triiiceratops 0.7.0 → 0.7.2

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