react-iiif-vault 1.0.0 → 1.0.2

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,32 +1,32 @@
1
1
  import { jsx as x, jsxs as N, Fragment as Me } from "react/jsx-runtime";
2
- import * as ot from "react";
3
- import me, { useContext as H, useMemo as E, useState as B, useEffect as K, useCallback as D, createContext as ce, useRef as ge, useLayoutEffect as hr, Fragment as Ke, useReducer as on, forwardRef as yr, useImperativeHandle as cn } from "react";
4
- import { AtlasAuto as un, mergeStyles as ln, RegionHighlight as fn, TileSet as pn, HTMLPortal as dn } from "@atlas-viewer/atlas";
5
- import { serialize as hn, serializeConfigPresentation2 as yn, serializeConfigPresentation3 as vn, isSpecificResource as gn, HAS_PART as Ze, PART_OF as Xe, frameResource as vr, normalize as mn } from "@iiif/parser";
2
+ import * as at from "react";
3
+ import me, { useContext as H, useMemo as E, useState as B, useEffect as K, useCallback as D, createContext as ce, useRef as ge, useLayoutEffect as hr, Fragment as Ke, useReducer as an, forwardRef as yr, useImperativeHandle as cn } from "react";
4
+ import { AtlasAuto as un, ModeContext as ln, mergeStyles as fn, RegionHighlight as pn, TileSet as dn, HTMLPortal as hn } from "@atlas-viewer/atlas";
5
+ import { serialize as yn, serializeConfigPresentation2 as vn, serializeConfigPresentation3 as gn, isSpecificResource as mn, HAS_PART as Ze, PART_OF as Xe, frameResource as vr, normalize as bn } from "@iiif/parser";
6
6
  import { ImageServiceLoader as gr, getImageServices as mt, getFixedSizeFromImage as Yt } from "@atlas-viewer/iiif-image-api";
7
7
  function bt(e, t) {
8
8
  return bt = Object.setPrototypeOf || function(i, n) {
9
9
  return i.__proto__ = n, i;
10
10
  }, bt(e, t);
11
11
  }
