@annotorious/react 3.0.19 → 3.0.21

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,4 +1,4 @@
1
- import { offset as I, shift as J, flip as K, inline as N, computePosition as Q, arrow as v } from "./annotorious-react.es16.js";
1
+ import { offset as I, shift as J, flip as K, inline as N, computePosition as Q, arrow as A } from "./annotorious-react.es16.js";
2
2
  import { autoUpdate as le, platform as ce } from "./annotorious-react.es16.js";
3
3
  import * as f from "react";
4
4
  import { useLayoutEffect as T, useEffect as X } from "react";
@@ -34,11 +34,11 @@ function h(e, t) {
34
34
  }
35
35
  return e !== e && t !== t;
36
36
  }
37
- function q(e) {
37
+ function v(e) {
38
38
  return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
39
39
  }
40
- function A(e, t) {
41
- const n = q(e);
40
+ function q(e, t) {
41
+ const n = v(e);
42
42
  return Math.round(t * n) / n;
43
43
  }
44
44
  function $(e) {
@@ -128,11 +128,11 @@ function te(e) {
128
128
  };
129
129
  if (!c.floating)
130
130
  return o;
131
- const w = A(c.floating, i.x), m = A(c.floating, i.y);
131
+ const w = q(c.floating, i.x), m = q(c.floating, i.y);
132
132
  return k ? {
133
133
  ...o,
134
134
  transform: "translate(" + w + "px, " + m + "px)",
135
- ...q(c.floating) >= 1.5 && {
135
+ ...v(c.floating) >= 1.5 && {
136
136
  willChange: "transform"
137
137
  }
138
138
  } : {
@@ -161,10 +161,10 @@ const Z = (e) => {
161
161
  element: r,
162
162
  padding: s
163
163
  } = typeof e == "function" ? e(n) : e;
164
- return r && t(r) ? r.current != null ? v({
164
+ return r && t(r) ? r.current != null ? A({
165
165
  element: r.current,
166
166
  padding: s
167
- }).fn(n) : {} : r ? v({
167
+ }).fn(n) : {} : r ? A({
168
168
  element: r,
169
169
  padding: s
170
170
  }).fn(n) : {};
@@ -1,129 +1,129 @@
1
- import { offset as it, shift as nt, flip as ot, inline as st, arrow as rt, computePosition as ct } from "./annotorious-react.es28.js";
2
- import { createCoords as y, rectToClientRect as G, round as H, floor as D, max as E, min as z } from "./annotorious-react.es27.js";
3
- import { getOverflowAncestors as $, isElement as v, getWindow as L, getFrameElement as U, getComputedStyle as b, getDocumentElement as R, isHTMLElement as O, isWebKit as J, isTopLayer as M, getNodeName as S, isOverflowElement as _, getNodeScroll as A, getParentNode as W, isLastTraversableNode as N, isTableElement as lt, isContainingBlock as Q, getContainingBlock as ft } from "./annotorious-react.es21.js";
4
- function Y(t) {
5
- const e = b(t);
6
- let i = parseFloat(e.width) || 0, n = parseFloat(e.height) || 0;
7
- const o = O(t), r = o ? t.offsetWidth : i, s = o ? t.offsetHeight : n, c = H(i) !== r || H(n) !== s;
8
- return c && (i = r, n = s), {
9
- width: i,
10
- height: n,
1
+ import { offset as ot, shift as st, flip as rt, inline as ct, arrow as lt, computePosition as ft } from "./annotorious-react.es28.js";
2
+ import { createCoords as m, rectToClientRect as J, round as H, floor as A, max as E, min as z } from "./annotorious-react.es27.js";
3
+ import { getOverflowAncestors as $, isElement as v, getWindow as L, getFrameElement as K, getComputedStyle as R, getDocumentElement as O, isHTMLElement as b, isWebKit as Q, isTopLayer as M, getNodeName as S, isOverflowElement as _, getNodeScroll as I, getParentNode as W, isLastTraversableNode as N, isTableElement as ut, isContainingBlock as Y, getContainingBlock as ht } from "./annotorious-react.es21.js";
4
+ function Z(t) {
5
+ const e = R(t);
6
+ let n = parseFloat(e.width) || 0, i = parseFloat(e.height) || 0;
7
+ const o = b(t), r = o ? t.offsetWidth : n, s = o ? t.offsetHeight : i, c = H(n) !== r || H(i) !== s;
8
+ return c && (n = r, i = s), {
9
+ width: n,
10
+ height: i,
11
11
  $: c
12
12
  };
13
13
  }
14
- function k(t) {
14
+ function q(t) {
15
15
  return v(t) ? t : t.contextElement;
16
16
  }
17
17
  function F(t) {
18
- const e = k(t);
19
- if (!O(e))
20
- return y(1);
21
- const i = e.getBoundingClientRect(), {
22
- width: n,
18
+ const e = q(t);
19
+ if (!b(e))
20
+ return m(1);
21
+ const n = e.getBoundingClientRect(), {
22
+ width: i,
23
23
  height: o,
24
24
  $: r
25
- } = Y(e);
26
- let s = (r ? H(i.width) : i.width) / n, c = (r ? H(i.height) : i.height) / o;
25
+ } = Z(e);
26
+ let s = (r ? H(n.width) : n.width) / i, c = (r ? H(n.height) : n.height) / o;
27
27
  return (!s || !Number.isFinite(s)) && (s = 1), (!c || !Number.isFinite(c)) && (c = 1), {
28
28
  x: s,
29
29
  y: c
30
30
  };
31
31
  }
32
- const ut = /* @__PURE__ */ y(0);
33
- function Z(t) {
32
+ const at = /* @__PURE__ */ m(0);
33
+ function X(t) {
34
34
  const e = L(t);
35
- return !J() || !e.visualViewport ? ut : {
35
+ return !Q() || !e.visualViewport ? at : {
36
36
  x: e.visualViewport.offsetLeft,
37
37
  y: e.visualViewport.offsetTop
38
38
  };
39
39
  }
40
- function ht(t, e, i) {
41
- return e === void 0 && (e = !1), !i || e && i !== L(t) ? !1 : e;
40
+ function dt(t, e, n) {
41
+ return e === void 0 && (e = !1), !n || e && n !== L(t) ? !1 : e;
42
42
  }
43
- function T(t, e, i, n) {
44
- e === void 0 && (e = !1), i === void 0 && (i = !1);
45
- const o = t.getBoundingClientRect(), r = k(t);
46
- let s = y(1);
47
- e && (n ? v(n) && (s = F(n)) : s = F(t));
48
- const c = ht(r, i, n) ? Z(r) : y(0);
43
+ function T(t, e, n, i) {
44
+ e === void 0 && (e = !1), n === void 0 && (n = !1);
45
+ const o = t.getBoundingClientRect(), r = q(t);
46
+ let s = m(1);
47
+ e && (i ? v(i) && (s = F(i)) : s = F(t));
48
+ const c = dt(r, n, i) ? X(r) : m(0);
49
49
  let l = (o.left + c.x) / s.x, f = (o.top + c.y) / s.y, u = o.width / s.x, h = o.height / s.y;
50
50
  if (r) {
51
- const p = L(r), g = n && v(n) ? L(n) : n;
52
- let x = p, a = U(x);
53
- for (; a && n && g !== x; ) {
54
- const w = F(a), d = a.getBoundingClientRect(), m = b(a), C = d.left + (a.clientLeft + parseFloat(m.paddingLeft)) * w.x, B = d.top + (a.clientTop + parseFloat(m.paddingTop)) * w.y;
55
- l *= w.x, f *= w.y, u *= w.x, h *= w.y, l += C, f += B, x = L(a), a = U(x);
51
+ const p = L(r), a = i && v(i) ? L(i) : i;
52
+ let y = p, g = K(y);
53
+ for (; g && i && a !== y; ) {
54
+ const w = F(g), d = g.getBoundingClientRect(), x = R(g), C = d.left + (g.clientLeft + parseFloat(x.paddingLeft)) * w.x, B = d.top + (g.clientTop + parseFloat(x.paddingTop)) * w.y;
55
+ l *= w.x, f *= w.y, u *= w.x, h *= w.y, l += C, f += B, y = L(g), g = K(y);
56
56
  }
57
57
  }
58
- return G({
58
+ return J({
59
59
  width: u,
60
60
  height: h,
61
61
  x: l,
62
62
  y: f
63
63
  });
64
64
  }
65
- function q(t, e) {
66
- const i = A(t).scrollLeft;
67
- return e ? e.left + i : T(R(t)).left + i;
65
+ function k(t, e) {
66
+ const n = I(t).scrollLeft;
67
+ return e ? e.left + n : T(O(t)).left + n;
68
68
  }
69
- function X(t, e, i) {
70
- i === void 0 && (i = !1);
71
- const n = t.getBoundingClientRect(), o = n.left + e.scrollLeft - (i ? 0 : (
69
+ function tt(t, e, n) {
70
+ n === void 0 && (n = !1);
71
+ const i = t.getBoundingClientRect(), o = i.left + e.scrollLeft - (n ? 0 : (
72
72
  // RTL <body> scrollbar.
73
- q(t, n)
74
- )), r = n.top + e.scrollTop;
73
+ k(t, i)
74
+ )), r = i.top + e.scrollTop;
75
75
  return {
76
76
  x: o,
77
77
  y: r
78
78
  };
79
79
  }
80
- function at(t) {
80
+ function gt(t) {
81
81
  let {
82
82
  elements: e,
83
- rect: i,
84
- offsetParent: n,
83
+ rect: n,
84
+ offsetParent: i,
85
85
  strategy: o
86
86
  } = t;
87
- const r = o === "fixed", s = R(n), c = e ? M(e.floating) : !1;
88
- if (n === s || c && r)
89
- return i;
87
+ const r = o === "fixed", s = O(i), c = e ? M(e.floating) : !1;
88
+ if (i === s || c && r)
89
+ return n;
90
90
  let l = {
91
91
  scrollLeft: 0,
92
92
  scrollTop: 0
93
- }, f = y(1);
94
- const u = y(0), h = O(n);
95
- if ((h || !h && !r) && ((S(n) !== "body" || _(s)) && (l = A(n)), O(n))) {
96
- const g = T(n);
97
- f = F(n), u.x = g.x + n.clientLeft, u.y = g.y + n.clientTop;
93
+ }, f = m(1);
94
+ const u = m(0), h = b(i);
95
+ if ((h || !h && !r) && ((S(i) !== "body" || _(s)) && (l = I(i)), b(i))) {
96
+ const a = T(i);
97
+ f = F(i), u.x = a.x + i.clientLeft, u.y = a.y + i.clientTop;
98
98
  }
99
- const p = s && !h && !r ? X(s, l, !0) : y(0);
99
+ const p = s && !h && !r ? tt(s, l, !0) : m(0);
100
100
  return {
101
- width: i.width * f.x,
102
- height: i.height * f.y,
103
- x: i.x * f.x - l.scrollLeft * f.x + u.x + p.x,
104
- y: i.y * f.y - l.scrollTop * f.y + u.y + p.y
101
+ width: n.width * f.x,
102
+ height: n.height * f.y,
103
+ x: n.x * f.x - l.scrollLeft * f.x + u.x + p.x,
104
+ y: n.y * f.y - l.scrollTop * f.y + u.y + p.y
105
105
  };
106
106
  }
107
- function dt(t) {
107
+ function pt(t) {
108
108
  return Array.from(t.getClientRects());
109
109
  }
110
- function gt(t) {
111
- const e = R(t), i = A(t), n = t.ownerDocument.body, o = E(e.scrollWidth, e.clientWidth, n.scrollWidth, n.clientWidth), r = E(e.scrollHeight, e.clientHeight, n.scrollHeight, n.clientHeight);
112
- let s = -i.scrollLeft + q(t);
113
- const c = -i.scrollTop;
114
- return b(n).direction === "rtl" && (s += E(e.clientWidth, n.clientWidth) - o), {
110
+ function wt(t) {
111
+ const e = O(t), n = I(t), i = t.ownerDocument.body, o = E(e.scrollWidth, e.clientWidth, i.scrollWidth, i.clientWidth), r = E(e.scrollHeight, e.clientHeight, i.scrollHeight, i.clientHeight);
112
+ let s = -n.scrollLeft + k(t);
113
+ const c = -n.scrollTop;
114
+ return R(i).direction === "rtl" && (s += E(e.clientWidth, i.clientWidth) - o), {
115
115
  width: o,
116
116
  height: r,
117
117
  x: s,
118
118
  y: c
119
119
  };
120
120
  }
121
- function pt(t, e) {
122
- const i = L(t), n = R(t), o = i.visualViewport;
123
- let r = n.clientWidth, s = n.clientHeight, c = 0, l = 0;
121
+ function mt(t, e) {
122
+ const n = L(t), i = O(t), o = n.visualViewport;
123
+ let r = i.clientWidth, s = i.clientHeight, c = 0, l = 0;
124
124
  if (o) {
125
125
  r = o.width, s = o.height;
126
- const f = J();
126
+ const f = Q();
127
127
  (!f || f && e === "fixed") && (c = o.offsetLeft, l = o.offsetTop);
128
128
  }
129
129
  return {
@@ -133,8 +133,8 @@ function pt(t, e) {
133
133
  y: l
134
134
  };
135
135
  }
136
- function wt(t, e) {
137
- const i = T(t, !0, e === "fixed"), n = i.top + t.clientTop, o = i.left + t.clientLeft, r = O(t) ? F(t) : y(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, l = o * r.x, f = n * r.y;
136
+ function yt(t, e) {
137
+ const n = T(t, !0, e === "fixed"), i = n.top + t.clientTop, o = n.left + t.clientLeft, r = b(t) ? F(t) : m(1), s = t.clientWidth * r.x, c = t.clientHeight * r.y, l = o * r.x, f = i * r.y;
138
138
  return {
139
139
  width: s,
140
140
  height: c,
@@ -142,53 +142,53 @@ function wt(t, e) {
142
142
  y: f
143
143
  };
144
144
  }
145
- function K(t, e, i) {
146
- let n;
145
+ function j(t, e, n) {
146
+ let i;
147
147
  if (e === "viewport")
148
- n = pt(t, i);
148
+ i = mt(t, n);
149
149
  else if (e === "document")
150
- n = gt(R(t));
150
+ i = wt(O(t));
151
151
  else if (v(e))
152
- n = wt(e, i);
152
+ i = yt(e, n);
153
153
  else {
154
- const o = Z(t);
155
- n = {
154
+ const o = X(t);
155
+ i = {
156
156
  x: e.x - o.x,
157
157
  y: e.y - o.y,
158
158
  width: e.width,
159
159
  height: e.height
160
160
  };
161
161
  }
162
- return G(n);
162
+ return J(i);
163
163
  }
164
- function tt(t, e) {
165
- const i = W(t);
166
- return i === e || !v(i) || N(i) ? !1 : b(i).position === "fixed" || tt(i, e);
164
+ function et(t, e) {
165
+ const n = W(t);
166
+ return n === e || !v(n) || N(n) ? !1 : R(n).position === "fixed" || et(n, e);
167
167
  }
168
- function mt(t, e) {
169
- const i = e.get(t);
170
- if (i)
171
- return i;
172
- let n = $(t, [], !1).filter((c) => v(c) && S(c) !== "body"), o = null;
173
- const r = b(t).position === "fixed";
168
+ function xt(t, e) {
169
+ const n = e.get(t);
170
+ if (n)
171
+ return n;
172
+ let i = $(t, [], !1).filter((c) => v(c) && S(c) !== "body"), o = null;
173
+ const r = R(t).position === "fixed";
174
174
  let s = r ? W(t) : t;
175
175
  for (; v(s) && !N(s); ) {
176
- const c = b(s), l = Q(s);
177
- !l && c.position === "fixed" && (o = null), (r ? !l && !o : !l && c.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || _(s) && !l && tt(t, s)) ? n = n.filter((u) => u !== s) : o = c, s = W(s);
176
+ const c = R(s), l = Y(s);
177
+ !l && c.position === "fixed" && (o = null), (r ? !l && !o : !l && c.position === "static" && !!o && ["absolute", "fixed"].includes(o.position) || _(s) && !l && et(t, s)) ? i = i.filter((u) => u !== s) : o = c, s = W(s);
178
178
  }
179
- return e.set(t, n), n;
179
+ return e.set(t, i), i;
180
180
  }
181
- function yt(t) {
181
+ function vt(t) {
182
182
  let {
183
183
  element: e,
184
- boundary: i,
185
- rootBoundary: n,
184
+ boundary: n,
185
+ rootBoundary: i,
186
186
  strategy: o
187
187
  } = t;
188
- const s = [...i === "clippingAncestors" ? M(e) ? [] : mt(e, this._c) : [].concat(i), n], c = s[0], l = s.reduce((f, u) => {
189
- const h = K(e, u, o);
188
+ const s = [...n === "clippingAncestors" ? M(e) ? [] : xt(e, this._c) : [].concat(n), i], c = s[0], l = s.reduce((f, u) => {
189
+ const h = j(e, u, o);
190
190
  return f.top = E(h.top, f.top), f.right = z(h.right, f.right), f.bottom = z(h.bottom, f.bottom), f.left = E(h.left, f.left), f;
191
- }, K(e, c, o));
191
+ }, j(e, c, o));
192
192
  return {
193
193
  width: l.right - l.left,
194
194
  height: l.bottom - l.top,
@@ -196,29 +196,29 @@ function yt(t) {
196
196
  y: l.top
197
197
  };
198
198
  }
199
- function xt(t) {
199
+ function Rt(t) {
200
200
  const {
201
201
  width: e,
202
- height: i
203
- } = Y(t);
202
+ height: n
203
+ } = Z(t);
204
204
  return {
205
205
  width: e,
206
- height: i
206
+ height: n
207
207
  };
208
208
  }
209
- function vt(t, e, i) {
210
- const n = O(e), o = R(e), r = i === "fixed", s = T(t, !0, r, e);
209
+ function Ot(t, e, n) {
210
+ const i = b(e), o = O(e), r = n === "fixed", s = T(t, !0, r, e);
211
211
  let c = {
212
212
  scrollLeft: 0,
213
213
  scrollTop: 0
214
214
  };
215
- const l = y(0);
216
- if (n || !n && !r)
217
- if ((S(e) !== "body" || _(o)) && (c = A(e)), n) {
215
+ const l = m(0);
216
+ if (i || !i && !r)
217
+ if ((S(e) !== "body" || _(o)) && (c = I(e)), i) {
218
218
  const p = T(e, !0, r, e);
219
219
  l.x = p.x + e.clientLeft, l.y = p.y + e.clientTop;
220
- } else o && (l.x = q(o));
221
- const f = o && !n && !r ? X(o, c) : y(0), u = s.left + c.scrollLeft - l.x - f.x, h = s.top + c.scrollTop - l.y - f.y;
220
+ } else o && (l.x = k(o));
221
+ const f = o && !i && !r ? tt(o, c) : m(0), u = s.left + c.scrollLeft - l.x - f.x, h = s.top + c.scrollTop - l.y - f.y;
222
222
  return {
223
223
  x: u,
224
224
  y: h,
@@ -227,165 +227,168 @@ function vt(t, e, i) {
227
227
  };
228
228
  }
229
229
  function V(t) {
230
- return b(t).position === "static";
230
+ return R(t).position === "static";
231
231
  }
232
- function j(t, e) {
233
- if (!O(t) || b(t).position === "fixed")
232
+ function G(t, e) {
233
+ if (!b(t) || R(t).position === "fixed")
234
234
  return null;
235
235
  if (e)
236
236
  return e(t);
237
- let i = t.offsetParent;
238
- return R(t) === i && (i = i.ownerDocument.body), i;
237
+ let n = t.offsetParent;
238
+ return O(t) === n && (n = n.ownerDocument.body), n;
239
239
  }
240
- function et(t, e) {
241
- const i = L(t);
240
+ function nt(t, e) {
241
+ const n = L(t);
242
242
  if (M(t))
243
- return i;
244
- if (!O(t)) {
243
+ return n;
244
+ if (!b(t)) {
245
245
  let o = W(t);
246
246
  for (; o && !N(o); ) {
247
247
  if (v(o) && !V(o))
248
248
  return o;
249
249
  o = W(o);
250
250
  }
251
- return i;
251
+ return n;
252
252
  }
253
- let n = j(t, e);
254
- for (; n && lt(n) && V(n); )
255
- n = j(n, e);
256
- return n && N(n) && V(n) && !Q(n) ? i : n || ft(t) || i;
253
+ let i = G(t, e);
254
+ for (; i && ut(i) && V(i); )
255
+ i = G(i, e);
256
+ return i && N(i) && V(i) && !Y(i) ? n : i || ht(t) || n;
257
257
  }
258
258
  const bt = async function(t) {
259
- const e = this.getOffsetParent || et, i = this.getDimensions, n = await i(t.floating);
259
+ const e = this.getOffsetParent || nt, n = this.getDimensions, i = await n(t.floating);
260
260
  return {
261
- reference: vt(t.reference, await e(t.floating), t.strategy),
261
+ reference: Ot(t.reference, await e(t.floating), t.strategy),
262
262
  floating: {
263
263
  x: 0,
264
264
  y: 0,
265
- width: n.width,
266
- height: n.height
265
+ width: i.width,
266
+ height: i.height
267
267
  }
268
268
  };
269
269
  };
270
- function Rt(t) {
271
- return b(t).direction === "rtl";
270
+ function Ct(t) {
271
+ return R(t).direction === "rtl";
272
272
  }
273
- const Ot = {
274
- convertOffsetParentRelativeRectToViewportRelativeRect: at,
275
- getDocumentElement: R,
276
- getClippingRect: yt,
277
- getOffsetParent: et,
273
+ const Lt = {
274
+ convertOffsetParentRelativeRectToViewportRelativeRect: gt,
275
+ getDocumentElement: O,
276
+ getClippingRect: vt,
277
+ getOffsetParent: nt,
278
278
  getElementRects: bt,
279
- getClientRects: dt,
280
- getDimensions: xt,
279
+ getClientRects: pt,
280
+ getDimensions: Rt,
281
281
  getScale: F,
282
282
  isElement: v,
283
- isRTL: Rt
283
+ isRTL: Ct
284
284
  };
285
- function Ct(t, e) {
286
- let i = null, n;
287
- const o = R(t);
285
+ function it(t, e) {
286
+ return t.x === e.x && t.y === e.y && t.width === e.width && t.height === e.height;
287
+ }
288
+ function Tt(t, e) {
289
+ let n = null, i;
290
+ const o = O(t);
288
291
  function r() {
289
292
  var c;
290
- clearTimeout(n), (c = i) == null || c.disconnect(), i = null;
293
+ clearTimeout(i), (c = n) == null || c.disconnect(), n = null;
291
294
  }
292
295
  function s(c, l) {
293
296
  c === void 0 && (c = !1), l === void 0 && (l = 1), r();
294
- const {
295
- left: f,
296
- top: u,
297
- width: h,
298
- height: p
299
- } = t.getBoundingClientRect();
300
- if (c || e(), !h || !p)
297
+ const f = t.getBoundingClientRect(), {
298
+ left: u,
299
+ top: h,
300
+ width: p,
301
+ height: a
302
+ } = f;
303
+ if (c || e(), !p || !a)
301
304
  return;
302
- const g = D(u), x = D(o.clientWidth - (f + h)), a = D(o.clientHeight - (u + p)), w = D(f), m = {
303
- rootMargin: -g + "px " + -x + "px " + -a + "px " + -w + "px",
305
+ const y = A(h), g = A(o.clientWidth - (u + p)), w = A(o.clientHeight - (h + a)), d = A(u), C = {
306
+ rootMargin: -y + "px " + -g + "px " + -w + "px " + -d + "px",
304
307
  threshold: E(0, z(1, l)) || 1
305
308
  };
306
- let C = !0;
307
- function B(P) {
308
- const I = P[0].intersectionRatio;
309
- if (I !== l) {
310
- if (!C)
309
+ let B = !0;
310
+ function P(U) {
311
+ const D = U[0].intersectionRatio;
312
+ if (D !== l) {
313
+ if (!B)
311
314
  return s();
312
- I ? s(!1, I) : n = setTimeout(() => {
315
+ D ? s(!1, D) : i = setTimeout(() => {
313
316
  s(!1, 1e-7);
314
317
  }, 1e3);
315
318
  }
316
- C = !1;
319
+ D === 1 && !it(f, t.getBoundingClientRect()) && s(), B = !1;
317
320
  }
318
321
  try {
319
- i = new IntersectionObserver(B, {
320
- ...m,
322
+ n = new IntersectionObserver(P, {
323
+ ...C,
321
324
  // Handle <iframe>s
322
325
  root: o.ownerDocument
323
326
  });
324
327
  } catch {
325
- i = new IntersectionObserver(B, m);
328
+ n = new IntersectionObserver(P, C);
326
329
  }
327
- i.observe(t);
330
+ n.observe(t);
328
331
  }
329
332
  return s(!0), r;
330
333
  }
331
- function Ft(t, e, i, n) {
332
- n === void 0 && (n = {});
334
+ function Bt(t, e, n, i) {
335
+ i === void 0 && (i = {});
333
336
  const {
334
337
  ancestorScroll: o = !0,
335
338
  ancestorResize: r = !0,
336
339
  elementResize: s = typeof ResizeObserver == "function",
337
340
  layoutShift: c = typeof IntersectionObserver == "function",
338
341
  animationFrame: l = !1
339
- } = n, f = k(t), u = o || r ? [...f ? $(f) : [], ...$(e)] : [];
342
+ } = i, f = q(t), u = o || r ? [...f ? $(f) : [], ...$(e)] : [];
340
343
  u.forEach((d) => {
341
- o && d.addEventListener("scroll", i, {
344
+ o && d.addEventListener("scroll", n, {
342
345
  passive: !0
343
- }), r && d.addEventListener("resize", i);
346
+ }), r && d.addEventListener("resize", n);
344
347
  });
345
- const h = f && c ? Ct(f, i) : null;
346
- let p = -1, g = null;
347
- s && (g = new ResizeObserver((d) => {
348
- let [m] = d;
349
- m && m.target === f && g && (g.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
348
+ const h = f && c ? Tt(f, n) : null;
349
+ let p = -1, a = null;
350
+ s && (a = new ResizeObserver((d) => {
351
+ let [x] = d;
352
+ x && x.target === f && a && (a.unobserve(e), cancelAnimationFrame(p), p = requestAnimationFrame(() => {
350
353
  var C;
351
- (C = g) == null || C.observe(e);
352
- })), i();
353
- }), f && !l && g.observe(f), g.observe(e));
354
- let x, a = l ? T(t) : null;
354
+ (C = a) == null || C.observe(e);
355
+ })), n();
356
+ }), f && !l && a.observe(f), a.observe(e));
357
+ let y, g = l ? T(t) : null;
355
358
  l && w();
356
359
  function w() {
357
360
  const d = T(t);
358
- a && (d.x !== a.x || d.y !== a.y || d.width !== a.width || d.height !== a.height) && i(), a = d, x = requestAnimationFrame(w);
361
+ g && !it(g, d) && n(), g = d, y = requestAnimationFrame(w);
359
362
  }
360
- return i(), () => {
363
+ return n(), () => {
361
364
  var d;
362
- u.forEach((m) => {
363
- o && m.removeEventListener("scroll", i), r && m.removeEventListener("resize", i);
364
- }), h == null || h(), (d = g) == null || d.disconnect(), g = null, l && cancelAnimationFrame(x);
365
+ u.forEach((x) => {
366
+ o && x.removeEventListener("scroll", n), r && x.removeEventListener("resize", n);
367
+ }), h == null || h(), (d = a) == null || d.disconnect(), a = null, l && cancelAnimationFrame(y);
365
368
  };
366
369
  }
367
- const Wt = it, Bt = nt, Dt = ot, Ht = rt, Nt = st, At = (t, e, i) => {
368
- const n = /* @__PURE__ */ new Map(), o = {
369
- platform: Ot,
370
- ...i
370
+ const Dt = ot, At = st, Ht = rt, Nt = lt, It = ct, Vt = (t, e, n) => {
371
+ const i = /* @__PURE__ */ new Map(), o = {
372
+ platform: Lt,
373
+ ...n
371
374
  }, r = {
372
375
  ...o.platform,
373
- _c: n
376
+ _c: i
374
377
  };
375
- return ct(t, e, {
378
+ return ft(t, e, {
376
379
  ...o,
377
380
  platform: r
378
381
  });
379
382
  };
380
383
  export {
381
- Ht as arrow,
382
- Ft as autoUpdate,
383
- At as computePosition,
384
- Dt as flip,
384
+ Nt as arrow,
385
+ Bt as autoUpdate,
386
+ Vt as computePosition,
387
+ Ht as flip,
385
388
  $ as getOverflowAncestors,
386
- Nt as inline,
387
- Wt as offset,
388
- Ot as platform,
389
- Bt as shift
389
+ It as inline,
390
+ Dt as offset,
391
+ Lt as platform,
392
+ At as shift
390
393
  };
391
394
  //# sourceMappingURL=annotorious-react.es16.js.map