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