12
- function bn(e, t) {
12
+ function An(e, t) {
13
13
  e.prototype = Object.create(t.prototype), e.prototype.constructor = e, bt(e, t);
14
14
  }
15
- var An = function(t, r) {
15
+ var xn = function(t, r) {
16
16
  return t === void 0 && (t = []), r === void 0 && (r = []), t.length !== r.length || t.some(function(i, n) {
17
17
  return !Object.is(i, r[n]);
18
18
  });
19
19
  }, Gt = {
20
20
  error: null
21
- }, xn = /* @__PURE__ */ function(e) {
22
- bn(t, e);
21
+ }, wn = /* @__PURE__ */ function(e) {
22
+ An(t, e);
23
23
  function t() {
24
- for (var i, n = arguments.length, s = new Array(n), a = 0; a < n; a++)
25
- s[a] = arguments[a];
24
+ for (var i, n = arguments.length, s = new Array(n), o = 0; o < n; o++)
25
+ s[o] = arguments[o];
26
26
  return i = e.call.apply(e, [this].concat(s)) || this, i.state = Gt, i.resetErrorBoundary = function() {
27
- for (var o, u = arguments.length, d = new Array(u), l = 0; l < u; l++)
27
+ for (var a, u = arguments.length, d = new Array(u), l = 0; l < u; l++)
28
28
  d[l] = arguments[l];
29
- i.props.onReset == null || (o = i.props).onReset.apply(o, d), i.reset();
29
+ i.props.onReset == null || (a = i.props).onReset.apply(a, d), i.reset();
30
30
  }, i;
31
31
  }
32
32
  t.getDerivedStateFromError = function(n) {
@@ -38,40 +38,40 @@ var An = function(t, r) {
38
38
  return r.reset = function() {
39
39
  this.setState(Gt);
40
40
  }, r.componentDidCatch = function(n, s) {
41
- var a, o;
42
- (a = (o = this.props).onError) == null || a.call(o, n, s);
41
+ var o, a;
42
+ (o = (a = this.props).onError) == null || o.call(a, n, s);
43
43
  }, r.componentDidUpdate = function(n, s) {
44
- var a = this.state.error, o = this.props.resetKeys;
45
- if (a !== null && s.error !== null && An(n.resetKeys, o)) {
44
+ var o = this.state.error, a = this.props.resetKeys;
45
+ if (o !== null && s.error !== null && xn(n.resetKeys, a)) {
46
46
  var u, d;
47
- (u = (d = this.props).onResetKeysChange) == null || u.call(d, n.resetKeys, o), this.reset();
47
+ (u = (d = this.props).onResetKeysChange) == null || u.call(d, n.resetKeys, a), this.reset();
48
48
  }
49
49
  }, r.render = function() {
50
- var n = this.state.error, s = this.props, a = s.fallbackRender, o = s.FallbackComponent, u = s.fallback;
50
+ var n = this.state.error, s = this.props, o = s.fallbackRender, a = s.FallbackComponent, u = s.fallback;
51
51
  if (n !== null) {
52
52
  var d = {
53
53
  error: n,
54
54
  resetErrorBoundary: this.resetErrorBoundary
55
55
  };
56
- if (/* @__PURE__ */ ot.isValidElement(u))
56
+ if (/* @__PURE__ */ at.isValidElement(u))
57
57
  return u;
58
- if (typeof a == "function")
59
- return a(d);
60
- if (o)
61
- return /* @__PURE__ */ ot.createElement(o, d);
58
+ if (typeof o == "function")
59
+ return o(d);
60
+ if (a)
61
+ return /* @__PURE__ */ at.createElement(a, d);
62
62
  throw new Error("react-error-boundary requires either a fallback, fallbackRender, or FallbackComponent prop");
63
63
  }
64
64
  return this.props.children;
65
65
  }, t;
66
- }(ot.Component);
67
- const wn = {
66
+ }(at.Component);
67
+ const Sn = {
68
68
  collection: void 0,
69
69
  manifest: void 0,
70
70
  range: void 0,
71
71
  canvas: void 0,
72
72
  annotation: void 0,
73
73
  annotationPage: void 0
74
- }, Et = me.createContext(wn), be = () => H(Et);
74
+ }, Et = me.createContext(Sn), be = () => H(Et);
75
75
  function Te({ value: e, children: t }) {
76
76
  const r = be(), i = E(() => ({
77
77
  ...r,
@@ -79,7 +79,7 @@ function Te({ value: e, children: t }) {
79
79
  }), [e, r]);
80
80
  return /* @__PURE__ */ x(Et.Provider, { value: i, children: t });
81
81
  }
82
- var Sn = Object.defineProperty, Cn = (e, t, r) => t in e ? Sn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ve = (e, t, r) => (Cn(e, typeof t != "symbol" ? t + "" : t, r), r);
82
+ var Cn = Object.defineProperty, Mn = (e, t, r) => t in e ? Cn(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, ve = (e, t, r) => (Mn(e, typeof t != "symbol" ? t + "" : t, r), r);
83
83
  const q = function(e) {
84
84
  return function() {
85
85
  const t = { type: e, getType: () => e, toString: () => e };
@@ -89,31 +89,31 @@ const q = function(e) {
89
89
  ...i !== void 0 && { meta: i }
90
90
  });
91
91
  };
92
- }, mr = "@iiif/IMPORT_ENTITIES", br = "@iiif/MODIFY_ENTITY_FIELD", Ar = "@iiif/REORDER_ENTITY_FIELD", xr = "@iiif/ADD_REFERENCE", At = "@iiif/UPDATE_REFERENCE", wr = "@iiif/REMOVE_REFERENCE", Sr = "@iiif/ADD_METADATA", Cr = "@iiif/REMOVE_METADATA", xt = "@iiif/UPDATE_METADATA", Mr = "@iiif/REORDER_METADATA", Rr = q(mr)(), Mn = q(br)(), Rn = q(Ar)(), In = q(xr)(), Tn = q(wr)(), kn = q(At)(), On = q(Sr)(), En = q(xt)(), Pn = q(Cr)(), Ln = q(Mr)(), Fn = {
92
+ }, mr = "@iiif/IMPORT_ENTITIES", br = "@iiif/MODIFY_ENTITY_FIELD", Ar = "@iiif/REORDER_ENTITY_FIELD", xr = "@iiif/ADD_REFERENCE", At = "@iiif/UPDATE_REFERENCE", wr = "@iiif/REMOVE_REFERENCE", Sr = "@iiif/ADD_METADATA", Cr = "@iiif/REMOVE_METADATA", xt = "@iiif/UPDATE_METADATA", Mr = "@iiif/REORDER_METADATA", Rr = q(mr)(), Rn = q(br)(), In = q(Ar)(), Tn = q(xr)(), kn = q(wr)(), On = q(At)(), En = q(Sr)(), Pn = q(xt)(), Ln = q(Cr)(), Fn = q(Mr)(), jn = {
93
93
  importEntities: Rr,
94
- modifyEntityField: Mn,
95
- reorderEntityField: Rn,
96
- addReference: In,
97
- removeReference: Tn,
98
- updateReference: kn,
99
- addMetadata: On,
100
- removeMetadata: Pn,
101
- updateMetadata: En,
102
- reorderMetadata: Ln
103
- }, Ir = "@iiif/ADD_MAPPING", Tr = "@iiif/ADD_MAPPINGS", jn = q(Ir)(), $n = q(Tr)(), kr = "@iiif/SET_META_VALUE", Or = "@iiif/SET_META_VALUE_DYNAMIC", Er = "@iiif/UNSET_META_VALUE", Dn = q(kr)(), qn = q(Or)(), _n = q(Er)(), Jt = {
104
- setMetaValue: Dn,
105
- setMetaValueDynamic: qn,
106
- unsetMetaValue: _n
107
- }, wt = "RESOURCE_ERROR", Pr = "RESOURCE_LOADING", St = "RESOURCE_READY", Lr = "@iiif/REQUEST_RESOURCE", Fr = "@iiif/REQUEST_ERROR", jr = "@iiif/REQUEST_MISMATCH", $r = "@iiif/REQUEST_COMPLETE", Un = "@iiif/REQUEST_OFFLINE_RESOURCE", Vn = q(Lr)(), Dr = q(Fr)(), Nn = q(jr)(), Hn = q($r)(), Pt = "@iiif/BATCH", Bn = "@iiif/BATCH_IMPORT", Ct = q(Pt)(), zn = (e, t) => {
108
- const { entities: r, resource: i, mapping: n } = mn(t);
94
+ modifyEntityField: Rn,
95
+ reorderEntityField: In,
96
+ addReference: Tn,
97
+ removeReference: kn,
98
+ updateReference: On,
99
+ addMetadata: En,
100
+ removeMetadata: Ln,
101
+ updateMetadata: Pn,
102
+ reorderMetadata: Fn
103
+ }, Ir = "@iiif/ADD_MAPPING", Tr = "@iiif/ADD_MAPPINGS", $n = q(Ir)(), Dn = q(Tr)(), kr = "@iiif/SET_META_VALUE", Or = "@iiif/SET_META_VALUE_DYNAMIC", Er = "@iiif/UNSET_META_VALUE", qn = q(kr)(), _n = q(Or)(), Un = q(Er)(), Jt = {
104
+ setMetaValue: qn,
105
+ setMetaValueDynamic: _n,
106
+ unsetMetaValue: Un
107
+ }, wt = "RESOURCE_ERROR", Pr = "RESOURCE_LOADING", St = "RESOURCE_READY", Lr = "@iiif/REQUEST_RESOURCE", Fr = "@iiif/REQUEST_ERROR", jr = "@iiif/REQUEST_MISMATCH", $r = "@iiif/REQUEST_COMPLETE", Vn = "@iiif/REQUEST_OFFLINE_RESOURCE", Nn = q(Lr)(), Dr = q(Fr)(), Hn = q(jr)(), Bn = q($r)(), Pt = "@iiif/BATCH", zn = "@iiif/BATCH_IMPORT", Ct = q(Pt)(), Wn = (e, t) => {
108
+ const { entities: r, resource: i, mapping: n } = bn(t);
109
109
  if (i.id === void 0)
110
110
  return [Dr({ id: e, message: "ID is not defined in resource." })];
111
- const s = [Rr({ entities: r }), $n({ mapping: n })];
112
- return i.id !== e && (s.push(jn({ id: e, type: i.type })), s.push(Nn({ requestId: e, actualId: i.id }))), s.push(Hn({ id: e })), s;
111
+ const s = [Rr({ entities: r }), Dn({ mapping: n })];
112
+ return i.id !== e && (s.push($n({ id: e, type: i.type })), s.push(Hn({ requestId: e, actualId: i.id }))), s.push(Bn({ id: e })), s;
113
113
  }, Kt = Number.isNaN || function(e) {
114
114
  return typeof e == "number" && e !== e;
115
115
  };
116
- function Wn(e, t) {
116
+ function Qn(e, t) {
117
117
  return !!(e === t || Kt(e) && Kt(t));
118
118
  }
119
119
  function Zt(e, t) {
@@ -122,7 +122,7 @@ function Zt(e, t) {
122
122
  if (e.length !== t.length)
123
123
  return !1;
124
124
  for (let r = 0; r < e.length; r++)
125
- if (!Wn(e[r], t[r]))
125
+ if (!Qn(e[r], t[r]))
126
126
  return !1;
127
127
  return !0;
128
128
  }
@@ -132,16 +132,16 @@ function ct(e, t, r) {
132
132
  return;
133
133
  const s = e.iiif.entities[n][i.resourceUri];
134
134
  if (s && s[Ze]) {
135
- const a = s[Ze].find((o) => r ? o[Xe] === r.id : o[Xe] === s.id);
136
- return vr(s, a);
135
+ const o = s[Ze].find((a) => r ? a[Xe] === r.id : a[Xe] === s.id);
136
+ return vr(s, o);
137
137
  }
138
138
  return s;
139
139
  }
140
140
  function Xt(e, t, { waitTimeout: r = 30 } = {}) {
141
141
  return async (i, n) => {
142
- const s = e.getStore(), a = s.getState(), o = a.iiif.requests[i];
143
- if (o)
144
- switch (o.loadingState) {
142
+ const s = e.getStore(), o = s.getState(), a = o.iiif.requests[i];
143
+ if (a)
144
+ switch (a.loadingState) {
145
145
  case wt:
146
146
  break;
147
147
  case Pr: {
@@ -176,17 +176,17 @@ function Xt(e, t, { waitTimeout: r = 30 } = {}) {
176
176
  break;
177
177
  }
178
178
  case St: {
179
- const u = ct(a, i);
179
+ const u = ct(o, i);
180
180
  if (u)
181
181
  return u;
182
182
  break;
183
183
  }
184
184
  }
185
- e.dispatch(Vn({ id: i }));
185
+ e.dispatch(Nn({ id: i }));
186
186
  try {
187
187
  const u = await t(i, n);
188
188
  !u.id && !u["@id"] && (u["@type"] && (u["@id"] = i), u.id = i);
189
- const d = zn(i, u);
189
+ const d = Wn(i, u);
190
190
  return e.dispatch(Ct({ actions: d })), ct(s.getState(), i);
191
191
  } catch (u) {
192
192
  throw e.dispatch(Dr({ id: i, message: u.toString() })), u;
@@ -210,22 +210,22 @@ function qr() {
210
210
  }
211
211
  const er = (e) => {
212
212
  let t;
213
- const r = /* @__PURE__ */ new Set(), i = (a, o) => {
214
- const u = typeof a == "function" ? a(t) : a;
213
+ const r = /* @__PURE__ */ new Set(), i = (o, a) => {
214
+ const u = typeof o == "function" ? o(t) : o;
215
215
  if (!Object.is(u, t)) {
216
216
  const d = t;
217
- t = o ?? typeof u != "object" ? u : Object.assign({}, t, u), r.forEach((l) => l(t, d));
217
+ t = a ?? typeof u != "object" ? u : Object.assign({}, t, u), r.forEach((l) => l(t, d));
218
218
  }
219
- }, n = () => t, s = { setState: i, getState: n, subscribe: (a) => (r.add(a), () => r.delete(a)), destroy: () => {
219
+ }, n = () => t, s = { setState: i, getState: n, subscribe: (o) => (r.add(o), () => r.delete(o)), destroy: () => {
220
220
  r.clear();
221
221
  } };
222
222
  return t = e(i, n, s), s;
223
- }, Qn = (e) => e ? er(e) : er, Yn = (e, t) => (r, i, n) => (n.dispatch = (s) => (r((a) => e(a, s), !1, s), s), n.dispatchFromDevtools = !0, { dispatch: (...s) => n.dispatch(...s), ...t }), Gn = Yn, Mt = /* @__PURE__ */ new Map(), Ne = (e) => {
223
+ }, Yn = (e) => e ? er(e) : er, Gn = (e, t) => (r, i, n) => (n.dispatch = (s) => (r((o) => e(o, s), !1, s), s), n.dispatchFromDevtools = !0, { dispatch: (...s) => n.dispatch(...s), ...t }), Jn = Gn, Mt = /* @__PURE__ */ new Map(), Ne = (e) => {
224
224
  const t = Mt.get(e);
225
225
  return t ? Object.fromEntries(
226
226
  Object.entries(t.stores).map(([r, i]) => [r, i.getState()])
227
227
  ) : {};
228
- }, Jn = (e, t, r) => {
228
+ }, Kn = (e, t, r) => {
229
229
  if (e === void 0)
230
230
  return {
231
231
  type: "untracked",
@@ -239,8 +239,8 @@ const er = (e) => {
239
239
  stores: {}
240
240
  };
241
241
  return Mt.set(r.name, n), { type: "tracked", store: e, ...n };
242
- }, Kn = (e, t = {}) => (r, i, n) => {
243
- const { enabled: s, anonymousActionType: a, store: o, ...u } = t;
242
+ }, Zn = (e, t = {}) => (r, i, n) => {
243
+ const { enabled: s, anonymousActionType: o, store: a, ...u } = t;
244
244
  let d;
245
245
  try {
246
246
  d = (s ?? !1) && window.__REDUX_DEVTOOLS_EXTENSION__;
@@ -248,21 +248,21 @@ const er = (e) => {
248
248
  }
249
249
  if (!d)
250
250
  return e(r, i, n);
251
- const { connection: l, ...p } = Jn(o, d, u);
251
+ const { connection: l, ...p } = Kn(a, d, u);
252
252
  let v = !0;
253
253
  n.setState = (g, b, A) => {
254
254
  const w = r(g, b);
255
255
  if (!v)
256
256
  return w;
257
- const C = A === void 0 ? { type: a || "anonymous" } : typeof A == "string" ? { type: A } : A;
258
- return o === void 0 ? (l == null || l.send(C, i()), w) : (l == null || l.send(
257
+ const C = A === void 0 ? { type: o || "anonymous" } : typeof A == "string" ? { type: A } : A;
258
+ return a === void 0 ? (l == null || l.send(C, i()), w) : (l == null || l.send(
259
259
  {
260
260
  ...C,
261
- type: `${o}/${C.type}`
261
+ type: `${a}/${C.type}`
262
262
  },
263
263
  {
264
264
  ...Ne(u.name),
265
- [o]: n.getState()
265
+ [a]: n.getState()
266
266
  }
267
267
  ), w);
268
268
  };
@@ -297,7 +297,7 @@ const er = (e) => {
297
297
  g.payload,
298
298
  (A) => {
299
299
  if (A.type === "__setState") {
300
- if (o === void 0) {
300
+ if (a === void 0) {
301
301
  m(A.state);
302
302
  return;
303
303
  }
@@ -308,7 +308,7 @@ const er = (e) => {
308
308
  and value of this only key should be a state object. Example: { "type": "__setState", "state": { "abc123Store": { "foo": "bar" } } }
309
309
  `
310
310
  );
311
- const w = A.state[o];
311
+ const w = A.state[a];
312
312
  if (w == null)
313
313
  return;
314
314
  JSON.stringify(n.getState()) !== JSON.stringify(w) && m(w);
@@ -320,35 +320,35 @@ const er = (e) => {
320
320
  case "DISPATCH":
321
321
  switch (g.payload.type) {
322
322
  case "RESET":
323
- return m(h), o === void 0 ? l == null ? void 0 : l.init(n.getState()) : l == null ? void 0 : l.init(Ne(u.name));
323
+ return m(h), a === void 0 ? l == null ? void 0 : l.init(n.getState()) : l == null ? void 0 : l.init(Ne(u.name));
324
324
  case "COMMIT":
325
- if (o === void 0) {
325
+ if (a === void 0) {
326
326
  l == null || l.init(n.getState());
327
327
  return;
328
328
  }
329
329
  return l == null ? void 0 : l.init(Ne(u.name));
330
330
  case "ROLLBACK":
331
331
  return ut(g.state, (A) => {
332
- if (o === void 0) {
332
+ if (a === void 0) {
333
333
  m(A), l == null || l.init(n.getState());
334
334
  return;
335
335
  }
336
- m(A[o]), l == null || l.init(Ne(u.name));
336
+ m(A[a]), l == null || l.init(Ne(u.name));
337
337
  });
338
338
  case "JUMP_TO_STATE":
339
339
  case "JUMP_TO_ACTION":
340
340
  return ut(g.state, (A) => {
341
- if (o === void 0) {
341
+ if (a === void 0) {
342
342
  m(A);
343
343
  return;
344
344
  }
345
- JSON.stringify(n.getState()) !== JSON.stringify(A[o]) && m(A[o]);
345
+ JSON.stringify(n.getState()) !== JSON.stringify(A[a]) && m(A[a]);
346
346
  });
347
347
  case "IMPORT_STATE": {
348
348
  const { nextLiftedState: A } = g.payload, w = (b = A.computedStates.slice(-1)[0]) == null ? void 0 : b.state;
349
349
  if (!w)
350
350
  return;
351
- m(o === void 0 ? w : w[o]), l == null || l.send(
351
+ m(a === void 0 ? w : w[a]), l == null || l.send(
352
352
  null,
353
353
  // FIXME no-any
354
354
  A
@@ -361,7 +361,7 @@ const er = (e) => {
361
361
  return;
362
362
  }
363
363
  }), h;
364
- }, Zn = Kn, ut = (e, t) => {
364
+ }, Xn = Zn, ut = (e, t) => {
365
365
  let r;
366
366
  try {
367
367
  r = JSON.parse(e);
@@ -372,24 +372,24 @@ const er = (e) => {
372
372
  );
373
373
  }
374
374
  r !== void 0 && t(r);
375
- }, Xn = (e) => (t, r, i) => {
375
+ }, es = (e) => (t, r, i) => {
376
376
  const n = i.subscribe;
377
- return i.subscribe = (s, a, o) => {
377
+ return i.subscribe = (s, o, a) => {
378
378
  let u = s;
379
- if (a) {
380
- const d = (o == null ? void 0 : o.equalityFn) || Object.is;
379
+ if (o) {
380
+ const d = (a == null ? void 0 : a.equalityFn) || Object.is;
381
381
  let l = s(i.getState());
382
382
  u = (p) => {
383
383
  const v = s(p);
384
384
  if (!d(l, v)) {
385
385
  const m = l;
386
- a(l = v, m);
386
+ o(l = v, m);
387
387
  }
388
- }, o != null && o.fireImmediately && a(l, l);
388
+ }, a != null && a.fireImmediately && o(l, l);
389
389
  }
390
390
  return n(u);
391
391
  }, e(t, r, i);
392
- }, es = Xn, ts = (e = {}, t) => {
392
+ }, ts = es, rs = (e = {}, t) => {
393
393
  switch (t.type) {
394
394
  case Ir:
395
395
  return {
@@ -408,16 +408,16 @@ const er = (e) => {
408
408
  function lt(e, t, r, i) {
409
409
  return !(!e[r] || !e[r][t] || !e[r][t][i] || !Array.isArray(e[r][t][i]));
410
410
  }
411
- function rs(e, t) {
411
+ function is(e, t) {
412
412
  const r = {}, i = [];
413
413
  for (const [n, s] of Object.entries(e || {})) {
414
414
  i.push(n);
415
- const a = (t || {})[n];
416
- if (!a || a.length === 0) {
415
+ const o = (t || {})[n];
416
+ if (!o || o.length === 0) {
417
417
  r[n] = s;
418
418
  continue;
419
419
  }
420
- r[n] = a;
420
+ r[n] = o;
421
421
  }
422
422
  for (const [n, s] of Object.entries(t || {}))
423
423
  i.indexOf(n) === -1 && (r[n] = s);
@@ -429,7 +429,7 @@ function R(e) {
429
429
  function ft(e, t) {
430
430
  return typeof e > "u" ? t : e;
431
431
  }
432
- const is = (e = qr(), t) => {
432
+ const ns = (e = qr(), t) => {
433
433
  var r;
434
434
  const i = (n, s) => ({
435
435
  ...e,
@@ -454,19 +454,19 @@ const is = (e = qr(), t) => {
454
454
  const n = e[R(t).type][R(t).id];
455
455
  if (typeof n == "string")
456
456
  return e;
457
- const s = Array.from(n[R(t).key]), [a] = s.splice(R(t).startIndex, 1);
458
- return s.splice(R(t).endIndex, 0, a), i(n, { [R(t).key]: s });
457
+ const s = Array.from(n[R(t).key]), [o] = s.splice(R(t).startIndex, 1);
458
+ return s.splice(R(t).endIndex, 0, o), i(n, { [R(t).key]: s });
459
459
  }
460
460
  case mr: {
461
461
  const n = Object.keys(R(t).entities), s = { ...e };
462
- for (const a of n) {
463
- const o = R(t).entities[a], u = { ...e[a] || {} };
462
+ for (const o of n) {
463
+ const a = R(t).entities[o], u = { ...e[o] || {} };
464
464
  let d = !1;
465
- const l = Object.keys(o || {}) || [];
466
- if (o && l) {
465
+ const l = Object.keys(a || {}) || [];
466
+ if (a && l) {
467
467
  for (const p of l)
468
- d = !0, u[p] = e[a][p] ? rs(e[a][p], o[p]) : o[p];
469
- d && (s[a] = u);
468
+ d = !0, u[p] = e[o][p] ? is(e[o][p], a[p]) : a[p];
469
+ d && (s[o] = u);
470
470
  }
471
471
  }
472
472
  return s;
@@ -481,41 +481,41 @@ const is = (e = qr(), t) => {
481
481
  case wr: {
482
482
  if (!lt(e, R(t).id, R(t).type, R(t).key))
483
483
  return e;
484
- const n = e[R(t).type][R(t).id], s = Array.from(n[R(t).key]), a = ft(
484
+ const n = e[R(t).type][R(t).id], s = Array.from(n[R(t).key]), o = ft(
485
485
  R(t).index,
486
- s.findIndex((o) => o && o.id === R(t).reference.id)
486
+ s.findIndex((a) => a && a.id === R(t).reference.id)
487
487
  );
488
- return a === -1 || ((r = s[a]) == null ? void 0 : r.id) !== R(t).reference.id ? e : (t.type === At ? s.splice(a, 1, R(t).reference) : s.splice(a, 1), i(n, { [R(t).key]: s }));
488
+ return o === -1 || ((r = s[o]) == null ? void 0 : r.id) !== R(t).reference.id ? e : (t.type === At ? s.splice(o, 1, R(t).reference) : s.splice(o, 1), i(n, { [R(t).key]: s }));
489
489
  }
490
490
  case Sr: {
491
491
  const n = e[R(t).type][R(t).id];
492
492
  if (!n)
493
493
  return e;
494
- const s = Array.from(n.metadata || []), a = R(t);
494
+ const s = Array.from(n.metadata || []), o = R(t);
495
495
  return s.splice(ft(t.payload.beforeIndex, s.length + 1), 0, {
496
- label: a.label,
497
- value: a.label
496
+ label: o.label,
497
+ value: o.label
498
498
  }), i(n, { metadata: s });
499
499
  }
500
500
  case Mr: {
501
501
  const n = e[R(t).type][R(t).id];
502
502
  if (typeof n == "string" || !n)
503
503
  return e;
504
- const s = Array.from(n.metadata || []), [a] = s.splice(R(t).startIndex, 1);
505
- return s.splice(R(t).endIndex, 0, a), i(n, { metadata: s });
504
+ const s = Array.from(n.metadata || []), [o] = s.splice(R(t).startIndex, 1);
505
+ return s.splice(R(t).endIndex, 0, o), i(n, { metadata: s });
506
506
  }
507
507
  case xt:
508
508
  case Cr: {
509
- const n = e[R(t).type][R(t).id], s = Array.from(n.metadata || []), a = R(t).atIndex;
510
- return typeof a > "u" || a === -1 || !s[a] ? e : (t.type === xt ? s.splice(a, 1, { label: R(t).label, value: R(t).value }) : s.splice(a, 1), i(n, { metadata: s }));
509
+ const n = e[R(t).type][R(t).id], s = Array.from(n.metadata || []), o = R(t).atIndex;
510
+ return typeof o > "u" || o === -1 || !s[o] ? e : (t.type === xt ? s.splice(o, 1, { label: R(t).label, value: R(t).value }) : s.splice(o, 1), i(n, { metadata: s }));
511
511
  }
512
512
  default:
513
513
  return e;
514
514
  }
515
- }, ns = (e = {}, t) => {
515
+ }, ss = (e = {}, t) => {
516
516
  switch (t.type) {
517
517
  case Lr:
518
- case Un:
518
+ case Vn:
519
519
  return {
520
520
  ...e,
521
521
  [t.payload.id]: {
@@ -560,8 +560,8 @@ const is = (e = qr(), t) => {
560
560
  };
561
561
  }
562
562
  return e;
563
- }, ss = (e = {}, t) => {
564
- const { id: r, updateValue: i, value: n, meta: s, key: a } = t && t.payload || {};
563
+ }, os = (e = {}, t) => {
564
+ const { id: r, updateValue: i, value: n, meta: s, key: o } = t && t.payload || {};
565
565
  switch (t.type) {
566
566
  case kr:
567
567
  return {
@@ -570,7 +570,7 @@ const is = (e = qr(), t) => {
570
570
  ...e[r] || {},
571
571
  [s]: {
572
572
  ...e[r] ? e[r][s] || {} : {},
573
- [a]: n
573
+ [o]: n
574
574
  }
575
575
  }
576
576
  };
@@ -581,18 +581,18 @@ const is = (e = qr(), t) => {
581
581
  ...e[r] || {},
582
582
  [s]: {
583
583
  ...e[r] ? e[r][s] || {} : {},
584
- [a]: e[r] && e[r][s] ? i(e[r][s][a]) : i(void 0)
584
+ [o]: e[r] && e[r][s] ? i(e[r][s][o]) : i(void 0)
585
585
  }
586
586
  }
587
587
  };
588
588
  case Er:
589
- return e[r] && e[r][s] && e[r][s][a] ? {
589
+ return e[r] && e[r][s] && e[r][s][o] ? {
590
590
  ...e,
591
591
  [r]: {
592
592
  ...e[r] || {},
593
593
  [s]: {
594
594
  ...e[r] ? e[r][s] || {} : {},
595
- [a]: void 0
595
+ [o]: void 0
596
596
  }
597
597
  }
598
598
  } : e;
@@ -605,15 +605,15 @@ function _r(e = {}) {
605
605
  return function(r = {}, i) {
606
606
  let n = !1;
607
607
  const s = {};
608
- for (let a = 0; a < t.length; a++) {
609
- const o = t[a];
610
- s[o] = e[o](r[o], i), n = n || s[o] !== r[o];
608
+ for (let o = 0; o < t.length; o++) {
609
+ const a = t[o];
610
+ s[a] = e[a](r[a], i), n = n || s[a] !== r[a];
611
611
  }
612
612
  return n ? s : r;
613
613
  };
614
614
  }
615
615
  function as(e) {
616
- return (t, r) => r && r.type === Pt ? r.payload.actions.reduce(e, t) : r && r.type === Bn ? {
616
+ return (t, r) => r && r.type === Pt ? r.payload.actions.reduce(e, t) : r && r.type === zn ? {
617
617
  ...t,
618
618
  iiif: {
619
619
  ...t.iiif,
@@ -621,13 +621,13 @@ function as(e) {
621
621
  }
622
622
  } : e(t, r);
623
623
  }
624
- const os = _r({
625
- mapping: ts,
626
- entities: is,
627
- requests: ns,
628
- meta: ss
624
+ const cs = _r({
625
+ mapping: rs,
626
+ entities: ns,
627
+ requests: ss,
628
+ meta: os
629
629
  });
630
- function cs() {
630
+ function us() {
631
631
  return {
632
632
  iiif: {
633
633
  entities: qr(),
@@ -637,16 +637,16 @@ function cs() {
637
637
  }
638
638
  };
639
639
  }
640
- function us(e = {}) {
640
+ function ls(e = {}) {
641
641
  const {
642
642
  enableDevtools: t = !1,
643
643
  iiifStoreName: r = "iiif",
644
- defaultState: i = cs(),
644
+ defaultState: i = us(),
645
645
  customReducers: n = {}
646
- } = e, s = as(_r({ [r]: os, ...n }));
647
- return Qn(es(Zn(Gn(s, i), { enabled: t })));
646
+ } = e, s = as(_r({ [r]: cs, ...n }));
647
+ return Yn(ts(Xn(Jn(s, i), { enabled: t })));
648
648
  }
649
- function ls(e) {
649
+ function fs(e) {
650
650
  return { all: e = e || /* @__PURE__ */ new Map(), on: function(t, r) {
651
651
  var i = e.get(t);
652
652
  i ? i.push(r) : e.set(t, [r]);
@@ -673,10 +673,10 @@ function G(e, t, r, i = !0) {
673
673
  const s = t[Se][e];
674
674
  if (!s)
675
675
  return s;
676
- const a = r.get(t[Se][e], {
676
+ const o = r.get(t[Se][e], {
677
677
  parent: this.id ? { id: this.id, type: this.type } : void 0
678
678
  });
679
- return n.has(a) || (n.clear(), n.set(a, Ce(a, r))), n.get(a);
679
+ return n.has(o) || (n.clear(), n.set(o, Ce(o, r))), n.get(o);
680
680
  },
681
681
  set(s) {
682
682
  t[Se][e] !== s && (this[we] ? r.modifyEntityField({ id: this.id, type: this.type }, e, Ur(s)) : this[Se][e] = s);
@@ -684,7 +684,7 @@ function G(e, t, r, i = !0) {
684
684
  });
685
685
  }
686
686
  const Se = Symbol.for("_refs_"), we = Symbol.for("_reactive_"), Oe = Symbol.for("_defined_"), tr = Symbol.for("_parent_");
687
- function fs(e, t = !1, r) {
687
+ function ps(e, t = !1, r) {
688
688
  const i = {
689
689
  id: "",
690
690
  type: "unknown",
@@ -757,7 +757,7 @@ function fs(e, t = !1, r) {
757
757
  };
758
758
  return G("items", i, e), G("annotations", i, e), G("structures", i, e), G("seeAlso", i, e), G("rendering", i, e), G("partOf", i, e), G("start", i, e, !1), G("supplementary", i, e), G("homepage", i, e), G("thumbnail", i, e), G("placeholderCanvas", i, e, !1), G("accompanyingCanvas", i, e, !1), G("provider", i, e), G("body", i, e), G("logo", i, e), i;
759
759
  }
760
- function ps(e) {
760
+ function ds(e) {
761
761
  return !!e[Oe];
762
762
  }
763
763
  function Ur(e) {
@@ -765,11 +765,11 @@ function Ur(e) {
765
765
  }
766
766
  function Ce(e, t, r = !1, i) {
767
767
  if (Array.isArray(e))
768
- return e.map((o) => Ce(o, t, r));
768
+ return e.map((a) => Ce(a, t, r));
769
769
  if (!e || !e.type || !e.id)
770
770
  return e;
771
- const n = fs(t, r), s = Object.create(n), a = Object.assign(s, e);
772
- return r && a.reactive(), a;
771
+ const n = ps(t, r), s = Object.create(n), o = Object.assign(s, e);
772
+ return r && o.reactive(), o;
773
773
  }
774
774
  function rr(e) {
775
775
  switch (e) {
@@ -799,11 +799,11 @@ let Rt = class {
799
799
  enableDevtools: !0
800
800
  },
801
801
  t || {}
802
- ), this.store = r || us({
802
+ ), this.store = r || ls({
803
803
  customReducers: this.options.reducers,
804
804
  defaultState: this.options.defaultState,
805
805
  enableDevtools: this.options.enableDevtools
806
- }), this.emitter = ls(), this.remoteFetcher = Xt(this, this.options.customFetcher), this.staticFetcher = Xt(this, (i, n) => n);
806
+ }), this.emitter = fs(), this.remoteFetcher = Xt(this, this.options.customFetcher), this.staticFetcher = Xt(this, (i, n) => n);
807
807
  }
808
808
  batch(t) {
809
809
  this.isBatching = !0;
@@ -825,7 +825,7 @@ let Rt = class {
825
825
  }
826
826
  modifyEntityField(t, r, i) {
827
827
  this.dispatch(
828
- Fn.modifyEntityField({
828
+ jn.modifyEntityField({
829
829
  id: t.id,
830
830
  type: t.type,
831
831
  key: r,
@@ -858,13 +858,13 @@ let Rt = class {
858
858
  };
859
859
  }
860
860
  serialize(t, r) {
861
- return hn(this.getState().iiif, t, r);
861
+ return yn(this.getState().iiif, t, r);
862
862
  }
863
863
  toPresentation2(t) {
864
- return this.serialize(t, yn);
864
+ return this.serialize(t, vn);
865
865
  }
866
866
  toPresentation3(t) {
867
- return this.serialize(t, vn);
867
+ return this.serialize(t, gn);
868
868
  }
869
869
  hydrate(t, r, i = {}) {
870
870
  return this.get(t, r, { ...i, skipSelfReturn: !1 });
@@ -875,9 +875,9 @@ let Rt = class {
875
875
  let s = i.parent ? typeof i.parent == "string" ? i.parent : i.parent.id : void 0;
876
876
  if (Array.isArray(t))
877
877
  return t.map((p) => this.get(p, i));
878
- const a = this.getState();
879
- if (gn(t) && !i.preserveSpecificResources && (t = t.source), typeof t == "string") {
880
- const p = rr(r || a.iiif.mapping[t]);
878
+ const o = this.getState();
879
+ if (mn(t) && !i.preserveSpecificResources && (t = t.source), typeof t == "string") {
880
+ const p = rr(r || o.iiif.mapping[t]);
881
881
  if (!p)
882
882
  return n ? null : { id: t, type: "unknown" };
883
883
  t = { id: t, type: p };
@@ -886,9 +886,9 @@ let Rt = class {
886
886
  const p = Array.isArray(t.partOf) ? t.partOf[0] : t.partOf;
887
887
  p && (typeof p == "string" && (s = p), typeof p.id == "string" && (s = p.id));
888
888
  }
889
- const o = rr(r || (t == null ? void 0 : t.type)), u = t == null ? void 0 : t.id, d = a.iiif.entities[o];
889
+ const a = rr(r || (t == null ? void 0 : t.type)), u = t == null ? void 0 : t.id, d = o.iiif.entities[a];
890
890
  if (!d) {
891
- const p = a.iiif.requests[u];
891
+ const p = o.iiif.requests[u];
892
892
  return p && p.resourceUri !== u ? this.get(p.resourceUri, i) : n ? null : t;
893
893
  }
894
894
  const l = d[t.id];
@@ -912,7 +912,7 @@ let Rt = class {
912
912
  return this.get(r, { skipSelfReturn: !1 });
913
913
  if (typeof t == "function")
914
914
  try {
915
- const n = t(this.get(r, { skipSelfReturn: !1 })), s = (a) => this.deep(a, n);
915
+ const n = t(this.get(r, { skipSelfReturn: !1 })), s = (o) => this.deep(o, n);
916
916
  return s.size = Array.isArray(n) ? n.length : 1, s;
917
917
  } catch {
918
918
  const n = (s) => this.deep(s, void 0);
@@ -971,7 +971,7 @@ let Rt = class {
971
971
  return Ce(this.get(t, { skipSelfReturn: !1 }), this);
972
972
  }
973
973
  isWrapped(t) {
974
- return ps(t);
974
+ return ds(t);
975
975
  }
976
976
  setMetaValue([t, r, i], n) {
977
977
  this.dispatch(
@@ -989,11 +989,11 @@ let Rt = class {
989
989
  );
990
990
  }
991
991
  };
992
- function ds() {
992
+ function hs() {
993
993
  return typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {};
994
994
  }
995
995
  function Vr(e) {
996
- const t = ds();
996
+ const t = hs();
997
997
  try {
998
998
  const i = t.IIIF_VAULT;
999
999
  if (i)
@@ -1019,8 +1019,8 @@ function Nr({
1019
1019
  resources: i,
1020
1020
  children: n
1021
1021
  }) {
1022
- const [s, a] = B(() => e || (r ? Vr(t) : t ? new Rt(t) : new Rt()));
1023
- return /* @__PURE__ */ x(tt.Provider, { value: { vault: s, setVaultInstance: a }, children: /* @__PURE__ */ x(Te, { value: i || {}, children: n }) });
1022
+ const [s, o] = B(() => e || (r ? Vr(t) : t ? new Rt(t) : new Rt()));
1023
+ return /* @__PURE__ */ x(tt.Provider, { value: { vault: s, setVaultInstance: o }, children: /* @__PURE__ */ x(Te, { value: i || {}, children: n }) });
1024
1024
  }
1025
1025
  const V = () => {
1026
1026
  const { vault: e } = H(tt);
@@ -1029,33 +1029,33 @@ const V = () => {
1029
1029
  return e;
1030
1030
  };
1031
1031
  function Hr(e, { noCache: t = !1 } = {}) {
1032
- const r = typeof e == "string" ? e : e.id, i = V(), [n, s] = B(r), [a, o] = B(void 0), u = E(() => i.get(r, { skipSelfReturn: !0 }) || void 0, [r, i]), [d, l] = B(u);
1032
+ const r = typeof e == "string" ? e : e.id, i = V(), [n, s] = B(r), [o, a] = B(void 0), u = E(() => i.get(r, { skipSelfReturn: !0 }) || void 0, [r, i]), [d, l] = B(u);
1033
1033
  return K(() => {
1034
1034
  (async () => {
1035
1035
  try {
1036
1036
  const p = u && !t ? u : await i.load(r), v = p ? p.id || p["@id"] : null;
1037
1037
  p && n !== v && s(v), l(p);
1038
1038
  } catch (p) {
1039
- o(p);
1039
+ a(p);
1040
1040
  }
1041
1041
  })();
1042
1042
  }, [r, t]), {
1043
1043
  isLoaded: !!d,
1044
1044
  id: n,
1045
1045
  requestId: r,
1046
- error: a,
1046
+ error: o,
1047
1047
  resource: d,
1048
1048
  cached: !!(d && d === u)
1049
1049
  };
1050
1050
  }
1051
- function hs(e, t) {
1052
- const { id: r, isLoaded: i, error: n, resource: s, requestId: a, cached: o } = Hr(
1051
+ function ys(e, t) {
1052
+ const { id: r, isLoaded: i, error: n, resource: s, requestId: o, cached: a } = Hr(
1053
1053
  e,
1054
1054
  t
1055
1055
  );
1056
- return { id: r, isLoaded: i, error: n, manifest: s, requestId: a, cached: o };
1056
+ return { id: r, isLoaded: i, error: n, manifest: s, requestId: o, cached: a };
1057
1057
  }
1058
- function ys({ manifest: e, children: t }) {
1058
+ function vs({ manifest: e, children: t }) {
1059
1059
  return /* @__PURE__ */ x(Te, { value: { manifest: e }, children: t });
1060
1060
  }
1061
1061
  function Lt({ canvas: e, children: t }) {
@@ -1082,26 +1082,26 @@ function Br() {
1082
1082
  function ke(e = {}, t = []) {
1083
1083
  const { id: r, selector: i } = e, n = be();
1084
1084
  V();
1085
- const s = r || n.manifest, a = Q(
1086
- (o) => s ? o.iiif.entities.Manifest[s] : void 0,
1085
+ const s = r || n.manifest, o = Q(
1086
+ (a) => s ? a.iiif.entities.Manifest[s] : void 0,
1087
1087
  [s]
1088
1088
  );
1089
1089
  return E(() => {
1090
- if (a)
1091
- return i ? i(a) : a;
1092
- }, [a, i, ...t]);
1090
+ if (o)
1091
+ return i ? i(o) : o;
1092
+ }, [o, i, ...t]);
1093
1093
  }
1094
- function vs({ range: e, children: t }) {
1094
+ function gs({ range: e, children: t }) {
1095
1095
  return /* @__PURE__ */ x(Te, { value: { range: e }, children: t });
1096
1096
  }
1097
- function gs(e, t) {
1097
+ function ms(e, t) {
1098
1098
  for (const r of t.items) {
1099
1099
  if (r.type === "Canvas")
1100
1100
  return r;
1101
1101
  if (r.type === "SpecificResource")
1102
1102
  return r.source;
1103
1103
  if (r.type === "Range") {
1104
- const i = gs(e, e.get(r));
1104
+ const i = ms(e, e.get(r));
1105
1105
  if (i)
1106
1106
  return i;
1107
1107
  }
@@ -1118,7 +1118,7 @@ function zr(e, t) {
1118
1118
  }
1119
1119
  return r;
1120
1120
  }
1121
- function Ic(e, t, r) {
1121
+ function Tc(e, t, r) {
1122
1122
  for (const i of t.structures) {
1123
1123
  const n = Wr(e, e.get(i), r);
1124
1124
  if (n)
@@ -1128,23 +1128,23 @@ function Ic(e, t, r) {
1128
1128
  }
1129
1129
  function Wr(e, t, r) {
1130
1130
  var i, n, s;
1131
- for (const a of t.items) {
1132
- const o = (n = (i = a == null ? void 0 : a.source) == null ? void 0 : i.id) == null ? void 0 : n.split("#")[0];
1133
- if (a.type === "SpecificResource" && a.source === r || a.type === "SpecificResource" && ((s = a.source) == null ? void 0 : s.type) === "Canvas" && r === o)
1131
+ for (const o of t.items) {
1132
+ const a = (n = (i = o == null ? void 0 : o.source) == null ? void 0 : i.id) == null ? void 0 : n.split("#")[0];
1133
+ if (o.type === "SpecificResource" && o.source === r || o.type === "SpecificResource" && ((s = o.source) == null ? void 0 : s.type) === "Canvas" && r === a)
1134
1134
  return t;
1135
- if (a.type === "Range") {
1136
- const u = Wr(e, e.get(a), r);
1135
+ if (o.type === "Range") {
1136
+ const u = Wr(e, e.get(o), r);
1137
1137
  if (u)
1138
1138
  return u;
1139
1139
  }
1140
1140
  }
1141
1141
  return null;
1142
1142
  }
1143
- function Tc(e, t, r, i = !1) {
1143
+ function kc(e, t, r, i = !1) {
1144
1144
  const n = t.behavior, s = r ? e.get(r) : null;
1145
1145
  if (!s)
1146
1146
  return [];
1147
- const a = s.behavior, o = i ? !1 : n.includes("paged"), u = o ? !1 : n.includes("continuous"), d = o || u ? !1 : n.includes("individuals"), l = a.includes("facing-pages"), p = a.includes("non-paged");
1147
+ const o = s.behavior, a = i ? !1 : n.includes("paged"), u = a ? !1 : n.includes("continuous"), d = a || u ? !1 : n.includes("individuals"), l = o.includes("facing-pages"), p = o.includes("non-paged");
1148
1148
  if (l || p || d || i)
1149
1149
  return [{ id: s.id, type: "Canvas" }];
1150
1150
  const [v, m] = Qr(e, t);
@@ -1159,10 +1159,10 @@ function Tc(e, t, r, i = !1) {
1159
1159
  return [{ id: s.id, type: "Canvas" }];
1160
1160
  }
1161
1161
  function Qr(e, t, { disablePaging: r, skipNonPaged: i } = {}) {
1162
- const n = t.behavior, s = n.includes("paged"), a = s ? !1 : n.includes("continuous"), o = s || a ? !1 : n.includes("individuals"), u = t.type === "Manifest" ? t.items : zr(e, t);
1163
- if (a)
1162
+ const n = t.behavior, s = n.includes("paged"), o = s ? !1 : n.includes("continuous"), a = s || o ? !1 : n.includes("individuals"), u = t.type === "Manifest" ? t.items : zr(e, t);
1163
+ if (o)
1164
1164
  return [u, [u.map((h, g) => g)]];
1165
- if (o || !s || r)
1165
+ if (a || !s || r)
1166
1166
  return [u, u.map((h, g) => [g])];
1167
1167
  const d = [];
1168
1168
  let l = [];
@@ -1188,44 +1188,44 @@ function Qr(e, t, { disablePaging: r, skipNonPaged: i } = {}) {
1188
1188
  }
1189
1189
  return l.length && p(), [u, d];
1190
1190
  }
1191
- function ms(e = {}, t = []) {
1192
- const { id: r, selector: i } = e, n = be(), s = r || n.range, a = Q((o) => s ? o.iiif.entities.Range[s] : void 0, [s]);
1191
+ function bs(e = {}, t = []) {
1192
+ const { id: r, selector: i } = e, n = be(), s = r || n.range, o = Q((a) => s ? a.iiif.entities.Range[s] : void 0, [s]);
1193
1193
  return E(() => {
1194
- if (a)
1195
- return i ? i(a) : a;
1196
- }, [a, i, ...t]);
1194
+ if (o)
1195
+ return i ? i(o) : o;
1196
+ }, [o, i, ...t]);
1197
1197
  }
1198
- function bs({ startCanvas: e, disablePaging: t }) {
1198
+ function As({ startCanvas: e, disablePaging: t }) {
1199
1199
  var h;
1200
- const r = V(), i = ke(), n = ms(), [s, a] = B(void 0), o = n || i;
1201
- if (!o)
1200
+ const r = V(), i = ke(), n = bs(), [s, o] = B(void 0), a = n || i;
1201
+ if (!a)
1202
1202
  throw new Error("Nothing selected");
1203
1203
  const [u, d] = E(
1204
- () => Qr(r, o, { disablePaging: t }),
1205
- [r, o]
1204
+ () => Qr(r, a, { disablePaging: t }),
1205
+ [r, a]
1206
1206
  ), l = D(
1207
1207
  (g) => {
1208
1208
  const b = d.findIndex((A) => A.includes(g));
1209
- a(b === -1 ? 0 : b);
1209
+ o(b === -1 ? 0 : b);
1210
1210
  },
1211
1211
  [u, d]
1212
1212
  ), p = D(
1213
1213
  (g) => {
1214
1214
  const b = u.findIndex((A) => A.id === g);
1215
- b !== -1 ? l(b) : a(0);
1215
+ b !== -1 ? l(b) : o(0);
1216
1216
  },
1217
1217
  [u, d]
1218
1218
  ), v = D(() => {
1219
- a((g) => g >= d.length ? g : g + 1);
1219
+ o((g) => g >= d.length ? g : g + 1);
1220
1220
  }, [d]), m = D(() => {
1221
- a((g) => g <= 0 ? 0 : g - 1);
1221
+ o((g) => g <= 0 ? 0 : g - 1);
1222
1222
  }, [d]);
1223
- return typeof s > "u" && (e ? p(e) : a(0)), {
1223
+ return typeof s > "u" && (e ? p(e) : o(0)), {
1224
1224
  visibleItems: ((h = d[s]) == null ? void 0 : h.map((g) => u[g].id)) || [],
1225
1225
  cursor: s,
1226
1226
  items: u,
1227
1227
  sequence: d,
1228
- setSequenceIndex: a,
1228
+ setSequenceIndex: o,
1229
1229
  setCanvasIndex: l,
1230
1230
  setCanvasId: p,
1231
1231
  next: v,
@@ -1243,42 +1243,42 @@ const Fe = () => {
1243
1243
  setSequenceIndex: Fe,
1244
1244
  currentSequenceIndex: 0
1245
1245
  });
1246
- function As(e) {
1247
- const t = ke(), { cursor: r, visibleItems: i, next: n, sequence: s, items: a, setCanvasIndex: o, setCanvasId: u, previous: d, setSequenceIndex: l } = bs({
1246
+ function xs(e) {
1247
+ const t = ke(), { cursor: r, visibleItems: i, next: n, sequence: s, items: o, setCanvasIndex: a, setCanvasId: u, previous: d, setSequenceIndex: l } = As({
1248
1248
  startCanvas: e.startCanvas,
1249
1249
  disablePaging: e.pagingEnabled === !1
1250
1250
  }), p = E(
1251
1251
  () => ({
1252
1252
  sequence: s,
1253
- items: a,
1253
+ items: o,
1254
1254
  // Extra functions.
1255
1255
  setCurrentCanvasId: u,
1256
1256
  nextCanvas: n,
1257
1257
  previousCanvas: d,
1258
- totalCanvases: a.length,
1259
- setCurrentCanvasIndex: o,
1258
+ totalCanvases: o.length,
1259
+ setCurrentCanvasIndex: a,
1260
1260
  setSequenceIndex: l,
1261
1261
  currentSequenceIndex: r
1262
1262
  }),
1263
- [s, a, u, n, d, a, o, l, r]
1263
+ [s, o, u, n, d, o, a, l, r]
1264
1264
  );
1265
1265
  return t ? /* @__PURE__ */ x(it.Provider, { value: p, children: /* @__PURE__ */ x(rt.Provider, { value: i, children: /* @__PURE__ */ x(Lt, { canvas: i[0], children: e.children }) }) }) : (console.warn("The manifest passed to the provider is not a valid IIIF manifest."), /* @__PURE__ */ x("div", { children: "Sorry, something went wrong." }));
1266
1266
  }
1267
- function xs(e) {
1268
- const t = hs(e.manifest);
1267
+ function ws(e) {
1268
+ const t = ys(e.manifest);
1269
1269
  if (!t)
1270
1270
  return console.warn("The manifest passed to the provider is not a valid IIIF manifest."), /* @__PURE__ */ x("div", { children: "Sorry, something went wrong." });
1271
1271
  if (t.error)
1272
1272
  return /* @__PURE__ */ x("div", { children: t.error.toString() });
1273
1273
  if (!t.isLoaded)
1274
1274
  return /* @__PURE__ */ x("div", { children: "Loading..." });
1275
- const r = /* @__PURE__ */ x(As, { ...e, children: e.children });
1276
- return /* @__PURE__ */ x(ys, { manifest: t.id, children: e.rangeId ? /* @__PURE__ */ x(vs, { range: e.rangeId, children: r }) : r });
1275
+ const r = /* @__PURE__ */ x(xs, { ...e, children: e.children });
1276
+ return /* @__PURE__ */ x(vs, { manifest: t.id, children: e.rangeId ? /* @__PURE__ */ x(gs, { range: e.rangeId, children: r }) : r });
1277
1277
  }
1278
- function ws() {
1278
+ function Ss() {
1279
1279
  return H(it);
1280
1280
  }
1281
- function Ss() {
1281
+ function Cs() {
1282
1282
  return {
1283
1283
  VaultContext: H(tt),
1284
1284
  ResourceContext: H(Et),
@@ -1286,7 +1286,7 @@ function Ss() {
1286
1286
  VisibleCanvasReactContext: H(rt)
1287
1287
  };
1288
1288
  }
1289
- function Cs(e) {
1289
+ function Ms(e) {
1290
1290
  return /* @__PURE__ */ x(Nr, { vault: e.bridge.VaultContext.vault || void 0, resources: e.bridge.ResourceContext, children: /* @__PURE__ */ x(rt.Provider, { value: e.bridge.VisibleCanvasReactContext, children: /* @__PURE__ */ x(it.Provider, { value: e.bridge.SimpleViewerReactContext, children: e.children }) }) });
1291
1291
  }
1292
1292
  const se = function(e) {
@@ -1298,29 +1298,29 @@ const se = function(e) {
1298
1298
  ...i !== void 0 && { meta: i }
1299
1299
  });
1300
1300
  };
1301
- }, Ms = "@iiif/IMPORT_ENTITIES", Rs = "@iiif/MODIFY_ENTITY_FIELD", Is = "@iiif/REORDER_ENTITY_FIELD", Ts = "@iiif/ADD_REFERENCE", ks = "@iiif/UPDATE_REFERENCE", Os = "@iiif/REMOVE_REFERENCE", Es = "@iiif/ADD_METADATA", Ps = "@iiif/REMOVE_METADATA", Ls = "@iiif/UPDATE_METADATA", Fs = "@iiif/REORDER_METADATA", js = se(Ms)(), $s = se(Rs)(), Ds = se(Is)(), qs = se(Ts)(), _s = se(Os)(), Us = se(ks)(), Vs = se(Es)(), Ns = se(Ls)(), Hs = se(Ps)(), Bs = se(Fs)(), pt = {
1302
- importEntities: js,
1303
- modifyEntityField: $s,
1304
- reorderEntityField: Ds,
1305
- addReference: qs,
1306
- removeReference: _s,
1307
- updateReference: Us,
1308
- addMetadata: Vs,
1309
- removeMetadata: Hs,
1310
- updateMetadata: Ns,
1311
- reorderMetadata: Bs
1301
+ }, Rs = "@iiif/IMPORT_ENTITIES", Is = "@iiif/MODIFY_ENTITY_FIELD", Ts = "@iiif/REORDER_ENTITY_FIELD", ks = "@iiif/ADD_REFERENCE", Os = "@iiif/UPDATE_REFERENCE", Es = "@iiif/REMOVE_REFERENCE", Ps = "@iiif/ADD_METADATA", Ls = "@iiif/REMOVE_METADATA", Fs = "@iiif/UPDATE_METADATA", js = "@iiif/REORDER_METADATA", $s = se(Rs)(), Ds = se(Is)(), qs = se(Ts)(), _s = se(ks)(), Us = se(Es)(), Vs = se(Os)(), Ns = se(Ps)(), Hs = se(Fs)(), Bs = se(Ls)(), zs = se(js)(), pt = {
1302
+ importEntities: $s,
1303
+ modifyEntityField: Ds,
1304
+ reorderEntityField: qs,
1305
+ addReference: _s,
1306
+ removeReference: Us,
1307
+ updateReference: Vs,
1308
+ addMetadata: Ns,
1309
+ removeMetadata: Bs,
1310
+ updateMetadata: Hs,
1311
+ reorderMetadata: zs
1312
1312
  };
1313
- function zs() {
1313
+ function Ws() {
1314
1314
  const t = V().getStore();
1315
1315
  return E(() => (r) => t.dispatch(r), [t]);
1316
1316
  }
1317
1317
  function ir(e) {
1318
1318
  return typeof e != "string" && e && e.bindToVault;
1319
1319
  }
1320
- function Ws() {
1321
- const e = V(), t = ge([]), r = zs(), i = E(() => `vault://annotation-page/${(/* @__PURE__ */ new Date()).getTime()}/${Math.round(Math.random() * 1e9).toString(16)}`, []);
1320
+ function Qs() {
1321
+ const e = V(), t = ge([]), r = Ws(), i = E(() => `vault://annotation-page/${(/* @__PURE__ */ new Date()).getTime()}/${Math.round(Math.random() * 1e9).toString(16)}`, []);
1322
1322
  hr(() => {
1323
- const o = {
1323
+ const a = {
1324
1324
  id: i,
1325
1325
  type: "AnnotationPage",
1326
1326
  behavior: [],
@@ -1341,31 +1341,31 @@ function Ws() {
1341
1341
  pt.importEntities({
1342
1342
  entities: {
1343
1343
  AnnotationPage: {
1344
- [o.id]: o
1344
+ [a.id]: a
1345
1345
  }
1346
1346
  }
1347
1347
  })
1348
1348
  );
1349
1349
  }, [i]);
1350
1350
  const n = Q(
1351
- (o) => i ? o.iiif.entities.AnnotationPage[i] : null,
1351
+ (a) => i ? a.iiif.entities.AnnotationPage[i] : null,
1352
1352
  [i]
1353
1353
  ), s = D(
1354
- (o, u) => {
1354
+ (a, u) => {
1355
1355
  if (i) {
1356
- if (ir(o)) {
1357
- const p = o;
1358
- p.__vault || p.bindToVault(e), o = typeof p.source == "string" ? p.source : p.source.id, t.current[o] = p;
1356
+ if (ir(a)) {
1357
+ const p = a;
1358
+ p.__vault || p.bindToVault(e), a = typeof p.source == "string" ? p.source : p.source.id, t.current[a] = p;
1359
1359
  } else
1360
- typeof o != "string" && (o = o.id);
1361
- const d = e.get({ id: i, type: "AnnotationPage" }), l = e.get({ id: o, type: "Annotation" });
1360
+ typeof a != "string" && (a = a.id);
1361
+ const d = e.get({ id: i, type: "AnnotationPage" }), l = e.get({ id: a, type: "Annotation" });
1362
1362
  d && l && (d.items.find((p) => p.id === l.id) || r(
1363
1363
  pt.addReference({
1364
1364
  id: i,
1365
1365
  type: "AnnotationPage",
1366
1366
  key: "items",
1367
1367
  reference: {
1368
- id: o,
1368
+ id: a,
1369
1369
  type: "Annotation"
1370
1370
  },
1371
1371
  index: u
@@ -1374,15 +1374,15 @@ function Ws() {
1374
1374
  }
1375
1375
  },
1376
1376
  [i]
1377
- ), a = D(
1378
- (o) => {
1379
- i && (ir(o) ? o = typeof o.source == "string" ? o.source : o.source.id : typeof o != "string" && (o = o.id), t.current[o] && t.current[o].beforeRemove(), e.get({ id: i, type: "AnnotationPage" }) && r(
1377
+ ), o = D(
1378
+ (a) => {
1379
+ i && (ir(a) ? a = typeof a.source == "string" ? a.source : a.source.id : typeof a != "string" && (a = a.id), t.current[a] && t.current[a].beforeRemove(), e.get({ id: i, type: "AnnotationPage" }) && r(
1380
1380
  pt.removeReference({
1381
1381
  id: i,
1382
1382
  type: "AnnotationPage",
1383
1383
  key: "items",
1384
1384
  reference: {
1385
- id: o,
1385
+ id: a,
1386
1386
  type: "Annotation"
1387
1387
  }
1388
1388
  })
@@ -1394,12 +1394,12 @@ function Ws() {
1394
1394
  n,
1395
1395
  {
1396
1396
  addAnnotation: s,
1397
- removeAnnotation: a
1397
+ removeAnnotation: o
1398
1398
  }
1399
1399
  ];
1400
1400
  }
1401
1401
  const Yr = ce(null);
1402
- function Qs() {
1402
+ function Ys() {
1403
1403
  const e = H(Yr);
1404
1404
  return [
1405
1405
  e.fullPage,
@@ -1409,8 +1409,8 @@ function Qs() {
1409
1409
  }
1410
1410
  ];
1411
1411
  }
1412
- function Ys({ children: e }) {
1413
- const [t, { addAnnotation: r, removeAnnotation: i }] = Ws();
1412
+ function Gs({ children: e }) {
1413
+ const [t, { addAnnotation: r, removeAnnotation: i }] = Qs();
1414
1414
  return /* @__PURE__ */ x(
1415
1415
  Yr.Provider,
1416
1416
  {
@@ -1419,7 +1419,7 @@ function Ys({ children: e }) {
1419
1419
  }
1420
1420
  );
1421
1421
  }
1422
- function Gs({
1422
+ function Js({
1423
1423
  width: e,
1424
1424
  style: t,
1425
1425
  height: r,
@@ -1433,7 +1433,7 @@ function Gs({
1433
1433
  ] });
1434
1434
  }
1435
1435
  const Ft = ce(null);
1436
- function Js() {
1436
+ function Ks() {
1437
1437
  return H(Ft);
1438
1438
  }
1439
1439
  const Gr = ce(
@@ -1450,27 +1450,27 @@ function Le(e, t, r, i, n = []) {
1450
1450
  }), [t, e, s, ...n]);
1451
1451
  }
1452
1452
  function ue(e = {}, t = []) {
1453
- const { id: r, selector: i } = e, n = be(), s = r || n.canvas, a = Q((o) => s ? o.iiif.entities.Canvas[s] : void 0, [s]);
1453
+ const { id: r, selector: i } = e, n = be(), s = r || n.canvas, o = Q((a) => s ? a.iiif.entities.Canvas[s] : void 0, [s]);
1454
1454
  return E(() => {
1455
- if (a)
1456
- return i ? i(a) : a;
1457
- }, [a, i, ...t]);
1455
+ if (o)
1456
+ return i ? i(o) : o;
1457
+ }, [o, i, ...t]);
1458
1458
  }
1459
1459
  const Kr = ce(() => {
1460
1460
  });
1461
- function Ks(e) {
1461
+ function Zs(e) {
1462
1462
  const t = ue(), r = H(Kr);
1463
1463
  K(() => t && t.id ? (r(t.id, e), () => r(t.id, -1)) : () => {
1464
1464
  }, [t, e]);
1465
1465
  }
1466
- function Zs({
1466
+ function Xs({
1467
1467
  children: e,
1468
1468
  errorFallback: t,
1469
1469
  outerContainerProps: r = {},
1470
1470
  worldScale: i,
1471
1471
  ...n
1472
1472
  }) {
1473
- const [s, a] = B(), o = Ss(), u = t || Gs, [d, l] = B({}), p = Object.entries(d), [v, m] = B({}), h = Object.entries(v), [g, b] = B({}), A = E(() => i || Math.max(...Object.values(g)), [g]), w = E(() => ({ maxOverZoom: A || 1 }), [A]), C = D((I, L) => {
1473
+ const [s, o] = B(), a = Cs(), u = t || Js, [d, l] = B({}), p = Object.entries(d), [v, m] = B({}), h = Object.entries(v), [g, b] = B({}), A = E(() => i || Math.max(...Object.values(g)), [g]), w = E(() => ({ maxOverZoom: A || 1, ...n.runtimeOptions || {} }), [A, n.runtimeOptions]), C = D((I, L) => {
1474
1474
  b((P) => {
1475
1475
  if (L === -1) {
1476
1476
  const { [I]: M, ...$ } = P;
@@ -1489,7 +1489,7 @@ function Zs({
1489
1489
  [I]: { element: L, props: P }
1490
1490
  } : $);
1491
1491
  }, []);
1492
- return /* @__PURE__ */ N(xn, { resetKeys: [], fallbackRender: (I) => /* @__PURE__ */ x(u, { ...n, ...I }), children: [
1492
+ return /* @__PURE__ */ N(wn, { resetKeys: [], fallbackRender: (I) => /* @__PURE__ */ x(u, { ...n, ...I }), children: [
1493
1493
  /* @__PURE__ */ x(
1494
1494
  un,
1495
1495
  {
@@ -1497,10 +1497,10 @@ function Zs({
1497
1497
  containerProps: { style: { position: "relative" }, ...n.containerProps || {} },
1498
1498
  htmlChildren: /* @__PURE__ */ x(Me, { children: p.map(([I, { element: L, props: P }]) => /* @__PURE__ */ x(me.Fragment, { children: /* @__PURE__ */ x(L, { ...P || {} }) }, I)) }),
1499
1499
  onCreated: (I) => {
1500
- a(I), n.onCreated && n.onCreated(I);
1500
+ o(I), n.onCreated && n.onCreated(I);
1501
1501
  },
1502
1502
  runtimeOptions: w,
1503
- children: /* @__PURE__ */ x(Ft.Provider, { value: s, children: /* @__PURE__ */ x(Kr.Provider, { value: C, children: /* @__PURE__ */ x(Gr.Provider, { value: T, children: /* @__PURE__ */ x(Jr.Provider, { value: j, children: /* @__PURE__ */ x(Cs, { bridge: o, children: /* @__PURE__ */ x(Ys, { children: e }) }) }) }) }) })
1503
+ children: /* @__PURE__ */ x(Ft.Provider, { value: s, children: /* @__PURE__ */ x(Kr.Provider, { value: C, children: /* @__PURE__ */ x(Gr.Provider, { value: T, children: /* @__PURE__ */ x(Jr.Provider, { value: j, children: /* @__PURE__ */ x(Ms, { bridge: a, children: /* @__PURE__ */ x(ln.Provider, { value: n.mode || "explore", children: /* @__PURE__ */ x(Gs, { children: e }) }) }) }) }) }) })
1504
1504
  }
1505
1505
  ),
1506
1506
  /* @__PURE__ */ x("div", { children: h.map(([I, { element: L, props: P }]) => /* @__PURE__ */ x(me.Fragment, { children: /* @__PURE__ */ x(L, { ...P || {} }) }, I)) })
@@ -1511,12 +1511,12 @@ const He = {}, Zr = {
1511
1511
  return e;
1512
1512
  },
1513
1513
  setMetaValue([e, t, r], i) {
1514
- const n = Zr.getResourceMeta(e, t), s = n ? n[r] : void 0, a = typeof i == "function" ? i(s) : i;
1514
+ const n = Zr.getResourceMeta(e, t), s = n ? n[r] : void 0, o = typeof i == "function" ? i(s) : i;
1515
1515
  He[e] = {
1516
1516
  ...He[e] || {},
1517
1517
  [t]: {
1518
1518
  ...(He[e] || {})[t] || {},
1519
- [r]: a
1519
+ [r]: o
1520
1520
  }
1521
1521
  };
1522
1522
  },
@@ -1533,11 +1533,11 @@ function Xr(e = Zr) {
1533
1533
  return e.setMetaValue(
1534
1534
  [t.id, "eventManager", r],
1535
1535
  (s) => {
1536
- const a = s || [];
1537
- for (const o of a)
1538
- if (o.callback === i)
1539
- return a;
1540
- return [...a, { callback: i, scope: n }];
1536
+ const o = s || [];
1537
+ for (const a of o)
1538
+ if (a.callback === i)
1539
+ return o;
1540
+ return [...o, { callback: i, scope: n }];
1541
1541
  }
1542
1542
  ), i;
1543
1543
  },
@@ -1553,11 +1553,11 @@ function Xr(e = Zr) {
1553
1553
  return {};
1554
1554
  const n = e.getResourceMeta(i.id, "eventManager"), s = {};
1555
1555
  if (n && i)
1556
- for (const a of Object.keys(n))
1557
- s[a] = (o) => {
1556
+ for (const o of Object.keys(n))
1557
+ s[o] = (a) => {
1558
1558
  const u = e.get(i);
1559
- for (const { callback: d, scope: l } of n[a] || [])
1560
- (!l || r && l.indexOf(r) !== -1) && d(o, u);
1559
+ for (const { callback: d, scope: l } of n[o] || [])
1560
+ (!l || r && l.indexOf(r) !== -1) && d(a, u);
1561
1561
  };
1562
1562
  return s;
1563
1563
  }
@@ -1572,12 +1572,12 @@ const Be = {}, ti = {
1572
1572
  return e;
1573
1573
  },
1574
1574
  setMetaValue([e, t, r], i) {
1575
- const n = ti.getResourceMeta(e, t), s = n ? n[r] : void 0, a = typeof i == "function" ? i(s) : i;
1575
+ const n = ti.getResourceMeta(e, t), s = n ? n[r] : void 0, o = typeof i == "function" ? i(s) : i;
1576
1576
  Be[e] = {
1577
1577
  ...Be[e] || {},
1578
1578
  [t]: {
1579
1579
  ...(Be[e] || {})[t] || {},
1580
- [r]: a
1580
+ [r]: o
1581
1581
  }
1582
1582
  };
1583
1583
  },
@@ -1608,20 +1608,20 @@ function et(e, t) {
1608
1608
  return n ? t ? n[t] : n : void 0;
1609
1609
  }, [e, t]);
1610
1610
  }
1611
- var Xs = Object.defineProperty, ea = (e, t, r) => t in e ? Xs(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Qe = (e, t, r) => (ea(e, typeof t != "symbol" ? t + "" : t, r), r), ta = /* @__PURE__ */ function() {
1611
+ var eo = Object.defineProperty, to = (e, t, r) => t in e ? eo(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Qe = (e, t, r) => (to(e, typeof t != "symbol" ? t + "" : t, r), r), ro = /* @__PURE__ */ function() {
1612
1612
  function e(t, r) {
1613
- var i = [], n = !0, s = !1, a = void 0;
1613
+ var i = [], n = !0, s = !1, o = void 0;
1614
1614
  try {
1615
- for (var o = t[Symbol.iterator](), u; !(n = (u = o.next()).done) && (i.push(u.value), !(r && i.length === r)); n = !0)
1615
+ for (var a = t[Symbol.iterator](), u; !(n = (u = a.next()).done) && (i.push(u.value), !(r && i.length === r)); n = !0)
1616
1616
  ;
1617
1617
  } catch (d) {
1618
- s = !0, a = d;
1618
+ s = !0, o = d;
1619
1619
  } finally {
1620
1620
  try {
1621
- !n && o.return && o.return();
1621
+ !n && a.return && a.return();
1622
1622
  } finally {
1623
1623
  if (s)
1624
- throw a;
1624
+ throw o;
1625
1625
  }
1626
1626
  }
1627
1627
  return i;
@@ -1633,64 +1633,64 @@ var Xs = Object.defineProperty, ea = (e, t, r) => t in e ? Xs(e, t, { enumerable
1633
1633
  return e(t, r);
1634
1634
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
1635
1635
  };
1636
- }(), $e = Math.PI * 2, dt = function(e, t, r, i, n, s, a) {
1637
- var o = e.x, u = e.y;
1638
- o *= t, u *= r;
1639
- var d = i * o - n * u, l = n * o + i * u;
1636
+ }(), $e = Math.PI * 2, dt = function(e, t, r, i, n, s, o) {
1637
+ var a = e.x, u = e.y;
1638
+ a *= t, u *= r;
1639
+ var d = i * a - n * u, l = n * a + i * u;
1640
1640
  return {
1641
1641
  x: d + s,
1642
- y: l + a
1642
+ y: l + o
1643
1643
  };
1644
- }, ra = function(e, t) {
1645
- var r = t === 1.5707963267948966 ? 0.551915024494 : t === -1.5707963267948966 ? -0.551915024494 : 1.3333333333333333 * Math.tan(t / 4), i = Math.cos(e), n = Math.sin(e), s = Math.cos(e + t), a = Math.sin(e + t);
1644
+ }, io = function(e, t) {
1645
+ var r = t === 1.5707963267948966 ? 0.551915024494 : t === -1.5707963267948966 ? -0.551915024494 : 1.3333333333333333 * Math.tan(t / 4), i = Math.cos(e), n = Math.sin(e), s = Math.cos(e + t), o = Math.sin(e + t);
1646
1646
  return [{
1647
1647
  x: i - n * r,
1648
1648
  y: n + i * r
1649
1649
  }, {
1650
- x: s + a * r,
1651
- y: a - s * r
1650
+ x: s + o * r,
1651
+ y: o - s * r
1652
1652
  }, {
1653
1653
  x: s,
1654
- y: a
1654
+ y: o
1655
1655
  }];
1656
1656
  }, nr = function(e, t, r, i) {
1657
1657
  var n = e * i - t * r < 0 ? -1 : 1, s = e * r + t * i;
1658
1658
  return s > 1 && (s = 1), s < -1 && (s = -1), n * Math.acos(s);
1659
- }, ia = function(e, t, r, i, n, s, a, o, u, d, l, p) {
1659
+ }, no = function(e, t, r, i, n, s, o, a, u, d, l, p) {
1660
1660
  var v = Math.pow(n, 2), m = Math.pow(s, 2), h = Math.pow(l, 2), g = Math.pow(p, 2), b = v * m - v * g - m * h;
1661
- b < 0 && (b = 0), b /= v * g + m * h, b = Math.sqrt(b) * (a === o ? -1 : 1);
1661
+ b < 0 && (b = 0), b /= v * g + m * h, b = Math.sqrt(b) * (o === a ? -1 : 1);
1662
1662
  var A = b * n / s * p, w = b * -s / n * l, C = d * A - u * w + (e + r) / 2, T = u * A + d * w + (t + i) / 2, j = (l - A) / n, I = (p - w) / s, L = (-l - A) / n, P = (-p - w) / s, M = nr(1, 0, j, I), $ = nr(j, I, L, P);
1663
- return o === 0 && $ > 0 && ($ -= $e), o === 1 && $ < 0 && ($ += $e), [C, T, M, $];
1664
- }, na = function(e) {
1665
- var t = e.px, r = e.py, i = e.cx, n = e.cy, s = e.rx, a = e.ry, o = e.xAxisRotation, u = o === void 0 ? 0 : o, d = e.largeArcFlag, l = d === void 0 ? 0 : d, p = e.sweepFlag, v = p === void 0 ? 0 : p, m = [];
1666
- if (s === 0 || a === 0)
1663
+ return a === 0 && $ > 0 && ($ -= $e), a === 1 && $ < 0 && ($ += $e), [C, T, M, $];
1664
+ }, so = function(e) {
1665
+ var t = e.px, r = e.py, i = e.cx, n = e.cy, s = e.rx, o = e.ry, a = e.xAxisRotation, u = a === void 0 ? 0 : a, d = e.largeArcFlag, l = d === void 0 ? 0 : d, p = e.sweepFlag, v = p === void 0 ? 0 : p, m = [];
1666
+ if (s === 0 || o === 0)
1667
1667
  return [];
1668
1668
  var h = Math.sin(u * $e / 360), g = Math.cos(u * $e / 360), b = g * (t - i) / 2 + h * (r - n) / 2, A = -h * (t - i) / 2 + g * (r - n) / 2;
1669
1669
  if (b === 0 && A === 0)
1670
1670
  return [];
1671
- s = Math.abs(s), a = Math.abs(a);
1672
- var w = Math.pow(b, 2) / Math.pow(s, 2) + Math.pow(A, 2) / Math.pow(a, 2);
1673
- w > 1 && (s *= Math.sqrt(w), a *= Math.sqrt(w));
1674
- var C = ia(t, r, i, n, s, a, l, v, h, g, b, A), T = ta(C, 4), j = T[0], I = T[1], L = T[2], P = T[3], M = Math.abs(P) / ($e / 4);
1671
+ s = Math.abs(s), o = Math.abs(o);
1672
+ var w = Math.pow(b, 2) / Math.pow(s, 2) + Math.pow(A, 2) / Math.pow(o, 2);
1673
+ w > 1 && (s *= Math.sqrt(w), o *= Math.sqrt(w));
1674
+ var C = no(t, r, i, n, s, o, l, v, h, g, b, A), T = ro(C, 4), j = T[0], I = T[1], L = T[2], P = T[3], M = Math.abs(P) / ($e / 4);
1675
1675
  Math.abs(1 - M) < 1e-7 && (M = 1);
1676
1676
  var $ = Math.max(Math.ceil(M), 1);
1677
1677
  P /= $;
1678
1678
  for (var ie = 0; ie < $; ie++)
1679
- m.push(ra(L, P)), L += P;
1679
+ m.push(io(L, P)), L += P;
1680
1680
  return m.map(function(Z) {
1681
- var U = dt(Z[0], s, a, g, h, j, I), z = U.x, ee = U.y, ne = dt(Z[1], s, a, g, h, j, I), xe = ne.x, O = ne.y, W = dt(Z[2], s, a, g, h, j, I), X = W.x, de = W.y;
1681
+ var U = dt(Z[0], s, o, g, h, j, I), z = U.x, ee = U.y, ne = dt(Z[1], s, o, g, h, j, I), xe = ne.x, O = ne.y, W = dt(Z[2], s, o, g, h, j, I), X = W.x, de = W.y;
1682
1682
  return { x1: z, y1: ee, x2: xe, y2: O, x: X, y: de };
1683
1683
  });
1684
1684
  };
1685
1685
  function ri(e) {
1686
1686
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
1687
1687
  }
1688
- var sa = oa, ht = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, aa = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
1689
- function oa(e) {
1688
+ var oo = co, ht = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, ao = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
1689
+ function co(e) {
1690
1690
  var t = [];
1691
- return e.replace(aa, function(r, i, n) {
1691
+ return e.replace(ao, function(r, i, n) {
1692
1692
  var s = i.toLowerCase();
1693
- for (n = ua(n), s == "m" && n.length > 2 && (t.push([i].concat(n.splice(0, 2))), s = "l", i = i == "m" ? "l" : "L"); ; ) {
1693
+ for (n = lo(n), s == "m" && n.length > 2 && (t.push([i].concat(n.splice(0, 2))), s = "l", i = i == "m" ? "l" : "L"); ; ) {
1694
1694
  if (n.length == ht[s])
1695
1695
  return n.unshift(i), t.push(n);
1696
1696
  if (n.length < ht[s])
@@ -1699,20 +1699,20 @@ function oa(e) {
1699
1699
  }
1700
1700
  }), t;
1701
1701
  }
1702
- var ca = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
1703
- function ua(e) {
1704
- var t = e.match(ca);
1702
+ var uo = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
1703
+ function lo(e) {
1704
+ var t = e.match(uo);
1705
1705
  return t ? t.map(Number) : [];
1706
1706
  }
1707
- const la = /* @__PURE__ */ ri(sa);
1708
- var fa = pa;
1709
- function pa(e) {
1707
+ const fo = /* @__PURE__ */ ri(oo);
1708
+ var po = ho;
1709
+ function ho(e) {
1710
1710
  var t = 0, r = 0, i = 0, n = 0;
1711
1711
  return e.map(function(s) {
1712
1712
  s = s.slice();
1713
- var a = s[0], o = a.toUpperCase();
1714
- if (a != o)
1715
- switch (s[0] = o, a) {
1713
+ var o = s[0], a = o.toUpperCase();
1714
+ if (o != a)
1715
+ switch (s[0] = a, o) {
1716
1716
  case "a":
1717
1717
  s[6] += i, s[7] += n;
1718
1718
  break;
@@ -1726,7 +1726,7 @@ function pa(e) {
1726
1726
  for (var u = 1; u < s.length; )
1727
1727
  s[u++] += i, s[u++] += n;
1728
1728
  }
1729
- switch (o) {
1729
+ switch (a) {
1730
1730
  case "Z":
1731
1731
  i = t, n = r;
1732
1732
  break;
@@ -1745,10 +1745,10 @@ function pa(e) {
1745
1745
  return s;
1746
1746
  });
1747
1747
  }
1748
- const da = /* @__PURE__ */ ri(fa);
1749
- function ha(e) {
1750
- const t = la(e), r = da(t);
1751
- let i, n = 0, s = 0, a = 0, o = 0, u, d, l = 0, p = 0;
1748
+ const yo = /* @__PURE__ */ ri(po);
1749
+ function vo(e) {
1750
+ const t = fo(e), r = yo(t);
1751
+ let i, n = 0, s = 0, o = 0, a = 0, u, d, l = 0, p = 0;
1752
1752
  const v = [];
1753
1753
  for (let m = 0; m < r.length; m++) {
1754
1754
  let h = r[m];
@@ -1766,7 +1766,7 @@ function ha(e) {
1766
1766
  case "S":
1767
1767
  {
1768
1768
  let b = l, A = p;
1769
- (i === "C" || i == "S") && (b += b - a, A += A - o), h = ["C", b, A, h[1], h[2], h[3], h[4]];
1769
+ (i === "C" || i == "S") && (b += b - o, A += A - a), h = ["C", b, A, h[1], h[2], h[3], h[4]];
1770
1770
  }
1771
1771
  break;
1772
1772
  case "T":
@@ -1777,7 +1777,7 @@ function ha(e) {
1777
1777
  break;
1778
1778
  case "A":
1779
1779
  {
1780
- const b = na({
1780
+ const b = so({
1781
1781
  px: l,
1782
1782
  py: p,
1783
1783
  cx: h[6],
@@ -1799,7 +1799,7 @@ function ha(e) {
1799
1799
  h = ["L", n, s];
1800
1800
  break;
1801
1801
  }
1802
- i = g, l = h[h.length - 2], p = h[h.length - 1], ["C", "Q", "A"].indexOf(g) > -1 ? (a = h[h.length - 4], o = h[h.length - 3]) : (a = l, o = p), v.push(h);
1802
+ i = g, l = h[h.length - 2], p = h[h.length - 1], ["C", "Q", "A"].indexOf(g) > -1 ? (o = h[h.length - 4], a = h[h.length - 3]) : (o = l, a = p), v.push(h);
1803
1803
  }
1804
1804
  return v;
1805
1805
  }
@@ -1834,15 +1834,15 @@ function ha(e) {
1834
1834
  * See the License for the specific language governing permissions and
1835
1835
  * limitations under the License.
1836
1836
  */
1837
- function ya(e, t, r, i = 1) {
1837
+ function go(e, t, r, i = 1) {
1838
1838
  return new ii(e, t, r).subdivide(i);
1839
1839
  }
1840
- function va(e, t, r, i, n = 1) {
1840
+ function mo(e, t, r, i, n = 1) {
1841
1841
  return new $t(
1842
1842
  new Float64Array([e.x, e.y, t.x, t.y, r.x, r.y, i.x, i.y])
1843
1843
  ).subdivide(n);
1844
1844
  }
1845
- function ga(e) {
1845
+ function bo(e) {
1846
1846
  return e.x * e.x + e.y * e.y;
1847
1847
  }
1848
1848
  function De(e) {
@@ -1863,13 +1863,13 @@ class ii {
1863
1863
  };
1864
1864
  }
1865
1865
  mapToBasic() {
1866
- const { x: t, y: r } = this.start, { x: i, y: n } = this.control, { x: s, y: a } = this.end, o = 2 * i - t - s, u = 2 * n - r - a, d = (i - t) * o + (n - r) * u, l = (s - i) * o + (a - n) * u, p = (s - t) * u - (a - r) * o, v = d / p, m = l / p, h = Math.abs(p) / (Math.hypot(o, u) * Math.abs(m - v));
1866
+ const { x: t, y: r } = this.start, { x: i, y: n } = this.control, { x: s, y: o } = this.end, a = 2 * i - t - s, u = 2 * n - r - o, d = (i - t) * a + (n - r) * u, l = (s - i) * a + (o - n) * u, p = (s - t) * u - (o - r) * a, v = d / p, m = l / p, h = Math.abs(p) / (Math.hypot(a, u) * Math.abs(m - v));
1867
1867
  return { x0: t, x2: s, scale: h, cross: p };
1868
1868
  }
1869
1869
  subdivide(t) {
1870
- const r = this.mapToBasic(), i = De(r.x0), n = De(r.x2), s = 0.5 * Math.abs(n - i) * Math.sqrt(r.scale / t), a = Math.ceil(s), o = Ee(i), u = Ee(n), d = [0];
1871
- for (let l = 1; l < a; l++) {
1872
- const p = (Ee(i + (n - i) * l / a) - o) / (u - o);
1870
+ const r = this.mapToBasic(), i = De(r.x0), n = De(r.x2), s = 0.5 * Math.abs(n - i) * Math.sqrt(r.scale / t), o = Math.ceil(s), a = Ee(i), u = Ee(n), d = [0];
1871
+ for (let l = 1; l < o; l++) {
1872
+ const p = (Ee(i + (n - i) * l / o) - a) / (u - a);
1873
1873
  d.push(p);
1874
1874
  }
1875
1875
  return d.push(1), d.map((l) => this.eval(l));
@@ -1881,16 +1881,16 @@ class $t {
1881
1881
  Qe(this, "c"), this.c = t;
1882
1882
  }
1883
1883
  weightsum(t, r, i, n) {
1884
- const s = t * this.c[0] + r * this.c[2] + i * this.c[4] + n * this.c[6], a = t * this.c[1] + r * this.c[3] + i * this.c[5] + n * this.c[7];
1885
- return { x: s, y: a };
1884
+ const s = t * this.c[0] + r * this.c[2] + i * this.c[4] + n * this.c[6], o = t * this.c[1] + r * this.c[3] + i * this.c[5] + n * this.c[7];
1885
+ return { x: s, y: o };
1886
1886
  }
1887
1887
  eval(t) {
1888
- const r = 1 - t, i = r * r * r, n = 3 * r * r * t, s = 3 * r * t * t, a = t * t * t;
1889
- return this.weightsum(i, n, s, a);
1888
+ const r = 1 - t, i = r * r * r, n = 3 * r * r * t, s = 3 * r * t * t, o = t * t * t;
1889
+ return this.weightsum(i, n, s, o);
1890
1890
  }
1891
1891
  deriv(t) {
1892
- const r = 1 - t, i = -3 * r * r, n = 3 * t * t, s = -6 * t * r - i, a = 6 * t * r - n;
1893
- return this.weightsum(i, s, a, n);
1892
+ const r = 1 - t, i = -3 * r * r, n = 3 * t * t, s = -6 * t * r - i, o = 6 * t * r - n;
1893
+ return this.weightsum(i, s, o, n);
1894
1894
  }
1895
1895
  // quadratic bezier with matching endpoints and minimum max vector error
1896
1896
  midpoint_quadbez() {
@@ -1900,23 +1900,23 @@ class $t {
1900
1900
  subsegment(t, r) {
1901
1901
  const i = new Float64Array(8), n = this.eval(t), s = this.eval(r);
1902
1902
  i[0] = n.x, i[1] = n.y;
1903
- const a = (r - t) / 3, o = this.deriv(t);
1904
- i[2] = n.x + a * o.x, i[3] = n.y + a * o.y;
1903
+ const o = (r - t) / 3, a = this.deriv(t);
1904
+ i[2] = n.x + o * a.x, i[3] = n.y + o * a.y;
1905
1905
  const u = this.deriv(r);
1906
- return i[4] = s.x - a * u.x, i[5] = s.y - a * u.y, i[6] = s.x, i[7] = s.y, new $t(i);
1906
+ return i[4] = s.x - o * u.x, i[5] = s.y - o * u.y, i[6] = s.x, i[7] = s.y, new $t(i);
1907
1907
  }
1908
1908
  // Very fancy subdivision scheme
1909
1909
  subdivide(t) {
1910
- const r = 0.1 * t, i = t - r, n = Math.sqrt(i), s = ga(this.weightsum(1, -3, 3, -1)), a = Math.ceil(Math.pow(s / (432 * r * r), 1 / 6)), o = [];
1910
+ const r = 0.1 * t, i = t - r, n = Math.sqrt(i), s = bo(this.weightsum(1, -3, 3, -1)), o = Math.ceil(Math.pow(s / (432 * r * r), 1 / 6)), a = [];
1911
1911
  let u = 0;
1912
- for (let h = 0; h < a; h++) {
1913
- const g = h / a, b = (h + 1) / a, A = this.subsegment(g, b).midpoint_quadbez(), w = A.mapToBasic(), C = De(w.x0), T = De(w.x2), j = Math.sqrt(w.scale);
1912
+ for (let h = 0; h < o; h++) {
1913
+ const g = h / o, b = (h + 1) / o, A = this.subsegment(g, b).midpoint_quadbez(), w = A.mapToBasic(), C = De(w.x0), T = De(w.x2), j = Math.sqrt(w.scale);
1914
1914
  let I = Math.abs(T - C) * j;
1915
1915
  if (Math.sign(w.x0) != Math.sign(w.x2)) {
1916
1916
  const L = n / j, P = n * Math.abs(T - C) / De(L);
1917
1917
  I = Math.max(I, P);
1918
1918
  }
1919
- o.push({
1919
+ a.push({
1920
1920
  quad: A,
1921
1921
  a0: C,
1922
1922
  a2: T,
@@ -1927,15 +1927,15 @@ class $t {
1927
1927
  let v = 0, m = 0;
1928
1928
  for (let h = 1; h < l; h++) {
1929
1929
  const g = u * h / l;
1930
- for (; v + o[m].val < g; )
1931
- v += o[m].val, m++;
1932
- const b = o[m].a0, A = o[m].a2, w = Ee(b), C = Ee(A), T = b + (A - b) * (g - v) / o[m].val, j = (Ee(T) - w) / (C - w);
1933
- p.push(o[m].quad.eval(j));
1930
+ for (; v + a[m].val < g; )
1931
+ v += a[m].val, m++;
1932
+ const b = a[m].a0, A = a[m].a2, w = Ee(b), C = Ee(A), T = b + (A - b) * (g - v) / a[m].val, j = (Ee(T) - w) / (C - w);
1933
+ p.push(a[m].quad.eval(j));
1934
1934
  }
1935
1935
  return p.push({ x: this.c[6], y: this.c[7] }), p;
1936
1936
  }
1937
1937
  }
1938
- const ma = /&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/, ba = /&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/, sr = /^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;
1938
+ const Ao = /&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/, xo = /&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/, sr = /^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;
1939
1939
  function Ye(e, {
1940
1940
  domParser: t,
1941
1941
  svgPreprocessor: r,
@@ -1946,11 +1946,11 @@ function Ye(e, {
1946
1946
  e.reduce(
1947
1947
  (n, s) => {
1948
1948
  const {
1949
- selector: a,
1950
- selectors: o,
1949
+ selector: o,
1950
+ selectors: a,
1951
1951
  iiifRenderingHints: u
1952
1952
  } = Ye(s, { domParser: t, svgPreprocessor: r, iiifRenderingHints: i });
1953
- return a && (n.selector || (n.selector = a), n.selectors.push(...o)), u && (n.iiifRenderingHints = n.iiifRenderingHints || { type: "ImageApiSelector" }, Object.assign(n.iiifRenderingHints, u)), n;
1953
+ return o && (n.selector || (n.selector = o), n.selectors.push(...a)), u && (n.iiifRenderingHints = n.iiifRenderingHints || { type: "ImageApiSelector" }, Object.assign(n.iiifRenderingHints, u)), n;
1954
1954
  },
1955
1955
  {
1956
1956
  selector: null,
@@ -1989,7 +1989,7 @@ function Ye(e, {
1989
1989
  iiifRenderingHints: i
1990
1990
  });
1991
1991
  }
1992
- if (Sa(e)) {
1992
+ if (Mo(e)) {
1993
1993
  const n = [];
1994
1994
  if (e.region) {
1995
1995
  const s = Ye(
@@ -2005,9 +2005,9 @@ function Ye(e, {
2005
2005
  });
2006
2006
  }
2007
2007
  if (e.type === "FragmentSelector") {
2008
- const n = ma.exec(e.value);
2008
+ const n = Ao.exec(e.value);
2009
2009
  if (n) {
2010
- const a = {
2010
+ const o = {
2011
2011
  type: "BoxSelector",
2012
2012
  spatial: {
2013
2013
  unit: n[2] === "percent:" || n[2] === "pct:" ? "percent" : "pixel",
@@ -2018,14 +2018,14 @@ function Ye(e, {
2018
2018
  }
2019
2019
  };
2020
2020
  return te({
2021
- selector: a,
2022
- selectors: [a],
2021
+ selector: o,
2022
+ selectors: [o],
2023
2023
  iiifRenderingHints: i
2024
2024
  });
2025
2025
  }
2026
- const s = e.value.match(ba);
2026
+ const s = e.value.match(xo);
2027
2027
  if (s) {
2028
- const a = {
2028
+ const o = {
2029
2029
  type: "TemporalSelector",
2030
2030
  temporal: {
2031
2031
  startTime: s[4] ? parseFloat(s[4]) : 0,
@@ -2033,8 +2033,8 @@ function Ye(e, {
2033
2033
  }
2034
2034
  };
2035
2035
  return te({
2036
- selector: a,
2037
- selectors: [a],
2036
+ selector: o,
2037
+ selectors: [o],
2038
2038
  iiifRenderingHints: i
2039
2039
  });
2040
2040
  }
@@ -2048,7 +2048,7 @@ function Ye(e, {
2048
2048
  t || (typeof window < "u" ? t = new window.DOMParser() : console.warn(
2049
2049
  "No DOMParser available, cannot parse SVG selector, `points`, `spatial` and `style` will be unavailable and the SVG will not be normalized."
2050
2050
  ));
2051
- let n = [], s, a, o = (r == null ? void 0 : r(e.value)) ?? e.value, u;
2051
+ let n = [], s, o, a = (r == null ? void 0 : r(e.value)) ?? e.value, u;
2052
2052
  if (t) {
2053
2053
  const l = t.parseFromString(e.value, "image/svg+xml").querySelector("svg");
2054
2054
  if (!l)
@@ -2067,13 +2067,13 @@ function Ye(e, {
2067
2067
  // urx
2068
2068
  Math.max(...n.map((v) => v[1]))
2069
2069
  // ury
2070
- ], { style: a, svg: o } = wa(p.element) ?? { svg: o });
2070
+ ], { style: o, svg: a } = Co(p.element) ?? { svg: a });
2071
2071
  }
2072
2072
  const d = {
2073
2073
  type: "SvgSelector",
2074
- svg: o,
2074
+ svg: a,
2075
2075
  svgShape: u,
2076
- style: a,
2076
+ style: o,
2077
2077
  points: n.length ? n : void 0,
2078
2078
  spatial: s ? { unit: "pixel", x: s[0], y: s[1], width: s[2] - s[0], height: s[3] - s[1] } : void 0
2079
2079
  };
@@ -2089,7 +2089,7 @@ function Ye(e, {
2089
2089
  iiifRenderingHints: i
2090
2090
  });
2091
2091
  }
2092
- function Aa(e) {
2092
+ function wo(e) {
2093
2093
  const t = e.map((i) => i[0]).reduce(
2094
2094
  (i, n) => (i[n] += 1, i),
2095
2095
  { C: 0, Q: 0, L: 0, M: 0 }
@@ -2119,40 +2119,40 @@ function ni(e) {
2119
2119
  const i = r.getAttribute("d");
2120
2120
  if (!i)
2121
2121
  continue;
2122
- const n = ha(i);
2123
- return { element: r, points: xa(n), shapeType: Aa(n) };
2122
+ const n = vo(i);
2123
+ return { element: r, points: So(n), shapeType: wo(n) };
2124
2124
  }
2125
2125
  case "circle": {
2126
2126
  const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("r") ?? "0");
2127
2127
  if (!s)
2128
2128
  continue;
2129
- const a = [];
2130
- for (let o = 0; o <= 360; o += 12) {
2131
- const u = o * Math.PI / 180;
2132
- a.push([i + s * Math.cos(u), n + s * Math.sin(u)]);
2129
+ const o = [];
2130
+ for (let a = 0; a <= 360; a += 12) {
2131
+ const u = a * Math.PI / 180;
2132
+ o.push([i + s * Math.cos(u), n + s * Math.sin(u)]);
2133
2133
  }
2134
- return { element: r, points: a, shapeType: "circle" };
2134
+ return { element: r, points: o, shapeType: "circle" };
2135
2135
  }
2136
2136
  case "ellipse": {
2137
- const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("rx") ?? "0"), a = parseFloat(r.getAttribute("ry") ?? "0");
2138
- if (!s && !a)
2137
+ const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("rx") ?? "0"), o = parseFloat(r.getAttribute("ry") ?? "0");
2138
+ if (!s && !o)
2139
2139
  continue;
2140
- const o = [];
2140
+ const a = [];
2141
2141
  for (let u = 0; u <= 360; u += 12) {
2142
- const d = Math.tan(u / 360 * Math.PI), l = s * (1 - d ** 2) / (1 + d ** 2), p = a * 2 * d / (1 + d ** 2);
2143
- o.push([i + l, n + p]);
2142
+ const d = Math.tan(u / 360 * Math.PI), l = s * (1 - d ** 2) / (1 + d ** 2), p = o * 2 * d / (1 + d ** 2);
2143
+ a.push([i + l, n + p]);
2144
2144
  }
2145
- return { element: r, points: o, shapeType: "ellipse" };
2145
+ return { element: r, points: a, shapeType: "ellipse" };
2146
2146
  }
2147
2147
  case "line": {
2148
- const i = parseFloat(r.getAttribute("x0") ?? "0"), n = parseFloat(r.getAttribute("y0") ?? "0"), s = parseFloat(r.getAttribute("x1") ?? "0"), a = parseFloat(r.getAttribute("y1") ?? "0");
2149
- if (i === s && n === a)
2148
+ const i = parseFloat(r.getAttribute("x0") ?? "0"), n = parseFloat(r.getAttribute("y0") ?? "0"), s = parseFloat(r.getAttribute("x1") ?? "0"), o = parseFloat(r.getAttribute("y1") ?? "0");
2149
+ if (i === s && n === o)
2150
2150
  continue;
2151
2151
  return {
2152
2152
  element: r,
2153
2153
  points: [
2154
2154
  [i, n],
2155
- [s, a]
2155
+ [s, o]
2156
2156
  ],
2157
2157
  shapeType: "polyline"
2158
2158
  };
@@ -2166,16 +2166,16 @@ function ni(e) {
2166
2166
  return r.tagName.toLowerCase() === "polygon" && (i.push(i[0]), n = "polygon"), { element: r, points: i, shapeType: n };
2167
2167
  }
2168
2168
  case "rect": {
2169
- const i = parseFloat(r.getAttribute("x") ?? "0"), n = parseFloat(r.getAttribute("y") ?? "0"), s = parseFloat(r.getAttribute("width") ?? "0"), a = parseFloat(r.getAttribute("height") ?? "0");
2170
- if (!s || !a)
2169
+ const i = parseFloat(r.getAttribute("x") ?? "0"), n = parseFloat(r.getAttribute("y") ?? "0"), s = parseFloat(r.getAttribute("width") ?? "0"), o = parseFloat(r.getAttribute("height") ?? "0");
2170
+ if (!s || !o)
2171
2171
  continue;
2172
2172
  return {
2173
2173
  element: r,
2174
2174
  points: [
2175
2175
  [i, n],
2176
2176
  [i + s, n],
2177
- [i + s, n + a],
2178
- [i, n + a],
2177
+ [i + s, n + o],
2178
+ [i, n + o],
2179
2179
  [i, n]
2180
2180
  ],
2181
2181
  shapeType: "rect"
@@ -2186,7 +2186,7 @@ function ni(e) {
2186
2186
  }
2187
2187
  return null;
2188
2188
  }
2189
- function xa(e) {
2189
+ function So(e) {
2190
2190
  const t = [];
2191
2191
  for (let r = 0; r < e.length; r++) {
2192
2192
  const i = t[t.length - 1] ?? [0, 0], n = e[r];
@@ -2197,7 +2197,7 @@ function xa(e) {
2197
2197
  continue;
2198
2198
  case "C":
2199
2199
  t.push(
2200
- ...va(
2200
+ ...mo(
2201
2201
  { x: i[0], y: i[1] },
2202
2202
  { x: n[1], y: n[2] },
2203
2203
  { x: n[3], y: n[4] },
@@ -2208,7 +2208,7 @@ function xa(e) {
2208
2208
  continue;
2209
2209
  case "Q":
2210
2210
  t.push(
2211
- ...ya(
2211
+ ...go(
2212
2212
  { x: i[0], y: i[1] },
2213
2213
  { x: n[1], y: n[2] },
2214
2214
  { x: n[3], y: n[4] }
@@ -2220,7 +2220,7 @@ function xa(e) {
2220
2220
  }
2221
2221
  return t;
2222
2222
  }
2223
- function wa(e) {
2223
+ function Co(e) {
2224
2224
  const t = {};
2225
2225
  if (e.hasAttribute("fill") ? (t.fill = e.getAttribute("fill"), e.removeAttribute("fill")) : e.style.fill && (t.fill = e.style.fill), t.fill) {
2226
2226
  const i = sr.exec(t.fill);
@@ -2237,14 +2237,14 @@ function wa(e) {
2237
2237
  throw new Error("Could not find root SVG element");
2238
2238
  return { svg: r.outerHTML, style: Object.keys(t).length > 0 ? t : void 0 };
2239
2239
  }
2240
- function Sa(e) {
2240
+ function Mo(e) {
2241
2241
  return !!e && e.type === "iiif:ImageApiSelector" && e.type === "iiif:ImageApiSelector";
2242
2242
  }
2243
2243
  function te(e) {
2244
2244
  if (e.iiifRenderingHints) {
2245
2245
  const t = e.iiifRenderingHints;
2246
2246
  if (t.rotation) {
2247
- const r = Ca(t.rotation);
2247
+ const r = Ro(t.rotation);
2248
2248
  if (r)
2249
2249
  if (e.selectors.length)
2250
2250
  for (const i of e.selectors)
@@ -2259,7 +2259,7 @@ function te(e) {
2259
2259
  delete e.iiifRenderingHints;
2260
2260
  return e;
2261
2261
  }
2262
- function Ca(e) {
2262
+ function Ro(e) {
2263
2263
  let t = parseFloat(e);
2264
2264
  return t && e.startsWith("!") && (t = 360 - t), t && (t = t % 360), t !== t ? 0 : t || 0;
2265
2265
  }
@@ -2335,95 +2335,95 @@ function Re(e, t = {}) {
2335
2335
  };
2336
2336
  }
2337
2337
  function si(e = {}, t = []) {
2338
- const { id: r, selector: i } = e, n = be(), s = V(), a = r || n.annotation, o = Q(
2339
- (d) => a ? d.iiif.entities.Annotation[a] : void 0,
2340
- [a]
2338
+ const { id: r, selector: i } = e, n = be(), s = V(), o = r || n.annotation, a = Q(
2339
+ (d) => o ? d.iiif.entities.Annotation[o] : void 0,
2340
+ [o]
2341
2341
  ), u = Q(
2342
- (d) => o && o.body ? o.body.map((l) => l ? l.type === "SpecificResource" ? {
2342
+ (d) => a && a.body ? a.body.map((l) => l ? l.type === "SpecificResource" ? {
2343
2343
  ...l,
2344
2344
  source: s.get(l)
2345
2345
  } : l ? d.iiif.entities[l.type][l.id] : null : null).filter(Boolean) : [],
2346
- [o]
2346
+ [a]
2347
2347
  );
2348
2348
  return E(() => {
2349
- if (!o)
2349
+ if (!a)
2350
2350
  return;
2351
2351
  const d = {
2352
- ...o,
2352
+ ...a,
2353
2353
  body: u,
2354
- target: Re(o.target, { typeMap: s.getState().iiif.mapping })
2354
+ target: Re(a.target, { typeMap: s.getState().iiif.mapping })
2355
2355
  };
2356
2356
  return i ? i(d) : d;
2357
- }, [o, i, u, ...t]);
2357
+ }, [a, i, u, ...t]);
2358
2358
  }
2359
- const ai = ({
2359
+ const oi = ({
2360
2360
  id: e,
2361
2361
  style: t,
2362
2362
  className: r,
2363
2363
  interactive: i
2364
2364
  }) => {
2365
- const n = si({ id: e }), s = et(n, "atlas"), a = et(n, "html"), o = ei(n, ["atlas"]), u = ue(), d = E(() => ln(t, s), [t, s]);
2365
+ const n = si({ id: e }), s = et(n, "atlas"), o = et(n, "html"), a = ei(n, ["atlas"]), u = ue(), d = E(() => fn(t, s), [t, s]);
2366
2366
  return u && n && n.target && n.target.selector && n.target.selector.type === "BoxSelector" && n.target.source && (n.target.source.id === u.id || n.target.source === u.id) ? /* @__PURE__ */ x(
2367
- fn,
2367
+ pn,
2368
2368
  {
2369
2369
  id: n.id,
2370
2370
  isEditing: !0,
2371
2371
  region: n.target.selector.spatial,
2372
2372
  style: d,
2373
- className: (a == null ? void 0 : a.className) || r,
2374
- interactive: !!(a != null && a.href || i),
2375
- href: (a == null ? void 0 : a.href) || null,
2376
- title: (a == null ? void 0 : a.title) || null,
2377
- hrefTarget: (a == null ? void 0 : a.target) || null,
2373
+ className: (o == null ? void 0 : o.className) || r,
2374
+ interactive: !!(o != null && o.href || i),
2375
+ href: (o == null ? void 0 : o.href) || null,
2376
+ title: (o == null ? void 0 : o.title) || null,
2377
+ hrefTarget: (o == null ? void 0 : o.target) || null,
2378
2378
  onClick: () => {
2379
2379
  },
2380
- ...o
2380
+ ...a
2381
2381
  }
2382
2382
  ) : null;
2383
2383
  };
2384
- function Ma(e = {}, t = []) {
2385
- const { id: r, selector: i } = e, n = be(), s = r || n.annotationPage, a = Q(
2386
- (o) => s ? o.iiif.entities.AnnotationPage[s] : void 0,
2384
+ function Io(e = {}, t = []) {
2385
+ const { id: r, selector: i } = e, n = be(), s = r || n.annotationPage, o = Q(
2386
+ (a) => s ? a.iiif.entities.AnnotationPage[s] : void 0,
2387
2387
  [s]
2388
2388
  );
2389
2389
  return E(() => {
2390
- if (a)
2391
- return i ? i(a) : a;
2392
- }, [a, ...t]);
2390
+ if (o)
2391
+ return i ? i(o) : o;
2392
+ }, [o, ...t]);
2393
2393
  }
2394
2394
  const It = ({
2395
2395
  className: e,
2396
2396
  page: t
2397
2397
  }) => {
2398
2398
  var s;
2399
- const r = Ma({ id: t.id }) || t, i = et(r, "atlas"), n = et(r, "html");
2400
- return Q((a) => r.id ? a.iiif.entities.AnnotationPage[r.id] : null, []), /* @__PURE__ */ x(Ke, { children: (s = r.items) == null ? void 0 : s.map((a) => /* @__PURE__ */ x(
2401
- ai,
2399
+ const r = Io({ id: t.id }) || t, i = et(r, "atlas"), n = et(r, "html");
2400
+ return Q((o) => r.id ? o.iiif.entities.AnnotationPage[r.id] : null, []), /* @__PURE__ */ x(Ke, { children: (s = r.items) == null ? void 0 : s.map((o) => /* @__PURE__ */ x(
2401
+ oi,
2402
2402
  {
2403
- id: a.id,
2403
+ id: o.id,
2404
2404
  style: i,
2405
2405
  className: (n == null ? void 0 : n.className) || e
2406
2406
  },
2407
- a.id
2407
+ o.id
2408
2408
  )) });
2409
2409
  };
2410
- function oi({
2410
+ function ai({
2411
2411
  id: e,
2412
2412
  image: t,
2413
2413
  thumbnail: r,
2414
2414
  isStatic: i,
2415
2415
  x: n = 0,
2416
2416
  y: s = 0,
2417
- children: a,
2418
- selector: o,
2417
+ children: o,
2418
+ selector: a,
2419
2419
  onClick: u,
2420
2420
  enableSizes: d
2421
2421
  }) {
2422
2422
  var p, v;
2423
2423
  const l = E(() => {
2424
- if (!(!o || o.spatial.x === 0 && o.spatial.y === 0))
2425
- return o.spatial;
2426
- }, [o]);
2424
+ if (!(!a || a.spatial.x === 0 && a.spatial.y === 0))
2425
+ return a.spatial;
2426
+ }, [a]);
2427
2427
  return /* @__PURE__ */ x(
2428
2428
  "world-object",
2429
2429
  {
@@ -2434,7 +2434,7 @@ function oi({
2434
2434
  onClick: u,
2435
2435
  children: t.service ? /* @__PURE__ */ N(Ke, { children: [
2436
2436
  /* @__PURE__ */ x(
2437
- pn,
2437
+ dn,
2438
2438
  {
2439
2439
  tiles: {
2440
2440
  id: t.service.id || t.service["@id"] || "unknown",
@@ -2451,7 +2451,7 @@ function oi({
2451
2451
  crop: l
2452
2452
  }
2453
2453
  ),
2454
- a
2454
+ o
2455
2455
  ] }, "service") : /* @__PURE__ */ N(Ke, { children: [
2456
2456
  /* @__PURE__ */ x(
2457
2457
  "world-image",
@@ -2466,26 +2466,26 @@ function oi({
2466
2466
  crop: l
2467
2467
  }
2468
2468
  ),
2469
- a
2469
+ o
2470
2470
  ] }, "no-service")
2471
2471
  },
2472
2472
  e + (t.service ? "server" : "no-service")
2473
2473
  );
2474
2474
  }
2475
- var Ra = Object.defineProperty, Ia = (e, t, r) => t in e ? Ra(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ge = (e, t, r) => (Ia(e, typeof t != "symbol" ? t + "" : t, r), r), Ta = /* @__PURE__ */ function() {
2475
+ var To = Object.defineProperty, ko = (e, t, r) => t in e ? To(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, Ge = (e, t, r) => (ko(e, typeof t != "symbol" ? t + "" : t, r), r), Oo = /* @__PURE__ */ function() {
2476
2476
  function e(t, r) {
2477
- var i = [], n = !0, s = !1, a = void 0;
2477
+ var i = [], n = !0, s = !1, o = void 0;
2478
2478
  try {
2479
- for (var o = t[Symbol.iterator](), u; !(n = (u = o.next()).done) && (i.push(u.value), !(r && i.length === r)); n = !0)
2479
+ for (var a = t[Symbol.iterator](), u; !(n = (u = a.next()).done) && (i.push(u.value), !(r && i.length === r)); n = !0)
2480
2480
  ;
2481
2481
  } catch (d) {
2482
- s = !0, a = d;
2482
+ s = !0, o = d;
2483
2483
  } finally {
2484
2484
  try {
2485
- !n && o.return && o.return();
2485
+ !n && a.return && a.return();
2486
2486
  } finally {
2487
2487
  if (s)
2488
- throw a;
2488
+ throw o;
2489
2489
  }
2490
2490
  }
2491
2491
  return i;
@@ -2497,64 +2497,64 @@ var Ra = Object.defineProperty, Ia = (e, t, r) => t in e ? Ra(e, t, { enumerable
2497
2497
  return e(t, r);
2498
2498
  throw new TypeError("Invalid attempt to destructure non-iterable instance");
2499
2499
  };
2500
- }(), qe = Math.PI * 2, yt = function(e, t, r, i, n, s, a) {
2501
- var o = e.x, u = e.y;
2502
- o *= t, u *= r;
2503
- var d = i * o - n * u, l = n * o + i * u;
2500
+ }(), qe = Math.PI * 2, yt = function(e, t, r, i, n, s, o) {
2501
+ var a = e.x, u = e.y;
2502
+ a *= t, u *= r;
2503
+ var d = i * a - n * u, l = n * a + i * u;
2504
2504
  return {
2505
2505
  x: d + s,
2506
- y: l + a
2506
+ y: l + o
2507
2507
  };
2508
- }, ka = function(e, t) {
2509
- var r = t === 1.5707963267948966 ? 0.551915024494 : t === -1.5707963267948966 ? -0.551915024494 : 1.3333333333333333 * Math.tan(t / 4), i = Math.cos(e), n = Math.sin(e), s = Math.cos(e + t), a = Math.sin(e + t);
2508
+ }, Eo = function(e, t) {
2509
+ var r = t === 1.5707963267948966 ? 0.551915024494 : t === -1.5707963267948966 ? -0.551915024494 : 1.3333333333333333 * Math.tan(t / 4), i = Math.cos(e), n = Math.sin(e), s = Math.cos(e + t), o = Math.sin(e + t);
2510
2510
  return [{
2511
2511
  x: i - n * r,
2512
2512
  y: n + i * r
2513
2513
  }, {
2514
- x: s + a * r,
2515
- y: a - s * r
2514
+ x: s + o * r,
2515
+ y: o - s * r
2516
2516
  }, {
2517
2517
  x: s,
2518
- y: a
2518
+ y: o
2519
2519
  }];
2520
- }, ar = function(e, t, r, i) {
2520
+ }, or = function(e, t, r, i) {
2521
2521
  var n = e * i - t * r < 0 ? -1 : 1, s = e * r + t * i;
2522
2522
  return s > 1 && (s = 1), s < -1 && (s = -1), n * Math.acos(s);
2523
- }, Oa = function(e, t, r, i, n, s, a, o, u, d, l, p) {
2523
+ }, Po = function(e, t, r, i, n, s, o, a, u, d, l, p) {
2524
2524
  var v = Math.pow(n, 2), m = Math.pow(s, 2), h = Math.pow(l, 2), g = Math.pow(p, 2), b = v * m - v * g - m * h;
2525
- b < 0 && (b = 0), b /= v * g + m * h, b = Math.sqrt(b) * (a === o ? -1 : 1);
2526
- var A = b * n / s * p, w = b * -s / n * l, C = d * A - u * w + (e + r) / 2, T = u * A + d * w + (t + i) / 2, j = (l - A) / n, I = (p - w) / s, L = (-l - A) / n, P = (-p - w) / s, M = ar(1, 0, j, I), $ = ar(j, I, L, P);
2527
- return o === 0 && $ > 0 && ($ -= qe), o === 1 && $ < 0 && ($ += qe), [C, T, M, $];
2528
- }, Ea = function(e) {
2529
- var t = e.px, r = e.py, i = e.cx, n = e.cy, s = e.rx, a = e.ry, o = e.xAxisRotation, u = o === void 0 ? 0 : o, d = e.largeArcFlag, l = d === void 0 ? 0 : d, p = e.sweepFlag, v = p === void 0 ? 0 : p, m = [];
2530
- if (s === 0 || a === 0)
2525
+ b < 0 && (b = 0), b /= v * g + m * h, b = Math.sqrt(b) * (o === a ? -1 : 1);
2526
+ var A = b * n / s * p, w = b * -s / n * l, C = d * A - u * w + (e + r) / 2, T = u * A + d * w + (t + i) / 2, j = (l - A) / n, I = (p - w) / s, L = (-l - A) / n, P = (-p - w) / s, M = or(1, 0, j, I), $ = or(j, I, L, P);
2527
+ return a === 0 && $ > 0 && ($ -= qe), a === 1 && $ < 0 && ($ += qe), [C, T, M, $];
2528
+ }, Lo = function(e) {
2529
+ var t = e.px, r = e.py, i = e.cx, n = e.cy, s = e.rx, o = e.ry, a = e.xAxisRotation, u = a === void 0 ? 0 : a, d = e.largeArcFlag, l = d === void 0 ? 0 : d, p = e.sweepFlag, v = p === void 0 ? 0 : p, m = [];
2530
+ if (s === 0 || o === 0)
2531
2531
  return [];
2532
2532
  var h = Math.sin(u * qe / 360), g = Math.cos(u * qe / 360), b = g * (t - i) / 2 + h * (r - n) / 2, A = -h * (t - i) / 2 + g * (r - n) / 2;
2533
2533
  if (b === 0 && A === 0)
2534
2534
  return [];
2535
- s = Math.abs(s), a = Math.abs(a);
2536
- var w = Math.pow(b, 2) / Math.pow(s, 2) + Math.pow(A, 2) / Math.pow(a, 2);
2537
- w > 1 && (s *= Math.sqrt(w), a *= Math.sqrt(w));
2538
- var C = Oa(t, r, i, n, s, a, l, v, h, g, b, A), T = Ta(C, 4), j = T[0], I = T[1], L = T[2], P = T[3], M = Math.abs(P) / (qe / 4);
2535
+ s = Math.abs(s), o = Math.abs(o);
2536
+ var w = Math.pow(b, 2) / Math.pow(s, 2) + Math.pow(A, 2) / Math.pow(o, 2);
2537
+ w > 1 && (s *= Math.sqrt(w), o *= Math.sqrt(w));
2538
+ var C = Po(t, r, i, n, s, o, l, v, h, g, b, A), T = Oo(C, 4), j = T[0], I = T[1], L = T[2], P = T[3], M = Math.abs(P) / (qe / 4);
2539
2539
  Math.abs(1 - M) < 1e-7 && (M = 1);
2540
2540
  var $ = Math.max(Math.ceil(M), 1);
2541
2541
  P /= $;
2542
2542
  for (var ie = 0; ie < $; ie++)
2543
- m.push(ka(L, P)), L += P;
2543
+ m.push(Eo(L, P)), L += P;
2544
2544
  return m.map(function(Z) {
2545
- var U = yt(Z[0], s, a, g, h, j, I), z = U.x, ee = U.y, ne = yt(Z[1], s, a, g, h, j, I), xe = ne.x, O = ne.y, W = yt(Z[2], s, a, g, h, j, I), X = W.x, de = W.y;
2545
+ var U = yt(Z[0], s, o, g, h, j, I), z = U.x, ee = U.y, ne = yt(Z[1], s, o, g, h, j, I), xe = ne.x, O = ne.y, W = yt(Z[2], s, o, g, h, j, I), X = W.x, de = W.y;
2546
2546
  return { x1: z, y1: ee, x2: xe, y2: O, x: X, y: de };
2547
2547
  });
2548
- }, Pa = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2548
+ }, Fo = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2549
2549
  function ci(e) {
2550
2550
  return e && e.__esModule && Object.prototype.hasOwnProperty.call(e, "default") ? e.default : e;
2551
2551
  }
2552
- var La = ja, vt = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, Fa = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
2553
- function ja(e) {
2552
+ var jo = Do, vt = { a: 7, c: 6, h: 1, l: 2, m: 2, q: 4, s: 4, t: 2, v: 1, z: 0 }, $o = /([astvzqmhlc])([^astvzqmhlc]*)/ig;
2553
+ function Do(e) {
2554
2554
  var t = [];
2555
- return e.replace(Fa, function(r, i, n) {
2555
+ return e.replace($o, function(r, i, n) {
2556
2556
  var s = i.toLowerCase();
2557
- for (n = Da(n), s == "m" && n.length > 2 && (t.push([i].concat(n.splice(0, 2))), s = "l", i = i == "m" ? "l" : "L"); ; ) {
2557
+ for (n = _o(n), s == "m" && n.length > 2 && (t.push([i].concat(n.splice(0, 2))), s = "l", i = i == "m" ? "l" : "L"); ; ) {
2558
2558
  if (n.length == vt[s])
2559
2559
  return n.unshift(i), t.push(n);
2560
2560
  if (n.length < vt[s])
@@ -2563,20 +2563,20 @@ function ja(e) {
2563
2563
  }
2564
2564
  }), t;
2565
2565
  }
2566
- var $a = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
2567
- function Da(e) {
2568
- var t = e.match($a);
2566
+ var qo = /-?[0-9]*\.?[0-9]+(?:e[-+]?\d+)?/ig;
2567
+ function _o(e) {
2568
+ var t = e.match(qo);
2569
2569
  return t ? t.map(Number) : [];
2570
2570
  }
2571
- const qa = /* @__PURE__ */ ci(La);
2572
- var _a = Ua;
2573
- function Ua(e) {
2571
+ const Uo = /* @__PURE__ */ ci(jo);
2572
+ var Vo = No;
2573
+ function No(e) {
2574
2574
  var t = 0, r = 0, i = 0, n = 0;
2575
2575
  return e.map(function(s) {
2576
2576
  s = s.slice();
2577
- var a = s[0], o = a.toUpperCase();
2578
- if (a != o)
2579
- switch (s[0] = o, a) {
2577
+ var o = s[0], a = o.toUpperCase();
2578
+ if (o != a)
2579
+ switch (s[0] = a, o) {
2580
2580
  case "a":
2581
2581
  s[6] += i, s[7] += n;
2582
2582
  break;
@@ -2590,7 +2590,7 @@ function Ua(e) {
2590
2590
  for (var u = 1; u < s.length; )
2591
2591
  s[u++] += i, s[u++] += n;
2592
2592
  }
2593
- switch (o) {
2593
+ switch (a) {
2594
2594
  case "Z":
2595
2595
  i = t, n = r;
2596
2596
  break;
@@ -2609,10 +2609,10 @@ function Ua(e) {
2609
2609
  return s;
2610
2610
  });
2611
2611
  }
2612
- const Va = /* @__PURE__ */ ci(_a);
2613
- function Na(e) {
2614
- const t = qa(e), r = Va(t);
2615
- let i, n = 0, s = 0, a = 0, o = 0, u, d, l = 0, p = 0;
2612
+ const Ho = /* @__PURE__ */ ci(Vo);
2613
+ function Bo(e) {
2614
+ const t = Uo(e), r = Ho(t);
2615
+ let i, n = 0, s = 0, o = 0, a = 0, u, d, l = 0, p = 0;
2616
2616
  const v = [];
2617
2617
  for (let m = 0; m < r.length; m++) {
2618
2618
  let h = r[m];
@@ -2630,7 +2630,7 @@ function Na(e) {
2630
2630
  case "S":
2631
2631
  {
2632
2632
  let b = l, A = p;
2633
- (i === "C" || i == "S") && (b += b - a, A += A - o), h = ["C", b, A, h[1], h[2], h[3], h[4]];
2633
+ (i === "C" || i == "S") && (b += b - o, A += A - a), h = ["C", b, A, h[1], h[2], h[3], h[4]];
2634
2634
  }
2635
2635
  break;
2636
2636
  case "T":
@@ -2641,7 +2641,7 @@ function Na(e) {
2641
2641
  break;
2642
2642
  case "A":
2643
2643
  {
2644
- const b = Ea({
2644
+ const b = Lo({
2645
2645
  px: l,
2646
2646
  py: p,
2647
2647
  cx: h[6],
@@ -2663,7 +2663,7 @@ function Na(e) {
2663
2663
  h = ["L", n, s];
2664
2664
  break;
2665
2665
  }
2666
- i = g, l = h[h.length - 2], p = h[h.length - 1], ["C", "Q", "A"].indexOf(g) > -1 ? (a = h[h.length - 4], o = h[h.length - 3]) : (a = l, o = p), v.push(h);
2666
+ i = g, l = h[h.length - 2], p = h[h.length - 1], ["C", "Q", "A"].indexOf(g) > -1 ? (o = h[h.length - 4], a = h[h.length - 3]) : (o = l, a = p), v.push(h);
2667
2667
  }
2668
2668
  return v;
2669
2669
  }
@@ -2698,15 +2698,15 @@ function Na(e) {
2698
2698
  * See the License for the specific language governing permissions and
2699
2699
  * limitations under the License.
2700
2700
  */
2701
- function Ha(e, t, r, i = 1) {
2701
+ function zo(e, t, r, i = 1) {
2702
2702
  return new ui(e, t, r).subdivide(i);
2703
2703
  }
2704
- function Ba(e, t, r, i, n = 1) {
2704
+ function Wo(e, t, r, i, n = 1) {
2705
2705
  return new Dt(
2706
2706
  new Float64Array([e.x, e.y, t.x, t.y, r.x, r.y, i.x, i.y])
2707
2707
  ).subdivide(n);
2708
2708
  }
2709
- function za(e) {
2709
+ function Qo(e) {
2710
2710
  return e.x * e.x + e.y * e.y;
2711
2711
  }
2712
2712
  function _e(e) {
@@ -2727,13 +2727,13 @@ class ui {
2727
2727
  };
2728
2728
  }
2729
2729
  mapToBasic() {
2730
- const { x: t, y: r } = this.start, { x: i, y: n } = this.control, { x: s, y: a } = this.end, o = 2 * i - t - s, u = 2 * n - r - a, d = (i - t) * o + (n - r) * u, l = (s - i) * o + (a - n) * u, p = (s - t) * u - (a - r) * o, v = d / p, m = l / p, h = Math.abs(p) / (Math.hypot(o, u) * Math.abs(m - v));
2730
+ const { x: t, y: r } = this.start, { x: i, y: n } = this.control, { x: s, y: o } = this.end, a = 2 * i - t - s, u = 2 * n - r - o, d = (i - t) * a + (n - r) * u, l = (s - i) * a + (o - n) * u, p = (s - t) * u - (o - r) * a, v = d / p, m = l / p, h = Math.abs(p) / (Math.hypot(a, u) * Math.abs(m - v));
2731
2731
  return { x0: t, x2: s, scale: h, cross: p };
2732
2732
  }
2733
2733
  subdivide(t) {
2734
- const r = this.mapToBasic(), i = _e(r.x0), n = _e(r.x2), s = 0.5 * Math.abs(n - i) * Math.sqrt(r.scale / t), a = Math.ceil(s), o = Pe(i), u = Pe(n), d = [0];
2735
- for (let l = 1; l < a; l++) {
2736
- const p = (Pe(i + (n - i) * l / a) - o) / (u - o);
2734
+ const r = this.mapToBasic(), i = _e(r.x0), n = _e(r.x2), s = 0.5 * Math.abs(n - i) * Math.sqrt(r.scale / t), o = Math.ceil(s), a = Pe(i), u = Pe(n), d = [0];
2735
+ for (let l = 1; l < o; l++) {
2736
+ const p = (Pe(i + (n - i) * l / o) - a) / (u - a);
2737
2737
  d.push(p);
2738
2738
  }
2739
2739
  return d.push(1), d.map((l) => this.eval(l));
@@ -2745,16 +2745,16 @@ class Dt {
2745
2745
  Ge(this, "c"), this.c = t;
2746
2746
  }
2747
2747
  weightsum(t, r, i, n) {
2748
- const s = t * this.c[0] + r * this.c[2] + i * this.c[4] + n * this.c[6], a = t * this.c[1] + r * this.c[3] + i * this.c[5] + n * this.c[7];
2749
- return { x: s, y: a };
2748
+ const s = t * this.c[0] + r * this.c[2] + i * this.c[4] + n * this.c[6], o = t * this.c[1] + r * this.c[3] + i * this.c[5] + n * this.c[7];
2749
+ return { x: s, y: o };
2750
2750
  }
2751
2751
  eval(t) {
2752
- const r = 1 - t, i = r * r * r, n = 3 * r * r * t, s = 3 * r * t * t, a = t * t * t;
2753
- return this.weightsum(i, n, s, a);
2752
+ const r = 1 - t, i = r * r * r, n = 3 * r * r * t, s = 3 * r * t * t, o = t * t * t;
2753
+ return this.weightsum(i, n, s, o);
2754
2754
  }
2755
2755
  deriv(t) {
2756
- const r = 1 - t, i = -3 * r * r, n = 3 * t * t, s = -6 * t * r - i, a = 6 * t * r - n;
2757
- return this.weightsum(i, s, a, n);
2756
+ const r = 1 - t, i = -3 * r * r, n = 3 * t * t, s = -6 * t * r - i, o = 6 * t * r - n;
2757
+ return this.weightsum(i, s, o, n);
2758
2758
  }
2759
2759
  // quadratic bezier with matching endpoints and minimum max vector error
2760
2760
  midpoint_quadbez() {
@@ -2764,23 +2764,23 @@ class Dt {
2764
2764
  subsegment(t, r) {
2765
2765
  const i = new Float64Array(8), n = this.eval(t), s = this.eval(r);
2766
2766
  i[0] = n.x, i[1] = n.y;
2767
- const a = (r - t) / 3, o = this.deriv(t);
2768
- i[2] = n.x + a * o.x, i[3] = n.y + a * o.y;
2767
+ const o = (r - t) / 3, a = this.deriv(t);
2768
+ i[2] = n.x + o * a.x, i[3] = n.y + o * a.y;
2769
2769
  const u = this.deriv(r);
2770
- return i[4] = s.x - a * u.x, i[5] = s.y - a * u.y, i[6] = s.x, i[7] = s.y, new Dt(i);
2770
+ return i[4] = s.x - o * u.x, i[5] = s.y - o * u.y, i[6] = s.x, i[7] = s.y, new Dt(i);
2771
2771
  }
2772
2772
  // Very fancy subdivision scheme
2773
2773
  subdivide(t) {
2774
- const r = 0.1 * t, i = t - r, n = Math.sqrt(i), s = za(this.weightsum(1, -3, 3, -1)), a = Math.ceil(Math.pow(s / (432 * r * r), 1 / 6)), o = [];
2774
+ const r = 0.1 * t, i = t - r, n = Math.sqrt(i), s = Qo(this.weightsum(1, -3, 3, -1)), o = Math.ceil(Math.pow(s / (432 * r * r), 1 / 6)), a = [];
2775
2775
  let u = 0;
2776
- for (let h = 0; h < a; h++) {
2777
- const g = h / a, b = (h + 1) / a, A = this.subsegment(g, b).midpoint_quadbez(), w = A.mapToBasic(), C = _e(w.x0), T = _e(w.x2), j = Math.sqrt(w.scale);
2776
+ for (let h = 0; h < o; h++) {
2777
+ const g = h / o, b = (h + 1) / o, A = this.subsegment(g, b).midpoint_quadbez(), w = A.mapToBasic(), C = _e(w.x0), T = _e(w.x2), j = Math.sqrt(w.scale);
2778
2778
  let I = Math.abs(T - C) * j;
2779
2779
  if (Math.sign(w.x0) != Math.sign(w.x2)) {
2780
2780
  const L = n / j, P = n * Math.abs(T - C) / _e(L);
2781
2781
  I = Math.max(I, P);
2782
2782
  }
2783
- o.push({
2783
+ a.push({
2784
2784
  quad: A,
2785
2785
  a0: C,
2786
2786
  a2: T,
@@ -2791,15 +2791,15 @@ class Dt {
2791
2791
  let v = 0, m = 0;
2792
2792
  for (let h = 1; h < l; h++) {
2793
2793
  const g = u * h / l;
2794
- for (; v + o[m].val < g; )
2795
- v += o[m].val, m++;
2796
- const b = o[m].a0, A = o[m].a2, w = Pe(b), C = Pe(A), T = b + (A - b) * (g - v) / o[m].val, j = (Pe(T) - w) / (C - w);
2797
- p.push(o[m].quad.eval(j));
2794
+ for (; v + a[m].val < g; )
2795
+ v += a[m].val, m++;
2796
+ const b = a[m].a0, A = a[m].a2, w = Pe(b), C = Pe(A), T = b + (A - b) * (g - v) / a[m].val, j = (Pe(T) - w) / (C - w);
2797
+ p.push(a[m].quad.eval(j));
2798
2798
  }
2799
2799
  return p.push({ x: this.c[6], y: this.c[7] }), p;
2800
2800
  }
2801
2801
  }
2802
- const Wa = /&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/, Qa = /&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/, or = /^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;
2802
+ const Yo = /&?(xywh=)?(pixel:|percent:|pct:)?([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?),([0-9]+(?:\.[0-9]+)?)/, Go = /&?(t=)(npt:)?([0-9]+(.[0-9]+)?)?(,([0-9]+(.[0-9]+)?))?/, ar = /^rgba\((\d+),(\d+),(\d+),([0-9.]+)\)$/;
2803
2803
  function Je(e, {
2804
2804
  domParser: t,
2805
2805
  svgPreprocessor: r,
@@ -2810,11 +2810,11 @@ function Je(e, {
2810
2810
  e.reduce(
2811
2811
  (n, s) => {
2812
2812
  const {
2813
- selector: a,
2814
- selectors: o,
2813
+ selector: o,
2814
+ selectors: a,
2815
2815
  iiifRenderingHints: u
2816
2816
  } = Je(s, { domParser: t, svgPreprocessor: r, iiifRenderingHints: i });
2817
- return a && (n.selector || (n.selector = a), n.selectors.push(...o)), u && (n.iiifRenderingHints = n.iiifRenderingHints || { type: "ImageApiSelector" }, Object.assign(n.iiifRenderingHints, u)), n;
2817
+ return o && (n.selector || (n.selector = o), n.selectors.push(...a)), u && (n.iiifRenderingHints = n.iiifRenderingHints || { type: "ImageApiSelector" }, Object.assign(n.iiifRenderingHints, u)), n;
2818
2818
  },
2819
2819
  {
2820
2820
  selector: null,
@@ -2853,7 +2853,7 @@ function Je(e, {
2853
2853
  iiifRenderingHints: i
2854
2854
  });
2855
2855
  }
2856
- if (Ka(e)) {
2856
+ if (Xo(e)) {
2857
2857
  const n = [];
2858
2858
  if (e.region) {
2859
2859
  const s = Je(
@@ -2869,9 +2869,9 @@ function Je(e, {
2869
2869
  });
2870
2870
  }
2871
2871
  if (e.type === "FragmentSelector") {
2872
- const n = Wa.exec(e.value);
2872
+ const n = Yo.exec(e.value);
2873
2873
  if (n) {
2874
- const a = {
2874
+ const o = {
2875
2875
  type: "BoxSelector",
2876
2876
  spatial: {
2877
2877
  unit: n[2] === "percent:" || n[2] === "pct:" ? "percent" : "pixel",
@@ -2882,14 +2882,14 @@ function Je(e, {
2882
2882
  }
2883
2883
  };
2884
2884
  return re({
2885
- selector: a,
2886
- selectors: [a],
2885
+ selector: o,
2886
+ selectors: [o],
2887
2887
  iiifRenderingHints: i
2888
2888
  });
2889
2889
  }
2890
- const s = e.value.match(Qa);
2890
+ const s = e.value.match(Go);
2891
2891
  if (s) {
2892
- const a = {
2892
+ const o = {
2893
2893
  type: "TemporalSelector",
2894
2894
  temporal: {
2895
2895
  startTime: s[4] ? parseFloat(s[4]) : 0,
@@ -2897,8 +2897,8 @@ function Je(e, {
2897
2897
  }
2898
2898
  };
2899
2899
  return re({
2900
- selector: a,
2901
- selectors: [a],
2900
+ selector: o,
2901
+ selectors: [o],
2902
2902
  iiifRenderingHints: i
2903
2903
  });
2904
2904
  }
@@ -2912,7 +2912,7 @@ function Je(e, {
2912
2912
  t || (typeof window < "u" ? t = new window.DOMParser() : console.warn(
2913
2913
  "No DOMParser available, cannot parse SVG selector, `points`, `spatial` and `style` will be unavailable and the SVG will not be normalized."
2914
2914
  ));
2915
- let n = [], s, a, o = (r == null ? void 0 : r(e.value)) ?? e.value, u;
2915
+ let n = [], s, o, a = (r == null ? void 0 : r(e.value)) ?? e.value, u;
2916
2916
  if (t) {
2917
2917
  const l = t.parseFromString(e.value, "image/svg+xml").querySelector("svg");
2918
2918
  if (!l)
@@ -2931,13 +2931,13 @@ function Je(e, {
2931
2931
  // urx
2932
2932
  Math.max(...n.map((v) => v[1]))
2933
2933
  // ury
2934
- ], { style: a, svg: o } = Ja(p.element) ?? { svg: o });
2934
+ ], { style: o, svg: a } = Zo(p.element) ?? { svg: a });
2935
2935
  }
2936
2936
  const d = {
2937
2937
  type: "SvgSelector",
2938
- svg: o,
2938
+ svg: a,
2939
2939
  svgShape: u,
2940
- style: a,
2940
+ style: o,
2941
2941
  points: n.length ? n : void 0,
2942
2942
  spatial: s ? { unit: "pixel", x: s[0], y: s[1], width: s[2] - s[0], height: s[3] - s[1] } : void 0
2943
2943
  };
@@ -2953,7 +2953,7 @@ function Je(e, {
2953
2953
  iiifRenderingHints: i
2954
2954
  });
2955
2955
  }
2956
- function Ya(e) {
2956
+ function Jo(e) {
2957
2957
  const t = e.map((i) => i[0]).reduce(
2958
2958
  (i, n) => (i[n] += 1, i),
2959
2959
  { C: 0, Q: 0, L: 0, M: 0 }
@@ -2983,40 +2983,40 @@ function li(e) {
2983
2983
  const i = r.getAttribute("d");
2984
2984
  if (!i)
2985
2985
  continue;
2986
- const n = Na(i);
2987
- return { element: r, points: Ga(n), shapeType: Ya(n) };
2986
+ const n = Bo(i);
2987
+ return { element: r, points: Ko(n), shapeType: Jo(n) };
2988
2988
  }
2989
2989
  case "circle": {
2990
2990
  const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("r") ?? "0");
2991
2991
  if (!s)
2992
2992
  continue;
2993
- const a = [];
2994
- for (let o = 0; o <= 360; o += 12) {
2995
- const u = o * Math.PI / 180;
2996
- a.push([i + s * Math.cos(u), n + s * Math.sin(u)]);
2993
+ const o = [];
2994
+ for (let a = 0; a <= 360; a += 12) {
2995
+ const u = a * Math.PI / 180;
2996
+ o.push([i + s * Math.cos(u), n + s * Math.sin(u)]);
2997
2997
  }
2998
- return { element: r, points: a, shapeType: "circle" };
2998
+ return { element: r, points: o, shapeType: "circle" };
2999
2999
  }
3000
3000
  case "ellipse": {
3001
- const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("rx") ?? "0"), a = parseFloat(r.getAttribute("ry") ?? "0");
3002
- if (!s && !a)
3001
+ const i = parseFloat(r.getAttribute("cx") ?? "0"), n = parseFloat(r.getAttribute("cy") ?? "0"), s = parseFloat(r.getAttribute("rx") ?? "0"), o = parseFloat(r.getAttribute("ry") ?? "0");
3002
+ if (!s && !o)
3003
3003
  continue;
3004
- const o = [];
3004
+ const a = [];
3005
3005
  for (let u = 0; u <= 360; u += 12) {
3006
- const d = Math.tan(u / 360 * Math.PI), l = s * (1 - d ** 2) / (1 + d ** 2), p = a * 2 * d / (1 + d ** 2);
3007
- o.push([i + l, n + p]);
3006
+ const d = Math.tan(u / 360 * Math.PI), l = s * (1 - d ** 2) / (1 + d ** 2), p = o * 2 * d / (1 + d ** 2);
3007
+ a.push([i + l, n + p]);
3008
3008
  }
3009
- return { element: r, points: o, shapeType: "ellipse" };
3009
+ return { element: r, points: a, shapeType: "ellipse" };
3010
3010
  }
3011
3011
  case "line": {
3012
- const i = parseFloat(r.getAttribute("x0") ?? "0"), n = parseFloat(r.getAttribute("y0") ?? "0"), s = parseFloat(r.getAttribute("x1") ?? "0"), a = parseFloat(r.getAttribute("y1") ?? "0");
3013
- if (i === s && n === a)
3012
+ const i = parseFloat(r.getAttribute("x0") ?? "0"), n = parseFloat(r.getAttribute("y0") ?? "0"), s = parseFloat(r.getAttribute("x1") ?? "0"), o = parseFloat(r.getAttribute("y1") ?? "0");
3013
+ if (i === s && n === o)
3014
3014
  continue;
3015
3015
  return {
3016
3016
  element: r,
3017
3017
  points: [
3018
3018
  [i, n],
3019
- [s, a]
3019
+ [s, o]
3020
3020
  ],
3021
3021
  shapeType: "polyline"
3022
3022
  };
@@ -3030,16 +3030,16 @@ function li(e) {
3030
3030
  return r.tagName.toLowerCase() === "polygon" && (i.push(i[0]), n = "polygon"), { element: r, points: i, shapeType: n };
3031
3031
  }
3032
3032
  case "rect": {
3033
- const i = parseFloat(r.getAttribute("x") ?? "0"), n = parseFloat(r.getAttribute("y") ?? "0"), s = parseFloat(r.getAttribute("width") ?? "0"), a = parseFloat(r.getAttribute("height") ?? "0");
3034
- if (!s || !a)
3033
+ const i = parseFloat(r.getAttribute("x") ?? "0"), n = parseFloat(r.getAttribute("y") ?? "0"), s = parseFloat(r.getAttribute("width") ?? "0"), o = parseFloat(r.getAttribute("height") ?? "0");
3034
+ if (!s || !o)
3035
3035
  continue;
3036
3036
  return {
3037
3037
  element: r,
3038
3038
  points: [
3039
3039
  [i, n],
3040
3040
  [i + s, n],
3041
- [i + s, n + a],
3042
- [i, n + a],
3041
+ [i + s, n + o],
3042
+ [i, n + o],
3043
3043
  [i, n]
3044
3044
  ],
3045
3045
  shapeType: "rect"
@@ -3050,7 +3050,7 @@ function li(e) {
3050
3050
  }
3051
3051
  return null;
3052
3052
  }
3053
- function Ga(e) {
3053
+ function Ko(e) {
3054
3054
  const t = [];
3055
3055
  for (let r = 0; r < e.length; r++) {
3056
3056
  const i = t[t.length - 1] ?? [0, 0], n = e[r];
@@ -3061,7 +3061,7 @@ function Ga(e) {
3061
3061
  continue;
3062
3062
  case "C":
3063
3063
  t.push(
3064
- ...Ba(
3064
+ ...Wo(
3065
3065
  { x: i[0], y: i[1] },
3066
3066
  { x: n[1], y: n[2] },
3067
3067
  { x: n[3], y: n[4] },
@@ -3072,7 +3072,7 @@ function Ga(e) {
3072
3072
  continue;
3073
3073
  case "Q":
3074
3074
  t.push(
3075
- ...Ha(
3075
+ ...zo(
3076
3076
  { x: i[0], y: i[1] },
3077
3077
  { x: n[1], y: n[2] },
3078
3078
  { x: n[3], y: n[4] }
@@ -3084,14 +3084,14 @@ function Ga(e) {
3084
3084
  }
3085
3085
  return t;
3086
3086
  }
3087
- function Ja(e) {
3087
+ function Zo(e) {
3088
3088
  const t = {};
3089
3089
  if (e.hasAttribute("fill") ? (t.fill = e.getAttribute("fill"), e.removeAttribute("fill")) : e.style.fill && (t.fill = e.style.fill), t.fill) {
3090
- const i = or.exec(t.fill);
3090
+ const i = ar.exec(t.fill);
3091
3091
  i && (t.fillOpacity = parseFloat(i[4]), t.fill = `rgb(${i[1]}, ${i[2]}, ${i[3]})`);
3092
3092
  }
3093
3093
  if (e.hasAttribute("fill-opacity") ? (t.fillOpacity = parseFloat(e.getAttribute("fill-opacity")), e.removeAttribute("fill-opacity")) : e.style.fillOpacity && (t.fillOpacity = parseFloat(e.style.fillOpacity)), e.hasAttribute("stroke") ? (t.stroke = e.getAttribute("stroke"), e.removeAttribute("stroke")) : e.style.stroke && (t.stroke = e.style.stroke), t.stroke) {
3094
- const i = or.exec(t.stroke);
3094
+ const i = ar.exec(t.stroke);
3095
3095
  i && (t.strokeOpacity = parseFloat(i[4]), t.stroke = `rgb(${i[1]}, ${i[2]}, ${i[3]})`);
3096
3096
  }
3097
3097
  e.hasAttribute("stroke-opacity") ? (t.strokeOpacity = parseFloat(e.getAttribute("stroke-opacity")), e.removeAttribute("stroke-opacity")) : e.style.strokeOpacity && (t.strokeOpacity = parseFloat(e.style.strokeOpacity)), e.hasAttribute("stroke-width") ? (t.strokeWidth = e.getAttribute("stroke-width"), e.removeAttribute("stroke-width")) : e.style.strokeWidth && (t.strokeWidth = e.style.strokeWidth), e.hasAttribute("stroke-dasharray") ? (t.strokeDasharray = e.getAttribute("stroke-dasharray"), e.removeAttribute("stroke-dasharray")) : e.style.strokeDasharray && (t.strokeDasharray = e.style.strokeDasharray);
@@ -3101,14 +3101,14 @@ function Ja(e) {
3101
3101
  throw new Error("Could not find root SVG element");
3102
3102
  return { svg: r.outerHTML, style: Object.keys(t).length > 0 ? t : void 0 };
3103
3103
  }
3104
- function Ka(e) {
3104
+ function Xo(e) {
3105
3105
  return !!e && e.type === "iiif:ImageApiSelector" && e.type === "iiif:ImageApiSelector";
3106
3106
  }
3107
3107
  function re(e) {
3108
3108
  if (e.iiifRenderingHints) {
3109
3109
  const t = e.iiifRenderingHints;
3110
3110
  if (t.rotation) {
3111
- const r = Za(t.rotation);
3111
+ const r = ea(t.rotation);
3112
3112
  if (r)
3113
3113
  if (e.selectors.length)
3114
3114
  for (const i of e.selectors)
@@ -3123,7 +3123,7 @@ function re(e) {
3123
3123
  delete e.iiifRenderingHints;
3124
3124
  return e;
3125
3125
  }
3126
- function Za(e) {
3126
+ function ea(e) {
3127
3127
  let t = parseFloat(e);
3128
3128
  return t && e.startsWith("!") && (t = 360 - t), t && (t = t % 360), t !== t ? 0 : t || 0;
3129
3129
  }
@@ -3198,8 +3198,8 @@ function je(e, t = {}) {
3198
3198
  selectors: []
3199
3199
  };
3200
3200
  }
3201
- var Xa = Object.defineProperty, eo = (e, t, r) => t in e ? Xa(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, cr = (e, t, r) => (eo(e, typeof t != "symbol" ? t + "" : t, r), r);
3202
- function to(e) {
3201
+ var ta = Object.defineProperty, ra = (e, t, r) => t in e ? ta(e, t, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[t] = r, cr = (e, t, r) => (ra(e, typeof t != "symbol" ? t + "" : t, r), r);
3202
+ function ia(e) {
3203
3203
  return Array.isArray(e) ? e : e ? [e] : [];
3204
3204
  }
3205
3205
  const ur = [
@@ -3215,7 +3215,7 @@ const ur = [
3215
3215
  "Service",
3216
3216
  "ContentResource"
3217
3217
  ];
3218
- function ro(e) {
3218
+ function na(e) {
3219
3219
  if (typeof e > "u" || e === null)
3220
3220
  throw new Error("Null or undefined is not a valid entity.");
3221
3221
  if (Array.isArray(e))
@@ -3384,7 +3384,7 @@ class qt {
3384
3384
  traverseUnknown(t) {
3385
3385
  if (!t["@type"] || typeof t == "string")
3386
3386
  return t;
3387
- switch (ro(t)) {
3387
+ switch (na(t)) {
3388
3388
  case "sc:Collection":
3389
3389
  return this.traverseCollection(t);
3390
3390
  case "sc:Manifest":
@@ -3457,7 +3457,7 @@ class qt {
3457
3457
  }, t);
3458
3458
  }
3459
3459
  }
3460
- const io = "http://library.stanford.edu/iiif/image-api/compliance.html#level0", fi = "http://library.stanford.edu/iiif/image-api/compliance.html#level1", pi = "http://library.stanford.edu/iiif/image-api/compliance.html#level2", no = "http://library.stanford.edu/iiif/image-api/conformance.html#level0", di = "http://library.stanford.edu/iiif/image-api/conformance.html#level1", hi = "http://library.stanford.edu/iiif/image-api/conformance.html#level2", so = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0", yi = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1", vi = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", ao = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0", gi = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1", mi = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2", oo = "http://iiif.io/api/image/1/level0.json", co = "http://iiif.io/api/image/1/profiles/level0.json", bi = "http://iiif.io/api/image/1/level1.json", Ai = "http://iiif.io/api/image/1/profiles/level1.json", xi = "http://iiif.io/api/image/1/level2.json", wi = "http://iiif.io/api/image/1/profiles/level2.json", uo = "http://iiif.io/api/image/2/level0.json", lo = "http://iiif.io/api/image/2/profiles/level0.json", Si = "http://iiif.io/api/image/2/level1.json", Ci = "http://iiif.io/api/image/2/profiles/level1.json", Mi = "http://iiif.io/api/image/2/level2.json", Ri = "http://iiif.io/api/image/2/profiles/level2.json", fo = "level0", Ii = "level1", Ti = "level2", po = "http://iiif.io/api/image/2/level0", ki = "http://iiif.io/api/image/2/level1", Oi = "http://iiif.io/api/image/2/level2", ho = [
3460
+ const sa = "http://library.stanford.edu/iiif/image-api/compliance.html#level0", fi = "http://library.stanford.edu/iiif/image-api/compliance.html#level1", pi = "http://library.stanford.edu/iiif/image-api/compliance.html#level2", oa = "http://library.stanford.edu/iiif/image-api/conformance.html#level0", di = "http://library.stanford.edu/iiif/image-api/conformance.html#level1", hi = "http://library.stanford.edu/iiif/image-api/conformance.html#level2", aa = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0", yi = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1", vi = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", ca = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0", gi = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1", mi = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2", ua = "http://iiif.io/api/image/1/level0.json", la = "http://iiif.io/api/image/1/profiles/level0.json", bi = "http://iiif.io/api/image/1/level1.json", Ai = "http://iiif.io/api/image/1/profiles/level1.json", xi = "http://iiif.io/api/image/1/level2.json", wi = "http://iiif.io/api/image/1/profiles/level2.json", fa = "http://iiif.io/api/image/2/level0.json", pa = "http://iiif.io/api/image/2/profiles/level0.json", Si = "http://iiif.io/api/image/2/level1.json", Ci = "http://iiif.io/api/image/2/profiles/level1.json", Mi = "http://iiif.io/api/image/2/level2.json", Ri = "http://iiif.io/api/image/2/profiles/level2.json", da = "level0", Ii = "level1", Ti = "level2", ha = "http://iiif.io/api/image/2/level0", ki = "http://iiif.io/api/image/2/level1", Oi = "http://iiif.io/api/image/2/level2", ya = [
3461
3461
  ki,
3462
3462
  Oi,
3463
3463
  fi,
@@ -3478,35 +3478,35 @@ const io = "http://library.stanford.edu/iiif/image-api/compliance.html#level0",
3478
3478
  Ri,
3479
3479
  Ii,
3480
3480
  Ti
3481
- ], yo = [
3482
- po,
3481
+ ], va = [
3482
+ ha,
3483
3483
  ki,
3484
3484
  Oi,
3485
- io,
3485
+ sa,
3486
3486
  fi,
3487
3487
  pi,
3488
- no,
3488
+ oa,
3489
3489
  di,
3490
3490
  hi,
3491
- so,
3491
+ aa,
3492
3492
  yi,
3493
3493
  vi,
3494
- ao,
3494
+ ca,
3495
3495
  gi,
3496
3496
  mi,
3497
- oo,
3498
- co,
3497
+ ua,
3498
+ la,
3499
3499
  bi,
3500
3500
  Ai,
3501
3501
  xi,
3502
3502
  wi,
3503
- uo,
3504
- lo,
3503
+ fa,
3504
+ pa,
3505
3505
  Si,
3506
3506
  Ci,
3507
3507
  Mi,
3508
3508
  Ri,
3509
- fo,
3509
+ da,
3510
3510
  Ii,
3511
3511
  Ti
3512
3512
  ];
@@ -3542,14 +3542,14 @@ function Ie(e, t = "none") {
3542
3542
  function Ei(e) {
3543
3543
  if (Array.isArray(e))
3544
3544
  return Ei(e.find((t) => typeof t == "string"));
3545
- if (yo.indexOf(e) !== -1)
3545
+ if (va.indexOf(e) !== -1)
3546
3546
  return "level2";
3547
- if (ho.indexOf(e) !== -1)
3547
+ if (ya.indexOf(e) !== -1)
3548
3548
  return "level1";
3549
3549
  if (typeof e == "string")
3550
3550
  return e;
3551
3551
  }
3552
- function vo(e) {
3552
+ function ga(e) {
3553
3553
  const t = Array.isArray(e) ? e : [e];
3554
3554
  for (const r of t)
3555
3555
  switch (r) {
@@ -3563,7 +3563,7 @@ function vo(e) {
3563
3563
  return "ImageApiSelector";
3564
3564
  }
3565
3565
  }
3566
- function go(e) {
3566
+ function ma(e) {
3567
3567
  switch (e) {
3568
3568
  case "http://iiif.io/api/image/2/level0.json":
3569
3569
  case "http://iiif.io/api/image/2/level1.json":
@@ -3598,18 +3598,18 @@ function lr(e) {
3598
3598
  return e.slice(t.length + 1);
3599
3599
  return e;
3600
3600
  }
3601
- const mo = ["Collection", "Manifest", "Annotation", "AnnotationPage", "Range", "Service"];
3601
+ const ba = ["Collection", "Manifest", "Annotation", "AnnotationPage", "Range", "Service"];
3602
3602
  function _t(e) {
3603
3603
  const t = e["@id"] || e.id;
3604
3604
  let r = e["@type"] || e.type;
3605
3605
  const i = e.profile || void 0, n = e["@context"] || void 0;
3606
3606
  if (i) {
3607
- const s = go(i);
3607
+ const s = ma(i);
3608
3608
  if (s)
3609
3609
  return s;
3610
3610
  }
3611
3611
  if (n) {
3612
- const s = vo(n);
3612
+ const s = ga(n);
3613
3613
  if (s)
3614
3614
  return s;
3615
3615
  }
@@ -3635,7 +3635,7 @@ function _t(e) {
3635
3635
  return "TextualBody";
3636
3636
  }
3637
3637
  }
3638
- if (r && mo.indexOf(r) !== -1)
3638
+ if (r && ba.indexOf(r) !== -1)
3639
3639
  return r;
3640
3640
  if (e.format) {
3641
3641
  if (e.format.startsWith("image/"))
@@ -3647,28 +3647,28 @@ function _t(e) {
3647
3647
  }
3648
3648
  return t && (t.endsWith(".jpg") || t.endsWith(".png") || t.endsWith(".jpeg")) ? "Image" : r || "unknown";
3649
3649
  }
3650
- const bo = /http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;
3651
- function Ao(e) {
3652
- const t = e.match(bo);
3650
+ const Aa = /http(s)?:\/\/(creativecommons.org|rightsstatements.org)[^"'\\<\n]+/gm;
3651
+ function xa(e) {
3652
+ const t = e.match(Aa);
3653
3653
  return t ? t[0] : e;
3654
3654
  }
3655
- function xo(e, t = "Rights/License", r = "none") {
3655
+ function wa(e, t = "Rights/License", r = "none") {
3656
3656
  let i = null;
3657
3657
  const n = [], s = Array.isArray(e) ? e : [e];
3658
- for (const a of s) {
3659
- const o = a ? Ao(a) : void 0;
3660
- if (o && (o.indexOf("creativecommons.org") !== -1 || o.indexOf("rightsstatements.org") !== -1)) {
3661
- o.startsWith("https://") ? i = `http://${o.slice(8)}` : i = o;
3658
+ for (const o of s) {
3659
+ const a = o ? xa(o) : void 0;
3660
+ if (a && (a.indexOf("creativecommons.org") !== -1 || a.indexOf("rightsstatements.org") !== -1)) {
3661
+ a.startsWith("https://") ? i = `http://${a.slice(8)}` : i = a;
3662
3662
  continue;
3663
3663
  }
3664
- o && n.push({
3664
+ a && n.push({
3665
3665
  label: { [r]: [t] },
3666
- value: { [r]: [o] }
3666
+ value: { [r]: [a] }
3667
3667
  });
3668
3668
  }
3669
3669
  return [i, n];
3670
3670
  }
3671
- const wo = [
3671
+ const Sa = [
3672
3672
  "http://iiif.io/api/presentation/2/context.json",
3673
3673
  "http://iiif.io/api/image/2/context.json",
3674
3674
  "http://iiif.io/api/image/1/context.json",
@@ -3679,16 +3679,16 @@ const wo = [
3679
3679
  "http://iiif.io/api/auth/0/context.json",
3680
3680
  "http://iiif.io/api/annex/openannotation/context.json"
3681
3681
  ];
3682
- function So(e) {
3682
+ function Ca(e) {
3683
3683
  if (e) {
3684
3684
  const t = Array.isArray(e) ? e : [e], r = [];
3685
3685
  for (const i of t)
3686
- i === "http://iiif.io/api/presentation/2/context.json" && r.push("http://iiif.io/api/presentation/3/context.json"), wo.indexOf(i) === -1 && r.push(i);
3686
+ i === "http://iiif.io/api/presentation/2/context.json" && r.push("http://iiif.io/api/presentation/3/context.json"), Sa.indexOf(i) === -1 && r.push(i);
3687
3687
  if (t.length)
3688
3688
  return r.length === 1 ? r[0] : r;
3689
3689
  }
3690
3690
  }
3691
- function Co(e) {
3691
+ function Ma(e) {
3692
3692
  return e ? e.map((t) => ({
3693
3693
  label: Ie(t.label),
3694
3694
  value: Ie(t.value)
@@ -3704,7 +3704,7 @@ function fe(e) {
3704
3704
  e.viewingHint && t.push(e.viewingHint);
3705
3705
  let r;
3706
3706
  return Array.isArray(e.motivation) ? r = e.motivation.map(lr) : e.motivation && (r = lr(e.motivation)), {
3707
- "@context": e["@context"] ? So(e["@context"]) : void 0,
3707
+ "@context": e["@context"] ? Ca(e["@context"]) : void 0,
3708
3708
  id: (e["@id"] || Pi(e)).trim(),
3709
3709
  type: _t(e),
3710
3710
  behavior: t.length ? t : void 0,
@@ -3719,7 +3719,7 @@ function fe(e) {
3719
3719
  };
3720
3720
  }
3721
3721
  function pe(e) {
3722
- const [t, r] = xo(e.license), i = [...e.metadata ? Co(e.metadata) : [], ...r];
3722
+ const [t, r] = wa(e.license), i = [...e.metadata ? Ma(e.metadata) : [], ...r];
3723
3723
  return {
3724
3724
  rights: t,
3725
3725
  metadata: i.length ? i : void 0,
@@ -3730,13 +3730,13 @@ function pe(e) {
3730
3730
  } : void 0,
3731
3731
  navDate: e.navDate,
3732
3732
  summary: e.description ? Ie(e.description) : void 0,
3733
- thumbnail: Mo(e.thumbnail)
3733
+ thumbnail: Ra(e.thumbnail)
3734
3734
  };
3735
3735
  }
3736
- function Mo(e) {
3736
+ function Ra(e) {
3737
3737
  return e && (Array.isArray(e) ? e : [e]).map((t) => typeof t == "string" ? { id: t, type: "Image" } : (t.type === "unknown" && (t.type = "Image"), t));
3738
3738
  }
3739
- function Ro(e) {
3739
+ function Ia(e) {
3740
3740
  if (!e.within)
3741
3741
  return;
3742
3742
  const t = Array.isArray(e.within) ? e.within : [e.within], r = [];
@@ -3767,22 +3767,22 @@ function Ae(e) {
3767
3767
  label: Ie(Tt.providerName)
3768
3768
  }
3769
3769
  ] : void 0,
3770
- partOf: Ro(e),
3770
+ partOf: Ia(e),
3771
3771
  rendering: e.rendering,
3772
3772
  seeAlso: e.seeAlso,
3773
3773
  start: e.startCanvas,
3774
- service: e.service ? to(e.service) : void 0,
3774
+ service: e.service ? ia(e.service) : void 0,
3775
3775
  supplementary: r ? [r] : void 0
3776
3776
  };
3777
3777
  }
3778
- function Io(e) {
3778
+ function Ta(e) {
3779
3779
  return {
3780
3780
  chars: e.chars,
3781
3781
  format: e.format ? e.format : void 0,
3782
3782
  language: e.language
3783
3783
  };
3784
3784
  }
3785
- function To(e) {
3785
+ function ka(e) {
3786
3786
  return le({
3787
3787
  ...fe(e),
3788
3788
  ...pe(e),
@@ -3790,7 +3790,7 @@ function To(e) {
3790
3790
  items: e.members
3791
3791
  });
3792
3792
  }
3793
- function ko(e) {
3793
+ function Oa(e) {
3794
3794
  const t = [], r = [];
3795
3795
  let i;
3796
3796
  for (const s of e.sequences || [])
@@ -3805,7 +3805,7 @@ function ko(e) {
3805
3805
  structures: e.structures
3806
3806
  });
3807
3807
  }
3808
- function Oo(e) {
3808
+ function Ea(e) {
3809
3809
  return le({
3810
3810
  ...fe(e),
3811
3811
  ...pe(e),
@@ -3820,7 +3820,7 @@ function Oo(e) {
3820
3820
  ] : void 0
3821
3821
  });
3822
3822
  }
3823
- function Eo(e) {
3823
+ function Pa(e) {
3824
3824
  return le({
3825
3825
  ...fe(e),
3826
3826
  ...pe(e),
@@ -3828,7 +3828,7 @@ function Eo(e) {
3828
3828
  items: e.resources && e.resources.length ? e.resources : void 0
3829
3829
  });
3830
3830
  }
3831
- function Po(e) {
3831
+ function La(e) {
3832
3832
  return !e.canvases || e.canvases.length === 0 ? {
3833
3833
  canvases: [],
3834
3834
  behavior: []
@@ -3838,7 +3838,7 @@ function Po(e) {
3838
3838
  startCanvas: e.startCanvas
3839
3839
  };
3840
3840
  }
3841
- function Lo(e) {
3841
+ function Fa(e) {
3842
3842
  function t(r) {
3843
3843
  if (Array.isArray(r)) {
3844
3844
  if (r.length > 1)
@@ -3879,10 +3879,10 @@ function kt(e) {
3879
3879
  ...fe(t),
3880
3880
  ...pe(t),
3881
3881
  ...Ae(t),
3882
- ...Io(t)
3882
+ ...Ta(t)
3883
3883
  });
3884
3884
  }
3885
- function Fo(e) {
3885
+ function ja(e) {
3886
3886
  const t = [];
3887
3887
  return e.default && e.default !== "rdf:nil" && t.push(e.default), e.item && e.item !== "rdf:nil" && t.push(...e.item), {
3888
3888
  ...fe(e),
@@ -3890,7 +3890,7 @@ function Fo(e) {
3890
3890
  items: t
3891
3891
  };
3892
3892
  }
3893
- function jo(e) {
3893
+ function $a(e) {
3894
3894
  return le({
3895
3895
  ...fe(e),
3896
3896
  ...pe(e),
@@ -3898,14 +3898,14 @@ function jo(e) {
3898
3898
  items: e.members
3899
3899
  });
3900
3900
  }
3901
- function $o(e) {
3902
- const { "@id": t, "@type": r, "@context": i, profile: n, ...s } = e, a = {};
3903
- return t && (a["@id"] = t), a["@type"] = _t(e), a["@type"] === "unknown" && (i && i.length && (a["@context"] = i), a["@type"] = "Service"), n && (a.profile = Ei(n)), le({
3904
- ...a,
3901
+ function Da(e) {
3902
+ const { "@id": t, "@type": r, "@context": i, profile: n, ...s } = e, o = {};
3903
+ return t && (o["@id"] = t), o["@type"] = _t(e), o["@type"] === "unknown" && (i && i.length && (o["@context"] = i), o["@type"] = "Service"), n && (o.profile = Ei(n)), le({
3904
+ ...o,
3905
3905
  ...s
3906
3906
  });
3907
3907
  }
3908
- function Do(e) {
3908
+ function qa(e) {
3909
3909
  return le({
3910
3910
  ...fe(e),
3911
3911
  ...pe(e),
@@ -3913,17 +3913,17 @@ function Do(e) {
3913
3913
  });
3914
3914
  }
3915
3915
  new qt({
3916
- collection: [To],
3917
- manifest: [ko],
3918
- canvas: [Oo],
3919
- annotationList: [Eo],
3920
- sequence: [Po],
3921
- annotation: [Lo],
3916
+ collection: [ka],
3917
+ manifest: [Oa],
3918
+ canvas: [Ea],
3919
+ annotationList: [Pa],
3920
+ sequence: [La],
3921
+ annotation: [Fa],
3922
3922
  contentResource: [kt],
3923
- choice: [Fo],
3924
- range: [jo],
3925
- service: [$o],
3926
- layer: [Do]
3923
+ choice: [ja],
3924
+ range: [$a],
3925
+ service: [Da],
3926
+ layer: [qa]
3927
3927
  });
3928
3928
  function Ot(e) {
3929
3929
  if ((Array.isArray(e["@type"]) && e["@type"].includes("oa:SvgSelector") || e["@type"] == "oa:SvgSelector") && ("chars" in e || "value" in e))
@@ -3953,11 +3953,11 @@ function Ot(e) {
3953
3953
  }
3954
3954
  var pr = { exports: {} };
3955
3955
  (function(e, t) {
3956
- var r = Object.defineProperty, i = (s, a, o) => a in s ? r(s, a, { enumerable: !0, configurable: !0, writable: !0, value: o }) : s[a] = o, n = (s, a, o) => (i(s, typeof a != "symbol" ? a + "" : a, o), o);
3957
- (function(s, a) {
3958
- a(t);
3959
- })(Pa, function(s) {
3960
- const a = "http://library.stanford.edu/iiif/image-api/compliance.html#level1", o = "http://library.stanford.edu/iiif/image-api/compliance.html#level2", u = "http://library.stanford.edu/iiif/image-api/conformance.html#level1", d = "http://library.stanford.edu/iiif/image-api/conformance.html#level2", l = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1", p = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", v = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1", m = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2", h = "http://iiif.io/api/image/1/level1.json", g = "http://iiif.io/api/image/1/profiles/level1.json", b = "http://iiif.io/api/image/1/level2.json", A = "http://iiif.io/api/image/1/profiles/level2.json", w = "http://iiif.io/api/image/2/level1.json", C = "http://iiif.io/api/image/2/profiles/level1.json", T = "http://iiif.io/api/image/2/level2.json", j = "http://iiif.io/api/image/2/profiles/level2.json", I = "level1", L = "level2", P = "http://iiif.io/api/image/2/level1", M = "http://iiif.io/api/image/2/level2", $ = [P, M, a, o, u, d, l, p, v, m, h, g, b, A, w, C, T, j, I, L], ie = ["http://iiif.io/api/image/2/level0", P, M, "http://library.stanford.edu/iiif/image-api/compliance.html#level0", a, o, "http://library.stanford.edu/iiif/image-api/conformance.html#level0", u, d, "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0", l, p, "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0", v, m, "http://iiif.io/api/image/1/level0.json", "http://iiif.io/api/image/1/profiles/level0.json", h, g, b, A, "http://iiif.io/api/image/2/level0.json", "http://iiif.io/api/image/2/profiles/level0.json", w, C, T, j, "level0", I, L], Z = ["sc:Collection", "sc:Manifest", "sc:Canvas", "sc:AnnotationList", "oa:Annotation", "sc:Range", "sc:Layer", "sc:Sequence", "oa:Choice", "Service", "ContentResource"];
3956
+ var r = Object.defineProperty, i = (s, o, a) => o in s ? r(s, o, { enumerable: !0, configurable: !0, writable: !0, value: a }) : s[o] = a, n = (s, o, a) => (i(s, typeof o != "symbol" ? o + "" : o, a), a);
3957
+ (function(s, o) {
3958
+ o(t);
3959
+ })(Fo, function(s) {
3960
+ const o = "http://library.stanford.edu/iiif/image-api/compliance.html#level1", a = "http://library.stanford.edu/iiif/image-api/compliance.html#level2", u = "http://library.stanford.edu/iiif/image-api/conformance.html#level1", d = "http://library.stanford.edu/iiif/image-api/conformance.html#level2", l = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level1", p = "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level2", v = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level1", m = "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level2", h = "http://iiif.io/api/image/1/level1.json", g = "http://iiif.io/api/image/1/profiles/level1.json", b = "http://iiif.io/api/image/1/level2.json", A = "http://iiif.io/api/image/1/profiles/level2.json", w = "http://iiif.io/api/image/2/level1.json", C = "http://iiif.io/api/image/2/profiles/level1.json", T = "http://iiif.io/api/image/2/level2.json", j = "http://iiif.io/api/image/2/profiles/level2.json", I = "level1", L = "level2", P = "http://iiif.io/api/image/2/level1", M = "http://iiif.io/api/image/2/level2", $ = [P, M, o, a, u, d, l, p, v, m, h, g, b, A, w, C, T, j, I, L], ie = ["http://iiif.io/api/image/2/level0", P, M, "http://library.stanford.edu/iiif/image-api/compliance.html#level0", o, a, "http://library.stanford.edu/iiif/image-api/conformance.html#level0", u, d, "http://library.stanford.edu/iiif/image-api/1.1/compliance.html#level0", l, p, "http://library.stanford.edu/iiif/image-api/1.1/conformance.html#level0", v, m, "http://iiif.io/api/image/1/level0.json", "http://iiif.io/api/image/1/profiles/level0.json", h, g, b, A, "http://iiif.io/api/image/2/level0.json", "http://iiif.io/api/image/2/profiles/level0.json", w, C, T, j, "level0", I, L], Z = ["sc:Collection", "sc:Manifest", "sc:Canvas", "sc:AnnotationList", "oa:Annotation", "sc:Range", "sc:Layer", "sc:Sequence", "oa:Choice", "Service", "ContentResource"];
3961
3961
  class U {
3962
3962
  constructor(c, y = {}) {
3963
3963
  n(this, "traversals"), n(this, "options"), this.traversals = { collection: [], manifest: [], canvas: [], annotationList: [], sequence: [], annotation: [], contentResource: [], choice: [], range: [], service: [], layer: [], ...c }, this.options = { convertPropsToArray: !0, mergeMemberProperties: !0, allowUndefinedReturn: !1, ...y };
@@ -4256,16 +4256,16 @@ var pr = { exports: {} };
4256
4256
  const y = encodeURI(f.id || f["@id"] || "").trim();
4257
4257
  return y && c ? `${y}/${c}` : y || (Bt++, `http://example.org/${f["@type"]}${c ? `/${c}` : ""}/${Bt}`);
4258
4258
  }
4259
- function ae(f) {
4259
+ function oe(f) {
4260
4260
  const c = [...f.behavior || []];
4261
4261
  let y;
4262
4262
  return f.viewingHint && c.push(f.viewingHint), Array.isArray(f.motivation) ? y = f.motivation.map(X) : f.motivation && (y = X(f.motivation)), { "@context": f["@context"] ? en(f["@context"]) : void 0, id: (f["@id"] || zt(f)).trim(), type: nt(f), behavior: c.length ? c : void 0, height: f.height ? f.height : void 0, width: f.width ? f.width : void 0, motivation: y, viewingDirection: f.viewingDirection, profile: f.profile, format: f.format ? f.format : void 0, duration: void 0, timeMode: void 0 };
4263
4263
  }
4264
- function oe(f) {
4264
+ function ae(f) {
4265
4265
  const [c, y] = function(k, Y = "Rights/License", Ue = "none") {
4266
4266
  let Ve = null;
4267
- const Wt = [], an = Array.isArray(k) ? k : [k];
4268
- for (const Qt of an) {
4267
+ const Wt = [], on = Array.isArray(k) ? k : [k];
4268
+ for (const Qt of on) {
4269
4269
  const ye = Qt ? Zi(Qt) : void 0;
4270
4270
  !ye || ye.indexOf("creativecommons.org") === -1 && ye.indexOf("rightsstatements.org") === -1 ? ye && Wt.push({ label: { [Ue]: [Y] }, value: { [Ue]: [ye] } }) : Ve = ye.startsWith("https://") ? `http://${ye.slice(8)}` : ye;
4271
4271
  }
@@ -4292,26 +4292,26 @@ var pr = { exports: {} };
4292
4292
  }
4293
4293
  function st(f) {
4294
4294
  const c = f;
4295
- return z({ ...ae(c), ...oe(c), ...he(c), ...(y = c, { chars: y.chars, format: y.format ? y.format : void 0, language: y.language }) });
4295
+ return z({ ...oe(c), ...ae(c), ...he(c), ...(y = c, { chars: y.chars, format: y.format ? y.format : void 0, language: y.language }) });
4296
4296
  var y;
4297
4297
  }
4298
4298
  const nn = new U({ collection: [function(f) {
4299
- return z({ ...ae(f), ...oe(f), ...he(f), items: f.members });
4299
+ return z({ ...oe(f), ...ae(f), ...he(f), items: f.members });
4300
4300
  }], manifest: [function(f) {
4301
4301
  const c = [], y = [];
4302
4302
  let S;
4303
4303
  for (const k of f.sequences || [])
4304
4304
  k.canvases.length && c.push(...k.canvases), k.behavior && y.push(...k.behavior), k.startCanvas && (S = k.startCanvas);
4305
- const F = ae(f);
4306
- return y.length && (F.behavior ? F.behavior.push(...y) : F.behavior = y), z({ ...F, ...oe(f), ...he(f), start: S, items: c, structures: f.structures });
4305
+ const F = oe(f);
4306
+ return y.length && (F.behavior ? F.behavior.push(...y) : F.behavior = y), z({ ...F, ...ae(f), ...he(f), start: S, items: c, structures: f.structures });
4307
4307
  }], canvas: [function(f) {
4308
- return z({ ...ae(f), ...oe(f), ...he(f), annotations: f.otherContent && f.otherContent.length ? f.otherContent : void 0, items: f.images && f.images.length ? [{ id: zt(f, "annotation-page"), type: "AnnotationPage", items: f.images }] : void 0 });
4308
+ return z({ ...oe(f), ...ae(f), ...he(f), annotations: f.otherContent && f.otherContent.length ? f.otherContent : void 0, items: f.images && f.images.length ? [{ id: zt(f, "annotation-page"), type: "AnnotationPage", items: f.images }] : void 0 });
4309
4309
  }], annotationList: [function(f) {
4310
- return z({ ...ae(f), ...oe(f), ...he(f), items: f.resources && f.resources.length ? f.resources : void 0 });
4310
+ return z({ ...oe(f), ...ae(f), ...he(f), items: f.resources && f.resources.length ? f.resources : void 0 });
4311
4311
  }], sequence: [function(f) {
4312
4312
  return f.canvases && f.canvases.length !== 0 ? { canvases: f.canvases, behavior: f.viewingHint ? [f.viewingHint] : [], startCanvas: f.startCanvas } : { canvases: [], behavior: [] };
4313
4313
  }], annotation: [function(f) {
4314
- return z({ ...ae(f), ...oe(f), ...he(f), target: function c(y) {
4314
+ return z({ ...oe(f), ...ae(f), ...he(f), target: function c(y) {
4315
4315
  if (Array.isArray(y)) {
4316
4316
  if (y.length > 1)
4317
4317
  return { type: "List", items: y.map(c) };
@@ -4330,28 +4330,28 @@ var pr = { exports: {} };
4330
4330
  throw new Error(`Unsupported source type on annotation: ${y.full["@type"]}`);
4331
4331
  S = { id: y.full["@id"], type: "Canvas" };
4332
4332
  }
4333
- return { type: "SpecificResource", source: S, selector: at(y.selector) };
4333
+ return { type: "SpecificResource", source: S, selector: ot(y.selector) };
4334
4334
  }
4335
4335
  return encodeURI(y["@id"]).trim();
4336
4336
  }(f.on), body: Array.isArray(f.resource) ? f.resource.map(st) : st(f.resource) });
4337
4337
  }], contentResource: [st], choice: [function(f) {
4338
4338
  const c = [];
4339
- return f.default && f.default !== "rdf:nil" && c.push(f.default), f.item && f.item !== "rdf:nil" && c.push(...f.item), { ...ae(f), ...oe(f), items: c };
4339
+ return f.default && f.default !== "rdf:nil" && c.push(f.default), f.item && f.item !== "rdf:nil" && c.push(...f.item), { ...oe(f), ...ae(f), items: c };
4340
4340
  }], range: [function(f) {
4341
- return z({ ...ae(f), ...oe(f), ...he(f), items: f.members });
4341
+ return z({ ...oe(f), ...ae(f), ...he(f), items: f.members });
4342
4342
  }], service: [function(f) {
4343
4343
  const { "@id": c, "@type": y, "@context": S, profile: F, ...k } = f, Y = {};
4344
4344
  return c && (Y["@id"] = c), Y["@type"] = nt(f), Y["@type"] === "unknown" && (S && S.length && (Y["@context"] = S), Y["@type"] = "Service"), F && (Y.profile = W(F)), z({ ...Y, ...k });
4345
4345
  }], layer: [function(f) {
4346
- return z({ ...ae(f), ...oe(f), ...he(f) });
4346
+ return z({ ...oe(f), ...ae(f), ...he(f) });
4347
4347
  }] });
4348
- function at(f) {
4348
+ function ot(f) {
4349
4349
  if ((Array.isArray(f["@type"]) && f["@type"].includes("oa:SvgSelector") || f["@type"] == "oa:SvgSelector") && ("chars" in f || "value" in f))
4350
4350
  return { type: "SvgSelector", value: "chars" in f ? f.chars : f.value };
4351
4351
  if (f["@type"] === "oa:FragmentSelector")
4352
4352
  return { type: "FragmentSelector", value: f.value };
4353
4353
  if (f["@type"] === "oa:Choice")
4354
- return [at(f.default), ...(Array.isArray(f.item) ? f.item : [f.item]).map(at)];
4354
+ return [ot(f.default), ...(Array.isArray(f.item) ? f.item : [f.item]).map(ot)];
4355
4355
  if (f["@type"] == "iiif:ImageApiSelector")
4356
4356
  return { type: "ImageApiSelector", region: "region" in f ? f.region : void 0, rotation: "rotation" in f ? f.rotation : void 0 };
4357
4357
  throw new Error(`Unsupported selector type: ${f["@type"]}`);
@@ -4362,7 +4362,7 @@ var pr = { exports: {} };
4362
4362
  s.upgrade = sn, Object.defineProperties(s, { __esModule: { value: !0 }, [Symbol.toStringTag]: { value: "Module" } });
4363
4363
  });
4364
4364
  })(pr, pr.exports);
4365
- function kc(e) {
4365
+ function Oc(e) {
4366
4366
  return e.type === "SpecificResource" ? [e.source, { selector: e.selector }] : [e, { selector: null }];
4367
4367
  }
4368
4368
  function Li(e, t) {
@@ -4387,16 +4387,16 @@ function Li(e, t) {
4387
4387
  i
4388
4388
  ];
4389
4389
  }
4390
- const qo = {
4390
+ const _a = {
4391
4391
  makeChoice: () => {
4392
4392
  }
4393
- }, gt = { type: "unknown" }, _ = (e) => ({ type: "unknown", reason: e, annotations: { pages: [] } }), _o = (e, t) => ({ type: "empty", width: e, height: t, annotations: { pages: [] }, image: null, images: [] });
4394
- function Uo(e, t) {
4393
+ }, gt = { type: "unknown" }, _ = (e) => ({ type: "unknown", reason: e, annotations: { pages: [] } }), Ua = (e, t) => ({ type: "empty", width: e, height: t, annotations: { pages: [] }, image: null, images: [] });
4394
+ function Va(e, t) {
4395
4395
  var i;
4396
4396
  const r = (i = e == null ? void 0 : e.iiif) == null ? void 0 : i.meta[t];
4397
4397
  return r ? r.annotationPageManager : null;
4398
4398
  }
4399
- function Vo(e, t) {
4399
+ function Na(e, t) {
4400
4400
  return Q(
4401
4401
  (r) => {
4402
4402
  const i = [];
@@ -4405,15 +4405,15 @@ function Vo(e, t) {
4405
4405
  const n = Object.keys(r.iiif.entities.AnnotationPage);
4406
4406
  for (const s of n)
4407
4407
  if (!t || t.indexOf(s) !== -1) {
4408
- const a = Uo(r, s);
4409
- a && a.views && a.views[e] && i.push(s);
4408
+ const o = Va(r, s);
4409
+ o && o.views && o.views[e] && i.push(s);
4410
4410
  }
4411
4411
  return i;
4412
4412
  },
4413
4413
  [e, t]
4414
4414
  );
4415
4415
  }
4416
- function No({
4416
+ function Ha({
4417
4417
  canvas: e,
4418
4418
  manifest: t,
4419
4419
  all: r,
@@ -4426,25 +4426,25 @@ function No({
4426
4426
  if (r) {
4427
4427
  if (i && i.length)
4428
4428
  for (const s of i)
4429
- for (const a of s.annotations)
4430
- n.indexOf(a.id) === -1 && n.push(a.id);
4429
+ for (const o of s.annotations)
4430
+ n.indexOf(o.id) === -1 && n.push(o.id);
4431
4431
  } else if (e)
4432
4432
  for (const s of e.annotations)
4433
4433
  n.indexOf(s.id) === -1 && n.push(s.id);
4434
4434
  return n;
4435
4435
  }
4436
- function Ho(e, t) {
4436
+ function Ba(e, t) {
4437
4437
  var i;
4438
4438
  const r = (i = e == null ? void 0 : e.iiif) == null ? void 0 : i.meta[t];
4439
4439
  return r ? r.annotationPageManager : null;
4440
4440
  }
4441
- function Bo(e, t = {}) {
4442
- const r = V(), i = ke(), n = ue(), s = Br(), a = E(() => No({
4441
+ function za(e, t = {}) {
4442
+ const r = V(), i = ke(), n = ue(), s = Br(), o = E(() => Ha({
4443
4443
  all: t.all,
4444
4444
  manifest: i,
4445
4445
  canvas: n,
4446
4446
  canvases: s
4447
- }), [t.all, n, s, i]), o = Vo(e, t.all ? void 0 : a), u = D(
4447
+ }), [t.all, n, s, i]), a = Na(e, t.all ? void 0 : o), u = D(
4448
4448
  (l) => {
4449
4449
  e && r.setMetaValue(
4450
4450
  [l, "annotationPageManager", "views"],
@@ -4463,7 +4463,7 @@ function Bo(e, t = {}) {
4463
4463
  if (p != null && p.deselectOthers) {
4464
4464
  const h = Object.keys(v.iiif.entities.AnnotationPage);
4465
4465
  for (const g of h) {
4466
- const b = Ho(v, g);
4466
+ const b = Ba(v, g);
4467
4467
  b && b.views && b.views[e] && m.push(g);
4468
4468
  }
4469
4469
  }
@@ -4480,30 +4480,30 @@ function Bo(e, t = {}) {
4480
4480
  [e, u, r]
4481
4481
  );
4482
4482
  return {
4483
- availablePageIds: a,
4484
- enabledPageIds: o,
4483
+ availablePageIds: o,
4484
+ enabledPageIds: a,
4485
4485
  setPageEnabled: d,
4486
4486
  setPageDisabled: u
4487
4487
  };
4488
4488
  }
4489
- function zo(e, t) {
4489
+ function Wa(e, t) {
4490
4490
  return Q((r, i) => i.get(e.map((n) => ({ id: n, type: t }))), [e, t]);
4491
4491
  }
4492
- const Wo = me.createContext(new gr());
4492
+ const Qa = me.createContext(new gr());
4493
4493
  function Ut() {
4494
- return H(Wo);
4494
+ return H(Qa);
4495
4495
  }
4496
- function Qo() {
4496
+ function Ya() {
4497
4497
  const e = Ut(), [t, r] = B({}), i = ge(!1);
4498
4498
  return K(() => () => {
4499
4499
  i.current = !0;
4500
4500
  }, []), [D(
4501
- (s, { height: a, width: o }) => {
4501
+ (s, { height: o, width: a }) => {
4502
4502
  if (s) {
4503
4503
  const u = s.id || s["@id"], d = e.loadServiceSync({
4504
4504
  id: u,
4505
- width: s.width || o,
4506
- height: s.height || a,
4505
+ width: s.width || a,
4506
+ height: s.height || o,
4507
4507
  source: s
4508
4508
  });
4509
4509
  d ? s = d : t[u] || (i.current || r((l) => ({
@@ -4511,8 +4511,8 @@ function Qo() {
4511
4511
  [u]: "loading"
4512
4512
  })), e.loadService({
4513
4513
  id: u,
4514
- width: s.width || o,
4515
- height: s.height || a
4514
+ width: s.width || a,
4515
+ height: s.height || o
4516
4516
  }).then(() => {
4517
4517
  i.current || r((l) => ({
4518
4518
  ...l,
@@ -4533,15 +4533,15 @@ function Vt(e = {}) {
4533
4533
  return [];
4534
4534
  if (t && e.enableSingleAnnotation)
4535
4535
  return [t];
4536
- const s = n.get(r.items), a = [];
4537
- for (const o of s)
4538
- a.push(...n.get(o.items));
4539
- return a;
4536
+ const s = n.get(r.items), o = [];
4537
+ for (const a of s)
4538
+ o.push(...n.get(a.items));
4539
+ return o;
4540
4540
  },
4541
4541
  [r]
4542
4542
  );
4543
4543
  }
4544
- function Yo(e) {
4544
+ function Ga(e) {
4545
4545
  return e.type === "SpecificResource" ? [e.source, { selector: e.selector }] : [e, { selector: null }];
4546
4546
  }
4547
4547
  const ze = {}, Fi = {
@@ -4549,12 +4549,12 @@ const ze = {}, Fi = {
4549
4549
  return e;
4550
4550
  },
4551
4551
  setMetaValue([e, t, r], i) {
4552
- const n = Fi.getResourceMeta(e, t), s = n ? n[r] : void 0, a = typeof i == "function" ? i(s) : i;
4552
+ const n = Fi.getResourceMeta(e, t), s = n ? n[r] : void 0, o = typeof i == "function" ? i(s) : i;
4553
4553
  ze[e] = {
4554
4554
  ...ze[e] || {},
4555
4555
  [t]: {
4556
4556
  ...(ze[e] || {})[t] || {},
4557
- [r]: a
4557
+ [r]: o
4558
4558
  }
4559
4559
  };
4560
4560
  },
@@ -4564,26 +4564,26 @@ const ze = {}, Fi = {
4564
4564
  return t ? r[t] : r;
4565
4565
  }
4566
4566
  };
4567
- function Go(e = Fi) {
4567
+ function Ja(e = Fi) {
4568
4568
  function t(n) {
4569
4569
  const s = n ? typeof n == "string" ? e.get(n) : n : null;
4570
4570
  if (!s)
4571
4571
  return [];
4572
- const a = e.get(s.items, { parent: s }), o = [];
4573
- for (const u of a)
4574
- o.push(...e.get(u.items, { parent: u }));
4575
- return o;
4572
+ const o = e.get(s.items, { parent: s }), a = [];
4573
+ for (const u of o)
4574
+ a.push(...e.get(u.items, { parent: u }));
4575
+ return a;
4576
4576
  }
4577
4577
  function r(n, s = []) {
4578
- const a = Array.isArray(n) ? n : t(n), o = [];
4578
+ const o = Array.isArray(n) ? n : t(n), a = [];
4579
4579
  let u = null;
4580
4580
  const d = [];
4581
- for (const l of a) {
4581
+ for (const l of o) {
4582
4582
  if (l.type !== "Annotation")
4583
4583
  throw new Error("getPaintables() accept either a canvas or list of annotations");
4584
4584
  const p = Array.from(Array.isArray(l.body) ? l.body : [l.body]);
4585
4585
  for (const v of p) {
4586
- const [m, { selector: h }] = Yo(v), g = e.get(m), b = (g.type || "unknown").toLowerCase();
4586
+ const [m, { selector: h }] = Ga(v), g = e.get(m), b = (g.type || "unknown").toLowerCase();
4587
4587
  if (b === "choice") {
4588
4588
  const A = e.get(g.items, { parent: g.id }), w = s.length ? s.map((C) => A.find((T) => T.id === C)).filter(Boolean) : [A[0]];
4589
4589
  w.length === 0 && w.push(A[0]), u = {
@@ -4597,7 +4597,7 @@ function Go(e = Fi) {
4597
4597
  }, p.push(...w);
4598
4598
  continue;
4599
4599
  }
4600
- o.indexOf(b) === -1 && o.push(b), d.push({
4600
+ a.indexOf(b) === -1 && a.push(b), d.push({
4601
4601
  type: b,
4602
4602
  annotationId: l.id,
4603
4603
  resource: g,
@@ -4607,7 +4607,7 @@ function Go(e = Fi) {
4607
4607
  }
4608
4608
  }
4609
4609
  return {
4610
- types: o,
4610
+ types: a,
4611
4611
  items: d,
4612
4612
  choice: u
4613
4613
  };
@@ -4622,20 +4622,20 @@ function Go(e = Fi) {
4622
4622
  extractChoices: i
4623
4623
  };
4624
4624
  }
4625
- function Jo(e, t = []) {
4626
- const r = V(), i = E(() => Go(r), []), n = Vt({ enableSingleAnnotation: e == null ? void 0 : e.enableSingleAnnotation }), [s, a] = B((e == null ? void 0 : e.defaultChoices) || []), o = E(
4625
+ function Ka(e, t = []) {
4626
+ const r = V(), i = E(() => Ja(r), []), n = Vt({ enableSingleAnnotation: e == null ? void 0 : e.enableSingleAnnotation }), [s, o] = B((e == null ? void 0 : e.defaultChoices) || []), a = E(
4627
4627
  () => i.getPaintables(n, s),
4628
4628
  [r, n, s, ...t]
4629
4629
  ), d = { makeChoice: D(
4630
4630
  (l, { deselectOthers: p = !0, deselect: v = !1 } = {}) => {
4631
- if (o.choice) {
4632
- if (o.choice.type !== "single-choice")
4631
+ if (a.choice) {
4632
+ if (a.choice.type !== "single-choice")
4633
4633
  throw new Error("Complex choice not supported yet");
4634
- a((m) => {
4634
+ o((m) => {
4635
4635
  if (v) {
4636
4636
  const g = m.filter((b) => b !== l);
4637
4637
  if (g.length === 0) {
4638
- const b = o.items[0].resource.id;
4638
+ const b = a.items[0].resource.id;
4639
4639
  return b ? [b] : [];
4640
4640
  }
4641
4641
  return g;
@@ -4643,30 +4643,30 @@ function Jo(e, t = []) {
4643
4643
  if (p)
4644
4644
  return [l];
4645
4645
  const h = [...m];
4646
- if (h.length === 0 && o.items.length) {
4647
- const g = o.items[0].resource.id;
4646
+ if (h.length === 0 && a.items.length) {
4647
+ const g = a.items[0].resource.id;
4648
4648
  g && h.push(g);
4649
4649
  }
4650
4650
  return m.indexOf(l) !== -1 ? m : [...m, l];
4651
4651
  });
4652
4652
  }
4653
4653
  },
4654
- [o.choice]
4654
+ [a.choice]
4655
4655
  ) };
4656
- return [o, d];
4656
+ return [a, d];
4657
4657
  }
4658
- function Ko(e, t, r) {
4658
+ function Za(e, t, r) {
4659
4659
  const i = [];
4660
4660
  for (const n of t.items) {
4661
4661
  const s = n.resource && n.resource.type === "SpecificResource" ? n.resource.source : n.resource;
4662
4662
  if (!s.id)
4663
4663
  return _("No resource Identifier");
4664
- let a;
4664
+ let o;
4665
4665
  if (s.service) {
4666
4666
  const m = mt(s);
4667
- m[0] && (a = r(m[0], e));
4667
+ m[0] && (o = r(m[0], e));
4668
4668
  }
4669
- const o = {
4669
+ const a = {
4670
4670
  type: "BoxSelector",
4671
4671
  spatial: {
4672
4672
  x: 0,
@@ -4696,16 +4696,16 @@ function Ko(e, t, r) {
4696
4696
  height: l.selector.spatial.height
4697
4697
  }
4698
4698
  } : void 0;
4699
- a && !a.id && (a.id = a["@id"]);
4699
+ o && !o.id && (o.id = o["@id"]);
4700
4700
  const v = {
4701
4701
  id: s.id,
4702
4702
  type: "Image",
4703
4703
  annotationId: n.annotationId,
4704
4704
  width: Number(u || p ? s.width : e.width),
4705
4705
  height: Number(u || p ? s.height : e.height),
4706
- service: a,
4707
- sizes: a && a.sizes ? a.sizes : s.width && s.height ? [{ width: s.width, height: s.height }] : [],
4708
- target: u && u.type !== "PointSelector" ? u : o,
4706
+ service: o,
4707
+ sizes: o && o.sizes ? o.sizes : s.width && s.height ? [{ width: s.width, height: s.height }] : [],
4708
+ target: u && u.type !== "PointSelector" ? u : a,
4709
4709
  selector: p
4710
4710
  };
4711
4711
  i.push(v);
@@ -4717,15 +4717,15 @@ function Ko(e, t, r) {
4717
4717
  choice: t.choice
4718
4718
  };
4719
4719
  }
4720
- const Zo = ["model/gltf-binary"];
4721
- function Xo(e, t) {
4720
+ const Xa = ["model/gltf-binary"];
4721
+ function ec(e, t) {
4722
4722
  const i = t.items[0].resource;
4723
- return i.format ? Zo.indexOf(i.format) === -1 ? _(`3D format: ${i.format} is unsupported`) : {
4723
+ return i.format ? Xa.indexOf(i.format) === -1 ? _(`3D format: ${i.format} is unsupported`) : {
4724
4724
  type: "3d-model",
4725
4725
  model: i
4726
4726
  } : _("Unknown format");
4727
4727
  }
4728
- function ec(e, t) {
4728
+ function tc(e, t) {
4729
4729
  var i;
4730
4730
  if (!e.duration)
4731
4731
  return _("No duration on canvas");
@@ -4760,16 +4760,16 @@ function ec(e, t) {
4760
4760
  }
4761
4761
  } : _("Audio does not have format") : _("Unknown audio");
4762
4762
  }
4763
- const tc = /^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?vi?=|&vi?=))([^#&?]*).*/;
4764
- function rc(e, t) {
4765
- var a;
4766
- const r = t.items.filter((o) => o.type === "video");
4763
+ const rc = /^.*(?:(?:youtu\.be\/|v\/|vi\/|u\/\w\/|embed\/|shorts\/)|(?:(?:watch)?\?vi?=|&vi?=))([^#&?]*).*/;
4764
+ function ic(e, t) {
4765
+ var o;
4766
+ const r = t.items.filter((a) => a.type === "video");
4767
4767
  if (!e.duration)
4768
4768
  return _("No duration on canvas");
4769
4769
  if (r.length > 1)
4770
4770
  return _("Only one video source supported");
4771
- const i = (a = r[0]) == null ? void 0 : a.resource, n = !!(i.service || []).find(
4772
- (o) => (o.profile || "").includes("youtube.com")
4771
+ const i = (o = r[0]) == null ? void 0 : o.resource, n = !!(i.service || []).find(
4772
+ (a) => (a.profile || "").includes("youtube.com")
4773
4773
  );
4774
4774
  if (!i)
4775
4775
  return _("Unknown video");
@@ -4799,10 +4799,10 @@ function rc(e, t) {
4799
4799
  };
4800
4800
  if (n) {
4801
4801
  s.type = "VideoYouTube";
4802
- const o = i.id.match(tc);
4803
- if (!o[1])
4802
+ const a = i.id.match(rc);
4803
+ if (!a[1])
4804
4804
  return _("Video is not known youtube video");
4805
- s.youTubeId = o[1];
4805
+ s.youTubeId = a[1];
4806
4806
  }
4807
4807
  return {
4808
4808
  type: "media",
@@ -4826,7 +4826,7 @@ function ji(e, t = {}, r) {
4826
4826
  }
4827
4827
  return t;
4828
4828
  }
4829
- function ic(e, t) {
4829
+ function nc(e, t) {
4830
4830
  const r = [];
4831
4831
  return t.items.forEach((i) => {
4832
4832
  if (i.resource) {
@@ -4838,37 +4838,37 @@ function ic(e, t) {
4838
4838
  items: r
4839
4839
  };
4840
4840
  }
4841
- function nc(e) {
4842
- const t = ke(), r = ue(), i = V(), [n, s] = Qo(), { enabledPageIds: a } = Bo((e == null ? void 0 : e.annotationPageManagerId) || (t == null ? void 0 : t.id) || (r == null ? void 0 : r.id), {
4841
+ function sc(e) {
4842
+ const t = ke(), r = ue(), i = V(), [n, s] = Ya(), { enabledPageIds: o } = za((e == null ? void 0 : e.annotationPageManagerId) || (t == null ? void 0 : t.id) || (r == null ? void 0 : r.id), {
4843
4843
  all: !1
4844
- }), o = zo(a, "AnnotationPage"), u = (e == null ? void 0 : e.strategies) || [
4844
+ }), a = Wa(o, "AnnotationPage"), u = (e == null ? void 0 : e.strategies) || [
4845
4845
  "empty",
4846
4846
  "images",
4847
4847
  "media",
4848
4848
  "textual-content",
4849
4849
  "complex-timeline"
4850
- ], [d, l] = Jo(e, [s]), p = E(() => {
4850
+ ], [d, l] = Ka(e, [s]), p = E(() => {
4851
4851
  if (!r)
4852
4852
  return console.log("No canvas"), gt;
4853
4853
  if (d.types.length === 0)
4854
- return u.indexOf("empty") !== -1 ? _o(r.width, r.height) : (console.log("No paintables"), gt);
4854
+ return u.indexOf("empty") !== -1 ? Ua(r.width, r.height) : (console.log("No paintables"), gt);
4855
4855
  if (d.types.length !== 1)
4856
4856
  if (d.types.length === 2 && d.types.indexOf("text") !== -1)
4857
4857
  d.types = d.types.filter((m) => m !== "text");
4858
4858
  else
4859
4859
  return u.indexOf("complex-timeline") === -1 ? _("Complex timeline not supported") : _("ComplexTimelineStrategy not yet supported");
4860
4860
  const v = d.types[0];
4861
- return v === "image" ? u.indexOf("images") === -1 ? _("Image not supported") : Ko(r, d, n) : v === "Model" || v === "model" ? u.indexOf("3d-model") === -1 ? _("3D not supported") : Xo(r, d) : v === "textualbody" ? u.indexOf("textual-content") === -1 ? _("Textual content not supported") : ic(r, d) : v === "sound" || v === "audio" ? u.indexOf("media") === -1 ? _("Media not supported") : ec(r, d) : v === "video" ? u.indexOf("media") === -1 ? _("Media not supported") : rc(r, d) : (console.log("No idea"), gt);
4861
+ return v === "image" ? u.indexOf("images") === -1 ? _("Image not supported") : Za(r, d, n) : v === "Model" || v === "model" ? u.indexOf("3d-model") === -1 ? _("3D not supported") : ec(r, d) : v === "textualbody" ? u.indexOf("textual-content") === -1 ? _("Textual content not supported") : nc(r, d) : v === "sound" || v === "audio" ? u.indexOf("media") === -1 ? _("Media not supported") : tc(r, d) : v === "video" ? u.indexOf("media") === -1 ? _("Media not supported") : ic(r, d) : (console.log("No idea"), gt);
4862
4862
  }, [r, d, i, l.makeChoice]);
4863
- return E(() => p.type === "unknown" ? [p, qo] : [
4863
+ return E(() => p.type === "unknown" ? [p, _a] : [
4864
4864
  {
4865
4865
  ...p,
4866
- annotations: { pages: o }
4866
+ annotations: { pages: a }
4867
4867
  },
4868
4868
  l
4869
- ], [p, o]);
4869
+ ], [p, a]);
4870
4870
  }
4871
- const sc = (e, t = []) => {
4871
+ const oc = (e, t = []) => {
4872
4872
  const r = V();
4873
4873
  K(() => {
4874
4874
  e(r);
@@ -4878,12 +4878,12 @@ const sc = (e, t = []) => {
4878
4878
  return e;
4879
4879
  },
4880
4880
  setMetaValue([e, t, r], i) {
4881
- const n = $i.getResourceMeta(e, t), s = n ? n[r] : void 0, a = typeof i == "function" ? i(s) : i;
4881
+ const n = $i.getResourceMeta(e, t), s = n ? n[r] : void 0, o = typeof i == "function" ? i(s) : i;
4882
4882
  We[e] = {
4883
4883
  ...We[e] || {},
4884
4884
  [t]: {
4885
4885
  ...(We[e] || {})[t] || {},
4886
- [r]: a
4886
+ [r]: o
4887
4887
  }
4888
4888
  };
4889
4889
  },
@@ -4893,15 +4893,15 @@ const sc = (e, t = []) => {
4893
4893
  return t ? r[t] : r;
4894
4894
  }
4895
4895
  }, ac = new gr();
4896
- function oc(e = $i, t = {}) {
4896
+ function cc(e = $i, t = {}) {
4897
4897
  const r = t.imageServiceLoader || ac;
4898
- async function i(n, s, a = !1, o = [], u) {
4899
- const d = () => r.getThumbnailFromResource(void 0, s, a, o);
4898
+ async function i(n, s, o = !1, a = [], u) {
4899
+ const d = () => r.getThumbnailFromResource(void 0, s, o, a);
4900
4900
  if (!n)
4901
- return await r.getThumbnailFromResource(void 0, s, a, o);
4901
+ return await r.getThumbnailFromResource(void 0, s, o, a);
4902
4902
  if (typeof n == "string") {
4903
4903
  const p = Yt(n);
4904
- return p && o.push(p), await r.getThumbnailFromResource(void 0, s, a, o);
4904
+ return p && a.push(p), await r.getThumbnailFromResource(void 0, s, o, a);
4905
4905
  }
4906
4906
  const l = e.get(n, { skipSelfReturn: !1 });
4907
4907
  if (typeof l == "string")
@@ -4910,34 +4910,34 @@ function oc(e = $i, t = {}) {
4910
4910
  return await d();
4911
4911
  switch (await (async (p) => {
4912
4912
  if (p && p.thumbnail && p.thumbnail.length) {
4913
- const v = e.get(p.thumbnail[0]), m = await r.getImageCandidates(v, a);
4914
- m && m.length && o.push(...m);
4913
+ const v = e.get(p.thumbnail[0]), m = await r.getImageCandidates(v, o);
4914
+ m && m.length && a.push(...m);
4915
4915
  }
4916
4916
  })(l), l.type) {
4917
4917
  case "Annotation": {
4918
4918
  const p = Array.isArray(l.body) ? l.body : [l.body], v = e.get(p[0]);
4919
- return u && !v.width && (v.width = u.width, v.height = u.height), await r.getThumbnailFromResource(v, s, a, o);
4919
+ return u && !v.width && (v.width = u.width, v.height = u.height), await r.getThumbnailFromResource(v, s, o, a);
4920
4920
  }
4921
4921
  case "Canvas": {
4922
4922
  const p = l;
4923
- return i(p.items[0], s, a, o, {
4923
+ return i(p.items[0], s, o, a, {
4924
4924
  width: p.width,
4925
4925
  height: p.height
4926
4926
  });
4927
4927
  }
4928
4928
  case "AnnotationPage":
4929
- return i(l.items[0], s, a, o, u);
4929
+ return i(l.items[0], s, o, a, u);
4930
4930
  case "Choice": {
4931
4931
  const p = l;
4932
- return !p.items || p.items[0] ? await d() : i(p.items[0], s, a, o, u);
4932
+ return !p.items || p.items[0] ? await d() : i(p.items[0], s, o, a, u);
4933
4933
  }
4934
4934
  case "Collection": {
4935
4935
  const p = l.items[0];
4936
- return p ? i(p, s, a, o, u) : await d();
4936
+ return p ? i(p, s, o, a, u) : await d();
4937
4937
  }
4938
4938
  case "Manifest": {
4939
4939
  const p = l.items[0];
4940
- return p ? i(p, s, a, o, u) : await d();
4940
+ return p ? i(p, s, o, a, u) : await d();
4941
4941
  }
4942
4942
  case "SpecificResource":
4943
4943
  case "Image":
@@ -4946,7 +4946,7 @@ function oc(e = $i, t = {}) {
4946
4946
  case "Text":
4947
4947
  case "TextualBody":
4948
4948
  case "Video":
4949
- return u && !l.width && (l.width = u.width, l.height = u.height), r.getThumbnailFromResource(l, s, a, o);
4949
+ return u && !l.width && (l.width = u.width, l.height = u.height), r.getThumbnailFromResource(l, s, o, a);
4950
4950
  }
4951
4951
  return await d();
4952
4952
  }
@@ -4954,25 +4954,25 @@ function oc(e = $i, t = {}) {
4954
4954
  getBestThumbnailAtSize: i
4955
4955
  };
4956
4956
  }
4957
- function cc(e, t, { canvasId: r, manifestId: i } = {}) {
4958
- const n = V(), s = Ut(), a = E(() => oc(n, { imageServiceLoader: s }), [n, s]), [o, u] = B(), d = ke(i ? { id: i } : void 0), l = ue(r ? { id: r } : void 0), p = l || d, v = ge(!1);
4957
+ function uc(e, t, { canvasId: r, manifestId: i } = {}) {
4958
+ const n = V(), s = Ut(), o = E(() => cc(n, { imageServiceLoader: s }), [n, s]), [a, u] = B(), d = ke(i ? { id: i } : void 0), l = ue(r ? { id: r } : void 0), p = l || d, v = ge(!1);
4959
4959
  if (K(() => (v.current = !1, () => {
4960
4960
  v.current = !0;
4961
4961
  }), []), !p)
4962
4962
  throw new Error("Must be called under a manifest or canvas context.");
4963
- return sc(
4963
+ return oc(
4964
4964
  (m) => {
4965
- a.getBestThumbnailAtSize(p, e, t).then((h) => {
4965
+ o.getBestThumbnailAtSize(p, e, t).then((h) => {
4966
4966
  h.best && !v.current && u(h.best);
4967
4967
  });
4968
4968
  },
4969
4969
  [p]
4970
- ), o;
4970
+ ), a;
4971
4971
  }
4972
- function uc(e) {
4972
+ function lc(e) {
4973
4973
  return { isMuted: !1, playRequested: !1, isPlaying: !1, isFinished: !1, volume: 100, duration: e };
4974
4974
  }
4975
- function lc(e, t) {
4975
+ function fc(e, t) {
4976
4976
  switch (t.type) {
4977
4977
  case "FINISHED":
4978
4978
  return { ...e, isFinished: !0, isPlaying: !1, playRequested: !1 };
@@ -4995,22 +4995,22 @@ function lc(e, t) {
4995
4995
  }
4996
4996
  return e;
4997
4997
  }
4998
- function fc(e) {
4998
+ function pc(e) {
4999
4999
  const t = Math.round(e);
5000
5000
  return `${Math.floor(t / 60)}:${`${t % 60}`.padStart(2, "0")}`;
5001
5001
  }
5002
5002
  function Nt(e) {
5003
- const [t, r] = on(lc, uc(e.duration)), i = ge(null), n = ge(null), s = ge(null), a = ge(!1), o = D(() => {
5004
- n.current && i.current && (n.current.innerHTML = fc(i.current.currentTime), s.current && (s.current.style.width = `${i.current.currentTime / e.duration * 100}%`), a.current !== i.current.muted && (a.current = i.current.muted, r(i.current.muted ? { type: "MUTE" } : { type: "UNMUTE" })));
5003
+ const [t, r] = an(fc, lc(e.duration)), i = ge(null), n = ge(null), s = ge(null), o = ge(!1), a = D(() => {
5004
+ n.current && i.current && (n.current.innerHTML = pc(i.current.currentTime), s.current && (s.current.style.width = `${i.current.currentTime / e.duration * 100}%`), o.current !== i.current.muted && (o.current = i.current.muted, r(i.current.muted ? { type: "MUTE" } : { type: "UNMUTE" })));
5005
5005
  }, [e.duration]), u = D(() => {
5006
5006
  i.current && (r({ type: "PLAY_REQUESTED" }), i.current.play().then(() => {
5007
5007
  r({ type: "PLAY" });
5008
- }), o());
5009
- }, [o]), d = D(() => {
5008
+ }), a());
5009
+ }, [a]), d = D(() => {
5010
5010
  i.current && (i.current.duration > 0 && i.current.paused ? u() : l());
5011
- }, [o]), l = D(() => {
5012
- i.current && (i.current.pause(), r({ type: "PAUSE" }), o());
5013
- }, [o]), p = D(() => {
5011
+ }, [a]), l = D(() => {
5012
+ i.current && (i.current.pause(), r({ type: "PAUSE" }), a());
5013
+ }, [a]), p = D(() => {
5014
5014
  i.current && (i.current.muted = !i.current.muted, r(i.current.muted ? { type: "MUTE" } : { type: "UNMUTE" }));
5015
5015
  }, []), v = D(() => {
5016
5016
  i.current && (i.current.muted = !0, r({ type: "MUTE" }));
@@ -5019,16 +5019,16 @@ function Nt(e) {
5019
5019
  }, []), h = D((A) => {
5020
5020
  i.current && (i.current.muted = !1, i.current.volume = A / 100, r({ type: "SET_VOLUME", volume: A }));
5021
5021
  }, []), g = D((A) => {
5022
- i.current && (i.current.currentTime = Math.max(0, Math.min(A * e.duration, e.duration)), o());
5022
+ i.current && (i.current.currentTime = Math.max(0, Math.min(A * e.duration, e.duration)), a());
5023
5023
  }, []), b = D((A) => {
5024
- i.current && (i.current.currentTime = Math.max(0, Math.min(A, e.duration)), o());
5024
+ i.current && (i.current.currentTime = Math.max(0, Math.min(A, e.duration)), a());
5025
5025
  }, []);
5026
5026
  return K(() => {
5027
5027
  const A = setInterval(() => {
5028
- o();
5028
+ a();
5029
5029
  }, 350);
5030
5030
  return () => clearInterval(A);
5031
- }, [o, e.duration]), K(() => {
5031
+ }, [a, e.duration]), K(() => {
5032
5032
  const A = () => {
5033
5033
  r({ type: "FINISHED" });
5034
5034
  }, w = i.current;
@@ -5050,19 +5050,19 @@ function Nt(e) {
5050
5050
  ];
5051
5051
  }
5052
5052
  const Di = ce(null), qi = ce(null), _i = ce(null);
5053
- function Oc() {
5053
+ function Ec() {
5054
5054
  const e = H(Di);
5055
5055
  if (!e)
5056
5056
  throw new Error("Ctx not found");
5057
5057
  return e;
5058
5058
  }
5059
- function Ec() {
5059
+ function Pc() {
5060
5060
  const e = H(qi);
5061
5061
  if (!e)
5062
5062
  throw new Error("Ctx not found");
5063
5063
  return e;
5064
5064
  }
5065
- function Pc() {
5065
+ function Lc() {
5066
5066
  const e = H(_i);
5067
5067
  if (!e)
5068
5068
  throw new Error("Ctx not found");
@@ -5079,12 +5079,12 @@ function Ui({
5079
5079
  return /* @__PURE__ */ x(_i.Provider, { value: { currentTime: i, progress: n, element: s }, children: /* @__PURE__ */ x(qi.Provider, { value: e, children: /* @__PURE__ */ x(Di.Provider, { value: t, children: r }) }) });
5080
5080
  }
5081
5081
  function Vi({ media: e, children: t }) {
5082
- const [{ element: r, currentTime: i, progress: n }, s, a] = Nt({ duration: e.duration });
5082
+ const [{ element: r, currentTime: i, progress: n }, s, o] = Nt({ duration: e.duration });
5083
5083
  return /* @__PURE__ */ N(
5084
5084
  Ui,
5085
5085
  {
5086
5086
  state: s,
5087
- actions: a,
5087
+ actions: o,
5088
5088
  currentTime: i,
5089
5089
  progress: n,
5090
5090
  element: r,
@@ -5130,24 +5130,24 @@ function Bi({
5130
5130
  mediaControlsDeps: t,
5131
5131
  children: r
5132
5132
  }) {
5133
- const [{ element: i, currentTime: n, progress: s }, a, o] = Nt({ duration: e.duration });
5133
+ const [{ element: i, currentTime: n, progress: s }, o, a] = Nt({ duration: e.duration });
5134
5134
  return Le("overlay", "video-element", Hi, {
5135
5135
  element: i,
5136
5136
  media: e,
5137
- playPause: o.playPause
5137
+ playPause: a.playPause
5138
5138
  }), Le(
5139
5139
  "portal",
5140
5140
  "custom-controls",
5141
5141
  Ui,
5142
5142
  {
5143
- state: a,
5144
- actions: o,
5143
+ state: o,
5144
+ actions: a,
5145
5145
  currentTime: n,
5146
5146
  progress: s,
5147
5147
  element: i,
5148
5148
  children: r
5149
5149
  },
5150
- [n, a, e, ...t || []]
5150
+ [n, o, e, ...t || []]
5151
5151
  ), null;
5152
5152
  }
5153
5153
  function zi({ model: e }) {
@@ -5193,7 +5193,7 @@ function Qi({ style: e }) {
5193
5193
  );
5194
5194
  }
5195
5195
  const Yi = me.createContext("en");
5196
- function Lc(e) {
5196
+ function Fc(e) {
5197
5197
  return /* @__PURE__ */ x(Yi.Provider, { value: e.language, children: e.children });
5198
5198
  }
5199
5199
  function Ht() {
@@ -5202,7 +5202,7 @@ function Ht() {
5202
5202
  function dr(e) {
5203
5203
  return e.indexOf("-") !== -1 ? e.slice(0, e.indexOf("-")) : e;
5204
5204
  }
5205
- function pc({ as: e, language: t, children: r, viewingDirection: i, ...n }) {
5205
+ function dc({ as: e, language: t, children: r, viewingDirection: i, ...n }) {
5206
5206
  const s = Ht();
5207
5207
  return E(() => dr(s) === dr(t), [s, t]) ? e ? /* @__PURE__ */ x(e, { ...n, children: r }) : /* @__PURE__ */ x("span", { ...n, children: r }) : e ? /* @__PURE__ */ x(e, { ...n, lang: t, dir: i, children: r }) : /* @__PURE__ */ x("span", { ...n, lang: t, dir: i, children: r });
5208
5208
  }
@@ -5221,15 +5221,15 @@ function Gi(e, t, r) {
5221
5221
  return n;
5222
5222
  return t.indexOf("none") !== -1 ? "none" : t.indexOf("@none") !== -1 ? "@none" : t[0];
5223
5223
  }
5224
- const dc = (e, t = []) => {
5224
+ const hc = (e, t = []) => {
5225
5225
  const r = Ht();
5226
5226
  return E(() => {
5227
5227
  const i = e();
5228
5228
  return Gi(r, i, []);
5229
5229
  }, [r, ...t]);
5230
5230
  };
5231
- function hc(e, t) {
5232
- const r = dc(() => Object.keys(e || {}), [e]);
5231
+ function yc(e, t) {
5232
+ const r = hc(() => Object.keys(e || {}), [e]);
5233
5233
  return [
5234
5234
  E(() => {
5235
5235
  if (!e)
@@ -5243,27 +5243,27 @@ function hc(e, t) {
5243
5243
  r
5244
5244
  ];
5245
5245
  }
5246
- function Fc() {
5246
+ function jc() {
5247
5247
  const e = Ht();
5248
5248
  return function(r, i, n) {
5249
- const s = Object.keys(r || {}), a = Gi(e, s, []);
5249
+ const s = Object.keys(r || {}), o = Gi(e, s, []);
5250
5250
  if (!r)
5251
5251
  return i || "";
5252
5252
  if (typeof r == "string")
5253
5253
  return r;
5254
- const o = a ? r[a] : void 0;
5255
- return o ? typeof o == "string" ? o : o.join(typeof n < "u" ? n : `
5254
+ const a = o ? r[o] : void 0;
5255
+ return a ? typeof a == "string" ? a : a.join(typeof n < "u" ? n : `
5256
5256
  `) : "";
5257
5257
  };
5258
5258
  }
5259
- const yc = ({ as: e, defaultText: t, enableDangerouslySetInnerHTML: r, children: i, ...n }) => {
5260
- const [s, a] = hc(i, t);
5261
- return a ? /* @__PURE__ */ x(
5262
- pc,
5259
+ const vc = ({ as: e, defaultText: t, enableDangerouslySetInnerHTML: r, children: i, ...n }) => {
5260
+ const [s, o] = yc(i, t);
5261
+ return o ? /* @__PURE__ */ x(
5262
+ dc,
5263
5263
  {
5264
5264
  ...n,
5265
5265
  as: e,
5266
- language: a,
5266
+ language: o,
5267
5267
  title: r ? void 0 : s,
5268
5268
  dangerouslySetInnerHTML: r ? {
5269
5269
  __html: s
@@ -5282,7 +5282,7 @@ const yc = ({ as: e, defaultText: t, enableDangerouslySetInnerHTML: r, children:
5282
5282
  }
5283
5283
  );
5284
5284
  };
5285
- function vc({
5285
+ function gc({
5286
5286
  element: e,
5287
5287
  media: t,
5288
5288
  playPause: r
@@ -5320,16 +5320,16 @@ function vc({
5320
5320
  )
5321
5321
  ] }) : null;
5322
5322
  }
5323
- function gc({
5323
+ function mc({
5324
5324
  media: e,
5325
5325
  mediaControlsDeps: t,
5326
5326
  children: r
5327
5327
  }) {
5328
- const [{ element: i, currentTime: n, progress: s }, a, o] = Nt({ duration: e.duration });
5329
- return Le("overlay", "video-element", vc, {
5328
+ const [{ element: i, currentTime: n, progress: s }, o, a] = Nt({ duration: e.duration });
5329
+ return Le("overlay", "video-element", gc, {
5330
5330
  element: i,
5331
5331
  media: e,
5332
- playPause: o.playPause
5332
+ playPause: a.playPause
5333
5333
  }), null;
5334
5334
  }
5335
5335
  function Ji({
@@ -5339,8 +5339,8 @@ function Ji({
5339
5339
  registerActions: i,
5340
5340
  defaultChoices: n,
5341
5341
  isStatic: s,
5342
- renderViewerControls: a,
5343
- renderMediaControls: o,
5342
+ renderViewerControls: o,
5343
+ renderMediaControls: a,
5344
5344
  viewControlsDeps: u,
5345
5345
  mediaControlsDeps: d,
5346
5346
  strategies: l,
@@ -5353,7 +5353,7 @@ function Ji({
5353
5353
  onClickPaintingAnnotation: A,
5354
5354
  children: w
5355
5355
  }) {
5356
- const C = ue(), T = ei(C, ["deep-zoom"]), [j] = Qs(), I = Js(), L = V(), P = E(() => jt(L), [L]), [M, $] = nc({
5356
+ const C = ue(), T = ei(C, ["deep-zoom"]), [j] = Ys(), I = Ks(), L = V(), P = E(() => jt(L), [L]), [M, $] = sc({
5357
5357
  strategies: l || ["images"],
5358
5358
  defaultChoices: n == null ? void 0 : n.map(({ id: O }) => O)
5359
5359
  }), ie = M.type === "images" ? M.choice : void 0, Z = E(() => h ? 1 : Math.max(
@@ -5363,7 +5363,7 @@ function Ji({
5363
5363
  return (O.width || 0) / ((W = O.target) == null ? void 0 : W.spatial.width);
5364
5364
  }) : []
5365
5365
  ), [h, M]);
5366
- Ks(Z), K(() => {
5366
+ Zs(Z), K(() => {
5367
5367
  i && i($);
5368
5368
  }, [M.annotations]), K(() => {
5369
5369
  if (n)
@@ -5374,16 +5374,16 @@ function Ji({
5374
5374
  }, [n]), hr(() => {
5375
5375
  r && r(ie);
5376
5376
  }, [ie]), Le(
5377
- I && (M.type === "images" || M.type === "empty" || M.type === "textual-content" && a) ? "overlay" : "none",
5377
+ I && (M.type === "images" || M.type === "empty" || M.type === "textual-content" && o) ? "overlay" : "none",
5378
5378
  `canvas-portal-controls-${C == null ? void 0 : C.id}`,
5379
5379
  Ft.Provider,
5380
- a ? {
5380
+ o ? {
5381
5381
  value: I || null,
5382
- children: a(M)
5382
+ children: o(M)
5383
5383
  } : {},
5384
5384
  [C, I, M, ...u || []]
5385
5385
  );
5386
- const U = cc({ maxWidth: 256, maxHeight: 256 });
5386
+ const U = uc({ maxWidth: 256, maxHeight: 256 });
5387
5387
  if (!C)
5388
5388
  return null;
5389
5389
  const z = C.accompanyingCanvas, ee = U && U.type === "fixed" ? /* @__PURE__ */ x("world-object", { height: C.height, width: C.width, x: e, y: t, children: /* @__PURE__ */ x(
@@ -5425,13 +5425,13 @@ function Ji({
5425
5425
  var X;
5426
5426
  return /* @__PURE__ */ N(Me, { children: [
5427
5427
  /* @__PURE__ */ x(
5428
- dn,
5428
+ hn,
5429
5429
  {
5430
5430
  onClick: A ? (de) => {
5431
5431
  de.stopPropagation(), A(O.annotationId, O, de);
5432
5432
  } : void 0,
5433
5433
  target: ((X = O.target) == null ? void 0 : X.spatial) || void 0,
5434
- children: /* @__PURE__ */ x("div", { "data-textual-content": !0, children: /* @__PURE__ */ x(yc, { enableDangerouslySetInnerHTML: !0, children: O.text }) })
5434
+ children: /* @__PURE__ */ x("div", { "data-textual-content": !0, children: /* @__PURE__ */ x(vc, { enableDangerouslySetInnerHTML: !0, children: O.text }) })
5435
5435
  },
5436
5436
  W
5437
5437
  ),
@@ -5440,7 +5440,7 @@ function Ji({
5440
5440
  }) : null,
5441
5441
  M.type === "images" ? /* @__PURE__ */ N(Me, { children: [
5442
5442
  M.images.map((O, W) => /* @__PURE__ */ x(
5443
- oi,
5443
+ ai,
5444
5444
  {
5445
5445
  isStatic: s,
5446
5446
  image: O,
@@ -5459,70 +5459,79 @@ function Ji({
5459
5459
  M.type === "3d-model" ? /* @__PURE__ */ x(Wi, { model: M.model }) : null,
5460
5460
  M.type === "media" ? /* @__PURE__ */ x(Me, { children: M.media.type === "Sound" ? /* @__PURE__ */ N(Ni, { media: M.media, mediaControlsDeps: d, children: [
5461
5461
  ee,
5462
- o ? o(M) : null
5462
+ a ? a(M) : null
5463
5463
  ] }) : M.media.type === "Video" ? /* @__PURE__ */ N(Bi, { media: M.media, mediaControlsDeps: d, children: [
5464
5464
  ee,
5465
- o ? o(M) : null
5466
- ] }) : M.media.type === "VideoYouTube" && b ? /* @__PURE__ */ N(gc, { media: M.media, mediaControlsDeps: d, children: [
5465
+ a ? a(M) : null
5466
+ ] }) : M.media.type === "VideoYouTube" && b ? /* @__PURE__ */ N(mc, { media: M.media, mediaControlsDeps: d, children: [
5467
5467
  ee,
5468
- o ? o(M) : null
5468
+ a ? a(M) : null
5469
5469
  ] }) : null }) : null
5470
5470
  ]
5471
5471
  },
5472
5472
  `${C.id}/${M.type}/${xe}`
5473
5473
  ),
5474
- M.type === "media" && M.media.type === "Sound" && z ? /* @__PURE__ */ x(Lt, { canvas: z.id, children: /* @__PURE__ */ x(Ji, { renderViewerControls: a }) }) : null
5474
+ M.type === "media" && M.media.type === "Sound" && z ? /* @__PURE__ */ x(Lt, { canvas: z.id, children: /* @__PURE__ */ x(Ji, { renderViewerControls: o }) }) : null
5475
5475
  ] });
5476
5476
  }
5477
- function mc() {
5477
+ function bc() {
5478
5478
  const e = H(tt);
5479
5479
  return e && e.vault ? e.vault : Vr();
5480
5480
  }
5481
- const bc = yr(function(t, r) {
5482
- const i = ke(), n = Br(), s = ws(), { ViewerControls: a, MediaControls: o } = t.components || {};
5481
+ const Ac = yr(function(t, r) {
5482
+ const i = ke(), n = Br(), s = Ss(), { ViewerControls: o, MediaControls: a } = t.components || {};
5483
5483
  if (cn(r, () => s, [s]), !i)
5484
5484
  return /* @__PURE__ */ x("div", {});
5485
5485
  let u = 0;
5486
5486
  return /* @__PURE__ */ N(Me, { children: [
5487
5487
  t.header,
5488
- /* @__PURE__ */ x(J.Viewer, { height: t.height, children: n.map((d, l) => {
5489
- const p = u;
5490
- return u += d.width + (t.spacing || 0), /* @__PURE__ */ x(Lt, { canvas: d.id, children: /* @__PURE__ */ x(
5491
- J.RenderCanvas,
5492
- {
5493
- strategies: ["3d-model", "media", "images", "empty", "textual-content"],
5494
- renderViewerControls: l === 0 && a ? () => /* @__PURE__ */ x(a, {}) : void 0,
5495
- renderMediaControls: l === 0 && o ? () => /* @__PURE__ */ x(o, {}) : void 0,
5496
- x: p,
5497
- ...t.canvasProps || {},
5498
- children: t.annotations
5499
- },
5500
- d.id
5501
- ) }, d.id);
5502
- }) }, t.reuseAtlas ? "" : s.currentSequenceIndex),
5488
+ /* @__PURE__ */ x(
5489
+ J.Viewer,
5490
+ {
5491
+ height: t.height,
5492
+ mode: t.mode,
5493
+ children: n.map((d, l) => {
5494
+ const p = u;
5495
+ return u += d.width + (t.spacing || 0), /* @__PURE__ */ x(Lt, { canvas: d.id, children: /* @__PURE__ */ x(
5496
+ J.RenderCanvas,
5497
+ {
5498
+ strategies: ["3d-model", "media", "images", "empty", "textual-content"],
5499
+ renderViewerControls: l === 0 && o ? () => /* @__PURE__ */ x(o, {}) : void 0,
5500
+ renderMediaControls: l === 0 && a ? () => /* @__PURE__ */ x(a, {}) : void 0,
5501
+ x: p,
5502
+ ...t.canvasProps || {},
5503
+ children: t.annotations
5504
+ },
5505
+ d.id
5506
+ ) }, d.id);
5507
+ })
5508
+ },
5509
+ t.reuseAtlas ? "" : s.currentSequenceIndex
5510
+ ),
5503
5511
  t.children
5504
5512
  ] });
5505
- }), J = yr(function({ children: t, height: r, annotations: i, canvasProps: n, spacing: s, header: a, components: o, ...u }, d) {
5506
- const l = mc();
5507
- return /* @__PURE__ */ x(Nr, { vault: l, children: /* @__PURE__ */ x(xs, { ...u, children: /* @__PURE__ */ x(
5508
- bc,
5513
+ }), J = yr(function({ children: t, height: r, annotations: i, canvasProps: n, spacing: s, header: o, components: a, mode: u, ...d }, l) {
5514
+ const p = bc();
5515
+ return /* @__PURE__ */ x(Nr, { vault: p, children: /* @__PURE__ */ x(ws, { ...d, children: /* @__PURE__ */ x(
5516
+ Ac,
5509
5517
  {
5510
- ref: d,
5518
+ ref: l,
5511
5519
  height: r,
5512
- components: o,
5520
+ components: a,
5513
5521
  spacing: s,
5514
5522
  canvasProps: n,
5515
5523
  annotations: i,
5516
- header: a,
5524
+ header: o,
5525
+ mode: u,
5517
5526
  children: t
5518
5527
  }
5519
5528
  ) }) });
5520
5529
  });
5521
- J.RenderImage = oi;
5530
+ J.RenderImage = ai;
5522
5531
  J.RenderCanvas = Ji;
5523
5532
  J.RenderAnnotationPage = It;
5524
- J.RenderAnnotation = ai;
5525
- J.Viewer = Zs;
5533
+ J.RenderAnnotation = oi;
5534
+ J.Viewer = Xs;
5526
5535
  J.CanvasBackground = Qi;
5527
5536
  J.Audio = Ni;
5528
5537
  J.Video = Bi;
@@ -5530,64 +5539,64 @@ J.Model = Wi;
5530
5539
  J.AudioHTML = Vi;
5531
5540
  J.VideoHTML = Hi;
5532
5541
  J.ModelHTML = zi;
5533
- function jc({ annotation: e, children: t }) {
5542
+ function $c({ annotation: e, children: t }) {
5534
5543
  return /* @__PURE__ */ x(Te, { value: { annotation: e }, children: t });
5535
5544
  }
5536
- function $c({ annotationPage: e, children: t }) {
5545
+ function Dc({ annotationPage: e, children: t }) {
5537
5546
  return /* @__PURE__ */ x(Te, { value: { annotationPage: e }, children: t });
5538
5547
  }
5539
- function Dc({ collection: e, children: t }) {
5548
+ function qc({ collection: e, children: t }) {
5540
5549
  return /* @__PURE__ */ x(Te, { value: { collection: e }, children: t });
5541
5550
  }
5542
- function qc(e, t = {}) {
5551
+ function _c(e, t = {}) {
5543
5552
  return Vt(t);
5544
5553
  }
5545
- function _c(e, t = !1) {
5554
+ function Uc(e, t = !1) {
5546
5555
  }
5547
- function Uc(e) {
5556
+ function Vc(e) {
5548
5557
  const r = be().manifest, i = e ? e.map((n) => typeof n == "string" ? n : n == null ? void 0 : n.id) : [];
5549
5558
  return Q(
5550
5559
  (n) => {
5551
- const s = r ? n.iiif.entities.Manifest[r] : void 0, a = (s == null ? void 0 : s.items) || [];
5560
+ const s = r ? n.iiif.entities.Manifest[r] : void 0, o = (s == null ? void 0 : s.items) || [];
5552
5561
  if (typeof e > "u")
5553
- return a;
5554
- const o = [];
5562
+ return o;
5563
+ const a = [];
5555
5564
  for (const u of (s == null ? void 0 : s.items) || [])
5556
- i.indexOf(u.id) !== -1 && o.push(u);
5557
- return o;
5565
+ i.indexOf(u.id) !== -1 && a.push(u);
5566
+ return a;
5558
5567
  },
5559
5568
  [i.join("/")]
5560
5569
  );
5561
5570
  }
5562
- function Vc(e, t = []) {
5563
- const { id: r, selector: i } = e, n = be(), s = r || n.collection, a = Q(
5564
- (o) => s ? o.iiif.entities.Collection[s] : void 0,
5571
+ function Nc(e, t = []) {
5572
+ const { id: r, selector: i } = e, n = be(), s = r || n.collection, o = Q(
5573
+ (a) => s ? a.iiif.entities.Collection[s] : void 0,
5565
5574
  [s]
5566
5575
  );
5567
5576
  return E(() => {
5568
- if (a)
5569
- return i ? i(a) : a;
5570
- }, [a, i, ...t]);
5577
+ if (o)
5578
+ return i ? i(o) : o;
5579
+ }, [o, i, ...t]);
5571
5580
  }
5572
- function Nc(e, t, r, i, n = []) {
5573
- const s = V(), a = E(() => Xr(s), [s]);
5581
+ function Hc(e, t, r, i, n = []) {
5582
+ const s = V(), o = E(() => Xr(s), [s]);
5574
5583
  K(() => {
5575
- const o = e;
5576
- return o ? (a.addEventListener(o, t, r, i), () => {
5577
- a.removeEventListener(o, t, r);
5584
+ const a = e;
5585
+ return a ? (o.addEventListener(a, t, r, i), () => {
5586
+ o.removeEventListener(a, t, r);
5578
5587
  }) : () => {
5579
5588
  };
5580
- }, [a, e, t, ...n]);
5589
+ }, [o, e, t, ...n]);
5581
5590
  }
5582
- function Hc(e, t) {
5583
- const { id: r, isLoaded: i, error: n, resource: s, requestId: a, cached: o } = Hr(
5591
+ function Bc(e, t) {
5592
+ const { id: r, isLoaded: i, error: n, resource: s, requestId: o, cached: a } = Hr(
5584
5593
  e,
5585
5594
  t
5586
5595
  );
5587
- return { id: r, isLoaded: i, error: n, manifest: s, requestId: a, cached: o };
5596
+ return { id: r, isLoaded: i, error: n, manifest: s, requestId: o, cached: a };
5588
5597
  }
5589
- function Ac({ cacheKey: e } = {}) {
5590
- const t = ue(), r = Vt(), i = V(), n = Ut(), [s, a] = B(void 0), [o, u] = B(!1), [d, l] = B("idle"), [p, v] = B(void 0), m = t ? t.id : "undefined", h = E(() => {
5598
+ function xc({ cacheKey: e } = {}) {
5599
+ const t = ue(), r = Vt(), i = V(), n = Ut(), [s, o] = B(void 0), [a, u] = B(!1), [d, l] = B("idle"), [p, v] = B(void 0), m = t ? t.id : "undefined", h = E(() => {
5591
5600
  try {
5592
5601
  if (t && r.length) {
5593
5602
  const b = r[0], A = i.get(b.body[0]), C = mt(A)[0];
@@ -5615,7 +5624,7 @@ function Ac({ cacheKey: e } = {}) {
5615
5624
  width: C.width || t.width,
5616
5625
  height: C.height || t.height
5617
5626
  }) || void 0;
5618
- a(T), l("success"), u(!1);
5627
+ o(T), l("success"), u(!1);
5619
5628
  } catch (T) {
5620
5629
  l("error"), v(T);
5621
5630
  }
@@ -5626,13 +5635,13 @@ function Ac({ cacheKey: e } = {}) {
5626
5635
  })();
5627
5636
  }, [m, e]), E(() => ({
5628
5637
  data: g,
5629
- isFetching: o,
5638
+ isFetching: a,
5630
5639
  status: d,
5631
5640
  error: p
5632
- }), [g, o, d, p]);
5641
+ }), [g, a, d, p]);
5633
5642
  }
5634
- function Bc() {
5635
- const e = Ac();
5643
+ function zc() {
5644
+ const e = xc();
5636
5645
  return {
5637
5646
  isLoading: e.isFetching,
5638
5647
  tile: e.data ? {
@@ -5644,106 +5653,106 @@ function Bc() {
5644
5653
  } : null
5645
5654
  };
5646
5655
  }
5647
- function zc() {
5656
+ function Wc() {
5648
5657
  const e = ke();
5649
5658
  return e ? e.service.find(
5650
5659
  (t) => t.profile === "SearchService1" || t.profile === "http://iiif.io/api/search/1/search"
5651
5660
  ) : void 0;
5652
5661
  }
5653
- function Wc() {
5662
+ function Qc() {
5654
5663
  const e = V();
5655
5664
  return E(() => jt(e), [e]);
5656
5665
  }
5657
5666
  export {
5658
- jc as AnnotationContext,
5659
- $c as AnnotationPageContext,
5667
+ $c as AnnotationContext,
5668
+ Dc as AnnotationPageContext,
5660
5669
  Lt as CanvasContext,
5661
5670
  J as CanvasPanel,
5662
- Dc as CollectionContext,
5663
- Cs as ContextBridge,
5664
- Wo as ImageServiceLoaderContext,
5665
- As as InnerViewerProvider,
5666
- Lc as LanguageProvider,
5667
- pc as LanguageString,
5668
- yc as LocaleString,
5669
- ys as ManifestContext,
5671
+ qc as CollectionContext,
5672
+ Ms as ContextBridge,
5673
+ Qa as ImageServiceLoaderContext,
5674
+ xs as InnerViewerProvider,
5675
+ Fc as LanguageProvider,
5676
+ dc as LanguageString,
5677
+ vc as LocaleString,
5678
+ vs as ManifestContext,
5670
5679
  Ui as MediaPlayerProvider,
5671
- vs as RangeContext,
5680
+ gs as RangeContext,
5672
5681
  tt as ReactVaultContext,
5673
5682
  Te as ResourceProvider,
5674
5683
  Et as ResourceReactContext,
5675
- xs as SimpleViewerProvider,
5684
+ ws as SimpleViewerProvider,
5676
5685
  it as SimpleViewerReactContext,
5677
5686
  Nr as VaultProvider,
5678
5687
  Ft as ViewerPresetContext,
5679
- Ys as VirtualAnnotationProvider,
5688
+ Gs as VirtualAnnotationProvider,
5680
5689
  rt as VisibleCanvasReactContext,
5681
- qo as emptyActions,
5682
- _o as emptyStrategy,
5690
+ _a as emptyActions,
5691
+ Ua as emptyStrategy,
5683
5692
  Re as expandTarget,
5684
5693
  zr as findAllCanvasesInRange,
5685
- gs as findFirstCanvasFromRange,
5686
- Ic as findManifestSelectedRange,
5694
+ ms as findFirstCanvasFromRange,
5695
+ Tc as findManifestSelectedRange,
5687
5696
  Wr as findSelectedRange,
5688
- No as flattenAnnotationPageIds,
5689
- fc as formatTime,
5690
- Ko as getImageStrategy,
5697
+ Ha as flattenAnnotationPageIds,
5698
+ pc as formatTime,
5699
+ Za as getImageStrategy,
5691
5700
  Qr as getManifestSequence,
5692
5701
  Li as getParsedTargetSelector,
5693
- Tc as getVisibleCanvasesFromCanvasId,
5694
- Sa as isImageApiSelector,
5695
- Ca as parseRotation,
5702
+ kc as getVisibleCanvasesFromCanvasId,
5703
+ Mo as isImageApiSelector,
5704
+ Ro as parseRotation,
5696
5705
  Ye as parseSelector,
5697
- kc as parseSpecificResource,
5706
+ Oc as parseSpecificResource,
5698
5707
  gt as unknownResponse,
5699
5708
  _ as unsupportedStrategy,
5700
5709
  si as useAnnotation,
5701
- Ma as useAnnotationPage,
5702
- Bo as useAnnotationPageManager,
5703
- qc as useAnnotationsAtTime,
5710
+ Io as useAnnotationPage,
5711
+ za as useAnnotationPageManager,
5712
+ _c as useAnnotationsAtTime,
5704
5713
  ue as useCanvas,
5705
- _c as useCanvasClock,
5706
- bs as useCanvasSequence,
5707
- Uc as useCanvasSubset,
5708
- dc as useClosestLanguage,
5709
- Vc as useCollection,
5710
- Ss as useContextBridge,
5711
- Fc as useCreateLocaleString,
5712
- zs as useDispatch,
5713
- Nc as useEventListener,
5714
- mc as useExistingVault,
5715
- Hc as useExternalCollection,
5716
- hs as useExternalManifest,
5714
+ Uc as useCanvasClock,
5715
+ As as useCanvasSequence,
5716
+ Vc as useCanvasSubset,
5717
+ hc as useClosestLanguage,
5718
+ Nc as useCollection,
5719
+ Cs as useContextBridge,
5720
+ jc as useCreateLocaleString,
5721
+ Ws as useDispatch,
5722
+ Hc as useEventListener,
5723
+ bc as useExistingVault,
5724
+ Bc as useExternalCollection,
5725
+ ys as useExternalManifest,
5717
5726
  Hr as useExternalResource,
5718
5727
  Ht as useIIIFLanguage,
5719
- Ac as useImageService,
5728
+ xc as useImageService,
5720
5729
  Ut as useImageServiceLoader,
5721
- Bc as useImageTile,
5722
- Qo as useLoadImageService,
5723
- hc as useLocaleString,
5730
+ zc as useImageTile,
5731
+ Ya as useLoadImageService,
5732
+ yc as useLocaleString,
5724
5733
  ke as useManifest,
5725
- Ec as useMediaActions,
5726
- Pc as useMediaElements,
5727
- Oc as useMediaState,
5728
- Jo as usePaintables,
5734
+ Pc as useMediaActions,
5735
+ Lc as useMediaElements,
5736
+ Ec as useMediaState,
5737
+ Ka as usePaintables,
5729
5738
  Vt as usePaintingAnnotations,
5730
- ms as useRange,
5731
- nc as useRenderingStrategy,
5739
+ bs as useRange,
5740
+ sc as useRenderingStrategy,
5732
5741
  be as useResourceContext,
5733
5742
  ei as useResourceEvents,
5734
- zo as useResources,
5735
- zc as useSearchService,
5743
+ Wa as useResources,
5744
+ Wc as useSearchService,
5736
5745
  Nt as useSimpleMediaPlayer,
5737
- ws as useSimpleViewer,
5738
- Wc as useStyleHelper,
5746
+ Ss as useSimpleViewer,
5747
+ Qc as useStyleHelper,
5739
5748
  et as useStyles,
5740
- cc as useThumbnail,
5749
+ uc as useThumbnail,
5741
5750
  V as useVault,
5742
- sc as useVaultEffect,
5751
+ oc as useVaultEffect,
5743
5752
  Q as useVaultSelector,
5744
- Js as useViewerPreset,
5745
- Ws as useVirtualAnnotationPage,
5746
- Qs as useVirtualAnnotationPageContext,
5753
+ Ks as useViewerPreset,
5754
+ Qs as useVirtualAnnotationPage,
5755
+ Ys as useVirtualAnnotationPageContext,
5747
5756
  Br as useVisibleCanvases
5748
5757
  };
5749
5758
  //# sourceMappingURL=index.mjs.map