@annotorious/openseadragon 3.0.15 → 3.0.17

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 = t || [];
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: _
@@ -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 = t || [];
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: _
@@ -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
  }, []);
@@ -4681,7 +4685,7 @@ const Ug = () => {
4681
4685
  drawingMode: "drag",
4682
4686
  userSelectAction: Cu.EDIT,
4683
4687
  theme: "light"
4684
- }), s = kg(i), { selection: n, store: o } = s, a = ym(o), l = vm(
4688
+ }), s = kg(i), { selection: n, store: o } = s, a = ym(o, i.initialHistory), l = vm(
4685
4689
  s,
4686
4690
  a,
4687
4691
  i.adapter,
@@ -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);
@@ -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) {
@@ -6711,7 +6715,7 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6711
6715
  strictNullHandling: !1
6712
6716
  }, A_ = function(t) {
6713
6717
  return typeof t == "string" || typeof t == "number" || typeof t == "boolean" || typeof t == "symbol" || typeof t == "bigint";
6714
- }, 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) {
6715
6719
  for (var g = t, v = x, w = 0, I = !1; (v = v.get(Mo)) !== void 0 && !I; ) {
6716
6720
  var A = v.get(t);
6717
6721
  if (w += 1, typeof A < "u") {
@@ -6721,17 +6725,17 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6721
6725
  }
6722
6726
  typeof v.get(Mo) > "u" && (w = 0);
6723
6727
  }
6724
- if (typeof c == "function" ? g = c(e, g) : g instanceof Date ? g = f(g) : i === "comma" && Le(g) && (g = on.maybeMap(g, function(R) {
6725
- 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;
6726
6730
  })), g === null) {
6727
6731
  if (o)
6728
- return h && !_ ? h(e, Ot.encoder, y, "key", p) : e;
6732
+ return h && !_ ? h(e, Ot.encoder, y, "key", f) : e;
6729
6733
  g = "";
6730
6734
  }
6731
6735
  if (A_(g) || on.isBuffer(g)) {
6732
6736
  if (h) {
6733
- var C = _ ? e : h(e, Ot.encoder, y, "key", p);
6734
- 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))];
6735
6739
  }
6736
6740
  return [m(e) + "=" + m(String(g))];
6737
6741
  }
@@ -6769,8 +6773,8 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6769
6773
  c,
6770
6774
  u,
6771
6775
  d,
6772
- f,
6773
6776
  p,
6777
+ f,
6774
6778
  m,
6775
6779
  _,
6776
6780
  y,
@@ -6855,8 +6859,8 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6855
6859
  h
6856
6860
  ));
6857
6861
  }
6858
- var f = o.join(i.delimiter), p = i.addQueryPrefix === !0 ? "?" : "";
6859
- return i.charsetSentinel && (i.charset === "iso-8859-1" ? p += "utf8=%26%2310003%3B&" : p += "utf8=%E2%9C%93&"), f.length > 0 ? p + f : "";
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 : "";
6860
6864
  }, Di = _d, Ea = Object.prototype.hasOwnProperty, R_ = Array.isArray, Pt = {
6861
6865
  allowDots: !1,
6862
6866
  allowEmptyArrays: !1,
@@ -6893,15 +6897,15 @@ var gd = Ni, Ui = _0, Z0 = B0, J0 = ws, Os = gd("%WeakMap%", !0), Fs = gd("%Map%
6893
6897
  o[l].indexOf("utf8=") === 0 && (o[l] === B_ ? h = "utf-8" : o[l] === M_ && (h = "iso-8859-1"), a = l, l = o.length);
6894
6898
  for (l = 0; l < o.length; ++l)
6895
6899
  if (l !== a) {
6896
- var c = o[l], u = c.indexOf("]="), d = u === -1 ? c.indexOf("=") : u + 1, f, p;
6897
- 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(
6898
6902
  wd(c.slice(d + 1), e),
6899
6903
  function(_) {
6900
6904
  return e.decoder(_, Pt.decoder, h, "value");
6901
6905
  }
6902
- )), p && e.interpretNumericEntities && h === "iso-8859-1" && (p = P_(String(p))), c.indexOf("[]=") > -1 && (p = R_(p) ? [p] : p);
6903
- var m = Ea.call(i, f);
6904
- 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);
6905
6909
  }
6906
6910
  return i;
6907
6911
  }, O_ = function(r, t, e, i) {
@@ -7065,26 +7069,26 @@ or.prototype.parse = function(r, t, e) {
7065
7069
  u && !(h && Aa[h]) && (a = a.substr(2), this.slashes = !0);
7066
7070
  }
7067
7071
  if (!Aa[h] && (u || h && !Ei[h])) {
7068
- for (var d = -1, f = 0; f < tc.length; f++) {
7069
- var p = a.indexOf(tc[f]);
7070
- 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);
7071
7075
  }
7072
7076
  var m, _;
7073
7077
  d === -1 ? _ = a.lastIndexOf("@") : _ = a.lastIndexOf("@", d), _ !== -1 && (m = a.slice(0, _), a = a.slice(_ + 1), this.auth = decodeURIComponent(m)), d = -1;
7074
- for (var f = 0; f < Qh.length; f++) {
7075
- var p = a.indexOf(Qh[f]);
7076
- 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);
7077
7081
  }
7078
7082
  d === -1 && (d = a.length), this.host = a.slice(0, d), a = a.slice(d), this.parseHost(), this.hostname = this.hostname || "";
7079
7083
  var y = this.hostname[0] === "[" && this.hostname[this.hostname.length - 1] === "]";
7080
7084
  if (!y)
7081
- for (var x = this.hostname.split(/\./), f = 0, g = x.length; f < g; f++) {
7082
- var v = x[f];
7085
+ for (var x = this.hostname.split(/\./), p = 0, g = x.length; p < g; p++) {
7086
+ var v = x[p];
7083
7087
  if (v && !v.match(ec)) {
7084
7088
  for (var w = "", I = 0, A = v.length; I < A; I++)
7085
7089
  v.charCodeAt(I) > 127 ? w += "x" : w += v[I];
7086
7090
  if (!w.match(ec)) {
7087
- 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_);
7088
7092
  S && (C.push(S[1]), N.unshift(S[2])), N.length && (a = "/" + N.join(".") + a), this.hostname = C.join(".");
7089
7093
  break;
7090
7094
  }
@@ -7095,8 +7099,8 @@ or.prototype.parse = function(r, t, e) {
7095
7099
  this.host = E + P, this.href += this.host, y && (this.hostname = this.hostname.substr(1, this.hostname.length - 2), a[0] !== "/" && (a = "/" + a));
7096
7100
  }
7097
7101
  if (!K_[c])
7098
- for (var f = 0, g = Ta.length; f < g; f++) {
7099
- var b = Ta[f];
7102
+ for (var p = 0, g = Ta.length; p < g; p++) {
7103
+ var b = Ta[p];
7100
7104
  if (a.indexOf(b) !== -1) {
7101
7105
  var B = encodeURIComponent(b);
7102
7106
  B === b && (B = escape(b)), a = a.split(b).join(B);
@@ -7160,12 +7164,12 @@ or.prototype.resolveObject = function(r) {
7160
7164
  } else
7161
7165
  e.pathname = r.pathname;
7162
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) {
7163
- var d = e.pathname || "", f = e.search || "";
7164
- e.path = d + f;
7167
+ var d = e.pathname || "", p = e.search || "";
7168
+ e.path = d + p;
7165
7169
  }
7166
7170
  return e.slashes = e.slashes || r.slashes, e.href = e.format(), e;
7167
7171
  }
7168
- 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];
7169
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)
7170
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;
7171
7175
  else if (g.length)
@@ -7688,10 +7692,10 @@ function uv(r, t) {
7688
7692
  if (h) return h;
7689
7693
  if (o != null && o.closest) {
7690
7694
  var c = this.toRgb(), u = 1 / 0, d = "black";
7691
- if (!n.length) for (var f in e) n[f] = new r(e[f]).toRgb();
7692
- for (var p in e) {
7693
- 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));
7694
- 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);
7695
7699
  }
7696
7700
  return d;
7697
7701
  }
@@ -8765,10 +8769,10 @@ const Tv = {
8765
8769
  format: c,
8766
8770
  type: u,
8767
8771
  target: d,
8768
- resolution: f,
8769
- resourceOptions: p
8772
+ resolution: p,
8773
+ resourceOptions: f
8770
8774
  } = e;
8771
- 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);
8772
8776
  }
8773
8777
  /**
8774
8778
  * Pixel width of the source of this texture
@@ -9138,8 +9142,8 @@ function Iv(r, t) {
9138
9142
  const h = t[l], c = r[l], u = Cd(c);
9139
9143
  s[u] || (s[u] = new Sv[u](n)), o = s[u];
9140
9144
  for (let d = 0; d < c.length; d++) {
9141
- const f = (d / h | 0) * i + a, p = d % h;
9142
- o[f + p] = c[d];
9145
+ const p = (d / h | 0) * i + a, f = d % h;
9146
+ o[p + f] = c[d];
9143
9147
  }
9144
9148
  a += h;
9145
9149
  }
@@ -9314,8 +9318,8 @@ class Tr {
9314
9318
  }
9315
9319
  for (let u = 0; u < t.length; u++) {
9316
9320
  const d = t[u].indexBuffer.data;
9317
- for (let f = 0; f < d.length; f++)
9318
- e.indexBuffer.data[f + h] += a;
9321
+ for (let p = 0; p < d.length; p++)
9322
+ e.indexBuffer.data[p + h] += a;
9319
9323
  a += t[u].buffers[c].data.length / l, h += d.length;
9320
9324
  }
9321
9325
  }
@@ -9476,8 +9480,8 @@ class at {
9476
9480
  const u = Math.sign(e.a * e.d - e.b * e.c);
9477
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))
9478
9482
  return !1;
9479
- 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;
9480
- 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)
9481
9485
  return !1;
9482
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;
9483
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);
@@ -11244,9 +11248,9 @@ const Zi = class ge extends Zn {
11244
11248
  } = this, l = ge._drawCallPool;
11245
11249
  let h = this._dcIndex, c = this._aIndex, u = this._iIndex, d = l[h];
11246
11250
  d.start = this._iIndex, d.texArray = t;
11247
- for (let f = e; f < i; ++f) {
11248
- const p = s[f], m = p._texture.baseTexture, _ = Sd[m.alphaMode ? 1 : 0][p.blendMode];
11249
- 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 = _;
11250
11254
  }
11251
11255
  e < i && (d.size = u - d.start, ++h), this._dcIndex = h, this._aIndex = c, this._iIndex = u;
11252
11256
  }
@@ -11334,9 +11338,9 @@ const Zi = class ge extends Zn {
11334
11338
  const {
11335
11339
  uint32View: o,
11336
11340
  float32View: a
11337
- } = 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);
11338
11342
  for (let m = 0; m < u.length; m += 2)
11339
- 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;
11340
11344
  for (let m = 0; m < c.length; m++)
11341
11345
  i[n++] = l + c[m];
11342
11346
  }
@@ -12634,17 +12638,17 @@ class $d {
12634
12638
  a = _.resolution, l = _.multisample;
12635
12639
  } else
12636
12640
  a = i.resolution, l = i.multisample;
12637
- 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;
12638
12642
  for (let _ = 1; _ < e.length; _++) {
12639
12643
  const y = e[_];
12640
- 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);
12641
12645
  }
12642
- 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);
12643
- 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);
12644
12648
  i.projection.transform && this.transformAABB(
12645
12649
  Vo.copyFrom(i.projection.transform).invert(),
12646
- p
12647
- ), 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(
12648
12652
  n.sourceFrame,
12649
12653
  o.current ? o.current.resolution : i.resolution,
12650
12654
  o.sourceFrame,
@@ -13211,14 +13215,14 @@ class Xd {
13211
13215
  let c = h[l];
13212
13216
  if (c)
13213
13217
  return h[a.id] = c, c;
13214
- const u = t.buffers, d = t.attributes, f = {}, p = {};
13218
+ const u = t.buffers, d = t.attributes, p = {}, f = {};
13215
13219
  for (const m in u)
13216
- f[m] = 0, p[m] = 0;
13220
+ p[m] = 0, f[m] = 0;
13217
13221
  for (const m in d)
13218
- !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];
13219
13223
  for (const m in d) {
13220
13224
  const _ = d[m], y = _.size;
13221
- _.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]);
13222
13226
  }
13223
13227
  c = s.createVertexArray(), s.bindVertexArray(c);
13224
13228
  for (let m = 0; m < u.length; m++) {
@@ -13276,9 +13280,9 @@ class Xd {
13276
13280
  const c = a[h], u = o[c.buffer], d = u._glBuffers[s];
13277
13281
  if (e.attributeData[h]) {
13278
13282
  l !== d && (n.bind(u), l = d);
13279
- const f = e.attributeData[h].location;
13280
- if (i.enableVertexAttribArray(f), i.vertexAttribPointer(
13281
- f,
13283
+ const p = e.attributeData[h].location;
13284
+ if (i.enableVertexAttribArray(p), i.vertexAttribPointer(
13285
+ p,
13282
13286
  c.size,
13283
13287
  c.type || i.FLOAT,
13284
13288
  c.normalized,
@@ -13286,7 +13290,7 @@ class Xd {
13286
13290
  c.start
13287
13291
  ), c.instance)
13288
13292
  if (this.hasInstance)
13289
- i.vertexAttribDivisor(f, c.divisor);
13293
+ i.vertexAttribDivisor(p, c.divisor);
13290
13294
  else
13291
13295
  throw new Error("geometry error, GPU Instancing is not supported on this device");
13292
13296
  }
@@ -14188,7 +14192,7 @@ function g1(r, t) {
14188
14192
  }
14189
14193
  if (!c)
14190
14194
  if (a.data.size > 1) {
14191
- 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;
14192
14196
  n.push(`
14193
14197
  cv = ud.${h}.value;
14194
14198
  v = uv.${h};
@@ -14198,11 +14202,11 @@ function g1(r, t) {
14198
14202
 
14199
14203
  for(var i=0; i < ${a.data.size * d}; i++)
14200
14204
  {
14201
- for(var j = 0; j < ${f}; j++)
14205
+ for(var j = 0; j < ${p}; j++)
14202
14206
  {
14203
14207
  data[offset++] = v[t++];
14204
14208
  }
14205
- offset += ${p};
14209
+ offset += ${f};
14206
14210
  }
14207
14211
 
14208
14212
  `);
@@ -16947,8 +16951,8 @@ class Dn {
16947
16951
  */
