triiiceratops 0.7.2 → 0.8.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,42 +1,42 @@
1
- var ft = Object.defineProperty;
2
- var qe = (i) => {
3
- throw TypeError(i);
1
+ var ht = Object.defineProperty;
2
+ var Qe = (s) => {
3
+ throw TypeError(s);
4
4
  };
5
- var ut = (i, t, r) => t in i ? ft(i, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : i[t] = r;
6
- var Ve = (i, t, r) => ut(i, typeof t != "symbol" ? t + "" : t, r), gt = (i, t, r) => t.has(i) || qe("Cannot " + r);
7
- var P = (i, t, r) => (gt(i, t, "read from private field"), r ? r.call(i) : t.get(i)), K = (i, t, r) => t.has(i) ? qe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, r);
5
+ var vt = (s, t, r) => t in s ? ht(s, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : s[t] = r;
6
+ var Ne = (s, t, r) => vt(s, typeof t != "symbol" ? t + "" : t, r), pt = (s, t, r) => t.has(s) || Qe("Cannot " + r);
7
+ var M = (s, t, r) => (pt(s, t, "read from private field"), r ? r.call(s) : t.get(s)), ee = (s, t, r) => t.has(s) ? Qe("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(s) : t.set(s, r);
8
8
  import "svelte/internal/disclose-version";
9
9
  import * as e from "svelte/internal/client";
10
- import { onMount as vt, getContext as fe, setContext as ht, onDestroy as pt } from "svelte";
11
- import * as mt from "manifesto.js";
12
- import Qe from "openseadragon";
13
- import bt from "phosphor-svelte/lib/CaretLeft";
14
- import _t from "phosphor-svelte/lib/CaretRight";
15
- import { m as E, l as yt } from "./plugin-DMqSBxJD.js";
16
- import { B as Ei } from "./plugin-DMqSBxJD.js";
17
- import wt from "phosphor-svelte/lib/CaretDown";
18
- import We from "phosphor-svelte/lib/Eye";
10
+ import { onMount as mt, getContext as he, untrack as bt, setContext as _t, onDestroy as yt } from "svelte";
11
+ import * as wt from "manifesto.js";
12
+ import We from "openseadragon";
13
+ import xt from "phosphor-svelte/lib/CaretLeft";
14
+ import St from "phosphor-svelte/lib/CaretRight";
15
+ import { m as $, l as At } from "./plugin-DMqSBxJD.js";
16
+ import { B as Ns } from "./plugin-DMqSBxJD.js";
17
+ import It from "phosphor-svelte/lib/CaretDown";
18
+ import Je from "phosphor-svelte/lib/Eye";
19
19
  import Ue from "phosphor-svelte/lib/EyeSlash";
20
- import Xe from "phosphor-svelte/lib/X";
21
- import xt from "phosphor-svelte/lib/ChatCenteredText";
22
- import St from "phosphor-svelte/lib/CornersIn";
23
- import At from "phosphor-svelte/lib/CornersOut";
24
- import It from "phosphor-svelte/lib/Info";
25
- import Ze from "phosphor-svelte/lib/MagnifyingGlass";
26
- import Ct from "phosphor-svelte/lib/List";
27
- import kt from "phosphor-svelte/lib/Slideshow";
28
- import Pt from "phosphor-svelte/lib/PuzzlePiece";
20
+ import qe from "phosphor-svelte/lib/X";
21
+ import Ct from "phosphor-svelte/lib/ChatCenteredText";
22
+ import kt from "phosphor-svelte/lib/CornersIn";
23
+ import Pt from "phosphor-svelte/lib/CornersOut";
24
+ import Mt from "phosphor-svelte/lib/Info";
25
+ import et from "phosphor-svelte/lib/MagnifyingGlass";
26
+ import Tt from "phosphor-svelte/lib/List";
27
+ import zt from "phosphor-svelte/lib/Slideshow";
28
+ import jt from "phosphor-svelte/lib/PuzzlePiece";
29
29
  import "phosphor-svelte/lib/Spinner";
30
- var ge;
31
- class Mt {
30
+ var ve;
31
+ class Lt {
32
32
  constructor() {
33
- K(this, ge, e.state(e.proxy({})));
33
+ ee(this, ve, e.state(e.proxy({})));
34
34
  }
35
35
  get manifests() {
36
- return e.get(P(this, ge));
36
+ return e.get(M(this, ve));
37
37
  }
38
38
  set manifests(t) {
39
- e.set(P(this, ge), t, !0);
39
+ e.set(M(this, ve), t, !0);
40
40
  }
41
41
  async fetchManifest(t) {
42
42
  if (!this.manifests[t]) {
@@ -45,8 +45,8 @@ class Mt {
45
45
  const r = await fetch(t);
46
46
  if (!r.ok)
47
47
  throw new Error(`HTTP error! status: ${r.status}`);
48
- const s = await r.json(), n = mt.parseManifest(s);
49
- this.manifests[t] = { json: s, manifesto: n, isFetching: !1 };
48
+ const i = await r.json(), n = wt.parseManifest(i);
49
+ this.manifests[t] = { json: i, manifesto: n, isFetching: !1 };
50
50
  } catch (r) {
51
51
  this.manifests[t] = { error: r.message, isFetching: !1 };
52
52
  }
@@ -61,8 +61,8 @@ class Mt {
61
61
  try {
62
62
  const r = await fetch(t);
63
63
  if (r.ok) {
64
- const s = await r.json();
65
- this.manifests[t] = { json: s };
64
+ const i = await r.json();
65
+ this.manifests[t] = { json: i };
66
66
  } else
67
67
  console.error(`Failed to fetch annotation list: ${t}`);
68
68
  } catch (r) {
@@ -73,162 +73,162 @@ class Mt {
73
73
  const r = this.getManifest(t);
74
74
  if (!r)
75
75
  return [];
76
- const s = r.getSequences();
77
- return !s || !s.length ? [] : s[0].getCanvases();
76
+ const i = r.getSequences();
77
+ return !i || !i.length ? [] : i[0].getCanvases();
78
78
  }
79
79
  getAnnotations(t, r) {
80
- const s = this.getManifest(t);
81
- return s ? s.getSequences()[0].getCanvasById(r) ? this.manualGetAnnotations(t, r) : [] : [];
80
+ const i = this.getManifest(t);
81
+ return i ? i.getSequences()[0].getCanvasById(r) ? this.manualGetAnnotations(t, r) : [] : [];
82
82
  }
83
83
  // We can refactor this to use Manifesto's resource handling later if needed.
84
84
  manualGetAnnotations(t, r) {
85
- const s = this.getManifest(t);
86
- if (!s) return [];
87
- const n = s.getSequences()[0].getCanvasById(r);
85
+ const i = this.getManifest(t);
86
+ if (!i) return [];
87
+ const n = i.getSequences()[0].getCanvasById(r);
88
88
  if (!n) return [];
89
89
  const a = n.__jsonld;
90
- let C = [];
91
- const m = (y) => y.resources || y.items || [];
92
- return a.otherContent && a.otherContent.forEach((y) => {
93
- const M = y["@id"] || y.id;
94
- if (M && !y.resources) {
95
- const g = this.manifests[M];
96
- if (g) {
97
- if (g.json) {
98
- const O = m(g.json);
99
- C.push(...O);
90
+ let P = [];
91
+ const p = (_) => _.resources || _.items || [];
92
+ return a.otherContent && a.otherContent.forEach((_) => {
93
+ const z = _["@id"] || _.id;
94
+ if (z && !_.resources) {
95
+ const E = this.manifests[z];
96
+ if (E) {
97
+ if (E.json) {
98
+ const f = p(E.json);
99
+ P.push(...f);
100
100
  }
101
101
  } else
102
- this.fetchAnnotationList(M);
103
- } else y.resources && C.push(...y.resources);
104
- }), a.annotations && a.annotations.forEach((y) => {
105
- const M = y.id || y["@id"];
106
- if (M && !y.items) {
107
- const g = this.manifests[M];
108
- if (g) {
109
- if (g.json) {
110
- const O = m(g.json);
111
- C.push(...O);
102
+ this.fetchAnnotationList(z);
103
+ } else _.resources && P.push(..._.resources);
104
+ }), a.annotations && a.annotations.forEach((_) => {
105
+ const z = _.id || _["@id"];
106
+ if (z && !_.items) {
107
+ const E = this.manifests[z];
108
+ if (E) {
109
+ if (E.json) {
110
+ const f = p(E.json);
111
+ P.push(...f);
112
112
  }
113
113
  } else
114
- this.fetchAnnotationList(M);
115
- } else y.items && C.push(...y.items);
116
- }), C;
114
+ this.fetchAnnotationList(z);
115
+ } else _.items && P.push(..._.items);
116
+ }), P;
117
117
  }
118
118
  }
119
- ge = new WeakMap();
120
- const le = new Mt();
121
- var ve, he, pe, me, be, _e, ye, we, xe, Se, Ae, Ie, Ce, ke, Pe, Me, Te, ze, je, Le, Re, De, Ge, Oe, Be, Ee;
122
- class Tt {
123
- constructor(t = null, r = null, s = []) {
124
- K(this, ve, e.state(null));
125
- K(this, he, e.state(null));
126
- K(this, pe, e.state(!1));
127
- K(this, me, e.state(!1));
128
- K(this, be, e.state(!1));
129
- K(this, _e, e.state(!1));
130
- K(this, ye, e.state(!1));
131
- K(this, we, e.state(!1));
132
- K(this, xe, e.state("bottom"));
133
- K(this, Se, e.state(e.proxy(/* @__PURE__ */ new Set())));
134
- K(this, Ae, e.state(e.proxy({})));
135
- K(
119
+ ve = new WeakMap();
120
+ const fe = new Lt();
121
+ var pe, me, be, _e, ye, we, xe, Se, Ae, Ie, Ce, ke, Pe, Me, Te, ze, je, Le, Be, De, Re, Oe, Ge, $e, Ee, Fe;
122
+ class Bt {
123
+ constructor(t = null, r = null, i = []) {
124
+ ee(this, pe, e.state(null));
125
+ ee(this, me, e.state(null));
126
+ ee(this, be, e.state(!1));
127
+ ee(this, _e, e.state(!1));
128
+ ee(this, ye, e.state(!1));
129
+ ee(this, we, e.state(!1));
130
+ ee(this, xe, e.state(!1));
131
+ ee(this, Se, e.state(!1));
132
+ ee(this, Ae, e.state("bottom"));
133
+ ee(this, Ie, e.state(e.proxy(/* @__PURE__ */ new Set())));
134
+ ee(this, Ce, e.state(e.proxy({})));
135
+ ee(
136
136
  this,
137
- Ie,
137
+ ke,
138
138
  // Gallery State (Lifted for persistence during re-docking)
139
139
  e.state(e.proxy({ x: 20, y: 100 }))
140
140
  );
141
- K(this, Ce, e.state(e.proxy({ width: 300, height: 400 })));
142
- K(this, ke, e.state(!1));
143
- K(this, Pe, e.state(e.proxy({ x: 0, y: 0 })));
144
- K(this, Me, e.state(null));
145
- K(this, Te, e.state(null));
146
- Ve(this, "eventTarget", null);
147
- K(this, ze, e.state(""));
148
- K(this, je, e.state(e.proxy([])));
149
- K(this, Le, e.state(!1));
150
- K(this, Re, e.state(!1));
151
- K(this, De, e.state(e.proxy([])));
152
- K(
141
+ ee(this, Pe, e.state(e.proxy({ width: 300, height: 400 })));
142
+ ee(this, Me, e.state(!1));
143
+ ee(this, Te, e.state(e.proxy({ x: 0, y: 0 })));
144
+ ee(this, ze, e.state(null));
145
+ ee(this, je, e.state(null));
146
+ Ne(this, "eventTarget", null);
147
+ ee(this, Le, e.state(""));
148
+ ee(this, Be, e.state(e.proxy([])));
149
+ ee(this, De, e.state(!1));
150
+ ee(this, Re, e.state(!1));
151
+ ee(this, Oe, e.state(e.proxy([])));
152
+ ee(
153
153
  this,
154
154
  Ge,
155
155
  // ==================== PLUGIN STATE ====================
156
156
  /** Registered plugins */
157
157
  e.state(e.proxy([]))
158
158
  );
159
- K(this, Oe, e.state(e.proxy([])));
160
- K(this, Be, e.state(e.proxy([])));
161
- K(this, Ee, e.state(null));
162
- Ve(this, "pluginEventHandlers", /* @__PURE__ */ new Map());
163
- this.manifestId = t || null, this.canvasId = r || null, this.manifestId && le.fetchManifest(this.manifestId);
164
- for (const n of s)
159
+ ee(this, $e, e.state(e.proxy([])));
160
+ ee(this, Ee, e.state(e.proxy([])));
161
+ ee(this, Fe, e.state(null));
162
+ Ne(this, "pluginEventHandlers", /* @__PURE__ */ new Map());
163
+ this.manifestId = t || null, this.canvasId = r || null, this.manifestId && fe.fetchManifest(this.manifestId);
164
+ for (const n of i)
165
165
  this.registerPlugin(n);
166
166
  }
167
167
  get manifestId() {
168
- return e.get(P(this, ve));
168
+ return e.get(M(this, pe));
169
169
  }
170
170
  set manifestId(t) {
171
- e.set(P(this, ve), t, !0);
171
+ e.set(M(this, pe), t, !0);
172
172
  }
173
173
  get canvasId() {
174
- return e.get(P(this, he));
174
+ return e.get(M(this, me));
175
175
  }
176
176
  set canvasId(t) {
177
- e.set(P(this, he), t, !0);
177
+ e.set(M(this, me), t, !0);
178
178
  }
179
179
  get showAnnotations() {
180
- return e.get(P(this, pe));
180
+ return e.get(M(this, be));
181
181
  }
182
182
  set showAnnotations(t) {
183
- e.set(P(this, pe), t, !0);
183
+ e.set(M(this, be), t, !0);
184
184
  }
185
185
  get showThumbnailGallery() {
186
- return e.get(P(this, me));
186
+ return e.get(M(this, _e));
187
187
  }
188
188
  set showThumbnailGallery(t) {
189
- e.set(P(this, me), t, !0);
189
+ e.set(M(this, _e), t, !0);
190
190
  }
191
191
  get isGalleryDockedBottom() {
192
- return e.get(P(this, be));
192
+ return e.get(M(this, ye));
193
193
  }
194
194
  set isGalleryDockedBottom(t) {
195
- e.set(P(this, be), t, !0);
195
+ e.set(M(this, ye), t, !0);
196
196
  }
197
197
  get isGalleryDockedRight() {
198
- return e.get(P(this, _e));
198
+ return e.get(M(this, we));
199
199
  }
200
200
  set isGalleryDockedRight(t) {
201
- e.set(P(this, _e), t, !0);
201
+ e.set(M(this, we), t, !0);
202
202
  }
203
203
  get isFullScreen() {
204
- return e.get(P(this, ye));
204
+ return e.get(M(this, xe));
205
205
  }
206
206
  set isFullScreen(t) {
207
- e.set(P(this, ye), t, !0);
207
+ e.set(M(this, xe), t, !0);
208
208
  }
209
209
  get showMetadataDialog() {
210
- return e.get(P(this, we));
210
+ return e.get(M(this, Se));
211
211
  }
212
212
  set showMetadataDialog(t) {
213
- e.set(P(this, we), t, !0);
213
+ e.set(M(this, Se), t, !0);
214
214
  }
215
215
  get dockSide() {
216
- return e.get(P(this, xe));
216
+ return e.get(M(this, Ae));
217
217
  }
218
218
  set dockSide(t) {
219
- e.set(P(this, xe), t, !0);
219
+ e.set(M(this, Ae), t, !0);
220
220
  }
221
221
  get visibleAnnotationIds() {
222
- return e.get(P(this, Se));
222
+ return e.get(M(this, Ie));
223
223
  }
224
224
  set visibleAnnotationIds(t) {
225
- e.set(P(this, Se), t, !0);
225
+ e.set(M(this, Ie), t, !0);
226
226
  }
227
227
  get config() {
228
- return e.get(P(this, Ae));
228
+ return e.get(M(this, Ce));
229
229
  }
230
230
  set config(t) {
231
- e.set(P(this, Ae), t, !0);
231
+ e.set(M(this, Ce), t, !0);
232
232
  }
233
233
  get showRightMenu() {
234
234
  return this.config.showRightMenu ?? !0;
@@ -240,40 +240,40 @@ class Tt {
240
240
  return this.config.showCanvasNav ?? !0;
241
241
  }
242
242
  get galleryPosition() {
243
- return e.get(P(this, Ie));
243
+ return e.get(M(this, ke));
244
244
  }
245
245
  set galleryPosition(t) {
246
- e.set(P(this, Ie), t, !0);
246
+ e.set(M(this, ke), t, !0);
247
247
  }
248
248
  get gallerySize() {
249
- return e.get(P(this, Ce));
249
+ return e.get(M(this, Pe));
250
250
  }
251
251
  set gallerySize(t) {
252
- e.set(P(this, Ce), t, !0);
252
+ e.set(M(this, Pe), t, !0);
253
253
  }
254
254
  get isGalleryDragging() {
255
- return e.get(P(this, ke));
255
+ return e.get(M(this, Me));
256
256
  }
257
257
  set isGalleryDragging(t) {
258
- e.set(P(this, ke), t, !0);
258
+ e.set(M(this, Me), t, !0);
259
259
  }
260
260
  get galleryDragOffset() {
261
- return e.get(P(this, Pe));
261
+ return e.get(M(this, Te));
262
262
  }
263
263
  set galleryDragOffset(t) {
264
- e.set(P(this, Pe), t, !0);
264
+ e.set(M(this, Te), t, !0);
265
265
  }
266
266
  get dragOverSide() {
267
- return e.get(P(this, Me));
267
+ return e.get(M(this, ze));
268
268
  }
269
269
  set dragOverSide(t) {
270
- e.set(P(this, Me), t, !0);
270
+ e.set(M(this, ze), t, !0);
271
271
  }
272
272
  get galleryCenterPanelRect() {
273
- return e.get(P(this, Te));
273
+ return e.get(M(this, je));
274
274
  }
275
275
  set galleryCenterPanelRect(t) {
276
- e.set(P(this, Te), t, !0);
276
+ e.set(M(this, je), t, !0);
277
277
  }
278
278
  setEventTarget(t) {
279
279
  this.eventTarget = t;
@@ -286,13 +286,14 @@ class Tt {
286
286
  */
287
287
  getSnapshot() {
288
288
  let t = -1;
289
- return this.manifestId && this.canvasId && (t = le.getCanvases(this.manifestId).findIndex((s) => s.id === this.canvasId)), {
289
+ return this.manifestId && this.canvasId && (t = fe.getCanvases(this.manifestId).findIndex((i) => i.id === this.canvasId)), {
290
290
  manifestId: this.manifestId,
291
291
  canvasId: this.canvasId,
292
292
  currentCanvasIndex: t,
293
293
  showAnnotations: this.showAnnotations,
294
294
  showThumbnailGallery: this.showThumbnailGallery,
295
295
  showSearchPanel: this.showSearchPanel,
296
+ searchQuery: this.searchQuery,
296
297
  isFullScreen: this.isFullScreen,
297
298
  dockSide: this.dockSide
298
299
  };
@@ -305,17 +306,17 @@ class Tt {
305
306
  * reactive cycle completes, preventing infinite update loops.
306
307
  */
307
308
  dispatchStateChange(t = "statechange") {
308
- this.eventTarget && queueMicrotask(() => {
309
+ console.log(`[ViewerState] Dispatching ${t}`, JSON.stringify(this.getSnapshot())), this.eventTarget && queueMicrotask(() => {
309
310
  var r;
310
311
  (r = this.eventTarget) == null || r.dispatchEvent(new CustomEvent(t, { detail: this.getSnapshot(), bubbles: !0, composed: !0 }));
311
312
  });
312
313
  }
313
314
  get manifest() {
314
- return this.manifestId ? le.getManifest(this.manifestId) : null;
315
+ return this.manifestId ? fe.getManifest(this.manifestId) : null;
315
316
  }
316
317
  get canvases() {
317
318
  if (!this.manifestId) return [];
318
- const t = le.getCanvases(this.manifestId);
319
+ const t = fe.getCanvases(this.manifestId);
319
320
  return t.length > 0 && !this.canvasId && setTimeout(
320
321
  () => {
321
322
  !this.canvasId && t.length > 0 && (this.canvasId = t[0].id);
@@ -345,13 +346,20 @@ class Tt {
345
346
  }
346
347
  }
347
348
  setManifest(t) {
348
- this.manifestId = t, this.canvasId = null, le.fetchManifest(t), this.dispatchStateChange("manifestchange");
349
+ this.manifestId = t, this.canvasId = null, fe.fetchManifest(t), this.dispatchStateChange("manifestchange");
349
350
  }
350
351
  setCanvas(t) {
351
352
  this.canvasId = t, this.dispatchStateChange("canvaschange");
352
353
  }
353
354
  updateConfig(t) {
354
- this.config = t, t.gallery && (t.gallery.open !== void 0 && (this.showThumbnailGallery = t.gallery.open), t.gallery.dockPosition !== void 0 && (this.dockSide = t.gallery.dockPosition)), t.search && t.search.open !== void 0 && (this.showSearchPanel = t.search.open), t.annotations && t.annotations.open !== void 0 && (this.showAnnotations = t.annotations.open);
355
+ var i;
356
+ const r = this.config;
357
+ if (this.config = t, t.gallery && (t.gallery.open !== void 0 && (this.showThumbnailGallery = t.gallery.open), t.gallery.dockPosition !== void 0 && (this.dockSide = t.gallery.dockPosition)), t.search) {
358
+ t.search.open !== void 0 && (this.showSearchPanel = t.search.open);
359
+ const n = t.search.query, a = (i = r.search) == null ? void 0 : i.query;
360
+ n !== void 0 && n !== a && n !== this.searchQuery && this._performSearch(n);
361
+ }
362
+ t.annotations && t.annotations.open !== void 0 && (this.showAnnotations = t.annotations.open);
355
363
  }
356
364
  toggleAnnotations() {
357
365
  this.showAnnotations = !this.showAnnotations, this.dispatchStateChange();
@@ -373,128 +381,144 @@ class Tt {
373
381
  this.showMetadataDialog = !this.showMetadataDialog;
374
382
  }
375
383
  get searchQuery() {
376
- return e.get(P(this, ze));
384
+ return e.get(M(this, Le));
377
385
  }
378
386
  set searchQuery(t) {
379
- e.set(P(this, ze), t, !0);
387
+ e.set(M(this, Le), t, !0);
380
388
  }
381
389
  get searchResults() {
382
- return e.get(P(this, je));
390
+ return e.get(M(this, Be));
383
391
  }
384
392
  set searchResults(t) {
385
- e.set(P(this, je), t, !0);
393
+ e.set(M(this, Be), t, !0);
386
394
  }
387
395
  get isSearching() {
388
- return e.get(P(this, Le));
396
+ return e.get(M(this, De));
389
397
  }
390
398
  set isSearching(t) {
391
- e.set(P(this, Le), t, !0);
399
+ e.set(M(this, De), t, !0);
392
400
  }
393
401
  get showSearchPanel() {
394
- return e.get(P(this, Re));
402
+ return e.get(M(this, Re));
395
403
  }
396
404
  set showSearchPanel(t) {
397
- e.set(P(this, Re), t, !0);
405
+ e.set(M(this, Re), t, !0);
398
406
  }
399
407
  toggleSearchPanel() {
400
408
  this.showSearchPanel = !this.showSearchPanel, this.showSearchPanel || (this.searchAnnotations = []), this.dispatchStateChange();
401
409
  }
402
410
  get searchAnnotations() {
403
- return e.get(P(this, De));
411
+ return e.get(M(this, Oe));
404
412
  }
405
413
  set searchAnnotations(t) {
406
- e.set(P(this, De), t, !0);
414
+ e.set(M(this, Oe), t, !0);
407
415
  }
408
416
  get currentCanvasSearchAnnotations() {
409
417
  return this.canvasId ? this.searchAnnotations.filter((t) => t.canvasId === this.canvasId) : [];
410
418
  }
411
419
  async search(t) {
412
- var r, s;
420
+ this.dispatchStateChange(), await this._performSearch(t), this.dispatchStateChange();
421
+ }
422
+ async _performSearch(t) {
423
+ var r, i;
413
424
  if (t.trim()) {
414
425
  this.isSearching = !0, this.searchQuery = t, this.searchResults = [];
415
426
  try {
416
427
  const n = this.manifest;
417
428
  if (!n) throw new Error("No manifest loaded");
418
429
  let a = n.getService("http://iiif.io/api/search/1/search") || n.getService("http://iiif.io/api/search/0/search");
419
- if (a || n.__jsonld && n.__jsonld.service && (a = (Array.isArray(n.__jsonld.service) ? n.__jsonld.service : [n.__jsonld.service]).find((k) => k.profile === "http://iiif.io/api/search/1/search" || k.profile === "http://iiif.io/api/search/0/search")), !a) {
430
+ if (a || n.__jsonld && n.__jsonld.service && (a = (Array.isArray(n.__jsonld.service) ? n.__jsonld.service : [n.__jsonld.service]).find((v) => v.profile === "http://iiif.io/api/search/1/search" || v.profile === "http://iiif.io/api/search/0/search")), !a) {
420
431
  console.warn("No IIIF search service found in manifest"), this.isSearching = !1;
421
432
  return;
422
433
  }
423
- const m = `${a.id || a["@id"]}?q=${encodeURIComponent(t)}`, y = await fetch(m);
424
- if (!y.ok) throw new Error("Search request failed");
425
- const M = await y.json(), g = M.resources || [], O = [], v = (p) => {
426
- const k = typeof p == "string" ? p : p["@id"] || p.id;
427
- if (!k) return null;
428
- const h = k.split("#xywh=");
429
- if (h.length < 2) return null;
430
- const l = h[1].split(",").map(Number);
431
- return l.length === 4 ? l : null;
434
+ const p = `${a.id || a["@id"]}?q=${encodeURIComponent(t)}`, _ = await fetch(p);
435
+ if (!_.ok) throw new Error("Search request failed");
436
+ const z = await _.json(), E = z.resources || [], f = [], g = (w) => {
437
+ const v = typeof w == "string" ? w : w["@id"] || w.id;
438
+ if (!v) return null;
439
+ const l = v.split("#xywh=");
440
+ if (l.length < 2) return null;
441
+ const o = l[1].split(",").map(Number);
442
+ return o.length === 4 ? o : null;
432
443
  };
433
- if (M.hits)
434
- for (const p of M.hits) {
435
- const k = p.annotations || [];
436
- for (const h of k) {
437
- const l = g.find((c) => c["@id"] === h || c.id === h);
438
- if (l && l.on) {
439
- const c = typeof l.on == "string" ? l.on : l.on["@id"] || l.on.id, R = c.split("#")[0], T = v(c), u = this.canvases.findIndex((A) => A.id === R);
440
- if (u >= 0) {
441
- const A = this.canvases[u];
442
- let $ = "Canvas " + (u + 1);
443
- try {
444
- if (A.getLabel) {
445
- const d = A.getLabel();
446
- Array.isArray(d) && d.length > 0 ? $ = d[0].value : typeof d == "string" && ($ = d);
447
- } else A.label && (typeof A.label == "string" ? $ = A.label : Array.isArray(A.label) && ($ = (r = A.label[0]) == null ? void 0 : r.value));
448
- } catch {
444
+ if (z.hits)
445
+ for (const w of z.hits) {
446
+ const v = w.annotations || [], l = /* @__PURE__ */ new Map();
447
+ for (const o of v) {
448
+ const C = E.find((x) => x["@id"] === o || x.id === o);
449
+ if (C && C.on) {
450
+ const x = typeof C.on == "string" ? C.on : C.on["@id"] || C.on.id, h = x.split("#")[0], I = g(x), G = this.canvases.findIndex((d) => d.id === h);
451
+ if (G >= 0) {
452
+ if (!l.has(G)) {
453
+ const d = this.canvases[G];
454
+ let A = "Canvas " + (G + 1);
455
+ try {
456
+ if (d.getLabel) {
457
+ const y = d.getLabel();
458
+ Array.isArray(y) && y.length > 0 ? A = y[0].value : typeof y == "string" && (A = y);
459
+ } else d.label && (typeof d.label == "string" ? A = d.label : Array.isArray(d.label) && (A = (r = d.label[0]) == null ? void 0 : r.value));
460
+ } catch {
461
+ }
462
+ l.set(G, { label: String(A), bounds: [] });
449
463
  }
450
- O.push({
451
- type: "hit",
452
- before: p.before,
453
- match: p.match,
454
- after: p.after,
455
- canvasIndex: u,
456
- canvasLabel: String($),
457
- bounds: T
458
- });
464
+ I && l.get(G).bounds.push(I);
459
465
  }
460
466
  }
461
467
  }
468
+ for (const [o, C] of l)
469
+ f.push({
470
+ type: "hit",
471
+ before: w.before,
472
+ match: w.match,
473
+ after: w.after,
474
+ canvasIndex: o,
475
+ canvasLabel: C.label,
476
+ // Store all bounds for this hit on this canvas
477
+ allBounds: C.bounds,
478
+ // Keep first bounds for backwards compatibility
479
+ bounds: C.bounds.length > 0 ? C.bounds[0] : null
480
+ });
462
481
  }
463
- else if (g.length > 0)
464
- for (const p of g) {
465
- const k = typeof p.on == "string" ? p.on : p.on["@id"] || p.on.id, h = k.split("#")[0], l = v(k), c = this.canvases.findIndex((R) => R.id === h);
466
- if (c >= 0) {
467
- const R = this.canvases[c];
468
- let T = "Canvas " + (c + 1);
482
+ else if (E.length > 0)
483
+ for (const w of E) {
484
+ const v = typeof w.on == "string" ? w.on : w.on["@id"] || w.on.id, l = v.split("#")[0], o = g(v), C = this.canvases.findIndex((x) => x.id === l);
485
+ if (C >= 0) {
486
+ const x = this.canvases[C];
487
+ let h = "Canvas " + (C + 1);
469
488
  try {
470
- if (R.getLabel) {
471
- const u = R.getLabel();
472
- Array.isArray(u) && u.length > 0 ? T = u[0].value : typeof u == "string" && (T = u);
473
- } else R.label && (typeof R.label == "string" ? T = R.label : Array.isArray(R.label) && (T = (s = R.label[0]) == null ? void 0 : s.value));
489
+ if (x.getLabel) {
490
+ const I = x.getLabel();
491
+ Array.isArray(I) && I.length > 0 ? h = I[0].value : typeof I == "string" && (h = I);
492
+ } else x.label && (typeof x.label == "string" ? h = x.label : Array.isArray(x.label) && (h = (i = x.label[0]) == null ? void 0 : i.value));
474
493
  } catch {
475
494
  }
476
- O.push({
495
+ f.push({
477
496
  type: "resource",
478
- match: p.resource && p.resource.chars ? p.resource.chars : p.chars || "",
479
- canvasIndex: c,
480
- canvasLabel: String(T),
481
- bounds: l
497
+ match: w.resource && w.resource.chars ? w.resource.chars : w.chars || "",
498
+ canvasIndex: C,
499
+ canvasLabel: String(h),
500
+ bounds: o
482
501
  });
483
502
  }
484
503
  }
485
- this.searchResults = O, this.searchAnnotations = O.filter((p) => p.bounds).map((p, k) => {
486
- const h = this.canvases[p.canvasIndex], l = `${h.id}#xywh=${p.bounds.join(",")}`;
487
- return {
488
- "@id": `urn:search-hit:${k}`,
489
- "@type": "oa:Annotation",
490
- motivation: "sc:painting",
491
- on: l,
492
- canvasId: h.id,
493
- resource: { "@type": "cnt:ContentAsText", chars: p.match },
494
- // Flag to identify styling in Overlay?
495
- // Or just standard rendering.
496
- isSearchHit: !0
497
- };
504
+ this.searchResults = f;
505
+ let D = 0;
506
+ this.searchAnnotations = f.flatMap((w) => {
507
+ const v = this.canvases[w.canvasIndex];
508
+ return (w.allBounds && w.allBounds.length > 0 ? w.allBounds : w.bounds ? [w.bounds] : []).map((o) => {
509
+ const C = `${v.id}#xywh=${o.join(",")}`;
510
+ return {
511
+ "@id": `urn:search-hit:${D++}`,
512
+ "@type": "oa:Annotation",
513
+ motivation: "sc:painting",
514
+ on: C,
515
+ canvasId: v.id,
516
+ resource: { "@type": "cnt:ContentAsText", chars: w.match },
517
+ // Flag to identify styling in Overlay?
518
+ // Or just standard rendering.
519
+ isSearchHit: !0
520
+ };
521
+ });
498
522
  });
499
523
  } catch (n) {
500
524
  console.error("Search error:", n);
@@ -504,28 +528,28 @@ class Tt {
504
528
  }
505
529
  }
506
530
  get plugins() {
507
- return e.get(P(this, Ge));
531
+ return e.get(M(this, Ge));
508
532
  }
509
533
  set plugins(t) {
510
- e.set(P(this, Ge), t, !0);
534
+ e.set(M(this, Ge), t, !0);
511
535
  }
512
536
  get pluginMenuButtons() {
513
- return e.get(P(this, Oe));
537
+ return e.get(M(this, $e));
514
538
  }
515
539
  set pluginMenuButtons(t) {
516
- e.set(P(this, Oe), t, !0);
540
+ e.set(M(this, $e), t, !0);
517
541
  }
518
542
  get pluginPanels() {
519
- return e.get(P(this, Be));
543
+ return e.get(M(this, Ee));
520
544
  }
521
545
  set pluginPanels(t) {
522
- e.set(P(this, Be), t, !0);
546
+ e.set(M(this, Ee), t, !0);
523
547
  }
524
548
  get osdViewer() {
525
- return e.get(P(this, Ee));
549
+ return e.get(M(this, Fe));
526
550
  }
527
551
  set osdViewer(t) {
528
- e.set(P(this, Ee), t, !0);
552
+ e.set(M(this, Fe), t, !0);
529
553
  }
530
554
  createPluginContext() {
531
555
  const t = this;
@@ -533,25 +557,25 @@ class Tt {
533
557
  viewerState: t,
534
558
  getOSDViewer: () => t.osdViewer,
535
559
  registerMenuButton(r) {
536
- t.pluginMenuButtons.find((s) => s.id === r.id) || (t.pluginMenuButtons = [...t.pluginMenuButtons, r]);
560
+ t.pluginMenuButtons.find((i) => i.id === r.id) || (t.pluginMenuButtons = [...t.pluginMenuButtons, r]);
537
561
  },
538
562
  unregisterMenuButton(r) {
539
- t.pluginMenuButtons = t.pluginMenuButtons.filter((s) => s.id !== r);
563
+ t.pluginMenuButtons = t.pluginMenuButtons.filter((i) => i.id !== r);
540
564
  },
541
565
  registerPanel(r) {
542
- t.pluginPanels.find((s) => s.id === r.id) || (t.pluginPanels = [...t.pluginPanels, r]);
566
+ t.pluginPanels.find((i) => i.id === r.id) || (t.pluginPanels = [...t.pluginPanels, r]);
543
567
  },
544
568
  unregisterPanel(r) {
545
- t.pluginPanels = t.pluginPanels.filter((s) => s.id !== r);
569
+ t.pluginPanels = t.pluginPanels.filter((i) => i.id !== r);
546
570
  },
547
- emit(r, s) {
571
+ emit(r, i) {
548
572
  const n = t.pluginEventHandlers.get(r);
549
- n == null || n.forEach((a) => a(s));
573
+ n == null || n.forEach((a) => a(i));
550
574
  },
551
- on(r, s) {
552
- return t.pluginEventHandlers.has(r) || t.pluginEventHandlers.set(r, /* @__PURE__ */ new Set()), t.pluginEventHandlers.get(r).add(s), () => {
575
+ on(r, i) {
576
+ return t.pluginEventHandlers.has(r) || t.pluginEventHandlers.set(r, /* @__PURE__ */ new Set()), t.pluginEventHandlers.get(r).add(i), () => {
553
577
  var n;
554
- (n = t.pluginEventHandlers.get(r)) == null || n.delete(s);
578
+ (n = t.pluginEventHandlers.get(r)) == null || n.delete(i);
555
579
  };
556
580
  }
557
581
  };
@@ -570,9 +594,9 @@ class Tt {
570
594
  * Unregister a plugin by ID.
571
595
  */
572
596
  unregisterPlugin(t) {
573
- var s;
597
+ var i;
574
598
  const r = this.plugins.find((n) => n.id === t);
575
- 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}:`)));
599
+ r && ((i = r.onDestroy) == null || i.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}:`)));
576
600
  }
577
601
  /**
578
602
  * Called by OSDViewer when OpenSeadragon is ready.
@@ -580,8 +604,8 @@ class Tt {
580
604
  notifyOSDReady(t) {
581
605
  var r;
582
606
  this.osdViewer = t;
583
- for (const s of this.plugins)
584
- (r = s.onViewerReady) == null || r.call(s, t);
607
+ for (const i of this.plugins)
608
+ (r = i.onViewerReady) == null || r.call(i, t);
585
609
  }
586
610
  /**
587
611
  * Destroy all plugins (called on viewer unmount).
@@ -593,8 +617,8 @@ class Tt {
593
617
  this.plugins = [], this.pluginMenuButtons = [], this.pluginPanels = [], this.pluginEventHandlers.clear();
594
618
  }
595
619
  }
596
- 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(), Ce = new WeakMap(), ke = new WeakMap(), Pe = new WeakMap(), Me = new WeakMap(), Te = new WeakMap(), ze = new WeakMap(), je = new WeakMap(), Le = new WeakMap(), Re = new WeakMap(), De = new WeakMap(), Ge = new WeakMap(), Oe = new WeakMap(), Be = new WeakMap(), Ee = new WeakMap();
597
- const ce = "triiiceratops:viewerState", zt = [
620
+ 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(), Ce = new WeakMap(), ke = new WeakMap(), Pe = new WeakMap(), Me = new WeakMap(), Te = new WeakMap(), ze = new WeakMap(), je = new WeakMap(), Le = new WeakMap(), Be = new WeakMap(), De = new WeakMap(), Re = new WeakMap(), Oe = new WeakMap(), Ge = new WeakMap(), $e = new WeakMap(), Ee = new WeakMap(), Fe = new WeakMap();
621
+ const ue = "triiiceratops:viewerState", Dt = [
598
622
  "light",
599
623
  "dark",
600
624
  "cupcake",
@@ -631,87 +655,87 @@ const ce = "triiiceratops:viewerState", zt = [
631
655
  "abyss",
632
656
  "silk"
633
657
  ];
634
- function jt(i) {
635
- i = i.replace(/^#/, "");
636
- let t, r, s;
637
- if (i.length === 3)
638
- t = parseInt(i[0] + i[0], 16), r = parseInt(i[1] + i[1], 16), s = parseInt(i[2] + i[2], 16);
639
- else if (i.length === 6 || i.length === 8)
640
- t = parseInt(i.slice(0, 2), 16), r = parseInt(i.slice(2, 4), 16), s = parseInt(i.slice(4, 6), 16);
658
+ function Rt(s) {
659
+ s = s.replace(/^#/, "");
660
+ let t, r, i;
661
+ if (s.length === 3)
662
+ t = parseInt(s[0] + s[0], 16), r = parseInt(s[1] + s[1], 16), i = parseInt(s[2] + s[2], 16);
663
+ else if (s.length === 6 || s.length === 8)
664
+ t = parseInt(s.slice(0, 2), 16), r = parseInt(s.slice(2, 4), 16), i = parseInt(s.slice(4, 6), 16);
641
665
  else
642
666
  return null;
643
- return isNaN(t) || isNaN(r) || isNaN(s) ? null : { r: t, g: r, b: s };
667
+ return isNaN(t) || isNaN(r) || isNaN(i) ? null : { r: t, g: r, b: i };
644
668
  }
645
- function Lt(i) {
646
- const t = i.match(
669
+ function Ot(s) {
670
+ const t = s.match(
647
671
  /rgba?\(\s*(\d+(?:\.\d+)?%?)\s*[,\s]\s*(\d+(?:\.\d+)?%?)\s*[,\s]\s*(\d+(?:\.\d+)?%?)(?:\s*[,/]\s*(\d*\.?\d+%?))?\s*\)/i
648
672
  );
649
673
  if (!t) return null;
650
- const r = (C) => C.endsWith("%") ? parseFloat(C) / 100 * 255 : parseFloat(C), s = r(t[1]), n = r(t[2]), a = r(t[3]);
651
- return isNaN(s) || isNaN(n) || isNaN(a) ? null : { r: s, g: n, b: a };
674
+ const r = (P) => P.endsWith("%") ? parseFloat(P) / 100 * 255 : parseFloat(P), i = r(t[1]), n = r(t[2]), a = r(t[3]);
675
+ return isNaN(i) || isNaN(n) || isNaN(a) ? null : { r: i, g: n, b: a };
652
676
  }
653
- function Ne(i) {
654
- const t = i / 255;
677
+ function He(s) {
678
+ const t = s / 255;
655
679
  return t <= 0.04045 ? t / 12.92 : Math.pow((t + 0.055) / 1.055, 2.4);
656
680
  }
657
- function Rt(i, t, r) {
681
+ function Gt(s, t, r) {
658
682
  return {
659
- x: 0.4124564 * i + 0.3575761 * t + 0.1804375 * r,
660
- y: 0.2126729 * i + 0.7151522 * t + 0.072175 * r,
661
- z: 0.0193339 * i + 0.119192 * t + 0.9503041 * r
683
+ x: 0.4124564 * s + 0.3575761 * t + 0.1804375 * r,
684
+ y: 0.2126729 * s + 0.7151522 * t + 0.072175 * r,
685
+ z: 0.0193339 * s + 0.119192 * t + 0.9503041 * r
662
686
  };
663
687
  }
664
- function Dt(i, t, r) {
665
- 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, C = Math.cbrt(s), m = Math.cbrt(n), y = Math.cbrt(a);
688
+ function $t(s, t, r) {
689
+ const i = 0.8189330101 * s + 0.3618667424 * t - 0.1288597137 * r, n = 0.0329845436 * s + 0.9293118715 * t + 0.0361456387 * r, a = 0.0482003018 * s + 0.2643662691 * t + 0.633851707 * r, P = Math.cbrt(i), p = Math.cbrt(n), _ = Math.cbrt(a);
666
690
  return {
667
- L: 0.2104542553 * C + 0.793617785 * m - 0.0040720468 * y,
668
- a: 1.9779984951 * C - 2.428592205 * m + 0.4505937099 * y,
669
- b: 0.0259040371 * C + 0.7827717662 * m - 0.808675766 * y
691
+ L: 0.2104542553 * P + 0.793617785 * p - 0.0040720468 * _,
692
+ a: 1.9779984951 * P - 2.428592205 * p + 0.4505937099 * _,
693
+ b: 0.0259040371 * P + 0.7827717662 * p - 0.808675766 * _
670
694
  };
671
695
  }
672
- function Gt(i, t, r) {
673
- const s = Math.sqrt(t * t + r * r);
696
+ function Et(s, t, r) {
697
+ const i = Math.sqrt(t * t + r * r);
674
698
  let n = Math.atan2(r, t) * 180 / Math.PI;
675
- return n < 0 && (n += 360), { L: i, C: s, h: n };
699
+ return n < 0 && (n += 360), { L: s, C: i, h: n };
676
700
  }
677
- function et(i, t, r) {
678
- const s = Ne(i), n = Ne(t), a = Ne(r), { x: C, y: m, z: y } = Rt(s, n, a), { L: M, a: g, b: O } = Dt(C, m, y);
679
- return Gt(M, g, O);
701
+ function tt(s, t, r) {
702
+ const i = He(s), n = He(t), a = He(r), { x: P, y: p, z: _ } = Gt(i, n, a), { L: z, a: E, b: f } = $t(P, p, _);
703
+ return Et(z, E, f);
680
704
  }
681
- function tt(i, t, r) {
682
- const s = (i * 100).toFixed(2), n = t.toFixed(4), a = t < 1e-4 ? 0 : r.toFixed(2);
683
- return `oklch(${s}% ${n} ${a})`;
705
+ function rt(s, t, r) {
706
+ const i = (s * 100).toFixed(2), n = t.toFixed(4), a = t < 1e-4 ? 0 : r.toFixed(2);
707
+ return `oklch(${i}% ${n} ${a})`;
684
708
  }
685
- function Ot(i) {
686
- return i.trim().toLowerCase().startsWith("oklch(");
709
+ function Ft(s) {
710
+ return s.trim().toLowerCase().startsWith("oklch(");
687
711
  }
688
- function Bt(i) {
712
+ function Vt(s) {
689
713
  return /^#([0-9a-fA-F]{3}|[0-9a-fA-F]{6}|[0-9a-fA-F]{8})$/.test(
690
- i.trim()
714
+ s.trim()
691
715
  );
692
716
  }
693
- function Et(i) {
694
- return /^rgba?\s*\(/i.test(i.trim());
717
+ function Nt(s) {
718
+ return /^rgba?\s*\(/i.test(s.trim());
695
719
  }
696
- function $t(i) {
697
- const t = jt(i);
720
+ function Ht(s) {
721
+ const t = Rt(s);
698
722
  if (!t)
699
- return console.warn(`Invalid hex color: ${i}, returning as-is`), i;
700
- const { L: r, C: s, h: n } = et(t.r, t.g, t.b);
701
- return tt(r, s, n);
723
+ return console.warn(`Invalid hex color: ${s}, returning as-is`), s;
724
+ const { L: r, C: i, h: n } = tt(t.r, t.g, t.b);
725
+ return rt(r, i, n);
702
726
  }
703
- function Ft(i) {
704
- const t = Lt(i);
727
+ function Yt(s) {
728
+ const t = Ot(s);
705
729
  if (!t)
706
- return console.warn(`Invalid rgb color: ${i}, returning as-is`), i;
707
- const { L: r, C: s, h: n } = et(t.r, t.g, t.b);
708
- return tt(r, s, n);
730
+ return console.warn(`Invalid rgb color: ${s}, returning as-is`), s;
731
+ const { L: r, C: i, h: n } = tt(t.r, t.g, t.b);
732
+ return rt(r, i, n);
709
733
  }
710
- function Vt(i) {
711
- const t = i.trim();
712
- return Ot(t) ? t : Bt(t) ? $t(t) : Et(t) ? Ft(t) : (console.warn(`Unrecognized color format: ${i}, passing through as-is`), i);
734
+ function Xt(s) {
735
+ const t = s.trim();
736
+ return Ft(t) ? t : Vt(t) ? Ht(t) : Nt(t) ? Yt(t) : (console.warn(`Unrecognized color format: ${s}, passing through as-is`), s);
713
737
  }
714
- const rt = {
738
+ const st = {
715
739
  // Semantic colors
716
740
  primary: "--color-primary",
717
741
  primaryContent: "--color-primary-content",
@@ -749,7 +773,7 @@ const rt = {
749
773
  noise: "--noise",
750
774
  // Color scheme (handled specially, not a CSS variable)
751
775
  colorScheme: "color-scheme"
752
- }, Nt = /* @__PURE__ */ new Set([
776
+ }, qt = /* @__PURE__ */ new Set([
753
777
  "primary",
754
778
  "primaryContent",
755
779
  "secondary",
@@ -771,47 +795,47 @@ const rt = {
771
795
  "error",
772
796
  "errorContent"
773
797
  ]);
774
- function Di(i) {
775
- return zt.includes(i);
798
+ function $s(s) {
799
+ return Dt.includes(s);
776
800
  }
777
- function Ht(i, t) {
778
- i.setAttribute("data-theme", t);
801
+ function Qt(s, t) {
802
+ s.setAttribute("data-theme", t);
779
803
  }
780
- function Yt(i, t) {
781
- for (const [r, s] of Object.entries(t)) {
782
- if (s == null) continue;
804
+ function Wt(s, t) {
805
+ for (const [r, i] of Object.entries(t)) {
806
+ if (i == null) continue;
783
807
  const n = r;
784
808
  if (n === "colorScheme") {
785
- i.style.colorScheme = s;
809
+ s.style.colorScheme = i;
786
810
  continue;
787
811
  }
788
- const a = rt[n];
812
+ const a = st[n];
789
813
  if (!a) continue;
790
- let C = String(s);
791
- Nt.has(n) && (C = Vt(C)), i.style.setProperty(a, C);
814
+ let P = String(i);
815
+ qt.has(n) && (P = Xt(P)), s.style.setProperty(a, P);
792
816
  }
793
817
  }
794
- function Xt(i) {
795
- for (const [t, r] of Object.entries(rt))
796
- t === "colorScheme" ? i.style.colorScheme = "" : i.style.removeProperty(r);
818
+ function Jt(s) {
819
+ for (const [t, r] of Object.entries(st))
820
+ t === "colorScheme" ? s.style.colorScheme = "" : s.style.removeProperty(r);
797
821
  }
798
- function Gi(i) {
822
+ function Es(s) {
799
823
  try {
800
- const t = JSON.parse(i);
824
+ const t = JSON.parse(s);
801
825
  return typeof t == "object" && t !== null ? t : null;
802
826
  } catch {
803
827
  return null;
804
828
  }
805
829
  }
806
- function qt(i, t, r) {
807
- t ? Ht(i, t) : i.removeAttribute("data-theme"), r ? Yt(i, r) : Xt(i);
830
+ function Ut(s, t, r) {
831
+ t ? Qt(s, t) : s.removeAttribute("data-theme"), r ? Wt(s, r) : Jt(s);
808
832
  }
809
- function it(i) {
810
- return i.id || i["@id"] || (typeof i.getId == "function" ? i.getId() : "");
833
+ function it(s) {
834
+ return s.id || s["@id"] || (typeof s.getId == "function" ? s.getId() : "");
811
835
  }
812
- function He(i) {
813
- if (!i) return null;
814
- const t = i.match(/xywh=(\d+),(\d+),(\d+),(\d+)/);
836
+ function Ye(s) {
837
+ if (!s) return null;
838
+ const t = s.match(/xywh=(\d+),(\d+),(\d+),(\d+)/);
815
839
  return t ? {
816
840
  x: parseInt(t[1], 10),
817
841
  y: parseInt(t[2], 10),
@@ -819,11 +843,11 @@ function He(i) {
819
843
  h: parseInt(t[4], 10)
820
844
  } : null;
821
845
  }
822
- function Qt(i) {
823
- const t = Wt(i);
846
+ function Kt(s) {
847
+ const t = Zt(s);
824
848
  if (t)
825
- return Ut(t);
826
- const r = er(i);
849
+ return er(t);
850
+ const r = ir(s);
827
851
  return r ? {
828
852
  type: "RECTANGLE",
829
853
  x: r.x,
@@ -832,235 +856,235 @@ function Qt(i) {
832
856
  h: r.h
833
857
  } : null;
834
858
  }
835
- function Wt(i) {
836
- var r, s;
837
- if (typeof i.getTarget == "function") {
838
- const n = ((r = i.__jsonld) == null ? void 0 : r.on) || ((s = i.__jsonld) == null ? void 0 : s.target);
859
+ function Zt(s) {
860
+ var r, i;
861
+ if (typeof s.getTarget == "function") {
862
+ const n = ((r = s.__jsonld) == null ? void 0 : r.on) || ((i = s.__jsonld) == null ? void 0 : i.target);
839
863
  if (n)
840
- return Je(n);
864
+ return Ke(n);
841
865
  }
842
- const t = i.target || i.on;
843
- return t ? Je(t) : null;
866
+ const t = s.target || s.on;
867
+ return t ? Ke(t) : null;
844
868
  }
845
- function Je(i) {
846
- if (!i) return null;
847
- if (Array.isArray(i))
848
- for (const t of i) {
849
- const r = Ke(t);
869
+ function Ke(s) {
870
+ if (!s) return null;
871
+ if (Array.isArray(s))
872
+ for (const t of s) {
873
+ const r = Ze(t);
850
874
  if (r) return r;
851
875
  }
852
876
  else
853
- return Ke(i);
877
+ return Ze(s);
854
878
  return null;
855
879
  }
856
- function Ke(i) {
880
+ function Ze(s) {
857
881
  var r;
858
- if (!i) return null;
859
- const t = i.selector || i;
882
+ if (!s) return null;
883
+ const t = s.selector || s;
860
884
  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;
861
885
  }
862
- function Ut(i) {
886
+ function er(s) {
863
887
  try {
864
- const r = new DOMParser().parseFromString(i, "image/svg+xml");
888
+ const r = new DOMParser().parseFromString(s, "image/svg+xml");
865
889
  if (r.documentElement.nodeName === "parsererror")
866
- return console.warn("Failed to parse SVG selector:", i), null;
867
- const s = [], n = r.querySelectorAll("polygon");
868
- for (const m of n) {
869
- const y = m.getAttribute("points");
870
- if (y) {
871
- const M = Jt(y);
872
- s.push(...M);
890
+ return console.warn("Failed to parse SVG selector:", s), null;
891
+ const i = [], n = r.querySelectorAll("polygon");
892
+ for (const p of n) {
893
+ const _ = p.getAttribute("points");
894
+ if (_) {
895
+ const z = tr(_);
896
+ i.push(...z);
873
897
  }
874
898
  }
875
899
  const a = r.querySelectorAll("path");
876
- for (const m of a) {
877
- const y = m.getAttribute("d");
878
- if (y) {
879
- const M = Kt(y);
880
- s.push(...M);
900
+ for (const p of a) {
901
+ const _ = p.getAttribute("d");
902
+ if (_) {
903
+ const z = rr(_);
904
+ i.push(...z);
881
905
  }
882
906
  }
883
- const C = r.querySelectorAll("circle");
884
- for (const m of C) {
885
- const y = parseFloat(m.getAttribute("cx") || "0"), M = parseFloat(m.getAttribute("cy") || "0"), g = parseFloat(m.getAttribute("r") || "0"), O = Zt(y, M, g);
886
- s.push(...O);
907
+ const P = r.querySelectorAll("circle");
908
+ for (const p of P) {
909
+ const _ = parseFloat(p.getAttribute("cx") || "0"), z = parseFloat(p.getAttribute("cy") || "0"), E = parseFloat(p.getAttribute("r") || "0"), f = sr(_, z, E);
910
+ i.push(...f);
887
911
  }
888
- return s.length === 0 ? null : {
912
+ return i.length === 0 ? null : {
889
913
  type: "POLYGON",
890
- points: s
914
+ points: i
891
915
  };
892
916
  } catch (t) {
893
917
  return console.warn("Failed to convert SVG to polygon:", t), null;
894
918
  }
895
919
  }
896
- function Jt(i) {
897
- const t = [], r = i.trim().split(/\s+/);
898
- for (const s of r) {
899
- const [n, a] = s.split(",").map((C) => parseFloat(C));
920
+ function tr(s) {
921
+ const t = [], r = s.trim().split(/\s+/);
922
+ for (const i of r) {
923
+ const [n, a] = i.split(",").map((P) => parseFloat(P));
900
924
  !isNaN(n) && !isNaN(a) && t.push([n, a]);
901
925
  }
902
926
  return t;
903
927
  }
904
- function Kt(i) {
928
+ function rr(s) {
905
929
  const t = [], r = /[ML]\s*([\d.]+)[,\s]+([\d.]+)/g;
906
- let s;
907
- for (; (s = r.exec(i)) !== null; ) {
908
- const n = parseFloat(s[1]), a = parseFloat(s[2]);
930
+ let i;
931
+ for (; (i = r.exec(s)) !== null; ) {
932
+ const n = parseFloat(i[1]), a = parseFloat(i[2]);
909
933
  !isNaN(n) && !isNaN(a) && t.push([n, a]);
910
934
  }
911
935
  return t;
912
936
  }
913
- function Zt(i, t, r, s = 8) {
937
+ function sr(s, t, r, i = 8) {
914
938
  const n = [];
915
- for (let a = 0; a < s; a++) {
916
- const C = a / s * Math.PI * 2, m = i + r * Math.cos(C), y = t + r * Math.sin(C);
917
- n.push([m, y]);
939
+ for (let a = 0; a < i; a++) {
940
+ const P = a / i * Math.PI * 2, p = s + r * Math.cos(P), _ = t + r * Math.sin(P);
941
+ n.push([p, _]);
918
942
  }
919
943
  return n;
920
944
  }
921
- function er(i) {
945
+ function ir(s) {
922
946
  var r;
923
- if (typeof i.getTarget == "function") {
924
- const s = i.getTarget();
925
- if (typeof s == "string" && s.includes("xywh="))
926
- return He(s);
927
- const n = (r = i.__jsonld) == null ? void 0 : r.on;
947
+ if (typeof s.getTarget == "function") {
948
+ const i = s.getTarget();
949
+ if (typeof i == "string" && i.includes("xywh="))
950
+ return Ye(i);
951
+ const n = (r = s.__jsonld) == null ? void 0 : r.on;
928
952
  if (n) {
929
- const a = Ye(n);
953
+ const a = Xe(n);
930
954
  if (a) return a;
931
955
  }
932
956
  }
933
- const t = i.target || i.on;
934
- return t ? Ye(t) : null;
957
+ const t = s.target || s.on;
958
+ return t ? Xe(t) : null;
935
959
  }
936
- function Ye(i) {
937
- if (!i) return null;
938
- if (Array.isArray(i))
939
- for (const t of i) {
940
- const r = Ye(t);
960
+ function Xe(s) {
961
+ if (!s) return null;
962
+ if (Array.isArray(s))
963
+ for (const t of s) {
964
+ const r = Xe(t);
941
965
  if (r) return r;
942
966
  }
943
- if (typeof i == "string" && i.includes("xywh="))
944
- return He(i);
945
- if (i.selector) {
946
- const t = i.selector, r = t.item || t;
967
+ if (typeof s == "string" && s.includes("xywh="))
968
+ return Ye(s);
969
+ if (s.selector) {
970
+ const t = s.selector, r = t.item || t;
947
971
  if (r.value && typeof r.value == "string" && r.value.includes("xywh="))
948
- return He(r.value);
972
+ return Ye(r.value);
949
973
  }
950
974
  return null;
951
975
  }
952
- function tr(i) {
976
+ function nr(s) {
953
977
  let t = "", r = !1;
954
- if (typeof i.getBody == "function") {
955
- const s = i.getBody();
956
- if (s && Array.isArray(s)) {
978
+ if (typeof s.getBody == "function") {
979
+ const i = s.getBody();
980
+ if (i && Array.isArray(i)) {
957
981
  const n = [];
958
- for (const a of s) {
959
- const C = a.getValue ? a.getValue() : "";
960
- if (C) {
961
- n.push(C);
962
- const m = a.getFormat ? a.getFormat() : "";
963
- (m === "text/html" || m === "application/html") && (r = !0);
982
+ for (const a of i) {
983
+ const P = a.getValue ? a.getValue() : "";
984
+ if (P) {
985
+ n.push(P);
986
+ const p = a.getFormat ? a.getFormat() : "";
987
+ (p === "text/html" || p === "application/html") && (r = !0);
964
988
  }
965
989
  }
966
990
  t = n.join(" ");
967
991
  }
968
992
  } else {
969
- const s = (a) => a && (a.chars || a.value || a["cnt:chars"]) || "", n = (a) => a ? a.format === "text/html" || a.type === "TextualBody" : !1;
970
- if (i.resource) {
971
- const a = Array.isArray(i.resource) ? i.resource : [i.resource];
972
- t = a.map(s).filter(Boolean).join(" "), r = a.some(n);
973
- } else if (i.body) {
974
- const a = Array.isArray(i.body) ? i.body : [i.body];
975
- t = a.map(s).filter(Boolean).join(" "), r = a.some(n);
993
+ const i = (a) => a && (a.chars || a.value || a["cnt:chars"]) || "", n = (a) => a ? a.format === "text/html" || a.type === "TextualBody" : !1;
994
+ if (s.resource) {
995
+ const a = Array.isArray(s.resource) ? s.resource : [s.resource];
996
+ t = a.map(i).filter(Boolean).join(" "), r = a.some(n);
997
+ } else if (s.body) {
998
+ const a = Array.isArray(s.body) ? s.body : [s.body];
999
+ t = a.map(i).filter(Boolean).join(" "), r = a.some(n);
976
1000
  }
977
1001
  }
978
- 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 };
1002
+ return t || (typeof s.getLabel == "function" ? t = s.getLabel() || "" : s.label && (t = Array.isArray(s.label) ? s.label.join(" ") : s.label)), { value: t || "Annotation", isHtml: r };
979
1003
  }
980
- function rr(i, t, r = !1) {
981
- const s = it(i) || `anno-${t}`, n = Qt(i);
1004
+ function ar(s, t, r = !1) {
1005
+ const i = it(s) || `anno-${t}`, n = Kt(s);
982
1006
  if (!n)
983
1007
  return null;
984
- const a = tr(i);
1008
+ const a = nr(s);
985
1009
  return {
986
- id: s,
1010
+ id: i,
987
1011
  geometry: n,
988
1012
  body: a,
989
1013
  isSearchHit: r
990
1014
  };
991
1015
  }
992
- function ir(i, t = /* @__PURE__ */ new Set()) {
993
- return i.map((r, s) => {
1016
+ function or(s, t = /* @__PURE__ */ new Set()) {
1017
+ return s.map((r, i) => {
994
1018
  const n = t.has(it(r));
995
- return rr(r, s, n);
1019
+ return ar(r, i, n);
996
1020
  }).filter((r) => r !== null);
997
1021
  }
998
- var sr = e.from_html("<div></div>"), nr = e.from_svg('<svg class="absolute pointer-events-auto"><title> </title><polygon stroke-width="2"></polygon></svg>'), ar = e.from_html('<div class="w-full h-full relative"><div class="w-full h-full osd-background bg-base-100"></div> <!></div>');
999
- function st(i, t) {
1022
+ var lr = e.from_html("<div></div>"), cr = e.from_svg('<svg class="absolute pointer-events-auto"><title> </title><polygon stroke-width="2"></polygon></svg>'), dr = e.from_html('<div class="w-full h-full relative"><div class="w-full h-full osd-background bg-base-100"></div> <!></div>');
1023
+ function nt(s, t) {
1000
1024
  e.push(t, !0);
1001
- let r = e.prop(t, "tileSources", 7), s = e.prop(t, "viewerState", 7), n = e.state(void 0), a = e.state(void 0), C = e.state(0), m = e.derived(() => {
1002
- if (!s().manifestId || !s().canvasId)
1025
+ let r = e.prop(t, "tileSources", 7), i = e.prop(t, "viewerState", 7), n = e.state(void 0), a = e.state(void 0), P = e.state(0), p = e.derived(() => {
1026
+ if (!i().manifestId || !i().canvasId)
1003
1027
  return [];
1004
- const h = le.getAnnotations(s().manifestId, s().canvasId), l = s().currentCanvasSearchAnnotations;
1005
- return [...h, ...l];
1006
- }), y = e.derived(() => {
1007
- const h = /* @__PURE__ */ new Set();
1008
- return s().currentCanvasSearchAnnotations.forEach((l) => {
1009
- const c = l.id || l["@id"];
1010
- c && h.add(c);
1011
- }), h;
1012
- }), M = e.derived(() => ir(e.get(m), e.get(y))), g = e.derived(() => {
1013
- if (e.get(C), !e.get(a) || !e.get(M).length)
1028
+ const v = fe.getAnnotations(i().manifestId, i().canvasId), l = i().currentCanvasSearchAnnotations;
1029
+ return [...v, ...l];
1030
+ }), _ = e.derived(() => {
1031
+ const v = /* @__PURE__ */ new Set();
1032
+ return i().currentCanvasSearchAnnotations.forEach((l) => {
1033
+ const o = l.id || l["@id"];
1034
+ o && v.add(o);
1035
+ }), v;
1036
+ }), z = e.derived(() => or(e.get(p), e.get(_))), E = e.derived(() => {
1037
+ if (e.get(P), !e.get(a) || !e.get(z).length)
1014
1038
  return [];
1015
- const h = e.get(a).world.getItemAt(0);
1016
- if (!h)
1039
+ const v = e.get(a).world.getItemAt(0);
1040
+ if (!v)
1017
1041
  return [];
1018
1042
  const l = [];
1019
- for (const c of e.get(M)) {
1020
- if (!c.isSearchHit) if (s().showAnnotations) {
1021
- if (!s().visibleAnnotationIds.has(c.id))
1043
+ for (const o of e.get(z)) {
1044
+ if (!o.isSearchHit) if (i().showAnnotations) {
1045
+ if (!i().visibleAnnotationIds.has(o.id))
1022
1046
  continue;
1023
1047
  } else continue;
1024
- if (c.geometry.type === "RECTANGLE") {
1025
- const R = h.imageToViewportRectangle(c.geometry.x, c.geometry.y, c.geometry.w, c.geometry.h), T = e.get(a).viewport.viewportToViewerElementRectangle(R);
1048
+ if (o.geometry.type === "RECTANGLE") {
1049
+ const C = v.imageToViewportRectangle(o.geometry.x, o.geometry.y, o.geometry.w, o.geometry.h), x = e.get(a).viewport.viewportToViewerElementRectangle(C);
1026
1050
  l.push({
1027
- id: c.id,
1051
+ id: o.id,
1028
1052
  type: "RECTANGLE",
1029
1053
  rect: {
1030
- x: T.x,
1031
- y: T.y,
1032
- width: T.width,
1033
- height: T.height
1054
+ x: x.x,
1055
+ y: x.y,
1056
+ width: x.width,
1057
+ height: x.height
1034
1058
  },
1035
- isSearchHit: c.isSearchHit,
1036
- tooltip: c.body.value
1059
+ isSearchHit: o.isSearchHit,
1060
+ tooltip: o.body.value
1037
1061
  });
1038
- } else if (c.geometry.type === "POLYGON") {
1039
- const R = c.geometry.points.map((z) => {
1040
- const S = h.imageToViewportCoordinates(new Qe.Point(z[0], z[1])), I = e.get(a).viewport.viewportToViewerElementCoordinates(S);
1041
- return [I.x, I.y];
1062
+ } else if (o.geometry.type === "POLYGON") {
1063
+ const C = o.geometry.points.map((A) => {
1064
+ const y = v.imageToViewportCoordinates(new We.Point(A[0], A[1])), k = e.get(a).viewport.viewportToViewerElementCoordinates(y);
1065
+ return [k.x, k.y];
1042
1066
  });
1043
- let T = 1 / 0, u = 1 / 0, A = -1 / 0, $ = -1 / 0;
1044
- for (const [z, S] of R)
1045
- T = Math.min(T, z), u = Math.min(u, S), A = Math.max(A, z), $ = Math.max($, S);
1046
- const d = R.map(([z, S]) => [z - T, S - u]);
1067
+ let x = 1 / 0, h = 1 / 0, I = -1 / 0, G = -1 / 0;
1068
+ for (const [A, y] of C)
1069
+ x = Math.min(x, A), h = Math.min(h, y), I = Math.max(I, A), G = Math.max(G, y);
1070
+ const d = C.map(([A, y]) => [A - x, y - h]);
1047
1071
  l.push({
1048
- id: c.id,
1072
+ id: o.id,
1049
1073
  type: "POLYGON",
1050
- bounds: { x: T, y: u, width: A - T, height: $ - u },
1074
+ bounds: { x, y: h, width: I - x, height: G - h },
1051
1075
  points: d,
1052
- isSearchHit: c.isSearchHit,
1053
- tooltip: c.body.value
1076
+ isSearchHit: o.isSearchHit,
1077
+ tooltip: o.body.value
1054
1078
  });
1055
1079
  }
1056
1080
  }
1057
1081
  return l;
1058
1082
  });
1059
- vt(() => {
1083
+ mt(() => {
1060
1084
  if (e.get(n))
1061
1085
  return e.set(
1062
1086
  a,
1063
- Qe({
1087
+ We({
1064
1088
  element: e.get(n),
1065
1089
  tileSources: null,
1066
1090
  // Will be set via effect
@@ -1077,358 +1101,358 @@ function st(i, t) {
1077
1101
  zoomPerClick: 2
1078
1102
  }),
1079
1103
  !0
1080
- ), s().notifyOSDReady(e.get(a)), () => {
1081
- var h;
1082
- (h = e.get(a)) == null || h.destroy(), s().osdViewer = null;
1104
+ ), i().notifyOSDReady(e.get(a)), () => {
1105
+ var v;
1106
+ (v = e.get(a)) == null || v.destroy(), i().osdViewer = null;
1083
1107
  };
1084
1108
  }), e.user_effect(() => {
1085
1109
  if (!e.get(a)) return;
1086
- const h = () => {
1087
- e.update(C);
1110
+ const v = () => {
1111
+ e.update(P);
1088
1112
  };
1089
- return e.get(a).addHandler("open", h), e.get(a).addHandler("animation", h), e.get(a).addHandler("resize", h), e.get(a).addHandler("rotate", h), e.get(a).world.addHandler("add-item", h), e.get(a).world.addHandler("remove-item", h), () => {
1090
- e.get(a).removeHandler("open", h), e.get(a).removeHandler("animation", h), e.get(a).removeHandler("resize", h), e.get(a).removeHandler("rotate", h), e.get(a).world.removeHandler("add-item", h), e.get(a).world.removeHandler("remove-item", h);
1113
+ return e.get(a).addHandler("open", v), e.get(a).addHandler("animation", v), e.get(a).addHandler("resize", v), e.get(a).addHandler("rotate", v), e.get(a).world.addHandler("add-item", v), e.get(a).world.addHandler("remove-item", v), () => {
1114
+ e.get(a).removeHandler("open", v), e.get(a).removeHandler("animation", v), e.get(a).removeHandler("resize", v), e.get(a).removeHandler("rotate", v), e.get(a).world.removeHandler("add-item", v), e.get(a).world.removeHandler("remove-item", v);
1091
1115
  };
1092
1116
  }), e.user_effect(() => {
1093
1117
  !e.get(a) || !r() || e.get(a).open(r());
1094
1118
  });
1095
- var O = {
1119
+ var f = {
1096
1120
  get tileSources() {
1097
1121
  return r();
1098
1122
  },
1099
- set tileSources(h) {
1100
- r(h), e.flush();
1123
+ set tileSources(v) {
1124
+ r(v), e.flush();
1101
1125
  },
1102
1126
  get viewerState() {
1103
- return s();
1127
+ return i();
1104
1128
  },
1105
- set viewerState(h) {
1106
- s(h), e.flush();
1129
+ set viewerState(v) {
1130
+ i(v), e.flush();
1107
1131
  }
1108
- }, v = ar(), p = e.child(v);
1109
- e.bind_this(p, (h) => e.set(n, h), () => e.get(n));
1110
- var k = e.sibling(p, 2);
1111
- return e.each(k, 17, () => e.get(g), (h) => h.id, (h, l) => {
1112
- var c = e.comment(), R = e.first_child(c);
1132
+ }, g = dr(), D = e.child(g);
1133
+ e.bind_this(D, (v) => e.set(n, v), () => e.get(n));
1134
+ var w = e.sibling(D, 2);
1135
+ return e.each(w, 17, () => e.get(E), (v) => v.id, (v, l) => {
1136
+ var o = e.comment(), C = e.first_child(o);
1113
1137
  {
1114
- var T = (A) => {
1115
- var $ = sr();
1138
+ var x = (I) => {
1139
+ var G = lr();
1116
1140
  e.template_effect(() => {
1117
- e.set_class($, 1, `absolute border-2 transition-colors cursor-pointer pointer-events-auto ${e.get(l).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($, `
1141
+ e.set_class(G, 1, `absolute border-2 transition-colors cursor-pointer pointer-events-auto ${e.get(l).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(G, `
1118
1142
  left: ${e.get(l).rect.x ?? ""}px;
1119
1143
  top: ${e.get(l).rect.y ?? ""}px;
1120
1144
  width: ${e.get(l).rect.width ?? ""}px;
1121
1145
  height: ${e.get(l).rect.height ?? ""}px;
1122
- `), e.set_attribute($, "title", e.get(l).tooltip);
1123
- }), e.append(A, $);
1124
- }, u = (A) => {
1125
- var $ = e.comment(), d = e.first_child($);
1146
+ `), e.set_attribute(G, "title", e.get(l).tooltip);
1147
+ }), e.append(I, G);
1148
+ }, h = (I) => {
1149
+ var G = e.comment(), d = e.first_child(G);
1126
1150
  {
1127
- var z = (S) => {
1128
- var I = nr(), G = e.child(I), j = e.child(G, !0);
1129
- e.reset(G);
1130
- var w = e.sibling(G);
1131
- e.reset(I), e.template_effect(
1132
- (b) => {
1133
- e.set_style(I, `
1151
+ var A = (y) => {
1152
+ var k = cr(), L = e.child(k), T = e.child(L, !0);
1153
+ e.reset(L);
1154
+ var S = e.sibling(L);
1155
+ e.reset(k), e.template_effect(
1156
+ (m) => {
1157
+ e.set_style(k, `
1134
1158
  left: ${e.get(l).bounds.x ?? ""}px;
1135
1159
  top: ${e.get(l).bounds.y ?? ""}px;
1136
1160
  width: ${e.get(l).bounds.width ?? ""}px;
1137
1161
  height: ${e.get(l).bounds.height ?? ""}px;
1138
- `), e.set_text(j, e.get(l).tooltip), e.set_attribute(w, "points", b), e.set_class(w, 0, `cursor-pointer transition-colors ${e.get(l).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"}`);
1162
+ `), e.set_text(T, e.get(l).tooltip), e.set_attribute(S, "points", m), e.set_class(S, 0, `cursor-pointer transition-colors ${e.get(l).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"}`);
1139
1163
  },
1140
- [() => e.get(l).points.map((b) => b.join(",")).join(" ")]
1141
- ), e.append(S, I);
1164
+ [() => e.get(l).points.map((m) => m.join(",")).join(" ")]
1165
+ ), e.append(y, k);
1142
1166
  };
1143
1167
  e.if(
1144
1168
  d,
1145
- (S) => {
1146
- e.get(l).type === "POLYGON" && S(z);
1169
+ (y) => {
1170
+ e.get(l).type === "POLYGON" && y(A);
1147
1171
  },
1148
1172
  !0
1149
1173
  );
1150
1174
  }
1151
- e.append(A, $);
1175
+ e.append(I, G);
1152
1176
  };
1153
- e.if(R, (A) => {
1154
- e.get(l).type === "RECTANGLE" ? A(T) : A(u, !1);
1177
+ e.if(C, (I) => {
1178
+ e.get(l).type === "RECTANGLE" ? I(x) : I(h, !1);
1155
1179
  });
1156
1180
  }
1157
- e.append(h, c);
1158
- }), e.reset(v), e.append(i, v), e.pop(O);
1181
+ e.append(v, o);
1182
+ }), e.reset(g), e.append(s, g), e.pop(f);
1159
1183
  }
1160
- e.create_custom_element(st, { tileSources: {}, viewerState: {} }, [], [], !0);
1161
- var or = 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 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>');
1162
- function nt(i, t) {
1184
+ e.create_custom_element(nt, { tileSources: {}, viewerState: {} }, [], [], !0);
1185
+ var fr = 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 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>');
1186
+ function at(s, t) {
1163
1187
  e.push(t, !0);
1164
1188
  let r = e.prop(t, "viewerState", 7);
1165
- var s = {
1189
+ var i = {
1166
1190
  get viewerState() {
1167
1191
  return r();
1168
1192
  },
1169
- set viewerState(O) {
1170
- r(O), e.flush();
1193
+ set viewerState(f) {
1194
+ r(f), e.flush();
1171
1195
  }
1172
- }, n = or(), a = e.child(n);
1196
+ }, n = fr(), a = e.child(n);
1173
1197
  a.__click = () => r().previousCanvas();
1174
- var C = e.child(a);
1175
- bt(C, { size: 20, weight: "bold" }), e.reset(a);
1176
- var m = e.sibling(a, 2), y = e.child(m);
1177
- e.reset(m);
1178
- var M = e.sibling(m, 2);
1179
- M.__click = () => r().nextCanvas();
1180
- var g = e.child(M);
1181
- return _t(g, { size: 20, weight: "bold" }), e.reset(M), e.reset(n), e.template_effect(
1182
- (O, v) => {
1183
- a.disabled = !r().hasPrevious, e.set_attribute(a, "aria-label", O), e.set_text(y, `${r().currentCanvasIndex + 1} / ${r().canvases.length ?? ""}`), M.disabled = !r().hasNext, e.set_attribute(M, "aria-label", v);
1198
+ var P = e.child(a);
1199
+ xt(P, { size: 20, weight: "bold" }), e.reset(a);
1200
+ var p = e.sibling(a, 2), _ = e.child(p);
1201
+ e.reset(p);
1202
+ var z = e.sibling(p, 2);
1203
+ z.__click = () => r().nextCanvas();
1204
+ var E = e.child(z);
1205
+ return St(E, { size: 20, weight: "bold" }), e.reset(z), e.reset(n), e.template_effect(
1206
+ (f, g) => {
1207
+ a.disabled = !r().hasPrevious, e.set_attribute(a, "aria-label", f), e.set_text(_, `${r().currentCanvasIndex + 1} / ${r().canvases.length ?? ""}`), z.disabled = !r().hasNext, e.set_attribute(z, "aria-label", g);
1184
1208
  },
1185
- [() => E.previous_canvas(), () => E.next_canvas()]
1186
- ), e.append(i, n), e.pop(s);
1209
+ [() => $.previous_canvas(), () => $.next_canvas()]
1210
+ ), e.append(s, n), e.pop(i);
1187
1211
  }
1188
1212
  e.delegate(["click"]);
1189
- e.create_custom_element(nt, { viewerState: {} }, [], [], !0);
1190
- var lr = e.from_html('<span class="text-xs opacity-50 truncate max-w-[150px]"> </span>'), cr = 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>'), dr = e.from_html('<div class="p-4 text-center opacity-50 text-sm">No annotations available.</div>'), fr = e.from_html('<div class="absolute top-4 right-4 z-40 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>');
1191
- function at(i, t) {
1213
+ e.create_custom_element(at, { viewerState: {} }, [], [], !0);
1214
+ var ur = e.from_html('<span class="text-xs opacity-50 truncate max-w-[150px]"> </span>'), gr = 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>'), hr = e.from_html('<div class="p-4 text-center opacity-50 text-sm">No annotations available.</div>'), vr = e.from_html('<div class="absolute top-4 right-4 z-40 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>');
1215
+ function ot(s, t) {
1192
1216
  e.push(t, !0);
1193
- const r = fe(ce);
1194
- let s = e.derived(() => {
1217
+ const r = he(ue);
1218
+ let i = e.derived(() => {
1195
1219
  if (!r.manifestId || !r.canvasId)
1196
1220
  return [];
1197
- const v = le.getAnnotations(r.manifestId, r.canvasId), p = r.currentCanvasSearchAnnotations;
1198
- return [...v, ...p];
1221
+ const g = fe.getAnnotations(r.manifestId, r.canvasId), D = r.currentCanvasSearchAnnotations;
1222
+ return [...g, ...D];
1199
1223
  });
1200
- function n(v) {
1201
- return v.id || v["@id"] || (typeof v.getId == "function" ? v.getId() : "") || "";
1224
+ function n(g) {
1225
+ return g.id || g["@id"] || (typeof g.getId == "function" ? g.getId() : "") || "";
1202
1226
  }
1203
1227
  e.user_effect(() => {
1204
- var v;
1205
- if (e.get(s).length > 0)
1206
- if (((v = r.config.annotations) == null ? void 0 : v.visible) ?? !0) {
1207
- const k = /* @__PURE__ */ new Set();
1208
- e.get(s).forEach((h) => {
1209
- const l = n(h);
1210
- l && k.add(l);
1211
- }), r.visibleAnnotationIds = k;
1228
+ var g;
1229
+ if (e.get(i).length > 0)
1230
+ if (((g = r.config.annotations) == null ? void 0 : g.visible) ?? !0) {
1231
+ const w = /* @__PURE__ */ new Set();
1232
+ e.get(i).forEach((v) => {
1233
+ const l = n(v);
1234
+ l && w.add(l);
1235
+ }), r.visibleAnnotationIds = w;
1212
1236
  } else
1213
1237
  r.visibleAnnotationIds = /* @__PURE__ */ new Set();
1214
1238
  else
1215
1239
  r.visibleAnnotationIds = /* @__PURE__ */ new Set();
1216
1240
  });
1217
- let a = e.derived(() => e.get(s).length === 0 ? !1 : e.get(s).every((v) => {
1218
- const p = n(v);
1219
- return !p || r.visibleAnnotationIds.has(p);
1241
+ let a = e.derived(() => e.get(i).length === 0 ? !1 : e.get(i).every((g) => {
1242
+ const D = n(g);
1243
+ return !D || r.visibleAnnotationIds.has(D);
1220
1244
  }));
1221
- function C(v) {
1222
- r.visibleAnnotationIds.has(v) ? r.visibleAnnotationIds.delete(v) : r.visibleAnnotationIds.add(v), r.visibleAnnotationIds = new Set(r.visibleAnnotationIds);
1245
+ function P(g) {
1246
+ r.visibleAnnotationIds.has(g) ? r.visibleAnnotationIds.delete(g) : r.visibleAnnotationIds.add(g), r.visibleAnnotationIds = new Set(r.visibleAnnotationIds);
1223
1247
  }
1224
- function m() {
1248
+ function p() {
1225
1249
  if (e.get(a))
1226
1250
  r.visibleAnnotationIds = /* @__PURE__ */ new Set();
1227
1251
  else {
1228
- const v = /* @__PURE__ */ new Set();
1229
- e.get(s).forEach((p) => {
1230
- const k = n(p);
1231
- k && v.add(k);
1232
- }), r.visibleAnnotationIds = v;
1252
+ const g = /* @__PURE__ */ new Set();
1253
+ e.get(i).forEach((D) => {
1254
+ const w = n(D);
1255
+ w && g.add(w);
1256
+ }), r.visibleAnnotationIds = g;
1233
1257
  }
1234
1258
  }
1235
- let y = e.derived(() => e.get(s).length ? e.get(s).map((v) => {
1236
- let p = "", k = !1;
1237
- if (typeof v.getBody == "function") {
1238
- const h = v.getBody();
1239
- if (h && h.length) {
1240
- const l = (c) => {
1241
- const R = c.getValue ? c.getValue() : null;
1242
- return R || "";
1259
+ let _ = e.derived(() => e.get(i).length ? e.get(i).map((g) => {
1260
+ let D = "", w = !1;
1261
+ if (typeof g.getBody == "function") {
1262
+ const v = g.getBody();
1263
+ if (v && v.length) {
1264
+ const l = (o) => {
1265
+ const C = o.getValue ? o.getValue() : null;
1266
+ return C || "";
1243
1267
  };
1244
- p = h.map((c) => l(c)).filter(Boolean).join(" "), k = h.some((c) => {
1245
- const R = c.getFormat ? c.getFormat() : "";
1246
- return R === "text/html" || R === "application/html";
1268
+ D = v.map((o) => l(o)).filter(Boolean).join(" "), w = v.some((o) => {
1269
+ const C = o.getFormat ? o.getFormat() : "";
1270
+ return C === "text/html" || C === "application/html";
1247
1271
  });
1248
1272
  }
1249
- if (!p && typeof v.getLabel == "function") {
1250
- const l = v.getLabel();
1251
- l && (p = l);
1273
+ if (!D && typeof g.getLabel == "function") {
1274
+ const l = g.getLabel();
1275
+ l && (D = l);
1252
1276
  }
1253
1277
  } else {
1254
- const h = (c) => c && (c.chars || c.value || c["cnt:chars"]) || "", l = (c) => c ? c.format === "text/html" || c.type === "TextualBody" : !1;
1255
- if (v.resource ? Array.isArray(v.resource) ? (p = v.resource.map((c) => h(c)).join(" "), v.resource.some((c) => l(c)) && (k = !0)) : (p = h(v.resource), l(v.resource) && (k = !0)) : v.body && (Array.isArray(v.body) ? (p = v.body.map((c) => h(c)).join(" "), v.body.some((c) => l(c)) && (k = !0)) : (p = h(v.body), l(v.body) && (k = !0))), !p) {
1256
- const c = v.label || v.name || v.title;
1257
- c && (p = Array.isArray(c) ? c.join(" ") : c);
1278
+ const v = (o) => o && (o.chars || o.value || o["cnt:chars"]) || "", l = (o) => o ? o.format === "text/html" || o.type === "TextualBody" : !1;
1279
+ if (g.resource ? Array.isArray(g.resource) ? (D = g.resource.map((o) => v(o)).join(" "), g.resource.some((o) => l(o)) && (w = !0)) : (D = v(g.resource), l(g.resource) && (w = !0)) : g.body && (Array.isArray(g.body) ? (D = g.body.map((o) => v(o)).join(" "), g.body.some((o) => l(o)) && (w = !0)) : (D = v(g.body), l(g.body) && (w = !0))), !D) {
1280
+ const o = g.label || g.name || g.title;
1281
+ o && (D = Array.isArray(o) ? o.join(" ") : o);
1258
1282
  }
1259
1283
  }
1260
1284
  return {
1261
- id: n(v),
1262
- content: p,
1263
- isHtml: k,
1264
- label: (typeof v.getLabel == "function" ? v.getLabel() : v.label) || ""
1285
+ id: n(g),
1286
+ content: D,
1287
+ isHtml: w,
1288
+ label: (typeof g.getLabel == "function" ? g.getLabel() : g.label) || ""
1265
1289
  };
1266
1290
  }) : []);
1267
- var M = e.comment(), g = e.first_child(M);
1291
+ var z = e.comment(), E = e.first_child(z);
1268
1292
  {
1269
- var O = (v) => {
1270
- var p = fr(), k = e.child(p), h = e.child(k), l = e.child(h);
1271
- l.__click = (I) => {
1272
- I.preventDefault(), m();
1293
+ var f = (g) => {
1294
+ var D = vr(), w = e.child(D), v = e.child(w), l = e.child(v);
1295
+ l.__click = (k) => {
1296
+ k.preventDefault(), p();
1273
1297
  };
1274
- var c = e.child(l);
1298
+ var o = e.child(l);
1275
1299
  {
1276
- var R = (I) => {
1277
- We(I, { size: 16, weight: "bold" });
1278
- }, T = (I) => {
1279
- Ue(I, { size: 16, weight: "bold" });
1300
+ var C = (k) => {
1301
+ Je(k, { size: 16, weight: "bold" });
1302
+ }, x = (k) => {
1303
+ Ue(k, { size: 16, weight: "bold" });
1280
1304
  };
1281
- e.if(c, (I) => {
1282
- e.get(a) ? I(R) : I(T, !1);
1305
+ e.if(o, (k) => {
1306
+ e.get(a) ? k(C) : k(x, !1);
1283
1307
  });
1284
1308
  }
1285
1309
  e.reset(l);
1286
- var u = e.sibling(l, 2), A = e.child(u), $ = e.sibling(A), d = e.child($, !0);
1287
- e.reset($), e.reset(u);
1288
- var z = e.sibling(u, 2);
1289
- wt(z, {
1310
+ var h = e.sibling(l, 2), I = e.child(h), G = e.sibling(I), d = e.child(G, !0);
1311
+ e.reset(G), e.reset(h);
1312
+ var A = e.sibling(h, 2);
1313
+ It(A, {
1290
1314
  size: 16,
1291
1315
  weight: "bold",
1292
1316
  class: "group-open:rotate-180 transition-transform opacity-80"
1293
- }), e.reset(h);
1294
- var S = e.sibling(h, 2);
1317
+ }), e.reset(v);
1318
+ var y = e.sibling(v, 2);
1295
1319
  e.each(
1296
- S,
1320
+ y,
1297
1321
  21,
1298
- () => e.get(y),
1322
+ () => e.get(_),
1299
1323
  e.index,
1300
- (I, G, j) => {
1301
- const w = e.derived(() => r.visibleAnnotationIds.has(e.get(G).id));
1302
- var b = cr();
1303
- b.__click = (o) => {
1304
- o.preventDefault(), C(e.get(G).id);
1324
+ (k, L, T) => {
1325
+ const S = e.derived(() => r.visibleAnnotationIds.has(e.get(L).id));
1326
+ var m = gr();
1327
+ m.__click = (K) => {
1328
+ K.preventDefault(), P(e.get(L).id);
1305
1329
  };
1306
- var _ = e.child(b), f = e.child(_);
1330
+ var b = e.child(m), u = e.child(b);
1307
1331
  {
1308
- var D = (o) => {
1309
- We(o, { size: 16, weight: "bold" });
1310
- }, V = (o) => {
1311
- Ue(o, { size: 16, weight: "bold" });
1332
+ var B = (K) => {
1333
+ Je(K, { size: 16, weight: "bold" });
1334
+ }, N = (K) => {
1335
+ Ue(K, { size: 16, weight: "bold" });
1312
1336
  };
1313
- e.if(f, (o) => {
1314
- e.get(w) ? o(D) : o(V, !1);
1337
+ e.if(u, (K) => {
1338
+ e.get(S) ? K(B) : K(N, !1);
1315
1339
  });
1316
1340
  }
1317
- e.reset(_);
1318
- var W = e.sibling(_, 2), L = e.child(W), B = e.child(L);
1319
- B.textContent = `#${j + 1}`;
1320
- var U = e.sibling(B, 2);
1341
+ e.reset(b);
1342
+ var q = e.sibling(b, 2), j = e.child(q), O = e.child(j);
1343
+ O.textContent = `#${T + 1}`;
1344
+ var X = e.sibling(O, 2);
1321
1345
  {
1322
- var H = (o) => {
1323
- var x = lr(), X = e.child(x, !0);
1324
- e.reset(x), e.template_effect(() => e.set_text(X, e.get(G).label)), e.append(o, x);
1346
+ var Y = (K) => {
1347
+ var se = ur(), ce = e.child(se, !0);
1348
+ e.reset(se), e.template_effect(() => e.set_text(ce, e.get(L).label)), e.append(K, se);
1325
1349
  };
1326
- e.if(U, (o) => {
1327
- e.get(G).label && e.get(G).label !== e.get(G).content && o(H);
1350
+ e.if(X, (K) => {
1351
+ e.get(L).label && e.get(L).label !== e.get(L).content && K(Y);
1328
1352
  });
1329
1353
  }
1330
- e.reset(L);
1331
- var N = e.sibling(L, 2), ie = e.child(N);
1354
+ e.reset(j);
1355
+ var H = e.sibling(j, 2), re = e.child(H);
1332
1356
  {
1333
- var ae = (o) => {
1334
- var x = e.comment(), X = e.first_child(x);
1335
- e.html(X, () => e.get(G).content), e.append(o, x);
1336
- }, oe = (o) => {
1337
- var x = e.text();
1338
- e.template_effect(() => e.set_text(x, e.get(G).content || "(No content)")), e.append(o, x);
1357
+ var ae = (K) => {
1358
+ var se = e.comment(), ce = e.first_child(se);
1359
+ e.html(ce, () => e.get(L).content), e.append(K, se);
1360
+ }, de = (K) => {
1361
+ var se = e.text();
1362
+ e.template_effect(() => e.set_text(se, e.get(L).content || "(No content)")), e.append(K, se);
1339
1363
  };
1340
- e.if(ie, (o) => {
1341
- e.get(G).isHtml ? o(ae) : o(oe, !1);
1364
+ e.if(re, (K) => {
1365
+ e.get(L).isHtml ? K(ae) : K(de, !1);
1342
1366
  });
1343
1367
  }
1344
- e.reset(N), e.reset(W), e.reset(b), e.template_effect(() => e.set_class(N, 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(I, b);
1368
+ e.reset(H), e.reset(q), e.reset(m), e.template_effect(() => e.set_class(H, 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(S) ? "" : "opacity-50"}`)), e.append(k, m);
1345
1369
  },
1346
- (I) => {
1347
- var G = dr();
1348
- e.append(I, G);
1370
+ (k) => {
1371
+ var L = hr();
1372
+ e.append(k, L);
1349
1373
  }
1350
- ), e.reset(S), e.reset(k), e.reset(p), e.template_effect(
1351
- (I, G, j) => {
1352
- e.set_attribute(l, "title", I), e.set_text(A, `${G ?? ""} `), e.set_text(d, j);
1374
+ ), e.reset(y), e.reset(w), e.reset(D), e.template_effect(
1375
+ (k, L, T) => {
1376
+ e.set_attribute(l, "title", k), e.set_text(I, `${L ?? ""} `), e.set_text(d, T);
1353
1377
  },
1354
1378
  [
1355
- () => e.get(a) ? E.hide_all_annotations() : E.show_all_annotations(),
1356
- () => E.annotations_count({ count: e.get(s).length }),
1357
- () => E.visible_count({ count: r.visibleAnnotationIds.size })
1379
+ () => e.get(a) ? $.hide_all_annotations() : $.show_all_annotations(),
1380
+ () => $.annotations_count({ count: e.get(i).length }),
1381
+ () => $.visible_count({ count: r.visibleAnnotationIds.size })
1358
1382
  ]
1359
- ), e.append(v, p);
1383
+ ), e.append(g, D);
1360
1384
  };
1361
- e.if(g, (v) => {
1362
- r.showAnnotations && v(O);
1385
+ e.if(E, (g) => {
1386
+ r.showAnnotations && g(f);
1363
1387
  });
1364
1388
  }
1365
- e.append(i, M), e.pop();
1389
+ e.append(s, z), e.pop();
1366
1390
  }
1367
1391
  e.delegate(["click"]);
1368
- e.create_custom_element(at, {}, [], [], !0);
1369
- var ur = e.from_html('<button class="absolute top-1 right-1 btn btn-error btn-xs btn-circle z-20" aria-label="Close Gallery"><!></button>'), gr = e.from_html('<div><div role="button" tabindex="0" aria-label="Drag Gallery"><div></div></div></div>'), vr = e.from_html('<img class="object-contain w-full h-full" loading="lazy" draggable="false"/>'), hr = e.from_html('<span class="opacity-20 text-4xl">?</span>'), pr = 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>'), mr = 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>'), br = 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), _r = e.from_html("<div><!> <!> <div><div></div></div> <!></div> <!>", 1);
1370
- function de(i, t) {
1392
+ e.create_custom_element(ot, {}, [], [], !0);
1393
+ var pr = e.from_html('<button class="absolute top-1 right-1 btn btn-error btn-xs btn-circle z-20" aria-label="Close Gallery"><!></button>'), mr = e.from_html('<div><div role="button" tabindex="0" aria-label="Drag Gallery"><div></div></div></div>'), br = e.from_html('<img class="object-contain w-full h-full" loading="lazy" draggable="false"/>'), _r = e.from_html('<span class="opacity-20 text-4xl">?</span>'), yr = 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>'), wr = 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>'), xr = 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), Sr = e.from_html("<div><!> <!> <div><div></div></div> <!></div> <!>", 1);
1394
+ function ge(s, t) {
1371
1395
  e.push(t, !0);
1372
- const r = fe(ce);
1373
- let s = e.derived(() => {
1396
+ const r = he(ue);
1397
+ let i = e.derived(() => {
1374
1398
  var d;
1375
1399
  return ((d = r.config.gallery) == null ? void 0 : d.draggable) ?? !0;
1376
1400
  }), n = e.derived(() => {
1377
1401
  var d;
1378
1402
  return ((d = r.config.gallery) == null ? void 0 : d.showCloseButton) ?? !0;
1379
- }), a = e.prop(t, "canvases", 7), C = e.state(!1), m = { x: 0, y: 0, w: 0, h: 0 }, y = e.state(null), M = e.derived(() => !a() || !Array.isArray(a()) ? [] : a().map((d, z) => {
1380
- let S = "";
1403
+ }), a = e.prop(t, "canvases", 7), P = e.state(!1), p = { x: 0, y: 0, w: 0, h: 0 }, _ = e.state(null), z = e.derived(() => !a() || !Array.isArray(a()) ? [] : a().map((d, A) => {
1404
+ let y = "";
1381
1405
  try {
1382
1406
  if (d.getThumbnail) {
1383
- const I = d.getThumbnail();
1384
- I && (S = typeof I == "string" ? I : I.id || I["@id"]);
1407
+ const k = d.getThumbnail();
1408
+ k && (y = typeof k == "string" ? k : k.id || k["@id"]);
1385
1409
  }
1386
- } catch (I) {
1387
- console.warn("Error getting thumbnail", I);
1410
+ } catch (k) {
1411
+ console.warn("Error getting thumbnail", k);
1388
1412
  }
1389
- if (!S) {
1390
- let I = d.getImages();
1391
- if ((!I || !I.length) && d.getContent && (I = d.getContent()), I && I.length > 0) {
1392
- const G = I[0];
1393
- let j = G.getResource ? G.getResource() : null;
1394
- if (!j && G.getBody) {
1395
- const w = G.getBody();
1396
- Array.isArray(w) && w.length > 0 ? j = w[0] : w && (j = w);
1413
+ if (!y) {
1414
+ let k = d.getImages();
1415
+ if ((!k || !k.length) && d.getContent && (k = d.getContent()), k && k.length > 0) {
1416
+ const L = k[0];
1417
+ let T = L.getResource ? L.getResource() : null;
1418
+ if (!T && L.getBody) {
1419
+ const S = L.getBody();
1420
+ Array.isArray(S) && S.length > 0 ? T = S[0] : S && (T = S);
1397
1421
  }
1398
- if (j && !j.id && !j.__jsonld && (!j.getServices || j.getServices().length === 0) && (j = null), !j) {
1399
- const w = G.__jsonld || G;
1400
- w.body && (j = Array.isArray(w.body) ? w.body[0] : w.body);
1422
+ if (T && !T.id && !T.__jsonld && (!T.getServices || T.getServices().length === 0) && (T = null), !T) {
1423
+ const S = L.__jsonld || L;
1424
+ S.body && (T = Array.isArray(S.body) ? S.body[0] : S.body);
1401
1425
  }
1402
- if (j) {
1403
- const b = (() => {
1404
- let f = [];
1405
- if (j.getServices && (f = j.getServices()), !f || f.length === 0) {
1406
- const D = j.__jsonld || j;
1407
- D.service && (f = Array.isArray(D.service) ? D.service : [D.service]);
1426
+ if (T) {
1427
+ const m = (() => {
1428
+ let u = [];
1429
+ if (T.getServices && (u = T.getServices()), !u || u.length === 0) {
1430
+ const B = T.__jsonld || T;
1431
+ B.service && (u = Array.isArray(B.service) ? B.service : [B.service]);
1408
1432
  }
1409
- return f;
1433
+ return u;
1410
1434
  })();
1411
- let _ = !1;
1412
- if (b.length > 0) {
1413
- const f = b[0];
1414
- let D = "";
1435
+ let b = !1;
1436
+ if (m.length > 0) {
1437
+ const u = m[0];
1438
+ let B = "";
1415
1439
  try {
1416
- if (D = f.getProfile ? f.getProfile() : f.profile || "", typeof D == "object" && D) {
1417
- const L = D;
1418
- D = L.value || L.id || L["@id"] || JSON.stringify(L);
1440
+ if (B = u.getProfile ? u.getProfile() : u.profile || "", typeof B == "object" && B) {
1441
+ const j = B;
1442
+ B = j.value || j.id || j["@id"] || JSON.stringify(j);
1419
1443
  }
1420
1444
  } catch {
1421
1445
  }
1422
- const V = String(D ?? "").toLowerCase();
1423
- (V.includes("level0") || V.includes("level-0")) && (_ = !0);
1424
- const W = f.id || f["@id"];
1425
- _ || (S = `${W}/full/200,/0/default.jpg`);
1446
+ const N = String(B ?? "").toLowerCase();
1447
+ (N.includes("level0") || N.includes("level-0")) && (b = !0);
1448
+ const q = u.id || u["@id"];
1449
+ b || (y = `${q}/full/200,/0/default.jpg`);
1426
1450
  }
1427
- if (!S && (S = j.id || j["@id"], !S)) {
1428
- let f = null;
1429
- if (G.__jsonld && G.__jsonld.body ? f = G.__jsonld.body : G.body && (f = G.body), f) {
1430
- const D = Array.isArray(f) ? f[0] : f;
1431
- S = D.id || D["@id"];
1451
+ if (!y && (y = T.id || T["@id"], !y)) {
1452
+ let u = null;
1453
+ if (L.__jsonld && L.__jsonld.body ? u = L.__jsonld.body : L.body && (u = L.body), u) {
1454
+ const B = Array.isArray(u) ? u[0] : u;
1455
+ y = B.id || B["@id"];
1432
1456
  }
1433
1457
  }
1434
1458
  }
@@ -1436,49 +1460,49 @@ function de(i, t) {
1436
1460
  }
1437
1461
  return {
1438
1462
  id: d.id,
1439
- label: d.getLabel().length ? d.getLabel()[0].value : `Canvas ${z + 1}`,
1440
- src: S,
1441
- index: z
1463
+ label: d.getLabel().length ? d.getLabel()[0].value : `Canvas ${A + 1}`,
1464
+ src: y,
1465
+ index: A
1442
1466
  };
1443
1467
  }));
1444
- function g(d) {
1468
+ function E(d) {
1445
1469
  if (!r.isGalleryDragging) return;
1446
- let z = d.clientX - r.galleryDragOffset.x, S = d.clientY - r.galleryDragOffset.y;
1447
- const I = Math.max(0, window.innerWidth - r.gallerySize.width), G = Math.max(0, window.innerHeight - r.gallerySize.height);
1448
- z = Math.max(0, Math.min(z, I)), S = Math.max(0, Math.min(S, G)), r.galleryPosition = { x: z, y: S };
1449
- const j = r.galleryCenterPanelRect;
1450
- if (!j) {
1470
+ let A = d.clientX - r.galleryDragOffset.x, y = d.clientY - r.galleryDragOffset.y;
1471
+ const k = Math.max(0, window.innerWidth - r.gallerySize.width), L = Math.max(0, window.innerHeight - r.gallerySize.height);
1472
+ A = Math.max(0, Math.min(A, k)), y = Math.max(0, Math.min(y, L)), r.galleryPosition = { x: A, y };
1473
+ const T = r.galleryCenterPanelRect;
1474
+ if (!T) {
1451
1475
  console.warn("[Gallery] No center panel rect available");
1452
1476
  return;
1453
1477
  }
1454
- const w = d.clientX, b = d.clientY, _ = 60;
1455
- r.dragOverSide = null, w >= j.left && w <= j.left + _ ? r.dragOverSide = "left" : w <= j.right && w >= j.right - _ ? r.dragOverSide = "right" : b >= j.top && b <= j.top + _ ? r.dragOverSide = "top" : b <= j.bottom && b >= j.bottom - _ && (r.dragOverSide = "bottom");
1478
+ const S = d.clientX, m = d.clientY, b = 60;
1479
+ r.dragOverSide = null, S >= T.left && S <= T.left + b ? r.dragOverSide = "left" : S <= T.right && S >= T.right - b ? r.dragOverSide = "right" : m >= T.top && m <= T.top + b ? r.dragOverSide = "top" : m <= T.bottom && m >= T.bottom - b && (r.dragOverSide = "bottom");
1456
1480
  }
1457
- function O() {
1481
+ function f() {
1458
1482
  const d = r.dragOverSide;
1459
- console.log("[Gallery] stopDrag. dropTarget:", d), r.isGalleryDragging = !1, r.dragOverSide = null, window.removeEventListener("mousemove", g), window.removeEventListener("mouseup", O), d && (r.dockSide = d);
1483
+ console.log("[Gallery] stopDrag. dropTarget:", d), r.isGalleryDragging = !1, r.dragOverSide = null, window.removeEventListener("mousemove", E), window.removeEventListener("mouseup", f), d && (r.dockSide = d);
1460
1484
  }
1461
- function v(d) {
1462
- d.stopPropagation(), e.set(C, !0), m = {
1485
+ function g(d) {
1486
+ d.stopPropagation(), e.set(P, !0), p = {
1463
1487
  x: d.clientX,
1464
1488
  y: d.clientY,
1465
1489
  w: r.gallerySize.width,
1466
1490
  h: r.gallerySize.height
1467
- }, window.addEventListener("mousemove", p), window.addEventListener("mouseup", k);
1491
+ }, window.addEventListener("mousemove", D), window.addEventListener("mouseup", w);
1468
1492
  }
1469
- function p(d) {
1470
- if (!e.get(C)) return;
1471
- const z = d.clientX - m.x, S = d.clientY - m.y;
1493
+ function D(d) {
1494
+ if (!e.get(P)) return;
1495
+ const A = d.clientX - p.x, y = d.clientY - p.y;
1472
1496
  r.gallerySize = {
1473
- width: Math.max(200, m.w + z),
1474
- height: Math.max(200, m.h + S)
1497
+ width: Math.max(200, p.w + A),
1498
+ height: Math.max(200, p.h + y)
1475
1499
  };
1476
1500
  }
1477
- function k() {
1478
- e.set(C, !1), window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", k);
1501
+ function w() {
1502
+ e.set(P, !1), window.removeEventListener("mousemove", D), window.removeEventListener("mouseup", w);
1479
1503
  }
1480
- function h(d) {
1481
- r.canvasId = d;
1504
+ function v(d) {
1505
+ r.setCanvas(d);
1482
1506
  }
1483
1507
  let l = e.state(e.proxy(r.dockSide));
1484
1508
  e.user_effect(() => {
@@ -1487,1015 +1511,1027 @@ function de(i, t) {
1487
1511
  }), e.user_effect(() => {
1488
1512
  r.dockSide !== e.get(l) && (r.dockSide = e.get(l), r.isGalleryDockedBottom = e.get(l) === "bottom", r.isGalleryDockedRight = e.get(l) === "right");
1489
1513
  });
1490
- let c = e.derived(() => e.get(l) === "top" || e.get(l) === "bottom" || e.get(l) === "none" && r.gallerySize.height < 320);
1491
- function R(d) {
1492
- var G, j;
1514
+ let o = e.derived(() => e.get(l) === "top" || e.get(l) === "bottom" || e.get(l) === "none" && r.gallerySize.height < 320);
1515
+ function C(d) {
1516
+ var L, T;
1493
1517
  if (!e.get(
1494
- s
1518
+ i
1495
1519
  // Dragging disabled in config
1496
1520
  ) || d.target.closest(".resize-handle")) return;
1497
- const z = e.get(l) !== "none";
1498
- if (z) {
1499
- let w = Math.max(0, d.clientX - 150), b = Math.max(0, d.clientY - 20);
1500
- const _ = Math.max(0, window.innerWidth - 300), f = Math.max(0, window.innerHeight - 400);
1501
- w = Math.min(w, _), b = Math.min(b, f), r.galleryPosition = { x: w, y: b }, r.galleryDragOffset = { x: d.clientX - w, y: d.clientY - b };
1521
+ const A = e.get(l) !== "none";
1522
+ if (A) {
1523
+ let S = Math.max(0, d.clientX - 150), m = Math.max(0, d.clientY - 20);
1524
+ const b = Math.max(0, window.innerWidth - 300), u = Math.max(0, window.innerHeight - 400);
1525
+ S = Math.min(S, b), m = Math.min(m, u), r.galleryPosition = { x: S, y: m }, r.galleryDragOffset = { x: d.clientX - S, y: d.clientY - m };
1502
1526
  } else
1503
1527
  r.galleryDragOffset = {
1504
1528
  x: d.clientX - r.galleryPosition.x,
1505
1529
  y: d.clientY - r.galleryPosition.y
1506
1530
  };
1507
- const S = (G = e.get(y)) == null ? void 0 : G.getRootNode(), I = ((j = S == null ? void 0 : S.getElementById) == null ? void 0 : j.call(S, "triiiceratops-center-panel")) ?? document.getElementById("triiiceratops-center-panel");
1508
- I ? (r.galleryCenterPanelRect = I.getBoundingClientRect(), console.log("[Gallery] Captured center panel rect:", r.galleryCenterPanelRect)) : console.warn("[Gallery] Could not find center panel in startDrag"), r.isGalleryDragging = !0, window.addEventListener("mousemove", g), window.addEventListener("mouseup", O), z && e.set(l, "none");
1531
+ const y = (L = e.get(_)) == null ? void 0 : L.getRootNode(), k = ((T = y == null ? void 0 : y.getElementById) == null ? void 0 : T.call(y, "triiiceratops-center-panel")) ?? document.getElementById("triiiceratops-center-panel");
1532
+ k ? (r.galleryCenterPanelRect = k.getBoundingClientRect(), console.log("[Gallery] Captured center panel rect:", r.galleryCenterPanelRect)) : console.warn("[Gallery] Could not find center panel in startDrag"), r.isGalleryDragging = !0, window.addEventListener("mousemove", E), window.addEventListener("mouseup", f), A && e.set(l, "none");
1509
1533
  }
1510
- var T = {
1534
+ var x = {
1511
1535
  get canvases() {
1512
1536
  return a();
1513
1537
  },
1514
1538
  set canvases(d) {
1515
1539
  a(d), e.flush();
1516
1540
  }
1517
- }, u = e.comment(), A = e.first_child(u);
1541
+ }, h = e.comment(), I = e.first_child(h);
1518
1542
  {
1519
- var $ = (d) => {
1520
- var z = _r(), S = e.first_child(z), I = e.child(S);
1543
+ var G = (d) => {
1544
+ var A = Sr(), y = e.first_child(A), k = e.child(y);
1521
1545
  {
1522
- var G = (L) => {
1523
- var B = ur();
1524
- B.__click = () => r.toggleThumbnailGallery();
1525
- var U = e.child(B);
1526
- Xe(U, { size: 16, weight: "bold" }), e.reset(B), e.append(L, B);
1546
+ var L = (j) => {
1547
+ var O = pr();
1548
+ O.__click = () => r.toggleThumbnailGallery();
1549
+ var X = e.child(O);
1550
+ qe(X, { size: 16, weight: "bold" }), e.reset(O), e.append(j, O);
1527
1551
  };
1528
- e.if(I, (L) => {
1529
- e.get(n) && L(G);
1552
+ e.if(k, (j) => {
1553
+ e.get(n) && j(L);
1530
1554
  });
1531
1555
  }
1532
- var j = e.sibling(I, 2);
1556
+ var T = e.sibling(k, 2);
1533
1557
  {
1534
- var w = (L) => {
1535
- var B = gr(), U = e.child(B);
1536
- U.__mousedown = R;
1537
- var H = e.child(U);
1538
- e.reset(U), e.reset(B), e.template_effect(() => {
1539
- e.set_class(B, 1, "bg-base-100 flex shrink-0 select-none relative " + (e.get(l) === "bottom" || e.get(l) === "top" ? "flex-row h-full items-center border-r border-base-200" : "flex-col w-full border-b border-base-200")), e.set_class(U, 1, "cursor-move flex items-center justify-center hover:bg-base-200/50 active:bg-base-200 transition-colors " + (e.get(l) === "bottom" || e.get(l) === "top" ? "w-8 h-full" : "h-6 w-full")), e.set_class(H, 1, "bg-base-300 rounded-full " + (e.get(l) === "bottom" || e.get(l) === "top" ? "w-1.5 h-12" : "w-12 h-1.5"));
1540
- }), e.append(L, B);
1558
+ var S = (j) => {
1559
+ var O = mr(), X = e.child(O);
1560
+ X.__mousedown = C;
1561
+ var Y = e.child(X);
1562
+ e.reset(X), e.reset(O), e.template_effect(() => {
1563
+ e.set_class(O, 1, "bg-base-100 flex shrink-0 select-none relative " + (e.get(l) === "bottom" || e.get(l) === "top" ? "flex-row h-full items-center border-r border-base-200" : "flex-col w-full border-b border-base-200")), e.set_class(X, 1, "cursor-move flex items-center justify-center hover:bg-base-200/50 active:bg-base-200 transition-colors " + (e.get(l) === "bottom" || e.get(l) === "top" ? "w-8 h-full" : "h-6 w-full")), e.set_class(Y, 1, "bg-base-300 rounded-full " + (e.get(l) === "bottom" || e.get(l) === "top" ? "w-1.5 h-12" : "w-12 h-1.5"));
1564
+ }), e.append(j, O);
1541
1565
  };
1542
- e.if(j, (L) => {
1543
- (e.get(s) || e.get(l) === "none") && L(w);
1566
+ e.if(T, (j) => {
1567
+ (e.get(i) || e.get(l) === "none") && j(S);
1544
1568
  });
1545
1569
  }
1546
- var b = e.sibling(j, 2), _ = e.child(b);
1547
- e.each(_, 21, () => e.get(M), e.index, (L, B) => {
1548
- var U = pr();
1549
- U.__click = () => h(e.get(B).id);
1550
- var H = e.child(U), N = e.child(H);
1570
+ var m = e.sibling(T, 2), b = e.child(m);
1571
+ e.each(b, 21, () => e.get(z), e.index, (j, O) => {
1572
+ var X = yr();
1573
+ X.__click = () => v(e.get(O).id);
1574
+ var Y = e.child(X), H = e.child(Y);
1551
1575
  {
1552
- var ie = (Y) => {
1553
- var re = vr();
1576
+ var re = (c) => {
1577
+ var R = br();
1554
1578
  e.template_effect(() => {
1555
- e.set_attribute(re, "src", e.get(B).src), e.set_attribute(re, "alt", e.get(B).label);
1556
- }), e.append(Y, re);
1557
- }, ae = (Y) => {
1558
- var re = hr();
1559
- e.append(Y, re);
1579
+ e.set_attribute(R, "src", e.get(O).src), e.set_attribute(R, "alt", e.get(O).label);
1580
+ }), e.append(c, R);
1581
+ }, ae = (c) => {
1582
+ var R = _r();
1583
+ e.append(c, R);
1560
1584
  };
1561
- e.if(N, (Y) => {
1562
- e.get(B).src ? Y(ie) : Y(ae, !1);
1585
+ e.if(H, (c) => {
1586
+ e.get(O).src ? c(re) : c(ae, !1);
1563
1587
  });
1564
1588
  }
1565
- e.reset(H);
1566
- var oe = e.sibling(H, 2), o = e.child(oe), x = e.child(o);
1567
- e.reset(o);
1568
- var X = e.sibling(o);
1569
- e.reset(oe), e.reset(U), e.template_effect(() => {
1570
- e.set_class(U, 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]" : ""} ${r.canvasId === e.get(B).id ? "ring-2 ring-primary bg-primary/5" : ""}`), e.set_attribute(U, "aria-label", `Select canvas ${e.get(B).label ?? ""}`), e.set_text(x, `${e.get(B).index + 1}.`), e.set_text(X, ` ${e.get(B).label ?? ""}`);
1571
- }), e.append(L, U);
1572
- }), e.reset(_), e.reset(b);
1573
- var f = e.sibling(b, 2);
1589
+ e.reset(Y);
1590
+ var de = e.sibling(Y, 2), K = e.child(de), se = e.child(K);
1591
+ e.reset(K);
1592
+ var ce = e.sibling(K);
1593
+ e.reset(de), e.reset(X), e.template_effect(() => {
1594
+ e.set_class(X, 1, `group flex flex-col gap-1 p-1 rounded hover:bg-base-200 transition-colors text-left relative shrink-0 ${e.get(o) ? "w-[140px]" : ""} ${r.canvasId === e.get(O).id ? "ring-2 ring-primary bg-primary/5" : ""}`), e.set_attribute(X, "aria-label", `Select canvas ${e.get(O).label ?? ""}`), e.set_text(se, `${e.get(O).index + 1}.`), e.set_text(ce, ` ${e.get(O).label ?? ""}`);
1595
+ }), e.append(j, X);
1596
+ }), e.reset(b), e.reset(m);
1597
+ var u = e.sibling(m, 2);
1574
1598
  {
1575
- var D = (L) => {
1576
- var B = mr();
1577
- B.__mousedown = v, e.append(L, B);
1599
+ var B = (j) => {
1600
+ var O = wr();
1601
+ O.__mousedown = g, e.append(j, O);
1578
1602
  };
1579
- e.if(f, (L) => {
1580
- e.get(l) === "none" && L(D);
1603
+ e.if(u, (j) => {
1604
+ e.get(l) === "none" && j(B);
1581
1605
  });
1582
1606
  }
1583
- e.reset(S), e.bind_this(S, (L) => e.set(y, L), () => e.get(y));
1584
- var V = e.sibling(S, 2);
1607
+ e.reset(y), e.bind_this(y, (j) => e.set(_, j), () => e.get(_));
1608
+ var N = e.sibling(y, 2);
1585
1609
  {
1586
- var W = (L) => {
1587
- var B = br(), U = e.first_child(B), H = e.sibling(U, 2), N = e.sibling(H, 2), ie = e.sibling(N, 2);
1610
+ var q = (j) => {
1611
+ var O = xr(), X = e.first_child(O), Y = e.sibling(X, 2), H = e.sibling(Y, 2), re = e.sibling(H, 2);
1588
1612
  e.template_effect(() => {
1589
- e.set_class(U, 1, `absolute top-2 left-2 right-2 h-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-200 ${r.dragOverSide === "top" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(H, 1, `absolute bottom-2 left-2 right-2 h-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-200 ${r.dragOverSide === "bottom" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(N, 1, `absolute top-2 bottom-2 left-2 w-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-200 ${r.dragOverSide === "left" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(ie, 1, `absolute top-2 bottom-2 right-2 w-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-300 ${r.dragOverSide === "right" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`);
1590
- }), e.append(L, B);
1613
+ e.set_class(X, 1, `absolute top-2 left-2 right-2 h-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-200 ${r.dragOverSide === "top" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(Y, 1, `absolute bottom-2 left-2 right-2 h-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-200 ${r.dragOverSide === "bottom" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(H, 1, `absolute top-2 bottom-2 left-2 w-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-200 ${r.dragOverSide === "left" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`), e.set_class(re, 1, `absolute top-2 bottom-2 right-2 w-16 rounded-xl border-4 border-dashed border-primary/40 z-999 pointer-events-none flex items-center justify-center transition-all duration-300 ${r.dragOverSide === "right" ? "bg-primary/20 scale-105" : "bg-base-100/50"}`);
1614
+ }), e.append(j, O);
1591
1615
  };
1592
- e.if(V, (L) => {
1593
- r.isGalleryDragging && L(W);
1616
+ e.if(N, (j) => {
1617
+ r.isGalleryDragging && j(q);
1594
1618
  });
1595
1619
  }
1596
1620
  e.template_effect(() => {
1597
- e.set_class(S, 1, (e.get(l) !== "none" ? `relative z-50 bg-base-100 shadow-xl border-base-300 flex transition-all duration-200 select-none w-full h-full
1621
+ e.set_class(y, 1, (e.get(l) !== "none" ? `relative z-50 bg-base-100 shadow-xl border-base-300 flex transition-all duration-200 select-none w-full h-full
1598
1622
  ${e.get(l) === "bottom" || e.get(l) === "top" ? "flex-row border-t" : ""}
1599
- ${e.get(l) === "left" || e.get(l) === "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(S, e.get(l) !== "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, `flex-1 p-1 bg-base-100 ${e.get(c) ? "overflow-x-auto overflow-y-hidden h-full" : "overflow-y-auto overflow-x-hidden"}`), e.set_class(_, 1, e.clsx(e.get(c) ? "flex flex-row gap-2 h-full items-center" : "grid gap-2")), e.set_style(_, e.get(c) ? "" : "grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));");
1600
- }), e.append(d, z);
1623
+ ${e.get(l) === "left" || e.get(l) === "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(y, e.get(l) !== "none" ? "" : `left: ${r.galleryPosition.x}px; top: ${r.galleryPosition.y}px; width: ${r.gallerySize.width}px; height: ${r.gallerySize.height}px;`), e.set_class(m, 1, `flex-1 p-1 bg-base-100 ${e.get(o) ? "overflow-x-auto overflow-y-hidden h-full" : "overflow-y-auto overflow-x-hidden"}`), e.set_class(b, 1, e.clsx(e.get(o) ? "flex flex-row gap-2 h-full items-center" : "grid gap-2")), e.set_style(b, e.get(o) ? "" : "grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));");
1624
+ }), e.append(d, A);
1601
1625
  };
1602
- e.if(A, (d) => {
1603
- r.showThumbnailGallery && d($);
1626
+ e.if(I, (d) => {
1627
+ r.showThumbnailGallery && d(G);
1604
1628
  });
1605
1629
  }
1606
- return e.append(i, u), e.pop(T);
1630
+ return e.append(s, h), e.pop(x);
1607
1631
  }
1608
1632
  e.delegate(["click", "mousedown"]);
1609
- e.create_custom_element(de, { canvases: {} }, [], [], !0);
1610
- var yr = e.from_html("<button><!></button>"), wr = e.from_html("<button><!></button>"), xr = e.from_html("<button><!></button>"), Sr = e.from_html("<button><!></button>"), Ar = e.from_html("<button><!></button>"), Ir = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Cr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), kr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Pr = e.from_html('<div class="tooltip tooltip-top"><!></div>'), Mr = e.from_html('<div class="tooltip tooltip-top"><!></div>'), Tr = e.from_html('<div class="absolute z-600 bottom-6 right-6"><!> <!> <!> <!> <!></div>'), zr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), jr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Lr = e.from_html('<div class="tooltip tooltip-top"><!></div>'), Rr = e.from_html('<div class="tooltip tooltip-top"><!></div>'), Dr = e.from_html('<div class="fab fab-flower fab-top-left absolute z-600 pointer-events-auto bottom-6 right-6"><div tabindex="0" role="button" class="btn btn-lg btn-primary btn-circle shadow-xl"><span class="sr-only"> </span> <!></div> <div class="fab-main-action tooltip tooltip-top"><!></div> <!> <!> <!> <!></div>');
1611
- function ot(i, t) {
1633
+ e.create_custom_element(ge, { canvases: {} }, [], [], !0);
1634
+ var Ar = e.from_html("<button><!></button>"), Ir = e.from_html("<button><!></button>"), Cr = e.from_html("<button><!></button>"), kr = e.from_html("<button><!></button>"), Pr = e.from_html("<button><!></button>"), Mr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Tr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), zr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), jr = e.from_html('<div class="tooltip tooltip-top"><!></div>'), Lr = e.from_html('<div class="tooltip tooltip-top"><!></div>'), Br = e.from_html('<div class="absolute z-600 bottom-6 right-6"><!> <!> <!> <!> <!></div>'), Dr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Rr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Or = e.from_html('<div class="tooltip tooltip-top"><!></div>'), Gr = e.from_html('<div class="tooltip tooltip-top"><!></div>'), $r = e.from_html('<div class="fab fab-flower fab-top-left absolute z-600 pointer-events-auto bottom-6 right-6"><div tabindex="0" role="button" class="btn btn-lg btn-primary btn-circle shadow-xl"><span class="sr-only"> </span> <!></div> <div class="fab-main-action tooltip tooltip-top"><!></div> <!> <!> <!> <!></div>');
1635
+ function lt(s, t) {
1612
1636
  e.push(t, !0);
1613
- const r = (T) => {
1614
- var u = yr();
1615
- u.__click = () => m.toggleSearchPanel();
1616
- var A = e.child(u);
1617
- Ze(A, { size: 28, weight: "bold" }), e.reset(u), e.template_effect(
1618
- ($) => {
1619
- e.set_attribute(u, "aria-label", $), e.set_class(u, 1, e.clsx([
1637
+ const r = (x) => {
1638
+ var h = Ar();
1639
+ h.__click = () => p.toggleSearchPanel();
1640
+ var I = e.child(h);
1641
+ et(I, { size: 28, weight: "bold" }), e.reset(h), e.template_effect(
1642
+ (G) => {
1643
+ e.set_attribute(h, "aria-label", G), e.set_class(h, 1, e.clsx([
1620
1644
  "btn btn-circle btn-lg shadow-lg",
1621
- m.showSearchPanel ? "btn-primary" : "btn-neutral"
1645
+ p.showSearchPanel ? "btn-primary" : "btn-neutral"
1622
1646
  ]));
1623
1647
  },
1624
- [() => E.toggle_search()]
1625
- ), e.append(T, u);
1626
- }, s = (T) => {
1627
- var u = wr();
1628
- u.__click = () => m.toggleThumbnailGallery();
1629
- var A = e.child(u);
1630
- kt(A, { size: 28, weight: "bold" }), e.reset(u), e.template_effect(
1631
- ($) => {
1632
- e.set_attribute(u, "aria-label", $), e.set_class(u, 1, `btn btn-lg btn-circle shadow-lg ${m.showThumbnailGallery ? "btn-info" : "btn-neutral"}`);
1648
+ [() => $.toggle_search()]
1649
+ ), e.append(x, h);
1650
+ }, i = (x) => {
1651
+ var h = Ir();
1652
+ h.__click = () => p.toggleThumbnailGallery();
1653
+ var I = e.child(h);
1654
+ zt(I, { size: 28, weight: "bold" }), e.reset(h), e.template_effect(
1655
+ (G) => {
1656
+ e.set_attribute(h, "aria-label", G), e.set_class(h, 1, `btn btn-lg btn-circle shadow-lg ${p.showThumbnailGallery ? "btn-info" : "btn-neutral"}`);
1633
1657
  },
1634
1658
  [
1635
- () => m.showThumbnailGallery ? E.hide_gallery() : E.show_gallery()
1659
+ () => p.showThumbnailGallery ? $.hide_gallery() : $.show_gallery()
1636
1660
  ]
1637
- ), e.append(T, u);
1638
- }, n = (T) => {
1639
- var u = xr();
1640
- u.__click = () => m.toggleFullScreen();
1641
- var A = e.child(u);
1661
+ ), e.append(x, h);
1662
+ }, n = (x) => {
1663
+ var h = Cr();
1664
+ h.__click = () => p.toggleFullScreen();
1665
+ var I = e.child(h);
1642
1666
  {
1643
- var $ = (z) => {
1644
- St(z, { size: 28, weight: "bold" });
1645
- }, d = (z) => {
1646
- At(z, { size: 28, weight: "bold" });
1667
+ var G = (A) => {
1668
+ kt(A, { size: 28, weight: "bold" });
1669
+ }, d = (A) => {
1670
+ Pt(A, { size: 28, weight: "bold" });
1647
1671
  };
1648
- e.if(A, (z) => {
1649
- m.isFullScreen ? z($) : z(d, !1);
1672
+ e.if(I, (A) => {
1673
+ p.isFullScreen ? A(G) : A(d, !1);
1650
1674
  });
1651
1675
  }
1652
- e.reset(u), e.template_effect(() => e.set_class(u, 1, `btn btn-circle btn-lg shadow-lg transition-all duration-300 ease-out ${m.isFullScreen ? "btn-warning" : "btn-neutral"}`)), e.append(T, u);
1653
- }, a = (T) => {
1654
- var u = Sr();
1655
- u.__click = () => m.toggleAnnotations();
1656
- var A = e.child(u);
1657
- xt(A, { size: 28, weight: "bold" }), e.reset(u), e.template_effect(
1658
- ($) => {
1659
- e.set_attribute(u, "aria-label", $), e.set_class(u, 1, `btn btn-lg btn-circle shadow-lg ${m.showAnnotations ? "btn-error" : "btn-neutral"}`);
1676
+ e.reset(h), e.template_effect(() => e.set_class(h, 1, `btn btn-circle btn-lg shadow-lg transition-all duration-300 ease-out ${p.isFullScreen ? "btn-warning" : "btn-neutral"}`)), e.append(x, h);
1677
+ }, a = (x) => {
1678
+ var h = kr();
1679
+ h.__click = () => p.toggleAnnotations();
1680
+ var I = e.child(h);
1681
+ Ct(I, { size: 28, weight: "bold" }), e.reset(h), e.template_effect(
1682
+ (G) => {
1683
+ e.set_attribute(h, "aria-label", G), e.set_class(h, 1, `btn btn-lg btn-circle shadow-lg ${p.showAnnotations ? "btn-error" : "btn-neutral"}`);
1660
1684
  },
1661
- [() => E.toggle_annotations()]
1662
- ), e.append(T, u);
1663
- }, C = (T) => {
1664
- var u = Ar();
1665
- u.__click = () => m.toggleMetadataDialog();
1666
- var A = e.child(u);
1667
- It(A, { size: 28, weight: "bold" }), e.reset(u), e.template_effect(
1668
- ($) => {
1669
- e.set_attribute(u, "aria-label", $), e.set_class(u, 1, `btn btn-lg btn-circle shadow-lg ${m.showMetadataDialog ? "btn-info" : "btn-neutral"}`);
1685
+ [() => $.toggle_annotations()]
1686
+ ), e.append(x, h);
1687
+ }, P = (x) => {
1688
+ var h = Pr();
1689
+ h.__click = () => p.toggleMetadataDialog();
1690
+ var I = e.child(h);
1691
+ Mt(I, { size: 28, weight: "bold" }), e.reset(h), e.template_effect(
1692
+ (G) => {
1693
+ e.set_attribute(h, "aria-label", G), e.set_class(h, 1, `btn btn-lg btn-circle shadow-lg ${p.showMetadataDialog ? "btn-info" : "btn-neutral"}`);
1670
1694
  },
1671
- [() => E.toggle_metadata()]
1672
- ), e.append(T, u);
1673
- }, m = fe(ce), y = e.derived(() => m.config.rightMenu || {}), M = e.derived(() => e.get(y).showSearch !== !1), g = e.derived(() => e.get(y).showGallery !== !1), O = e.derived(() => e.get(y).showFullscreen !== !1), v = e.derived(() => e.get(y).showAnnotations !== !1), p = e.derived(() => e.get(y).showInfo !== !1), k = e.derived(() => [
1674
- e.get(M) ? "search" : null,
1675
- e.get(g) ? "gallery" : null,
1676
- e.get(O) ? "fullscreen" : null,
1677
- e.get(v) ? "annotations" : null,
1678
- e.get(p) ? "info" : null
1679
- ].filter((T) => T !== null));
1680
- var h = e.comment(), l = e.first_child(h);
1695
+ [() => $.toggle_metadata()]
1696
+ ), e.append(x, h);
1697
+ }, p = he(ue), _ = e.derived(() => p.config.rightMenu || {}), z = e.derived(() => e.get(_).showSearch !== !1), E = e.derived(() => e.get(_).showGallery !== !1), f = e.derived(() => e.get(_).showFullscreen !== !1), g = e.derived(() => e.get(_).showAnnotations !== !1), D = e.derived(() => e.get(_).showInfo !== !1), w = e.derived(() => [
1698
+ e.get(z) ? "search" : null,
1699
+ e.get(E) ? "gallery" : null,
1700
+ e.get(f) ? "fullscreen" : null,
1701
+ e.get(g) ? "annotations" : null,
1702
+ e.get(D) ? "info" : null
1703
+ ].filter((x) => x !== null));
1704
+ var v = e.comment(), l = e.first_child(v);
1681
1705
  {
1682
- var c = (T) => {
1683
- var u = Tr(), A = e.child(u);
1706
+ var o = (x) => {
1707
+ var h = Br(), I = e.child(h);
1684
1708
  {
1685
- var $ = (_) => {
1686
- var f = Ir(), D = e.child(f);
1687
- r(D), e.reset(f), e.template_effect((V) => e.set_attribute(f, "data-tip", V), [() => E.search()]), e.append(_, f);
1709
+ var G = (b) => {
1710
+ var u = Mr(), B = e.child(u);
1711
+ r(B), e.reset(u), e.template_effect((N) => e.set_attribute(u, "data-tip", N), [() => $.search()]), e.append(b, u);
1688
1712
  };
1689
- e.if(A, (_) => {
1690
- e.get(M) && _($);
1713
+ e.if(I, (b) => {
1714
+ e.get(z) && b(G);
1691
1715
  });
1692
1716
  }
1693
- var d = e.sibling(A, 2);
1717
+ var d = e.sibling(I, 2);
1694
1718
  {
1695
- var z = (_) => {
1696
- var f = Cr(), D = e.child(f);
1697
- s(D), e.reset(f), e.template_effect((V) => e.set_attribute(f, "data-tip", V), [
1698
- () => m.showThumbnailGallery ? E.hide_gallery() : E.show_gallery()
1699
- ]), e.append(_, f);
1719
+ var A = (b) => {
1720
+ var u = Tr(), B = e.child(u);
1721
+ i(B), e.reset(u), e.template_effect((N) => e.set_attribute(u, "data-tip", N), [
1722
+ () => p.showThumbnailGallery ? $.hide_gallery() : $.show_gallery()
1723
+ ]), e.append(b, u);
1700
1724
  };
1701
- e.if(d, (_) => {
1702
- e.get(g) && _(z);
1725
+ e.if(d, (b) => {
1726
+ e.get(E) && b(A);
1703
1727
  });
1704
1728
  }
1705
- var S = e.sibling(d, 2);
1729
+ var y = e.sibling(d, 2);
1706
1730
  {
1707
- var I = (_) => {
1708
- var f = kr(), D = e.child(f);
1709
- n(D), e.reset(f), e.template_effect((V) => e.set_attribute(f, "data-tip", V), [
1710
- () => m.isFullScreen ? E.exit_full_screen() : E.enter_full_screen()
1711
- ]), e.append(_, f);
1731
+ var k = (b) => {
1732
+ var u = zr(), B = e.child(u);
1733
+ n(B), e.reset(u), e.template_effect((N) => e.set_attribute(u, "data-tip", N), [
1734
+ () => p.isFullScreen ? $.exit_full_screen() : $.enter_full_screen()
1735
+ ]), e.append(b, u);
1712
1736
  };
1713
- e.if(S, (_) => {
1714
- e.get(O) && _(I);
1737
+ e.if(y, (b) => {
1738
+ e.get(f) && b(k);
1715
1739
  });
1716
1740
  }
1717
- var G = e.sibling(S, 2);
1741
+ var L = e.sibling(y, 2);
1718
1742
  {
1719
- var j = (_) => {
1720
- var f = Pr(), D = e.child(f);
1721
- a(D), e.reset(f), e.template_effect((V) => e.set_attribute(f, "data-tip", V), [
1722
- () => m.showAnnotations ? E.hide_annotations() : E.show_annotations()
1723
- ]), e.append(_, f);
1743
+ var T = (b) => {
1744
+ var u = jr(), B = e.child(u);
1745
+ a(B), e.reset(u), e.template_effect((N) => e.set_attribute(u, "data-tip", N), [
1746
+ () => p.showAnnotations ? $.hide_annotations() : $.show_annotations()
1747
+ ]), e.append(b, u);
1724
1748
  };
1725
- e.if(G, (_) => {
1726
- e.get(v) && _(j);
1749
+ e.if(L, (b) => {
1750
+ e.get(g) && b(T);
1727
1751
  });
1728
1752
  }
1729
- var w = e.sibling(G, 2);
1753
+ var S = e.sibling(L, 2);
1730
1754
  {
1731
- var b = (_) => {
1732
- var f = Mr(), D = e.child(f);
1733
- C(D), e.reset(f), e.template_effect((V) => e.set_attribute(f, "data-tip", V), [() => E.metadata()]), e.append(_, f);
1755
+ var m = (b) => {
1756
+ var u = Lr(), B = e.child(u);
1757
+ P(B), e.reset(u), e.template_effect((N) => e.set_attribute(u, "data-tip", N), [() => $.metadata()]), e.append(b, u);
1734
1758
  };
1735
- e.if(w, (_) => {
1736
- e.get(p) && _(b);
1759
+ e.if(S, (b) => {
1760
+ e.get(D) && b(m);
1737
1761
  });
1738
1762
  }
1739
- e.reset(u), e.append(T, u);
1740
- }, R = (T) => {
1741
- var u = e.comment(), A = e.first_child(u);
1763
+ e.reset(h), e.append(x, h);
1764
+ }, C = (x) => {
1765
+ var h = e.comment(), I = e.first_child(h);
1742
1766
  {
1743
- var $ = (d) => {
1744
- var z = Dr(), S = e.child(z), I = e.child(S), G = e.child(I, !0);
1745
- e.reset(I);
1746
- var j = e.sibling(I, 2);
1747
- Ct(j, { size: 32, weight: "bold" }), e.reset(S);
1748
- var w = e.sibling(S, 2), b = e.child(w);
1749
- r(b), e.reset(w);
1750
- var _ = e.sibling(w, 2);
1767
+ var G = (d) => {
1768
+ var A = $r(), y = e.child(A), k = e.child(y), L = e.child(k, !0);
1769
+ e.reset(k);
1770
+ var T = e.sibling(k, 2);
1771
+ Tt(T, { size: 32, weight: "bold" }), e.reset(y);
1772
+ var S = e.sibling(y, 2), m = e.child(S);
1773
+ r(m), e.reset(S);
1774
+ var b = e.sibling(S, 2);
1751
1775
  {
1752
- var f = (H) => {
1753
- var N = zr(), ie = e.child(N);
1754
- s(ie), e.reset(N), e.template_effect((ae) => e.set_attribute(N, "data-tip", ae), [
1755
- () => m.showThumbnailGallery ? E.hide_gallery() : E.show_gallery()
1756
- ]), e.append(H, N);
1776
+ var u = (Y) => {
1777
+ var H = Dr(), re = e.child(H);
1778
+ i(re), e.reset(H), e.template_effect((ae) => e.set_attribute(H, "data-tip", ae), [
1779
+ () => p.showThumbnailGallery ? $.hide_gallery() : $.show_gallery()
1780
+ ]), e.append(Y, H);
1757
1781
  };
1758
- e.if(_, (H) => {
1759
- e.get(g) && H(f);
1782
+ e.if(b, (Y) => {
1783
+ e.get(E) && Y(u);
1760
1784
  });
1761
1785
  }
1762
- var D = e.sibling(_, 2);
1786
+ var B = e.sibling(b, 2);
1763
1787
  {
1764
- var V = (H) => {
1765
- var N = jr(), ie = e.child(N);
1766
- n(ie), e.reset(N), e.template_effect((ae) => e.set_attribute(N, "data-tip", ae), [
1767
- () => m.isFullScreen ? E.exit_full_screen() : E.enter_full_screen()
1768
- ]), e.append(H, N);
1788
+ var N = (Y) => {
1789
+ var H = Rr(), re = e.child(H);
1790
+ n(re), e.reset(H), e.template_effect((ae) => e.set_attribute(H, "data-tip", ae), [
1791
+ () => p.isFullScreen ? $.exit_full_screen() : $.enter_full_screen()
1792
+ ]), e.append(Y, H);
1769
1793
  };
1770
- e.if(D, (H) => {
1771
- e.get(O) && H(V);
1794
+ e.if(B, (Y) => {
1795
+ e.get(f) && Y(N);
1772
1796
  });
1773
1797
  }
1774
- var W = e.sibling(D, 2);
1798
+ var q = e.sibling(B, 2);
1775
1799
  {
1776
- var L = (H) => {
1777
- var N = Lr(), ie = e.child(N);
1778
- a(ie), e.reset(N), e.template_effect((ae) => e.set_attribute(N, "data-tip", ae), [
1779
- () => m.showAnnotations ? E.hide_annotations() : E.show_annotations()
1780
- ]), e.append(H, N);
1800
+ var j = (Y) => {
1801
+ var H = Or(), re = e.child(H);
1802
+ a(re), e.reset(H), e.template_effect((ae) => e.set_attribute(H, "data-tip", ae), [
1803
+ () => p.showAnnotations ? $.hide_annotations() : $.show_annotations()
1804
+ ]), e.append(Y, H);
1781
1805
  };
1782
- e.if(W, (H) => {
1783
- e.get(v) && H(L);
1806
+ e.if(q, (Y) => {
1807
+ e.get(g) && Y(j);
1784
1808
  });
1785
1809
  }
1786
- var B = e.sibling(W, 2);
1810
+ var O = e.sibling(q, 2);
1787
1811
  {
1788
- var U = (H) => {
1789
- var N = Rr(), ie = e.child(N);
1790
- C(ie), e.reset(N), e.template_effect((ae) => e.set_attribute(N, "data-tip", ae), [() => E.metadata()]), e.append(H, N);
1812
+ var X = (Y) => {
1813
+ var H = Gr(), re = e.child(H);
1814
+ P(re), e.reset(H), e.template_effect((ae) => e.set_attribute(H, "data-tip", ae), [() => $.metadata()]), e.append(Y, H);
1791
1815
  };
1792
- e.if(B, (H) => {
1793
- e.get(p) && H(U);
1816
+ e.if(O, (Y) => {
1817
+ e.get(D) && Y(X);
1794
1818
  });
1795
1819
  }
1796
- e.reset(z), e.template_effect(
1797
- (H, N) => {
1798
- e.set_text(G, H), e.set_attribute(w, "data-tip", N);
1820
+ e.reset(A), e.template_effect(
1821
+ (Y, H) => {
1822
+ e.set_text(L, Y), e.set_attribute(S, "data-tip", H);
1799
1823
  },
1800
- [() => E.menu(), () => E.search()]
1801
- ), e.append(d, z);
1824
+ [() => $.menu(), () => $.search()]
1825
+ ), e.append(d, A);
1802
1826
  };
1803
1827
  e.if(
1804
- A,
1828
+ I,
1805
1829
  (d) => {
1806
- e.get(k).length > 1 && d($);
1830
+ e.get(w).length > 1 && d(G);
1807
1831
  },
1808
1832
  !0
1809
1833
  );
1810
1834
  }
1811
- e.append(T, u);
1835
+ e.append(x, h);
1812
1836
  };
1813
- e.if(l, (T) => {
1814
- e.get(k).length === 1 ? T(c) : T(R, !1);
1837
+ e.if(l, (x) => {
1838
+ e.get(w).length === 1 ? x(o) : x(C, !1);
1815
1839
  });
1816
1840
  }
1817
- e.append(i, h), e.pop();
1841
+ e.append(s, v), e.pop();
1818
1842
  }
1819
1843
  e.delegate(["click"]);
1820
- e.create_custom_element(ot, {}, [], [], !0);
1821
- var Gr = e.from_html('<div class="tooltip tooltip-right"><button><!></button></div>'), Or = 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>');
1822
- function lt(i, t) {
1844
+ e.create_custom_element(lt, {}, [], [], !0);
1845
+ var Er = e.from_html('<div class="tooltip tooltip-right"><button><!></button></div>'), Fr = 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>');
1846
+ function ct(s, t) {
1823
1847
  e.push(t, !0);
1824
- const r = fe(ce);
1825
- let s = e.derived(() => [...r.pluginMenuButtons].sort((M, g) => (M.order ?? 100) - (g.order ?? 100))), n = e.state(!1);
1848
+ const r = he(ue);
1849
+ let i = e.derived(() => [...r.pluginMenuButtons].sort((z, E) => (z.order ?? 100) - (E.order ?? 100))), n = e.state(!1);
1826
1850
  function a() {
1827
1851
  e.set(n, !e.get(n));
1828
1852
  }
1829
- var C = e.comment(), m = e.first_child(C);
1853
+ var P = e.comment(), p = e.first_child(P);
1830
1854
  {
1831
- var y = (M) => {
1832
- var g = Or(), O = e.child(g);
1833
- e.each(O, 21, () => e.get(s), (c) => c.id, (c, R) => {
1834
- const T = e.derived(() => e.get(R).icon);
1835
- var u = Gr(), A = e.child(u);
1836
- A.__click = () => {
1837
- e.get(R).onClick(), e.set(n, !1);
1855
+ var _ = (z) => {
1856
+ var E = Fr(), f = e.child(E);
1857
+ e.each(f, 21, () => e.get(i), (o) => o.id, (o, C) => {
1858
+ const x = e.derived(() => e.get(C).icon);
1859
+ var h = Er(), I = e.child(h);
1860
+ I.__click = () => {
1861
+ e.get(C).onClick(), e.set(n, !1);
1838
1862
  };
1839
- var $ = e.child(A);
1840
- e.component($, () => e.get(T), (d, z) => {
1841
- z(d, { size: 28, weight: "bold" });
1842
- }), e.reset(A), e.reset(u), e.template_effect(
1863
+ var G = e.child(I);
1864
+ e.component(G, () => e.get(x), (d, A) => {
1865
+ A(d, { size: 28, weight: "bold" });
1866
+ }), e.reset(I), e.reset(h), e.template_effect(
1843
1867
  (d) => {
1844
- e.set_attribute(u, "data-tip", e.get(R).tooltip), e.set_attribute(A, "aria-label", e.get(R).tooltip), e.set_class(A, 1, `btn btn-lg btn-circle shadow-lg ${d ?? ""}`);
1868
+ e.set_attribute(h, "data-tip", e.get(C).tooltip), e.set_attribute(I, "aria-label", e.get(C).tooltip), e.set_class(I, 1, `btn btn-lg btn-circle shadow-lg ${d ?? ""}`);
1845
1869
  },
1846
1870
  [
1847
1871
  () => {
1848
- var d, z;
1849
- return (z = (d = e.get(R)).isActive) != null && z.call(d) ? e.get(R).activeClass ?? "btn-primary" : "btn-neutral";
1872
+ var d, A;
1873
+ return (A = (d = e.get(C)).isActive) != null && A.call(d) ? e.get(C).activeClass ?? "btn-primary" : "btn-neutral";
1850
1874
  }
1851
1875
  ]
1852
- ), e.append(c, u);
1853
- }), e.reset(O);
1854
- var v = e.sibling(O, 2), p = e.child(v);
1855
- p.__click = a;
1856
- var k = e.child(p);
1876
+ ), e.append(o, h);
1877
+ }), e.reset(f);
1878
+ var g = e.sibling(f, 2), D = e.child(g);
1879
+ D.__click = a;
1880
+ var w = e.child(D);
1857
1881
  {
1858
- var h = (c) => {
1859
- Xe(c, { size: 28, weight: "bold" });
1860
- }, l = (c) => {
1861
- Pt(c, { size: 28, weight: "bold" });
1882
+ var v = (o) => {
1883
+ qe(o, { size: 28, weight: "bold" });
1884
+ }, l = (o) => {
1885
+ jt(o, { size: 28, weight: "bold" });
1862
1886
  };
1863
- e.if(k, (c) => {
1864
- e.get(n) ? c(h) : c(l, !1);
1887
+ e.if(w, (o) => {
1888
+ e.get(n) ? o(v) : o(l, !1);
1865
1889
  });
1866
1890
  }
1867
- e.reset(p), e.reset(v), e.reset(g), e.template_effect(
1868
- (c, R) => {
1869
- e.set_class(O, 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(v, "data-tip", c), e.set_class(p, 1, `btn btn-lg btn-secondary btn-circle shadow-xl transition-transform duration-300 ${e.get(n) ? "rotate-90" : ""}`), e.set_attribute(p, "aria-label", R);
1891
+ e.reset(D), e.reset(g), e.reset(E), e.template_effect(
1892
+ (o, C) => {
1893
+ e.set_class(f, 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(g, "data-tip", o), e.set_class(D, 1, `btn btn-lg btn-secondary btn-circle shadow-xl transition-transform duration-300 ${e.get(n) ? "rotate-90" : ""}`), e.set_attribute(D, "aria-label", C);
1870
1894
  },
1871
- [() => E.plugins_tooltip(), () => E.plugins_tooltip()]
1872
- ), e.append(M, g);
1895
+ [() => $.plugins_tooltip(), () => $.plugins_tooltip()]
1896
+ ), e.append(z, E);
1873
1897
  };
1874
- e.if(m, (M) => {
1875
- e.get(s).length > 0 && M(y);
1898
+ e.if(p, (z) => {
1899
+ e.get(i).length > 0 && z(_);
1876
1900
  });
1877
1901
  }
1878
- e.append(i, C), e.pop();
1902
+ e.append(s, P), e.pop();
1879
1903
  }
1880
1904
  e.delegate(["click"]);
1881
- e.create_custom_element(lt, {}, [], [], !0);
1882
- var Br = e.from_html('<div class="mb-6 prose"><p><!></p></div>'), Er = 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), Fr = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><!></dd>', 1), Vr = 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>');
1883
- function ct(i, t) {
1905
+ e.create_custom_element(ct, {}, [], [], !0);
1906
+ var Vr = e.from_html('<div class="mb-6 prose"><p><!></p></div>'), Nr = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><!></dd>', 1), Hr = 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), Xr = 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>');
1907
+ function dt(s, t) {
1884
1908
  e.push(t, !0);
1885
- const r = fe(ce);
1886
- let s = e.derived(() => r.manifest), n = e.derived(() => {
1887
- const b = yt.current;
1888
- if (!e.get(s)) return [];
1889
- const _ = e.get(s).getMetadata();
1890
- return _ ? _.map((f) => {
1891
- let D = "", V = "";
1892
- const W = (L) => {
1893
- if (typeof L == "string") return L;
1894
- if (Array.isArray(L)) {
1895
- let B = L.find((U) => U.locale === b || U.language === b);
1896
- return B || (B = L.find((U) => U.locale === "en" || U.language === "en")), B || (B = L.find((U) => !U.locale && !U.language)), B || (B = L[0]), B ? B.value : "";
1909
+ const r = he(ue);
1910
+ let i = e.derived(() => r.manifest), n = e.derived(() => {
1911
+ const m = At.current;
1912
+ if (!e.get(i)) return [];
1913
+ const b = e.get(i).getMetadata();
1914
+ return b ? b.map((u) => {
1915
+ let B = "", N = "";
1916
+ const q = (j) => {
1917
+ if (typeof j == "string") return j;
1918
+ if (Array.isArray(j)) {
1919
+ let O = j.find((X) => X.locale === m || X.language === m);
1920
+ return O || (O = j.find((X) => X.locale === "en" || X.language === "en")), O || (O = j.find((X) => !X.locale && !X.language)), O || (O = j[0]), O ? O.value : "";
1897
1921
  }
1898
- return String(L);
1922
+ return String(j);
1899
1923
  };
1900
- return f.getLabel ? D = W(f.getLabel()) : f.label && (D = W(f.label)), f.getValue ? V = W(f.getValue()) : f.value && (V = W(f.value)), { label: D, value: V };
1924
+ return u.getLabel ? B = q(u.getLabel()) : u.label && (B = q(u.label)), u.getValue ? N = q(u.getValue()) : u.value && (N = q(u.value)), { label: B, value: N };
1901
1925
  }) : [];
1902
- }), a = e.derived(() => e.get(s) ? e.get(s).getDescription() : ""), C = e.derived(() => {
1903
- var b;
1904
- return e.get(s) ? (b = e.get(s).getRequiredStatement()) == null ? void 0 : b.getValue() : "";
1905
- }), m = e.derived(() => e.get(s) ? e.get(s).getLicense() : "");
1906
- var y = Vr(), M = e.child(y), g = e.child(M), O = e.child(g);
1907
- O.__click = () => r.toggleMetadataDialog(), e.reset(g);
1908
- var v = e.sibling(g, 2), p = e.child(v, !0);
1909
- e.reset(v);
1910
- var k = e.sibling(v, 2), h = e.child(k);
1926
+ }), a = e.derived(() => e.get(i) ? e.get(i).getDescription() : ""), P = e.derived(() => {
1927
+ var m;
1928
+ return e.get(i) ? (m = e.get(i).getRequiredStatement()) == null ? void 0 : m.getValue() : "";
1929
+ }), p = e.derived(() => e.get(i) ? e.get(i).getLicense() : "");
1930
+ var _ = Xr(), z = e.child(_), E = e.child(z), f = e.child(E);
1931
+ f.__click = () => r.toggleMetadataDialog(), e.reset(E);
1932
+ var g = e.sibling(E, 2), D = e.child(g, !0);
1933
+ e.reset(g);
1934
+ var w = e.sibling(g, 2), v = e.child(w);
1911
1935
  {
1912
- var l = (b) => {
1913
- var _ = Br(), f = e.child(_), D = e.child(f);
1914
- e.html(D, () => e.get(a)), e.reset(f), e.reset(_), e.append(b, _);
1936
+ var l = (m) => {
1937
+ var b = Vr(), u = e.child(b), B = e.child(u);
1938
+ e.html(B, () => e.get(a)), e.reset(u), e.reset(b), e.append(m, b);
1915
1939
  };
1916
- e.if(h, (b) => {
1917
- e.get(a) && b(l);
1940
+ e.if(v, (m) => {
1941
+ e.get(a) && m(l);
1918
1942
  });
1919
1943
  }
1920
- var c = e.sibling(h, 2), R = e.child(c);
1944
+ var o = e.sibling(v, 2), C = e.child(o);
1921
1945
  {
1922
- var T = (b) => {
1923
- var _ = Er(), f = e.first_child(_), D = e.child(f, !0);
1924
- e.reset(f);
1925
- var V = e.sibling(f, 2), W = e.child(V);
1926
- e.html(W, () => e.get(C)), e.reset(V), e.template_effect((L) => e.set_text(D, L), [() => E.attribution()]), e.append(b, _);
1946
+ var x = (m) => {
1947
+ var b = Nr(), u = e.first_child(b), B = e.child(u, !0);
1948
+ e.reset(u);
1949
+ var N = e.sibling(u, 2), q = e.child(N);
1950
+ e.html(q, () => e.get(P)), e.reset(N), e.template_effect((j) => e.set_text(B, j), [() => $.attribution()]), e.append(m, b);
1927
1951
  };
1928
- e.if(R, (b) => {
1929
- e.get(C) && b(T);
1952
+ e.if(C, (m) => {
1953
+ e.get(P) && m(x);
1930
1954
  });
1931
1955
  }
1932
- var u = e.sibling(R, 2);
1956
+ var h = e.sibling(C, 2);
1933
1957
  {
1934
- var A = (b) => {
1935
- var _ = $r(), f = e.first_child(_), D = e.child(f, !0);
1936
- e.reset(f);
1937
- var V = e.sibling(f, 2), W = e.child(V), L = e.child(W, !0);
1938
- e.reset(W), e.reset(V), e.template_effect(
1939
- (B) => {
1940
- e.set_text(D, B), e.set_attribute(W, "href", e.get(m)), e.set_text(L, e.get(m));
1958
+ var I = (m) => {
1959
+ var b = Hr(), u = e.first_child(b), B = e.child(u, !0);
1960
+ e.reset(u);
1961
+ var N = e.sibling(u, 2), q = e.child(N), j = e.child(q, !0);
1962
+ e.reset(q), e.reset(N), e.template_effect(
1963
+ (O) => {
1964
+ e.set_text(B, O), e.set_attribute(q, "href", e.get(p)), e.set_text(j, e.get(p));
1941
1965
  },
1942
- [() => E.license()]
1943
- ), e.append(b, _);
1966
+ [() => $.license()]
1967
+ ), e.append(m, b);
1944
1968
  };
1945
- e.if(u, (b) => {
1946
- e.get(m) && b(A);
1969
+ e.if(h, (m) => {
1970
+ e.get(p) && m(I);
1947
1971
  });
1948
1972
  }
1949
- var $ = e.sibling(u, 2);
1950
- e.each($, 17, () => e.get(n), e.index, (b, _) => {
1951
- var f = Fr(), D = e.first_child(f), V = e.child(D, !0);
1952
- e.reset(D);
1953
- var W = e.sibling(D, 2), L = e.child(W);
1954
- e.html(L, () => e.get(_).value), e.reset(W), e.template_effect(() => e.set_text(V, e.get(_).label)), e.append(b, f);
1955
- }), e.reset(c), e.reset(k);
1956
- var d = e.sibling(k, 2), z = e.child(d), S = e.child(z);
1957
- S.__click = () => r.toggleMetadataDialog();
1958
- var I = e.child(S, !0);
1959
- e.reset(S), e.reset(z), e.reset(d), e.reset(M);
1960
- var G = e.sibling(M, 2), j = e.child(G);
1961
- j.__click = () => r.toggleMetadataDialog();
1962
- var w = e.child(j, !0);
1963
- e.reset(j), e.reset(G), e.reset(y), e.template_effect(
1964
- (b, _, f) => {
1965
- y.open = r.showMetadataDialog, e.set_text(p, b), e.set_text(I, _), e.set_text(w, f);
1973
+ var G = e.sibling(h, 2);
1974
+ e.each(G, 17, () => e.get(n), e.index, (m, b) => {
1975
+ var u = Yr(), B = e.first_child(u), N = e.child(B, !0);
1976
+ e.reset(B);
1977
+ var q = e.sibling(B, 2), j = e.child(q);
1978
+ e.html(j, () => e.get(b).value), e.reset(q), e.template_effect(() => e.set_text(N, e.get(b).label)), e.append(m, u);
1979
+ }), e.reset(o), e.reset(w);
1980
+ var d = e.sibling(w, 2), A = e.child(d), y = e.child(A);
1981
+ y.__click = () => r.toggleMetadataDialog();
1982
+ var k = e.child(y, !0);
1983
+ e.reset(y), e.reset(A), e.reset(d), e.reset(z);
1984
+ var L = e.sibling(z, 2), T = e.child(L);
1985
+ T.__click = () => r.toggleMetadataDialog();
1986
+ var S = e.child(T, !0);
1987
+ e.reset(T), e.reset(L), e.reset(_), e.template_effect(
1988
+ (m, b, u) => {
1989
+ _.open = r.showMetadataDialog, e.set_text(D, m), e.set_text(k, b), e.set_text(S, u);
1966
1990
  },
1967
1991
  [
1968
- () => e.get(s) ? e.get(s).getLabel().length && e.get(s).getLabel()[0] ? e.get(s).getLabel()[0].value : E.metadata_label_fallback() : E.loading(),
1969
- () => E.close(),
1970
- () => E.close()
1992
+ () => e.get(i) ? e.get(i).getLabel().length && e.get(i).getLabel()[0] ? e.get(i).getLabel()[0].value : $.metadata_label_fallback() : $.loading(),
1993
+ () => $.close(),
1994
+ () => $.close()
1971
1995
  ]
1972
- ), e.append(i, y), e.pop();
1996
+ ), e.append(s, _), e.pop();
1973
1997
  }
1974
1998
  e.delegate(["click"]);
1975
- e.create_custom_element(ct, {}, [], [], !0);
1976
- var Nr = e.from_html('<button class="btn btn-sm btn-circle btn-ghost"><!></button>'), Hr = e.from_html('<span class="loading loading-spinner loading-xs"></span>'), Yr = e.from_html('<div class="flex justify-center p-8"><span class="loading loading-spinner loading-lg text-primary"></span></div>'), Xr = e.from_html('<div class="text-center opacity-50 p-4"> </div>'), qr = e.from_html('<div class="text-center opacity-50 p-4 text-sm"> </div>'), Qr = 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>'), Wr = e.from_html('<div class="leading-relaxed"> </div>'), Ur = 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>'), Jr = e.from_html('<div class="text-xs font-bold opacity-50 uppercase tracking-wider pb-2"> </div> <!>', 1), Kr = 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="flex items-center justify-between p-4 border-b border-base-300"><h2 class="font-bold text-lg"> </h2> <!></div> <div class="p-4 border-b border-base-300 shrink-0"><div class="relative w-full"><input type="text" class="input input-bordered w-full pr-12"/> <button class="btn btn-primary absolute right-0 top-0 h-full rounded-l-none"><!></button></div></div> <div class="flex-1 overflow-y-auto p-4 space-y-4"><!></div></div>');
1977
- function dt(i, t) {
1999
+ e.create_custom_element(dt, {}, [], [], !0);
2000
+ var qr = e.from_html('<button class="btn btn-sm btn-circle btn-ghost"><!></button>'), Qr = e.from_html('<span class="loading loading-spinner loading-xs"></span>'), Wr = e.from_html('<div class="flex justify-center p-8"><span class="loading loading-spinner loading-lg text-primary"></span></div>'), Jr = e.from_html('<div class="text-center opacity-50 p-4"> </div>'), Ur = 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>'), Zr = e.from_html('<div class="leading-relaxed"> </div>'), es = 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>'), ts = e.from_html('<div class="text-xs font-bold opacity-50 uppercase tracking-wider pb-2"> </div> <!>', 1), rs = 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="flex items-center justify-between p-4 border-b border-base-300"><h2 class="font-bold text-lg"> </h2> <!></div> <div class="p-4 border-b border-base-300 shrink-0"><div class="relative w-full"><input type="text" class="input input-bordered w-full pr-12"/> <button class="btn btn-primary absolute right-0 top-0 h-full rounded-l-none"><!></button></div></div> <div class="flex-1 overflow-y-auto p-4 space-y-4"><!></div></div>');
2001
+ function ft(s, t) {
1978
2002
  e.push(t, !0);
1979
- const r = fe(ce);
1980
- let s = e.state(""), n = e.derived(() => {
1981
- var O;
1982
- return ((O = r.config.search) == null ? void 0 : O.showCloseButton) ?? !0;
2003
+ const r = he(ue);
2004
+ let i = e.state(""), n = e.derived(() => {
2005
+ var f;
2006
+ return ((f = r.config.search) == null ? void 0 : f.showCloseButton) ?? !0;
2007
+ });
2008
+ e.user_effect(() => {
2009
+ r.searchQuery !== bt(() => e.get(i)) && e.set(i, r.searchQuery, !0);
1983
2010
  });
1984
2011
  function a() {
1985
- r.search(e.get(s));
2012
+ r.search(e.get(i));
1986
2013
  }
1987
- function C(O) {
1988
- O.key === "Enter" && a();
2014
+ function P(f) {
2015
+ f.key === "Enter" && a();
1989
2016
  }
1990
- function m(O) {
1991
- const v = r.canvases[O.canvasIndex];
1992
- v && (r.canvasId = v.id);
2017
+ function p(f) {
2018
+ const g = r.canvases[f.canvasIndex];
2019
+ g && r.setCanvas(g.id);
1993
2020
  }
1994
- var y = e.comment(), M = e.first_child(y);
2021
+ var _ = e.comment(), z = e.first_child(_);
1995
2022
  {
1996
- var g = (O) => {
1997
- var v = Kr(), p = e.child(v), k = e.child(p), h = e.child(k, !0);
1998
- e.reset(k);
1999
- var l = e.sibling(k, 2);
2023
+ var E = (f) => {
2024
+ var g = rs(), D = e.child(g), w = e.child(D), v = e.child(w, !0);
2025
+ e.reset(w);
2026
+ var l = e.sibling(w, 2);
2000
2027
  {
2001
- var c = (w) => {
2002
- var b = Nr();
2003
- b.__click = () => r.toggleSearchPanel();
2004
- var _ = e.child(b);
2005
- Xe(_, { size: 20, weight: "bold" }), e.reset(b), e.template_effect((f) => e.set_attribute(b, "aria-label", f), [() => E.close_search()]), e.append(w, b);
2028
+ var o = (S) => {
2029
+ var m = qr();
2030
+ m.__click = () => r.toggleSearchPanel();
2031
+ var b = e.child(m);
2032
+ qe(b, { size: 20, weight: "bold" }), e.reset(m), e.template_effect((u) => e.set_attribute(m, "aria-label", u), [() => $.close_search()]), e.append(S, m);
2006
2033
  };
2007
- e.if(l, (w) => {
2008
- e.get(n) && w(c);
2034
+ e.if(l, (S) => {
2035
+ e.get(n) && S(o);
2009
2036
  });
2010
2037
  }
2011
- e.reset(p);
2012
- var R = e.sibling(p, 2), T = e.child(R), u = e.child(T);
2013
- e.remove_input_defaults(u), u.__keydown = C;
2014
- var A = e.sibling(u, 2);
2015
- A.__click = a;
2016
- var $ = e.child(A);
2038
+ e.reset(D);
2039
+ var C = e.sibling(D, 2), x = e.child(C), h = e.child(x);
2040
+ e.remove_input_defaults(h), h.__keydown = P;
2041
+ var I = e.sibling(h, 2);
2042
+ I.__click = a;
2043
+ var G = e.child(I);
2017
2044
  {
2018
- var d = (w) => {
2019
- var b = Hr();
2020
- e.append(w, b);
2021
- }, z = (w) => {
2022
- Ze(w, { size: 20, weight: "bold" });
2045
+ var d = (S) => {
2046
+ var m = Qr();
2047
+ e.append(S, m);
2048
+ }, A = (S) => {
2049
+ et(S, { size: 20, weight: "bold" });
2023
2050
  };
2024
- e.if($, (w) => {
2025
- r.isSearching ? w(d) : w(z, !1);
2051
+ e.if(G, (S) => {
2052
+ r.isSearching ? S(d) : S(A, !1);
2026
2053
  });
2027
2054
  }
2028
- e.reset(A), e.reset(T), e.reset(R);
2029
- var S = e.sibling(R, 2), I = e.child(S);
2055
+ e.reset(I), e.reset(x), e.reset(C);
2056
+ var y = e.sibling(C, 2), k = e.child(y);
2030
2057
  {
2031
- var G = (w) => {
2032
- var b = Yr();
2033
- e.append(w, b);
2034
- }, j = (w) => {
2035
- var b = e.comment(), _ = e.first_child(b);
2058
+ var L = (S) => {
2059
+ var m = Wr();
2060
+ e.append(S, m);
2061
+ }, T = (S) => {
2062
+ var m = e.comment(), b = e.first_child(m);
2036
2063
  {
2037
- var f = (V) => {
2038
- var W = Xr(), L = e.child(W, !0);
2039
- e.reset(W), e.template_effect((B) => e.set_text(L, B), [
2040
- () => E.search_panel_no_results({ query: r.searchQuery })
2041
- ]), e.append(V, W);
2042
- }, D = (V) => {
2043
- var W = e.comment(), L = e.first_child(W);
2064
+ var u = (N) => {
2065
+ var q = Jr(), j = e.child(q, !0);
2066
+ e.reset(q), e.template_effect((O) => e.set_text(j, O), [
2067
+ () => $.search_panel_no_results({ query: r.searchQuery })
2068
+ ]), e.append(N, q);
2069
+ }, B = (N) => {
2070
+ var q = e.comment(), j = e.first_child(q);
2044
2071
  {
2045
- var B = (H) => {
2046
- var N = qr(), ie = e.child(N, !0);
2047
- e.reset(N), e.template_effect((ae) => e.set_text(ie, ae), [() => E.search_panel_instruction()]), e.append(H, N);
2048
- }, U = (H) => {
2049
- var N = Jr(), ie = e.first_child(N), ae = e.child(ie, !0);
2050
- e.reset(ie);
2051
- var oe = e.sibling(ie, 2);
2052
- e.each(oe, 17, () => r.searchResults, e.index, (o, x) => {
2053
- var X = Ur();
2054
- X.__click = () => m(e.get(x));
2055
- var Y = e.child(X), re = e.child(Y), J = e.child(re, !0);
2056
- e.reset(re), e.reset(Y);
2057
- var q = e.sibling(Y, 2);
2072
+ var O = (Y) => {
2073
+ var H = Ur(), re = e.child(H, !0);
2074
+ e.reset(H), e.template_effect((ae) => e.set_text(re, ae), [() => $.search_panel_instruction()]), e.append(Y, H);
2075
+ }, X = (Y) => {
2076
+ var H = ts(), re = e.first_child(H), ae = e.child(re, !0);
2077
+ e.reset(re);
2078
+ var de = e.sibling(re, 2);
2079
+ e.each(de, 17, () => r.searchResults, e.index, (K, se) => {
2080
+ var ce = es();
2081
+ ce.__click = () => p(e.get(se));
2082
+ var c = e.child(ce), R = e.child(c), te = e.child(R, !0);
2083
+ e.reset(R), e.reset(c);
2084
+ var Z = e.sibling(c, 2);
2058
2085
  {
2059
- var Z = (te) => {
2060
- var F = Qr(), Q = e.child(F), se = e.child(Q);
2061
- e.html(se, () => e.get(x).before), e.reset(Q);
2062
- var ne = e.sibling(Q, 2), ue = e.child(ne);
2063
- e.html(ue, () => e.get(x).match), e.reset(ne);
2064
- var $e = e.sibling(ne, 2), Fe = e.child($e);
2065
- e.html(Fe, () => e.get(x).after), e.reset($e), e.reset(F), e.append(te, F);
2066
- }, ee = (te) => {
2067
- var F = Wr(), Q = e.child(F, !0);
2068
- e.reset(F), e.template_effect(() => e.set_text(Q, e.get(x).match)), e.append(te, F);
2086
+ var le = (V) => {
2087
+ var Q = Kr(), J = e.child(Q), ne = e.child(J);
2088
+ e.html(ne, () => e.get(se).before), e.reset(J);
2089
+ var F = e.sibling(J, 2), U = e.child(F);
2090
+ e.html(U, () => e.get(se).match), e.reset(F);
2091
+ var ie = e.sibling(F, 2), oe = e.child(ie);
2092
+ e.html(oe, () => e.get(se).after), e.reset(ie), e.reset(Q), e.append(V, Q);
2093
+ }, W = (V) => {
2094
+ var Q = Zr(), J = e.child(Q, !0);
2095
+ e.reset(Q), e.template_effect(() => e.set_text(J, e.get(se).match)), e.append(V, Q);
2069
2096
  };
2070
- e.if(q, (te) => {
2071
- e.get(x).type === "hit" ? te(Z) : te(ee, !1);
2097
+ e.if(Z, (V) => {
2098
+ e.get(se).type === "hit" ? V(le) : V(W, !1);
2072
2099
  });
2073
2100
  }
2074
- e.reset(X), e.template_effect(() => e.set_text(J, e.get(x).canvasLabel)), e.append(o, X);
2075
- }), e.template_effect((o) => e.set_text(ae, o), [
2076
- () => E.search_panel_results_count({ count: r.searchResults.length })
2077
- ]), e.append(H, N);
2101
+ e.reset(ce), e.template_effect(() => e.set_text(te, e.get(se).canvasLabel)), e.append(K, ce);
2102
+ }), e.template_effect((K) => e.set_text(ae, K), [
2103
+ () => $.search_panel_results_count({ count: r.searchResults.length })
2104
+ ]), e.append(Y, H);
2078
2105
  };
2079
2106
  e.if(
2080
- L,
2081
- (H) => {
2082
- r.searchResults.length === 0 && !r.searchQuery ? H(B) : H(U, !1);
2107
+ j,
2108
+ (Y) => {
2109
+ r.searchResults.length === 0 && !r.searchQuery ? Y(O) : Y(X, !1);
2083
2110
  },
2084
2111
  !0
2085
2112
  );
2086
2113
  }
2087
- e.append(V, W);
2114
+ e.append(N, q);
2088
2115
  };
2089
2116
  e.if(
2090
- _,
2091
- (V) => {
2092
- r.searchResults.length === 0 && r.searchQuery ? V(f) : V(D, !1);
2117
+ b,
2118
+ (N) => {
2119
+ r.searchResults.length === 0 && r.searchQuery ? N(u) : N(B, !1);
2093
2120
  },
2094
2121
  !0
2095
2122
  );
2096
2123
  }
2097
- e.append(w, b);
2124
+ e.append(S, m);
2098
2125
  };
2099
- e.if(I, (w) => {
2100
- r.isSearching ? w(G) : w(j, !1);
2126
+ e.if(k, (S) => {
2127
+ r.isSearching ? S(L) : S(T, !1);
2101
2128
  });
2102
2129
  }
2103
- e.reset(S), e.reset(v), e.template_effect(
2104
- (w, b, _, f) => {
2105
- e.set_attribute(v, "aria-label", w), e.set_text(h, b), e.set_attribute(u, "placeholder", _), e.set_attribute(A, "aria-label", f);
2130
+ e.reset(y), e.reset(g), e.template_effect(
2131
+ (S, m, b, u) => {
2132
+ e.set_attribute(g, "aria-label", S), e.set_text(v, m), e.set_attribute(h, "placeholder", b), e.set_attribute(I, "aria-label", u);
2106
2133
  },
2107
2134
  [
2108
- () => E.search_panel_title(),
2109
- () => E.search(),
2110
- () => E.search_panel_placeholder(),
2111
- () => E.search_panel_title()
2135
+ () => $.search_panel_title(),
2136
+ () => $.search(),
2137
+ () => $.search_panel_placeholder(),
2138
+ () => $.search_panel_title()
2112
2139
  ]
2113
- ), e.bind_value(u, () => e.get(s), (w) => e.set(s, w)), e.append(O, v);
2140
+ ), e.bind_value(h, () => e.get(i), (S) => e.set(i, S)), e.append(f, g);
2114
2141
  };
2115
- e.if(M, (O) => {
2116
- r.showSearchPanel && O(g);
2142
+ e.if(z, (f) => {
2143
+ r.showSearchPanel && f(E);
2117
2144
  });
2118
2145
  }
2119
- e.append(i, y), e.pop();
2146
+ e.append(s, _), e.pop();
2120
2147
  }
2121
2148
  e.delegate(["click", "keydown"]);
2122
- e.create_custom_element(dt, {}, [], [], !0);
2123
- var Zr = e.from_html('<div class="h-full w-[200px] pointer-events-auto relative"><!></div>'), ei = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), ti = e.from_html('<div class="flex-none flex flex-row z-20 bg-base-200 border-r border-base-300 transition-all"><!> <!></div>'), ri = e.from_html('<div class="flex-none h-[140px] w-full pointer-events-auto relative z-20"><!></div>'), ii = 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>'), si = e.from_html('<div class="w-full h-full flex items-center justify-center text-error"> </div>'), ni = e.from_html('<div class="w-full h-full flex items-center justify-center text-base-content/50"> </div>'), ai = e.from_html('<div class="absolute inset-0 z-40 pointer-events-none"><!></div>'), oi = e.from_html('<div class="flex-none h-[140px] w-full pointer-events-auto relative z-20"><!></div>'), li = e.from_html('<div class="relative w-full z-40 pointer-events-auto"><!></div>'), ci = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), di = e.from_html('<div class="h-full w-[200px] pointer-events-auto relative"><!></div>'), fi = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), ui = e.from_html('<div class="flex-none flex flex-row z-20 bg-base-200 border-l border-base-300 transition-all"><!> <!> <!></div>'), gi = 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>');
2124
- function vi(i, t) {
2149
+ e.create_custom_element(ft, {}, [], [], !0);
2150
+ var ss = e.from_html('<div class="h-full w-[200px] pointer-events-auto relative"><!></div>'), is = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), ns = e.from_html('<div class="flex-none flex flex-row z-20 bg-base-200 border-r border-base-300 transition-all"><!> <!></div>'), as = e.from_html('<div class="flex-none h-[140px] w-full pointer-events-auto relative z-20"><!></div>'), os = 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>'), ls = e.from_html('<div class="w-full h-full flex items-center justify-center text-error"> </div>'), cs = e.from_html('<div class="w-full h-full flex items-center justify-center text-base-content/50"> </div>'), ds = e.from_html('<div class="absolute inset-0 z-40 pointer-events-none"><!></div>'), fs = e.from_html('<div class="flex-none h-[140px] w-full pointer-events-auto relative z-20"><!></div>'), us = e.from_html('<div class="relative w-full z-40 pointer-events-auto"><!></div>'), gs = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), hs = e.from_html('<div class="h-full w-[200px] pointer-events-auto relative"><!></div>'), vs = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), ps = e.from_html('<div class="flex-none flex flex-row z-20 bg-base-200 border-l border-base-300 transition-all"><!> <!> <!></div>'), ms = 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>');
2151
+ function bs(s, t) {
2125
2152
  e.push(t, !0);
2126
- 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), C = e.prop(t, "themeConfig", 7), m = e.prop(t, "config", 23, () => ({})), y = e.prop(t, "viewerState", 15), M = e.state(void 0);
2153
+ const r = typeof window < "u";
2154
+ let i = e.prop(t, "manifestId", 7), n = e.prop(t, "canvasId", 7), a = e.prop(t, "plugins", 23, () => []), P = e.prop(t, "theme", 7), p = e.prop(t, "themeConfig", 7), _ = e.prop(t, "config", 23, () => ({})), z = e.prop(t, "viewerState", 15), E = e.state(void 0);
2127
2155
  e.user_effect(() => {
2128
- e.get(M) && qt(e.get(M), a(), C());
2156
+ e.get(E) && Ut(e.get(E), P(), p());
2129
2157
  });
2130
- const g = new Tt(null, void 0, []);
2131
- y(
2132
- g
2158
+ const f = new Bt(null, void 0, []);
2159
+ z(
2160
+ f
2133
2161
  // Expose via bindable prop
2134
- ), ht(ce, g), pt(() => {
2135
- g.destroyAllPlugins();
2162
+ ), _t(ue, f), yt(() => {
2163
+ f.destroyAllPlugins();
2136
2164
  }), e.user_effect(() => {
2137
- r() && g.setManifest(r());
2138
- }), e.user_effect(() => {
2139
- s() && g.setCanvas(s());
2140
- }), e.user_effect(() => {
2141
- m() && (console.log("[Viewer] updateConfig called with:", m()), g.updateConfig(m()));
2165
+ i() && i() !== f.manifestId && f.setManifest(i());
2166
+ });
2167
+ let g = "";
2168
+ e.user_effect(() => {
2169
+ n() && n() !== g && (g = n(), n() !== f.canvasId && f.setCanvas(n()));
2170
+ });
2171
+ let D = "";
2172
+ e.user_effect(() => {
2173
+ if (_()) {
2174
+ const c = JSON.stringify(_());
2175
+ c !== D && (D = c, console.log("[Viewer] updateConfig called with new config:", _()), f.updateConfig(_()));
2176
+ }
2142
2177
  }), e.user_effect(() => {
2143
- for (const o of n())
2144
- g.registerPlugin(o);
2178
+ for (const c of a())
2179
+ f.registerPlugin(c);
2145
2180
  }), e.user_effect(() => {
2146
- const o = () => {
2147
- g.isFullScreen = !!document.fullscreenElement;
2181
+ if (!r) return;
2182
+ const c = () => {
2183
+ f.isFullScreen = !!document.fullscreenElement;
2148
2184
  };
2149
- return document.addEventListener("fullscreenchange", o), () => {
2150
- document.removeEventListener("fullscreenchange", o);
2185
+ return document.addEventListener("fullscreenchange", c), () => {
2186
+ document.removeEventListener("fullscreenchange", c);
2151
2187
  };
2152
2188
  });
2153
- let O = e.derived(() => g.showThumbnailGallery && g.dockSide === "left" || g.pluginPanels.some((o) => o.position === "left" && o.isVisible())), v = e.derived(() => g.showSearchPanel || g.showThumbnailGallery && g.dockSide === "right" || g.pluginPanels.some((o) => o.position === "right" && o.isVisible())), p = e.derived(() => g.manifest), k = e.derived(() => g.canvases), h = e.derived(() => g.currentCanvasIndex), l = e.derived(() => {
2154
- var ee, te;
2155
- if (!e.get(k) || e.get(h) === -1 || !e.get(k)[e.get(h)])
2156
- return (ee = e.get(p)) != null && ee.isFetching || console.log("TriiiceratopsViewer: No canvas found"), null;
2157
- const o = e.get(k)[e.get(h)];
2158
- let x = o.getImages();
2159
- if ((!x || !x.length) && o.getContent && (x = o.getContent()), !x || !x.length)
2160
- return o.__jsonld && o.__jsonld.items, (te = e.get(p)) != null && te.isFetching || console.log("TriiiceratopsViewer: No images/content in canvas"), null;
2161
- const X = x[0];
2162
- let Y = X.getResource ? X.getResource() : null;
2163
- if (!Y && X.getBody) {
2164
- const F = X.getBody();
2165
- Array.isArray(F) && F.length > 0 ? Y = F[0] : F && (Y = F);
2189
+ let w = e.derived(() => f.showThumbnailGallery && f.dockSide === "left" || f.pluginPanels.some((c) => c.position === "left" && c.isVisible())), v = e.derived(() => f.showSearchPanel || f.showThumbnailGallery && f.dockSide === "right" || f.pluginPanels.some((c) => c.position === "right" && c.isVisible())), l = e.derived(() => f.manifest), o = e.derived(() => f.canvases), C = e.derived(() => f.currentCanvasIndex), x = e.derived(() => {
2190
+ var J, ne;
2191
+ if (!e.get(o) || e.get(C) === -1 || !e.get(o)[e.get(C)])
2192
+ return (J = e.get(l)) != null && J.isFetching || console.log("TriiiceratopsViewer: No canvas found"), null;
2193
+ const c = e.get(o)[e.get(C)];
2194
+ let R = c.getImages();
2195
+ if ((!R || !R.length) && c.getContent && (R = c.getContent()), !R || !R.length)
2196
+ return c.__jsonld && c.__jsonld.items, (ne = e.get(l)) != null && ne.isFetching || console.log("TriiiceratopsViewer: No images/content in canvas"), null;
2197
+ const te = R[0];
2198
+ let Z = te.getResource ? te.getResource() : null;
2199
+ if (!Z && te.getBody) {
2200
+ const F = te.getBody();
2201
+ Array.isArray(F) && F.length > 0 ? Z = F[0] : F && (Z = F);
2166
2202
  }
2167
- if (Y && !Y.id && !Y.__jsonld && (!Y.getServices || Y.getServices().length === 0) && (Y = null), !Y) {
2168
- const F = X.__jsonld || X;
2169
- F.body && (Y = Array.isArray(F.body) ? F.body[0] : F.body);
2203
+ if (Z && !Z.id && !Z.__jsonld && (!Z.getServices || Z.getServices().length === 0) && (Z = null), !Z) {
2204
+ const F = te.__jsonld || te;
2205
+ F.body && (Z = Array.isArray(F.body) ? F.body[0] : F.body);
2170
2206
  }
2171
- if (!Y)
2207
+ if (!Z)
2172
2208
  return null;
2173
- const re = (F) => F.id || F["@id"];
2174
- let J = [];
2175
- if (Y.getServices && (J = Y.getServices()), !J.length) {
2176
- const F = Y.__jsonld || Y;
2177
- F.service && (J = Array.isArray(F.service) ? F.service : [F.service]);
2209
+ const le = (F) => F.id || F["@id"];
2210
+ let W = [];
2211
+ if (Z.getServices && (W = Z.getServices()), !W.length) {
2212
+ const F = Z.__jsonld || Z;
2213
+ F.service && (W = Array.isArray(F.service) ? F.service : [F.service]);
2178
2214
  }
2179
- if (J.length > 0) {
2180
- const F = J.find((Q) => {
2181
- const se = Q.getType ? Q.getType() : Q.type || "", ne = Q.getProfile ? Q.getProfile() : Q.profile || "";
2182
- return se === "ImageService1" || se === "ImageService2" || se === "ImageService3" || typeof ne == "string" && ne.includes("http://iiif.io/api/image") || typeof ne == "string" && ne === "level0";
2215
+ if (W.length > 0) {
2216
+ const F = W.find((U) => {
2217
+ const ie = U.getType ? U.getType() : U.type || "", oe = U.getProfile ? U.getProfile() : U.profile || "";
2218
+ return ie === "ImageService1" || ie === "ImageService2" || ie === "ImageService3" || typeof oe == "string" && oe.includes("http://iiif.io/api/image") || typeof oe == "string" && oe === "level0";
2183
2219
  });
2184
2220
  if (F) {
2185
- let Q = re(F);
2186
- return Q && !Q.endsWith("/info.json") && (Q = `${Q}/info.json`), Q;
2221
+ let U = le(F);
2222
+ return U && !U.endsWith("/info.json") && (U = `${U}/info.json`), U;
2187
2223
  }
2188
2224
  }
2189
- const q = re(Y);
2190
- if (q && q.includes("/iiif/")) {
2191
- const F = q.split("/"), Q = F.findIndex((se) => se === "full" || se.match(/^\d+,\d+,\d+,\d+$/));
2192
- if (Q > 0)
2193
- return `${F.slice(0, Q).join("/")}/info.json`;
2225
+ const V = le(Z);
2226
+ if (V && V.includes("/iiif/")) {
2227
+ const F = V.split("/"), U = F.findIndex((ie) => ie === "full" || ie.match(/^\d+,\d+,\d+,\d+$/));
2228
+ if (U > 0)
2229
+ return `${F.slice(0, U).join("/")}/info.json`;
2194
2230
  }
2195
- return console.log("TriiiceratopsViewer: No service or ID found, returning raw URL"), { type: "image", url: q };
2231
+ return console.log("TriiiceratopsViewer: No service or ID found, returning raw URL"), { type: "image", url: V };
2196
2232
  });
2197
- var c = {
2233
+ var h = {
2198
2234
  get manifestId() {
2199
- return r();
2235
+ return i();
2200
2236
  },
2201
- set manifestId(o) {
2202
- r(o), e.flush();
2237
+ set manifestId(c) {
2238
+ i(c), e.flush();
2203
2239
  },
2204
2240
  get canvasId() {
2205
- return s();
2241
+ return n();
2206
2242
  },
2207
- set canvasId(o) {
2208
- s(o), e.flush();
2243
+ set canvasId(c) {
2244
+ n(c), e.flush();
2209
2245
  },
2210
2246
  get plugins() {
2211
- return n();
2247
+ return a();
2212
2248
  },
2213
- set plugins(o = []) {
2214
- n(o), e.flush();
2249
+ set plugins(c = []) {
2250
+ a(c), e.flush();
2215
2251
  },
2216
2252
  get theme() {
2217
- return a();
2253
+ return P();
2218
2254
  },
2219
- set theme(o) {
2220
- a(o), e.flush();
2255
+ set theme(c) {
2256
+ P(c), e.flush();
2221
2257
  },
2222
2258
  get themeConfig() {
2223
- return C();
2259
+ return p();
2224
2260
  },
2225
- set themeConfig(o) {
2226
- C(o), e.flush();
2261
+ set themeConfig(c) {
2262
+ p(c), e.flush();
2227
2263
  },
2228
2264
  get config() {
2229
- return m();
2265
+ return _();
2230
2266
  },
2231
- set config(o = {}) {
2232
- m(o), e.flush();
2267
+ set config(c = {}) {
2268
+ _(c), e.flush();
2233
2269
  },
2234
2270
  get viewerState() {
2235
- return y();
2271
+ return z();
2236
2272
  },
2237
- set viewerState(o) {
2238
- y(o), e.flush();
2273
+ set viewerState(c) {
2274
+ z(c), e.flush();
2239
2275
  }
2240
- }, R = gi(), T = e.child(R);
2276
+ }, I = ms(), G = e.child(I);
2241
2277
  {
2242
- var u = (o) => {
2243
- var x = ti(), X = e.child(x);
2278
+ var d = (c) => {
2279
+ var R = ns(), te = e.child(R);
2244
2280
  {
2245
- var Y = (J) => {
2246
- var q = Zr(), Z = e.child(q);
2247
- de(Z, {
2281
+ var Z = (W) => {
2282
+ var V = ss(), Q = e.child(V);
2283
+ ge(Q, {
2248
2284
  get canvases() {
2249
- return e.get(k);
2285
+ return e.get(o);
2250
2286
  }
2251
- }), e.reset(q), e.append(J, q);
2287
+ }), e.reset(V), e.append(W, V);
2252
2288
  };
2253
- e.if(X, (J) => {
2254
- g.showThumbnailGallery && g.dockSide === "left" && J(Y);
2289
+ e.if(te, (W) => {
2290
+ f.showThumbnailGallery && f.dockSide === "left" && W(Z);
2255
2291
  });
2256
2292
  }
2257
- var re = e.sibling(X, 2);
2258
- e.each(re, 17, () => g.pluginPanels, (J) => J.id, (J, q) => {
2259
- var Z = e.comment(), ee = e.first_child(Z);
2293
+ var le = e.sibling(te, 2);
2294
+ e.each(le, 17, () => f.pluginPanels, (W) => W.id, (W, V) => {
2295
+ var Q = e.comment(), J = e.first_child(Q);
2260
2296
  {
2261
- var te = (F) => {
2262
- var Q = ei(), se = e.child(Q);
2263
- e.component(se, () => e.get(q).component, (ne, ue) => {
2264
- ue(ne, e.spread_props(() => e.get(q).props ?? {}));
2265
- }), e.reset(Q), e.append(F, Q);
2297
+ var ne = (F) => {
2298
+ var U = is(), ie = e.child(U);
2299
+ e.component(ie, () => e.get(V).component, (oe, Ve) => {
2300
+ Ve(oe, e.spread_props(() => e.get(V).props ?? {}));
2301
+ }), e.reset(U), e.append(F, U);
2266
2302
  };
2267
- e.if(ee, (F) => {
2268
- e.get(q).isVisible() && e.get(q).position === "left" && F(te);
2303
+ e.if(J, (F) => {
2304
+ e.get(V).isVisible() && e.get(V).position === "left" && F(ne);
2269
2305
  });
2270
2306
  }
2271
- e.append(J, Z);
2272
- }), e.reset(x), e.append(o, x);
2307
+ e.append(W, Q);
2308
+ }), e.reset(R), e.append(c, R);
2273
2309
  };
2274
- e.if(T, (o) => {
2275
- e.get(O) && o(u);
2310
+ e.if(G, (c) => {
2311
+ e.get(w) && c(d);
2276
2312
  });
2277
2313
  }
2278
- var A = e.sibling(T, 2), $ = e.child(A);
2314
+ var A = e.sibling(G, 2), y = e.child(A);
2279
2315
  {
2280
- var d = (o) => {
2281
- var x = ri(), X = e.child(x);
2282
- de(X, {
2316
+ var k = (c) => {
2317
+ var R = as(), te = e.child(R);
2318
+ ge(te, {
2283
2319
  get canvases() {
2284
- return e.get(k);
2320
+ return e.get(o);
2285
2321
  }
2286
- }), e.reset(x), e.append(o, x);
2322
+ }), e.reset(R), e.append(c, R);
2287
2323
  };
2288
- e.if($, (o) => {
2289
- g.showThumbnailGallery && g.dockSide === "top" && o(d);
2324
+ e.if(y, (c) => {
2325
+ f.showThumbnailGallery && f.dockSide === "top" && c(k);
2290
2326
  });
2291
2327
  }
2292
- var z = e.sibling($, 2), S = e.child(z);
2328
+ var L = e.sibling(y, 2), T = e.child(L);
2293
2329
  {
2294
- var I = (o) => {
2295
- var x = ii();
2296
- e.append(o, x);
2297
- }, G = (o) => {
2298
- var x = e.comment(), X = e.first_child(x);
2330
+ var S = (c) => {
2331
+ var R = os();
2332
+ e.append(c, R);
2333
+ }, m = (c) => {
2334
+ var R = e.comment(), te = e.first_child(R);
2299
2335
  {
2300
- var Y = (J) => {
2301
- var q = si(), Z = e.child(q);
2302
- e.reset(q), e.template_effect(
2303
- (ee) => e.set_text(Z, `${ee ?? ""}
2304
- ${e.get(p).error ?? ""}`),
2305
- [() => E.error_prefix()]
2306
- ), e.append(J, q);
2307
- }, re = (J) => {
2308
- var q = e.comment(), Z = e.first_child(q);
2336
+ var Z = (W) => {
2337
+ var V = ls(), Q = e.child(V);
2338
+ e.reset(V), e.template_effect(
2339
+ (J) => e.set_text(Q, `${J ?? ""}
2340
+ ${e.get(l).error ?? ""}`),
2341
+ [() => $.error_prefix()]
2342
+ ), e.append(W, V);
2343
+ }, le = (W) => {
2344
+ var V = e.comment(), Q = e.first_child(V);
2309
2345
  {
2310
- var ee = (F) => {
2311
- var Q = e.comment(), se = e.first_child(Q);
2312
- e.key(se, () => e.get(l), (ne) => {
2313
- st(ne, {
2346
+ var J = (F) => {
2347
+ var U = e.comment(), ie = e.first_child(U);
2348
+ e.key(ie, () => e.get(x), (oe) => {
2349
+ nt(oe, {
2314
2350
  get tileSources() {
2315
- return e.get(l);
2351
+ return e.get(x);
2316
2352
  },
2317
2353
  get viewerState() {
2318
- return g;
2354
+ return f;
2319
2355
  }
2320
2356
  });
2321
- }), e.append(F, Q);
2322
- }, te = (F) => {
2323
- var Q = ni(), se = e.child(Q, !0);
2324
- e.reset(Q), e.template_effect((ne) => e.set_text(se, ne), [() => E.no_image_found()]), e.append(F, Q);
2357
+ }), e.append(F, U);
2358
+ }, ne = (F) => {
2359
+ var U = cs(), ie = e.child(U, !0);
2360
+ e.reset(U), e.template_effect((oe) => e.set_text(ie, oe), [() => $.no_image_found()]), e.append(F, U);
2325
2361
  };
2326
2362
  e.if(
2327
- Z,
2363
+ Q,
2328
2364
  (F) => {
2329
- e.get(l) ? F(ee) : F(te, !1);
2365
+ e.get(x) ? F(J) : F(ne, !1);
2330
2366
  },
2331
2367
  !0
2332
2368
  );
2333
2369
  }
2334
- e.append(J, q);
2370
+ e.append(W, V);
2335
2371
  };
2336
2372
  e.if(
2337
- X,
2338
- (J) => {
2339
- var q;
2340
- (q = e.get(p)) != null && q.error ? J(Y) : J(re, !1);
2373
+ te,
2374
+ (W) => {
2375
+ var V;
2376
+ (V = e.get(l)) != null && V.error ? W(Z) : W(le, !1);
2341
2377
  },
2342
2378
  !0
2343
2379
  );
2344
2380
  }
2345
- e.append(o, x);
2381
+ e.append(c, R);
2346
2382
  };
2347
- e.if(S, (o) => {
2348
- var x;
2349
- (x = e.get(p)) != null && x.isFetching ? o(I) : o(G, !1);
2383
+ e.if(T, (c) => {
2384
+ var R;
2385
+ (R = e.get(l)) != null && R.isFetching ? c(S) : c(m, !1);
2350
2386
  });
2351
2387
  }
2352
- var j = e.sibling(S, 2);
2353
- at(j, {});
2354
- var w = e.sibling(j, 2);
2355
- ct(w, {});
2356
- var b = e.sibling(w, 2);
2388
+ var b = e.sibling(T, 2);
2389
+ ot(b, {});
2390
+ var u = e.sibling(b, 2);
2391
+ dt(u, {});
2392
+ var B = e.sibling(u, 2);
2357
2393
  {
2358
- var _ = (o) => {
2359
- ot(o, {});
2394
+ var N = (c) => {
2395
+ lt(c, {});
2360
2396
  };
2361
- e.if(b, (o) => {
2362
- g.showRightMenu && o(_);
2397
+ e.if(B, (c) => {
2398
+ f.showRightMenu && c(N);
2363
2399
  });
2364
2400
  }
2365
- var f = e.sibling(b, 2);
2401
+ var q = e.sibling(B, 2);
2366
2402
  {
2367
- var D = (o) => {
2368
- lt(o, {});
2403
+ var j = (c) => {
2404
+ ct(c, {});
2369
2405
  };
2370
- e.if(f, (o) => {
2371
- g.showLeftMenu && o(D);
2406
+ e.if(q, (c) => {
2407
+ f.showLeftMenu && c(j);
2372
2408
  });
2373
2409
  }
2374
- var V = e.sibling(f, 2);
2375
- e.each(V, 17, () => g.pluginPanels, (o) => o.id, (o, x) => {
2376
- var X = e.comment(), Y = e.first_child(X);
2410
+ var O = e.sibling(q, 2);
2411
+ e.each(O, 17, () => f.pluginPanels, (c) => c.id, (c, R) => {
2412
+ var te = e.comment(), Z = e.first_child(te);
2377
2413
  {
2378
- var re = (J) => {
2379
- var q = ai(), Z = e.child(q);
2380
- e.component(Z, () => e.get(x).component, (ee, te) => {
2381
- te(ee, e.spread_props(() => e.get(x).props ?? {}));
2382
- }), e.reset(q), e.append(J, q);
2414
+ var le = (W) => {
2415
+ var V = ds(), Q = e.child(V);
2416
+ e.component(Q, () => e.get(R).component, (J, ne) => {
2417
+ ne(J, e.spread_props(() => e.get(R).props ?? {}));
2418
+ }), e.reset(V), e.append(W, V);
2383
2419
  };
2384
- e.if(Y, (J) => {
2385
- e.get(x).isVisible() && e.get(x).position === "overlay" && J(re);
2420
+ e.if(Z, (W) => {
2421
+ e.get(R).isVisible() && e.get(R).position === "overlay" && W(le);
2386
2422
  });
2387
2423
  }
2388
- e.append(o, X);
2424
+ e.append(c, te);
2389
2425
  });
2390
- var W = e.sibling(V, 2);
2426
+ var X = e.sibling(O, 2);
2391
2427
  {
2392
- var L = (o) => {
2393
- nt(o, {
2428
+ var Y = (c) => {
2429
+ at(c, {
2394
2430
  get viewerState() {
2395
- return g;
2431
+ return f;
2396
2432
  }
2397
2433
  });
2398
2434
  };
2399
- e.if(W, (o) => {
2400
- e.get(k).length > 1 && g.showCanvasNav && o(L);
2435
+ e.if(X, (c) => {
2436
+ e.get(o).length > 1 && f.showCanvasNav && c(Y);
2401
2437
  });
2402
2438
  }
2403
- var B = e.sibling(W, 2);
2439
+ var H = e.sibling(X, 2);
2404
2440
  {
2405
- var U = (o) => {
2406
- de(o, {
2441
+ var re = (c) => {
2442
+ ge(c, {
2407
2443
  get canvases() {
2408
- return e.get(k);
2444
+ return e.get(o);
2409
2445
  }
2410
2446
  });
2411
2447
  };
2412
- e.if(B, (o) => {
2413
- g.showThumbnailGallery && g.dockSide === "none" && o(U);
2448
+ e.if(H, (c) => {
2449
+ f.showThumbnailGallery && f.dockSide === "none" && c(re);
2414
2450
  });
2415
2451
  }
2416
- e.reset(z);
2417
- var H = e.sibling(z, 2);
2452
+ e.reset(L);
2453
+ var ae = e.sibling(L, 2);
2418
2454
  {
2419
- var N = (o) => {
2420
- var x = oi(), X = e.child(x);
2421
- de(X, {
2455
+ var de = (c) => {
2456
+ var R = fs(), te = e.child(R);
2457
+ ge(te, {
2422
2458
  get canvases() {
2423
- return e.get(k);
2459
+ return e.get(o);
2424
2460
  }
2425
- }), e.reset(x), e.append(o, x);
2461
+ }), e.reset(R), e.append(c, R);
2426
2462
  };
2427
- e.if(H, (o) => {
2428
- g.showThumbnailGallery && g.dockSide === "bottom" && o(N);
2463
+ e.if(ae, (c) => {
2464
+ f.showThumbnailGallery && f.dockSide === "bottom" && c(de);
2429
2465
  });
2430
2466
  }
2431
- var ie = e.sibling(H, 2);
2432
- e.each(ie, 17, () => g.pluginPanels, (o) => o.id, (o, x) => {
2433
- var X = e.comment(), Y = e.first_child(X);
2467
+ var K = e.sibling(ae, 2);
2468
+ e.each(K, 17, () => f.pluginPanels, (c) => c.id, (c, R) => {
2469
+ var te = e.comment(), Z = e.first_child(te);
2434
2470
  {
2435
- var re = (J) => {
2436
- var q = li(), Z = e.child(q);
2437
- e.component(Z, () => e.get(x).component, (ee, te) => {
2438
- te(ee, e.spread_props(() => e.get(x).props ?? {}));
2439
- }), e.reset(q), e.append(J, q);
2471
+ var le = (W) => {
2472
+ var V = us(), Q = e.child(V);
2473
+ e.component(Q, () => e.get(R).component, (J, ne) => {
2474
+ ne(J, e.spread_props(() => e.get(R).props ?? {}));
2475
+ }), e.reset(V), e.append(W, V);
2440
2476
  };
2441
- e.if(Y, (J) => {
2442
- e.get(x).isVisible() && e.get(x).position === "bottom" && J(re);
2477
+ e.if(Z, (W) => {
2478
+ e.get(R).isVisible() && e.get(R).position === "bottom" && W(le);
2443
2479
  });
2444
2480
  }
2445
- e.append(o, X);
2481
+ e.append(c, te);
2446
2482
  }), e.reset(A);
2447
- var ae = e.sibling(A, 2);
2483
+ var se = e.sibling(A, 2);
2448
2484
  {
2449
- var oe = (o) => {
2450
- var x = ui(), X = e.child(x);
2485
+ var ce = (c) => {
2486
+ var R = ps(), te = e.child(R);
2451
2487
  {
2452
- var Y = (Z) => {
2453
- var ee = ci(), te = e.child(ee);
2454
- dt(te, {}), e.reset(ee), e.append(Z, ee);
2488
+ var Z = (Q) => {
2489
+ var J = gs(), ne = e.child(J);
2490
+ ft(ne, {}), e.reset(J), e.append(Q, J);
2455
2491
  };
2456
- e.if(X, (Z) => {
2457
- g.showSearchPanel && Z(Y);
2492
+ e.if(te, (Q) => {
2493
+ f.showSearchPanel && Q(Z);
2458
2494
  });
2459
2495
  }
2460
- var re = e.sibling(X, 2);
2496
+ var le = e.sibling(te, 2);
2461
2497
  {
2462
- var J = (Z) => {
2463
- var ee = di(), te = e.child(ee);
2464
- de(te, {
2498
+ var W = (Q) => {
2499
+ var J = hs(), ne = e.child(J);
2500
+ ge(ne, {
2465
2501
  get canvases() {
2466
- return e.get(k);
2502
+ return e.get(o);
2467
2503
  }
2468
- }), e.reset(ee), e.append(Z, ee);
2504
+ }), e.reset(J), e.append(Q, J);
2469
2505
  };
2470
- e.if(re, (Z) => {
2471
- g.showThumbnailGallery && g.dockSide === "right" && Z(J);
2506
+ e.if(le, (Q) => {
2507
+ f.showThumbnailGallery && f.dockSide === "right" && Q(W);
2472
2508
  });
2473
2509
  }
2474
- var q = e.sibling(re, 2);
2475
- e.each(q, 17, () => g.pluginPanels, (Z) => Z.id, (Z, ee) => {
2476
- var te = e.comment(), F = e.first_child(te);
2510
+ var V = e.sibling(le, 2);
2511
+ e.each(V, 17, () => f.pluginPanels, (Q) => Q.id, (Q, J) => {
2512
+ var ne = e.comment(), F = e.first_child(ne);
2477
2513
  {
2478
- var Q = (se) => {
2479
- var ne = fi(), ue = e.child(ne);
2480
- e.component(ue, () => e.get(ee).component, ($e, Fe) => {
2481
- Fe($e, e.spread_props(() => e.get(ee).props ?? {}));
2482
- }), e.reset(ne), e.append(se, ne);
2514
+ var U = (ie) => {
2515
+ var oe = vs(), Ve = e.child(oe);
2516
+ e.component(Ve, () => e.get(J).component, (ut, gt) => {
2517
+ gt(ut, e.spread_props(() => e.get(J).props ?? {}));
2518
+ }), e.reset(oe), e.append(ie, oe);
2483
2519
  };
2484
- e.if(F, (se) => {
2485
- e.get(ee).isVisible() && e.get(ee).position === "right" && se(Q);
2520
+ e.if(F, (ie) => {
2521
+ e.get(J).isVisible() && e.get(J).position === "right" && ie(U);
2486
2522
  });
2487
2523
  }
2488
- e.append(Z, te);
2489
- }), e.reset(x), e.append(o, x);
2524
+ e.append(Q, ne);
2525
+ }), e.reset(R), e.append(c, R);
2490
2526
  };
2491
- e.if(ae, (o) => {
2492
- e.get(v) && o(oe);
2527
+ e.if(se, (c) => {
2528
+ e.get(v) && c(ce);
2493
2529
  });
2494
2530
  }
2495
- return e.reset(R), e.bind_this(R, (o) => e.set(M, o), () => e.get(M)), e.append(i, R), e.pop(c);
2531
+ return e.reset(I), e.bind_this(I, (c) => e.set(E, c), () => e.get(E)), e.append(s, I), e.pop(h);
2496
2532
  }
2497
2533
  e.create_custom_element(
2498
- vi,
2534
+ bs,
2499
2535
  {
2500
2536
  manifestId: {},
2501
2537
  canvasId: {},
@@ -2510,18 +2546,18 @@ e.create_custom_element(
2510
2546
  !0
2511
2547
  );
2512
2548
  export {
2513
- Ei as BasePlugin,
2514
- zt as DAISYUI_THEMES,
2515
- Mt as ManifestsState,
2516
- vi as TriiiceratopsViewer,
2517
- ce as VIEWER_STATE_KEY,
2518
- Tt as ViewerState,
2519
- Ht as applyBuiltInTheme,
2520
- qt as applyTheme,
2521
- Yt as applyThemeConfig,
2522
- Xt as clearThemeConfig,
2523
- $t as hexToOklch,
2524
- Di as isBuiltInTheme,
2525
- Vt as normalizeColor,
2526
- Gi as parseThemeConfig
2549
+ Ns as BasePlugin,
2550
+ Dt as DAISYUI_THEMES,
2551
+ Lt as ManifestsState,
2552
+ bs as TriiiceratopsViewer,
2553
+ ue as VIEWER_STATE_KEY,
2554
+ Bt as ViewerState,
2555
+ Qt as applyBuiltInTheme,
2556
+ Ut as applyTheme,
2557
+ Wt as applyThemeConfig,
2558
+ Jt as clearThemeConfig,
2559
+ Ht as hexToOklch,
2560
+ $s as isBuiltInTheme,
2561
+ Xt as normalizeColor,
2562
+ Es as parseThemeConfig
2527
2563
  };