triiiceratops 0.7.1 → 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 Ne = (i, t, r) => ut(i, typeof t != "symbol" ? t + "" : t, r), gt = (i, t, r) => t.has(i) || qe("Cannot " + r);
7
- var M = (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 $i } 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 Fe 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(M(this, ge));
36
+ return e.get(M(this, ve));
37
37
  }
38
38
  set manifests(t) {
39
- e.set(M(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(), a = mt.parseManifest(s);
49
- this.manifests[t] = { json: s, manifesto: a, 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 a = s.getSequences()[0].getCanvasById(r);
88
- if (!a) return [];
89
- const o = a.__jsonld;
90
- let I = [];
91
- const b = (w) => w.resources || w.items || [];
92
- return o.otherContent && o.otherContent.forEach((w) => {
93
- const P = w["@id"] || w.id;
94
- if (P && !w.resources) {
95
- const g = this.manifests[P];
96
- if (g) {
97
- if (g.json) {
98
- const O = b(g.json);
99
- I.push(...O);
85
+ const i = this.getManifest(t);
86
+ if (!i) return [];
87
+ const n = i.getSequences()[0].getCanvasById(r);
88
+ if (!n) return [];
89
+ const a = n.__jsonld;
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(P);
103
- } else w.resources && I.push(...w.resources);
104
- }), o.annotations && o.annotations.forEach((w) => {
105
- const P = w.id || w["@id"];
106
- if (P && !w.items) {
107
- const g = this.manifests[P];
108
- if (g) {
109
- if (g.json) {
110
- const O = b(g.json);
111
- I.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(P);
115
- } else w.items && I.push(...w.items);
116
- }), I;
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, Ee, Ge, Oe, Be;
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));
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
146
  Ne(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(
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
- Ee,
154
+ Ge,
155
155
  // ==================== PLUGIN STATE ====================
156
156
  /** Registered plugins */
157
157
  e.state(e.proxy([]))
158
158
  );
159
- K(this, Ge, e.state(e.proxy([])));
160
- K(this, Oe, e.state(e.proxy([])));
161
- K(this, Be, e.state(null));
159
+ ee(this, $e, e.state(e.proxy([])));
160
+ ee(this, Ee, e.state(e.proxy([])));
161
+ ee(this, Fe, e.state(null));
162
162
  Ne(this, "pluginEventHandlers", /* @__PURE__ */ new Map());
163
- this.manifestId = t || null, this.canvasId = r || null, this.manifestId && le.fetchManifest(this.manifestId);
164
- for (const a of s)
165
- this.registerPlugin(a);
163
+ this.manifestId = t || null, this.canvasId = r || null, this.manifestId && fe.fetchManifest(this.manifestId);
164
+ for (const n of i)
165
+ this.registerPlugin(n);
166
166
  }
167
167
  get manifestId() {
168
- return e.get(M(this, ve));
168
+ return e.get(M(this, pe));
169
169
  }
170
170
  set manifestId(t) {
171
- e.set(M(this, ve), t, !0);
171
+ e.set(M(this, pe), t, !0);
172
172
  }
173
173
  get canvasId() {
174
- return e.get(M(this, he));
174
+ return e.get(M(this, me));
175
175
  }
176
176
  set canvasId(t) {
177
- e.set(M(this, he), t, !0);
177
+ e.set(M(this, me), t, !0);
178
178
  }
179
179
  get showAnnotations() {
180
- return e.get(M(this, pe));
180
+ return e.get(M(this, be));
181
181
  }
182
182
  set showAnnotations(t) {
183
- e.set(M(this, pe), t, !0);
183
+ e.set(M(this, be), t, !0);
184
184
  }
185
185
  get showThumbnailGallery() {
186
- return e.get(M(this, me));
186
+ return e.get(M(this, _e));
187
187
  }
188
188
  set showThumbnailGallery(t) {
189
- e.set(M(this, me), t, !0);
189
+ e.set(M(this, _e), t, !0);
190
190
  }
191
191
  get isGalleryDockedBottom() {
192
- return e.get(M(this, be));
192
+ return e.get(M(this, ye));
193
193
  }
194
194
  set isGalleryDockedBottom(t) {
195
- e.set(M(this, be), t, !0);
195
+ e.set(M(this, ye), t, !0);
196
196
  }
197
197
  get isGalleryDockedRight() {
198
- return e.get(M(this, _e));
198
+ return e.get(M(this, we));
199
199
  }
200
200
  set isGalleryDockedRight(t) {
201
- e.set(M(this, _e), t, !0);
201
+ e.set(M(this, we), t, !0);
202
202
  }
203
203
  get isFullScreen() {
204
- return e.get(M(this, ye));
204
+ return e.get(M(this, xe));
205
205
  }
206
206
  set isFullScreen(t) {
207
- e.set(M(this, ye), t, !0);
207
+ e.set(M(this, xe), t, !0);
208
208
  }
209
209
  get showMetadataDialog() {
210
- return e.get(M(this, we));
210
+ return e.get(M(this, Se));
211
211
  }
212
212
  set showMetadataDialog(t) {
213
- e.set(M(this, we), t, !0);
213
+ e.set(M(this, Se), t, !0);
214
214
  }
215
215
  get dockSide() {
216
- return e.get(M(this, xe));
216
+ return e.get(M(this, Ae));
217
217
  }
218
218
  set dockSide(t) {
219
- e.set(M(this, xe), t, !0);
219
+ e.set(M(this, Ae), t, !0);
220
220
  }
221
221
  get visibleAnnotationIds() {
222
- return e.get(M(this, Se));
222
+ return e.get(M(this, Ie));
223
223
  }
224
224
  set visibleAnnotationIds(t) {
225
- e.set(M(this, Se), t, !0);
225
+ e.set(M(this, Ie), t, !0);
226
226
  }
227
227
  get config() {
228
- return e.get(M(this, Ae));
228
+ return e.get(M(this, Ce));
229
229
  }
230
230
  set config(t) {
231
- e.set(M(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(M(this, Ie));
243
+ return e.get(M(this, ke));
244
244
  }
245
245
  set galleryPosition(t) {
246
- e.set(M(this, Ie), t, !0);
246
+ e.set(M(this, ke), t, !0);
247
247
  }
248
248
  get gallerySize() {
249
- return e.get(M(this, Ce));
249
+ return e.get(M(this, Pe));
250
250
  }
251
251
  set gallerySize(t) {
252
- e.set(M(this, Ce), t, !0);
252
+ e.set(M(this, Pe), t, !0);
253
253
  }
254
254
  get isGalleryDragging() {
255
- return e.get(M(this, ke));
255
+ return e.get(M(this, Me));
256
256
  }
257
257
  set isGalleryDragging(t) {
258
- e.set(M(this, ke), t, !0);
258
+ e.set(M(this, Me), t, !0);
259
259
  }
260
260
  get galleryDragOffset() {
261
- return e.get(M(this, Pe));
261
+ return e.get(M(this, Te));
262
262
  }
263
263
  set galleryDragOffset(t) {
264
- e.set(M(this, Pe), t, !0);
264
+ e.set(M(this, Te), t, !0);
265
265
  }
266
266
  get dragOverSide() {
267
- return e.get(M(this, Me));
267
+ return e.get(M(this, ze));
268
268
  }
269
269
  set dragOverSide(t) {
270
- e.set(M(this, Me), t, !0);
270
+ e.set(M(this, ze), t, !0);
271
271
  }
272
272
  get galleryCenterPanelRect() {
273
- return e.get(M(this, Te));
273
+ return e.get(M(this, je));
274
274
  }
275
275
  set galleryCenterPanelRect(t) {
276
- e.set(M(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,22 +381,22 @@ class Tt {
373
381
  this.showMetadataDialog = !this.showMetadataDialog;
374
382
  }
375
383
  get searchQuery() {
376
- return e.get(M(this, ze));
384
+ return e.get(M(this, Le));
377
385
  }
378
386
  set searchQuery(t) {
379
- e.set(M(this, ze), t, !0);
387
+ e.set(M(this, Le), t, !0);
380
388
  }
381
389
  get searchResults() {
382
- return e.get(M(this, je));
390
+ return e.get(M(this, Be));
383
391
  }
384
392
  set searchResults(t) {
385
- e.set(M(this, je), t, !0);
393
+ e.set(M(this, Be), t, !0);
386
394
  }
387
395
  get isSearching() {
388
- return e.get(M(this, Le));
396
+ return e.get(M(this, De));
389
397
  }
390
398
  set isSearching(t) {
391
- e.set(M(this, Le), t, !0);
399
+ e.set(M(this, De), t, !0);
392
400
  }
393
401
  get showSearchPanel() {
394
402
  return e.get(M(this, Re));
@@ -400,132 +408,148 @@ class Tt {
400
408
  this.showSearchPanel = !this.showSearchPanel, this.showSearchPanel || (this.searchAnnotations = []), this.dispatchStateChange();
401
409
  }
402
410
  get searchAnnotations() {
403
- return e.get(M(this, De));
411
+ return e.get(M(this, Oe));
404
412
  }
405
413
  set searchAnnotations(t) {
406
- e.set(M(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
- const a = this.manifest;
417
- if (!a) throw new Error("No manifest loaded");
418
- let o = a.getService("http://iiif.io/api/search/1/search") || a.getService("http://iiif.io/api/search/0/search");
419
- if (o || a.__jsonld && a.__jsonld.service && (o = (Array.isArray(a.__jsonld.service) ? a.__jsonld.service : [a.__jsonld.service]).find((C) => C.profile === "http://iiif.io/api/search/1/search" || C.profile === "http://iiif.io/api/search/0/search")), !o) {
427
+ const n = this.manifest;
428
+ if (!n) throw new Error("No manifest loaded");
429
+ let a = n.getService("http://iiif.io/api/search/1/search") || n.getService("http://iiif.io/api/search/0/search");
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 b = `${o.id || o["@id"]}?q=${encodeURIComponent(t)}`, w = await fetch(b);
424
- if (!w.ok) throw new Error("Search request failed");
425
- const P = await w.json(), g = P.resources || [], O = [], v = (p) => {
426
- const C = typeof p == "string" ? p : p["@id"] || p.id;
427
- if (!C) return null;
428
- const h = C.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 (P.hits)
434
- for (const p of P.hits) {
435
- const C = p.annotations || [];
436
- for (const h of C) {
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 C = typeof p.on == "string" ? p.on : p.on["@id"] || p.on.id, h = C.split("#")[0], l = v(C), 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, C) => {
486
- const h = this.canvases[p.canvasIndex], l = `${h.id}#xywh=${p.bounds.join(",")}`;
487
- return {
488
- "@id": `urn:search-hit:${C}`,
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
- } catch (a) {
500
- console.error("Search error:", a);
523
+ } catch (n) {
524
+ console.error("Search error:", n);
501
525
  } finally {
502
526
  this.isSearching = !1;
503
527
  }
504
528
  }
505
529
  }
506
530
  get plugins() {
507
- return e.get(M(this, Ee));
531
+ return e.get(M(this, Ge));
508
532
  }
509
533
  set plugins(t) {
510
- e.set(M(this, Ee), t, !0);
534
+ e.set(M(this, Ge), t, !0);
511
535
  }
512
536
  get pluginMenuButtons() {
513
- return e.get(M(this, Ge));
537
+ return e.get(M(this, $e));
514
538
  }
515
539
  set pluginMenuButtons(t) {
516
- e.set(M(this, Ge), t, !0);
540
+ e.set(M(this, $e), t, !0);
517
541
  }
518
542
  get pluginPanels() {
519
- return e.get(M(this, Oe));
543
+ return e.get(M(this, Ee));
520
544
  }
521
545
  set pluginPanels(t) {
522
- e.set(M(this, Oe), t, !0);
546
+ e.set(M(this, Ee), t, !0);
523
547
  }
524
548
  get osdViewer() {
525
- return e.get(M(this, Be));
549
+ return e.get(M(this, Fe));
526
550
  }
527
551
  set osdViewer(t) {
528
- e.set(M(this, Be), 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) {
548
- const a = t.pluginEventHandlers.get(r);
549
- a == null || a.forEach((o) => o(s));
571
+ emit(r, i) {
572
+ const n = t.pluginEventHandlers.get(r);
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), () => {
553
- var a;
554
- (a = t.pluginEventHandlers.get(r)) == null || a.delete(s);
575
+ on(r, i) {
576
+ return t.pluginEventHandlers.has(r) || t.pluginEventHandlers.set(r, /* @__PURE__ */ new Set()), t.pluginEventHandlers.get(r).add(i), () => {
577
+ var n;
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;
574
- const r = this.plugins.find((a) => a.id === t);
575
- r && ((s = r.onDestroy) == null || s.call(r), this.plugins = this.plugins.filter((a) => a.id !== t), this.pluginMenuButtons = this.pluginMenuButtons.filter((a) => !a.id.startsWith(`${t}:`)), this.pluginPanels = this.pluginPanels.filter((a) => !a.id.startsWith(`${t}:`)));
597
+ var i;
598
+ const r = this.plugins.find((n) => n.id === 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(), Ee = new WeakMap(), Ge = new WeakMap(), Oe = new WeakMap(), Be = 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 = (I) => I.endsWith("%") ? parseFloat(I) / 100 * 255 : parseFloat(I), s = r(t[1]), a = r(t[2]), o = r(t[3]);
651
- return isNaN(s) || isNaN(a) || isNaN(o) ? null : { r: s, g: a, b: o };
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 He(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, a = 0.0329845436 * i + 0.9293118715 * t + 0.0361456387 * r, o = 0.0482003018 * i + 0.2643662691 * t + 0.633851707 * r, I = Math.cbrt(s), b = Math.cbrt(a), w = Math.cbrt(o);
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 * I + 0.793617785 * b - 0.0040720468 * w,
668
- a: 1.9779984951 * I - 2.428592205 * b + 0.4505937099 * w,
669
- b: 0.0259040371 * I + 0.7827717662 * b - 0.808675766 * w
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 Et(i, t, r) {
673
- const s = Math.sqrt(t * t + r * r);
674
- let a = Math.atan2(r, t) * 180 / Math.PI;
675
- return a < 0 && (a += 360), { L: i, C: s, h: a };
696
+ function Et(s, t, r) {
697
+ const i = Math.sqrt(t * t + r * r);
698
+ let n = Math.atan2(r, t) * 180 / Math.PI;
699
+ return n < 0 && (n += 360), { L: s, C: i, h: n };
676
700
  }
677
- function et(i, t, r) {
678
- const s = He(i), a = He(t), o = He(r), { x: I, y: b, z: w } = Rt(s, a, o), { L: P, a: g, b: O } = Dt(I, b, w);
679
- return Et(P, 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), a = t.toFixed(4), o = t < 1e-4 ? 0 : r.toFixed(2);
683
- return `oklch(${s}% ${a} ${o})`;
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 Gt(i) {
686
- return i.trim().toLowerCase().startsWith("oklch(");
709
+ function Ft(s) {
710
+ return s.trim().toLowerCase().startsWith("oklch(");
687
711
  }
688
- function Ot(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 Bt(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: a } = et(t.r, t.g, t.b);
701
- return tt(r, s, a);
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: a } = et(t.r, t.g, t.b);
708
- return tt(r, s, a);
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 Gt(t) ? t : Ot(t) ? $t(t) : Bt(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 Ei(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;
783
- const a = r;
784
- if (a === "colorScheme") {
785
- i.style.colorScheme = s;
804
+ function Wt(s, t) {
805
+ for (const [r, i] of Object.entries(t)) {
806
+ if (i == null) continue;
807
+ const n = r;
808
+ if (n === "colorScheme") {
809
+ s.style.colorScheme = i;
786
810
  continue;
787
811
  }
788
- const o = rt[a];
789
- if (!o) continue;
790
- let I = String(s);
791
- Nt.has(a) && (I = Vt(I)), i.style.setProperty(o, I);
812
+ const a = st[n];
813
+ if (!a) continue;
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 Ye(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 Ye(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,236 +856,236 @@ 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 a = ((r = i.__jsonld) == null ? void 0 : r.on) || ((s = i.__jsonld) == null ? void 0 : s.target);
839
- if (a)
840
- return Je(a);
841
- }
842
- const t = i.target || i.on;
843
- return t ? Je(t) : null;
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);
863
+ if (n)
864
+ return Ke(n);
865
+ }
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 = [], a = r.querySelectorAll("polygon");
868
- for (const b of a) {
869
- const w = b.getAttribute("points");
870
- if (w) {
871
- const P = Jt(w);
872
- s.push(...P);
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
- const o = r.querySelectorAll("path");
876
- for (const b of o) {
877
- const w = b.getAttribute("d");
878
- if (w) {
879
- const P = Kt(w);
880
- s.push(...P);
899
+ const a = r.querySelectorAll("path");
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 I = r.querySelectorAll("circle");
884
- for (const b of I) {
885
- const w = parseFloat(b.getAttribute("cx") || "0"), P = parseFloat(b.getAttribute("cy") || "0"), g = parseFloat(b.getAttribute("r") || "0"), O = Zt(w, P, 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 [a, o] = s.split(",").map((I) => parseFloat(I));
900
- !isNaN(a) && !isNaN(o) && t.push([a, o]);
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));
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 a = parseFloat(s[1]), o = parseFloat(s[2]);
909
- !isNaN(a) && !isNaN(o) && t.push([a, o]);
930
+ let i;
931
+ for (; (i = r.exec(s)) !== null; ) {
932
+ const n = parseFloat(i[1]), a = parseFloat(i[2]);
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) {
914
- const a = [];
915
- for (let o = 0; o < s; o++) {
916
- const I = o / s * Math.PI * 2, b = i + r * Math.cos(I), w = t + r * Math.sin(I);
917
- a.push([b, w]);
937
+ function sr(s, t, r, i = 8) {
938
+ const n = [];
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
- return a;
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 Ye(s);
927
- const a = (r = i.__jsonld) == null ? void 0 : r.on;
928
- if (a) {
929
- const o = Xe(a);
930
- if (o) return o;
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;
952
+ if (n) {
953
+ const a = Xe(n);
954
+ if (a) return a;
931
955
  }
932
956
  }
933
- const t = i.target || i.on;
957
+ const t = s.target || s.on;
934
958
  return t ? Xe(t) : null;
935
959
  }
936
- function Xe(i) {
937
- if (!i) return null;
938
- if (Array.isArray(i))
939
- for (const t of i) {
960
+ function Xe(s) {
961
+ if (!s) return null;
962
+ if (Array.isArray(s))
963
+ for (const t of s) {
940
964
  const r = Xe(t);
941
965
  if (r) return r;
942
966
  }
943
- if (typeof i == "string" && i.includes("xywh="))
944
- return Ye(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
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)) {
957
- const a = [];
958
- for (const o of s) {
959
- const I = o.getValue ? o.getValue() : "";
960
- if (I) {
961
- a.push(I);
962
- const b = o.getFormat ? o.getFormat() : "";
963
- (b === "text/html" || b === "application/html") && (r = !0);
978
+ if (typeof s.getBody == "function") {
979
+ const i = s.getBody();
980
+ if (i && Array.isArray(i)) {
981
+ const n = [];
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
- t = a.join(" ");
990
+ t = n.join(" ");
967
991
  }
968
992
  } else {
969
- const s = (o) => o && (o.chars || o.value || o["cnt:chars"]) || "", a = (o) => o ? o.format === "text/html" || o.type === "TextualBody" : !1;
970
- if (i.resource) {
971
- const o = Array.isArray(i.resource) ? i.resource : [i.resource];
972
- t = o.map(s).filter(Boolean).join(" "), r = o.some(a);
973
- } else if (i.body) {
974
- const o = Array.isArray(i.body) ? i.body : [i.body];
975
- t = o.map(s).filter(Boolean).join(" "), r = o.some(a);
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}`, a = Qt(i);
982
- if (!a)
1004
+ function ar(s, t, r = !1) {
1005
+ const i = it(s) || `anno-${t}`, n = Kt(s);
1006
+ if (!n)
983
1007
  return null;
984
- const o = tr(i);
1008
+ const a = nr(s);
985
1009
  return {
986
- id: s,
987
- geometry: a,
988
- body: o,
1010
+ id: i,
1011
+ geometry: n,
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) => {
994
- const a = t.has(it(r));
995
- return rr(r, s, a);
1016
+ function or(s, t = /* @__PURE__ */ new Set()) {
1017
+ return s.map((r, i) => {
1018
+ const n = t.has(it(r));
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), a = e.state(void 0), o = e.state(void 0), I = e.state(0), b = 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
- }), w = 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
- }), P = e.derived(() => ir(e.get(b), e.get(w))), g = e.derived(() => {
1013
- if (e.get(I), !e.get(o) || !e.get(P).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(o).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(P)) {
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(o).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])), k = e.get(o).viewport.viewportToViewerElementCoordinates(S);
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);
1041
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(() => {
1060
- if (e.get(a))
1083
+ mt(() => {
1084
+ if (e.get(n))
1061
1085
  return e.set(
1062
- o,
1063
- Qe({
1064
- element: e.get(a),
1086
+ a,
1087
+ We({
1088
+ element: e.get(n),
1065
1089
  tileSources: null,
1066
1090
  // Will be set via effect
1067
1091
  prefixUrl: "",
@@ -1077,57 +1101,57 @@ function st(i, t) {
1077
1101
  zoomPerClick: 2
1078
1102
  }),
1079
1103
  !0
1080
- ), s().notifyOSDReady(e.get(o)), () => {
1081
- var h;
1082
- (h = e.get(o)) == 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
- if (!e.get(o)) return;
1086
- const h = () => {
1087
- e.update(I);
1109
+ if (!e.get(a)) return;
1110
+ const v = () => {
1111
+ e.update(P);
1088
1112
  };
1089
- return e.get(o).addHandler("open", h), e.get(o).addHandler("animation", h), e.get(o).addHandler("resize", h), e.get(o).addHandler("rotate", h), e.get(o).world.addHandler("add-item", h), e.get(o).world.addHandler("remove-item", h), () => {
1090
- e.get(o).removeHandler("open", h), e.get(o).removeHandler("animation", h), e.get(o).removeHandler("resize", h), e.get(o).removeHandler("rotate", h), e.get(o).world.removeHandler("add-item", h), e.get(o).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
- !e.get(o) || !r() || e.get(o).open(r());
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(a, h), () => e.get(a));
1110
- var C = e.sibling(p, 2);
1111
- return e.each(C, 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 k = nr(), D = e.child(k), j = e.child(D, !0);
1129
- e.reset(D);
1130
- var x = e.sibling(D);
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);
1131
1155
  e.reset(k), e.template_effect(
1132
1156
  (m) => {
1133
1157
  e.set_style(k, `
@@ -1135,300 +1159,300 @@ function st(i, t) {
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(x, "points", m), e.set_class(x, 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
1164
  [() => e.get(l).points.map((m) => m.join(",")).join(" ")]
1141
- ), e.append(S, k);
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
- }, a = or(), o = e.child(a);
1173
- o.__click = () => r().previousCanvas();
1174
- var I = e.child(o);
1175
- bt(I, { size: 20, weight: "bold" }), e.reset(o);
1176
- var b = e.sibling(o, 2), w = e.child(b);
1177
- e.reset(b);
1178
- var P = e.sibling(b, 2);
1179
- P.__click = () => r().nextCanvas();
1180
- var g = e.child(P);
1181
- return _t(g, { size: 20, weight: "bold" }), e.reset(P), e.reset(a), e.template_effect(
1182
- (O, v) => {
1183
- o.disabled = !r().hasPrevious, e.set_attribute(o, "aria-label", O), e.set_text(w, `${r().currentCanvasIndex + 1} / ${r().canvases.length ?? ""}`), P.disabled = !r().hasNext, e.set_attribute(P, "aria-label", v);
1196
+ }, n = fr(), a = e.child(n);
1197
+ a.__click = () => r().previousCanvas();
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, a), 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 a(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 C = /* @__PURE__ */ new Set();
1208
- e.get(s).forEach((h) => {
1209
- const l = a(h);
1210
- l && C.add(l);
1211
- }), r.visibleAnnotationIds = C;
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 o = e.derived(() => e.get(s).length === 0 ? !1 : e.get(s).every((v) => {
1218
- const p = a(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 I(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 b() {
1225
- if (e.get(o))
1248
+ function p() {
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 C = a(p);
1231
- C && v.add(C);
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 w = e.derived(() => e.get(s).length ? e.get(s).map((v) => {
1236
- let p = "", C = !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(" "), C = 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)) && (C = !0)) : (p = h(v.resource), l(v.resource) && (C = !0)) : v.body && (Array.isArray(v.body) ? (p = v.body.map((c) => h(c)).join(" "), v.body.some((c) => l(c)) && (C = !0)) : (p = h(v.body), l(v.body) && (C = !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: a(v),
1262
- content: p,
1263
- isHtml: C,
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 P = e.comment(), g = e.first_child(P);
1291
+ var z = e.comment(), E = e.first_child(z);
1268
1292
  {
1269
- var O = (v) => {
1270
- var p = fr(), C = e.child(p), h = e.child(C), l = e.child(h);
1293
+ var f = (g) => {
1294
+ var D = vr(), w = e.child(D), v = e.child(w), l = e.child(v);
1271
1295
  l.__click = (k) => {
1272
- k.preventDefault(), b();
1296
+ k.preventDefault(), p();
1273
1297
  };
1274
- var c = e.child(l);
1298
+ var o = e.child(l);
1275
1299
  {
1276
- var R = (k) => {
1277
- We(k, { size: 16, weight: "bold" });
1278
- }, T = (k) => {
1300
+ var C = (k) => {
1301
+ Je(k, { size: 16, weight: "bold" });
1302
+ }, x = (k) => {
1279
1303
  Ue(k, { size: 16, weight: "bold" });
1280
1304
  };
1281
- e.if(c, (k) => {
1282
- e.get(o) ? k(R) : k(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(w),
1322
+ () => e.get(_),
1299
1323
  e.index,
1300
- (k, D, j) => {
1301
- const x = e.derived(() => r.visibleAnnotationIds.has(e.get(D).id));
1302
- var m = cr();
1303
- m.__click = (n) => {
1304
- n.preventDefault(), I(e.get(D).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 y = e.child(m), f = e.child(y);
1330
+ var b = e.child(m), u = e.child(b);
1307
1331
  {
1308
- var G = (n) => {
1309
- We(n, { size: 16, weight: "bold" });
1310
- }, V = (n) => {
1311
- Ue(n, { 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, (n) => {
1314
- e.get(x) ? n(G) : n(V, !1);
1337
+ e.if(u, (K) => {
1338
+ e.get(S) ? K(B) : K(N, !1);
1315
1339
  });
1316
1340
  }
1317
- e.reset(y);
1318
- var U = e.sibling(y, 2), L = e.child(U), B = e.child(L);
1319
- B.textContent = `#${j + 1}`;
1320
- var q = 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 re = (n) => {
1323
- var _ = lr(), Y = e.child(_, !0);
1324
- e.reset(_), e.template_effect(() => e.set_text(Y, e.get(D).label)), e.append(n, _);
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(q, (n) => {
1327
- e.get(D).label && e.get(D).label !== e.get(D).content && n(re);
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 se = e.sibling(L, 2), oe = e.child(se);
1354
+ e.reset(j);
1355
+ var H = e.sibling(j, 2), re = e.child(H);
1332
1356
  {
1333
- var Q = (n) => {
1334
- var _ = e.comment(), Y = e.first_child(_);
1335
- e.html(Y, () => e.get(D).content), e.append(n, _);
1336
- }, H = (n) => {
1337
- var _ = e.text();
1338
- e.template_effect(() => e.set_text(_, e.get(D).content || "(No content)")), e.append(n, _);
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(oe, (n) => {
1341
- e.get(D).isHtml ? n(Q) : n(H, !1);
1364
+ e.if(re, (K) => {
1365
+ e.get(L).isHtml ? K(ae) : K(de, !1);
1342
1366
  });
1343
1367
  }
1344
- e.reset(se), e.reset(U), e.reset(m), e.template_effect(() => e.set_class(se, 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(x) ? "" : "opacity-50"}`)), e.append(k, m);
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
1370
  (k) => {
1347
- var D = dr();
1348
- e.append(k, D);
1371
+ var L = hr();
1372
+ e.append(k, L);
1349
1373
  }
1350
- ), e.reset(S), e.reset(C), e.reset(p), e.template_effect(
1351
- (k, D, j) => {
1352
- e.set_attribute(l, "title", k), e.set_text(A, `${D ?? ""} `), 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(o) ? 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, P), 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
- }), a = e.derived(() => {
1400
+ }), n = e.derived(() => {
1377
1401
  var d;
1378
1402
  return ((d = r.config.gallery) == null ? void 0 : d.showCloseButton) ?? !0;
1379
- }), o = e.prop(t, "canvases", 7), I = e.state(!1), b = { x: 0, y: 0, w: 0, h: 0 }, w = e.state(null), P = e.derived(() => !o() || !Array.isArray(o()) ? [] : o().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
1407
  const k = d.getThumbnail();
1384
- k && (S = typeof k == "string" ? k : k.id || k["@id"]);
1408
+ k && (y = typeof k == "string" ? k : k.id || k["@id"]);
1385
1409
  }
1386
1410
  } catch (k) {
1387
1411
  console.warn("Error getting thumbnail", k);
1388
1412
  }
1389
- if (!S) {
1413
+ if (!y) {
1390
1414
  let k = d.getImages();
1391
1415
  if ((!k || !k.length) && d.getContent && (k = d.getContent()), k && k.length > 0) {
1392
- const D = k[0];
1393
- let j = D.getResource ? D.getResource() : null;
1394
- if (!j && D.getBody) {
1395
- const x = D.getBody();
1396
- Array.isArray(x) && x.length > 0 ? j = x[0] : x && (j = x);
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 x = D.__jsonld || D;
1400
- x.body && (j = Array.isArray(x.body) ? x.body[0] : x.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) {
1426
+ if (T) {
1403
1427
  const m = (() => {
1404
- let f = [];
1405
- if (j.getServices && (f = j.getServices()), !f || f.length === 0) {
1406
- const G = j.__jsonld || j;
1407
- G.service && (f = Array.isArray(G.service) ? G.service : [G.service]);
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 y = !1;
1435
+ let b = !1;
1412
1436
  if (m.length > 0) {
1413
- const f = m[0];
1414
- let G = "";
1437
+ const u = m[0];
1438
+ let B = "";
1415
1439
  try {
1416
- if (G = f.getProfile ? f.getProfile() : f.profile || "", typeof G == "object" && G) {
1417
- const L = G;
1418
- G = 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(G ?? "").toLowerCase();
1423
- (V.includes("level0") || V.includes("level-0")) && (y = !0);
1424
- const U = f.id || f["@id"];
1425
- y || (S = `${U}/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 (D.__jsonld && D.__jsonld.body ? f = D.__jsonld.body : D.body && (f = D.body), f) {
1430
- const G = Array.isArray(f) ? f[0] : f;
1431
- S = G.id || G["@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 k = Math.max(0, window.innerWidth - r.gallerySize.width), D = Math.max(0, window.innerHeight - r.gallerySize.height);
1448
- z = Math.max(0, Math.min(z, k)), S = Math.max(0, Math.min(S, D)), 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 x = d.clientX, m = d.clientY, y = 60;
1455
- r.dragOverSide = null, x >= j.left && x <= j.left + y ? r.dragOverSide = "left" : x <= j.right && x >= j.right - y ? r.dragOverSide = "right" : m >= j.top && m <= j.top + y ? r.dragOverSide = "top" : m <= j.bottom && m >= j.bottom - y && (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(I, !0), b = {
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", C);
1491
+ }, window.addEventListener("mousemove", D), window.addEventListener("mouseup", w);
1468
1492
  }
1469
- function p(d) {
1470
- if (!e.get(I)) return;
1471
- const z = d.clientX - b.x, S = d.clientY - b.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, b.w + z),
1474
- height: Math.max(200, b.h + S)
1497
+ width: Math.max(200, p.w + A),
1498
+ height: Math.max(200, p.h + y)
1475
1499
  };
1476
1500
  }
1477
- function C() {
1478
- e.set(I, !1), window.removeEventListener("mousemove", p), window.removeEventListener("mouseup", C);
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,1034 +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 D, 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 x = Math.max(0, d.clientX - 150), m = Math.max(0, d.clientY - 20);
1500
- const y = Math.max(0, window.innerWidth - 300), f = Math.max(0, window.innerHeight - 400);
1501
- x = Math.min(x, y), m = Math.min(m, f), r.galleryPosition = { x, y: m }, r.galleryDragOffset = { x: d.clientX - x, y: d.clientY - m };
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 = (D = e.get(w)) == null ? void 0 : D.getRootNode(), k = ((j = S == null ? void 0 : S.getElementById) == null ? void 0 : j.call(S, "triiiceratops-center-panel")) ?? document.getElementById("triiiceratops-center-panel");
1508
- 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", 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
- return o();
1536
+ return a();
1513
1537
  },
1514
1538
  set canvases(d) {
1515
- o(d), e.flush();
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), k = e.child(S);
1543
+ var G = (d) => {
1544
+ var A = Sr(), y = e.first_child(A), k = e.child(y);
1521
1545
  {
1522
- var D = (L) => {
1523
- var B = ur();
1524
- B.__click = () => r.toggleThumbnailGallery();
1525
- var q = e.child(B);
1526
- Fe(q, { 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(k, (L) => {
1529
- e.get(a) && L(D);
1552
+ e.if(k, (j) => {
1553
+ e.get(n) && j(L);
1530
1554
  });
1531
1555
  }
1532
- var j = e.sibling(k, 2);
1556
+ var T = e.sibling(k, 2);
1533
1557
  {
1534
- var x = (L) => {
1535
- var B = gr(), q = e.child(B);
1536
- q.__mousedown = R;
1537
- var re = e.child(q);
1538
- e.reset(q), 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(q, 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(re, 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(x);
1566
+ e.if(T, (j) => {
1567
+ (e.get(i) || e.get(l) === "none") && j(S);
1544
1568
  });
1545
1569
  }
1546
- var m = e.sibling(j, 2), y = e.child(m);
1547
- e.each(y, 21, () => e.get(P), e.index, (L, B) => {
1548
- var q = pr();
1549
- q.__click = () => h(e.get(B).id);
1550
- var re = e.child(q), se = e.child(re);
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 oe = (N) => {
1553
- var ie = vr();
1576
+ var re = (c) => {
1577
+ var R = br();
1554
1578
  e.template_effect(() => {
1555
- e.set_attribute(ie, "src", e.get(B).src), e.set_attribute(ie, "alt", e.get(B).label);
1556
- }), e.append(N, ie);
1557
- }, Q = (N) => {
1558
- var ie = hr();
1559
- e.append(N, ie);
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(se, (N) => {
1562
- e.get(B).src ? N(oe) : N(Q, !1);
1585
+ e.if(H, (c) => {
1586
+ e.get(O).src ? c(re) : c(ae, !1);
1563
1587
  });
1564
1588
  }
1565
- e.reset(re);
1566
- var H = e.sibling(re, 2), n = e.child(H), _ = e.child(n);
1567
- e.reset(n);
1568
- var Y = e.sibling(n);
1569
- e.reset(H), e.reset(q), e.template_effect(() => {
1570
- e.set_class(q, 1, `group flex flex-col gap-1 p-1 rounded hover:bg-base-200 transition-colors text-left relative shrink-0 ${e.get(c) ? "w-[140px]" : ""} ${r.canvasId === e.get(B).id ? "ring-2 ring-primary bg-primary/5" : ""}`), e.set_attribute(q, "aria-label", `Select canvas ${e.get(B).label ?? ""}`), e.set_text(_, `${e.get(B).index + 1}.`), e.set_text(Y, ` ${e.get(B).label ?? ""}`);
1571
- }), e.append(L, q);
1572
- }), e.reset(y), e.reset(m);
1573
- var f = e.sibling(m, 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 G = (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(G);
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(w, L), () => e.get(w));
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 U = (L) => {
1587
- var B = br(), q = e.first_child(B), re = e.sibling(q, 2), se = e.sibling(re, 2), oe = e.sibling(se, 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(q, 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(re, 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(se, 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(oe, 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(U);
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(m, 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(y, 1, e.clsx(e.get(c) ? "flex flex-row gap-2 h-full items-center" : "grid gap-2")), e.set_style(y, 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('<button class="btn btn-circle btn-lg btn-neutral shadow-lg"><!></button>'), jr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Lr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Rr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Dr = e.from_html('<div class="tooltip tooltip-left"><!></div>'), Er = e.from_html('<div class="fab fab-flower fab-top-left absolute z-600 pointer-events-auto flex-col items-end transition-all duration-300 bottom-6 right-6"><div class="tooltip tooltip-left"><div tabindex="0" role="button" class="btn btn-lg btn-primary btn-circle shadow-xl"><span class="sr-only"> </span> <!></div></div> <div class="fab-close tooltip tooltip-top"><!></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 = () => b.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
- b.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 = () => b.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 ${b.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
- () => b.showThumbnailGallery ? E.hide_gallery() : E.show_gallery()
1659
+ () => p.showThumbnailGallery ? $.hide_gallery() : $.show_gallery()
1636
1660
  ]
1637
- ), e.append(T, u);
1638
- }, a = (T) => {
1639
- var u = xr();
1640
- u.__click = () => b.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
- b.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 ${b.isFullScreen ? "btn-warning" : "btn-neutral"}`)), e.append(T, u);
1653
- }, o = (T) => {
1654
- var u = Sr();
1655
- u.__click = () => b.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 ${b.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
- }, I = (T) => {
1664
- var u = Ar();
1665
- u.__click = () => b.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 ${b.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
- }, b = fe(ce), w = e.derived(() => b.config.rightMenu || {}), P = e.derived(() => e.get(w).showSearch !== !1), g = e.derived(() => e.get(w).showGallery !== !1), O = e.derived(() => e.get(w).showFullscreen !== !1), v = e.derived(() => e.get(w).showAnnotations !== !1), p = e.derived(() => e.get(w).showInfo !== !1), C = e.derived(() => [
1674
- e.get(P) ? "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 $ = (y) => {
1686
- var f = Ir(), G = e.child(f);
1687
- r(G), e.reset(f), e.template_effect((V) => e.set_attribute(f, "data-tip", V), [() => E.search()]), e.append(y, 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, (y) => {
1690
- e.get(P) && y($);
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 = (y) => {
1696
- var f = Cr(), G = e.child(f);
1697
- s(G), e.reset(f), e.template_effect((V) => e.set_attribute(f, "data-tip", V), [
1698
- () => b.showThumbnailGallery ? E.hide_gallery() : E.show_gallery()
1699
- ]), e.append(y, 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, (y) => {
1702
- e.get(g) && y(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 k = (y) => {
1708
- var f = kr(), G = e.child(f);
1709
- a(G), e.reset(f), e.template_effect((V) => e.set_attribute(f, "data-tip", V), [
1710
- () => b.isFullScreen ? E.exit_full_screen() : E.enter_full_screen()
1711
- ]), e.append(y, 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, (y) => {
1714
- e.get(O) && y(k);
1737
+ e.if(y, (b) => {
1738
+ e.get(f) && b(k);
1715
1739
  });
1716
1740
  }
1717
- var D = e.sibling(S, 2);
1741
+ var L = e.sibling(y, 2);
1718
1742
  {
1719
- var j = (y) => {
1720
- var f = Pr(), G = e.child(f);
1721
- o(G), e.reset(f), e.template_effect((V) => e.set_attribute(f, "data-tip", V), [
1722
- () => b.showAnnotations ? E.hide_annotations() : E.show_annotations()
1723
- ]), e.append(y, 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(D, (y) => {
1726
- e.get(v) && y(j);
1749
+ e.if(L, (b) => {
1750
+ e.get(g) && b(T);
1727
1751
  });
1728
1752
  }
1729
- var x = e.sibling(D, 2);
1753
+ var S = e.sibling(L, 2);
1730
1754
  {
1731
- var m = (y) => {
1732
- var f = Mr(), G = e.child(f);
1733
- I(G), e.reset(f), e.template_effect((V) => e.set_attribute(f, "data-tip", V), [() => E.metadata()]), e.append(y, 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(x, (y) => {
1736
- e.get(p) && y(m);
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 = Er(), S = e.child(z), k = e.child(S), D = e.child(k), j = e.child(D, !0);
1745
- e.reset(D);
1746
- var x = e.sibling(D, 2);
1747
- Ct(x, { size: 32, weight: "bold" }), e.reset(k), e.reset(S);
1748
- var m = e.sibling(S, 2), y = e.child(m);
1749
- {
1750
- var f = (Q) => {
1751
- r(Q);
1752
- }, G = (Q) => {
1753
- var H = zr();
1754
- H.__click = (_) => {
1755
- document.activeElement instanceof HTMLElement && document.activeElement.blur();
1756
- };
1757
- var n = e.child(H);
1758
- Fe(n, { size: 28, weight: "bold" }), e.reset(H), e.template_effect((_) => e.set_attribute(H, "aria-label", _), [() => E.close_menu()]), e.append(Q, H);
1759
- };
1760
- e.if(y, (Q) => {
1761
- e.get(P) ? Q(f) : Q(G, !1);
1762
- });
1763
- }
1764
- e.reset(m);
1765
- var V = e.sibling(m, 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);
1766
1775
  {
1767
- var U = (Q) => {
1768
- var H = jr(), n = e.child(H);
1769
- s(n), e.reset(H), e.template_effect((_) => e.set_attribute(H, "data-tip", _), [
1770
- () => b.showThumbnailGallery ? E.hide_gallery() : E.show_gallery()
1771
- ]), e.append(Q, H);
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);
1772
1781
  };
1773
- e.if(V, (Q) => {
1774
- e.get(g) && Q(U);
1782
+ e.if(b, (Y) => {
1783
+ e.get(E) && Y(u);
1775
1784
  });
1776
1785
  }
1777
- var L = e.sibling(V, 2);
1786
+ var B = e.sibling(b, 2);
1778
1787
  {
1779
- var B = (Q) => {
1780
- var H = Lr(), n = e.child(H);
1781
- a(n), e.reset(H), e.template_effect((_) => e.set_attribute(H, "data-tip", _), [
1782
- () => b.isFullScreen ? E.exit_full_screen() : E.enter_full_screen()
1783
- ]), e.append(Q, H);
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);
1784
1793
  };
1785
- e.if(L, (Q) => {
1786
- e.get(O) && Q(B);
1794
+ e.if(B, (Y) => {
1795
+ e.get(f) && Y(N);
1787
1796
  });
1788
1797
  }
1789
- var q = e.sibling(L, 2);
1798
+ var q = e.sibling(B, 2);
1790
1799
  {
1791
- var re = (Q) => {
1792
- var H = Rr(), n = e.child(H);
1793
- o(n), e.reset(H), e.template_effect((_) => e.set_attribute(H, "data-tip", _), [
1794
- () => b.showAnnotations ? E.hide_annotations() : E.show_annotations()
1795
- ]), e.append(Q, H);
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);
1796
1805
  };
1797
- e.if(q, (Q) => {
1798
- e.get(v) && Q(re);
1806
+ e.if(q, (Y) => {
1807
+ e.get(g) && Y(j);
1799
1808
  });
1800
1809
  }
1801
- var se = e.sibling(q, 2);
1810
+ var O = e.sibling(q, 2);
1802
1811
  {
1803
- var oe = (Q) => {
1804
- var H = Dr(), n = e.child(H);
1805
- I(n), e.reset(H), e.template_effect((_) => e.set_attribute(H, "data-tip", _), [() => E.metadata()]), e.append(Q, H);
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);
1806
1815
  };
1807
- e.if(se, (Q) => {
1808
- e.get(p) && Q(oe);
1816
+ e.if(O, (Y) => {
1817
+ e.get(D) && Y(X);
1809
1818
  });
1810
1819
  }
1811
- e.reset(z), e.template_effect(
1812
- (Q, H, n) => {
1813
- e.set_attribute(S, "data-tip", Q), e.set_text(j, H), e.set_attribute(m, "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);
1814
1823
  },
1815
- [
1816
- () => E.menu(),
1817
- () => E.menu(),
1818
- () => e.get(P) ? E.search() : E.close_menu()
1819
- ]
1820
- ), e.append(d, z);
1824
+ [() => $.menu(), () => $.search()]
1825
+ ), e.append(d, A);
1821
1826
  };
1822
1827
  e.if(
1823
- A,
1828
+ I,
1824
1829
  (d) => {
1825
- e.get(C).length > 1 && d($);
1830
+ e.get(w).length > 1 && d(G);
1826
1831
  },
1827
1832
  !0
1828
1833
  );
1829
1834
  }
1830
- e.append(T, u);
1835
+ e.append(x, h);
1831
1836
  };
1832
- e.if(l, (T) => {
1833
- e.get(C).length === 1 ? T(c) : T(R, !1);
1837
+ e.if(l, (x) => {
1838
+ e.get(w).length === 1 ? x(o) : x(C, !1);
1834
1839
  });
1835
1840
  }
1836
- e.append(i, h), e.pop();
1841
+ e.append(s, v), e.pop();
1837
1842
  }
1838
1843
  e.delegate(["click"]);
1839
- e.create_custom_element(ot, {}, [], [], !0);
1840
- 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>');
1841
- 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) {
1842
1847
  e.push(t, !0);
1843
- const r = fe(ce);
1844
- let s = e.derived(() => [...r.pluginMenuButtons].sort((P, g) => (P.order ?? 100) - (g.order ?? 100))), a = e.state(!1);
1845
- function o() {
1846
- e.set(a, !e.get(a));
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);
1850
+ function a() {
1851
+ e.set(n, !e.get(n));
1847
1852
  }
1848
- var I = e.comment(), b = e.first_child(I);
1853
+ var P = e.comment(), p = e.first_child(P);
1849
1854
  {
1850
- var w = (P) => {
1851
- var g = Or(), O = e.child(g);
1852
- e.each(O, 21, () => e.get(s), (c) => c.id, (c, R) => {
1853
- const T = e.derived(() => e.get(R).icon);
1854
- var u = Gr(), A = e.child(u);
1855
- A.__click = () => {
1856
- e.get(R).onClick(), e.set(a, !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);
1857
1862
  };
1858
- var $ = e.child(A);
1859
- e.component($, () => e.get(T), (d, z) => {
1860
- z(d, { size: 28, weight: "bold" });
1861
- }), 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(
1862
1867
  (d) => {
1863
- 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 ?? ""}`);
1864
1869
  },
1865
1870
  [
1866
1871
  () => {
1867
- var d, z;
1868
- 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";
1869
1874
  }
1870
1875
  ]
1871
- ), e.append(c, u);
1872
- }), e.reset(O);
1873
- var v = e.sibling(O, 2), p = e.child(v);
1874
- p.__click = o;
1875
- var C = 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);
1876
1881
  {
1877
- var h = (c) => {
1878
- Fe(c, { size: 28, weight: "bold" });
1879
- }, l = (c) => {
1880
- 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" });
1881
1886
  };
1882
- e.if(C, (c) => {
1883
- e.get(a) ? c(h) : c(l, !1);
1887
+ e.if(w, (o) => {
1888
+ e.get(n) ? o(v) : o(l, !1);
1884
1889
  });
1885
1890
  }
1886
- e.reset(p), e.reset(v), e.reset(g), e.template_effect(
1887
- (c, R) => {
1888
- e.set_class(O, 1, `flex flex-col-reverse gap-3 mb-3 transition-all duration-300 origin-bottom ${e.get(a) ? "opacity-100 translate-y-0 scale-100" : "opacity-0 translate-y-4 scale-90 pointer-events-none"}`), e.set_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(a) ? "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);
1889
1894
  },
1890
- [() => E.plugins_tooltip(), () => E.plugins_tooltip()]
1891
- ), e.append(P, g);
1895
+ [() => $.plugins_tooltip(), () => $.plugins_tooltip()]
1896
+ ), e.append(z, E);
1892
1897
  };
1893
- e.if(b, (P) => {
1894
- e.get(s).length > 0 && P(w);
1898
+ e.if(p, (z) => {
1899
+ e.get(i).length > 0 && z(_);
1895
1900
  });
1896
1901
  }
1897
- e.append(i, I), e.pop();
1902
+ e.append(s, P), e.pop();
1898
1903
  }
1899
1904
  e.delegate(["click"]);
1900
- e.create_custom_element(lt, {}, [], [], !0);
1901
- var Br = e.from_html('<div class="mb-6 prose"><p><!></p></div>'), $r = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><!></dd>', 1), Fr = 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), Vr = e.from_html('<dt class="font-bold text-lg opacity-70 mt-6"> </dt> <dd class="text-sm ps-2"><!></dd>', 1), Nr = 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>');
1902
- 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) {
1903
1908
  e.push(t, !0);
1904
- const r = fe(ce);
1905
- let s = e.derived(() => r.manifest), a = e.derived(() => {
1906
- const m = yt.current;
1907
- if (!e.get(s)) return [];
1908
- const y = e.get(s).getMetadata();
1909
- return y ? y.map((f) => {
1910
- let G = "", V = "";
1911
- const U = (L) => {
1912
- if (typeof L == "string") return L;
1913
- if (Array.isArray(L)) {
1914
- let B = L.find((q) => q.locale === m || q.language === m);
1915
- return B || (B = L.find((q) => q.locale === "en" || q.language === "en")), B || (B = L.find((q) => !q.locale && !q.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 : "";
1916
1921
  }
1917
- return String(L);
1922
+ return String(j);
1918
1923
  };
1919
- return f.getLabel ? G = U(f.getLabel()) : f.label && (G = U(f.label)), f.getValue ? V = U(f.getValue()) : f.value && (V = U(f.value)), { label: G, 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 };
1920
1925
  }) : [];
1921
- }), o = e.derived(() => e.get(s) ? e.get(s).getDescription() : ""), I = e.derived(() => {
1926
+ }), a = e.derived(() => e.get(i) ? e.get(i).getDescription() : ""), P = e.derived(() => {
1922
1927
  var m;
1923
- return e.get(s) ? (m = e.get(s).getRequiredStatement()) == null ? void 0 : m.getValue() : "";
1924
- }), b = e.derived(() => e.get(s) ? e.get(s).getLicense() : "");
1925
- var w = Nr(), P = e.child(w), g = e.child(P), O = e.child(g);
1926
- O.__click = () => r.toggleMetadataDialog(), e.reset(g);
1927
- var v = e.sibling(g, 2), p = e.child(v, !0);
1928
- e.reset(v);
1929
- var C = e.sibling(v, 2), h = e.child(C);
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);
1930
1935
  {
1931
1936
  var l = (m) => {
1932
- var y = Br(), f = e.child(y), G = e.child(f);
1933
- e.html(G, () => e.get(o)), e.reset(f), e.reset(y), e.append(m, y);
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);
1934
1939
  };
1935
- e.if(h, (m) => {
1936
- e.get(o) && m(l);
1940
+ e.if(v, (m) => {
1941
+ e.get(a) && m(l);
1937
1942
  });
1938
1943
  }
1939
- var c = e.sibling(h, 2), R = e.child(c);
1944
+ var o = e.sibling(v, 2), C = e.child(o);
1940
1945
  {
1941
- var T = (m) => {
1942
- var y = $r(), f = e.first_child(y), G = e.child(f, !0);
1943
- e.reset(f);
1944
- var V = e.sibling(f, 2), U = e.child(V);
1945
- e.html(U, () => e.get(I)), e.reset(V), e.template_effect((L) => e.set_text(G, L), [() => E.attribution()]), e.append(m, y);
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);
1946
1951
  };
1947
- e.if(R, (m) => {
1948
- e.get(I) && m(T);
1952
+ e.if(C, (m) => {
1953
+ e.get(P) && m(x);
1949
1954
  });
1950
1955
  }
1951
- var u = e.sibling(R, 2);
1956
+ var h = e.sibling(C, 2);
1952
1957
  {
1953
- var A = (m) => {
1954
- var y = Fr(), f = e.first_child(y), G = e.child(f, !0);
1955
- e.reset(f);
1956
- var V = e.sibling(f, 2), U = e.child(V), L = e.child(U, !0);
1957
- e.reset(U), e.reset(V), e.template_effect(
1958
- (B) => {
1959
- e.set_text(G, B), e.set_attribute(U, "href", e.get(b)), e.set_text(L, e.get(b));
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));
1960
1965
  },
1961
- [() => E.license()]
1962
- ), e.append(m, y);
1966
+ [() => $.license()]
1967
+ ), e.append(m, b);
1963
1968
  };
1964
- e.if(u, (m) => {
1965
- e.get(b) && m(A);
1969
+ e.if(h, (m) => {
1970
+ e.get(p) && m(I);
1966
1971
  });
1967
1972
  }
1968
- var $ = e.sibling(u, 2);
1969
- e.each($, 17, () => e.get(a), e.index, (m, y) => {
1970
- var f = Vr(), G = e.first_child(f), V = e.child(G, !0);
1971
- e.reset(G);
1972
- var U = e.sibling(G, 2), L = e.child(U);
1973
- e.html(L, () => e.get(y).value), e.reset(U), e.template_effect(() => e.set_text(V, e.get(y).label)), e.append(m, f);
1974
- }), e.reset(c), e.reset(C);
1975
- var d = e.sibling(C, 2), z = e.child(d), S = e.child(z);
1976
- S.__click = () => r.toggleMetadataDialog();
1977
- var k = e.child(S, !0);
1978
- e.reset(S), e.reset(z), e.reset(d), e.reset(P);
1979
- var D = e.sibling(P, 2), j = e.child(D);
1980
- j.__click = () => r.toggleMetadataDialog();
1981
- var x = e.child(j, !0);
1982
- e.reset(j), e.reset(D), e.reset(w), e.template_effect(
1983
- (m, y, f) => {
1984
- w.open = r.showMetadataDialog, e.set_text(p, m), e.set_text(k, y), e.set_text(x, 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);
1985
1990
  },
1986
1991
  [
1987
- () => 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(),
1988
- () => E.close(),
1989
- () => 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()
1990
1995
  ]
1991
- ), e.append(i, w), e.pop();
1996
+ ), e.append(s, _), e.pop();
1992
1997
  }
1993
1998
  e.delegate(["click"]);
1994
- e.create_custom_element(ct, {}, [], [], !0);
1995
- var Hr = e.from_html('<button class="btn btn-sm btn-circle btn-ghost"><!></button>'), Yr = e.from_html('<span class="loading loading-spinner loading-xs"></span>'), Xr = e.from_html('<div class="flex justify-center p-8"><span class="loading loading-spinner loading-lg text-primary"></span></div>'), qr = 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>'), Wr = 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>'), Ur = e.from_html('<div class="leading-relaxed"> </div>'), Jr = 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>'), Kr = e.from_html('<div class="text-xs font-bold opacity-50 uppercase tracking-wider pb-2"> </div> <!>', 1), Zr = e.from_html('<div class="h-full w-80 bg-base-200 shadow-2xl z-100 flex flex-col border-l border-base-300" role="dialog"><div class="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>');
1996
- 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) {
1997
2002
  e.push(t, !0);
1998
- const r = fe(ce);
1999
- let s = e.state(""), a = e.derived(() => {
2000
- var O;
2001
- 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);
2002
2010
  });
2003
- function o() {
2004
- r.search(e.get(s));
2011
+ function a() {
2012
+ r.search(e.get(i));
2005
2013
  }
2006
- function I(O) {
2007
- O.key === "Enter" && o();
2014
+ function P(f) {
2015
+ f.key === "Enter" && a();
2008
2016
  }
2009
- function b(O) {
2010
- const v = r.canvases[O.canvasIndex];
2011
- v && (r.canvasId = v.id);
2017
+ function p(f) {
2018
+ const g = r.canvases[f.canvasIndex];
2019
+ g && r.setCanvas(g.id);
2012
2020
  }
2013
- var w = e.comment(), P = e.first_child(w);
2021
+ var _ = e.comment(), z = e.first_child(_);
2014
2022
  {
2015
- var g = (O) => {
2016
- var v = Zr(), p = e.child(v), C = e.child(p), h = e.child(C, !0);
2017
- e.reset(C);
2018
- var l = e.sibling(C, 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);
2019
2027
  {
2020
- var c = (x) => {
2021
- var m = Hr();
2028
+ var o = (S) => {
2029
+ var m = qr();
2022
2030
  m.__click = () => r.toggleSearchPanel();
2023
- var y = e.child(m);
2024
- Fe(y, { size: 20, weight: "bold" }), e.reset(m), e.template_effect((f) => e.set_attribute(m, "aria-label", f), [() => E.close_search()]), e.append(x, m);
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);
2025
2033
  };
2026
- e.if(l, (x) => {
2027
- e.get(a) && x(c);
2034
+ e.if(l, (S) => {
2035
+ e.get(n) && S(o);
2028
2036
  });
2029
2037
  }
2030
- e.reset(p);
2031
- var R = e.sibling(p, 2), T = e.child(R), u = e.child(T);
2032
- e.remove_input_defaults(u), u.__keydown = I;
2033
- var A = e.sibling(u, 2);
2034
- A.__click = o;
2035
- 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);
2036
2044
  {
2037
- var d = (x) => {
2038
- var m = Yr();
2039
- e.append(x, m);
2040
- }, z = (x) => {
2041
- Ze(x, { 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" });
2042
2050
  };
2043
- e.if($, (x) => {
2044
- r.isSearching ? x(d) : x(z, !1);
2051
+ e.if(G, (S) => {
2052
+ r.isSearching ? S(d) : S(A, !1);
2045
2053
  });
2046
2054
  }
2047
- e.reset(A), e.reset(T), e.reset(R);
2048
- var S = e.sibling(R, 2), k = e.child(S);
2055
+ e.reset(I), e.reset(x), e.reset(C);
2056
+ var y = e.sibling(C, 2), k = e.child(y);
2049
2057
  {
2050
- var D = (x) => {
2051
- var m = Xr();
2052
- e.append(x, m);
2053
- }, j = (x) => {
2054
- var m = e.comment(), y = e.first_child(m);
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);
2055
2063
  {
2056
- var f = (V) => {
2057
- var U = qr(), L = e.child(U, !0);
2058
- e.reset(U), e.template_effect((B) => e.set_text(L, B), [
2059
- () => E.search_panel_no_results({ query: r.searchQuery })
2060
- ]), e.append(V, U);
2061
- }, G = (V) => {
2062
- var U = e.comment(), L = e.first_child(U);
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);
2063
2071
  {
2064
- var B = (re) => {
2065
- var se = Qr(), oe = e.child(se, !0);
2066
- e.reset(se), e.template_effect((Q) => e.set_text(oe, Q), [() => E.search_panel_instruction()]), e.append(re, se);
2067
- }, q = (re) => {
2068
- var se = Kr(), oe = e.first_child(se), Q = e.child(oe, !0);
2069
- e.reset(oe);
2070
- var H = e.sibling(oe, 2);
2071
- e.each(H, 17, () => r.searchResults, e.index, (n, _) => {
2072
- var Y = Jr();
2073
- Y.__click = () => b(e.get(_));
2074
- var N = e.child(Y), ie = e.child(N), J = e.child(ie, !0);
2075
- e.reset(ie), e.reset(N);
2076
- var X = e.sibling(N, 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);
2077
2085
  {
2078
- var Z = (te) => {
2079
- var F = Wr(), W = e.child(F), ne = e.child(W);
2080
- e.html(ne, () => e.get(_).before), e.reset(W);
2081
- var ae = e.sibling(W, 2), ue = e.child(ae);
2082
- e.html(ue, () => e.get(_).match), e.reset(ae);
2083
- var $e = e.sibling(ae, 2), Ve = e.child($e);
2084
- e.html(Ve, () => e.get(_).after), e.reset($e), e.reset(F), e.append(te, F);
2085
- }, ee = (te) => {
2086
- var F = Ur(), W = e.child(F, !0);
2087
- e.reset(F), e.template_effect(() => e.set_text(W, e.get(_).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);
2088
2096
  };
2089
- e.if(X, (te) => {
2090
- e.get(_).type === "hit" ? te(Z) : te(ee, !1);
2097
+ e.if(Z, (V) => {
2098
+ e.get(se).type === "hit" ? V(le) : V(W, !1);
2091
2099
  });
2092
2100
  }
2093
- e.reset(Y), e.template_effect(() => e.set_text(J, e.get(_).canvasLabel)), e.append(n, Y);
2094
- }), e.template_effect((n) => e.set_text(Q, n), [
2095
- () => E.search_panel_results_count({ count: r.searchResults.length })
2096
- ]), e.append(re, se);
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);
2097
2105
  };
2098
2106
  e.if(
2099
- L,
2100
- (re) => {
2101
- r.searchResults.length === 0 && !r.searchQuery ? re(B) : re(q, !1);
2107
+ j,
2108
+ (Y) => {
2109
+ r.searchResults.length === 0 && !r.searchQuery ? Y(O) : Y(X, !1);
2102
2110
  },
2103
2111
  !0
2104
2112
  );
2105
2113
  }
2106
- e.append(V, U);
2114
+ e.append(N, q);
2107
2115
  };
2108
2116
  e.if(
2109
- y,
2110
- (V) => {
2111
- r.searchResults.length === 0 && r.searchQuery ? V(f) : V(G, !1);
2117
+ b,
2118
+ (N) => {
2119
+ r.searchResults.length === 0 && r.searchQuery ? N(u) : N(B, !1);
2112
2120
  },
2113
2121
  !0
2114
2122
  );
2115
2123
  }
2116
- e.append(x, m);
2124
+ e.append(S, m);
2117
2125
  };
2118
- e.if(k, (x) => {
2119
- r.isSearching ? x(D) : x(j, !1);
2126
+ e.if(k, (S) => {
2127
+ r.isSearching ? S(L) : S(T, !1);
2120
2128
  });
2121
2129
  }
2122
- e.reset(S), e.reset(v), e.template_effect(
2123
- (x, m, y, f) => {
2124
- e.set_attribute(v, "aria-label", x), e.set_text(h, m), e.set_attribute(u, "placeholder", y), 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);
2125
2133
  },
2126
2134
  [
2127
- () => E.search_panel_title(),
2128
- () => E.search(),
2129
- () => E.search_panel_placeholder(),
2130
- () => E.search_panel_title()
2135
+ () => $.search_panel_title(),
2136
+ () => $.search(),
2137
+ () => $.search_panel_placeholder(),
2138
+ () => $.search_panel_title()
2131
2139
  ]
2132
- ), e.bind_value(u, () => e.get(s), (x) => e.set(s, x)), e.append(O, v);
2140
+ ), e.bind_value(h, () => e.get(i), (S) => e.set(i, S)), e.append(f, g);
2133
2141
  };
2134
- e.if(P, (O) => {
2135
- r.showSearchPanel && O(g);
2142
+ e.if(z, (f) => {
2143
+ r.showSearchPanel && f(E);
2136
2144
  });
2137
2145
  }
2138
- e.append(i, w), e.pop();
2146
+ e.append(s, _), e.pop();
2139
2147
  }
2140
2148
  e.delegate(["click", "keydown"]);
2141
- e.create_custom_element(dt, {}, [], [], !0);
2142
- var ei = e.from_html('<div class="h-full w-[200px] pointer-events-auto relative"><!></div>'), ti = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), ri = e.from_html('<div class="flex-none flex flex-row z-20 bg-base-200 border-r border-base-300 transition-all"><!> <!></div>'), ii = e.from_html('<div class="flex-none h-[140px] w-full pointer-events-auto relative z-20"><!></div>'), si = 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>'), ni = e.from_html('<div class="w-full h-full flex items-center justify-center text-error"> </div>'), ai = e.from_html('<div class="w-full h-full flex items-center justify-center text-base-content/50"> </div>'), oi = e.from_html('<div class="absolute inset-0 z-40 pointer-events-none"><!></div>'), li = e.from_html('<div class="flex-none h-[140px] w-full pointer-events-auto relative z-20"><!></div>'), ci = e.from_html('<div class="relative w-full z-40 pointer-events-auto"><!></div>'), di = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), fi = e.from_html('<div class="h-full w-[200px] pointer-events-auto relative"><!></div>'), ui = e.from_html('<div class="h-full relative pointer-events-auto"><!></div>'), gi = e.from_html('<div class="flex-none flex flex-row z-20 bg-base-200 border-l border-base-300 transition-all"><!> <!> <!></div>'), vi = 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>');
2143
- function hi(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) {
2144
2152
  e.push(t, !0);
2145
- let r = e.prop(t, "manifestId", 7), s = e.prop(t, "canvasId", 7), a = e.prop(t, "plugins", 23, () => []), o = e.prop(t, "theme", 7), I = e.prop(t, "themeConfig", 7), b = e.prop(t, "config", 23, () => ({})), w = e.prop(t, "viewerState", 15), P = 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);
2146
2155
  e.user_effect(() => {
2147
- e.get(P) && qt(e.get(P), o(), I());
2156
+ e.get(E) && Ut(e.get(E), P(), p());
2148
2157
  });
2149
- const g = new Tt(null, void 0, []);
2150
- w(
2151
- g
2158
+ const f = new Bt(null, void 0, []);
2159
+ z(
2160
+ f
2152
2161
  // Expose via bindable prop
2153
- ), ht(ce, g), pt(() => {
2154
- g.destroyAllPlugins();
2162
+ ), _t(ue, f), yt(() => {
2163
+ f.destroyAllPlugins();
2155
2164
  }), e.user_effect(() => {
2156
- r() && g.setManifest(r());
2157
- }), e.user_effect(() => {
2158
- s() && g.setCanvas(s());
2159
- }), e.user_effect(() => {
2160
- b() && (console.log("[Viewer] updateConfig called with:", b()), g.updateConfig(b()));
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
+ }
2161
2177
  }), e.user_effect(() => {
2162
- for (const n of a())
2163
- g.registerPlugin(n);
2178
+ for (const c of a())
2179
+ f.registerPlugin(c);
2164
2180
  }), e.user_effect(() => {
2165
- const n = () => {
2166
- g.isFullScreen = !!document.fullscreenElement;
2181
+ if (!r) return;
2182
+ const c = () => {
2183
+ f.isFullScreen = !!document.fullscreenElement;
2167
2184
  };
2168
- return document.addEventListener("fullscreenchange", n), () => {
2169
- document.removeEventListener("fullscreenchange", n);
2185
+ return document.addEventListener("fullscreenchange", c), () => {
2186
+ document.removeEventListener("fullscreenchange", c);
2170
2187
  };
2171
2188
  });
2172
- let O = e.derived(() => g.showThumbnailGallery && g.dockSide === "left" || g.pluginPanels.some((n) => n.position === "left" && n.isVisible())), v = e.derived(() => g.showSearchPanel || g.showThumbnailGallery && g.dockSide === "right" || g.pluginPanels.some((n) => n.position === "right" && n.isVisible())), p = e.derived(() => g.manifest), C = e.derived(() => g.canvases), h = e.derived(() => g.currentCanvasIndex), l = e.derived(() => {
2173
- var ee, te;
2174
- if (!e.get(C) || e.get(h) === -1 || !e.get(C)[e.get(h)])
2175
- return (ee = e.get(p)) != null && ee.isFetching || console.log("TriiiceratopsViewer: No canvas found"), null;
2176
- const n = e.get(C)[e.get(h)];
2177
- let _ = n.getImages();
2178
- if ((!_ || !_.length) && n.getContent && (_ = n.getContent()), !_ || !_.length)
2179
- return n.__jsonld && n.__jsonld.items, (te = e.get(p)) != null && te.isFetching || console.log("TriiiceratopsViewer: No images/content in canvas"), null;
2180
- const Y = _[0];
2181
- let N = Y.getResource ? Y.getResource() : null;
2182
- if (!N && Y.getBody) {
2183
- const F = Y.getBody();
2184
- Array.isArray(F) && F.length > 0 ? N = F[0] : F && (N = 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);
2185
2202
  }
2186
- if (N && !N.id && !N.__jsonld && (!N.getServices || N.getServices().length === 0) && (N = null), !N) {
2187
- const F = Y.__jsonld || Y;
2188
- F.body && (N = 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);
2189
2206
  }
2190
- if (!N)
2207
+ if (!Z)
2191
2208
  return null;
2192
- const ie = (F) => F.id || F["@id"];
2193
- let J = [];
2194
- if (N.getServices && (J = N.getServices()), !J.length) {
2195
- const F = N.__jsonld || N;
2196
- 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]);
2197
2214
  }
2198
- if (J.length > 0) {
2199
- const F = J.find((W) => {
2200
- const ne = W.getType ? W.getType() : W.type || "", ae = W.getProfile ? W.getProfile() : W.profile || "";
2201
- return ne === "ImageService1" || ne === "ImageService2" || ne === "ImageService3" || typeof ae == "string" && ae.includes("http://iiif.io/api/image") || typeof ae == "string" && ae === "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";
2202
2219
  });
2203
2220
  if (F) {
2204
- let W = ie(F);
2205
- return W && !W.endsWith("/info.json") && (W = `${W}/info.json`), W;
2221
+ let U = le(F);
2222
+ return U && !U.endsWith("/info.json") && (U = `${U}/info.json`), U;
2206
2223
  }
2207
2224
  }
2208
- const X = ie(N);
2209
- if (X && X.includes("/iiif/")) {
2210
- const F = X.split("/"), W = F.findIndex((ne) => ne === "full" || ne.match(/^\d+,\d+,\d+,\d+$/));
2211
- if (W > 0)
2212
- return `${F.slice(0, W).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`;
2213
2230
  }
2214
- return console.log("TriiiceratopsViewer: No service or ID found, returning raw URL"), { type: "image", url: X };
2231
+ return console.log("TriiiceratopsViewer: No service or ID found, returning raw URL"), { type: "image", url: V };
2215
2232
  });
2216
- var c = {
2233
+ var h = {
2217
2234
  get manifestId() {
2218
- return r();
2235
+ return i();
2219
2236
  },
2220
- set manifestId(n) {
2221
- r(n), e.flush();
2237
+ set manifestId(c) {
2238
+ i(c), e.flush();
2222
2239
  },
2223
2240
  get canvasId() {
2224
- return s();
2241
+ return n();
2225
2242
  },
2226
- set canvasId(n) {
2227
- s(n), e.flush();
2243
+ set canvasId(c) {
2244
+ n(c), e.flush();
2228
2245
  },
2229
2246
  get plugins() {
2230
2247
  return a();
2231
2248
  },
2232
- set plugins(n = []) {
2233
- a(n), e.flush();
2249
+ set plugins(c = []) {
2250
+ a(c), e.flush();
2234
2251
  },
2235
2252
  get theme() {
2236
- return o();
2253
+ return P();
2237
2254
  },
2238
- set theme(n) {
2239
- o(n), e.flush();
2255
+ set theme(c) {
2256
+ P(c), e.flush();
2240
2257
  },
2241
2258
  get themeConfig() {
2242
- return I();
2259
+ return p();
2243
2260
  },
2244
- set themeConfig(n) {
2245
- I(n), e.flush();
2261
+ set themeConfig(c) {
2262
+ p(c), e.flush();
2246
2263
  },
2247
2264
  get config() {
2248
- return b();
2265
+ return _();
2249
2266
  },
2250
- set config(n = {}) {
2251
- b(n), e.flush();
2267
+ set config(c = {}) {
2268
+ _(c), e.flush();
2252
2269
  },
2253
2270
  get viewerState() {
2254
- return w();
2271
+ return z();
2255
2272
  },
2256
- set viewerState(n) {
2257
- w(n), e.flush();
2273
+ set viewerState(c) {
2274
+ z(c), e.flush();
2258
2275
  }
2259
- }, R = vi(), T = e.child(R);
2276
+ }, I = ms(), G = e.child(I);
2260
2277
  {
2261
- var u = (n) => {
2262
- var _ = ri(), Y = e.child(_);
2278
+ var d = (c) => {
2279
+ var R = ns(), te = e.child(R);
2263
2280
  {
2264
- var N = (J) => {
2265
- var X = ei(), Z = e.child(X);
2266
- de(Z, {
2281
+ var Z = (W) => {
2282
+ var V = ss(), Q = e.child(V);
2283
+ ge(Q, {
2267
2284
  get canvases() {
2268
- return e.get(C);
2285
+ return e.get(o);
2269
2286
  }
2270
- }), e.reset(X), e.append(J, X);
2287
+ }), e.reset(V), e.append(W, V);
2271
2288
  };
2272
- e.if(Y, (J) => {
2273
- g.showThumbnailGallery && g.dockSide === "left" && J(N);
2289
+ e.if(te, (W) => {
2290
+ f.showThumbnailGallery && f.dockSide === "left" && W(Z);
2274
2291
  });
2275
2292
  }
2276
- var ie = e.sibling(Y, 2);
2277
- e.each(ie, 17, () => g.pluginPanels, (J) => J.id, (J, X) => {
2278
- 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);
2279
2296
  {
2280
- var te = (F) => {
2281
- var W = ti(), ne = e.child(W);
2282
- e.component(ne, () => e.get(X).component, (ae, ue) => {
2283
- ue(ae, e.spread_props(() => e.get(X).props ?? {}));
2284
- }), e.reset(W), e.append(F, W);
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);
2285
2302
  };
2286
- e.if(ee, (F) => {
2287
- e.get(X).isVisible() && e.get(X).position === "left" && F(te);
2303
+ e.if(J, (F) => {
2304
+ e.get(V).isVisible() && e.get(V).position === "left" && F(ne);
2288
2305
  });
2289
2306
  }
2290
- e.append(J, Z);
2291
- }), e.reset(_), e.append(n, _);
2307
+ e.append(W, Q);
2308
+ }), e.reset(R), e.append(c, R);
2292
2309
  };
2293
- e.if(T, (n) => {
2294
- e.get(O) && n(u);
2310
+ e.if(G, (c) => {
2311
+ e.get(w) && c(d);
2295
2312
  });
2296
2313
  }
2297
- var A = e.sibling(T, 2), $ = e.child(A);
2314
+ var A = e.sibling(G, 2), y = e.child(A);
2298
2315
  {
2299
- var d = (n) => {
2300
- var _ = ii(), Y = e.child(_);
2301
- de(Y, {
2316
+ var k = (c) => {
2317
+ var R = as(), te = e.child(R);
2318
+ ge(te, {
2302
2319
  get canvases() {
2303
- return e.get(C);
2320
+ return e.get(o);
2304
2321
  }
2305
- }), e.reset(_), e.append(n, _);
2322
+ }), e.reset(R), e.append(c, R);
2306
2323
  };
2307
- e.if($, (n) => {
2308
- g.showThumbnailGallery && g.dockSide === "top" && n(d);
2324
+ e.if(y, (c) => {
2325
+ f.showThumbnailGallery && f.dockSide === "top" && c(k);
2309
2326
  });
2310
2327
  }
2311
- var z = e.sibling($, 2), S = e.child(z);
2328
+ var L = e.sibling(y, 2), T = e.child(L);
2312
2329
  {
2313
- var k = (n) => {
2314
- var _ = si();
2315
- e.append(n, _);
2316
- }, D = (n) => {
2317
- var _ = e.comment(), Y = e.first_child(_);
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);
2318
2335
  {
2319
- var N = (J) => {
2320
- var X = ni(), Z = e.child(X);
2321
- e.reset(X), e.template_effect(
2322
- (ee) => e.set_text(Z, `${ee ?? ""}
2323
- ${e.get(p).error ?? ""}`),
2324
- [() => E.error_prefix()]
2325
- ), e.append(J, X);
2326
- }, ie = (J) => {
2327
- var X = e.comment(), Z = e.first_child(X);
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);
2328
2345
  {
2329
- var ee = (F) => {
2330
- var W = e.comment(), ne = e.first_child(W);
2331
- e.key(ne, () => e.get(l), (ae) => {
2332
- st(ae, {
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, {
2333
2350
  get tileSources() {
2334
- return e.get(l);
2351
+ return e.get(x);
2335
2352
  },
2336
2353
  get viewerState() {
2337
- return g;
2354
+ return f;
2338
2355
  }
2339
2356
  });
2340
- }), e.append(F, W);
2341
- }, te = (F) => {
2342
- var W = ai(), ne = e.child(W, !0);
2343
- e.reset(W), e.template_effect((ae) => e.set_text(ne, ae), [() => E.no_image_found()]), e.append(F, W);
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);
2344
2361
  };
2345
2362
  e.if(
2346
- Z,
2363
+ Q,
2347
2364
  (F) => {
2348
- e.get(l) ? F(ee) : F(te, !1);
2365
+ e.get(x) ? F(J) : F(ne, !1);
2349
2366
  },
2350
2367
  !0
2351
2368
  );
2352
2369
  }
2353
- e.append(J, X);
2370
+ e.append(W, V);
2354
2371
  };
2355
2372
  e.if(
2356
- Y,
2357
- (J) => {
2358
- var X;
2359
- (X = e.get(p)) != null && X.error ? J(N) : J(ie, !1);
2373
+ te,
2374
+ (W) => {
2375
+ var V;
2376
+ (V = e.get(l)) != null && V.error ? W(Z) : W(le, !1);
2360
2377
  },
2361
2378
  !0
2362
2379
  );
2363
2380
  }
2364
- e.append(n, _);
2381
+ e.append(c, R);
2365
2382
  };
2366
- e.if(S, (n) => {
2367
- var _;
2368
- (_ = e.get(p)) != null && _.isFetching ? n(k) : n(D, !1);
2383
+ e.if(T, (c) => {
2384
+ var R;
2385
+ (R = e.get(l)) != null && R.isFetching ? c(S) : c(m, !1);
2369
2386
  });
2370
2387
  }
2371
- var j = e.sibling(S, 2);
2372
- at(j, {});
2373
- var x = e.sibling(j, 2);
2374
- ct(x, {});
2375
- var m = e.sibling(x, 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);
2376
2393
  {
2377
- var y = (n) => {
2378
- ot(n, {});
2394
+ var N = (c) => {
2395
+ lt(c, {});
2379
2396
  };
2380
- e.if(m, (n) => {
2381
- g.showRightMenu && n(y);
2397
+ e.if(B, (c) => {
2398
+ f.showRightMenu && c(N);
2382
2399
  });
2383
2400
  }
2384
- var f = e.sibling(m, 2);
2401
+ var q = e.sibling(B, 2);
2385
2402
  {
2386
- var G = (n) => {
2387
- lt(n, {});
2403
+ var j = (c) => {
2404
+ ct(c, {});
2388
2405
  };
2389
- e.if(f, (n) => {
2390
- g.showLeftMenu && n(G);
2406
+ e.if(q, (c) => {
2407
+ f.showLeftMenu && c(j);
2391
2408
  });
2392
2409
  }
2393
- var V = e.sibling(f, 2);
2394
- e.each(V, 17, () => g.pluginPanels, (n) => n.id, (n, _) => {
2395
- var Y = e.comment(), N = e.first_child(Y);
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);
2396
2413
  {
2397
- var ie = (J) => {
2398
- var X = oi(), Z = e.child(X);
2399
- e.component(Z, () => e.get(_).component, (ee, te) => {
2400
- te(ee, e.spread_props(() => e.get(_).props ?? {}));
2401
- }), e.reset(X), e.append(J, X);
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);
2402
2419
  };
2403
- e.if(N, (J) => {
2404
- e.get(_).isVisible() && e.get(_).position === "overlay" && J(ie);
2420
+ e.if(Z, (W) => {
2421
+ e.get(R).isVisible() && e.get(R).position === "overlay" && W(le);
2405
2422
  });
2406
2423
  }
2407
- e.append(n, Y);
2424
+ e.append(c, te);
2408
2425
  });
2409
- var U = e.sibling(V, 2);
2426
+ var X = e.sibling(O, 2);
2410
2427
  {
2411
- var L = (n) => {
2412
- nt(n, {
2428
+ var Y = (c) => {
2429
+ at(c, {
2413
2430
  get viewerState() {
2414
- return g;
2431
+ return f;
2415
2432
  }
2416
2433
  });
2417
2434
  };
2418
- e.if(U, (n) => {
2419
- e.get(C).length > 1 && g.showCanvasNav && n(L);
2435
+ e.if(X, (c) => {
2436
+ e.get(o).length > 1 && f.showCanvasNav && c(Y);
2420
2437
  });
2421
2438
  }
2422
- var B = e.sibling(U, 2);
2439
+ var H = e.sibling(X, 2);
2423
2440
  {
2424
- var q = (n) => {
2425
- de(n, {
2441
+ var re = (c) => {
2442
+ ge(c, {
2426
2443
  get canvases() {
2427
- return e.get(C);
2444
+ return e.get(o);
2428
2445
  }
2429
2446
  });
2430
2447
  };
2431
- e.if(B, (n) => {
2432
- g.showThumbnailGallery && g.dockSide === "none" && n(q);
2448
+ e.if(H, (c) => {
2449
+ f.showThumbnailGallery && f.dockSide === "none" && c(re);
2433
2450
  });
2434
2451
  }
2435
- e.reset(z);
2436
- var re = e.sibling(z, 2);
2452
+ e.reset(L);
2453
+ var ae = e.sibling(L, 2);
2437
2454
  {
2438
- var se = (n) => {
2439
- var _ = li(), Y = e.child(_);
2440
- de(Y, {
2455
+ var de = (c) => {
2456
+ var R = fs(), te = e.child(R);
2457
+ ge(te, {
2441
2458
  get canvases() {
2442
- return e.get(C);
2459
+ return e.get(o);
2443
2460
  }
2444
- }), e.reset(_), e.append(n, _);
2461
+ }), e.reset(R), e.append(c, R);
2445
2462
  };
2446
- e.if(re, (n) => {
2447
- g.showThumbnailGallery && g.dockSide === "bottom" && n(se);
2463
+ e.if(ae, (c) => {
2464
+ f.showThumbnailGallery && f.dockSide === "bottom" && c(de);
2448
2465
  });
2449
2466
  }
2450
- var oe = e.sibling(re, 2);
2451
- e.each(oe, 17, () => g.pluginPanels, (n) => n.id, (n, _) => {
2452
- var Y = e.comment(), N = e.first_child(Y);
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);
2453
2470
  {
2454
- var ie = (J) => {
2455
- var X = ci(), Z = e.child(X);
2456
- e.component(Z, () => e.get(_).component, (ee, te) => {
2457
- te(ee, e.spread_props(() => e.get(_).props ?? {}));
2458
- }), e.reset(X), e.append(J, X);
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);
2459
2476
  };
2460
- e.if(N, (J) => {
2461
- e.get(_).isVisible() && e.get(_).position === "bottom" && J(ie);
2477
+ e.if(Z, (W) => {
2478
+ e.get(R).isVisible() && e.get(R).position === "bottom" && W(le);
2462
2479
  });
2463
2480
  }
2464
- e.append(n, Y);
2481
+ e.append(c, te);
2465
2482
  }), e.reset(A);
2466
- var Q = e.sibling(A, 2);
2483
+ var se = e.sibling(A, 2);
2467
2484
  {
2468
- var H = (n) => {
2469
- var _ = gi(), Y = e.child(_);
2485
+ var ce = (c) => {
2486
+ var R = ps(), te = e.child(R);
2470
2487
  {
2471
- var N = (Z) => {
2472
- var ee = di(), te = e.child(ee);
2473
- 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);
2474
2491
  };
2475
- e.if(Y, (Z) => {
2476
- g.showSearchPanel && Z(N);
2492
+ e.if(te, (Q) => {
2493
+ f.showSearchPanel && Q(Z);
2477
2494
  });
2478
2495
  }
2479
- var ie = e.sibling(Y, 2);
2496
+ var le = e.sibling(te, 2);
2480
2497
  {
2481
- var J = (Z) => {
2482
- var ee = fi(), te = e.child(ee);
2483
- de(te, {
2498
+ var W = (Q) => {
2499
+ var J = hs(), ne = e.child(J);
2500
+ ge(ne, {
2484
2501
  get canvases() {
2485
- return e.get(C);
2502
+ return e.get(o);
2486
2503
  }
2487
- }), e.reset(ee), e.append(Z, ee);
2504
+ }), e.reset(J), e.append(Q, J);
2488
2505
  };
2489
- e.if(ie, (Z) => {
2490
- g.showThumbnailGallery && g.dockSide === "right" && Z(J);
2506
+ e.if(le, (Q) => {
2507
+ f.showThumbnailGallery && f.dockSide === "right" && Q(W);
2491
2508
  });
2492
2509
  }
2493
- var X = e.sibling(ie, 2);
2494
- e.each(X, 17, () => g.pluginPanels, (Z) => Z.id, (Z, ee) => {
2495
- 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);
2496
2513
  {
2497
- var W = (ne) => {
2498
- var ae = ui(), ue = e.child(ae);
2499
- e.component(ue, () => e.get(ee).component, ($e, Ve) => {
2500
- Ve($e, e.spread_props(() => e.get(ee).props ?? {}));
2501
- }), e.reset(ae), e.append(ne, ae);
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);
2502
2519
  };
2503
- e.if(F, (ne) => {
2504
- e.get(ee).isVisible() && e.get(ee).position === "right" && ne(W);
2520
+ e.if(F, (ie) => {
2521
+ e.get(J).isVisible() && e.get(J).position === "right" && ie(U);
2505
2522
  });
2506
2523
  }
2507
- e.append(Z, te);
2508
- }), e.reset(_), e.append(n, _);
2524
+ e.append(Q, ne);
2525
+ }), e.reset(R), e.append(c, R);
2509
2526
  };
2510
- e.if(Q, (n) => {
2511
- e.get(v) && n(H);
2527
+ e.if(se, (c) => {
2528
+ e.get(v) && c(ce);
2512
2529
  });
2513
2530
  }
2514
- return e.reset(R), e.bind_this(R, (n) => e.set(P, n), () => e.get(P)), 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);
2515
2532
  }
2516
2533
  e.create_custom_element(
2517
- hi,
2534
+ bs,
2518
2535
  {
2519
2536
  manifestId: {},
2520
2537
  canvasId: {},
@@ -2529,18 +2546,18 @@ e.create_custom_element(
2529
2546
  !0
2530
2547
  );
2531
2548
  export {
2532
- $i as BasePlugin,
2533
- zt as DAISYUI_THEMES,
2534
- Mt as ManifestsState,
2535
- hi as TriiiceratopsViewer,
2536
- ce as VIEWER_STATE_KEY,
2537
- Tt as ViewerState,
2538
- Ht as applyBuiltInTheme,
2539
- qt as applyTheme,
2540
- Yt as applyThemeConfig,
2541
- Xt as clearThemeConfig,
2542
- $t as hexToOklch,
2543
- Ei as isBuiltInTheme,
2544
- Vt as normalizeColor,
2545
- 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
2546
2563
  };