16948
16952
  addFrameMatrix(t, e, i, s, n) {
16949
16953
  const o = t.a, a = t.b, l = t.c, h = t.d, c = t.tx, u = t.ty;
16950
- let d = this.minX, f = this.minY, p = this.maxX, m = this.maxY, _ = o * e + l * i + c, y = a * e + h * i + u;
16951
- 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;
16952
16956
  }
16953
16957
  /**
16954
16958
  * Adds screen vertices from array
@@ -16985,12 +16989,12 @@ class Dn {
16985
16989
  */
16986
16990
  addVerticesMatrix(t, e, i, s, n = 0, o = n) {
16987
16991
  const a = t.a, l = t.b, h = t.c, c = t.d, u = t.tx, d = t.ty;
16988
- 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;
16989
16993
  for (let y = i; y < s; y += 2) {
16990
16994
  const x = e[y], g = e[y + 1], v = a * x + h * g + u, w = c * g + l * x + d;
16991
- 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);
16992
16996
  }
16993
- this.minX = f, this.minY = p, this.maxX = m, this.maxY = _;
16997
+ this.minX = p, this.minY = f, this.maxX = m, this.maxY = _;
16994
16998
  }
16995
16999
  /**
16996
17000
  * Adds other {@link PIXI.Bounds}.
@@ -17780,8 +17784,8 @@ class ki extends Ae {
17780
17784
  return;
17781
17785
  this._textureID !== t._updateID && (this.uvs = this._texture._uvs.uvsFloat32), this._transformID = this.transform._worldID, this._textureID = t._updateID;
17782
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;
17783
- let f = 0, p = 0, m = 0, _ = 0;
17784
- 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) {
17785
17789
  const y = j.RESOLUTION;
17786
17790
  for (let x = 0; x < h.length; ++x)
17787
17791
  h[x] = Math.round(h[x] * y) / y;
@@ -17798,8 +17802,8 @@ class ki extends Ae {
17798
17802
  else if (this._transformTrimmedID === this.transform._worldID && this._textureTrimmedID === this._texture._updateID)
17799
17803
  return;
17800
17804
  this._transformTrimmedID = this.transform._worldID, this._textureTrimmedID = this._texture._updateID;
17801
- 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;
17802
- 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) {
17803
17807
  const _ = j.RESOLUTION;
17804
17808
  for (let y = 0; y < e.length; ++y)
17805
17809
  e[y] = Math.round(e[y] * _) / _;
@@ -18019,15 +18023,15 @@ Rt.prototype._renderCached = function(r) {
18019
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));
18020
18024
  };
18021
18025
  Rt.prototype._initCachedDisplayObject = function(r) {
18022
- var d, f;
18026
+ var d, p;
18023
18027
  if ((d = this._cacheData) != null && d.sprite)
18024
18028
  return;
18025
18029
  const t = this.alpha;
18026
18030
  this.alpha = 1, r.batch.flush();
18027
18031
  const e = this.getLocalBounds(new at(), !0);
18028
- if ((f = this.filters) != null && f.length) {
18029
- const p = this.filters[0].padding;
18030
- e.pad(p);
18032
+ if ((p = this.filters) != null && p.length) {
18033
+ const f = this.filters[0].padding;
18034
+ e.pad(f);
18031
18035
  }
18032
18036
  const i = this.cacheAsBitmapResolution || r.resolution;
18033
18037
  e.ceil(i), e.width = Math.max(e.width, 1 / i), e.height = Math.max(e.height, 1 / i);
@@ -18590,7 +18594,7 @@ class qa extends Qt {
18590
18594
  */
