dbf-mirador 4.2.4 → 4.3.0-testing1

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.
@@ -1,3170 +0,0 @@
1
- import { $ as e, C as t, D as n, G as r, J as i, K as a, Q as o, S as s, T as c, Y as l, Z as u, a as d, c as f, d as p, f as m, ft as h, l as g, m as _, n as v, nt as y, o as b, q as x, rt as S, tt as C, u as w, ut as T, v as E, w as D, x as O } from "./getters-COus7Mvg.js";
2
- //#region ../node_modules/lodash/_isKey.js
3
- var k = /* @__PURE__ */ T(((e, t) => {
4
- var n = S(), r = o(), i = /\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/, a = /^\w*$/;
5
- function s(e, t) {
6
- if (n(e)) return !1;
7
- var o = typeof e;
8
- return o == "number" || o == "symbol" || o == "boolean" || e == null || r(e) ? !0 : a.test(e) || !i.test(e) || t != null && e in Object(t);
9
- }
10
- t.exports = s;
11
- })), A = /* @__PURE__ */ T(((e, t) => {
12
- t.exports = l()(Object, "create");
13
- })), ee = /* @__PURE__ */ T(((e, t) => {
14
- var n = A();
15
- function r() {
16
- this.__data__ = n ? n(null) : {}, this.size = 0;
17
- }
18
- t.exports = r;
19
- })), te = /* @__PURE__ */ T(((e, t) => {
20
- function n(e) {
21
- var t = this.has(e) && delete this.__data__[e];
22
- return this.size -= +!!t, t;
23
- }
24
- t.exports = n;
25
- })), ne = /* @__PURE__ */ T(((e, t) => {
26
- var n = A(), r = "__lodash_hash_undefined__", i = Object.prototype.hasOwnProperty;
27
- function a(e) {
28
- var t = this.__data__;
29
- if (n) {
30
- var a = t[e];
31
- return a === r ? void 0 : a;
32
- }
33
- return i.call(t, e) ? t[e] : void 0;
34
- }
35
- t.exports = a;
36
- })), re = /* @__PURE__ */ T(((e, t) => {
37
- var n = A(), r = Object.prototype.hasOwnProperty;
38
- function i(e) {
39
- var t = this.__data__;
40
- return n ? t[e] !== void 0 : r.call(t, e);
41
- }
42
- t.exports = i;
43
- })), ie = /* @__PURE__ */ T(((e, t) => {
44
- var n = A(), r = "__lodash_hash_undefined__";
45
- function i(e, t) {
46
- var i = this.__data__;
47
- return this.size += +!this.has(e), i[e] = n && t === void 0 ? r : t, this;
48
- }
49
- t.exports = i;
50
- })), ae = /* @__PURE__ */ T(((e, t) => {
51
- var n = ee(), r = te(), i = ne(), a = re(), o = ie();
52
- function s(e) {
53
- var t = -1, n = e == null ? 0 : e.length;
54
- for (this.clear(); ++t < n;) {
55
- var r = e[t];
56
- this.set(r[0], r[1]);
57
- }
58
- }
59
- s.prototype.clear = n, s.prototype.delete = r, s.prototype.get = i, s.prototype.has = a, s.prototype.set = o, t.exports = s;
60
- })), oe = /* @__PURE__ */ T(((e, t) => {
61
- function n() {
62
- this.__data__ = [], this.size = 0;
63
- }
64
- t.exports = n;
65
- })), j = /* @__PURE__ */ T(((e, t) => {
66
- function n(e, t) {
67
- return e === t || e !== e && t !== t;
68
- }
69
- t.exports = n;
70
- })), M = /* @__PURE__ */ T(((e, t) => {
71
- var n = j();
72
- function r(e, t) {
73
- for (var r = e.length; r--;) if (n(e[r][0], t)) return r;
74
- return -1;
75
- }
76
- t.exports = r;
77
- })), se = /* @__PURE__ */ T(((e, t) => {
78
- var n = M(), r = Array.prototype.splice;
79
- function i(e) {
80
- var t = this.__data__, i = n(t, e);
81
- return i < 0 ? !1 : (i == t.length - 1 ? t.pop() : r.call(t, i, 1), --this.size, !0);
82
- }
83
- t.exports = i;
84
- })), ce = /* @__PURE__ */ T(((e, t) => {
85
- var n = M();
86
- function r(e) {
87
- var t = this.__data__, r = n(t, e);
88
- return r < 0 ? void 0 : t[r][1];
89
- }
90
- t.exports = r;
91
- })), le = /* @__PURE__ */ T(((e, t) => {
92
- var n = M();
93
- function r(e) {
94
- return n(this.__data__, e) > -1;
95
- }
96
- t.exports = r;
97
- })), ue = /* @__PURE__ */ T(((e, t) => {
98
- var n = M();
99
- function r(e, t) {
100
- var r = this.__data__, i = n(r, e);
101
- return i < 0 ? (++this.size, r.push([e, t])) : r[i][1] = t, this;
102
- }
103
- t.exports = r;
104
- })), N = /* @__PURE__ */ T(((e, t) => {
105
- var n = oe(), r = se(), i = ce(), a = le(), o = ue();
106
- function s(e) {
107
- var t = -1, n = e == null ? 0 : e.length;
108
- for (this.clear(); ++t < n;) {
109
- var r = e[t];
110
- this.set(r[0], r[1]);
111
- }
112
- }
113
- s.prototype.clear = n, s.prototype.delete = r, s.prototype.get = i, s.prototype.has = a, s.prototype.set = o, t.exports = s;
114
- })), de = /* @__PURE__ */ T(((e, t) => {
115
- var n = ae(), r = N(), a = i();
116
- function o() {
117
- this.size = 0, this.__data__ = {
118
- hash: new n(),
119
- map: new (a || r)(),
120
- string: new n()
121
- };
122
- }
123
- t.exports = o;
124
- })), fe = /* @__PURE__ */ T(((e, t) => {
125
- function n(e) {
126
- var t = typeof e;
127
- return t == "string" || t == "number" || t == "symbol" || t == "boolean" ? e !== "__proto__" : e === null;
128
- }
129
- t.exports = n;
130
- })), P = /* @__PURE__ */ T(((e, t) => {
131
- var n = fe();
132
- function r(e, t) {
133
- var r = e.__data__;
134
- return n(t) ? r[typeof t == "string" ? "string" : "hash"] : r.map;
135
- }
136
- t.exports = r;
137
- })), pe = /* @__PURE__ */ T(((e, t) => {
138
- var n = P();
139
- function r(e) {
140
- var t = n(this, e).delete(e);
141
- return this.size -= +!!t, t;
142
- }
143
- t.exports = r;
144
- })), me = /* @__PURE__ */ T(((e, t) => {
145
- var n = P();
146
- function r(e) {
147
- return n(this, e).get(e);
148
- }
149
- t.exports = r;
150
- })), he = /* @__PURE__ */ T(((e, t) => {
151
- var n = P();
152
- function r(e) {
153
- return n(this, e).has(e);
154
- }
155
- t.exports = r;
156
- })), ge = /* @__PURE__ */ T(((e, t) => {
157
- var n = P();
158
- function r(e, t) {
159
- var r = n(this, e), i = r.size;
160
- return r.set(e, t), this.size += r.size == i ? 0 : 1, this;
161
- }
162
- t.exports = r;
163
- })), F = /* @__PURE__ */ T(((e, t) => {
164
- var n = de(), r = pe(), i = me(), a = he(), o = ge();
165
- function s(e) {
166
- var t = -1, n = e == null ? 0 : e.length;
167
- for (this.clear(); ++t < n;) {
168
- var r = e[t];
169
- this.set(r[0], r[1]);
170
- }
171
- }
172
- s.prototype.clear = n, s.prototype.delete = r, s.prototype.get = i, s.prototype.has = a, s.prototype.set = o, t.exports = s;
173
- })), _e = /* @__PURE__ */ T(((e, t) => {
174
- var n = F(), r = "Expected a function";
175
- function i(e, t) {
176
- if (typeof e != "function" || t != null && typeof t != "function") throw TypeError(r);
177
- var a = function() {
178
- var n = arguments, r = t ? t.apply(this, n) : n[0], i = a.cache;
179
- if (i.has(r)) return i.get(r);
180
- var o = e.apply(this, n);
181
- return a.cache = i.set(r, o) || i, o;
182
- };
183
- return a.cache = new (i.Cache || n)(), a;
184
- }
185
- i.Cache = n, t.exports = i;
186
- })), ve = /* @__PURE__ */ T(((e, t) => {
187
- var n = _e(), r = 500;
188
- function i(e) {
189
- var t = n(e, function(e) {
190
- return i.size === r && i.clear(), e;
191
- }), i = t.cache;
192
- return t;
193
- }
194
- t.exports = i;
195
- })), ye = /* @__PURE__ */ T(((e, t) => {
196
- var n = ve(), r = /[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g, i = /\\(\\)?/g;
197
- t.exports = n(function(e) {
198
- var t = [];
199
- return e.charCodeAt(0) === 46 && t.push(""), e.replace(r, function(e, n, r, a) {
200
- t.push(r ? a.replace(i, "$1") : n || e);
201
- }), t;
202
- });
203
- })), be = /* @__PURE__ */ T(((e, t) => {
204
- function n(e, t) {
205
- for (var n = -1, r = e == null ? 0 : e.length, i = Array(r); ++n < r;) i[n] = t(e[n], n, e);
206
- return i;
207
- }
208
- t.exports = n;
209
- })), xe = /* @__PURE__ */ T(((e, t) => {
210
- var n = C(), r = be(), i = S(), a = o(), s = 1 / 0, c = n ? n.prototype : void 0, l = c ? c.toString : void 0;
211
- function u(e) {
212
- if (typeof e == "string") return e;
213
- if (i(e)) return r(e, u) + "";
214
- if (a(e)) return l ? l.call(e) : "";
215
- var t = e + "";
216
- return t == "0" && 1 / e == -s ? "-0" : t;
217
- }
218
- t.exports = u;
219
- })), Se = /* @__PURE__ */ T(((e, t) => {
220
- var n = xe();
221
- function r(e) {
222
- return e == null ? "" : n(e);
223
- }
224
- t.exports = r;
225
- })), I = /* @__PURE__ */ T(((e, t) => {
226
- var n = S(), r = k(), i = ye(), a = Se();
227
- function o(e, t) {
228
- return n(e) ? e : r(e, t) ? [e] : i(a(e));
229
- }
230
- t.exports = o;
231
- })), L = /* @__PURE__ */ T(((e, t) => {
232
- var n = o(), r = 1 / 0;
233
- function i(e) {
234
- if (typeof e == "string" || n(e)) return e;
235
- var t = e + "";
236
- return t == "0" && 1 / e == -r ? "-0" : t;
237
- }
238
- t.exports = i;
239
- })), Ce = /* @__PURE__ */ T(((e, t) => {
240
- var n = I(), r = L();
241
- function i(e, t) {
242
- t = n(t, e);
243
- for (var i = 0, a = t.length; e != null && i < a;) e = e[r(t[i++])];
244
- return i && i == a ? e : void 0;
245
- }
246
- t.exports = i;
247
- })), we = /* @__PURE__ */ T(((e, t) => {
248
- var n = x();
249
- function r(e, t, r) {
250
- t == "__proto__" && n ? n(e, t, {
251
- configurable: !0,
252
- enumerable: !0,
253
- value: r,
254
- writable: !0
255
- }) : e[t] = r;
256
- }
257
- t.exports = r;
258
- })), Te = /* @__PURE__ */ T(((e, t) => {
259
- function n(e, t) {
260
- for (var n = -1, r = e == null ? 0 : e.length, i = 0, a = []; ++n < r;) {
261
- var o = e[n];
262
- t(o, n, e) && (a[i++] = o);
263
- }
264
- return a;
265
- }
266
- t.exports = n;
267
- })), Ee = /* @__PURE__ */ T(((e, t) => {
268
- function n(e) {
269
- return function(t, n, r) {
270
- for (var i = -1, a = Object(t), o = r(t), s = o.length; s--;) {
271
- var c = o[e ? s : ++i];
272
- if (n(a[c], c, a) === !1) break;
273
- }
274
- return t;
275
- };
276
- }
277
- t.exports = n;
278
- })), De = /* @__PURE__ */ T(((e, t) => {
279
- t.exports = Ee()();
280
- })), Oe = /* @__PURE__ */ T(((e, t) => {
281
- function n(e, t) {
282
- for (var n = -1, r = Array(e); ++n < e;) r[n] = t(n);
283
- return r;
284
- }
285
- t.exports = n;
286
- })), ke = /* @__PURE__ */ T(((e, t) => {
287
- var n = Oe(), r = D(), i = S(), o = O(), s = a(), c = E(), l = Object.prototype.hasOwnProperty;
288
- function u(e, t) {
289
- var a = i(e), u = !a && r(e), d = !a && !u && o(e), f = !a && !u && !d && c(e), p = a || u || d || f, m = p ? n(e.length, String) : [], h = m.length;
290
- for (var g in e) (t || l.call(e, g)) && !(p && (g == "length" || d && (g == "offset" || g == "parent") || f && (g == "buffer" || g == "byteLength" || g == "byteOffset") || s(g, h))) && m.push(g);
291
- return m;
292
- }
293
- t.exports = u;
294
- })), R = /* @__PURE__ */ T(((e, t) => {
295
- var r = ke(), i = n(), a = s();
296
- function o(e) {
297
- return a(e) ? r(e) : i(e);
298
- }
299
- t.exports = o;
300
- })), Ae = /* @__PURE__ */ T(((e, t) => {
301
- var n = De(), r = R();
302
- function i(e, t) {
303
- return e && n(e, t, r);
304
- }
305
- t.exports = i;
306
- })), je = /* @__PURE__ */ T(((e, t) => {
307
- var n = s();
308
- function r(e, t) {
309
- return function(r, i) {
310
- if (r == null) return r;
311
- if (!n(r)) return e(r, i);
312
- for (var a = r.length, o = t ? a : -1, s = Object(r); (t ? o-- : ++o < a) && i(s[o], o, s) !== !1;);
313
- return r;
314
- };
315
- }
316
- t.exports = r;
317
- })), Me = /* @__PURE__ */ T(((e, t) => {
318
- var n = Ae();
319
- t.exports = je()(n);
320
- })), Ne = /* @__PURE__ */ T(((e, t) => {
321
- var n = N();
322
- function r() {
323
- this.__data__ = new n(), this.size = 0;
324
- }
325
- t.exports = r;
326
- })), Pe = /* @__PURE__ */ T(((e, t) => {
327
- function n(e) {
328
- var t = this.__data__, n = t.delete(e);
329
- return this.size = t.size, n;
330
- }
331
- t.exports = n;
332
- })), Fe = /* @__PURE__ */ T(((e, t) => {
333
- function n(e) {
334
- return this.__data__.get(e);
335
- }
336
- t.exports = n;
337
- })), Ie = /* @__PURE__ */ T(((e, t) => {
338
- function n(e) {
339
- return this.__data__.has(e);
340
- }
341
- t.exports = n;
342
- })), Le = /* @__PURE__ */ T(((e, t) => {
343
- var n = N(), r = i(), a = F(), o = 200;
344
- function s(e, t) {
345
- var i = this.__data__;
346
- if (i instanceof n) {
347
- var s = i.__data__;
348
- if (!r || s.length < o - 1) return s.push([e, t]), this.size = ++i.size, this;
349
- i = this.__data__ = new a(s);
350
- }
351
- return i.set(e, t), this.size = i.size, this;
352
- }
353
- t.exports = s;
354
- })), Re = /* @__PURE__ */ T(((e, t) => {
355
- var n = N(), r = Ne(), i = Pe(), a = Fe(), o = Ie(), s = Le();
356
- function c(e) {
357
- var t = this.__data__ = new n(e);
358
- this.size = t.size;
359
- }
360
- c.prototype.clear = r, c.prototype.delete = i, c.prototype.get = a, c.prototype.has = o, c.prototype.set = s, t.exports = c;
361
- })), ze = /* @__PURE__ */ T(((e, t) => {
362
- function n(e) {
363
- return this.__data__.set(e, "__lodash_hash_undefined__"), this;
364
- }
365
- t.exports = n;
366
- })), Be = /* @__PURE__ */ T(((e, t) => {
367
- function n(e) {
368
- return this.__data__.has(e);
369
- }
370
- t.exports = n;
371
- })), Ve = /* @__PURE__ */ T(((e, t) => {
372
- var n = F(), r = ze(), i = Be();
373
- function a(e) {
374
- var t = -1, r = e == null ? 0 : e.length;
375
- for (this.__data__ = new n(); ++t < r;) this.add(e[t]);
376
- }
377
- a.prototype.add = a.prototype.push = r, a.prototype.has = i, t.exports = a;
378
- })), He = /* @__PURE__ */ T(((e, t) => {
379
- function n(e, t) {
380
- for (var n = -1, r = e == null ? 0 : e.length; ++n < r;) if (t(e[n], n, e)) return !0;
381
- return !1;
382
- }
383
- t.exports = n;
384
- })), Ue = /* @__PURE__ */ T(((e, t) => {
385
- function n(e, t) {
386
- return e.has(t);
387
- }
388
- t.exports = n;
389
- })), We = /* @__PURE__ */ T(((e, t) => {
390
- var n = Ve(), r = He(), i = Ue(), a = 1, o = 2;
391
- function s(e, t, s, c, l, u) {
392
- var d = s & a, f = e.length, p = t.length;
393
- if (f != p && !(d && p > f)) return !1;
394
- var m = u.get(e), h = u.get(t);
395
- if (m && h) return m == t && h == e;
396
- var g = -1, _ = !0, v = s & o ? new n() : void 0;
397
- for (u.set(e, t), u.set(t, e); ++g < f;) {
398
- var y = e[g], b = t[g];
399
- if (c) var x = d ? c(b, y, g, t, e, u) : c(y, b, g, e, t, u);
400
- if (x !== void 0) {
401
- if (x) continue;
402
- _ = !1;
403
- break;
404
- }
405
- if (v) {
406
- if (!r(t, function(e, t) {
407
- if (!i(v, t) && (y === e || l(y, e, s, c, u))) return v.push(t);
408
- })) {
409
- _ = !1;
410
- break;
411
- }
412
- } else if (!(y === b || l(y, b, s, c, u))) {
413
- _ = !1;
414
- break;
415
- }
416
- }
417
- return u.delete(e), u.delete(t), _;
418
- }
419
- t.exports = s;
420
- })), Ge = /* @__PURE__ */ T(((e, t) => {
421
- t.exports = y().Uint8Array;
422
- })), Ke = /* @__PURE__ */ T(((e, t) => {
423
- function n(e) {
424
- var t = -1, n = Array(e.size);
425
- return e.forEach(function(e, r) {
426
- n[++t] = [r, e];
427
- }), n;
428
- }
429
- t.exports = n;
430
- })), qe = /* @__PURE__ */ T(((e, t) => {
431
- function n(e) {
432
- var t = -1, n = Array(e.size);
433
- return e.forEach(function(e) {
434
- n[++t] = e;
435
- }), n;
436
- }
437
- t.exports = n;
438
- })), Je = /* @__PURE__ */ T(((e, t) => {
439
- var n = C(), r = Ge(), i = j(), a = We(), o = Ke(), s = qe(), c = 1, l = 2, u = "[object Boolean]", d = "[object Date]", f = "[object Error]", p = "[object Map]", m = "[object Number]", h = "[object RegExp]", g = "[object Set]", _ = "[object String]", v = "[object Symbol]", y = "[object ArrayBuffer]", b = "[object DataView]", x = n ? n.prototype : void 0, S = x ? x.valueOf : void 0;
440
- function w(e, t, n, x, C, w, T) {
441
- switch (n) {
442
- case b:
443
- if (e.byteLength != t.byteLength || e.byteOffset != t.byteOffset) return !1;
444
- e = e.buffer, t = t.buffer;
445
- case y: return !(e.byteLength != t.byteLength || !w(new r(e), new r(t)));
446
- case u:
447
- case d:
448
- case m: return i(+e, +t);
449
- case f: return e.name == t.name && e.message == t.message;
450
- case h:
451
- case _: return e == t + "";
452
- case p: var E = o;
453
- case g:
454
- var D = x & c;
455
- if (E ||= s, e.size != t.size && !D) return !1;
456
- var O = T.get(e);
457
- if (O) return O == t;
458
- x |= l, T.set(e, t);
459
- var k = a(E(e), E(t), x, C, w, T);
460
- return T.delete(e), k;
461
- case v: if (S) return S.call(e) == S.call(t);
462
- }
463
- return !1;
464
- }
465
- t.exports = w;
466
- })), Ye = /* @__PURE__ */ T(((e, t) => {
467
- function n(e, t) {
468
- for (var n = -1, r = t.length, i = e.length; ++n < r;) e[i + n] = t[n];
469
- return e;
470
- }
471
- t.exports = n;
472
- })), Xe = /* @__PURE__ */ T(((e, t) => {
473
- var n = Ye(), r = S();
474
- function i(e, t, i) {
475
- var a = t(e);
476
- return r(e) ? a : n(a, i(e));
477
- }
478
- t.exports = i;
479
- })), Ze = /* @__PURE__ */ T(((e, t) => {
480
- function n() {
481
- return [];
482
- }
483
- t.exports = n;
484
- })), Qe = /* @__PURE__ */ T(((e, t) => {
485
- var n = Te(), r = Ze(), i = Object.prototype.propertyIsEnumerable, a = Object.getOwnPropertySymbols;
486
- t.exports = a ? function(e) {
487
- return e == null ? [] : (e = Object(e), n(a(e), function(t) {
488
- return i.call(e, t);
489
- }));
490
- } : r;
491
- })), $e = /* @__PURE__ */ T(((e, t) => {
492
- var n = Xe(), r = Qe(), i = R();
493
- function a(e) {
494
- return n(e, i, r);
495
- }
496
- t.exports = a;
497
- })), et = /* @__PURE__ */ T(((e, t) => {
498
- var n = $e(), r = 1, i = Object.prototype.hasOwnProperty;
499
- function a(e, t, a, o, s, c) {
500
- var l = a & r, u = n(e), d = u.length;
501
- if (d != n(t).length && !l) return !1;
502
- for (var f = d; f--;) {
503
- var p = u[f];
504
- if (!(l ? p in t : i.call(t, p))) return !1;
505
- }
506
- var m = c.get(e), h = c.get(t);
507
- if (m && h) return m == t && h == e;
508
- var g = !0;
509
- c.set(e, t), c.set(t, e);
510
- for (var _ = l; ++f < d;) {
511
- p = u[f];
512
- var v = e[p], y = t[p];
513
- if (o) var b = l ? o(y, v, p, t, e, c) : o(v, y, p, e, t, c);
514
- if (!(b === void 0 ? v === y || s(v, y, a, o, c) : b)) {
515
- g = !1;
516
- break;
517
- }
518
- _ ||= p == "constructor";
519
- }
520
- if (g && !_) {
521
- var x = e.constructor, S = t.constructor;
522
- x != S && "constructor" in e && "constructor" in t && !(typeof x == "function" && x instanceof x && typeof S == "function" && S instanceof S) && (g = !1);
523
- }
524
- return c.delete(e), c.delete(t), g;
525
- }
526
- t.exports = a;
527
- })), tt = /* @__PURE__ */ T(((e, t) => {
528
- var n = Re(), r = We(), i = Je(), a = et(), o = c(), s = S(), l = O(), u = E(), d = 1, f = "[object Arguments]", p = "[object Array]", m = "[object Object]", h = Object.prototype.hasOwnProperty;
529
- function g(e, t, c, g, _, v) {
530
- var y = s(e), b = s(t), x = y ? p : o(e), S = b ? p : o(t);
531
- x = x == f ? m : x, S = S == f ? m : S;
532
- var C = x == m, w = S == m, T = x == S;
533
- if (T && l(e)) {
534
- if (!l(t)) return !1;
535
- y = !0, C = !1;
536
- }
537
- if (T && !C) return v ||= new n(), y || u(e) ? r(e, t, c, g, _, v) : i(e, t, x, c, g, _, v);
538
- if (!(c & d)) {
539
- var E = C && h.call(e, "__wrapped__"), D = w && h.call(t, "__wrapped__");
540
- if (E || D) {
541
- var O = E ? e.value() : e, k = D ? t.value() : t;
542
- return v ||= new n(), _(O, k, c, g, v);
543
- }
544
- }
545
- return T ? (v ||= new n(), a(e, t, c, g, _, v)) : !1;
546
- }
547
- t.exports = g;
548
- })), nt = /* @__PURE__ */ T(((t, n) => {
549
- var r = tt(), i = e();
550
- function a(e, t, n, o, s) {
551
- return e === t ? !0 : e == null || t == null || !i(e) && !i(t) ? e !== e && t !== t : r(e, t, n, o, a, s);
552
- }
553
- n.exports = a;
554
- })), rt = /* @__PURE__ */ T(((e, t) => {
555
- var n = Re(), r = nt(), i = 1, a = 2;
556
- function o(e, t, o, s) {
557
- var c = o.length, l = c, u = !s;
558
- if (e == null) return !l;
559
- for (e = Object(e); c--;) {
560
- var d = o[c];
561
- if (u && d[2] ? d[1] !== e[d[0]] : !(d[0] in e)) return !1;
562
- }
563
- for (; ++c < l;) {
564
- d = o[c];
565
- var f = d[0], p = e[f], m = d[1];
566
- if (u && d[2]) {
567
- if (p === void 0 && !(f in e)) return !1;
568
- } else {
569
- var h = new n();
570
- if (s) var g = s(p, m, f, e, t, h);
571
- if (!(g === void 0 ? r(m, p, i | a, s, h) : g)) return !1;
572
- }
573
- }
574
- return !0;
575
- }
576
- t.exports = o;
577
- })), it = /* @__PURE__ */ T(((e, t) => {
578
- var n = u();
579
- function r(e) {
580
- return e === e && !n(e);
581
- }
582
- t.exports = r;
583
- })), at = /* @__PURE__ */ T(((e, t) => {
584
- var n = it(), r = R();
585
- function i(e) {
586
- for (var t = r(e), i = t.length; i--;) {
587
- var a = t[i], o = e[a];
588
- t[i] = [
589
- a,
590
- o,
591
- n(o)
592
- ];
593
- }
594
- return t;
595
- }
596
- t.exports = i;
597
- })), ot = /* @__PURE__ */ T(((e, t) => {
598
- function n(e, t) {
599
- return function(n) {
600
- return n != null && n[e] === t && (t !== void 0 || e in Object(n));
601
- };
602
- }
603
- t.exports = n;
604
- })), st = /* @__PURE__ */ T(((e, t) => {
605
- var n = rt(), r = at(), i = ot();
606
- function a(e) {
607
- var t = r(e);
608
- return t.length == 1 && t[0][2] ? i(t[0][0], t[0][1]) : function(r) {
609
- return r === e || n(r, e, t);
610
- };
611
- }
612
- t.exports = a;
613
- })), ct = /* @__PURE__ */ T(((e, t) => {
614
- var n = Ce();
615
- function r(e, t, r) {
616
- var i = e == null ? void 0 : n(e, t);
617
- return i === void 0 ? r : i;
618
- }
619
- t.exports = r;
620
- })), lt = /* @__PURE__ */ T(((e, t) => {
621
- function n(e, t) {
622
- return e != null && t in Object(e);
623
- }
624
- t.exports = n;
625
- })), ut = /* @__PURE__ */ T(((e, n) => {
626
- var r = I(), i = D(), o = S(), s = a(), c = t(), l = L();
627
- function u(e, t, n) {
628
- t = r(t, e);
629
- for (var a = -1, u = t.length, d = !1; ++a < u;) {
630
- var f = l(t[a]);
631
- if (!(d = e != null && n(e, f))) break;
632
- e = e[f];
633
- }
634
- return d || ++a != u ? d : (u = e == null ? 0 : e.length, !!u && c(u) && s(f, u) && (o(e) || i(e)));
635
- }
636
- n.exports = u;
637
- })), dt = /* @__PURE__ */ T(((e, t) => {
638
- var n = lt(), r = ut();
639
- function i(e, t) {
640
- return e != null && r(e, t, n);
641
- }
642
- t.exports = i;
643
- })), ft = /* @__PURE__ */ T(((e, t) => {
644
- var n = nt(), r = ct(), i = dt(), a = k(), o = it(), s = ot(), c = L(), l = 1, u = 2;
645
- function d(e, t) {
646
- return a(e) && o(t) ? s(c(e), t) : function(a) {
647
- var o = r(a, e);
648
- return o === void 0 && o === t ? i(a, e) : n(t, o, l | u);
649
- };
650
- }
651
- t.exports = d;
652
- })), pt = /* @__PURE__ */ T(((e, t) => {
653
- function n(e) {
654
- return function(t) {
655
- return t?.[e];
656
- };
657
- }
658
- t.exports = n;
659
- })), mt = /* @__PURE__ */ T(((e, t) => {
660
- var n = Ce();
661
- function r(e) {
662
- return function(t) {
663
- return n(t, e);
664
- };
665
- }
666
- t.exports = r;
667
- })), ht = /* @__PURE__ */ T(((e, t) => {
668
- var n = pt(), r = mt(), i = k(), a = L();
669
- function o(e) {
670
- return i(e) ? n(a(e)) : r(e);
671
- }
672
- t.exports = o;
673
- })), gt = /* @__PURE__ */ T(((e, t) => {
674
- var n = st(), i = ft(), a = r(), o = S(), s = ht();
675
- function c(e) {
676
- return typeof e == "function" ? e : e == null ? a : typeof e == "object" ? o(e) ? i(e[0], e[1]) : n(e) : s(e);
677
- }
678
- t.exports = c;
679
- })), _t = class {
680
- constructor(e, t = "single") {
681
- this.canvases = e, this.viewType = t, this._groupings = null;
682
- }
683
- getCanvases(e) {
684
- switch (this.viewType) {
685
- case "book": return this.groupings()[Math.ceil(e / 2)];
686
- default: return this.groupings()[e];
687
- }
688
- }
689
- groupings() {
690
- if (this._groupings) return this._groupings;
691
- if (this.viewType === "scroll") return [this.canvases];
692
- if (this.viewType !== "book") return this.canvases.map((e) => [e]);
693
- let e = [];
694
- return this.canvases.forEach((t, n) => {
695
- if (n === 0) {
696
- e.push([t]);
697
- return;
698
- }
699
- n % 2 == 0 ? e[Math.ceil(n / 2)].push(t) : e.push([t]);
700
- }), this._groupings = e, e;
701
- }
702
- }, vt = /* @__PURE__ */ T(((e, t) => {
703
- (function(n, r) {
704
- typeof e == "object" && typeof t == "object" ? t.exports = r() : typeof define == "function" && define.amd ? define("manifesto", [], r) : typeof e == "object" ? e.manifesto = r() : n.manifesto = r();
705
- })(Object(typeof self < "u" ? self : e), () => (() => {
706
- var e = {
707
- 19(e, t) {
708
- Object.defineProperty(t, "__esModule", { value: !0 }), t.CONTINUE = 100, t.SWITCHING_PROTOCOLS = 101, t.PROCESSING = 102, t.OK = 200, t.CREATED = 201, t.ACCEPTED = 202, t.NON_AUTHORITATIVE_INFORMATION = 203, t.NO_CONTENT = 204, t.RESET_CONTENT = 205, t.PARTIAL_CONTENT = 206, t.MULTI_STATUS = 207, t.MULTIPLE_CHOICES = 300, t.MOVED_PERMANENTLY = 301, t.MOVED_TEMPORARILY = 302, t.SEE_OTHER = 303, t.NOT_MODIFIED = 304, t.USE_PROXY = 305, t.TEMPORARY_REDIRECT = 307, t.BAD_REQUEST = 400, t.UNAUTHORIZED = 401, t.PAYMENT_REQUIRED = 402, t.FORBIDDEN = 403, t.NOT_FOUND = 404, t.METHOD_NOT_ALLOWED = 405, t.NOT_ACCEPTABLE = 406, t.PROXY_AUTHENTICATION_REQUIRED = 407, t.REQUEST_TIME_OUT = 408, t.CONFLICT = 409, t.GONE = 410, t.LENGTH_REQUIRED = 411, t.PRECONDITION_FAILED = 412, t.REQUEST_ENTITY_TOO_LARGE = 413, t.REQUEST_URI_TOO_LARGE = 414, t.UNSUPPORTED_MEDIA_TYPE = 415, t.REQUESTED_RANGE_NOT_SATISFIABLE = 416, t.EXPECTATION_FAILED = 417, t.IM_A_TEAPOT = 418, t.UNPROCESSABLE_ENTITY = 422, t.LOCKED = 423, t.FAILED_DEPENDENCY = 424, t.UNORDERED_COLLECTION = 425, t.UPGRADE_REQUIRED = 426, t.PRECONDITION_REQUIRED = 428, t.TOO_MANY_REQUESTS = 429, t.REQUEST_HEADER_FIELDS_TOO_LARGE = 431, t.INTERNAL_SERVER_ERROR = 500, t.NOT_IMPLEMENTED = 501, t.BAD_GATEWAY = 502, t.SERVICE_UNAVAILABLE = 503, t.GATEWAY_TIME_OUT = 504, t.HTTP_VERSION_NOT_SUPPORTED = 505, t.VARIANT_ALSO_NEGOTIATES = 506, t.INSUFFICIENT_STORAGE = 507, t.BANDWIDTH_LIMIT_EXCEEDED = 509, t.NOT_EXTENDED = 510, t.NETWORK_AUTHENTICATION_REQUIRED = 511;
709
- },
710
- 957(e, t) {
711
- var n, r, i, a, o, s, c, l, u, d;
712
- Object.defineProperty(t, "__esModule", { value: !0 }), t.ViewingHint = t.ViewingDirection = t.ServiceType = t.ServiceProfile = t.RenderingFormat = t.MediaType = t.IIIFResourceType = t.ExternalResourceType = t.Behavior = t.AnnotationMotivation = void 0, function(e) {
713
- e.BOOKMARKING = "oa:bookmarking", e.CLASSIFYING = "oa:classifying", e.COMMENTING = "oa:commenting", e.DESCRIBING = "oa:describing", e.EDITING = "oa:editing", e.HIGHLIGHTING = "oa:highlighting", e.IDENTIFYING = "oa:identifying", e.LINKING = "oa:linking", e.MODERATING = "oa:moderating", e.PAINTING = "sc:painting", e.QUESTIONING = "oa:questioning", e.REPLYING = "oa:replying", e.TAGGING = "oa:tagging", e.TRANSCRIBING = "oad:transcribing";
714
- }(n || (t.AnnotationMotivation = n = {})), function(e) {
715
- e.AUTO_ADVANCE = "auto-advance", e.CONTINUOUS = "continuous", e.FACING_PAGES = "facing-pages", e.HIDDEN = "hidden", e.INDIVIDUALS = "individuals", e.MULTI_PART = "multi-part", e.NO_NAV = "no-nav", e.NON_PAGED = "non-paged", e.PAGED = "paged", e.REPEAT = "repeat", e.SEQUENCE = "sequence", e.THUMBNAIL_NAV = "thumbnail-nav", e.TOGETHER = "together", e.UNORDERED = "unordered";
716
- }(r || (t.Behavior = r = {})), function(e) {
717
- e.CANVAS = "canvas", e.CHOICE = "choice", e.OA_CHOICE = "oa:choice", e.CONTENT_AS_TEXT = "contentastext", e.DATASET = "dataset", e.DOCUMENT = "document", e.IMAGE = "image", e.MODEL = "model", e.MOVING_IMAGE = "movingimage", e.PDF = "pdf", e.PHYSICAL_OBJECT = "physicalobject", e.SOUND = "sound", e.TEXT = "text", e.TEXTUALBODY = "textualbody", e.VIDEO = "video";
718
- }(i || (t.ExternalResourceType = i = {})), function(e) {
719
- e.ANNOTATION = "annotation", e.CANVAS = "canvas", e.COLLECTION = "collection", e.MANIFEST = "manifest", e.RANGE = "range", e.SEQUENCE = "sequence";
720
- }(a || (t.IIIFResourceType = a = {})), function(e) {
721
- e.AUDIO_MP4 = "audio/mp4", e.CORTO = "application/corto", e.DICOM = "application/dicom", e.DRACO = "application/draco", e.EPUB = "application/epub+zip", e.GIRDER = "image/vnd.kitware.girder", e.GLB = "model/gltf-binary", e.GLTF = "model/gltf+json", e.IIIF_PRESENTATION_2 = "application/ld+json;profile=\"http://iiif.io/api/presentation/2/context.json\"", e.IIIF_PRESENTATION_3 = "application/ld+json;profile=\"http://iiif.io/api/presentation/3/context.json\"", e.JPG = "image/jpeg", e.M3U8 = "application/vnd.apple.mpegurl", e.MP3 = "audio/mp3", e.MPEG = "audio/mpeg", e.MPEG_DASH = "application/dash+xml", e.OBJ = "model/obj", e.OPF = "application/oebps-package+xml", e.PDF = "application/pdf", e.PLY = "application/ply", e.THREEJS = "application/vnd.threejs+json", e.USDZ = "model/vnd.usd+zip", e.VIDEO_MP4 = "video/mp4", e.WAV = "audio/wav", e.WEBM = "video/webm";
722
- }(o || (t.MediaType = o = {})), function(e) {
723
- e.DOC = "application/msword", e.DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document", e.ODT = "application/vnd.oasis.opendocument.text", e.PDF = "application/pdf";
724
- }(s || (t.RenderingFormat = s = {})), function(e) {
725
- e.IMAGE_0_COMPLIANCE_LEVEL_0 = "http://library.stanford.edu/iiif/image-api/compliance.html#level0", e.IMAGE_0_COMPLIANCE_LEVEL_1 = "http://library.stanford.edu/iiif/image-api/compliance.html#level1", e.IMAGE_0_COMPLIANCE_LEVEL_2 = "http://library.stanford.edu/iiif/image-api/compliance.html#level2", e.IMAGE_0_CONFORMANCE_LEVEL_0 = "http://library.stanford.edu/iiif/image-api/conformance.html#level0", e.IMAGE_0_CONFORMANCE_LEVEL_1 = "http://library.stanford.edu/iiif/image-api/conformance.html#level1", e.IMAGE_0_CONFORMANCE_LEVEL_2 = "http://library.stanford.edu/iiif/image-api/conformance.html#level2", e.IMAGE_1_COMPLIANCE_LEVEL_0 = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0", e.IMAGE_1_COMPLIANCE_LEVEL_1 = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1", e.IMAGE_1_COMPLIANCE_LEVEL_2 = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", e.IMAGE_1_CONFORMANCE_LEVEL_0 = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0", e.IMAGE_1_CONFORMANCE_LEVEL_1 = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1", e.IMAGE_1_CONFORMANCE_LEVEL_2 = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2", e.IMAGE_1_LEVEL_0 = "http://iiif.io/api/image/1/level0.json", e.IMAGE_1_PROFILE_LEVEL_0 = "http://iiif.io/api/image/1/profiles/level0.json", e.IMAGE_1_LEVEL_1 = "http://iiif.io/api/image/1/level1.json", e.IMAGE_1_PROFILE_LEVEL_1 = "http://iiif.io/api/image/1/profiles/level1.json", e.IMAGE_1_LEVEL_2 = "http://iiif.io/api/image/1/level2.json", e.IMAGE_1_PROFILE_LEVEL_2 = "http://iiif.io/api/image/1/profiles/level2.json", e.IMAGE_2_LEVEL_0 = "http://iiif.io/api/image/2/level0.json", e.IMAGE_2_PROFILE_LEVEL_0 = "http://iiif.io/api/image/2/profiles/level0.json", e.IMAGE_2_LEVEL_1 = "http://iiif.io/api/image/2/level1.json", e.IMAGE_2_PROFILE_LEVEL_1 = "http://iiif.io/api/image/2/profiles/level1.json", e.IMAGE_2_LEVEL_2 = "http://iiif.io/api/image/2/level2.json", e.IMAGE_2_PROFILE_LEVEL_2 = "http://iiif.io/api/image/2/profiles/level2.json", e.AUTH_0_CLICK_THROUGH = "http://iiif.io/api/auth/0/login/clickthrough", e.AUTH_0_LOGIN = "http://iiif.io/api/auth/0/login", e.AUTH_0_LOGOUT = "http://iiif.io/api/auth/0/logout", e.AUTH_0_RESTRICTED = "http://iiif.io/api/auth/0/login/restricted", e.AUTH_0_TOKEN = "http://iiif.io/api/auth/0/token", e.AUTH_1_CLICK_THROUGH = "http://iiif.io/api/auth/1/clickthrough", e.AUTH_1_EXTERNAL = "http://iiif.io/api/auth/1/external", e.AUTH_1_KIOSK = "http://iiif.io/api/auth/1/kiosk", e.AUTH_1_LOGIN = "http://iiif.io/api/auth/1/login", e.AUTH_1_LOGOUT = "http://iiif.io/api/auth/1/logout", e.AUTH_1_PROBE = "http://iiif.io/api/auth/1/probe", e.AUTH_1_TOKEN = "http://iiif.io/api/auth/1/token", e.SEARCH_0 = "http://iiif.io/api/search/0/search", e.SEARCH_0_AUTO_COMPLETE = "http://iiif.io/api/search/0/autocomplete", e.SEARCH_1 = "http://iiif.io/api/search/1/search", e.SEARCH_1_AUTO_COMPLETE = "http://iiif.io/api/search/1/autocomplete", e.TRACKING_EXTENSIONS = "http://universalviewer.io/tracking-extensions-profile", e.UI_EXTENSIONS = "http://universalviewer.io/ui-extensions-profile", e.PRINT_EXTENSIONS = "http://universalviewer.io/print-extensions-profile", e.SHARE_EXTENSIONS = "http://universalviewer.io/share-extensions-profile", e.DOWNLOAD_EXTENSIONS = "http://universalviewer.io/download-extensions-profile", e.OTHER_MANIFESTATIONS = "http://iiif.io/api/otherManifestations.json", e.IXIF = "http://wellcomelibrary.org/ld/ixif/0/alpha.json";
726
- }(c || (t.ServiceProfile = c = {})), function(e) {
727
- e.IMAGE_SERVICE_2 = "ImageService2", e.IMAGE_SERVICE_3 = "ImageService3";
728
- }(l || (t.ServiceType = l = {})), function(e) {
729
- e.BOTTOM_TO_TOP = "bottom-to-top", e.LEFT_TO_RIGHT = "left-to-right", e.RIGHT_TO_LEFT = "right-to-left", e.TOP_TO_BOTTOM = "top-to-bottom";
730
- }(u || (t.ViewingDirection = u = {})), function(e) {
731
- e.CONTINUOUS = "continuous", e.INDIVIDUALS = "individuals", e.NON_PAGED = "non-paged", e.PAGED = "paged", e.TOP = "top";
732
- }(d || (t.ViewingHint = d = {}));
733
- },
734
- 916(e, t, n) {
735
- e.exports = self.fetch || (self.fetch = n(782).default || n(782));
736
- },
737
- 39(e, t, n) {
738
- var r, i = this && this.__extends || (r = function(e, t) {
739
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
740
- e.__proto__ = t;
741
- } || function(e, t) {
742
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
743
- }, r(e, t);
744
- }, function(e, t) {
745
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
746
- function n() {
747
- this.constructor = e;
748
- }
749
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
750
- });
751
- Object.defineProperty(t, "__esModule", { value: !0 }), t.Annotation = void 0;
752
- var a = n(799);
753
- t.Annotation = function(e) {
754
- function t(t, n) {
755
- return e.call(this, t, n) || this;
756
- }
757
- return i(t, e), t.prototype.getBody = function() {
758
- var e = [], t = this.getProperty("body");
759
- if (t) {
760
- if (Array.isArray(t)) for (var n = 0; n < t.length; n++) if ((o = t[n]).items) for (var r = 0; r < o.items.length; r++) {
761
- var i = o.items[r];
762
- e.push(new a.AnnotationBody(i, this.options));
763
- }
764
- else e.push(new a.AnnotationBody(o, this.options));
765
- else if (t.items) for (n = 0; n < t.items.length; n++) {
766
- var o = t.items[n];
767
- e.push(new a.AnnotationBody(o, this.options));
768
- }
769
- else e.push(new a.AnnotationBody(t, this.options));
770
- }
771
- return e;
772
- }, t.prototype.getMotivation = function() {
773
- return this.getProperty("motivation") || null;
774
- }, t.prototype.getOn = function() {
775
- return this.getProperty("on");
776
- }, t.prototype.getTarget = function() {
777
- return this.getProperty("target");
778
- }, t.prototype.getResource = function() {
779
- return new a.Resource(this.getProperty("resource"), this.options);
780
- }, t;
781
- }(a.ManifestResource);
782
- },
783
- 339(e, t, n) {
784
- var r, i = this && this.__extends || (r = function(e, t) {
785
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
786
- e.__proto__ = t;
787
- } || function(e, t) {
788
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
789
- }, r(e, t);
790
- }, function(e, t) {
791
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
792
- function n() {
793
- this.constructor = e;
794
- }
795
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
796
- });
797
- Object.defineProperty(t, "__esModule", { value: !0 }), t.AnnotationBody = void 0;
798
- var a = n(799);
799
- t.AnnotationBody = function(e) {
800
- function t(t, n) {
801
- return e.call(this, t, n) || this;
802
- }
803
- return i(t, e), t.prototype.getFormat = function() {
804
- var e = this.getProperty("format");
805
- return e ? a.Utils.getMediaType(e) : null;
806
- }, t.prototype.getType = function() {
807
- return this.getProperty("type") ? a.Utils.normaliseType(this.getProperty("type")) : null;
808
- }, t.prototype.getValue = function() {
809
- return this.getProperty("value");
810
- }, t.prototype.getLanguage = function() {
811
- return this.getProperty("language");
812
- }, t.prototype.getWidth = function() {
813
- return this.getProperty("width");
814
- }, t.prototype.getHeight = function() {
815
- return this.getProperty("height");
816
- }, t;
817
- }(a.ManifestResource);
818
- },
819
- 435(e, t, n) {
820
- var r, i = this && this.__extends || (r = function(e, t) {
821
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
822
- e.__proto__ = t;
823
- } || function(e, t) {
824
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
825
- }, r(e, t);
826
- }, function(e, t) {
827
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
828
- function n() {
829
- this.constructor = e;
830
- }
831
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
832
- });
833
- Object.defineProperty(t, "__esModule", { value: !0 }), t.AnnotationList = void 0;
834
- var a = n(799);
835
- t.AnnotationList = function(e) {
836
- function t(t, n, r) {
837
- var i = e.call(this, n) || this;
838
- return i.label = t, i.options = r, i;
839
- }
840
- return i(t, e), t.prototype.getIIIFResourceType = function() {
841
- return a.Utils.normaliseType(this.getProperty("type"));
842
- }, t.prototype.getLabel = function() {
843
- return this.label;
844
- }, t.prototype.getResources = function() {
845
- var e = this;
846
- return this.getProperty("resources").map(function(t) {
847
- return new a.Annotation(t, e.options);
848
- });
849
- }, t.prototype.load = function() {
850
- var e = this;
851
- return new Promise(function(t, n) {
852
- if (e.isLoaded) t(e);
853
- else {
854
- var r = e.__jsonld.id;
855
- r ||= e.__jsonld["@id"], a.Utils.loadManifest(r).then(function(n) {
856
- e.__jsonld = n, e.context = e.getProperty("context"), e.id = e.getProperty("id"), e.isLoaded = !0, t(e);
857
- }).catch(n);
858
- }
859
- });
860
- }, t;
861
- }(a.JSONLDResource);
862
- },
863
- 556(e, t, n) {
864
- var r, i = this && this.__extends || (r = function(e, t) {
865
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
866
- e.__proto__ = t;
867
- } || function(e, t) {
868
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
869
- }, r(e, t);
870
- }, function(e, t) {
871
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
872
- function n() {
873
- this.constructor = e;
874
- }
875
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
876
- });
877
- Object.defineProperty(t, "__esModule", { value: !0 }), t.AnnotationPage = void 0;
878
- var a = n(799);
879
- t.AnnotationPage = function(e) {
880
- function t(t, n) {
881
- return e.call(this, t, n) || this;
882
- }
883
- return i(t, e), t.prototype.getItems = function() {
884
- return this.getProperty("items");
885
- }, t.prototype.getAnnotations = function() {
886
- var e = [], t = this.getProperty("items");
887
- if (!t || !Array.isArray(t)) return e;
888
- for (var n = 0; n < t.length; n++) {
889
- var r = new a.Annotation(t[n], this.options);
890
- e.push(r);
891
- }
892
- return e;
893
- }, t;
894
- }(a.ManifestResource);
895
- },
896
- 98(e, t, n) {
897
- var r, i = this && this.__extends || (r = function(e, t) {
898
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
899
- e.__proto__ = t;
900
- } || function(e, t) {
901
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
902
- }, r(e, t);
903
- }, function(e, t) {
904
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
905
- function n() {
906
- this.constructor = e;
907
- }
908
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
909
- });
910
- Object.defineProperty(t, "__esModule", { value: !0 }), t.Canvas = void 0;
911
- var a = n(957), o = n(799);
912
- t.Canvas = function(e) {
913
- function t(t, n) {
914
- return e.call(this, t, n) || this;
915
- }
916
- return i(t, e), t.prototype.getCanonicalImageUri = function(e) {
917
- var t = null, n = "default", r = e, i = r + ",";
918
- if (this.externalResource && this.externalResource.data && this.externalResource.data["@id"]) t = this.externalResource.data["@id"], r ||= this.externalResource.data.width, this.externalResource.data["@context"] && (this.externalResource.data["@context"].indexOf("/1.0/context.json") > -1 || this.externalResource.data["@context"].indexOf("/1.1/context.json") > -1 || this.externalResource.data["@context"].indexOf("/1/context.json") > -1) && (n = "native");
919
- else {
920
- var a = void 0;
921
- if ((a = this.getImages()) && a.length) {
922
- var s = a[0].getResource(), c = s.getServices();
923
- if (r ||= s.getWidth(), l = c ? c.find(function(e) {
924
- return o.Utils.isImageProfile(e.getProfile()) || o.Utils.isImageServiceType(e.getIIIFResourceType());
925
- }) : null) t = l.id, n = o.Utils.getImageQuality(l.getProfile());
926
- else if (r === s.getWidth()) return s.id;
927
- }
928
- if ((a = this.getContent()) && a.length) {
929
- var l, u = a[0].getBody()[0];
930
- if (c = u.getServices(), r ||= u.getWidth(), l = c ? c.find(function(e) {
931
- return o.Utils.isImageServiceType(e.getIIIFResourceType());
932
- }) : null) t = l.id, n = o.Utils.getImageQuality(l.getProfile());
933
- else if (r === u.getWidth()) return u.id;
934
- }
935
- if (!t) {
936
- var d = this.getProperty("thumbnail");
937
- if (d) {
938
- if (typeof d == "string") return d;
939
- if (d["@id"]) return d["@id"];
940
- if (d.length) return d[0].id;
941
- }
942
- }
943
- }
944
- return t && t.endsWith("/") && (t = t.substr(0, t.length - 1)), [
945
- t,
946
- "full",
947
- i,
948
- 0,
949
- n + ".jpg"
950
- ].join("/");
951
- }, t.prototype.getMaxDimensions = function() {
952
- var e, t = null;
953
- return this.externalResource && this.externalResource.data && this.externalResource.data.profile && (e = this.externalResource.data.profile, Array.isArray(e) && (e = e.filter(function(e) {
954
- return e.maxWidth ?? e.maxwidth;
955
- })[0]) && (t = new o.Size(e.maxWidth, e.maxHeight ? e.maxHeight : e.maxWidth))), this.externalResource && this.externalResource.data && this.externalResource.data.maxWidth && (t = new o.Size(this.externalResource.data.maxWidth, this.externalResource.data.maxHeight ? this.externalResource.data.maxHeight : this.externalResource.data.maxWidth)), t;
956
- }, t.prototype.getContent = function() {
957
- var e = [], t = this.__jsonld.items || this.__jsonld.content;
958
- if (!t) return e;
959
- var n = null;
960
- if (t.length && (n = new o.AnnotationPage(t[0], this.options)), !n) return e;
961
- for (var r = n.getAnnotations(), i = 0; i < r.length; i++) {
962
- var a = r[i];
963
- e.push(a);
964
- }
965
- return e;
966
- }, t.prototype.getAnnotations = function() {
967
- var e = [], t = this.__jsonld.annotations;
968
- if (!t || !Array.isArray(t)) return e;
969
- for (var n = 0; n < t.length; n++) {
970
- var r = new o.AnnotationPage(t[n], this.options);
971
- e.push(r);
972
- }
973
- return e;
974
- }, t.prototype.getDuration = function() {
975
- return this.getProperty("duration");
976
- }, t.prototype.getImages = function() {
977
- var e = [];
978
- if (!this.__jsonld.images) return e;
979
- for (var t = 0; t < this.__jsonld.images.length; t++) {
980
- var n = this.__jsonld.images[t], r = new o.Annotation(n, this.options);
981
- e.push(r);
982
- }
983
- return e;
984
- }, t.prototype.getIndex = function() {
985
- return this.getProperty("index");
986
- }, t.prototype.getOtherContent = function() {
987
- var e = this, t = (Array.isArray(this.getProperty("otherContent")) ? this.getProperty("otherContent") : [this.getProperty("otherContent")]).filter(function(e) {
988
- return e && typeof (t = e["@type"]) == "string" && t.toLowerCase() == t.toLowerCase();
989
- var t;
990
- }).map(function(t, n) {
991
- return new o.AnnotationList(t.label || `Annotation list ${n}`, t, e.options);
992
- }).map(function(e) {
993
- return e.load();
994
- });
995
- return Promise.all(t);
996
- }, t.prototype.getWidth = function() {
997
- return this.getProperty("width");
998
- }, t.prototype.getHeight = function() {
999
- return this.getProperty("height");
1000
- }, t.prototype.getViewingHint = function() {
1001
- var e = this.getProperty("viewingHint");
1002
- return Array.isArray(e) && (e = e[0]), e || null;
1003
- }, Object.defineProperty(t.prototype, "imageResources", {
1004
- get: function() {
1005
- var e = this;
1006
- return [this.getImages().map(function(e) {
1007
- return e.getResource();
1008
- }), this.getContent().map(function(e) {
1009
- return e.getBody();
1010
- })].flat(1 / 0).map(function(n) {
1011
- switch (n.getProperty("type").toLowerCase()) {
1012
- case a.ExternalResourceType.CHOICE:
1013
- case a.ExternalResourceType.OA_CHOICE: return new t({ images: [n.getProperty("default"), n.getProperty("item")].flat().map(function(e) {
1014
- return { resource: e };
1015
- }) }, e.options).getImages().map(function(e) {
1016
- return e.getResource();
1017
- });
1018
- default: return n;
1019
- }
1020
- }).flat();
1021
- },
1022
- enumerable: !1,
1023
- configurable: !0
1024
- }), Object.defineProperty(t.prototype, "resourceAnnotations", {
1025
- get: function() {
1026
- return [this.getImages(), this.getContent()].flat(1 / 0);
1027
- },
1028
- enumerable: !1,
1029
- configurable: !0
1030
- }), t.prototype.resourceAnnotation = function(e) {
1031
- return this.resourceAnnotations.find(function(t) {
1032
- return t.getResource().id === e || [t.getBody()].flat().some(function(t) {
1033
- return t.id === e;
1034
- });
1035
- });
1036
- }, t.prototype.onFragment = function(e) {
1037
- var t = this.resourceAnnotation(e);
1038
- if (t) {
1039
- var n = t.getProperty("on"), r = t.getProperty("target");
1040
- if (n && r) {
1041
- var i = (n || r).match(/xywh=(.*)$/);
1042
- if (i) return i[1].split(",").map(function(e) {
1043
- return parseInt(e, 10);
1044
- });
1045
- }
1046
- }
1047
- }, Object.defineProperty(t.prototype, "iiifImageResources", {
1048
- get: function() {
1049
- return this.imageResources.filter(function(e) {
1050
- return e && e.getServices()[0] && e.getServices()[0].id;
1051
- });
1052
- },
1053
- enumerable: !1,
1054
- configurable: !0
1055
- }), Object.defineProperty(t.prototype, "imageServiceIds", {
1056
- get: function() {
1057
- return this.iiifImageResources.map(function(e) {
1058
- return e.getServices()[0].id;
1059
- });
1060
- },
1061
- enumerable: !1,
1062
- configurable: !0
1063
- }), Object.defineProperty(t.prototype, "aspectRatio", {
1064
- get: function() {
1065
- return this.getWidth() / this.getHeight();
1066
- },
1067
- enumerable: !1,
1068
- configurable: !0
1069
- }), t.prototype.getChoices = function() {
1070
- for (var e = this, t = 0, n = this.getContent(); t < n.length; t++) {
1071
- var r = n[t].getProperty("body");
1072
- if (r && r.type?.toLowerCase() === a.ExternalResourceType.CHOICE && r.items && r.items.length) return r.items.map(function(t) {
1073
- return new o.AnnotationBody(t, e.options);
1074
- });
1075
- }
1076
- return [];
1077
- }, t;
1078
- }(o.Resource);
1079
- },
1080
- 214(e, t, n) {
1081
- var r, i = this && this.__extends || (r = function(e, t) {
1082
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1083
- e.__proto__ = t;
1084
- } || function(e, t) {
1085
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1086
- }, r(e, t);
1087
- }, function(e, t) {
1088
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1089
- function n() {
1090
- this.constructor = e;
1091
- }
1092
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1093
- });
1094
- Object.defineProperty(t, "__esModule", { value: !0 }), t.Collection = void 0;
1095
- var a = n(957), o = n(799);
1096
- t.Collection = function(e) {
1097
- function t(t, n) {
1098
- var r = e.call(this, t, n) || this;
1099
- return r.items = [], r._collections = null, r._manifests = null, t.__collection = r, r;
1100
- }
1101
- return i(t, e), t.prototype.getCollections = function() {
1102
- return this._collections ? this._collections : this._collections = this.items.filter(function(e) {
1103
- return e.isCollection();
1104
- });
1105
- }, t.prototype.getManifests = function() {
1106
- return this._manifests ? this._manifests : this._manifests = this.items.filter(function(e) {
1107
- return e.isManifest();
1108
- });
1109
- }, t.prototype.getCollectionByIndex = function(e) {
1110
- for (var t, n = this.getCollections(), r = 0; r < n.length; r++) {
1111
- var i = n[r];
1112
- i.index === e && (t = i);
1113
- }
1114
- if (t) return t.options.index = e, t.load();
1115
- throw Error("Collection index not found");
1116
- }, t.prototype.getManifestByIndex = function(e) {
1117
- for (var t, n = this.getManifests(), r = 0; r < n.length; r++) {
1118
- var i = n[r];
1119
- i.index === e && (t = i);
1120
- }
1121
- if (t) return t.options.index = e, t.load();
1122
- throw Error("Manifest index not found");
1123
- }, t.prototype.getTotalCollections = function() {
1124
- return this.getCollections().length;
1125
- }, t.prototype.getTotalManifests = function() {
1126
- return this.getManifests().length;
1127
- }, t.prototype.getTotalItems = function() {
1128
- return this.items.length;
1129
- }, t.prototype.getViewingDirection = function() {
1130
- return this.getProperty("viewingDirection") ? this.getProperty("viewingDirection") : a.ViewingDirection.LEFT_TO_RIGHT;
1131
- }, t.prototype.getBehavior = function() {
1132
- var e = this.getProperty("behavior");
1133
- return Array.isArray(e) && (e = e[0]), e || null;
1134
- }, t.prototype.getViewingHint = function() {
1135
- var e = this.getProperty("viewingHint");
1136
- return Array.isArray(e) && (e = e[0]), e || null;
1137
- }, t.prototype.getDefaultTree = function() {
1138
- return e.prototype.getDefaultTree.call(this), this.defaultTree.data.type = o.Utils.normaliseType(o.TreeNodeType.COLLECTION), this._parseManifests(this), this._parseCollections(this), o.Utils.generateTreeNodeIds(this.defaultTree), this.defaultTree;
1139
- }, t.prototype._parseManifests = function(e) {
1140
- if (e.getManifests() && e.getManifests().length) for (var t = 0; t < e.getManifests().length; t++) {
1141
- var n = e.getManifests()[t], r = n.getDefaultTree();
1142
- r.label = n.parentLabel || n.getLabel().getValue(this.options.locale) || "manifest " + (t + 1), r.navDate = n.getNavDate(), r.data.id = n.id, r.data.type = o.Utils.normaliseType(o.TreeNodeType.MANIFEST), e.defaultTree.addNode(r);
1143
- }
1144
- }, t.prototype._parseCollections = function(e) {
1145
- if (e.getCollections() && e.getCollections().length) for (var t = 0; t < e.getCollections().length; t++) {
1146
- var n = e.getCollections()[t], r = n.getDefaultTree();
1147
- r.label = n.parentLabel || n.getLabel().getValue(this.options.locale) || "collection " + (t + 1), r.navDate = n.getNavDate(), r.data.id = n.id, r.data.type = o.Utils.normaliseType(o.TreeNodeType.COLLECTION), e.defaultTree.addNode(r);
1148
- }
1149
- }, t;
1150
- }(o.IIIFResource);
1151
- },
1152
- 858(e, t) {
1153
- Object.defineProperty(t, "__esModule", { value: !0 }), t.Duration = void 0, t.Duration = function() {
1154
- function e(e, t) {
1155
- this.start = e, this.end = t;
1156
- }
1157
- return e.prototype.getLength = function() {
1158
- return this.end - this.start;
1159
- }, e;
1160
- }();
1161
- },
1162
- 712(e, t) {
1163
- Object.defineProperty(t, "__esModule", { value: !0 });
1164
- },
1165
- 167(e, t) {
1166
- Object.defineProperty(t, "__esModule", { value: !0 });
1167
- },
1168
- 672(e, t) {
1169
- Object.defineProperty(t, "__esModule", { value: !0 });
1170
- },
1171
- 376(e, t) {
1172
- Object.defineProperty(t, "__esModule", { value: !0 });
1173
- },
1174
- 184(e, t) {
1175
- Object.defineProperty(t, "__esModule", { value: !0 });
1176
- },
1177
- 107(e, t, n) {
1178
- var r, i = this && this.__extends || (r = function(e, t) {
1179
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1180
- e.__proto__ = t;
1181
- } || function(e, t) {
1182
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1183
- }, r(e, t);
1184
- }, function(e, t) {
1185
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1186
- function n() {
1187
- this.constructor = e;
1188
- }
1189
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1190
- });
1191
- Object.defineProperty(t, "__esModule", { value: !0 }), t.IIIFResource = void 0;
1192
- var a = n(799), o = n(957);
1193
- t.IIIFResource = function(e) {
1194
- function t(t, n) {
1195
- var r = e.call(this, t, n) || this;
1196
- return r.index = -1, r.isLoaded = !1, r.options = Object.assign({
1197
- defaultLabel: "-",
1198
- locale: "en-GB",
1199
- resource: r,
1200
- pessimisticAccessControl: !1
1201
- }, n), r;
1202
- }
1203
- return i(t, e), t.prototype.getAttribution = function() {
1204
- var e = this.getProperty("attribution");
1205
- return e ? a.PropertyValue.parse(e, this.options.locale) : new a.PropertyValue([], this.options.locale);
1206
- }, t.prototype.getDescription = function() {
1207
- var e = this.getProperty("description");
1208
- return e === void 0 && (e = this.getProperty("summary")), e ? a.PropertyValue.parse(e, this.options.locale) : new a.PropertyValue([], this.options.locale);
1209
- }, t.prototype.getSummary = function() {
1210
- var e = this.getProperty("summary");
1211
- return e === void 0 && (e = this.getProperty("description")), e ? a.PropertyValue.parse(e, this.options.locale) : new a.PropertyValue([], this.options.locale);
1212
- }, t.prototype.getHomepage = function() {
1213
- var e = this.getProperty("homepage");
1214
- return e ? typeof e == "string" ? e : (Array.isArray(e) && e.length && (e = e[0]), e["@id"] || e.id) : null;
1215
- }, t.prototype.getIIIFResourceType = function() {
1216
- return a.Utils.normaliseType(this.getProperty("type"));
1217
- }, t.prototype.getLogo = function() {
1218
- var e = this.getProperty("logo");
1219
- if (!e) {
1220
- var t = this.getProperty("provider");
1221
- if (!t) return null;
1222
- var n = t.find(function(e) {
1223
- return e.logo !== void 0;
1224
- });
1225
- e = n && n.logo !== void 0 ? n.logo : null;
1226
- }
1227
- return e ? typeof e == "string" ? e : (Array.isArray(e) && e.length && (e = e[0]), e["@id"] || e?.id) : null;
1228
- }, t.prototype.getLicense = function() {
1229
- return a.Utils.getLocalisedValue(this.getProperty("license"), this.options.locale);
1230
- }, t.prototype.getRights = function() {
1231
- var e = this.getProperty("rights");
1232
- return e ? typeof e == "string" ? e : (Array.isArray(e) && e.length && (e = e[0]), e["@id"] || e.id) : null;
1233
- }, t.prototype.getNavDate = function() {
1234
- return new Date(this.getProperty("navDate"));
1235
- }, t.prototype.getRelated = function() {
1236
- return this.getProperty("related");
1237
- }, t.prototype.getSeeAlso = function() {
1238
- return this.getProperty("seeAlso");
1239
- }, t.prototype.getTrackingLabel = function() {
1240
- var e = this.getService(o.ServiceProfile.TRACKING_EXTENSIONS);
1241
- return e ? e.getProperty("trackingLabel") : "";
1242
- }, t.prototype.getDefaultTree = function() {
1243
- return this.defaultTree = new a.TreeNode("root"), this.defaultTree.data = this, this.defaultTree;
1244
- }, t.prototype.getRequiredStatement = function() {
1245
- var e = null, t = this.getProperty("requiredStatement");
1246
- if (t) (e = new a.LabelValuePair(this.options.locale)).parse(t);
1247
- else {
1248
- var n = this.getAttribution();
1249
- n && n.length && ((e = new a.LabelValuePair(this.options.locale)).value = n);
1250
- }
1251
- return e;
1252
- }, t.prototype.isCollection = function() {
1253
- return this.getIIIFResourceType() === o.IIIFResourceType.COLLECTION;
1254
- }, t.prototype.isManifest = function() {
1255
- return this.getIIIFResourceType() === o.IIIFResourceType.MANIFEST;
1256
- }, t.prototype.load = function() {
1257
- var e = this;
1258
- return new Promise(function(t) {
1259
- if (e.isLoaded) t(e);
1260
- else {
1261
- var n = e.options;
1262
- n.navDate = e.getNavDate();
1263
- var r = e.__jsonld.id;
1264
- r ||= e.__jsonld["@id"], a.Utils.loadManifest(r).then(function(r) {
1265
- e.parentLabel = e.getLabel().getValue(n.locale);
1266
- var i = a.Deserialiser.parse(r, n);
1267
- (e = Object.assign(e, i)).index = n.index, t(e);
1268
- });
1269
- }
1270
- });
1271
- }, t;
1272
- }(a.ManifestResource);
1273
- },
1274
- 739(e, t) {
1275
- Object.defineProperty(t, "__esModule", { value: !0 });
1276
- },
1277
- 436(e, t) {
1278
- Object.defineProperty(t, "__esModule", { value: !0 }), t.JSONLDResource = void 0, t.JSONLDResource = function() {
1279
- function e(e) {
1280
- this.__jsonld = e, this.context = this.getProperty("context"), this.id = this.getProperty("id");
1281
- }
1282
- return e.prototype.getProperty = function(e) {
1283
- var t = null;
1284
- return this.__jsonld && ((t = this.__jsonld[e]) || (t = this.__jsonld["@" + e])), t;
1285
- }, e;
1286
- }();
1287
- },
1288
- 817(e, t, n) {
1289
- Object.defineProperty(t, "__esModule", { value: !0 }), t.LabelValuePair = void 0;
1290
- var r = n(799);
1291
- t.LabelValuePair = function() {
1292
- function e(e) {
1293
- this.label = null, this.value = null, this.defaultLocale = e;
1294
- }
1295
- return e.prototype.parse = function(e) {
1296
- this.resource = e, this.label = r.PropertyValue.parse(this.resource.label, this.defaultLocale), this.value = r.PropertyValue.parse(this.resource.value, this.defaultLocale);
1297
- }, e.prototype.getLabel = function(e) {
1298
- return this.label === null ? null : (Array.isArray(e) && !e.length && (e = void 0), this.label.getValue(e || this.defaultLocale));
1299
- }, e.prototype.getLabels = function(e) {
1300
- return this.label === null ? [] : (Array.isArray(e) && !e.length && (e = void 0), this.label.getValues(e || this.defaultLocale));
1301
- }, e.prototype.setLabel = function(e) {
1302
- this.label === null && (this.label = new r.PropertyValue([])), this.label.setValue(e, this.defaultLocale);
1303
- }, e.prototype.getValue = function(e, t) {
1304
- return t === void 0 && (t = "<br/>"), this.value === null ? null : (Array.isArray(e) && !e.length && (e = void 0), this.value.getValue(e || this.defaultLocale, t));
1305
- }, e.prototype.getValues = function(e) {
1306
- return this.value === null ? [] : (Array.isArray(e) && !e.length && (e = void 0), this.value.getValues(e || this.defaultLocale));
1307
- }, e.prototype.setValue = function(e) {
1308
- this.value === null && (this.value = new r.PropertyValue([])), this.value.setValue(e, this.defaultLocale);
1309
- }, e;
1310
- }();
1311
- },
1312
- 72(e, t) {
1313
- Object.defineProperty(t, "__esModule", { value: !0 });
1314
- },
1315
- 212(e, t) {
1316
- var n, r = this && this.__extends || (n = function(e, t) {
1317
- return n = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1318
- e.__proto__ = t;
1319
- } || function(e, t) {
1320
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1321
- }, n(e, t);
1322
- }, function(e, t) {
1323
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1324
- function r() {
1325
- this.constructor = e;
1326
- }
1327
- n(e, t), e.prototype = t === null ? Object.create(t) : (r.prototype = t.prototype, new r());
1328
- });
1329
- Object.defineProperty(t, "__esModule", { value: !0 }), t.LanguageMap = void 0, t.LanguageMap = function(e) {
1330
- function t() {
1331
- return e !== null && e.apply(this, arguments) || this;
1332
- }
1333
- return r(t, e), t.getValue = function(e, t) {
1334
- return e.getValue(t, "<br/>");
1335
- }, t.getValues = function(e, t) {
1336
- return e.getValues(t);
1337
- }, t;
1338
- }(Array);
1339
- },
1340
- 531(e, t, n) {
1341
- var r, i = this && this.__extends || (r = function(e, t) {
1342
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1343
- e.__proto__ = t;
1344
- } || function(e, t) {
1345
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1346
- }, r(e, t);
1347
- }, function(e, t) {
1348
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1349
- function n() {
1350
- this.constructor = e;
1351
- }
1352
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1353
- });
1354
- Object.defineProperty(t, "__esModule", { value: !0 }), t.Manifest = void 0;
1355
- var a = n(957), o = n(799);
1356
- t.Manifest = function(e) {
1357
- function t(t, n) {
1358
- var r = e.call(this, t, n) || this;
1359
- if (r.index = 0, r._allRanges = null, r.items = [], r._topRanges = [], r.__jsonld.structures && r.__jsonld.structures.length) for (var i = r._getTopRanges(), a = 0; a < i.length; a++) {
1360
- var o = i[a];
1361
- r._parseRanges(o, String(a));
1362
- }
1363
- return r;
1364
- }
1365
- return i(t, e), t.prototype.getPosterCanvas = function() {
1366
- var e = this.getProperty("posterCanvas");
1367
- return e &&= new o.Canvas(e, this.options), e;
1368
- }, t.prototype.getAccompanyingCanvas = function() {
1369
- var e = this.getProperty("accompanyingCanvas");
1370
- return e &&= new o.Canvas(e, this.options), e;
1371
- }, t.prototype.getBehavior = function() {
1372
- var e = this.getProperty("behavior");
1373
- return Array.isArray(e) && (e = e[0]), e || null;
1374
- }, t.prototype.getDefaultTree = function() {
1375
- if (e.prototype.getDefaultTree.call(this), this.defaultTree.data.type = o.Utils.normaliseType(o.TreeNodeType.MANIFEST), !this.isLoaded) return this.defaultTree;
1376
- var t = this.getTopRanges();
1377
- return t.length && t[0].getTree(this.defaultTree), o.Utils.generateTreeNodeIds(this.defaultTree), this.defaultTree;
1378
- }, t.prototype._getTopRanges = function() {
1379
- var e = [];
1380
- if (this.__jsonld.structures && this.__jsonld.structures.length) {
1381
- for (var t = 0; t < this.__jsonld.structures.length; t++) {
1382
- var n = this.__jsonld.structures[t];
1383
- n.viewingHint === a.ViewingHint.TOP && e.push(n);
1384
- }
1385
- if (!e.length) {
1386
- var r = {};
1387
- r.ranges = this.__jsonld.structures, e.push(r);
1388
- }
1389
- }
1390
- return e;
1391
- }, t.prototype.getTopRanges = function() {
1392
- return this._topRanges;
1393
- }, t.prototype._getRangeById = function(e) {
1394
- if (this.__jsonld.structures && this.__jsonld.structures.length) for (var t = 0; t < this.__jsonld.structures.length; t++) {
1395
- var n = this.__jsonld.structures[t];
1396
- if (n["@id"] === e || n.id === e) return n;
1397
- }
1398
- return null;
1399
- }, t.prototype._parseRanges = function(e, t, n) {
1400
- var r = null;
1401
- if (typeof e == "string" && (r = e, e = this._getRangeById(r)), e) {
1402
- var i = new o.Range(e, this.options);
1403
- i.parentRange = n, i.path = t, n ? n.items.push(i) : this._topRanges.push(i);
1404
- var a = e.items || e.members;
1405
- if (a) for (var s = 0; s < a.length; s++) {
1406
- var c = a[s];
1407
- if (c["@type"] && c["@type"].toLowerCase() === "sc:range" || c.type && c.type.toLowerCase() === "range") this._parseRanges(c, t + "/" + s, i);
1408
- else if (c["@type"] && c["@type"].toLowerCase() === "sc:canvas" || c.type && c.type.toLowerCase() === "canvas") {
1409
- i.canvases ||= [];
1410
- var l = c.id || c["@id"];
1411
- i.canvases.push(l);
1412
- }
1413
- }
1414
- else if (e.ranges) for (s = 0; s < e.ranges.length; s++) this._parseRanges(e.ranges[s], t + "/" + s, i);
1415
- } else console.warn("Range:", r, "does not exist");
1416
- }, t.prototype.getAllRanges = function() {
1417
- if (this._allRanges != null) return this._allRanges;
1418
- this._allRanges = [];
1419
- for (var e = this.getTopRanges(), t = function(t) {
1420
- var r = e[t];
1421
- r.id && n._allRanges.push(r);
1422
- var i = function(e, t) {
1423
- e.add(t);
1424
- var n = t.getRanges();
1425
- return n.length ? n.reduce(i, e) : e;
1426
- }, a = Array.from(r.getRanges().reduce(i, /* @__PURE__ */ new Set()));
1427
- n._allRanges = n._allRanges.concat(a);
1428
- }, n = this, r = 0; r < e.length; r++) t(r);
1429
- return this._allRanges;
1430
- }, t.prototype.getRangeById = function(e) {
1431
- for (var t = this.getAllRanges(), n = 0; n < t.length; n++) {
1432
- var r = t[n];
1433
- if (r.id === e) return r;
1434
- }
1435
- return null;
1436
- }, t.prototype.getRangeByPath = function(e) {
1437
- for (var t = this.getAllRanges(), n = 0; n < t.length; n++) {
1438
- var r = t[n];
1439
- if (r.path === e) return r;
1440
- }
1441
- return null;
1442
- }, t.prototype.getSequences = function() {
1443
- if (this.items.length) return this.items;
1444
- var e = this.__jsonld.mediaSequences || this.__jsonld.sequences;
1445
- if (e) for (var t = 0; t < e.length; t++) {
1446
- var n = e[t], r = new o.Sequence(n, this.options);
1447
- this.items.push(r);
1448
- }
1449
- else this.__jsonld.items && (r = new o.Sequence(this.__jsonld.items, this.options), this.items.push(r));
1450
- return this.items;
1451
- }, t.prototype.getSequenceByIndex = function(e) {
1452
- return this.getSequences()[e];
1453
- }, t.prototype.getTotalSequences = function() {
1454
- return this.getSequences().length;
1455
- }, t.prototype.getManifestType = function() {
1456
- var e = this.getService(a.ServiceProfile.UI_EXTENSIONS);
1457
- return e ? e.getProperty("manifestType") : o.ManifestType.EMPTY;
1458
- }, t.prototype.isMultiSequence = function() {
1459
- return this.getTotalSequences() > 1;
1460
- }, t.prototype.isPagingEnabled = function() {
1461
- var e = this.getViewingHint();
1462
- if (e) return e === a.ViewingHint.PAGED;
1463
- var t = this.getBehavior();
1464
- return !!t && t === a.Behavior.PAGED;
1465
- }, t.prototype.getViewingDirection = function() {
1466
- return this.getProperty("viewingDirection");
1467
- }, t.prototype.getViewingHint = function() {
1468
- var e = this.getProperty("viewingHint");
1469
- return Array.isArray(e) && (e = e[0]), e || null;
1470
- }, t;
1471
- }(o.IIIFResource);
1472
- },
1473
- 315(e, t, n) {
1474
- var r, i = this && this.__extends || (r = function(e, t) {
1475
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1476
- e.__proto__ = t;
1477
- } || function(e, t) {
1478
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1479
- }, r(e, t);
1480
- }, function(e, t) {
1481
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1482
- function n() {
1483
- this.constructor = e;
1484
- }
1485
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1486
- });
1487
- Object.defineProperty(t, "__esModule", { value: !0 }), t.ManifestResource = void 0;
1488
- var a = n(799), o = n(957);
1489
- t.ManifestResource = function(e) {
1490
- function t(t, n) {
1491
- var r = e.call(this, t) || this;
1492
- return r.options = n, r;
1493
- }
1494
- return i(t, e), t.prototype.getIIIFResourceType = function() {
1495
- return a.Utils.normaliseType(this.getProperty("type"));
1496
- }, t.prototype.getLabel = function() {
1497
- var e = this.getProperty("label");
1498
- return e ? a.PropertyValue.parse(e, this.options.locale) : new a.PropertyValue([], this.options.locale);
1499
- }, t.prototype.getDefaultLabel = function() {
1500
- return this.getLabel().getValue(this.options.locale);
1501
- }, t.prototype.getMetadata = function() {
1502
- var e = this.getProperty("metadata"), t = [];
1503
- if (!e) return t;
1504
- for (var n = 0; n < e.length; n++) {
1505
- var r = e[n], i = new a.LabelValuePair(this.options.locale);
1506
- i.parse(r), t.push(i);
1507
- }
1508
- return t;
1509
- }, t.prototype.getRendering = function(e) {
1510
- for (var t = this.getRenderings(), n = 0; n < t.length; n++) {
1511
- var r = t[n];
1512
- if (r.getFormat() === e) return r;
1513
- }
1514
- return null;
1515
- }, t.prototype.getRenderings = function() {
1516
- var e, t = [];
1517
- if (!(e = this.__jsonld ? this.__jsonld.rendering : this.rendering)) return t;
1518
- Array.isArray(e) || (e = [e]);
1519
- for (var n = 0; n < e.length; n++) {
1520
- var r = e[n];
1521
- t.push(new a.Rendering(r, this.options));
1522
- }
1523
- return t;
1524
- }, t.prototype.getRequiredStatement = function() {
1525
- var e = null, t = this.getProperty("requiredStatement");
1526
- return t && (e = new a.LabelValuePair(this.options.locale)).parse(t), e;
1527
- }, t.prototype.getService = function(e) {
1528
- return a.Utils.getService(this, e);
1529
- }, t.prototype.getServices = function() {
1530
- return a.Utils.getServices(this);
1531
- }, t.prototype.getThumbnail = function() {
1532
- var e = this.getProperty("thumbnail");
1533
- return Array.isArray(e) && (e = e[0]), e ? new a.Thumbnail(e, this.options) : null;
1534
- }, t.prototype.isAnnotation = function() {
1535
- return this.getIIIFResourceType() === o.IIIFResourceType.ANNOTATION;
1536
- }, t.prototype.isCanvas = function() {
1537
- return this.getIIIFResourceType() === o.IIIFResourceType.CANVAS;
1538
- }, t.prototype.isCollection = function() {
1539
- return this.getIIIFResourceType() === o.IIIFResourceType.COLLECTION;
1540
- }, t.prototype.isManifest = function() {
1541
- return this.getIIIFResourceType() === o.IIIFResourceType.MANIFEST;
1542
- }, t.prototype.isRange = function() {
1543
- return this.getIIIFResourceType() === o.IIIFResourceType.RANGE;
1544
- }, t.prototype.isSequence = function() {
1545
- return this.getIIIFResourceType() === o.IIIFResourceType.SEQUENCE;
1546
- }, t;
1547
- }(a.JSONLDResource);
1548
- },
1549
- 43(e, t) {
1550
- var n;
1551
- Object.defineProperty(t, "__esModule", { value: !0 }), t.ManifestType = void 0, function(e) {
1552
- e.EMPTY = "", e.MANUSCRIPT = "manuscript", e.MONOGRAPH = "monograph";
1553
- }(n || (t.ManifestType = n = {}));
1554
- },
1555
- 6(e, t, n) {
1556
- var r, i = this && this.__extends || (r = function(e, t) {
1557
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1558
- e.__proto__ = t;
1559
- } || function(e, t) {
1560
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1561
- }, r(e, t);
1562
- }, function(e, t) {
1563
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1564
- function n() {
1565
- this.constructor = e;
1566
- }
1567
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1568
- });
1569
- Object.defineProperty(t, "__esModule", { value: !0 }), t.PropertyValue = t.LocalizedValue = void 0;
1570
- var a = n(41), o = function() {
1571
- function e(e, t, n) {
1572
- n === void 0 && (n = "none"), this._value = Array.isArray(e) && e.length === 1 ? e[0] : e, t !== "none" && t !== "@none" || (t = void 0), this._locale = t, this._defaultLocale = n;
1573
- }
1574
- return e.parseV2Value = function(t, n) {
1575
- return typeof t == "string" ? new e(t, void 0, n) : t["@value"] ? new e(t["@value"], t["@language"], n) : null;
1576
- }, Object.defineProperty(e.prototype, "value", {
1577
- get: function() {
1578
- return Array.isArray(this._value) ? this._value.join("<br/>") : this._value;
1579
- },
1580
- enumerable: !1,
1581
- configurable: !0
1582
- }), Object.defineProperty(e.prototype, "locale", {
1583
- get: function() {
1584
- return this._locale === void 0 ? this._defaultLocale : this._locale;
1585
- },
1586
- enumerable: !1,
1587
- configurable: !0
1588
- }), e.prototype.addValue = function(e) {
1589
- Array.isArray(this._value) || (this._value = [this._value]), Array.isArray(e) ? this._value = this._value.concat(e) : this._value.push(e);
1590
- }, e;
1591
- }();
1592
- t.LocalizedValue = o, t.PropertyValue = function(e) {
1593
- function t(n, r) {
1594
- n === void 0 && (n = []);
1595
- var i = e.apply(this, n) || this;
1596
- return i.__proto__ = t.prototype, i._defaultLocale = r, i;
1597
- }
1598
- return i(t, e), t.parse = function(e, n) {
1599
- if (!e) return new t([], n);
1600
- if (Array.isArray(e)) {
1601
- var r = (i = e.map(function(e) {
1602
- return o.parseV2Value(e, n);
1603
- }).filter(function(e) {
1604
- return e !== null;
1605
- })).reduce(function(e, t) {
1606
- var n = t._locale;
1607
- return n ||= "none", e[n] ? e[n].addValue(t._value) : e[n] = t, e;
1608
- }, {});
1609
- return new t(Object.values(r), n);
1610
- }
1611
- return typeof e == "string" ? new t([new o(e, void 0, n)], n) : e["@language"] || e["@value"] ? new t((i = o.parseV2Value(e)) === null ? [] : [i], n) : new t(Object.keys(e).map(function(t) {
1612
- var r = e[t];
1613
- if (!Array.isArray(r)) throw Error("A IIIF v3 localized property value must have an array as the value for a given language.");
1614
- return new o(r, t, n);
1615
- }), n);
1616
- var i;
1617
- }, t.prototype.getSuitableLocale = function(e) {
1618
- for (var t = Array.from(this.values()).map(function(e) {
1619
- return e._locale;
1620
- }).filter(function(e) {
1621
- return e !== void 0;
1622
- }), n = function(e) {
1623
- var n = t.find(function(t) {
1624
- return t === e;
1625
- });
1626
- if (n) return { value: n };
1627
- }, r = 0, i = e; r < i.length; r++) {
1628
- var o = n(i[r]);
1629
- if (typeof o == "object") return o.value;
1630
- }
1631
- for (var s = function(e) {
1632
- var n = t.find(function(t) {
1633
- return a.Utils.getInexactLocale(t) === a.Utils.getInexactLocale(e);
1634
- });
1635
- if (n) return { value: n };
1636
- }, c = 0, l = e; c < l.length; c++) {
1637
- var u = s(l[c]);
1638
- if (typeof u == "object") return u.value;
1639
- }
1640
- }, t.prototype.setValue = function(e, t) {
1641
- var n = void 0;
1642
- if (t) {
1643
- var r = this.getSuitableLocale([t]);
1644
- r && (n = this.find(function(e) {
1645
- return e._locale === r;
1646
- }));
1647
- } else n = this.find(function(e) {
1648
- return e._locale === void 0;
1649
- });
1650
- n ? n._value = e : this.push(new o(e, t, this._defaultLocale));
1651
- }, t.prototype.getValue = function(e, t) {
1652
- var n = this.getValues(e);
1653
- return n.length === 0 ? null : t ? n.join(t) : n[0];
1654
- }, t.prototype.getValues = function(e) {
1655
- if (!this.length) return [];
1656
- var t;
1657
- if (t = e ? Array.isArray(e) ? e : [e] : [], this.length === 1 && this[0]._locale === void 0) {
1658
- var n = this[0]._value;
1659
- return Array.isArray(n) ? n : [n];
1660
- }
1661
- var r = this.getSuitableLocale(t);
1662
- if (r) return n = this.find(function(e) {
1663
- return e._locale === r;
1664
- })._value, Array.isArray(n) ? n : [n];
1665
- if (!this.find(function(e) {
1666
- return e._locale === void 0;
1667
- })) return n = this[0]._value, Array.isArray(n) ? n : [n];
1668
- var i = this.find(function(e) {
1669
- return e._locale === void 0;
1670
- });
1671
- return i ? Array.isArray(i._value) ? i._value : [i._value] : [];
1672
- }, t;
1673
- }(Array);
1674
- },
1675
- 845(e, t, n) {
1676
- var r, i = this && this.__extends || (r = function(e, t) {
1677
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1678
- e.__proto__ = t;
1679
- } || function(e, t) {
1680
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1681
- }, r(e, t);
1682
- }, function(e, t) {
1683
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1684
- function n() {
1685
- this.constructor = e;
1686
- }
1687
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1688
- });
1689
- Object.defineProperty(t, "__esModule", { value: !0 }), t.Range = void 0;
1690
- var a = n(799), o = n(957);
1691
- t.Range = function(e) {
1692
- function t(t, n) {
1693
- var r = e.call(this, t, n) || this;
1694
- return r._ranges = null, r.canvases = null, r.items = [], r;
1695
- }
1696
- return i(t, e), t.prototype.getCanvasIds = function() {
1697
- return this.__jsonld.canvases ? this.__jsonld.canvases : this.canvases ? this.canvases : [];
1698
- }, t.prototype.getDuration = function() {
1699
- if (this.canvases && this.canvases.length) {
1700
- for (var e = [], t = [], n = 0, r = this.canvases; n < r.length; n++) if (m = r[n]) {
1701
- var i = m.match(/(.*)#t=([0-9.]+),?([0-9.]+)?/) || [void 0, m], o = i[1], s = i[2], c = i[3];
1702
- o && (e.push(parseFloat(s)), t.push(parseFloat(c)));
1703
- }
1704
- if (e.length && t.length) return new a.Duration(Math.min.apply(Math, e), Math.max.apply(Math, t));
1705
- } else {
1706
- e = [], t = [];
1707
- for (var l = 0, u = g = this.getRanges(); l < u.length; l++) (_ = u[l].getDuration()) && (e.push(_.start), t.push(_.end));
1708
- if (e.length && t.length) return new a.Duration(Math.min.apply(Math, e), Math.max.apply(Math, t));
1709
- }
1710
- var d, f;
1711
- if (this.canvases && this.canvases.length) for (var p = 0; p < this.canvases.length; p++) {
1712
- var m = this.canvases[p], h = a.Utils.getTemporalComponent(m);
1713
- h && h.length > 1 && (p === 0 && (d = Number(h[0])), p === this.canvases.length - 1 && (f = Number(h[1])));
1714
- }
1715
- else {
1716
- var g = this.getRanges();
1717
- for (p = 0; p < g.length; p++) {
1718
- var _;
1719
- (_ = g[p].getDuration()) && (p === 0 && (d = _.start), p === g.length - 1 && (f = _.end));
1720
- }
1721
- }
1722
- if (d !== void 0 && f !== void 0) return new a.Duration(d, f);
1723
- }, t.prototype.getRanges = function() {
1724
- return this._ranges ? this._ranges : this._ranges = this.items.filter(function(e) {
1725
- return e.isRange();
1726
- });
1727
- }, t.prototype.getBehavior = function() {
1728
- var e = this.getProperty("behavior");
1729
- return Array.isArray(e) && (e = e[0]), e || null;
1730
- }, t.prototype.getViewingDirection = function() {
1731
- return this.getProperty("viewingDirection");
1732
- }, t.prototype.getViewingHint = function() {
1733
- var e = this.getProperty("viewingHint");
1734
- return Array.isArray(e) && (e = e[0]), e || null;
1735
- }, t.prototype.getTree = function(e) {
1736
- e.data = this, this.treeNode = e;
1737
- var t = this.getRanges();
1738
- if (t && t.length) for (var n = 0; n < t.length; n++) {
1739
- var r = t[n], i = new a.TreeNode();
1740
- e.addNode(i), this._parseTreeNode(i, r);
1741
- }
1742
- return a.Utils.generateTreeNodeIds(e), e;
1743
- }, t.prototype.spansTime = function(e) {
1744
- var t = this.getDuration();
1745
- return !!(t && e >= t.start && e <= t.end);
1746
- }, t.prototype._parseTreeNode = function(e, t) {
1747
- e.label = t.getLabel().getValue(this.options.locale), e.data = t, e.data.type = a.Utils.normaliseType(a.TreeNodeType.RANGE), t.treeNode = e;
1748
- var n = t.getRanges();
1749
- if (n && n.length) for (var r = 0; r < n.length; r++) {
1750
- var i = n[r];
1751
- if (i.getBehavior() !== o.Behavior.NO_NAV) {
1752
- var s = new a.TreeNode();
1753
- e.addNode(s), this._parseTreeNode(s, i);
1754
- }
1755
- }
1756
- }, t;
1757
- }(a.ManifestResource);
1758
- },
1759
- 940(e, t, n) {
1760
- var r, i = this && this.__extends || (r = function(e, t) {
1761
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1762
- e.__proto__ = t;
1763
- } || function(e, t) {
1764
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1765
- }, r(e, t);
1766
- }, function(e, t) {
1767
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1768
- function n() {
1769
- this.constructor = e;
1770
- }
1771
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1772
- });
1773
- Object.defineProperty(t, "__esModule", { value: !0 }), t.Rendering = void 0, t.Rendering = function(e) {
1774
- function t(t, n) {
1775
- return e.call(this, t, n) || this;
1776
- }
1777
- return i(t, e), t.prototype.getFormat = function() {
1778
- return this.getProperty("format");
1779
- }, t;
1780
- }(n(799).ManifestResource);
1781
- },
1782
- 258(e, t, n) {
1783
- var r, i = this && this.__extends || (r = function(e, t) {
1784
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1785
- e.__proto__ = t;
1786
- } || function(e, t) {
1787
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1788
- }, r(e, t);
1789
- }, function(e, t) {
1790
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1791
- function n() {
1792
- this.constructor = e;
1793
- }
1794
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1795
- });
1796
- Object.defineProperty(t, "__esModule", { value: !0 }), t.Resource = void 0;
1797
- var a = n(799);
1798
- t.Resource = function(e) {
1799
- function t(t, n) {
1800
- return e.call(this, t, n) || this;
1801
- }
1802
- return i(t, e), t.prototype.getFormat = function() {
1803
- var e = this.getProperty("format");
1804
- return e ? e.toLowerCase() : null;
1805
- }, t.prototype.getResources = function() {
1806
- var e = [];
1807
- if (!this.__jsonld.resources) return e;
1808
- for (var t = 0; t < this.__jsonld.resources.length; t++) {
1809
- var n = this.__jsonld.resources[t], r = new a.Annotation(n, this.options);
1810
- e.push(r);
1811
- }
1812
- return e;
1813
- }, t.prototype.getType = function() {
1814
- var e = this.getProperty("type");
1815
- return e ? a.Utils.normaliseType(e) : null;
1816
- }, t.prototype.getWidth = function() {
1817
- return this.getProperty("width");
1818
- }, t.prototype.getHeight = function() {
1819
- return this.getProperty("height");
1820
- }, t.prototype.getMaxWidth = function() {
1821
- return this.getProperty("maxWidth");
1822
- }, t.prototype.getMaxHeight = function() {
1823
- return this.getProperty("maxHeight") ? null : this.getMaxWidth();
1824
- }, t;
1825
- }(a.ManifestResource);
1826
- },
1827
- 591(e, t, n) {
1828
- var r, i = this && this.__extends || (r = function(e, t) {
1829
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
1830
- e.__proto__ = t;
1831
- } || function(e, t) {
1832
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
1833
- }, r(e, t);
1834
- }, function(e, t) {
1835
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
1836
- function n() {
1837
- this.constructor = e;
1838
- }
1839
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
1840
- });
1841
- Object.defineProperty(t, "__esModule", { value: !0 }), t.Sequence = void 0;
1842
- var a = n(957), o = n(799);
1843
- t.Sequence = function(e) {
1844
- function t(t, n) {
1845
- var r = e.call(this, t, n) || this;
1846
- return r.items = [], r._thumbnails = null, r;
1847
- }
1848
- return i(t, e), t.prototype.getCanvases = function() {
1849
- if (this.items.length) return this.items;
1850
- var e = this.__jsonld.canvases || this.__jsonld.elements;
1851
- if (e) for (var t = 0; t < e.length; t++) {
1852
- var n = e[t];
1853
- (r = new o.Canvas(n, this.options)).index = t, this.items.push(r);
1854
- }
1855
- else if (this.__jsonld) for (t = 0; t < this.__jsonld.length; t++) {
1856
- var r;
1857
- n = this.__jsonld[t], (r = new o.Canvas(n, this.options)).index = t, this.items.push(r);
1858
- }
1859
- return this.items;
1860
- }, t.prototype.getCanvasById = function(e) {
1861
- for (var t = 0; t < this.getTotalCanvases(); t++) {
1862
- var n = this.getCanvasByIndex(t), r = o.Utils.normaliseUrl(n.id);
1863
- if (o.Utils.normaliseUrl(e) === r) return n;
1864
- }
1865
- return null;
1866
- }, t.prototype.getCanvasByIndex = function(e) {
1867
- return this.getCanvases()[e];
1868
- }, t.prototype.getCanvasIndexById = function(e) {
1869
- for (var t = 0; t < this.getTotalCanvases(); t++) if (this.getCanvasByIndex(t).id === e) return t;
1870
- return null;
1871
- }, t.prototype.getCanvasIndexByLabel = function(e, t) {
1872
- e = e.trim(), isNaN(e) || (e = parseInt(e, 10).toString(), t && (e += "r"));
1873
- for (var n, r, i, a = /(\d*)\D+(\d*)/, o = 0; o < this.getTotalCanvases(); o++) {
1874
- var s = this.getCanvasByIndex(o);
1875
- if (s.getLabel().getValue(this.options.locale) === e || (n = a.exec(e)) && (r = n[1], (i = n[2]) && RegExp("^" + r + "\\D+" + i + "$").test(s.getLabel().toString()))) return o;
1876
- }
1877
- return -1;
1878
- }, t.prototype.getLastCanvasLabel = function(e) {
1879
- for (var t = this.getTotalCanvases() - 1; t >= 0; t--) {
1880
- var n = this.getCanvasByIndex(t).getLabel().getValue(this.options.locale);
1881
- if (e) {
1882
- if (/^[a-zA-Z0-9]*$/.test(n)) return n;
1883
- } else if (n) return n;
1884
- }
1885
- return this.options.defaultLabel;
1886
- }, t.prototype.getLastPageIndex = function() {
1887
- return this.getTotalCanvases() - 1;
1888
- }, t.prototype.getNextPageIndex = function(e, t) {
1889
- var n;
1890
- if (t) {
1891
- var r = this.getPagedIndices(e), i = this.getViewingDirection();
1892
- n = i && i === a.ViewingDirection.RIGHT_TO_LEFT ? r[0] + 1 : r[r.length - 1] + 1;
1893
- } else n = e + 1;
1894
- return n > this.getLastPageIndex() ? -1 : n;
1895
- }, t.prototype.getPagedIndices = function(e, t) {
1896
- var n = [];
1897
- if (t) {
1898
- n = this.isFirstCanvas(e) || this.isLastCanvas(e) ? [e] : e % 2 ? [e, e + 1] : [e - 1, e];
1899
- var r = this.getViewingDirection();
1900
- r && r === a.ViewingDirection.RIGHT_TO_LEFT && (n = n.reverse());
1901
- } else n.push(e);
1902
- return n;
1903
- }, t.prototype.getPrevPageIndex = function(e, t) {
1904
- var n;
1905
- if (t) {
1906
- var r = this.getPagedIndices(e), i = this.getViewingDirection();
1907
- n = i && i === a.ViewingDirection.RIGHT_TO_LEFT ? r[r.length - 1] - 1 : r[0] - 1;
1908
- } else n = e - 1;
1909
- return n;
1910
- }, t.prototype.getStartCanvasIndex = function() {
1911
- var e = this.getStartCanvas();
1912
- if (e) {
1913
- for (var t = 0; t < this.getTotalCanvases(); t++) if (this.getCanvasByIndex(t).id === e) return t;
1914
- }
1915
- return 0;
1916
- }, t.prototype.getThumbs = function(e, t) {
1917
- for (var n = [], r = this.getTotalCanvases(), i = 0; i < r; i++) {
1918
- var a = this.getCanvasByIndex(i), s = new o.Thumb(e, a);
1919
- n.push(s);
1920
- }
1921
- return n;
1922
- }, t.prototype.getThumbnails = function() {
1923
- if (this._thumbnails != null) return this._thumbnails;
1924
- this._thumbnails = [];
1925
- for (var e = this.getCanvases(), t = 0; t < e.length; t++) {
1926
- var n = e[t].getThumbnail();
1927
- n && this._thumbnails.push(n);
1928
- }
1929
- return this._thumbnails;
1930
- }, t.prototype.getStartCanvas = function() {
1931
- return this.getProperty("startCanvas");
1932
- }, t.prototype.getTotalCanvases = function() {
1933
- return this.getCanvases().length;
1934
- }, t.prototype.getViewingDirection = function() {
1935
- return this.getProperty("viewingDirection") ? this.getProperty("viewingDirection") : this.options.resource.getViewingDirection ? this.options.resource.getViewingDirection() : null;
1936
- }, t.prototype.getViewingHint = function() {
1937
- var e = this.getProperty("viewingHint");
1938
- return Array.isArray(e) && (e = e[0]), e || null;
1939
- }, t.prototype.isCanvasIndexOutOfRange = function(e) {
1940
- return e > this.getTotalCanvases() - 1;
1941
- }, t.prototype.isFirstCanvas = function(e) {
1942
- return e === 0;
1943
- }, t.prototype.isLastCanvas = function(e) {
1944
- return e === this.getTotalCanvases() - 1;
1945
- }, t.prototype.isMultiCanvas = function() {
1946
- return this.getTotalCanvases() > 1;
1947
- }, t.prototype.isPagingEnabled = function() {
1948
- var e = this.getViewingHint();
1949
- return !!e && e === a.ViewingHint.PAGED;
1950
- }, t.prototype.isTotalCanvasesEven = function() {
1951
- return this.getTotalCanvases() % 2 == 0;
1952
- }, t;
1953
- }(o.ManifestResource);
1954
- },
1955
- 29(e, t, n) {
1956
- Object.defineProperty(t, "__esModule", { value: !0 }), t.Deserialiser = void 0;
1957
- var r = n(799);
1958
- t.Deserialiser = function() {
1959
- function e() {}
1960
- return e.parse = function(e, t) {
1961
- return typeof e == "string" && (e = JSON.parse(e)), this.parseJson(e, t);
1962
- }, e.parseJson = function(e, t) {
1963
- var n;
1964
- if (t && t.navDate && !isNaN(t.navDate.getTime()) && (e.navDate = t.navDate.toString()), e["@type"]) switch (e["@type"]) {
1965
- case "sc:Collection":
1966
- n = this.parseCollection(e, t);
1967
- break;
1968
- case "sc:Manifest":
1969
- n = this.parseManifest(e, t);
1970
- break;
1971
- default: return null;
1972
- }
1973
- else switch (e.type) {
1974
- case "Collection":
1975
- n = this.parseCollection(e, t);
1976
- break;
1977
- case "Manifest":
1978
- n = this.parseManifest(e, t);
1979
- break;
1980
- default: return null;
1981
- }
1982
- return n.isLoaded = !0, n;
1983
- }, e.parseCollection = function(e, t) {
1984
- var n = new r.Collection(e, t);
1985
- return t ? (n.index = t.index || 0, t.resource && (n.parentCollection = t.resource.parentCollection)) : n.index = 0, this.parseCollections(n, t), this.parseManifests(n, t), this.parseItems(n, t), n;
1986
- }, e.parseCollections = function(e, t) {
1987
- var n;
1988
- if (e.__jsonld.collections ? n = e.__jsonld.collections : e.__jsonld.items && (n = e.__jsonld.items.filter(function(e) {
1989
- return e.type.toLowerCase() === "collection";
1990
- })), n) for (var r = 0; r < n.length; r++) {
1991
- t && (t.index = r);
1992
- var i = this.parseCollection(n[r], t);
1993
- i.index = r, i.parentCollection = e, e.items.push(i);
1994
- }
1995
- }, e.parseManifest = function(e, t) {
1996
- return new r.Manifest(e, t);
1997
- }, e.parseManifests = function(e, t) {
1998
- var n;
1999
- if (e.__jsonld.manifests ? n = e.__jsonld.manifests : e.__jsonld.items && (n = e.__jsonld.items.filter(function(e) {
2000
- return e.type.toLowerCase() === "manifest";
2001
- })), n) for (var r = 0; r < n.length; r++) {
2002
- var i = this.parseManifest(n[r], t);
2003
- i.index = r, i.parentCollection = e, e.items.push(i);
2004
- }
2005
- }, e.parseItem = function(e, t) {
2006
- if (e["@type"]) {
2007
- if (e["@type"].toLowerCase() === "sc:manifest") return this.parseManifest(e, t);
2008
- if (e["@type"].toLowerCase() === "sc:collection") return this.parseCollection(e, t);
2009
- } else if (e.type) {
2010
- if (e.type.toLowerCase() === "manifest") return this.parseManifest(e, t);
2011
- if (e.type.toLowerCase() === "collection") return this.parseCollection(e, t);
2012
- }
2013
- return null;
2014
- }, e.parseItems = function(e, t) {
2015
- var n = e.__jsonld.members || e.__jsonld.items;
2016
- if (n) for (var r = function(r) {
2017
- t && (t.index = r);
2018
- var a = i.parseItem(n[r], t);
2019
- return a ? e.items.filter(function(e) {
2020
- return e.id === a.id;
2021
- })[0] ? "continue" : (a.index = r, a.parentCollection = e, void e.items.push(a)) : { value: void 0 };
2022
- }, i = this, a = 0; a < n.length; a++) {
2023
- var o = r(a);
2024
- if (typeof o == "object") return o.value;
2025
- }
2026
- }, e;
2027
- }();
2028
- },
2029
- 579(e, t, n) {
2030
- var r, i = this && this.__extends || (r = function(e, t) {
2031
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
2032
- e.__proto__ = t;
2033
- } || function(e, t) {
2034
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
2035
- }, r(e, t);
2036
- }, function(e, t) {
2037
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
2038
- function n() {
2039
- this.constructor = e;
2040
- }
2041
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
2042
- });
2043
- Object.defineProperty(t, "__esModule", { value: !0 }), t.Service = void 0;
2044
- var a = n(799);
2045
- t.Service = function(e) {
2046
- function t(t, n) {
2047
- return e.call(this, t, n) || this;
2048
- }
2049
- return i(t, e), t.prototype.getProfile = function() {
2050
- var e = this.getProperty("profile");
2051
- return e ||= this.getProperty("dcterms:conformsTo"), Array.isArray(e) ? e[0] : e;
2052
- }, t.prototype.getConfirmLabel = function() {
2053
- return a.Utils.getLocalisedValue(this.getProperty("confirmLabel"), this.options.locale);
2054
- }, t.prototype.getDescription = function() {
2055
- return a.Utils.getLocalisedValue(this.getProperty("description"), this.options.locale);
2056
- }, t.prototype.getFailureDescription = function() {
2057
- return a.Utils.getLocalisedValue(this.getProperty("failureDescription"), this.options.locale);
2058
- }, t.prototype.getFailureHeader = function() {
2059
- return a.Utils.getLocalisedValue(this.getProperty("failureHeader"), this.options.locale);
2060
- }, t.prototype.getHeader = function() {
2061
- return a.Utils.getLocalisedValue(this.getProperty("header"), this.options.locale);
2062
- }, t.prototype.getServiceLabel = function() {
2063
- return a.Utils.getLocalisedValue(this.getProperty("label"), this.options.locale);
2064
- }, t.prototype.getInfoUri = function() {
2065
- var e = this.id;
2066
- return e.endsWith("/") || (e += "/"), e + "info.json";
2067
- }, t;
2068
- }(a.ManifestResource);
2069
- },
2070
- 639(e, t) {
2071
- Object.defineProperty(t, "__esModule", { value: !0 }), t.Size = void 0, t.Size = function(e, t) {
2072
- this.width = e, this.height = t;
2073
- };
2074
- },
2075
- 633(e, t) {
2076
- var n;
2077
- Object.defineProperty(t, "__esModule", { value: !0 }), t.StatusCode = void 0, function(e) {
2078
- e[e.AUTHORIZATION_FAILED = 1] = "AUTHORIZATION_FAILED", e[e.FORBIDDEN = 2] = "FORBIDDEN", e[e.INTERNAL_SERVER_ERROR = 3] = "INTERNAL_SERVER_ERROR", e[e.RESTRICTED = 4] = "RESTRICTED";
2079
- }(n || (t.StatusCode = n = {}));
2080
- },
2081
- 692(e, t) {
2082
- Object.defineProperty(t, "__esModule", { value: !0 }), t.Thumb = void 0, t.Thumb = function(e, t) {
2083
- this.data = t, this.index = t.index, this.width = e;
2084
- var n = t.getHeight() / t.getWidth();
2085
- this.height = n ? Math.floor(this.width * n) : e, this.uri = t.getCanonicalImageUri(e), this.label = t.getLabel().getValue(), this.viewingHint = t.getViewingHint();
2086
- };
2087
- },
2088
- 204(e, t, n) {
2089
- var r, i = this && this.__extends || (r = function(e, t) {
2090
- return r = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(e, t) {
2091
- e.__proto__ = t;
2092
- } || function(e, t) {
2093
- for (var n in t) Object.prototype.hasOwnProperty.call(t, n) && (e[n] = t[n]);
2094
- }, r(e, t);
2095
- }, function(e, t) {
2096
- if (typeof t != "function" && t !== null) throw TypeError("Class extends value " + String(t) + " is not a constructor or null");
2097
- function n() {
2098
- this.constructor = e;
2099
- }
2100
- r(e, t), e.prototype = t === null ? Object.create(t) : (n.prototype = t.prototype, new n());
2101
- });
2102
- Object.defineProperty(t, "__esModule", { value: !0 }), t.Thumbnail = void 0, t.Thumbnail = function(e) {
2103
- function t(t, n) {
2104
- return e.call(this, t, n) || this;
2105
- }
2106
- return i(t, e), t;
2107
- }(n(799).Resource);
2108
- },
2109
- 570(e, t, n) {
2110
- Object.defineProperty(t, "__esModule", { value: !0 }), t.TreeNode = void 0;
2111
- var r = n(799);
2112
- t.TreeNode = function() {
2113
- function e(e, t) {
2114
- this.label = e, this.data = t || {}, this.nodes = [];
2115
- }
2116
- return e.prototype.addNode = function(e) {
2117
- this.nodes.push(e), e.parentNode = this;
2118
- }, e.prototype.isCollection = function() {
2119
- return this.data.type === r.Utils.normaliseType(r.TreeNodeType.COLLECTION);
2120
- }, e.prototype.isManifest = function() {
2121
- return this.data.type === r.Utils.normaliseType(r.TreeNodeType.MANIFEST);
2122
- }, e.prototype.isRange = function() {
2123
- return this.data.type === r.Utils.normaliseType(r.TreeNodeType.RANGE);
2124
- }, e;
2125
- }();
2126
- },
2127
- 386(e, t) {
2128
- var n;
2129
- Object.defineProperty(t, "__esModule", { value: !0 }), t.TreeNodeType = void 0, function(e) {
2130
- e.COLLECTION = "collection", e.MANIFEST = "manifest", e.RANGE = "range";
2131
- }(n || (t.TreeNodeType = n = {}));
2132
- },
2133
- 41(e, t, n) {
2134
- var r = this && this.__awaiter || function(e, t, n, r) {
2135
- return new (n ||= Promise)(function(i, a) {
2136
- function o(e) {
2137
- try {
2138
- c(r.next(e));
2139
- } catch (e) {
2140
- a(e);
2141
- }
2142
- }
2143
- function s(e) {
2144
- try {
2145
- c(r.throw(e));
2146
- } catch (e) {
2147
- a(e);
2148
- }
2149
- }
2150
- function c(e) {
2151
- var t;
2152
- e.done ? i(e.value) : (t = e.value, t instanceof n ? t : new n(function(e) {
2153
- e(t);
2154
- })).then(o, s);
2155
- }
2156
- c((r = r.apply(e, t || [])).next());
2157
- });
2158
- }, i = this && this.__generator || function(e, t) {
2159
- var n, r, i, a = {
2160
- label: 0,
2161
- sent: function() {
2162
- if (1 & i[0]) throw i[1];
2163
- return i[1];
2164
- },
2165
- trys: [],
2166
- ops: []
2167
- }, o = Object.create((typeof Iterator == "function" ? Iterator : Object).prototype);
2168
- return o.next = s(0), o.throw = s(1), o.return = s(2), typeof Symbol == "function" && (o[Symbol.iterator] = function() {
2169
- return this;
2170
- }), o;
2171
- function s(s) {
2172
- return function(c) {
2173
- return function(s) {
2174
- if (n) throw TypeError("Generator is already executing.");
2175
- for (; o && (o = 0, s[0] && (a = 0)), a;) try {
2176
- if (n = 1, r && (i = 2 & s[0] ? r.return : s[0] ? r.throw || ((i = r.return) && i.call(r), 0) : r.next) && !(i = i.call(r, s[1])).done) return i;
2177
- switch (r = 0, i && (s = [2 & s[0], i.value]), s[0]) {
2178
- case 0:
2179
- case 1:
2180
- i = s;
2181
- break;
2182
- case 4: return a.label++, {
2183
- value: s[1],
2184
- done: !1
2185
- };
2186
- case 5:
2187
- a.label++, r = s[1], s = [0];
2188
- continue;
2189
- case 7:
2190
- s = a.ops.pop(), a.trys.pop();
2191
- continue;
2192
- default:
2193
- if (!((i = (i = a.trys).length > 0 && i[i.length - 1]) || s[0] !== 6 && s[0] !== 2)) {
2194
- a = 0;
2195
- continue;
2196
- }
2197
- if (s[0] === 3 && (!i || s[1] > i[0] && s[1] < i[3])) {
2198
- a.label = s[1];
2199
- break;
2200
- }
2201
- if (s[0] === 6 && a.label < i[1]) {
2202
- a.label = i[1], i = s;
2203
- break;
2204
- }
2205
- if (i && a.label < i[2]) {
2206
- a.label = i[2], a.ops.push(s);
2207
- break;
2208
- }
2209
- i[2] && a.ops.pop(), a.trys.pop();
2210
- continue;
2211
- }
2212
- s = t.call(e, a);
2213
- } catch (e) {
2214
- s = [6, e], r = 0;
2215
- } finally {
2216
- n = i = 0;
2217
- }
2218
- if (5 & s[0]) throw s[1];
2219
- return {
2220
- value: s[0] ? s[1] : void 0,
2221
- done: !0
2222
- };
2223
- }([s, c]);
2224
- };
2225
- }
2226
- };
2227
- Object.defineProperty(t, "__esModule", { value: !0 }), t.Utils = void 0;
2228
- var a = n(799), o = n(957), s = n(19);
2229
- n(916), t.Utils = function() {
2230
- function e() {}
2231
- return e.getMediaType = function(e) {
2232
- return (e = (e = e.toLowerCase()).split(";")[0]).trim();
2233
- }, e.getImageQuality = function(e) {
2234
- return e === o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1 || e === o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2 || e === o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1 || e === o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2 || e === o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1 || e === o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2 || e === o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1 || e === o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2 || e === o.ServiceProfile.IMAGE_1_LEVEL_1 || e === o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1 || e === o.ServiceProfile.IMAGE_1_LEVEL_2 || e === o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2 ? "native" : "default";
2235
- }, e.getInexactLocale = function(e) {
2236
- return e.indexOf("-") === -1 ? e : e.substr(0, e.indexOf("-"));
2237
- }, e.getLocalisedValue = function(e, t) {
2238
- if (!Array.isArray(e)) return e;
2239
- for (var n = 0; n < e.length; n++) {
2240
- var r = e[n];
2241
- if (t === r["@language"]) return r["@value"];
2242
- }
2243
- var i = t.substr(0, t.indexOf("-"));
2244
- for (n = 0; n < e.length; n++) {
2245
- var a = e[n];
2246
- if (a["@language"] === i) return a["@value"];
2247
- }
2248
- return null;
2249
- }, e.generateTreeNodeIds = function(t, n) {
2250
- var r;
2251
- n === void 0 && (n = 0), r = t.parentNode ? t.parentNode.id + "-" + n : "0", t.id = r;
2252
- for (var i = 0; i < t.nodes.length; i++) {
2253
- var a = t.nodes[i];
2254
- e.generateTreeNodeIds(a, i);
2255
- }
2256
- }, e.normaliseType = function(e) {
2257
- return (e = (e || "").toLowerCase()).indexOf(":") === -1 ? e : e.split(":")[1];
2258
- }, e.normaliseUrl = function(e) {
2259
- return (e = e.substr(e.indexOf("://"))).indexOf("#") !== -1 && (e = e.split("#")[0]), e;
2260
- }, e.normalisedUrlsMatch = function(t, n) {
2261
- return e.normaliseUrl(t) === e.normaliseUrl(n);
2262
- }, e.isImageProfile = function(t) {
2263
- return !!(e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2));
2264
- }, e.isImageServiceType = function(e) {
2265
- return e !== null && e.toLowerCase() === o.ServiceType.IMAGE_SERVICE_2.toLowerCase() || e === o.ServiceType.IMAGE_SERVICE_3.toLowerCase();
2266
- }, e.isLevel0ImageProfile = function(t) {
2267
- return !!(e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_LEVEL_0) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_0));
2268
- }, e.isLevel1ImageProfile = function(t) {
2269
- return !!(e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_LEVEL_1) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_1));
2270
- }, e.isLevel2ImageProfile = function(t) {
2271
- return !!(e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_COMPLIANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_COMPLIANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_0_CONFORMANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_CONFORMANCE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_1_PROFILE_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_LEVEL_2) || e.normalisedUrlsMatch(t, o.ServiceProfile.IMAGE_2_PROFILE_LEVEL_2));
2272
- }, e.parseManifest = function(e, t) {
2273
- return a.Deserialiser.parse(e, t);
2274
- }, e.checkStatus = function(e) {
2275
- if (e.ok) return e;
2276
- var t = Error(e.statusText);
2277
- return t.response = e, Promise.reject(t);
2278
- }, e.loadManifest = function(t) {
2279
- return new Promise(function(n, r) {
2280
- fetch(t).then(e.checkStatus).then(function(e) {
2281
- return e.json();
2282
- }).then(function(e) {
2283
- n(e);
2284
- }).catch(function(e) {
2285
- r();
2286
- });
2287
- });
2288
- }, e.loadExternalResourcesAuth1 = function(t, n, r, i, a, o, s, c) {
2289
- return new Promise(function(l, u) {
2290
- var d = t.map(function(t) {
2291
- return e.loadExternalResourceAuth1(t, n, r, i, a, o, s, c);
2292
- });
2293
- Promise.all(d).then(function() {
2294
- l(t);
2295
- }).catch(function(e) {
2296
- u(e);
2297
- });
2298
- });
2299
- }, e.loadExternalResourceAuth1 = function(t, n, a, o, c, l, u, d) {
2300
- return r(this, void 0, void 0, function() {
2301
- var r;
2302
- return i(this, function(i) {
2303
- switch (i.label) {
2304
- case 0: return [4, o(t)];
2305
- case 1: return (r = i.sent()) ? [4, t.getData(r)] : [3, 6];
2306
- case 2: return i.sent(), t.status === s.OK ? [2, t] : [3, 3];
2307
- case 3: return [4, e.doAuthChain(t, n, a, c, l, u, d)];
2308
- case 4: i.sent(), i.label = 5;
2309
- case 5:
2310
- if (t.status === s.OK || t.status === s.MOVED_TEMPORARILY) return [2, t];
2311
- throw e.createAuthorizationFailedError();
2312
- case 6: return [4, t.getData()];
2313
- case 7: return i.sent(), t.status !== s.MOVED_TEMPORARILY && t.status !== s.UNAUTHORIZED ? [3, 9] : [4, e.doAuthChain(t, n, a, c, l, u, d)];
2314
- case 8: i.sent(), i.label = 9;
2315
- case 9:
2316
- if (t.status === s.OK || t.status === s.MOVED_TEMPORARILY) return [2, t];
2317
- throw e.createAuthorizationFailedError();
2318
- }
2319
- });
2320
- });
2321
- }, e.doAuthChain = function(t, n, a, o, c, l, u) {
2322
- return r(this, void 0, void 0, function() {
2323
- var r, d, f, p, m, h, g, _;
2324
- return i(this, function(i) {
2325
- switch (i.label) {
2326
- case 0: return t.isAccessControlled() ? ((r = t.externalService) && (r.options = t.options), (d = t.kioskService) && (d.options = t.options), (f = t.clickThroughService) && (f.options = t.options), (p = t.loginService) && (p.options = t.options), t.isResponseHandled || t.status !== s.MOVED_TEMPORARILY ? [3, 2] : [4, l(t)]) : [2, t];
2327
- case 1:
2328
- case 3:
2329
- case 6:
2330
- case 10:
2331
- case 14: return i.sent(), [2, t];
2332
- case 2: return m = null, h = null, (m = r) ? (h = m, [4, e.attemptResourceWithToken(t, a, m)]) : [3, 4];
2333
- case 4: return (m = d) ? (h = m, (g = n(m)) ? [4, o(g)] : [3, 7]) : [3, 7];
2334
- case 5:
2335
- case 9:
2336
- case 13: return i.sent(), [4, e.attemptResourceWithToken(t, a, m)];
2337
- case 7: return (m = f) ? (h = m, [4, c(t, m)]) : [3, 11];
2338
- case 8: return (_ = i.sent()) ? [4, o(_)] : [3, 11];
2339
- case 11: return (m = p) ? (h = m, [4, c(t, m)]) : [3, 15];
2340
- case 12: return (_ = i.sent()) ? [4, o(_)] : [3, 15];
2341
- case 15: return h && u(t, h), [2];
2342
- }
2343
- });
2344
- });
2345
- }, e.attemptResourceWithToken = function(e, t, n) {
2346
- return r(this, void 0, void 0, function() {
2347
- var r, a;
2348
- return i(this, function(i) {
2349
- switch (i.label) {
2350
- case 0: return (r = n.getService(o.ServiceProfile.AUTH_1_TOKEN)) ? [4, t(e, r)] : [3, 3];
2351
- case 1: return (a = i.sent()) && a.accessToken ? [4, e.getData(a)] : [3, 3];
2352
- case 2: return i.sent(), [2, e];
2353
- case 3: return [2];
2354
- }
2355
- });
2356
- });
2357
- }, e.loadExternalResourcesAuth09 = function(t, n, r, i, a, o, s, c, l, u) {
2358
- return new Promise(function(d, f) {
2359
- var p = t.map(function(t) {
2360
- return e.loadExternalResourceAuth09(t, n, r, i, a, o, s, c, l, u);
2361
- });
2362
- Promise.all(p).then(function() {
2363
- d(t);
2364
- }).catch(function(e) {
2365
- f(e);
2366
- });
2367
- });
2368
- }, e.loadExternalResourceAuth09 = function(t, n, r, i, a, o, c, l, u, d) {
2369
- return new Promise(function(f, p) {
2370
- d && d.pessimisticAccessControl ? t.getData().then(function() {
2371
- t.isAccessControlled() ? t.clickThroughService ? (f(r(t)), f(i(t))) : a(t).then(function() {
2372
- o(t, !0).then(function(n) {
2373
- t.getData(n).then(function() {
2374
- f(u(t));
2375
- }).catch(function(t) {
2376
- p(e.createInternalServerError(t));
2377
- });
2378
- }).catch(function(t) {
2379
- p(e.createInternalServerError(t));
2380
- });
2381
- }).catch(function(t) {
2382
- p(e.createInternalServerError(t));
2383
- }) : f(t);
2384
- }).catch(function(t) {
2385
- p(e.createInternalServerError(t));
2386
- }) : l(t, n).then(function(d) {
2387
- d ? t.getData(d).then(function() {
2388
- t.status === s.OK ? f(u(t)) : e.authorize(t, n, r, i, a, o, c, l).then(function() {
2389
- f(u(t));
2390
- }).catch(function(t) {
2391
- p(e.createAuthorizationFailedError());
2392
- });
2393
- }).catch(function(t) {
2394
- p(e.createAuthorizationFailedError());
2395
- }) : e.authorize(t, n, r, i, a, o, c, l).then(function() {
2396
- f(u(t));
2397
- }).catch(function(t) {
2398
- p(e.createAuthorizationFailedError());
2399
- });
2400
- }).catch(function(t) {
2401
- p(e.createAuthorizationFailedError());
2402
- });
2403
- });
2404
- }, e.createError = function(e, t) {
2405
- var n = /* @__PURE__ */ Error();
2406
- return n.message = t, n.name = String(e), n;
2407
- }, e.createAuthorizationFailedError = function() {
2408
- return e.createError(a.StatusCode.AUTHORIZATION_FAILED, "Authorization failed");
2409
- }, e.createRestrictedError = function() {
2410
- return e.createError(a.StatusCode.RESTRICTED, "Restricted");
2411
- }, e.createInternalServerError = function(t) {
2412
- return e.createError(a.StatusCode.INTERNAL_SERVER_ERROR, t);
2413
- }, e.authorize = function(t, n, r, i, a, o, c, l) {
2414
- return new Promise(function(u, d) {
2415
- t.getData().then(function() {
2416
- t.isAccessControlled() ? l(t, n).then(function(l) {
2417
- l ? t.getData(l).then(function() {
2418
- t.status === s.OK ? u(t) : e.showAuthInteraction(t, n, r, i, a, o, c, u, d);
2419
- }).catch(function(t) {
2420
- d(e.createInternalServerError(t));
2421
- }) : o(t, !1).then(function(l) {
2422
- l ? c(t, l, n).then(function() {
2423
- t.getData(l).then(function() {
2424
- t.status === s.OK ? u(t) : e.showAuthInteraction(t, n, r, i, a, o, c, u, d);
2425
- }).catch(function(t) {
2426
- d(e.createInternalServerError(t));
2427
- });
2428
- }).catch(function(t) {
2429
- d(e.createInternalServerError(t));
2430
- }) : e.showAuthInteraction(t, n, r, i, a, o, c, u, d);
2431
- });
2432
- }).catch(function(t) {
2433
- d(e.createInternalServerError(t));
2434
- }) : u(t);
2435
- });
2436
- });
2437
- }, e.showAuthInteraction = function(t, n, r, i, a, o, c, l, u) {
2438
- t.status !== s.MOVED_TEMPORARILY || t.isResponseHandled ? t.clickThroughService && !t.isResponseHandled ? r(t).then(function() {
2439
- o(t, !0).then(function(r) {
2440
- c(t, r, n).then(function() {
2441
- t.getData(r).then(function() {
2442
- l(t);
2443
- }).catch(function(t) {
2444
- u(e.createInternalServerError(t));
2445
- });
2446
- }).catch(function(t) {
2447
- u(e.createInternalServerError(t));
2448
- });
2449
- }).catch(function(t) {
2450
- u(e.createInternalServerError(t));
2451
- });
2452
- }) : a(t).then(function() {
2453
- o(t, !0).then(function(r) {
2454
- c(t, r, n).then(function() {
2455
- t.getData(r).then(function() {
2456
- l(t);
2457
- }).catch(function(t) {
2458
- u(e.createInternalServerError(t));
2459
- });
2460
- }).catch(function(t) {
2461
- u(e.createInternalServerError(t));
2462
- });
2463
- }).catch(function(t) {
2464
- u(e.createInternalServerError(t));
2465
- });
2466
- }) : l(t);
2467
- }, e.getService = function(e, t) {
2468
- for (var n = this.getServices(e), r = 0; r < n.length; r++) {
2469
- var i = n[r];
2470
- if (i.getProfile() === t) return i;
2471
- }
2472
- return null;
2473
- }, e.getResourceById = function(t, n) {
2474
- return e.traverseAndFind(t.__jsonld, "@id", n);
2475
- }, e.traverseAndFind = function(t, n, r) {
2476
- if (t.hasOwnProperty(n) && t[n] === r) return t;
2477
- for (var i = 0; i < Object.keys(t).length; i++) if (typeof t[Object.keys(t)[i]] == "object") {
2478
- var a = e.traverseAndFind(t[Object.keys(t)[i]], n, r);
2479
- if (a != null) return a;
2480
- }
2481
- }, e.getServices = function(t, n) {
2482
- var r = n === void 0 ? {} : n, i = r.onlyService, o = i !== void 0 && i, s = r.onlyServices, c = s !== void 0 && s, l = r.skipParentResources, u = [];
2483
- (l === void 0 || !l) && t && t.options && t.options.resource && t.options.resource !== t && u.push.apply(u, e.getServices(t.options.resource, { onlyServices: !0 }));
2484
- var d = c ? [] : (t.__jsonld || t).service || [];
2485
- if (Array.isArray(d) || (d = [d]), o || d.push.apply(d, (t.__jsonld || t).services || []), d.length === 0) return u;
2486
- for (var f = 0; f < d.length; f++) {
2487
- var p = d[f];
2488
- if (typeof p == "string") {
2489
- var m = this.getResourceById(t.options.resource, p);
2490
- m && u.push(new a.Service(m.__jsonld || m, t.options));
2491
- } else u.push(new a.Service(p, t.options));
2492
- }
2493
- return u;
2494
- }, e.getTemporalComponent = function(e) {
2495
- var t = /t=([^&]+)/g.exec(e), n = null;
2496
- return t && t[1] && (n = t[1].split(",")), n;
2497
- }, e;
2498
- }();
2499
- },
2500
- 156(e, t, n) {
2501
- var r = this && this.__createBinding || (Object.create ? function(e, t, n, r) {
2502
- r === void 0 && (r = n);
2503
- var i = Object.getOwnPropertyDescriptor(t, n);
2504
- i && !("get" in i ? !t.__esModule : i.writable || i.configurable) || (i = {
2505
- enumerable: !0,
2506
- get: function() {
2507
- return t[n];
2508
- }
2509
- }), Object.defineProperty(e, r, i);
2510
- } : function(e, t, n, r) {
2511
- r === void 0 && (r = n), e[r] = t[n];
2512
- }), i = this && this.__exportStar || function(e, t) {
2513
- for (var n in e) n === "default" || Object.prototype.hasOwnProperty.call(t, n) || r(t, e, n);
2514
- };
2515
- Object.defineProperty(t, "__esModule", { value: !0 }), t.parseManifest = t.loadManifest = void 0, i(n(799), t);
2516
- var a = n(41);
2517
- t.loadManifest = function(e) {
2518
- return a.Utils.loadManifest(e);
2519
- }, t.parseManifest = function(e, t) {
2520
- return a.Utils.parseManifest(e, t);
2521
- };
2522
- },
2523
- 799(e, t, n) {
2524
- var r = this && this.__createBinding || (Object.create ? function(e, t, n, r) {
2525
- r === void 0 && (r = n);
2526
- var i = Object.getOwnPropertyDescriptor(t, n);
2527
- i && !("get" in i ? !t.__esModule : i.writable || i.configurable) || (i = {
2528
- enumerable: !0,
2529
- get: function() {
2530
- return t[n];
2531
- }
2532
- }), Object.defineProperty(e, r, i);
2533
- } : function(e, t, n, r) {
2534
- r === void 0 && (r = n), e[r] = t[n];
2535
- }), i = this && this.__exportStar || function(e, t) {
2536
- for (var n in e) n === "default" || Object.prototype.hasOwnProperty.call(t, n) || r(t, e, n);
2537
- };
2538
- Object.defineProperty(t, "__esModule", { value: !0 }), i(n(436), t), i(n(315), t), i(n(258), t), i(n(107), t), i(n(39), t), i(n(339), t), i(n(435), t), i(n(556), t), i(n(98), t), i(n(214), t), i(n(858), t), i(n(712), t), i(n(167), t), i(n(672), t), i(n(376), t), i(n(184), t), i(n(739), t), i(n(817), t), i(n(72), t), i(n(212), t), i(n(6), t), i(n(531), t), i(n(43), t), i(n(845), t), i(n(940), t), i(n(591), t), i(n(29), t), i(n(579), t), i(n(639), t), i(n(633), t), i(n(692), t), i(n(204), t), i(n(570), t), i(n(386), t), i(n(41), t);
2539
- },
2540
- 782(e, t, n) {
2541
- function r(e, t) {
2542
- return t ||= {}, new Promise(function(n, r) {
2543
- var i = new XMLHttpRequest(), a = [], o = [], s = {}, c = function() {
2544
- return {
2545
- ok: (i.status / 100 | 0) == 2,
2546
- statusText: i.statusText,
2547
- status: i.status,
2548
- url: i.responseURL,
2549
- text: function() {
2550
- return Promise.resolve(i.responseText);
2551
- },
2552
- json: function() {
2553
- return Promise.resolve(i.responseText).then(JSON.parse);
2554
- },
2555
- blob: function() {
2556
- return Promise.resolve(new Blob([i.response]));
2557
- },
2558
- clone: c,
2559
- headers: {
2560
- keys: function() {
2561
- return a;
2562
- },
2563
- entries: function() {
2564
- return o;
2565
- },
2566
- get: function(e) {
2567
- return s[e.toLowerCase()];
2568
- },
2569
- has: function(e) {
2570
- return e.toLowerCase() in s;
2571
- }
2572
- }
2573
- };
2574
- };
2575
- for (var l in i.open(t.method || "get", e, !0), i.onload = function() {
2576
- i.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(e, t, n) {
2577
- a.push(t = t.toLowerCase()), o.push([t, n]), s[t] = s[t] ? s[t] + "," + n : n;
2578
- }), n(c());
2579
- }, i.onerror = r, i.withCredentials = t.credentials == "include", t.headers) i.setRequestHeader(l, t.headers[l]);
2580
- i.send(t.body || null);
2581
- });
2582
- }
2583
- n.r(t), n.d(t, { default: () => r });
2584
- }
2585
- }, t = {};
2586
- function n(r) {
2587
- var i = t[r];
2588
- if (i !== void 0) return i.exports;
2589
- var a = t[r] = { exports: {} };
2590
- return e[r].call(a.exports, a, a.exports, n), a.exports;
2591
- }
2592
- return n.d = (e, t) => {
2593
- for (var r in t) n.o(t, r) && !n.o(e, r) && Object.defineProperty(e, r, {
2594
- enumerable: !0,
2595
- get: t[r]
2596
- });
2597
- }, n.o = (e, t) => Object.prototype.hasOwnProperty.call(e, t), n.r = (e) => {
2598
- typeof Symbol < "u" && Symbol.toStringTag && Object.defineProperty(e, Symbol.toStringTag, { value: "Module" }), Object.defineProperty(e, "__esModule", { value: !0 });
2599
- }, n(156);
2600
- })());
2601
- })), z = vt();
2602
- function B(e) {
2603
- return e.getServices().find((e) => e.getProfile && z.Utils.isImageProfile(e.getProfile() || "") || z.Utils.isImageServiceType(e.getIIIFResourceType() || ""));
2604
- }
2605
- //#endregion
2606
- //#region src/lib/MiradorCanvas.js
2607
- var yt = class {
2608
- constructor(e) {
2609
- this.canvas = e;
2610
- }
2611
- get id() {
2612
- return this.canvas.id;
2613
- }
2614
- getWidth() {
2615
- return this.canvas.getWidth();
2616
- }
2617
- getHeight() {
2618
- return this.canvas.getHeight();
2619
- }
2620
- get aspectRatio() {
2621
- return this.canvas.getWidth() / this.canvas.getHeight();
2622
- }
2623
- get annotationListUris() {
2624
- return Array(this.canvas.__jsonld.otherContent).flat().filter((e) => e && (typeof e == "string" || e["@type"] === "sc:AnnotationList")).map((e) => typeof e == "string" ? e : e["@id"]);
2625
- }
2626
- get canvasAnnotationPages() {
2627
- return Array(this.canvas.__jsonld.annotations).flat().filter((e) => e && e.type === "AnnotationPage");
2628
- }
2629
- get imageResource() {
2630
- return this.imageResources[0];
2631
- }
2632
- get imageResources() {
2633
- return [this.canvas.getImages().map((e) => e.getResource()), this.canvas.getContent().map((e) => e.__jsonld.body.type === "Choice" ? e.__jsonld.body : e.getBody())].flat(Infinity).flatMap((e) => {
2634
- switch (e.type || e.getProperty("type")) {
2635
- case "Choice": return new z.Canvas({ images: e.items.map((e) => ({ resource: e })) }, this.canvas.options).getImages().map((e, t) => {
2636
- let n = e.getResource();
2637
- return n && (n.preferred = !t), n;
2638
- });
2639
- case "oa:Choice": return new z.Canvas({ images: [e.getProperty("default"), e.getProperty("item")].flat(Infinity).map((e) => ({ resource: e })) }, this.canvas.options).getImages().map((e, t) => {
2640
- let n = e.getResource();
2641
- return n && (n.preferred = !t), n;
2642
- });
2643
- default: {
2644
- let t = e;
2645
- return t.preferred = !0, t;
2646
- }
2647
- }
2648
- });
2649
- }
2650
- get textResources() {
2651
- return [this.canvas.getContent().map((e) => e.getBody())].flat(Infinity).filter((e) => e.getProperty("type") === "Text").flat();
2652
- }
2653
- get videoResources() {
2654
- return [this.canvas.getContent().map((e) => e.getBody())].flat(Infinity).filter((e) => e.getProperty("type") === "Video").flat();
2655
- }
2656
- get audioResources() {
2657
- return [this.canvas.getContent().map((e) => e.getBody())].flat(Infinity).filter((e) => e.getProperty("type") === "Sound").flat();
2658
- }
2659
- get v2VttContent() {
2660
- return [this.canvas.getContent().map((e) => e.getBody())].flat(Infinity).filter((e) => e.getProperty("format") === "text/vtt").flat();
2661
- }
2662
- get v3VttContent() {
2663
- return this.canvasAnnotationPages.map((e) => new z.AnnotationPage(e, this.canvas.options).getItems().map((e) => new z.Annotation(e, this.canvas.options).getBody())).flat(Infinity).filter((e) => e.getProperty("format") === "text/vtt").flat();
2664
- }
2665
- get resourceAnnotations() {
2666
- return [this.canvas.getImages(), this.canvas.getContent()].flat(Infinity);
2667
- }
2668
- resourceAnnotation(e) {
2669
- return this.resourceAnnotations.find((t) => t.getResource().id === e || Array(t.getBody()).flat().some((t) => t.id === e));
2670
- }
2671
- onFragment(e) {
2672
- let t = this.resourceAnnotation(e);
2673
- if (!t) return;
2674
- let n = t.getProperty("on"), r = t.getProperty("target"), i = (n || r).match(/xywh=(.*)$/);
2675
- if (i) return i[1].split(",").map((e) => parseInt(e, 10));
2676
- }
2677
- get iiifImageResources() {
2678
- return this.imageResources.filter((e) => e && B(e)?.id);
2679
- }
2680
- get imageServiceIds() {
2681
- return this.iiifImageResources.map((e) => e && B(e)?.id);
2682
- }
2683
- get service() {
2684
- return this.canvas.__jsonld.service;
2685
- }
2686
- getLabel(e = void 0) {
2687
- return this.canvas.getLabel().length > 0 ? this.canvas.getLabel().getValue(e) : String(this.canvas.index + 1);
2688
- }
2689
- }, V = class {
2690
- constructor(e) {
2691
- this.manifest = e;
2692
- }
2693
- get startCanvas() {
2694
- let e, t = this.manifest.getSequences()[0];
2695
- if (t) {
2696
- if (e = t.getProperty("startCanvas"), !e) {
2697
- let n = this.manifest.getProperty("start") || t.getProperty("start");
2698
- e = n && (n.id || n.source);
2699
- }
2700
- return e && t.getCanvasById(e) || void 0;
2701
- }
2702
- }
2703
- canvasAt(e) {
2704
- let t = this.manifest.getSequences()[0], n = t && t.getCanvases();
2705
- return n && n[e];
2706
- }
2707
- }, H = _([], (e, t) => (e) => e && new yt(e)), bt = _([], (e) => (e) => e && new V(e));
2708
- //#endregion
2709
- //#region src/lib/asArray.js
2710
- function U(e) {
2711
- return e === void 0 ? [] : Array.isArray(e) ? e : [e];
2712
- }
2713
- //#endregion
2714
- //#region ../node_modules/lodash/_arrayAggregator.js
2715
- var xt = /* @__PURE__ */ T(((e, t) => {
2716
- function n(e, t, n, r) {
2717
- for (var i = -1, a = e == null ? 0 : e.length; ++i < a;) {
2718
- var o = e[i];
2719
- t(r, o, n(o), e);
2720
- }
2721
- return r;
2722
- }
2723
- t.exports = n;
2724
- })), St = /* @__PURE__ */ T(((e, t) => {
2725
- var n = Me();
2726
- function r(e, t, r, i) {
2727
- return n(e, function(e, n, a) {
2728
- t(i, e, r(e), a);
2729
- }), i;
2730
- }
2731
- t.exports = r;
2732
- })), Ct = /* @__PURE__ */ T(((e, t) => {
2733
- var n = xt(), r = St(), i = gt(), a = S();
2734
- function o(e, t) {
2735
- return function(o, s) {
2736
- var c = a(o) ? n : r, l = t ? t() : {};
2737
- return c(o, e, i(s, 2), l);
2738
- };
2739
- }
2740
- t.exports = o;
2741
- })), wt = /* @__PURE__ */ h((/* @__PURE__ */ T(((e, t) => {
2742
- var n = we(), r = Ct(), i = Object.prototype.hasOwnProperty;
2743
- t.exports = r(function(e, t, r) {
2744
- i.call(e, r) ? e[r].push(t) : n(e, r, [t]);
2745
- });
2746
- })))(), 1);
2747
- function W(e) {
2748
- return m(e).companionWindows || p;
2749
- }
2750
- var Tt = _([W, (e, { companionWindowId: t }) => t], (e, t) => t && e[t]), Et = _([Tt], (e) => e && e.locale), Dt = _([d, W], (e, t) => e && t[e.thumbnailNavigationId] && t[e.thumbnailNavigationId].position), Ot = _([f, W], (e, t) => (Object.keys(e) || []).reduce((n, r) => ({
2751
- ...n,
2752
- [r]: (0, wt.default)(e[r].companionWindowIds || w, (e) => t[e] && t[e].position)
2753
- }), {})), kt = _([f, W], (e, t) => (Object.keys(e) || []).reduce((n, r) => ({
2754
- ...n,
2755
- [r]: (0, wt.default)((e[r].companionWindowIds || w).map((e) => t[e]), (e) => e.position)
2756
- }), {})), At = _([(e, { windowId: t }) => t, kt], (e, t) => t[e] || p), jt = _([(e, { windowId: t }) => t, Ot], (e, t) => t[e] || p), Mt = _([At, (e, { position: t }) => t], (e, t) => e[t] || w), Nt = _([At, (e, { content: t }) => t], (e, t) => [].concat(...Object.values(e)).filter((e) => e.content === t)), Pt = _([jt, (e, { position: t }) => t], (e, t) => e[t] || w), Ft = _([(e, { position: t }) => t, d], (e, t) => {
2757
- if (!t) return !1;
2758
- let { companionAreaOpen: n, sideBarOpen: r } = t;
2759
- return e !== "left" || !!(n && r);
2760
- }), It = _([At], (e) => {
2761
- let t = 0, n = 0;
2762
- return [].concat(...Object.values(e)).forEach((e) => {
2763
- e.position.match(/right/) && (t += 235), e.position.match(/bottom/) && (n += 201);
2764
- }), {
2765
- height: n,
2766
- width: t
2767
- };
2768
- }), Lt = /* @__PURE__ */ T(((e, t) => {
2769
- var n = function(e) {
2770
- return r(e) && !i(e);
2771
- };
2772
- function r(e) {
2773
- return !!e && typeof e == "object";
2774
- }
2775
- function i(e) {
2776
- var t = Object.prototype.toString.call(e);
2777
- return t === "[object RegExp]" || t === "[object Date]" || o(e);
2778
- }
2779
- var a = typeof Symbol == "function" && Symbol.for ? Symbol.for("react.element") : 60103;
2780
- function o(e) {
2781
- return e.$$typeof === a;
2782
- }
2783
- function s(e) {
2784
- return Array.isArray(e) ? [] : {};
2785
- }
2786
- function c(e, t) {
2787
- return t.clone !== !1 && t.isMergeableObject(e) ? g(s(e), e, t) : e;
2788
- }
2789
- function l(e, t, n) {
2790
- return e.concat(t).map(function(e) {
2791
- return c(e, n);
2792
- });
2793
- }
2794
- function u(e, t) {
2795
- if (!t.customMerge) return g;
2796
- var n = t.customMerge(e);
2797
- return typeof n == "function" ? n : g;
2798
- }
2799
- function d(e) {
2800
- return Object.getOwnPropertySymbols ? Object.getOwnPropertySymbols(e).filter(function(t) {
2801
- return Object.propertyIsEnumerable.call(e, t);
2802
- }) : [];
2803
- }
2804
- function f(e) {
2805
- return Object.keys(e).concat(d(e));
2806
- }
2807
- function p(e, t) {
2808
- try {
2809
- return t in e;
2810
- } catch {
2811
- return !1;
2812
- }
2813
- }
2814
- function m(e, t) {
2815
- return p(e, t) && !(Object.hasOwnProperty.call(e, t) && Object.propertyIsEnumerable.call(e, t));
2816
- }
2817
- function h(e, t, n) {
2818
- var r = {};
2819
- return n.isMergeableObject(e) && f(e).forEach(function(t) {
2820
- r[t] = c(e[t], n);
2821
- }), f(t).forEach(function(i) {
2822
- m(e, i) || (r[i] = p(e, i) && n.isMergeableObject(t[i]) ? u(i, n)(e[i], t[i], n) : c(t[i], n));
2823
- }), r;
2824
- }
2825
- function g(e, t, r) {
2826
- r ||= {}, r.arrayMerge = r.arrayMerge || l, r.isMergeableObject = r.isMergeableObject || n, r.cloneUnlessOtherwiseSpecified = c;
2827
- var i = Array.isArray(t);
2828
- return i === Array.isArray(e) ? i ? r.arrayMerge(e, t, r) : h(e, t, r) : c(t, r);
2829
- }
2830
- g.all = function(e, t) {
2831
- if (!Array.isArray(e)) throw Error("first argument should be an array");
2832
- return e.reduce(function(e, n) {
2833
- return g(e, n, t);
2834
- }, {});
2835
- }, t.exports = g;
2836
- })), Rt = /* @__PURE__ */ h(Lt(), 1), zt = [
2837
- "ar",
2838
- "fa",
2839
- "he",
2840
- "ur"
2841
- ];
2842
- function Bt(e) {
2843
- return e ? zt.includes(e.split("-")[0].toLowerCase()) : !1;
2844
- }
2845
- //#endregion
2846
- //#region src/state/selectors/config.js
2847
- function G(e) {
2848
- return m(e || {}).config || p;
2849
- }
2850
- function Vt(e) {
2851
- let t = G(e).export;
2852
- return Object.entries(t).reduce((t, [n, r]) => (r === !0 ? t[n] = e[n] : r.filter && (t[n] = Object.entries(e[n]).filter(r.filter).reduce((e, [t, n]) => (e[t] = n, e), {})), t), {});
2853
- }
2854
- var Ht = _([G], ({ availableLanguages: e, language: t }) => Object.keys(e).map((n) => ({
2855
- current: n === t,
2856
- label: e[n],
2857
- locale: n
2858
- }))), Ut = _([g, G], (e, t) => e.showZoomControls === void 0 ? t.workspace.showZoomControls : e.showZoomControls), Wt = _([G], ({ theme: e, themes: t, selectedTheme: n, language: r }) => {
2859
- let i = (0, Rt.default)(e, t[n] || {});
2860
- return i.direction || !Bt(r) ? i : {
2861
- ...i,
2862
- direction: "rtl"
2863
- };
2864
- }), Gt = _([G], ({ themes: e }) => Object.keys(e)), Kt = _([G], ({ id: e }) => e), qt = _([G], ({ theme: e, language: t }) => e.direction || (Bt(t) ? "rtl" : "ltr")), Jt = _([G], ({ requests: e }) => e || p), Yt = _([G], ({ thumbnails: e }) => e || p);
2865
- //#endregion
2866
- //#region src/lib/ThumbnailFactory.js
2867
- function Xt(e) {
2868
- let t = e.getProfile();
2869
- return t.endsWith("#level1") || t.endsWith("#level2") ? !1 : t === "level0" || z.Utils.isLevel0ImageProfile(t);
2870
- }
2871
- function Zt(e) {
2872
- let t = e.getProfile();
2873
- return t.endsWith("#level0") || t.endsWith("#level1") ? !1 : t === "level2" || z.Utils.isLevel2ImageProfile(t);
2874
- }
2875
- function Qt(e) {
2876
- return U(e.getProperty("type") || []).some((e) => e.startsWith("ImageService"));
2877
- }
2878
- function $t(e) {
2879
- let t = e && e.getServices().find((e) => Qt(e) || z.Utils.isImageProfile(e.getProfile()));
2880
- if (t) return t;
2881
- }
2882
- var en = class e {
2883
- constructor(e = {}, { getMiradorCanvas: t, getMiradorManifest: n }) {
2884
- this.iiifOpts = e, this.getMiradorCanvas = t, this.getMiradorManifest = n;
2885
- }
2886
- static staticImageUrl(e) {
2887
- return {
2888
- height: e.getProperty("height"),
2889
- url: e.id,
2890
- width: e.getProperty("width")
2891
- };
2892
- }
2893
- static getPreferredImage(e) {
2894
- return e.iiifImageResources[0] || e.imageResource;
2895
- }
2896
- static selectBestImageSize(e, t) {
2897
- let n = U(e.getProperty("sizes")), r = {
2898
- default: !0,
2899
- height: e.getProperty("height") || 2 ** 53 - 1,
2900
- width: e.getProperty("width") || 2 ** 53 - 1
2901
- }, i = (e) => e.width * e.height - t;
2902
- if (r = n.reduce((e, t) => {
2903
- let n = i(t);
2904
- return n < 0 ? e : Math.abs(n) < Math.abs(i(e)) ? t : e;
2905
- }, r), r.width * r.height > t * 6 && (r = n.reduce((e, t) => Math.abs(i(t)) < Math.abs(i(e)) ? t : e, r)), !r.default) return r;
2906
- }
2907
- iiifThumbnailUrl(t) {
2908
- let n, r, i, a = 120, o = 120, { maxHeight: s, maxWidth: c } = this.iiifOpts;
2909
- s && (a = Math.max(s, 120)), c && (o = Math.max(c, 120));
2910
- let l = $t(t);
2911
- if (!l) return e.staticImageUrl(t);
2912
- let u = t.getWidth() && t.getHeight() && t.getWidth() / t.getHeight(), d = c && s ? c * s : a * o, f = e.selectBestImageSize(l, d);
2913
- if (f) r = f.width, i = f.height, n = `${r},${i}`;
2914
- else if (Xt(l)) {
2915
- if (!l.getProperty("height") && !l.getProperty("width")) return e.staticImageUrl(t);
2916
- } else s && c ? Zt(l) ? (n = `!${o},${a}`, r = o, i = a, u && u > 1 && (i = Math.round(o / u)), u && u < 1 && (r = Math.round(a * u))) : o / a < u ? (n = `${o},`, r = o, u && (i = Math.round(o / u))) : (n = `,${a}`, i = a, u && (r = Math.round(a * u))) : s && !c ? (n = `,${a}`, i = a, u && (r = Math.round(a * u))) : !s && c ? (n = `${o},`, r = o, u && (i = Math.round(o / u))) : (n = ",120", i = 120, u && (r = Math.round(i * u)));
2917
- let p = z.Utils.getImageQuality(l.getProfile()), m = l.id.replace(/\/+$/, ""), h = this.getFormat(l);
2918
- return {
2919
- height: i,
2920
- url: [
2921
- m,
2922
- "full",
2923
- n,
2924
- 0,
2925
- `${p}.${h}`
2926
- ].join("/"),
2927
- width: r
2928
- };
2929
- }
2930
- getFormat(e) {
2931
- let { preferredFormats: t = [] } = this.iiifOpts, n = e.getProperty("preferredFormats");
2932
- if (!n) return "jpg";
2933
- let r = n.filter((e) => t.includes(e));
2934
- return r[0] ? r[0] : !n.includes("jpg") && t.includes("jpg") ? "jpg" : n[0] ? n[0] : "jpg";
2935
- }
2936
- getSourceContentResource(t) {
2937
- let n = t.getThumbnail();
2938
- if (n) return typeof n.__jsonld == "string" ? n.__jsonld : !t.isCollection() && !t.isManifest() && !t.isCanvas() && t.getType() === "image" && $t(t) && !$t(n) ? t : n;
2939
- if (t.isCollection()) {
2940
- let e = t.getManifests()[0];
2941
- return e ? this.getSourceContentResource(e) : void 0;
2942
- }
2943
- if (t.isManifest()) {
2944
- let e = this.getMiradorManifest(t), n = e.startCanvas || e.canvasAt(0);
2945
- return n ? this.getSourceContentResource(n) : void 0;
2946
- }
2947
- if (t.isCanvas()) {
2948
- let n = e.getPreferredImage(this.getMiradorCanvas(t));
2949
- return n ? this.getSourceContentResource(n) : void 0;
2950
- }
2951
- if (t.getType() === "image") return t;
2952
- }
2953
- get(e) {
2954
- if (!e) return;
2955
- let t = this.getSourceContentResource(e);
2956
- if (t) return typeof t == "string" ? { url: t } : this.iiifThumbnailUrl(t);
2957
- }
2958
- };
2959
- function tn(e, t = {}) {
2960
- return new en(t, {
2961
- getMiradorCanvas: (e) => new yt(e),
2962
- getMiradorManifest: (e) => new V(e)
2963
- }).get(e);
2964
- }
2965
- //#endregion
2966
- //#region src/state/selectors/thumbnails.js
2967
- var nn = _([
2968
- Yt,
2969
- (e, t, n) => t,
2970
- (e, t, n) => n
2971
- ], (e, t, n) => ({
2972
- maxHeight: t,
2973
- maxWidth: n,
2974
- preferredFormats: e.preferredFormats
2975
- })), rn = _([
2976
- nn,
2977
- H,
2978
- bt
2979
- ], (e, t, n) => new en(e, {
2980
- getMiradorCanvas: t,
2981
- getMiradorManifest: n
2982
- }));
2983
- //#endregion
2984
- //#region src/state/selectors/manifests.js
2985
- function an(e, t) {
2986
- if (!e) return;
2987
- let n = z.Utils.parseManifest(structuredClone(e), t ? { locale: t } : void 0);
2988
- if (n) return typeof n.getSequences != "function" && (n.getSequences = () => []), n;
2989
- }
2990
- var K = _([
2991
- Et,
2992
- G,
2993
- (e, { locale: t }) => t
2994
- ], (e, t = {}, n) => n || e || t.language || t.fallbackLanguages), on = Object.freeze({ missing: !0 }), sn = _([v], (e) => e || on), cn = _([v], (e) => e && e.error), ln = _(v, (e) => e && an(e.json)), q = _(ln, (e, { json: t }) => t, (e, t) => t && an(t) || e), J = _([q, K], (e, t) => t ?? (e && e.options && e.options.locale && e.options.locale.replace(/-.*$/, "")));
2995
- function Y(e) {
2996
- return _([q], (t) => t && t.getProperty(e));
2997
- }
2998
- var un = _([Y("provider"), J], (e, t) => e && e[0].label && z.PropertyValue.parse(e[0].label).getValue(t)), dn = Object.freeze({}), fn = _([Y("provider"), (e) => rn(e, dn)], (e, t) => {
2999
- let n = e && e[0] && e[0].logo && e[0].logo[0];
3000
- return n ? t.get(new z.Resource(n))?.url : null;
3001
- }), pn = _([q, fn], (e, t) => t || e && e.getLogo()), mn = _([Y("homepage"), J], (e, t) => e && U(e).map((e) => ({
3002
- label: z.PropertyValue.parse(e.label).getValue(t),
3003
- value: e.id || e["@id"]
3004
- }))), hn = _([q, J], (e, t) => e && e.getRenderings().map((e) => ({
3005
- label: e.getLabel().getValue(t),
3006
- value: e.id
3007
- }))), gn = _([Y("seeAlso"), J], (e, t) => e && U(e).map((e) => ({
3008
- format: e.format,
3009
- label: z.PropertyValue.parse(e.label).getValue(t),
3010
- value: e.id || e["@id"]
3011
- }))), _n = gn, vn = _([Y("related"), J], (e, t) => e && U(e).map((e) => typeof e == "string" ? { value: e } : {
3012
- format: e.format,
3013
- label: z.PropertyValue.parse(e.label).getValue(t),
3014
- value: e.id || e["@id"]
3015
- })), yn = _([K, q], (e, t) => t && U(t.getRequiredStatement()).flatMap((t) => {
3016
- let n = t?.getValues(e) ?? [];
3017
- if (!n.length) return [];
3018
- let r = t?.getLabels(e) ?? [];
3019
- return Array.from({ length: Math.max(r.length, n.length) }, (e, t) => t).filter((e) => n[e]).map((e) => ({
3020
- label: r[e] ?? null,
3021
- values: [n[e]]
3022
- }));
3023
- })), bn = _([
3024
- Y("rights"),
3025
- Y("license"),
3026
- J
3027
- ], (e, t, n) => {
3028
- let r = e || t;
3029
- return U(z.PropertyValue.parse(r).getValues(n));
3030
- });
3031
- function xn(e, t) {
3032
- let n = q(e, t), r = rn(e, 80, 120);
3033
- if (!n) return;
3034
- let i = r.get(n);
3035
- return i && i.url;
3036
- }
3037
- var Sn = _([q, J], (e, t) => e && e.getLabel().getValue(t)), Cn = _([K, q], (e, t) => t && t.getDescription().getValue(e)), wn = _([Y("summary"), J], (e, t) => e && z.PropertyValue.parse(e).getValue(t)), Tn = _([q], (e) => e && e.id);
3038
- function En(e, t = void 0) {
3039
- return e && e.getMetadata().map((e) => ({
3040
- label: e.getLabel(t),
3041
- values: e.getValues(t)
3042
- }));
3043
- }
3044
- var Dn = _([q, J], (e, t) => e && En(e, t));
3045
- function On(e) {
3046
- let t = /* @__PURE__ */ new Set([]), n = (e) => {
3047
- if (e && typeof e == "object") {
3048
- if (e["@language"] && e["@value"]) {
3049
- t.add(e["@language"]);
3050
- return;
3051
- }
3052
- Object.keys(e).forEach((e) => {
3053
- t.add(e);
3054
- });
3055
- }
3056
- };
3057
- return Array.isArray(e) ? e.forEach((e) => n(e)) : n(e), [...t];
3058
- }
3059
- function kn(e) {
3060
- if (!e) return [];
3061
- let t = e.getProperty("metadata") || [], n = {};
3062
- for (let e = 0; e < t.length; e += 1) {
3063
- let r = t[e];
3064
- On(r.label).forEach((e) => {
3065
- n[e] = !0;
3066
- }), On(r.value).forEach((e) => {
3067
- n[e] = !0;
3068
- });
3069
- }
3070
- return Object.keys(n);
3071
- }
3072
- var An = _([q], (e) => kn(e)), jn = _([q], (e) => e && (e.getService("http://iiif.io/api/search/0/search") || e.getService("http://iiif.io/api/search/1/search")) || null), Mn = _([jn], (e) => {
3073
- let t = e && (e.getService("http://iiif.io/api/search/0/autocomplete") || e.getService("http://iiif.io/api/search/1/autocomplete"));
3074
- return t && t;
3075
- }), Nn = _([q], (e) => {
3076
- if (!e || !e.getTopRanges) return null;
3077
- let t = e.getTopRanges(), n = t.filter((e) => e.getProperty("viewingHint") === "top"), r = [];
3078
- return n.length === 0 && t.length === 1 && (r = t[0].getRanges().filter((e) => e.getBehavior() === "sequence")), [].concat(e.getSequences(), r);
3079
- }), X = _([
3080
- Nn,
3081
- d,
3082
- (e, { sequenceId: t }) => t
3083
- ], (e, t, n) => {
3084
- if (!e) return null;
3085
- if (n || t && t.sequenceId) {
3086
- let r = e.find((e) => e.id === (n || t.sequenceId));
3087
- if (r) return r;
3088
- }
3089
- return e[0];
3090
- }), Pn = _([d, X], (e, t) => (t && e && e.canvasId && t.getCanvasById(e.canvasId) || {}).index || 0), Fn = _([X, q], (e, t) => t && (e && e.getViewingHint() || t.getViewingHint()) || null), In = _([
3091
- d,
3092
- X,
3093
- q
3094
- ], (e, t, n) => e && e.viewingDirection || t && t.getViewingDirection() || n && n.getViewingDirection() || null), Ln = _([X, q], (e, t) => {
3095
- if (!t || !e) return [];
3096
- let n = e && e.getProperty("behavior");
3097
- if (n) return Array.isArray(n) ? n : [n];
3098
- let r = t.getProperty("behavior");
3099
- return r ? Array.isArray(r) ? r : [r] : [];
3100
- }), Rn = _([X, q], (e, t) => e && e.getProperty("type") && e.isRange() ? e.getTree(new z.TreeNode("root")) : t && t.getDefaultTree());
3101
- //#endregion
3102
- //#region src/state/selectors/workspace.js
3103
- function zn(e) {
3104
- return m(e).elasticLayout;
3105
- }
3106
- var Bn = _([g], (e) => e.isFullscreenEnabled);
3107
- function Vn(e) {
3108
- let [t] = m(e).errors.items;
3109
- return m(e).errors[t];
3110
- }
3111
- var Hn = _([g], ({ type: e }) => e), Un = _([g], ({ focusedWindowId: e }) => e), Wn = (e, { windowId: t }) => Un(e) === t, Gn = _([G, d], ({ window: e }, t = {}) => ({
3112
- ...e,
3113
- ...t
3114
- }));
3115
- function Kn(e) {
3116
- let t = {};
3117
- return Object.keys(f(e)).forEach((n) => {
3118
- t[n] = Sn(e, { windowId: n });
3119
- }), t;
3120
- }
3121
- var qn = _([f], (e) => Object.values(e).filter((e) => e.maximized === !0).map((e) => e.id)), Jn = _([
3122
- d,
3123
- Gn,
3124
- Fn,
3125
- Ln
3126
- ], (e, { views: t = [], defaultView: n }, r, i) => {
3127
- if (e && e.view) return e.view;
3128
- let a = (t || []).find((e) => e.behaviors && e.behaviors.some((e) => r === e || i.includes(e)));
3129
- return a && a.key || n;
3130
- }), Yn = _([
3131
- Fn,
3132
- Ln,
3133
- Gn
3134
- ], (e, t, { views: n = [], defaultView: r }) => (n || []).reduce((n, i) => ((i.key === r || !i.behaviors || i.behaviors.some((n) => e === n || t.includes(n))) && n.push(i.key), n), [])), Xn = _([
3135
- Hn,
3136
- d,
3137
- (e) => b(e).length > 1
3138
- ], (e, t, n) => e === "elastic" || n && t && t.maximized === !1), Zn = (e) => m(e).infoResponses, Qn = _([X], (e) => e && e.getCanvases() || w), Z = _([X, (e, { canvasId: t }) => t], (e, t) => {
3139
- if (!(!e || !t)) return e.getCanvasById(t);
3140
- }), $n = _([X, d], (e, t) => {
3141
- if (!(!e || !t)) return t.canvasId ? e.getCanvasById(t.canvasId) : e.getCanvasByIndex(0);
3142
- }), er = _([d], (e) => e && (e.visibleCanvases || e.canvasId && [e.canvasId]) || w), Q = _([er, Qn], (e, t) => (t || []).filter((t) => e.includes(t.id))), $ = _([Qn, Jn], (e, t) => e && new _t(e, t).groupings()), tr = _([$, (e, { canvasId: t }) => t], (e, t) => e && e.find((e) => e.some((e) => e.id === t)) || w), nr = _([$, $n], (e, t, n) => {
3143
- if (!e || !t) return;
3144
- let r = e.findIndex((e) => e.some((e) => e.id === t.id));
3145
- if (!(r < 0 || r + 1 >= e.length)) return e[r + 1];
3146
- }), rr = _([$, $n], (e, t, n) => {
3147
- if (!e || !t) return;
3148
- let r = e.findIndex((e) => e.some((e) => e.id === t.id));
3149
- if (!(r < 1)) return e[r - 1];
3150
- }), ir = _([Z, J], (e, t) => e && (e.getLabel().length > 0 ? e.getLabel().getValue(t) : String(e.index + 1))), ar = _([Z, J], (e, t) => e && En(e, t)), or = _([Z], (e) => e && e.getProperty("description")), sr = _([Q, H], (e, t) => e.flatMap((e) => t(e).imageResources).filter((e) => !B(e))), cr = _([Q, H], (e, t) => e.flatMap((e) => t(e).textResources)), lr = _([Q, H], (e, t) => e.flatMap((e) => t(e).videoResources)), ur = _([Q, H], (e, t) => e.flatMap((e) => {
3151
- let n = t(e);
3152
- return n.v3VttContent.length ? n.v3VttContent : n.v2VttContent;
3153
- })), dr = _([Q, H], (e, t) => e.flatMap((e) => t(e).audioResources)), fr = _([
3154
- (e, { infoId: t }) => t,
3155
- Z,
3156
- H,
3157
- Zn
3158
- ], (e, t, n, r) => {
3159
- let i = e;
3160
- if (!e) {
3161
- if (!t) return;
3162
- let e = n(t).iiifImageResources[0];
3163
- i = e && B(e)?.id;
3164
- }
3165
- return i && r[i] && !r[i].isFetching && r[i];
3166
- });
3167
- //#endregion
3168
- export { gn as $, Ve as $t, Hn as A, Nt as At, K as B, B as Bt, Xn as C, Yt as Ct, Un as D, Pt as Dt, zn as E, Tt as Et, Rn as F, U as Ft, J as G, $e as Gt, Cn as H, _t as Ht, In as I, H as It, un as J, Xe as Jt, pn as K, Qe as Kt, Fn as L, bt as Lt, Pn as M, Dt as Mt, X as N, It as Nt, Bn as O, Et as Ot, Ln as P, Ct as Pt, jn as Q, Ue as Qt, Nn as R, V as Rt, Gn as S, Gt as St, Jn as T, Ft as Tt, cn as U, gt as Ut, Mn as V, vt as Vt, mn as W, nt as Wt, _n as X, qe as Xt, vn as Y, Ye as Yt, hn as Z, Ge as Zt, Q as _, Ht as _t, ir as a, we as an, q as at, Yn as b, Wt as bt, $n as c, I as cn, yn as ct, dr as d, ye as dn, rn as dt, Re as en, sn as et, ur as f, j as fn, en as ft, lr as g, Vt as gt, cr as h, Kt as ht, $ as i, Te as in, Tn as it, Wn as j, Mt as jt, Vn as k, W as kt, nr as l, Se as ln, bn as lt, sr as m, G as mt, or as n, R as nn, xn as nt, ar as o, Ce as on, An as ot, er as p, tn as pt, Dn as q, Ze as qt, tr as r, ke as rn, Sn as rt, Qn as s, L as sn, fn as st, Z as t, Me as tn, wn as tt, rr as u, be as un, nn as ut, fr as v, Jt as vt, Kn as w, Lt as wt, qn as x, qt as xt, Zn as y, Ut as yt, En as z, yt as zt };
3169
-
3170
- //# sourceMappingURL=canvases-CKYPFdER.js.map