react-iiif-vault 1.0.1 → 1.0.3
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/bundle/cjs/index.js +9 -9
- package/dist/bundle/cjs/index.js.map +1 -1
- package/dist/bundle/esm/index.mjs +886 -858
- package/dist/bundle/esm/index.mjs.map +1 -1
- package/dist/canvas-panel/cjs/canvas-panel.js +8 -8
- package/dist/canvas-panel/cjs/canvas-panel.js.map +1 -1
- package/dist/canvas-panel/esm/canvas-panel.mjs +713 -685
- package/dist/canvas-panel/esm/canvas-panel.mjs.map +1 -1
- package/dist/index.umd.js +51 -51
- package/dist/index.umd.js.map +1 -1
- package/dist/react17/cjs/index.js +9 -9
- package/dist/react17/cjs/index.js.map +1 -1
- package/dist/react17/esm/index.mjs +886 -858
- package/dist/react17/esm/index.mjs.map +1 -1
- package/package.json +2 -2
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as x, jsxs as N, Fragment as Me } from "react/jsx-runtime";
|
|
2
2
|
import * as at from "react";
|
|
3
|
-
import me, { useContext as H, useMemo as E, useState as B, useEffect as K, useCallback as D, createContext as ce, useRef as ge, useLayoutEffect as
|
|
3
|
+
import me, { useContext as H, useMemo as E, useState as B, useEffect as K, useCallback as D, createContext as ce, useRef as ge, useLayoutEffect as yr, Fragment as Ke, useReducer as an, forwardRef as vr, useImperativeHandle as cn } from "react";
|
|
4
4
|
import { AtlasAuto as un, ModeContext as ln, mergeStyles as fn, RegionHighlight as pn, TileSet as dn, HTMLPortal as hn } from "@atlas-viewer/atlas";
|
|
5
|
-
import { serialize as yn, serializeConfigPresentation2 as vn, serializeConfigPresentation3 as gn, isSpecificResource as mn, HAS_PART as Ze, PART_OF as Xe, frameResource as
|
|
6
|
-
import { ImageServiceLoader as
|
|
5
|
+
import { serialize as yn, serializeConfigPresentation2 as vn, serializeConfigPresentation3 as gn, isSpecificResource as mn, HAS_PART as Ze, PART_OF as Xe, frameResource as gr, normalize as bn } from "@iiif/parser";
|
|
6
|
+
import { ImageServiceLoader as mr, getImageServices as mt, getFixedSizeFromImage as Gt } from "@atlas-viewer/iiif-image-api";
|
|
7
7
|
function bt(e, t) {
|
|
8
8
|
return bt = Object.setPrototypeOf || function(i, n) {
|
|
9
9
|
return i.__proto__ = n, i;
|
|
@@ -16,17 +16,17 @@ var xn = function(t, r) {
|
|
|
16
16
|
return t === void 0 && (t = []), r === void 0 && (r = []), t.length !== r.length || t.some(function(i, n) {
|
|
17
17
|
return !Object.is(i, r[n]);
|
|
18
18
|
});
|
|
19
|
-
},
|
|
19
|
+
}, Jt = {
|
|
20
20
|
error: null
|
|
21
21
|
}, wn = /* @__PURE__ */ function(e) {
|
|
22
22
|
An(t, e);
|
|
23
23
|
function t() {
|
|
24
24
|
for (var i, n = arguments.length, s = new Array(n), o = 0; o < n; o++)
|
|
25
25
|
s[o] = arguments[o];
|
|
26
|
-
return i = e.call.apply(e, [this].concat(s)) || this, i.state =
|
|
27
|
-
for (var a, u = arguments.length,
|
|
28
|
-
|
|
29
|
-
i.props.onReset == null || (a = i.props).onReset.apply(a,
|
|
26
|
+
return i = e.call.apply(e, [this].concat(s)) || this, i.state = Jt, i.resetErrorBoundary = function() {
|
|
27
|
+
for (var a, u = arguments.length, f = new Array(u), l = 0; l < u; l++)
|
|
28
|
+
f[l] = arguments[l];
|
|
29
|
+
i.props.onReset == null || (a = i.props).onReset.apply(a, f), i.reset();
|
|
30
30
|
}, i;
|
|
31
31
|
}
|
|
32
32
|
t.getDerivedStateFromError = function(n) {
|
|
@@ -36,29 +36,29 @@ var xn = function(t, r) {
|
|
|
36
36
|
};
|
|
37
37
|
var r = t.prototype;
|
|
38
38
|
return r.reset = function() {
|
|
39
|
-
this.setState(
|
|
39
|
+
this.setState(Jt);
|
|
40
40
|
}, r.componentDidCatch = function(n, s) {
|
|
41
41
|
var o, a;
|
|
42
42
|
(o = (a = this.props).onError) == null || o.call(a, n, s);
|
|
43
43
|
}, r.componentDidUpdate = function(n, s) {
|
|
44
44
|
var o = this.state.error, a = this.props.resetKeys;
|
|
45
45
|
if (o !== null && s.error !== null && xn(n.resetKeys, a)) {
|
|
46
|
-
var u,
|
|
47
|
-
(u = (
|
|
46
|
+
var u, f;
|
|
47
|
+
(u = (f = this.props).onResetKeysChange) == null || u.call(f, n.resetKeys, a), this.reset();
|
|
48
48
|
}
|
|
49
49
|
}, r.render = function() {
|
|
50
50
|
var n = this.state.error, s = this.props, o = s.fallbackRender, a = s.FallbackComponent, u = s.fallback;
|
|
51
51
|
if (n !== null) {
|
|
52
|
-
var
|
|
52
|
+
var f = {
|
|
53
53
|
error: n,
|
|
54
54
|
resetErrorBoundary: this.resetErrorBoundary
|
|
55
55
|
};
|
|
56
56
|
if (/* @__PURE__ */ at.isValidElement(u))
|
|
57
57
|
return u;
|
|
58
58
|
if (typeof o == "function")
|
|
59
|
-
return o(
|
|
59
|
+
return o(f);
|
|
60
60
|
if (a)
|
|
61
|
-
return /* @__PURE__ */ at.createElement(a,
|
|
61
|
+
return /* @__PURE__ */ at.createElement(a, f);
|
|
62
62
|
throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
|
|
63
63
|
}
|
|
64
64
|
return this.props.children;
|
|
@@ -71,13 +71,13 @@ const Sn = {
|
|
|
71
71
|
canvas: void 0,
|
|
72
72
|
annotation: void 0,
|
|
73
73
|
annotationPage: void 0
|
|
74
|
-
},
|
|
74
|
+
}, Pt = me.createContext(Sn), be = () => H(Pt);
|
|
75
75
|
function Te({ value: e, children: t }) {
|
|
76
76
|
const r = be(), i = E(() => ({
|
|
77
77
|
...r,
|
|
78
78
|
...e
|
|
79
79
|
}), [e, r]);
|
|
80
|
-
return /* @__PURE__ */ x(
|
|
80
|
+
return /* @__PURE__ */ x(Pt.Provider, { value: i, children: t });
|
|
81
81
|
}
|
|
82
82
|
var Cn = Object.defineProperty, Mn = (e, t, r) => t in e ? Cn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ve = (e, t, r) => (Mn(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
83
83
|
const q = function(e) {
|
|
@@ -89,8 +89,8 @@ const q = function(e) {
|
|
|
89
89
|
...i !== void 0 && { meta: i }
|
|
90
90
|
});
|
|
91
91
|
};
|
|
92
|
-
},
|
|
93
|
-
importEntities:
|
|
92
|
+
}, br = "@iiif/IMPORT_ENTITIES", Ar = "@iiif/MODIFY_ENTITY_FIELD", xr = "@iiif/REORDER_ENTITY_FIELD", wr = "@iiif/ADD_REFERENCE", At = "@iiif/UPDATE_REFERENCE", Sr = "@iiif/REMOVE_REFERENCE", Cr = "@iiif/ADD_METADATA", Mr = "@iiif/REMOVE_METADATA", xt = "@iiif/UPDATE_METADATA", Rr = "@iiif/REORDER_METADATA", Ir = q(br)(), Rn = q(Ar)(), In = q(xr)(), Tn = q(wr)(), kn = q(Sr)(), On = q(At)(), En = q(Cr)(), Pn = q(xt)(), Ln = q(Mr)(), Fn = q(Rr)(), jn = {
|
|
93
|
+
importEntities: Ir,
|
|
94
94
|
modifyEntityField: Rn,
|
|
95
95
|
reorderEntityField: In,
|
|
96
96
|
addReference: Tn,
|
|
@@ -100,23 +100,23 @@ const q = function(e) {
|
|
|
100
100
|
removeMetadata: Ln,
|
|
101
101
|
updateMetadata: Pn,
|
|
102
102
|
reorderMetadata: Fn
|
|
103
|
-
},
|
|
103
|
+
}, Tr = "@iiif/ADD_MAPPING", kr = "@iiif/ADD_MAPPINGS", $n = q(Tr)(), Dn = q(kr)(), Or = "@iiif/SET_META_VALUE", Er = "@iiif/SET_META_VALUE_DYNAMIC", Pr = "@iiif/UNSET_META_VALUE", qn = q(Or)(), _n = q(Er)(), Un = q(Pr)(), Kt = {
|
|
104
104
|
setMetaValue: qn,
|
|
105
105
|
setMetaValueDynamic: _n,
|
|
106
106
|
unsetMetaValue: Un
|
|
107
|
-
}, wt = "RESOURCE_ERROR",
|
|
107
|
+
}, wt = "RESOURCE_ERROR", Lr = "RESOURCE_LOADING", St = "RESOURCE_READY", Fr = "@iiif/REQUEST_RESOURCE", jr = "@iiif/REQUEST_ERROR", $r = "@iiif/REQUEST_MISMATCH", Dr = "@iiif/REQUEST_COMPLETE", Vn = "@iiif/REQUEST_OFFLINE_RESOURCE", Nn = q(Fr)(), Ct = q(jr)(), Hn = q($r)(), Bn = q(Dr)(), Lt = "@iiif/BATCH", zn = "@iiif/BATCH_IMPORT", Mt = q(Lt)(), Wn = (e, t) => {
|
|
108
108
|
const { entities: r, resource: i, mapping: n } = bn(t);
|
|
109
109
|
if (i.id === void 0)
|
|
110
|
-
return [
|
|
111
|
-
const s = [
|
|
110
|
+
return [Ct({ id: e, message: "ID is not defined in resource." })];
|
|
111
|
+
const s = [Ir({ entities: r }), Dn({ mapping: n })];
|
|
112
112
|
return i.id !== e && (s.push($n({ id: e, type: i.type })), s.push(Hn({ requestId: e, actualId: i.id }))), s.push(Bn({ id: e })), s;
|
|
113
|
-
},
|
|
113
|
+
}, Zt = Number.isNaN || function(e) {
|
|
114
114
|
return typeof e == "number" && e !== e;
|
|
115
115
|
};
|
|
116
116
|
function Qn(e, t) {
|
|
117
|
-
return !!(e === t ||
|
|
117
|
+
return !!(e === t || Zt(e) && Zt(t));
|
|
118
118
|
}
|
|
119
|
-
function
|
|
119
|
+
function Xt(e, t) {
|
|
120
120
|
if (!Array.isArray(e) || !Array.isArray(t))
|
|
121
121
|
return e === t;
|
|
122
122
|
if (e.length !== t.length)
|
|
@@ -133,63 +133,79 @@ function ct(e, t, r) {
|
|
|
133
133
|
const s = e.iiif.entities[n][i.resourceUri];
|
|
134
134
|
if (s && s[Ze]) {
|
|
135
135
|
const o = s[Ze].find((a) => r ? a[Xe] === r.id : a[Xe] === s.id);
|
|
136
|
-
return
|
|
136
|
+
return gr(s, o);
|
|
137
137
|
}
|
|
138
138
|
return s;
|
|
139
139
|
}
|
|
140
|
-
function
|
|
141
|
-
return
|
|
140
|
+
function Yn(e) {
|
|
141
|
+
return e && typeof e.then == "function";
|
|
142
|
+
}
|
|
143
|
+
function er(e, t, { waitTimeout: r = 30 } = {}) {
|
|
144
|
+
return (i, n) => {
|
|
142
145
|
const s = e.getStore(), o = s.getState(), a = o.iiif.requests[i];
|
|
143
|
-
if (a)
|
|
146
|
+
if (a) {
|
|
147
|
+
if (a.loadingState === St) {
|
|
148
|
+
const f = ct(o, i);
|
|
149
|
+
if (f)
|
|
150
|
+
return f;
|
|
151
|
+
}
|
|
144
152
|
switch (a.loadingState) {
|
|
145
153
|
case wt:
|
|
146
154
|
break;
|
|
147
|
-
case
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
if (u)
|
|
181
|
-
return u;
|
|
182
|
-
break;
|
|
183
|
-
}
|
|
155
|
+
case Lr:
|
|
156
|
+
return (async () => {
|
|
157
|
+
let f, l = !1;
|
|
158
|
+
try {
|
|
159
|
+
const d = await Promise.race([
|
|
160
|
+
new Promise((v, m) => {
|
|
161
|
+
l || (f = s.subscribe(() => {
|
|
162
|
+
const h = s.getState();
|
|
163
|
+
if (h.iiif.requests[i].loadingState === wt) {
|
|
164
|
+
m();
|
|
165
|
+
return;
|
|
166
|
+
}
|
|
167
|
+
if (h.iiif.requests[i].loadingState === St) {
|
|
168
|
+
const g = ct(h, i);
|
|
169
|
+
g ? v(g) : m();
|
|
170
|
+
}
|
|
171
|
+
}));
|
|
172
|
+
}),
|
|
173
|
+
new Promise(
|
|
174
|
+
(v, m) => setTimeout(
|
|
175
|
+
() => {
|
|
176
|
+
l = !0, m();
|
|
177
|
+
},
|
|
178
|
+
r * 60 * 1e3
|
|
179
|
+
)
|
|
180
|
+
)
|
|
181
|
+
]);
|
|
182
|
+
if (f && f(), d)
|
|
183
|
+
return d;
|
|
184
|
+
} catch {
|
|
185
|
+
f && f();
|
|
186
|
+
}
|
|
187
|
+
})();
|
|
184
188
|
}
|
|
189
|
+
}
|
|
185
190
|
e.dispatch(Nn({ id: i }));
|
|
191
|
+
const u = (f) => {
|
|
192
|
+
if (!f)
|
|
193
|
+
return;
|
|
194
|
+
!f.id && !f["@id"] && (f["@type"] && (f["@id"] = i), f.id = i);
|
|
195
|
+
const l = Wn(i, f);
|
|
196
|
+
return e.dispatch(Mt({ actions: l })), ct(s.getState(), i);
|
|
197
|
+
};
|
|
186
198
|
try {
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
199
|
+
const f = t(i, n);
|
|
200
|
+
return Yn(f) ? (async () => {
|
|
201
|
+
try {
|
|
202
|
+
return u(await f);
|
|
203
|
+
} catch (l) {
|
|
204
|
+
throw e.dispatch(Ct({ id: i, message: l.toString() })), l;
|
|
205
|
+
}
|
|
206
|
+
})() : u(f);
|
|
207
|
+
} catch (f) {
|
|
208
|
+
throw e.dispatch(Ct({ id: i, message: f.toString() })), f;
|
|
193
209
|
}
|
|
194
210
|
};
|
|
195
211
|
}
|
|
@@ -208,47 +224,47 @@ function qr() {
|
|
|
208
224
|
Agent: {}
|
|
209
225
|
};
|
|
210
226
|
}
|
|
211
|
-
const
|
|
227
|
+
const tr = (e) => {
|
|
212
228
|
let t;
|
|
213
229
|
const r = /* @__PURE__ */ new Set(), i = (o, a) => {
|
|
214
230
|
const u = typeof o == "function" ? o(t) : o;
|
|
215
231
|
if (!Object.is(u, t)) {
|
|
216
|
-
const
|
|
217
|
-
t = a ?? typeof u != "object" ? u : Object.assign({}, t, u), r.forEach((l) => l(t,
|
|
232
|
+
const f = t;
|
|
233
|
+
t = a ?? typeof u != "object" ? u : Object.assign({}, t, u), r.forEach((l) => l(t, f));
|
|
218
234
|
}
|
|
219
235
|
}, n = () => t, s = { setState: i, getState: n, subscribe: (o) => (r.add(o), () => r.delete(o)), destroy: () => {
|
|
220
236
|
r.clear();
|
|
221
237
|
} };
|
|
222
238
|
return t = e(i, n, s), s;
|
|
223
|
-
},
|
|
224
|
-
const t =
|
|
239
|
+
}, Gn = (e) => e ? tr(e) : tr, Jn = (e, t) => (r, i, n) => (n.dispatch = (s) => (r((o) => e(o, s), !1, s), s), n.dispatchFromDevtools = !0, { dispatch: (...s) => n.dispatch(...s), ...t }), Kn = Jn, Rt = /* @__PURE__ */ new Map(), Ne = (e) => {
|
|
240
|
+
const t = Rt.get(e);
|
|
225
241
|
return t ? Object.fromEntries(
|
|
226
242
|
Object.entries(t.stores).map(([r, i]) => [r, i.getState()])
|
|
227
243
|
) : {};
|
|
228
|
-
},
|
|
244
|
+
}, Zn = (e, t, r) => {
|
|
229
245
|
if (e === void 0)
|
|
230
246
|
return {
|
|
231
247
|
type: "untracked",
|
|
232
248
|
connection: t.connect(r)
|
|
233
249
|
};
|
|
234
|
-
const i =
|
|
250
|
+
const i = Rt.get(r.name);
|
|
235
251
|
if (i)
|
|
236
252
|
return { type: "tracked", store: e, ...i };
|
|
237
253
|
const n = {
|
|
238
254
|
connection: t.connect(r),
|
|
239
255
|
stores: {}
|
|
240
256
|
};
|
|
241
|
-
return
|
|
242
|
-
},
|
|
257
|
+
return Rt.set(r.name, n), { type: "tracked", store: e, ...n };
|
|
258
|
+
}, Xn = (e, t = {}) => (r, i, n) => {
|
|
243
259
|
const { enabled: s, anonymousActionType: o, store: a, ...u } = t;
|
|
244
|
-
let
|
|
260
|
+
let f;
|
|
245
261
|
try {
|
|
246
|
-
|
|
262
|
+
f = (s ?? !1) && window.__REDUX_DEVTOOLS_EXTENSION__;
|
|
247
263
|
} catch {
|
|
248
264
|
}
|
|
249
|
-
if (!
|
|
265
|
+
if (!f)
|
|
250
266
|
return e(r, i, n);
|
|
251
|
-
const { connection: l, ...
|
|
267
|
+
const { connection: l, ...d } = Zn(a, f, u);
|
|
252
268
|
let v = !0;
|
|
253
269
|
n.setState = (g, b, A) => {
|
|
254
270
|
const w = r(g, b);
|
|
@@ -270,11 +286,11 @@ const er = (e) => {
|
|
|
270
286
|
const b = v;
|
|
271
287
|
v = !1, r(...g), v = b;
|
|
272
288
|
}, h = e(n.setState, i, n);
|
|
273
|
-
if (
|
|
289
|
+
if (d.type === "untracked" ? l == null || l.init(h) : (d.stores[d.store] = n, l == null || l.init(
|
|
274
290
|
Object.fromEntries(
|
|
275
|
-
Object.entries(
|
|
291
|
+
Object.entries(d.stores).map(([g, b]) => [
|
|
276
292
|
g,
|
|
277
|
-
g ===
|
|
293
|
+
g === d.store ? h : b.getState()
|
|
278
294
|
])
|
|
279
295
|
)
|
|
280
296
|
)), n.dispatchFromDevtools && typeof n.dispatch == "function") {
|
|
@@ -361,7 +377,7 @@ const er = (e) => {
|
|
|
361
377
|
return;
|
|
362
378
|
}
|
|
363
379
|
}), h;
|
|
364
|
-
},
|
|
380
|
+
}, es = Xn, ut = (e, t) => {
|
|
365
381
|
let r;
|
|
366
382
|
try {
|
|
367
383
|
r = JSON.parse(e);
|
|
@@ -372,16 +388,16 @@ const er = (e) => {
|
|
|
372
388
|
);
|
|
373
389
|
}
|
|
374
390
|
r !== void 0 && t(r);
|
|
375
|
-
},
|
|
391
|
+
}, ts = (e) => (t, r, i) => {
|
|
376
392
|
const n = i.subscribe;
|
|
377
393
|
return i.subscribe = (s, o, a) => {
|
|
378
394
|
let u = s;
|
|
379
395
|
if (o) {
|
|
380
|
-
const
|
|
396
|
+
const f = (a == null ? void 0 : a.equalityFn) || Object.is;
|
|
381
397
|
let l = s(i.getState());
|
|
382
|
-
u = (
|
|
383
|
-
const v = s(
|
|
384
|
-
if (!
|
|
398
|
+
u = (d) => {
|
|
399
|
+
const v = s(d);
|
|
400
|
+
if (!f(l, v)) {
|
|
385
401
|
const m = l;
|
|
386
402
|
o(l = v, m);
|
|
387
403
|
}
|
|
@@ -389,14 +405,14 @@ const er = (e) => {
|
|
|
389
405
|
}
|
|
390
406
|
return n(u);
|
|
391
407
|
}, e(t, r, i);
|
|
392
|
-
},
|
|
408
|
+
}, rs = ts, is = (e = {}, t) => {
|
|
393
409
|
switch (t.type) {
|
|
394
|
-
case
|
|
410
|
+
case Tr:
|
|
395
411
|
return {
|
|
396
412
|
...e,
|
|
397
413
|
[t.payload.id]: t.payload.type
|
|
398
414
|
};
|
|
399
|
-
case
|
|
415
|
+
case kr:
|
|
400
416
|
return {
|
|
401
417
|
...e,
|
|
402
418
|
...t.payload.mapping
|
|
@@ -408,7 +424,7 @@ const er = (e) => {
|
|
|
408
424
|
function lt(e, t, r, i) {
|
|
409
425
|
return !(!e[r] || !e[r][t] || !e[r][t][i] || !Array.isArray(e[r][t][i]));
|
|
410
426
|
}
|
|
411
|
-
function
|
|
427
|
+
function ns(e, t) {
|
|
412
428
|
const r = {}, i = [];
|
|
413
429
|
for (const [n, s] of Object.entries(e || {})) {
|
|
414
430
|
i.push(n);
|
|
@@ -429,7 +445,7 @@ function R(e) {
|
|
|
429
445
|
function ft(e, t) {
|
|
430
446
|
return typeof e > "u" ? t : e;
|
|
431
447
|
}
|
|
432
|
-
const
|
|
448
|
+
const ss = (e = qr(), t) => {
|
|
433
449
|
var r;
|
|
434
450
|
const i = (n, s) => ({
|
|
435
451
|
...e,
|
|
@@ -442,13 +458,13 @@ const ns = (e = qr(), t) => {
|
|
|
442
458
|
}
|
|
443
459
|
});
|
|
444
460
|
switch (t.type) {
|
|
445
|
-
case
|
|
461
|
+
case Ar: {
|
|
446
462
|
if (!e[R(t).type] || !e[R(t).type][R(t).id])
|
|
447
463
|
return e;
|
|
448
464
|
const n = e[R(t).type][R(t).id];
|
|
449
465
|
return typeof n == "string" ? e : i(n, { [R(t).key]: R(t).value });
|
|
450
466
|
}
|
|
451
|
-
case
|
|
467
|
+
case xr: {
|
|
452
468
|
if (!lt(e, R(t).id, R(t).type, R(t).key))
|
|
453
469
|
return e;
|
|
454
470
|
const n = e[R(t).type][R(t).id];
|
|
@@ -457,28 +473,28 @@ const ns = (e = qr(), t) => {
|
|
|
457
473
|
const s = Array.from(n[R(t).key]), [o] = s.splice(R(t).startIndex, 1);
|
|
458
474
|
return s.splice(R(t).endIndex, 0, o), i(n, { [R(t).key]: s });
|
|
459
475
|
}
|
|
460
|
-
case
|
|
476
|
+
case br: {
|
|
461
477
|
const n = Object.keys(R(t).entities), s = { ...e };
|
|
462
478
|
for (const o of n) {
|
|
463
479
|
const a = R(t).entities[o], u = { ...e[o] || {} };
|
|
464
|
-
let
|
|
480
|
+
let f = !1;
|
|
465
481
|
const l = Object.keys(a || {}) || [];
|
|
466
482
|
if (a && l) {
|
|
467
|
-
for (const
|
|
468
|
-
|
|
469
|
-
|
|
483
|
+
for (const d of l)
|
|
484
|
+
f = !0, u[d] = e[o][d] ? ns(e[o][d], a[d]) : a[d];
|
|
485
|
+
f && (s[o] = u);
|
|
470
486
|
}
|
|
471
487
|
}
|
|
472
488
|
return s;
|
|
473
489
|
}
|
|
474
|
-
case
|
|
490
|
+
case wr: {
|
|
475
491
|
if (!lt(e, R(t).id, R(t).type, R(t).key))
|
|
476
492
|
return e;
|
|
477
493
|
const n = e[R(t).type][R(t).id], s = Array.from(n[R(t).key]);
|
|
478
494
|
return s.splice(ft(R(t).index, s.length + 1), 0, R(t).reference), i(n, { [R(t).key]: s });
|
|
479
495
|
}
|
|
480
496
|
case At:
|
|
481
|
-
case
|
|
497
|
+
case Sr: {
|
|
482
498
|
if (!lt(e, R(t).id, R(t).type, R(t).key))
|
|
483
499
|
return e;
|
|
484
500
|
const n = e[R(t).type][R(t).id], s = Array.from(n[R(t).key]), o = ft(
|
|
@@ -487,7 +503,7 @@ const ns = (e = qr(), t) => {
|
|
|
487
503
|
);
|
|
488
504
|
return o === -1 || ((r = s[o]) == null ? void 0 : r.id) !== R(t).reference.id ? e : (t.type === At ? s.splice(o, 1, R(t).reference) : s.splice(o, 1), i(n, { [R(t).key]: s }));
|
|
489
505
|
}
|
|
490
|
-
case
|
|
506
|
+
case Cr: {
|
|
491
507
|
const n = e[R(t).type][R(t).id];
|
|
492
508
|
if (!n)
|
|
493
509
|
return e;
|
|
@@ -497,7 +513,7 @@ const ns = (e = qr(), t) => {
|
|
|
497
513
|
value: o.label
|
|
498
514
|
}), i(n, { metadata: s });
|
|
499
515
|
}
|
|
500
|
-
case
|
|
516
|
+
case Rr: {
|
|
501
517
|
const n = e[R(t).type][R(t).id];
|
|
502
518
|
if (typeof n == "string" || !n)
|
|
503
519
|
return e;
|
|
@@ -505,27 +521,27 @@ const ns = (e = qr(), t) => {
|
|
|
505
521
|
return s.splice(R(t).endIndex, 0, o), i(n, { metadata: s });
|
|
506
522
|
}
|
|
507
523
|
case xt:
|
|
508
|
-
case
|
|
524
|
+
case Mr: {
|
|
509
525
|
const n = e[R(t).type][R(t).id], s = Array.from(n.metadata || []), o = R(t).atIndex;
|
|
510
526
|
return typeof o > "u" || o === -1 || !s[o] ? e : (t.type === xt ? s.splice(o, 1, { label: R(t).label, value: R(t).value }) : s.splice(o, 1), i(n, { metadata: s }));
|
|
511
527
|
}
|
|
512
528
|
default:
|
|
513
529
|
return e;
|
|
514
530
|
}
|
|
515
|
-
},
|
|
531
|
+
}, os = (e = {}, t) => {
|
|
516
532
|
switch (t.type) {
|
|
517
|
-
case
|
|
533
|
+
case Fr:
|
|
518
534
|
case Vn:
|
|
519
535
|
return {
|
|
520
536
|
...e,
|
|
521
537
|
[t.payload.id]: {
|
|
522
538
|
requestUri: t.payload.id,
|
|
523
|
-
loadingState:
|
|
539
|
+
loadingState: Lr,
|
|
524
540
|
uriMismatch: !1,
|
|
525
541
|
resourceUri: t.payload.id
|
|
526
542
|
}
|
|
527
543
|
};
|
|
528
|
-
case
|
|
544
|
+
case $r:
|
|
529
545
|
return {
|
|
530
546
|
...e,
|
|
531
547
|
[t.payload.requestId]: {
|
|
@@ -540,7 +556,7 @@ const ns = (e = qr(), t) => {
|
|
|
540
556
|
resourceUri: t.payload.actualId
|
|
541
557
|
}
|
|
542
558
|
};
|
|
543
|
-
case
|
|
559
|
+
case jr:
|
|
544
560
|
return {
|
|
545
561
|
...e,
|
|
546
562
|
[t.payload.id]: {
|
|
@@ -549,7 +565,7 @@ const ns = (e = qr(), t) => {
|
|
|
549
565
|
error: t.payload.message
|
|
550
566
|
}
|
|
551
567
|
};
|
|
552
|
-
case
|
|
568
|
+
case Dr:
|
|
553
569
|
return {
|
|
554
570
|
...e,
|
|
555
571
|
[t.payload.id]: {
|
|
@@ -560,10 +576,10 @@ const ns = (e = qr(), t) => {
|
|
|
560
576
|
};
|
|
561
577
|
}
|
|
562
578
|
return e;
|
|
563
|
-
},
|
|
579
|
+
}, as = (e = {}, t) => {
|
|
564
580
|
const { id: r, updateValue: i, value: n, meta: s, key: o } = t && t.payload || {};
|
|
565
581
|
switch (t.type) {
|
|
566
|
-
case
|
|
582
|
+
case Or:
|
|
567
583
|
return {
|
|
568
584
|
...e,
|
|
569
585
|
[r]: {
|
|
@@ -574,7 +590,7 @@ const ns = (e = qr(), t) => {
|
|
|
574
590
|
}
|
|
575
591
|
}
|
|
576
592
|
};
|
|
577
|
-
case
|
|
593
|
+
case Er:
|
|
578
594
|
return {
|
|
579
595
|
...e,
|
|
580
596
|
[r]: {
|
|
@@ -585,7 +601,7 @@ const ns = (e = qr(), t) => {
|
|
|
585
601
|
}
|
|
586
602
|
}
|
|
587
603
|
};
|
|
588
|
-
case
|
|
604
|
+
case Pr:
|
|
589
605
|
return e[r] && e[r][s] && e[r][s][o] ? {
|
|
590
606
|
...e,
|
|
591
607
|
[r]: {
|
|
@@ -612,8 +628,8 @@ function _r(e = {}) {
|
|
|
612
628
|
return n ? s : r;
|
|
613
629
|
};
|
|
614
630
|
}
|
|
615
|
-
function
|
|
616
|
-
return (t, r) => r && r.type ===
|
|
631
|
+
function cs(e) {
|
|
632
|
+
return (t, r) => r && r.type === Lt ? r.payload.actions.reduce(e, t) : r && r.type === zn ? {
|
|
617
633
|
...t,
|
|
618
634
|
iiif: {
|
|
619
635
|
...t.iiif,
|
|
@@ -621,13 +637,13 @@ function as(e) {
|
|
|
621
637
|
}
|
|
622
638
|
} : e(t, r);
|
|
623
639
|
}
|
|
624
|
-
const
|
|
625
|
-
mapping:
|
|
626
|
-
entities:
|
|
627
|
-
requests:
|
|
628
|
-
meta:
|
|
640
|
+
const us = _r({
|
|
641
|
+
mapping: is,
|
|
642
|
+
entities: ss,
|
|
643
|
+
requests: os,
|
|
644
|
+
meta: as
|
|
629
645
|
});
|
|
630
|
-
function
|
|
646
|
+
function ls() {
|
|
631
647
|
return {
|
|
632
648
|
iiif: {
|
|
633
649
|
entities: qr(),
|
|
@@ -637,16 +653,16 @@ function us() {
|
|
|
637
653
|
}
|
|
638
654
|
};
|
|
639
655
|
}
|
|
640
|
-
function
|
|
656
|
+
function fs(e = {}) {
|
|
641
657
|
const {
|
|
642
658
|
enableDevtools: t = !1,
|
|
643
659
|
iiifStoreName: r = "iiif",
|
|
644
|
-
defaultState: i =
|
|
660
|
+
defaultState: i = ls(),
|
|
645
661
|
customReducers: n = {}
|
|
646
|
-
} = e, s =
|
|
647
|
-
return
|
|
662
|
+
} = e, s = cs(_r({ [r]: us, ...n }));
|
|
663
|
+
return Gn(rs(es(Kn(s, i), { enabled: t })));
|
|
648
664
|
}
|
|
649
|
-
function
|
|
665
|
+
function ps(e) {
|
|
650
666
|
return { all: e = e || /* @__PURE__ */ new Map(), on: function(t, r) {
|
|
651
667
|
var i = e.get(t);
|
|
652
668
|
i ? i.push(r) : e.set(t, [r]);
|
|
@@ -683,14 +699,14 @@ function G(e, t, r, i = !0) {
|
|
|
683
699
|
}
|
|
684
700
|
});
|
|
685
701
|
}
|
|
686
|
-
const Se = Symbol.for("_refs_"), we = Symbol.for("_reactive_"), Oe = Symbol.for("_defined_"),
|
|
687
|
-
function
|
|
702
|
+
const Se = Symbol.for("_refs_"), we = Symbol.for("_reactive_"), Oe = Symbol.for("_defined_"), rr = Symbol.for("_parent_");
|
|
703
|
+
function ds(e, t = !1, r) {
|
|
688
704
|
const i = {
|
|
689
705
|
id: "",
|
|
690
706
|
type: "unknown",
|
|
691
707
|
[Oe]: [],
|
|
692
708
|
[Se]: {},
|
|
693
|
-
[
|
|
709
|
+
[rr]: r || null,
|
|
694
710
|
[we]: null,
|
|
695
711
|
is(n) {
|
|
696
712
|
return typeof n == "string" ? this.id === n : n.id ? n.id === this.id : !1;
|
|
@@ -714,7 +730,7 @@ function ps(e, t = !1, r) {
|
|
|
714
730
|
unwrap() {
|
|
715
731
|
if (!this.id)
|
|
716
732
|
throw new Error("Invalid object");
|
|
717
|
-
const n = this[
|
|
733
|
+
const n = this[rr];
|
|
718
734
|
return e.get(this.id, { parent: n ? { id: n, type: "unknown" } : void 0 });
|
|
719
735
|
},
|
|
720
736
|
toPresentation3() {
|
|
@@ -757,7 +773,7 @@ function ps(e, t = !1, r) {
|
|
|
757
773
|
};
|
|
758
774
|
return G("items", i, e), G("annotations", i, e), G("structures", i, e), G("seeAlso", i, e), G("rendering", i, e), G("partOf", i, e), G("start", i, e, !1), G("supplementary", i, e), G("homepage", i, e), G("thumbnail", i, e), G("placeholderCanvas", i, e, !1), G("accompanyingCanvas", i, e, !1), G("provider", i, e), G("body", i, e), G("logo", i, e), i;
|
|
759
775
|
}
|
|
760
|
-
function
|
|
776
|
+
function hs(e) {
|
|
761
777
|
return !!e[Oe];
|
|
762
778
|
}
|
|
763
779
|
function Ur(e) {
|
|
@@ -768,10 +784,10 @@ function Ce(e, t, r = !1, i) {
|
|
|
768
784
|
return e.map((a) => Ce(a, t, r));
|
|
769
785
|
if (!e || !e.type || !e.id)
|
|
770
786
|
return e;
|
|
771
|
-
const n =
|
|
787
|
+
const n = ds(t, r), s = Object.create(n), o = Object.assign(s, e);
|
|
772
788
|
return r && o.reactive(), o;
|
|
773
789
|
}
|
|
774
|
-
function
|
|
790
|
+
function ir(e) {
|
|
775
791
|
switch (e) {
|
|
776
792
|
case "Image":
|
|
777
793
|
case "Video":
|
|
@@ -790,7 +806,7 @@ function rr(e) {
|
|
|
790
806
|
}
|
|
791
807
|
return e;
|
|
792
808
|
}
|
|
793
|
-
let
|
|
809
|
+
let It = class {
|
|
794
810
|
constructor(t, r) {
|
|
795
811
|
ve(this, "options"), ve(this, "store"), ve(this, "emitter"), ve(this, "isBatching", !1), ve(this, "batchQueue", []), ve(this, "remoteFetcher"), ve(this, "staticFetcher"), ve(this, "defaultFetcher", (i) => fetch(i).then((n) => n.json())), this.options = Object.assign(
|
|
796
812
|
{
|
|
@@ -799,16 +815,16 @@ let Rt = class {
|
|
|
799
815
|
enableDevtools: !0
|
|
800
816
|
},
|
|
801
817
|
t || {}
|
|
802
|
-
), this.store = r ||
|
|
818
|
+
), this.store = r || fs({
|
|
803
819
|
customReducers: this.options.reducers,
|
|
804
820
|
defaultState: this.options.defaultState,
|
|
805
821
|
enableDevtools: this.options.enableDevtools
|
|
806
|
-
}), this.emitter =
|
|
822
|
+
}), this.emitter = ps(), this.remoteFetcher = er(this, this.options.customFetcher), this.staticFetcher = er(this, (i, n) => n);
|
|
807
823
|
}
|
|
808
824
|
batch(t) {
|
|
809
825
|
this.isBatching = !0;
|
|
810
826
|
try {
|
|
811
|
-
t(this), this.isBatching = !1, this.dispatch(
|
|
827
|
+
t(this), this.isBatching = !1, this.dispatch(Mt({ actions: this.batchQueue }));
|
|
812
828
|
} catch (r) {
|
|
813
829
|
throw this.batchQueue = [], this.isBatching = !1, r;
|
|
814
830
|
}
|
|
@@ -817,7 +833,7 @@ let Rt = class {
|
|
|
817
833
|
async asyncBatch(t) {
|
|
818
834
|
this.isBatching = !0;
|
|
819
835
|
try {
|
|
820
|
-
await t(this), this.isBatching = !1, this.dispatch(
|
|
836
|
+
await t(this), this.isBatching = !1, this.dispatch(Mt({ actions: this.batchQueue }));
|
|
821
837
|
} catch (r) {
|
|
822
838
|
throw this.batchQueue = [], this.isBatching = !1, r;
|
|
823
839
|
}
|
|
@@ -837,7 +853,7 @@ let Rt = class {
|
|
|
837
853
|
if (this.isBatching)
|
|
838
854
|
this.batchQueue.push(t);
|
|
839
855
|
else {
|
|
840
|
-
if (t.type ===
|
|
856
|
+
if (t.type === Lt) {
|
|
841
857
|
for (const n of t.payload.actions)
|
|
842
858
|
this.emitter.emit(n.type, { action: n, state: this.store.getState() });
|
|
843
859
|
this.store.dispatch(t);
|
|
@@ -874,29 +890,29 @@ let Rt = class {
|
|
|
874
890
|
const { skipSelfReturn: n = !0 } = i || {};
|
|
875
891
|
let s = i.parent ? typeof i.parent == "string" ? i.parent : i.parent.id : void 0;
|
|
876
892
|
if (Array.isArray(t))
|
|
877
|
-
return t.map((
|
|
893
|
+
return t.map((d) => this.get(d, i));
|
|
878
894
|
const o = this.getState();
|
|
879
895
|
if (mn(t) && !i.preserveSpecificResources && (t = t.source), typeof t == "string") {
|
|
880
|
-
const
|
|
881
|
-
if (!
|
|
896
|
+
const d = ir(r || o.iiif.mapping[t]);
|
|
897
|
+
if (!d)
|
|
882
898
|
return n ? null : { id: t, type: "unknown" };
|
|
883
|
-
t = { id: t, type:
|
|
899
|
+
t = { id: t, type: d };
|
|
884
900
|
}
|
|
885
901
|
if (t && t.partOf && !s && !i.skipPartOfCheck) {
|
|
886
|
-
const
|
|
887
|
-
|
|
902
|
+
const d = Array.isArray(t.partOf) ? t.partOf[0] : t.partOf;
|
|
903
|
+
d && (typeof d == "string" && (s = d), typeof d.id == "string" && (s = d.id));
|
|
888
904
|
}
|
|
889
|
-
const a =
|
|
890
|
-
if (!
|
|
891
|
-
const
|
|
892
|
-
return
|
|
905
|
+
const a = ir(r || (t == null ? void 0 : t.type)), u = t == null ? void 0 : t.id, f = o.iiif.entities[a];
|
|
906
|
+
if (!f) {
|
|
907
|
+
const d = o.iiif.requests[u];
|
|
908
|
+
return d && d.resourceUri !== u ? this.get(d.resourceUri, i) : n ? null : t;
|
|
893
909
|
}
|
|
894
|
-
const l =
|
|
910
|
+
const l = f[t.id];
|
|
895
911
|
if (l && l[Ze]) {
|
|
896
|
-
const
|
|
897
|
-
return
|
|
912
|
+
const d = l[Ze].find((v) => s ? v[Xe] === s : v[Xe] === l.id);
|
|
913
|
+
return gr(l, d);
|
|
898
914
|
}
|
|
899
|
-
return
|
|
915
|
+
return f[t.id] || (n ? null : t);
|
|
900
916
|
}
|
|
901
917
|
select(t) {
|
|
902
918
|
return t(this.getState());
|
|
@@ -931,14 +947,26 @@ let Rt = class {
|
|
|
931
947
|
}
|
|
932
948
|
load(t, r) {
|
|
933
949
|
const i = typeof t == "string" ? t : t.id;
|
|
934
|
-
return r ? this.staticFetcher(i, r) : this.remoteFetcher(i);
|
|
950
|
+
return r ? Promise.resolve(this.staticFetcher(i, r)) : Promise.resolve(this.remoteFetcher(i));
|
|
951
|
+
}
|
|
952
|
+
loadSync(t, r) {
|
|
953
|
+
const i = typeof t == "string" ? t : t.id;
|
|
954
|
+
return this.staticFetcher(i, r);
|
|
955
|
+
}
|
|
956
|
+
loadManifestSync(t, r) {
|
|
957
|
+
const i = typeof t == "string" ? t : t.id;
|
|
958
|
+
return this.loadSync(i, r);
|
|
959
|
+
}
|
|
960
|
+
loadCollectionSync(t, r) {
|
|
961
|
+
const i = typeof t == "string" ? t : t.id;
|
|
962
|
+
return this.loadSync(i, r);
|
|
935
963
|
}
|
|
936
964
|
areInputsEqual(t, r) {
|
|
937
|
-
return
|
|
965
|
+
return Xt(t, r);
|
|
938
966
|
}
|
|
939
967
|
subscribe(t, r, i) {
|
|
940
968
|
return typeof i > "u" && (typeof r > "u" || r === !1 || r === !0) && (i = r, r = t, t = (n) => n), this.store.subscribe(t, (n) => r(n, this), {
|
|
941
|
-
equalityFn:
|
|
969
|
+
equalityFn: Xt,
|
|
942
970
|
fireImmediately: !i
|
|
943
971
|
});
|
|
944
972
|
}
|
|
@@ -971,16 +999,16 @@ let Rt = class {
|
|
|
971
999
|
return Ce(this.get(t, { skipSelfReturn: !1 }), this);
|
|
972
1000
|
}
|
|
973
1001
|
isWrapped(t) {
|
|
974
|
-
return
|
|
1002
|
+
return hs(t);
|
|
975
1003
|
}
|
|
976
1004
|
setMetaValue([t, r, i], n) {
|
|
977
1005
|
this.dispatch(
|
|
978
|
-
typeof n == "function" ?
|
|
1006
|
+
typeof n == "function" ? Kt.setMetaValueDynamic({
|
|
979
1007
|
id: t,
|
|
980
1008
|
meta: r,
|
|
981
1009
|
key: i,
|
|
982
1010
|
updateValue: n
|
|
983
|
-
}) :
|
|
1011
|
+
}) : Kt.setMetaValue({
|
|
984
1012
|
id: t,
|
|
985
1013
|
meta: r,
|
|
986
1014
|
key: i,
|
|
@@ -989,18 +1017,18 @@ let Rt = class {
|
|
|
989
1017
|
);
|
|
990
1018
|
}
|
|
991
1019
|
};
|
|
992
|
-
function
|
|
1020
|
+
function ys() {
|
|
993
1021
|
return typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
|
|
994
1022
|
}
|
|
995
1023
|
function Vr(e) {
|
|
996
|
-
const t =
|
|
1024
|
+
const t = ys();
|
|
997
1025
|
try {
|
|
998
1026
|
const i = t.IIIF_VAULT;
|
|
999
1027
|
if (i)
|
|
1000
1028
|
return i;
|
|
1001
1029
|
} catch {
|
|
1002
1030
|
}
|
|
1003
|
-
const r = new
|
|
1031
|
+
const r = new It(e);
|
|
1004
1032
|
try {
|
|
1005
1033
|
t.IIIF_VAULT = r;
|
|
1006
1034
|
} catch {
|
|
@@ -1019,7 +1047,7 @@ function Nr({
|
|
|
1019
1047
|
resources: i,
|
|
1020
1048
|
children: n
|
|
1021
1049
|
}) {
|
|
1022
|
-
const [s, o] = B(() => e || (r ? Vr(t) : t ? new
|
|
1050
|
+
const [s, o] = B(() => e || (r ? Vr(t) : t ? new It(t) : new It()));
|
|
1023
1051
|
return /* @__PURE__ */ x(tt.Provider, { value: { vault: s, setVaultInstance: o }, children: /* @__PURE__ */ x(Te, { value: i || {}, children: n }) });
|
|
1024
1052
|
}
|
|
1025
1053
|
const V = () => {
|
|
@@ -1029,36 +1057,36 @@ const V = () => {
|
|
|
1029
1057
|
return e;
|
|
1030
1058
|
};
|
|
1031
1059
|
function Hr(e, { noCache: t = !1 } = {}) {
|
|
1032
|
-
const r = typeof e == "string" ? e : e.id, i = V(), [n, s] = B(r), [o, a] = B(void 0), u = E(() => i.get(r, { skipSelfReturn: !0 }) || void 0, [r, i]), [
|
|
1060
|
+
const r = typeof e == "string" ? e : e.id, i = V(), [n, s] = B(r), [o, a] = B(void 0), u = E(() => i.get(r, { skipSelfReturn: !0 }) || void 0, [r, i]), [f, l] = B(u);
|
|
1033
1061
|
return K(() => {
|
|
1034
1062
|
(async () => {
|
|
1035
1063
|
try {
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1038
|
-
} catch (
|
|
1039
|
-
a(
|
|
1064
|
+
const d = u && !t ? u : await i.load(r), v = d ? d.id || d["@id"] : null;
|
|
1065
|
+
d && n !== v && s(v), l(d);
|
|
1066
|
+
} catch (d) {
|
|
1067
|
+
a(d);
|
|
1040
1068
|
}
|
|
1041
1069
|
})();
|
|
1042
1070
|
}, [r, t]), {
|
|
1043
|
-
isLoaded: !!
|
|
1071
|
+
isLoaded: !!f,
|
|
1044
1072
|
id: n,
|
|
1045
1073
|
requestId: r,
|
|
1046
1074
|
error: o,
|
|
1047
|
-
resource:
|
|
1048
|
-
cached: !!(
|
|
1075
|
+
resource: f,
|
|
1076
|
+
cached: !!(f && f === u)
|
|
1049
1077
|
};
|
|
1050
1078
|
}
|
|
1051
|
-
function
|
|
1079
|
+
function vs(e, t) {
|
|
1052
1080
|
const { id: r, isLoaded: i, error: n, resource: s, requestId: o, cached: a } = Hr(
|
|
1053
1081
|
e,
|
|
1054
1082
|
t
|
|
1055
1083
|
);
|
|
1056
1084
|
return { id: r, isLoaded: i, error: n, manifest: s, requestId: o, cached: a };
|
|
1057
1085
|
}
|
|
1058
|
-
function
|
|
1086
|
+
function gs({ manifest: e, children: t }) {
|
|
1059
1087
|
return /* @__PURE__ */ x(Te, { value: { manifest: e }, children: t });
|
|
1060
1088
|
}
|
|
1061
|
-
function
|
|
1089
|
+
function Ft({ canvas: e, children: t }) {
|
|
1062
1090
|
return /* @__PURE__ */ x(Te, { value: { canvas: e }, children: t });
|
|
1063
1091
|
}
|
|
1064
1092
|
function Q(e, t = []) {
|
|
@@ -1091,17 +1119,17 @@ function ke(e = {}, t = []) {
|
|
|
1091
1119
|
return i ? i(o) : o;
|
|
1092
1120
|
}, [o, i, ...t]);
|
|
1093
1121
|
}
|
|
1094
|
-
function
|
|
1122
|
+
function ms({ range: e, children: t }) {
|
|
1095
1123
|
return /* @__PURE__ */ x(Te, { value: { range: e }, children: t });
|
|
1096
1124
|
}
|
|
1097
|
-
function
|
|
1125
|
+
function bs(e, t) {
|
|
1098
1126
|
for (const r of t.items) {
|
|
1099
1127
|
if (r.type === "Canvas")
|
|
1100
1128
|
return r;
|
|
1101
1129
|
if (r.type === "SpecificResource")
|
|
1102
1130
|
return r.source;
|
|
1103
1131
|
if (r.type === "Range") {
|
|
1104
|
-
const i =
|
|
1132
|
+
const i = bs(e, e.get(r));
|
|
1105
1133
|
if (i)
|
|
1106
1134
|
return i;
|
|
1107
1135
|
}
|
|
@@ -1118,7 +1146,7 @@ function zr(e, t) {
|
|
|
1118
1146
|
}
|
|
1119
1147
|
return r;
|
|
1120
1148
|
}
|
|
1121
|
-
function
|
|
1149
|
+
function kc(e, t, r) {
|
|
1122
1150
|
for (const i of t.structures) {
|
|
1123
1151
|
const n = Wr(e, e.get(i), r);
|
|
1124
1152
|
if (n)
|
|
@@ -1140,12 +1168,12 @@ function Wr(e, t, r) {
|
|
|
1140
1168
|
}
|
|
1141
1169
|
return null;
|
|
1142
1170
|
}
|
|
1143
|
-
function
|
|
1171
|
+
function Oc(e, t, r, i = !1) {
|
|
1144
1172
|
const n = t.behavior, s = r ? e.get(r) : null;
|
|
1145
1173
|
if (!s)
|
|
1146
1174
|
return [];
|
|
1147
|
-
const o = s.behavior, a = i ? !1 : n.includes("paged"), u = a ? !1 : n.includes("continuous"),
|
|
1148
|
-
if (l ||
|
|
1175
|
+
const o = s.behavior, a = i ? !1 : n.includes("paged"), u = a ? !1 : n.includes("continuous"), f = a || u ? !1 : n.includes("individuals"), l = o.includes("facing-pages"), d = o.includes("non-paged");
|
|
1176
|
+
if (l || d || f || i)
|
|
1149
1177
|
return [{ id: s.id, type: "Canvas" }];
|
|
1150
1178
|
const [v, m] = Qr(e, t);
|
|
1151
1179
|
if (u)
|
|
@@ -1164,70 +1192,70 @@ function Qr(e, t, { disablePaging: r, skipNonPaged: i } = {}) {
|
|
|
1164
1192
|
return [u, [u.map((h, g) => g)]];
|
|
1165
1193
|
if (a || !s || r)
|
|
1166
1194
|
return [u, u.map((h, g) => [g])];
|
|
1167
|
-
const
|
|
1195
|
+
const f = [];
|
|
1168
1196
|
let l = [];
|
|
1169
|
-
const
|
|
1170
|
-
l.length && (
|
|
1197
|
+
const d = () => {
|
|
1198
|
+
l.length && (f.push([...l]), l = []);
|
|
1171
1199
|
};
|
|
1172
1200
|
let v = 0, m = !1;
|
|
1173
1201
|
for (let h = 0; h < u.length; h++) {
|
|
1174
1202
|
const g = e.get(u[h]);
|
|
1175
1203
|
if (g.behavior.includes("non-paged")) {
|
|
1176
|
-
h === v && v++, i || (
|
|
1204
|
+
h === v && v++, i || (d(), f.push([h]), d());
|
|
1177
1205
|
continue;
|
|
1178
1206
|
}
|
|
1179
1207
|
if (h === v || g.behavior.includes("facing-pages")) {
|
|
1180
|
-
l.length && (m = !0),
|
|
1208
|
+
l.length && (m = !0), d(), f.push([h]), d();
|
|
1181
1209
|
continue;
|
|
1182
1210
|
}
|
|
1183
1211
|
if (l.push(h), m) {
|
|
1184
|
-
|
|
1212
|
+
d(), m = !1;
|
|
1185
1213
|
continue;
|
|
1186
1214
|
}
|
|
1187
|
-
l.length > 1 &&
|
|
1215
|
+
l.length > 1 && d();
|
|
1188
1216
|
}
|
|
1189
|
-
return l.length &&
|
|
1217
|
+
return l.length && d(), [u, f];
|
|
1190
1218
|
}
|
|
1191
|
-
function
|
|
1219
|
+
function As(e = {}, t = []) {
|
|
1192
1220
|
const { id: r, selector: i } = e, n = be(), s = r || n.range, o = Q((a) => s ? a.iiif.entities.Range[s] : void 0, [s]);
|
|
1193
1221
|
return E(() => {
|
|
1194
1222
|
if (o)
|
|
1195
1223
|
return i ? i(o) : o;
|
|
1196
1224
|
}, [o, i, ...t]);
|
|
1197
1225
|
}
|
|
1198
|
-
function
|
|
1226
|
+
function xs({ startCanvas: e, disablePaging: t }) {
|
|
1199
1227
|
var h;
|
|
1200
|
-
const r = V(), i = ke(), n =
|
|
1228
|
+
const r = V(), i = ke(), n = As(), [s, o] = B(void 0), a = n || i;
|
|
1201
1229
|
if (!a)
|
|
1202
1230
|
throw new Error("Nothing selected");
|
|
1203
|
-
const [u,
|
|
1231
|
+
const [u, f] = E(
|
|
1204
1232
|
() => Qr(r, a, { disablePaging: t }),
|
|
1205
1233
|
[r, a]
|
|
1206
1234
|
), l = D(
|
|
1207
1235
|
(g) => {
|
|
1208
|
-
const b =
|
|
1236
|
+
const b = f.findIndex((A) => A.includes(g));
|
|
1209
1237
|
o(b === -1 ? 0 : b);
|
|
1210
1238
|
},
|
|
1211
|
-
[u,
|
|
1212
|
-
),
|
|
1239
|
+
[u, f]
|
|
1240
|
+
), d = D(
|
|
1213
1241
|
(g) => {
|
|
1214
1242
|
const b = u.findIndex((A) => A.id === g);
|
|
1215
1243
|
b !== -1 ? l(b) : o(0);
|
|
1216
1244
|
},
|
|
1217
|
-
[u,
|
|
1245
|
+
[u, f]
|
|
1218
1246
|
), v = D(() => {
|
|
1219
|
-
o((g) => g >=
|
|
1220
|
-
}, [
|
|
1247
|
+
o((g) => g >= f.length ? g : g + 1);
|
|
1248
|
+
}, [f]), m = D(() => {
|
|
1221
1249
|
o((g) => g <= 0 ? 0 : g - 1);
|
|
1222
|
-
}, [
|
|
1223
|
-
return typeof s > "u" && (e ?
|
|
1224
|
-
visibleItems: ((h =
|
|
1250
|
+
}, [f]);
|
|
1251
|
+
return typeof s > "u" && (e ? d(e) : o(0)), {
|
|
1252
|
+
visibleItems: ((h = f[s]) == null ? void 0 : h.map((g) => u[g].id)) || [],
|
|
1225
1253
|
cursor: s,
|
|
1226
1254
|
items: u,
|
|
1227
|
-
sequence:
|
|
1255
|
+
sequence: f,
|
|
1228
1256
|
setSequenceIndex: o,
|
|
1229
1257
|
setCanvasIndex: l,
|
|
1230
|
-
setCanvasId:
|
|
1258
|
+
setCanvasId: d,
|
|
1231
1259
|
next: v,
|
|
1232
1260
|
previous: m
|
|
1233
1261
|
};
|
|
@@ -1243,50 +1271,50 @@ const Fe = () => {
|
|
|
1243
1271
|
setSequenceIndex: Fe,
|
|
1244
1272
|
currentSequenceIndex: 0
|
|
1245
1273
|
});
|
|
1246
|
-
function
|
|
1247
|
-
const t = ke(), { cursor: r, visibleItems: i, next: n, sequence: s, items: o, setCanvasIndex: a, setCanvasId: u, previous:
|
|
1274
|
+
function ws(e) {
|
|
1275
|
+
const t = ke(), { cursor: r, visibleItems: i, next: n, sequence: s, items: o, setCanvasIndex: a, setCanvasId: u, previous: f, setSequenceIndex: l } = xs({
|
|
1248
1276
|
startCanvas: e.startCanvas,
|
|
1249
1277
|
disablePaging: e.pagingEnabled === !1
|
|
1250
|
-
}),
|
|
1278
|
+
}), d = E(
|
|
1251
1279
|
() => ({
|
|
1252
1280
|
sequence: s,
|
|
1253
1281
|
items: o,
|
|
1254
1282
|
// Extra functions.
|
|
1255
1283
|
setCurrentCanvasId: u,
|
|
1256
1284
|
nextCanvas: n,
|
|
1257
|
-
previousCanvas:
|
|
1285
|
+
previousCanvas: f,
|
|
1258
1286
|
totalCanvases: o.length,
|
|
1259
1287
|
setCurrentCanvasIndex: a,
|
|
1260
1288
|
setSequenceIndex: l,
|
|
1261
1289
|
currentSequenceIndex: r
|
|
1262
1290
|
}),
|
|
1263
|
-
[s, o, u, n,
|
|
1291
|
+
[s, o, u, n, f, o, a, l, r]
|
|
1264
1292
|
);
|
|
1265
|
-
return t ? /* @__PURE__ */ x(it.Provider, { value:
|
|
1293
|
+
return t ? /* @__PURE__ */ x(it.Provider, { value: d, children: /* @__PURE__ */ x(rt.Provider, { value: i, children: /* @__PURE__ */ x(Ft, { canvas: i[0], children: e.children }) }) }) : (console.warn("The manifest passed to the provider is not a valid IIIF manifest."), /* @__PURE__ */ x("div", { children: "Sorry, something went wrong." }));
|
|
1266
1294
|
}
|
|
1267
|
-
function
|
|
1268
|
-
const t =
|
|
1295
|
+
function Ss(e) {
|
|
1296
|
+
const t = vs(e.manifest);
|
|
1269
1297
|
if (!t)
|
|
1270
1298
|
return console.warn("The manifest passed to the provider is not a valid IIIF manifest."), /* @__PURE__ */ x("div", { children: "Sorry, something went wrong." });
|
|
1271
1299
|
if (t.error)
|
|
1272
1300
|
return /* @__PURE__ */ x("div", { children: t.error.toString() });
|
|
1273
1301
|
if (!t.isLoaded)
|
|
1274
1302
|
return /* @__PURE__ */ x("div", { children: "Loading..." });
|
|
1275
|
-
const r = /* @__PURE__ */ x(
|
|
1276
|
-
return /* @__PURE__ */ x(
|
|
1303
|
+
const r = /* @__PURE__ */ x(ws, { ...e, children: e.children });
|
|
1304
|
+
return /* @__PURE__ */ x(gs, { manifest: t.id, children: e.rangeId ? /* @__PURE__ */ x(ms, { range: e.rangeId, children: r }) : r });
|
|
1277
1305
|
}
|
|
1278
|
-
function
|
|
1306
|
+
function Cs() {
|
|
1279
1307
|
return H(it);
|
|
1280
1308
|
}
|
|
1281
|
-
function
|
|
1309
|
+
function Ms() {
|
|
1282
1310
|
return {
|
|
1283
1311
|
VaultContext: H(tt),
|
|
1284
|
-
ResourceContext: H(
|
|
1312
|
+
ResourceContext: H(Pt),
|
|
1285
1313
|
SimpleViewerReactContext: H(it),
|
|
1286
1314
|
VisibleCanvasReactContext: H(rt)
|
|
1287
1315
|
};
|
|
1288
1316
|
}
|
|
1289
|
-
function
|
|
1317
|
+
function Rs(e) {
|
|
1290
1318
|
return /* @__PURE__ */ x(Nr, { vault: e.bridge.VaultContext.vault || void 0, resources: e.bridge.ResourceContext, children: /* @__PURE__ */ x(rt.Provider, { value: e.bridge.VisibleCanvasReactContext, children: /* @__PURE__ */ x(it.Provider, { value: e.bridge.SimpleViewerReactContext, children: e.children }) }) });
|
|
1291
1319
|
}
|
|
1292
1320
|
const se = function(e) {
|
|
@@ -1298,28 +1326,28 @@ const se = function(e) {
|
|
|
1298
1326
|
...i !== void 0 && { meta: i }
|
|
1299
1327
|
});
|
|
1300
1328
|
};
|
|
1301
|
-
},
|
|
1302
|
-
importEntities:
|
|
1303
|
-
modifyEntityField:
|
|
1304
|
-
reorderEntityField:
|
|
1305
|
-
addReference:
|
|
1306
|
-
removeReference:
|
|
1307
|
-
updateReference:
|
|
1308
|
-
addMetadata:
|
|
1309
|
-
removeMetadata:
|
|
1310
|
-
updateMetadata:
|
|
1311
|
-
reorderMetadata:
|
|
1329
|
+
}, Is = "@iiif/IMPORT_ENTITIES", Ts = "@iiif/MODIFY_ENTITY_FIELD", ks = "@iiif/REORDER_ENTITY_FIELD", Os = "@iiif/ADD_REFERENCE", Es = "@iiif/UPDATE_REFERENCE", Ps = "@iiif/REMOVE_REFERENCE", Ls = "@iiif/ADD_METADATA", Fs = "@iiif/REMOVE_METADATA", js = "@iiif/UPDATE_METADATA", $s = "@iiif/REORDER_METADATA", Ds = se(Is)(), qs = se(Ts)(), _s = se(ks)(), Us = se(Os)(), Vs = se(Ps)(), Ns = se(Es)(), Hs = se(Ls)(), Bs = se(js)(), zs = se(Fs)(), Ws = se($s)(), pt = {
|
|
1330
|
+
importEntities: Ds,
|
|
1331
|
+
modifyEntityField: qs,
|
|
1332
|
+
reorderEntityField: _s,
|
|
1333
|
+
addReference: Us,
|
|
1334
|
+
removeReference: Vs,
|
|
1335
|
+
updateReference: Ns,
|
|
1336
|
+
addMetadata: Hs,
|
|
1337
|
+
removeMetadata: zs,
|
|
1338
|
+
updateMetadata: Bs,
|
|
1339
|
+
reorderMetadata: Ws
|
|
1312
1340
|
};
|
|
1313
|
-
function
|
|
1341
|
+
function Qs() {
|
|
1314
1342
|
const t = V().getStore();
|
|
1315
1343
|
return E(() => (r) => t.dispatch(r), [t]);
|
|
1316
1344
|
}
|
|
1317
|
-
function
|
|
1345
|
+
function nr(e) {
|
|
1318
1346
|
return typeof e != "string" && e && e.bindToVault;
|
|
1319
1347
|
}
|
|
1320
|
-
function
|
|
1321
|
-
const e = V(), t = ge([]), r =
|
|
1322
|
-
|
|
1348
|
+
function Ys() {
|
|
1349
|
+
const e = V(), t = ge([]), r = Qs(), i = E(() => `vault://annotation-page/${(/* @__PURE__ */ new Date()).getTime()}/${Math.round(Math.random() * 1e9).toString(16)}`, []);
|
|
1350
|
+
yr(() => {
|
|
1323
1351
|
const a = {
|
|
1324
1352
|
id: i,
|
|
1325
1353
|
type: "AnnotationPage",
|
|
@@ -1353,13 +1381,13 @@ function Qs() {
|
|
|
1353
1381
|
), s = D(
|
|
1354
1382
|
(a, u) => {
|
|
1355
1383
|
if (i) {
|
|
1356
|
-
if (
|
|
1357
|
-
const
|
|
1358
|
-
|
|
1384
|
+
if (nr(a)) {
|
|
1385
|
+
const d = a;
|
|
1386
|
+
d.__vault || d.bindToVault(e), a = typeof d.source == "string" ? d.source : d.source.id, t.current[a] = d;
|
|
1359
1387
|
} else
|
|
1360
1388
|
typeof a != "string" && (a = a.id);
|
|
1361
|
-
const
|
|
1362
|
-
|
|
1389
|
+
const f = e.get({ id: i, type: "AnnotationPage" }), l = e.get({ id: a, type: "Annotation" });
|
|
1390
|
+
f && l && (f.items.find((d) => d.id === l.id) || r(
|
|
1363
1391
|
pt.addReference({
|
|
1364
1392
|
id: i,
|
|
1365
1393
|
type: "AnnotationPage",
|
|
@@ -1376,7 +1404,7 @@ function Qs() {
|
|
|
1376
1404
|
[i]
|
|
1377
1405
|
), o = D(
|
|
1378
1406
|
(a) => {
|
|
1379
|
-
i && (
|
|
1407
|
+
i && (nr(a) ? a = typeof a.source == "string" ? a.source : a.source.id : typeof a != "string" && (a = a.id), t.current[a] && t.current[a].beforeRemove(), e.get({ id: i, type: "AnnotationPage" }) && r(
|
|
1380
1408
|
pt.removeReference({
|
|
1381
1409
|
id: i,
|
|
1382
1410
|
type: "AnnotationPage",
|
|
@@ -1399,7 +1427,7 @@ function Qs() {
|
|
|
1399
1427
|
];
|
|
1400
1428
|
}
|
|
1401
1429
|
const Yr = ce(null);
|
|
1402
|
-
function
|
|
1430
|
+
function Gs() {
|
|
1403
1431
|
const e = H(Yr);
|
|
1404
1432
|
return [
|
|
1405
1433
|
e.fullPage,
|
|
@@ -1409,8 +1437,8 @@ function Ys() {
|
|
|
1409
1437
|
}
|
|
1410
1438
|
];
|
|
1411
1439
|
}
|
|
1412
|
-
function
|
|
1413
|
-
const [t, { addAnnotation: r, removeAnnotation: i }] =
|
|
1440
|
+
function Js({ children: e }) {
|
|
1441
|
+
const [t, { addAnnotation: r, removeAnnotation: i }] = Ys();
|
|
1414
1442
|
return /* @__PURE__ */ x(
|
|
1415
1443
|
Yr.Provider,
|
|
1416
1444
|
{
|
|
@@ -1419,7 +1447,7 @@ function Gs({ children: e }) {
|
|
|
1419
1447
|
}
|
|
1420
1448
|
);
|
|
1421
1449
|
}
|
|
1422
|
-
function
|
|
1450
|
+
function Ks({
|
|
1423
1451
|
width: e,
|
|
1424
1452
|
style: t,
|
|
1425
1453
|
height: r,
|
|
@@ -1432,9 +1460,9 @@ function Js({
|
|
|
1432
1460
|
/* @__PURE__ */ x("button", { onClick: n, children: "Reset" })
|
|
1433
1461
|
] });
|
|
1434
1462
|
}
|
|
1435
|
-
const
|
|
1436
|
-
function
|
|
1437
|
-
return H(
|
|
1463
|
+
const jt = ce(null);
|
|
1464
|
+
function Zs() {
|
|
1465
|
+
return H(jt);
|
|
1438
1466
|
}
|
|
1439
1467
|
const Gr = ce(
|
|
1440
1468
|
() => {
|
|
@@ -1458,19 +1486,19 @@ function ue(e = {}, t = []) {
|
|
|
1458
1486
|
}
|
|
1459
1487
|
const Kr = ce(() => {
|
|
1460
1488
|
});
|
|
1461
|
-
function
|
|
1489
|
+
function Xs(e) {
|
|
1462
1490
|
const t = ue(), r = H(Kr);
|
|
1463
1491
|
K(() => t && t.id ? (r(t.id, e), () => r(t.id, -1)) : () => {
|
|
1464
1492
|
}, [t, e]);
|
|
1465
1493
|
}
|
|
1466
|
-
function
|
|
1494
|
+
function eo({
|
|
1467
1495
|
children: e,
|
|
1468
1496
|
errorFallback: t,
|
|
1469
1497
|
outerContainerProps: r = {},
|
|
1470
1498
|
worldScale: i,
|
|
1471
1499
|
...n
|
|
1472
1500
|
}) {
|
|
1473
|
-
const [s, o] = B(), a =
|
|
1501
|
+
const [s, o] = B(), a = Ms(), u = t || Ks, [f, l] = B({}), d = Object.entries(f), [v, m] = B({}), h = Object.entries(v), [g, b] = B({}), A = E(() => i || Math.max(...Object.values(g)), [g]), w = E(() => ({ maxOverZoom: A || 1, ...n.runtimeOptions || {} }), [A, n.runtimeOptions]), C = D((I, L) => {
|
|
1474
1502
|
b((P) => {
|
|
1475
1503
|
if (L === -1) {
|
|
1476
1504
|
const { [I]: M, ...$ } = P;
|
|
@@ -1495,12 +1523,12 @@ function Xs({
|
|
|
1495
1523
|
{
|
|
1496
1524
|
...n,
|
|
1497
1525
|
containerProps: { style: { position: "relative" }, ...n.containerProps || {} },
|
|
1498
|
-
htmlChildren: /* @__PURE__ */ x(Me, { children:
|
|
1526
|
+
htmlChildren: /* @__PURE__ */ x(Me, { children: d.map(([I, { element: L, props: P }]) => /* @__PURE__ */ x(me.Fragment, { children: /* @__PURE__ */ x(L, { ...P || {} }) }, I)) }),
|
|
1499
1527
|
onCreated: (I) => {
|
|
1500
1528
|
o(I), n.onCreated && n.onCreated(I);
|
|
1501
1529
|
},
|
|
1502
1530
|
runtimeOptions: w,
|
|
1503
|
-
children: /* @__PURE__ */ x(
|
|
1531
|
+
children: /* @__PURE__ */ x(jt.Provider, { value: s, children: /* @__PURE__ */ x(Kr.Provider, { value: C, children: /* @__PURE__ */ x(Gr.Provider, { value: T, children: /* @__PURE__ */ x(Jr.Provider, { value: j, children: /* @__PURE__ */ x(Rs, { bridge: a, children: /* @__PURE__ */ x(ln.Provider, { value: n.mode || "explore", children: /* @__PURE__ */ x(Js, { children: e }) }) }) }) }) }) })
|
|
1504
1532
|
}
|
|
1505
1533
|
),
|
|
1506
1534
|
/* @__PURE__ */ x("div", { children: h.map(([I, { element: L, props: P }]) => /* @__PURE__ */ x(me.Fragment, { children: /* @__PURE__ */ x(L, { ...P || {} }) }, I)) })
|
|
@@ -1556,8 +1584,8 @@ function Xr(e = Zr) {
|
|
|
1556
1584
|
for (const o of Object.keys(n))
|
|
1557
1585
|
s[o] = (a) => {
|
|
1558
1586
|
const u = e.get(i);
|
|
1559
|
-
for (const { callback:
|
|
1560
|
-
(!l || r && l.indexOf(r) !== -1) &&
|
|
1587
|
+
for (const { callback: f, scope: l } of n[o] || [])
|
|
1588
|
+
(!l || r && l.indexOf(r) !== -1) && f(a, u);
|
|
1561
1589
|
};
|
|
1562
1590
|
return s;
|
|
1563
1591
|
}
|
|
@@ -1587,7 +1615,7 @@ const Be = {}, ti = {
|
|
|
1587
1615
|
return t ? r[t] : r;
|
|
1588
1616
|
}
|
|
1589
1617
|
};
|
|
1590
|
-
function
|
|
1618
|
+
function $t(e = ti) {
|
|
1591
1619
|
return {
|
|
1592
1620
|
applyStyles(t, r, i) {
|
|
1593
1621
|
const n = typeof t == "string" ? t : t.id;
|
|
@@ -1600,7 +1628,7 @@ function jt(e = ti) {
|
|
|
1600
1628
|
};
|
|
1601
1629
|
}
|
|
1602
1630
|
function et(e, t) {
|
|
1603
|
-
const r = V(), i = E(() =>
|
|
1631
|
+
const r = V(), i = E(() => $t(r), [r]);
|
|
1604
1632
|
return Q(() => {
|
|
1605
1633
|
if (!e)
|
|
1606
1634
|
return null;
|
|
@@ -1608,14 +1636,14 @@ function et(e, t) {
|
|
|
1608
1636
|
return n ? t ? n[t] : n : void 0;
|
|
1609
1637
|
}, [e, t]);
|
|
1610
1638
|
}
|
|
1611
|
-
var
|
|
1639
|
+
var to = Object.defineProperty, ro = (e, t, r) => t in e ? to(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Qe = (e, t, r) => (ro(e, typeof t != "symbol" ? t + "" : t, r), r), io = /* @__PURE__ */ function() {
|
|
1612
1640
|
function e(t, r) {
|
|
1613
1641
|
var i = [], n = !0, s = !1, o = void 0;
|
|
1614
1642
|
try {
|
|
1615
1643
|
for (var a = t[Symbol.iterator](), u; !(n = (u = a.next()).done) && (i.push(u.value), !(r && i.length === r)); n = !0)
|
|
1616
1644
|
;
|
|
1617
|
-
} catch (
|
|
1618
|
-
s = !0, o =
|
|
1645
|
+
} catch (f) {
|
|
1646
|
+
s = !0, o = f;
|
|
1619
1647
|
} finally {
|
|
1620
1648
|
try {
|
|
1621
1649
|
!n && a.return && a.return();
|
|
@@ -1636,12 +1664,12 @@ var eo = Object.defineProperty, to = (e, t, r) => t in e ? eo(e, t, { enumerable
|
|
|
1636
1664
|
}(), $e = Math.PI * 2, dt = function(e, t, r, i, n, s, o) {
|
|
1637
1665
|
var a = e.x, u = e.y;
|
|
1638
1666
|
a *= t, u *= r;
|
|
1639
|
-
var
|
|
1667
|
+
var f = i * a - n * u, l = n * a + i * u;
|
|
1640
1668
|
return {
|
|
1641
|
-
x:
|
|
1669
|
+
x: f + s,
|
|
1642
1670
|
y: l + o
|
|
1643
1671
|
};
|
|
1644
|
-
},
|
|
1672
|
+
}, no = function(e, t) {
|
|
1645
1673
|
var r = t === 1.5707963267948966 ? 0.551915024494 : t === -1.5707963267948966 ? -0.551915024494 : 1.3333333333333333 * Math.tan(t / 4), i = Math.cos(e), n = Math.sin(e), s = Math.cos(e + t), o = Math.sin(e + t);
|
|
1646
1674
|
return [{
|
|
1647
1675
|
x: i - n * r,
|
|
@@ -1653,16 +1681,16 @@ var eo = Object.defineProperty, to = (e, t, r) => t in e ? eo(e, t, { enumerable
|
|
|
1653
1681
|
x: s,
|
|
1654
1682
|
y: o
|
|
1655
1683
|
}];
|
|
1656
|
-
},
|
|
1684
|
+
}, sr = function(e, t, r, i) {
|
|
1657
1685
|
var n = e * i - t * r < 0 ? -1 : 1, s = e * r + t * i;
|
|
1658
1686
|
return s > 1 && (s = 1), s < -1 && (s = -1), n * Math.acos(s);
|
|
1659
|
-
},
|
|
1660
|
-
var v = Math.pow(n, 2), m = Math.pow(s, 2), h = Math.pow(l, 2), g = Math.pow(
|
|
1687
|
+
}, so = function(e, t, r, i, n, s, o, a, u, f, l, d) {
|
|
1688
|
+
var v = Math.pow(n, 2), m = Math.pow(s, 2), h = Math.pow(l, 2), g = Math.pow(d, 2), b = v * m - v * g - m * h;
|
|
1661
1689
|
b < 0 && (b = 0), b /= v * g + m * h, b = Math.sqrt(b) * (o === a ? -1 : 1);
|
|
1662
|
-
var A = b * n / s *
|
|
1690
|
+
var A = b * n / s * d, w = b * -s / n * l, C = f * A - u * w + (e + r) / 2, T = u * A + f * w + (t + i) / 2, j = (l - A) / n, I = (d - w) / s, L = (-l - A) / n, P = (-d - w) / s, M = sr(1, 0, j, I), $ = sr(j, I, L, P);
|
|
1663
1691
|
return a === 0 && $ > 0 && ($ -= $e), a === 1 && $ < 0 && ($ += $e), [C, T, M, $];
|
|
1664
|
-
},
|
|
1665
|
-
var t = e.px, r = e.py, i = e.cx, n = e.cy, s = e.rx, o = e.ry, a = e.xAxisRotation, u = a === void 0 ? 0 : a,
|
|
1692
|
+
}, oo = function(e) {
|
|
1693
|
+
var t = e.px, r = e.py, i = e.cx, n = e.cy, s = e.rx, o = e.ry, a = e.xAxisRotation, u = a === void 0 ? 0 : a, f = e.largeArcFlag, l = f === void 0 ? 0 : f, d = e.sweepFlag, v = d === void 0 ? 0 : d, m = [];
|
|
1666
1694
|
if (s === 0 || o === 0)
|
|
1667
1695
|
return [];
|
|
1668
1696
|
var h = Math.sin(u * $e / 360), g = Math.cos(u * $e / 360), b = g * (t - i) / 2 + h * (r - n) / 2, A = -h * (t - i) / 2 + g * (r - n) / 2;
|
|
@@ -1671,12 +1699,12 @@ var eo = Object.defineProperty, to = (e, t, r) => t in e ? eo(e, t, { enumerable
|
|
|
1671
1699
|
s = Math.abs(s), o = Math.abs(o);
|
|
1672
1700
|
var w = Math.pow(b, 2) / Math.pow(s, 2) + Math.pow(A, 2) / Math.pow(o, 2);
|
|
1673
1701
|
w > 1 && (s *= Math.sqrt(w), o *= Math.sqrt(w));
|
|
1674
|
-
var C =
|
|
1702
|
+
var C = so(t, r, i, n, s, o, l, v, h, g, b, A), T = io(C, 4), j = T[0], I = T[1], L = T[2], P = T[3], M = Math.abs(P) / ($e / 4);
|
|
1675
1703
|
Math.abs(1 - M) < 1e-7 && (M = 1);
|
|
1676
1704
|
var $ = Math.max(Math.ceil(M), 1);
|
|
1677
1705
|
P /= $;
|
|
1678
1706
|
for (var ie = 0; ie < $; ie++)
|
|
1679
|
-
m.push(
|
|
1707
|
+
m.push(no(L, P)), L += P;
|
|
1680
1708
|
return m.map(function(Z) {
|
|
1681
1709
|
var U = dt(Z[0], s, o, g, h, j, I), z = U.x, ee = U.y, ne = dt(Z[1], s, o, g, h, j, I), xe = ne.x, O = ne.y, W = dt(Z[2], s, o, g, h, j, I), X = W.x, de = W.y;
|
|
1682
1710
|
return { x1: z, y1: ee, x2: xe, y2: O, x: X, y: de };
|
|
@@ -1685,12 +1713,12 @@ var eo = Object.defineProperty, to = (e, t, r) => t in e ? eo(e, t, { enumerable
|
|
|
1685
1713
|
function ri(e) {
|
|
1686
1714
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
1687
1715
|
}
|
|
1688
|
-
var
|
|
1689
|
-
function
|
|
1716
|
+
var ao = uo, ht = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, co = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
|
|
1717
|
+
function uo(e) {
|
|
1690
1718
|
var t = [];
|
|
1691
|
-
return e.replace(
|
|
1719
|
+
return e.replace(co, function(r, i, n) {
|
|
1692
1720
|
var s = i.toLowerCase();
|
|
1693
|
-
for (n =
|
|
1721
|
+
for (n = fo(n), s == "m" && n.length > 2 && (t.push([i].concat(n.splice(0, 2))), s = "l", i = i == "m" ? "l" : "L"); ; ) {
|
|
1694
1722
|
if (n.length == ht[s])
|
|
1695
1723
|
return n.unshift(i), t.push(n);
|
|
1696
1724
|
if (n.length < ht[s])
|
|
@@ -1699,14 +1727,14 @@ function co(e) {
|
|
|
1699
1727
|
}
|
|
1700
1728
|
}), t;
|
|
1701
1729
|
}
|
|
1702
|
-
var
|
|
1703
|
-
function
|
|
1704
|
-
var t = e.match(
|
|
1730
|
+
var lo = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
|
|
1731
|
+
function fo(e) {
|
|
1732
|
+
var t = e.match(lo);
|
|
1705
1733
|
return t ? t.map(Number) : [];
|
|
1706
1734
|
}
|
|
1707
|
-
const
|
|
1708
|
-
var
|
|
1709
|
-
function
|
|
1735
|
+
const po = /* @__PURE__ */ ri(ao);
|
|
1736
|
+
var ho = yo;
|
|
1737
|
+
function yo(e) {
|
|
1710
1738
|
var t = 0, r = 0, i = 0, n = 0;
|
|
1711
1739
|
return e.map(function(s) {
|
|
1712
1740
|
s = s.slice();
|
|
@@ -1745,10 +1773,10 @@ function ho(e) {
|
|
|
1745
1773
|
return s;
|
|
1746
1774
|
});
|
|
1747
1775
|
}
|
|
1748
|
-
const
|
|
1749
|
-
function
|
|
1750
|
-
const t =
|
|
1751
|
-
let i, n = 0, s = 0, o = 0, a = 0, u,
|
|
1776
|
+
const vo = /* @__PURE__ */ ri(ho);
|
|
1777
|
+
function go(e) {
|
|
1778
|
+
const t = po(e), r = vo(t);
|
|
1779
|
+
let i, n = 0, s = 0, o = 0, a = 0, u, f, l = 0, d = 0;
|
|
1752
1780
|
const v = [];
|
|
1753
1781
|
for (let m = 0; m < r.length; m++) {
|
|
1754
1782
|
let h = r[m];
|
|
@@ -1765,21 +1793,21 @@ function vo(e) {
|
|
|
1765
1793
|
break;
|
|
1766
1794
|
case "S":
|
|
1767
1795
|
{
|
|
1768
|
-
let b = l, A =
|
|
1796
|
+
let b = l, A = d;
|
|
1769
1797
|
(i === "C" || i == "S") && (b += b - o, A += A - a), h = ["C", b, A, h[1], h[2], h[3], h[4]];
|
|
1770
1798
|
}
|
|
1771
1799
|
break;
|
|
1772
1800
|
case "T":
|
|
1773
|
-
i === "Q" || i == "T" ? (u = l * 2 - u,
|
|
1801
|
+
i === "Q" || i == "T" ? (u = l * 2 - u, f = d * 2 - f) : (u = l, f = d), h = ["Q", u, f, h[1], h[2]];
|
|
1774
1802
|
break;
|
|
1775
1803
|
case "Q":
|
|
1776
|
-
u = h[1],
|
|
1804
|
+
u = h[1], f = h[2];
|
|
1777
1805
|
break;
|
|
1778
1806
|
case "A":
|
|
1779
1807
|
{
|
|
1780
|
-
const b =
|
|
1808
|
+
const b = oo({
|
|
1781
1809
|
px: l,
|
|
1782
|
-
py:
|
|
1810
|
+
py: d,
|
|
1783
1811
|
cx: h[6],
|
|
1784
1812
|
cy: h[7],
|
|
1785
1813
|
rx: h[1],
|
|
@@ -1799,7 +1827,7 @@ function vo(e) {
|
|
|
1799
1827
|
h = ["L", n, s];
|
|
1800
1828
|
break;
|
|
1801
1829
|
}
|
|
1802
|
-
i = g, l = h[h.length - 2],
|
|
1830
|
+
i = g, l = h[h.length - 2], d = h[h.length - 1], ["C", "Q", "A"].indexOf(g) > -1 ? (o = h[h.length - 4], a = h[h.length - 3]) : (o = l, a = d), v.push(h);
|
|
1803
1831
|
}
|
|
1804
1832
|
return v;
|
|
1805
1833
|
}
|
|
@@ -1834,15 +1862,15 @@ function vo(e) {
|
|
|
1834
1862
|
* See the License for the specific language governing permissions and
|
|
1835
1863
|
* limitations under the License.
|
|
1836
1864
|
*/
|
|
1837
|
-
function
|
|
1865
|
+
function mo(e, t, r, i = 1) {
|
|
1838
1866
|
return new ii(e, t, r).subdivide(i);
|
|
1839
1867
|
}
|
|
1840
|
-
function
|
|
1841
|
-
return new
|
|
1868
|
+
function bo(e, t, r, i, n = 1) {
|
|
1869
|
+
return new Dt(
|
|
1842
1870
|
new Float64Array([e.x, e.y, t.x, t.y, r.x, r.y, i.x, i.y])
|
|
1843
1871
|
).subdivide(n);
|
|
1844
1872
|
}
|
|
1845
|
-
function
|
|
1873
|
+
function Ao(e) {
|
|
1846
1874
|
return e.x * e.x + e.y * e.y;
|
|
1847
1875
|
}
|
|
1848
1876
|
function De(e) {
|
|
@@ -1863,19 +1891,19 @@ class ii {
|
|
|
1863
1891
|
};
|
|
1864
1892
|
}
|
|
1865
1893
|
mapToBasic() {
|
|
1866
|
-
const { x: t, y: r } = this.start, { x: i, y: n } = this.control, { x: s, y: o } = this.end, a = 2 * i - t - s, u = 2 * n - r - o,
|
|
1867
|
-
return { x0: t, x2: s, scale: h, cross:
|
|
1894
|
+
const { x: t, y: r } = this.start, { x: i, y: n } = this.control, { x: s, y: o } = this.end, a = 2 * i - t - s, u = 2 * n - r - o, f = (i - t) * a + (n - r) * u, l = (s - i) * a + (o - n) * u, d = (s - t) * u - (o - r) * a, v = f / d, m = l / d, h = Math.abs(d) / (Math.hypot(a, u) * Math.abs(m - v));
|
|
1895
|
+
return { x0: t, x2: s, scale: h, cross: d };
|
|
1868
1896
|
}
|
|
1869
1897
|
subdivide(t) {
|
|
1870
|
-
const r = this.mapToBasic(), i = De(r.x0), n = De(r.x2), s = 0.5 * Math.abs(n - i) * Math.sqrt(r.scale / t), o = Math.ceil(s), a = Ee(i), u = Ee(n),
|
|
1898
|
+
const r = this.mapToBasic(), i = De(r.x0), n = De(r.x2), s = 0.5 * Math.abs(n - i) * Math.sqrt(r.scale / t), o = Math.ceil(s), a = Ee(i), u = Ee(n), f = [0];
|
|
1871
1899
|
for (let l = 1; l < o; l++) {
|
|
1872
|
-
const
|
|
1873
|
-
|
|
1900
|
+
const d = (Ee(i + (n - i) * l / o) - a) / (u - a);
|
|
1901
|
+
f.push(d);
|
|
1874
1902
|
}
|
|
1875
|
-
return
|
|
1903
|
+
return f.push(1), f.map((l) => this.eval(l));
|
|
1876
1904
|
}
|
|
1877
1905
|
}
|
|
1878
|
-
class
|
|
1906
|
+
class Dt {
|
|
1879
1907
|
/// Argument is array of coordinate values [x0, y0, x1, y1, x2, y2, x3, y3].
|
|
1880
1908
|
constructor(t) {
|
|
1881
1909
|
Qe(this, "c"), this.c = t;
|
|
@@ -1903,11 +1931,11 @@ class $t {
|
|
|
1903
1931
|
const o = (r - t) / 3, a = this.deriv(t);
|
|
1904
1932
|
i[2] = n.x + o * a.x, i[3] = n.y + o * a.y;
|
|
1905
1933
|
const u = this.deriv(r);
|
|
1906
|
-
return i[4] = s.x - o * u.x, i[5] = s.y - o * u.y, i[6] = s.x, i[7] = s.y, new
|
|
1934
|
+
return i[4] = s.x - o * u.x, i[5] = s.y - o * u.y, i[6] = s.x, i[7] = s.y, new Dt(i);
|
|
1907
1935
|
}
|
|
1908
1936
|
// Very fancy subdivision scheme
|
|
1909
1937
|
subdivide(t) {
|
|
1910
|
-
const r = 0.1 * t, i = t - r, n = Math.sqrt(i), s =
|
|
1938
|
+
const r = 0.1 * t, i = t - r, n = Math.sqrt(i), s = Ao(this.weightsum(1, -3, 3, -1)), o = Math.ceil(Math.pow(s / (432 * r * r), 1 / 6)), a = [];
|
|
1911
1939
|
let u = 0;
|
|
1912
1940
|
for (let h = 0; h < o; h++) {
|
|
1913
1941
|
const g = h / o, b = (h + 1) / o, A = this.subsegment(g, b).midpoint_quadbez(), w = A.mapToBasic(), C = De(w.x0), T = De(w.x2), j = Math.sqrt(w.scale);
|
|
@@ -1923,19 +1951,19 @@ class $t {
|
|
|
1923
1951
|
val: I
|
|
1924
1952
|
}), u += I;
|
|
1925
1953
|
}
|
|
1926
|
-
const
|
|
1954
|
+
const f = 0.5 * u / n, l = Math.ceil(f), d = [{ x: this.c[0], y: this.c[1] }];
|
|
1927
1955
|
let v = 0, m = 0;
|
|
1928
1956
|
for (let h = 1; h < l; h++) {
|
|
1929
1957
|
const g = u * h / l;
|
|
1930
1958
|
for (; v + a[m].val < g; )
|
|
1931
1959
|
v += a[m].val, m++;
|
|
1932
1960
|
const b = a[m].a0, A = a[m].a2, w = Ee(b), C = Ee(A), T = b + (A - b) * (g - v) / a[m].val, j = (Ee(T) - w) / (C - w);
|
|
1933
|
-
|
|
1961
|
+
d.push(a[m].quad.eval(j));
|
|
1934
1962
|
}
|
|
1935
|
-
return
|
|
1963
|
+
return d.push({ x: this.c[6], y: this.c[7] }), d;
|
|
1936
1964
|
}
|
|
1937
1965
|
}
|
|
1938
|
-
const
|
|
1966
|
+
const xo = /&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/, wo = /&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/, or = /^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;
|
|
1939
1967
|
function Ye(e, {
|
|
1940
1968
|
domParser: t,
|
|
1941
1969
|
svgPreprocessor: r,
|
|
@@ -1989,7 +2017,7 @@ function Ye(e, {
|
|
|
1989
2017
|
iiifRenderingHints: i
|
|
1990
2018
|
});
|
|
1991
2019
|
}
|
|
1992
|
-
if (
|
|
2020
|
+
if (Ro(e)) {
|
|
1993
2021
|
const n = [];
|
|
1994
2022
|
if (e.region) {
|
|
1995
2023
|
const s = Ye(
|
|
@@ -2005,7 +2033,7 @@ function Ye(e, {
|
|
|
2005
2033
|
});
|
|
2006
2034
|
}
|
|
2007
2035
|
if (e.type === "FragmentSelector") {
|
|
2008
|
-
const n =
|
|
2036
|
+
const n = xo.exec(e.value);
|
|
2009
2037
|
if (n) {
|
|
2010
2038
|
const o = {
|
|
2011
2039
|
type: "BoxSelector",
|
|
@@ -2023,7 +2051,7 @@ function Ye(e, {
|
|
|
2023
2051
|
iiifRenderingHints: i
|
|
2024
2052
|
});
|
|
2025
2053
|
}
|
|
2026
|
-
const s = e.value.match(
|
|
2054
|
+
const s = e.value.match(wo);
|
|
2027
2055
|
if (s) {
|
|
2028
2056
|
const o = {
|
|
2029
2057
|
type: "TemporalSelector",
|
|
@@ -2057,8 +2085,8 @@ function Ye(e, {
|
|
|
2057
2085
|
selectors: [],
|
|
2058
2086
|
iiifRenderingHints: i
|
|
2059
2087
|
});
|
|
2060
|
-
const
|
|
2061
|
-
|
|
2088
|
+
const d = ni(l);
|
|
2089
|
+
d && (n = d.points, u = d.shapeType, s = [
|
|
2062
2090
|
Math.min(...n.map((v) => v[0])),
|
|
2063
2091
|
// llx
|
|
2064
2092
|
Math.min(...n.map((v) => v[1])),
|
|
@@ -2067,9 +2095,9 @@ function Ye(e, {
|
|
|
2067
2095
|
// urx
|
|
2068
2096
|
Math.max(...n.map((v) => v[1]))
|
|
2069
2097
|
// ury
|
|
2070
|
-
], { style: o, svg: a } =
|
|
2098
|
+
], { style: o, svg: a } = Mo(d.element) ?? { svg: a });
|
|
2071
2099
|
}
|
|
2072
|
-
const
|
|
2100
|
+
const f = {
|
|
2073
2101
|
type: "SvgSelector",
|
|
2074
2102
|
svg: a,
|
|
2075
2103
|
svgShape: u,
|
|
@@ -2078,8 +2106,8 @@ function Ye(e, {
|
|
|
2078
2106
|
spatial: s ? { unit: "pixel", x: s[0], y: s[1], width: s[2] - s[0], height: s[3] - s[1] } : void 0
|
|
2079
2107
|
};
|
|
2080
2108
|
return te({
|
|
2081
|
-
selector:
|
|
2082
|
-
selectors: [
|
|
2109
|
+
selector: f,
|
|
2110
|
+
selectors: [f],
|
|
2083
2111
|
iiifRenderingHints: i
|
|
2084
2112
|
});
|
|
2085
2113
|
}
|
|
@@ -2089,7 +2117,7 @@ function Ye(e, {
|
|
|
2089
2117
|
iiifRenderingHints: i
|
|
2090
2118
|
});
|
|
2091
2119
|
}
|
|
2092
|
-
function
|
|
2120
|
+
function So(e) {
|
|
2093
2121
|
const t = e.map((i) => i[0]).reduce(
|
|
2094
2122
|
(i, n) => (i[n] += 1, i),
|
|
2095
2123
|
{ C: 0, Q: 0, L: 0, M: 0 }
|
|
@@ -2119,8 +2147,8 @@ function ni(e) {
|
|
|
2119
2147
|
const i = r.getAttribute("d");
|
|
2120
2148
|
if (!i)
|
|
2121
2149
|
continue;
|
|
2122
|
-
const n =
|
|
2123
|
-
return { element: r, points:
|
|
2150
|
+
const n = go(i);
|
|
2151
|
+
return { element: r, points: Co(n), shapeType: So(n) };
|
|
2124
2152
|
}
|
|
2125
2153
|
case "circle": {
|
|
2126
2154
|
const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("r") ?? "0");
|
|
@@ -2139,8 +2167,8 @@ function ni(e) {
|
|
|
2139
2167
|
continue;
|
|
2140
2168
|
const a = [];
|
|
2141
2169
|
for (let u = 0; u <= 360; u += 12) {
|
|
2142
|
-
const
|
|
2143
|
-
a.push([i + l, n +
|
|
2170
|
+
const f = Math.tan(u / 360 * Math.PI), l = s * (1 - f ** 2) / (1 + f ** 2), d = o * 2 * f / (1 + f ** 2);
|
|
2171
|
+
a.push([i + l, n + d]);
|
|
2144
2172
|
}
|
|
2145
2173
|
return { element: r, points: a, shapeType: "ellipse" };
|
|
2146
2174
|
}
|
|
@@ -2186,7 +2214,7 @@ function ni(e) {
|
|
|
2186
2214
|
}
|
|
2187
2215
|
return null;
|
|
2188
2216
|
}
|
|
2189
|
-
function
|
|
2217
|
+
function Co(e) {
|
|
2190
2218
|
const t = [];
|
|
2191
2219
|
for (let r = 0; r < e.length; r++) {
|
|
2192
2220
|
const i = t[t.length - 1] ?? [0, 0], n = e[r];
|
|
@@ -2197,7 +2225,7 @@ function So(e) {
|
|
|
2197
2225
|
continue;
|
|
2198
2226
|
case "C":
|
|
2199
2227
|
t.push(
|
|
2200
|
-
...
|
|
2228
|
+
...bo(
|
|
2201
2229
|
{ x: i[0], y: i[1] },
|
|
2202
2230
|
{ x: n[1], y: n[2] },
|
|
2203
2231
|
{ x: n[3], y: n[4] },
|
|
@@ -2208,7 +2236,7 @@ function So(e) {
|
|
|
2208
2236
|
continue;
|
|
2209
2237
|
case "Q":
|
|
2210
2238
|
t.push(
|
|
2211
|
-
...
|
|
2239
|
+
...mo(
|
|
2212
2240
|
{ x: i[0], y: i[1] },
|
|
2213
2241
|
{ x: n[1], y: n[2] },
|
|
2214
2242
|
{ x: n[3], y: n[4] }
|
|
@@ -2220,14 +2248,14 @@ function So(e) {
|
|
|
2220
2248
|
}
|
|
2221
2249
|
return t;
|
|
2222
2250
|
}
|
|
2223
|
-
function
|
|
2251
|
+
function Mo(e) {
|
|
2224
2252
|
const t = {};
|
|
2225
2253
|
if (e.hasAttribute("fill") ? (t.fill = e.getAttribute("fill"), e.removeAttribute("fill")) : e.style.fill && (t.fill = e.style.fill), t.fill) {
|
|
2226
|
-
const i =
|
|
2254
|
+
const i = or.exec(t.fill);
|
|
2227
2255
|
i && (t.fillOpacity = parseFloat(i[4]), t.fill = `rgb(${i[1]}, ${i[2]}, ${i[3]})`);
|
|
2228
2256
|
}
|
|
2229
2257
|
if (e.hasAttribute("fill-opacity") ? (t.fillOpacity = parseFloat(e.getAttribute("fill-opacity")), e.removeAttribute("fill-opacity")) : e.style.fillOpacity && (t.fillOpacity = parseFloat(e.style.fillOpacity)), e.hasAttribute("stroke") ? (t.stroke = e.getAttribute("stroke"), e.removeAttribute("stroke")) : e.style.stroke && (t.stroke = e.style.stroke), t.stroke) {
|
|
2230
|
-
const i =
|
|
2258
|
+
const i = or.exec(t.stroke);
|
|
2231
2259
|
i && (t.strokeOpacity = parseFloat(i[4]), t.stroke = `rgb(${i[1]}, ${i[2]}, ${i[3]})`);
|
|
2232
2260
|
}
|
|
2233
2261
|
e.hasAttribute("stroke-opacity") ? (t.strokeOpacity = parseFloat(e.getAttribute("stroke-opacity")), e.removeAttribute("stroke-opacity")) : e.style.strokeOpacity && (t.strokeOpacity = parseFloat(e.style.strokeOpacity)), e.hasAttribute("stroke-width") ? (t.strokeWidth = e.getAttribute("stroke-width"), e.removeAttribute("stroke-width")) : e.style.strokeWidth && (t.strokeWidth = e.style.strokeWidth), e.hasAttribute("stroke-dasharray") ? (t.strokeDasharray = e.getAttribute("stroke-dasharray"), e.removeAttribute("stroke-dasharray")) : e.style.strokeDasharray && (t.strokeDasharray = e.style.strokeDasharray);
|
|
@@ -2237,14 +2265,14 @@ function Co(e) {
|
|
|
2237
2265
|
throw new Error("Could not find root SVG element");
|
|
2238
2266
|
return { svg: r.outerHTML, style: Object.keys(t).length > 0 ? t : void 0 };
|
|
2239
2267
|
}
|
|
2240
|
-
function
|
|
2268
|
+
function Ro(e) {
|
|
2241
2269
|
return !!e && e.type === "iiif:ImageApiSelector" && e.type === "iiif:ImageApiSelector";
|
|
2242
2270
|
}
|
|
2243
2271
|
function te(e) {
|
|
2244
2272
|
if (e.iiifRenderingHints) {
|
|
2245
2273
|
const t = e.iiifRenderingHints;
|
|
2246
2274
|
if (t.rotation) {
|
|
2247
|
-
const r =
|
|
2275
|
+
const r = Io(t.rotation);
|
|
2248
2276
|
if (r)
|
|
2249
2277
|
if (e.selectors.length)
|
|
2250
2278
|
for (const i of e.selectors)
|
|
@@ -2259,7 +2287,7 @@ function te(e) {
|
|
|
2259
2287
|
delete e.iiifRenderingHints;
|
|
2260
2288
|
return e;
|
|
2261
2289
|
}
|
|
2262
|
-
function
|
|
2290
|
+
function Io(e) {
|
|
2263
2291
|
let t = parseFloat(e);
|
|
2264
2292
|
return t && e.startsWith("!") && (t = 360 - t), t && (t = t % 360), t !== t ? 0 : t || 0;
|
|
2265
2293
|
}
|
|
@@ -2336,24 +2364,24 @@ function Re(e, t = {}) {
|
|
|
2336
2364
|
}
|
|
2337
2365
|
function si(e = {}, t = []) {
|
|
2338
2366
|
const { id: r, selector: i } = e, n = be(), s = V(), o = r || n.annotation, a = Q(
|
|
2339
|
-
(
|
|
2367
|
+
(f) => o ? f.iiif.entities.Annotation[o] : void 0,
|
|
2340
2368
|
[o]
|
|
2341
2369
|
), u = Q(
|
|
2342
|
-
(
|
|
2370
|
+
(f) => a && a.body ? a.body.map((l) => l ? l.type === "SpecificResource" ? {
|
|
2343
2371
|
...l,
|
|
2344
2372
|
source: s.get(l)
|
|
2345
|
-
} : l ?
|
|
2373
|
+
} : l ? f.iiif.entities[l.type][l.id] : null : null).filter(Boolean) : [],
|
|
2346
2374
|
[a]
|
|
2347
2375
|
);
|
|
2348
2376
|
return E(() => {
|
|
2349
2377
|
if (!a)
|
|
2350
2378
|
return;
|
|
2351
|
-
const
|
|
2379
|
+
const f = {
|
|
2352
2380
|
...a,
|
|
2353
2381
|
body: u,
|
|
2354
2382
|
target: Re(a.target, { typeMap: s.getState().iiif.mapping })
|
|
2355
2383
|
};
|
|
2356
|
-
return i ? i(
|
|
2384
|
+
return i ? i(f) : f;
|
|
2357
2385
|
}, [a, i, u, ...t]);
|
|
2358
2386
|
}
|
|
2359
2387
|
const oi = ({
|
|
@@ -2362,14 +2390,14 @@ const oi = ({
|
|
|
2362
2390
|
className: r,
|
|
2363
2391
|
interactive: i
|
|
2364
2392
|
}) => {
|
|
2365
|
-
const n = si({ id: e }), s = et(n, "atlas"), o = et(n, "html"), a = ei(n, ["atlas"]), u = ue(),
|
|
2393
|
+
const n = si({ id: e }), s = et(n, "atlas"), o = et(n, "html"), a = ei(n, ["atlas"]), u = ue(), f = E(() => fn(t, s), [t, s]);
|
|
2366
2394
|
return u && n && n.target && n.target.selector && n.target.selector.type === "BoxSelector" && n.target.source && (n.target.source.id === u.id || n.target.source === u.id) ? /* @__PURE__ */ x(
|
|
2367
2395
|
pn,
|
|
2368
2396
|
{
|
|
2369
2397
|
id: n.id,
|
|
2370
2398
|
isEditing: !0,
|
|
2371
2399
|
region: n.target.selector.spatial,
|
|
2372
|
-
style:
|
|
2400
|
+
style: f,
|
|
2373
2401
|
className: (o == null ? void 0 : o.className) || r,
|
|
2374
2402
|
interactive: !!(o != null && o.href || i),
|
|
2375
2403
|
href: (o == null ? void 0 : o.href) || null,
|
|
@@ -2381,7 +2409,7 @@ const oi = ({
|
|
|
2381
2409
|
}
|
|
2382
2410
|
) : null;
|
|
2383
2411
|
};
|
|
2384
|
-
function
|
|
2412
|
+
function To(e = {}, t = []) {
|
|
2385
2413
|
const { id: r, selector: i } = e, n = be(), s = r || n.annotationPage, o = Q(
|
|
2386
2414
|
(a) => s ? a.iiif.entities.AnnotationPage[s] : void 0,
|
|
2387
2415
|
[s]
|
|
@@ -2391,12 +2419,12 @@ function Io(e = {}, t = []) {
|
|
|
2391
2419
|
return i ? i(o) : o;
|
|
2392
2420
|
}, [o, ...t]);
|
|
2393
2421
|
}
|
|
2394
|
-
const
|
|
2422
|
+
const Tt = ({
|
|
2395
2423
|
className: e,
|
|
2396
2424
|
page: t
|
|
2397
2425
|
}) => {
|
|
2398
2426
|
var s;
|
|
2399
|
-
const r =
|
|
2427
|
+
const r = To({ id: t.id }) || t, i = et(r, "atlas"), n = et(r, "html");
|
|
2400
2428
|
return Q((o) => r.id ? o.iiif.entities.AnnotationPage[r.id] : null, []), /* @__PURE__ */ x(Ke, { children: (s = r.items) == null ? void 0 : s.map((o) => /* @__PURE__ */ x(
|
|
2401
2429
|
oi,
|
|
2402
2430
|
{
|
|
@@ -2417,9 +2445,9 @@ function ai({
|
|
|
2417
2445
|
children: o,
|
|
2418
2446
|
selector: a,
|
|
2419
2447
|
onClick: u,
|
|
2420
|
-
enableSizes:
|
|
2448
|
+
enableSizes: f
|
|
2421
2449
|
}) {
|
|
2422
|
-
var
|
|
2450
|
+
var d, v;
|
|
2423
2451
|
const l = E(() => {
|
|
2424
2452
|
if (!(!a || a.spatial.x === 0 && a.spatial.y === 0))
|
|
2425
2453
|
return a.spatial;
|
|
@@ -2443,10 +2471,10 @@ function ai({
|
|
|
2443
2471
|
imageService: t.service,
|
|
2444
2472
|
thumbnail: r && r.type === "fixed" ? r : void 0
|
|
2445
2473
|
},
|
|
2446
|
-
enableSizes:
|
|
2474
|
+
enableSizes: f,
|
|
2447
2475
|
x: 0,
|
|
2448
2476
|
y: 0,
|
|
2449
|
-
width: (
|
|
2477
|
+
width: (d = t.target) == null ? void 0 : d.spatial.width,
|
|
2450
2478
|
height: (v = t.target) == null ? void 0 : v.spatial.height,
|
|
2451
2479
|
crop: l
|
|
2452
2480
|
}
|
|
@@ -2472,14 +2500,14 @@ function ai({
|
|
|
2472
2500
|
e + (t.service ? "server" : "no-service")
|
|
2473
2501
|
);
|
|
2474
2502
|
}
|
|
2475
|
-
var
|
|
2503
|
+
var ko = Object.defineProperty, Oo = (e, t, r) => t in e ? ko(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ge = (e, t, r) => (Oo(e, typeof t != "symbol" ? t + "" : t, r), r), Eo = /* @__PURE__ */ function() {
|
|
2476
2504
|
function e(t, r) {
|
|
2477
2505
|
var i = [], n = !0, s = !1, o = void 0;
|
|
2478
2506
|
try {
|
|
2479
2507
|
for (var a = t[Symbol.iterator](), u; !(n = (u = a.next()).done) && (i.push(u.value), !(r && i.length === r)); n = !0)
|
|
2480
2508
|
;
|
|
2481
|
-
} catch (
|
|
2482
|
-
s = !0, o =
|
|
2509
|
+
} catch (f) {
|
|
2510
|
+
s = !0, o = f;
|
|
2483
2511
|
} finally {
|
|
2484
2512
|
try {
|
|
2485
2513
|
!n && a.return && a.return();
|
|
@@ -2500,12 +2528,12 @@ var To = Object.defineProperty, ko = (e, t, r) => t in e ? To(e, t, { enumerable
|
|
|
2500
2528
|
}(), qe = Math.PI * 2, yt = function(e, t, r, i, n, s, o) {
|
|
2501
2529
|
var a = e.x, u = e.y;
|
|
2502
2530
|
a *= t, u *= r;
|
|
2503
|
-
var
|
|
2531
|
+
var f = i * a - n * u, l = n * a + i * u;
|
|
2504
2532
|
return {
|
|
2505
|
-
x:
|
|
2533
|
+
x: f + s,
|
|
2506
2534
|
y: l + o
|
|
2507
2535
|
};
|
|
2508
|
-
},
|
|
2536
|
+
}, Po = function(e, t) {
|
|
2509
2537
|
var r = t === 1.5707963267948966 ? 0.551915024494 : t === -1.5707963267948966 ? -0.551915024494 : 1.3333333333333333 * Math.tan(t / 4), i = Math.cos(e), n = Math.sin(e), s = Math.cos(e + t), o = Math.sin(e + t);
|
|
2510
2538
|
return [{
|
|
2511
2539
|
x: i - n * r,
|
|
@@ -2517,16 +2545,16 @@ var To = Object.defineProperty, ko = (e, t, r) => t in e ? To(e, t, { enumerable
|
|
|
2517
2545
|
x: s,
|
|
2518
2546
|
y: o
|
|
2519
2547
|
}];
|
|
2520
|
-
},
|
|
2548
|
+
}, ar = function(e, t, r, i) {
|
|
2521
2549
|
var n = e * i - t * r < 0 ? -1 : 1, s = e * r + t * i;
|
|
2522
2550
|
return s > 1 && (s = 1), s < -1 && (s = -1), n * Math.acos(s);
|
|
2523
|
-
},
|
|
2524
|
-
var v = Math.pow(n, 2), m = Math.pow(s, 2), h = Math.pow(l, 2), g = Math.pow(
|
|
2551
|
+
}, Lo = function(e, t, r, i, n, s, o, a, u, f, l, d) {
|
|
2552
|
+
var v = Math.pow(n, 2), m = Math.pow(s, 2), h = Math.pow(l, 2), g = Math.pow(d, 2), b = v * m - v * g - m * h;
|
|
2525
2553
|
b < 0 && (b = 0), b /= v * g + m * h, b = Math.sqrt(b) * (o === a ? -1 : 1);
|
|
2526
|
-
var A = b * n / s *
|
|
2554
|
+
var A = b * n / s * d, w = b * -s / n * l, C = f * A - u * w + (e + r) / 2, T = u * A + f * w + (t + i) / 2, j = (l - A) / n, I = (d - w) / s, L = (-l - A) / n, P = (-d - w) / s, M = ar(1, 0, j, I), $ = ar(j, I, L, P);
|
|
2527
2555
|
return a === 0 && $ > 0 && ($ -= qe), a === 1 && $ < 0 && ($ += qe), [C, T, M, $];
|
|
2528
|
-
},
|
|
2529
|
-
var t = e.px, r = e.py, i = e.cx, n = e.cy, s = e.rx, o = e.ry, a = e.xAxisRotation, u = a === void 0 ? 0 : a,
|
|
2556
|
+
}, Fo = function(e) {
|
|
2557
|
+
var t = e.px, r = e.py, i = e.cx, n = e.cy, s = e.rx, o = e.ry, a = e.xAxisRotation, u = a === void 0 ? 0 : a, f = e.largeArcFlag, l = f === void 0 ? 0 : f, d = e.sweepFlag, v = d === void 0 ? 0 : d, m = [];
|
|
2530
2558
|
if (s === 0 || o === 0)
|
|
2531
2559
|
return [];
|
|
2532
2560
|
var h = Math.sin(u * qe / 360), g = Math.cos(u * qe / 360), b = g * (t - i) / 2 + h * (r - n) / 2, A = -h * (t - i) / 2 + g * (r - n) / 2;
|
|
@@ -2535,26 +2563,26 @@ var To = Object.defineProperty, ko = (e, t, r) => t in e ? To(e, t, { enumerable
|
|
|
2535
2563
|
s = Math.abs(s), o = Math.abs(o);
|
|
2536
2564
|
var w = Math.pow(b, 2) / Math.pow(s, 2) + Math.pow(A, 2) / Math.pow(o, 2);
|
|
2537
2565
|
w > 1 && (s *= Math.sqrt(w), o *= Math.sqrt(w));
|
|
2538
|
-
var C =
|
|
2566
|
+
var C = Lo(t, r, i, n, s, o, l, v, h, g, b, A), T = Eo(C, 4), j = T[0], I = T[1], L = T[2], P = T[3], M = Math.abs(P) / (qe / 4);
|
|
2539
2567
|
Math.abs(1 - M) < 1e-7 && (M = 1);
|
|
2540
2568
|
var $ = Math.max(Math.ceil(M), 1);
|
|
2541
2569
|
P /= $;
|
|
2542
2570
|
for (var ie = 0; ie < $; ie++)
|
|
2543
|
-
m.push(
|
|
2571
|
+
m.push(Po(L, P)), L += P;
|
|
2544
2572
|
return m.map(function(Z) {
|
|
2545
2573
|
var U = yt(Z[0], s, o, g, h, j, I), z = U.x, ee = U.y, ne = yt(Z[1], s, o, g, h, j, I), xe = ne.x, O = ne.y, W = yt(Z[2], s, o, g, h, j, I), X = W.x, de = W.y;
|
|
2546
2574
|
return { x1: z, y1: ee, x2: xe, y2: O, x: X, y: de };
|
|
2547
2575
|
});
|
|
2548
|
-
},
|
|
2576
|
+
}, jo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2549
2577
|
function ci(e) {
|
|
2550
2578
|
return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
|
|
2551
2579
|
}
|
|
2552
|
-
var
|
|
2553
|
-
function
|
|
2580
|
+
var $o = qo, vt = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, Do = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
|
|
2581
|
+
function qo(e) {
|
|
2554
2582
|
var t = [];
|
|
2555
|
-
return e.replace(
|
|
2583
|
+
return e.replace(Do, function(r, i, n) {
|
|
2556
2584
|
var s = i.toLowerCase();
|
|
2557
|
-
for (n =
|
|
2585
|
+
for (n = Uo(n), s == "m" && n.length > 2 && (t.push([i].concat(n.splice(0, 2))), s = "l", i = i == "m" ? "l" : "L"); ; ) {
|
|
2558
2586
|
if (n.length == vt[s])
|
|
2559
2587
|
return n.unshift(i), t.push(n);
|
|
2560
2588
|
if (n.length < vt[s])
|
|
@@ -2563,14 +2591,14 @@ function Do(e) {
|
|
|
2563
2591
|
}
|
|
2564
2592
|
}), t;
|
|
2565
2593
|
}
|
|
2566
|
-
var
|
|
2567
|
-
function
|
|
2568
|
-
var t = e.match(
|
|
2594
|
+
var _o = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
|
|
2595
|
+
function Uo(e) {
|
|
2596
|
+
var t = e.match(_o);
|
|
2569
2597
|
return t ? t.map(Number) : [];
|
|
2570
2598
|
}
|
|
2571
|
-
const
|
|
2572
|
-
var
|
|
2573
|
-
function
|
|
2599
|
+
const Vo = /* @__PURE__ */ ci($o);
|
|
2600
|
+
var No = Ho;
|
|
2601
|
+
function Ho(e) {
|
|
2574
2602
|
var t = 0, r = 0, i = 0, n = 0;
|
|
2575
2603
|
return e.map(function(s) {
|
|
2576
2604
|
s = s.slice();
|
|
@@ -2609,10 +2637,10 @@ function No(e) {
|
|
|
2609
2637
|
return s;
|
|
2610
2638
|
});
|
|
2611
2639
|
}
|
|
2612
|
-
const
|
|
2613
|
-
function
|
|
2614
|
-
const t =
|
|
2615
|
-
let i, n = 0, s = 0, o = 0, a = 0, u,
|
|
2640
|
+
const Bo = /* @__PURE__ */ ci(No);
|
|
2641
|
+
function zo(e) {
|
|
2642
|
+
const t = Vo(e), r = Bo(t);
|
|
2643
|
+
let i, n = 0, s = 0, o = 0, a = 0, u, f, l = 0, d = 0;
|
|
2616
2644
|
const v = [];
|
|
2617
2645
|
for (let m = 0; m < r.length; m++) {
|
|
2618
2646
|
let h = r[m];
|
|
@@ -2629,21 +2657,21 @@ function Bo(e) {
|
|
|
2629
2657
|
break;
|
|
2630
2658
|
case "S":
|
|
2631
2659
|
{
|
|
2632
|
-
let b = l, A =
|
|
2660
|
+
let b = l, A = d;
|
|
2633
2661
|
(i === "C" || i == "S") && (b += b - o, A += A - a), h = ["C", b, A, h[1], h[2], h[3], h[4]];
|
|
2634
2662
|
}
|
|
2635
2663
|
break;
|
|
2636
2664
|
case "T":
|
|
2637
|
-
i === "Q" || i == "T" ? (u = l * 2 - u,
|
|
2665
|
+
i === "Q" || i == "T" ? (u = l * 2 - u, f = d * 2 - f) : (u = l, f = d), h = ["Q", u, f, h[1], h[2]];
|
|
2638
2666
|
break;
|
|
2639
2667
|
case "Q":
|
|
2640
|
-
u = h[1],
|
|
2668
|
+
u = h[1], f = h[2];
|
|
2641
2669
|
break;
|
|
2642
2670
|
case "A":
|
|
2643
2671
|
{
|
|
2644
|
-
const b =
|
|
2672
|
+
const b = Fo({
|
|
2645
2673
|
px: l,
|
|
2646
|
-
py:
|
|
2674
|
+
py: d,
|
|
2647
2675
|
cx: h[6],
|
|
2648
2676
|
cy: h[7],
|
|
2649
2677
|
rx: h[1],
|
|
@@ -2663,7 +2691,7 @@ function Bo(e) {
|
|
|
2663
2691
|
h = ["L", n, s];
|
|
2664
2692
|
break;
|
|
2665
2693
|
}
|
|
2666
|
-
i = g, l = h[h.length - 2],
|
|
2694
|
+
i = g, l = h[h.length - 2], d = h[h.length - 1], ["C", "Q", "A"].indexOf(g) > -1 ? (o = h[h.length - 4], a = h[h.length - 3]) : (o = l, a = d), v.push(h);
|
|
2667
2695
|
}
|
|
2668
2696
|
return v;
|
|
2669
2697
|
}
|
|
@@ -2698,15 +2726,15 @@ function Bo(e) {
|
|
|
2698
2726
|
* See the License for the specific language governing permissions and
|
|
2699
2727
|
* limitations under the License.
|
|
2700
2728
|
*/
|
|
2701
|
-
function
|
|
2729
|
+
function Wo(e, t, r, i = 1) {
|
|
2702
2730
|
return new ui(e, t, r).subdivide(i);
|
|
2703
2731
|
}
|
|
2704
|
-
function
|
|
2705
|
-
return new
|
|
2732
|
+
function Qo(e, t, r, i, n = 1) {
|
|
2733
|
+
return new qt(
|
|
2706
2734
|
new Float64Array([e.x, e.y, t.x, t.y, r.x, r.y, i.x, i.y])
|
|
2707
2735
|
).subdivide(n);
|
|
2708
2736
|
}
|
|
2709
|
-
function
|
|
2737
|
+
function Yo(e) {
|
|
2710
2738
|
return e.x * e.x + e.y * e.y;
|
|
2711
2739
|
}
|
|
2712
2740
|
function _e(e) {
|
|
@@ -2727,19 +2755,19 @@ class ui {
|
|
|
2727
2755
|
};
|
|
2728
2756
|
}
|
|
2729
2757
|
mapToBasic() {
|
|
2730
|
-
const { x: t, y: r } = this.start, { x: i, y: n } = this.control, { x: s, y: o } = this.end, a = 2 * i - t - s, u = 2 * n - r - o,
|
|
2731
|
-
return { x0: t, x2: s, scale: h, cross:
|
|
2758
|
+
const { x: t, y: r } = this.start, { x: i, y: n } = this.control, { x: s, y: o } = this.end, a = 2 * i - t - s, u = 2 * n - r - o, f = (i - t) * a + (n - r) * u, l = (s - i) * a + (o - n) * u, d = (s - t) * u - (o - r) * a, v = f / d, m = l / d, h = Math.abs(d) / (Math.hypot(a, u) * Math.abs(m - v));
|
|
2759
|
+
return { x0: t, x2: s, scale: h, cross: d };
|
|
2732
2760
|
}
|
|
2733
2761
|
subdivide(t) {
|
|
2734
|
-
const r = this.mapToBasic(), i = _e(r.x0), n = _e(r.x2), s = 0.5 * Math.abs(n - i) * Math.sqrt(r.scale / t), o = Math.ceil(s), a = Pe(i), u = Pe(n),
|
|
2762
|
+
const r = this.mapToBasic(), i = _e(r.x0), n = _e(r.x2), s = 0.5 * Math.abs(n - i) * Math.sqrt(r.scale / t), o = Math.ceil(s), a = Pe(i), u = Pe(n), f = [0];
|
|
2735
2763
|
for (let l = 1; l < o; l++) {
|
|
2736
|
-
const
|
|
2737
|
-
|
|
2764
|
+
const d = (Pe(i + (n - i) * l / o) - a) / (u - a);
|
|
2765
|
+
f.push(d);
|
|
2738
2766
|
}
|
|
2739
|
-
return
|
|
2767
|
+
return f.push(1), f.map((l) => this.eval(l));
|
|
2740
2768
|
}
|
|
2741
2769
|
}
|
|
2742
|
-
class
|
|
2770
|
+
class qt {
|
|
2743
2771
|
/// Argument is array of coordinate values [x0, y0, x1, y1, x2, y2, x3, y3].
|
|
2744
2772
|
constructor(t) {
|
|
2745
2773
|
Ge(this, "c"), this.c = t;
|
|
@@ -2767,11 +2795,11 @@ class Dt {
|
|
|
2767
2795
|
const o = (r - t) / 3, a = this.deriv(t);
|
|
2768
2796
|
i[2] = n.x + o * a.x, i[3] = n.y + o * a.y;
|
|
2769
2797
|
const u = this.deriv(r);
|
|
2770
|
-
return i[4] = s.x - o * u.x, i[5] = s.y - o * u.y, i[6] = s.x, i[7] = s.y, new
|
|
2798
|
+
return i[4] = s.x - o * u.x, i[5] = s.y - o * u.y, i[6] = s.x, i[7] = s.y, new qt(i);
|
|
2771
2799
|
}
|
|
2772
2800
|
// Very fancy subdivision scheme
|
|
2773
2801
|
subdivide(t) {
|
|
2774
|
-
const r = 0.1 * t, i = t - r, n = Math.sqrt(i), s =
|
|
2802
|
+
const r = 0.1 * t, i = t - r, n = Math.sqrt(i), s = Yo(this.weightsum(1, -3, 3, -1)), o = Math.ceil(Math.pow(s / (432 * r * r), 1 / 6)), a = [];
|
|
2775
2803
|
let u = 0;
|
|
2776
2804
|
for (let h = 0; h < o; h++) {
|
|
2777
2805
|
const g = h / o, b = (h + 1) / o, A = this.subsegment(g, b).midpoint_quadbez(), w = A.mapToBasic(), C = _e(w.x0), T = _e(w.x2), j = Math.sqrt(w.scale);
|
|
@@ -2787,19 +2815,19 @@ class Dt {
|
|
|
2787
2815
|
val: I
|
|
2788
2816
|
}), u += I;
|
|
2789
2817
|
}
|
|
2790
|
-
const
|
|
2818
|
+
const f = 0.5 * u / n, l = Math.ceil(f), d = [{ x: this.c[0], y: this.c[1] }];
|
|
2791
2819
|
let v = 0, m = 0;
|
|
2792
2820
|
for (let h = 1; h < l; h++) {
|
|
2793
2821
|
const g = u * h / l;
|
|
2794
2822
|
for (; v + a[m].val < g; )
|
|
2795
2823
|
v += a[m].val, m++;
|
|
2796
2824
|
const b = a[m].a0, A = a[m].a2, w = Pe(b), C = Pe(A), T = b + (A - b) * (g - v) / a[m].val, j = (Pe(T) - w) / (C - w);
|
|
2797
|
-
|
|
2825
|
+
d.push(a[m].quad.eval(j));
|
|
2798
2826
|
}
|
|
2799
|
-
return
|
|
2827
|
+
return d.push({ x: this.c[6], y: this.c[7] }), d;
|
|
2800
2828
|
}
|
|
2801
2829
|
}
|
|
2802
|
-
const
|
|
2830
|
+
const Go = /&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/, Jo = /&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/, cr = /^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;
|
|
2803
2831
|
function Je(e, {
|
|
2804
2832
|
domParser: t,
|
|
2805
2833
|
svgPreprocessor: r,
|
|
@@ -2853,7 +2881,7 @@ function Je(e, {
|
|
|
2853
2881
|
iiifRenderingHints: i
|
|
2854
2882
|
});
|
|
2855
2883
|
}
|
|
2856
|
-
if (
|
|
2884
|
+
if (ea(e)) {
|
|
2857
2885
|
const n = [];
|
|
2858
2886
|
if (e.region) {
|
|
2859
2887
|
const s = Je(
|
|
@@ -2869,7 +2897,7 @@ function Je(e, {
|
|
|
2869
2897
|
});
|
|
2870
2898
|
}
|
|
2871
2899
|
if (e.type === "FragmentSelector") {
|
|
2872
|
-
const n =
|
|
2900
|
+
const n = Go.exec(e.value);
|
|
2873
2901
|
if (n) {
|
|
2874
2902
|
const o = {
|
|
2875
2903
|
type: "BoxSelector",
|
|
@@ -2887,7 +2915,7 @@ function Je(e, {
|
|
|
2887
2915
|
iiifRenderingHints: i
|
|
2888
2916
|
});
|
|
2889
2917
|
}
|
|
2890
|
-
const s = e.value.match(
|
|
2918
|
+
const s = e.value.match(Jo);
|
|
2891
2919
|
if (s) {
|
|
2892
2920
|
const o = {
|
|
2893
2921
|
type: "TemporalSelector",
|
|
@@ -2921,8 +2949,8 @@ function Je(e, {
|
|
|
2921
2949
|
selectors: [],
|
|
2922
2950
|
iiifRenderingHints: i
|
|
2923
2951
|
});
|
|
2924
|
-
const
|
|
2925
|
-
|
|
2952
|
+
const d = li(l);
|
|
2953
|
+
d && (n = d.points, u = d.shapeType, s = [
|
|
2926
2954
|
Math.min(...n.map((v) => v[0])),
|
|
2927
2955
|
// llx
|
|
2928
2956
|
Math.min(...n.map((v) => v[1])),
|
|
@@ -2931,9 +2959,9 @@ function Je(e, {
|
|
|
2931
2959
|
// urx
|
|
2932
2960
|
Math.max(...n.map((v) => v[1]))
|
|
2933
2961
|
// ury
|
|
2934
|
-
], { style: o, svg: a } =
|
|
2962
|
+
], { style: o, svg: a } = Xo(d.element) ?? { svg: a });
|
|
2935
2963
|
}
|
|
2936
|
-
const
|
|
2964
|
+
const f = {
|
|
2937
2965
|
type: "SvgSelector",
|
|
2938
2966
|
svg: a,
|
|
2939
2967
|
svgShape: u,
|
|
@@ -2942,8 +2970,8 @@ function Je(e, {
|
|
|
2942
2970
|
spatial: s ? { unit: "pixel", x: s[0], y: s[1], width: s[2] - s[0], height: s[3] - s[1] } : void 0
|
|
2943
2971
|
};
|
|
2944
2972
|
return re({
|
|
2945
|
-
selector:
|
|
2946
|
-
selectors: [
|
|
2973
|
+
selector: f,
|
|
2974
|
+
selectors: [f],
|
|
2947
2975
|
iiifRenderingHints: i
|
|
2948
2976
|
});
|
|
2949
2977
|
}
|
|
@@ -2953,7 +2981,7 @@ function Je(e, {
|
|
|
2953
2981
|
iiifRenderingHints: i
|
|
2954
2982
|
});
|
|
2955
2983
|
}
|
|
2956
|
-
function
|
|
2984
|
+
function Ko(e) {
|
|
2957
2985
|
const t = e.map((i) => i[0]).reduce(
|
|
2958
2986
|
(i, n) => (i[n] += 1, i),
|
|
2959
2987
|
{ C: 0, Q: 0, L: 0, M: 0 }
|
|
@@ -2983,8 +3011,8 @@ function li(e) {
|
|
|
2983
3011
|
const i = r.getAttribute("d");
|
|
2984
3012
|
if (!i)
|
|
2985
3013
|
continue;
|
|
2986
|
-
const n =
|
|
2987
|
-
return { element: r, points:
|
|
3014
|
+
const n = zo(i);
|
|
3015
|
+
return { element: r, points: Zo(n), shapeType: Ko(n) };
|
|
2988
3016
|
}
|
|
2989
3017
|
case "circle": {
|
|
2990
3018
|
const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("r") ?? "0");
|
|
@@ -3003,8 +3031,8 @@ function li(e) {
|
|
|
3003
3031
|
continue;
|
|
3004
3032
|
const a = [];
|
|
3005
3033
|
for (let u = 0; u <= 360; u += 12) {
|
|
3006
|
-
const
|
|
3007
|
-
a.push([i + l, n +
|
|
3034
|
+
const f = Math.tan(u / 360 * Math.PI), l = s * (1 - f ** 2) / (1 + f ** 2), d = o * 2 * f / (1 + f ** 2);
|
|
3035
|
+
a.push([i + l, n + d]);
|
|
3008
3036
|
}
|
|
3009
3037
|
return { element: r, points: a, shapeType: "ellipse" };
|
|
3010
3038
|
}
|
|
@@ -3050,7 +3078,7 @@ function li(e) {
|
|
|
3050
3078
|
}
|
|
3051
3079
|
return null;
|
|
3052
3080
|
}
|
|
3053
|
-
function
|
|
3081
|
+
function Zo(e) {
|
|
3054
3082
|
const t = [];
|
|
3055
3083
|
for (let r = 0; r < e.length; r++) {
|
|
3056
3084
|
const i = t[t.length - 1] ?? [0, 0], n = e[r];
|
|
@@ -3061,7 +3089,7 @@ function Ko(e) {
|
|
|
3061
3089
|
continue;
|
|
3062
3090
|
case "C":
|
|
3063
3091
|
t.push(
|
|
3064
|
-
...
|
|
3092
|
+
...Qo(
|
|
3065
3093
|
{ x: i[0], y: i[1] },
|
|
3066
3094
|
{ x: n[1], y: n[2] },
|
|
3067
3095
|
{ x: n[3], y: n[4] },
|
|
@@ -3072,7 +3100,7 @@ function Ko(e) {
|
|
|
3072
3100
|
continue;
|
|
3073
3101
|
case "Q":
|
|
3074
3102
|
t.push(
|
|
3075
|
-
...
|
|
3103
|
+
...Wo(
|
|
3076
3104
|
{ x: i[0], y: i[1] },
|
|
3077
3105
|
{ x: n[1], y: n[2] },
|
|
3078
3106
|
{ x: n[3], y: n[4] }
|
|
@@ -3084,14 +3112,14 @@ function Ko(e) {
|
|
|
3084
3112
|
}
|
|
3085
3113
|
return t;
|
|
3086
3114
|
}
|
|
3087
|
-
function
|
|
3115
|
+
function Xo(e) {
|
|
3088
3116
|
const t = {};
|
|
3089
3117
|
if (e.hasAttribute("fill") ? (t.fill = e.getAttribute("fill"), e.removeAttribute("fill")) : e.style.fill && (t.fill = e.style.fill), t.fill) {
|
|
3090
|
-
const i =
|
|
3118
|
+
const i = cr.exec(t.fill);
|
|
3091
3119
|
i && (t.fillOpacity = parseFloat(i[4]), t.fill = `rgb(${i[1]}, ${i[2]}, ${i[3]})`);
|
|
3092
3120
|
}
|
|
3093
3121
|
if (e.hasAttribute("fill-opacity") ? (t.fillOpacity = parseFloat(e.getAttribute("fill-opacity")), e.removeAttribute("fill-opacity")) : e.style.fillOpacity && (t.fillOpacity = parseFloat(e.style.fillOpacity)), e.hasAttribute("stroke") ? (t.stroke = e.getAttribute("stroke"), e.removeAttribute("stroke")) : e.style.stroke && (t.stroke = e.style.stroke), t.stroke) {
|
|
3094
|
-
const i =
|
|
3122
|
+
const i = cr.exec(t.stroke);
|
|
3095
3123
|
i && (t.strokeOpacity = parseFloat(i[4]), t.stroke = `rgb(${i[1]}, ${i[2]}, ${i[3]})`);
|
|
3096
3124
|
}
|
|
3097
3125
|
e.hasAttribute("stroke-opacity") ? (t.strokeOpacity = parseFloat(e.getAttribute("stroke-opacity")), e.removeAttribute("stroke-opacity")) : e.style.strokeOpacity && (t.strokeOpacity = parseFloat(e.style.strokeOpacity)), e.hasAttribute("stroke-width") ? (t.strokeWidth = e.getAttribute("stroke-width"), e.removeAttribute("stroke-width")) : e.style.strokeWidth && (t.strokeWidth = e.style.strokeWidth), e.hasAttribute("stroke-dasharray") ? (t.strokeDasharray = e.getAttribute("stroke-dasharray"), e.removeAttribute("stroke-dasharray")) : e.style.strokeDasharray && (t.strokeDasharray = e.style.strokeDasharray);
|
|
@@ -3101,14 +3129,14 @@ function Zo(e) {
|
|
|
3101
3129
|
throw new Error("Could not find root SVG element");
|
|
3102
3130
|
return { svg: r.outerHTML, style: Object.keys(t).length > 0 ? t : void 0 };
|
|
3103
3131
|
}
|
|
3104
|
-
function
|
|
3132
|
+
function ea(e) {
|
|
3105
3133
|
return !!e && e.type === "iiif:ImageApiSelector" && e.type === "iiif:ImageApiSelector";
|
|
3106
3134
|
}
|
|
3107
3135
|
function re(e) {
|
|
3108
3136
|
if (e.iiifRenderingHints) {
|
|
3109
3137
|
const t = e.iiifRenderingHints;
|
|
3110
3138
|
if (t.rotation) {
|
|
3111
|
-
const r =
|
|
3139
|
+
const r = ta(t.rotation);
|
|
3112
3140
|
if (r)
|
|
3113
3141
|
if (e.selectors.length)
|
|
3114
3142
|
for (const i of e.selectors)
|
|
@@ -3123,7 +3151,7 @@ function re(e) {
|
|
|
3123
3151
|
delete e.iiifRenderingHints;
|
|
3124
3152
|
return e;
|
|
3125
3153
|
}
|
|
3126
|
-
function
|
|
3154
|
+
function ta(e) {
|
|
3127
3155
|
let t = parseFloat(e);
|
|
3128
3156
|
return t && e.startsWith("!") && (t = 360 - t), t && (t = t % 360), t !== t ? 0 : t || 0;
|
|
3129
3157
|
}
|
|
@@ -3198,11 +3226,11 @@ function je(e, t = {}) {
|
|
|
3198
3226
|
selectors: []
|
|
3199
3227
|
};
|
|
3200
3228
|
}
|
|
3201
|
-
var
|
|
3202
|
-
function
|
|
3229
|
+
var ra = Object.defineProperty, ia = (e, t, r) => t in e ? ra(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ur = (e, t, r) => (ia(e, typeof t != "symbol" ? t + "" : t, r), r);
|
|
3230
|
+
function na(e) {
|
|
3203
3231
|
return Array.isArray(e) ? e : e ? [e] : [];
|
|
3204
3232
|
}
|
|
3205
|
-
const
|
|
3233
|
+
const lr = [
|
|
3206
3234
|
"sc:Collection",
|
|
3207
3235
|
"sc:Manifest",
|
|
3208
3236
|
"sc:Canvas",
|
|
@@ -3215,7 +3243,7 @@ const ur = [
|
|
|
3215
3243
|
"Service",
|
|
3216
3244
|
"ContentResource"
|
|
3217
3245
|
];
|
|
3218
|
-
function
|
|
3246
|
+
function sa(e) {
|
|
3219
3247
|
if (typeof e > "u" || e === null)
|
|
3220
3248
|
throw new Error("Null or undefined is not a valid entity.");
|
|
3221
3249
|
if (Array.isArray(e))
|
|
@@ -3223,9 +3251,9 @@ function na(e) {
|
|
|
3223
3251
|
if (typeof e != "object")
|
|
3224
3252
|
throw new Error(`${typeof e} is not a valid entity`);
|
|
3225
3253
|
if (typeof e["@type"] == "string") {
|
|
3226
|
-
const t =
|
|
3254
|
+
const t = lr.indexOf(e["@type"]);
|
|
3227
3255
|
if (t !== -1)
|
|
3228
|
-
return
|
|
3256
|
+
return lr[t];
|
|
3229
3257
|
}
|
|
3230
3258
|
if (e.profile)
|
|
3231
3259
|
return "Service";
|
|
@@ -3233,9 +3261,9 @@ function na(e) {
|
|
|
3233
3261
|
return "ContentResource";
|
|
3234
3262
|
throw new Error("Resource type is not known");
|
|
3235
3263
|
}
|
|
3236
|
-
class
|
|
3264
|
+
class _t {
|
|
3237
3265
|
constructor(t, r = {}) {
|
|
3238
|
-
|
|
3266
|
+
ur(this, "traversals"), ur(this, "options"), this.traversals = {
|
|
3239
3267
|
collection: [],
|
|
3240
3268
|
manifest: [],
|
|
3241
3269
|
canvas: [],
|
|
@@ -3256,7 +3284,7 @@ class qt {
|
|
|
3256
3284
|
};
|
|
3257
3285
|
}
|
|
3258
3286
|
static all(t) {
|
|
3259
|
-
return new
|
|
3287
|
+
return new _t({
|
|
3260
3288
|
collection: [t],
|
|
3261
3289
|
manifest: [t],
|
|
3262
3290
|
canvas: [t],
|
|
@@ -3384,7 +3412,7 @@ class qt {
|
|
|
3384
3412
|
traverseUnknown(t) {
|
|
3385
3413
|
if (!t["@type"] || typeof t == "string")
|
|
3386
3414
|
return t;
|
|
3387
|
-
switch (
|
|
3415
|
+
switch (sa(t)) {
|
|
3388
3416
|
case "sc:Collection":
|
|
3389
3417
|
return this.traverseCollection(t);
|
|
3390
3418
|
case "sc:Manifest":
|
|
@@ -3457,7 +3485,7 @@ class qt {
|
|
|
3457
3485
|
}, t);
|
|
3458
3486
|
}
|
|
3459
3487
|
}
|
|
3460
|
-
const
|
|
3488
|
+
const oa = "http://library.stanford.edu/iiif/image-api/compliance.html#level0", fi = "http://library.stanford.edu/iiif/image-api/compliance.html#level1", pi = "http://library.stanford.edu/iiif/image-api/compliance.html#level2", aa = "http://library.stanford.edu/iiif/image-api/conformance.html#level0", di = "http://library.stanford.edu/iiif/image-api/conformance.html#level1", hi = "http://library.stanford.edu/iiif/image-api/conformance.html#level2", ca = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0", yi = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1", vi = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", ua = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0", gi = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1", mi = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2", la = "http://iiif.io/api/image/1/level0.json", fa = "http://iiif.io/api/image/1/profiles/level0.json", bi = "http://iiif.io/api/image/1/level1.json", Ai = "http://iiif.io/api/image/1/profiles/level1.json", xi = "http://iiif.io/api/image/1/level2.json", wi = "http://iiif.io/api/image/1/profiles/level2.json", pa = "http://iiif.io/api/image/2/level0.json", da = "http://iiif.io/api/image/2/profiles/level0.json", Si = "http://iiif.io/api/image/2/level1.json", Ci = "http://iiif.io/api/image/2/profiles/level1.json", Mi = "http://iiif.io/api/image/2/level2.json", Ri = "http://iiif.io/api/image/2/profiles/level2.json", ha = "level0", Ii = "level1", Ti = "level2", ya = "http://iiif.io/api/image/2/level0", ki = "http://iiif.io/api/image/2/level1", Oi = "http://iiif.io/api/image/2/level2", va = [
|
|
3461
3489
|
ki,
|
|
3462
3490
|
Oi,
|
|
3463
3491
|
fi,
|
|
@@ -3478,35 +3506,35 @@ const sa = "http://library.stanford.edu/iiif/image-api/compliance.html#level0",
|
|
|
3478
3506
|
Ri,
|
|
3479
3507
|
Ii,
|
|
3480
3508
|
Ti
|
|
3481
|
-
],
|
|
3482
|
-
|
|
3509
|
+
], ga = [
|
|
3510
|
+
ya,
|
|
3483
3511
|
ki,
|
|
3484
3512
|
Oi,
|
|
3485
|
-
|
|
3513
|
+
oa,
|
|
3486
3514
|
fi,
|
|
3487
3515
|
pi,
|
|
3488
|
-
|
|
3516
|
+
aa,
|
|
3489
3517
|
di,
|
|
3490
3518
|
hi,
|
|
3491
|
-
|
|
3519
|
+
ca,
|
|
3492
3520
|
yi,
|
|
3493
3521
|
vi,
|
|
3494
|
-
|
|
3522
|
+
ua,
|
|
3495
3523
|
gi,
|
|
3496
3524
|
mi,
|
|
3497
|
-
ua,
|
|
3498
3525
|
la,
|
|
3526
|
+
fa,
|
|
3499
3527
|
bi,
|
|
3500
3528
|
Ai,
|
|
3501
3529
|
xi,
|
|
3502
3530
|
wi,
|
|
3503
|
-
fa,
|
|
3504
3531
|
pa,
|
|
3532
|
+
da,
|
|
3505
3533
|
Si,
|
|
3506
3534
|
Ci,
|
|
3507
3535
|
Mi,
|
|
3508
3536
|
Ri,
|
|
3509
|
-
|
|
3537
|
+
ha,
|
|
3510
3538
|
Ii,
|
|
3511
3539
|
Ti
|
|
3512
3540
|
];
|
|
@@ -3515,7 +3543,7 @@ function le(e) {
|
|
|
3515
3543
|
(typeof e[t] > "u" || e[t] === null) && delete e[t];
|
|
3516
3544
|
return e;
|
|
3517
3545
|
}
|
|
3518
|
-
const
|
|
3546
|
+
const kt = {
|
|
3519
3547
|
attributionLabel: "Attribution",
|
|
3520
3548
|
lang: "none",
|
|
3521
3549
|
providerId: "http://example.org/provider",
|
|
@@ -3542,14 +3570,14 @@ function Ie(e, t = "none") {
|
|
|
3542
3570
|
function Ei(e) {
|
|
3543
3571
|
if (Array.isArray(e))
|
|
3544
3572
|
return Ei(e.find((t) => typeof t == "string"));
|
|
3545
|
-
if (
|
|
3573
|
+
if (ga.indexOf(e) !== -1)
|
|
3546
3574
|
return "level2";
|
|
3547
|
-
if (
|
|
3575
|
+
if (va.indexOf(e) !== -1)
|
|
3548
3576
|
return "level1";
|
|
3549
3577
|
if (typeof e == "string")
|
|
3550
3578
|
return e;
|
|
3551
3579
|
}
|
|
3552
|
-
function
|
|
3580
|
+
function ma(e) {
|
|
3553
3581
|
const t = Array.isArray(e) ? e : [e];
|
|
3554
3582
|
for (const r of t)
|
|
3555
3583
|
switch (r) {
|
|
@@ -3563,7 +3591,7 @@ function ga(e) {
|
|
|
3563
3591
|
return "ImageApiSelector";
|
|
3564
3592
|
}
|
|
3565
3593
|
}
|
|
3566
|
-
function
|
|
3594
|
+
function ba(e) {
|
|
3567
3595
|
switch (e) {
|
|
3568
3596
|
case "http://iiif.io/api/image/2/level0.json":
|
|
3569
3597
|
case "http://iiif.io/api/image/2/level1.json":
|
|
@@ -3592,24 +3620,24 @@ function ma(e) {
|
|
|
3592
3620
|
return "AutoCompleteService1";
|
|
3593
3621
|
}
|
|
3594
3622
|
}
|
|
3595
|
-
function
|
|
3623
|
+
function fr(e) {
|
|
3596
3624
|
for (const t of ["sc", "oa", "dcterms", "dctypes", "iiif"])
|
|
3597
3625
|
if (e.startsWith(`${t}:`))
|
|
3598
3626
|
return e.slice(t.length + 1);
|
|
3599
3627
|
return e;
|
|
3600
3628
|
}
|
|
3601
|
-
const
|
|
3602
|
-
function
|
|
3629
|
+
const Aa = ["Collection", "Manifest", "Annotation", "AnnotationPage", "Range", "Service"];
|
|
3630
|
+
function Ut(e) {
|
|
3603
3631
|
const t = e["@id"] || e.id;
|
|
3604
3632
|
let r = e["@type"] || e.type;
|
|
3605
3633
|
const i = e.profile || void 0, n = e["@context"] || void 0;
|
|
3606
3634
|
if (i) {
|
|
3607
|
-
const s =
|
|
3635
|
+
const s = ba(i);
|
|
3608
3636
|
if (s)
|
|
3609
3637
|
return s;
|
|
3610
3638
|
}
|
|
3611
3639
|
if (n) {
|
|
3612
|
-
const s =
|
|
3640
|
+
const s = ma(n);
|
|
3613
3641
|
if (s)
|
|
3614
3642
|
return s;
|
|
3615
3643
|
}
|
|
@@ -3635,7 +3663,7 @@ function _t(e) {
|
|
|
3635
3663
|
return "TextualBody";
|
|
3636
3664
|
}
|
|
3637
3665
|
}
|
|
3638
|
-
if (r &&
|
|
3666
|
+
if (r && Aa.indexOf(r) !== -1)
|
|
3639
3667
|
return r;
|
|
3640
3668
|
if (e.format) {
|
|
3641
3669
|
if (e.format.startsWith("image/"))
|
|
@@ -3647,16 +3675,16 @@ function _t(e) {
|
|
|
3647
3675
|
}
|
|
3648
3676
|
return t && (t.endsWith(".jpg") || t.endsWith(".png") || t.endsWith(".jpeg")) ? "Image" : r || "unknown";
|
|
3649
3677
|
}
|
|
3650
|
-
const
|
|
3651
|
-
function
|
|
3652
|
-
const t = e.match(
|
|
3678
|
+
const xa = /http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;
|
|
3679
|
+
function wa(e) {
|
|
3680
|
+
const t = e.match(xa);
|
|
3653
3681
|
return t ? t[0] : e;
|
|
3654
3682
|
}
|
|
3655
|
-
function
|
|
3683
|
+
function Sa(e, t = "Rights/License", r = "none") {
|
|
3656
3684
|
let i = null;
|
|
3657
3685
|
const n = [], s = Array.isArray(e) ? e : [e];
|
|
3658
3686
|
for (const o of s) {
|
|
3659
|
-
const a = o ?
|
|
3687
|
+
const a = o ? wa(o) : void 0;
|
|
3660
3688
|
if (a && (a.indexOf("creativecommons.org") !== -1 || a.indexOf("rightsstatements.org") !== -1)) {
|
|
3661
3689
|
a.startsWith("https://") ? i = `http://${a.slice(8)}` : i = a;
|
|
3662
3690
|
continue;
|
|
@@ -3668,7 +3696,7 @@ function wa(e, t = "Rights/License", r = "none") {
|
|
|
3668
3696
|
}
|
|
3669
3697
|
return [i, n];
|
|
3670
3698
|
}
|
|
3671
|
-
const
|
|
3699
|
+
const Ca = [
|
|
3672
3700
|
"http://iiif.io/api/presentation/2/context.json",
|
|
3673
3701
|
"http://iiif.io/api/image/2/context.json",
|
|
3674
3702
|
"http://iiif.io/api/image/1/context.json",
|
|
@@ -3679,34 +3707,34 @@ const Sa = [
|
|
|
3679
3707
|
"http://iiif.io/api/auth/0/context.json",
|
|
3680
3708
|
"http://iiif.io/api/annex/openannotation/context.json"
|
|
3681
3709
|
];
|
|
3682
|
-
function
|
|
3710
|
+
function Ma(e) {
|
|
3683
3711
|
if (e) {
|
|
3684
3712
|
const t = Array.isArray(e) ? e : [e], r = [];
|
|
3685
3713
|
for (const i of t)
|
|
3686
|
-
i === "http://iiif.io/api/presentation/2/context.json" && r.push("http://iiif.io/api/presentation/3/context.json"),
|
|
3714
|
+
i === "http://iiif.io/api/presentation/2/context.json" && r.push("http://iiif.io/api/presentation/3/context.json"), Ca.indexOf(i) === -1 && r.push(i);
|
|
3687
3715
|
if (t.length)
|
|
3688
3716
|
return r.length === 1 ? r[0] : r;
|
|
3689
3717
|
}
|
|
3690
3718
|
}
|
|
3691
|
-
function
|
|
3719
|
+
function Ra(e) {
|
|
3692
3720
|
return e ? e.map((t) => ({
|
|
3693
3721
|
label: Ie(t.label),
|
|
3694
3722
|
value: Ie(t.value)
|
|
3695
3723
|
})) : [];
|
|
3696
3724
|
}
|
|
3697
|
-
let
|
|
3725
|
+
let pr = 0;
|
|
3698
3726
|
function Pi(e, t) {
|
|
3699
3727
|
const r = encodeURI(e.id || e["@id"] || "").trim();
|
|
3700
|
-
return r && t ? `${r}/${t}` : r || (
|
|
3728
|
+
return r && t ? `${r}/${t}` : r || (pr++, `http://example.org/${e["@type"]}${t ? `/${t}` : ""}/${pr}`);
|
|
3701
3729
|
}
|
|
3702
3730
|
function fe(e) {
|
|
3703
3731
|
const t = [...e.behavior || []];
|
|
3704
3732
|
e.viewingHint && t.push(e.viewingHint);
|
|
3705
3733
|
let r;
|
|
3706
|
-
return Array.isArray(e.motivation) ? r = e.motivation.map(
|
|
3707
|
-
"@context": e["@context"] ?
|
|
3734
|
+
return Array.isArray(e.motivation) ? r = e.motivation.map(fr) : e.motivation && (r = fr(e.motivation)), {
|
|
3735
|
+
"@context": e["@context"] ? Ma(e["@context"]) : void 0,
|
|
3708
3736
|
id: (e["@id"] || Pi(e)).trim(),
|
|
3709
|
-
type:
|
|
3737
|
+
type: Ut(e),
|
|
3710
3738
|
behavior: t.length ? t : void 0,
|
|
3711
3739
|
height: e.height ? e.height : void 0,
|
|
3712
3740
|
width: e.width ? e.width : void 0,
|
|
@@ -3719,24 +3747,24 @@ function fe(e) {
|
|
|
3719
3747
|
};
|
|
3720
3748
|
}
|
|
3721
3749
|
function pe(e) {
|
|
3722
|
-
const [t, r] =
|
|
3750
|
+
const [t, r] = Sa(e.license), i = [...e.metadata ? Ra(e.metadata) : [], ...r];
|
|
3723
3751
|
return {
|
|
3724
3752
|
rights: t,
|
|
3725
3753
|
metadata: i.length ? i : void 0,
|
|
3726
3754
|
label: e.label ? Ie(e.label) : void 0,
|
|
3727
3755
|
requiredStatement: e.attribution ? {
|
|
3728
|
-
label: Ie(
|
|
3756
|
+
label: Ie(kt.attributionLabel),
|
|
3729
3757
|
value: Ie(e.attribution)
|
|
3730
3758
|
} : void 0,
|
|
3731
3759
|
navDate: e.navDate,
|
|
3732
3760
|
summary: e.description ? Ie(e.description) : void 0,
|
|
3733
|
-
thumbnail:
|
|
3761
|
+
thumbnail: Ia(e.thumbnail)
|
|
3734
3762
|
};
|
|
3735
3763
|
}
|
|
3736
|
-
function
|
|
3764
|
+
function Ia(e) {
|
|
3737
3765
|
return e && (Array.isArray(e) ? e : [e]).map((t) => typeof t == "string" ? { id: t, type: "Image" } : (t.type === "unknown" && (t.type = "Image"), t));
|
|
3738
3766
|
}
|
|
3739
|
-
function
|
|
3767
|
+
function Ta(e) {
|
|
3740
3768
|
if (!e.within)
|
|
3741
3769
|
return;
|
|
3742
3770
|
const t = Array.isArray(e.within) ? e.within : [e.within], r = [];
|
|
@@ -3751,7 +3779,7 @@ function Ia(e) {
|
|
|
3751
3779
|
} else
|
|
3752
3780
|
i["@id"] && r.push({
|
|
3753
3781
|
id: i["@id"],
|
|
3754
|
-
type:
|
|
3782
|
+
type: Ut(i)
|
|
3755
3783
|
});
|
|
3756
3784
|
return r.length ? r : void 0;
|
|
3757
3785
|
}
|
|
@@ -3760,29 +3788,29 @@ function Ae(e) {
|
|
|
3760
3788
|
return {
|
|
3761
3789
|
provider: e.logo || t.length ? [
|
|
3762
3790
|
{
|
|
3763
|
-
id:
|
|
3791
|
+
id: kt.providerId,
|
|
3764
3792
|
type: "Agent",
|
|
3765
3793
|
homepage: t.length ? [t[0]] : void 0,
|
|
3766
3794
|
logo: e.logo ? Array.isArray(e.logo) ? e.logo : [e.logo] : void 0,
|
|
3767
|
-
label: Ie(
|
|
3795
|
+
label: Ie(kt.providerName)
|
|
3768
3796
|
}
|
|
3769
3797
|
] : void 0,
|
|
3770
|
-
partOf:
|
|
3798
|
+
partOf: Ta(e),
|
|
3771
3799
|
rendering: e.rendering,
|
|
3772
3800
|
seeAlso: e.seeAlso,
|
|
3773
3801
|
start: e.startCanvas,
|
|
3774
|
-
service: e.service ?
|
|
3802
|
+
service: e.service ? na(e.service) : void 0,
|
|
3775
3803
|
supplementary: r ? [r] : void 0
|
|
3776
3804
|
};
|
|
3777
3805
|
}
|
|
3778
|
-
function
|
|
3806
|
+
function ka(e) {
|
|
3779
3807
|
return {
|
|
3780
3808
|
chars: e.chars,
|
|
3781
3809
|
format: e.format ? e.format : void 0,
|
|
3782
3810
|
language: e.language
|
|
3783
3811
|
};
|
|
3784
3812
|
}
|
|
3785
|
-
function
|
|
3813
|
+
function Oa(e) {
|
|
3786
3814
|
return le({
|
|
3787
3815
|
...fe(e),
|
|
3788
3816
|
...pe(e),
|
|
@@ -3790,7 +3818,7 @@ function ka(e) {
|
|
|
3790
3818
|
items: e.members
|
|
3791
3819
|
});
|
|
3792
3820
|
}
|
|
3793
|
-
function
|
|
3821
|
+
function Ea(e) {
|
|
3794
3822
|
const t = [], r = [];
|
|
3795
3823
|
let i;
|
|
3796
3824
|
for (const s of e.sequences || [])
|
|
@@ -3805,7 +3833,7 @@ function Oa(e) {
|
|
|
3805
3833
|
structures: e.structures
|
|
3806
3834
|
});
|
|
3807
3835
|
}
|
|
3808
|
-
function
|
|
3836
|
+
function Pa(e) {
|
|
3809
3837
|
return le({
|
|
3810
3838
|
...fe(e),
|
|
3811
3839
|
...pe(e),
|
|
@@ -3820,7 +3848,7 @@ function Ea(e) {
|
|
|
3820
3848
|
] : void 0
|
|
3821
3849
|
});
|
|
3822
3850
|
}
|
|
3823
|
-
function
|
|
3851
|
+
function La(e) {
|
|
3824
3852
|
return le({
|
|
3825
3853
|
...fe(e),
|
|
3826
3854
|
...pe(e),
|
|
@@ -3828,7 +3856,7 @@ function Pa(e) {
|
|
|
3828
3856
|
items: e.resources && e.resources.length ? e.resources : void 0
|
|
3829
3857
|
});
|
|
3830
3858
|
}
|
|
3831
|
-
function
|
|
3859
|
+
function Fa(e) {
|
|
3832
3860
|
return !e.canvases || e.canvases.length === 0 ? {
|
|
3833
3861
|
canvases: [],
|
|
3834
3862
|
behavior: []
|
|
@@ -3838,7 +3866,7 @@ function La(e) {
|
|
|
3838
3866
|
startCanvas: e.startCanvas
|
|
3839
3867
|
};
|
|
3840
3868
|
}
|
|
3841
|
-
function
|
|
3869
|
+
function ja(e) {
|
|
3842
3870
|
function t(r) {
|
|
3843
3871
|
if (Array.isArray(r)) {
|
|
3844
3872
|
if (r.length > 1)
|
|
@@ -3860,7 +3888,7 @@ function Fa(e) {
|
|
|
3860
3888
|
return {
|
|
3861
3889
|
type: "SpecificResource",
|
|
3862
3890
|
source: i,
|
|
3863
|
-
selector:
|
|
3891
|
+
selector: Et(r.selector)
|
|
3864
3892
|
};
|
|
3865
3893
|
} else
|
|
3866
3894
|
return encodeURI(r["@id"]).trim();
|
|
@@ -3870,19 +3898,19 @@ function Fa(e) {
|
|
|
3870
3898
|
...pe(e),
|
|
3871
3899
|
...Ae(e),
|
|
3872
3900
|
target: t(e.on),
|
|
3873
|
-
body: Array.isArray(e.resource) ? e.resource.map(
|
|
3901
|
+
body: Array.isArray(e.resource) ? e.resource.map(Ot) : Ot(e.resource)
|
|
3874
3902
|
});
|
|
3875
3903
|
}
|
|
3876
|
-
function
|
|
3904
|
+
function Ot(e) {
|
|
3877
3905
|
const t = e;
|
|
3878
3906
|
return le({
|
|
3879
3907
|
...fe(t),
|
|
3880
3908
|
...pe(t),
|
|
3881
3909
|
...Ae(t),
|
|
3882
|
-
...
|
|
3910
|
+
...ka(t)
|
|
3883
3911
|
});
|
|
3884
3912
|
}
|
|
3885
|
-
function
|
|
3913
|
+
function $a(e) {
|
|
3886
3914
|
const t = [];
|
|
3887
3915
|
return e.default && e.default !== "rdf:nil" && t.push(e.default), e.item && e.item !== "rdf:nil" && t.push(...e.item), {
|
|
3888
3916
|
...fe(e),
|
|
@@ -3890,7 +3918,7 @@ function ja(e) {
|
|
|
3890
3918
|
items: t
|
|
3891
3919
|
};
|
|
3892
3920
|
}
|
|
3893
|
-
function
|
|
3921
|
+
function Da(e) {
|
|
3894
3922
|
return le({
|
|
3895
3923
|
...fe(e),
|
|
3896
3924
|
...pe(e),
|
|
@@ -3898,34 +3926,34 @@ function $a(e) {
|
|
|
3898
3926
|
items: e.members
|
|
3899
3927
|
});
|
|
3900
3928
|
}
|
|
3901
|
-
function
|
|
3929
|
+
function qa(e) {
|
|
3902
3930
|
const { "@id": t, "@type": r, "@context": i, profile: n, ...s } = e, o = {};
|
|
3903
|
-
return t && (o["@id"] = t), o["@type"] =
|
|
3931
|
+
return t && (o["@id"] = t), o["@type"] = Ut(e), o["@type"] === "unknown" && (i && i.length && (o["@context"] = i), o["@type"] = "Service"), n && (o.profile = Ei(n)), le({
|
|
3904
3932
|
...o,
|
|
3905
3933
|
...s
|
|
3906
3934
|
});
|
|
3907
3935
|
}
|
|
3908
|
-
function
|
|
3936
|
+
function _a(e) {
|
|
3909
3937
|
return le({
|
|
3910
3938
|
...fe(e),
|
|
3911
3939
|
...pe(e),
|
|
3912
3940
|
...Ae(e)
|
|
3913
3941
|
});
|
|
3914
3942
|
}
|
|
3915
|
-
new
|
|
3916
|
-
collection: [
|
|
3917
|
-
manifest: [
|
|
3918
|
-
canvas: [
|
|
3919
|
-
annotationList: [
|
|
3920
|
-
sequence: [
|
|
3921
|
-
annotation: [
|
|
3922
|
-
contentResource: [
|
|
3923
|
-
choice: [
|
|
3924
|
-
range: [
|
|
3925
|
-
service: [
|
|
3926
|
-
layer: [
|
|
3943
|
+
new _t({
|
|
3944
|
+
collection: [Oa],
|
|
3945
|
+
manifest: [Ea],
|
|
3946
|
+
canvas: [Pa],
|
|
3947
|
+
annotationList: [La],
|
|
3948
|
+
sequence: [Fa],
|
|
3949
|
+
annotation: [ja],
|
|
3950
|
+
contentResource: [Ot],
|
|
3951
|
+
choice: [$a],
|
|
3952
|
+
range: [Da],
|
|
3953
|
+
service: [qa],
|
|
3954
|
+
layer: [_a]
|
|
3927
3955
|
});
|
|
3928
|
-
function
|
|
3956
|
+
function Et(e) {
|
|
3929
3957
|
if ((Array.isArray(e["@type"]) && e["@type"].includes("oa:SvgSelector") || e["@type"] == "oa:SvgSelector") && ("chars" in e || "value" in e))
|
|
3930
3958
|
return {
|
|
3931
3959
|
type: "SvgSelector",
|
|
@@ -3938,9 +3966,9 @@ function Ot(e) {
|
|
|
3938
3966
|
};
|
|
3939
3967
|
if (e["@type"] === "oa:Choice")
|
|
3940
3968
|
return [
|
|
3941
|
-
|
|
3969
|
+
Et(e.default),
|
|
3942
3970
|
...(Array.isArray(e.item) ? e.item : [e.item]).map(
|
|
3943
|
-
|
|
3971
|
+
Et
|
|
3944
3972
|
)
|
|
3945
3973
|
];
|
|
3946
3974
|
if (e["@type"] == "iiif:ImageApiSelector")
|
|
@@ -3951,13 +3979,13 @@ function Ot(e) {
|
|
|
3951
3979
|
};
|
|
3952
3980
|
throw new Error(`Unsupported selector type: ${e["@type"]}`);
|
|
3953
3981
|
}
|
|
3954
|
-
var
|
|
3982
|
+
var dr = { exports: {} };
|
|
3955
3983
|
(function(e, t) {
|
|
3956
3984
|
var r = Object.defineProperty, i = (s, o, a) => o in s ? r(s, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : s[o] = a, n = (s, o, a) => (i(s, typeof o != "symbol" ? o + "" : o, a), a);
|
|
3957
3985
|
(function(s, o) {
|
|
3958
3986
|
o(t);
|
|
3959
|
-
})(
|
|
3960
|
-
const o = "http://library.stanford.edu/iiif/image-api/compliance.html#level1", a = "http://library.stanford.edu/iiif/image-api/compliance.html#level2", u = "http://library.stanford.edu/iiif/image-api/conformance.html#level1",
|
|
3987
|
+
})(jo, function(s) {
|
|
3988
|
+
const o = "http://library.stanford.edu/iiif/image-api/compliance.html#level1", a = "http://library.stanford.edu/iiif/image-api/compliance.html#level2", u = "http://library.stanford.edu/iiif/image-api/conformance.html#level1", f = "http://library.stanford.edu/iiif/image-api/conformance.html#level2", l = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1", d = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", v = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1", m = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2", h = "http://iiif.io/api/image/1/level1.json", g = "http://iiif.io/api/image/1/profiles/level1.json", b = "http://iiif.io/api/image/1/level2.json", A = "http://iiif.io/api/image/1/profiles/level2.json", w = "http://iiif.io/api/image/2/level1.json", C = "http://iiif.io/api/image/2/profiles/level1.json", T = "http://iiif.io/api/image/2/level2.json", j = "http://iiif.io/api/image/2/profiles/level2.json", I = "level1", L = "level2", P = "http://iiif.io/api/image/2/level1", M = "http://iiif.io/api/image/2/level2", $ = [P, M, o, a, u, f, l, d, v, m, h, g, b, A, w, C, T, j, I, L], ie = ["http://iiif.io/api/image/2/level0", P, M, "http://library.stanford.edu/iiif/image-api/compliance.html#level0", o, a, "http://library.stanford.edu/iiif/image-api/conformance.html#level0", u, f, "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0", l, d, "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0", v, m, "http://iiif.io/api/image/1/level0.json", "http://iiif.io/api/image/1/profiles/level0.json", h, g, b, A, "http://iiif.io/api/image/2/level0.json", "http://iiif.io/api/image/2/profiles/level0.json", w, C, T, j, "level0", I, L], Z = ["sc:Collection", "sc:Manifest", "sc:Canvas", "sc:AnnotationList", "oa:Annotation", "sc:Range", "sc:Layer", "sc:Sequence", "oa:Choice", "Service", "ContentResource"];
|
|
3961
3989
|
class U {
|
|
3962
3990
|
constructor(c, y = {}) {
|
|
3963
3991
|
n(this, "traversals"), n(this, "options"), this.traversals = { collection: [], manifest: [], canvas: [], annotationList: [], sequence: [], annotation: [], contentResource: [], choice: [], range: [], service: [], layer: [], ...c }, this.options = { convertPropsToArray: !0, mergeMemberProperties: !0, allowUndefinedReturn: !1, ...y };
|
|
@@ -4113,16 +4141,16 @@ var pr = { exports: {} };
|
|
|
4113
4141
|
}, c);
|
|
4114
4142
|
}
|
|
4115
4143
|
}
|
|
4116
|
-
function z(
|
|
4117
|
-
for (const c in
|
|
4118
|
-
|
|
4119
|
-
return
|
|
4144
|
+
function z(p) {
|
|
4145
|
+
for (const c in p)
|
|
4146
|
+
p[c] !== void 0 && p[c] !== null || delete p[c];
|
|
4147
|
+
return p;
|
|
4120
4148
|
}
|
|
4121
4149
|
const ee = "Attribution", ne = "http://example.org/provider", xe = "Unknown";
|
|
4122
|
-
function O(
|
|
4123
|
-
if (!
|
|
4150
|
+
function O(p, c = "none") {
|
|
4151
|
+
if (!p)
|
|
4124
4152
|
return {};
|
|
4125
|
-
const y = Array.isArray(
|
|
4153
|
+
const y = Array.isArray(p) ? p : [p], S = {};
|
|
4126
4154
|
for (const F of y) {
|
|
4127
4155
|
if (typeof F == "string") {
|
|
4128
4156
|
S[c] = S[c] ? S[c] : [], S[c].push(F || "");
|
|
@@ -4137,20 +4165,20 @@ var pr = { exports: {} };
|
|
|
4137
4165
|
}
|
|
4138
4166
|
return S;
|
|
4139
4167
|
}
|
|
4140
|
-
function W(
|
|
4141
|
-
return Array.isArray(
|
|
4168
|
+
function W(p) {
|
|
4169
|
+
return Array.isArray(p) ? W(p.find((c) => typeof c == "string")) : ie.indexOf(p) !== -1 ? "level2" : $.indexOf(p) !== -1 ? "level1" : typeof p == "string" ? p : void 0;
|
|
4142
4170
|
}
|
|
4143
|
-
function X(
|
|
4171
|
+
function X(p) {
|
|
4144
4172
|
for (const c of ["sc", "oa", "dcterms", "dctypes", "iiif"])
|
|
4145
|
-
if (
|
|
4146
|
-
return
|
|
4147
|
-
return
|
|
4173
|
+
if (p.startsWith(`${c}:`))
|
|
4174
|
+
return p.slice(c.length + 1);
|
|
4175
|
+
return p;
|
|
4148
4176
|
}
|
|
4149
4177
|
const de = ["Collection", "Manifest", "Annotation", "AnnotationPage", "Range", "Service"];
|
|
4150
|
-
function nt(
|
|
4151
|
-
const c =
|
|
4152
|
-
let y =
|
|
4153
|
-
const S =
|
|
4178
|
+
function nt(p) {
|
|
4179
|
+
const c = p["@id"] || p.id;
|
|
4180
|
+
let y = p["@type"] || p.type;
|
|
4181
|
+
const S = p.profile || void 0, F = p["@context"] || void 0;
|
|
4154
4182
|
if (S) {
|
|
4155
4183
|
const k = function(Y) {
|
|
4156
4184
|
switch (Y) {
|
|
@@ -4226,92 +4254,92 @@ var pr = { exports: {} };
|
|
|
4226
4254
|
}
|
|
4227
4255
|
if (y && de.indexOf(y) !== -1)
|
|
4228
4256
|
return y;
|
|
4229
|
-
if (
|
|
4230
|
-
if (
|
|
4257
|
+
if (p.format) {
|
|
4258
|
+
if (p.format.startsWith("image/"))
|
|
4231
4259
|
return "Image";
|
|
4232
|
-
if (
|
|
4260
|
+
if (p.format.startsWith("text/") || p.format === "application/pdf")
|
|
4233
4261
|
return "Text";
|
|
4234
|
-
if (
|
|
4262
|
+
if (p.format.startsWith("application/"))
|
|
4235
4263
|
return "Dataset";
|
|
4236
4264
|
}
|
|
4237
4265
|
return c && (c.endsWith(".jpg") || c.endsWith(".png") || c.endsWith(".jpeg")) ? "Image" : y || "unknown";
|
|
4238
4266
|
}
|
|
4239
4267
|
const Ki = /http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;
|
|
4240
|
-
function Zi(
|
|
4241
|
-
const c =
|
|
4242
|
-
return c ? c[0] :
|
|
4268
|
+
function Zi(p) {
|
|
4269
|
+
const c = p.match(Ki);
|
|
4270
|
+
return c ? c[0] : p;
|
|
4243
4271
|
}
|
|
4244
4272
|
const Xi = ["http://iiif.io/api/presentation/2/context.json", "http://iiif.io/api/image/2/context.json", "http://iiif.io/api/image/1/context.json", "http://library.stanford.edu/iiif/image-api/1.1/context.json", "http://iiif.io/api/search/1/context.json", "http://iiif.io/api/search/0/context.json", "http://iiif.io/api/auth/1/context.json", "http://iiif.io/api/auth/0/context.json", "http://iiif.io/api/annex/openannotation/context.json"];
|
|
4245
|
-
function en(
|
|
4246
|
-
if (
|
|
4247
|
-
const c = Array.isArray(
|
|
4273
|
+
function en(p) {
|
|
4274
|
+
if (p) {
|
|
4275
|
+
const c = Array.isArray(p) ? p : [p], y = [];
|
|
4248
4276
|
for (const S of c)
|
|
4249
4277
|
S === "http://iiif.io/api/presentation/2/context.json" && y.push("http://iiif.io/api/presentation/3/context.json"), Xi.indexOf(S) === -1 && y.push(S);
|
|
4250
4278
|
if (c.length)
|
|
4251
4279
|
return y.length === 1 ? y[0] : y;
|
|
4252
4280
|
}
|
|
4253
4281
|
}
|
|
4254
|
-
let
|
|
4255
|
-
function
|
|
4256
|
-
const y = encodeURI(
|
|
4257
|
-
return y && c ? `${y}/${c}` : y || (
|
|
4282
|
+
let zt = 0;
|
|
4283
|
+
function Wt(p, c) {
|
|
4284
|
+
const y = encodeURI(p.id || p["@id"] || "").trim();
|
|
4285
|
+
return y && c ? `${y}/${c}` : y || (zt++, `http://example.org/${p["@type"]}${c ? `/${c}` : ""}/${zt}`);
|
|
4258
4286
|
}
|
|
4259
|
-
function oe(
|
|
4260
|
-
const c = [...
|
|
4287
|
+
function oe(p) {
|
|
4288
|
+
const c = [...p.behavior || []];
|
|
4261
4289
|
let y;
|
|
4262
|
-
return
|
|
4290
|
+
return p.viewingHint && c.push(p.viewingHint), Array.isArray(p.motivation) ? y = p.motivation.map(X) : p.motivation && (y = X(p.motivation)), { "@context": p["@context"] ? en(p["@context"]) : void 0, id: (p["@id"] || Wt(p)).trim(), type: nt(p), behavior: c.length ? c : void 0, height: p.height ? p.height : void 0, width: p.width ? p.width : void 0, motivation: y, viewingDirection: p.viewingDirection, profile: p.profile, format: p.format ? p.format : void 0, duration: void 0, timeMode: void 0 };
|
|
4263
4291
|
}
|
|
4264
|
-
function ae(
|
|
4292
|
+
function ae(p) {
|
|
4265
4293
|
const [c, y] = function(k, Y = "Rights/License", Ue = "none") {
|
|
4266
4294
|
let Ve = null;
|
|
4267
|
-
const
|
|
4268
|
-
for (const
|
|
4269
|
-
const ye =
|
|
4270
|
-
!ye || ye.indexOf("creativecommons.org") === -1 && ye.indexOf("rightsstatements.org") === -1 ? ye &&
|
|
4295
|
+
const Qt = [], on = Array.isArray(k) ? k : [k];
|
|
4296
|
+
for (const Yt of on) {
|
|
4297
|
+
const ye = Yt ? Zi(Yt) : void 0;
|
|
4298
|
+
!ye || ye.indexOf("creativecommons.org") === -1 && ye.indexOf("rightsstatements.org") === -1 ? ye && Qt.push({ label: { [Ue]: [Y] }, value: { [Ue]: [ye] } }) : Ve = ye.startsWith("https://") ? `http://${ye.slice(8)}` : ye;
|
|
4271
4299
|
}
|
|
4272
|
-
return [Ve,
|
|
4273
|
-
}(
|
|
4300
|
+
return [Ve, Qt];
|
|
4301
|
+
}(p.license), S = [...p.metadata ? (F = p.metadata, F ? F.map((k) => ({ label: O(k.label), value: O(k.value) })) : []) : [], ...y];
|
|
4274
4302
|
var F;
|
|
4275
|
-
return { rights: c, metadata: S.length ? S : void 0, label:
|
|
4303
|
+
return { rights: c, metadata: S.length ? S : void 0, label: p.label ? O(p.label) : void 0, requiredStatement: p.attribution ? { label: O(ee), value: O(p.attribution) } : void 0, navDate: p.navDate, summary: p.description ? O(p.description) : void 0, thumbnail: tn(p.thumbnail) };
|
|
4276
4304
|
}
|
|
4277
|
-
function tn(
|
|
4278
|
-
return
|
|
4305
|
+
function tn(p) {
|
|
4306
|
+
return p && (Array.isArray(p) ? p : [p]).map((c) => typeof c == "string" ? { id: c, type: "Image" } : (c.type === "unknown" && (c.type = "Image"), c));
|
|
4279
4307
|
}
|
|
4280
|
-
function rn(
|
|
4281
|
-
if (!
|
|
4308
|
+
function rn(p) {
|
|
4309
|
+
if (!p.within)
|
|
4282
4310
|
return;
|
|
4283
|
-
const c = Array.isArray(
|
|
4311
|
+
const c = Array.isArray(p.within) ? p.within : [p.within], y = [];
|
|
4284
4312
|
for (const S of c)
|
|
4285
|
-
typeof S == "string" ? S &&
|
|
4313
|
+
typeof S == "string" ? S && p["@type"] === "sc:Manifest" && y.push({ id: S, type: "Collection" }) : S["@id"] && y.push({ id: S["@id"], type: nt(S) });
|
|
4286
4314
|
return y.length ? y : void 0;
|
|
4287
4315
|
}
|
|
4288
|
-
function he(
|
|
4289
|
-
const c =
|
|
4290
|
-
return { provider:
|
|
4316
|
+
function he(p) {
|
|
4317
|
+
const c = p.related ? Array.isArray(p.related) ? p.related : [p.related] : [], y = p.contentLayer;
|
|
4318
|
+
return { provider: p.logo || c.length ? [{ id: ne, type: "Agent", homepage: c.length ? [c[0]] : void 0, logo: p.logo ? Array.isArray(p.logo) ? p.logo : [p.logo] : void 0, label: O(xe) }] : void 0, partOf: rn(p), rendering: p.rendering, seeAlso: p.seeAlso, start: p.startCanvas, service: p.service ? (S = p.service, Array.isArray(S) ? S : S ? [S] : []) : void 0, supplementary: y ? [y] : void 0 };
|
|
4291
4319
|
var S;
|
|
4292
4320
|
}
|
|
4293
|
-
function st(
|
|
4294
|
-
const c =
|
|
4321
|
+
function st(p) {
|
|
4322
|
+
const c = p;
|
|
4295
4323
|
return z({ ...oe(c), ...ae(c), ...he(c), ...(y = c, { chars: y.chars, format: y.format ? y.format : void 0, language: y.language }) });
|
|
4296
4324
|
var y;
|
|
4297
4325
|
}
|
|
4298
|
-
const nn = new U({ collection: [function(
|
|
4299
|
-
return z({ ...oe(
|
|
4300
|
-
}], manifest: [function(
|
|
4326
|
+
const nn = new U({ collection: [function(p) {
|
|
4327
|
+
return z({ ...oe(p), ...ae(p), ...he(p), items: p.members });
|
|
4328
|
+
}], manifest: [function(p) {
|
|
4301
4329
|
const c = [], y = [];
|
|
4302
4330
|
let S;
|
|
4303
|
-
for (const k of
|
|
4331
|
+
for (const k of p.sequences || [])
|
|
4304
4332
|
k.canvases.length && c.push(...k.canvases), k.behavior && y.push(...k.behavior), k.startCanvas && (S = k.startCanvas);
|
|
4305
|
-
const F = oe(
|
|
4306
|
-
return y.length && (F.behavior ? F.behavior.push(...y) : F.behavior = y), z({ ...F, ...ae(
|
|
4307
|
-
}], canvas: [function(
|
|
4308
|
-
return z({ ...oe(
|
|
4309
|
-
}], annotationList: [function(
|
|
4310
|
-
return z({ ...oe(
|
|
4311
|
-
}], sequence: [function(
|
|
4312
|
-
return
|
|
4313
|
-
}], annotation: [function(
|
|
4314
|
-
return z({ ...oe(
|
|
4333
|
+
const F = oe(p);
|
|
4334
|
+
return y.length && (F.behavior ? F.behavior.push(...y) : F.behavior = y), z({ ...F, ...ae(p), ...he(p), start: S, items: c, structures: p.structures });
|
|
4335
|
+
}], canvas: [function(p) {
|
|
4336
|
+
return z({ ...oe(p), ...ae(p), ...he(p), annotations: p.otherContent && p.otherContent.length ? p.otherContent : void 0, items: p.images && p.images.length ? [{ id: Wt(p, "annotation-page"), type: "AnnotationPage", items: p.images }] : void 0 });
|
|
4337
|
+
}], annotationList: [function(p) {
|
|
4338
|
+
return z({ ...oe(p), ...ae(p), ...he(p), items: p.resources && p.resources.length ? p.resources : void 0 });
|
|
4339
|
+
}], sequence: [function(p) {
|
|
4340
|
+
return p.canvases && p.canvases.length !== 0 ? { canvases: p.canvases, behavior: p.viewingHint ? [p.viewingHint] : [], startCanvas: p.startCanvas } : { canvases: [], behavior: [] };
|
|
4341
|
+
}], annotation: [function(p) {
|
|
4342
|
+
return z({ ...oe(p), ...ae(p), ...he(p), target: function c(y) {
|
|
4315
4343
|
if (Array.isArray(y)) {
|
|
4316
4344
|
if (y.length > 1)
|
|
4317
4345
|
return { type: "List", items: y.map(c) };
|
|
@@ -4333,36 +4361,36 @@ var pr = { exports: {} };
|
|
|
4333
4361
|
return { type: "SpecificResource", source: S, selector: ot(y.selector) };
|
|
4334
4362
|
}
|
|
4335
4363
|
return encodeURI(y["@id"]).trim();
|
|
4336
|
-
}(
|
|
4337
|
-
}], contentResource: [st], choice: [function(
|
|
4364
|
+
}(p.on), body: Array.isArray(p.resource) ? p.resource.map(st) : st(p.resource) });
|
|
4365
|
+
}], contentResource: [st], choice: [function(p) {
|
|
4338
4366
|
const c = [];
|
|
4339
|
-
return
|
|
4340
|
-
}], range: [function(
|
|
4341
|
-
return z({ ...oe(
|
|
4342
|
-
}], service: [function(
|
|
4343
|
-
const { "@id": c, "@type": y, "@context": S, profile: F, ...k } =
|
|
4344
|
-
return c && (Y["@id"] = c), Y["@type"] = nt(
|
|
4345
|
-
}], layer: [function(
|
|
4346
|
-
return z({ ...oe(
|
|
4367
|
+
return p.default && p.default !== "rdf:nil" && c.push(p.default), p.item && p.item !== "rdf:nil" && c.push(...p.item), { ...oe(p), ...ae(p), items: c };
|
|
4368
|
+
}], range: [function(p) {
|
|
4369
|
+
return z({ ...oe(p), ...ae(p), ...he(p), items: p.members });
|
|
4370
|
+
}], service: [function(p) {
|
|
4371
|
+
const { "@id": c, "@type": y, "@context": S, profile: F, ...k } = p, Y = {};
|
|
4372
|
+
return c && (Y["@id"] = c), Y["@type"] = nt(p), Y["@type"] === "unknown" && (S && S.length && (Y["@context"] = S), Y["@type"] = "Service"), F && (Y.profile = W(F)), z({ ...Y, ...k });
|
|
4373
|
+
}], layer: [function(p) {
|
|
4374
|
+
return z({ ...oe(p), ...ae(p), ...he(p) });
|
|
4347
4375
|
}] });
|
|
4348
|
-
function ot(
|
|
4349
|
-
if ((Array.isArray(
|
|
4350
|
-
return { type: "SvgSelector", value: "chars" in
|
|
4351
|
-
if (
|
|
4352
|
-
return { type: "FragmentSelector", value:
|
|
4353
|
-
if (
|
|
4354
|
-
return [ot(
|
|
4355
|
-
if (
|
|
4356
|
-
return { type: "ImageApiSelector", region: "region" in
|
|
4357
|
-
throw new Error(`Unsupported selector type: ${
|
|
4376
|
+
function ot(p) {
|
|
4377
|
+
if ((Array.isArray(p["@type"]) && p["@type"].includes("oa:SvgSelector") || p["@type"] == "oa:SvgSelector") && ("chars" in p || "value" in p))
|
|
4378
|
+
return { type: "SvgSelector", value: "chars" in p ? p.chars : p.value };
|
|
4379
|
+
if (p["@type"] === "oa:FragmentSelector")
|
|
4380
|
+
return { type: "FragmentSelector", value: p.value };
|
|
4381
|
+
if (p["@type"] === "oa:Choice")
|
|
4382
|
+
return [ot(p.default), ...(Array.isArray(p.item) ? p.item : [p.item]).map(ot)];
|
|
4383
|
+
if (p["@type"] == "iiif:ImageApiSelector")
|
|
4384
|
+
return { type: "ImageApiSelector", region: "region" in p ? p.region : void 0, rotation: "rotation" in p ? p.rotation : void 0 };
|
|
4385
|
+
throw new Error(`Unsupported selector type: ${p["@type"]}`);
|
|
4358
4386
|
}
|
|
4359
|
-
const sn = function(
|
|
4360
|
-
return
|
|
4387
|
+
const sn = function(p) {
|
|
4388
|
+
return p && p["@context"] && (p["@context"] === "http://iiif.io/api/presentation/2/context.json" || p["@context"].indexOf("http://iiif.io/api/presentation/2/context.json") !== -1 || p["@context"] === "http://www.shared-canvas.org/ns/context.json") || p["@context"] === "http://iiif.io/api/image/2/context.json" ? nn.traverseUnknown(p) : p;
|
|
4361
4389
|
};
|
|
4362
4390
|
s.upgrade = sn, Object.defineProperties(s, { __esModule: { value: !0 }, [Symbol.toStringTag]: { value: "Module" } });
|
|
4363
4391
|
});
|
|
4364
|
-
})(
|
|
4365
|
-
function
|
|
4392
|
+
})(dr, dr.exports);
|
|
4393
|
+
function Ec(e) {
|
|
4366
4394
|
return e.type === "SpecificResource" ? [e.source, { selector: e.selector }] : [e, { selector: null }];
|
|
4367
4395
|
}
|
|
4368
4396
|
function Li(e, t) {
|
|
@@ -4387,16 +4415,16 @@ function Li(e, t) {
|
|
|
4387
4415
|
i
|
|
4388
4416
|
];
|
|
4389
4417
|
}
|
|
4390
|
-
const
|
|
4418
|
+
const Ua = {
|
|
4391
4419
|
makeChoice: () => {
|
|
4392
4420
|
}
|
|
4393
|
-
}, gt = { type: "unknown" }, _ = (e) => ({ type: "unknown", reason: e, annotations: { pages: [] } }),
|
|
4394
|
-
function
|
|
4421
|
+
}, gt = { type: "unknown" }, _ = (e) => ({ type: "unknown", reason: e, annotations: { pages: [] } }), Va = (e, t) => ({ type: "empty", width: e, height: t, annotations: { pages: [] }, image: null, images: [] });
|
|
4422
|
+
function Na(e, t) {
|
|
4395
4423
|
var i;
|
|
4396
4424
|
const r = (i = e == null ? void 0 : e.iiif) == null ? void 0 : i.meta[t];
|
|
4397
4425
|
return r ? r.annotationPageManager : null;
|
|
4398
4426
|
}
|
|
4399
|
-
function
|
|
4427
|
+
function Ha(e, t) {
|
|
4400
4428
|
return Q(
|
|
4401
4429
|
(r) => {
|
|
4402
4430
|
const i = [];
|
|
@@ -4405,7 +4433,7 @@ function Na(e, t) {
|
|
|
4405
4433
|
const n = Object.keys(r.iiif.entities.AnnotationPage);
|
|
4406
4434
|
for (const s of n)
|
|
4407
4435
|
if (!t || t.indexOf(s) !== -1) {
|
|
4408
|
-
const o =
|
|
4436
|
+
const o = Na(r, s);
|
|
4409
4437
|
o && o.views && o.views[e] && i.push(s);
|
|
4410
4438
|
}
|
|
4411
4439
|
return i;
|
|
@@ -4413,7 +4441,7 @@ function Na(e, t) {
|
|
|
4413
4441
|
[e, t]
|
|
4414
4442
|
);
|
|
4415
4443
|
}
|
|
4416
|
-
function
|
|
4444
|
+
function Ba({
|
|
4417
4445
|
canvas: e,
|
|
4418
4446
|
manifest: t,
|
|
4419
4447
|
all: r,
|
|
@@ -4433,37 +4461,37 @@ function Ha({
|
|
|
4433
4461
|
n.indexOf(s.id) === -1 && n.push(s.id);
|
|
4434
4462
|
return n;
|
|
4435
4463
|
}
|
|
4436
|
-
function
|
|
4464
|
+
function za(e, t) {
|
|
4437
4465
|
var i;
|
|
4438
4466
|
const r = (i = e == null ? void 0 : e.iiif) == null ? void 0 : i.meta[t];
|
|
4439
4467
|
return r ? r.annotationPageManager : null;
|
|
4440
4468
|
}
|
|
4441
|
-
function
|
|
4442
|
-
const r = V(), i = ke(), n = ue(), s = Br(), o = E(() =>
|
|
4469
|
+
function Wa(e, t = {}) {
|
|
4470
|
+
const r = V(), i = ke(), n = ue(), s = Br(), o = E(() => Ba({
|
|
4443
4471
|
all: t.all,
|
|
4444
4472
|
manifest: i,
|
|
4445
4473
|
canvas: n,
|
|
4446
4474
|
canvases: s
|
|
4447
|
-
}), [t.all, n, s, i]), a =
|
|
4475
|
+
}), [t.all, n, s, i]), a = Ha(e, t.all ? void 0 : o), u = D(
|
|
4448
4476
|
(l) => {
|
|
4449
4477
|
e && r.setMetaValue(
|
|
4450
4478
|
[l, "annotationPageManager", "views"],
|
|
4451
|
-
(
|
|
4452
|
-
...
|
|
4479
|
+
(d) => d && !d[e] ? d : {
|
|
4480
|
+
...d || {},
|
|
4453
4481
|
[e]: !1
|
|
4454
4482
|
}
|
|
4455
4483
|
);
|
|
4456
4484
|
},
|
|
4457
4485
|
[e, r]
|
|
4458
|
-
),
|
|
4459
|
-
(l,
|
|
4486
|
+
), f = D(
|
|
4487
|
+
(l, d = {}) => {
|
|
4460
4488
|
if (!e)
|
|
4461
4489
|
return;
|
|
4462
4490
|
const v = r.getState(), m = [];
|
|
4463
|
-
if (
|
|
4491
|
+
if (d != null && d.deselectOthers) {
|
|
4464
4492
|
const h = Object.keys(v.iiif.entities.AnnotationPage);
|
|
4465
4493
|
for (const g of h) {
|
|
4466
|
-
const b =
|
|
4494
|
+
const b = za(v, g);
|
|
4467
4495
|
b && b.views && b.views[e] && m.push(g);
|
|
4468
4496
|
}
|
|
4469
4497
|
}
|
|
@@ -4482,31 +4510,31 @@ function za(e, t = {}) {
|
|
|
4482
4510
|
return {
|
|
4483
4511
|
availablePageIds: o,
|
|
4484
4512
|
enabledPageIds: a,
|
|
4485
|
-
setPageEnabled:
|
|
4513
|
+
setPageEnabled: f,
|
|
4486
4514
|
setPageDisabled: u
|
|
4487
4515
|
};
|
|
4488
4516
|
}
|
|
4489
|
-
function
|
|
4517
|
+
function Qa(e, t) {
|
|
4490
4518
|
return Q((r, i) => i.get(e.map((n) => ({ id: n, type: t }))), [e, t]);
|
|
4491
4519
|
}
|
|
4492
|
-
const
|
|
4493
|
-
function
|
|
4494
|
-
return H(
|
|
4520
|
+
const Ya = me.createContext(new mr());
|
|
4521
|
+
function Vt() {
|
|
4522
|
+
return H(Ya);
|
|
4495
4523
|
}
|
|
4496
|
-
function
|
|
4497
|
-
const e =
|
|
4524
|
+
function Ga() {
|
|
4525
|
+
const e = Vt(), [t, r] = B({}), i = ge(!1);
|
|
4498
4526
|
return K(() => () => {
|
|
4499
4527
|
i.current = !0;
|
|
4500
4528
|
}, []), [D(
|
|
4501
4529
|
(s, { height: o, width: a }) => {
|
|
4502
4530
|
if (s) {
|
|
4503
|
-
const u = s.id || s["@id"],
|
|
4531
|
+
const u = s.id || s["@id"], f = e.loadServiceSync({
|
|
4504
4532
|
id: u,
|
|
4505
4533
|
width: s.width || a,
|
|
4506
4534
|
height: s.height || o,
|
|
4507
4535
|
source: s
|
|
4508
4536
|
});
|
|
4509
|
-
|
|
4537
|
+
f ? s = f : t[u] || (i.current || r((l) => ({
|
|
4510
4538
|
...l,
|
|
4511
4539
|
[u]: "loading"
|
|
4512
4540
|
})), e.loadService({
|
|
@@ -4525,7 +4553,7 @@ function Ya() {
|
|
|
4525
4553
|
[e, t]
|
|
4526
4554
|
), t];
|
|
4527
4555
|
}
|
|
4528
|
-
function
|
|
4556
|
+
function Nt(e = {}) {
|
|
4529
4557
|
const t = si(), r = ue(e.canvasId ? { id: e.canvasId } : void 0);
|
|
4530
4558
|
return Q(
|
|
4531
4559
|
(i, n) => {
|
|
@@ -4541,7 +4569,7 @@ function Vt(e = {}) {
|
|
|
4541
4569
|
[r]
|
|
4542
4570
|
);
|
|
4543
4571
|
}
|
|
4544
|
-
function
|
|
4572
|
+
function Ja(e) {
|
|
4545
4573
|
return e.type === "SpecificResource" ? [e.source, { selector: e.selector }] : [e, { selector: null }];
|
|
4546
4574
|
}
|
|
4547
4575
|
const ze = {}, Fi = {
|
|
@@ -4564,7 +4592,7 @@ const ze = {}, Fi = {
|
|
|
4564
4592
|
return t ? r[t] : r;
|
|
4565
4593
|
}
|
|
4566
4594
|
};
|
|
4567
|
-
function
|
|
4595
|
+
function Ka(e = Fi) {
|
|
4568
4596
|
function t(n) {
|
|
4569
4597
|
const s = n ? typeof n == "string" ? e.get(n) : n : null;
|
|
4570
4598
|
if (!s)
|
|
@@ -4577,13 +4605,13 @@ function Ja(e = Fi) {
|
|
|
4577
4605
|
function r(n, s = []) {
|
|
4578
4606
|
const o = Array.isArray(n) ? n : t(n), a = [];
|
|
4579
4607
|
let u = null;
|
|
4580
|
-
const
|
|
4608
|
+
const f = [];
|
|
4581
4609
|
for (const l of o) {
|
|
4582
4610
|
if (l.type !== "Annotation")
|
|
4583
4611
|
throw new Error("getPaintables() accept either a canvas or list of annotations");
|
|
4584
|
-
const
|
|
4585
|
-
for (const v of
|
|
4586
|
-
const [m, { selector: h }] =
|
|
4612
|
+
const d = Array.from(Array.isArray(l.body) ? l.body : [l.body]);
|
|
4613
|
+
for (const v of d) {
|
|
4614
|
+
const [m, { selector: h }] = Ja(v), g = e.get(m), b = (g.type || "unknown").toLowerCase();
|
|
4587
4615
|
if (b === "choice") {
|
|
4588
4616
|
const A = e.get(g.items, { parent: g.id }), w = s.length ? s.map((C) => A.find((T) => T.id === C)).filter(Boolean) : [A[0]];
|
|
4589
4617
|
w.length === 0 && w.push(A[0]), u = {
|
|
@@ -4594,10 +4622,10 @@ function Ja(e = Fi) {
|
|
|
4594
4622
|
selected: w.indexOf(C) !== -1
|
|
4595
4623
|
})),
|
|
4596
4624
|
label: m.label
|
|
4597
|
-
},
|
|
4625
|
+
}, d.push(...w);
|
|
4598
4626
|
continue;
|
|
4599
4627
|
}
|
|
4600
|
-
a.indexOf(b) === -1 && a.push(b),
|
|
4628
|
+
a.indexOf(b) === -1 && a.push(b), f.push({
|
|
4601
4629
|
type: b,
|
|
4602
4630
|
annotationId: l.id,
|
|
4603
4631
|
resource: g,
|
|
@@ -4608,7 +4636,7 @@ function Ja(e = Fi) {
|
|
|
4608
4636
|
}
|
|
4609
4637
|
return {
|
|
4610
4638
|
types: a,
|
|
4611
|
-
items:
|
|
4639
|
+
items: f,
|
|
4612
4640
|
choice: u
|
|
4613
4641
|
};
|
|
4614
4642
|
}
|
|
@@ -4622,12 +4650,12 @@ function Ja(e = Fi) {
|
|
|
4622
4650
|
extractChoices: i
|
|
4623
4651
|
};
|
|
4624
4652
|
}
|
|
4625
|
-
function
|
|
4626
|
-
const r = V(), i = E(() =>
|
|
4653
|
+
function Za(e, t = []) {
|
|
4654
|
+
const r = V(), i = E(() => Ka(r), []), n = Nt({ enableSingleAnnotation: e == null ? void 0 : e.enableSingleAnnotation }), [s, o] = B((e == null ? void 0 : e.defaultChoices) || []), a = E(
|
|
4627
4655
|
() => i.getPaintables(n, s),
|
|
4628
4656
|
[r, n, s, ...t]
|
|
4629
|
-
),
|
|
4630
|
-
(l, { deselectOthers:
|
|
4657
|
+
), f = { makeChoice: D(
|
|
4658
|
+
(l, { deselectOthers: d = !0, deselect: v = !1 } = {}) => {
|
|
4631
4659
|
if (a.choice) {
|
|
4632
4660
|
if (a.choice.type !== "single-choice")
|
|
4633
4661
|
throw new Error("Complex choice not supported yet");
|
|
@@ -4640,7 +4668,7 @@ function Ka(e, t = []) {
|
|
|
4640
4668
|
}
|
|
4641
4669
|
return g;
|
|
4642
4670
|
}
|
|
4643
|
-
if (
|
|
4671
|
+
if (d)
|
|
4644
4672
|
return [l];
|
|
4645
4673
|
const h = [...m];
|
|
4646
4674
|
if (h.length === 0 && a.items.length) {
|
|
@@ -4653,9 +4681,9 @@ function Ka(e, t = []) {
|
|
|
4653
4681
|
},
|
|
4654
4682
|
[a.choice]
|
|
4655
4683
|
) };
|
|
4656
|
-
return [a,
|
|
4684
|
+
return [a, f];
|
|
4657
4685
|
}
|
|
4658
|
-
function
|
|
4686
|
+
function Xa(e, t, r) {
|
|
4659
4687
|
const i = [];
|
|
4660
4688
|
for (const n of t.items) {
|
|
4661
4689
|
const s = n.resource && n.resource.type === "SpecificResource" ? n.resource.source : n.resource;
|
|
@@ -4674,8 +4702,8 @@ function Za(e, t, r) {
|
|
|
4674
4702
|
width: Number(e.width),
|
|
4675
4703
|
height: Number(e.height)
|
|
4676
4704
|
}
|
|
4677
|
-
}, [u,
|
|
4678
|
-
if (
|
|
4705
|
+
}, [u, f] = Li(e, n.target);
|
|
4706
|
+
if (f.id !== e.id)
|
|
4679
4707
|
continue;
|
|
4680
4708
|
n.resource.width && n.resource.height && (n.resource.width, n.resource.height);
|
|
4681
4709
|
let l = n.resource.type === "SpecificResource" ? Re(n.resource) : null;
|
|
@@ -4687,7 +4715,7 @@ function Za(e, t, r) {
|
|
|
4687
4715
|
});
|
|
4688
4716
|
m && (l = m);
|
|
4689
4717
|
}
|
|
4690
|
-
const
|
|
4718
|
+
const d = l && l.selector && (l.selector.type === "BoxSelector" || l.selector.type === "TemporalBoxSelector") ? {
|
|
4691
4719
|
type: "BoxSelector",
|
|
4692
4720
|
spatial: {
|
|
4693
4721
|
x: l.selector.spatial.x,
|
|
@@ -4701,12 +4729,12 @@ function Za(e, t, r) {
|
|
|
4701
4729
|
id: s.id,
|
|
4702
4730
|
type: "Image",
|
|
4703
4731
|
annotationId: n.annotationId,
|
|
4704
|
-
width: Number(u ||
|
|
4705
|
-
height: Number(u ||
|
|
4732
|
+
width: Number(u || d ? s.width : e.width),
|
|
4733
|
+
height: Number(u || d ? s.height : e.height),
|
|
4706
4734
|
service: o,
|
|
4707
4735
|
sizes: o && o.sizes ? o.sizes : s.width && s.height ? [{ width: s.width, height: s.height }] : [],
|
|
4708
4736
|
target: u && u.type !== "PointSelector" ? u : a,
|
|
4709
|
-
selector:
|
|
4737
|
+
selector: d
|
|
4710
4738
|
};
|
|
4711
4739
|
i.push(v);
|
|
4712
4740
|
}
|
|
@@ -4717,15 +4745,15 @@ function Za(e, t, r) {
|
|
|
4717
4745
|
choice: t.choice
|
|
4718
4746
|
};
|
|
4719
4747
|
}
|
|
4720
|
-
const
|
|
4721
|
-
function
|
|
4748
|
+
const ec = ["model/gltf-binary"];
|
|
4749
|
+
function tc(e, t) {
|
|
4722
4750
|
const i = t.items[0].resource;
|
|
4723
|
-
return i.format ?
|
|
4751
|
+
return i.format ? ec.indexOf(i.format) === -1 ? _(`3D format: ${i.format} is unsupported`) : {
|
|
4724
4752
|
type: "3d-model",
|
|
4725
4753
|
model: i
|
|
4726
4754
|
} : _("Unknown format");
|
|
4727
4755
|
}
|
|
4728
|
-
function
|
|
4756
|
+
function rc(e, t) {
|
|
4729
4757
|
var i;
|
|
4730
4758
|
if (!e.duration)
|
|
4731
4759
|
return _("No duration on canvas");
|
|
@@ -4760,8 +4788,8 @@ function tc(e, t) {
|
|
|
4760
4788
|
}
|
|
4761
4789
|
} : _("Audio does not have format") : _("Unknown audio");
|
|
4762
4790
|
}
|
|
4763
|
-
const
|
|
4764
|
-
function
|
|
4791
|
+
const ic = /^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?vi?=|&vi?=))([^#&?]*).*/;
|
|
4792
|
+
function nc(e, t) {
|
|
4765
4793
|
var o;
|
|
4766
4794
|
const r = t.items.filter((a) => a.type === "video");
|
|
4767
4795
|
if (!e.duration)
|
|
@@ -4799,7 +4827,7 @@ function ic(e, t) {
|
|
|
4799
4827
|
};
|
|
4800
4828
|
if (n) {
|
|
4801
4829
|
s.type = "VideoYouTube";
|
|
4802
|
-
const a = i.id.match(
|
|
4830
|
+
const a = i.id.match(ic);
|
|
4803
4831
|
if (!a[1])
|
|
4804
4832
|
return _("Video is not known youtube video");
|
|
4805
4833
|
s.youTubeId = a[1];
|
|
@@ -4826,7 +4854,7 @@ function ji(e, t = {}, r) {
|
|
|
4826
4854
|
}
|
|
4827
4855
|
return t;
|
|
4828
4856
|
}
|
|
4829
|
-
function
|
|
4857
|
+
function sc(e, t) {
|
|
4830
4858
|
const r = [];
|
|
4831
4859
|
return t.items.forEach((i) => {
|
|
4832
4860
|
if (i.resource) {
|
|
@@ -4838,37 +4866,37 @@ function nc(e, t) {
|
|
|
4838
4866
|
items: r
|
|
4839
4867
|
};
|
|
4840
4868
|
}
|
|
4841
|
-
function
|
|
4842
|
-
const t = ke(), r = ue(), i = V(), [n, s] =
|
|
4869
|
+
function oc(e) {
|
|
4870
|
+
const t = ke(), r = ue(), i = V(), [n, s] = Ga(), { enabledPageIds: o } = Wa((e == null ? void 0 : e.annotationPageManagerId) || (t == null ? void 0 : t.id) || (r == null ? void 0 : r.id), {
|
|
4843
4871
|
all: !1
|
|
4844
|
-
}), a =
|
|
4872
|
+
}), a = Qa(o, "AnnotationPage"), u = (e == null ? void 0 : e.strategies) || [
|
|
4845
4873
|
"empty",
|
|
4846
4874
|
"images",
|
|
4847
4875
|
"media",
|
|
4848
4876
|
"textual-content",
|
|
4849
4877
|
"complex-timeline"
|
|
4850
|
-
], [
|
|
4878
|
+
], [f, l] = Za(e, [s]), d = E(() => {
|
|
4851
4879
|
if (!r)
|
|
4852
4880
|
return console.log("No canvas"), gt;
|
|
4853
|
-
if (
|
|
4854
|
-
return u.indexOf("empty") !== -1 ?
|
|
4855
|
-
if (
|
|
4856
|
-
if (
|
|
4857
|
-
|
|
4881
|
+
if (f.types.length === 0)
|
|
4882
|
+
return u.indexOf("empty") !== -1 ? Va(r.width, r.height) : (console.log("No paintables"), gt);
|
|
4883
|
+
if (f.types.length !== 1)
|
|
4884
|
+
if (f.types.length === 2 && f.types.indexOf("text") !== -1)
|
|
4885
|
+
f.types = f.types.filter((m) => m !== "text");
|
|
4858
4886
|
else
|
|
4859
4887
|
return u.indexOf("complex-timeline") === -1 ? _("Complex timeline not supported") : _("ComplexTimelineStrategy not yet supported");
|
|
4860
|
-
const v =
|
|
4861
|
-
return v === "image" ? u.indexOf("images") === -1 ? _("Image not supported") :
|
|
4862
|
-
}, [r,
|
|
4863
|
-
return E(() =>
|
|
4888
|
+
const v = f.types[0];
|
|
4889
|
+
return v === "image" ? u.indexOf("images") === -1 ? _("Image not supported") : Xa(r, f, n) : v === "Model" || v === "model" ? u.indexOf("3d-model") === -1 ? _("3D not supported") : tc(r, f) : v === "textualbody" ? u.indexOf("textual-content") === -1 ? _("Textual content not supported") : sc(r, f) : v === "sound" || v === "audio" ? u.indexOf("media") === -1 ? _("Media not supported") : rc(r, f) : v === "video" ? u.indexOf("media") === -1 ? _("Media not supported") : nc(r, f) : (console.log("No idea"), gt);
|
|
4890
|
+
}, [r, f, i, l.makeChoice]);
|
|
4891
|
+
return E(() => d.type === "unknown" ? [d, Ua] : [
|
|
4864
4892
|
{
|
|
4865
|
-
...
|
|
4893
|
+
...d,
|
|
4866
4894
|
annotations: { pages: a }
|
|
4867
4895
|
},
|
|
4868
4896
|
l
|
|
4869
|
-
], [
|
|
4897
|
+
], [d, a]);
|
|
4870
4898
|
}
|
|
4871
|
-
const
|
|
4899
|
+
const ac = (e, t = []) => {
|
|
4872
4900
|
const r = V();
|
|
4873
4901
|
K(() => {
|
|
4874
4902
|
e(r);
|
|
@@ -4892,52 +4920,52 @@ const oc = (e, t = []) => {
|
|
|
4892
4920
|
if (r)
|
|
4893
4921
|
return t ? r[t] : r;
|
|
4894
4922
|
}
|
|
4895
|
-
},
|
|
4896
|
-
function
|
|
4897
|
-
const r = t.imageServiceLoader ||
|
|
4923
|
+
}, cc = new mr();
|
|
4924
|
+
function uc(e = $i, t = {}) {
|
|
4925
|
+
const r = t.imageServiceLoader || cc;
|
|
4898
4926
|
async function i(n, s, o = !1, a = [], u) {
|
|
4899
|
-
const
|
|
4927
|
+
const f = () => r.getThumbnailFromResource(void 0, s, o, a);
|
|
4900
4928
|
if (!n)
|
|
4901
4929
|
return await r.getThumbnailFromResource(void 0, s, o, a);
|
|
4902
4930
|
if (typeof n == "string") {
|
|
4903
|
-
const
|
|
4904
|
-
return
|
|
4931
|
+
const d = Gt(n);
|
|
4932
|
+
return d && a.push(d), await r.getThumbnailFromResource(void 0, s, o, a);
|
|
4905
4933
|
}
|
|
4906
4934
|
const l = e.get(n, { skipSelfReturn: !1 });
|
|
4907
4935
|
if (typeof l == "string")
|
|
4908
|
-
return { best:
|
|
4936
|
+
return { best: Gt(l), fallback: [], log: [] };
|
|
4909
4937
|
if (!l)
|
|
4910
|
-
return await
|
|
4911
|
-
switch (await (async (
|
|
4912
|
-
if (
|
|
4913
|
-
const v = e.get(
|
|
4938
|
+
return await f();
|
|
4939
|
+
switch (await (async (d) => {
|
|
4940
|
+
if (d && d.thumbnail && d.thumbnail.length) {
|
|
4941
|
+
const v = e.get(d.thumbnail[0]), m = await r.getImageCandidates(v, o);
|
|
4914
4942
|
m && m.length && a.push(...m);
|
|
4915
4943
|
}
|
|
4916
4944
|
})(l), l.type) {
|
|
4917
4945
|
case "Annotation": {
|
|
4918
|
-
const
|
|
4946
|
+
const d = Array.isArray(l.body) ? l.body : [l.body], v = e.get(d[0]);
|
|
4919
4947
|
return u && !v.width && (v.width = u.width, v.height = u.height), await r.getThumbnailFromResource(v, s, o, a);
|
|
4920
4948
|
}
|
|
4921
4949
|
case "Canvas": {
|
|
4922
|
-
const
|
|
4923
|
-
return i(
|
|
4924
|
-
width:
|
|
4925
|
-
height:
|
|
4950
|
+
const d = l;
|
|
4951
|
+
return i(d.items[0], s, o, a, {
|
|
4952
|
+
width: d.width,
|
|
4953
|
+
height: d.height
|
|
4926
4954
|
});
|
|
4927
4955
|
}
|
|
4928
4956
|
case "AnnotationPage":
|
|
4929
4957
|
return i(l.items[0], s, o, a, u);
|
|
4930
4958
|
case "Choice": {
|
|
4931
|
-
const
|
|
4932
|
-
return !
|
|
4959
|
+
const d = l;
|
|
4960
|
+
return !d.items || d.items[0] ? await f() : i(d.items[0], s, o, a, u);
|
|
4933
4961
|
}
|
|
4934
4962
|
case "Collection": {
|
|
4935
|
-
const
|
|
4936
|
-
return
|
|
4963
|
+
const d = l.items[0];
|
|
4964
|
+
return d ? i(d, s, o, a, u) : await f();
|
|
4937
4965
|
}
|
|
4938
4966
|
case "Manifest": {
|
|
4939
|
-
const
|
|
4940
|
-
return
|
|
4967
|
+
const d = l.items[0];
|
|
4968
|
+
return d ? i(d, s, o, a, u) : await f();
|
|
4941
4969
|
}
|
|
4942
4970
|
case "SpecificResource":
|
|
4943
4971
|
case "Image":
|
|
@@ -4948,31 +4976,31 @@ function cc(e = $i, t = {}) {
|
|
|
4948
4976
|
case "Video":
|
|
4949
4977
|
return u && !l.width && (l.width = u.width, l.height = u.height), r.getThumbnailFromResource(l, s, o, a);
|
|
4950
4978
|
}
|
|
4951
|
-
return await
|
|
4979
|
+
return await f();
|
|
4952
4980
|
}
|
|
4953
4981
|
return {
|
|
4954
4982
|
getBestThumbnailAtSize: i
|
|
4955
4983
|
};
|
|
4956
4984
|
}
|
|
4957
|
-
function
|
|
4958
|
-
const n = V(), s =
|
|
4985
|
+
function lc(e, t, { canvasId: r, manifestId: i } = {}) {
|
|
4986
|
+
const n = V(), s = Vt(), o = E(() => uc(n, { imageServiceLoader: s }), [n, s]), [a, u] = B(), f = ke(i ? { id: i } : void 0), l = ue(r ? { id: r } : void 0), d = l || f, v = ge(!1);
|
|
4959
4987
|
if (K(() => (v.current = !1, () => {
|
|
4960
4988
|
v.current = !0;
|
|
4961
|
-
}), []), !
|
|
4989
|
+
}), []), !d)
|
|
4962
4990
|
throw new Error("Must be called under a manifest or canvas context.");
|
|
4963
|
-
return
|
|
4991
|
+
return ac(
|
|
4964
4992
|
(m) => {
|
|
4965
|
-
o.getBestThumbnailAtSize(
|
|
4993
|
+
o.getBestThumbnailAtSize(d, e, t).then((h) => {
|
|
4966
4994
|
h.best && !v.current && u(h.best);
|
|
4967
4995
|
});
|
|
4968
4996
|
},
|
|
4969
|
-
[
|
|
4997
|
+
[d]
|
|
4970
4998
|
), a;
|
|
4971
4999
|
}
|
|
4972
|
-
function
|
|
5000
|
+
function fc(e) {
|
|
4973
5001
|
return { isMuted: !1, playRequested: !1, isPlaying: !1, isFinished: !1, volume: 100, duration: e };
|
|
4974
5002
|
}
|
|
4975
|
-
function
|
|
5003
|
+
function pc(e, t) {
|
|
4976
5004
|
switch (t.type) {
|
|
4977
5005
|
case "FINISHED":
|
|
4978
5006
|
return { ...e, isFinished: !0, isPlaying: !1, playRequested: !1 };
|
|
@@ -4995,22 +5023,22 @@ function fc(e, t) {
|
|
|
4995
5023
|
}
|
|
4996
5024
|
return e;
|
|
4997
5025
|
}
|
|
4998
|
-
function
|
|
5026
|
+
function dc(e) {
|
|
4999
5027
|
const t = Math.round(e);
|
|
5000
5028
|
return `${Math.floor(t / 60)}:${`${t % 60}`.padStart(2, "0")}`;
|
|
5001
5029
|
}
|
|
5002
|
-
function
|
|
5003
|
-
const [t, r] = an(
|
|
5004
|
-
n.current && i.current && (n.current.innerHTML =
|
|
5030
|
+
function Ht(e) {
|
|
5031
|
+
const [t, r] = an(pc, fc(e.duration)), i = ge(null), n = ge(null), s = ge(null), o = ge(!1), a = D(() => {
|
|
5032
|
+
n.current && i.current && (n.current.innerHTML = dc(i.current.currentTime), s.current && (s.current.style.width = `${i.current.currentTime / e.duration * 100}%`), o.current !== i.current.muted && (o.current = i.current.muted, r(i.current.muted ? { type: "MUTE" } : { type: "UNMUTE" })));
|
|
5005
5033
|
}, [e.duration]), u = D(() => {
|
|
5006
5034
|
i.current && (r({ type: "PLAY_REQUESTED" }), i.current.play().then(() => {
|
|
5007
5035
|
r({ type: "PLAY" });
|
|
5008
5036
|
}), a());
|
|
5009
|
-
}, [a]),
|
|
5037
|
+
}, [a]), f = D(() => {
|
|
5010
5038
|
i.current && (i.current.duration > 0 && i.current.paused ? u() : l());
|
|
5011
5039
|
}, [a]), l = D(() => {
|
|
5012
5040
|
i.current && (i.current.pause(), r({ type: "PAUSE" }), a());
|
|
5013
|
-
}, [a]),
|
|
5041
|
+
}, [a]), d = D(() => {
|
|
5014
5042
|
i.current && (i.current.muted = !i.current.muted, r(i.current.muted ? { type: "MUTE" } : { type: "UNMUTE" }));
|
|
5015
5043
|
}, []), v = D(() => {
|
|
5016
5044
|
i.current && (i.current.muted = !0, r({ type: "MUTE" }));
|
|
@@ -5039,10 +5067,10 @@ function Nt(e) {
|
|
|
5039
5067
|
{
|
|
5040
5068
|
play: u,
|
|
5041
5069
|
pause: l,
|
|
5042
|
-
playPause:
|
|
5070
|
+
playPause: f,
|
|
5043
5071
|
mute: v,
|
|
5044
5072
|
unmute: m,
|
|
5045
|
-
toggleMute:
|
|
5073
|
+
toggleMute: d,
|
|
5046
5074
|
setVolume: h,
|
|
5047
5075
|
setDurationPercent: g,
|
|
5048
5076
|
setTime: b
|
|
@@ -5050,19 +5078,19 @@ function Nt(e) {
|
|
|
5050
5078
|
];
|
|
5051
5079
|
}
|
|
5052
5080
|
const Di = ce(null), qi = ce(null), _i = ce(null);
|
|
5053
|
-
function
|
|
5081
|
+
function Pc() {
|
|
5054
5082
|
const e = H(Di);
|
|
5055
5083
|
if (!e)
|
|
5056
5084
|
throw new Error("Ctx not found");
|
|
5057
5085
|
return e;
|
|
5058
5086
|
}
|
|
5059
|
-
function
|
|
5087
|
+
function Lc() {
|
|
5060
5088
|
const e = H(qi);
|
|
5061
5089
|
if (!e)
|
|
5062
5090
|
throw new Error("Ctx not found");
|
|
5063
5091
|
return e;
|
|
5064
5092
|
}
|
|
5065
|
-
function
|
|
5093
|
+
function Fc() {
|
|
5066
5094
|
const e = H(_i);
|
|
5067
5095
|
if (!e)
|
|
5068
5096
|
throw new Error("Ctx not found");
|
|
@@ -5079,7 +5107,7 @@ function Ui({
|
|
|
5079
5107
|
return /* @__PURE__ */ x(_i.Provider, { value: { currentTime: i, progress: n, element: s }, children: /* @__PURE__ */ x(qi.Provider, { value: e, children: /* @__PURE__ */ x(Di.Provider, { value: t, children: r }) }) });
|
|
5080
5108
|
}
|
|
5081
5109
|
function Vi({ media: e, children: t }) {
|
|
5082
|
-
const [{ element: r, currentTime: i, progress: n }, s, o] =
|
|
5110
|
+
const [{ element: r, currentTime: i, progress: n }, s, o] = Ht({ duration: e.duration });
|
|
5083
5111
|
return /* @__PURE__ */ N(
|
|
5084
5112
|
Ui,
|
|
5085
5113
|
{
|
|
@@ -5130,7 +5158,7 @@ function Bi({
|
|
|
5130
5158
|
mediaControlsDeps: t,
|
|
5131
5159
|
children: r
|
|
5132
5160
|
}) {
|
|
5133
|
-
const [{ element: i, currentTime: n, progress: s }, o, a] =
|
|
5161
|
+
const [{ element: i, currentTime: n, progress: s }, o, a] = Ht({ duration: e.duration });
|
|
5134
5162
|
return Le("overlay", "video-element", Hi, {
|
|
5135
5163
|
element: i,
|
|
5136
5164
|
media: e,
|
|
@@ -5193,18 +5221,18 @@ function Qi({ style: e }) {
|
|
|
5193
5221
|
);
|
|
5194
5222
|
}
|
|
5195
5223
|
const Yi = me.createContext("en");
|
|
5196
|
-
function
|
|
5224
|
+
function jc(e) {
|
|
5197
5225
|
return /* @__PURE__ */ x(Yi.Provider, { value: e.language, children: e.children });
|
|
5198
5226
|
}
|
|
5199
|
-
function
|
|
5227
|
+
function Bt() {
|
|
5200
5228
|
return me.useContext(Yi);
|
|
5201
5229
|
}
|
|
5202
|
-
function
|
|
5230
|
+
function hr(e) {
|
|
5203
5231
|
return e.indexOf("-") !== -1 ? e.slice(0, e.indexOf("-")) : e;
|
|
5204
5232
|
}
|
|
5205
|
-
function
|
|
5206
|
-
const s =
|
|
5207
|
-
return E(() =>
|
|
5233
|
+
function hc({ as: e, language: t, children: r, viewingDirection: i, ...n }) {
|
|
5234
|
+
const s = Bt();
|
|
5235
|
+
return E(() => hr(s) === hr(t), [s, t]) ? e ? /* @__PURE__ */ x(e, { ...n, children: r }) : /* @__PURE__ */ x("span", { ...n, children: r }) : e ? /* @__PURE__ */ x(e, { ...n, lang: t, dir: i, children: r }) : /* @__PURE__ */ x("span", { ...n, lang: t, dir: i, children: r });
|
|
5208
5236
|
}
|
|
5209
5237
|
function Gi(e, t, r) {
|
|
5210
5238
|
if (t.length === 0)
|
|
@@ -5221,15 +5249,15 @@ function Gi(e, t, r) {
|
|
|
5221
5249
|
return n;
|
|
5222
5250
|
return t.indexOf("none") !== -1 ? "none" : t.indexOf("@none") !== -1 ? "@none" : t[0];
|
|
5223
5251
|
}
|
|
5224
|
-
const
|
|
5225
|
-
const r =
|
|
5252
|
+
const yc = (e, t = []) => {
|
|
5253
|
+
const r = Bt();
|
|
5226
5254
|
return E(() => {
|
|
5227
5255
|
const i = e();
|
|
5228
5256
|
return Gi(r, i, []);
|
|
5229
5257
|
}, [r, ...t]);
|
|
5230
5258
|
};
|
|
5231
|
-
function
|
|
5232
|
-
const r =
|
|
5259
|
+
function vc(e, t) {
|
|
5260
|
+
const r = yc(() => Object.keys(e || {}), [e]);
|
|
5233
5261
|
return [
|
|
5234
5262
|
E(() => {
|
|
5235
5263
|
if (!e)
|
|
@@ -5243,8 +5271,8 @@ function yc(e, t) {
|
|
|
5243
5271
|
r
|
|
5244
5272
|
];
|
|
5245
5273
|
}
|
|
5246
|
-
function
|
|
5247
|
-
const e =
|
|
5274
|
+
function $c() {
|
|
5275
|
+
const e = Bt();
|
|
5248
5276
|
return function(r, i, n) {
|
|
5249
5277
|
const s = Object.keys(r || {}), o = Gi(e, s, []);
|
|
5250
5278
|
if (!r)
|
|
@@ -5256,10 +5284,10 @@ function jc() {
|
|
|
5256
5284
|
`) : "";
|
|
5257
5285
|
};
|
|
5258
5286
|
}
|
|
5259
|
-
const
|
|
5260
|
-
const [s, o] =
|
|
5287
|
+
const gc = ({ as: e, defaultText: t, enableDangerouslySetInnerHTML: r, children: i, ...n }) => {
|
|
5288
|
+
const [s, o] = vc(i, t);
|
|
5261
5289
|
return o ? /* @__PURE__ */ x(
|
|
5262
|
-
|
|
5290
|
+
hc,
|
|
5263
5291
|
{
|
|
5264
5292
|
...n,
|
|
5265
5293
|
as: e,
|
|
@@ -5282,7 +5310,7 @@ const vc = ({ as: e, defaultText: t, enableDangerouslySetInnerHTML: r, children:
|
|
|
5282
5310
|
}
|
|
5283
5311
|
);
|
|
5284
5312
|
};
|
|
5285
|
-
function
|
|
5313
|
+
function mc({
|
|
5286
5314
|
element: e,
|
|
5287
5315
|
media: t,
|
|
5288
5316
|
playPause: r
|
|
@@ -5320,13 +5348,13 @@ function gc({
|
|
|
5320
5348
|
)
|
|
5321
5349
|
] }) : null;
|
|
5322
5350
|
}
|
|
5323
|
-
function
|
|
5351
|
+
function bc({
|
|
5324
5352
|
media: e,
|
|
5325
5353
|
mediaControlsDeps: t,
|
|
5326
5354
|
children: r
|
|
5327
5355
|
}) {
|
|
5328
|
-
const [{ element: i, currentTime: n, progress: s }, o, a] =
|
|
5329
|
-
return Le("overlay", "video-element",
|
|
5356
|
+
const [{ element: i, currentTime: n, progress: s }, o, a] = Ht({ duration: e.duration });
|
|
5357
|
+
return Le("overlay", "video-element", mc, {
|
|
5330
5358
|
element: i,
|
|
5331
5359
|
media: e,
|
|
5332
5360
|
playPause: a.playPause
|
|
@@ -5342,9 +5370,9 @@ function Ji({
|
|
|
5342
5370
|
renderViewerControls: o,
|
|
5343
5371
|
renderMediaControls: a,
|
|
5344
5372
|
viewControlsDeps: u,
|
|
5345
|
-
mediaControlsDeps:
|
|
5373
|
+
mediaControlsDeps: f,
|
|
5346
5374
|
strategies: l,
|
|
5347
|
-
throwOnUnknown:
|
|
5375
|
+
throwOnUnknown: d,
|
|
5348
5376
|
backgroundStyle: v,
|
|
5349
5377
|
alwaysShowBackground: m,
|
|
5350
5378
|
keepCanvasScale: h = !1,
|
|
@@ -5353,7 +5381,7 @@ function Ji({
|
|
|
5353
5381
|
onClickPaintingAnnotation: A,
|
|
5354
5382
|
children: w
|
|
5355
5383
|
}) {
|
|
5356
|
-
const C = ue(), T = ei(C, ["deep-zoom"]), [j] =
|
|
5384
|
+
const C = ue(), T = ei(C, ["deep-zoom"]), [j] = Gs(), I = Zs(), L = V(), P = E(() => $t(L), [L]), [M, $] = oc({
|
|
5357
5385
|
strategies: l || ["images"],
|
|
5358
5386
|
defaultChoices: n == null ? void 0 : n.map(({ id: O }) => O)
|
|
5359
5387
|
}), ie = M.type === "images" ? M.choice : void 0, Z = E(() => h ? 1 : Math.max(
|
|
@@ -5363,7 +5391,7 @@ function Ji({
|
|
|
5363
5391
|
return (O.width || 0) / ((W = O.target) == null ? void 0 : W.spatial.width);
|
|
5364
5392
|
}) : []
|
|
5365
5393
|
), [h, M]);
|
|
5366
|
-
|
|
5394
|
+
Xs(Z), K(() => {
|
|
5367
5395
|
i && i($);
|
|
5368
5396
|
}, [M.annotations]), K(() => {
|
|
5369
5397
|
if (n)
|
|
@@ -5371,19 +5399,19 @@ function Ji({
|
|
|
5371
5399
|
typeof O.opacity < "u" && P.applyStyles({ id: O.id }, "atlas", {
|
|
5372
5400
|
opacity: O.opacity
|
|
5373
5401
|
});
|
|
5374
|
-
}, [n]),
|
|
5402
|
+
}, [n]), yr(() => {
|
|
5375
5403
|
r && r(ie);
|
|
5376
5404
|
}, [ie]), Le(
|
|
5377
5405
|
I && (M.type === "images" || M.type === "empty" || M.type === "textual-content" && o) ? "overlay" : "none",
|
|
5378
5406
|
`canvas-portal-controls-${C == null ? void 0 : C.id}`,
|
|
5379
|
-
|
|
5407
|
+
jt.Provider,
|
|
5380
5408
|
o ? {
|
|
5381
5409
|
value: I || null,
|
|
5382
5410
|
children: o(M)
|
|
5383
5411
|
} : {},
|
|
5384
5412
|
[C, I, M, ...u || []]
|
|
5385
5413
|
);
|
|
5386
|
-
const U =
|
|
5414
|
+
const U = lc({ maxWidth: 256, maxHeight: 256 });
|
|
5387
5415
|
if (!C)
|
|
5388
5416
|
return null;
|
|
5389
5417
|
const z = C.accompanyingCanvas, ee = U && U.type === "fixed" ? /* @__PURE__ */ x("world-object", { height: C.height, width: C.width, x: e, y: t, children: /* @__PURE__ */ x(
|
|
@@ -5401,13 +5429,13 @@ function Ji({
|
|
|
5401
5429
|
if (M.type === "unknown") {
|
|
5402
5430
|
if (ee)
|
|
5403
5431
|
return ee;
|
|
5404
|
-
if (
|
|
5432
|
+
if (d)
|
|
5405
5433
|
throw new Error(M.reason || "Unknown image strategy");
|
|
5406
5434
|
return null;
|
|
5407
5435
|
}
|
|
5408
5436
|
const ne = /* @__PURE__ */ N(Ke, { children: [
|
|
5409
|
-
j ? /* @__PURE__ */ x(
|
|
5410
|
-
M.annotations && M.annotations.pages ? M.annotations.pages.map((O) => /* @__PURE__ */ x(
|
|
5437
|
+
j ? /* @__PURE__ */ x(Tt, { page: j }) : null,
|
|
5438
|
+
M.annotations && M.annotations.pages ? M.annotations.pages.map((O) => /* @__PURE__ */ x(Tt, { page: O }, O.id)) : null,
|
|
5411
5439
|
w
|
|
5412
5440
|
] }), xe = M.type === "images" ? M.images.length : 0;
|
|
5413
5441
|
return /* @__PURE__ */ N(Me, { children: [
|
|
@@ -5431,7 +5459,7 @@ function Ji({
|
|
|
5431
5459
|
de.stopPropagation(), A(O.annotationId, O, de);
|
|
5432
5460
|
} : void 0,
|
|
5433
5461
|
target: ((X = O.target) == null ? void 0 : X.spatial) || void 0,
|
|
5434
|
-
children: /* @__PURE__ */ x("div", { "data-textual-content": !0, children: /* @__PURE__ */ x(
|
|
5462
|
+
children: /* @__PURE__ */ x("div", { "data-textual-content": !0, children: /* @__PURE__ */ x(gc, { enableDangerouslySetInnerHTML: !0, children: O.text }) })
|
|
5435
5463
|
},
|
|
5436
5464
|
W
|
|
5437
5465
|
),
|
|
@@ -5457,13 +5485,13 @@ function Ji({
|
|
|
5457
5485
|
ne
|
|
5458
5486
|
] }) : null,
|
|
5459
5487
|
M.type === "3d-model" ? /* @__PURE__ */ x(Wi, { model: M.model }) : null,
|
|
5460
|
-
M.type === "media" ? /* @__PURE__ */ x(Me, { children: M.media.type === "Sound" ? /* @__PURE__ */ N(Ni, { media: M.media, mediaControlsDeps:
|
|
5488
|
+
M.type === "media" ? /* @__PURE__ */ x(Me, { children: M.media.type === "Sound" ? /* @__PURE__ */ N(Ni, { media: M.media, mediaControlsDeps: f, children: [
|
|
5461
5489
|
ee,
|
|
5462
5490
|
a ? a(M) : null
|
|
5463
|
-
] }) : M.media.type === "Video" ? /* @__PURE__ */ N(Bi, { media: M.media, mediaControlsDeps:
|
|
5491
|
+
] }) : M.media.type === "Video" ? /* @__PURE__ */ N(Bi, { media: M.media, mediaControlsDeps: f, children: [
|
|
5464
5492
|
ee,
|
|
5465
5493
|
a ? a(M) : null
|
|
5466
|
-
] }) : M.media.type === "VideoYouTube" && b ? /* @__PURE__ */ N(
|
|
5494
|
+
] }) : M.media.type === "VideoYouTube" && b ? /* @__PURE__ */ N(bc, { media: M.media, mediaControlsDeps: f, children: [
|
|
5467
5495
|
ee,
|
|
5468
5496
|
a ? a(M) : null
|
|
5469
5497
|
] }) : null }) : null
|
|
@@ -5471,15 +5499,15 @@ function Ji({
|
|
|
5471
5499
|
},
|
|
5472
5500
|
`${C.id}/${M.type}/${xe}`
|
|
5473
5501
|
),
|
|
5474
|
-
M.type === "media" && M.media.type === "Sound" && z ? /* @__PURE__ */ x(
|
|
5502
|
+
M.type === "media" && M.media.type === "Sound" && z ? /* @__PURE__ */ x(Ft, { canvas: z.id, children: /* @__PURE__ */ x(Ji, { renderViewerControls: o }) }) : null
|
|
5475
5503
|
] });
|
|
5476
5504
|
}
|
|
5477
|
-
function
|
|
5505
|
+
function Ac() {
|
|
5478
5506
|
const e = H(tt);
|
|
5479
5507
|
return e && e.vault ? e.vault : Vr();
|
|
5480
5508
|
}
|
|
5481
|
-
const
|
|
5482
|
-
const i = ke(), n = Br(), s =
|
|
5509
|
+
const xc = vr(function(t, r) {
|
|
5510
|
+
const i = ke(), n = Br(), s = Cs(), { ViewerControls: o, MediaControls: a } = t.components || {};
|
|
5483
5511
|
if (cn(r, () => s, [s]), !i)
|
|
5484
5512
|
return /* @__PURE__ */ x("div", {});
|
|
5485
5513
|
let u = 0;
|
|
@@ -5490,30 +5518,30 @@ const Ac = yr(function(t, r) {
|
|
|
5490
5518
|
{
|
|
5491
5519
|
height: t.height,
|
|
5492
5520
|
mode: t.mode,
|
|
5493
|
-
children: n.map((
|
|
5494
|
-
const
|
|
5495
|
-
return u +=
|
|
5521
|
+
children: n.map((f, l) => {
|
|
5522
|
+
const d = u;
|
|
5523
|
+
return u += f.width + (t.spacing || 0), /* @__PURE__ */ x(Ft, { canvas: f.id, children: /* @__PURE__ */ x(
|
|
5496
5524
|
J.RenderCanvas,
|
|
5497
5525
|
{
|
|
5498
5526
|
strategies: ["3d-model", "media", "images", "empty", "textual-content"],
|
|
5499
5527
|
renderViewerControls: l === 0 && o ? () => /* @__PURE__ */ x(o, {}) : void 0,
|
|
5500
5528
|
renderMediaControls: l === 0 && a ? () => /* @__PURE__ */ x(a, {}) : void 0,
|
|
5501
|
-
x:
|
|
5529
|
+
x: d,
|
|
5502
5530
|
...t.canvasProps || {},
|
|
5503
5531
|
children: t.annotations
|
|
5504
5532
|
},
|
|
5505
|
-
|
|
5506
|
-
) },
|
|
5533
|
+
f.id
|
|
5534
|
+
) }, f.id);
|
|
5507
5535
|
})
|
|
5508
5536
|
},
|
|
5509
5537
|
t.reuseAtlas ? "" : s.currentSequenceIndex
|
|
5510
5538
|
),
|
|
5511
5539
|
t.children
|
|
5512
5540
|
] });
|
|
5513
|
-
}), J =
|
|
5514
|
-
const
|
|
5515
|
-
return /* @__PURE__ */ x(Nr, { vault:
|
|
5516
|
-
|
|
5541
|
+
}), J = vr(function({ children: t, height: r, annotations: i, canvasProps: n, spacing: s, header: o, components: a, mode: u, ...f }, l) {
|
|
5542
|
+
const d = Ac();
|
|
5543
|
+
return /* @__PURE__ */ x(Nr, { vault: d, children: /* @__PURE__ */ x(Ss, { ...f, children: /* @__PURE__ */ x(
|
|
5544
|
+
xc,
|
|
5517
5545
|
{
|
|
5518
5546
|
ref: l,
|
|
5519
5547
|
height: r,
|
|
@@ -5529,9 +5557,9 @@ const Ac = yr(function(t, r) {
|
|
|
5529
5557
|
});
|
|
5530
5558
|
J.RenderImage = ai;
|
|
5531
5559
|
J.RenderCanvas = Ji;
|
|
5532
|
-
J.RenderAnnotationPage =
|
|
5560
|
+
J.RenderAnnotationPage = Tt;
|
|
5533
5561
|
J.RenderAnnotation = oi;
|
|
5534
|
-
J.Viewer =
|
|
5562
|
+
J.Viewer = eo;
|
|
5535
5563
|
J.CanvasBackground = Qi;
|
|
5536
5564
|
J.Audio = Ni;
|
|
5537
5565
|
J.Video = Bi;
|
|
@@ -5539,21 +5567,21 @@ J.Model = Wi;
|
|
|
5539
5567
|
J.AudioHTML = Vi;
|
|
5540
5568
|
J.VideoHTML = Hi;
|
|
5541
5569
|
J.ModelHTML = zi;
|
|
5542
|
-
function
|
|
5570
|
+
function Dc({ annotation: e, children: t }) {
|
|
5543
5571
|
return /* @__PURE__ */ x(Te, { value: { annotation: e }, children: t });
|
|
5544
5572
|
}
|
|
5545
|
-
function
|
|
5573
|
+
function qc({ annotationPage: e, children: t }) {
|
|
5546
5574
|
return /* @__PURE__ */ x(Te, { value: { annotationPage: e }, children: t });
|
|
5547
5575
|
}
|
|
5548
|
-
function
|
|
5576
|
+
function _c({ collection: e, children: t }) {
|
|
5549
5577
|
return /* @__PURE__ */ x(Te, { value: { collection: e }, children: t });
|
|
5550
5578
|
}
|
|
5551
|
-
function
|
|
5552
|
-
return
|
|
5579
|
+
function Uc(e, t = {}) {
|
|
5580
|
+
return Nt(t);
|
|
5553
5581
|
}
|
|
5554
|
-
function
|
|
5582
|
+
function Vc(e, t = !1) {
|
|
5555
5583
|
}
|
|
5556
|
-
function
|
|
5584
|
+
function Nc(e) {
|
|
5557
5585
|
const r = be().manifest, i = e ? e.map((n) => typeof n == "string" ? n : n == null ? void 0 : n.id) : [];
|
|
5558
5586
|
return Q(
|
|
5559
5587
|
(n) => {
|
|
@@ -5568,7 +5596,7 @@ function Vc(e) {
|
|
|
5568
5596
|
[i.join("/")]
|
|
5569
5597
|
);
|
|
5570
5598
|
}
|
|
5571
|
-
function
|
|
5599
|
+
function Hc(e, t = []) {
|
|
5572
5600
|
const { id: r, selector: i } = e, n = be(), s = r || n.collection, o = Q(
|
|
5573
5601
|
(a) => s ? a.iiif.entities.Collection[s] : void 0,
|
|
5574
5602
|
[s]
|
|
@@ -5578,7 +5606,7 @@ function Nc(e, t = []) {
|
|
|
5578
5606
|
return i ? i(o) : o;
|
|
5579
5607
|
}, [o, i, ...t]);
|
|
5580
5608
|
}
|
|
5581
|
-
function
|
|
5609
|
+
function Bc(e, t, r, i, n = []) {
|
|
5582
5610
|
const s = V(), o = E(() => Xr(s), [s]);
|
|
5583
5611
|
K(() => {
|
|
5584
5612
|
const a = e;
|
|
@@ -5588,15 +5616,15 @@ function Hc(e, t, r, i, n = []) {
|
|
|
5588
5616
|
};
|
|
5589
5617
|
}, [o, e, t, ...n]);
|
|
5590
5618
|
}
|
|
5591
|
-
function
|
|
5619
|
+
function zc(e, t) {
|
|
5592
5620
|
const { id: r, isLoaded: i, error: n, resource: s, requestId: o, cached: a } = Hr(
|
|
5593
5621
|
e,
|
|
5594
5622
|
t
|
|
5595
5623
|
);
|
|
5596
5624
|
return { id: r, isLoaded: i, error: n, manifest: s, requestId: o, cached: a };
|
|
5597
5625
|
}
|
|
5598
|
-
function
|
|
5599
|
-
const t = ue(), r =
|
|
5626
|
+
function wc({ cacheKey: e } = {}) {
|
|
5627
|
+
const t = ue(), r = Nt(), i = V(), n = Vt(), [s, o] = B(void 0), [a, u] = B(!1), [f, l] = B("idle"), [d, v] = B(void 0), m = t ? t.id : "undefined", h = E(() => {
|
|
5600
5628
|
try {
|
|
5601
5629
|
if (t && r.length) {
|
|
5602
5630
|
const b = r[0], A = i.get(b.body[0]), C = mt(A)[0];
|
|
@@ -5609,7 +5637,7 @@ function xc({ cacheKey: e } = {}) {
|
|
|
5609
5637
|
} catch (b) {
|
|
5610
5638
|
console.error(b);
|
|
5611
5639
|
}
|
|
5612
|
-
}, [m, e, t]), g =
|
|
5640
|
+
}, [m, e, t]), g = f === "success" && s ? s : h;
|
|
5613
5641
|
return K(() => {
|
|
5614
5642
|
(async () => {
|
|
5615
5643
|
try {
|
|
@@ -5636,12 +5664,12 @@ function xc({ cacheKey: e } = {}) {
|
|
|
5636
5664
|
}, [m, e]), E(() => ({
|
|
5637
5665
|
data: g,
|
|
5638
5666
|
isFetching: a,
|
|
5639
|
-
status:
|
|
5640
|
-
error:
|
|
5641
|
-
}), [g, a,
|
|
5667
|
+
status: f,
|
|
5668
|
+
error: d
|
|
5669
|
+
}), [g, a, f, d]);
|
|
5642
5670
|
}
|
|
5643
|
-
function
|
|
5644
|
-
const e =
|
|
5671
|
+
function Wc() {
|
|
5672
|
+
const e = wc();
|
|
5645
5673
|
return {
|
|
5646
5674
|
isLoading: e.isFetching,
|
|
5647
5675
|
tile: e.data ? {
|
|
@@ -5653,106 +5681,106 @@ function zc() {
|
|
|
5653
5681
|
} : null
|
|
5654
5682
|
};
|
|
5655
5683
|
}
|
|
5656
|
-
function
|
|
5684
|
+
function Qc() {
|
|
5657
5685
|
const e = ke();
|
|
5658
5686
|
return e ? e.service.find(
|
|
5659
5687
|
(t) => t.profile === "SearchService1" || t.profile === "http://iiif.io/api/search/1/search"
|
|
5660
5688
|
) : void 0;
|
|
5661
5689
|
}
|
|
5662
|
-
function
|
|
5690
|
+
function Yc() {
|
|
5663
5691
|
const e = V();
|
|
5664
|
-
return E(() =>
|
|
5692
|
+
return E(() => $t(e), [e]);
|
|
5665
5693
|
}
|
|
5666
5694
|
export {
|
|
5667
|
-
|
|
5668
|
-
|
|
5669
|
-
|
|
5695
|
+
Dc as AnnotationContext,
|
|
5696
|
+
qc as AnnotationPageContext,
|
|
5697
|
+
Ft as CanvasContext,
|
|
5670
5698
|
J as CanvasPanel,
|
|
5671
|
-
|
|
5672
|
-
|
|
5673
|
-
|
|
5674
|
-
|
|
5675
|
-
|
|
5676
|
-
|
|
5677
|
-
|
|
5678
|
-
|
|
5699
|
+
_c as CollectionContext,
|
|
5700
|
+
Rs as ContextBridge,
|
|
5701
|
+
Ya as ImageServiceLoaderContext,
|
|
5702
|
+
ws as InnerViewerProvider,
|
|
5703
|
+
jc as LanguageProvider,
|
|
5704
|
+
hc as LanguageString,
|
|
5705
|
+
gc as LocaleString,
|
|
5706
|
+
gs as ManifestContext,
|
|
5679
5707
|
Ui as MediaPlayerProvider,
|
|
5680
|
-
|
|
5708
|
+
ms as RangeContext,
|
|
5681
5709
|
tt as ReactVaultContext,
|
|
5682
5710
|
Te as ResourceProvider,
|
|
5683
|
-
|
|
5684
|
-
|
|
5711
|
+
Pt as ResourceReactContext,
|
|
5712
|
+
Ss as SimpleViewerProvider,
|
|
5685
5713
|
it as SimpleViewerReactContext,
|
|
5686
5714
|
Nr as VaultProvider,
|
|
5687
|
-
|
|
5688
|
-
|
|
5715
|
+
jt as ViewerPresetContext,
|
|
5716
|
+
Js as VirtualAnnotationProvider,
|
|
5689
5717
|
rt as VisibleCanvasReactContext,
|
|
5690
|
-
|
|
5691
|
-
|
|
5718
|
+
Ua as emptyActions,
|
|
5719
|
+
Va as emptyStrategy,
|
|
5692
5720
|
Re as expandTarget,
|
|
5693
5721
|
zr as findAllCanvasesInRange,
|
|
5694
|
-
|
|
5695
|
-
|
|
5722
|
+
bs as findFirstCanvasFromRange,
|
|
5723
|
+
kc as findManifestSelectedRange,
|
|
5696
5724
|
Wr as findSelectedRange,
|
|
5697
|
-
|
|
5698
|
-
|
|
5699
|
-
|
|
5725
|
+
Ba as flattenAnnotationPageIds,
|
|
5726
|
+
dc as formatTime,
|
|
5727
|
+
Xa as getImageStrategy,
|
|
5700
5728
|
Qr as getManifestSequence,
|
|
5701
5729
|
Li as getParsedTargetSelector,
|
|
5702
|
-
|
|
5703
|
-
|
|
5704
|
-
|
|
5730
|
+
Oc as getVisibleCanvasesFromCanvasId,
|
|
5731
|
+
Ro as isImageApiSelector,
|
|
5732
|
+
Io as parseRotation,
|
|
5705
5733
|
Ye as parseSelector,
|
|
5706
|
-
|
|
5734
|
+
Ec as parseSpecificResource,
|
|
5707
5735
|
gt as unknownResponse,
|
|
5708
5736
|
_ as unsupportedStrategy,
|
|
5709
5737
|
si as useAnnotation,
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
|
|
5738
|
+
To as useAnnotationPage,
|
|
5739
|
+
Wa as useAnnotationPageManager,
|
|
5740
|
+
Uc as useAnnotationsAtTime,
|
|
5713
5741
|
ue as useCanvas,
|
|
5714
|
-
|
|
5715
|
-
|
|
5716
|
-
|
|
5717
|
-
|
|
5718
|
-
|
|
5719
|
-
|
|
5720
|
-
|
|
5721
|
-
|
|
5722
|
-
|
|
5723
|
-
|
|
5724
|
-
|
|
5725
|
-
|
|
5742
|
+
Vc as useCanvasClock,
|
|
5743
|
+
xs as useCanvasSequence,
|
|
5744
|
+
Nc as useCanvasSubset,
|
|
5745
|
+
yc as useClosestLanguage,
|
|
5746
|
+
Hc as useCollection,
|
|
5747
|
+
Ms as useContextBridge,
|
|
5748
|
+
$c as useCreateLocaleString,
|
|
5749
|
+
Qs as useDispatch,
|
|
5750
|
+
Bc as useEventListener,
|
|
5751
|
+
Ac as useExistingVault,
|
|
5752
|
+
zc as useExternalCollection,
|
|
5753
|
+
vs as useExternalManifest,
|
|
5726
5754
|
Hr as useExternalResource,
|
|
5727
|
-
|
|
5728
|
-
|
|
5729
|
-
|
|
5730
|
-
|
|
5731
|
-
|
|
5732
|
-
|
|
5755
|
+
Bt as useIIIFLanguage,
|
|
5756
|
+
wc as useImageService,
|
|
5757
|
+
Vt as useImageServiceLoader,
|
|
5758
|
+
Wc as useImageTile,
|
|
5759
|
+
Ga as useLoadImageService,
|
|
5760
|
+
vc as useLocaleString,
|
|
5733
5761
|
ke as useManifest,
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5762
|
+
Lc as useMediaActions,
|
|
5763
|
+
Fc as useMediaElements,
|
|
5764
|
+
Pc as useMediaState,
|
|
5765
|
+
Za as usePaintables,
|
|
5766
|
+
Nt as usePaintingAnnotations,
|
|
5767
|
+
As as useRange,
|
|
5768
|
+
oc as useRenderingStrategy,
|
|
5741
5769
|
be as useResourceContext,
|
|
5742
5770
|
ei as useResourceEvents,
|
|
5743
|
-
|
|
5744
|
-
|
|
5745
|
-
|
|
5746
|
-
|
|
5747
|
-
|
|
5771
|
+
Qa as useResources,
|
|
5772
|
+
Qc as useSearchService,
|
|
5773
|
+
Ht as useSimpleMediaPlayer,
|
|
5774
|
+
Cs as useSimpleViewer,
|
|
5775
|
+
Yc as useStyleHelper,
|
|
5748
5776
|
et as useStyles,
|
|
5749
|
-
|
|
5777
|
+
lc as useThumbnail,
|
|
5750
5778
|
V as useVault,
|
|
5751
|
-
|
|
5779
|
+
ac as useVaultEffect,
|
|
5752
5780
|
Q as useVaultSelector,
|
|
5753
|
-
|
|
5754
|
-
|
|
5755
|
-
|
|
5781
|
+
Zs as useViewerPreset,
|
|
5782
|
+
Ys as useVirtualAnnotationPage,
|
|
5783
|
+
Gs as useVirtualAnnotationPageContext,
|
|
5756
5784
|
Br as useVisibleCanvases
|
|
5757
5785
|
};
|
|
5758
5786
|
//# sourceMappingURL=index.mjs.map
|