18591
18595
  hue(t, e) {
18592
18596
  t = (t || 0) / 180 * Math.PI;
18593
- 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 = [
18594
18598
  l,
18595
18599
  h,
18596
18600
  c,
@@ -18598,10 +18602,10 @@ class qa extends Qt {
18598
18602
  0,
18599
18603
  u,
18600
18604
  d,
18601
- f,
18605
+ p,
18602
18606
  0,
18603
18607
  0,
18604
- p,
18608
+ f,
18605
18609
  m,
18606
18610
  _,
18607
18611
  0,
@@ -18934,7 +18938,7 @@ class qa extends Qt {
18934
18938
  */
18935
18939
  colorTone(t, e, i, s, n) {
18936
18940
  t = t || 0.2, e = e || 0.15, i = i || 16770432, s = s || 3375104;
18937
- 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 = [
18938
18942
  0.3,
18939
18943
  0.59,
18940
18944
  0.11,
@@ -18956,7 +18960,7 @@ class qa extends Qt {
18956
18960
  0,
18957
18961
  0
18958
18962
  ];
18959
- this._loadMatrix(f, n);
18963
+ this._loadMatrix(p, n);
18960
18964
  }
18961
18965
  /**
18962
18966
  * Night effect
@@ -19725,7 +19729,7 @@ class On extends Ts {
19725
19729
  * @deprecated since 7.0.0
19726
19730
  */
19727
19731
  // eslint-disable-next-line max-params
19728
- 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) {
19729
19733
  throw new Error("Method not implemented.");
19730
19734
  }
19731
19735
  }
@@ -19878,7 +19882,7 @@ class lx {
19878
19882
  if ((t.eventMode === "dynamic" || e === "dynamic") && (gr.pauseUpdate = !1), t.interactiveChildren && t.children) {
19879
19883
  const c = t.children;
19880
19884
  for (let u = c.length - 1; u >= 0; u--) {
19881
- const d = c[u], f = this.hitTestMoveRecursive(
19885
+ const d = c[u], p = this.hitTestMoveRecursive(
19882
19886
  d,
19883
19887
  this._isInteractive(e) ? e : d.eventMode,
19884
19888
  i,
@@ -19886,11 +19890,11 @@ class lx {
19886
19890
  n,
19887
19891
  o || n(t, i)
19888
19892
  );
19889
- if (f) {
19890
- if (f.length > 0 && !f[f.length - 1].parent)
19893
+ if (p) {
19894
+ if (p.length > 0 && !p[p.length - 1].parent)
19891
19895
  continue;
19892
- const p = t.isInteractive();
19893
- (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;
19894
19898
  }
19895
19899
  }
19896
19900
  }
@@ -20040,10 +20044,10 @@ class lx {
20040
20044
  for (; d && d !== this.rootTarget.parent && d !== e.target; )
20041
20045
  d = d.parent;
20042
20046
  if (!d || d === this.rootTarget.parent) {
20043
- const f = this.clonePointerEvent(e, "pointerenter");
20044
- for (f.eventPhase = f.AT_TARGET; f.target && f.target !== n && f.target !== this.rootTarget.parent; )
20045
- f.currentTarget = f.target, this.notifyTarget(f), i && this.notifyTarget(f, "mouseenter"), f.target = f.target.parent;
20046
- 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);
20047
20051
  }
20048
20052
  this.freeEvent(u);
20049
20053
  }
@@ -21289,14 +21293,14 @@ class _f {
21289
21293
  let u = this.div;
21290
21294
  u.style.left = `${e}px`, u.style.top = `${i}px`, u.style.width = `${o}px`, u.style.height = `${a}px`;
21291
21295
  for (let d = 0; d < this.children.length; d++) {
21292
- const f = this.children[d];
21293
- if (f.renderId !== this.renderId)
21294
- 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--;
21295
21299
  else {
21296
- u = f._accessibleDiv;
21297
- let p = f.hitArea;
21298
- const m = f.worldTransform;
21299
- 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));
21300
21304
  }
21301
21305
  }
21302
21306
  this.renderId++;
@@ -22324,11 +22328,11 @@ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`), o.pu
22324
22328
  this.hasKey(l) && console.warn(`[Resolver] already has key: ${l} overwriting`);
22325
22329
  }, xe(o).forEach((l) => {
22326
22330
  const { src: h, srcs: c } = l;
22327
- let { data: u, format: d, loadParser: f } = l;
22328
- 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);
22329
22333
  Array.isArray(m) ? m.forEach(a) : a(m);
22330
22334
  const _ = [];
22331
- p.forEach((y) => {
22335
+ f.forEach((y) => {
22332
22336
  y.forEach((x) => {
22333
22337
  let g = {};
22334
22338
  if (typeof x != "object") {
@@ -22341,7 +22345,7 @@ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`), o.pu
22341
22345
  }
22342
22346
  }
22343
22347
  } else
22344
- 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 = {
22345
22349
  ...g,
22346
22350
  ...x
22347
22351
  };
@@ -22351,7 +22355,7 @@ Please use Assets.add({ alias, src, data, format, loadParser }) instead.`), o.pu
22351
22355
  aliases: m,
22352
22356
  data: u,
22353
22357
  format: d,
22354
- loadParser: f
22358
+ loadParser: p
22355
22359
  }), _.push(g);
22356
22360
  });
22357
22361
  }), m.forEach((y) => {
@@ -22625,8 +22629,8 @@ class Zx {
22625
22629
  e == null || e(++a / l);
22626
22630
  }, c = o.map((u) => {
22627
22631
  const d = s[u];
22628
- return l += Object.keys(d).length, this._mapLoadToResolve(d, h).then((f) => {
22629
- n[u] = f;
22632
+ return l += Object.keys(d).length, this._mapLoadToResolve(d, h).then((p) => {
22633
+ n[u] = p;
22630
22634
  });
22631
22635
  });
22632
22636
  return await Promise.all(c), i ? n[t[0]] : n;
@@ -23129,14 +23133,14 @@ class Vr extends lb {
23129
23133
  */
23130
23134
  static _createLevelBuffers(t, e, i, s, n, o, a) {
23131
23135
  const l = new Array(i);
23132
- 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];
23133
23137
  for (let m = 0; m < i; m++)
23134
23138
  l[m] = {
23135
23139
  levelID: m,
23136
23140
  levelWidth: i > 1 ? c : d,
23137
- levelHeight: i > 1 ? u : f,
23138
- levelBuffer: new Uint8Array(t.buffer, h, p)
23139
- }, 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];
23140
23144
  return l;
23141
23145
  }
23142
23146
  }
@@ -23211,15 +23215,15 @@ function Ab(r) {
23211
23215
  t.buffer,
23212
23216
  h,
23213
23217
  Nc / Uint32Array.BYTES_PER_ELEMENT
23214
- ), 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];
23215
23219
  if (m === void 0)
23216
23220
  throw new Error(`DDSParser cannot parse texture data with DXGI format ${u}`);
23217
- if (f === wb)
23221
+ if (p === wb)
23218
23222
  throw new Error("DDSParser does not support cubemap textures");
23219
23223
  if (d === 6)
23220
23224
  throw new Error("DDSParser does not supported 3D texture data");
23221
23225
  const _ = new Array(), y = Ko + js + Nc;
23222
- if (p === 1)
23226
+ if (f === 1)
23223
23227
  _.push(new Uint8Array(r, y));
23224
23228
  else {
23225
23229
  const x = Ln[m];
@@ -23229,7 +23233,7 @@ function Ab(r) {
23229
23233
  g += S, v = v >>> 1, w = w >>> 1;
23230
23234
  }
23231
23235
  let I = y;
23232
- for (let A = 0; A < p; A++)
23236
+ for (let A = 0; A < f; A++)
23233
23237
  _.push(new Uint8Array(r, I, g)), I += g;
23234
23238
  }
23235
23239
  return _.map((x) => new Vr(x, {
@@ -23280,7 +23284,7 @@ function Rb(r, t, e = !1) {
23280
23284
  const i = new DataView(t);
23281
23285
  if (!Pb(r, i))
23282
23286
  return null;
23283
- 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);
23284
23288
  if (h === 0 || c !== 1)
23285
23289
  throw new Error("Only 2D textures are supported");
23286
23290
  if (d !== 1)
@@ -23293,18 +23297,18 @@ function Rb(r, t, e = !1) {
23293
23297
  let w;
23294
23298
  if (n !== 0 ? kc[n] ? w = kc[n] * Ib[o] : w = Cb[n] : w = Ln[a], w === void 0)
23295
23299
  throw new Error("Unable to resolve the pixel format stored in the *.ktx file!");
23296
- const I = e ? Bb(i, p, s) : null;
23297
- let A = v * w, C = l, N = h, S = y, P = x, E = rl + p;
23298
- 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++) {
23299
23303
  const B = i.getUint32(E, s);
23300
23304
  let O = E + 4;
23301
23305
  for (let G = 0; G < u; G++) {
23302
23306
  let $ = g[G];
23303
- $ || ($ = g[G] = new Array(f)), $[b] = {
23307
+ $ || ($ = g[G] = new Array(p)), $[b] = {
23304
23308
  levelID: b,
23305
23309
  // don't align mipWidth when texture not compressed! (glType not zero)
23306
- levelWidth: f > 1 || n !== 0 ? C : S,
23307
- levelHeight: f > 1 || n !== 0 ? N : P,
23310
+ levelWidth: p > 1 || n !== 0 ? C : S,
23311
+ levelHeight: p > 1 || n !== 0 ? N : P,
23308
23312
  levelBuffer: new Uint8Array(t, O, A)
23309
23313
  }, O += A;
23310
23314
  }
@@ -23343,7 +23347,7 @@ function Rb(r, t, e = !1) {
23343
23347
  format: a,
23344
23348
  width: l,
23345
23349
  height: h,
23346
- levels: f,
23350
+ levels: p,
23347
23351
  levelBuffers: b
23348
23352
  })),
23349
23353
  kvData: I
@@ -23576,8 +23580,8 @@ const Ks = new at(), Nb = 4, Tf = class es {
23576
23580
  if (a) {
23577
23581
  if (s = a.baseTexture.resolution, e = e ?? a.frame, n = !1, o = a.baseTexture.alphaMode > 0 && a.baseTexture.format === k.RGBA, !l) {
23578
23582
  i.renderTexture.bind(a);
23579
- const f = a.framebuffer.glFramebuffers[i.CONTEXT_UID];
23580
- f.blitFramebuffer && i.framebuffer.bind(f.blitFramebuffer);
23583
+ const p = a.framebuffer.glFramebuffers[i.CONTEXT_UID];
23584
+ p.blitFramebuffer && i.framebuffer.bind(p.blitFramebuffer);
23581
23585
  }
23582
23586
  } else
23583
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();
@@ -23626,14 +23630,14 @@ const Nn = {
23626
23630
  const t = r.points;
23627
23631
  let e, i, s, n, o, a;
23628
23632
  if (r.type === Wt.CIRC) {
23629
- const p = r.shape;
23630
- 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;
23631
23635
  } else if (r.type === Wt.ELIP) {
23632
- const p = r.shape;
23633
- 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;
23634
23638
  } else {
23635
- const p = r.shape, m = p.width / 2, _ = p.height / 2;
23636
- 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;
23637
23641
  }
23638
23642
  if (!(o >= 0 && a >= 0 && s >= 0 && n >= 0)) {
23639
23643
  t.length = 0;
@@ -23646,21 +23650,21 @@ const Nn = {
23646
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;
23647
23651
  return;
23648
23652
  }
23649
- 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;
23650
23654
  {
23651
- 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;
23652
23656
  if (t[c++] = _, t[c++] = x, t[--u] = x, t[--u] = y, n) {
23653
23657
  const g = i - m;
23654
- t[d++] = y, t[d++] = g, t[--f] = g, t[--f] = _;
23658
+ t[d++] = y, t[d++] = g, t[--p] = g, t[--p] = _;
23655
23659
  }
23656
23660
  }
23657
- for (let p = 1; p < l; p++) {
23658
- 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;
23659
- 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;
23660
23664
  }
23661
23665
  {
23662
- const p = s, m = n + a, _ = e + p, y = e - p, x = i + m, g = i - m;
23663
- 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);
23664
23668
  }
23665
23669
  },
23666
23670
  triangulate(r, t) {
@@ -23803,7 +23807,7 @@ class $c {
23803
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);
23804
23808
  if (d < 1e-8 || n === 0)
23805
23809
  return (o[o.length - 2] !== t || o[o.length - 1] !== e) && o.push(t, e), null;
23806
- 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);
23807
23811
  return {
23808
23812
  cx: v + t,
23809
23813
  cy: w + e,
@@ -23833,12 +23837,12 @@ class $c {
23833
23837
  const c = a - o, u = Oi._segmentsCount(
23834
23838
  Math.abs(c) * n,
23835
23839
  Math.ceil(Math.abs(c) / Cn) * 40
23836
- ), 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 / _;
23837
23841
  for (let x = 0; x <= _; ++x) {
23838
- 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);
23839
23843
  h.push(
23840
- (p * w + m * I) * n + i,
23841
- (p * -I + m * w) * n + s
23844
+ (f * w + m * I) * n + i,
23845
+ (f * -I + m * w) * n + s
23842
23846
  );
23843
23847
  }
23844
23848
  }
@@ -23885,9 +23889,9 @@ class Ml {
23885
23889
  * @returns - Length of bezier curve
23886
23890
  */
23887
23891
  static curveLength(t, e, i, s, n, o, a, l) {
23888
- 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;
23889
23893
  for (let I = 1; I <= 10; ++I)
23890
- 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);
23891
23895
  return h;
23892
23896
  }
23893
23897
  /**
@@ -23909,22 +23913,22 @@ class Ml {
23909
23913
  const c = Oi._segmentsCount(
23910
23914
  Ml.curveLength(l, h, t, e, i, s, n, o)
23911
23915
  );
23912
- let u = 0, d = 0, f = 0, p = 0, m = 0;
23916
+ let u = 0, d = 0, p = 0, f = 0, m = 0;
23913
23917
  a.push(l, h);
23914
23918
  for (let _ = 1, y = 0; _ <= c; ++_)
23915
- y = _ / c, u = 1 - y, d = u * u, f = d * u, p = y * y, m = p * y, a.push(
23916
- f * l + 3 * d * y * t + 3 * u * p * i + m * n,
23917
- 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
23918
23922
  );
23919
23923
  }
23920
23924
  }
23921
23925
  function Hc(r, t, e, i, s, n, o, a) {
23922
23926
  const l = r - e * s, h = t - i * s, c = r + e * n, u = t + i * n;
23923
- let d, f;
23924
- o ? (d = i, f = -e) : (d = -i, f = e);
23925
- 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;
23926
23930
  return a.push(
23927
- p,
23931
+ f,
23928
23932
  m,
23929
23933
  _,
23930
23934
  y
@@ -23935,7 +23939,7 @@ function Rr(r, t, e, i, s, n, o, a) {
23935
23939
  let c = Math.atan2(l, h), u = Math.atan2(s - r, n - t);
23936
23940
  a && c < u ? c += Math.PI * 2 : !a && c > u && (u += Math.PI * 2);
23937
23941
  let d = c;
23938
- 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 / _;
23939
23943
  if (d += y, a) {
23940
23944
  o.push(
23941
23945
  r,
@@ -23993,9 +23997,9 @@ function Hb(r, t) {
23993
23997
  }
23994
23998
  const c = t.points, u = i.length / 2;
23995
23999
  let d = i.length;
23996
- 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;
23997
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);
23998
- A /= P, C /= P, A *= p, C *= p;
24002
+ A /= P, C /= P, A *= f, C *= f;
23999
24003
  const E = n.alignment, b = (1 - E) * 2, B = E * 2;
24000
24004
  l || (n.cap === br.ROUND ? d += Rr(
24001
24005
  y - A * (b - B) * 0.5,
@@ -24013,7 +24017,7 @@ function Hb(r, t) {
24013
24017
  x + C * B
24014
24018
  );
24015
24019
  for (let $ = 1; $ < u - 1; ++$) {
24016
- 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;
24017
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;
24018
24022
  if (Math.abs(et) < 1e-3 * Math.abs(z)) {
24019
24023
  c.push(
@@ -24178,7 +24182,7 @@ function Hb(r, t) {
24178
24182
  ), d += 2;
24179
24183
  }
24180
24184
  }
24181
- 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(
24182
24186
  g - A * b,
24183
24187
  v - C * b,
24184
24188
  g + A * B,
@@ -24194,7 +24198,7 @@ function Hb(r, t) {
24194
24198
  !1
24195
24199
  ) + 2 : n.cap === br.SQUARE && (d += Hc(g, v, A, C, b, B, !1, c)));
24196
24200
  const O = t.indices, G = Oi.epsilon * Oi.epsilon;
24197
- for (let $ = f; $ < d + f - 2; ++$)
24201
+ for (let $ = p; $ < d + p - 2; ++$)
24198
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);
24199
24203
  }
24200
24204
  function Xb(r, t) {
@@ -24226,8 +24230,8 @@ class Bl {
24226
24230
  * @returns - Length of quadratic curve
24227
24231
  */
24228
24232
  static curveLength(t, e, i, s, n, o) {
24229
- 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;
24230
- 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 * _);
24231
24235
  }
24232
24236
  /**
24233
24237
  * Calculate the points for a quadratic bezier curve and then draws it.
@@ -24398,13 +24402,13 @@ const ni = new gt(), Sf = class If extends Pd {
24398
24402
  const h = e[l], c = h.fillStyle, u = h.lineStyle;
24399
24403
  Zo[h.type].build(h), h.matrix && this.transformPoints(h.points, h.matrix), (c.visible || u.visible) && this.processHoles(h.holes);
24400
24404
  for (let d = 0; d < 2; d++) {
24401
- const f = d === 0 ? c : u;
24402
- if (!f.visible)
24405
+ const p = d === 0 ? c : u;
24406
+ if (!p.visible)
24403
24407
  continue;
24404
- const p = f.texture.baseTexture, m = this.indices.length, _ = this.points.length / 2;
24405
- 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);
24406
24410
  const y = this.points.length / 2 - _;
24407
- 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));
24408
24412
  }
24409
24413
  }
24410
24414
  const n = this.indices.length, o = this.points.length / 2;
@@ -24471,8 +24475,8 @@ const ni = new gt(), Sf = class If extends Pd {
24471
24475
  let n = 0, o = null, a = 0, l = !1, h = ke.TRIANGLES, c = 0;
24472
24476
  this.drawCalls.push(s);
24473
24477
  for (let u = 0; u < this.batches.length; u++) {
24474
- const d = this.batches[u], f = 8, p = d.style, m = p.texture.baseTexture;
24475
- 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);
24476
24480
  }
24477
24481
  st._globalBatch = t, this.packAttributes();
24478
24482
  }
@@ -24567,8 +24571,8 @@ const ni = new gt(), Sf = class If extends Pd {
24567
24571
  for (; a < n; ) {
24568
24572
  let u = t[(s + a) * 2], d = t[(s + a) * 2 + 1];
24569
24573
  if (o) {
24570
- const f = o.a * u + o.c * d + o.tx;
24571
- 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;
24572
24576
  }
24573
24577
  a++, e.push(u / h.width, d / h.height);
24574
24578
  }
@@ -24585,10 +24589,10 @@ const ni = new gt(), Sf = class If extends Pd {
24585
24589
  */
24586
24590
  adjustUvs(t, e, i, s) {
24587
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;
24588
- 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);
24589
24593
  for (let m = i + 2; m < a; m += 2)
24590
- f = Math.min(f, Math.floor(t[m] + o)), p = Math.min(p, Math.floor(t[m + 1] + o));
24591
- 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;
24592
24596
  for (let m = i; m < a; m += 2)
24593
24597
  t[m] = (t[m] + u) * h, t[m + 1] = (t[m + 1] + d) * c;
24594
24598
  }
@@ -24818,8 +24822,8 @@ const Jo = {}, il = class dn extends Ae {
24818
24822
  this._initCurve(t, e);
24819
24823
  const o = this.currentPath.points, a = $c.curveTo(t, e, i, s, n, o);
24820
24824
  if (a) {
24821
- const { cx: l, cy: h, radius: c, startAngle: u, endAngle: d, anticlockwise: f } = a;
24822
- 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);
24823
24827
  }
24824
24828
  return this;
24825
24829
  }
@@ -25116,8 +25120,8 @@ const Jo = {}, il = class dn extends Ae {
25116
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;
25117
25121
  let u = 0;
25118
25122
  for (let d = 0; d < h.length; d += 2) {
25119
- const f = h[d], p = h[d + 1];
25120
- 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;
25121
25125
  }
25122
25126
  }
25123
25127
  /**
@@ -25324,13 +25328,13 @@ const Qo = new gt(), zc = new Xr(), Cf = class Rf extends Ae {
25324
25328
  this._transformID = this.transform._worldID, this.vertexData.length !== e.length && (this.vertexData = new Float32Array(e.length));
25325
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;
25326
25330
  for (let d = 0; d < u.length / 2; d++) {
25327
- const f = e[d * 2], p = e[d * 2 + 1];
25328
- 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;
25329
25333
  }
25330
25334
  if (this._roundPixels) {
25331
25335
  const d = j.RESOLUTION;
25332
- for (let f = 0; f < u.length; ++f)
25333
- 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;
25334
25338
  }
25335
25339
  this.vertexDirty = i;
25336
25340
  }
@@ -25685,13 +25689,13 @@ class Pf extends Zn {
25685
25689
  const c = n.gl, u = t.worldTransform.copyTo(this.tempMatrix);
25686
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);
25687
25691
  let d = !1;
25688
- for (let f = 0, p = 0; f < o; f += s, p += 1) {
25689
- let m = o - f;
25690
- m > s && (m = s), p >= a.length && a.push(this._generateOneMoreBuffer(t));
25691
- const _ = a[p];
25692
- _.uploadDynamic(e, f, m);
25693
- const y = t._bufferUpdateIDs[p] || 0;
25694
- 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);
25695
25699
  }
25696
25700
  }
25697
25701
  /**
@@ -25726,8 +25730,8 @@ class Pf extends Zn {
25726
25730
  uploadVertices(t, e, i, s, n, o) {
25727
25731
  let a = 0, l = 0, h = 0, c = 0;
25728
25732
  for (let u = 0; u < i; ++u) {
25729
- const d = t[e + u], f = d._texture, p = d.scale.x, m = d.scale.y, _ = f.trim, y = f.orig;
25730
- _ ? (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;
25731
25735
  }
25732
25736
  }
25733
25737
  /**
@@ -25851,19 +25855,19 @@ const Js = {
25851
25855
  a.font = n;
25852
25856
  const l = (i ? K.wordWrap(t, e, s) : t).split(/(?:\r\n|\r|\n)/), h = new Array(l.length);
25853
25857
  let c = 0;
25854
- for (let p = 0; p < l.length; p++) {
25855
- const m = K._measureText(l[p], e.letterSpacing, a);
25856
- 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);
25857
25861
  }
25858
25862
  let u = c + e.strokeThickness;
25859
25863
  e.dropShadow && (u += e.dropShadowDistance);
25860
25864
  const d = e.lineHeight || o.fontSize + e.strokeThickness;
25861
- let f = Math.max(d, o.fontSize + e.strokeThickness * 2) + e.leading + (l.length - 1) * (d + e.leading);
25862
- 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(
25863
25867
  t,
25864
25868
  e,
25865
25869
  u,
25866
- f,
25870
+ p,
25867
25871
  l,
25868
25872
  h,
25869
25873
  d + e.leading,
@@ -25889,13 +25893,13 @@ const Js = {
25889
25893
  const s = i.getContext("2d", Js);
25890
25894
  let n = 0, o = "", a = "";
25891
25895
  const l = /* @__PURE__ */ Object.create(null), { letterSpacing: h, whiteSpace: c } = e, u = K.collapseSpaces(c), d = K.collapseNewlines(c);
25892
- let f = !u;
25893
- const p = e.wordWrapWidth + h, m = K.tokenize(t);
25896
+ let p = !u;
25897
+ const f = e.wordWrapWidth + h, m = K.tokenize(t);
25894
25898
  for (let _ = 0; _ < m.length; _++) {
25895
25899
  let y = m[_];
25896
25900
  if (K.isNewline(y)) {
25897
25901
  if (!d) {
25898
- a += K.addLine(o), f = !u, o = "", n = 0;
25902
+ a += K.addLine(o), p = !u, o = "", n = 0;
25899
25903
  continue;
25900
25904
  }
25901
25905
  y = " ";
@@ -25906,7 +25910,7 @@ const Js = {
25906
25910
  continue;
25907
25911
  }
25908
25912
  const x = K.getFromCache(y, h, l, s);
25909
- if (x > p)
25913
+ if (x > f)
25910
25914
  if (o !== "" && (a += K.addLine(o), o = "", n = 0), K.canBreakWords(y, e.breakWords)) {
25911
25915
  const g = K.wordWrapSplit(y);
25912
25916
  for (let v = 0; v < g.length; v++) {
@@ -25921,15 +25925,15 @@ const Js = {
25921
25925
  }
25922
25926
  v += A - 1;
25923
25927
  const C = K.getFromCache(w, h, l, s);
25924
- 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;
25925
25929
  }
25926
25930
  } else {
25927
25931
  o.length > 0 && (a += K.addLine(o), o = "", n = 0);
25928
25932
  const g = _ === m.length - 1;
25929
- a += K.addLine(y, !g), f = !1, o = "", n = 0;
25933
+ a += K.addLine(y, !g), p = !1, o = "", n = 0;
25930
25934
  }
25931
25935
  else
25932
- 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);
25933
25937
  }
25934
25938
  return a += K.addLine(o, !1), a;
25935
25939
  }
@@ -26092,26 +26096,26 @@ const Js = {
26092
26096
  return K._fonts[t] = e, e;
26093
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);
26094
26098
  const h = s.getImageData(0, 0, o, l).data, c = h.length, u = o * 4;
26095
- let d = 0, f = 0, p = !1;
26099
+ let d = 0, p = 0, f = !1;
26096
26100
  for (d = 0; d < a; ++d) {
26097
26101
  for (let m = 0; m < u; m += 4)
26098
- if (h[f + m] !== 255) {
26099
- p = !0;
26102
+ if (h[p + m] !== 255) {
26103
+ f = !0;
26100
26104
  break;
26101
26105
  }
26102
- if (!p)
26103
- f += u;
26106
+ if (!f)
26107
+ p += u;
26104
26108
  else
26105
26109
  break;
26106
26110
  }
26107
- 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) {
26108
26112
  for (let m = 0; m < u; m += 4)
26109
- if (h[f + m] !== 255) {
26110
- p = !0;
26113
+ if (h[p + m] !== 255) {
26114
+ f = !0;
26111
26115
  break;
26112
26116
  }
26113
- if (!p)
26114
- f -= u;
26117
+ if (!f)
26118
+ p -= u;
26115
26119
  else
26116
26120
  break;
26117
26121
  }
@@ -26713,9 +26717,9 @@ const Qb = {
26713
26717
  this._font = this._style.toFontString();
26714
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;
26715
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;
26716
- let d, f;
26717
- const p = e.dropShadow ? 2 : 1;
26718
- 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) {
26719
26723
  const _ = e.dropShadow && m === 0, y = _ ? Math.ceil(Math.max(1, o) + e.padding * 2) : 0, x = y * this._resolution;
26720
26724
  if (_) {
26721
26725
  i.fillStyle = "black", i.strokeStyle = "black";
@@ -26726,15 +26730,15 @@ const Qb = {
26726
26730
  let g = (l - u.fontSize) / 2;
26727
26731
  l - u.fontSize < 0 && (g = 0);
26728
26732
  for (let v = 0; v < a.length; v++)
26729
- 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(
26730
26734
  a[v],
26731
26735
  d + e.padding,
26732
- f + e.padding - y,
26736
+ p + e.padding - y,
26733
26737
  !0
26734
26738
  ), e.fill && this.drawLetterSpacing(
26735
26739
  a[v],
26736
26740
  d + e.padding,
26737
- f + e.padding - y
26741
+ p + e.padding - y
26738
26742
  );
26739
26743
  }
26740
26744
  this.updateTexture();
@@ -26760,10 +26764,10 @@ const Qb = {
26760
26764
  for (let u = 0; u < l.length; ++u) {
26761
26765
  const d = l[u];
26762
26766
  s ? this.context.strokeText(d, a, i) : this.context.fillText(d, a, i);
26763
- let f = "";
26764
- for (let p = u + 1; p < l.length; ++p)
26765
- f += l[p];
26766
- 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;
26767
26771
  }
26768
26772
  }
26769
26773
  /** Updates texture size based on canvas size. */
@@ -26820,19 +26824,19 @@ const Qb = {
26820
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();
26821
26825
  if (!u.length) {
26822
26826
  const d = c.length + 1;
26823
- for (let f = 1; f < d; ++f)
26824
- u.push(f / d);
26827
+ for (let p = 1; p < d; ++p)
26828
+ u.push(p / d);
26825
26829
  }
26826
26830
  if (c.unshift(s[0]), u.unshift(0), c.push(s[s.length - 1]), u.push(1), t.fillGradientType === to.LINEAR_VERTICAL) {
26827
26831
  n = this.context.createLinearGradient(l / 2, a, l / 2, h + a);
26828
26832
  const d = i.fontProperties.fontSize + t.strokeThickness;
26829
- for (let f = 0; f < e.length; f++) {
26830
- 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;
26831
26835
  let _ = m;
26832
- f > 0 && p > m && (_ = (m + p) / 2);
26833
- 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);
26834
26838
  let g = y;
26835
- f + 1 < e.length && x < y && (g = (y + x) / 2);
26839
+ p + 1 < e.length && x < y && (g = (y + x) / 2);
26836
26840
  const v = (g - _) / h;
26837
26841
  for (let w = 0; w < c.length; w++) {
26838
26842
  let I = 0;
@@ -26847,10 +26851,10 @@ const Qb = {
26847
26851
  } else {
26848
26852
  n = this.context.createLinearGradient(a, h / 2, l + a, h / 2);
26849
26853
  const d = c.length + 1;
26850
- let f = 1;
26851
- for (let p = 0; p < c.length; p++) {
26854
+ let p = 1;
26855
+ for (let f = 0; f < c.length; f++) {
26852
26856
  let m;
26853
- 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++;
26854
26858
  }
26855
26859
  }
26856
26860
  return n;
@@ -27275,15 +27279,15 @@ class Uf extends Zn {
27275
27279
  const a = t._texture, l = a.baseTexture, h = l.alphaMode > 0, c = t.tileTransform.localTransform, u = t.uvMatrix;
27276
27280
  let d = l.isPowerOfTwo && a.frame.width === l.width && a.frame.height === l.height;
27277
27281
  d && (l._glTextures[e.CONTEXT_UID] ? d = l.wrapMode !== Er.CLAMP : l.wrapMode === Er.CLAMP && (l.wrapMode = Er.REPEAT));
27278
- 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;
27279
27283
  Qs.set(
27280
- c.a * p / _,
27281
- c.b * p / y,
27284
+ c.a * f / _,
27285
+ c.b * f / y,
27282
27286
  c.c * m / _,
27283
27287
  c.d * m / y,
27284
27288
  c.tx / _,
27285
27289
  c.ty / y
27286
- ), 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);
27287
27291
  }
27288
27292
  }
27289
27293
  Uf.extension = {
@@ -27503,10 +27507,10 @@ const mw = {
27503
27507
  const h = (c = r == null ? void 0 : r.meta) == null ? void 0 : c.related_multi_packs;
27504
27508
  if (Array.isArray(h)) {
27505
27509
  const d = [];
27506
- for (const p of h) {
27507
- if (typeof p != "string")
27510
+ for (const f of h) {
27511
+ if (typeof f != "string")
27508
27512
  continue;
27509
- let m = o + p;
27513
+ let m = o + f;
27510
27514
  (u = t.data) != null && u.ignoreMultiPack || (m = tl(m, t.src), d.push(e.load({
27511
27515
  src: m,
27512
27516
  data: {
@@ -27514,9 +27518,9 @@ const mw = {
27514
27518
  }
27515
27519
  })));
27516
27520
  }
27517
- const f = await Promise.all(d);
27518
- l.linkedSheets = f, f.forEach((p) => {
27519
- 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));
27520
27524
  });
27521
27525
  }
27522
27526
  return l;
@@ -27560,8 +27564,8 @@ class fn {
27560
27564
  for (const n in e) {
27561
27565
  const o = e[n].match(/^[a-z]+/gm)[0], a = e[n].match(/[a-zA-Z]+=([^\s"']+|"([^"]*)")/gm), l = {};
27562
27566
  for (const h in a) {
27563
- const c = a[h].split("="), u = c[0], d = c[1].replace(/"/gm, ""), f = parseFloat(d), p = isNaN(f) ? d : f;
27564
- 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;
27565
27569
  }
27566
27570
  i[o].push(l);
27567
27571
  }
@@ -27690,33 +27694,33 @@ function yw(r, t, e, i, s, n) {
27690
27694
  } else
27691
27695
  return o;
27692
27696
  let a;
27693
- 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();
27694
- if (!f.length) {
27695
- const p = d.length + 1;
27696
- for (let m = 1; m < p; ++m)
27697
- 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);
27698
27702
  }
27699
- 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) {
27700
27704
  a = t.createLinearGradient(c / 2, h, c / 2, u + h);
27701
- let p = 0;
27705
+ let f = 0;
27702
27706
  const m = (n.fontProperties.fontSize + e.strokeThickness) / u;
27703
27707
  for (let _ = 0; _ < s.length; _++) {
27704
27708
  const y = n.lineHeight * _;
27705
27709
  for (let x = 0; x < d.length; x++) {
27706
27710
  let g = 0;
27707
- typeof f[x] == "number" ? g = f[x] : g = x / d.length;
27711
+ typeof p[x] == "number" ? g = p[x] : g = x / d.length;
27708
27712
  const v = y / u + g * m;
27709
- let w = Math.max(p, v);
27710
- 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;
27711
27715
  }
27712
27716
  }
27713
27717
  } else {
27714
27718
  a = t.createLinearGradient(h, u / 2, c + h, u / 2);
27715
- const p = d.length + 1;
27719
+ const f = d.length + 1;
27716
27720
  let m = 1;
27717
27721
  for (let _ = 0; _ < d.length; _++) {
27718
27722
  let y;
27719
- 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++;
27720
27724
  }
27721
27725
  }
27722
27726
  return a;
@@ -27726,8 +27730,8 @@ function _w(r, t, e, i, s, n, o) {
27726
27730
  t.translate(i, s), t.scale(n, n);
27727
27731
  const h = o.strokeThickness / 2, c = -(o.strokeThickness / 2);
27728
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) {
27729
- const u = o.dropShadowColor, d = o.dropShadowBlur * n, f = o.dropShadowDistance * n;
27730
- 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;
27731
27735
  } else
27732
27736
  t.shadowColor = "black", t.shadowBlur = 0, t.shadowOffsetX = 0, t.shadowOffsetY = 0;
27733
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)";
@@ -27770,16 +27774,16 @@ const dr = class Fe {
27770
27774
  const [s] = t.info, [n] = t.common, [o] = t.page, [a] = t.distanceField, l = ar(o.file), h = {};
27771
27775
  this._ownsTextures = i, this.font = s.face, this.size = s.size, this.lineHeight = n.lineHeight / l, this.chars = {}, this.pageTextures = h;
27772
27776
  for (let u = 0; u < t.page.length; u++) {
27773
- const { id: d, file: f } = t.page[u];
27774
- 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);
27775
27779
  }
27776
27780
  for (let u = 0; u < t.char.length; u++) {
27777
- const { id: d, page: f } = t.char[u];
27778
- let { x: p, y: m, width: _, height: y, xoffset: x, yoffset: g, xadvance: v } = t.char[u];
27779
- 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;
27780
27784
  const w = new at(
27781
- p + h[f].frame.x / l,
27782
- m + h[f].frame.y / l,
27785
+ f + h[p].frame.x / l,
27786
+ m + h[p].frame.y / l,
27783
27787
  _,
27784
27788
  y
27785
27789
  );
@@ -27789,15 +27793,15 @@ const dr = class Fe {
27789
27793
  xAdvance: v,
27790
27794
  kerning: {},
27791
27795
  texture: new Y(
27792
- h[f].baseTexture,
27796
+ h[p].baseTexture,
27793
27797
  w
27794
27798
  ),
27795
- page: f
27799
+ page: p
27796
27800
  };
27797
27801
  }
27798
27802
  for (let u = 0; u < t.kerning.length; u++) {
27799
- let { first: d, second: f, amount: p } = t.kerning[u];
27800
- 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);
27801
27805
  }
27802
27806
  this.distanceFieldRange = a == null ? void 0 : a.distanceRange, this.distanceFieldType = ((c = a == null ? void 0 : a.fieldType) == null ? void 0 : c.toLowerCase()) ?? "none";
27803
27807
  }
@@ -27891,17 +27895,17 @@ const dr = class Fe {
27891
27895
  textureWidth: a,
27892
27896
  textureHeight: l,
27893
27897
  ...h
27894
- } = Object.assign({}, Fe.defaultOptions, i), c = vw(s), u = e instanceof Ar ? e : new Ar(e), d = a, f = new kn();
27895
- 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] = {
27896
27900
  face: u.fontFamily,
27897
27901
  size: u.fontSize
27898
- }, f.common[0] = {
27902
+ }, p.common[0] = {
27899
27903
  lineHeight: u.fontSize
27900
27904
  };
27901
- let p = 0, m = 0, _, y, x, g = 0;
27905
+ let f = 0, m = 0, _, y, x, g = 0;
27902
27906
  const v = [];
27903
27907
  for (let I = 0; I < c.length; I++) {
27904
- _ || (_ = 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({
27905
27909
  id: v.length - 1,
27906
27910
  file: ""
27907
27911
  }));
@@ -27909,42 +27913,42 @@ const dr = class Fe {
27909
27913
  if (m >= l - S * o) {
27910
27914
  if (m === 0)
27911
27915
  throw new Error(`[BitmapFont] textureHeight ${l}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${A}')`);
27912
- --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;
27913
27917
  continue;
27914
27918
  }
27915
- if (g = Math.max(S + C.fontProperties.descent, g), P * o + p >= d) {
27916
- if (p === 0)
27919
+ if (g = Math.max(S + C.fontProperties.descent, g), P * o + f >= d) {
27920
+ if (f === 0)
27917
27921
  throw new Error(`[BitmapFont] textureWidth ${a}px is too small (fontFamily: '${u.fontFamily}', fontSize: ${u.fontSize}px, char: '${A}')`);
27918
- --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;
27919
27923
  continue;
27920
27924
  }
27921
- _w(_, y, C, p, m, o, u);
27925
+ _w(_, y, C, f, m, o, u);
27922
27926
  const E = pn(C.text);
27923
- f.char.push({
27927
+ p.char.push({
27924
27928
  id: E,
27925
27929
  page: v.length - 1,
27926
- x: p / o,
27930
+ x: f / o,
27927
27931
  y: m / o,
27928
27932
  width: P,
27929
27933
  height: S,
27930
27934
  xoffset: 0,
27931
27935
  yoffset: 0,
27932
27936
  xadvance: N - (u.dropShadow ? u.dropShadowDistance : 0) - (u.stroke ? u.strokeThickness : 0)
27933
- }), p += (P + 2 * n) * o, p = Math.ceil(p);
27937
+ }), f += (P + 2 * n) * o, f = Math.ceil(f);
27934
27938
  }
27935
27939
  if (!(i != null && i.skipKerning))
27936
27940
  for (let I = 0, A = c.length; I < A; I++) {
27937
27941
  const C = c[I];
27938
27942
  for (let N = 0; N < A; N++) {
27939
27943
  const S = c[N], P = y.measureText(C).width, E = y.measureText(S).width, b = y.measureText(C + S).width - (P + E);
27940
- b && f.kerning.push({
27944
+ b && p.kerning.push({
27941
27945
  first: pn(C),
27942
27946
  second: pn(S),
27943
27947
  amount: b
27944
27948
  });
27945
27949
  }
27946
27950
  }
27947
- const w = new Fe(f, v, !0);
27951
+ const w = new Fe(p, v, !0);
27948
27952
  return Fe.available[t] !== void 0 && Fe.uninstall(t), Fe.available[t] = w, w;
27949
27953
  }
27950
27954
  };
@@ -28066,12 +28070,12 @@ const Zc = [], Jc = [], Qc = [], ww = class Hf extends Ae {
28066
28070
  var P;
28067
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, `
28068
28072
  `) || " ", h = $f(l), c = this._maxWidth * t.size / e, u = t.distanceFieldType === "none" ? Zc : Jc;
28069
- 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;
28070
28074
  for (let E = 0; E < h.length; E++) {
28071
28075
  const b = h[E], B = pn(b);
28072
- if (/(?:\s)/.test(b) && (_ = E, y = f, v++), b === "\r" || b === `
28076
+ if (/(?:\s)/.test(b) && (_ = E, y = p, v++), b === "\r" || b === `
28073
28077
  `) {
28074
- 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;
28075
28079
  continue;
28076
28080
  }
28077
28081
  const O = t.chars[B];
@@ -28085,15 +28089,15 @@ const Zc = [], Jc = [], Qc = [], ww = class Hf extends Ae {
28085
28089
  prevSpaces: 0,
28086
28090
  position: new gt()
28087
28091
  };
28088
- 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);
28089
28093
  }
28090
28094
  const w = h[h.length - 1];
28091
28095
  w !== "\r" && w !== `
28092
- ` && (/(?:\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));
28093
28097
  const I = [];
28094
28098
  for (let E = 0; E <= m; E++) {
28095
28099
  let b = 0;
28096
- 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);
28097
28101
  }
28098
28102
  const A = n.length, C = {}, N = [], S = this._activePagesMeshData;
28099
28103
  u.push(...S);
@@ -28150,7 +28154,7 @@ const Zc = [], Jc = [], Qc = [], ww = class Hf extends Ae {
28150
28154
  const O = B * i, G = b.position.y * i, $ = b.texture, F = C[$.baseTexture.uid], Q = $.frame, R = $._uvs, U = F.index++;
28151
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;
28152
28156
  }
28153
- this._textWidth = p * i, this._textHeight = (s.y + t.lineHeight) * i;
28157
+ this._textWidth = f * i, this._textHeight = (s.y + t.lineHeight) * i;
28154
28158
  for (const E in C) {
28155
28159
  const b = C[E];
28156
28160
  if (this.anchor.x !== 0 || this.anchor.y !== 0) {
@@ -28174,9 +28178,9 @@ const Zc = [], Jc = [], Qc = [], ww = class Hf extends Ae {
28174
28178
  this._autoResolution && this._resolution !== t.resolution && (this._resolution = t.resolution, this.dirty = !0);
28175
28179
  const { distanceFieldRange: e, distanceFieldType: i, size: s } = fr.available[this._fontName];
28176
28180
  if (i !== "none") {
28177
- 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;
28178
- for (const p of this._activePagesMeshData)
28179
- 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;
28180
28184
  }
28181
28185
  super._render(t);
28182
28186
  }
@@ -28880,9 +28884,9 @@ const hl = (r) => {
28880
28884
  return r.viewport.getZoom(!0) * t / r.world.getContentFactor();
28881
28885
  }, tu = (r, t, e, i) => () => {
28882
28886
  const s = r.viewport.viewportToImageRectangle(r.viewport.getBounds(!0)), n = Xf(r);
28883
- (n !== ds || !yr) && (yr = !0, e.forEach(({ stroke: d, strokeWidth: f }) => {
28884
- const { lineStyle: p } = d.geometry.graphicsData[0];
28885
- 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());
28886
28890
  })), ds = n;
28887
28891
  const o = r.viewport.getFlip();
28888
28892
  let a = Math.PI * r.viewport.getRotation(!0) / 180;
@@ -28921,14 +28925,14 @@ const hl = (r) => {
28921
28925
  w && (s.delete(g), w.fill.destroy(), w.stroke.destroy(), l(w.annotation, v));
28922
28926
  }, d = (g, v) => {
28923
28927
  i.resize(g, v), i.render(e);
28924
- }, f = (g) => {
28928
+ }, p = (g) => {
28925
28929
  yr = !1;
28926
28930
  const { children: v } = e;
28927
28931
  s.forEach(({ fill: w, stroke: I, annotation: A }) => {
28928
28932
  const C = g ? n.has(A.id) || g(A) : !0;
28929
28933
  C && !v.includes(w) ? (e.addChild(w), e.addChild(I)) : !C && v.includes(w) && (e.removeChild(w), e.removeChild(I));
28930
28934
  }), i.render(e);
28931
- }, p = (g) => {
28935
+ }, f = (g) => {
28932
28936
  o !== g && (o && u(o, { selected: n.has(o) }), g && u(g, { selected: n.has(g), hovered: !0 }), o = g, i.render(e));
28933
28937
  }, m = (g) => {
28934
28938
  const v = g.selected.map((A) => A.id), w = v.filter((A) => !n.has(A)), I = [...n].filter((A) => !v.includes(A));
@@ -28959,8 +28963,8 @@ const hl = (r) => {
28959
28963
  redraw: tu(r, e, s, i),
28960
28964
  removeAnnotation: h,
28961
28965
  resize: d,
28962
- setFilter: f,
28963
- setHovered: p,
28966
+ setFilter: p,
28967
+ setHovered: f,
28964
28968
  setSelected: m,
28965
28969
  setStyle: _,
28966
28970
  setVisible: y,
@@ -28969,9 +28973,9 @@ const hl = (r) => {
28969
28973
  };
28970
28974
  function Dw(r, t, e) {
28971
28975
  let i, s, { filter: n } = t, { state: o } = t, { style: a } = t, { viewer: l } = t, { visible: h = !0 } = t;
28972
- const { store: c, hover: u, selection: d, viewport: f } = o;
28976
+ const { store: c, hover: u, selection: d, viewport: p } = o;
28973
28977
  ca(r, u, (I) => e(11, i = I)), ca(r, d, (I) => e(8, s = I));
28974
- const p = Vn();
28978
+ const f = Vn();
28975
28979
  let m, _;
28976
28980
  const y = (I) => {
28977
28981
  const A = new _i.Point(I.x, I.y), { x: C, y: N } = l.viewport.pointFromPixel(A);
@@ -28987,7 +28991,7 @@ function Dw(r, t, e) {
28987
28991
  const A = I.originalEvent, { x: C, y: N } = I.position, S = C - _.x, P = N - _.y;
28988
28992
  if (Math.sqrt(S * S + P * P) < 5) {
28989
28993
  const { x: b, y: B } = y(I.position), O = c.getAt(b, B);
28990
- O ? p("click", { originalEvent: A, annotation: O }) : p("click", { originalEvent: A });
28994
+ O ? f("click", { originalEvent: A, annotation: O }) : f("click", { originalEvent: A });
28991
28995
  }
28992
28996
  _ = void 0;
28993
28997
  };
@@ -29011,16 +29015,16 @@ function Dw(r, t, e) {
29011
29015
  const G = l.viewport.getBounds();
29012
29016
  w = l.viewport.viewportToImageRectangle(G);
29013
29017
  const { x: $, y: F, width: Q, height: R } = w, U = c.getIntersecting($, F, Q, R);
29014
- f.set(U.map((z) => z.id));
29018
+ p.set(U.map((z) => z.id));
29015
29019
  };
29016
29020
  l.addHandler("canvas-press", x), l.addHandler("canvas-release", v), l.addHandler("update-viewport", m.redraw), l.addHandler("animation-finish", P);
29017
29021
  const E = (G) => G.filter(($) => ir($)), b = (G) => ir(G.oldValue) && ir(G.newValue), B = (G) => {
29018
29022
  const { created: $, updated: F, deleted: Q } = G.changes;
29019
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) {
29020
29024
  const { x: R, y: U, width: z, height: et } = w, J = c.getIntersecting(R, U, z, et);
29021
- f.set(J.map((H) => H.id));
29025
+ p.set(J.map((H) => H.id));
29022
29026
  } else
29023
- f.set(c.all().map((R) => R.id));
29027
+ p.set(c.all().map((R) => R.id));
29024
29028
  m.redraw();
29025
29029
  };
29026
29030
  return c.observe(B), () => {
@@ -29081,8 +29085,8 @@ const Fl = (r, t) => t, Gw = (r) => {
29081
29085
  }, $w = {
29082
29086
  area: (r) => Math.PI * r.geometry.rx * r.geometry.ry,
29083
29087
  intersects: (r, t, e) => {
29084
- 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;
29085
- 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;
29086
29090
  }
29087
29091
  };
29088
29092
  Fl(Fi.ELLIPSE, $w);
@@ -29171,17 +29175,17 @@ function Vw(r) {
29171
29175
  let t, e, i, s, n, o, a, l, h, c, u, d = Pi(
29172
29176
  /*geom*/
29173
29177
  r[4].points
29174
- ), f = [];
29178
+ ), p = [];
29175
29179
  for (let m = 0; m < d.length; m += 1)
29176
- f[m] = iu(ru(r, d, m));
29177
- const p = (m) => dt(f[m], 1, 1, () => {
29178
- f[m] = null;
29180
+ p[m] = iu(ru(r, d, m));
29181
+ const f = (m) => dt(p[m], 1, 1, () => {
29182
+ p[m] = null;
29179
29183
  });
29180
29184
  return {
29181
29185
  c() {
29182
29186
  t = Et("polygon"), s = ve(), n = Et("polygon"), a = ve();
29183
- for (let m = 0; m < f.length; m += 1)
29184
- f[m].c();
29187
+ for (let m = 0; m < p.length; m += 1)
29188
+ p[m].c();
29185
29189
  l = cr(), M(t, "class", "a9s-outer"), M(t, "style", e = /*computedStyle*/
29186
29190
  r[1] ? "display:none;" : void 0), M(t, "points", i = /*geom*/
29187
29191
  r[4].points.map(su).join(" ")), M(n, "class", "a9s-inner a9s-shape-handle"), M(
@@ -29194,8 +29198,8 @@ function Vw(r) {
29194
29198
  },
29195
29199
  m(m, _) {
29196
29200
  pt(m, t, _), pt(m, s, _), pt(m, n, _), pt(m, a, _);
29197
- for (let y = 0; y < f.length; y += 1)
29198
- f[y] && f[y].m(m, _);
29201
+ for (let y = 0; y < p.length; y += 1)
29202
+ p[y] && p[y].m(m, _);
29199
29203
  pt(m, l, _), h = !0, c || (u = [
29200
29204
  zt(t, "pointerdown", function() {
29201
29205
  jt(
@@ -29233,28 +29237,28 @@ function Vw(r) {
29233
29237
  let y;
29234
29238
  for (y = 0; y < d.length; y += 1) {
29235
29239
  const x = ru(r, d, y);
29236
- 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));
29237
29241
  }
29238
- for (We(), y = d.length; y < f.length; y += 1)
29239
- p(y);
29242
+ for (We(), y = d.length; y < p.length; y += 1)
29243
+ f(y);
29240
29244
  je();
29241
29245
  }
29242
29246
  },
29243
29247
  i(m) {
29244
29248
  if (!h) {
29245
29249
  for (let _ = 0; _ < d.length; _ += 1)
29246
- nt(f[_]);
29250
+ nt(p[_]);
29247
29251
  h = !0;
29248
29252
  }
29249
29253
  },
29250
29254
  o(m) {
29251
- f = f.filter(Boolean);
29252
- for (let _ = 0; _ < f.length; _ += 1)
29253
- dt(f[_]);
29255
+ p = p.filter(Boolean);
29256
+ for (let _ = 0; _ < p.length; _ += 1)
29257
+ dt(p[_]);
29254
29258
  h = !1;
29255
29259
  },
29256
29260
  d(m) {
29257
- 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);
29258
29262
  }
29259
29263
  };
29260
29264
  }
@@ -29325,10 +29329,10 @@ function zw(r) {
29325
29329
  const su = (r) => r.join(","), nu = (r) => r.join(",");
29326
29330
  function Ww(r, t, e) {
29327
29331
  let i, { shape: s } = t, { computedStyle: n } = t, { transform: o } = t, { viewportScale: a = 1 } = t;
29328
- const l = (d, f, p) => {
29332
+ const l = (d, p, f) => {
29329
29333
  let m;
29330
29334
  const _ = d.geometry;
29331
- 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]);
29332
29336
  const y = Gw(m);
29333
29337
  return { ...d, geometry: { points: m, bounds: y } };
29334
29338
  };
@@ -29579,20 +29583,20 @@ function Zw(r) {
29579
29583
  }
29580
29584
  function Jw(r, t, e) {
29581
29585
  let i, { x: s } = t, { y: n } = t, { scale: o } = t, { radius: a = 30 } = t, l = !1;
29582
- const h = (p) => {
29583
- p.pointerType === "touch" && e(4, l = !0);
29586
+ const h = (f) => {
29587
+ f.pointerType === "touch" && e(4, l = !0);
29584
29588
  }, c = () => e(4, l = !1);
29585
- function u(p) {
29586
- nr.call(this, r, p);
29589
+ function u(f) {
29590
+ nr.call(this, r, f);
29587
29591
  }
29588
- function d(p) {
29589
- nr.call(this, r, p);
29592
+ function d(f) {
29593
+ nr.call(this, r, f);
29590
29594
  }
29591
- function f(p) {
29592
- nr.call(this, r, p);
29595
+ function p(f) {
29596
+ nr.call(this, r, f);
29593
29597
  }
29594
- return r.$$set = (p) => {
29595
- 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);
29596
29600
  }, r.$$.update = () => {
29597
29601
  r.$$.dirty & /*scale*/
29598
29602
  4 && e(5, i = 10 / o);
@@ -29608,7 +29612,7 @@ function Jw(r, t, e) {
29608
29612
  t,
29609
29613
  u,
29610
29614
  d,
29611
- f
29615
+ p
29612
29616
  ];
29613
29617
  }
29614
29618
  class ss extends ae {
@@ -29617,7 +29621,7 @@ class ss extends ae {
29617
29621
  }
29618
29622
  }
29619
29623
  function Qw(r) {
29620
- 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;
29621
29625
  return F = new ss({
29622
29626
  props: {
29623
29627
  class: "a9s-corner-handle-topleft",
@@ -29708,7 +29712,7 @@ function Qw(r) {
29708
29712
  ) && r[9]("BOTTOM_LEFT").apply(this, arguments);
29709
29713
  }), {
29710
29714
  c() {
29711
- 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*/
29712
29716
  r[1] ? "display:none;" : void 0), M(t, "x", i = /*geom*/
29713
29717
  r[4].x), M(t, "y", s = /*geom*/
29714
29718
  r[4].y), M(t, "width", n = /*geom*/
@@ -29722,9 +29726,9 @@ function Qw(r) {
29722
29726
  r[4].x), M(l, "y", c = /*geom*/
29723
29727
  r[4].y), M(l, "width", u = /*geom*/
29724
29728
  r[4].w), M(l, "height", d = /*geom*/
29725
- r[4].h), M(p, "class", "a9s-edge-handle a9s-edge-handle-top"), M(p, "x", m = /*geom*/
29726
- r[4].x), M(p, "y", _ = /*geom*/
29727
- 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*/
29728
29732
  r[4].w), M(g, "class", "a9s-edge-handle a9s-edge-handle-right"), M(g, "x", v = /*geom*/
29729
29733
  r[4].x + /*geom*/
29730
29734
  r[4].w), M(g, "y", w = /*geom*/
@@ -29739,7 +29743,7 @@ function Qw(r) {
29739
29743
  r[4].h), M(b, "width", 1);
29740
29744
  },
29741
29745
  m(L, D) {
29742
- 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 = [
29743
29747
  zt(t, "pointerdown", function() {
29744
29748
  jt(
29745
29749
  /*grab*/
@@ -29752,7 +29756,7 @@ function Qw(r) {
29752
29756
  r[9]("SHAPE")
29753
29757
  ) && r[9]("SHAPE").apply(this, arguments);
29754
29758
  }),
29755
- zt(p, "pointerdown", function() {
29759
+ zt(f, "pointerdown", function() {
29756
29760
  jt(
29757
29761
  /*grab*/
29758
29762
  r[9]("TOP")
@@ -29805,11 +29809,11 @@ function Qw(r) {
29805
29809
  16 && d !== (d = /*geom*/
29806
29810
  r[4].h)) && M(l, "height", d), (!H || D & /*geom*/
29807
29811
  16 && m !== (m = /*geom*/
29808
- r[4].x)) && M(p, "x", m), (!H || D & /*geom*/
29812
+ r[4].x)) && M(f, "x", m), (!H || D & /*geom*/
29809
29813
  16 && _ !== (_ = /*geom*/
29810
- r[4].y)) && M(p, "y", _), (!H || D & /*geom*/
29814
+ r[4].y)) && M(f, "y", _), (!H || D & /*geom*/
29811
29815
  16 && y !== (y = /*geom*/
29812
- r[4].w)) && M(p, "width", y), (!H || D & /*geom*/
29816
+ r[4].w)) && M(f, "width", y), (!H || D & /*geom*/
29813
29817
  16 && v !== (v = /*geom*/
29814
29818
  r[4].x + /*geom*/
29815
29819
  r[4].w)) && M(g, "x", v), (!H || D & /*geom*/
@@ -29874,7 +29878,7 @@ function Qw(r) {
29874
29878
  dt(F.$$.fragment, L), dt(R.$$.fragment, L), dt(z.$$.fragment, L), dt(J.$$.fragment, L), H = !1;
29875
29879
  },
29876
29880
  d(L) {
29877
- 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);
29878
29882
  }
29879
29883
  };
29880
29884
  }
@@ -29944,14 +29948,14 @@ function tE(r) {
29944
29948
  }
29945
29949
  function eE(r, t, e) {
29946
29950
  let i, { shape: s } = t, { computedStyle: n } = t, { transform: o } = t, { viewportScale: a = 1 } = t;
29947
- const l = (d, f, p) => {
29951
+ const l = (d, p, f) => {
29948
29952
  const m = d.geometry.bounds;
29949
29953
  let [_, y] = [m.minX, m.minY], [x, g] = [m.maxX, m.maxY];
29950
- const [v, w] = p;
29951
- if (f === "SHAPE")
29954
+ const [v, w] = f;
29955
+ if (p === "SHAPE")
29952
29956
  _ += v, x += v, y += w, g += w;
29953
29957
  else {
29954
- switch (f) {
29958
+ switch (p) {
29955
29959
  case "TOP":
29956
29960
  case "TOP_LEFT":
29957
29961
  case "TOP_RIGHT": {
@@ -29965,7 +29969,7 @@ function eE(r, t, e) {
29965
29969
  break;
29966
29970
  }
29967
29971
  }
29968
- switch (f) {
29972
+ switch (p) {
29969
29973
  case "LEFT":
29970
29974
  case "TOP_LEFT":
29971
29975
  case "BOTTOM_LEFT": {
@@ -30108,17 +30112,17 @@ function nE(r, t, e) {
30108
30112
  let { shape: o } = t, { editor: a } = t, { transform: l } = t, h, c, u;
30109
30113
  const d = (m) => (_) => {
30110
30114
  h = m, c = l.elementToImage(_.offsetX, _.offsetY), u = o, _.target.setPointerCapture(_.pointerId), n("grab", _);
30111
- }, f = (m) => {
30115
+ }, p = (m) => {
30112
30116
  if (h) {
30113
30117
  const [_, y] = l.elementToImage(m.offsetX, m.offsetY), x = [_ - c[0], y - c[1]];
30114
30118
  e(3, o = a(u, h, x)), n("change", o);
30115
30119
  }
30116
- }, p = (m) => {
30120
+ }, f = (m) => {
30117
30121
  m.target.releasePointerCapture(m.pointerId), h = void 0, u = o, n("release", m);
30118
30122
  };
30119
30123
  return r.$$set = (m) => {
30120
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);
30121
- }, [d, f, p, o, a, l, s, i];
30125
+ }, [d, p, f, o, a, l, s, i];
30122
30126
  }
30123
30127
  class Vf extends ae {
30124
30128
  constructor(t) {
@@ -30253,8 +30257,8 @@ function uE(r, t, e) {
30253
30257
  const l = () => {
30254
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);
30255
30259
  u && (d.x = h - d.x);
30256
- const f = c * h / n.world.getContentFactor(), p = u ? -f : f, m = n.viewport.getRotation(!0);
30257
- 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());
30258
30262
  };
30259
30263
  return Xn(() => (n.addHandler("update-viewport", l), () => {
30260
30264
  n.removeHandler("update-viewport", l);
@@ -30271,14 +30275,14 @@ function dE(r, t, e) {
30271
30275
  const i = Vn();
30272
30276
  let { drawingMode: s } = t, { target: n } = t, { tool: o } = t, { transform: a } = t, { viewer: l } = t, { viewportScale: h } = t, c;
30273
30277
  return Xn(() => {
30274
- const u = n.closest("svg"), d = [], f = (p, m, _) => {
30275
- 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") {
30276
30280
  const y = (g) => {
30277
30281
  const { originalEvent: v } = g;
30278
30282
  m(v);
30279
- }, x = p === "pointerup" ? "canvas-click" : "canvas-double-click";
30283
+ }, x = f === "pointerup" ? "canvas-click" : "canvas-double-click";
30280
30284
  l.addHandler(x, y), d.push(() => l.removeHandler(x, y));
30281
- } else if (p === "pointermove") {
30285
+ } else if (f === "pointermove") {
30282
30286
  const y = (x) => {
30283
30287
  const { originalEvent: g } = x;
30284
30288
  m(g);
@@ -30289,13 +30293,13 @@ function dE(r, t, e) {
30289
30293
  return e(6, c = new o({
30290
30294
  target: n,
30291
30295
  props: {
30292
- addEventListener: f,
30296
+ addEventListener: p,
30293
30297
  drawingMode: s,
30294
30298
  transform: a,
30295
30299
  viewportScale: h
30296
30300
  }
30297
- })), c.$on("create", (p) => i("create", p.detail)), () => {
30298
- d.forEach((p) => p()), c.$destroy();
30301
+ })), c.$on("create", (f) => i("create", f.detail)), () => {
30302
+ d.forEach((f) => f()), c.$destroy();
30299
30303
  };
30300
30304
  }), r.$$set = (u) => {
30301
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);
@@ -30727,7 +30731,7 @@ function yE(r) {
30727
30731
  };
30728
30732
  }
30729
30733
  function _E(r, t, e) {
30730
- 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;
30731
30735
  const m = () => d, _ = () => a, y = navigator.userAgent.match(/firefox|fxios/i);
30732
30736
  let x;
30733
30737
  const { store: g, selection: v, hover: w } = c;
@@ -30741,30 +30745,30 @@ function _E(r, t, e) {
30741
30745
  const { updated: U } = R.changes;
30742
30746
  e(6, A = (U || []).map((z) => z.newValue));
30743
30747
  }, g.observe(I, { annotations: Q }), y) {
30744
- const { width: R } = p.viewport.viewerElementToViewportRectangle(new _i.Rect(0, 0, 1, 1));
30745
- 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));
30746
30750
  }
30747
30751
  } else
30748
30752
  e(6, A = void 0);
30749
30753
  }, S = (F, Q) => {
30750
- 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));
30751
30755
  return [R, U];
30752
30756
  }, P = (F) => {
30753
- p.setMouseNavEnabled(!1), C = F.timeStamp;
30757
+ f.setMouseNavEnabled(!1), C = F.timeStamp;
30754
30758
  }, E = (F) => {
30755
- if (p.setMouseNavEnabled(!0), performance.now() - (C || 0) < 300) {
30759
+ if (f.setMouseNavEnabled(!0), performance.now() - (C || 0) < 300) {
30756
30760
  const { offsetX: R, offsetY: U } = F.detail, [z, et] = S(R, U), J = g.getAt(z, et);
30757
30761
  J && (!l || l(J)) && !A.find((X) => X.id === J.id) && (w.set(J.id), v.setSelected(J.id));
30758
30762
  }
30759
30763
  }, b = (F) => (Q) => {
30760
30764
  var et;
30761
- 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;
30762
30766
  g.updateTarget({
30763
30767
  ...R,
30764
30768
  selector: Q.detail,
30765
30769
  created: z ? R.created : /* @__PURE__ */ new Date(),
30766
30770
  updated: z ? /* @__PURE__ */ new Date() : void 0,
30767
- updatedBy: z ? f : void 0
30771
+ updatedBy: z ? p : void 0
30768
30772
  });
30769
30773
  }, B = (F) => {
30770
30774
  const Q = kw(), R = {
@@ -30773,11 +30777,11 @@ function _E(r, t, e) {
30773
30777
  target: {
30774
30778
  annotation: Q,
30775
30779
  selector: F.detail,
30776
- creator: f,
30780
+ creator: p,
30777
30781
  created: /* @__PURE__ */ new Date()
30778
30782
  }
30779
30783
  };
30780
- g.addAnnotation(R), v.setSelected(R.id), p.setMouseNavEnabled(!0);
30784
+ g.addAnnotation(R), v.setSelected(R.id), f.setMouseNavEnabled(!0);
30781
30785
  }, O = (F) => Du(F), G = (F) => ir(F);
30782
30786
  function $(F) {
30783
30787
  xn[F ? "unshift" : "push"](() => {
@@ -30785,20 +30789,20 @@ function _E(r, t, e) {
30785
30789
  });
30786
30790
  }
30787
30791
  return r.$$set = (F) => {
30788
- "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);
30789
30793
  }, r.$$.update = () => {
30790
30794
  r.$$.dirty[0] & /*toolName*/
30791
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*/
30792
30796
  2162688 && e(4, n = (s == null ? void 0 : s.drawingMode) || h), r.$$.dirty[0] & /*drawingEnabled, drawingMode, viewer*/
30793
- 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*/
30794
30798
  1 && a && v.clear(), r.$$.dirty[0] & /*$selection, drawingMode, drawingEnabled, viewer*/
30795
- 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*/
30796
30800
  4194304 && N(o.selected);
30797
30801
  }, [
30798
30802
  a,
30799
30803
  u,
30800
30804
  d,
30801
- p,
30805
+ f,
30802
30806
  n,
30803
30807
  x,
30804
30808
  A,
@@ -30813,7 +30817,7 @@ function _E(r, t, e) {
30813
30817
  l,
30814
30818
  h,
30815
30819
  c,
30816
- f,
30820
+ p,
30817
30821
  m,
30818
30822
  _,
30819
30823
  s,
@@ -30877,49 +30881,49 @@ function xE(r) {
30877
30881
  r[1] - 5 / /*scale*/
30878
30882
  r[3]), M(a, "class", "svelte-1rehw2p"), M(t, "class", "a9s-presence-label");
30879
30883
  },
30880
- m(f, p) {
30881
- 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);
30882
30886
  },
30883
- p(f, [p]) {
30884
- p & /*x*/
30887
+ p(p, [f]) {
30888
+ f & /*x*/
30885
30889
  1 && M(
30886
30890
  e,
30887
30891
  "x",
30888
30892
  /*x*/
30889
- f[0]
30890
- ), p & /*y, scale*/
30893
+ p[0]
30894
+ ), f & /*y, scale*/
30891
30895
  10 && i !== (i = /*y*/
30892
- f[1] - 18 / /*scale*/
30893
- f[3]) && M(e, "y", i), p & /*scale*/
30896
+ p[1] - 18 / /*scale*/
30897
+ p[3]) && M(e, "y", i), f & /*scale*/
30894
30898
  8 && s !== (s = 18 / /*scale*/
30895
- f[3]) && M(e, "height", s), p & /*user*/
30899
+ p[3]) && M(e, "height", s), f & /*user*/
30896
30900
  4 && n !== (n = /*user*/
30897
- f[2].appearance.color) && M(e, "fill", n), p & /*user*/
30901
+ p[2].appearance.color) && M(e, "fill", n), f & /*user*/
30898
30902
  4 && o !== (o = /*user*/
30899
- f[2].appearance.color) && M(e, "stroke", o), p & /*user*/
30903
+ p[2].appearance.color) && M(e, "stroke", o), f & /*user*/
30900
30904
  4 && l !== (l = /*user*/
30901
- f[2].appearance.label + "") && zg(h, l), p & /*scale*/
30905
+ p[2].appearance.label + "") && zg(h, l), f & /*scale*/
30902
30906
  8 && c !== (c = 12 / /*scale*/
30903
- f[3]) && M(a, "font-size", c), p & /*x, scale*/
30907
+ p[3]) && M(a, "font-size", c), f & /*x, scale*/
30904
30908
  9 && u !== (u = /*x*/
30905
- f[0] + Math.round(5 / /*scale*/
30906
- 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*/
30907
30911
  10 && d !== (d = /*y*/
30908
- f[1] - 5 / /*scale*/
30909
- f[3]) && M(a, "y", d);
30912
+ p[1] - 5 / /*scale*/
30913
+ p[3]) && M(a, "y", d);
30910
30914
  },
30911
30915
  i: Xe,
30912
30916
  o: Xe,
30913
- d(f) {
30914
- f && ct(t), r[6](null);
30917
+ d(p) {
30918
+ p && ct(t), r[6](null);
30915
30919
  }
30916
30920
  };
30917
30921
  }
30918
30922
  function bE(r, t, e) {
30919
30923
  let { x: i } = t, { y: s } = t, { user: n } = t, { scale: o } = t, { hAlign: a = null } = t, l;
30920
30924
  const h = (u) => {
30921
- const d = l.querySelector("text"), f = l.querySelector("rect"), p = d.getBBox().width + 10 / u;
30922
- 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}`);
30923
30927
  };
30924
30928
  function c(u) {
30925
30929
  xn[u ? "unshift" : "push"](() => {
@@ -31001,8 +31005,8 @@ function EE(r, t, e) {
31001
31005
  let i, s, { annotation: n } = t, { user: o } = t, { scale: a } = t;
31002
31006
  const l = (h) => {
31003
31007
  let [c, ...u] = h.points;
31004
- return u.forEach(([d, f]) => {
31005
- f < c[1] && (c = [d, f]);
31008
+ return u.forEach(([d, p]) => {
31009
+ p < c[1] && (c = [d, p]);
31006
31010
  }), c;
31007
31011
  };
31008
31012
  return r.$$set = (h) => {
@@ -31400,8 +31404,8 @@ function DE(r, t, e) {
31400
31404
  selectedBy: h
31401
31405
  }))
31402
31406
  ].filter(({ annotation: u }) => (u || console.warn("Selection event on unknown annotation"), !!u))), a && i.unobserve(a), a = (u) => {
31403
- const { deleted: d, updated: f } = u.changes, p = new Set((d || []).map((_) => _.id)), m = o.filter(({ annotation: _ }) => !p.has(_.id)).map((_) => {
31404
- 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);
31405
31409
  return y ? {
31406
31410
  selectedBy: _.selectedBy,
31407
31411
  annotation: y.newValue
@@ -31443,7 +31447,7 @@ const _u = (r, t) => {
31443
31447
  const a = r.container.getBoundingClientRect(), { padding: l } = s;
31444
31448
  let [h, c, u, d] = l ? Array.isArray(l) ? l : [l, l, l, l] : [0, 0, 0, 0];
31445
31449
  h = h / a.height, c = c / a.width, u = u / a.height, d = d / a.width;
31446
- 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);
31447
31451
  r.viewport[e](A, s.immediately);
31448
31452
  }, FE = (r, t) => jf(r, t, "fitBounds"), LE = (r, t) => jf(r, t, "fitBoundsWithConstraints"), WE = (r, t = {}) => {
31449
31453
  const e = $u(t, {
@@ -31451,14 +31455,14 @@ const _u = (r, t) => {
31451
31455
  drawingMode: Mu ? "drag" : "click",
31452
31456
  userSelectAction: vu.EDIT,
31453
31457
  theme: "light"
31454
- }), i = ku(e), { hover: s, selection: n, store: o } = i, a = cp(o), l = up(
31458
+ }), i = ku(e), { hover: s, selection: n, store: o } = i, a = cp(o, e.initialHistory), l = up(
31455
31459
  i,
31456
31460
  a,
31457
31461
  e.adapter,
31458
31462
  e.autoSave
31459
31463
  );
31460
31464
  let h = vp(), c = e.drawingEnabled, u = e.drawingMode, d = e.modalSelect;
31461
- const f = Hu(a, r.element), p = new Ow({
31465
+ const p = Hu(a, r.element), f = new Ow({
31462
31466
  target: r.element,
31463
31467
  props: {
31464
31468
  state: i,
@@ -31485,7 +31489,7 @@ const _u = (r, t) => {
31485
31489
  viewer: r
31486
31490
  }
31487
31491
  });
31488
- p.$on("click", (R) => {
31492
+ f.$on("click", (R) => {
31489
31493
  const { originalEvent: U, annotation: z } = R.detail;
31490
31494
  d ? n.isEmpty() && z && n.userSelect(z.id, U) : z && !(u === "click" && c) ? n.userSelect(z.id, U) : n.isEmpty() || n.clear();
31491
31495
  }), r.element.addEventListener("pointerdown", (R) => {
@@ -31497,7 +31501,7 @@ const _u = (r, t) => {
31497
31501
  const y = fp(i, a, e.adapter), x = () => {
31498
31502
  _.$set({ drawingEnabled: !1 }), setTimeout(() => _.$set({ drawingEnabled: !0 }), 1);
31499
31503
  }, g = () => {
31500
- p.$destroy(), m.$destroy(), _.$destroy(), f.destroy(), a.destroy();
31504
+ f.$destroy(), m.$destroy(), _.$destroy(), p.destroy(), a.destroy();
31501
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) => {
31502
31506
  if (!Hn(R))
31503
31507
  throw `No drawing tool named ${R}`;
@@ -31505,11 +31509,11 @@ const _u = (r, t) => {
31505
31509
  }, E = (R) => {
31506
31510
  c = R, _.$set({ drawingEnabled: c });
31507
31511
  }, b = (R) => {
31508
- p.$set({ filter: R }), _.$set({ filter: R });
31512
+ f.$set({ filter: R }), _.$set({ filter: R });
31509
31513
  }, B = (R) => {
31510
31514
  d = R;
31511
31515
  }, O = (R) => {
31512
- p.$set({ style: R }), _.$set({ style: R });
31516
+ f.$set({ style: R }), _.$set({ style: R });
31513
31517
  }, G = (R) => (
31514
31518
  // @ts-ignore
31515
31519
  m.$set({ provider: R })
@@ -31517,7 +31521,7 @@ const _u = (r, t) => {
31517
31521
  h = R, _.$set({ user: R });
31518
31522
  }, Q = (R) => (
31519
31523
  // @ts-ignore
31520
- p.$set({ visible: R })
31524
+ f.$set({ visible: R })
31521
31525
  );
31522
31526
  return {
31523
31527
  ...y,