triiiceratops 0.10.3 → 0.10.5
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/{ArrowCounterClockwise-CvTUOlYp.js → ArrowCounterClockwise-C2bPi1fL.js} +1 -1
- package/dist/{X-Dgb3I7Ob.js → X-Hy7z8RKI.js} +344 -336
- package/dist/{annotation_tool_point-CKkqbVDq.js → annotation_tool_point-CVRtOCN5.js} +1 -1
- package/dist/components/SearchPanel.svelte +4 -1
- package/dist/components/TriiiceratopsViewer.svelte +1 -0
- package/dist/{image_filters_reset-DZrbHhqM.js → image_filters_reset-BOxhPxhP.js} +1 -1
- package/dist/plugins/annotation-editor.js +3 -3
- package/dist/plugins/image-manipulation.js +3 -3
- package/dist/state/viewer.svelte.d.ts +6 -0
- package/dist/state/viewer.svelte.js +20 -2
- package/dist/triiiceratops-bundle.js +569 -569
- package/dist/triiiceratops-element.iife.js +6 -6
- package/package.json +1 -1
|
@@ -1,100 +1,100 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var De = Object.defineProperty;
|
|
2
|
+
var pe = (a) => {
|
|
3
3
|
throw TypeError(a);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var n = (a,
|
|
8
|
-
import * as
|
|
9
|
-
import * as
|
|
5
|
+
var Re = (a, e, s) => e in a ? De(a, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : a[e] = s;
|
|
6
|
+
var he = (a, e, s) => Re(a, typeof e != "symbol" ? e + "" : e, s), Ge = (a, e, s) => e.has(a) || pe("Cannot " + s);
|
|
7
|
+
var n = (a, e, s) => (Ge(a, e, "read from private field"), s ? s.call(a) : e.get(a)), h = (a, e, s) => e.has(a) ? pe("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(a) : e.set(a, s);
|
|
8
|
+
import * as t from "svelte/internal/client";
|
|
9
|
+
import * as Be from "manifesto.js";
|
|
10
10
|
import "svelte/internal/disclose-version";
|
|
11
|
-
import { hasContext as
|
|
11
|
+
import { hasContext as Te, getContext as je } from "svelte";
|
|
12
12
|
var E, D;
|
|
13
|
-
class
|
|
13
|
+
class Ve {
|
|
14
14
|
constructor() {
|
|
15
|
-
h(this, E,
|
|
16
|
-
h(this, D,
|
|
15
|
+
h(this, E, t.state(t.proxy({})));
|
|
16
|
+
h(this, D, t.state(t.proxy(/* @__PURE__ */ new Map())));
|
|
17
17
|
}
|
|
18
18
|
get manifests() {
|
|
19
|
-
return
|
|
19
|
+
return t.get(n(this, E));
|
|
20
20
|
}
|
|
21
|
-
set manifests(
|
|
22
|
-
|
|
21
|
+
set manifests(e) {
|
|
22
|
+
t.set(n(this, E), e, !0);
|
|
23
23
|
}
|
|
24
24
|
get userAnnotations() {
|
|
25
|
-
return
|
|
25
|
+
return t.get(n(this, D));
|
|
26
26
|
}
|
|
27
|
-
set userAnnotations(
|
|
28
|
-
|
|
27
|
+
set userAnnotations(e) {
|
|
28
|
+
t.set(n(this, D), e, !0);
|
|
29
29
|
}
|
|
30
30
|
// === User Annotations API ===
|
|
31
|
-
userAnnotationKey(
|
|
32
|
-
return `${
|
|
31
|
+
userAnnotationKey(e, s) {
|
|
32
|
+
return `${e}::${s}`;
|
|
33
33
|
}
|
|
34
|
-
setUserAnnotations(
|
|
35
|
-
const r = this.userAnnotationKey(
|
|
34
|
+
setUserAnnotations(e, s, i) {
|
|
35
|
+
const r = this.userAnnotationKey(e, s), d = new Map(this.userAnnotations);
|
|
36
36
|
d.set(r, i), this.userAnnotations = d;
|
|
37
37
|
}
|
|
38
|
-
clearUserAnnotations(
|
|
39
|
-
const i = this.userAnnotationKey(
|
|
38
|
+
clearUserAnnotations(e, s) {
|
|
39
|
+
const i = this.userAnnotationKey(e, s);
|
|
40
40
|
if (this.userAnnotations.has(i)) {
|
|
41
41
|
const r = new Map(this.userAnnotations);
|
|
42
42
|
r.delete(i), this.userAnnotations = r;
|
|
43
43
|
}
|
|
44
44
|
}
|
|
45
|
-
getUserAnnotations(
|
|
46
|
-
const i = this.userAnnotationKey(
|
|
45
|
+
getUserAnnotations(e, s) {
|
|
46
|
+
const i = this.userAnnotationKey(e, s);
|
|
47
47
|
return this.userAnnotations.get(i) ?? [];
|
|
48
48
|
}
|
|
49
49
|
// === Manifest Fetching ===
|
|
50
|
-
async fetchManifest(
|
|
51
|
-
if (!this.manifests[
|
|
52
|
-
this.manifests[
|
|
50
|
+
async fetchManifest(e) {
|
|
51
|
+
if (!this.manifests[e]) {
|
|
52
|
+
this.manifests[e] = { isFetching: !0 };
|
|
53
53
|
try {
|
|
54
|
-
const s = await fetch(
|
|
54
|
+
const s = await fetch(e);
|
|
55
55
|
if (!s.ok)
|
|
56
56
|
throw new Error(`HTTP error! status: ${s.status}`);
|
|
57
|
-
const i = await s.json(), r =
|
|
58
|
-
this.manifests[
|
|
57
|
+
const i = await s.json(), r = Be.parseManifest(i);
|
|
58
|
+
this.manifests[e] = { json: i, manifesto: r, isFetching: !1 };
|
|
59
59
|
} catch (s) {
|
|
60
|
-
this.manifests[
|
|
60
|
+
this.manifests[e] = { error: s.message, isFetching: !1 };
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
getManifest(
|
|
65
|
-
const s = this.manifests[
|
|
64
|
+
getManifest(e) {
|
|
65
|
+
const s = this.manifests[e];
|
|
66
66
|
return s == null ? void 0 : s.manifesto;
|
|
67
67
|
}
|
|
68
|
-
getManifestEntry(
|
|
69
|
-
return this.manifests[
|
|
68
|
+
getManifestEntry(e) {
|
|
69
|
+
return this.manifests[e];
|
|
70
70
|
}
|
|
71
|
-
async fetchAnnotationList(
|
|
72
|
-
if (!this.manifests[
|
|
71
|
+
async fetchAnnotationList(e) {
|
|
72
|
+
if (!this.manifests[e])
|
|
73
73
|
try {
|
|
74
|
-
const s = await fetch(
|
|
74
|
+
const s = await fetch(e);
|
|
75
75
|
if (s.ok) {
|
|
76
76
|
const i = await s.json();
|
|
77
|
-
this.manifests[
|
|
77
|
+
this.manifests[e] = { json: i };
|
|
78
78
|
} else
|
|
79
|
-
console.error(`Failed to fetch annotation list: ${
|
|
79
|
+
console.error(`Failed to fetch annotation list: ${e}`);
|
|
80
80
|
} catch (s) {
|
|
81
|
-
console.error(`Error fetching annotation list: ${
|
|
81
|
+
console.error(`Error fetching annotation list: ${e}`, s);
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
|
-
getCanvases(
|
|
85
|
-
const s = this.getManifest(
|
|
84
|
+
getCanvases(e) {
|
|
85
|
+
const s = this.getManifest(e);
|
|
86
86
|
if (!s)
|
|
87
87
|
return [];
|
|
88
88
|
const i = s.getSequences();
|
|
89
89
|
return !i || !i.length ? [] : i[0].getCanvases();
|
|
90
90
|
}
|
|
91
|
-
getAnnotations(
|
|
92
|
-
const i = this.manualGetAnnotations(
|
|
91
|
+
getAnnotations(e, s) {
|
|
92
|
+
const i = this.manualGetAnnotations(e, s), r = this.getUserAnnotations(e, s);
|
|
93
93
|
return [...i, ...r];
|
|
94
94
|
}
|
|
95
95
|
// We can refactor this to use Manifesto's resource handling later if needed.
|
|
96
|
-
manualGetAnnotations(
|
|
97
|
-
const i = this.getManifest(
|
|
96
|
+
manualGetAnnotations(e, s) {
|
|
97
|
+
const i = this.getManifest(e);
|
|
98
98
|
if (!i) return [];
|
|
99
99
|
const r = i.getSequences()[0].getCanvasById(s);
|
|
100
100
|
if (!r) return [];
|
|
@@ -129,118 +129,123 @@ class Vt {
|
|
|
129
129
|
}
|
|
130
130
|
}
|
|
131
131
|
E = new WeakMap(), D = new WeakMap();
|
|
132
|
-
const P = new
|
|
133
|
-
var R, G, B, T, j, V, O, F, Q, Z, z, H, N, U, q, K, $, W, J, X, Y,
|
|
134
|
-
class
|
|
135
|
-
constructor(
|
|
136
|
-
h(this, R,
|
|
137
|
-
h(this, G,
|
|
138
|
-
h(this, B,
|
|
139
|
-
h(this, T,
|
|
140
|
-
h(this, j,
|
|
141
|
-
h(this, V,
|
|
142
|
-
h(this, O,
|
|
143
|
-
h(this, F,
|
|
144
|
-
h(this, Q,
|
|
145
|
-
h(this, Z,
|
|
146
|
-
h(this, z,
|
|
132
|
+
const P = new Ve();
|
|
133
|
+
var R, G, B, T, j, V, O, F, Q, Z, z, H, N, U, q, K, $, W, J, X, Y, ee, te, se, ne, ae;
|
|
134
|
+
class at {
|
|
135
|
+
constructor(e = null, s = null, i = []) {
|
|
136
|
+
h(this, R, t.state(null));
|
|
137
|
+
h(this, G, t.state(null));
|
|
138
|
+
h(this, B, t.state(!1));
|
|
139
|
+
h(this, T, t.state(!1));
|
|
140
|
+
h(this, j, t.state(!1));
|
|
141
|
+
h(this, V, t.state(!1));
|
|
142
|
+
h(this, O, t.state(!1));
|
|
143
|
+
h(this, F, t.state(!1));
|
|
144
|
+
h(this, Q, t.state("bottom"));
|
|
145
|
+
h(this, Z, t.state(t.proxy(/* @__PURE__ */ new Set())));
|
|
146
|
+
h(this, z, t.state(t.proxy({})));
|
|
147
147
|
h(
|
|
148
148
|
this,
|
|
149
149
|
H,
|
|
150
150
|
// Gallery State (Lifted for persistence during re-docking)
|
|
151
|
-
|
|
151
|
+
t.state(t.proxy({ x: 20, y: 100 }))
|
|
152
152
|
);
|
|
153
|
-
h(this, N,
|
|
154
|
-
h(this, U,
|
|
155
|
-
h(this, q,
|
|
156
|
-
h(this, K,
|
|
157
|
-
h(this, $,
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
h(this,
|
|
153
|
+
h(this, N, t.state(t.proxy({ width: 300, height: 400 })));
|
|
154
|
+
h(this, U, t.state(!1));
|
|
155
|
+
h(this, q, t.state(t.proxy({ x: 0, y: 0 })));
|
|
156
|
+
h(this, K, t.state(null));
|
|
157
|
+
h(this, $, t.state(null));
|
|
158
|
+
he(this, "eventTarget", null);
|
|
159
|
+
/**
|
|
160
|
+
* Reference to the main viewer DOM element.
|
|
161
|
+
* Used for fullscreen toggling.
|
|
162
|
+
*/
|
|
163
|
+
he(this, "viewerElement", null);
|
|
164
|
+
h(this, W, t.state(""));
|
|
165
|
+
h(this, J, t.state(null));
|
|
166
|
+
h(this, X, t.state(t.proxy([])));
|
|
167
|
+
h(this, Y, t.state(!1));
|
|
168
|
+
h(this, ee, t.state(!1));
|
|
169
|
+
h(this, te, t.state(t.proxy([])));
|
|
165
170
|
h(
|
|
166
171
|
this,
|
|
167
|
-
|
|
172
|
+
se,
|
|
168
173
|
// ==================== PLUGIN STATE ====================
|
|
169
174
|
/** Plugin-registered menu buttons */
|
|
170
|
-
|
|
175
|
+
t.state(t.proxy([]))
|
|
171
176
|
);
|
|
172
|
-
h(this,
|
|
173
|
-
h(this,
|
|
174
|
-
|
|
175
|
-
this.manifestId =
|
|
177
|
+
h(this, ne, t.state(t.proxy([])));
|
|
178
|
+
h(this, ae, t.state(null));
|
|
179
|
+
he(this, "pluginEventHandlers", /* @__PURE__ */ new Map());
|
|
180
|
+
this.manifestId = e || null, this.canvasId = s || null, this.manifestId && P.fetchManifest(this.manifestId);
|
|
176
181
|
for (const r of i)
|
|
177
182
|
this.registerPlugin(r);
|
|
178
183
|
}
|
|
179
184
|
get manifestId() {
|
|
180
|
-
return
|
|
185
|
+
return t.get(n(this, R));
|
|
181
186
|
}
|
|
182
|
-
set manifestId(
|
|
183
|
-
|
|
187
|
+
set manifestId(e) {
|
|
188
|
+
t.set(n(this, R), e, !0);
|
|
184
189
|
}
|
|
185
190
|
get canvasId() {
|
|
186
|
-
return
|
|
191
|
+
return t.get(n(this, G));
|
|
187
192
|
}
|
|
188
|
-
set canvasId(
|
|
189
|
-
|
|
193
|
+
set canvasId(e) {
|
|
194
|
+
t.set(n(this, G), e, !0);
|
|
190
195
|
}
|
|
191
196
|
get showAnnotations() {
|
|
192
|
-
return
|
|
197
|
+
return t.get(n(this, B));
|
|
193
198
|
}
|
|
194
|
-
set showAnnotations(
|
|
195
|
-
|
|
199
|
+
set showAnnotations(e) {
|
|
200
|
+
t.set(n(this, B), e, !0);
|
|
196
201
|
}
|
|
197
202
|
get showThumbnailGallery() {
|
|
198
|
-
return
|
|
203
|
+
return t.get(n(this, T));
|
|
199
204
|
}
|
|
200
|
-
set showThumbnailGallery(
|
|
201
|
-
|
|
205
|
+
set showThumbnailGallery(e) {
|
|
206
|
+
t.set(n(this, T), e, !0);
|
|
202
207
|
}
|
|
203
208
|
get isGalleryDockedBottom() {
|
|
204
|
-
return
|
|
209
|
+
return t.get(n(this, j));
|
|
205
210
|
}
|
|
206
|
-
set isGalleryDockedBottom(
|
|
207
|
-
|
|
211
|
+
set isGalleryDockedBottom(e) {
|
|
212
|
+
t.set(n(this, j), e, !0);
|
|
208
213
|
}
|
|
209
214
|
get isGalleryDockedRight() {
|
|
210
|
-
return
|
|
215
|
+
return t.get(n(this, V));
|
|
211
216
|
}
|
|
212
|
-
set isGalleryDockedRight(
|
|
213
|
-
|
|
217
|
+
set isGalleryDockedRight(e) {
|
|
218
|
+
t.set(n(this, V), e, !0);
|
|
214
219
|
}
|
|
215
220
|
get isFullScreen() {
|
|
216
|
-
return
|
|
221
|
+
return t.get(n(this, O));
|
|
217
222
|
}
|
|
218
|
-
set isFullScreen(
|
|
219
|
-
|
|
223
|
+
set isFullScreen(e) {
|
|
224
|
+
t.set(n(this, O), e, !0);
|
|
220
225
|
}
|
|
221
226
|
get showMetadataDialog() {
|
|
222
|
-
return
|
|
227
|
+
return t.get(n(this, F));
|
|
223
228
|
}
|
|
224
|
-
set showMetadataDialog(
|
|
225
|
-
|
|
229
|
+
set showMetadataDialog(e) {
|
|
230
|
+
t.set(n(this, F), e, !0);
|
|
226
231
|
}
|
|
227
232
|
get dockSide() {
|
|
228
|
-
return
|
|
233
|
+
return t.get(n(this, Q));
|
|
229
234
|
}
|
|
230
|
-
set dockSide(
|
|
231
|
-
|
|
235
|
+
set dockSide(e) {
|
|
236
|
+
t.set(n(this, Q), e, !0);
|
|
232
237
|
}
|
|
233
238
|
get visibleAnnotationIds() {
|
|
234
|
-
return
|
|
239
|
+
return t.get(n(this, Z));
|
|
235
240
|
}
|
|
236
|
-
set visibleAnnotationIds(
|
|
237
|
-
|
|
241
|
+
set visibleAnnotationIds(e) {
|
|
242
|
+
t.set(n(this, Z), e, !0);
|
|
238
243
|
}
|
|
239
244
|
get config() {
|
|
240
|
-
return
|
|
245
|
+
return t.get(n(this, z));
|
|
241
246
|
}
|
|
242
|
-
set config(
|
|
243
|
-
|
|
247
|
+
set config(e) {
|
|
248
|
+
t.set(n(this, z), e, !0);
|
|
244
249
|
}
|
|
245
250
|
get showRightMenu() {
|
|
246
251
|
return this.config.showRightMenu ?? !0;
|
|
@@ -252,43 +257,43 @@ class ae {
|
|
|
252
257
|
return this.config.showCanvasNav ?? !0;
|
|
253
258
|
}
|
|
254
259
|
get galleryPosition() {
|
|
255
|
-
return
|
|
260
|
+
return t.get(n(this, H));
|
|
256
261
|
}
|
|
257
|
-
set galleryPosition(
|
|
258
|
-
|
|
262
|
+
set galleryPosition(e) {
|
|
263
|
+
t.set(n(this, H), e, !0);
|
|
259
264
|
}
|
|
260
265
|
get gallerySize() {
|
|
261
|
-
return
|
|
266
|
+
return t.get(n(this, N));
|
|
262
267
|
}
|
|
263
|
-
set gallerySize(
|
|
264
|
-
|
|
268
|
+
set gallerySize(e) {
|
|
269
|
+
t.set(n(this, N), e, !0);
|
|
265
270
|
}
|
|
266
271
|
get isGalleryDragging() {
|
|
267
|
-
return
|
|
272
|
+
return t.get(n(this, U));
|
|
268
273
|
}
|
|
269
|
-
set isGalleryDragging(
|
|
270
|
-
|
|
274
|
+
set isGalleryDragging(e) {
|
|
275
|
+
t.set(n(this, U), e, !0);
|
|
271
276
|
}
|
|
272
277
|
get galleryDragOffset() {
|
|
273
|
-
return
|
|
278
|
+
return t.get(n(this, q));
|
|
274
279
|
}
|
|
275
|
-
set galleryDragOffset(
|
|
276
|
-
|
|
280
|
+
set galleryDragOffset(e) {
|
|
281
|
+
t.set(n(this, q), e, !0);
|
|
277
282
|
}
|
|
278
283
|
get dragOverSide() {
|
|
279
|
-
return
|
|
284
|
+
return t.get(n(this, K));
|
|
280
285
|
}
|
|
281
|
-
set dragOverSide(
|
|
282
|
-
|
|
286
|
+
set dragOverSide(e) {
|
|
287
|
+
t.set(n(this, K), e, !0);
|
|
283
288
|
}
|
|
284
289
|
get galleryCenterPanelRect() {
|
|
285
|
-
return
|
|
290
|
+
return t.get(n(this, $));
|
|
286
291
|
}
|
|
287
|
-
set galleryCenterPanelRect(
|
|
288
|
-
|
|
292
|
+
set galleryCenterPanelRect(e) {
|
|
293
|
+
t.set(n(this, $), e, !0);
|
|
289
294
|
}
|
|
290
|
-
setEventTarget(
|
|
291
|
-
this.eventTarget =
|
|
295
|
+
setEventTarget(e) {
|
|
296
|
+
this.eventTarget = e;
|
|
292
297
|
}
|
|
293
298
|
/**
|
|
294
299
|
* Get current state as a plain object snapshot.
|
|
@@ -297,11 +302,11 @@ class ae {
|
|
|
297
302
|
* which can cause infinite loops when it auto-sets canvasId.
|
|
298
303
|
*/
|
|
299
304
|
getSnapshot() {
|
|
300
|
-
let
|
|
301
|
-
return this.manifestId && this.canvasId && (
|
|
305
|
+
let e = -1;
|
|
306
|
+
return this.manifestId && this.canvasId && (e = P.getCanvases(this.manifestId).findIndex((i) => (i.id || i["@id"] || (i.getCanvasId ? i.getCanvasId() : null) || (i.getId ? i.getId() : null)) === this.canvasId)), {
|
|
302
307
|
manifestId: this.manifestId,
|
|
303
308
|
canvasId: this.canvasId,
|
|
304
|
-
currentCanvasIndex:
|
|
309
|
+
currentCanvasIndex: e,
|
|
305
310
|
showAnnotations: this.showAnnotations,
|
|
306
311
|
showThumbnailGallery: this.showThumbnailGallery,
|
|
307
312
|
showSearchPanel: this.showSearchPanel,
|
|
@@ -317,10 +322,10 @@ class ae {
|
|
|
317
322
|
* Uses queueMicrotask to dispatch asynchronously AFTER the current
|
|
318
323
|
* reactive cycle completes, preventing infinite update loops.
|
|
319
324
|
*/
|
|
320
|
-
dispatchStateChange(
|
|
321
|
-
console.log(`[ViewerState] Dispatching ${
|
|
325
|
+
dispatchStateChange(e = "statechange") {
|
|
326
|
+
console.log(`[ViewerState] Dispatching ${e}`, JSON.stringify(this.getSnapshot())), this.eventTarget && queueMicrotask(() => {
|
|
322
327
|
var s;
|
|
323
|
-
(s = this.eventTarget) == null || s.dispatchEvent(new CustomEvent(
|
|
328
|
+
(s = this.eventTarget) == null || s.dispatchEvent(new CustomEvent(e, { detail: this.getSnapshot(), bubbles: !0, composed: !0 }));
|
|
324
329
|
});
|
|
325
330
|
}
|
|
326
331
|
get manifest() {
|
|
@@ -333,7 +338,7 @@ class ae {
|
|
|
333
338
|
return this.manifestId ? P.getCanvases(this.manifestId) : [];
|
|
334
339
|
}
|
|
335
340
|
get currentCanvasIndex() {
|
|
336
|
-
return this.canvasId ? this.canvases.findIndex((
|
|
341
|
+
return this.canvasId ? this.canvases.findIndex((e) => (e.id || e["@id"] || (e.getCanvasId ? e.getCanvasId() : null) || (e.getId ? e.getId() : null)) === this.canvasId) : this.canvases.length > 0 ? 0 : -1;
|
|
337
342
|
}
|
|
338
343
|
get hasNext() {
|
|
339
344
|
return this.currentCanvasIndex < this.canvases.length - 1;
|
|
@@ -343,31 +348,31 @@ class ae {
|
|
|
343
348
|
}
|
|
344
349
|
nextCanvas() {
|
|
345
350
|
if (this.hasNext) {
|
|
346
|
-
const
|
|
351
|
+
const e = this.currentCanvasIndex + 1, s = this.canvases[e];
|
|
347
352
|
this.setCanvas(s.id);
|
|
348
353
|
}
|
|
349
354
|
}
|
|
350
355
|
previousCanvas() {
|
|
351
356
|
if (this.hasPrevious) {
|
|
352
|
-
const
|
|
357
|
+
const e = this.currentCanvasIndex - 1, s = this.canvases[e];
|
|
353
358
|
this.setCanvas(s.id);
|
|
354
359
|
}
|
|
355
360
|
}
|
|
356
|
-
setManifest(
|
|
357
|
-
this.manifestId =
|
|
361
|
+
setManifest(e) {
|
|
362
|
+
this.manifestId = e, this.canvasId = null, P.fetchManifest(e), this.dispatchStateChange("manifestchange");
|
|
358
363
|
}
|
|
359
|
-
setCanvas(
|
|
360
|
-
this.canvasId =
|
|
364
|
+
setCanvas(e) {
|
|
365
|
+
this.canvasId = e, this.dispatchStateChange("canvaschange");
|
|
361
366
|
}
|
|
362
|
-
updateConfig(
|
|
367
|
+
updateConfig(e) {
|
|
363
368
|
var i;
|
|
364
369
|
const s = this.config;
|
|
365
|
-
if (this.config =
|
|
366
|
-
|
|
367
|
-
const r =
|
|
370
|
+
if (this.config = e, e.gallery && (e.gallery.open !== void 0 && (this.showThumbnailGallery = e.gallery.open), e.gallery.dockPosition !== void 0 && (this.dockSide = e.gallery.dockPosition)), e.search) {
|
|
371
|
+
e.search.open !== void 0 && (this.showSearchPanel = e.search.open);
|
|
372
|
+
const r = e.search.query, d = (i = s.search) == null ? void 0 : i.query;
|
|
368
373
|
r !== void 0 && r !== d && r !== this.searchQuery && this._performSearch(r);
|
|
369
374
|
}
|
|
370
|
-
|
|
375
|
+
e.annotations && e.annotations.open !== void 0 && (this.showAnnotations = e.annotations.open);
|
|
371
376
|
}
|
|
372
377
|
toggleAnnotations() {
|
|
373
378
|
this.showAnnotations = !this.showAnnotations, this.dispatchStateChange();
|
|
@@ -375,72 +380,75 @@ class ae {
|
|
|
375
380
|
toggleThumbnailGallery() {
|
|
376
381
|
this.showThumbnailGallery = !this.showThumbnailGallery, this.dispatchStateChange();
|
|
377
382
|
}
|
|
383
|
+
setViewerElement(e) {
|
|
384
|
+
this.viewerElement = e;
|
|
385
|
+
}
|
|
378
386
|
toggleFullScreen() {
|
|
379
387
|
if (document.fullscreenElement)
|
|
380
388
|
document.exitFullscreen();
|
|
381
389
|
else {
|
|
382
|
-
const
|
|
383
|
-
|
|
390
|
+
const e = this.viewerElement || document.getElementById("triiiceratops-viewer");
|
|
391
|
+
e ? e.requestFullscreen().catch((s) => {
|
|
384
392
|
console.warn("Fullscreen request failed", s);
|
|
385
|
-
});
|
|
393
|
+
}) : console.warn("Cannot toggle fullscreen: Viewer element not found");
|
|
386
394
|
}
|
|
387
395
|
}
|
|
388
396
|
toggleMetadataDialog() {
|
|
389
397
|
this.showMetadataDialog = !this.showMetadataDialog;
|
|
390
398
|
}
|
|
391
399
|
get searchQuery() {
|
|
392
|
-
return
|
|
400
|
+
return t.get(n(this, W));
|
|
393
401
|
}
|
|
394
|
-
set searchQuery(
|
|
395
|
-
|
|
402
|
+
set searchQuery(e) {
|
|
403
|
+
t.set(n(this, W), e, !0);
|
|
396
404
|
}
|
|
397
405
|
get pendingSearchQuery() {
|
|
398
|
-
return
|
|
406
|
+
return t.get(n(this, J));
|
|
399
407
|
}
|
|
400
|
-
set pendingSearchQuery(
|
|
401
|
-
|
|
408
|
+
set pendingSearchQuery(e) {
|
|
409
|
+
t.set(n(this, J), e, !0);
|
|
402
410
|
}
|
|
403
411
|
get searchResults() {
|
|
404
|
-
return
|
|
412
|
+
return t.get(n(this, X));
|
|
405
413
|
}
|
|
406
|
-
set searchResults(
|
|
407
|
-
|
|
414
|
+
set searchResults(e) {
|
|
415
|
+
t.set(n(this, X), e, !0);
|
|
408
416
|
}
|
|
409
417
|
get isSearching() {
|
|
410
|
-
return
|
|
418
|
+
return t.get(n(this, Y));
|
|
411
419
|
}
|
|
412
|
-
set isSearching(
|
|
413
|
-
|
|
420
|
+
set isSearching(e) {
|
|
421
|
+
t.set(n(this, Y), e, !0);
|
|
414
422
|
}
|
|
415
423
|
get showSearchPanel() {
|
|
416
|
-
return
|
|
424
|
+
return t.get(n(this, ee));
|
|
417
425
|
}
|
|
418
|
-
set showSearchPanel(
|
|
419
|
-
|
|
426
|
+
set showSearchPanel(e) {
|
|
427
|
+
t.set(n(this, ee), e, !0);
|
|
420
428
|
}
|
|
421
429
|
toggleSearchPanel() {
|
|
422
430
|
this.showSearchPanel = !this.showSearchPanel, this.showSearchPanel || (this.searchAnnotations = []), this.dispatchStateChange();
|
|
423
431
|
}
|
|
424
432
|
get searchAnnotations() {
|
|
425
|
-
return
|
|
433
|
+
return t.get(n(this, te));
|
|
426
434
|
}
|
|
427
|
-
set searchAnnotations(
|
|
428
|
-
|
|
435
|
+
set searchAnnotations(e) {
|
|
436
|
+
t.set(n(this, te), e, !0);
|
|
429
437
|
}
|
|
430
438
|
get currentCanvasSearchAnnotations() {
|
|
431
|
-
return this.canvasId ? this.searchAnnotations.filter((
|
|
439
|
+
return this.canvasId ? this.searchAnnotations.filter((e) => e.canvasId === this.canvasId) : [];
|
|
432
440
|
}
|
|
433
|
-
async search(
|
|
434
|
-
this.dispatchStateChange(), await this._performSearch(
|
|
441
|
+
async search(e) {
|
|
442
|
+
this.dispatchStateChange(), await this._performSearch(e), this.dispatchStateChange();
|
|
435
443
|
}
|
|
436
|
-
async _performSearch(
|
|
444
|
+
async _performSearch(e) {
|
|
437
445
|
var s, i;
|
|
438
|
-
if (
|
|
439
|
-
this.isSearching = !0, this.searchQuery =
|
|
446
|
+
if (e.trim()) {
|
|
447
|
+
this.isSearching = !0, this.searchQuery = e, this.searchResults = [];
|
|
440
448
|
try {
|
|
441
449
|
const r = this.manifest;
|
|
442
450
|
if (!r) {
|
|
443
|
-
console.log("[ViewerState] Manifest not loaded, deferring search:",
|
|
451
|
+
console.log("[ViewerState] Manifest not loaded, deferring search:", e), this.pendingSearchQuery = e;
|
|
444
452
|
return;
|
|
445
453
|
}
|
|
446
454
|
let d = r.getService("http://iiif.io/api/search/1/search") || r.getService("http://iiif.io/api/search/0/search");
|
|
@@ -448,9 +456,9 @@ class ae {
|
|
|
448
456
|
console.warn("No IIIF search service found in manifest"), this.isSearching = !1;
|
|
449
457
|
return;
|
|
450
458
|
}
|
|
451
|
-
const I = `${d.id || d["@id"]}?q=${encodeURIComponent(
|
|
459
|
+
const I = `${d.id || d["@id"]}?q=${encodeURIComponent(e)}`, g = await fetch(I);
|
|
452
460
|
if (!g.ok) throw new Error("Search request failed");
|
|
453
|
-
const v = await g.json(), w = v.resources || [], A = /* @__PURE__ */ new Map(),
|
|
461
|
+
const v = await g.json(), w = v.resources || [], A = /* @__PURE__ */ new Map(), ie = (o) => {
|
|
454
462
|
const c = typeof o == "string" ? o : o["@id"] || o.id;
|
|
455
463
|
if (!c) return null;
|
|
456
464
|
const u = c.split("#xywh=");
|
|
@@ -465,7 +473,7 @@ class ae {
|
|
|
465
473
|
for (const l of c) {
|
|
466
474
|
const f = w.find((p) => p["@id"] === l || p.id === l);
|
|
467
475
|
if (f && f.on) {
|
|
468
|
-
const p = typeof f.on == "string" ? f.on : f.on["@id"] || f.on.id,
|
|
476
|
+
const p = typeof f.on == "string" ? f.on : f.on["@id"] || f.on.id, fe = p.split("#")[0], k = ie(p), b = this.canvases.findIndex((x) => x.id === fe);
|
|
469
477
|
b >= 0 && (u === -1 && (u = b), k && (y.push(k), S || (S = k)));
|
|
470
478
|
}
|
|
471
479
|
}
|
|
@@ -494,7 +502,7 @@ class ae {
|
|
|
494
502
|
}
|
|
495
503
|
else if (w.length > 0)
|
|
496
504
|
for (const o of w) {
|
|
497
|
-
const c = typeof o.on == "string" ? o.on : o.on["@id"] || o.on.id, u = c.split("#")[0], S =
|
|
505
|
+
const c = typeof o.on == "string" ? o.on : o.on["@id"] || o.on.id, u = c.split("#")[0], S = ie(c), y = this.canvases.findIndex((l) => l.id === u);
|
|
498
506
|
if (y >= 0) {
|
|
499
507
|
const l = this.canvases[y];
|
|
500
508
|
let f = "Canvas " + (y + 1);
|
|
@@ -514,13 +522,13 @@ class ae {
|
|
|
514
522
|
}
|
|
515
523
|
}
|
|
516
524
|
this.searchResults = Array.from(A.values()).sort((o, c) => o.canvasIndex - c.canvasIndex);
|
|
517
|
-
let
|
|
525
|
+
let ge = 0;
|
|
518
526
|
this.searchAnnotations = this.searchResults.flatMap((o) => {
|
|
519
527
|
const c = this.canvases[o.canvasIndex];
|
|
520
528
|
return o.hits.flatMap((u) => (u.allBounds && u.allBounds.length > 0 ? u.allBounds : u.bounds ? [u.bounds] : []).map((y) => {
|
|
521
529
|
const l = `${c.id}#xywh=${y.join(",")}`;
|
|
522
530
|
return {
|
|
523
|
-
"@id": `urn:search-hit:${
|
|
531
|
+
"@id": `urn:search-hit:${ge++}`,
|
|
524
532
|
"@type": "oa:Annotation",
|
|
525
533
|
motivation: "sc:painting",
|
|
526
534
|
on: l,
|
|
@@ -533,58 +541,58 @@ class ae {
|
|
|
533
541
|
}));
|
|
534
542
|
});
|
|
535
543
|
} catch (r) {
|
|
536
|
-
console.error("Search error:", r);
|
|
544
|
+
console.error("Search error:", r), this.isSearching = !1;
|
|
537
545
|
} finally {
|
|
538
|
-
this.isSearching = !1;
|
|
546
|
+
this.pendingSearchQuery || (this.isSearching = !1);
|
|
539
547
|
}
|
|
540
548
|
}
|
|
541
549
|
}
|
|
542
550
|
get pluginMenuButtons() {
|
|
543
|
-
return
|
|
551
|
+
return t.get(n(this, se));
|
|
544
552
|
}
|
|
545
|
-
set pluginMenuButtons(
|
|
546
|
-
|
|
553
|
+
set pluginMenuButtons(e) {
|
|
554
|
+
t.set(n(this, se), e, !0);
|
|
547
555
|
}
|
|
548
556
|
get pluginPanels() {
|
|
549
|
-
return
|
|
557
|
+
return t.get(n(this, ne));
|
|
550
558
|
}
|
|
551
|
-
set pluginPanels(
|
|
552
|
-
|
|
559
|
+
set pluginPanels(e) {
|
|
560
|
+
t.set(n(this, ne), e, !0);
|
|
553
561
|
}
|
|
554
562
|
get osdViewer() {
|
|
555
|
-
return
|
|
563
|
+
return t.get(n(this, ae));
|
|
556
564
|
}
|
|
557
|
-
set osdViewer(
|
|
558
|
-
|
|
565
|
+
set osdViewer(e) {
|
|
566
|
+
t.set(n(this, ae), e);
|
|
559
567
|
}
|
|
560
|
-
registerPlugin(
|
|
561
|
-
const s =
|
|
562
|
-
let i =
|
|
568
|
+
registerPlugin(e) {
|
|
569
|
+
const s = e.id || `plugin-${Math.random().toString(36).substr(2, 9)}`;
|
|
570
|
+
let i = t.state(!1);
|
|
563
571
|
const r = {
|
|
564
572
|
id: `${s}:toggle`,
|
|
565
|
-
icon:
|
|
566
|
-
tooltip:
|
|
573
|
+
icon: e.icon,
|
|
574
|
+
tooltip: e.name,
|
|
567
575
|
onClick: () => {
|
|
568
|
-
|
|
576
|
+
t.set(i, !t.get(i));
|
|
569
577
|
},
|
|
570
|
-
isActive: () =>
|
|
578
|
+
isActive: () => t.get(i),
|
|
571
579
|
order: 200
|
|
572
580
|
// Default order for simple plugins
|
|
573
581
|
}, d = {
|
|
574
582
|
id: `${s}:panel`,
|
|
575
|
-
component:
|
|
576
|
-
position:
|
|
577
|
-
isVisible: () =>
|
|
583
|
+
component: e.panel,
|
|
584
|
+
position: e.position || "left",
|
|
585
|
+
isVisible: () => t.get(i),
|
|
578
586
|
props: {
|
|
579
|
-
...
|
|
587
|
+
...e.props,
|
|
580
588
|
// Pass isOpen state and closer to component
|
|
581
|
-
isOpen:
|
|
589
|
+
isOpen: t.get(i),
|
|
582
590
|
close: () => {
|
|
583
|
-
|
|
591
|
+
t.set(i, !1);
|
|
584
592
|
}
|
|
585
593
|
}
|
|
586
594
|
};
|
|
587
|
-
this.pluginMenuButtons = [...this.pluginMenuButtons, r], this.pluginPanels = [...this.pluginPanels, d],
|
|
595
|
+
this.pluginMenuButtons = [...this.pluginMenuButtons, r], this.pluginPanels = [...this.pluginPanels, d], e.onInit && e.onInit(this);
|
|
588
596
|
}
|
|
589
597
|
/**
|
|
590
598
|
* Unregister a plugin's UI components by ID prefix.
|
|
@@ -592,8 +600,8 @@ class ae {
|
|
|
592
600
|
* since we don't have a handle on the plugin instance or its cleanup function anymore.
|
|
593
601
|
* Plugins should manage their own cleanup via component lifecycle (onDestroy) if possible.
|
|
594
602
|
*/
|
|
595
|
-
unregisterPlugin(
|
|
596
|
-
this.pluginMenuButtons = this.pluginMenuButtons.filter((s) => !s.id.startsWith(`${
|
|
603
|
+
unregisterPlugin(e) {
|
|
604
|
+
this.pluginMenuButtons = this.pluginMenuButtons.filter((s) => !s.id.startsWith(`${e}:`)), this.pluginPanels = this.pluginPanels.filter((s) => !s.id.startsWith(`${e}:`));
|
|
597
605
|
}
|
|
598
606
|
/**
|
|
599
607
|
* Notify that OSD viewer is ready.
|
|
@@ -601,8 +609,8 @@ class ae {
|
|
|
601
609
|
* Instead, plugins should use the OSDViewer instance from context or listen for 'osd-ready' event (if we emitted one).
|
|
602
610
|
* But since we have direct access to osdViewer in this state, components can just react to it.
|
|
603
611
|
*/
|
|
604
|
-
notifyOSDReady(
|
|
605
|
-
this.osdViewer =
|
|
612
|
+
notifyOSDReady(e) {
|
|
613
|
+
this.osdViewer = e;
|
|
606
614
|
}
|
|
607
615
|
/**
|
|
608
616
|
* Cleanup everything.
|
|
@@ -611,32 +619,32 @@ class ae {
|
|
|
611
619
|
this.pluginMenuButtons = [], this.pluginPanels = [], this.pluginEventHandlers.clear();
|
|
612
620
|
}
|
|
613
621
|
}
|
|
614
|
-
R = new WeakMap(), G = new WeakMap(), B = new WeakMap(), T = new WeakMap(), j = new WeakMap(), V = new WeakMap(), O = new WeakMap(), F = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), z = new WeakMap(), H = new WeakMap(), N = new WeakMap(), U = new WeakMap(), q = new WeakMap(), K = new WeakMap(), $ = new WeakMap(), W = new WeakMap(), J = new WeakMap(), X = new WeakMap(), Y = new WeakMap(),
|
|
615
|
-
const
|
|
616
|
-
let
|
|
617
|
-
function
|
|
618
|
-
return
|
|
622
|
+
R = new WeakMap(), G = new WeakMap(), B = new WeakMap(), T = new WeakMap(), j = new WeakMap(), V = new WeakMap(), O = new WeakMap(), F = new WeakMap(), Q = new WeakMap(), Z = new WeakMap(), z = new WeakMap(), H = new WeakMap(), N = new WeakMap(), U = new WeakMap(), q = new WeakMap(), K = new WeakMap(), $ = new WeakMap(), W = new WeakMap(), J = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), ee = new WeakMap(), te = new WeakMap(), se = new WeakMap(), ne = new WeakMap(), ae = new WeakMap();
|
|
623
|
+
const it = "triiiceratops:viewerState";
|
|
624
|
+
let ve = Symbol("phosphor-svelte");
|
|
625
|
+
function Oe() {
|
|
626
|
+
return Te(ve) ? je(ve) : {};
|
|
619
627
|
}
|
|
620
|
-
const
|
|
628
|
+
const Fe = "en", de = (
|
|
621
629
|
/** @type {const} */
|
|
622
630
|
["en", "de"]
|
|
623
|
-
),
|
|
631
|
+
), ye = "PARAGLIDE_LOCALE", Qe = 3456e4, we = [
|
|
624
632
|
"cookie",
|
|
625
633
|
"globalVariable",
|
|
626
634
|
"baseLocale"
|
|
627
635
|
];
|
|
628
636
|
globalThis.__paraglide = {};
|
|
629
|
-
let
|
|
637
|
+
let ce, me = !1, Se = () => {
|
|
630
638
|
let a;
|
|
631
|
-
for (const
|
|
632
|
-
if (
|
|
633
|
-
a =
|
|
634
|
-
else if (
|
|
635
|
-
a =
|
|
636
|
-
else if (
|
|
637
|
-
a =
|
|
638
|
-
else if (
|
|
639
|
-
const s =
|
|
639
|
+
for (const e of we) {
|
|
640
|
+
if (e === "cookie")
|
|
641
|
+
a = Ne();
|
|
642
|
+
else if (e === "baseLocale")
|
|
643
|
+
a = Fe;
|
|
644
|
+
else if (e === "globalVariable" && ce !== void 0)
|
|
645
|
+
a = ce;
|
|
646
|
+
else if (Ie(e) && ue.has(e)) {
|
|
647
|
+
const s = ue.get(e);
|
|
640
648
|
if (s) {
|
|
641
649
|
const i = s.getLocale();
|
|
642
650
|
if (i instanceof Promise)
|
|
@@ -645,39 +653,39 @@ let ht, mt = !1, St = () => {
|
|
|
645
653
|
}
|
|
646
654
|
}
|
|
647
655
|
if (a !== void 0) {
|
|
648
|
-
const s =
|
|
649
|
-
return
|
|
656
|
+
const s = He(a);
|
|
657
|
+
return me || (ce = s, me = !0, Ae(s, { reload: !1 })), s;
|
|
650
658
|
}
|
|
651
659
|
}
|
|
652
660
|
throw new Error("No locale found. Read the docs https://inlang.com/m/gerre34r/library-inlang-paraglideJs/errors#no-locale-found");
|
|
653
661
|
};
|
|
654
|
-
const
|
|
662
|
+
const Ze = (a) => {
|
|
655
663
|
window.location.reload();
|
|
656
664
|
};
|
|
657
|
-
let
|
|
665
|
+
let Ae = (a, e) => {
|
|
658
666
|
const s = {
|
|
659
667
|
reload: !0,
|
|
660
|
-
...
|
|
668
|
+
...e
|
|
661
669
|
};
|
|
662
670
|
let i;
|
|
663
671
|
try {
|
|
664
|
-
i =
|
|
672
|
+
i = Se();
|
|
665
673
|
} catch {
|
|
666
674
|
}
|
|
667
675
|
const r = [];
|
|
668
|
-
for (const m of
|
|
676
|
+
for (const m of we)
|
|
669
677
|
if (m === "globalVariable")
|
|
670
|
-
|
|
678
|
+
ce = a;
|
|
671
679
|
else if (m === "cookie") {
|
|
672
680
|
if (typeof document > "u" || typeof window > "u")
|
|
673
681
|
continue;
|
|
674
|
-
const I = `${
|
|
682
|
+
const I = `${ye}=${a}; path=/; max-age=${Qe}`;
|
|
675
683
|
document.cookie = I;
|
|
676
684
|
} else {
|
|
677
685
|
if (m === "baseLocale")
|
|
678
686
|
continue;
|
|
679
|
-
if (
|
|
680
|
-
const I =
|
|
687
|
+
if (Ie(m) && ue.has(m)) {
|
|
688
|
+
const I = ue.get(m);
|
|
681
689
|
if (I) {
|
|
682
690
|
let g = I.setLocale(a);
|
|
683
691
|
g instanceof Promise && (g = g.catch((v) => {
|
|
@@ -689,7 +697,7 @@ let At = (a, t) => {
|
|
|
689
697
|
}
|
|
690
698
|
}
|
|
691
699
|
const d = () => {
|
|
692
|
-
s.reload && window.location && a !== i &&
|
|
700
|
+
s.reload && window.location && a !== i && Ze();
|
|
693
701
|
};
|
|
694
702
|
if (r.length)
|
|
695
703
|
return Promise.all(r).then(() => {
|
|
@@ -697,185 +705,185 @@ let At = (a, t) => {
|
|
|
697
705
|
});
|
|
698
706
|
d();
|
|
699
707
|
};
|
|
700
|
-
const
|
|
701
|
-
|
|
708
|
+
const rt = (a) => {
|
|
709
|
+
Ae = /** @type {SetLocaleFn} */
|
|
702
710
|
a;
|
|
703
711
|
};
|
|
704
|
-
function
|
|
705
|
-
return typeof a != "string" ? !1 : a ?
|
|
712
|
+
function ze(a) {
|
|
713
|
+
return typeof a != "string" ? !1 : a ? de.some((e) => e.toLowerCase() === a.toLowerCase()) : !1;
|
|
706
714
|
}
|
|
707
|
-
function
|
|
715
|
+
function He(a) {
|
|
708
716
|
if (typeof a != "string")
|
|
709
717
|
throw new Error(`Invalid locale: ${a}. Expected a string.`);
|
|
710
|
-
const
|
|
718
|
+
const e = a.toLowerCase(), s = de.find((i) => i.toLowerCase() === e);
|
|
711
719
|
if (!s)
|
|
712
|
-
throw new Error(`Invalid locale: ${a}. Expected one of: ${
|
|
720
|
+
throw new Error(`Invalid locale: ${a}. Expected one of: ${de.join(", ")}`);
|
|
713
721
|
return s;
|
|
714
722
|
}
|
|
715
|
-
function
|
|
723
|
+
function Ne() {
|
|
716
724
|
if (typeof document > "u" || !document.cookie)
|
|
717
725
|
return;
|
|
718
|
-
const a = document.cookie.match(new RegExp(`(^| )${
|
|
719
|
-
if (
|
|
720
|
-
return
|
|
726
|
+
const a = document.cookie.match(new RegExp(`(^| )${ye}=([^;]+)`)), e = a == null ? void 0 : a[2];
|
|
727
|
+
if (ze(e))
|
|
728
|
+
return e;
|
|
721
729
|
}
|
|
722
|
-
const
|
|
723
|
-
function
|
|
730
|
+
const ue = /* @__PURE__ */ new Map();
|
|
731
|
+
function Ie(a) {
|
|
724
732
|
return typeof a == "string" && /^custom-[A-Za-z0-9_-]+$/.test(a);
|
|
725
733
|
}
|
|
726
|
-
const
|
|
734
|
+
const Ue = (
|
|
727
735
|
/** @type {(inputs: {}) => LocalizedString} */
|
|
728
736
|
() => (
|
|
729
737
|
/** @type {LocalizedString} */
|
|
730
738
|
"Close"
|
|
731
739
|
)
|
|
732
|
-
),
|
|
740
|
+
), qe = (
|
|
733
741
|
/** @type {(inputs: {}) => LocalizedString} */
|
|
734
742
|
() => (
|
|
735
743
|
/** @type {LocalizedString} */
|
|
736
744
|
"Schließen"
|
|
737
745
|
)
|
|
738
|
-
),
|
|
739
|
-
var
|
|
740
|
-
function
|
|
741
|
-
|
|
742
|
-
const s =
|
|
743
|
-
let i =
|
|
746
|
+
), ot = /* @__NO_SIDE_EFFECTS__ */ (a = {}, e = {}) => (e.locale ?? Se()) === "en" ? Ue() : qe();
|
|
747
|
+
var Ke = t.from_svg('<path d="M208.49,191.51a12,12,0,0,1-17,17L128,145,64.49,208.49a12,12,0,0,1-17-17L111,128,47.51,64.49a12,12,0,0,1,17-17L128,111l63.51-63.52a12,12,0,0,1,17,17L145,128Z"></path>'), $e = t.from_svg('<path d="M216,56V200a16,16,0,0,1-16,16H56a16,16,0,0,1-16-16V56A16,16,0,0,1,56,40H200A16,16,0,0,1,216,56Z" opacity="0.2"></path><path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>', 1), We = t.from_svg('<path d="M208,32H48A16,16,0,0,0,32,48V208a16,16,0,0,0,16,16H208a16,16,0,0,0,16-16V48A16,16,0,0,0,208,32ZM181.66,170.34a8,8,0,0,1-11.32,11.32L128,139.31,85.66,181.66a8,8,0,0,1-11.32-11.32L116.69,128,74.34,85.66A8,8,0,0,1,85.66,74.34L128,116.69l42.34-42.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>'), Je = t.from_svg('<path d="M204.24,195.76a6,6,0,1,1-8.48,8.48L128,136.49,60.24,204.24a6,6,0,0,1-8.48-8.48L119.51,128,51.76,60.24a6,6,0,0,1,8.48-8.48L128,119.51l67.76-67.75a6,6,0,0,1,8.48,8.48L136.49,128Z"></path>'), Xe = t.from_svg('<path d="M205.66,194.34a8,8,0,0,1-11.32,11.32L128,139.31,61.66,205.66a8,8,0,0,1-11.32-11.32L116.69,128,50.34,61.66A8,8,0,0,1,61.66,50.34L128,116.69l66.34-66.35a8,8,0,0,1,11.32,11.32L139.31,128Z"></path>'), Ye = t.from_svg('<path d="M202.83,197.17a4,4,0,0,1-5.66,5.66L128,133.66,58.83,202.83a4,4,0,0,1-5.66-5.66L122.34,128,53.17,58.83a4,4,0,0,1,5.66-5.66L128,122.34l69.17-69.17a4,4,0,1,1,5.66,5.66L133.66,128Z"></path>'), et = t.from_svg('<svg><!><rect width="256" height="256" fill="none"></rect><!></svg>');
|
|
748
|
+
function lt(a, e) {
|
|
749
|
+
t.push(e, !0);
|
|
750
|
+
const s = Oe();
|
|
751
|
+
let i = t.rest_props(e, ["$$slots", "$$events", "$$legacy", "children"]), r = t.derived(() => e.weight ?? s.weight ?? "regular"), d = t.derived(() => e.color ?? s.color ?? "currentColor"), m = t.derived(() => e.size ?? s.size ?? "1em"), I = t.derived(() => e.mirrored ?? s.mirrored ?? !1);
|
|
744
752
|
function g(o) {
|
|
745
753
|
let { weight: c, color: u, size: S, mirrored: y, ...l } = o;
|
|
746
754
|
return l;
|
|
747
755
|
}
|
|
748
|
-
var v =
|
|
749
|
-
|
|
756
|
+
var v = et();
|
|
757
|
+
t.attribute_effect(
|
|
750
758
|
v,
|
|
751
759
|
(o, c) => ({
|
|
752
760
|
xmlns: "http://www.w3.org/2000/svg",
|
|
753
761
|
role: "img",
|
|
754
|
-
width:
|
|
755
|
-
height:
|
|
756
|
-
fill:
|
|
757
|
-
transform:
|
|
762
|
+
width: t.get(m),
|
|
763
|
+
height: t.get(m),
|
|
764
|
+
fill: t.get(d),
|
|
765
|
+
transform: t.get(I) ? "scale(-1, 1)" : void 0,
|
|
758
766
|
viewBox: "0 0 256 256",
|
|
759
767
|
...o,
|
|
760
768
|
...c
|
|
761
769
|
}),
|
|
762
770
|
[() => g(s), () => g(i)]
|
|
763
771
|
);
|
|
764
|
-
var w =
|
|
772
|
+
var w = t.child(v);
|
|
765
773
|
{
|
|
766
774
|
var A = (o) => {
|
|
767
|
-
var c =
|
|
768
|
-
|
|
775
|
+
var c = t.comment(), u = t.first_child(c);
|
|
776
|
+
t.snippet(u, () => e.children), t.append(o, c);
|
|
769
777
|
};
|
|
770
|
-
|
|
771
|
-
|
|
778
|
+
t.if(w, (o) => {
|
|
779
|
+
e.children && o(A);
|
|
772
780
|
});
|
|
773
781
|
}
|
|
774
|
-
var
|
|
782
|
+
var ie = t.sibling(w, 2);
|
|
775
783
|
{
|
|
776
784
|
var _ = (o) => {
|
|
777
|
-
var c =
|
|
778
|
-
|
|
779
|
-
},
|
|
780
|
-
var c =
|
|
785
|
+
var c = Ke();
|
|
786
|
+
t.append(o, c);
|
|
787
|
+
}, ge = (o) => {
|
|
788
|
+
var c = t.comment(), u = t.first_child(c);
|
|
781
789
|
{
|
|
782
790
|
var S = (l) => {
|
|
783
|
-
var f = $
|
|
784
|
-
|
|
791
|
+
var f = $e();
|
|
792
|
+
t.next(), t.append(l, f);
|
|
785
793
|
}, y = (l) => {
|
|
786
|
-
var f =
|
|
794
|
+
var f = t.comment(), p = t.first_child(f);
|
|
787
795
|
{
|
|
788
|
-
var
|
|
789
|
-
var x =
|
|
790
|
-
|
|
796
|
+
var fe = (b) => {
|
|
797
|
+
var x = We();
|
|
798
|
+
t.append(b, x);
|
|
791
799
|
}, k = (b) => {
|
|
792
|
-
var x =
|
|
800
|
+
var x = t.comment(), be = t.first_child(x);
|
|
793
801
|
{
|
|
794
|
-
var
|
|
795
|
-
var
|
|
796
|
-
|
|
797
|
-
},
|
|
798
|
-
var
|
|
802
|
+
var _e = (L) => {
|
|
803
|
+
var re = Je();
|
|
804
|
+
t.append(L, re);
|
|
805
|
+
}, xe = (L) => {
|
|
806
|
+
var re = t.comment(), Le = t.first_child(re);
|
|
799
807
|
{
|
|
800
|
-
var
|
|
801
|
-
var
|
|
802
|
-
|
|
803
|
-
},
|
|
804
|
-
var
|
|
808
|
+
var Me = (M) => {
|
|
809
|
+
var oe = Xe();
|
|
810
|
+
t.append(M, oe);
|
|
811
|
+
}, Ce = (M) => {
|
|
812
|
+
var oe = t.comment(), Pe = t.first_child(oe);
|
|
805
813
|
{
|
|
806
|
-
var
|
|
807
|
-
var
|
|
808
|
-
|
|
809
|
-
},
|
|
810
|
-
var
|
|
811
|
-
|
|
814
|
+
var ke = (C) => {
|
|
815
|
+
var le = Ye();
|
|
816
|
+
t.append(C, le);
|
|
817
|
+
}, Ee = (C) => {
|
|
818
|
+
var le = t.text();
|
|
819
|
+
le.nodeValue = (console.error('Unsupported icon weight. Choose from "thin", "light", "regular", "bold", "fill", or "duotone".'), ""), t.append(C, le);
|
|
812
820
|
};
|
|
813
|
-
|
|
814
|
-
|
|
821
|
+
t.if(
|
|
822
|
+
Pe,
|
|
815
823
|
(C) => {
|
|
816
|
-
|
|
824
|
+
t.get(r) === "thin" ? C(ke) : C(Ee, !1);
|
|
817
825
|
},
|
|
818
826
|
!0
|
|
819
827
|
);
|
|
820
828
|
}
|
|
821
|
-
|
|
829
|
+
t.append(M, oe);
|
|
822
830
|
};
|
|
823
|
-
|
|
824
|
-
|
|
831
|
+
t.if(
|
|
832
|
+
Le,
|
|
825
833
|
(M) => {
|
|
826
|
-
|
|
834
|
+
t.get(r) === "regular" ? M(Me) : M(Ce, !1);
|
|
827
835
|
},
|
|
828
836
|
!0
|
|
829
837
|
);
|
|
830
838
|
}
|
|
831
|
-
|
|
839
|
+
t.append(L, re);
|
|
832
840
|
};
|
|
833
|
-
|
|
834
|
-
|
|
841
|
+
t.if(
|
|
842
|
+
be,
|
|
835
843
|
(L) => {
|
|
836
|
-
|
|
844
|
+
t.get(r) === "light" ? L(_e) : L(xe, !1);
|
|
837
845
|
},
|
|
838
846
|
!0
|
|
839
847
|
);
|
|
840
848
|
}
|
|
841
|
-
|
|
849
|
+
t.append(b, x);
|
|
842
850
|
};
|
|
843
|
-
|
|
851
|
+
t.if(
|
|
844
852
|
p,
|
|
845
853
|
(b) => {
|
|
846
|
-
|
|
854
|
+
t.get(r) === "fill" ? b(fe) : b(k, !1);
|
|
847
855
|
},
|
|
848
856
|
!0
|
|
849
857
|
);
|
|
850
858
|
}
|
|
851
|
-
|
|
859
|
+
t.append(l, f);
|
|
852
860
|
};
|
|
853
|
-
|
|
861
|
+
t.if(
|
|
854
862
|
u,
|
|
855
863
|
(l) => {
|
|
856
|
-
|
|
864
|
+
t.get(r) === "duotone" ? l(S) : l(y, !1);
|
|
857
865
|
},
|
|
858
866
|
!0
|
|
859
867
|
);
|
|
860
868
|
}
|
|
861
|
-
|
|
869
|
+
t.append(o, c);
|
|
862
870
|
};
|
|
863
|
-
|
|
864
|
-
|
|
871
|
+
t.if(ie, (o) => {
|
|
872
|
+
t.get(r) === "bold" ? o(_) : o(ge, !1);
|
|
865
873
|
});
|
|
866
874
|
}
|
|
867
|
-
|
|
875
|
+
t.reset(v), t.append(a, v), t.pop();
|
|
868
876
|
}
|
|
869
877
|
export {
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
+
Ve as M,
|
|
879
|
+
it as V,
|
|
880
|
+
lt as X,
|
|
881
|
+
Se as a,
|
|
882
|
+
at as b,
|
|
883
|
+
ot as c,
|
|
884
|
+
Oe as g,
|
|
885
|
+
de as l,
|
|
878
886
|
P as m,
|
|
879
|
-
|
|
880
|
-
|
|
887
|
+
rt as o,
|
|
888
|
+
Ae as s
|
|
881
889
|
};
|