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