@annotorious/openseadragon 3.0.14 → 3.0.16

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.
@@ -94,10 +94,10 @@ const ap = (r, t) => {
94
94
  ...(t.deleted || []).filter((u) => !e.has(u.id))
95
95
  ], c = [
96
96
  ...(r.updated || []).filter(({ newValue: u }) => !n.has(u.id)).map((u) => {
97
- const { oldValue: d, newValue: f } = u;
98
- if (o.has(f.id)) {
99
- const p = t.updated.find((m) => m.oldValue.id === f.id).newValue;
100
- return op(d, p);
97
+ const { oldValue: d, newValue: p } = u;
98
+ if (o.has(p.id)) {
99
+ const f = t.updated.find((m) => m.oldValue.id === p.id).newValue;
100
+ return op(d, f);
101
101
  } else
102
102
  return u;
103
103
  }),
@@ -119,41 +119,42 @@ let lp = () => ({
119
119
  };
120
120
  }
121
121
  });
122
- const hp = 250, cp = (r) => {
123
- const t = lp(), e = [];
124
- let i = -1, s = !1, n = 0;
125
- const o = (f) => {
126
- if (!s) {
127
- const { changes: p } = f, m = performance.now();
128
- if (m - n > hp)
129
- e.splice(i + 1), e.push(p), i = e.length - 1;
122
+ const hp = 250, cp = (r, t) => {
123
+ const e = lp(), i = [];
124
+ let s = -1, n = !1, o = 0;
125
+ const a = (f) => {
126
+ if (!n) {
127
+ const { changes: m } = f, _ = performance.now();
128
+ if (_ - o > hp)
129
+ i.splice(s + 1), i.push(m), s = i.length - 1;
130
130
  else {
131
- const _ = e.length - 1;
132
- e[_] = ap(e[_], p);
131
+ const y = i.length - 1;
132
+ i[y] = ap(i[y], m);
133
133
  }
134
- n = m;
134
+ o = _;
135
135
  }
136
- s = !1;
136
+ n = !1;
137
137
  };
138
- r.observe(o, { origin: _r.LOCAL });
139
- const a = (f) => f && f.length > 0 && r.bulkDeleteAnnotation(f), l = (f) => f && f.length > 0 && r.bulkAddAnnotation(f, !1), h = (f) => f && f.length > 0 && r.bulkUpdateAnnotation(f.map(({ oldValue: p }) => p)), c = (f) => f && f.length > 0 && r.bulkUpdateAnnotation(f.map(({ newValue: p }) => p)), u = (f) => f && f.length > 0 && r.bulkAddAnnotation(f, !1), d = (f) => f && f.length > 0 && r.bulkDeleteAnnotation(f);
138
+ r.observe(a, { origin: _r.LOCAL });
139
+ const l = (f) => f && f.length > 0 && r.bulkDeleteAnnotation(f), h = (f) => f && f.length > 0 && r.bulkAddAnnotation(f, !1), c = (f) => f && f.length > 0 && r.bulkUpdateAnnotation(f.map(({ oldValue: m }) => m)), u = (f) => f && f.length > 0 && r.bulkUpdateAnnotation(f.map(({ newValue: m }) => m)), d = (f) => f && f.length > 0 && r.bulkAddAnnotation(f, !1), p = (f) => f && f.length > 0 && r.bulkDeleteAnnotation(f);
140
140
  return {
141
- canRedo: () => e.length - 1 > i,
142
- canUndo: () => i > -1,
143
- destroy: () => r.unobserve(o),
144
- on: (f, p) => t.on(f, p),
141
+ canRedo: () => i.length - 1 > s,
142
+ canUndo: () => s > -1,
143
+ destroy: () => r.unobserve(a),
144
+ getHistory: () => [...i],
145
+ on: (f, m) => e.on(f, m),
145
146
  redo: () => {
146
- if (e.length - 1 > i) {
147
- s = !0;
148
- const { created: f, updated: p, deleted: m } = e[i + 1];
149
- l(f), c(p), d(m), t.emit("redo", e[i + 1]), i += 1;
147
+ if (i.length - 1 > s) {
148
+ n = !0;
149
+ const { created: f, updated: m, deleted: _ } = i[s + 1];
150
+ h(f), u(m), p(_), e.emit("redo", i[s + 1]), s += 1;
150
151
  }
151
152
  },
152
153
  undo: () => {
153
- if (i > -1) {
154
- s = !0;
155
- const { created: f, updated: p, deleted: m } = e[i];
156
- a(f), h(p), u(m), t.emit("undo", e[i]), i -= 1;
154
+ if (s > -1) {
155
+ n = !0;
156
+ const { created: f, updated: m, deleted: _ } = i[s];
157
+ l(f), c(m), d(_), e.emit("undo", i[s]), s -= 1;
157
158
  }
158
159
  }
159
160
  };
@@ -162,13 +163,13 @@ const hp = 250, cp = (r) => {
162
163
  let h = [], c, u;
163
164
  const d = (y, x) => {
164
165
  l.has(y) ? l.get(y).push(x) : l.set(y, [x]);
165
- }, f = (y, x) => {
166
+ }, p = (y, x) => {
166
167
  const g = l.get(y);
167
168
  if (g) {
168
169
  const v = g.indexOf(x);
169
170
  v !== -1 && g.splice(v, 1);
170
171
  }
171
- }, p = (y, x, g) => {
172
+ }, f = (y, x, g) => {
172
173
  l.has(y) && setTimeout(() => {
173
174
  l.get(y).forEach((v) => {
174
175
  if (e) {
@@ -182,7 +183,7 @@ const hp = 250, cp = (r) => {
182
183
  const { selected: y } = n, x = (y || []).map(({ id: g }) => o.getAnnotation(g));
183
184
  x.forEach((g) => {
184
185
  const v = h.find((w) => w.id === g.id);
185
- (!v || !Gr(v, g)) && p("updateAnnotation", g, v);
186
+ (!v || !Gr(v, g)) && f("updateAnnotation", g, v);
186
187
  }), h = h.map((g) => x.find(({ id: w }) => w === g.id) || g);
187
188
  };
188
189
  n.subscribe(({ selected: y }) => {
@@ -192,13 +193,13 @@ const hp = 250, cp = (r) => {
192
193
  else if (h.length > 0 && y.length === 0)
193
194
  h.forEach((x) => {
194
195
  const g = o.getAnnotation(x.id);
195
- g && !Gr(g, x) && p("updateAnnotation", g, x);
196
+ g && !Gr(g, x) && f("updateAnnotation", g, x);
196
197
  }), h = [];
197
198
  else {
198
199
  const x = new Set(h.map((v) => v.id)), g = new Set(y.map(({ id: v }) => v));
199
200
  h.filter((v) => !g.has(v.id)).forEach((v) => {
200
201
  const w = o.getAnnotation(v.id);
201
- w && !Gr(w, v) && p("updateAnnotation", w, v);
202
+ w && !Gr(w, v) && f("updateAnnotation", w, v);
202
203
  }), h = [
203
204
  // Remove annotations that were deselected
204
205
  ...h.filter((v) => g.has(v.id)),
@@ -206,20 +207,20 @@ const hp = 250, cp = (r) => {
206
207
  ...y.filter(({ id: v }) => !x.has(v)).map(({ id: v }) => o.getAnnotation(v))
207
208
  ];
208
209
  }
209
- p("selectionChanged", h);
210
+ f("selectionChanged", h);
210
211
  }
211
212
  }), s.subscribe((y) => {
212
- !c && y ? p("mouseEnterAnnotation", o.getAnnotation(y)) : c && !y ? p("mouseLeaveAnnotation", o.getAnnotation(c)) : c && y && (p("mouseLeaveAnnotation", o.getAnnotation(c)), p("mouseEnterAnnotation", o.getAnnotation(y))), c = y;
213
- }), a == null || a.subscribe((y) => p("viewportIntersect", y.map((x) => o.getAnnotation(x)))), o.observe((y) => {
213
+ !c && y ? f("mouseEnterAnnotation", o.getAnnotation(y)) : c && !y ? f("mouseLeaveAnnotation", o.getAnnotation(c)) : c && y && (f("mouseLeaveAnnotation", o.getAnnotation(c)), f("mouseEnterAnnotation", o.getAnnotation(y))), c = y;
214
+ }), a == null || a.subscribe((y) => f("viewportIntersect", y.map((x) => o.getAnnotation(x)))), o.observe((y) => {
214
215
  i && (u && clearTimeout(u), u = setTimeout(m, 1e3));
215
216
  const { created: x, deleted: g } = y.changes;
216
- (x || []).forEach((v) => p("createAnnotation", v)), (g || []).forEach((v) => p("deleteAnnotation", v)), (y.changes.updated || []).filter((v) => [
217
+ (x || []).forEach((v) => f("createAnnotation", v)), (g || []).forEach((v) => f("deleteAnnotation", v)), (y.changes.updated || []).filter((v) => [
217
218
  ...v.bodiesCreated || [],
218
219
  ...v.bodiesDeleted || [],
219
220
  ...v.bodiesUpdated || []
220
221
  ].length > 0).forEach(({ oldValue: v, newValue: w }) => {
221
222
  const I = h.find((A) => A.id === v.id) || v;
222
- h = h.map((A) => A.id === v.id ? w : A), p("updateAnnotation", w, I);
223
+ h = h.map((A) => A.id === v.id ? w : A), f("updateAnnotation", w, I);
223
224
  });
224
225
  }, { origin: _r.LOCAL }), o.observe((y) => {
225
226
  if (h) {
@@ -229,9 +230,9 @@ const hp = 250, cp = (r) => {
229
230
  }, { origin: _r.REMOTE });
230
231
  const _ = (y) => (x) => {
231
232
  const { updated: g } = x;
232
- y ? (g || []).forEach((v) => p("updateAnnotation", v.oldValue, v.newValue)) : (g || []).forEach((v) => p("updateAnnotation", v.newValue, v.oldValue));
233
+ y ? (g || []).forEach((v) => f("updateAnnotation", v.oldValue, v.newValue)) : (g || []).forEach((v) => f("updateAnnotation", v.newValue, v.oldValue));
233
234
  };
234
- return t.on("undo", _(!0)), t.on("redo", _(!1)), { on: d, off: f, emit: p };
235
+ return t.on("undo", _(!0)), t.on("redo", _(!1)), { on: d, off: p, emit: f };
235
236
  }, dp = (r) => (t) => t.reduce((e, i) => {
236
237
  const { parsed: s, error: n } = r.parse(i);
237
238
  return n ? {
@@ -257,7 +258,7 @@ const hp = 250, cp = (r) => {
257
258
  var y;
258
259
  const x = (((y = s.selected) == null ? void 0 : y.map((g) => g.id)) || []).map((g) => i.getAnnotation(g)).filter(Boolean);
259
260
  return e ? x.map(e.serialize) : x;
260
- }, u = (y, x = !0) => fetch(y).then((g) => g.json()).then((g) => (f(g, x), g)), d = (y) => {
261
+ }, u = (y, x = !0) => fetch(y).then((g) => g.json()).then((g) => (p(g, x), g)), d = (y) => {
261
262
  if (typeof y == "string") {
262
263
  const x = i.getAnnotation(y);
263
264
  if (i.deleteAnnotation(y), x)
@@ -267,13 +268,13 @@ const hp = 250, cp = (r) => {
267
268
  if (x)
268
269
  return i.deleteAnnotation(x), y;
269
270
  }
270
- }, f = (y, x = !0) => {
271
+ }, p = (y, x = !0) => {
271
272
  if (e) {
272
273
  const g = e.parseAll || dp(e), { parsed: v, failed: w } = g(y);
273
274
  w.length > 0 && console.warn(`Discarded ${w.length} invalid annotations`, w), i.bulkAddAnnotation(v, x, _r.REMOTE);
274
275
  } else
275
276
  i.bulkAddAnnotation(y.map(io), x, _r.REMOTE);
276
- }, p = (y, x) => {
277
+ }, f = (y, x) => {
277
278
  y ? s.setSelected(y, x) : s.clear();
278
279
  }, m = (y) => {
279
280
  s.clear(), s.setUserSelectAction(y);
@@ -294,12 +295,13 @@ const hp = 250, cp = (r) => {
294
295
  clearAnnotations: a,
295
296
  getAnnotationById: l,
296
297
  getAnnotations: h,
298
+ getHistory: t.getHistory,
297
299
  getSelected: c,
298
300
  loadAnnotations: u,
299
301
  redo: t.redo,
300
302
  removeAnnotation: d,
301
- setAnnotations: f,
302
- setSelected: p,
303
+ setAnnotations: p,
304
+ setSelected: f,
303
305
  setUserSelectAction: m,
304
306
  undo: t.undo,
305
307
  updateAnnotation: _
@@ -310,13 +312,13 @@ let mp = (r) => crypto.getRandomValues(new Uint8Array(r)), gp = (r, t, e) => {
310
312
  return (n = t) => {
311
313
  let o = "";
312
314
  for (; ; ) {
313
- let a = e(s), l = s;
315
+ let a = e(s), l = s | 0;
314
316
  for (; l--; )
315
- if (o += r[a[l] & i] || "", o.length === n) return o;
317
+ if (o += r[a[l] & i] || "", o.length >= n) return o;
316
318
  }
317
319
  };
318
- }, yp = (r, t = 21) => gp(r, t, mp), _p = (r = 21) => {
319
- let t = "", e = crypto.getRandomValues(new Uint8Array(r));
320
+ }, yp = (r, t = 21) => gp(r, t | 0, mp), _p = (r = 21) => {
321
+ let t = "", e = crypto.getRandomValues(new Uint8Array(r |= 0));
320
322
  for (; r--; )
321
323
  t += pp[e[r] & 63];
322
324
  return t;
@@ -625,9 +627,9 @@ function de(r, t, e, i, s, n, o = null, a = [-1]) {
625
627
  };
626
628
  o && o(h.root);
627
629
  let c = !1;
628
- if (h.ctx = e ? e(r, t.props || {}, (u, d, ...f) => {
629
- const p = f.length ? f[0] : d;
630
- return h.ctx && s(h.ctx[u], h.ctx[u] = p) && (!h.skip_bound && h.bound[u] && h.bound[u](p), c && Op(r, u)), d;
630
+ if (h.ctx = e ? e(r, t.props || {}, (u, d, ...p) => {
631
+ const f = p.length ? p[0] : d;
632
+ return h.ctx && s(h.ctx[u], h.ctx[u] = f) && (!h.skip_bound && h.bound[u] && h.bound[u](f), c && Op(r, u)), d;
631
633
  }) : [], h.update(), c = !0, ze(h.before_update), h.fragment = i ? i(h.ctx) : !1, t.target) {
632
634
  if (t.hydrate) {
633
635
  const u = Cp(t.target);
@@ -680,8 +682,8 @@ const ul = {}, dl = (r, t) => ul[r] = t, la = (r) => ul[r.type].area(r), Lp = (r
680
682
  }, Np = {
681
683
  area: (r) => Math.PI * r.geometry.rx * r.geometry.ry,
682
684
  intersects: (r, t, e) => {
683
- const { cx: i, cy: s, rx: n, ry: o } = r.geometry, a = 0, l = Math.cos(a), h = Math.sin(a), c = t - i, u = e - s, d = l * c + h * u, f = h * c - l * u;
684
- return d * d / (n * n) + f * f / (o * o) <= 1;
685
+ const { cx: i, cy: s, rx: n, ry: o } = r.geometry, a = 0, l = Math.cos(a), h = Math.sin(a), c = t - i, u = e - s, d = l * c + h * u, p = h * c - l * u;
686
+ return d * d / (n * n) + p * p / (o * o) <= 1;
685
687
  }
686
688
  };
687
689
  dl(Tt.ELLIPSE, Np);
@@ -716,19 +718,19 @@ const ir = (r) => rn(r.target), rn = (r) => {
716
718
  const e = typeof r == "string" ? r : r.value, i = /^(xywh)=(pixel|percent)?:?(.+?),(.+?),(.+?),(.+)*/g, s = [...e.matchAll(i)][0], [n, o, a, l, h, c, u] = s;
717
719
  if (o !== "xywh") throw new Error("Unsupported MediaFragment: " + e);
718
720
  if (a && a !== "pixel") throw new Error(`Unsupported MediaFragment unit: ${a}`);
719
- const [d, f, p, m] = [l, h, c, u].map(parseFloat);
721
+ const [d, p, f, m] = [l, h, c, u].map(parseFloat);
720
722
  return {
721
723
  type: Tt.RECTANGLE,
722
724
  geometry: {
723
725
  x: d,
724
- y: f,
725
- w: p,
726
+ y: p,
727
+ w: f,
726
728
  h: m,
727
729
  bounds: {
728
730
  minX: d,
729
- minY: t ? f - m : f,
730
- maxX: d + p,
731
- maxY: t ? f : f + m
731
+ minY: t ? p - m : p,
732
+ maxX: d + f,
733
+ maxY: t ? p : p + m
732
734
  }
733
735
  }
734
736
  };
@@ -895,28 +897,28 @@ var Cu = /* @__PURE__ */ ((r) => (r.EDIT = "EDIT", r.SELECT = "SELECT", r.NONE =
895
897
  const Is = { selected: [] }, tm = (r, t, e) => {
896
898
  const { subscribe: i, set: s } = fl(Is);
897
899
  let n = t, o = Is;
898
- i((p) => o = p);
900
+ i((f) => o = f);
899
901
  const a = () => {
900
902
  wr(o, Is) || s(Is);
901
903
  }, l = () => {
902
- var p;
903
- return ((p = o.selected) == null ? void 0 : p.length) === 0;
904
- }, h = (p) => {
904
+ var f;
905
+ return ((f = o.selected) == null ? void 0 : f.length) === 0;
906
+ }, h = (f) => {
905
907
  if (l())
906
908
  return !1;
907
- const m = typeof p == "string" ? p : p.id;
909
+ const m = typeof f == "string" ? f : f.id;
908
910
  return o.selected.some((_) => _.id === m);
909
- }, c = (p, m) => {
911
+ }, c = (f, m) => {
910
912
  let _;
911
- if (Array.isArray(p)) {
912
- if (_ = p.map((x) => r.getAnnotation(x)).filter(Boolean), _.length < p.length) {
913
- console.warn("Invalid selection: " + p.filter((x) => !_.some((g) => g.id === x)));
913
+ if (Array.isArray(f)) {
914
+ if (_ = f.map((x) => r.getAnnotation(x)).filter(Boolean), _.length < f.length) {
915
+ console.warn("Invalid selection: " + f.filter((x) => !_.some((g) => g.id === x)));
914
916
  return;
915
917
  }
916
918
  } else {
917
- const x = r.getAnnotation(p);
919
+ const x = r.getAnnotation(f);
918
920
  if (!x) {
919
- console.warn("Invalid selection: " + p);
921
+ console.warn("Invalid selection: " + f);
920
922
  return;
921
923
  }
922
924
  _ = [x];
@@ -926,22 +928,22 @@ const Is = { selected: [] }, tm = (r, t, e) => {
926
928
  return v === "EDIT" ? [...x, { id: g.id, editable: !0 }] : v === "SELECT" ? [...x, { id: g.id }] : x;
927
929
  }, []);
928
930
  s({ selected: y, event: m });
929
- }, u = (p, m) => {
930
- const _ = Array.isArray(p) ? p : [p], y = _.map((x) => r.getAnnotation(x)).filter((x) => !!x);
931
+ }, u = (f, m) => {
932
+ const _ = Array.isArray(f) ? f : [f], y = _.map((x) => r.getAnnotation(x)).filter((x) => !!x);
931
933
  s({
932
934
  selected: y.map((x) => {
933
935
  const g = m === void 0 ? zl(x, n, e) === "EDIT" : m;
934
936
  return { id: x.id, editable: g };
935
937
  })
936
- }), y.length !== _.length && console.warn("Invalid selection", p);
937
- }, d = (p) => {
938
+ }), y.length !== _.length && console.warn("Invalid selection", f);
939
+ }, d = (f) => {
938
940
  if (l())
939
941
  return !1;
940
942
  const { selected: m } = o;
941
- m.some(({ id: _ }) => p.includes(_)) && s({ selected: m.filter(({ id: _ }) => !p.includes(_)) });
942
- }, f = (p) => n = p;
943
+ m.some(({ id: _ }) => f.includes(_)) && s({ selected: m.filter(({ id: _ }) => !f.includes(_)) });
944
+ }, p = (f) => n = f;
943
945
  return r.observe(
944
- ({ changes: p }) => d((p.deleted || []).map((m) => m.id))
946
+ ({ changes: f }) => d((f.deleted || []).map((m) => m.id))
945
947
  ), {
946
948
  get event() {
947
949
  return o ? o.event : null;
@@ -956,7 +958,7 @@ const Is = { selected: [] }, tm = (r, t, e) => {
956
958
  isEmpty: l,
957
959
  isSelected: h,
958
960
  setSelected: u,
959
- setUserSelectAction: f,
961
+ setUserSelectAction: p,
960
962
  subscribe: i,
961
963
  userSelect: c
962
964
  };
@@ -1049,10 +1051,10 @@ const cm = (r, t) => {
1049
1051
  ...(t.deleted || []).filter((u) => !e.has(u.id))
1050
1052
  ], c = [
1051
1053
  ...(r.updated || []).filter(({ newValue: u }) => !n.has(u.id)).map((u) => {
1052
- const { oldValue: d, newValue: f } = u;
1053
- if (o.has(f.id)) {
1054
- const p = t.updated.find((m) => m.oldValue.id === f.id).newValue;
1055
- return Ru(d, p);
1054
+ const { oldValue: d, newValue: p } = u;
1055
+ if (o.has(p.id)) {
1056
+ const f = t.updated.find((m) => m.oldValue.id === p.id).newValue;
1057
+ return Ru(d, f);
1056
1058
  } else
1057
1059
  return u;
1058
1060
  }),
@@ -1132,7 +1134,7 @@ const cm = (r, t) => {
1132
1134
  }, u = () => [...r.values()], d = (S = At.LOCAL) => {
1133
1135
  const P = [...r.values()];
1134
1136
  r.clear(), t.clear(), n(S, { deleted: P });
1135
- }, f = (S, P = !0, E = At.LOCAL) => {
1137
+ }, p = (S, P = !0, E = At.LOCAL) => {
1136
1138
  const b = S.map(co);
1137
1139
  if (P) {
1138
1140
  const B = [...r.values()];
@@ -1150,17 +1152,17 @@ const cm = (r, t) => {
1150
1152
  r.set(O.id, O), O.bodies.forEach((G) => t.set(G.id, O.id));
1151
1153
  }), n(E, { created: b });
1152
1154
  }
1153
- }, p = (S) => {
1155
+ }, f = (S) => {
1154
1156
  const P = typeof S == "string" ? S : S.id, E = r.get(P);
1155
1157
  if (E)
1156
1158
  return r.delete(P), E.bodies.forEach((b) => t.delete(b.id)), E;
1157
1159
  console.warn(`Attempt to delete missing annotation: ${P}`);
1158
1160
  }, m = (S, P = At.LOCAL) => {
1159
- const E = p(S);
1161
+ const E = f(S);
1160
1162
  E && n(P, { deleted: [E] });
1161
1163
  }, _ = (S, P = At.LOCAL) => {
1162
1164
  const E = S.reduce((b, B) => {
1163
- const O = p(B);
1165
+ const O = f(B);
1164
1166
  return O ? [...b, O] : b;
1165
1167
  }, []);
1166
1168
  E.length > 0 && n(P, { deleted: E });
@@ -1248,7 +1250,7 @@ const cm = (r, t) => {
1248
1250
  addAnnotation: o,
1249
1251
  addBody: c,
1250
1252
  all: u,
1251
- bulkAddAnnotation: f,
1253
+ bulkAddAnnotation: p,
1252
1254
  bulkDeleteAnnotation: _,
1253
1255
  bulkDeleteBodies: g,
1254
1256
  bulkUpdateAnnotation: h,
@@ -1292,41 +1294,42 @@ let mm = () => ({
1292
1294
  };
1293
1295
  }
1294
1296
  });
1295
- const gm = 250, ym = (r) => {
1296
- const t = mm(), e = [];
1297
- let i = -1, s = !1, n = 0;
1298
- const o = (f) => {
1299
- if (!s) {
1300
- const { changes: p } = f, m = performance.now();
1301
- if (m - n > gm)
1302
- e.splice(i + 1), e.push(p), i = e.length - 1;
1297
+ const gm = 250, ym = (r, t) => {
1298
+ const e = mm(), i = [];
1299
+ let s = -1, n = !1, o = 0;
1300
+ const a = (f) => {
1301
+ if (!n) {
1302
+ const { changes: m } = f, _ = performance.now();
1303
+ if (_ - o > gm)
1304
+ i.splice(s + 1), i.push(m), s = i.length - 1;
1303
1305
  else {
1304
- const _ = e.length - 1;
1305
- e[_] = um(e[_], p);
1306
+ const y = i.length - 1;
1307
+ i[y] = um(i[y], m);
1306
1308
  }
1307
- n = m;
1309
+ o = _;
1308
1310
  }
1309
- s = !1;
1311
+ n = !1;
1310
1312
  };
1311
- r.observe(o, { origin: At.LOCAL });
1312
- const a = (f) => f && f.length > 0 && r.bulkDeleteAnnotation(f), l = (f) => f && f.length > 0 && r.bulkAddAnnotation(f, !1), h = (f) => f && f.length > 0 && r.bulkUpdateAnnotation(f.map(({ oldValue: p }) => p)), c = (f) => f && f.length > 0 && r.bulkUpdateAnnotation(f.map(({ newValue: p }) => p)), u = (f) => f && f.length > 0 && r.bulkAddAnnotation(f, !1), d = (f) => f && f.length > 0 && r.bulkDeleteAnnotation(f);
1313
+ r.observe(a, { origin: At.LOCAL });
1314
+ const l = (f) => f && f.length > 0 && r.bulkDeleteAnnotation(f), h = (f) => f && f.length > 0 && r.bulkAddAnnotation(f, !1), c = (f) => f && f.length > 0 && r.bulkUpdateAnnotation(f.map(({ oldValue: m }) => m)), u = (f) => f && f.length > 0 && r.bulkUpdateAnnotation(f.map(({ newValue: m }) => m)), d = (f) => f && f.length > 0 && r.bulkAddAnnotation(f, !1), p = (f) => f && f.length > 0 && r.bulkDeleteAnnotation(f);
1313
1315
  return {
1314
- canRedo: () => e.length - 1 > i,
1315
- canUndo: () => i > -1,
1316
- destroy: () => r.unobserve(o),
1317
- on: (f, p) => t.on(f, p),
1316
+ canRedo: () => i.length - 1 > s,
1317
+ canUndo: () => s > -1,
1318
+ destroy: () => r.unobserve(a),
1319
+ getHistory: () => [...i],
1320
+ on: (f, m) => e.on(f, m),
1318
1321
  redo: () => {
1319
- if (e.length - 1 > i) {
1320
- s = !0;
1321
- const { created: f, updated: p, deleted: m } = e[i + 1];
1322
- l(f), c(p), d(m), t.emit("redo", e[i + 1]), i += 1;
1322
+ if (i.length - 1 > s) {
1323
+ n = !0;
1324
+ const { created: f, updated: m, deleted: _ } = i[s + 1];
1325
+ h(f), u(m), p(_), e.emit("redo", i[s + 1]), s += 1;
1323
1326
  }
1324
1327
  },
1325
1328
  undo: () => {
1326
- if (i > -1) {
1327
- s = !0;
1328
- const { created: f, updated: p, deleted: m } = e[i];
1329
- a(f), h(p), u(m), t.emit("undo", e[i]), i -= 1;
1329
+ if (s > -1) {
1330
+ n = !0;
1331
+ const { created: f, updated: m, deleted: _ } = i[s];
1332
+ l(f), c(m), d(_), e.emit("undo", i[s]), s -= 1;
1330
1333
  }
1331
1334
  }
1332
1335
  };
@@ -1341,13 +1344,13 @@ const gm = 250, ym = (r) => {
1341
1344
  let h = [], c, u;
1342
1345
  const d = (y, x) => {
1343
1346
  l.has(y) ? l.get(y).push(x) : l.set(y, [x]);
1344
- }, f = (y, x) => {
1347
+ }, p = (y, x) => {
1345
1348
  const g = l.get(y);
1346
1349
  if (g) {
1347
1350
  const v = g.indexOf(x);
1348
1351
  v !== -1 && g.splice(v, 1);
1349
1352
  }
1350
- }, p = (y, x, g) => {
1353
+ }, f = (y, x, g) => {
1351
1354
  l.has(y) && setTimeout(() => {
1352
1355
  l.get(y).forEach((v) => {
1353
1356
  if (e) {
@@ -1361,7 +1364,7 @@ const gm = 250, ym = (r) => {
1361
1364
  const { selected: y } = n, x = (y || []).map(({ id: g }) => o.getAnnotation(g));
1362
1365
  x.forEach((g) => {
1363
1366
  const v = h.find((w) => w.id === g.id);
1364
- (!v || !wr(v, g)) && p("updateAnnotation", g, v);
1367
+ (!v || !wr(v, g)) && f("updateAnnotation", g, v);
1365
1368
  }), h = h.map((g) => x.find(({ id: v }) => v === g.id) || g);
1366
1369
  };
1367
1370
  n.subscribe(({ selected: y }) => {
@@ -1371,13 +1374,13 @@ const gm = 250, ym = (r) => {
1371
1374
  else if (h.length > 0 && y.length === 0)
1372
1375
  h.forEach((x) => {
1373
1376
  const g = o.getAnnotation(x.id);
1374
- g && !wr(g, x) && p("updateAnnotation", g, x);
1377
+ g && !wr(g, x) && f("updateAnnotation", g, x);
1375
1378
  }), h = [];
1376
1379
  else {
1377
1380
  const x = new Set(h.map((v) => v.id)), g = new Set(y.map(({ id: v }) => v));
1378
1381
  h.filter((v) => !g.has(v.id)).forEach((v) => {
1379
1382
  const w = o.getAnnotation(v.id);
1380
- w && !wr(w, v) && p("updateAnnotation", w, v);
1383
+ w && !wr(w, v) && f("updateAnnotation", w, v);
1381
1384
  }), h = [
1382
1385
  // Remove annotations that were deselected
1383
1386
  ...h.filter((v) => g.has(v.id)),
@@ -1385,20 +1388,20 @@ const gm = 250, ym = (r) => {
1385
1388
  ...y.filter(({ id: v }) => !x.has(v)).map(({ id: v }) => o.getAnnotation(v))
1386
1389
  ];
1387
1390
  }
1388
- p("selectionChanged", h);
1391
+ f("selectionChanged", h);
1389
1392
  }
1390
1393
  }), s.subscribe((y) => {
1391
- !c && y ? p("mouseEnterAnnotation", o.getAnnotation(y)) : c && !y ? p("mouseLeaveAnnotation", o.getAnnotation(c)) : c && y && (p("mouseLeaveAnnotation", o.getAnnotation(c)), p("mouseEnterAnnotation", o.getAnnotation(y))), c = y;
1392
- }), a == null || a.subscribe((y) => p("viewportIntersect", y.map((x) => o.getAnnotation(x)))), o.observe((y) => {
1394
+ !c && y ? f("mouseEnterAnnotation", o.getAnnotation(y)) : c && !y ? f("mouseLeaveAnnotation", o.getAnnotation(c)) : c && y && (f("mouseLeaveAnnotation", o.getAnnotation(c)), f("mouseEnterAnnotation", o.getAnnotation(y))), c = y;
1395
+ }), a == null || a.subscribe((y) => f("viewportIntersect", y.map((x) => o.getAnnotation(x)))), o.observe((y) => {
1393
1396
  i && (u && clearTimeout(u), u = setTimeout(m, 1e3));
1394
1397
  const { created: x, deleted: g } = y.changes;
1395
- (x || []).forEach((v) => p("createAnnotation", v)), (g || []).forEach((v) => p("deleteAnnotation", v)), (y.changes.updated || []).filter((v) => [
1398
+ (x || []).forEach((v) => f("createAnnotation", v)), (g || []).forEach((v) => f("deleteAnnotation", v)), (y.changes.updated || []).filter((v) => [
1396
1399
  ...v.bodiesCreated || [],
1397
1400
  ...v.bodiesDeleted || [],
1398
1401
  ...v.bodiesUpdated || []
1399
1402
  ].length > 0).forEach(({ oldValue: v, newValue: w }) => {
1400
1403
  const I = h.find((A) => A.id === v.id) || v;
1401
- h = h.map((A) => A.id === v.id ? w : A), p("updateAnnotation", w, I);
1404
+ h = h.map((A) => A.id === v.id ? w : A), f("updateAnnotation", w, I);
1402
1405
  });
1403
1406
  }, { origin: At.LOCAL }), o.observe((y) => {
1404
1407
  if (h) {
@@ -1408,9 +1411,9 @@ const gm = 250, ym = (r) => {
1408
1411
  }, { origin: At.REMOTE });
1409
1412
  const _ = (y) => (x) => {
1410
1413
  const { updated: g } = x;
1411
- y ? (g || []).forEach((v) => p("updateAnnotation", v.oldValue, v.newValue)) : (g || []).forEach((v) => p("updateAnnotation", v.newValue, v.oldValue));
1414
+ y ? (g || []).forEach((v) => f("updateAnnotation", v.oldValue, v.newValue)) : (g || []).forEach((v) => f("updateAnnotation", v.newValue, v.oldValue));
1412
1415
  };
1413
- return t.on("undo", _(!0)), t.on("redo", _(!1)), { on: d, off: f, emit: p };
1416
+ return t.on("undo", _(!0)), t.on("redo", _(!1)), { on: d, off: p, emit: f };
1414
1417
  }, xm = (r) => (t) => t.reduce((e, i) => {
1415
1418
  const { parsed: s, error: n } = r.parse(i);
1416
1419
  return n ? {
@@ -1436,7 +1439,7 @@ const gm = 250, ym = (r) => {
1436
1439
  var y;
1437
1440
  const x = (((y = s.selected) == null ? void 0 : y.map((g) => g.id)) || []).map((g) => i.getAnnotation(g)).filter(Boolean);
1438
1441
  return e ? x.map(e.serialize) : x;
1439
- }, u = (y, x = !0) => fetch(y).then((g) => g.json()).then((g) => (f(g, x), g)), d = (y) => {
1442
+ }, u = (y, x = !0) => fetch(y).then((g) => g.json()).then((g) => (p(g, x), g)), d = (y) => {
1440
1443
  if (typeof y == "string") {
1441
1444
  const x = i.getAnnotation(y);
1442
1445
  if (i.deleteAnnotation(y), x)
@@ -1446,13 +1449,13 @@ const gm = 250, ym = (r) => {
1446
1449
  if (x)
1447
1450
  return i.deleteAnnotation(x), y;
1448
1451
  }
1449
- }, f = (y, x = !0) => {
1452
+ }, p = (y, x = !0) => {
1450
1453
  if (e) {
1451
1454
  const g = e.parseAll || xm(e), { parsed: v, failed: w } = g(y);
1452
1455
  w.length > 0 && console.warn(`Discarded ${w.length} invalid annotations`, w), i.bulkAddAnnotation(v, x, At.REMOTE);
1453
1456
  } else
1454
1457
  i.bulkAddAnnotation(y.map(ho), x, At.REMOTE);
1455
- }, p = (y, x) => {
1458
+ }, f = (y, x) => {
1456
1459
  y ? s.setSelected(y, x) : s.clear();
1457
1460
  }, m = (y) => {
1458
1461
  s.clear(), s.setUserSelectAction(y);
@@ -1473,12 +1476,13 @@ const gm = 250, ym = (r) => {
1473
1476
  clearAnnotations: a,
1474
1477
  getAnnotationById: l,
1475
1478
  getAnnotations: h,
1479
+ getHistory: t.getHistory,
1476
1480
  getSelected: c,
1477
1481
  loadAnnotations: u,
1478
1482
  redo: t.redo,
1479
1483
  removeAnnotation: d,
1480
- setAnnotations: f,
1481
- setSelected: p,
1484
+ setAnnotations: p,
1485
+ setSelected: f,
1482
1486
  setUserSelectAction: m,
1483
1487
  undo: t.undo,
1484
1488
  updateAnnotation: _
@@ -1498,13 +1502,13 @@ let Em = (r) => crypto.getRandomValues(new Uint8Array(r)), Tm = (r, t, e) => {
1498
1502
  return (n = t) => {
1499
1503
  let o = "";
1500
1504
  for (; ; ) {
1501
- let a = e(s), l = s;
1505
+ let a = e(s), l = s | 0;
1502
1506
  for (; l--; )
1503
- if (o += r[a[l] & i] || "", o.length === n) return o;
1507
+ if (o += r[a[l] & i] || "", o.length >= n) return o;
1504
1508
  }
1505
1509
  };
1506
- }, Am = (r, t = 21) => Tm(r, t, Em), Sm = (r = 21) => {
1507
- let t = "", e = crypto.getRandomValues(new Uint8Array(r));
1510
+ }, Am = (r, t = 21) => Tm(r, t | 0, Em), Sm = (r = 21) => {
1511
+ let t = "", e = crypto.getRandomValues(new Uint8Array(r |= 0));
1508
1512
  for (; r--; )
1509
1513
  t += wm[e[r] & 63];
1510
1514
  return t;
@@ -1661,17 +1665,17 @@ function Dm(r) {
1661
1665
  let t, e, i, s, n, o, a, l, h, c, u, d = Ri(
1662
1666
  /*geom*/
1663
1667
  r[4].points
1664
- ), f = [];
1668
+ ), p = [];
1665
1669
  for (let m = 0; m < d.length; m += 1)
1666
- f[m] = Yl(jl(r, d, m));
1667
- const p = (m) => mt(f[m], 1, 1, () => {
1668
- f[m] = null;
1670
+ p[m] = Yl(jl(r, d, m));
1671
+ const f = (m) => mt(p[m], 1, 1, () => {
1672
+ p[m] = null;
1669
1673
  });
1670
1674
  return {
1671
1675
  c() {
1672
1676
  t = yt("polygon"), s = _e(), n = yt("polygon"), a = _e();
1673
- for (let m = 0; m < f.length; m += 1)
1674
- f[m].c();
1677
+ for (let m = 0; m < p.length; m += 1)
1678
+ p[m].c();
1675
1679
  l = Se(), T(t, "class", "a9s-outer"), T(t, "style", e = /*computedStyle*/
1676
1680
  r[1] ? "display:none;" : void 0), T(t, "points", i = /*geom*/
1677
1681
  r[4].points.map(ql).join(" ")), T(n, "class", "a9s-inner a9s-shape-handle"), T(
@@ -1684,8 +1688,8 @@ function Dm(r) {
1684
1688
  },
1685
1689
  m(m, _) {
1686
1690
  it(m, t, _), it(m, s, _), it(m, n, _), it(m, a, _);
1687
- for (let y = 0; y < f.length; y += 1)
1688
- f[y] && f[y].m(m, _);
1691
+ for (let y = 0; y < p.length; y += 1)
1692
+ p[y] && p[y].m(m, _);
1689
1693
  it(m, l, _), h = !0, c || (u = [
1690
1694
  Dt(t, "pointerdown", function() {
1691
1695
  Nt(
@@ -1723,28 +1727,28 @@ function Dm(r) {
1723
1727
  let y;
1724
1728
  for (y = 0; y < d.length; y += 1) {
1725
1729
  const x = jl(r, d, y);
1726
- f[y] ? (f[y].p(x, _), ot(f[y], 1)) : (f[y] = Yl(x), f[y].c(), ot(f[y], 1), f[y].m(l.parentNode, l));
1730
+ p[y] ? (p[y].p(x, _), ot(p[y], 1)) : (p[y] = Yl(x), p[y].c(), ot(p[y], 1), p[y].m(l.parentNode, l));
1727
1731
  }
1728
- for (Ee(), y = d.length; y < f.length; y += 1)
1729
- p(y);
1732
+ for (Ee(), y = d.length; y < p.length; y += 1)
1733
+ f(y);
1730
1734
  Te();
1731
1735
  }
1732
1736
  },
1733
1737
  i(m) {
1734
1738
  if (!h) {
1735
1739
  for (let _ = 0; _ < d.length; _ += 1)
1736
- ot(f[_]);
1740
+ ot(p[_]);
1737
1741
  h = !0;
1738
1742
  }
1739
1743
  },
1740
1744
  o(m) {
1741
- f = f.filter(Boolean);
1742
- for (let _ = 0; _ < f.length; _ += 1)
1743
- mt(f[_]);
1745
+ p = p.filter(Boolean);
1746
+ for (let _ = 0; _ < p.length; _ += 1)
1747
+ mt(p[_]);
1744
1748
  h = !1;
1745
1749
  },
1746
1750
  d(m) {
1747
- m && (rt(t), rt(s), rt(n), rt(a), rt(l)), cl(f, m), c = !1, ze(u);
1751
+ m && (rt(t), rt(s), rt(n), rt(a), rt(l)), cl(p, m), c = !1, ze(u);
1748
1752
  }
1749
1753
  };
1750
1754
  }
@@ -1815,10 +1819,10 @@ function Om(r) {
1815
1819
  const ql = (r) => r.join(","), Kl = (r) => r.join(",");
1816
1820
  function Fm(r, t, e) {
1817
1821
  let i, { shape: s } = t, { computedStyle: n } = t, { transform: o } = t, { viewportScale: a = 1 } = t;
1818
- const l = (d, f, p) => {
1822
+ const l = (d, p, f) => {
1819
1823
  let m;
1820
1824
  const _ = d.geometry;
1821
- f === "SHAPE" ? m = _.points.map(([x, g]) => [x + p[0], g + p[1]]) : m = _.points.map(([x, g], v) => f === `HANDLE-${v}` ? [x + p[0], g + p[1]] : [x, g]);
1825
+ p === "SHAPE" ? m = _.points.map(([x, g]) => [x + f[0], g + f[1]]) : m = _.points.map(([x, g], v) => p === `HANDLE-${v}` ? [x + f[0], g + f[1]] : [x, g]);
1822
1826
  const y = yn(m);
1823
1827
  return { ...d, geometry: { points: m, bounds: y } };
1824
1828
  };
@@ -2122,20 +2126,20 @@ function Hm(r) {
2122
2126
  }
2123
2127
  function Xm(r, t, e) {
2124
2128
  let i, { x: s } = t, { y: n } = t, { scale: o } = t, { radius: a = 30 } = t, l = !1;
2125
- const h = (p) => {
2126
- p.pointerType === "touch" && e(4, l = !0);
2129
+ const h = (f) => {
2130
+ f.pointerType === "touch" && e(4, l = !0);
2127
2131
  }, c = () => e(4, l = !1);
2128
- function u(p) {
2129
- rr.call(this, r, p);
2132
+ function u(f) {
2133
+ rr.call(this, r, f);
2130
2134
  }
2131
- function d(p) {
2132
- rr.call(this, r, p);
2135
+ function d(f) {
2136
+ rr.call(this, r, f);
2133
2137
  }
2134
- function f(p) {
2135
- rr.call(this, r, p);
2138
+ function p(f) {
2139
+ rr.call(this, r, f);
2136
2140
  }
2137
- return r.$$set = (p) => {
2138
- e(8, t = na(na({}, t), Gl(p))), "x" in p && e(0, s = p.x), "y" in p && e(1, n = p.y), "scale" in p && e(2, o = p.scale), "radius" in p && e(3, a = p.radius);
2141
+ return r.$$set = (f) => {
2142
+ e(8, t = na(na({}, t), Gl(f))), "x" in f && e(0, s = f.x), "y" in f && e(1, n = f.y), "scale" in f && e(2, o = f.scale), "radius" in f && e(3, a = f.radius);
2139
2143
  }, r.$$.update = () => {
2140
2144
  r.$$.dirty & /*scale*/
2141
2145
  4 && e(5, i = 10 / o);
@@ -2151,7 +2155,7 @@ function Xm(r, t, e) {
2151
2155
  t,
2152
2156
  u,
2153
2157
  d,
2154
- f
2158
+ p
2155
2159
  ];
2156
2160
  }
2157
2161
  class Yi extends fe {
@@ -2160,7 +2164,7 @@ class Yi extends fe {
2160
2164
  }
2161
2165
  }
2162
2166
  function Vm(r) {
2163
- let t, e, i, s, n, o, a, l, h, c, u, d, f, p, m, _, y, x, g, v, w, I, A, C, N, S, P, E, b, B, O, G, $, F, Q, R, U, z, et, J, H, X, lt;
2167
+ let t, e, i, s, n, o, a, l, h, c, u, d, p, f, m, _, y, x, g, v, w, I, A, C, N, S, P, E, b, B, O, G, $, F, Q, R, U, z, et, J, H, X, lt;
2164
2168
  return F = new Yi({
2165
2169
  props: {
2166
2170
  class: "a9s-corner-handle-topleft",
@@ -2251,7 +2255,7 @@ function Vm(r) {
2251
2255
  ) && r[9]("BOTTOM_LEFT").apply(this, arguments);
2252
2256
  }), {
2253
2257
  c() {
2254
- t = yt("rect"), a = _e(), l = yt("rect"), f = _e(), p = yt("rect"), x = _e(), g = yt("rect"), A = _e(), C = yt("rect"), E = _e(), b = yt("rect"), $ = _e(), he(F.$$.fragment), Q = _e(), he(R.$$.fragment), U = _e(), he(z.$$.fragment), et = _e(), he(J.$$.fragment), T(t, "class", "a9s-outer"), T(t, "style", e = /*computedStyle*/
2258
+ t = yt("rect"), a = _e(), l = yt("rect"), p = _e(), f = yt("rect"), x = _e(), g = yt("rect"), A = _e(), C = yt("rect"), E = _e(), b = yt("rect"), $ = _e(), he(F.$$.fragment), Q = _e(), he(R.$$.fragment), U = _e(), he(z.$$.fragment), et = _e(), he(J.$$.fragment), T(t, "class", "a9s-outer"), T(t, "style", e = /*computedStyle*/
2255
2259
  r[1] ? "display:none;" : void 0), T(t, "x", i = /*geom*/
2256
2260
  r[4].x), T(t, "y", s = /*geom*/
2257
2261
  r[4].y), T(t, "width", n = /*geom*/
@@ -2265,9 +2269,9 @@ function Vm(r) {
2265
2269
  r[4].x), T(l, "y", c = /*geom*/
2266
2270
  r[4].y), T(l, "width", u = /*geom*/
2267
2271
  r[4].w), T(l, "height", d = /*geom*/
2268
- r[4].h), T(p, "class", "a9s-edge-handle a9s-edge-handle-top"), T(p, "x", m = /*geom*/
2269
- r[4].x), T(p, "y", _ = /*geom*/
2270
- r[4].y), T(p, "height", 1), T(p, "width", y = /*geom*/
2272
+ r[4].h), T(f, "class", "a9s-edge-handle a9s-edge-handle-top"), T(f, "x", m = /*geom*/
2273
+ r[4].x), T(f, "y", _ = /*geom*/
2274
+ r[4].y), T(f, "height", 1), T(f, "width", y = /*geom*/
2271
2275
  r[4].w), T(g, "class", "a9s-edge-handle a9s-edge-handle-right"), T(g, "x", v = /*geom*/
2272
2276
  r[4].x + /*geom*/
2273
2277
  r[4].w), T(g, "y", w = /*geom*/
@@ -2282,7 +2286,7 @@ function Vm(r) {
2282
2286
  r[4].h), T(b, "width", 1);
2283
2287
  },
2284
2288
  m(L, D) {
2285
- it(L, t, D), it(L, a, D), it(L, l, D), it(L, f, D), it(L, p, D), it(L, x, D), it(L, g, D), it(L, A, D), it(L, C, D), it(L, E, D), it(L, b, D), it(L, $, D), ie(F, L, D), it(L, Q, D), ie(R, L, D), it(L, U, D), ie(z, L, D), it(L, et, D), ie(J, L, D), H = !0, X || (lt = [
2289
+ it(L, t, D), it(L, a, D), it(L, l, D), it(L, p, D), it(L, f, D), it(L, x, D), it(L, g, D), it(L, A, D), it(L, C, D), it(L, E, D), it(L, b, D), it(L, $, D), ie(F, L, D), it(L, Q, D), ie(R, L, D), it(L, U, D), ie(z, L, D), it(L, et, D), ie(J, L, D), H = !0, X || (lt = [
2286
2290
  Dt(t, "pointerdown", function() {
2287
2291
  Nt(
2288
2292
  /*grab*/
@@ -2295,7 +2299,7 @@ function Vm(r) {
2295
2299
  r[9]("SHAPE")
2296
2300
  ) && r[9]("SHAPE").apply(this, arguments);
2297
2301
  }),
2298
- Dt(p, "pointerdown", function() {
2302
+ Dt(f, "pointerdown", function() {
2299
2303
  Nt(
2300
2304
  /*grab*/
2301
2305
  r[9]("TOP")
@@ -2348,11 +2352,11 @@ function Vm(r) {
2348
2352
  16 && d !== (d = /*geom*/
2349
2353
  r[4].h)) && T(l, "height", d), (!H || D & /*geom*/
2350
2354
  16 && m !== (m = /*geom*/
2351
- r[4].x)) && T(p, "x", m), (!H || D & /*geom*/
2355
+ r[4].x)) && T(f, "x", m), (!H || D & /*geom*/
2352
2356
  16 && _ !== (_ = /*geom*/
2353
- r[4].y)) && T(p, "y", _), (!H || D & /*geom*/
2357
+ r[4].y)) && T(f, "y", _), (!H || D & /*geom*/
2354
2358
  16 && y !== (y = /*geom*/
2355
- r[4].w)) && T(p, "width", y), (!H || D & /*geom*/
2359
+ r[4].w)) && T(f, "width", y), (!H || D & /*geom*/
2356
2360
  16 && v !== (v = /*geom*/
2357
2361
  r[4].x + /*geom*/
2358
2362
  r[4].w)) && T(g, "x", v), (!H || D & /*geom*/
@@ -2417,7 +2421,7 @@ function Vm(r) {
2417
2421
  mt(F.$$.fragment, L), mt(R.$$.fragment, L), mt(z.$$.fragment, L), mt(J.$$.fragment, L), H = !1;
2418
2422
  },
2419
2423
  d(L) {
2420
- L && (rt(t), rt(a), rt(l), rt(f), rt(p), rt(x), rt(g), rt(A), rt(C), rt(E), rt(b), rt($), rt(Q), rt(U), rt(et)), se(F, L), se(R, L), se(z, L), se(J, L), X = !1, ze(lt);
2424
+ L && (rt(t), rt(a), rt(l), rt(p), rt(f), rt(x), rt(g), rt(A), rt(C), rt(E), rt(b), rt($), rt(Q), rt(U), rt(et)), se(F, L), se(R, L), se(z, L), se(J, L), X = !1, ze(lt);
2421
2425
  }
2422
2426
  };
2423
2427
  }
@@ -2487,14 +2491,14 @@ function zm(r) {
2487
2491
  }
2488
2492
  function Wm(r, t, e) {
2489
2493
  let i, { shape: s } = t, { computedStyle: n } = t, { transform: o } = t, { viewportScale: a = 1 } = t;
2490
- const l = (d, f, p) => {
2494
+ const l = (d, p, f) => {
2491
2495
  const m = d.geometry.bounds;
2492
2496
  let [_, y] = [m.minX, m.minY], [x, g] = [m.maxX, m.maxY];
2493
- const [v, w] = p;
2494
- if (f === "SHAPE")
2497
+ const [v, w] = f;
2498
+ if (p === "SHAPE")
2495
2499
  _ += v, x += v, y += w, g += w;
2496
2500
  else {
2497
- switch (f) {
2501
+ switch (p) {
2498
2502
  case "TOP":
2499
2503
  case "TOP_LEFT":
2500
2504
  case "TOP_RIGHT": {
@@ -2508,7 +2512,7 @@ function Wm(r, t, e) {
2508
2512
  break;
2509
2513
  }
2510
2514
  }
2511
- switch (f) {
2515
+ switch (p) {
2512
2516
  case "LEFT":
2513
2517
  case "TOP_LEFT":
2514
2518
  case "BOTTOM_LEFT": {
@@ -2653,17 +2657,17 @@ function Km(r, t, e) {
2653
2657
  let { shape: o } = t, { editor: a } = t, { transform: l } = t, h, c, u;
2654
2658
  const d = (m) => (_) => {
2655
2659
  h = m, c = l.elementToImage(_.offsetX, _.offsetY), u = o, _.target.setPointerCapture(_.pointerId), n("grab", _);
2656
- }, f = (m) => {
2660
+ }, p = (m) => {
2657
2661
  if (h) {
2658
2662
  const [_, y] = l.elementToImage(m.offsetX, m.offsetY), x = [_ - c[0], y - c[1]];
2659
2663
  e(3, o = a(u, h, x)), n("change", o);
2660
2664
  }
2661
- }, p = (m) => {
2665
+ }, f = (m) => {
2662
2666
  m.target.releasePointerCapture(m.pointerId), h = void 0, u = o, n("release", m);
2663
2667
  };
2664
2668
  return r.$$set = (m) => {
2665
2669
  "shape" in m && e(3, o = m.shape), "editor" in m && e(4, a = m.editor), "transform" in m && e(5, l = m.transform), "$$scope" in m && e(6, s = m.$$scope);
2666
- }, [d, f, p, o, a, l, s, i];
2670
+ }, [d, p, f, o, a, l, s, i];
2667
2671
  }
2668
2672
  class Fu extends fe {
2669
2673
  constructor(t) {
@@ -2730,8 +2734,8 @@ function Qm(r, t, e) {
2730
2734
  const i = Li();
2731
2735
  let { drawingMode: s } = t, { target: n } = t, { tool: o } = t, { transform: a } = t, { viewportScale: l } = t, h;
2732
2736
  return xs(() => {
2733
- const c = n.closest("svg"), u = [], d = (f, p, m) => {
2734
- c == null || c.addEventListener(f, p, m), u.push(() => c == null ? void 0 : c.removeEventListener(f, p, m));
2737
+ const c = n.closest("svg"), u = [], d = (p, f, m) => {
2738
+ c == null || c.addEventListener(p, f, m), u.push(() => c == null ? void 0 : c.removeEventListener(p, f, m));
2735
2739
  };
2736
2740
  return e(5, h = new o({
2737
2741
  target: n,
@@ -2741,8 +2745,8 @@ function Qm(r, t, e) {
2741
2745
  transform: a,
2742
2746
  viewportScale: l
2743
2747
  }
2744
- })), h.$on("create", (f) => i("create", f.detail)), () => {
2745
- u.forEach((f) => f()), h.$destroy();
2748
+ })), h.$on("create", (p) => i("create", p.detail)), () => {
2749
+ u.forEach((p) => p()), h.$destroy();
2746
2750
  };
2747
2751
  }), r.$$set = (c) => {
2748
2752
  "drawingMode" in c && e(0, s = c.drawingMode), "target" in c && e(1, n = c.target), "tool" in c && e(2, o = c.tool), "transform" in c && e(3, a = c.transform), "viewportScale" in c && e(4, l = c.viewportScale);
@@ -2892,21 +2896,21 @@ function eg(r) {
2892
2896
  }
2893
2897
  function rg(r, t, e) {
2894
2898
  const i = Li();
2895
- let { addEventListener: s } = t, { drawingMode: n } = t, { transform: o } = t, a, l, h, c, u, d, f;
2896
- const p = (x) => {
2899
+ let { addEventListener: s } = t, { drawingMode: n } = t, { transform: o } = t, a, l, h, c, u, d, p;
2900
+ const f = (x) => {
2897
2901
  const g = x;
2898
- a = performance.now(), n === "drag" && (e(0, l = o.elementToImage(g.offsetX, g.offsetY)), h = l, e(1, c = l[0]), e(2, u = l[1]), e(3, d = 1), e(4, f = 1));
2902
+ a = performance.now(), n === "drag" && (e(0, l = o.elementToImage(g.offsetX, g.offsetY)), h = l, e(1, c = l[0]), e(2, u = l[1]), e(3, d = 1), e(4, p = 1));
2899
2903
  }, m = (x) => {
2900
2904
  const g = x;
2901
- l && (h = o.elementToImage(g.offsetX, g.offsetY), e(1, c = Math.min(h[0], l[0])), e(2, u = Math.min(h[1], l[1])), e(3, d = Math.abs(h[0] - l[0])), e(4, f = Math.abs(h[1] - l[1])));
2905
+ l && (h = o.elementToImage(g.offsetX, g.offsetY), e(1, c = Math.min(h[0], l[0])), e(2, u = Math.min(h[1], l[1])), e(3, d = Math.abs(h[0] - l[0])), e(4, p = Math.abs(h[1] - l[1])));
2902
2906
  }, _ = (x) => {
2903
2907
  const g = x, v = performance.now() - a;
2904
2908
  if (n === "click") {
2905
2909
  if (v > 300) return;
2906
- l ? y() : (e(0, l = o.elementToImage(g.offsetX, g.offsetY)), h = l, e(1, c = l[0]), e(2, u = l[1]), e(3, d = 1), e(4, f = 1));
2907
- } else l && (v > 300 || d * f > 100 ? (g.stopPropagation(), y()) : (e(0, l = void 0), h = void 0));
2910
+ l ? y() : (e(0, l = o.elementToImage(g.offsetX, g.offsetY)), h = l, e(1, c = l[0]), e(2, u = l[1]), e(3, d = 1), e(4, p = 1));
2911
+ } else l && (v > 300 || d * p > 100 ? (g.stopPropagation(), y()) : (e(0, l = void 0), h = void 0));
2908
2912
  }, y = () => {
2909
- if (d * f > 15) {
2913
+ if (d * p > 15) {
2910
2914
  const x = {
2911
2915
  type: Tt.RECTANGLE,
2912
2916
  geometry: {
@@ -2914,12 +2918,12 @@ function rg(r, t, e) {
2914
2918
  minX: c,
2915
2919
  minY: u,
2916
2920
  maxX: c + d,
2917
- maxY: u + f
2921
+ maxY: u + p
2918
2922
  },
2919
2923
  x: c,
2920
2924
  y: u,
2921
2925
  w: d,
2922
- h: f
2926
+ h: p
2923
2927
  }
2924
2928
  };
2925
2929
  i("create", x);
@@ -2927,10 +2931,10 @@ function rg(r, t, e) {
2927
2931
  e(0, l = void 0), h = void 0;
2928
2932
  };
2929
2933
  return xs(() => {
2930
- s("pointerdown", p), s("pointermove", m), s("pointerup", _, !0);
2934
+ s("pointerdown", f), s("pointermove", m), s("pointerup", _, !0);
2931
2935
  }), r.$$set = (x) => {
2932
2936
  "addEventListener" in x && e(5, s = x.addEventListener), "drawingMode" in x && e(6, n = x.drawingMode), "transform" in x && e(7, o = x.transform);
2933
- }, [l, c, u, d, f, s, n, o];
2937
+ }, [l, c, u, d, p, s, n, o];
2934
2938
  }
2935
2939
  class ig extends fe {
2936
2940
  constructor(t) {
@@ -3058,8 +3062,8 @@ const ng = 20, og = 1500;
3058
3062
  function ag(r, t, e) {
3059
3063
  let i;
3060
3064
  const s = Li();
3061
- let { addEventListener: n } = t, { drawingMode: o } = t, { transform: a } = t, { viewportScale: l = 1 } = t, h, c = [], u, d, f = !1;
3062
- const p = (g) => {
3065
+ let { addEventListener: n } = t, { drawingMode: o } = t, { transform: a } = t, { viewportScale: l = 1 } = t, h, c = [], u, d, p = !1;
3066
+ const f = (g) => {
3063
3067
  const v = g, { timeStamp: w, offsetX: I, offsetY: A } = v;
3064
3068
  if (h = { timeStamp: w, offsetX: I, offsetY: A }, o === "drag" && c.length === 0) {
3065
3069
  const C = a.elementToImage(v.offsetX, v.offsetY);
@@ -3070,7 +3074,7 @@ function ag(r, t, e) {
3070
3074
  if (d && clearTimeout(d), c.length > 0) {
3071
3075
  if (e(1, u = a.elementToImage(v.offsetX, v.offsetY)), c.length > 2) {
3072
3076
  const w = uo(u, c[0]) * l;
3073
- e(2, f = w < ng);
3077
+ e(2, p = w < ng);
3074
3078
  }
3075
3079
  v.pointerType === "touch" && (d = setTimeout(
3076
3080
  () => {
@@ -3084,7 +3088,7 @@ function ag(r, t, e) {
3084
3088
  if (d && clearTimeout(d), o === "click") {
3085
3089
  const w = v.timeStamp - h.timeStamp, I = uo([h.offsetX, h.offsetY], [v.offsetX, v.offsetY]);
3086
3090
  if (w > 300 || I > 15) return;
3087
- if (f)
3091
+ if (p)
3088
3092
  x();
3089
3093
  else if (c.length === 0) {
3090
3094
  const A = a.elementToImage(v.offsetX, v.offsetY);
@@ -3096,7 +3100,7 @@ function ag(r, t, e) {
3096
3100
  e(0, c = []), e(1, u = void 0);
3097
3101
  return;
3098
3102
  }
3099
- v.stopImmediatePropagation(), f ? x() : c.push(u);
3103
+ v.stopImmediatePropagation(), p ? x() : c.push(u);
3100
3104
  }
3101
3105
  }, y = () => {
3102
3106
  if (!u) return;
@@ -3116,7 +3120,7 @@ function ag(r, t, e) {
3116
3120
  e(0, c = []), e(1, u = void 0), s("create", g);
3117
3121
  };
3118
3122
  return xs(() => {
3119
- n("pointerdown", p, !0), n("pointermove", m), n("pointerup", _, !0), n("dblclick", y, !0);
3123
+ n("pointerdown", f, !0), n("pointermove", m), n("pointerup", _, !0), n("dblclick", y, !0);
3120
3124
  }), r.$$set = (g) => {
3121
3125
  "addEventListener" in g && e(4, n = g.addEventListener), "drawingMode" in g && e(5, o = g.drawingMode), "transform" in g && e(6, a = g.transform), "viewportScale" in g && e(7, l = g.viewportScale);
3122
3126
  }, r.$$.update = () => {
@@ -3125,7 +3129,7 @@ function ag(r, t, e) {
3125
3129
  }, [
3126
3130
  c,
3127
3131
  u,
3128
- f,
3132
+ p,
3129
3133
  i,
3130
3134
  n,
3131
3135
  o,
@@ -4085,8 +4089,8 @@ function Cg(r) {
4085
4089
  },
4086
4090
  m(u, d) {
4087
4091
  it(u, t, d), He(t, e);
4088
- for (let f = 0; f < l.length; f += 1)
4089
- l[f] && l[f].m(e, null);
4092
+ for (let p = 0; p < l.length; p += 1)
4093
+ l[p] && l[p].m(e, null);
4090
4094
  He(t, i), c && c.m(i, null), r[33](i), r[34](t), s = !0, n || (o = [
4091
4095
  Dt(t, "pointerup", function() {
4092
4096
  Nt(
@@ -4118,13 +4122,13 @@ function Cg(r) {
4118
4122
  r[32]
4119
4123
  )
4120
4124
  );
4121
- let f;
4122
- for (f = 0; f < a.length; f += 1) {
4123
- const p = rh(r, a, f);
4124
- l[f] ? (l[f].p(p, d), ot(l[f], 1)) : (l[f] = nh(p), l[f].c(), ot(l[f], 1), l[f].m(e, null));
4125
+ let p;
4126
+ for (p = 0; p < a.length; p += 1) {
4127
+ const f = rh(r, a, p);
4128
+ l[p] ? (l[p].p(f, d), ot(l[p], 1)) : (l[p] = nh(f), l[p].c(), ot(l[p], 1), l[p].m(e, null));
4125
4129
  }
4126
- for (Ee(), f = a.length; f < l.length; f += 1)
4127
- h(f);
4130
+ for (Ee(), p = a.length; p < l.length; p += 1)
4131
+ h(p);
4128
4132
  Te();
4129
4133
  }
4130
4134
  r[5] ? c ? (c.p(r, d), d[0] & /*drawingEl*/
@@ -4165,8 +4169,8 @@ function Cg(r) {
4165
4169
  };
4166
4170
  }
4167
4171
  function Rg(r, t, e) {
4168
- let i, s, n, o, a, l, h, c, u, d, f, p = Ct, m = () => (p(), p = bu(E, (X) => e(16, f = X)), E);
4169
- r.$$.on_destroy.push(() => p());
4172
+ let i, s, n, o, a, l, h, c, u, d, p, f = Ct, m = () => (f(), f = bu(E, (X) => e(16, p = X)), E);
4173
+ r.$$.on_destroy.push(() => f());
4170
4174
  let { drawingEnabled: _ } = t, { image: y } = t, { preferredDrawingMode: x } = t, { state: g } = t, { style: v = void 0 } = t, { toolName: w = $n()[0] } = t, { user: I } = t, { visible: A = !0 } = t;
4171
4175
  const C = () => w, N = () => _;
4172
4176
  let S, P, E;
@@ -4244,7 +4248,7 @@ function Rg(r, t, e) {
4244
4248
  i,
4245
4249
  c,
4246
4250
  d,
4247
- f,
4251
+ p,
4248
4252
  b,
4249
4253
  B,
4250
4254
  O,
@@ -4299,8 +4303,8 @@ class Pg extends fe {
4299
4303
  function Uu(r, t, e = 0, i = r.length - 1, s = Mg) {
4300
4304
  for (; i > e; ) {
4301
4305
  if (i - e > 600) {
4302
- const l = i - e + 1, h = t - e + 1, c = Math.log(l), u = 0.5 * Math.exp(2 * c / 3), d = 0.5 * Math.sqrt(c * u * (l - u) / l) * (h - l / 2 < 0 ? -1 : 1), f = Math.max(e, Math.floor(t - h * u / l + d)), p = Math.min(i, Math.floor(t + (l - h) * u / l + d));
4303
- Uu(r, t, f, p, s);
4306
+ const l = i - e + 1, h = t - e + 1, c = Math.log(l), u = 0.5 * Math.exp(2 * c / 3), d = 0.5 * Math.sqrt(c * u * (l - u) / l) * (h - l / 2 < 0 ? -1 : 1), p = Math.max(e, Math.floor(t - h * u / l + d)), f = Math.min(i, Math.floor(t + (l - h) * u / l + d));
4307
+ Uu(r, t, p, f, s);
4304
4308
  }
4305
4309
  const n = r[t];
4306
4310
  let o = e, a = i;
@@ -4430,8 +4434,8 @@ class Bg {
4430
4434
  const u = Math.min(c + h - 1, i);
4431
4435
  uh(t, c, u, l, this.compareMinY);
4432
4436
  for (let d = c; d <= u; d += l) {
4433
- const f = Math.min(d + l - 1, u);
4434
- a.children.push(this._build(t, d, f, s - 1));
4437
+ const p = Math.min(d + l - 1, u);
4438
+ a.children.push(this._build(t, d, p, s - 1));
4435
4439
  }
4436
4440
  }
4437
4441
  return Qr(a, this.toBBox), a;
@@ -4601,8 +4605,8 @@ const Ug = () => {
4601
4605
  a && i();
4602
4606
  const l = o.reduce((h, c) => {
4603
4607
  if (rn(c)) {
4604
- const { minX: u, minY: d, maxX: f, maxY: p } = c.selector.geometry.bounds;
4605
- return [...h, { minX: u, minY: d, maxX: f, maxY: p, target: c }];
4608
+ const { minX: u, minY: d, maxX: p, maxY: f } = c.selector.geometry.bounds;
4609
+ return [...h, { minX: u, minY: d, maxX: p, maxY: f, target: c }];
4606
4610
  } else
4607
4611
  return h;
4608
4612
  }, []);
@@ -4706,7 +4710,7 @@ const Ug = () => {
4706
4710
  const { originalEvent: b, annotation: B } = E.detail;
4707
4711
  B ? n.userSelect(B.id, b) : n.isEmpty() || n.clear();
4708
4712
  });
4709
- const f = bm(s, a, i.adapter), p = () => {
4713
+ const p = bm(s, a, i.adapter), f = () => {
4710
4714
  d.$set({ drawingEnabled: !1 }), setTimeout(() => d.$set({ drawingEnabled: !0 }), 1);
4711
4715
  }, m = () => {
4712
4716
  d.$destroy(), h.parentNode.insertBefore(e, h), h.parentNode.removeChild(h), c.destroy(), a.destroy();
@@ -4723,8 +4727,8 @@ const Ug = () => {
4723
4727
  d.$set({ visible: E })
4724
4728
  );
4725
4729
  return {
4726
- ...f,
4727
- cancelDrawing: p,
4730
+ ...p,
4731
+ cancelDrawing: f,
4728
4732
  destroy: m,
4729
4733
  getDrawingTool: _,
4730
4734
  getUser: y,
@@ -5032,9 +5036,9 @@ function oe(r, t, e, i, s, n, o = null, a = [-1]) {
5032
5036
  };
5033
5037
  o && o(h.root);
5034
5038
  let c = !1;
5035
- if (h.ctx = e ? e(r, t.props || {}, (u, d, ...f) => {
5036
- const p = f.length ? f[0] : d;
5037
- return h.ctx && s(h.ctx[u], h.ctx[u] = p) && (!h.skip_bound && h.bound[u] && h.bound[u](p), c && Jg(r, u)), d;
5039
+ if (h.ctx = e ? e(r, t.props || {}, (u, d, ...p) => {
5040
+ const f = p.length ? p[0] : d;
5041
+ return h.ctx && s(h.ctx[u], h.ctx[u] = f) && (!h.skip_bound && h.bound[u] && h.bound[u](f), c && Jg(r, u)), d;
5038
5042
  }) : [], h.update(), c = !0, hr(h.before_update), h.fragment = i ? i(h.ctx) : !1, t.target) {
5039
5043
  if (t.hydrate) {
5040
5044
  const u = Vg(t.target);
@@ -5255,8 +5259,8 @@ var Ju = { exports: {} };
5255
5259
  function n(l, h, c, u, d) {
5256
5260
  if (typeof c != "function")
5257
5261
  throw new TypeError("The listener must be a function");
5258
- var f = new s(c, u || l, d), p = e ? e + h : h;
5259
- return l._events[p] ? l._events[p].fn ? l._events[p] = [l._events[p], f] : l._events[p].push(f) : (l._events[p] = f, l._eventsCount++), l;
5262
+ var p = new s(c, u || l, d), f = e ? e + h : h;
5263
+ return l._events[f] ? l._events[f].fn ? l._events[f] = [l._events[f], p] : l._events[f].push(p) : (l._events[f] = p, l._eventsCount++), l;
5260
5264
  }
5261
5265
  function o(l, h) {
5262
5266
  --l._eventsCount === 0 ? l._events = new i() : delete l._events[h];
@@ -5274,13 +5278,13 @@ var Ju = { exports: {} };
5274
5278
  var c = e ? e + h : h, u = this._events[c];
5275
5279
  if (!u) return [];
5276
5280
  if (u.fn) return [u.fn];
5277
- for (var d = 0, f = u.length, p = new Array(f); d < f; d++)
5278
- p[d] = u[d].fn;
5279
- return p;
5281
+ for (var d = 0, p = u.length, f = new Array(p); d < p; d++)
5282
+ f[d] = u[d].fn;
5283
+ return f;
5280
5284
  }, a.prototype.listenerCount = function(h) {
5281
5285
  var c = e ? e + h : h, u = this._events[c];
5282
5286
  return u ? u.fn ? 1 : u.length : 0;
5283
- }, a.prototype.emit = function(h, c, u, d, f, p) {
5287
+ }, a.prototype.emit = function(h, c, u, d, p, f) {
5284
5288
  var m = e ? e + h : h;
5285
5289
  if (!this._events[m]) return !1;
5286
5290
  var _ = this._events[m], y = arguments.length, x, g;
@@ -5295,9 +5299,9 @@ var Ju = { exports: {} };
5295
5299
  case 4:
5296
5300
  return _.fn.call(_.context, c, u, d), !0;
5297
5301
  case 5:
5298
- return _.fn.call(_.context, c, u, d, f), !0;
5302
+ return _.fn.call(_.context, c, u, d, p), !0;
5299
5303
  case 6:
5300
- return _.fn.call(_.context, c, u, d, f, p), !0;
5304
+ return _.fn.call(_.context, c, u, d, p, f), !0;
5301
5305
  }
5302
5306
  for (g = 1, x = new Array(y - 1); g < y; g++)
5303
5307
  x[g - 1] = arguments[g];
@@ -5330,17 +5334,17 @@ var Ju = { exports: {} };
5330
5334
  }, a.prototype.once = function(h, c, u) {
5331
5335
  return n(this, h, c, u, !0);
5332
5336
  }, a.prototype.removeListener = function(h, c, u, d) {
5333
- var f = e ? e + h : h;
5334
- if (!this._events[f]) return this;
5337
+ var p = e ? e + h : h;
5338
+ if (!this._events[p]) return this;
5335
5339
  if (!c)
5336
- return o(this, f), this;
5337
- var p = this._events[f];
5338
- if (p.fn)
5339
- p.fn === c && (!d || p.once) && (!u || p.context === u) && o(this, f);
5340
+ return o(this, p), this;
5341
+ var f = this._events[p];
5342
+ if (f.fn)
5343
+ f.fn === c && (!d || f.once) && (!u || f.context === u) && o(this, p);
5340
5344
  else {
5341
- for (var m = 0, _ = [], y = p.length; m < y; m++)
5342
- (p[m].fn !== c || d && !p[m].once || u && p[m].context !== u) && _.push(p[m]);
5343
- _.length ? this._events[f] = _.length === 1 ? _[0] : _ : o(this, f);
5345
+ for (var m = 0, _ = [], y = f.length; m < y; m++)
5346
+ (f[m].fn !== c || d && !f[m].once || u && f[m].context !== u) && _.push(f[m]);
5347
+ _.length ? this._events[p] = _.length === 1 ? _[0] : _ : o(this, p);
5344
5348
  }
5345
5349
  return this;
5346
5350
  }, a.prototype.removeAllListeners = function(h) {
@@ -5357,14 +5361,14 @@ function zn(r, t, e) {
5357
5361
  e = e || 2;
5358
5362
  var i = t && t.length, s = i ? t[0] * e : r.length, n = Qu(r, 0, s, e, !0), o = [];
5359
5363
  if (!n || n.next === n.prev) return o;
5360
- var a, l, h, c, u, d, f;
5364
+ var a, l, h, c, u, d, p;
5361
5365
  if (i && (n = hy(r, t, n, e)), r.length > 80 * e) {
5362
5366
  a = h = r[0], l = c = r[1];
5363
- for (var p = e; p < s; p += e)
5364
- u = r[p], d = r[p + 1], u < a && (a = u), d < l && (l = d), u > h && (h = u), d > c && (c = d);
5365
- f = Math.max(h - a, c - l), f = f !== 0 ? 32767 / f : 0;
5367
+ for (var f = e; f < s; f += e)
5368
+ u = r[f], d = r[f + 1], u < a && (a = u), d < l && (l = d), u > h && (h = u), d > c && (c = d);
5369
+ p = Math.max(h - a, c - l), p = p !== 0 ? 32767 / p : 0;
5366
5370
  }
5367
- return ms(n, o, e, a, l, f, 0), o;
5371
+ return ms(n, o, e, a, l, p, 0), o;
5368
5372
  }
5369
5373
  function Qu(r, t, e, i, s) {
5370
5374
  var n, o;
@@ -5405,25 +5409,25 @@ function ms(r, t, e, i, s, n, o) {
5405
5409
  function ny(r) {
5406
5410
  var t = r.prev, e = r, i = r.next;
5407
5411
  if (It(t, e, i) >= 0) return !1;
5408
- for (var s = t.x, n = e.x, o = i.x, a = t.y, l = e.y, h = i.y, c = s < n ? s < o ? s : o : n < o ? n : o, u = a < l ? a < h ? a : h : l < h ? l : h, d = s > n ? s > o ? s : o : n > o ? n : o, f = a > l ? a > h ? a : h : l > h ? l : h, p = i.next; p !== t; ) {
5409
- if (p.x >= c && p.x <= d && p.y >= u && p.y <= f && gi(s, a, n, l, o, h, p.x, p.y) && It(p.prev, p, p.next) >= 0) return !1;
5410
- p = p.next;
5412
+ for (var s = t.x, n = e.x, o = i.x, a = t.y, l = e.y, h = i.y, c = s < n ? s < o ? s : o : n < o ? n : o, u = a < l ? a < h ? a : h : l < h ? l : h, d = s > n ? s > o ? s : o : n > o ? n : o, p = a > l ? a > h ? a : h : l > h ? l : h, f = i.next; f !== t; ) {
5413
+ if (f.x >= c && f.x <= d && f.y >= u && f.y <= p && gi(s, a, n, l, o, h, f.x, f.y) && It(f.prev, f, f.next) >= 0) return !1;
5414
+ f = f.next;
5411
5415
  }
5412
5416
  return !0;
5413
5417
  }
5414
5418
  function oy(r, t, e, i) {
5415
5419
  var s = r.prev, n = r, o = r.next;
5416
5420
  if (It(s, n, o) >= 0) return !1;
5417
- for (var a = s.x, l = n.x, h = o.x, c = s.y, u = n.y, d = o.y, f = a < l ? a < h ? a : h : l < h ? l : h, p = c < u ? c < d ? c : d : u < d ? u : d, m = a > l ? a > h ? a : h : l > h ? l : h, _ = c > u ? c > d ? c : d : u > d ? u : d, y = pa(f, p, t, e, i), x = pa(m, _, t, e, i), g = r.prevZ, v = r.nextZ; g && g.z >= y && v && v.z <= x; ) {
5418
- if (g.x >= f && g.x <= m && g.y >= p && g.y <= _ && g !== s && g !== o && gi(a, c, l, u, h, d, g.x, g.y) && It(g.prev, g, g.next) >= 0 || (g = g.prevZ, v.x >= f && v.x <= m && v.y >= p && v.y <= _ && v !== s && v !== o && gi(a, c, l, u, h, d, v.x, v.y) && It(v.prev, v, v.next) >= 0)) return !1;
5421
+ for (var a = s.x, l = n.x, h = o.x, c = s.y, u = n.y, d = o.y, p = a < l ? a < h ? a : h : l < h ? l : h, f = c < u ? c < d ? c : d : u < d ? u : d, m = a > l ? a > h ? a : h : l > h ? l : h, _ = c > u ? c > d ? c : d : u > d ? u : d, y = pa(p, f, t, e, i), x = pa(m, _, t, e, i), g = r.prevZ, v = r.nextZ; g && g.z >= y && v && v.z <= x; ) {
5422
+ if (g.x >= p && g.x <= m && g.y >= f && g.y <= _ && g !== s && g !== o && gi(a, c, l, u, h, d, g.x, g.y) && It(g.prev, g, g.next) >= 0 || (g = g.prevZ, v.x >= p && v.x <= m && v.y >= f && v.y <= _ && v !== s && v !== o && gi(a, c, l, u, h, d, v.x, v.y) && It(v.prev, v, v.next) >= 0)) return !1;
5419
5423
  v = v.nextZ;
5420
5424
  }
5421
5425
  for (; g && g.z >= y; ) {
5422
- if (g.x >= f && g.x <= m && g.y >= p && g.y <= _ && g !== s && g !== o && gi(a, c, l, u, h, d, g.x, g.y) && It(g.prev, g, g.next) >= 0) return !1;
5426
+ if (g.x >= p && g.x <= m && g.y >= f && g.y <= _ && g !== s && g !== o && gi(a, c, l, u, h, d, g.x, g.y) && It(g.prev, g, g.next) >= 0) return !1;
5423
5427
  g = g.prevZ;
5424
5428
  }
5425
5429
  for (; v && v.z <= x; ) {
5426
- if (v.x >= f && v.x <= m && v.y >= p && v.y <= _ && v !== s && v !== o && gi(a, c, l, u, h, d, v.x, v.y) && It(v.prev, v, v.next) >= 0) return !1;
5430
+ if (v.x >= p && v.x <= m && v.y >= f && v.y <= _ && v !== s && v !== o && gi(a, c, l, u, h, d, v.x, v.y) && It(v.prev, v, v.next) >= 0) return !1;
5427
5431
  v = v.nextZ;
5428
5432
  }
5429
5433
  return !0;
@@ -5586,9 +5590,9 @@ zn.deviation = function(r, t, e, i) {
5586
5590
  }
5587
5591
  var u = 0;
5588
5592
  for (a = 0; a < i.length; a += 3) {
5589
- var d = i[a] * e, f = i[a + 1] * e, p = i[a + 2] * e;
5593
+ var d = i[a] * e, p = i[a + 1] * e, f = i[a + 2] * e;
5590
5594
  u += Math.abs(
5591
- (r[d] - r[p]) * (r[f + 1] - r[d + 1]) - (r[d] - r[f]) * (r[p + 1] - r[d + 1])
5595
+ (r[d] - r[f]) * (r[p + 1] - r[d + 1]) - (r[d] - r[p]) * (r[f + 1] - r[d + 1])
5592
5596
  );
5593
5597
  }
5594
5598
  return o === 0 && u === 0 ? 0 : Math.abs((u - o) / o);
@@ -5615,7 +5619,7 @@ bn.exports;
5615
5619
  (function(e) {
5616
5620
  var i = t && !t.nodeType && t, s = r && !r.nodeType && r, n = typeof as == "object" && as;
5617
5621
  (n.global === n || n.window === n || n.self === n) && (e = n);
5618
- var o, a = 2147483647, l = 36, h = 1, c = 26, u = 38, d = 700, f = 72, p = 128, m = "-", _ = /^xn--/, y = /[^\x20-\x7E]/, x = /[\x2E\u3002\uFF0E\uFF61]/g, g = {
5622
+ var o, a = 2147483647, l = 36, h = 1, c = 26, u = 38, d = 700, p = 72, f = 128, m = "-", _ = /^xn--/, y = /[^\x20-\x7E]/, x = /[\x2E\u3002\uFF0E\uFF61]/g, g = {
5619
5623
  overflow: "Overflow: input needs wider integers to process",
5620
5624
  "not-basic": "Illegal input >= 0x80 (not a basic code point)",
5621
5625
  "invalid-input": "Invalid input"
@@ -5658,7 +5662,7 @@ bn.exports;
5658
5662
  return w(et + (v + 1) * R / (R + u));
5659
5663
  }
5660
5664
  function G(R) {
5661
- var U = [], z = R.length, et, J = 0, H = p, X = f, lt, L, D, _t, ht, vt, xt, Ce, Re;
5665
+ var U = [], z = R.length, et, J = 0, H = f, X = p, lt, L, D, _t, ht, vt, xt, Ce, Re;
5662
5666
  for (lt = R.lastIndexOf(m), lt < 0 && (lt = 0), L = 0; L < lt; ++L)
5663
5667
  R.charCodeAt(L) >= 128 && C("not-basic"), U.push(R.charCodeAt(L));
5664
5668
  for (D = lt > 0 ? lt + 1 : 0; D < z; ) {
@@ -5670,7 +5674,7 @@ bn.exports;
5670
5674
  }
5671
5675
  function $(R) {
5672
5676
  var U, z, et, J, H, X, lt, L, D, _t, ht, vt = [], xt, Ce, Re, $i;
5673
- for (R = P(R), xt = R.length, U = p, z = 0, H = f, X = 0; X < xt; ++X)
5677
+ for (R = P(R), xt = R.length, U = f, z = 0, H = p, X = 0; X < xt; ++X)
5674
5678
  ht = R[X], ht < 128 && vt.push(I(ht));
5675
5679
  for (et = J = vt.length, J && vt.push(m); et < xt; ) {
5676
5680
  for (lt = a, X = 0; X < xt; ++X)
@@ -6002,8 +6006,8 @@ var t0 = function r(t) {
6002
6006
  var i = o0(t), s = i.length > 0 ? i[0] : "", n = a0("%" + s + "%", e), o = n.name, a = n.value, l = !1, h = n.alias;
6003
6007
  h && (s = h[0], r0(i, e0([0, 1], h)));
6004
6008
  for (var c = 1, u = !0; c < i.length; c += 1) {
6005
- var d = i[c], f = En(d, 0, 1), p = En(d, -1);
6006
- if ((f === '"' || f === "'" || f === "`" || p === '"' || p === "'" || p === "`") && f !== p)
6009
+ var d = i[c], p = En(d, 0, 1), f = En(d, -1);
6010
+ if ((p === '"' || p === "'" || p === "`" || f === '"' || f === "'" || f === "`") && p !== f)
6007
6011
  throw new Mi("property names with quotes must have matching quotes");
6008
6012
  if ((d === "constructor" || !u) && (l = !0), s += "." + d, o = "%" + s + "%", wn(Hr, o))
6009
6013
  a = Hr[o];
@@ -6108,9 +6112,9 @@ var u0 = od, d0 = Ni, Nh = c0, f0 = u0(), Uh = nd, kh = ws, p0 = d0("%Math.floor
6108
6112
  r.exports = function(d) {
6109
6113
  if (typeof d != "function")
6110
6114
  throw new s("a function is required");
6111
- var f = a(t, o, arguments);
6115
+ var p = a(t, o, arguments);
6112
6116
  return i(
6113
- f,
6117
+ p,
6114
6118
  1 + h(0, d.length - (arguments.length - 1)),
6115
6119
  !0
6116
6120
  );
@@ -6202,8 +6206,8 @@ var xa = b0, Yh = xa.custom, qh = fd(Yh) ? Yh : null, ud = {
6202
6206
  return r(b, n, i + 1, s);
6203
6207
  }
6204
6208
  if (typeof t == "function" && !Kh(t)) {
6205
- var f = $0(t), p = Ds(t, d);
6206
- return "[Function" + (f ? ": " + f : " (anonymous)") + "]" + (p.length > 0 ? " { " + Ue.call(p, ", ") + " }" : "");
6209
+ var p = $0(t), f = Ds(t, d);
6210
+ return "[Function" + (p ? ": " + p : " (anonymous)") + "]" + (f.length > 0 ? " { " + Ue.call(f, ", ") + " }" : "");
6207
6211
  }
6208
6212
  if (fd(t)) {
6209
6213
  var m = Bi ? vr.call(String(t), /^(Symbol\(.*\))_[^)]*$/, "$1") : va.call(t);
@@ -6569,13 +6573,13 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6569
6573
  }
6570
6574
  }
6571
6575
  }, yd = function(t, e) {
6572
- for (var i = e && e.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, s = 0; s < t.length; ++s)
6576
+ for (var i = e && e.plainObjects ? { __proto__: null } : {}, s = 0; s < t.length; ++s)
6573
6577
  typeof t[s] < "u" && (i[s] = t[s]);
6574
6578
  return i;
6575
6579
  }, f_ = function r(t, e, i) {
6576
6580
  if (!e)
6577
6581
  return t;
6578
- if (typeof e != "object") {
6582
+ if (typeof e != "object" && typeof e != "function") {
6579
6583
  if (Lr(t))
6580
6584
  t.push(e);
6581
6585
  else if (t && typeof t == "object")
@@ -6615,8 +6619,8 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6615
6619
  return t;
6616
6620
  var o = t;
6617
6621
  if (typeof t == "symbol" ? o = Symbol.prototype.toString.call(t) : typeof t != "string" && (o = String(t)), i === "iso-8859-1")
6618
- return escape(o).replace(/%u[0-9a-f]{4}/gi, function(f) {
6619
- return "%26%23" + parseInt(f.slice(2), 16) + "%3B";
6622
+ return escape(o).replace(/%u[0-9a-f]{4}/gi, function(p) {
6623
+ return "%26%23" + parseInt(p.slice(2), 16) + "%3B";
6620
6624
  });
6621
6625
  for (var a = "", l = 0; l < o.length; l += Po) {
6622
6626
  for (var h = o.length >= Po ? o.slice(l, l + Po) : o, c = [], u = 0; u < h.length; ++u) {
@@ -6693,11 +6697,13 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6693
6697
  arrayFormat: "indices",
6694
6698
  charset: "utf-8",
6695
6699
  charsetSentinel: !1,
6700
+ commaRoundTrip: !1,
6696
6701
  delimiter: "&",
6697
6702
  encode: !0,
6698
6703
  encodeDotInKeys: !1,
6699
6704
  encoder: on.encode,
6700
6705
  encodeValuesOnly: !1,
6706
+ filter: void 0,
6701
6707
  format: Jh,
6702
6708
  formatter: cs.formatters[Jh],
6703
6709
  // deprecated
@@ -6709,7 +6715,7 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6709
6715
  strictNullHandling: !1
6710
6716
  }, A_ = function(t) {
6711
6717
  return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || typeof t == "symbol" || typeof t == "bigint";
6712
- }, Mo = {}, S_ = function r(t, e, i, s, n, o, a, l, h, c, u, d, f, p, m, _, y, x) {
6718
+ }, Mo = {}, S_ = function r(t, e, i, s, n, o, a, l, h, c, u, d, p, f, m, _, y, x) {
6713
6719
  for (var g = t, v = x, w = 0, I = !1; (v = v.get(Mo)) !== void 0 && !I; ) {
6714
6720
  var A = v.get(t);
6715
6721
  if (w += 1, typeof A < "u") {
@@ -6719,17 +6725,17 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6719
6725
  }
6720
6726
  typeof v.get(Mo) > "u" && (w = 0);
6721
6727
  }
6722
- if (typeof c == "function" ? g = c(e, g) : g instanceof Date ? g = f(g) : i === "comma" && Le(g) && (g = on.maybeMap(g, function(R) {
6723
- return R instanceof Date ? f(R) : R;
6728
+ if (typeof c == "function" ? g = c(e, g) : g instanceof Date ? g = p(g) : i === "comma" && Le(g) && (g = on.maybeMap(g, function(R) {
6729
+ return R instanceof Date ? p(R) : R;
6724
6730
  })), g === null) {
6725
6731
  if (o)
6726
- return h && !_ ? h(e, Ot.encoder, y, "key", p) : e;
6732
+ return h && !_ ? h(e, Ot.encoder, y, "key", f) : e;
6727
6733
  g = "";
6728
6734
  }
6729
6735
  if (A_(g) || on.isBuffer(g)) {
6730
6736
  if (h) {
6731
- var C = _ ? e : h(e, Ot.encoder, y, "key", p);
6732
- return [m(C) + "=" + m(h(g, Ot.encoder, y, "value", p))];
6737
+ var C = _ ? e : h(e, Ot.encoder, y, "key", f);
6738
+ return [m(C) + "=" + m(h(g, Ot.encoder, y, "value", f))];
6733
6739
  }
6734
6740
  return [m(e) + "=" + m(String(g))];
6735
6741
  }
@@ -6745,13 +6751,13 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6745
6751
  var P = Object.keys(g);
6746
6752
  S = u ? P.sort(u) : P;
6747
6753
  }
6748
- var E = l ? e.replace(/\./g, "%2E") : e, b = s && Le(g) && g.length === 1 ? E + "[]" : E;
6754
+ var E = l ? String(e).replace(/\./g, "%2E") : String(e), b = s && Le(g) && g.length === 1 ? E + "[]" : E;
6749
6755
  if (n && Le(g) && g.length === 0)
6750
6756
  return b + "[]";
6751
6757
  for (var B = 0; B < S.length; ++B) {
6752
- var O = S[B], G = typeof O == "object" && typeof O.value < "u" ? O.value : g[O];
6758
+ var O = S[B], G = typeof O == "object" && O && typeof O.value < "u" ? O.value : g[O];
6753
6759
  if (!(a && G === null)) {
6754
- var $ = d && l ? O.replace(/\./g, "%2E") : O, F = Le(g) ? typeof i == "function" ? i(b, $) : b : b + (d ? "." + $ : "[" + $ + "]");
6760
+ var $ = d && l ? String(O).replace(/\./g, "%2E") : String(O), F = Le(g) ? typeof i == "function" ? i(b, $) : b : b + (d ? "." + $ : "[" + $ + "]");
6755
6761
  x.set(t, w);
6756
6762
  var Q = vd();
6757
6763
  Q.set(Mo, x), bd(N, r(
@@ -6767,8 +6773,8 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6767
6773
  c,
6768
6774
  u,
6769
6775
  d,
6770
- f,
6771
6776
  p,
6777
+ f,
6772
6778
  m,
6773
6779
  _,
6774
6780
  y,
@@ -6808,7 +6814,7 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6808
6814
  arrayFormat: o,
6809
6815
  charset: e,
6810
6816
  charsetSentinel: typeof t.charsetSentinel == "boolean" ? t.charsetSentinel : Ot.charsetSentinel,
6811
- commaRoundTrip: t.commaRoundTrip,
6817
+ commaRoundTrip: !!t.commaRoundTrip,
6812
6818
  delimiter: typeof t.delimiter > "u" ? Ot.delimiter : t.delimiter,
6813
6819
  encode: typeof t.encode == "boolean" ? t.encode : Ot.encode,
6814
6820
  encodeDotInKeys: typeof t.encodeDotInKeys == "boolean" ? t.encodeDotInKeys : Ot.encodeDotInKeys,
@@ -6831,9 +6837,9 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6831
6837
  var a = xd[i.arrayFormat], l = a === "comma" && i.commaRoundTrip;
6832
6838
  s || (s = Object.keys(e)), i.sort && s.sort(i.sort);
6833
6839
  for (var h = vd(), c = 0; c < s.length; ++c) {
6834
- var u = s[c];
6835
- i.skipNulls && e[u] === null || bd(o, S_(
6836
- e[u],
6840
+ var u = s[c], d = e[u];
6841
+ i.skipNulls && d === null || bd(o, S_(
6842
+ d,
6837
6843
  u,
6838
6844
  a,
6839
6845
  l,
@@ -6853,8 +6859,8 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6853
6859
  h
6854
6860
  ));
6855
6861
  }
6856
- var d = o.join(i.delimiter), f = i.addQueryPrefix === !0 ? "?" : "";
6857
- return i.charsetSentinel && (i.charset === "iso-8859-1" ? f += "utf8=%26%2310003%3B&" : f += "utf8=%E2%9C%93&"), d.length > 0 ? f + d : "";
6862
+ var p = o.join(i.delimiter), f = i.addQueryPrefix === !0 ? "?" : "";
6863
+ return i.charsetSentinel && (i.charset === "iso-8859-1" ? f += "utf8=%26%2310003%3B&" : f += "utf8=%E2%9C%93&"), p.length > 0 ? f + p : "";
6858
6864
  }, Di = _d, Ea = Object.prototype.hasOwnProperty, R_ = Array.isArray, Pt = {
6859
6865
  allowDots: !1,
6860
6866
  allowEmptyArrays: !1,
@@ -6891,15 +6897,15 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6891
6897
  o[l].indexOf("utf8=") === 0 && (o[l] === B_ ? h = "utf-8" : o[l] === M_ && (h = "iso-8859-1"), a = l, l = o.length);
6892
6898
  for (l = 0; l < o.length; ++l)
6893
6899
  if (l !== a) {
6894
- var c = o[l], u = c.indexOf("]="), d = u === -1 ? c.indexOf("=") : u + 1, f, p;
6895
- d === -1 ? (f = e.decoder(c, Pt.decoder, h, "key"), p = e.strictNullHandling ? null : "") : (f = e.decoder(c.slice(0, d), Pt.decoder, h, "key"), p = Di.maybeMap(
6900
+ var c = o[l], u = c.indexOf("]="), d = u === -1 ? c.indexOf("=") : u + 1, p, f;
6901
+ d === -1 ? (p = e.decoder(c, Pt.decoder, h, "key"), f = e.strictNullHandling ? null : "") : (p = e.decoder(c.slice(0, d), Pt.decoder, h, "key"), f = Di.maybeMap(
6896
6902
  wd(c.slice(d + 1), e),
6897
6903
  function(_) {
6898
6904
  return e.decoder(_, Pt.decoder, h, "value");
6899
6905
  }
6900
- )), p && e.interpretNumericEntities && h === "iso-8859-1" && (p = P_(p)), c.indexOf("[]=") > -1 && (p = R_(p) ? [p] : p);
6901
- var m = Ea.call(i, f);
6902
- m && e.duplicates === "combine" ? i[f] = Di.combine(i[f], p) : (!m || e.duplicates === "last") && (i[f] = p);
6906
+ )), f && e.interpretNumericEntities && h === "iso-8859-1" && (f = P_(String(f))), c.indexOf("[]=") > -1 && (f = R_(f) ? [f] : f);
6907
+ var m = Ea.call(i, p);
6908
+ m && e.duplicates === "combine" ? i[p] = Di.combine(i[p], f) : (!m || e.duplicates === "last") && (i[p] = f);
6903
6909
  }
6904
6910
  return i;
6905
6911
  }, O_ = function(r, t, e, i) {
@@ -6908,7 +6914,7 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6908
6914
  if (a === "[]" && e.parseArrays)
6909
6915
  o = e.allowEmptyArrays && (s === "" || e.strictNullHandling && s === null) ? [] : [].concat(s);
6910
6916
  else {
6911
- o = e.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
6917
+ o = e.plainObjects ? { __proto__: null } : {};
6912
6918
  var l = a.charAt(0) === "[" && a.charAt(a.length - 1) === "]" ? a.slice(1, -1) : a, h = e.decodeDotInKeys ? l.replace(/%2E/g, ".") : l, c = parseInt(h, 10);
6913
6919
  !e.parseArrays && h === "" ? o = { 0: s } : !isNaN(c) && a !== h && String(c) === h && c >= 0 && e.parseArrays && c <= e.arrayLimit ? (o = [], o[c] = s) : h !== "__proto__" && (o[h] = s);
6914
6920
  }
@@ -6976,8 +6982,8 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6976
6982
  }, N_ = function(r, t) {
6977
6983
  var e = L_(t);
6978
6984
  if (r === "" || r === null || typeof r > "u")
6979
- return e.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
6980
- for (var i = typeof r == "string" ? D_(r, e) : r, s = e.plainObjects ? /* @__PURE__ */ Object.create(null) : {}, n = Object.keys(i), o = 0; o < n.length; ++o) {
6985
+ return e.plainObjects ? { __proto__: null } : {};
6986
+ for (var i = typeof r == "string" ? D_(r, e) : r, s = e.plainObjects ? { __proto__: null } : {}, n = Object.keys(i), o = 0; o < n.length; ++o) {
6981
6987
  var a = n[o], l = F_(a, i[a], e, typeof r == "string");
6982
6988
  s = Di.merge(s, l, e);
6983
6989
  }
@@ -7063,26 +7069,26 @@ or.prototype.parse = function(r, t, e) {
7063
7069
  u && !(h && Aa[h]) && (a = a.substr(2), this.slashes = !0);
7064
7070
  }
7065
7071
  if (!Aa[h] && (u || h && !Ei[h])) {
7066
- for (var d = -1, f = 0; f < tc.length; f++) {
7067
- var p = a.indexOf(tc[f]);
7068
- p !== -1 && (d === -1 || p < d) && (d = p);
7072
+ for (var d = -1, p = 0; p < tc.length; p++) {
7073
+ var f = a.indexOf(tc[p]);
7074
+ f !== -1 && (d === -1 || f < d) && (d = f);
7069
7075
  }
7070
7076
  var m, _;
7071
7077
  d === -1 ? _ = a.lastIndexOf("@") : _ = a.lastIndexOf("@", d), _ !== -1 && (m = a.slice(0, _), a = a.slice(_ + 1), this.auth = decodeURIComponent(m)), d = -1;
7072
- for (var f = 0; f < Qh.length; f++) {
7073
- var p = a.indexOf(Qh[f]);
7074
- p !== -1 && (d === -1 || p < d) && (d = p);
7078
+ for (var p = 0; p < Qh.length; p++) {
7079
+ var f = a.indexOf(Qh[p]);
7080
+ f !== -1 && (d === -1 || f < d) && (d = f);
7075
7081
  }
7076
7082
  d === -1 && (d = a.length), this.host = a.slice(0, d), a = a.slice(d), this.parseHost(), this.hostname = this.hostname || "";
7077
7083
  var y = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
7078
7084
  if (!y)
7079
- for (var x = this.hostname.split(/\./), f = 0, g = x.length; f < g; f++) {
7080
- var v = x[f];
7085
+ for (var x = this.hostname.split(/\./), p = 0, g = x.length; p < g; p++) {
7086
+ var v = x[p];
7081
7087
  if (v && !v.match(ec)) {
7082
7088
  for (var w = "", I = 0, A = v.length; I < A; I++)
7083
7089
  v.charCodeAt(I) > 127 ? w += "x" : w += v[I];
7084
7090
  if (!w.match(ec)) {
7085
- var C = x.slice(0, f), N = x.slice(f + 1), S = v.match(q_);
7091
+ var C = x.slice(0, p), N = x.slice(p + 1), S = v.match(q_);
7086
7092
  S && (C.push(S[1]), N.unshift(S[2])), N.length && (a = "/" + N.join(".") + a), this.hostname = C.join(".");
7087
7093
  break;
7088
7094
  }
@@ -7093,8 +7099,8 @@ or.prototype.parse = function(r, t, e) {
7093
7099
  this.host = E + P, this.href += this.host, y && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), a[0] !== "/" && (a = "/" + a));
7094
7100
  }
7095
7101
  if (!K_[c])
7096
- for (var f = 0, g = Ta.length; f < g; f++) {
7097
- var b = Ta[f];
7102
+ for (var p = 0, g = Ta.length; p < g; p++) {
7103
+ var b = Ta[p];
7098
7104
  if (a.indexOf(b) !== -1) {
7099
7105
  var B = encodeURIComponent(b);
7100
7106
  B === b && (B = escape(b)), a = a.split(b).join(B);
@@ -7158,12 +7164,12 @@ or.prototype.resolveObject = function(r) {
7158
7164
  } else
7159
7165
  e.pathname = r.pathname;
7160
7166
  if (e.search = r.search, e.query = r.query, e.host = r.host || "", e.auth = r.auth, e.hostname = r.hostname || r.host, e.port = r.port, e.pathname || e.search) {
7161
- var d = e.pathname || "", f = e.search || "";
7162
- e.path = d + f;
7167
+ var d = e.pathname || "", p = e.search || "";
7168
+ e.path = d + p;
7163
7169
  }
7164
7170
  return e.slashes = e.slashes || r.slashes, e.href = e.format(), e;
7165
7171
  }
7166
- var p = e.pathname && e.pathname.charAt(0) === "/", m = r.host || r.pathname && r.pathname.charAt(0) === "/", _ = m || p || e.host && r.pathname, y = _, x = e.pathname && e.pathname.split("/") || [], g = r.pathname && r.pathname.split("/") || [], v = e.protocol && !Ei[e.protocol];
7172
+ var f = e.pathname && e.pathname.charAt(0) === "/", m = r.host || r.pathname && r.pathname.charAt(0) === "/", _ = m || f || e.host && r.pathname, y = _, x = e.pathname && e.pathname.split("/") || [], g = r.pathname && r.pathname.split("/") || [], v = e.protocol && !Ei[e.protocol];
7167
7173
  if (v && (e.hostname = "", e.port = null, e.host && (x[0] === "" ? x[0] = e.host : x.unshift(e.host)), e.host = "", r.protocol && (r.hostname = null, r.port = null, r.host && (g[0] === "" ? g[0] = r.host : g.unshift(r.host)), r.host = null), _ = _ && (g[0] === "" || x[0] === "")), m)
7168
7174
  e.host = r.host || r.host === "" ? r.host : e.host, e.hostname = r.hostname || r.hostname === "" ? r.hostname : e.hostname, e.search = r.search, e.query = r.query, x = g;
7169
7175
  else if (g.length)
@@ -7686,10 +7692,10 @@ function uv(r, t) {
7686
7692
  if (h) return h;
7687
7693
  if (o != null && o.closest) {
7688
7694
  var c = this.toRgb(), u = 1 / 0, d = "black";
7689
- if (!n.length) for (var f in e) n[f] = new r(e[f]).toRgb();
7690
- for (var p in e) {
7691
- var m = (a = c, l = n[p], Math.pow(a.r - l.r, 2) + Math.pow(a.g - l.g, 2) + Math.pow(a.b - l.b, 2));
7692
- m < u && (u = m, d = p);
7695
+ if (!n.length) for (var p in e) n[p] = new r(e[p]).toRgb();
7696
+ for (var f in e) {
7697
+ var m = (a = c, l = n[f], Math.pow(a.r - l.r, 2) + Math.pow(a.g - l.g, 2) + Math.pow(a.b - l.b, 2));
7698
+ m < u && (u = m, d = f);
7693
7699
  }
7694
7700
  return d;
7695
7701
  }
@@ -8763,10 +8769,10 @@ const Tv = {
8763
8769
  format: c,
8764
8770
  type: u,
8765
8771
  target: d,
8766
- resolution: f,
8767
- resourceOptions: p
8772
+ resolution: p,
8773
+ resourceOptions: f
8768
8774
  } = e;
8769
- t && !(t instanceof _s) && (t = Rd(t, p), t.internal = !0), this.resolution = f || j.RESOLUTION, this.width = Math.round((a || 0) * this.resolution) / this.resolution, this.height = Math.round((l || 0) * this.resolution) / this.resolution, this._mipmap = s, this.anisotropicLevel = n, this._wrapMode = h, this._scaleMode = o, this.format = c, this.type = u, this.target = d, this.alphaMode = i, this.uid = Wr(), this.touched = 0, this.isPowerOfTwo = !1, this._refreshPOT(), this._glTextures = {}, this.dirtyId = 0, this.dirtyStyleId = 0, this.cacheId = null, this.valid = a > 0 && l > 0, this.textureCacheIds = [], this.destroyed = !1, this.resource = null, this._batchEnabled = 0, this._batchLocation = 0, this.parentTextureArray = null, this.setResource(t);
8775
+ t && !(t instanceof _s) && (t = Rd(t, f), t.internal = !0), this.resolution = p || j.RESOLUTION, this.width = Math.round((a || 0) * this.resolution) / this.resolution, this.height = Math.round((l || 0) * this.resolution) / this.resolution, this._mipmap = s, this.anisotropicLevel = n, this._wrapMode = h, this._scaleMode = o, this.format = c, this.type = u, this.target = d, this.alphaMode = i, this.uid = Wr(), this.touched = 0, this.isPowerOfTwo = !1, this._refreshPOT(), this._glTextures = {}, this.dirtyId = 0, this.dirtyStyleId = 0, this.cacheId = null, this.valid = a > 0 && l > 0, this.textureCacheIds = [], this.destroyed = !1, this.resource = null, this._batchEnabled = 0, this._batchLocation = 0, this.parentTextureArray = null, this.setResource(t);
8770
8776
  }
8771
8777
  /**
8772
8778
  * Pixel width of the source of this texture
@@ -9136,8 +9142,8 @@ function Iv(r, t) {
9136
9142
  const h = t[l], c = r[l], u = Cd(c);
9137
9143
  s[u] || (s[u] = new Sv[u](n)), o = s[u];
9138
9144
  for (let d = 0; d < c.length; d++) {
9139
- const f = (d / h | 0) * i + a, p = d % h;
9140
- o[f + p] = c[d];
9145
+ const p = (d / h | 0) * i + a, f = d % h;
9146
+ o[p + f] = c[d];
9141
9147
  }
9142
9148
  a += h;
9143
9149
  }
@@ -9312,8 +9318,8 @@ class Tr {
9312
9318
  }
9313
9319
  for (let u = 0; u < t.length; u++) {
9314
9320
  const d = t[u].indexBuffer.data;
9315
- for (let f = 0; f < d.length; f++)
9316
- e.indexBuffer.data[f + h] += a;
9321
+ for (let p = 0; p < d.length; p++)
9322
+ e.indexBuffer.data[p + h] += a;
9317
9323
  a += t[u].buffers[c].data.length / l, h += d.length;
9318
9324
  }
9319
9325
  }
@@ -9474,8 +9480,8 @@ class at {
9474
9480
  const u = Math.sign(e.a * e.d - e.b * e.c);
9475
9481
  if (u === 0 || (e.apply(a, a), e.apply(l, l), e.apply(h, h), e.apply(c, c), Math.max(a.x, l.x, h.x, c.x) <= i || Math.min(a.x, l.x, h.x, c.x) >= s || Math.max(a.y, l.y, h.y, c.y) <= n || Math.min(a.y, l.y, h.y, c.y) >= o))
9476
9482
  return !1;
9477
- const d = u * (l.y - a.y), f = u * (a.x - l.x), p = d * i + f * n, m = d * s + f * n, _ = d * i + f * o, y = d * s + f * o;
9478
- if (Math.max(p, m, _, y) <= d * a.x + f * a.y || Math.min(p, m, _, y) >= d * c.x + f * c.y)
9483
+ const d = u * (l.y - a.y), p = u * (a.x - l.x), f = d * i + p * n, m = d * s + p * n, _ = d * i + p * o, y = d * s + p * o;
9484
+ if (Math.max(f, m, _, y) <= d * a.x + p * a.y || Math.min(f, m, _, y) >= d * c.x + p * c.y)
9479
9485
  return !1;
9480
9486
  const x = u * (a.y - h.y), g = u * (h.x - a.x), v = x * i + g * n, w = x * s + g * n, I = x * i + g * o, A = x * s + g * o;
9481
9487
  return !(Math.max(v, w, I, A) <= x * a.x + g * a.y || Math.min(v, w, I, A) >= x * c.x + g * c.y);
@@ -11242,9 +11248,9 @@ const Zi = class ge extends Zn {
11242
11248
  } = this, l = ge._drawCallPool;
11243
11249
  let h = this._dcIndex, c = this._aIndex, u = this._iIndex, d = l[h];
11244
11250
  d.start = this._iIndex, d.texArray = t;
11245
- for (let f = e; f < i; ++f) {
11246
- const p = s[f], m = p._texture.baseTexture, _ = Sd[m.alphaMode ? 1 : 0][p.blendMode];
11247
- s[f] = null, e < f && d.blend !== _ && (d.size = u - d.start, e = f, d = l[++h], d.texArray = t, d.start = u), this.packInterleavedGeometry(p, n, o, c, u), c += p.vertexData.length / 2 * a, u += p.indices.length, d.blend = _;
11251
+ for (let p = e; p < i; ++p) {
11252
+ const f = s[p], m = f._texture.baseTexture, _ = Sd[m.alphaMode ? 1 : 0][f.blendMode];
11253
+ s[p] = null, e < p && d.blend !== _ && (d.size = u - d.start, e = p, d = l[++h], d.texArray = t, d.start = u), this.packInterleavedGeometry(f, n, o, c, u), c += f.vertexData.length / 2 * a, u += f.indices.length, d.blend = _;
11248
11254
  }
11249
11255
  e < i && (d.size = u - d.start, ++h), this._dcIndex = h, this._aIndex = c, this._iIndex = u;
11250
11256
  }
@@ -11332,9 +11338,9 @@ const Zi = class ge extends Zn {
11332
11338
  const {
11333
11339
  uint32View: o,
11334
11340
  float32View: a
11335
- } = e, l = s / this.vertexSize, h = t.uvs, c = t.indices, u = t.vertexData, d = t._texture.baseTexture._batchLocation, f = Math.min(t.worldAlpha, 1), p = bt.shared.setValue(t._tintRGB).toPremultiplied(f, t._texture.baseTexture.alphaMode > 0);
11341
+ } = e, l = s / this.vertexSize, h = t.uvs, c = t.indices, u = t.vertexData, d = t._texture.baseTexture._batchLocation, p = Math.min(t.worldAlpha, 1), f = bt.shared.setValue(t._tintRGB).toPremultiplied(p, t._texture.baseTexture.alphaMode > 0);
11336
11342
  for (let m = 0; m < u.length; m += 2)
11337
- a[s++] = u[m], a[s++] = u[m + 1], a[s++] = h[m], a[s++] = h[m + 1], o[s++] = p, a[s++] = d;
11343
+ a[s++] = u[m], a[s++] = u[m + 1], a[s++] = h[m], a[s++] = h[m + 1], o[s++] = f, a[s++] = d;
11338
11344
  for (let m = 0; m < c.length; m++)
11339
11345
  i[n++] = l + c[m];
11340
11346
  }
@@ -12632,17 +12638,17 @@ class $d {
12632
12638
  a = _.resolution, l = _.multisample;
12633
12639
  } else
12634
12640
  a = i.resolution, l = i.multisample;
12635
- let h = e[0].resolution || a, c = e[0].multisample ?? l, u = e[0].padding, d = e[0].autoFit, f = e[0].legacy ?? !0;
12641
+ let h = e[0].resolution || a, c = e[0].multisample ?? l, u = e[0].padding, d = e[0].autoFit, p = e[0].legacy ?? !0;
12636
12642
  for (let _ = 1; _ < e.length; _++) {
12637
12643
  const y = e[_];
12638
- h = Math.min(h, y.resolution || a), c = Math.min(c, y.multisample ?? l), u = this.useMaxPadding ? Math.max(u, y.padding) : u + y.padding, d = d && y.autoFit, f = f || (y.legacy ?? !0);
12644
+ h = Math.min(h, y.resolution || a), c = Math.min(c, y.multisample ?? l), u = this.useMaxPadding ? Math.max(u, y.padding) : u + y.padding, d = d && y.autoFit, p = p || (y.legacy ?? !0);
12639
12645
  }
12640
- s.length === 1 && (this.defaultFilterStack[0].renderTexture = o.current), s.push(n), n.resolution = h, n.multisample = c, n.legacy = f, n.target = t, n.sourceFrame.copyFrom(t.filterArea || t.getBounds(!0)), n.sourceFrame.pad(u);
12641
- const p = this.tempRect.copyFrom(o.sourceFrame);
12646
+ s.length === 1 && (this.defaultFilterStack[0].renderTexture = o.current), s.push(n), n.resolution = h, n.multisample = c, n.legacy = p, n.target = t, n.sourceFrame.copyFrom(t.filterArea || t.getBounds(!0)), n.sourceFrame.pad(u);
12647
+ const f = this.tempRect.copyFrom(o.sourceFrame);
12642
12648
  i.projection.transform && this.transformAABB(
12643
12649
  Vo.copyFrom(i.projection.transform).invert(),
12644
- p
12645
- ), d ? (n.sourceFrame.fit(p), (n.sourceFrame.width <= 0 || n.sourceFrame.height <= 0) && (n.sourceFrame.width = 0, n.sourceFrame.height = 0)) : n.sourceFrame.intersects(p) || (n.sourceFrame.width = 0, n.sourceFrame.height = 0), this.roundFrame(
12650
+ f
12651
+ ), d ? (n.sourceFrame.fit(f), (n.sourceFrame.width <= 0 || n.sourceFrame.height <= 0) && (n.sourceFrame.width = 0, n.sourceFrame.height = 0)) : n.sourceFrame.intersects(f) || (n.sourceFrame.width = 0, n.sourceFrame.height = 0), this.roundFrame(
12646
12652
  n.sourceFrame,
12647
12653
  o.current ? o.current.resolution : i.resolution,
12648
12654
  o.sourceFrame,
@@ -13209,14 +13215,14 @@ class Xd {
13209
13215
  let c = h[l];
13210
13216
  if (c)
13211
13217
  return h[a.id] = c, c;
13212
- const u = t.buffers, d = t.attributes, f = {}, p = {};
13218
+ const u = t.buffers, d = t.attributes, p = {}, f = {};
13213
13219
  for (const m in u)
13214
- f[m] = 0, p[m] = 0;
13220
+ p[m] = 0, f[m] = 0;
13215
13221
  for (const m in d)
13216
- !d[m].size && a.attributeData[m] ? d[m].size = a.attributeData[m].size : d[m].size || console.warn(`PIXI Geometry attribute '${m}' size cannot be determined (likely the bound shader does not have the attribute)`), f[d[m].buffer] += d[m].size * zo[d[m].type];
13222
+ !d[m].size && a.attributeData[m] ? d[m].size = a.attributeData[m].size : d[m].size || console.warn(`PIXI Geometry attribute '${m}' size cannot be determined (likely the bound shader does not have the attribute)`), p[d[m].buffer] += d[m].size * zo[d[m].type];
13217
13223
  for (const m in d) {
13218
13224
  const _ = d[m], y = _.size;
13219
- _.stride === void 0 && (f[_.buffer] === y * zo[_.type] ? _.stride = 0 : _.stride = f[_.buffer]), _.start === void 0 && (_.start = p[_.buffer], p[_.buffer] += y * zo[_.type]);
13225
+ _.stride === void 0 && (p[_.buffer] === y * zo[_.type] ? _.stride = 0 : _.stride = p[_.buffer]), _.start === void 0 && (_.start = f[_.buffer], f[_.buffer] += y * zo[_.type]);
13220
13226
  }
13221
13227
  c = s.createVertexArray(), s.bindVertexArray(c);
13222
13228
  for (let m = 0; m < u.length; m++) {
@@ -13274,9 +13280,9 @@ class Xd {
13274
13280
  const c = a[h], u = o[c.buffer], d = u._glBuffers[s];
13275
13281
  if (e.attributeData[h]) {
13276
13282
  l !== d && (n.bind(u), l = d);
13277
- const f = e.attributeData[h].location;
13278
- if (i.enableVertexAttribArray(f), i.vertexAttribPointer(
13279
- f,
13283
+ const p = e.attributeData[h].location;
13284
+ if (i.enableVertexAttribArray(p), i.vertexAttribPointer(
13285
+ p,
13280
13286
  c.size,
13281
13287
  c.type || i.FLOAT,
13282
13288
  c.normalized,
@@ -13284,7 +13290,7 @@ class Xd {
13284
13290
  c.start
13285
13291
  ), c.instance)
13286
13292
  if (this.hasInstance)
13287
- i.vertexAttribDivisor(f, c.divisor);
13293
+ i.vertexAttribDivisor(p, c.divisor);
13288
13294
  else
13289
13295
  throw new Error("geometry error, GPU Instancing is not supported on this device");
13290
13296
  }
@@ -14186,7 +14192,7 @@ function g1(r, t) {
14186
14192
  }
14187
14193
  if (!c)
14188
14194
  if (a.data.size > 1) {
14189
- const u = Od(a.data.type), d = Math.max(Qd[a.data.type] / 16, 1), f = u / d, p = (4 - f % 4) % 4;
14195
+ const u = Od(a.data.type), d = Math.max(Qd[a.data.type] / 16, 1), p = u / d, f = (4 - p % 4) % 4;
14190
14196
  n.push(`
14191
14197
  cv = ud.${h}.value;
14192
14198
  v = uv.${h};
@@ -14196,11 +14202,11 @@ function g1(r, t) {
14196
14202
 
14197
14203
  for(var i=0; i < ${a.data.size * d}; i++)
14198
14204
  {
14199
- for(var j = 0; j < ${f}; j++)
14205
+ for(var j = 0; j < ${p}; j++)
14200
14206
  {
14201
14207
  data[offset++] = v[t++];
14202
14208
  }
14203
- offset += ${p};
14209
+ offset += ${f};
14204
14210
  }
14205
14211
 
14206
14212
  `);
@@ -16945,8 +16951,8 @@ class Dn {
16945
16951
  */
16946
16952
  addFrameMatrix(t, e, i, s, n) {
16947
16953
  const o = t.a, a = t.b, l = t.c, h = t.d, c = t.tx, u = t.ty;
16948
- let d = this.minX, f = this.minY, p = this.maxX, m = this.maxY, _ = o * e + l * i + c, y = a * e + h * i + u;
16949
- d = _ < d ? _ : d, f = y < f ? y : f, p = _ > p ? _ : p, m = y > m ? y : m, _ = o * s + l * i + c, y = a * s + h * i + u, d = _ < d ? _ : d, f = y < f ? y : f, p = _ > p ? _ : p, m = y > m ? y : m, _ = o * e + l * n + c, y = a * e + h * n + u, d = _ < d ? _ : d, f = y < f ? y : f, p = _ > p ? _ : p, m = y > m ? y : m, _ = o * s + l * n + c, y = a * s + h * n + u, d = _ < d ? _ : d, f = y < f ? y : f, p = _ > p ? _ : p, m = y > m ? y : m, this.minX = d, this.minY = f, this.maxX = p, this.maxY = m;
16954
+ let d = this.minX, p = this.minY, f = this.maxX, m = this.maxY, _ = o * e + l * i + c, y = a * e + h * i + u;
16955
+ d = _ < d ? _ : d, p = y < p ? y : p, f = _ > f ? _ : f, m = y > m ? y : m, _ = o * s + l * i + c, y = a * s + h * i + u, d = _ < d ? _ : d, p = y < p ? y : p, f = _ > f ? _ : f, m = y > m ? y : m, _ = o * e + l * n + c, y = a * e + h * n + u, d = _ < d ? _ : d, p = y < p ? y : p, f = _ > f ? _ : f, m = y > m ? y : m, _ = o * s + l * n + c, y = a * s + h * n + u, d = _ < d ? _ : d, p = y < p ? y : p, f = _ > f ? _ : f, m = y > m ? y : m, this.minX = d, this.minY = p, this.maxX = f, this.maxY = m;
16950
16956
  }
16951
16957
  /**
16952
16958
  * Adds screen vertices from array
@@ -16983,12 +16989,12 @@ class Dn {
16983
16989
  */
16984
16990
  addVerticesMatrix(t, e, i, s, n = 0, o = n) {
16985
16991
  const a = t.a, l = t.b, h = t.c, c = t.d, u = t.tx, d = t.ty;
16986
- let f = this.minX, p = this.minY, m = this.maxX, _ = this.maxY;
16992
+ let p = this.minX, f = this.minY, m = this.maxX, _ = this.maxY;
16987
16993
  for (let y = i; y < s; y += 2) {
16988
16994
  const x = e[y], g = e[y + 1], v = a * x + h * g + u, w = c * g + l * x + d;
16989
- f = Math.min(f, v - n), m = Math.max(m, v + n), p = Math.min(p, w - o), _ = Math.max(_, w + o);
16995
+ p = Math.min(p, v - n), m = Math.max(m, v + n), f = Math.min(f, w - o), _ = Math.max(_, w + o);
16990
16996
  }
16991
- this.minX = f, this.minY = p, this.maxX = m, this.maxY = _;
16997
+ this.minX = p, this.minY = f, this.maxX = m, this.maxY = _;
16992
16998
  }
16993
16999
  /**
16994
17000
  * Adds other {@link PIXI.Bounds}.
@@ -17778,8 +17784,8 @@ class ki extends Ae {
17778
17784
  return;
17779
17785
  this._textureID !== t._updateID && (this.uvs = this._texture._uvs.uvsFloat32), this._transformID = this.transform._worldID, this._textureID = t._updateID;
17780
17786
  const e = this.transform.worldTransform, i = e.a, s = e.b, n = e.c, o = e.d, a = e.tx, l = e.ty, h = this.vertexData, c = t.trim, u = t.orig, d = this._anchor;
17781
- let f = 0, p = 0, m = 0, _ = 0;
17782
- if (c ? (p = c.x - d._x * u.width, f = p + c.width, _ = c.y - d._y * u.height, m = _ + c.height) : (p = -d._x * u.width, f = p + u.width, _ = -d._y * u.height, m = _ + u.height), h[0] = i * p + n * _ + a, h[1] = o * _ + s * p + l, h[2] = i * f + n * _ + a, h[3] = o * _ + s * f + l, h[4] = i * f + n * m + a, h[5] = o * m + s * f + l, h[6] = i * p + n * m + a, h[7] = o * m + s * p + l, this._roundPixels) {
17787
+ let p = 0, f = 0, m = 0, _ = 0;
17788
+ if (c ? (f = c.x - d._x * u.width, p = f + c.width, _ = c.y - d._y * u.height, m = _ + c.height) : (f = -d._x * u.width, p = f + u.width, _ = -d._y * u.height, m = _ + u.height), h[0] = i * f + n * _ + a, h[1] = o * _ + s * f + l, h[2] = i * p + n * _ + a, h[3] = o * _ + s * p + l, h[4] = i * p + n * m + a, h[5] = o * m + s * p + l, h[6] = i * f + n * m + a, h[7] = o * m + s * f + l, this._roundPixels) {
17783
17789
  const y = j.RESOLUTION;
17784
17790
  for (let x = 0; x < h.length; ++x)
17785
17791
  h[x] = Math.round(h[x] * y) / y;
@@ -17796,8 +17802,8 @@ class ki extends Ae {
17796
17802
  else if (this._transformTrimmedID === this.transform._worldID && this._textureTrimmedID === this._texture._updateID)
17797
17803
  return;
17798
17804
  this._transformTrimmedID = this.transform._worldID, this._textureTrimmedID = this._texture._updateID;
17799
- const t = this._texture, e = this.vertexTrimmedData, i = t.orig, s = this._anchor, n = this.transform.worldTransform, o = n.a, a = n.b, l = n.c, h = n.d, c = n.tx, u = n.ty, d = -s._x * i.width, f = d + i.width, p = -s._y * i.height, m = p + i.height;
17800
- if (e[0] = o * d + l * p + c, e[1] = h * p + a * d + u, e[2] = o * f + l * p + c, e[3] = h * p + a * f + u, e[4] = o * f + l * m + c, e[5] = h * m + a * f + u, e[6] = o * d + l * m + c, e[7] = h * m + a * d + u, this._roundPixels) {
17805
+ const t = this._texture, e = this.vertexTrimmedData, i = t.orig, s = this._anchor, n = this.transform.worldTransform, o = n.a, a = n.b, l = n.c, h = n.d, c = n.tx, u = n.ty, d = -s._x * i.width, p = d + i.width, f = -s._y * i.height, m = f + i.height;
17806
+ if (e[0] = o * d + l * f + c, e[1] = h * f + a * d + u, e[2] = o * p + l * f + c, e[3] = h * f + a * p + u, e[4] = o * p + l * m + c, e[5] = h * m + a * p + u, e[6] = o * d + l * m + c, e[7] = h * m + a * d + u, this._roundPixels) {
17801
17807
  const _ = j.RESOLUTION;
17802
17808
  for (let y = 0; y < e.length; ++y)
17803
17809
  e[y] = Math.round(e[y] * _) / _;
@@ -18017,15 +18023,15 @@ Rt.prototype._renderCached = function(r) {
18017
18023
  !this.visible || this.worldAlpha <= 0 || !this.renderable || (this._initCachedDisplayObject(r), this._cacheData.sprite.transform._worldID = this.transform._worldID, this._cacheData.sprite.worldAlpha = this.worldAlpha, this._cacheData.sprite._render(r));
18018
18024
  };
18019
18025
  Rt.prototype._initCachedDisplayObject = function(r) {
18020
- var d, f;
18026
+ var d, p;
18021
18027
  if ((d = this._cacheData) != null && d.sprite)
18022
18028
  return;
18023
18029
  const t = this.alpha;
18024
18030
  this.alpha = 1, r.batch.flush();
18025
18031
  const e = this.getLocalBounds(new at(), !0);
18026
- if ((f = this.filters) != null && f.length) {
18027
- const p = this.filters[0].padding;
18028
- e.pad(p);
18032
+ if ((p = this.filters) != null && p.length) {
18033
+ const f = this.filters[0].padding;
18034
+ e.pad(f);
18029
18035
  }
18030
18036
  const i = this.cacheAsBitmapResolution || r.resolution;
18031
18037
  e.ceil(i), e.width = Math.max(e.width, 1 / i), e.height = Math.max(e.height, 1 / i);
@@ -18588,7 +18594,7 @@ class qa extends Qt {
18588
18594
  */
18589
18595
  hue(t, e) {
18590
18596
  t = (t || 0) / 180 * Math.PI;
18591
- const i = Math.cos(t), s = Math.sin(t), n = Math.sqrt, o = 1 / 3, a = n(o), l = i + (1 - i) * o, h = o * (1 - i) - a * s, c = o * (1 - i) + a * s, u = o * (1 - i) + a * s, d = i + o * (1 - i), f = o * (1 - i) - a * s, p = o * (1 - i) - a * s, m = o * (1 - i) + a * s, _ = i + o * (1 - i), y = [
18597
+ const i = Math.cos(t), s = Math.sin(t), n = Math.sqrt, o = 1 / 3, a = n(o), l = i + (1 - i) * o, h = o * (1 - i) - a * s, c = o * (1 - i) + a * s, u = o * (1 - i) + a * s, d = i + o * (1 - i), p = o * (1 - i) - a * s, f = o * (1 - i) - a * s, m = o * (1 - i) + a * s, _ = i + o * (1 - i), y = [
18592
18598
  l,
18593
18599
  h,
18594
18600
  c,
@@ -18596,10 +18602,10 @@ class qa extends Qt {
18596
18602
  0,
18597
18603
  u,
18598
18604
  d,
18599
- f,
18605
+ p,
18600
18606
  0,
18601
18607
  0,
18602
- p,
18608
+ f,
18603
18609
  m,
18604
18610
  _,
18605
18611
  0,
@@ -18932,7 +18938,7 @@ class qa extends Qt {
18932
18938
  */
18933
18939
  colorTone(t, e, i, s, n) {
18934
18940
  t = t || 0.2, e = e || 0.15, i = i || 16770432, s = s || 3375104;
18935
- const o = bt.shared, [a, l, h] = o.setValue(i).toArray(), [c, u, d] = o.setValue(s).toArray(), f = [
18941
+ const o = bt.shared, [a, l, h] = o.setValue(i).toArray(), [c, u, d] = o.setValue(s).toArray(), p = [
18936
18942
  0.3,
18937
18943
  0.59,
18938
18944
  0.11,
@@ -18954,7 +18960,7 @@ class qa extends Qt {
18954
18960
  0,
18955
18961
  0
18956
18962
  ];
18957
- this._loadMatrix(f, n);
18963
+ this._loadMatrix(p, n);
18958
18964
  }
18959
18965
  /**
18960
18966
  * Night effect
@@ -19723,7 +19729,7 @@ class On extends Ts {
19723
19729
  * @deprecated since 7.0.0
19724
19730
  */
19725
19731
  // eslint-disable-next-line max-params
19726
- initMouseEvent(t, e, i, s, n, o, a, l, h, c, u, d, f, p, m) {
19732
+ initMouseEvent(t, e, i, s, n, o, a, l, h, c, u, d, p, f, m) {
19727
19733
  throw new Error("Method not implemented.");
19728
19734
  }
19729
19735
  }
@@ -19876,7 +19882,7 @@ class lx {
19876
19882
  if ((t.eventMode === "dynamic" || e === "dynamic") && (gr.pauseUpdate = !1), t.interactiveChildren && t.children) {
19877
19883
  const c = t.children;
19878
19884
  for (let u = c.length - 1; u >= 0; u--) {
19879
- const d = c[u], f = this.hitTestMoveRecursive(
19885
+ const d = c[u], p = this.hitTestMoveRecursive(
19880
19886
  d,
19881
19887
  this._isInteractive(e) ? e : d.eventMode,
19882
19888
  i,
@@ -19884,11 +19890,11 @@ class lx {
19884
19890
  n,
19885
19891
  o || n(t, i)
19886
19892
  );
19887
- if (f) {
19888
- if (f.length > 0 && !f[f.length - 1].parent)
19893
+ if (p) {
19894
+ if (p.length > 0 && !p[p.length - 1].parent)
19889
19895
  continue;
19890
- const p = t.isInteractive();
19891
- (f.length > 0 || p) && (p && this._allInteractiveElements.push(t), f.push(t)), this._hitElements.length === 0 && (this._hitElements = f), a = !0;
19896
+ const f = t.isInteractive();
19897
+ (p.length > 0 || f) && (f && this._allInteractiveElements.push(t), p.push(t)), this._hitElements.length === 0 && (this._hitElements = p), a = !0;
19892
19898
  }
19893
19899
  }
19894
19900
  }
@@ -20038,10 +20044,10 @@ class lx {
20038
20044
  for (; d && d !== this.rootTarget.parent && d !== e.target; )
20039
20045
  d = d.parent;
20040
20046
  if (!d || d === this.rootTarget.parent) {
20041
- const f = this.clonePointerEvent(e, "pointerenter");
20042
- for (f.eventPhase = f.AT_TARGET; f.target && f.target !== n && f.target !== this.rootTarget.parent; )
20043
- f.currentTarget = f.target, this.notifyTarget(f), i && this.notifyTarget(f, "mouseenter"), f.target = f.target.parent;
20044
- this.freeEvent(f);
20047
+ const p = this.clonePointerEvent(e, "pointerenter");
20048
+ for (p.eventPhase = p.AT_TARGET; p.target && p.target !== n && p.target !== this.rootTarget.parent; )
20049
+ p.currentTarget = p.target, this.notifyTarget(p), i && this.notifyTarget(p, "mouseenter"), p.target = p.target.parent;
20050
+ this.freeEvent(p);
20045
20051
  }
20046
20052
  this.freeEvent(u);
20047
20053
  }
@@ -21287,14 +21293,14 @@ class _f {
21287
21293
  let u = this.div;
21288
21294
  u.style.left = `${e}px`, u.style.top = `${i}px`, u.style.width = `${o}px`, u.style.height = `${a}px`;
21289
21295
  for (let d = 0; d < this.children.length; d++) {
21290
- const f = this.children[d];
21291
- if (f.renderId !== this.renderId)
21292
- f._accessibleActive = !1, Ti(this.children, d, 1), this.div.removeChild(f._accessibleDiv), this.pool.push(f._accessibleDiv), f._accessibleDiv = null, d--;
21296
+ const p = this.children[d];
21297
+ if (p.renderId !== this.renderId)
21298
+ p._accessibleActive = !1, Ti(this.children, d, 1), this.div.removeChild(p._accessibleDiv), this.pool.push(p._accessibleDiv), p._accessibleDiv = null, d--;
21293
21299
  else {
21294
- u = f._accessibleDiv;
21295
- let p = f.hitArea;
21296
- const m = f.worldTransform;
21297
- f.hitArea ? (u.style.left = `${(m.tx + p.x * m.a) * h}px`, u.style.top = `${(m.ty + p.y * m.d) * c}px`, u.style.width = `${p.width * m.a * h}px`, u.style.height = `${p.height * m.d * c}px`) : (p = f.getBounds(), this.capHitArea(p), u.style.left = `${p.x * h}px`, u.style.top = `${p.y * c}px`, u.style.width = `${p.width * h}px`, u.style.height = `${p.height * c}px`, u.title !== f.accessibleTitle && f.accessibleTitle !== null && (u.title = f.accessibleTitle), u.getAttribute("aria-label") !== f.accessibleHint && f.accessibleHint !== null && u.setAttribute("aria-label", f.accessibleHint)), (f.accessibleTitle !== u.title || f.tabIndex !== u.tabIndex) && (u.title = f.accessibleTitle, u.tabIndex = f.tabIndex, this.debug && this.updateDebugHTML(u));
21300
+ u = p._accessibleDiv;
21301
+ let f = p.hitArea;
21302
+ const m = p.worldTransform;
21303
+ p.hitArea ? (u.style.left = `${(m.tx + f.x * m.a) * h}px`, u.style.top = `${(m.ty + f.y * m.d) * c}px`, u.style.width = `${f.width * m.a * h}px`, u.style.height = `${f.height * m.d * c}px`) : (f = p.getBounds(), this.capHitArea(f), u.style.left = `${f.x * h}px`, u.style.top = `${f.y * c}px`, u.style.width = `${f.width * h}px`, u.style.height = `${f.height * c}px`, u.title !== p.accessibleTitle && p.accessibleTitle !== null && (u.title = p.accessibleTitle), u.getAttribute("aria-label") !== p.accessibleHint && p.accessibleHint !== null && u.setAttribute("aria-label", p.accessibleHint)), (p.accessibleTitle !== u.title || p.tabIndex !== u.tabIndex) && (u.title = p.accessibleTitle, u.tabIndex = p.tabIndex, this.debug && this.updateDebugHTML(u));
21298
21304
  }
21299
21305
  }
21300
21306
  this.renderId++;
@@ -22322,11 +22328,11 @@ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`), o.pu
22322
22328
  this.hasKey(l) && console.warn(`[Resolver] already has key: ${l} overwriting`);
22323
22329
  }, xe(o).forEach((l) => {
22324
22330
  const { src: h, srcs: c } = l;
22325
- let { data: u, format: d, loadParser: f } = l;
22326
- const p = xe(h || c).map((y) => typeof y == "string" ? bx(y) : Array.isArray(y) ? y : [y]), m = this.getAlias(l);
22331
+ let { data: u, format: d, loadParser: p } = l;
22332
+ const f = xe(h || c).map((y) => typeof y == "string" ? bx(y) : Array.isArray(y) ? y : [y]), m = this.getAlias(l);
22327
22333
  Array.isArray(m) ? m.forEach(a) : a(m);
22328
22334
  const _ = [];
22329
- p.forEach((y) => {
22335
+ f.forEach((y) => {
22330
22336
  y.forEach((x) => {
22331
22337
  let g = {};
22332
22338
  if (typeof x != "object") {
@@ -22339,7 +22345,7 @@ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`), o.pu
22339
22345
  }
22340
22346
  }
22341
22347
  } else
22342
- u = x.data ?? u, d = x.format ?? d, f = x.loadParser ?? f, g = {
22348
+ u = x.data ?? u, d = x.format ?? d, p = x.loadParser ?? p, g = {
22343
22349
  ...g,
22344
22350
  ...x
22345
22351
  };
@@ -22349,7 +22355,7 @@ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`), o.pu
22349
22355
  aliases: m,
22350
22356
  data: u,
22351
22357
  format: d,
22352
- loadParser: f
22358
+ loadParser: p
22353
22359
  }), _.push(g);
22354
22360
  });
22355
22361
  }), m.forEach((y) => {
@@ -22623,8 +22629,8 @@ class Zx {
22623
22629
  e == null || e(++a / l);
22624
22630
  }, c = o.map((u) => {
22625
22631
  const d = s[u];
22626
- return l += Object.keys(d).length, this._mapLoadToResolve(d, h).then((f) => {
22627
- n[u] = f;
22632
+ return l += Object.keys(d).length, this._mapLoadToResolve(d, h).then((p) => {
22633
+ n[u] = p;
22628
22634
  });
22629
22635
  });
22630
22636
  return await Promise.all(c), i ? n[t[0]] : n;
@@ -23127,14 +23133,14 @@ class Vr extends lb {
23127
23133
  */
23128
23134
  static _createLevelBuffers(t, e, i, s, n, o, a) {
23129
23135
  const l = new Array(i);
23130
- let h = t.byteOffset, c = o, u = a, d = c + s - 1 & ~(s - 1), f = u + n - 1 & ~(n - 1), p = d * f * Ln[e];
23136
+ let h = t.byteOffset, c = o, u = a, d = c + s - 1 & ~(s - 1), p = u + n - 1 & ~(n - 1), f = d * p * Ln[e];
23131
23137
  for (let m = 0; m < i; m++)
23132
23138
  l[m] = {
23133
23139
  levelID: m,
23134
23140
  levelWidth: i > 1 ? c : d,
23135
- levelHeight: i > 1 ? u : f,
23136
- levelBuffer: new Uint8Array(t.buffer, h, p)
23137
- }, h += p, c = c >> 1 || 1, u = u >> 1 || 1, d = c + s - 1 & ~(s - 1), f = u + n - 1 & ~(n - 1), p = d * f * Ln[e];
23141
+ levelHeight: i > 1 ? u : p,
23142
+ levelBuffer: new Uint8Array(t.buffer, h, f)
23143
+ }, h += f, c = c >> 1 || 1, u = u >> 1 || 1, d = c + s - 1 & ~(s - 1), p = u + n - 1 & ~(n - 1), f = d * p * Ln[e];
23138
23144
  return l;
23139
23145
  }
23140
23146
  }
@@ -23209,15 +23215,15 @@ function Ab(r) {
23209
23215
  t.buffer,
23210
23216
  h,
23211
23217
  Nc / Uint32Array.BYTES_PER_ELEMENT
23212
- ), u = c[qs.DXGI_FORMAT], d = c[qs.RESOURCE_DIMENSION], f = c[qs.MISC_FLAG], p = c[qs.ARRAY_SIZE], m = Tb[u];
23218
+ ), u = c[qs.DXGI_FORMAT], d = c[qs.RESOURCE_DIMENSION], p = c[qs.MISC_FLAG], f = c[qs.ARRAY_SIZE], m = Tb[u];
23213
23219
  if (m === void 0)
23214
23220
  throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);
23215
- if (f === wb)
23221
+ if (p === wb)
23216
23222
  throw new Error("DDSParser does not support cubemap textures");
23217
23223
  if (d === 6)
23218
23224
  throw new Error("DDSParser does not supported 3D texture data");
23219
23225
  const _ = new Array(), y = Ko + js + Nc;
23220
- if (p === 1)
23226
+ if (f === 1)
23221
23227
  _.push(new Uint8Array(r, y));
23222
23228
  else {
23223
23229
  const x = Ln[m];
@@ -23227,7 +23233,7 @@ function Ab(r) {
23227
23233
  g += S, v = v >>> 1, w = w >>> 1;
23228
23234
  }
23229
23235
  let I = y;
23230
- for (let A = 0; A < p; A++)
23236
+ for (let A = 0; A < f; A++)
23231
23237
  _.push(new Uint8Array(r, I, g)), I += g;
23232
23238
  }
23233
23239
  return _.map((x) => new Vr(x, {
@@ -23278,7 +23284,7 @@ function Rb(r, t, e = !1) {
23278
23284
  const i = new DataView(t);
23279
23285
  if (!Pb(r, i))
23280
23286
  return null;
23281
- const s = i.getUint32(me.ENDIANNESS, !0) === Sb, n = i.getUint32(me.GL_TYPE, s), o = i.getUint32(me.GL_FORMAT, s), a = i.getUint32(me.GL_INTERNAL_FORMAT, s), l = i.getUint32(me.PIXEL_WIDTH, s), h = i.getUint32(me.PIXEL_HEIGHT, s) || 1, c = i.getUint32(me.PIXEL_DEPTH, s) || 1, u = i.getUint32(me.NUMBER_OF_ARRAY_ELEMENTS, s) || 1, d = i.getUint32(me.NUMBER_OF_FACES, s), f = i.getUint32(me.NUMBER_OF_MIPMAP_LEVELS, s), p = i.getUint32(me.BYTES_OF_KEY_VALUE_DATA, s);
23287
+ const s = i.getUint32(me.ENDIANNESS, !0) === Sb, n = i.getUint32(me.GL_TYPE, s), o = i.getUint32(me.GL_FORMAT, s), a = i.getUint32(me.GL_INTERNAL_FORMAT, s), l = i.getUint32(me.PIXEL_WIDTH, s), h = i.getUint32(me.PIXEL_HEIGHT, s) || 1, c = i.getUint32(me.PIXEL_DEPTH, s) || 1, u = i.getUint32(me.NUMBER_OF_ARRAY_ELEMENTS, s) || 1, d = i.getUint32(me.NUMBER_OF_FACES, s), p = i.getUint32(me.NUMBER_OF_MIPMAP_LEVELS, s), f = i.getUint32(me.BYTES_OF_KEY_VALUE_DATA, s);
23282
23288
  if (h === 0 || c !== 1)
23283
23289
  throw new Error("Only 2D textures are supported");
23284
23290
  if (d !== 1)
@@ -23291,18 +23297,18 @@ function Rb(r, t, e = !1) {
23291
23297
  let w;
23292
23298
  if (n !== 0 ? kc[n] ? w = kc[n] * Ib[o] : w = Cb[n] : w = Ln[a], w === void 0)
23293
23299
  throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");
23294
- const I = e ? Bb(i, p, s) : null;
23295
- let A = v * w, C = l, N = h, S = y, P = x, E = rl + p;
23296
- for (let b = 0; b < f; b++) {
23300
+ const I = e ? Bb(i, f, s) : null;
23301
+ let A = v * w, C = l, N = h, S = y, P = x, E = rl + f;
23302
+ for (let b = 0; b < p; b++) {
23297
23303
  const B = i.getUint32(E, s);
23298
23304
  let O = E + 4;
23299
23305
  for (let G = 0; G < u; G++) {
23300
23306
  let $ = g[G];
23301
- $ || ($ = g[G] = new Array(f)), $[b] = {
23307
+ $ || ($ = g[G] = new Array(p)), $[b] = {
23302
23308
  levelID: b,
23303
23309
  // don't align mipWidth when texture not compressed! (glType not zero)
23304
- levelWidth: f > 1 || n !== 0 ? C : S,
23305
- levelHeight: f > 1 || n !== 0 ? N : P,
23310
+ levelWidth: p > 1 || n !== 0 ? C : S,
23311
+ levelHeight: p > 1 || n !== 0 ? N : P,
23306
23312
  levelBuffer: new Uint8Array(t, O, A)
23307
23313
  }, O += A;
23308
23314
  }
@@ -23341,7 +23347,7 @@ function Rb(r, t, e = !1) {
23341
23347
  format: a,
23342
23348
  width: l,
23343
23349
  height: h,
23344
- levels: f,
23350
+ levels: p,
23345
23351
  levelBuffers: b
23346
23352
  })),
23347
23353
  kvData: I
@@ -23574,8 +23580,8 @@ const Ks = new at(), Nb = 4, Tf = class es {
23574
23580
  if (a) {
23575
23581
  if (s = a.baseTexture.resolution, e = e ?? a.frame, n = !1, o = a.baseTexture.alphaMode > 0 && a.baseTexture.format === k.RGBA, !l) {
23576
23582
  i.renderTexture.bind(a);
23577
- const f = a.framebuffer.glFramebuffers[i.CONTEXT_UID];
23578
- f.blitFramebuffer && i.framebuffer.bind(f.blitFramebuffer);
23583
+ const p = a.framebuffer.glFramebuffers[i.CONTEXT_UID];
23584
+ p.blitFramebuffer && i.framebuffer.bind(p.blitFramebuffer);
23579
23585
  }
23580
23586
  } else
23581
23587
  s = i.resolution, e || (e = Ks, e.width = i.width / s, e.height = i.height / s), n = !0, o = this._rendererPremultipliedAlpha, i.renderTexture.bind();
@@ -23624,14 +23630,14 @@ const Nn = {
23624
23630
  const t = r.points;
23625
23631
  let e, i, s, n, o, a;
23626
23632
  if (r.type === Wt.CIRC) {
23627
- const p = r.shape;
23628
- e = p.x, i = p.y, o = a = p.radius, s = n = 0;
23633
+ const f = r.shape;
23634
+ e = f.x, i = f.y, o = a = f.radius, s = n = 0;
23629
23635
  } else if (r.type === Wt.ELIP) {
23630
- const p = r.shape;
23631
- e = p.x, i = p.y, o = p.width, a = p.height, s = n = 0;
23636
+ const f = r.shape;
23637
+ e = f.x, i = f.y, o = f.width, a = f.height, s = n = 0;
23632
23638
  } else {
23633
- const p = r.shape, m = p.width / 2, _ = p.height / 2;
23634
- e = p.x + m, i = p.y + _, o = a = Math.max(0, Math.min(p.radius, Math.min(m, _))), s = m - o, n = _ - a;
23639
+ const f = r.shape, m = f.width / 2, _ = f.height / 2;
23640
+ e = f.x + m, i = f.y + _, o = a = Math.max(0, Math.min(f.radius, Math.min(m, _))), s = m - o, n = _ - a;
23635
23641
  }
23636
23642
  if (!(o >= 0 && a >= 0 && s >= 0 && n >= 0)) {
23637
23643
  t.length = 0;
@@ -23644,21 +23650,21 @@ const Nn = {
23644
23650
  t.length = 8, t[0] = t[6] = e + s, t[1] = t[3] = i + n, t[2] = t[4] = e - s, t[5] = t[7] = i - n;
23645
23651
  return;
23646
23652
  }
23647
- let c = 0, u = l * 4 + (s ? 2 : 0) + 2, d = u, f = h;
23653
+ let c = 0, u = l * 4 + (s ? 2 : 0) + 2, d = u, p = h;
23648
23654
  {
23649
- const p = s + o, m = n, _ = e + p, y = e - p, x = i + m;
23655
+ const f = s + o, m = n, _ = e + f, y = e - f, x = i + m;
23650
23656
  if (t[c++] = _, t[c++] = x, t[--u] = x, t[--u] = y, n) {
23651
23657
  const g = i - m;
23652
- t[d++] = y, t[d++] = g, t[--f] = g, t[--f] = _;
23658
+ t[d++] = y, t[d++] = g, t[--p] = g, t[--p] = _;
23653
23659
  }
23654
23660
  }
23655
- for (let p = 1; p < l; p++) {
23656
- const m = Math.PI / 2 * (p / l), _ = s + Math.cos(m) * o, y = n + Math.sin(m) * a, x = e + _, g = e - _, v = i + y, w = i - y;
23657
- t[c++] = x, t[c++] = v, t[--u] = v, t[--u] = g, t[d++] = g, t[d++] = w, t[--f] = w, t[--f] = x;
23661
+ for (let f = 1; f < l; f++) {
23662
+ const m = Math.PI / 2 * (f / l), _ = s + Math.cos(m) * o, y = n + Math.sin(m) * a, x = e + _, g = e - _, v = i + y, w = i - y;
23663
+ t[c++] = x, t[c++] = v, t[--u] = v, t[--u] = g, t[d++] = g, t[d++] = w, t[--p] = w, t[--p] = x;
23658
23664
  }
23659
23665
  {
23660
- const p = s, m = n + a, _ = e + p, y = e - p, x = i + m, g = i - m;
23661
- t[c++] = _, t[c++] = x, t[--f] = g, t[--f] = _, s && (t[c++] = y, t[c++] = x, t[--f] = g, t[--f] = y);
23666
+ const f = s, m = n + a, _ = e + f, y = e - f, x = i + m, g = i - m;
23667
+ t[c++] = _, t[c++] = x, t[--p] = g, t[--p] = _, s && (t[c++] = y, t[c++] = x, t[--p] = g, t[--p] = y);
23662
23668
  }
23663
23669
  },
23664
23670
  triangulate(r, t) {
@@ -23801,7 +23807,7 @@ class $c {
23801
23807
  const a = o[o.length - 2], l = o[o.length - 1] - e, h = a - t, c = s - e, u = i - t, d = Math.abs(l * u - h * c);
23802
23808
  if (d < 1e-8 || n === 0)
23803
23809
  return (o[o.length - 2] !== t || o[o.length - 1] !== e) && o.push(t, e), null;
23804
- const f = l * l + h * h, p = c * c + u * u, m = l * c + h * u, _ = n * Math.sqrt(f) / d, y = n * Math.sqrt(p) / d, x = _ * m / f, g = y * m / p, v = _ * u + y * h, w = _ * c + y * l, I = h * (y + x), A = l * (y + x), C = u * (_ + g), N = c * (_ + g), S = Math.atan2(A - w, I - v), P = Math.atan2(N - w, C - v);
23810
+ const p = l * l + h * h, f = c * c + u * u, m = l * c + h * u, _ = n * Math.sqrt(p) / d, y = n * Math.sqrt(f) / d, x = _ * m / p, g = y * m / f, v = _ * u + y * h, w = _ * c + y * l, I = h * (y + x), A = l * (y + x), C = u * (_ + g), N = c * (_ + g), S = Math.atan2(A - w, I - v), P = Math.atan2(N - w, C - v);
23805
23811
  return {
23806
23812
  cx: v + t,
23807
23813
  cy: w + e,
@@ -23831,12 +23837,12 @@ class $c {
23831
23837
  const c = a - o, u = Oi._segmentsCount(
23832
23838
  Math.abs(c) * n,
23833
23839
  Math.ceil(Math.abs(c) / Cn) * 40
23834
- ), d = c / (u * 2), f = d * 2, p = Math.cos(d), m = Math.sin(d), _ = u - 1, y = _ % 1 / _;
23840
+ ), d = c / (u * 2), p = d * 2, f = Math.cos(d), m = Math.sin(d), _ = u - 1, y = _ % 1 / _;
23835
23841
  for (let x = 0; x <= _; ++x) {
23836
- const g = x + y * x, v = d + o + f * g, w = Math.cos(v), I = -Math.sin(v);
23842
+ const g = x + y * x, v = d + o + p * g, w = Math.cos(v), I = -Math.sin(v);
23837
23843
  h.push(
23838
- (p * w + m * I) * n + i,
23839
- (p * -I + m * w) * n + s
23844
+ (f * w + m * I) * n + i,
23845
+ (f * -I + m * w) * n + s
23840
23846
  );
23841
23847
  }
23842
23848
  }
@@ -23883,9 +23889,9 @@ class Ml {
23883
23889
  * @returns - Length of bezier curve
23884
23890
  */
23885
23891
  static curveLength(t, e, i, s, n, o, a, l) {
23886
- let h = 0, c = 0, u = 0, d = 0, f = 0, p = 0, m = 0, _ = 0, y = 0, x = 0, g = 0, v = t, w = e;
23892
+ let h = 0, c = 0, u = 0, d = 0, p = 0, f = 0, m = 0, _ = 0, y = 0, x = 0, g = 0, v = t, w = e;
23887
23893
  for (let I = 1; I <= 10; ++I)
23888
- c = I / 10, u = c * c, d = u * c, f = 1 - c, p = f * f, m = p * f, _ = m * t + 3 * p * c * i + 3 * f * u * n + d * a, y = m * e + 3 * p * c * s + 3 * f * u * o + d * l, x = v - _, g = w - y, v = _, w = y, h += Math.sqrt(x * x + g * g);
23894
+ c = I / 10, u = c * c, d = u * c, p = 1 - c, f = p * p, m = f * p, _ = m * t + 3 * f * c * i + 3 * p * u * n + d * a, y = m * e + 3 * f * c * s + 3 * p * u * o + d * l, x = v - _, g = w - y, v = _, w = y, h += Math.sqrt(x * x + g * g);
23889
23895
  return h;
23890
23896
  }
23891
23897
  /**
@@ -23907,22 +23913,22 @@ class Ml {
23907
23913
  const c = Oi._segmentsCount(
23908
23914
  Ml.curveLength(l, h, t, e, i, s, n, o)
23909
23915
  );
23910
- let u = 0, d = 0, f = 0, p = 0, m = 0;
23916
+ let u = 0, d = 0, p = 0, f = 0, m = 0;
23911
23917
  a.push(l, h);
23912
23918
  for (let _ = 1, y = 0; _ <= c; ++_)
23913
- y = _ / c, u = 1 - y, d = u * u, f = d * u, p = y * y, m = p * y, a.push(
23914
- f * l + 3 * d * y * t + 3 * u * p * i + m * n,
23915
- f * h + 3 * d * y * e + 3 * u * p * s + m * o
23919
+ y = _ / c, u = 1 - y, d = u * u, p = d * u, f = y * y, m = f * y, a.push(
23920
+ p * l + 3 * d * y * t + 3 * u * f * i + m * n,
23921
+ p * h + 3 * d * y * e + 3 * u * f * s + m * o
23916
23922
  );
23917
23923
  }
23918
23924
  }
23919
23925
  function Hc(r, t, e, i, s, n, o, a) {
23920
23926
  const l = r - e * s, h = t - i * s, c = r + e * n, u = t + i * n;
23921
- let d, f;
23922
- o ? (d = i, f = -e) : (d = -i, f = e);
23923
- const p = l + d, m = h + f, _ = c + d, y = u + f;
23927
+ let d, p;
23928
+ o ? (d = i, p = -e) : (d = -i, p = e);
23929
+ const f = l + d, m = h + p, _ = c + d, y = u + p;
23924
23930
  return a.push(
23925
- p,
23931
+ f,
23926
23932
  m,
23927
23933
  _,
23928
23934
  y
@@ -23933,7 +23939,7 @@ function Rr(r, t, e, i, s, n, o, a) {
23933
23939
  let c = Math.atan2(l, h), u = Math.atan2(s - r, n - t);
23934
23940
  a && c < u ? c += Math.PI * 2 : !a && c > u && (u += Math.PI * 2);
23935
23941
  let d = c;
23936
- const f = u - c, p = Math.abs(f), m = Math.sqrt(l * l + h * h), _ = (15 * p * Math.sqrt(m) / Math.PI >> 0) + 1, y = f / _;
23942
+ const p = u - c, f = Math.abs(p), m = Math.sqrt(l * l + h * h), _ = (15 * f * Math.sqrt(m) / Math.PI >> 0) + 1, y = p / _;
23937
23943
  if (d += y, a) {
23938
23944
  o.push(
23939
23945
  r,
@@ -23991,9 +23997,9 @@ function Hb(r, t) {
23991
23997
  }
23992
23998
  const c = t.points, u = i.length / 2;
23993
23999
  let d = i.length;
23994
- const f = c.length / 2, p = n.width / 2, m = p * p, _ = n.miterLimit * n.miterLimit;
24000
+ const p = c.length / 2, f = n.width / 2, m = f * f, _ = n.miterLimit * n.miterLimit;
23995
24001
  let y = i[0], x = i[1], g = i[2], v = i[3], w = 0, I = 0, A = -(x - v), C = y - g, N = 0, S = 0, P = Math.sqrt(A * A + C * C);
23996
- A /= P, C /= P, A *= p, C *= p;
24002
+ A /= P, C /= P, A *= f, C *= f;
23997
24003
  const E = n.alignment, b = (1 - E) * 2, B = E * 2;
23998
24004
  l || (n.cap === br.ROUND ? d += Rr(
23999
24005
  y - A * (b - B) * 0.5,
@@ -24011,7 +24017,7 @@ function Hb(r, t) {
24011
24017
  x + C * B
24012
24018
  );
24013
24019
  for (let $ = 1; $ < u - 1; ++$) {
24014
- y = i[($ - 1) * 2], x = i[($ - 1) * 2 + 1], g = i[$ * 2], v = i[$ * 2 + 1], w = i[($ + 1) * 2], I = i[($ + 1) * 2 + 1], A = -(x - v), C = y - g, P = Math.sqrt(A * A + C * C), A /= P, C /= P, A *= p, C *= p, N = -(v - I), S = g - w, P = Math.sqrt(N * N + S * S), N /= P, S /= P, N *= p, S *= p;
24020
+ y = i[($ - 1) * 2], x = i[($ - 1) * 2 + 1], g = i[$ * 2], v = i[$ * 2 + 1], w = i[($ + 1) * 2], I = i[($ + 1) * 2 + 1], A = -(x - v), C = y - g, P = Math.sqrt(A * A + C * C), A /= P, C /= P, A *= f, C *= f, N = -(v - I), S = g - w, P = Math.sqrt(N * N + S * S), N /= P, S /= P, N *= f, S *= f;
24015
24021
  const F = g - y, Q = x - v, R = g - w, U = I - v, z = F * R + Q * U, et = Q * R - U * F, J = et < 0;
24016
24022
  if (Math.abs(et) < 1e-3 * Math.abs(z)) {
24017
24023
  c.push(
@@ -24176,7 +24182,7 @@ function Hb(r, t) {
24176
24182
  ), d += 2;
24177
24183
  }
24178
24184
  }
24179
- y = i[(u - 2) * 2], x = i[(u - 2) * 2 + 1], g = i[(u - 1) * 2], v = i[(u - 1) * 2 + 1], A = -(x - v), C = y - g, P = Math.sqrt(A * A + C * C), A /= P, C /= P, A *= p, C *= p, c.push(
24185
+ y = i[(u - 2) * 2], x = i[(u - 2) * 2 + 1], g = i[(u - 1) * 2], v = i[(u - 1) * 2 + 1], A = -(x - v), C = y - g, P = Math.sqrt(A * A + C * C), A /= P, C /= P, A *= f, C *= f, c.push(
24180
24186
  g - A * b,
24181
24187
  v - C * b,
24182
24188
  g + A * B,
@@ -24192,7 +24198,7 @@ function Hb(r, t) {
24192
24198
  !1
24193
24199
  ) + 2 : n.cap === br.SQUARE && (d += Hc(g, v, A, C, b, B, !1, c)));
24194
24200
  const O = t.indices, G = Oi.epsilon * Oi.epsilon;
24195
- for (let $ = f; $ < d + f - 2; ++$)
24201
+ for (let $ = p; $ < d + p - 2; ++$)
24196
24202
  y = c[$ * 2], x = c[$ * 2 + 1], g = c[($ + 1) * 2], v = c[($ + 1) * 2 + 1], w = c[($ + 2) * 2], I = c[($ + 2) * 2 + 1], !(Math.abs(y * (v - I) + g * (I - x) + w * (x - v)) < G) && O.push($, $ + 1, $ + 2);
24197
24203
  }
24198
24204
  function Xb(r, t) {
@@ -24224,8 +24230,8 @@ class Bl {
24224
24230
  * @returns - Length of quadratic curve
24225
24231
  */
24226
24232
  static curveLength(t, e, i, s, n, o) {
24227
- const a = t - 2 * i + n, l = e - 2 * s + o, h = 2 * i - 2 * t, c = 2 * s - 2 * e, u = 4 * (a * a + l * l), d = 4 * (a * h + l * c), f = h * h + c * c, p = 2 * Math.sqrt(u + d + f), m = Math.sqrt(u), _ = 2 * u * m, y = 2 * Math.sqrt(f), x = d / m;
24228
- return (_ * p + m * d * (p - y) + (4 * f * u - d * d) * Math.log((2 * m + x + p) / (x + y))) / (4 * _);
24233
+ const a = t - 2 * i + n, l = e - 2 * s + o, h = 2 * i - 2 * t, c = 2 * s - 2 * e, u = 4 * (a * a + l * l), d = 4 * (a * h + l * c), p = h * h + c * c, f = 2 * Math.sqrt(u + d + p), m = Math.sqrt(u), _ = 2 * u * m, y = 2 * Math.sqrt(p), x = d / m;
24234
+ return (_ * f + m * d * (f - y) + (4 * p * u - d * d) * Math.log((2 * m + x + f) / (x + y))) / (4 * _);
24229
24235
  }
24230
24236
  /**
24231
24237
  * Calculate the points for a quadratic bezier curve and then draws it.
@@ -24396,13 +24402,13 @@ const ni = new gt(), Sf = class If extends Pd {
24396
24402
  const h = e[l], c = h.fillStyle, u = h.lineStyle;
24397
24403
  Zo[h.type].build(h), h.matrix && this.transformPoints(h.points, h.matrix), (c.visible || u.visible) && this.processHoles(h.holes);
24398
24404
  for (let d = 0; d < 2; d++) {
24399
- const f = d === 0 ? c : u;
24400
- if (!f.visible)
24405
+ const p = d === 0 ? c : u;
24406
+ if (!p.visible)
24401
24407
  continue;
24402
- const p = f.texture.baseTexture, m = this.indices.length, _ = this.points.length / 2;
24403
- p.wrapMode = Er.REPEAT, d === 0 ? this.processFill(h) : this.processLine(h);
24408
+ const f = p.texture.baseTexture, m = this.indices.length, _ = this.points.length / 2;
24409
+ f.wrapMode = Er.REPEAT, d === 0 ? this.processFill(h) : this.processLine(h);
24404
24410
  const y = this.points.length / 2 - _;
24405
- y !== 0 && (i && !this._compareStyles(s, f) && (i.end(m, _), i = null), i || (i = Vc.pop() || new $b(), i.begin(f, m, _), this.batches.push(i), s = f), this.addUvs(this.points, t, f.texture, _, y, f.matrix));
24411
+ y !== 0 && (i && !this._compareStyles(s, p) && (i.end(m, _), i = null), i || (i = Vc.pop() || new $b(), i.begin(p, m, _), this.batches.push(i), s = p), this.addUvs(this.points, t, p.texture, _, y, p.matrix));
24406
24412
  }
24407
24413
  }
24408
24414
  const n = this.indices.length, o = this.points.length / 2;
@@ -24469,8 +24475,8 @@ const ni = new gt(), Sf = class If extends Pd {
24469
24475
  let n = 0, o = null, a = 0, l = !1, h = ke.TRIANGLES, c = 0;
24470
24476
  this.drawCalls.push(s);
24471
24477
  for (let u = 0; u < this.batches.length; u++) {
24472
- const d = this.batches[u], f = 8, p = d.style, m = p.texture.baseTexture;
24473
- l !== !!p.native && (l = !!p.native, h = l ? ke.LINES : ke.TRIANGLES, o = null, n = f, t++), o !== m && (o = m, m._batchEnabled !== t && (n === f && (t++, n = 0, s.size > 0 && (s = Zs.pop(), s || (s = new Oa(), s.texArray = new Ua()), this.drawCalls.push(s)), s.start = c, s.size = 0, s.texArray.count = 0, s.type = h), m.touched = 1, m._batchEnabled = t, m._batchLocation = n, m.wrapMode = Er.REPEAT, s.texArray.elements[s.texArray.count++] = m, n++)), s.size += d.size, c += d.size, a = m._batchLocation, this.addColors(e, p.color, p.alpha, d.attribSize, d.attribStart), this.addTextureIds(i, a, d.attribSize, d.attribStart);
24478
+ const d = this.batches[u], p = 8, f = d.style, m = f.texture.baseTexture;
24479
+ l !== !!f.native && (l = !!f.native, h = l ? ke.LINES : ke.TRIANGLES, o = null, n = p, t++), o !== m && (o = m, m._batchEnabled !== t && (n === p && (t++, n = 0, s.size > 0 && (s = Zs.pop(), s || (s = new Oa(), s.texArray = new Ua()), this.drawCalls.push(s)), s.start = c, s.size = 0, s.texArray.count = 0, s.type = h), m.touched = 1, m._batchEnabled = t, m._batchLocation = n, m.wrapMode = Er.REPEAT, s.texArray.elements[s.texArray.count++] = m, n++)), s.size += d.size, c += d.size, a = m._batchLocation, this.addColors(e, f.color, f.alpha, d.attribSize, d.attribStart), this.addTextureIds(i, a, d.attribSize, d.attribStart);
24474
24480
  }
24475
24481
  st._globalBatch = t, this.packAttributes();
24476
24482
  }
@@ -24565,8 +24571,8 @@ const ni = new gt(), Sf = class If extends Pd {
24565
24571
  for (; a < n; ) {
24566
24572
  let u = t[(s + a) * 2], d = t[(s + a) * 2 + 1];
24567
24573
  if (o) {
24568
- const f = o.a * u + o.c * d + o.tx;
24569
- d = o.b * u + o.d * d + o.ty, u = f;
24574
+ const p = o.a * u + o.c * d + o.tx;
24575
+ d = o.b * u + o.d * d + o.ty, u = p;
24570
24576
  }
24571
24577
  a++, e.push(u / h.width, d / h.height);
24572
24578
  }
@@ -24583,10 +24589,10 @@ const ni = new gt(), Sf = class If extends Pd {
24583
24589
  */
24584
24590
  adjustUvs(t, e, i, s) {
24585
24591
  const n = e.baseTexture, o = 1e-6, a = i + s * 2, l = e.frame, h = l.width / n.width, c = l.height / n.height;
24586
- let u = l.x / l.width, d = l.y / l.height, f = Math.floor(t[i] + o), p = Math.floor(t[i + 1] + o);
24592
+ let u = l.x / l.width, d = l.y / l.height, p = Math.floor(t[i] + o), f = Math.floor(t[i + 1] + o);
24587
24593
  for (let m = i + 2; m < a; m += 2)
24588
- f = Math.min(f, Math.floor(t[m] + o)), p = Math.min(p, Math.floor(t[m + 1] + o));
24589
- u -= f, d -= p;
24594
+ p = Math.min(p, Math.floor(t[m] + o)), f = Math.min(f, Math.floor(t[m + 1] + o));
24595
+ u -= p, d -= f;
24590
24596
  for (let m = i; m < a; m += 2)
24591
24597
  t[m] = (t[m] + u) * h, t[m + 1] = (t[m + 1] + d) * c;
24592
24598
  }
@@ -24816,8 +24822,8 @@ const Jo = {}, il = class dn extends Ae {
24816
24822
  this._initCurve(t, e);
24817
24823
  const o = this.currentPath.points, a = $c.curveTo(t, e, i, s, n, o);
24818
24824
  if (a) {
24819
- const { cx: l, cy: h, radius: c, startAngle: u, endAngle: d, anticlockwise: f } = a;
24820
- this.arc(l, h, c, u, d, f);
24825
+ const { cx: l, cy: h, radius: c, startAngle: u, endAngle: d, anticlockwise: p } = a;
24826
+ this.arc(l, h, c, u, d, p);
24821
24827
  }
24822
24828
  return this;
24823
24829
  }
@@ -25114,8 +25120,8 @@ const Jo = {}, il = class dn extends Ae {
25114
25120
  const e = this.transform.worldTransform, i = e.a, s = e.b, n = e.c, o = e.d, a = e.tx, l = e.ty, h = this._geometry.points, c = this.vertexData;
25115
25121
  let u = 0;
25116
25122
  for (let d = 0; d < h.length; d += 2) {
25117
- const f = h[d], p = h[d + 1];
25118
- c[u++] = i * f + n * p + a, c[u++] = o * p + s * f + l;
25123
+ const p = h[d], f = h[d + 1];
25124
+ c[u++] = i * p + n * f + a, c[u++] = o * f + s * p + l;
25119
25125
  }
25120
25126
  }
25121
25127
  /**
@@ -25322,13 +25328,13 @@ const Qo = new gt(), zc = new Xr(), Cf = class Rf extends Ae {
25322
25328
  this._transformID = this.transform._worldID, this.vertexData.length !== e.length && (this.vertexData = new Float32Array(e.length));
25323
25329
  const s = this.transform.worldTransform, n = s.a, o = s.b, a = s.c, l = s.d, h = s.tx, c = s.ty, u = this.vertexData;
25324
25330
  for (let d = 0; d < u.length / 2; d++) {
25325
- const f = e[d * 2], p = e[d * 2 + 1];
25326
- u[d * 2] = n * f + a * p + h, u[d * 2 + 1] = o * f + l * p + c;
25331
+ const p = e[d * 2], f = e[d * 2 + 1];
25332
+ u[d * 2] = n * p + a * f + h, u[d * 2 + 1] = o * p + l * f + c;
25327
25333
  }
25328
25334
  if (this._roundPixels) {
25329
25335
  const d = j.RESOLUTION;
25330
- for (let f = 0; f < u.length; ++f)
25331
- u[f] = Math.round(u[f] * d) / d;
25336
+ for (let p = 0; p < u.length; ++p)
25337
+ u[p] = Math.round(u[p] * d) / d;
25332
25338
  }
25333
25339
  this.vertexDirty = i;
25334
25340
  }
@@ -25683,13 +25689,13 @@ class Pf extends Zn {
25683
25689
  const c = n.gl, u = t.worldTransform.copyTo(this.tempMatrix);
25684
25690
  u.prepend(n.globalUniforms.uniforms.projectionMatrix), this.shader.uniforms.translationMatrix = u.toArray(!0), this.shader.uniforms.uColor = bt.shared.setValue(t.tintRgb).premultiply(t.worldAlpha, h).toArray(this.shader.uniforms.uColor), this.shader.uniforms.uSampler = l, this.renderer.shader.bind(this.shader);
25685
25691
  let d = !1;
25686
- for (let f = 0, p = 0; f < o; f += s, p += 1) {
25687
- let m = o - f;
25688
- m > s && (m = s), p >= a.length && a.push(this._generateOneMoreBuffer(t));
25689
- const _ = a[p];
25690
- _.uploadDynamic(e, f, m);
25691
- const y = t._bufferUpdateIDs[p] || 0;
25692
- d = d || _._updateID < y, d && (_._updateID = t._updateID, _.uploadStatic(e, f, m)), n.geometry.bind(_.geometry), c.drawElements(c.TRIANGLES, m * 6, c.UNSIGNED_SHORT, 0);
25692
+ for (let p = 0, f = 0; p < o; p += s, f += 1) {
25693
+ let m = o - p;
25694
+ m > s && (m = s), f >= a.length && a.push(this._generateOneMoreBuffer(t));
25695
+ const _ = a[f];
25696
+ _.uploadDynamic(e, p, m);
25697
+ const y = t._bufferUpdateIDs[f] || 0;
25698
+ d = d || _._updateID < y, d && (_._updateID = t._updateID, _.uploadStatic(e, p, m)), n.geometry.bind(_.geometry), c.drawElements(c.TRIANGLES, m * 6, c.UNSIGNED_SHORT, 0);
25693
25699
  }
25694
25700
  }
25695
25701
  /**
@@ -25724,8 +25730,8 @@ class Pf extends Zn {
25724
25730
  uploadVertices(t, e, i, s, n, o) {
25725
25731
  let a = 0, l = 0, h = 0, c = 0;
25726
25732
  for (let u = 0; u < i; ++u) {
25727
- const d = t[e + u], f = d._texture, p = d.scale.x, m = d.scale.y, _ = f.trim, y = f.orig;
25728
- _ ? (l = _.x - d.anchor.x * y.width, a = l + _.width, c = _.y - d.anchor.y * y.height, h = c + _.height) : (a = y.width * (1 - d.anchor.x), l = y.width * -d.anchor.x, h = y.height * (1 - d.anchor.y), c = y.height * -d.anchor.y), s[o] = l * p, s[o + 1] = c * m, s[o + n] = a * p, s[o + n + 1] = c * m, s[o + n * 2] = a * p, s[o + n * 2 + 1] = h * m, s[o + n * 3] = l * p, s[o + n * 3 + 1] = h * m, o += n * 4;
25733
+ const d = t[e + u], p = d._texture, f = d.scale.x, m = d.scale.y, _ = p.trim, y = p.orig;
25734
+ _ ? (l = _.x - d.anchor.x * y.width, a = l + _.width, c = _.y - d.anchor.y * y.height, h = c + _.height) : (a = y.width * (1 - d.anchor.x), l = y.width * -d.anchor.x, h = y.height * (1 - d.anchor.y), c = y.height * -d.anchor.y), s[o] = l * f, s[o + 1] = c * m, s[o + n] = a * f, s[o + n + 1] = c * m, s[o + n * 2] = a * f, s[o + n * 2 + 1] = h * m, s[o + n * 3] = l * f, s[o + n * 3 + 1] = h * m, o += n * 4;
25729
25735
  }
25730
25736
  }
25731
25737
  /**
@@ -25849,19 +25855,19 @@ const Js = {
25849
25855
  a.font = n;
25850
25856
  const l = (i ? K.wordWrap(t, e, s) : t).split(/(?:\r\n|\r|\n)/), h = new Array(l.length);
25851
25857
  let c = 0;
25852
- for (let p = 0; p < l.length; p++) {
25853
- const m = K._measureText(l[p], e.letterSpacing, a);
25854
- h[p] = m, c = Math.max(c, m);
25858
+ for (let f = 0; f < l.length; f++) {
25859
+ const m = K._measureText(l[f], e.letterSpacing, a);
25860
+ h[f] = m, c = Math.max(c, m);
25855
25861
  }
25856
25862
  let u = c + e.strokeThickness;
25857
25863
  e.dropShadow && (u += e.dropShadowDistance);
25858
25864
  const d = e.lineHeight || o.fontSize + e.strokeThickness;
25859
- let f = Math.max(d, o.fontSize + e.strokeThickness * 2) + e.leading + (l.length - 1) * (d + e.leading);
25860
- return e.dropShadow && (f += e.dropShadowDistance), new K(
25865
+ let p = Math.max(d, o.fontSize + e.strokeThickness * 2) + e.leading + (l.length - 1) * (d + e.leading);
25866
+ return e.dropShadow && (p += e.dropShadowDistance), new K(
25861
25867
  t,
25862
25868
  e,
25863
25869
  u,
25864
- f,
25870
+ p,
25865
25871
  l,
25866
25872
  h,
25867
25873
  d + e.leading,
@@ -25887,13 +25893,13 @@ const Js = {
25887
25893
  const s = i.getContext("2d", Js);
25888
25894
  let n = 0, o = "", a = "";
25889
25895
  const l = /* @__PURE__ */ Object.create(null), { letterSpacing: h, whiteSpace: c } = e, u = K.collapseSpaces(c), d = K.collapseNewlines(c);
25890
- let f = !u;
25891
- const p = e.wordWrapWidth + h, m = K.tokenize(t);
25896
+ let p = !u;
25897
+ const f = e.wordWrapWidth + h, m = K.tokenize(t);
25892
25898
  for (let _ = 0; _ < m.length; _++) {
25893
25899
  let y = m[_];
25894
25900
  if (K.isNewline(y)) {
25895
25901
  if (!d) {
25896
- a += K.addLine(o), f = !u, o = "", n = 0;
25902
+ a += K.addLine(o), p = !u, o = "", n = 0;
25897
25903
  continue;
25898
25904
  }
25899
25905
  y = " ";
@@ -25904,7 +25910,7 @@ const Js = {
25904
25910
  continue;
25905
25911
  }
25906
25912
  const x = K.getFromCache(y, h, l, s);
25907
- if (x > p)
25913
+ if (x > f)
25908
25914
  if (o !== "" && (a += K.addLine(o), o = "", n = 0), K.canBreakWords(y, e.breakWords)) {
25909
25915
  const g = K.wordWrapSplit(y);
25910
25916
  for (let v = 0; v < g.length; v++) {
@@ -25919,15 +25925,15 @@ const Js = {
25919
25925
  }
25920
25926
  v += A - 1;
25921
25927
  const C = K.getFromCache(w, h, l, s);
25922
- C + n > p && (a += K.addLine(o), f = !1, o = "", n = 0), o += w, n += C;
25928
+ C + n > f && (a += K.addLine(o), p = !1, o = "", n = 0), o += w, n += C;
25923
25929
  }
25924
25930
  } else {
25925
25931
  o.length > 0 && (a += K.addLine(o), o = "", n = 0);
25926
25932
  const g = _ === m.length - 1;
25927
- a += K.addLine(y, !g), f = !1, o = "", n = 0;
25933
+ a += K.addLine(y, !g), p = !1, o = "", n = 0;
25928
25934
  }
25929
25935
  else
25930
- x + n > p && (f = !1, a += K.addLine(o), o = "", n = 0), (o.length > 0 || !K.isBreakingSpace(y) || f) && (o += y, n += x);
25936
+ x + n > f && (p = !1, a += K.addLine(o), o = "", n = 0), (o.length > 0 || !K.isBreakingSpace(y) || p) && (o += y, n += x);
25931
25937
  }
25932
25938
  return a += K.addLine(o, !1), a;
25933
25939
  }
@@ -26090,26 +26096,26 @@ const Js = {
26090
26096
  return K._fonts[t] = e, e;
26091
26097
  i.width = o, i.height = l, s.fillStyle = "#f00", s.fillRect(0, 0, o, l), s.font = t, s.textBaseline = "alphabetic", s.fillStyle = "#000", s.fillText(n, 0, a);
26092
26098
  const h = s.getImageData(0, 0, o, l).data, c = h.length, u = o * 4;
26093
- let d = 0, f = 0, p = !1;
26099
+ let d = 0, p = 0, f = !1;
26094
26100
  for (d = 0; d < a; ++d) {
26095
26101
  for (let m = 0; m < u; m += 4)
26096
- if (h[f + m] !== 255) {
26097
- p = !0;
26102
+ if (h[p + m] !== 255) {
26103
+ f = !0;
26098
26104
  break;
26099
26105
  }
26100
- if (!p)
26101
- f += u;
26106
+ if (!f)
26107
+ p += u;
26102
26108
  else
26103
26109
  break;
26104
26110
  }
26105
- for (e.ascent = a - d, f = c - u, p = !1, d = l; d > a; --d) {
26111
+ for (e.ascent = a - d, p = c - u, f = !1, d = l; d > a; --d) {
26106
26112
  for (let m = 0; m < u; m += 4)
26107
- if (h[f + m] !== 255) {
26108
- p = !0;
26113
+ if (h[p + m] !== 255) {
26114
+ f = !0;
26109
26115
  break;
26110
26116
  }
26111
- if (!p)
26112
- f -= u;
26117
+ if (!f)
26118
+ p -= u;
26113
26119
  else
26114
26120
  break;
26115
26121
  }
@@ -26711,9 +26717,9 @@ const Qb = {
26711
26717
  this._font = this._style.toFontString();
26712
26718
  const i = this.context, s = mr.measureText(this._text || " ", this._style, this._style.wordWrap, this.canvas), n = s.width, o = s.height, a = s.lines, l = s.lineHeight, h = s.lineWidths, c = s.maxLineWidth, u = s.fontProperties;
26713
26719
  this.canvas.width = Math.ceil(Math.ceil(Math.max(1, n) + e.padding * 2) * this._resolution), this.canvas.height = Math.ceil(Math.ceil(Math.max(1, o) + e.padding * 2) * this._resolution), i.scale(this._resolution, this._resolution), i.clearRect(0, 0, this.canvas.width, this.canvas.height), i.font = this._font, i.lineWidth = e.strokeThickness, i.textBaseline = e.textBaseline, i.lineJoin = e.lineJoin, i.miterLimit = e.miterLimit;
26714
- let d, f;
26715
- const p = e.dropShadow ? 2 : 1;
26716
- for (let m = 0; m < p; ++m) {
26720
+ let d, p;
26721
+ const f = e.dropShadow ? 2 : 1;
26722
+ for (let m = 0; m < f; ++m) {
26717
26723
  const _ = e.dropShadow && m === 0, y = _ ? Math.ceil(Math.max(1, o) + e.padding * 2) : 0, x = y * this._resolution;
26718
26724
  if (_) {
26719
26725
  i.fillStyle = "black", i.strokeStyle = "black";
@@ -26724,15 +26730,15 @@ const Qb = {
26724
26730
  let g = (l - u.fontSize) / 2;
26725
26731
  l - u.fontSize < 0 && (g = 0);
26726
26732
  for (let v = 0; v < a.length; v++)
26727
- d = e.strokeThickness / 2, f = e.strokeThickness / 2 + v * l + u.ascent + g, e.align === "right" ? d += c - h[v] : e.align === "center" && (d += (c - h[v]) / 2), e.stroke && e.strokeThickness && this.drawLetterSpacing(
26733
+ d = e.strokeThickness / 2, p = e.strokeThickness / 2 + v * l + u.ascent + g, e.align === "right" ? d += c - h[v] : e.align === "center" && (d += (c - h[v]) / 2), e.stroke && e.strokeThickness && this.drawLetterSpacing(
26728
26734
  a[v],
26729
26735
  d + e.padding,
26730
- f + e.padding - y,
26736
+ p + e.padding - y,
26731
26737
  !0
26732
26738
  ), e.fill && this.drawLetterSpacing(
26733
26739
  a[v],
26734
26740
  d + e.padding,
26735
- f + e.padding - y
26741
+ p + e.padding - y
26736
26742
  );
26737
26743
  }
26738
26744
  this.updateTexture();
@@ -26758,10 +26764,10 @@ const Qb = {
26758
26764
  for (let u = 0; u < l.length; ++u) {
26759
26765
  const d = l[u];
26760
26766
  s ? this.context.strokeText(d, a, i) : this.context.fillText(d, a, i);
26761
- let f = "";
26762
- for (let p = u + 1; p < l.length; ++p)
26763
- f += l[p];
26764
- c = this.context.measureText(f).width, a += h - c + n, h = c;
26767
+ let p = "";
26768
+ for (let f = u + 1; f < l.length; ++f)
26769
+ p += l[f];
26770
+ c = this.context.measureText(p).width, a += h - c + n, h = c;
26765
26771
  }
26766
26772
  }
26767
26773
  /** Updates texture size based on canvas size. */
@@ -26818,19 +26824,19 @@ const Qb = {
26818
26824
  const o = t.dropShadow ? t.dropShadowDistance : 0, a = t.padding || 0, l = this.canvas.width / this._resolution - o - a * 2, h = this.canvas.height / this._resolution - o - a * 2, c = s.slice(), u = t.fillGradientStops.slice();
26819
26825
  if (!u.length) {
26820
26826
  const d = c.length + 1;
26821
- for (let f = 1; f < d; ++f)
26822
- u.push(f / d);
26827
+ for (let p = 1; p < d; ++p)
26828
+ u.push(p / d);
26823
26829
  }
26824
26830
  if (c.unshift(s[0]), u.unshift(0), c.push(s[s.length - 1]), u.push(1), t.fillGradientType === to.LINEAR_VERTICAL) {
26825
26831
  n = this.context.createLinearGradient(l / 2, a, l / 2, h + a);
26826
26832
  const d = i.fontProperties.fontSize + t.strokeThickness;
26827
- for (let f = 0; f < e.length; f++) {
26828
- const p = i.lineHeight * (f - 1) + d, m = i.lineHeight * f;
26833
+ for (let p = 0; p < e.length; p++) {
26834
+ const f = i.lineHeight * (p - 1) + d, m = i.lineHeight * p;
26829
26835
  let _ = m;
26830
- f > 0 && p > m && (_ = (m + p) / 2);
26831
- const y = m + d, x = i.lineHeight * (f + 1);
26836
+ p > 0 && f > m && (_ = (m + f) / 2);
26837
+ const y = m + d, x = i.lineHeight * (p + 1);
26832
26838
  let g = y;
26833
- f + 1 < e.length && x < y && (g = (y + x) / 2);
26839
+ p + 1 < e.length && x < y && (g = (y + x) / 2);
26834
26840
  const v = (g - _) / h;
26835
26841
  for (let w = 0; w < c.length; w++) {
26836
26842
  let I = 0;
@@ -26845,10 +26851,10 @@ const Qb = {
26845
26851
  } else {
26846
26852
  n = this.context.createLinearGradient(a, h / 2, l + a, h / 2);
26847
26853
  const d = c.length + 1;
26848
- let f = 1;
26849
- for (let p = 0; p < c.length; p++) {
26854
+ let p = 1;
26855
+ for (let f = 0; f < c.length; f++) {
26850
26856
  let m;
26851
- typeof u[p] == "number" ? m = u[p] : m = f / d, n.addColorStop(m, c[p]), f++;
26857
+ typeof u[f] == "number" ? m = u[f] : m = p / d, n.addColorStop(m, c[f]), p++;
26852
26858
  }
26853
26859
  }
26854
26860
  return n;
@@ -27273,15 +27279,15 @@ class Uf extends Zn {
27273
27279
  const a = t._texture, l = a.baseTexture, h = l.alphaMode > 0, c = t.tileTransform.localTransform, u = t.uvMatrix;
27274
27280
  let d = l.isPowerOfTwo && a.frame.width === l.width && a.frame.height === l.height;
27275
27281
  d && (l._glTextures[e.CONTEXT_UID] ? d = l.wrapMode !== Er.CLAMP : l.wrapMode === Er.CLAMP && (l.wrapMode = Er.REPEAT));
27276
- const f = d ? this.simpleShader : this.shader, p = a.width, m = a.height, _ = t._width, y = t._height;
27282
+ const p = d ? this.simpleShader : this.shader, f = a.width, m = a.height, _ = t._width, y = t._height;
27277
27283
  Qs.set(
27278
- c.a * p / _,
27279
- c.b * p / y,
27284
+ c.a * f / _,
27285
+ c.b * f / y,
27280
27286
  c.c * m / _,
27281
27287
  c.d * m / y,
27282
27288
  c.tx / _,
27283
27289
  c.ty / y
27284
- ), Qs.invert(), d ? Qs.prepend(u.mapCoord) : (f.uniforms.uMapCoord = u.mapCoord.toArray(!0), f.uniforms.uClampFrame = u.uClampFrame, f.uniforms.uClampOffset = u.uClampOffset), f.uniforms.uTransform = Qs.toArray(!0), f.uniforms.uColor = bt.shared.setValue(t.tint).premultiply(t.worldAlpha, h).toArray(f.uniforms.uColor), f.uniforms.translationMatrix = t.transform.worldTransform.toArray(!0), f.uniforms.uSampler = a, e.shader.bind(f), e.geometry.bind(i), this.state.blendMode = Id(t.blendMode, h), e.state.set(this.state), e.geometry.draw(this.renderer.gl.TRIANGLES, 6, 0);
27290
+ ), Qs.invert(), d ? Qs.prepend(u.mapCoord) : (p.uniforms.uMapCoord = u.mapCoord.toArray(!0), p.uniforms.uClampFrame = u.uClampFrame, p.uniforms.uClampOffset = u.uClampOffset), p.uniforms.uTransform = Qs.toArray(!0), p.uniforms.uColor = bt.shared.setValue(t.tint).premultiply(t.worldAlpha, h).toArray(p.uniforms.uColor), p.uniforms.translationMatrix = t.transform.worldTransform.toArray(!0), p.uniforms.uSampler = a, e.shader.bind(p), e.geometry.bind(i), this.state.blendMode = Id(t.blendMode, h), e.state.set(this.state), e.geometry.draw(this.renderer.gl.TRIANGLES, 6, 0);
27285
27291
  }
27286
27292
  }
27287
27293
  Uf.extension = {
@@ -27501,10 +27507,10 @@ const mw = {
27501
27507
  const h = (c = r == null ? void 0 : r.meta) == null ? void 0 : c.related_multi_packs;
27502
27508
  if (Array.isArray(h)) {
27503
27509
  const d = [];
27504
- for (const p of h) {
27505
- if (typeof p != "string")
27510
+ for (const f of h) {
27511
+ if (typeof f != "string")
27506
27512
  continue;
27507
- let m = o + p;
27513
+ let m = o + f;
27508
27514
  (u = t.data) != null && u.ignoreMultiPack || (m = tl(m, t.src), d.push(e.load({
27509
27515
  src: m,
27510
27516
  data: {
@@ -27512,9 +27518,9 @@ const mw = {
27512
27518
  }
27513
27519
  })));
27514
27520
  }
27515
- const f = await Promise.all(d);
27516
- l.linkedSheets = f, f.forEach((p) => {
27517
- p.linkedSheets = [l].concat(l.linkedSheets.filter((m) => m !== p));
27521
+ const p = await Promise.all(d);
27522
+ l.linkedSheets = p, p.forEach((f) => {
27523
+ f.linkedSheets = [l].concat(l.linkedSheets.filter((m) => m !== f));
27518
27524
  });
27519
27525
  }
27520
27526
  return l;
@@ -27558,8 +27564,8 @@ class fn {
27558
27564
  for (const n in e) {
27559
27565
  const o = e[n].match(/^[a-z]+/gm)[0], a = e[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm), l = {};
27560
27566
  for (const h in a) {
27561
- const c = a[h].split("="), u = c[0], d = c[1].replace(/"/gm, ""), f = parseFloat(d), p = isNaN(f) ? d : f;
27562
- l[u] = p;
27567
+ const c = a[h].split("="), u = c[0], d = c[1].replace(/"/gm, ""), p = parseFloat(d), f = isNaN(p) ? d : p;
27568
+ l[u] = f;
27563
27569
  }
27564
27570
  i[o].push(l);
27565
27571
  }
@@ -27688,33 +27694,33 @@ function yw(r, t, e, i, s, n) {
27688
27694
  } else
27689
27695
  return o;
27690
27696
  let a;
27691
- const l = e.dropShadow ? e.dropShadowDistance : 0, h = e.padding || 0, c = r.width / i - l - h * 2, u = r.height / i - l - h * 2, d = o.slice(), f = e.fillGradientStops.slice();
27692
- if (!f.length) {
27693
- const p = d.length + 1;
27694
- for (let m = 1; m < p; ++m)
27695
- f.push(m / p);
27697
+ const l = e.dropShadow ? e.dropShadowDistance : 0, h = e.padding || 0, c = r.width / i - l - h * 2, u = r.height / i - l - h * 2, d = o.slice(), p = e.fillGradientStops.slice();
27698
+ if (!p.length) {
27699
+ const f = d.length + 1;
27700
+ for (let m = 1; m < f; ++m)
27701
+ p.push(m / f);
27696
27702
  }
27697
- if (d.unshift(o[0]), f.unshift(0), d.push(o[o.length - 1]), f.push(1), e.fillGradientType === to.LINEAR_VERTICAL) {
27703
+ if (d.unshift(o[0]), p.unshift(0), d.push(o[o.length - 1]), p.push(1), e.fillGradientType === to.LINEAR_VERTICAL) {
27698
27704
  a = t.createLinearGradient(c / 2, h, c / 2, u + h);
27699
- let p = 0;
27705
+ let f = 0;
27700
27706
  const m = (n.fontProperties.fontSize + e.strokeThickness) / u;
27701
27707
  for (let _ = 0; _ < s.length; _++) {
27702
27708
  const y = n.lineHeight * _;
27703
27709
  for (let x = 0; x < d.length; x++) {
27704
27710
  let g = 0;
27705
- typeof f[x] == "number" ? g = f[x] : g = x / d.length;
27711
+ typeof p[x] == "number" ? g = p[x] : g = x / d.length;
27706
27712
  const v = y / u + g * m;
27707
- let w = Math.max(p, v);
27708
- w = Math.min(w, 1), a.addColorStop(w, d[x]), p = w;
27713
+ let w = Math.max(f, v);
27714
+ w = Math.min(w, 1), a.addColorStop(w, d[x]), f = w;
27709
27715
  }
27710
27716
  }
27711
27717
  } else {
27712
27718
  a = t.createLinearGradient(h, u / 2, c + h, u / 2);
27713
- const p = d.length + 1;
27719
+ const f = d.length + 1;
27714
27720
  let m = 1;
27715
27721
  for (let _ = 0; _ < d.length; _++) {
27716
27722
  let y;
27717
- typeof f[_] == "number" ? y = f[_] : y = m / p, a.addColorStop(y, d[_]), m++;
27723
+ typeof p[_] == "number" ? y = p[_] : y = m / f, a.addColorStop(y, d[_]), m++;
27718
27724
  }
27719
27725
  }
27720
27726
  return a;
@@ -27724,8 +27730,8 @@ function _w(r, t, e, i, s, n, o) {
27724
27730
  t.translate(i, s), t.scale(n, n);
27725
27731
  const h = o.strokeThickness / 2, c = -(o.strokeThickness / 2);
27726
27732
  if (t.font = o.toFontString(), t.lineWidth = o.strokeThickness, t.textBaseline = o.textBaseline, t.lineJoin = o.lineJoin, t.miterLimit = o.miterLimit, t.fillStyle = yw(r, t, o, n, [a], e), t.strokeStyle = o.stroke, o.dropShadow) {
27727
- const u = o.dropShadowColor, d = o.dropShadowBlur * n, f = o.dropShadowDistance * n;
27728
- t.shadowColor = bt.shared.setValue(u).setAlpha(o.dropShadowAlpha).toRgbaString(), t.shadowBlur = d, t.shadowOffsetX = Math.cos(o.dropShadowAngle) * f, t.shadowOffsetY = Math.sin(o.dropShadowAngle) * f;
27733
+ const u = o.dropShadowColor, d = o.dropShadowBlur * n, p = o.dropShadowDistance * n;
27734
+ t.shadowColor = bt.shared.setValue(u).setAlpha(o.dropShadowAlpha).toRgbaString(), t.shadowBlur = d, t.shadowOffsetX = Math.cos(o.dropShadowAngle) * p, t.shadowOffsetY = Math.sin(o.dropShadowAngle) * p;
27729
27735
  } else
27730
27736
  t.shadowColor = "black", t.shadowBlur = 0, t.shadowOffsetX = 0, t.shadowOffsetY = 0;
27731
27737
  o.stroke && o.strokeThickness && t.strokeText(a, h, c + e.lineHeight - l.descent), o.fill && t.fillText(a, h, c + e.lineHeight - l.descent), t.setTransform(1, 0, 0, 1, 0, 0), t.fillStyle = "rgba(0, 0, 0, 0)";
@@ -27768,16 +27774,16 @@ const dr = class Fe {
27768
27774
  const [s] = t.info, [n] = t.common, [o] = t.page, [a] = t.distanceField, l = ar(o.file), h = {};
27769
27775
  this._ownsTextures = i, this.font = s.face, this.size = s.size, this.lineHeight = n.lineHeight / l, this.chars = {}, this.pageTextures = h;
27770
27776
  for (let u = 0; u < t.page.length; u++) {
27771
- const { id: d, file: f } = t.page[u];
27772
- h[d] = e instanceof Array ? e[u] : e[f], a != null && a.fieldType && a.fieldType !== "none" && (h[d].baseTexture.alphaMode = ee.NO_PREMULTIPLIED_ALPHA, h[d].baseTexture.mipmap = Ve.OFF);
27777
+ const { id: d, file: p } = t.page[u];
27778
+ h[d] = e instanceof Array ? e[u] : e[p], a != null && a.fieldType && a.fieldType !== "none" && (h[d].baseTexture.alphaMode = ee.NO_PREMULTIPLIED_ALPHA, h[d].baseTexture.mipmap = Ve.OFF);
27773
27779
  }
27774
27780
  for (let u = 0; u < t.char.length; u++) {
27775
- const { id: d, page: f } = t.char[u];
27776
- let { x: p, y: m, width: _, height: y, xoffset: x, yoffset: g, xadvance: v } = t.char[u];
27777
- p /= l, m /= l, _ /= l, y /= l, x /= l, g /= l, v /= l;
27781
+ const { id: d, page: p } = t.char[u];
27782
+ let { x: f, y: m, width: _, height: y, xoffset: x, yoffset: g, xadvance: v } = t.char[u];
27783
+ f /= l, m /= l, _ /= l, y /= l, x /= l, g /= l, v /= l;
27778
27784
  const w = new at(
27779
- p + h[f].frame.x / l,
27780
- m + h[f].frame.y / l,
27785
+ f + h[p].frame.x / l,
27786
+ m + h[p].frame.y / l,
27781
27787
  _,
27782
27788
  y
27783
27789
  );
@@ -27787,15 +27793,15 @@ const dr = class Fe {
27787
27793
  xAdvance: v,
27788
27794
  kerning: {},
27789
27795
  texture: new Y(
27790
- h[f].baseTexture,
27796
+ h[p].baseTexture,
27791
27797
  w
27792
27798
  ),
27793
- page: f
27799
+ page: p
27794
27800
  };
27795
27801
  }
27796
27802
  for (let u = 0; u < t.kerning.length; u++) {
27797
- let { first: d, second: f, amount: p } = t.kerning[u];
27798
- d /= l, f /= l, p /= l, this.chars[f] && (this.chars[f].kerning[d] = p);
27803
+ let { first: d, second: p, amount: f } = t.kerning[u];
27804
+ d /= l, p /= l, f /= l, this.chars[p] && (this.chars[p].kerning[d] = f);
27799
27805
  }
27800
27806
  this.distanceFieldRange = a == null ? void 0 : a.distanceRange, this.distanceFieldType = ((c = a == null ? void 0 : a.fieldType) == null ? void 0 : c.toLowerCase()) ?? "none";
27801
27807
  }
@@ -27889,17 +27895,17 @@ const dr = class Fe {
27889
27895
  textureWidth: a,
27890
27896
  textureHeight: l,
27891
27897
  ...h
27892
- } = Object.assign({}, Fe.defaultOptions, i), c = vw(s), u = e instanceof Ar ? e : new Ar(e), d = a, f = new kn();
27893
- f.info[0] = {
27898
+ } = Object.assign({}, Fe.defaultOptions, i), c = vw(s), u = e instanceof Ar ? e : new Ar(e), d = a, p = new kn();
27899
+ p.info[0] = {
27894
27900
  face: u.fontFamily,
27895
27901
  size: u.fontSize
27896
- }, f.common[0] = {
27902
+ }, p.common[0] = {
27897
27903
  lineHeight: u.fontSize
27898
27904
  };
27899
- let p = 0, m = 0, _, y, x, g = 0;
27905
+ let f = 0, m = 0, _, y, x, g = 0;
27900
27906
  const v = [];
27901
27907
  for (let I = 0; I < c.length; I++) {
27902
- _ || (_ = j.ADAPTER.createCanvas(), _.width = a, _.height = l, y = _.getContext("2d"), x = new st(_, { resolution: o, ...h }), v.push(new Y(x)), f.page.push({
27908
+ _ || (_ = j.ADAPTER.createCanvas(), _.width = a, _.height = l, y = _.getContext("2d"), x = new st(_, { resolution: o, ...h }), v.push(new Y(x)), p.page.push({
27903
27909
  id: v.length - 1,
27904
27910
  file: ""
27905
27911
  }));
@@ -27907,42 +27913,42 @@ const dr = class Fe {
27907
27913
  if (m >= l - S * o) {
27908
27914
  if (m === 0)
27909
27915
  throw new Error(`[BitmapFont] textureHeight ${l}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${A}')`);
27910
- --I, _ = null, y = null, x = null, m = 0, p = 0, g = 0;
27916
+ --I, _ = null, y = null, x = null, m = 0, f = 0, g = 0;
27911
27917
  continue;
27912
27918
  }
27913
- if (g = Math.max(S + C.fontProperties.descent, g), P * o + p >= d) {
27914
- if (p === 0)
27919
+ if (g = Math.max(S + C.fontProperties.descent, g), P * o + f >= d) {
27920
+ if (f === 0)
27915
27921
  throw new Error(`[BitmapFont] textureWidth ${a}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${A}')`);
27916
- --I, m += g * o, m = Math.ceil(m), p = 0, g = 0;
27922
+ --I, m += g * o, m = Math.ceil(m), f = 0, g = 0;
27917
27923
  continue;
27918
27924
  }
27919
- _w(_, y, C, p, m, o, u);
27925
+ _w(_, y, C, f, m, o, u);
27920
27926
  const E = pn(C.text);
27921
- f.char.push({
27927
+ p.char.push({
27922
27928
  id: E,
27923
27929
  page: v.length - 1,
27924
- x: p / o,
27930
+ x: f / o,
27925
27931
  y: m / o,
27926
27932
  width: P,
27927
27933
  height: S,
27928
27934
  xoffset: 0,
27929
27935
  yoffset: 0,
27930
27936
  xadvance: N - (u.dropShadow ? u.dropShadowDistance : 0) - (u.stroke ? u.strokeThickness : 0)
27931
- }), p += (P + 2 * n) * o, p = Math.ceil(p);
27937
+ }), f += (P + 2 * n) * o, f = Math.ceil(f);
27932
27938
  }
27933
27939
  if (!(i != null && i.skipKerning))
27934
27940
  for (let I = 0, A = c.length; I < A; I++) {
27935
27941
  const C = c[I];
27936
27942
  for (let N = 0; N < A; N++) {
27937
27943
  const S = c[N], P = y.measureText(C).width, E = y.measureText(S).width, b = y.measureText(C + S).width - (P + E);
27938
- b && f.kerning.push({
27944
+ b && p.kerning.push({
27939
27945
  first: pn(C),
27940
27946
  second: pn(S),
27941
27947
  amount: b
27942
27948
  });
27943
27949
  }
27944
27950
  }
27945
- const w = new Fe(f, v, !0);
27951
+ const w = new Fe(p, v, !0);
27946
27952
  return Fe.available[t] !== void 0 && Fe.uninstall(t), Fe.available[t] = w, w;
27947
27953
  }
27948
27954
  };
@@ -28064,12 +28070,12 @@ const Zc = [], Jc = [], Qc = [], ww = class Hf extends Ae {
28064
28070
  var P;
28065
28071
  const t = fr.available[this._fontName], e = this.fontSize, i = e / t.size, s = new gt(), n = [], o = [], a = [], l = this._text.replace(/(?:\r\n|\r)/g, `
28066
28072
  `) || " ", h = $f(l), c = this._maxWidth * t.size / e, u = t.distanceFieldType === "none" ? Zc : Jc;
28067
- let d = null, f = 0, p = 0, m = 0, _ = -1, y = 0, x = 0, g = 0, v = 0;
28073
+ let d = null, p = 0, f = 0, m = 0, _ = -1, y = 0, x = 0, g = 0, v = 0;
28068
28074
  for (let E = 0; E < h.length; E++) {
28069
28075
  const b = h[E], B = pn(b);
28070
- if (/(?:\s)/.test(b) && (_ = E, y = f, v++), b === "\r" || b === `
28076
+ if (/(?:\s)/.test(b) && (_ = E, y = p, v++), b === "\r" || b === `
28071
28077
  `) {
28072
- o.push(f), a.push(-1), p = Math.max(p, f), ++m, ++x, s.x = 0, s.y += t.lineHeight, d = null, v = 0;
28078
+ o.push(p), a.push(-1), f = Math.max(f, p), ++m, ++x, s.x = 0, s.y += t.lineHeight, d = null, v = 0;
28073
28079
  continue;
28074
28080
  }
28075
28081
  const O = t.chars[B];
@@ -28083,15 +28089,15 @@ const Zc = [], Jc = [], Qc = [], ww = class Hf extends Ae {
28083
28089
  prevSpaces: 0,
28084
28090
  position: new gt()
28085
28091
  };
28086
- G.texture = O.texture, G.line = m, G.charCode = B, G.position.x = Math.round(s.x + O.xOffset + this._letterSpacing / 2), G.position.y = Math.round(s.y + O.yOffset), G.prevSpaces = v, n.push(G), f = G.position.x + Math.max(O.xAdvance - O.xOffset, O.texture.orig.width), s.x += O.xAdvance + this._letterSpacing, g = Math.max(g, O.yOffset + O.texture.height), d = B, _ !== -1 && c > 0 && s.x > c && (++x, Ti(n, 1 + _ - x, 1 + E - _), E = _, _ = -1, o.push(y), a.push(n.length > 0 ? n[n.length - 1].prevSpaces : 0), p = Math.max(p, y), m++, s.x = 0, s.y += t.lineHeight, d = null, v = 0);
28092
+ G.texture = O.texture, G.line = m, G.charCode = B, G.position.x = Math.round(s.x + O.xOffset + this._letterSpacing / 2), G.position.y = Math.round(s.y + O.yOffset), G.prevSpaces = v, n.push(G), p = G.position.x + Math.max(O.xAdvance - O.xOffset, O.texture.orig.width), s.x += O.xAdvance + this._letterSpacing, g = Math.max(g, O.yOffset + O.texture.height), d = B, _ !== -1 && c > 0 && s.x > c && (++x, Ti(n, 1 + _ - x, 1 + E - _), E = _, _ = -1, o.push(y), a.push(n.length > 0 ? n[n.length - 1].prevSpaces : 0), f = Math.max(f, y), m++, s.x = 0, s.y += t.lineHeight, d = null, v = 0);
28087
28093
  }
28088
28094
  const w = h[h.length - 1];
28089
28095
  w !== "\r" && w !== `
28090
- ` && (/(?:\s)/.test(w) && (f = y), o.push(f), p = Math.max(p, f), a.push(-1));
28096
+ ` && (/(?:\s)/.test(w) && (p = y), o.push(p), f = Math.max(f, p), a.push(-1));
28091
28097
  const I = [];
28092
28098
  for (let E = 0; E <= m; E++) {
28093
28099
  let b = 0;
28094
- this._align === "right" ? b = p - o[E] : this._align === "center" ? b = (p - o[E]) / 2 : this._align === "justify" && (b = a[E] < 0 ? 0 : (p - o[E]) / a[E]), I.push(b);
28100
+ this._align === "right" ? b = f - o[E] : this._align === "center" ? b = (f - o[E]) / 2 : this._align === "justify" && (b = a[E] < 0 ? 0 : (f - o[E]) / a[E]), I.push(b);
28095
28101
  }
28096
28102
  const A = n.length, C = {}, N = [], S = this._activePagesMeshData;
28097
28103
  u.push(...S);
@@ -28148,7 +28154,7 @@ const Zc = [], Jc = [], Qc = [], ww = class Hf extends Ae {
28148
28154
  const O = B * i, G = b.position.y * i, $ = b.texture, F = C[$.baseTexture.uid], Q = $.frame, R = $._uvs, U = F.index++;
28149
28155
  F.indices[U * 6 + 0] = 0 + U * 4, F.indices[U * 6 + 1] = 1 + U * 4, F.indices[U * 6 + 2] = 2 + U * 4, F.indices[U * 6 + 3] = 0 + U * 4, F.indices[U * 6 + 4] = 2 + U * 4, F.indices[U * 6 + 5] = 3 + U * 4, F.vertices[U * 8 + 0] = O, F.vertices[U * 8 + 1] = G, F.vertices[U * 8 + 2] = O + Q.width * i, F.vertices[U * 8 + 3] = G, F.vertices[U * 8 + 4] = O + Q.width * i, F.vertices[U * 8 + 5] = G + Q.height * i, F.vertices[U * 8 + 6] = O, F.vertices[U * 8 + 7] = G + Q.height * i, F.uvs[U * 8 + 0] = R.x0, F.uvs[U * 8 + 1] = R.y0, F.uvs[U * 8 + 2] = R.x1, F.uvs[U * 8 + 3] = R.y1, F.uvs[U * 8 + 4] = R.x2, F.uvs[U * 8 + 5] = R.y2, F.uvs[U * 8 + 6] = R.x3, F.uvs[U * 8 + 7] = R.y3;
28150
28156
  }
28151
- this._textWidth = p * i, this._textHeight = (s.y + t.lineHeight) * i;
28157
+ this._textWidth = f * i, this._textHeight = (s.y + t.lineHeight) * i;
28152
28158
  for (const E in C) {
28153
28159
  const b = C[E];
28154
28160
  if (this.anchor.x !== 0 || this.anchor.y !== 0) {
@@ -28172,9 +28178,9 @@ const Zc = [], Jc = [], Qc = [], ww = class Hf extends Ae {
28172
28178
  this._autoResolution && this._resolution !== t.resolution && (this._resolution = t.resolution, this.dirty = !0);
28173
28179
  const { distanceFieldRange: e, distanceFieldType: i, size: s } = fr.available[this._fontName];
28174
28180
  if (i !== "none") {
28175
- const { a: n, b: o, c: a, d: l } = this.worldTransform, h = Math.sqrt(n * n + o * o), c = Math.sqrt(a * a + l * l), u = (Math.abs(h) + Math.abs(c)) / 2, d = this.fontSize / s, f = t._view.resolution;
28176
- for (const p of this._activePagesMeshData)
28177
- p.mesh.shader.uniforms.uFWidth = u * e * d * f;
28181
+ const { a: n, b: o, c: a, d: l } = this.worldTransform, h = Math.sqrt(n * n + o * o), c = Math.sqrt(a * a + l * l), u = (Math.abs(h) + Math.abs(c)) / 2, d = this.fontSize / s, p = t._view.resolution;
28182
+ for (const f of this._activePagesMeshData)
28183
+ f.mesh.shader.uniforms.uFWidth = u * e * d * p;
28178
28184
  }
28179
28185
  super._render(t);
28180
28186
  }
@@ -28878,9 +28884,9 @@ const hl = (r) => {
28878
28884
  return r.viewport.getZoom(!0) * t / r.world.getContentFactor();
28879
28885
  }, tu = (r, t, e, i) => () => {
28880
28886
  const s = r.viewport.viewportToImageRectangle(r.viewport.getBounds(!0)), n = Xf(r);
28881
- (n !== ds || !yr) && (yr = !0, e.forEach(({ stroke: d, strokeWidth: f }) => {
28882
- const { lineStyle: p } = d.geometry.graphicsData[0];
28883
- f > 1 ? (yr = n === ds, p.width = f / n, p.native = !1, d.geometry.invalidate()) : f === 1 && !p.native && (p.width = 1, p.native = !0, d.geometry.invalidate());
28887
+ (n !== ds || !yr) && (yr = !0, e.forEach(({ stroke: d, strokeWidth: p }) => {
28888
+ const { lineStyle: f } = d.geometry.graphicsData[0];
28889
+ p > 1 ? (yr = n === ds, f.width = p / n, f.native = !1, d.geometry.invalidate()) : p === 1 && !f.native && (f.width = 1, f.native = !0, d.geometry.invalidate());
28884
28890
  })), ds = n;
28885
28891
  const o = r.viewport.getFlip();
28886
28892
  let a = Math.PI * r.viewport.getRotation(!0) / 180;
@@ -28919,14 +28925,14 @@ const hl = (r) => {
28919
28925
  w && (s.delete(g), w.fill.destroy(), w.stroke.destroy(), l(w.annotation, v));
28920
28926
  }, d = (g, v) => {
28921
28927
  i.resize(g, v), i.render(e);
28922
- }, f = (g) => {
28928
+ }, p = (g) => {
28923
28929
  yr = !1;
28924
28930
  const { children: v } = e;
28925
28931
  s.forEach(({ fill: w, stroke: I, annotation: A }) => {
28926
28932
  const C = g ? n.has(A.id) || g(A) : !0;
28927
28933
  C && !v.includes(w) ? (e.addChild(w), e.addChild(I)) : !C && v.includes(w) && (e.removeChild(w), e.removeChild(I));
28928
28934
  }), i.render(e);
28929
- }, p = (g) => {
28935
+ }, f = (g) => {
28930
28936
  o !== g && (o && u(o, { selected: n.has(o) }), g && u(g, { selected: n.has(g), hovered: !0 }), o = g, i.render(e));
28931
28937
  }, m = (g) => {
28932
28938
  const v = g.selected.map((A) => A.id), w = v.filter((A) => !n.has(A)), I = [...n].filter((A) => !v.includes(A));
@@ -28957,8 +28963,8 @@ const hl = (r) => {
28957
28963
  redraw: tu(r, e, s, i),
28958
28964
  removeAnnotation: h,
28959
28965
  resize: d,
28960
- setFilter: f,
28961
- setHovered: p,
28966
+ setFilter: p,
28967
+ setHovered: f,
28962
28968
  setSelected: m,
28963
28969
  setStyle: _,
28964
28970
  setVisible: y,
@@ -28967,9 +28973,9 @@ const hl = (r) => {
28967
28973
  };
28968
28974
  function Dw(r, t, e) {
28969
28975
  let i, s, { filter: n } = t, { state: o } = t, { style: a } = t, { viewer: l } = t, { visible: h = !0 } = t;
28970
- const { store: c, hover: u, selection: d, viewport: f } = o;
28976
+ const { store: c, hover: u, selection: d, viewport: p } = o;
28971
28977
  ca(r, u, (I) => e(11, i = I)), ca(r, d, (I) => e(8, s = I));
28972
- const p = Vn();
28978
+ const f = Vn();
28973
28979
  let m, _;
28974
28980
  const y = (I) => {
28975
28981
  const A = new _i.Point(I.x, I.y), { x: C, y: N } = l.viewport.pointFromPixel(A);
@@ -28985,7 +28991,7 @@ function Dw(r, t, e) {
28985
28991
  const A = I.originalEvent, { x: C, y: N } = I.position, S = C - _.x, P = N - _.y;
28986
28992
  if (Math.sqrt(S * S + P * P) < 5) {
28987
28993
  const { x: b, y: B } = y(I.position), O = c.getAt(b, B);
28988
- O ? p("click", { originalEvent: A, annotation: O }) : p("click", { originalEvent: A });
28994
+ O ? f("click", { originalEvent: A, annotation: O }) : f("click", { originalEvent: A });
28989
28995
  }
28990
28996
  _ = void 0;
28991
28997
  };
@@ -29009,16 +29015,16 @@ function Dw(r, t, e) {
29009
29015
  const G = l.viewport.getBounds();
29010
29016
  w = l.viewport.viewportToImageRectangle(G);
29011
29017
  const { x: $, y: F, width: Q, height: R } = w, U = c.getIntersecting($, F, Q, R);
29012
- f.set(U.map((z) => z.id));
29018
+ p.set(U.map((z) => z.id));
29013
29019
  };
29014
29020
  l.addHandler("canvas-press", x), l.addHandler("canvas-release", v), l.addHandler("update-viewport", m.redraw), l.addHandler("animation-finish", P);
29015
29021
  const E = (G) => G.filter(($) => ir($)), b = (G) => ir(G.oldValue) && ir(G.newValue), B = (G) => {
29016
29022
  const { created: $, updated: F, deleted: Q } = G.changes;
29017
29023
  if (E($ || []).forEach((R) => m.addAnnotation(R)), E(Q || []).forEach((R) => m.removeAnnotation(R)), (F || []).filter((R) => b(R)).forEach(({ oldValue: R, newValue: U }) => m.updateAnnotation(R, U)), w) {
29018
29024
  const { x: R, y: U, width: z, height: et } = w, J = c.getIntersecting(R, U, z, et);
29019
- f.set(J.map((H) => H.id));
29025
+ p.set(J.map((H) => H.id));
29020
29026
  } else
29021
- f.set(c.all().map((R) => R.id));
29027
+ p.set(c.all().map((R) => R.id));
29022
29028
  m.redraw();
29023
29029
  };
29024
29030
  return c.observe(B), () => {
@@ -29079,8 +29085,8 @@ const Fl = (r, t) => t, Gw = (r) => {
29079
29085
  }, $w = {
29080
29086
  area: (r) => Math.PI * r.geometry.rx * r.geometry.ry,
29081
29087
  intersects: (r, t, e) => {
29082
- const { cx: i, cy: s, rx: n, ry: o } = r.geometry, a = 0, l = Math.cos(a), h = Math.sin(a), c = t - i, u = e - s, d = l * c + h * u, f = h * c - l * u;
29083
- return d * d / (n * n) + f * f / (o * o) <= 1;
29088
+ const { cx: i, cy: s, rx: n, ry: o } = r.geometry, a = 0, l = Math.cos(a), h = Math.sin(a), c = t - i, u = e - s, d = l * c + h * u, p = h * c - l * u;
29089
+ return d * d / (n * n) + p * p / (o * o) <= 1;
29084
29090
  }
29085
29091
  };
29086
29092
  Fl(Fi.ELLIPSE, $w);
@@ -29169,17 +29175,17 @@ function Vw(r) {
29169
29175
  let t, e, i, s, n, o, a, l, h, c, u, d = Pi(
29170
29176
  /*geom*/
29171
29177
  r[4].points
29172
- ), f = [];
29178
+ ), p = [];
29173
29179
  for (let m = 0; m < d.length; m += 1)
29174
- f[m] = iu(ru(r, d, m));
29175
- const p = (m) => dt(f[m], 1, 1, () => {
29176
- f[m] = null;
29180
+ p[m] = iu(ru(r, d, m));
29181
+ const f = (m) => dt(p[m], 1, 1, () => {
29182
+ p[m] = null;
29177
29183
  });
29178
29184
  return {
29179
29185
  c() {
29180
29186
  t = Et("polygon"), s = ve(), n = Et("polygon"), a = ve();
29181
- for (let m = 0; m < f.length; m += 1)
29182
- f[m].c();
29187
+ for (let m = 0; m < p.length; m += 1)
29188
+ p[m].c();
29183
29189
  l = cr(), M(t, "class", "a9s-outer"), M(t, "style", e = /*computedStyle*/
29184
29190
  r[1] ? "display:none;" : void 0), M(t, "points", i = /*geom*/
29185
29191
  r[4].points.map(su).join(" ")), M(n, "class", "a9s-inner a9s-shape-handle"), M(
@@ -29192,8 +29198,8 @@ function Vw(r) {
29192
29198
  },
29193
29199
  m(m, _) {
29194
29200
  pt(m, t, _), pt(m, s, _), pt(m, n, _), pt(m, a, _);
29195
- for (let y = 0; y < f.length; y += 1)
29196
- f[y] && f[y].m(m, _);
29201
+ for (let y = 0; y < p.length; y += 1)
29202
+ p[y] && p[y].m(m, _);
29197
29203
  pt(m, l, _), h = !0, c || (u = [
29198
29204
  zt(t, "pointerdown", function() {
29199
29205
  jt(
@@ -29231,28 +29237,28 @@ function Vw(r) {
29231
29237
  let y;
29232
29238
  for (y = 0; y < d.length; y += 1) {
29233
29239
  const x = ru(r, d, y);
29234
- f[y] ? (f[y].p(x, _), nt(f[y], 1)) : (f[y] = iu(x), f[y].c(), nt(f[y], 1), f[y].m(l.parentNode, l));
29240
+ p[y] ? (p[y].p(x, _), nt(p[y], 1)) : (p[y] = iu(x), p[y].c(), nt(p[y], 1), p[y].m(l.parentNode, l));
29235
29241
  }
29236
- for (We(), y = d.length; y < f.length; y += 1)
29237
- p(y);
29242
+ for (We(), y = d.length; y < p.length; y += 1)
29243
+ f(y);
29238
29244
  je();
29239
29245
  }
29240
29246
  },
29241
29247
  i(m) {
29242
29248
  if (!h) {
29243
29249
  for (let _ = 0; _ < d.length; _ += 1)
29244
- nt(f[_]);
29250
+ nt(p[_]);
29245
29251
  h = !0;
29246
29252
  }
29247
29253
  },
29248
29254
  o(m) {
29249
- f = f.filter(Boolean);
29250
- for (let _ = 0; _ < f.length; _ += 1)
29251
- dt(f[_]);
29255
+ p = p.filter(Boolean);
29256
+ for (let _ = 0; _ < p.length; _ += 1)
29257
+ dt(p[_]);
29252
29258
  h = !1;
29253
29259
  },
29254
29260
  d(m) {
29255
- m && (ct(t), ct(s), ct(n), ct(a), ct(l)), ml(f, m), c = !1, hr(u);
29261
+ m && (ct(t), ct(s), ct(n), ct(a), ct(l)), ml(p, m), c = !1, hr(u);
29256
29262
  }
29257
29263
  };
29258
29264
  }
@@ -29323,10 +29329,10 @@ function zw(r) {
29323
29329
  const su = (r) => r.join(","), nu = (r) => r.join(",");
29324
29330
  function Ww(r, t, e) {
29325
29331
  let i, { shape: s } = t, { computedStyle: n } = t, { transform: o } = t, { viewportScale: a = 1 } = t;
29326
- const l = (d, f, p) => {
29332
+ const l = (d, p, f) => {
29327
29333
  let m;
29328
29334
  const _ = d.geometry;
29329
- f === "SHAPE" ? m = _.points.map(([x, g]) => [x + p[0], g + p[1]]) : m = _.points.map(([x, g], v) => f === `HANDLE-${v}` ? [x + p[0], g + p[1]] : [x, g]);
29335
+ p === "SHAPE" ? m = _.points.map(([x, g]) => [x + f[0], g + f[1]]) : m = _.points.map(([x, g], v) => p === `HANDLE-${v}` ? [x + f[0], g + f[1]] : [x, g]);
29330
29336
  const y = Gw(m);
29331
29337
  return { ...d, geometry: { points: m, bounds: y } };
29332
29338
  };
@@ -29577,20 +29583,20 @@ function Zw(r) {
29577
29583
  }
29578
29584
  function Jw(r, t, e) {
29579
29585
  let i, { x: s } = t, { y: n } = t, { scale: o } = t, { radius: a = 30 } = t, l = !1;
29580
- const h = (p) => {
29581
- p.pointerType === "touch" && e(4, l = !0);
29586
+ const h = (f) => {
29587
+ f.pointerType === "touch" && e(4, l = !0);
29582
29588
  }, c = () => e(4, l = !1);
29583
- function u(p) {
29584
- nr.call(this, r, p);
29589
+ function u(f) {
29590
+ nr.call(this, r, f);
29585
29591
  }
29586
- function d(p) {
29587
- nr.call(this, r, p);
29592
+ function d(f) {
29593
+ nr.call(this, r, f);
29588
29594
  }
29589
- function f(p) {
29590
- nr.call(this, r, p);
29595
+ function p(f) {
29596
+ nr.call(this, r, f);
29591
29597
  }
29592
- return r.$$set = (p) => {
29593
- e(8, t = ha(ha({}, t), mh(p))), "x" in p && e(0, s = p.x), "y" in p && e(1, n = p.y), "scale" in p && e(2, o = p.scale), "radius" in p && e(3, a = p.radius);
29598
+ return r.$$set = (f) => {
29599
+ e(8, t = ha(ha({}, t), mh(f))), "x" in f && e(0, s = f.x), "y" in f && e(1, n = f.y), "scale" in f && e(2, o = f.scale), "radius" in f && e(3, a = f.radius);
29594
29600
  }, r.$$.update = () => {
29595
29601
  r.$$.dirty & /*scale*/
29596
29602
  4 && e(5, i = 10 / o);
@@ -29606,7 +29612,7 @@ function Jw(r, t, e) {
29606
29612
  t,
29607
29613
  u,
29608
29614
  d,
29609
- f
29615
+ p
29610
29616
  ];
29611
29617
  }
29612
29618
  class ss extends ae {
@@ -29615,7 +29621,7 @@ class ss extends ae {
29615
29621
  }
29616
29622
  }
29617
29623
  function Qw(r) {
29618
- let t, e, i, s, n, o, a, l, h, c, u, d, f, p, m, _, y, x, g, v, w, I, A, C, N, S, P, E, b, B, O, G, $, F, Q, R, U, z, et, J, H, X, lt;
29624
+ let t, e, i, s, n, o, a, l, h, c, u, d, p, f, m, _, y, x, g, v, w, I, A, C, N, S, P, E, b, B, O, G, $, F, Q, R, U, z, et, J, H, X, lt;
29619
29625
  return F = new ss({
29620
29626
  props: {
29621
29627
  class: "a9s-corner-handle-topleft",
@@ -29706,7 +29712,7 @@ function Qw(r) {
29706
29712
  ) && r[9]("BOTTOM_LEFT").apply(this, arguments);
29707
29713
  }), {
29708
29714
  c() {
29709
- t = Et("rect"), a = ve(), l = Et("rect"), f = ve(), p = Et("rect"), x = ve(), g = Et("rect"), A = ve(), C = Et("rect"), E = ve(), b = Et("rect"), $ = ve(), Jt(F.$$.fragment), Q = ve(), Jt(R.$$.fragment), U = ve(), Jt(z.$$.fragment), et = ve(), Jt(J.$$.fragment), M(t, "class", "a9s-outer"), M(t, "style", e = /*computedStyle*/
29715
+ t = Et("rect"), a = ve(), l = Et("rect"), p = ve(), f = Et("rect"), x = ve(), g = Et("rect"), A = ve(), C = Et("rect"), E = ve(), b = Et("rect"), $ = ve(), Jt(F.$$.fragment), Q = ve(), Jt(R.$$.fragment), U = ve(), Jt(z.$$.fragment), et = ve(), Jt(J.$$.fragment), M(t, "class", "a9s-outer"), M(t, "style", e = /*computedStyle*/
29710
29716
  r[1] ? "display:none;" : void 0), M(t, "x", i = /*geom*/
29711
29717
  r[4].x), M(t, "y", s = /*geom*/
29712
29718
  r[4].y), M(t, "width", n = /*geom*/
@@ -29720,9 +29726,9 @@ function Qw(r) {
29720
29726
  r[4].x), M(l, "y", c = /*geom*/
29721
29727
  r[4].y), M(l, "width", u = /*geom*/
29722
29728
  r[4].w), M(l, "height", d = /*geom*/
29723
- r[4].h), M(p, "class", "a9s-edge-handle a9s-edge-handle-top"), M(p, "x", m = /*geom*/
29724
- r[4].x), M(p, "y", _ = /*geom*/
29725
- r[4].y), M(p, "height", 1), M(p, "width", y = /*geom*/
29729
+ r[4].h), M(f, "class", "a9s-edge-handle a9s-edge-handle-top"), M(f, "x", m = /*geom*/
29730
+ r[4].x), M(f, "y", _ = /*geom*/
29731
+ r[4].y), M(f, "height", 1), M(f, "width", y = /*geom*/
29726
29732
  r[4].w), M(g, "class", "a9s-edge-handle a9s-edge-handle-right"), M(g, "x", v = /*geom*/
29727
29733
  r[4].x + /*geom*/
29728
29734
  r[4].w), M(g, "y", w = /*geom*/
@@ -29737,7 +29743,7 @@ function Qw(r) {
29737
29743
  r[4].h), M(b, "width", 1);
29738
29744
  },
29739
29745
  m(L, D) {
29740
- pt(L, t, D), pt(L, a, D), pt(L, l, D), pt(L, f, D), pt(L, p, D), pt(L, x, D), pt(L, g, D), pt(L, A, D), pt(L, C, D), pt(L, E, D), pt(L, b, D), pt(L, $, D), Yt(F, L, D), pt(L, Q, D), Yt(R, L, D), pt(L, U, D), Yt(z, L, D), pt(L, et, D), Yt(J, L, D), H = !0, X || (lt = [
29746
+ pt(L, t, D), pt(L, a, D), pt(L, l, D), pt(L, p, D), pt(L, f, D), pt(L, x, D), pt(L, g, D), pt(L, A, D), pt(L, C, D), pt(L, E, D), pt(L, b, D), pt(L, $, D), Yt(F, L, D), pt(L, Q, D), Yt(R, L, D), pt(L, U, D), Yt(z, L, D), pt(L, et, D), Yt(J, L, D), H = !0, X || (lt = [
29741
29747
  zt(t, "pointerdown", function() {
29742
29748
  jt(
29743
29749
  /*grab*/
@@ -29750,7 +29756,7 @@ function Qw(r) {
29750
29756
  r[9]("SHAPE")
29751
29757
  ) && r[9]("SHAPE").apply(this, arguments);
29752
29758
  }),
29753
- zt(p, "pointerdown", function() {
29759
+ zt(f, "pointerdown", function() {
29754
29760
  jt(
29755
29761
  /*grab*/
29756
29762
  r[9]("TOP")
@@ -29803,11 +29809,11 @@ function Qw(r) {
29803
29809
  16 && d !== (d = /*geom*/
29804
29810
  r[4].h)) && M(l, "height", d), (!H || D & /*geom*/
29805
29811
  16 && m !== (m = /*geom*/
29806
- r[4].x)) && M(p, "x", m), (!H || D & /*geom*/
29812
+ r[4].x)) && M(f, "x", m), (!H || D & /*geom*/
29807
29813
  16 && _ !== (_ = /*geom*/
29808
- r[4].y)) && M(p, "y", _), (!H || D & /*geom*/
29814
+ r[4].y)) && M(f, "y", _), (!H || D & /*geom*/
29809
29815
  16 && y !== (y = /*geom*/
29810
- r[4].w)) && M(p, "width", y), (!H || D & /*geom*/
29816
+ r[4].w)) && M(f, "width", y), (!H || D & /*geom*/
29811
29817
  16 && v !== (v = /*geom*/
29812
29818
  r[4].x + /*geom*/
29813
29819
  r[4].w)) && M(g, "x", v), (!H || D & /*geom*/
@@ -29872,7 +29878,7 @@ function Qw(r) {
29872
29878
  dt(F.$$.fragment, L), dt(R.$$.fragment, L), dt(z.$$.fragment, L), dt(J.$$.fragment, L), H = !1;
29873
29879
  },
29874
29880
  d(L) {
29875
- L && (ct(t), ct(a), ct(l), ct(f), ct(p), ct(x), ct(g), ct(A), ct(C), ct(E), ct(b), ct($), ct(Q), ct(U), ct(et)), qt(F, L), qt(R, L), qt(z, L), qt(J, L), X = !1, hr(lt);
29881
+ L && (ct(t), ct(a), ct(l), ct(p), ct(f), ct(x), ct(g), ct(A), ct(C), ct(E), ct(b), ct($), ct(Q), ct(U), ct(et)), qt(F, L), qt(R, L), qt(z, L), qt(J, L), X = !1, hr(lt);
29876
29882
  }
29877
29883
  };
29878
29884
  }
@@ -29942,14 +29948,14 @@ function tE(r) {
29942
29948
  }
29943
29949
  function eE(r, t, e) {
29944
29950
  let i, { shape: s } = t, { computedStyle: n } = t, { transform: o } = t, { viewportScale: a = 1 } = t;
29945
- const l = (d, f, p) => {
29951
+ const l = (d, p, f) => {
29946
29952
  const m = d.geometry.bounds;
29947
29953
  let [_, y] = [m.minX, m.minY], [x, g] = [m.maxX, m.maxY];
29948
- const [v, w] = p;
29949
- if (f === "SHAPE")
29954
+ const [v, w] = f;
29955
+ if (p === "SHAPE")
29950
29956
  _ += v, x += v, y += w, g += w;
29951
29957
  else {
29952
- switch (f) {
29958
+ switch (p) {
29953
29959
  case "TOP":
29954
29960
  case "TOP_LEFT":
29955
29961
  case "TOP_RIGHT": {
@@ -29963,7 +29969,7 @@ function eE(r, t, e) {
29963
29969
  break;
29964
29970
  }
29965
29971
  }
29966
- switch (f) {
29972
+ switch (p) {
29967
29973
  case "LEFT":
29968
29974
  case "TOP_LEFT":
29969
29975
  case "BOTTOM_LEFT": {
@@ -30106,17 +30112,17 @@ function nE(r, t, e) {
30106
30112
  let { shape: o } = t, { editor: a } = t, { transform: l } = t, h, c, u;
30107
30113
  const d = (m) => (_) => {
30108
30114
  h = m, c = l.elementToImage(_.offsetX, _.offsetY), u = o, _.target.setPointerCapture(_.pointerId), n("grab", _);
30109
- }, f = (m) => {
30115
+ }, p = (m) => {
30110
30116
  if (h) {
30111
30117
  const [_, y] = l.elementToImage(m.offsetX, m.offsetY), x = [_ - c[0], y - c[1]];
30112
30118
  e(3, o = a(u, h, x)), n("change", o);
30113
30119
  }
30114
- }, p = (m) => {
30120
+ }, f = (m) => {
30115
30121
  m.target.releasePointerCapture(m.pointerId), h = void 0, u = o, n("release", m);
30116
30122
  };
30117
30123
  return r.$$set = (m) => {
30118
30124
  "shape" in m && e(3, o = m.shape), "editor" in m && e(4, a = m.editor), "transform" in m && e(5, l = m.transform), "$$scope" in m && e(6, s = m.$$scope);
30119
- }, [d, f, p, o, a, l, s, i];
30125
+ }, [d, p, f, o, a, l, s, i];
30120
30126
  }
30121
30127
  class Vf extends ae {
30122
30128
  constructor(t) {
@@ -30251,8 +30257,8 @@ function uE(r, t, e) {
30251
30257
  const l = () => {
30252
30258
  const h = n.viewport.getContainerSize().x, c = n.viewport.getZoom(!0), u = n.viewport.getFlip(), d = n.viewport.pixelFromPoint(new _i.Point(0, 0), !0);
30253
30259
  u && (d.x = h - d.x);
30254
- const f = c * h / n.world.getContentFactor(), p = u ? -f : f, m = n.viewport.getRotation(!0);
30255
- e(1, a = `translate(${d.x}, ${d.y}) scale(${p}, ${f}) rotate(${m})`), e(0, o = c * h / n.world.getContentFactor());
30260
+ const p = c * h / n.world.getContentFactor(), f = u ? -p : p, m = n.viewport.getRotation(!0);
30261
+ e(1, a = `translate(${d.x}, ${d.y}) scale(${f}, ${p}) rotate(${m})`), e(0, o = c * h / n.world.getContentFactor());
30256
30262
  };
30257
30263
  return Xn(() => (n.addHandler("update-viewport", l), () => {
30258
30264
  n.removeHandler("update-viewport", l);
@@ -30269,14 +30275,14 @@ function dE(r, t, e) {
30269
30275
  const i = Vn();
30270
30276
  let { drawingMode: s } = t, { target: n } = t, { tool: o } = t, { transform: a } = t, { viewer: l } = t, { viewportScale: h } = t, c;
30271
30277
  return Xn(() => {
30272
- const u = n.closest("svg"), d = [], f = (p, m, _) => {
30273
- if (u == null || u.addEventListener(p, m, _), d.push(() => u == null ? void 0 : u.removeEventListener(p, m, _)), p === "pointerup" || p === "dblclick") {
30278
+ const u = n.closest("svg"), d = [], p = (f, m, _) => {
30279
+ if (u == null || u.addEventListener(f, m, _), d.push(() => u == null ? void 0 : u.removeEventListener(f, m, _)), f === "pointerup" || f === "dblclick") {
30274
30280
  const y = (g) => {
30275
30281
  const { originalEvent: v } = g;
30276
30282
  m(v);
30277
- }, x = p === "pointerup" ? "canvas-click" : "canvas-double-click";
30283
+ }, x = f === "pointerup" ? "canvas-click" : "canvas-double-click";
30278
30284
  l.addHandler(x, y), d.push(() => l.removeHandler(x, y));
30279
- } else if (p === "pointermove") {
30285
+ } else if (f === "pointermove") {
30280
30286
  const y = (x) => {
30281
30287
  const { originalEvent: g } = x;
30282
30288
  m(g);
@@ -30287,13 +30293,13 @@ function dE(r, t, e) {
30287
30293
  return e(6, c = new o({
30288
30294
  target: n,
30289
30295
  props: {
30290
- addEventListener: f,
30296
+ addEventListener: p,
30291
30297
  drawingMode: s,
30292
30298
  transform: a,
30293
30299
  viewportScale: h
30294
30300
  }
30295
- })), c.$on("create", (p) => i("create", p.detail)), () => {
30296
- d.forEach((p) => p()), c.$destroy();
30301
+ })), c.$on("create", (f) => i("create", f.detail)), () => {
30302
+ d.forEach((f) => f()), c.$destroy();
30297
30303
  };
30298
30304
  }), r.$$set = (u) => {
30299
30305
  "drawingMode" in u && e(0, s = u.drawingMode), "target" in u && e(1, n = u.target), "tool" in u && e(2, o = u.tool), "transform" in u && e(3, a = u.transform), "viewer" in u && e(4, l = u.viewer), "viewportScale" in u && e(5, h = u.viewportScale);
@@ -30725,7 +30731,7 @@ function yE(r) {
30725
30731
  };
30726
30732
  }
30727
30733
  function _E(r, t, e) {
30728
- let i, s, n, o, { drawingEnabled: a } = t, { filter: l } = t, { preferredDrawingMode: h } = t, { state: c } = t, { style: u = void 0 } = t, { toolName: d = $n()[0] } = t, { user: f } = t, { viewer: p } = t;
30734
+ let i, s, n, o, { drawingEnabled: a } = t, { filter: l } = t, { preferredDrawingMode: h } = t, { state: c } = t, { style: u = void 0 } = t, { toolName: d = $n()[0] } = t, { user: p } = t, { viewer: f } = t;
30729
30735
  const m = () => d, _ = () => a, y = navigator.userAgent.match(/firefox|fxios/i);
30730
30736
  let x;
30731
30737
  const { store: g, selection: v, hover: w } = c;
@@ -30739,30 +30745,30 @@ function _E(r, t, e) {
30739
30745
  const { updated: U } = R.changes;
30740
30746
  e(6, A = (U || []).map((z) => z.newValue));
30741
30747
  }, g.observe(I, { annotations: Q }), y) {
30742
- const { width: R } = p.viewport.viewerElementToViewportRectangle(new _i.Rect(0, 0, 1, 1));
30743
- p.viewport.panBy(new _i.Point(Math.abs(R / 10), 0));
30748
+ const { width: R } = f.viewport.viewerElementToViewportRectangle(new _i.Rect(0, 0, 1, 1));
30749
+ f.viewport.panBy(new _i.Point(Math.abs(R / 10), 0));
30744
30750
  }
30745
30751
  } else
30746
30752
  e(6, A = void 0);
30747
30753
  }, S = (F, Q) => {
30748
- const { x: R, y: U } = p.viewport.viewerElementToImageCoordinates(new _i.Point(F, Q));
30754
+ const { x: R, y: U } = f.viewport.viewerElementToImageCoordinates(new _i.Point(F, Q));
30749
30755
  return [R, U];
30750
30756
  }, P = (F) => {
30751
- p.setMouseNavEnabled(!1), C = F.timeStamp;
30757
+ f.setMouseNavEnabled(!1), C = F.timeStamp;
30752
30758
  }, E = (F) => {
30753
- if (p.setMouseNavEnabled(!0), performance.now() - (C || 0) < 300) {
30759
+ if (f.setMouseNavEnabled(!0), performance.now() - (C || 0) < 300) {
30754
30760
  const { offsetX: R, offsetY: U } = F.detail, [z, et] = S(R, U), J = g.getAt(z, et);
30755
30761
  J && (!l || l(J)) && !A.find((X) => X.id === J.id) && (w.set(J.id), v.setSelected(J.id));
30756
30762
  }
30757
30763
  }, b = (F) => (Q) => {
30758
30764
  var et;
30759
- const { target: R } = F, U = 10 * 60 * 1e3, z = ((et = R.creator) == null ? void 0 : et.id) !== f.id || !R.created || (/* @__PURE__ */ new Date()).getTime() - R.created.getTime() > U;
30765
+ const { target: R } = F, U = 10 * 60 * 1e3, z = ((et = R.creator) == null ? void 0 : et.id) !== p.id || !R.created || (/* @__PURE__ */ new Date()).getTime() - R.created.getTime() > U;
30760
30766
  g.updateTarget({
30761
30767
  ...R,
30762
30768
  selector: Q.detail,
30763
30769
  created: z ? R.created : /* @__PURE__ */ new Date(),
30764
30770
  updated: z ? /* @__PURE__ */ new Date() : void 0,
30765
- updatedBy: z ? f : void 0
30771
+ updatedBy: z ? p : void 0
30766
30772
  });
30767
30773
  }, B = (F) => {
30768
30774
  const Q = kw(), R = {
@@ -30771,11 +30777,11 @@ function _E(r, t, e) {
30771
30777
  target: {
30772
30778
  annotation: Q,
30773
30779
  selector: F.detail,
30774
- creator: f,
30780
+ creator: p,
30775
30781
  created: /* @__PURE__ */ new Date()
30776
30782
  }
30777
30783
  };
30778
- g.addAnnotation(R), v.setSelected(R.id), p.setMouseNavEnabled(!0);
30784
+ g.addAnnotation(R), v.setSelected(R.id), f.setMouseNavEnabled(!0);
30779
30785
  }, O = (F) => Du(F), G = (F) => ir(F);
30780
30786
  function $(F) {
30781
30787
  xn[F ? "unshift" : "push"](() => {
@@ -30783,20 +30789,20 @@ function _E(r, t, e) {
30783
30789
  });
30784
30790
  }
30785
30791
  return r.$$set = (F) => {
30786
- "drawingEnabled" in F && e(0, a = F.drawingEnabled), "filter" in F && e(15, l = F.filter), "preferredDrawingMode" in F && e(16, h = F.preferredDrawingMode), "state" in F && e(17, c = F.state), "style" in F && e(1, u = F.style), "toolName" in F && e(2, d = F.toolName), "user" in F && e(18, f = F.user), "viewer" in F && e(3, p = F.viewer);
30792
+ "drawingEnabled" in F && e(0, a = F.drawingEnabled), "filter" in F && e(15, l = F.filter), "preferredDrawingMode" in F && e(16, h = F.preferredDrawingMode), "state" in F && e(17, c = F.state), "style" in F && e(1, u = F.style), "toolName" in F && e(2, d = F.toolName), "user" in F && e(18, p = F.user), "viewer" in F && e(3, f = F.viewer);
30787
30793
  }, r.$$.update = () => {
30788
30794
  r.$$.dirty[0] & /*toolName*/
30789
30795
  4 && e(7, { tool: i, opts: s } = Hn(d) || { tool: void 0, opts: void 0 }, i, (e(21, s), e(2, d))), r.$$.dirty[0] & /*opts, preferredDrawingMode*/
30790
30796
  2162688 && e(4, n = (s == null ? void 0 : s.drawingMode) || h), r.$$.dirty[0] & /*drawingEnabled, drawingMode, viewer*/
30791
- 25 && (a && n === "drag" ? p.setMouseNavEnabled(!1) : p.setMouseNavEnabled(!0)), r.$$.dirty[0] & /*drawingEnabled*/
30797
+ 25 && (a && n === "drag" ? f.setMouseNavEnabled(!1) : f.setMouseNavEnabled(!0)), r.$$.dirty[0] & /*drawingEnabled*/
30792
30798
  1 && a && v.clear(), r.$$.dirty[0] & /*$selection, drawingMode, drawingEnabled, viewer*/
30793
- 4194329 && o.selected.length === 0 && n === "drag" && a && p.setMouseNavEnabled(!1), r.$$.dirty[0] & /*$selection*/
30799
+ 4194329 && o.selected.length === 0 && n === "drag" && a && f.setMouseNavEnabled(!1), r.$$.dirty[0] & /*$selection*/
30794
30800
  4194304 && N(o.selected);
30795
30801
  }, [
30796
30802
  a,
30797
30803
  u,
30798
30804
  d,
30799
- p,
30805
+ f,
30800
30806
  n,
30801
30807
  x,
30802
30808
  A,
@@ -30811,7 +30817,7 @@ function _E(r, t, e) {
30811
30817
  l,
30812
30818
  h,
30813
30819
  c,
30814
- f,
30820
+ p,
30815
30821
  m,
30816
30822
  _,
30817
30823
  s,
@@ -30875,49 +30881,49 @@ function xE(r) {
30875
30881
  r[1] - 5 / /*scale*/
30876
30882
  r[3]), M(a, "class", "svelte-1rehw2p"), M(t, "class", "a9s-presence-label");
30877
30883
  },
30878
- m(f, p) {
30879
- pt(f, t, p), sr(t, e), sr(t, a), sr(a, h), r[6](t);
30884
+ m(p, f) {
30885
+ pt(p, t, f), sr(t, e), sr(t, a), sr(a, h), r[6](t);
30880
30886
  },
30881
- p(f, [p]) {
30882
- p & /*x*/
30887
+ p(p, [f]) {
30888
+ f & /*x*/
30883
30889
  1 && M(
30884
30890
  e,
30885
30891
  "x",
30886
30892
  /*x*/
30887
- f[0]
30888
- ), p & /*y, scale*/
30893
+ p[0]
30894
+ ), f & /*y, scale*/
30889
30895
  10 && i !== (i = /*y*/
30890
- f[1] - 18 / /*scale*/
30891
- f[3]) && M(e, "y", i), p & /*scale*/
30896
+ p[1] - 18 / /*scale*/
30897
+ p[3]) && M(e, "y", i), f & /*scale*/
30892
30898
  8 && s !== (s = 18 / /*scale*/
30893
- f[3]) && M(e, "height", s), p & /*user*/
30899
+ p[3]) && M(e, "height", s), f & /*user*/
30894
30900
  4 && n !== (n = /*user*/
30895
- f[2].appearance.color) && M(e, "fill", n), p & /*user*/
30901
+ p[2].appearance.color) && M(e, "fill", n), f & /*user*/
30896
30902
  4 && o !== (o = /*user*/
30897
- f[2].appearance.color) && M(e, "stroke", o), p & /*user*/
30903
+ p[2].appearance.color) && M(e, "stroke", o), f & /*user*/
30898
30904
  4 && l !== (l = /*user*/
30899
- f[2].appearance.label + "") && zg(h, l), p & /*scale*/
30905
+ p[2].appearance.label + "") && zg(h, l), f & /*scale*/
30900
30906
  8 && c !== (c = 12 / /*scale*/
30901
- f[3]) && M(a, "font-size", c), p & /*x, scale*/
30907
+ p[3]) && M(a, "font-size", c), f & /*x, scale*/
30902
30908
  9 && u !== (u = /*x*/
30903
- f[0] + Math.round(5 / /*scale*/
30904
- f[3])) && M(a, "x", u), p & /*y, scale*/
30909
+ p[0] + Math.round(5 / /*scale*/
30910
+ p[3])) && M(a, "x", u), f & /*y, scale*/
30905
30911
  10 && d !== (d = /*y*/
30906
- f[1] - 5 / /*scale*/
30907
- f[3]) && M(a, "y", d);
30912
+ p[1] - 5 / /*scale*/
30913
+ p[3]) && M(a, "y", d);
30908
30914
  },
30909
30915
  i: Xe,
30910
30916
  o: Xe,
30911
- d(f) {
30912
- f && ct(t), r[6](null);
30917
+ d(p) {
30918
+ p && ct(t), r[6](null);
30913
30919
  }
30914
30920
  };
30915
30921
  }
30916
30922
  function bE(r, t, e) {
30917
30923
  let { x: i } = t, { y: s } = t, { user: n } = t, { scale: o } = t, { hAlign: a = null } = t, l;
30918
30924
  const h = (u) => {
30919
- const d = l.querySelector("text"), f = l.querySelector("rect"), p = d.getBBox().width + 10 / u;
30920
- a === "CENTER" && l.setAttribute("style", `transform: translateX(-${p / 2}px)`), f.setAttribute("width", `${p}`);
30925
+ const d = l.querySelector("text"), p = l.querySelector("rect"), f = d.getBBox().width + 10 / u;
30926
+ a === "CENTER" && l.setAttribute("style", `transform: translateX(-${f / 2}px)`), p.setAttribute("width", `${f}`);
30921
30927
  };
30922
30928
  function c(u) {
30923
30929
  xn[u ? "unshift" : "push"](() => {
@@ -30999,8 +31005,8 @@ function EE(r, t, e) {
30999
31005
  let i, s, { annotation: n } = t, { user: o } = t, { scale: a } = t;
31000
31006
  const l = (h) => {
31001
31007
  let [c, ...u] = h.points;
31002
- return u.forEach(([d, f]) => {
31003
- f < c[1] && (c = [d, f]);
31008
+ return u.forEach(([d, p]) => {
31009
+ p < c[1] && (c = [d, p]);
31004
31010
  }), c;
31005
31011
  };
31006
31012
  return r.$$set = (h) => {
@@ -31398,8 +31404,8 @@ function DE(r, t, e) {
31398
31404
  selectedBy: h
31399
31405
  }))
31400
31406
  ].filter(({ annotation: u }) => (u || console.warn("Selection event on unknown annotation"), !!u))), a && i.unobserve(a), a = (u) => {
31401
- const { deleted: d, updated: f } = u.changes, p = new Set((d || []).map((_) => _.id)), m = o.filter(({ annotation: _ }) => !p.has(_.id)).map((_) => {
31402
- const y = (f || []).find((x) => x.oldValue.id === _.annotation.id);
31407
+ const { deleted: d, updated: p } = u.changes, f = new Set((d || []).map((_) => _.id)), m = o.filter(({ annotation: _ }) => !f.has(_.id)).map((_) => {
31408
+ const y = (p || []).find((x) => x.oldValue.id === _.annotation.id);
31403
31409
  return y ? {
31404
31410
  selectedBy: _.selectedBy,
31405
31411
  annotation: y.newValue
@@ -31441,7 +31447,7 @@ const _u = (r, t) => {
31441
31447
  const a = r.container.getBoundingClientRect(), { padding: l } = s;
31442
31448
  let [h, c, u, d] = l ? Array.isArray(l) ? l : [l, l, l, l] : [0, 0, 0, 0];
31443
31449
  h = h / a.height, c = c / a.width, u = u / a.height, d = d / a.width;
31444
- const { minX: f, minY: p, maxX: m, maxY: _ } = o.target.selector.geometry.bounds, y = m - f, x = _ - p, g = f - d * y, v = p - h * x, w = y + (c + d) * y, I = x + (h + u) * x, A = r.viewport.imageToViewportRectangle(g, v, w, I);
31450
+ const { minX: p, minY: f, maxX: m, maxY: _ } = o.target.selector.geometry.bounds, y = m - p, x = _ - f, g = p - d * y, v = f - h * x, w = y + (c + d) * y, I = x + (h + u) * x, A = r.viewport.imageToViewportRectangle(g, v, w, I);
31445
31451
  r.viewport[e](A, s.immediately);
31446
31452
  }, FE = (r, t) => jf(r, t, "fitBounds"), LE = (r, t) => jf(r, t, "fitBoundsWithConstraints"), WE = (r, t = {}) => {
31447
31453
  const e = $u(t, {
@@ -31456,7 +31462,7 @@ const _u = (r, t) => {
31456
31462
  e.autoSave
31457
31463
  );
31458
31464
  let h = vp(), c = e.drawingEnabled, u = e.drawingMode, d = e.modalSelect;
31459
- const f = Hu(a, r.element), p = new Ow({
31465
+ const p = Hu(a, r.element), f = new Ow({
31460
31466
  target: r.element,
31461
31467
  props: {
31462
31468
  state: i,
@@ -31483,7 +31489,7 @@ const _u = (r, t) => {
31483
31489
  viewer: r
31484
31490
  }
31485
31491
  });
31486
- p.$on("click", (R) => {
31492
+ f.$on("click", (R) => {
31487
31493
  const { originalEvent: U, annotation: z } = R.detail;
31488
31494
  d ? n.isEmpty() && z && n.userSelect(z.id, U) : z && !(u === "click" && c) ? n.userSelect(z.id, U) : n.isEmpty() || n.clear();
31489
31495
  }), r.element.addEventListener("pointerdown", (R) => {
@@ -31495,7 +31501,7 @@ const _u = (r, t) => {
31495
31501
  const y = fp(i, a, e.adapter), x = () => {
31496
31502
  _.$set({ drawingEnabled: !1 }), setTimeout(() => _.$set({ drawingEnabled: !0 }), 1);
31497
31503
  }, g = () => {
31498
- p.$destroy(), m.$destroy(), _.$destroy(), f.destroy(), a.destroy();
31504
+ f.$destroy(), m.$destroy(), _.$destroy(), p.destroy(), a.destroy();
31499
31505
  }, v = FE(r, o), w = LE(r, o), I = () => _.getDrawingTool(), A = () => h, C = () => _.isDrawingEnabled(), N = (R, U, z) => Lu(R, U, z), S = (R, U) => Ou(R, U), P = (R) => {
31500
31506
  if (!Hn(R))
31501
31507
  throw `No drawing tool named ${R}`;
@@ -31503,11 +31509,11 @@ const _u = (r, t) => {
31503
31509
  }, E = (R) => {
31504
31510
  c = R, _.$set({ drawingEnabled: c });
31505
31511
  }, b = (R) => {
31506
- p.$set({ filter: R }), _.$set({ filter: R });
31512
+ f.$set({ filter: R }), _.$set({ filter: R });
31507
31513
  }, B = (R) => {
31508
31514
  d = R;
31509
31515
  }, O = (R) => {
31510
- p.$set({ style: R }), _.$set({ style: R });
31516
+ f.$set({ style: R }), _.$set({ style: R });
31511
31517
  }, G = (R) => (
31512
31518
  // @ts-ignore
31513
31519
  m.$set({ provider: R })
@@ -31515,7 +31521,7 @@ const _u = (r, t) => {
31515
31521
  h = R, _.$set({ user: R });
31516
31522
  }, Q = (R) => (
31517
31523
  // @ts-ignore
31518
- p.$set({ visible: R })
31524
+ f.$set({ visible: R })
31519
31525
  );
31520
31526
  return {
31521
31527
  ...y,