@mlightcad/mtext-renderer 0.12.9 → 0.12.11

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.
@@ -10,10 +10,10 @@ var ct;
10
10
  (function(n) {
11
11
  n[n.DEFAULT = 0] = "DEFAULT", n[n.LEFT = 1] = "LEFT", n[n.RIGHT = 2] = "RIGHT", n[n.CENTER = 3] = "CENTER", n[n.JUSTIFIED = 4] = "JUSTIFIED", n[n.DISTRIBUTED = 5] = "DISTRIBUTED";
12
12
  })(ct || (ct = {}));
13
- var Ve;
13
+ var We;
14
14
  (function(n) {
15
15
  n[n.NONE = 0] = "NONE", n[n.UNDERLINE = 1] = "UNDERLINE", n[n.OVERLINE = 2] = "OVERLINE", n[n.STRIKE_THROUGH = 4] = "STRIKE_THROUGH";
16
- })(Ve || (Ve = {}));
16
+ })(We || (We = {}));
17
17
  const $l = {
18
18
  c: "Ø",
19
19
  d: "°",
@@ -890,7 +890,7 @@ class Vi {
890
890
  return t;
891
891
  }
892
892
  }
893
- class ve {
893
+ class Se {
894
894
  /**
895
895
  * Create a new MTextColor instance.
896
896
  * @param color The initial color: number for ACI, [r,g,b] for RGB, or null/undefined for default (ACI=256).
@@ -966,7 +966,7 @@ class ve {
966
966
  * @returns A new MTextColor instance with the same color state.
967
967
  */
968
968
  copy() {
969
- const t = new ve();
969
+ const t = new Se();
970
970
  return t._aci = this._aci, t._rgbValue = this._rgbValue, t;
971
971
  }
972
972
  /**
@@ -991,7 +991,7 @@ class ve {
991
991
  const e = tu(t);
992
992
  if (e === null)
993
993
  return null;
994
- const s = new ve();
994
+ const s = new Se();
995
995
  return s.rgbValue = e, s;
996
996
  }
997
997
  /**
@@ -1005,7 +1005,7 @@ class ve {
1005
1005
  }
1006
1006
  class vs {
1007
1007
  constructor() {
1008
- this._stroke = 0, this.continueStroke = !1, this.color = new ve(), this.align = Ye.BOTTOM, this.fontFace = { family: "", style: "Regular", weight: 400 }, this._capHeight = { value: 1, isRelative: !1 }, this._widthFactor = { value: 1, isRelative: !1 }, this._charTrackingFactor = { value: 1, isRelative: !1 }, this.oblique = 0, this.paragraph = {
1008
+ this._stroke = 0, this.continueStroke = !1, this.color = new Se(), this.align = Ye.BOTTOM, this.fontFace = { family: "", style: "Regular", weight: 400 }, this._capHeight = { value: 1, isRelative: !1 }, this._widthFactor = { value: 1, isRelative: !1 }, this._charTrackingFactor = { value: 1, isRelative: !1 }, this.oblique = 0, this.paragraph = {
1009
1009
  indent: 0,
1010
1010
  left: 0,
1011
1011
  right: 0,
@@ -1121,40 +1121,40 @@ class vs {
1121
1121
  * Get whether text is underlined
1122
1122
  */
1123
1123
  get underline() {
1124
- return !!(this._stroke & Ve.UNDERLINE);
1124
+ return !!(this._stroke & We.UNDERLINE);
1125
1125
  }
1126
1126
  /**
1127
1127
  * Set whether text is underlined
1128
1128
  * @param value - Whether to underline
1129
1129
  */
1130
1130
  set underline(t) {
1131
- this._setStrokeState(Ve.UNDERLINE, t);
1131
+ this._setStrokeState(We.UNDERLINE, t);
1132
1132
  }
1133
1133
  /**
1134
1134
  * Get whether text has strike-through
1135
1135
  */
1136
1136
  get strikeThrough() {
1137
- return !!(this._stroke & Ve.STRIKE_THROUGH);
1137
+ return !!(this._stroke & We.STRIKE_THROUGH);
1138
1138
  }
1139
1139
  /**
1140
1140
  * Set whether text has strike-through
1141
1141
  * @param value - Whether to strike through
1142
1142
  */
1143
1143
  set strikeThrough(t) {
1144
- this._setStrokeState(Ve.STRIKE_THROUGH, t);
1144
+ this._setStrokeState(We.STRIKE_THROUGH, t);
1145
1145
  }
1146
1146
  /**
1147
1147
  * Get whether text has overline
1148
1148
  */
1149
1149
  get overline() {
1150
- return !!(this._stroke & Ve.OVERLINE);
1150
+ return !!(this._stroke & We.OVERLINE);
1151
1151
  }
1152
1152
  /**
1153
1153
  * Set whether text has overline
1154
1154
  * @param value - Whether to overline
1155
1155
  */
1156
1156
  set overline(t) {
1157
- this._setStrokeState(Ve.OVERLINE, t);
1157
+ this._setStrokeState(We.OVERLINE, t);
1158
1158
  }
1159
1159
  /**
1160
1160
  * Check if any stroke formatting is active
@@ -1195,7 +1195,7 @@ class Wi {
1195
1195
  * Copyright 2010-2024 Three.js Authors
1196
1196
  * SPDX-License-Identifier: MIT
1197
1197
  */
1198
- const hh = "172", Vr = 0, iu = 1, za = 1, Ha = 100, Ga = 204, Va = 205, Wa = 3, ru = 0, lh = 300, qa = 1e3, Os = 1001, ja = 1002, au = 1006, ou = 1008, cu = 1009, hu = 1015, lu = 1023, uh = "", re = "srgb", Xa = "srgb-linear", Ya = "linear", qi = "srgb", bn = 7680, $a = 519, Za = 35044, _s = 2e3, Ja = 2001;
1198
+ const hh = "172", Vr = 0, iu = 1, za = 1, Ha = 100, Ga = 204, Va = 205, Wa = 3, ru = 0, lh = 300, qa = 1e3, Os = 1001, ja = 1002, au = 1006, ou = 1008, cu = 1009, hu = 1015, lu = 1023, uh = "", ae = "srgb", Xa = "srgb-linear", Ya = "linear", qi = "srgb", bn = 7680, $a = 519, Za = 35044, _s = 2e3, Ja = 2001;
1199
1199
  class Ii {
1200
1200
  addEventListener(t, e) {
1201
1201
  this._listeners === void 0 && (this._listeners = {});
@@ -1712,7 +1712,7 @@ function pu() {
1712
1712
  */
1713
1713
  spaces: {},
1714
1714
  convert: function(i, r, a) {
1715
- return this.enabled === !1 || r === a || !r || !a || (this.spaces[r].transfer === qi && (i.r = Be(i.r), i.g = Be(i.g), i.b = Be(i.b)), this.spaces[r].primaries !== this.spaces[a].primaries && (i.applyMatrix3(this.spaces[r].toXYZ), i.applyMatrix3(this.spaces[a].fromXYZ)), this.spaces[a].transfer === qi && (i.r = Rn(i.r), i.g = Rn(i.g), i.b = Rn(i.b))), i;
1715
+ return this.enabled === !1 || r === a || !r || !a || (this.spaces[r].transfer === qi && (i.r = Re(i.r), i.g = Re(i.g), i.b = Re(i.b)), this.spaces[r].primaries !== this.spaces[a].primaries && (i.applyMatrix3(this.spaces[r].toXYZ), i.applyMatrix3(this.spaces[a].fromXYZ)), this.spaces[a].transfer === qi && (i.r = Rn(i.r), i.g = Rn(i.g), i.b = Rn(i.b))), i;
1716
1716
  },
1717
1717
  fromWorkingColorSpace: function(i, r) {
1718
1718
  return this.convert(i, this.workingColorSpace, r);
@@ -1751,22 +1751,22 @@ function pu() {
1751
1751
  toXYZ: Qa,
1752
1752
  fromXYZ: to,
1753
1753
  luminanceCoefficients: e,
1754
- workingColorSpaceConfig: { unpackColorSpace: re },
1755
- outputColorSpaceConfig: { drawingBufferColorSpace: re }
1754
+ workingColorSpaceConfig: { unpackColorSpace: ae },
1755
+ outputColorSpaceConfig: { drawingBufferColorSpace: ae }
1756
1756
  },
1757
- [re]: {
1757
+ [ae]: {
1758
1758
  primaries: t,
1759
1759
  whitePoint: s,
1760
1760
  transfer: qi,
1761
1761
  toXYZ: Qa,
1762
1762
  fromXYZ: to,
1763
1763
  luminanceCoefficients: e,
1764
- outputColorSpaceConfig: { drawingBufferColorSpace: re }
1764
+ outputColorSpaceConfig: { drawingBufferColorSpace: ae }
1765
1765
  }
1766
1766
  }), n;
1767
1767
  }
1768
1768
  const ee = /* @__PURE__ */ pu();
1769
- function Be(n) {
1769
+ function Re(n) {
1770
1770
  return n < 0.04045 ? n * 0.0773993808 : Math.pow(n * 0.9478672986 + 0.0521327014, 2.4);
1771
1771
  }
1772
1772
  function Rn(n) {
@@ -1795,12 +1795,12 @@ class du {
1795
1795
  s.drawImage(t, 0, 0, t.width, t.height);
1796
1796
  const i = s.getImageData(0, 0, t.width, t.height), r = i.data;
1797
1797
  for (let a = 0; a < r.length; a++)
1798
- r[a] = Be(r[a] / 255) * 255;
1798
+ r[a] = Re(r[a] / 255) * 255;
1799
1799
  return s.putImageData(i, 0, 0), e;
1800
1800
  } else if (t.data) {
1801
1801
  const e = t.data.slice(0);
1802
1802
  for (let s = 0; s < e.length; s++)
1803
- e instanceof Uint8Array || e instanceof Uint8ClampedArray ? e[s] = Math.floor(Be(e[s] / 255) * 255) : e[s] = Be(e[s]);
1803
+ e instanceof Uint8Array || e instanceof Uint8ClampedArray ? e[s] = Math.floor(Re(e[s] / 255) * 255) : e[s] = Re(e[s]);
1804
1804
  return {
1805
1805
  data: e,
1806
1806
  width: t.width,
@@ -2727,37 +2727,37 @@ class At {
2727
2727
  intersectsTriangle(t) {
2728
2728
  if (this.isEmpty())
2729
2729
  return !1;
2730
- this.getCenter(Kn), Is.subVectors(this.max, Kn), Sn.subVectors(t.a, Kn), wn.subVectors(t.b, Kn), Cn.subVectors(t.c, Kn), De.subVectors(wn, Sn), Ue.subVectors(Cn, wn), nn.subVectors(Sn, Cn);
2730
+ this.getCenter(Kn), Is.subVectors(this.max, Kn), Sn.subVectors(t.a, Kn), wn.subVectors(t.b, Kn), Cn.subVectors(t.c, Kn), Ue.subVectors(wn, Sn), Pe.subVectors(Cn, wn), nn.subVectors(Sn, Cn);
2731
2731
  let e = [
2732
- 0,
2733
- -De.z,
2734
- De.y,
2735
2732
  0,
2736
2733
  -Ue.z,
2737
2734
  Ue.y,
2738
2735
  0,
2736
+ -Pe.z,
2737
+ Pe.y,
2738
+ 0,
2739
2739
  -nn.z,
2740
2740
  nn.y,
2741
- De.z,
2742
- 0,
2743
- -De.x,
2744
2741
  Ue.z,
2745
2742
  0,
2746
2743
  -Ue.x,
2744
+ Pe.z,
2745
+ 0,
2746
+ -Pe.x,
2747
2747
  nn.z,
2748
2748
  0,
2749
2749
  -nn.x,
2750
- -De.y,
2751
- De.x,
2752
- 0,
2753
2750
  -Ue.y,
2754
2751
  Ue.x,
2755
2752
  0,
2753
+ -Pe.y,
2754
+ Pe.x,
2755
+ 0,
2756
2756
  -nn.y,
2757
2757
  nn.x,
2758
2758
  0
2759
2759
  ];
2760
- return !Zi(e, Sn, wn, Cn, Is) || (e = [1, 0, 0, 0, 1, 0, 0, 0, 1], !Zi(e, Sn, wn, Cn, Is)) ? !1 : (Bs.crossVectors(De, Ue), e = [Bs.x, Bs.y, Bs.z], Zi(e, Sn, wn, Cn, Is));
2760
+ return !Zi(e, Sn, wn, Cn, Is) || (e = [1, 0, 0, 0, 1, 0, 0, 0, 1], !Zi(e, Sn, wn, Cn, Is)) ? !1 : (Bs.crossVectors(Ue, Pe), e = [Bs.x, Bs.y, Bs.z], Zi(e, Sn, wn, Cn, Is));
2761
2761
  }
2762
2762
  clampPoint(t, e) {
2763
2763
  return e.copy(t).clamp(this.min, this.max);
@@ -2775,7 +2775,7 @@ class At {
2775
2775
  return this.min.min(t.min), this.max.max(t.max), this;
2776
2776
  }
2777
2777
  applyMatrix4(t) {
2778
- return this.isEmpty() ? this : (Te[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t), Te[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t), Te[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t), Te[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t), Te[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t), Te[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t), Te[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t), Te[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t), this.setFromPoints(Te), this);
2778
+ return this.isEmpty() ? this : (Fe[0].set(this.min.x, this.min.y, this.min.z).applyMatrix4(t), Fe[1].set(this.min.x, this.min.y, this.max.z).applyMatrix4(t), Fe[2].set(this.min.x, this.max.y, this.min.z).applyMatrix4(t), Fe[3].set(this.min.x, this.max.y, this.max.z).applyMatrix4(t), Fe[4].set(this.max.x, this.min.y, this.min.z).applyMatrix4(t), Fe[5].set(this.max.x, this.min.y, this.max.z).applyMatrix4(t), Fe[6].set(this.max.x, this.max.y, this.min.z).applyMatrix4(t), Fe[7].set(this.max.x, this.max.y, this.max.z).applyMatrix4(t), this.setFromPoints(Fe), this);
2779
2779
  }
2780
2780
  translate(t) {
2781
2781
  return this.min.add(t), this.max.add(t), this;
@@ -2784,7 +2784,7 @@ class At {
2784
2784
  return t.min.equals(this.min) && t.max.equals(this.max);
2785
2785
  }
2786
2786
  }
2787
- const Te = [
2787
+ const Fe = [
2788
2788
  /* @__PURE__ */ new E(),
2789
2789
  /* @__PURE__ */ new E(),
2790
2790
  /* @__PURE__ */ new E(),
@@ -2793,7 +2793,7 @@ const Te = [
2793
2793
  /* @__PURE__ */ new E(),
2794
2794
  /* @__PURE__ */ new E(),
2795
2795
  /* @__PURE__ */ new E()
2796
- ], ne = /* @__PURE__ */ new E(), Ls = /* @__PURE__ */ new At(), Sn = /* @__PURE__ */ new E(), wn = /* @__PURE__ */ new E(), Cn = /* @__PURE__ */ new E(), De = /* @__PURE__ */ new E(), Ue = /* @__PURE__ */ new E(), nn = /* @__PURE__ */ new E(), Kn = /* @__PURE__ */ new E(), Is = /* @__PURE__ */ new E(), Bs = /* @__PURE__ */ new E(), sn = /* @__PURE__ */ new E();
2796
+ ], ne = /* @__PURE__ */ new E(), Ls = /* @__PURE__ */ new At(), Sn = /* @__PURE__ */ new E(), wn = /* @__PURE__ */ new E(), Cn = /* @__PURE__ */ new E(), Ue = /* @__PURE__ */ new E(), Pe = /* @__PURE__ */ new E(), nn = /* @__PURE__ */ new E(), Kn = /* @__PURE__ */ new E(), Is = /* @__PURE__ */ new E(), Bs = /* @__PURE__ */ new E(), sn = /* @__PURE__ */ new E();
2797
2797
  function Zi(n, t, e, s, i) {
2798
2798
  for (let r = 0, a = n.length - 3; r <= a; r += 3) {
2799
2799
  sn.fromArray(n, r);
@@ -2878,7 +2878,7 @@ class fa {
2878
2878
  return new this.constructor().copy(this);
2879
2879
  }
2880
2880
  }
2881
- const Fe = /* @__PURE__ */ new E(), Ki = /* @__PURE__ */ new E(), Rs = /* @__PURE__ */ new E(), Pe = /* @__PURE__ */ new E(), Qi = /* @__PURE__ */ new E(), Ds = /* @__PURE__ */ new E(), tr = /* @__PURE__ */ new E();
2881
+ const Ae = /* @__PURE__ */ new E(), Ki = /* @__PURE__ */ new E(), Rs = /* @__PURE__ */ new E(), Ne = /* @__PURE__ */ new E(), Qi = /* @__PURE__ */ new E(), Ds = /* @__PURE__ */ new E(), tr = /* @__PURE__ */ new E();
2882
2882
  class fh {
2883
2883
  constructor(t = new E(), e = new E(0, 0, -1)) {
2884
2884
  this.origin = t, this.direction = e;
@@ -2896,7 +2896,7 @@ class fh {
2896
2896
  return this.direction.copy(t).sub(this.origin).normalize(), this;
2897
2897
  }
2898
2898
  recast(t) {
2899
- return this.origin.copy(this.at(t, Fe)), this;
2899
+ return this.origin.copy(this.at(t, Ae)), this;
2900
2900
  }
2901
2901
  closestPointToPoint(t, e) {
2902
2902
  e.subVectors(t, this.origin);
@@ -2907,12 +2907,12 @@ class fh {
2907
2907
  return Math.sqrt(this.distanceSqToPoint(t));
2908
2908
  }
2909
2909
  distanceSqToPoint(t) {
2910
- const e = Fe.subVectors(t, this.origin).dot(this.direction);
2911
- return e < 0 ? this.origin.distanceToSquared(t) : (Fe.copy(this.origin).addScaledVector(this.direction, e), Fe.distanceToSquared(t));
2910
+ const e = Ae.subVectors(t, this.origin).dot(this.direction);
2911
+ return e < 0 ? this.origin.distanceToSquared(t) : (Ae.copy(this.origin).addScaledVector(this.direction, e), Ae.distanceToSquared(t));
2912
2912
  }
2913
2913
  distanceSqToSegment(t, e, s, i) {
2914
- Ki.copy(t).add(e).multiplyScalar(0.5), Rs.copy(e).sub(t).normalize(), Pe.copy(this.origin).sub(Ki);
2915
- const r = t.distanceTo(e) * 0.5, a = -this.direction.dot(Rs), o = Pe.dot(this.direction), c = -Pe.dot(Rs), h = Pe.lengthSq(), l = Math.abs(1 - a * a);
2914
+ Ki.copy(t).add(e).multiplyScalar(0.5), Rs.copy(e).sub(t).normalize(), Ne.copy(this.origin).sub(Ki);
2915
+ const r = t.distanceTo(e) * 0.5, a = -this.direction.dot(Rs), o = Ne.dot(this.direction), c = -Ne.dot(Rs), h = Ne.lengthSq(), l = Math.abs(1 - a * a);
2916
2916
  let u, f, p, d;
2917
2917
  if (l > 0)
2918
2918
  if (u = a * c - o, f = a * o - c, d = r * l, u >= 0)
@@ -2931,8 +2931,8 @@ class fh {
2931
2931
  return s && s.copy(this.origin).addScaledVector(this.direction, u), i && i.copy(Ki).addScaledVector(Rs, f), p;
2932
2932
  }
2933
2933
  intersectSphere(t, e) {
2934
- Fe.subVectors(t.center, this.origin);
2935
- const s = Fe.dot(this.direction), i = Fe.dot(Fe) - s * s, r = t.radius * t.radius;
2934
+ Ae.subVectors(t.center, this.origin);
2935
+ const s = Ae.dot(this.direction), i = Ae.dot(Ae) - s * s, r = t.radius * t.radius;
2936
2936
  if (i > r) return null;
2937
2937
  const a = Math.sqrt(r - i), o = s - a, c = s + a;
2938
2938
  return c < 0 ? null : o < 0 ? this.at(c, e) : this.at(o, e);
@@ -2961,7 +2961,7 @@ class fh {
2961
2961
  return h >= 0 ? (s = (t.min.x - f.x) * h, i = (t.max.x - f.x) * h) : (s = (t.max.x - f.x) * h, i = (t.min.x - f.x) * h), l >= 0 ? (r = (t.min.y - f.y) * l, a = (t.max.y - f.y) * l) : (r = (t.max.y - f.y) * l, a = (t.min.y - f.y) * l), s > a || r > i || ((r > s || isNaN(s)) && (s = r), (a < i || isNaN(i)) && (i = a), u >= 0 ? (o = (t.min.z - f.z) * u, c = (t.max.z - f.z) * u) : (o = (t.max.z - f.z) * u, c = (t.min.z - f.z) * u), s > c || o > i) || ((o > s || s !== s) && (s = o), (c < i || i !== i) && (i = c), i < 0) ? null : this.at(s >= 0 ? s : i, e);
2962
2962
  }
2963
2963
  intersectsBox(t) {
2964
- return this.intersectBox(t, Fe) !== null;
2964
+ return this.intersectBox(t, Ae) !== null;
2965
2965
  }
2966
2966
  intersectTriangle(t, e, s, i, r) {
2967
2967
  Qi.subVectors(e, t), Ds.subVectors(s, t), tr.crossVectors(Qi, Ds);
@@ -2973,14 +2973,14 @@ class fh {
2973
2973
  o = -1, a = -a;
2974
2974
  else
2975
2975
  return null;
2976
- Pe.subVectors(this.origin, t);
2977
- const c = o * this.direction.dot(Ds.crossVectors(Pe, Ds));
2976
+ Ne.subVectors(this.origin, t);
2977
+ const c = o * this.direction.dot(Ds.crossVectors(Ne, Ds));
2978
2978
  if (c < 0)
2979
2979
  return null;
2980
- const h = o * this.direction.dot(Qi.cross(Pe));
2980
+ const h = o * this.direction.dot(Qi.cross(Ne));
2981
2981
  if (h < 0 || c + h > a)
2982
2982
  return null;
2983
- const l = -o * Pe.dot(tr);
2983
+ const l = -o * Ne.dot(tr);
2984
2984
  return l < 0 ? null : this.at(l / a, r);
2985
2985
  }
2986
2986
  applyMatrix4(t) {
@@ -3125,7 +3125,7 @@ class mt {
3125
3125
  }
3126
3126
  lookAt(t, e, s) {
3127
3127
  const i = this.elements;
3128
- return Wt.subVectors(t, e), Wt.lengthSq() === 0 && (Wt.z = 1), Wt.normalize(), Ne.crossVectors(s, Wt), Ne.lengthSq() === 0 && (Math.abs(s.z) === 1 ? Wt.x += 1e-4 : Wt.z += 1e-4, Wt.normalize(), Ne.crossVectors(s, Wt)), Ne.normalize(), Us.crossVectors(Wt, Ne), i[0] = Ne.x, i[4] = Us.x, i[8] = Wt.x, i[1] = Ne.y, i[5] = Us.y, i[9] = Wt.y, i[2] = Ne.z, i[6] = Us.z, i[10] = Wt.z, this;
3128
+ return Wt.subVectors(t, e), Wt.lengthSq() === 0 && (Wt.z = 1), Wt.normalize(), ze.crossVectors(s, Wt), ze.lengthSq() === 0 && (Math.abs(s.z) === 1 ? Wt.x += 1e-4 : Wt.z += 1e-4, Wt.normalize(), ze.crossVectors(s, Wt)), ze.normalize(), Us.crossVectors(Wt, ze), i[0] = ze.x, i[4] = Us.x, i[8] = Wt.x, i[1] = ze.y, i[5] = Us.y, i[9] = Wt.y, i[2] = ze.z, i[6] = Us.z, i[10] = Wt.z, this;
3129
3129
  }
3130
3130
  multiply(t) {
3131
3131
  return this.multiplyMatrices(this, t);
@@ -3134,8 +3134,8 @@ class mt {
3134
3134
  return this.multiplyMatrices(t, this);
3135
3135
  }
3136
3136
  multiplyMatrices(t, e) {
3137
- const s = t.elements, i = e.elements, r = this.elements, a = s[0], o = s[4], c = s[8], h = s[12], l = s[1], u = s[5], f = s[9], p = s[13], d = s[2], g = s[6], x = s[10], b = s[14], S = s[3], v = s[7], w = s[11], F = s[15], M = i[0], O = i[4], I = i[8], H = i[12], R = i[1], W = i[5], J = i[9], D = i[13], U = i[2], P = i[6], Q = i[10], yt = i[14], Pt = i[3], Ct = i[7], ut = i[11], j = i[15];
3138
- return r[0] = a * M + o * R + c * U + h * Pt, r[4] = a * O + o * W + c * P + h * Ct, r[8] = a * I + o * J + c * Q + h * ut, r[12] = a * H + o * D + c * yt + h * j, r[1] = l * M + u * R + f * U + p * Pt, r[5] = l * O + u * W + f * P + p * Ct, r[9] = l * I + u * J + f * Q + p * ut, r[13] = l * H + u * D + f * yt + p * j, r[2] = d * M + g * R + x * U + b * Pt, r[6] = d * O + g * W + x * P + b * Ct, r[10] = d * I + g * J + x * Q + b * ut, r[14] = d * H + g * D + x * yt + b * j, r[3] = S * M + v * R + w * U + F * Pt, r[7] = S * O + v * W + w * P + F * Ct, r[11] = S * I + v * J + w * Q + F * ut, r[15] = S * H + v * D + w * yt + F * j, this;
3137
+ const s = t.elements, i = e.elements, r = this.elements, a = s[0], o = s[4], c = s[8], h = s[12], l = s[1], u = s[5], f = s[9], p = s[13], d = s[2], g = s[6], x = s[10], b = s[14], S = s[3], v = s[7], w = s[11], F = s[15], M = i[0], O = i[4], I = i[8], H = i[12], R = i[1], W = i[5], J = i[9], D = i[13], U = i[2], P = i[6], Q = i[10], yt = i[14], Pt = i[3], Tt = i[7], ut = i[11], j = i[15];
3138
+ return r[0] = a * M + o * R + c * U + h * Pt, r[4] = a * O + o * W + c * P + h * Tt, r[8] = a * I + o * J + c * Q + h * ut, r[12] = a * H + o * D + c * yt + h * j, r[1] = l * M + u * R + f * U + p * Pt, r[5] = l * O + u * W + f * P + p * Tt, r[9] = l * I + u * J + f * Q + p * ut, r[13] = l * H + u * D + f * yt + p * j, r[2] = d * M + g * R + x * U + b * Pt, r[6] = d * O + g * W + x * P + b * Tt, r[10] = d * I + g * J + x * Q + b * ut, r[14] = d * H + g * D + x * yt + b * j, r[3] = S * M + v * R + w * U + F * Pt, r[7] = S * O + v * W + w * P + F * Tt, r[11] = S * I + v * J + w * Q + F * ut, r[15] = S * H + v * D + w * yt + F * j, this;
3139
3139
  }
3140
3140
  multiplyScalar(t) {
3141
3141
  const e = this.elements;
@@ -3379,7 +3379,7 @@ class mt {
3379
3379
  return t[e] = s[0], t[e + 1] = s[1], t[e + 2] = s[2], t[e + 3] = s[3], t[e + 4] = s[4], t[e + 5] = s[5], t[e + 6] = s[6], t[e + 7] = s[7], t[e + 8] = s[8], t[e + 9] = s[9], t[e + 10] = s[10], t[e + 11] = s[11], t[e + 12] = s[12], t[e + 13] = s[13], t[e + 14] = s[14], t[e + 15] = s[15], t;
3380
3380
  }
3381
3381
  }
3382
- const Tn = /* @__PURE__ */ new E(), se = /* @__PURE__ */ new mt(), bu = /* @__PURE__ */ new E(0, 0, 0), vu = /* @__PURE__ */ new E(1, 1, 1), Ne = /* @__PURE__ */ new E(), Us = /* @__PURE__ */ new E(), Wt = /* @__PURE__ */ new E(), no = /* @__PURE__ */ new mt(), so = /* @__PURE__ */ new gn();
3382
+ const Tn = /* @__PURE__ */ new E(), se = /* @__PURE__ */ new mt(), bu = /* @__PURE__ */ new E(0, 0, 0), vu = /* @__PURE__ */ new E(1, 1, 1), ze = /* @__PURE__ */ new E(), Us = /* @__PURE__ */ new E(), Wt = /* @__PURE__ */ new E(), no = /* @__PURE__ */ new mt(), so = /* @__PURE__ */ new gn();
3383
3383
  class ws {
3384
3384
  constructor(t = 0, e = 0, s = 0, i = ws.DEFAULT_ORDER) {
3385
3385
  this.isEuler = !0, this._x = t, this._y = e, this._z = s, this._order = i;
@@ -3501,7 +3501,7 @@ class Su {
3501
3501
  }
3502
3502
  }
3503
3503
  let wu = 0;
3504
- const io = /* @__PURE__ */ new E(), Fn = /* @__PURE__ */ new gn(), Ae = /* @__PURE__ */ new mt(), Ps = /* @__PURE__ */ new E(), ts = /* @__PURE__ */ new E(), Cu = /* @__PURE__ */ new E(), Tu = /* @__PURE__ */ new gn(), ro = /* @__PURE__ */ new E(1, 0, 0), ao = /* @__PURE__ */ new E(0, 1, 0), oo = /* @__PURE__ */ new E(0, 0, 1), co = { type: "added" }, Fu = { type: "removed" }, An = { type: "childadded", child: null }, er = { type: "childremoved", child: null };
3504
+ const io = /* @__PURE__ */ new E(), Fn = /* @__PURE__ */ new gn(), ke = /* @__PURE__ */ new mt(), Ps = /* @__PURE__ */ new E(), ts = /* @__PURE__ */ new E(), Cu = /* @__PURE__ */ new E(), Tu = /* @__PURE__ */ new gn(), ro = /* @__PURE__ */ new E(1, 0, 0), ao = /* @__PURE__ */ new E(0, 1, 0), oo = /* @__PURE__ */ new E(0, 0, 1), co = { type: "added" }, Fu = { type: "removed" }, An = { type: "childadded", child: null }, er = { type: "childremoved", child: null };
3505
3505
  class Xt extends Ii {
3506
3506
  constructor() {
3507
3507
  super(), this.isObject3D = !0, Object.defineProperty(this, "id", { value: wu++ }), this.uuid = Yn(), this.name = "", this.type = "Object3D", this.parent = null, this.children = [], this.up = Xt.DEFAULT_UP.clone();
@@ -3598,12 +3598,12 @@ class Xt extends Ii {
3598
3598
  return this.updateWorldMatrix(!0, !1), t.applyMatrix4(this.matrixWorld);
3599
3599
  }
3600
3600
  worldToLocal(t) {
3601
- return this.updateWorldMatrix(!0, !1), t.applyMatrix4(Ae.copy(this.matrixWorld).invert());
3601
+ return this.updateWorldMatrix(!0, !1), t.applyMatrix4(ke.copy(this.matrixWorld).invert());
3602
3602
  }
3603
3603
  lookAt(t, e, s) {
3604
3604
  t.isVector3 ? Ps.copy(t) : Ps.set(t, e, s);
3605
3605
  const i = this.parent;
3606
- this.updateWorldMatrix(!0, !1), ts.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? Ae.lookAt(ts, Ps, this.up) : Ae.lookAt(Ps, ts, this.up), this.quaternion.setFromRotationMatrix(Ae), i && (Ae.extractRotation(i.matrixWorld), Fn.setFromRotationMatrix(Ae), this.quaternion.premultiply(Fn.invert()));
3606
+ this.updateWorldMatrix(!0, !1), ts.setFromMatrixPosition(this.matrixWorld), this.isCamera || this.isLight ? ke.lookAt(ts, Ps, this.up) : ke.lookAt(Ps, ts, this.up), this.quaternion.setFromRotationMatrix(ke), i && (ke.extractRotation(i.matrixWorld), Fn.setFromRotationMatrix(ke), this.quaternion.premultiply(Fn.invert()));
3607
3607
  }
3608
3608
  add(t) {
3609
3609
  if (arguments.length > 1) {
@@ -3630,7 +3630,7 @@ class Xt extends Ii {
3630
3630
  return this.remove(...this.children);
3631
3631
  }
3632
3632
  attach(t) {
3633
- return this.updateWorldMatrix(!0, !1), Ae.copy(this.matrixWorld).invert(), t.parent !== null && (t.parent.updateWorldMatrix(!0, !1), Ae.multiply(t.parent.matrixWorld)), t.applyMatrix4(Ae), t.removeFromParent(), t.parent = this, this.children.push(t), t.updateWorldMatrix(!1, !0), t.dispatchEvent(co), An.child = t, this.dispatchEvent(An), An.child = null, this;
3633
+ return this.updateWorldMatrix(!0, !1), ke.copy(this.matrixWorld).invert(), t.parent !== null && (t.parent.updateWorldMatrix(!0, !1), ke.multiply(t.parent.matrixWorld)), t.applyMatrix4(ke), t.removeFromParent(), t.parent = this, this.children.push(t), t.updateWorldMatrix(!1, !0), t.dispatchEvent(co), An.child = t, this.dispatchEvent(An), An.child = null, this;
3634
3634
  }
3635
3635
  getObjectById(t) {
3636
3636
  return this.getObjectByProperty("id", t);
@@ -3802,8 +3802,8 @@ class Xt extends Ii {
3802
3802
  Xt.DEFAULT_UP = /* @__PURE__ */ new E(0, 1, 0);
3803
3803
  Xt.DEFAULT_MATRIX_AUTO_UPDATE = !0;
3804
3804
  Xt.DEFAULT_MATRIX_WORLD_AUTO_UPDATE = !0;
3805
- const ie = /* @__PURE__ */ new E(), ke = /* @__PURE__ */ new E(), nr = /* @__PURE__ */ new E(), Ee = /* @__PURE__ */ new E(), kn = /* @__PURE__ */ new E(), En = /* @__PURE__ */ new E(), ho = /* @__PURE__ */ new E(), sr = /* @__PURE__ */ new E(), ir = /* @__PURE__ */ new E(), rr = /* @__PURE__ */ new E(), ar = /* @__PURE__ */ new Ss(), or = /* @__PURE__ */ new Ss(), cr = /* @__PURE__ */ new Ss();
3806
- class ce {
3805
+ const ie = /* @__PURE__ */ new E(), Ee = /* @__PURE__ */ new E(), nr = /* @__PURE__ */ new E(), Me = /* @__PURE__ */ new E(), kn = /* @__PURE__ */ new E(), En = /* @__PURE__ */ new E(), ho = /* @__PURE__ */ new E(), sr = /* @__PURE__ */ new E(), ir = /* @__PURE__ */ new E(), rr = /* @__PURE__ */ new E(), ar = /* @__PURE__ */ new Ss(), or = /* @__PURE__ */ new Ss(), cr = /* @__PURE__ */ new Ss();
3806
+ class he {
3807
3807
  constructor(t = new E(), e = new E(), s = new E()) {
3808
3808
  this.a = t, this.b = e, this.c = s;
3809
3809
  }
@@ -3815,24 +3815,24 @@ class ce {
3815
3815
  // static/instance method to calculate barycentric coordinates
3816
3816
  // based on: http://www.blackpawn.com/texts/pointinpoly/default.html
3817
3817
  static getBarycoord(t, e, s, i, r) {
3818
- ie.subVectors(i, e), ke.subVectors(s, e), nr.subVectors(t, e);
3819
- const a = ie.dot(ie), o = ie.dot(ke), c = ie.dot(nr), h = ke.dot(ke), l = ke.dot(nr), u = a * h - o * o;
3818
+ ie.subVectors(i, e), Ee.subVectors(s, e), nr.subVectors(t, e);
3819
+ const a = ie.dot(ie), o = ie.dot(Ee), c = ie.dot(nr), h = Ee.dot(Ee), l = Ee.dot(nr), u = a * h - o * o;
3820
3820
  if (u === 0)
3821
3821
  return r.set(0, 0, 0), null;
3822
3822
  const f = 1 / u, p = (h * c - o * l) * f, d = (a * l - o * c) * f;
3823
3823
  return r.set(1 - p - d, d, p);
3824
3824
  }
3825
3825
  static containsPoint(t, e, s, i) {
3826
- return this.getBarycoord(t, e, s, i, Ee) === null ? !1 : Ee.x >= 0 && Ee.y >= 0 && Ee.x + Ee.y <= 1;
3826
+ return this.getBarycoord(t, e, s, i, Me) === null ? !1 : Me.x >= 0 && Me.y >= 0 && Me.x + Me.y <= 1;
3827
3827
  }
3828
3828
  static getInterpolation(t, e, s, i, r, a, o, c) {
3829
- return this.getBarycoord(t, e, s, i, Ee) === null ? (c.x = 0, c.y = 0, "z" in c && (c.z = 0), "w" in c && (c.w = 0), null) : (c.setScalar(0), c.addScaledVector(r, Ee.x), c.addScaledVector(a, Ee.y), c.addScaledVector(o, Ee.z), c);
3829
+ return this.getBarycoord(t, e, s, i, Me) === null ? (c.x = 0, c.y = 0, "z" in c && (c.z = 0), "w" in c && (c.w = 0), null) : (c.setScalar(0), c.addScaledVector(r, Me.x), c.addScaledVector(a, Me.y), c.addScaledVector(o, Me.z), c);
3830
3830
  }
3831
3831
  static getInterpolatedAttribute(t, e, s, i, r, a) {
3832
3832
  return ar.setScalar(0), or.setScalar(0), cr.setScalar(0), ar.fromBufferAttribute(t, e), or.fromBufferAttribute(t, s), cr.fromBufferAttribute(t, i), a.setScalar(0), a.addScaledVector(ar, r.x), a.addScaledVector(or, r.y), a.addScaledVector(cr, r.z), a;
3833
3833
  }
3834
3834
  static isFrontFacing(t, e, s, i) {
3835
- return ie.subVectors(s, e), ke.subVectors(t, e), ie.cross(ke).dot(i) < 0;
3835
+ return ie.subVectors(s, e), Ee.subVectors(t, e), ie.cross(Ee).dot(i) < 0;
3836
3836
  }
3837
3837
  set(t, e, s) {
3838
3838
  return this.a.copy(t), this.b.copy(e), this.c.copy(s), this;
@@ -3850,28 +3850,28 @@ class ce {
3850
3850
  return this.a.copy(t.a), this.b.copy(t.b), this.c.copy(t.c), this;
3851
3851
  }
3852
3852
  getArea() {
3853
- return ie.subVectors(this.c, this.b), ke.subVectors(this.a, this.b), ie.cross(ke).length() * 0.5;
3853
+ return ie.subVectors(this.c, this.b), Ee.subVectors(this.a, this.b), ie.cross(Ee).length() * 0.5;
3854
3854
  }
3855
3855
  getMidpoint(t) {
3856
3856
  return t.addVectors(this.a, this.b).add(this.c).multiplyScalar(1 / 3);
3857
3857
  }
3858
3858
  getNormal(t) {
3859
- return ce.getNormal(this.a, this.b, this.c, t);
3859
+ return he.getNormal(this.a, this.b, this.c, t);
3860
3860
  }
3861
3861
  getPlane(t) {
3862
3862
  return t.setFromCoplanarPoints(this.a, this.b, this.c);
3863
3863
  }
3864
3864
  getBarycoord(t, e) {
3865
- return ce.getBarycoord(t, this.a, this.b, this.c, e);
3865
+ return he.getBarycoord(t, this.a, this.b, this.c, e);
3866
3866
  }
3867
3867
  getInterpolation(t, e, s, i, r) {
3868
- return ce.getInterpolation(t, this.a, this.b, this.c, e, s, i, r);
3868
+ return he.getInterpolation(t, this.a, this.b, this.c, e, s, i, r);
3869
3869
  }
3870
3870
  containsPoint(t) {
3871
- return ce.containsPoint(t, this.a, this.b, this.c);
3871
+ return he.containsPoint(t, this.a, this.b, this.c);
3872
3872
  }
3873
3873
  isFrontFacing(t) {
3874
- return ce.isFrontFacing(this.a, this.b, this.c, t);
3874
+ return he.isFrontFacing(this.a, this.b, this.c, t);
3875
3875
  }
3876
3876
  intersectsBox(t) {
3877
3877
  return t.intersectsTriangle(this);
@@ -4056,7 +4056,7 @@ const ph = {
4056
4056
  whitesmoke: 16119285,
4057
4057
  yellow: 16776960,
4058
4058
  yellowgreen: 10145074
4059
- }, ze = { h: 0, s: 0, l: 0 }, Ns = { h: 0, s: 0, l: 0 };
4059
+ }, He = { h: 0, s: 0, l: 0 }, Ns = { h: 0, s: 0, l: 0 };
4060
4060
  function hr(n, t, e) {
4061
4061
  return e < 0 && (e += 1), e > 1 && (e -= 1), e < 1 / 6 ? n + (t - n) * 6 * e : e < 1 / 2 ? t : e < 2 / 3 ? n + (t - n) * 6 * (2 / 3 - e) : n;
4062
4062
  }
@@ -4075,7 +4075,7 @@ class $n {
4075
4075
  setScalar(t) {
4076
4076
  return this.r = t, this.g = t, this.b = t, this;
4077
4077
  }
4078
- setHex(t, e = re) {
4078
+ setHex(t, e = ae) {
4079
4079
  return t = Math.floor(t), this.r = (t >> 16 & 255) / 255, this.g = (t >> 8 & 255) / 255, this.b = (t & 255) / 255, ee.toWorkingColorSpace(this, e), this;
4080
4080
  }
4081
4081
  setRGB(t, e, s, i = ee.workingColorSpace) {
@@ -4090,7 +4090,7 @@ class $n {
4090
4090
  }
4091
4091
  return ee.toWorkingColorSpace(this, i), this;
4092
4092
  }
4093
- setStyle(t, e = re) {
4093
+ setStyle(t, e = ae) {
4094
4094
  function s(r) {
4095
4095
  r !== void 0 && parseFloat(r) < 1 && console.warn("THREE.Color: Alpha component of " + t + " will be ignored.");
4096
4096
  }
@@ -4145,7 +4145,7 @@ class $n {
4145
4145
  return this.setColorName(t, e);
4146
4146
  return this;
4147
4147
  }
4148
- setColorName(t, e = re) {
4148
+ setColorName(t, e = ae) {
4149
4149
  const s = ph[t.toLowerCase()];
4150
4150
  return s !== void 0 ? this.setHex(s, e) : console.warn("THREE.Color: Unknown color " + t), this;
4151
4151
  }
@@ -4156,7 +4156,7 @@ class $n {
4156
4156
  return this.r = t.r, this.g = t.g, this.b = t.b, this;
4157
4157
  }
4158
4158
  copySRGBToLinear(t) {
4159
- return this.r = Be(t.r), this.g = Be(t.g), this.b = Be(t.b), this;
4159
+ return this.r = Re(t.r), this.g = Re(t.g), this.b = Re(t.b), this;
4160
4160
  }
4161
4161
  copyLinearToSRGB(t) {
4162
4162
  return this.r = Rn(t.r), this.g = Rn(t.g), this.b = Rn(t.b), this;
@@ -4167,10 +4167,10 @@ class $n {
4167
4167
  convertLinearToSRGB() {
4168
4168
  return this.copyLinearToSRGB(this), this;
4169
4169
  }
4170
- getHex(t = re) {
4170
+ getHex(t = ae) {
4171
4171
  return ee.fromWorkingColorSpace(Lt.copy(this), t), Math.round(Z(Lt.r * 255, 0, 255)) * 65536 + Math.round(Z(Lt.g * 255, 0, 255)) * 256 + Math.round(Z(Lt.b * 255, 0, 255));
4172
4172
  }
4173
- getHexString(t = re) {
4173
+ getHexString(t = ae) {
4174
4174
  return ("000000" + this.getHex(t).toString(16)).slice(-6);
4175
4175
  }
4176
4176
  getHSL(t, e = ee.workingColorSpace) {
@@ -4200,13 +4200,13 @@ class $n {
4200
4200
  getRGB(t, e = ee.workingColorSpace) {
4201
4201
  return ee.fromWorkingColorSpace(Lt.copy(this), e), t.r = Lt.r, t.g = Lt.g, t.b = Lt.b, t;
4202
4202
  }
4203
- getStyle(t = re) {
4203
+ getStyle(t = ae) {
4204
4204
  ee.fromWorkingColorSpace(Lt.copy(this), t);
4205
4205
  const e = Lt.r, s = Lt.g, i = Lt.b;
4206
- return t !== re ? `color(${t} ${e.toFixed(3)} ${s.toFixed(3)} ${i.toFixed(3)})` : `rgb(${Math.round(e * 255)},${Math.round(s * 255)},${Math.round(i * 255)})`;
4206
+ return t !== ae ? `color(${t} ${e.toFixed(3)} ${s.toFixed(3)} ${i.toFixed(3)})` : `rgb(${Math.round(e * 255)},${Math.round(s * 255)},${Math.round(i * 255)})`;
4207
4207
  }
4208
4208
  offsetHSL(t, e, s) {
4209
- return this.getHSL(ze), this.setHSL(ze.h + t, ze.s + e, ze.l + s);
4209
+ return this.getHSL(He), this.setHSL(He.h + t, He.s + e, He.l + s);
4210
4210
  }
4211
4211
  add(t) {
4212
4212
  return this.r += t.r, this.g += t.g, this.b += t.b, this;
@@ -4233,8 +4233,8 @@ class $n {
4233
4233
  return this.r = t.r + (e.r - t.r) * s, this.g = t.g + (e.g - t.g) * s, this.b = t.b + (e.b - t.b) * s, this;
4234
4234
  }
4235
4235
  lerpHSL(t, e) {
4236
- this.getHSL(ze), t.getHSL(Ns);
4237
- const s = ji(ze.h, Ns.h, e), i = ji(ze.s, Ns.s, e), r = ji(ze.l, Ns.l, e);
4236
+ this.getHSL(He), t.getHSL(Ns);
4237
+ const s = ji(He.h, Ns.h, e), i = ji(He.s, Ns.s, e), r = ji(He.l, Ns.l, e);
4238
4238
  return this.setHSL(s, i, r), this;
4239
4239
  }
4240
4240
  setFromVector3(t) {
@@ -4362,7 +4362,7 @@ class gh extends dh {
4362
4362
  }
4363
4363
  }
4364
4364
  const xt = /* @__PURE__ */ new E(), zs = /* @__PURE__ */ new X();
4365
- class le {
4365
+ class ue {
4366
4366
  constructor(t, e, s = !1) {
4367
4367
  if (Array.isArray(t))
4368
4368
  throw new TypeError("THREE.BufferAttribute: array should be a Typed Array.");
@@ -4481,17 +4481,17 @@ class le {
4481
4481
  return this.name !== "" && (t.name = this.name), this.usage !== Za && (t.usage = this.usage), t;
4482
4482
  }
4483
4483
  }
4484
- class ku extends le {
4484
+ class ku extends ue {
4485
4485
  constructor(t, e, s) {
4486
4486
  super(new Uint16Array(t), e, s);
4487
4487
  }
4488
4488
  }
4489
- class Eu extends le {
4489
+ class Eu extends ue {
4490
4490
  constructor(t, e, s) {
4491
4491
  super(new Uint32Array(t), e, s);
4492
4492
  }
4493
4493
  }
4494
- class un extends le {
4494
+ class un extends ue {
4495
4495
  constructor(t, e, s) {
4496
4496
  super(new Float32Array(t), e, s);
4497
4497
  }
@@ -4647,7 +4647,7 @@ class Dt extends Ii {
4647
4647
  return;
4648
4648
  }
4649
4649
  const s = e.position, i = e.normal, r = e.uv;
4650
- this.hasAttribute("tangent") === !1 && this.setAttribute("tangent", new le(new Float32Array(4 * s.count), 4));
4650
+ this.hasAttribute("tangent") === !1 && this.setAttribute("tangent", new ue(new Float32Array(4 * s.count), 4));
4651
4651
  const a = this.getAttribute("tangent"), o = [], c = [];
4652
4652
  for (let I = 0; I < s.count; I++)
4653
4653
  o[I] = new E(), c[I] = new E();
@@ -4690,7 +4690,7 @@ class Dt extends Ii {
4690
4690
  if (e !== void 0) {
4691
4691
  let s = this.getAttribute("normal");
4692
4692
  if (s === void 0)
4693
- s = new le(new Float32Array(e.count * 3), 3), this.setAttribute("normal", s);
4693
+ s = new ue(new Float32Array(e.count * 3), 3), this.setAttribute("normal", s);
4694
4694
  else
4695
4695
  for (let f = 0, p = s.count; f < p; f++)
4696
4696
  s.setXYZ(f, 0, 0, 0);
@@ -4720,7 +4720,7 @@ class Dt extends Ii {
4720
4720
  for (let b = 0; b < l; b++)
4721
4721
  f[d++] = h[p++];
4722
4722
  }
4723
- return new le(f, l, u);
4723
+ return new ue(f, l, u);
4724
4724
  }
4725
4725
  if (this.index === null)
4726
4726
  return console.warn("THREE.BufferGeometry.toNonIndexed(): BufferGeometry is already non-indexed."), this;
@@ -4918,7 +4918,7 @@ function Xs(n, t, e, s, i, r, a, o, c, h) {
4918
4918
  const l = Ou(n, t, e, s, Gs, Vs, Ws, fo);
4919
4919
  if (l) {
4920
4920
  const u = new E();
4921
- ce.getBarycoord(fo, Gs, Vs, Ws, u), i && (l.uv = ce.getInterpolatedAttribute(i, o, c, h, u, new X())), r && (l.uv1 = ce.getInterpolatedAttribute(r, o, c, h, u, new X())), a && (l.normal = ce.getInterpolatedAttribute(a, o, c, h, u, new E()), l.normal.dot(s.direction) > 0 && l.normal.multiplyScalar(-1));
4921
+ he.getBarycoord(fo, Gs, Vs, Ws, u), i && (l.uv = he.getInterpolatedAttribute(i, o, c, h, u, new X())), r && (l.uv1 = he.getInterpolatedAttribute(r, o, c, h, u, new X())), a && (l.normal = he.getInterpolatedAttribute(a, o, c, h, u, new E()), l.normal.dot(s.direction) > 0 && l.normal.multiplyScalar(-1));
4922
4922
  const f = {
4923
4923
  a: o,
4924
4924
  b: c,
@@ -4926,7 +4926,7 @@ function Xs(n, t, e, s, i, r, a, o, c, h) {
4926
4926
  normal: new E(),
4927
4927
  materialIndex: 0
4928
4928
  };
4929
- ce.getNormal(Gs, Vs, Ws, f.normal), l.face = f, l.barycoord = u;
4929
+ he.getNormal(Gs, Vs, Ws, f.normal), l.face = f, l.barycoord = u;
4930
4930
  }
4931
4931
  return l;
4932
4932
  }
@@ -5038,7 +5038,7 @@ class xo extends Xt {
5038
5038
  super(), this.isGroup = !0, this.type = "Group";
5039
5039
  }
5040
5040
  }
5041
- class we {
5041
+ class Ce {
5042
5042
  constructor() {
5043
5043
  this.type = "Curve", this.arcLengthDivisions = 200;
5044
5044
  }
@@ -5173,7 +5173,7 @@ class we {
5173
5173
  return this.arcLengthDivisions = t.arcLengthDivisions, this;
5174
5174
  }
5175
5175
  }
5176
- class fs extends we {
5176
+ class fs extends Ce {
5177
5177
  constructor(t = 0, e = 0, s = 1, i = 1, r = 0, a = Math.PI * 2, o = !1, c = 0) {
5178
5178
  super(), this.isEllipseCurve = !0, this.type = "EllipseCurve", this.aX = t, this.aY = e, this.xRadius = s, this.yRadius = i, this.aStartAngle = r, this.aEndAngle = a, this.aClockwise = o, this.aRotation = c;
5179
5179
  }
@@ -5228,7 +5228,7 @@ function pa() {
5228
5228
  };
5229
5229
  }
5230
5230
  const Zs = /* @__PURE__ */ new E(), pr = /* @__PURE__ */ new pa(), dr = /* @__PURE__ */ new pa(), gr = /* @__PURE__ */ new pa();
5231
- class Lu extends we {
5231
+ class Lu extends Ce {
5232
5232
  constructor(t = [], e = !1, s = "centripetal", i = 0.5) {
5233
5233
  super(), this.isCatmullRomCurve3 = !0, this.type = "CatmullRomCurve3", this.points = t, this.closed = e, this.curveType = s, this.tension = i;
5234
5234
  }
@@ -5310,7 +5310,7 @@ function Nu(n, t) {
5310
5310
  function cs(n, t, e, s, i) {
5311
5311
  return Du(n, t) + Uu(n, e) + Pu(n, s) + Nu(n, i);
5312
5312
  }
5313
- class yi extends we {
5313
+ class yi extends Ce {
5314
5314
  constructor(t = new X(), e = new X(), s = new X(), i = new X()) {
5315
5315
  super(), this.isCubicBezierCurve = !0, this.type = "CubicBezierCurve", this.v0 = t, this.v1 = e, this.v2 = s, this.v3 = i;
5316
5316
  }
@@ -5332,7 +5332,7 @@ class yi extends we {
5332
5332
  return super.fromJSON(t), this.v0.fromArray(t.v0), this.v1.fromArray(t.v1), this.v2.fromArray(t.v2), this.v3.fromArray(t.v3), this;
5333
5333
  }
5334
5334
  }
5335
- class zu extends we {
5335
+ class zu extends Ce {
5336
5336
  constructor(t = new E(), e = new E(), s = new E(), i = new E()) {
5337
5337
  super(), this.isCubicBezierCurve3 = !0, this.type = "CubicBezierCurve3", this.v0 = t, this.v1 = e, this.v2 = s, this.v3 = i;
5338
5338
  }
@@ -5355,7 +5355,7 @@ class zu extends we {
5355
5355
  return super.fromJSON(t), this.v0.fromArray(t.v0), this.v1.fromArray(t.v1), this.v2.fromArray(t.v2), this.v3.fromArray(t.v3), this;
5356
5356
  }
5357
5357
  }
5358
- class hs extends we {
5358
+ class hs extends Ce {
5359
5359
  constructor(t = new X(), e = new X()) {
5360
5360
  super(), this.isLineCurve = !0, this.type = "LineCurve", this.v1 = t, this.v2 = e;
5361
5361
  }
@@ -5384,7 +5384,7 @@ class hs extends we {
5384
5384
  return super.fromJSON(t), this.v1.fromArray(t.v1), this.v2.fromArray(t.v2), this;
5385
5385
  }
5386
5386
  }
5387
- class Hu extends we {
5387
+ class Hu extends Ce {
5388
5388
  constructor(t = new E(), e = new E()) {
5389
5389
  super(), this.isLineCurve3 = !0, this.type = "LineCurve3", this.v1 = t, this.v2 = e;
5390
5390
  }
@@ -5413,7 +5413,7 @@ class Hu extends we {
5413
5413
  return super.fromJSON(t), this.v1.fromArray(t.v1), this.v2.fromArray(t.v2), this;
5414
5414
  }
5415
5415
  }
5416
- class xi extends we {
5416
+ class xi extends Ce {
5417
5417
  constructor(t = new X(), e = new X(), s = new X()) {
5418
5418
  super(), this.isQuadraticBezierCurve = !0, this.type = "QuadraticBezierCurve", this.v0 = t, this.v1 = e, this.v2 = s;
5419
5419
  }
@@ -5435,7 +5435,7 @@ class xi extends we {
5435
5435
  return super.fromJSON(t), this.v0.fromArray(t.v0), this.v1.fromArray(t.v1), this.v2.fromArray(t.v2), this;
5436
5436
  }
5437
5437
  }
5438
- class Gu extends we {
5438
+ class Gu extends Ce {
5439
5439
  constructor(t = new E(), e = new E(), s = new E()) {
5440
5440
  super(), this.isQuadraticBezierCurve3 = !0, this.type = "QuadraticBezierCurve3", this.v0 = t, this.v1 = e, this.v2 = s;
5441
5441
  }
@@ -5458,7 +5458,7 @@ class Gu extends we {
5458
5458
  return super.fromJSON(t), this.v0.fromArray(t.v0), this.v1.fromArray(t.v1), this.v2.fromArray(t.v2), this;
5459
5459
  }
5460
5460
  }
5461
- class xh extends we {
5461
+ class xh extends Ce {
5462
5462
  constructor(t = []) {
5463
5463
  super(), this.isSplineCurve = !0, this.type = "SplineCurve", this.points = t;
5464
5464
  }
@@ -5508,7 +5508,7 @@ var vo = /* @__PURE__ */ Object.freeze({
5508
5508
  QuadraticBezierCurve3: Gu,
5509
5509
  SplineCurve: xh
5510
5510
  });
5511
- class Vu extends we {
5511
+ class Vu extends Ce {
5512
5512
  constructor() {
5513
5513
  super(), this.type = "CurvePath", this.curves = [], this.autoClose = !1;
5514
5514
  }
@@ -6146,7 +6146,7 @@ class wh {
6146
6146
  }
6147
6147
  }
6148
6148
  wh.DEFAULT_MATERIAL_NAME = "__DEFAULT";
6149
- const Me = {};
6149
+ const Oe = {};
6150
6150
  class uf extends Error {
6151
6151
  constructor(t, e) {
6152
6152
  super(t), this.response = e;
@@ -6163,15 +6163,15 @@ class ff extends wh {
6163
6163
  return this.manager.itemStart(t), setTimeout(() => {
6164
6164
  e && e(r), this.manager.itemEnd(t);
6165
6165
  }, 0), r;
6166
- if (Me[t] !== void 0) {
6167
- Me[t].push({
6166
+ if (Oe[t] !== void 0) {
6167
+ Oe[t].push({
6168
6168
  onLoad: e,
6169
6169
  onProgress: s,
6170
6170
  onError: i
6171
6171
  });
6172
6172
  return;
6173
6173
  }
6174
- Me[t] = [], Me[t].push({
6174
+ Oe[t] = [], Oe[t].push({
6175
6175
  onLoad: e,
6176
6176
  onProgress: s,
6177
6177
  onError: i
@@ -6185,7 +6185,7 @@ class ff extends wh {
6185
6185
  if (h.status === 200 || h.status === 0) {
6186
6186
  if (h.status === 0 && console.warn("THREE.FileLoader: HTTP Status 0 received."), typeof ReadableStream > "u" || h.body === void 0 || h.body.getReader === void 0)
6187
6187
  return h;
6188
- const l = Me[t], u = h.body.getReader(), f = h.headers.get("X-File-Size") || h.headers.get("Content-Length"), p = f ? parseInt(f) : 0, d = p !== 0;
6188
+ const l = Oe[t], u = h.body.getReader(), f = h.headers.get("X-File-Size") || h.headers.get("Content-Length"), p = f ? parseInt(f) : 0, d = p !== 0;
6189
6189
  let g = 0;
6190
6190
  const x = new ReadableStream({
6191
6191
  start(b) {
@@ -6232,17 +6232,17 @@ class ff extends wh {
6232
6232
  }
6233
6233
  }).then((h) => {
6234
6234
  To.add(t, h);
6235
- const l = Me[t];
6236
- delete Me[t];
6235
+ const l = Oe[t];
6236
+ delete Oe[t];
6237
6237
  for (let u = 0, f = l.length; u < f; u++) {
6238
6238
  const p = l[u];
6239
6239
  p.onLoad && p.onLoad(h);
6240
6240
  }
6241
6241
  }).catch((h) => {
6242
- const l = Me[t];
6242
+ const l = Oe[t];
6243
6243
  if (l === void 0)
6244
6244
  throw this.manager.itemError(t), h;
6245
- delete Me[t];
6245
+ delete Oe[t];
6246
6246
  for (let u = 0, f = l.length; u < f; u++) {
6247
6247
  const p = l[u];
6248
6248
  p.onError && p.onError(h);
@@ -6596,7 +6596,7 @@ class Fo {
6596
6596
  s.call(null, t, ...e);
6597
6597
  }
6598
6598
  }
6599
- const yf = (n) => n.substring(n.lastIndexOf(".") + 1), Eh = (n) => n.split("/").pop(), We = (n) => {
6599
+ const yf = (n) => n.substring(n.lastIndexOf(".") + 1), Eh = (n) => n.split("/").pop(), qe = (n) => {
6600
6600
  const t = Eh(n);
6601
6601
  if (t) {
6602
6602
  const e = t.lastIndexOf(".");
@@ -8781,7 +8781,7 @@ const on = {
8781
8781
  * @returns The font data if found, undefined otherwise
8782
8782
  */
8783
8783
  async find(t) {
8784
- const e = We(t).toLowerCase(), s = await this.get(e);
8784
+ const e = qe(t).toLowerCase(), s = await this.get(e);
8785
8785
  return s || (await this.getAll()).find(
8786
8786
  (r) => {
8787
8787
  var a;
@@ -8900,7 +8900,7 @@ const on = {
8900
8900
  }
8901
8901
  };
8902
8902
  jt.DATABASE_NAME = "mlightcad", jt.DATABASE_VERSION = xr[xr.length - 1].version;
8903
- let qe = jt;
8903
+ let re = jt;
8904
8904
  const np = 512;
8905
8905
  function sp(n, t) {
8906
8906
  return (n + t) * np;
@@ -8918,6 +8918,8 @@ const Qr = {
8918
8918
  r12r14: ["txt", "simplex", "romans", "gbcbig", "simsun"],
8919
8919
  // Mesh/TTF first so missing style fonts (e.g. "标准") get correct Latin metrics.
8920
8920
  // BIGFONT SHX stays available via glyph fallback for CJK coverage.
8921
+ // Korean/Japanese faces are not in this preset — load on demand via style
8922
+ // names (e.g. `malgun`) or switch to the `korean` / `cjk` presets.
8921
8923
  modern: ["simsun", "hztxt"],
8922
8924
  international: ["txt", "simplex", "romans", "simsun"],
8923
8925
  // Full CJK: mesh faces for CN/KR/JP, then matching SHX big fonts.
@@ -8976,7 +8978,7 @@ var Nh = new ys(), zh = new ys(), ma = new Uint8Array(30), ya = new Uint16Array(
8976
8978
  14,
8977
8979
  1,
8978
8980
  15
8979
- ]), Uo = new ys(), de = new Uint8Array(320);
8981
+ ]), Uo = new ys(), ge = new Uint8Array(320);
8980
8982
  function Vh(n, t, e, s) {
8981
8983
  var i, r;
8982
8984
  for (i = 0; i < e; ++i) n[i] = 0;
@@ -9009,7 +9011,7 @@ function hp(n) {
9009
9011
  var t = n.tag & 1;
9010
9012
  return n.tag >>>= 1, t;
9011
9013
  }
9012
- function me(n, t, e) {
9014
+ function ye(n, t, e) {
9013
9015
  if (!t)
9014
9016
  return e;
9015
9017
  for (; n.bitcount < 24; )
@@ -9028,33 +9030,33 @@ function ta(n, t) {
9028
9030
  }
9029
9031
  function lp(n, t, e) {
9030
9032
  var s, i, r, a, o, c;
9031
- for (s = me(n, 5, 257), i = me(n, 5, 1), r = me(n, 4, 4), a = 0; a < 19; ++a) de[a] = 0;
9033
+ for (s = ye(n, 5, 257), i = ye(n, 5, 1), r = ye(n, 4, 4), a = 0; a < 19; ++a) ge[a] = 0;
9032
9034
  for (a = 0; a < r; ++a) {
9033
- var h = me(n, 3, 0);
9034
- de[op[a]] = h;
9035
+ var h = ye(n, 3, 0);
9036
+ ge[op[a]] = h;
9035
9037
  }
9036
- for (vr(Uo, de, 0, 19), o = 0; o < s + i; ) {
9038
+ for (vr(Uo, ge, 0, 19), o = 0; o < s + i; ) {
9037
9039
  var l = ta(n, Uo);
9038
9040
  switch (l) {
9039
9041
  case 16:
9040
- var u = de[o - 1];
9041
- for (c = me(n, 2, 3); c; --c)
9042
- de[o++] = u;
9042
+ var u = ge[o - 1];
9043
+ for (c = ye(n, 2, 3); c; --c)
9044
+ ge[o++] = u;
9043
9045
  break;
9044
9046
  case 17:
9045
- for (c = me(n, 3, 3); c; --c)
9046
- de[o++] = 0;
9047
+ for (c = ye(n, 3, 3); c; --c)
9048
+ ge[o++] = 0;
9047
9049
  break;
9048
9050
  case 18:
9049
- for (c = me(n, 7, 11); c; --c)
9050
- de[o++] = 0;
9051
+ for (c = ye(n, 7, 11); c; --c)
9052
+ ge[o++] = 0;
9051
9053
  break;
9052
9054
  default:
9053
- de[o++] = l;
9055
+ ge[o++] = l;
9054
9056
  break;
9055
9057
  }
9056
9058
  }
9057
- vr(t, de, 0, s), vr(e, de, s, i);
9059
+ vr(t, ge, 0, s), vr(e, ge, s, i);
9058
9060
  }
9059
9061
  function No(n, t, e) {
9060
9062
  for (; ; ) {
@@ -9065,7 +9067,7 @@ function No(n, t, e) {
9065
9067
  n.dest[n.destLen++] = s;
9066
9068
  else {
9067
9069
  var i, r, a, o;
9068
- for (s -= 257, i = me(n, ma[s], ya[s]), r = ta(n, e), a = n.destLen - me(n, Hh[r], Gh[r]), o = a; o < a + i; ++o)
9070
+ for (s -= 257, i = ye(n, ma[s], ya[s]), r = ta(n, e), a = n.destLen - ye(n, Hh[r], Gh[r]), o = a; o < a + i; ++o)
9069
9071
  n.dest[n.destLen++] = n.dest[o];
9070
9072
  }
9071
9073
  }
@@ -9082,7 +9084,7 @@ function up(n) {
9082
9084
  function Wh(n, t) {
9083
9085
  var e = new ap(n, t), s, i, r;
9084
9086
  do {
9085
- switch (s = hp(e), i = me(e, 2, 0), i) {
9087
+ switch (s = hp(e), i = ye(e, 2, 0), i) {
9086
9088
  case 0:
9087
9089
  r = up(e);
9088
9090
  break;
@@ -9448,7 +9450,7 @@ function zo(n, t) {
9448
9450
  n || Yh(t);
9449
9451
  }
9450
9452
  var V = { fail: Yh, argument: zo, assert: zo }, Ho = 32768, Go = 2147483648, dp = -32768, gp = 32767 + 1 / 65536, Wn = {}, N = {}, q = {};
9451
- function pe(n) {
9453
+ function de(n) {
9452
9454
  return function() {
9453
9455
  return n;
9454
9456
  };
@@ -9456,11 +9458,11 @@ function pe(n) {
9456
9458
  N.BYTE = function(n) {
9457
9459
  return V.argument(n >= 0 && n <= 255, "Byte value should be between 0 and 255."), [n];
9458
9460
  };
9459
- q.BYTE = pe(1);
9461
+ q.BYTE = de(1);
9460
9462
  N.CHAR = function(n) {
9461
9463
  return [n.charCodeAt(0)];
9462
9464
  };
9463
- q.CHAR = pe(1);
9465
+ q.CHAR = de(1);
9464
9466
  N.CHARARRAY = function(n) {
9465
9467
  (n === null || typeof n > "u") && (n = "", console.warn("CHARARRAY with undefined or null value encountered and treated as an empty string. This is probably caused by a missing glyph name."));
9466
9468
  const t = [];
@@ -9474,23 +9476,23 @@ q.CHARARRAY = function(n) {
9474
9476
  N.USHORT = function(n) {
9475
9477
  return [n >> 8 & 255, n & 255];
9476
9478
  };
9477
- q.USHORT = pe(2);
9479
+ q.USHORT = de(2);
9478
9480
  N.SHORT = function(n) {
9479
9481
  return n >= Ho && (n = -(2 * Ho - n)), [n >> 8 & 255, n & 255];
9480
9482
  };
9481
- q.SHORT = pe(2);
9483
+ q.SHORT = de(2);
9482
9484
  N.UINT24 = function(n) {
9483
9485
  return [n >> 16 & 255, n >> 8 & 255, n & 255];
9484
9486
  };
9485
- q.UINT24 = pe(3);
9487
+ q.UINT24 = de(3);
9486
9488
  N.ULONG = function(n) {
9487
9489
  return [n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255];
9488
9490
  };
9489
- q.ULONG = pe(4);
9491
+ q.ULONG = de(4);
9490
9492
  N.LONG = function(n) {
9491
9493
  return n >= Go && (n = -(2 * Go - n)), [n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255];
9492
9494
  };
9493
- q.LONG = pe(4);
9495
+ q.LONG = de(4);
9494
9496
  N.FLOAT = function(n) {
9495
9497
  if (n > gp || n < dp)
9496
9498
  throw new Error(`Value ${n} is outside the range of representable values in 16.16 format`);
@@ -9511,7 +9513,7 @@ q.F2DOT14 = q.USHORT;
9511
9513
  N.LONGDATETIME = function(n) {
9512
9514
  return [0, 0, 0, 0, n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255];
9513
9515
  };
9514
- q.LONGDATETIME = pe(8);
9516
+ q.LONGDATETIME = de(8);
9515
9517
  N.TAG = function(n) {
9516
9518
  return V.argument(n.length === 4, "Tag should be exactly 4 ASCII characters."), [
9517
9519
  n.charCodeAt(0),
@@ -9520,7 +9522,7 @@ N.TAG = function(n) {
9520
9522
  n.charCodeAt(3)
9521
9523
  ];
9522
9524
  };
9523
- q.TAG = pe(4);
9525
+ q.TAG = de(4);
9524
9526
  N.Card8 = N.BYTE;
9525
9527
  q.Card8 = q.BYTE;
9526
9528
  N.Card16 = N.USHORT;
@@ -9538,11 +9540,11 @@ q.NUMBER = function(n) {
9538
9540
  N.NUMBER16 = function(n) {
9539
9541
  return [28, n >> 8 & 255, n & 255];
9540
9542
  };
9541
- q.NUMBER16 = pe(3);
9543
+ q.NUMBER16 = de(3);
9542
9544
  N.NUMBER32 = function(n) {
9543
9545
  return [29, n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, n & 255];
9544
9546
  };
9545
- q.NUMBER32 = pe(5);
9547
+ q.NUMBER32 = de(5);
9546
9548
  N.REAL = function(n) {
9547
9549
  let t = n.toString();
9548
9550
  const e = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(t);
@@ -13467,7 +13469,7 @@ function Sa(n, t, e = 0, s = "hexa") {
13467
13469
  const a = rl(i.colorRecords[r]);
13468
13470
  return s === "bgra" ? a : Xn(a, s);
13469
13471
  }
13470
- function ae(n) {
13472
+ function oe(n) {
13471
13473
  return ("0" + parseInt(n).toString(16)).slice(-2);
13472
13474
  }
13473
13475
  function td(n) {
@@ -13509,7 +13511,7 @@ function ed(n) {
13509
13511
  };
13510
13512
  }
13511
13513
  function al(n) {
13512
- return parseInt(`0x${ae(n.b)}${ae(n.g)}${ae(n.r)}${ae(n.a * 255)}`, 16);
13514
+ return parseInt(`0x${oe(n.b)}${oe(n.g)}${oe(n.r)}${oe(n.a * 255)}`, 16);
13513
13515
  }
13514
13516
  function Mi(n, t = "hexa") {
13515
13517
  const e = t == "raw" || t == "cpal", s = Number.isInteger(n);
@@ -13608,11 +13610,11 @@ function Xn(n, t = "hexa") {
13608
13610
  case "hex":
13609
13611
  case "hex6":
13610
13612
  case "hex-6":
13611
- return `#${ae(n.r)}${ae(n.g)}${ae(n.b)}`;
13613
+ return `#${oe(n.r)}${oe(n.g)}${oe(n.b)}`;
13612
13614
  case "hexa":
13613
13615
  case "hex8":
13614
13616
  case "hex-8":
13615
- return `#${ae(n.r)}${ae(n.g)}${ae(n.b)}${ae(n.a * 255)}`;
13617
+ return `#${oe(n.r)}${oe(n.g)}${oe(n.b)}${oe(n.a * 255)}`;
13616
13618
  case "hsl":
13617
13619
  return `hsl(${e.h.toFixed(2)}, ${e.s.toFixed(2)}%, ${e.l.toFixed(2)}%)`;
13618
13620
  case "hsla":
@@ -13865,7 +13867,7 @@ function rd(n, t, e, s, i) {
13865
13867
  }, r;
13866
13868
  };
13867
13869
  }
13868
- var Se = { GlyphSet: Pi, glyphLoader: sd, ttfGlyphLoader: id, cffGlyphLoader: rd };
13870
+ var we = { GlyphSet: Pi, glyphLoader: sd, ttfGlyphLoader: id, cffGlyphLoader: rd };
13869
13871
  function cl(n, t) {
13870
13872
  if (n === t)
13871
13873
  return !0;
@@ -13884,7 +13886,7 @@ function Oi(n) {
13884
13886
  let t;
13885
13887
  return n.length < 1240 ? t = 107 : n.length < 33900 ? t = 1131 : t = 32768, t;
13886
13888
  }
13887
- function ge(n, t, e, s) {
13889
+ function me(n, t, e, s) {
13888
13890
  const i = [], r = [], a = s > 1 ? z.getULong(n, t) : z.getCard16(n, t), o = s > 1 ? 4 : 2;
13889
13891
  let c, h;
13890
13892
  if (a !== 0) {
@@ -14097,7 +14099,7 @@ function yd(n, t, e) {
14097
14099
  if (o !== 0 && c !== 0) {
14098
14100
  const h = Ta(n, c + t, o, [], 2);
14099
14101
  if (h.subrs) {
14100
- const l = c + h.subrs, u = ge(n, l + t, void 0, 2);
14102
+ const l = c + h.subrs, u = me(n, l + t, void 0, 2);
14101
14103
  a._subrs = u.objects, a._subrsBias = Oi(a._subrs);
14102
14104
  }
14103
14105
  a._privateDict = h;
@@ -14115,7 +14117,7 @@ function Sr(n, t, e, s, i) {
14115
14117
  if (h !== 0 && l !== 0) {
14116
14118
  const u = Ta(n, l + t, h, s, i);
14117
14119
  if (c._defaultWidthX = u.defaultWidthX, c._nominalWidthX = u.nominalWidthX, u.subrs !== 0) {
14118
- const f = l + u.subrs, p = ge(n, f + t, void 0, i);
14120
+ const f = l + u.subrs, p = me(n, f + t, void 0, i);
14119
14121
  c._subrs = p.objects, c._subrsBias = Oi(c._subrs);
14120
14122
  }
14121
14123
  c._privateDict = u;
@@ -14198,7 +14200,7 @@ function ra(n, t, e, s, i) {
14198
14200
  U = (l.length & 1) !== 0, U && !f && (R = l.shift() + v), u += l.length >> 1, l.length = 0, f = !0;
14199
14201
  }
14200
14202
  function D(U) {
14201
- let P, Q, yt, Pt, Ct, ut, j, rt, bt, kt, St, Tt, ht = 0;
14203
+ let P, Q, yt, Pt, Tt, ut, j, rt, bt, kt, St, Ft, ht = 0;
14202
14204
  for (; ht < U.length; ) {
14203
14205
  let Mt = U[ht];
14204
14206
  switch (ht += 1, Mt) {
@@ -14228,7 +14230,7 @@ function ra(n, t, e, s, i) {
14228
14230
  r = d + l.shift(), a = g + l.shift(), o = r + l.shift(), c = a + l.shift(), d = o + l.shift(), g = c + l.shift(), h.curveTo(r, a, o, c, d, g);
14229
14231
  break;
14230
14232
  case 10:
14231
- if (Ct = l.pop() + b, ut = x[Ct], ut) {
14233
+ if (Tt = l.pop() + b, ut = x[Tt], ut) {
14232
14234
  if (O >= Xo) {
14233
14235
  console.warn("CFF charstring subroutine call depth exceeded, skipping callsubr");
14234
14236
  break;
@@ -14245,16 +14247,16 @@ function ra(n, t, e, s, i) {
14245
14247
  case 12:
14246
14248
  switch (Mt = U[ht], ht += 1, Mt) {
14247
14249
  case 35:
14248
- r = d + l.shift(), a = g + l.shift(), o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c + l.shift(), bt = j + l.shift(), kt = rt + l.shift(), St = bt + l.shift(), Tt = kt + l.shift(), d = St + l.shift(), g = Tt + l.shift(), l.shift(), h.curveTo(r, a, o, c, j, rt), h.curveTo(bt, kt, St, Tt, d, g);
14250
+ r = d + l.shift(), a = g + l.shift(), o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c + l.shift(), bt = j + l.shift(), kt = rt + l.shift(), St = bt + l.shift(), Ft = kt + l.shift(), d = St + l.shift(), g = Ft + l.shift(), l.shift(), h.curveTo(r, a, o, c, j, rt), h.curveTo(bt, kt, St, Ft, d, g);
14249
14251
  break;
14250
14252
  case 34:
14251
- r = d + l.shift(), a = g, o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c, bt = j + l.shift(), kt = c, St = bt + l.shift(), Tt = g, d = St + l.shift(), h.curveTo(r, a, o, c, j, rt), h.curveTo(bt, kt, St, Tt, d, g);
14253
+ r = d + l.shift(), a = g, o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c, bt = j + l.shift(), kt = c, St = bt + l.shift(), Ft = g, d = St + l.shift(), h.curveTo(r, a, o, c, j, rt), h.curveTo(bt, kt, St, Ft, d, g);
14252
14254
  break;
14253
14255
  case 36:
14254
- r = d + l.shift(), a = g + l.shift(), o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c, bt = j + l.shift(), kt = c, St = bt + l.shift(), Tt = kt + l.shift(), d = St + l.shift(), h.curveTo(r, a, o, c, j, rt), h.curveTo(bt, kt, St, Tt, d, g);
14256
+ r = d + l.shift(), a = g + l.shift(), o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c, bt = j + l.shift(), kt = c, St = bt + l.shift(), Ft = kt + l.shift(), d = St + l.shift(), h.curveTo(r, a, o, c, j, rt), h.curveTo(bt, kt, St, Ft, d, g);
14255
14257
  break;
14256
14258
  case 37:
14257
- r = d + l.shift(), a = g + l.shift(), o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c + l.shift(), bt = j + l.shift(), kt = rt + l.shift(), St = bt + l.shift(), Tt = kt + l.shift(), Math.abs(St - d) > Math.abs(Tt - g) ? d = St + l.shift() : g = Tt + l.shift(), h.curveTo(r, a, o, c, j, rt), h.curveTo(bt, kt, St, Tt, d, g);
14259
+ r = d + l.shift(), a = g + l.shift(), o = r + l.shift(), c = a + l.shift(), j = o + l.shift(), rt = c + l.shift(), bt = j + l.shift(), kt = rt + l.shift(), St = bt + l.shift(), Ft = kt + l.shift(), Math.abs(St - d) > Math.abs(Ft - g) ? d = St + l.shift() : g = Ft + l.shift(), h.curveTo(r, a, o, c, j, rt), h.curveTo(bt, kt, St, Ft, d, g);
14258
14260
  break;
14259
14261
  default:
14260
14262
  console.log("Glyph " + t.index + ": unknown operator 1200" + Mt), l.length = 0;
@@ -14266,10 +14268,10 @@ function ra(n, t, e, s, i) {
14266
14268
  break;
14267
14269
  }
14268
14270
  if (l.length >= 4) {
14269
- const Ce = ia[l.pop()], C = ia[l.pop()], m = l.pop(), y = l.pop();
14270
- if (Ce && C) {
14271
+ const Te = ia[l.pop()], C = ia[l.pop()], m = l.pop(), y = l.pop();
14272
+ if (Te && C) {
14271
14273
  t.isComposite = !0, t.components = [];
14272
- const T = n.cffEncoding.charset.indexOf(Ce), k = n.cffEncoding.charset.indexOf(C);
14274
+ const T = n.cffEncoding.charset.indexOf(Te), k = n.cffEncoding.charset.indexOf(C);
14273
14275
  t.components.push({
14274
14276
  glyphIndex: k,
14275
14277
  dx: 0,
@@ -14304,11 +14306,11 @@ function ra(n, t, e, s, i) {
14304
14306
  M || (M = n.variation && i && n.variation.process.getBlendVector(F, w, i));
14305
14307
  var tt = l.pop(), Et = M ? M.length : F.itemVariationSubtables[w].regionIndexes.length, Nt = tt * Et, zt = l.length - Nt, Ht = zt - tt;
14306
14308
  if (M)
14307
- for (let Ce = 0; Ce < tt; Ce++) {
14308
- var Vt = l[Ht + Ce];
14309
+ for (let Te = 0; Te < tt; Te++) {
14310
+ var Vt = l[Ht + Te];
14309
14311
  for (let C = 0; C < Et; C++)
14310
14312
  Vt += M[C] * l[zt++];
14311
- l[Ht + Ce] = Vt;
14313
+ l[Ht + Te] = Vt;
14312
14314
  }
14313
14315
  for (; Nt--; )
14314
14316
  l.pop();
@@ -14351,7 +14353,7 @@ function ra(n, t, e, s, i) {
14351
14353
  P = U[ht], Q = U[ht + 1], l.push((P << 24 | Q << 16) >> 16), ht += 2;
14352
14354
  break;
14353
14355
  case 29:
14354
- if (Ct = l.pop() + n.gsubrsBias, ut = n.gsubrs[Ct], ut) {
14356
+ if (Tt = l.pop() + n.gsubrsBias, ut = n.gsubrs[Tt], ut) {
14355
14357
  if (O >= Xo) {
14356
14358
  console.warn("CFF charstring subroutine call depth exceeded, skipping callgsubr");
14357
14359
  break;
@@ -14416,7 +14418,7 @@ function Sd(n, t, e, s) {
14416
14418
  let i;
14417
14419
  const r = ud(n, t);
14418
14420
  r.formatMajor === 2 ? i = e.tables.cff2 = {} : i = e.tables.cff = {};
14419
- const a = r.formatMajor > 1 ? null : ge(n, r.endOffset, z.bytesToString), o = r.formatMajor > 1 ? null : ge(n, a.endOffset), c = r.formatMajor > 1 ? null : ge(n, o.endOffset, z.bytesToString), h = ge(n, r.formatMajor > 1 ? t + r.size + r.topDictLength : c.endOffset, void 0, r.formatMajor);
14421
+ const a = r.formatMajor > 1 ? null : me(n, r.endOffset, z.bytesToString), o = r.formatMajor > 1 ? null : me(n, a.endOffset), c = r.formatMajor > 1 ? null : me(n, o.endOffset, z.bytesToString), h = me(n, r.formatMajor > 1 ? t + r.size + r.topDictLength : c.endOffset, void 0, r.formatMajor);
14420
14422
  e.gsubrs = h.objects, e.gsubrsBias = Oi(e.gsubrs);
14421
14423
  let l;
14422
14424
  if (r.formatMajor > 1) {
@@ -14432,38 +14434,38 @@ function Sd(n, t, e, s) {
14432
14434
  let f = l.fdArray, p = l.fdSelect;
14433
14435
  if (!f)
14434
14436
  throw new Error("This is a CFF2 font, but FDArray information is missing");
14435
- const d = ge(n, t + f, null, r.formatMajor), g = yd(n, t, d.objects);
14437
+ const d = me(n, t + f, null, r.formatMajor), g = yd(n, t, d.objects);
14436
14438
  l._fdArray = g, p && (l._fdSelect = Yo(n, t + p, e.numGlyphs, g.length, r.formatMajor));
14437
14439
  } else if (e.isCIDFont) {
14438
14440
  let f = l.fdArray, p = l.fdSelect;
14439
14441
  if (f === 0 || p === 0)
14440
14442
  throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
14441
14443
  f += t;
14442
- const d = ge(n, f), g = Sr(n, t, d.objects, c.objects, r.formatMajor);
14444
+ const d = me(n, f), g = Sr(n, t, d.objects, c.objects, r.formatMajor);
14443
14445
  l._fdArray = g, p += t, l._fdSelect = Yo(n, p, e.numGlyphs, g.length, r.formatMajor);
14444
14446
  }
14445
14447
  if (r.formatMajor < 2) {
14446
14448
  const f = t + l.private[1], p = Ta(n, f, l.private[0], c.objects, r.formatMajor);
14447
14449
  if (e.defaultWidthX = p.defaultWidthX, e.nominalWidthX = p.nominalWidthX, p.subrs !== 0) {
14448
- const d = f + p.subrs, g = ge(n, d);
14450
+ const d = f + p.subrs, g = me(n, d);
14449
14451
  e.subrs = g.objects, e.subrsBias = Oi(e.subrs);
14450
14452
  } else
14451
14453
  e.subrs = [], e.subrsBias = 0;
14452
14454
  }
14453
14455
  let u;
14454
- if (s.lowMemory ? (u = ad(n, t + l.charStrings, r.formatMajor), e.nGlyphs = u.offsets.length - (r.formatMajor > 1 ? 1 : 0)) : (u = ge(n, t + l.charStrings, null, r.formatMajor), e.nGlyphs = u.objects.length), r.formatMajor > 1 && e.tables.maxp && e.nGlyphs !== e.tables.maxp.numGlyphs && console.error(`Glyph count in the CFF2 table (${e.nGlyphs}) must correspond to the glyph count in the maxp table (${e.tables.maxp.numGlyphs})`), r.formatMajor < 2) {
14456
+ if (s.lowMemory ? (u = ad(n, t + l.charStrings, r.formatMajor), e.nGlyphs = u.offsets.length - (r.formatMajor > 1 ? 1 : 0)) : (u = me(n, t + l.charStrings, null, r.formatMajor), e.nGlyphs = u.objects.length), r.formatMajor > 1 && e.tables.maxp && e.nGlyphs !== e.tables.maxp.numGlyphs && console.error(`Glyph count in the CFF2 table (${e.nGlyphs}) must correspond to the glyph count in the maxp table (${e.tables.maxp.numGlyphs})`), r.formatMajor < 2) {
14455
14457
  let f = [], p = [];
14456
14458
  l.charset === 0 ? f = Wp : l.charset === 1 ? f = qp : l.charset === 2 ? f = jp : f = xd(n, t + l.charset, e.nGlyphs, c.objects, e.isCIDFont), l.encoding === 0 ? p = ia : l.encoding === 1 ? p = Xp : p = bd(n, t + l.encoding), e.cffEncoding = new il(p, f), e.encoding = e.encoding || e.cffEncoding;
14457
14459
  }
14458
- if (e.glyphs = new Se.GlyphSet(e), s.lowMemory)
14460
+ if (e.glyphs = new we.GlyphSet(e), s.lowMemory)
14459
14461
  e._push = function(f) {
14460
14462
  const p = od(f, u.offsets, n, t + l.charStrings, void 0, r.formatMajor);
14461
- e.glyphs.push(f, Se.cffGlyphLoader(e, f, ra, p, r.formatMajor));
14463
+ e.glyphs.push(f, we.cffGlyphLoader(e, f, ra, p, r.formatMajor));
14462
14464
  };
14463
14465
  else
14464
14466
  for (let f = 0; f < e.nGlyphs; f += 1) {
14465
14467
  const p = u.objects[f];
14466
- e.glyphs.push(f, Se.cffGlyphLoader(e, f, ra, p, r.formatMajor));
14468
+ e.glyphs.push(f, we.cffGlyphLoader(e, f, ra, p, r.formatMajor));
14467
14469
  }
14468
14470
  if (l.vstore) {
14469
14471
  const f = new z.Parser(n, t + l.vstore);
@@ -15101,8 +15103,8 @@ function Xd(n) {
15101
15103
  { name: "maxMemType1", type: "ULONG", value: c }
15102
15104
  ]);
15103
15105
  }
15104
- var bl = { parse: jd, make: Xd }, ue = new Array(9);
15105
- ue[1] = function() {
15106
+ var bl = { parse: jd, make: Xd }, fe = new Array(9);
15107
+ fe[1] = function() {
15106
15108
  const t = this.offset + this.relativeOffset, e = this.parseUShort();
15107
15109
  if (e === 1)
15108
15110
  return {
@@ -15118,7 +15120,7 @@ ue[1] = function() {
15118
15120
  };
15119
15121
  V.assert(!1, "0x" + t.toString(16) + ": lookup type 1 format must be 1 or 2.");
15120
15122
  };
15121
- ue[2] = function() {
15123
+ fe[2] = function() {
15122
15124
  const t = this.parseUShort();
15123
15125
  return V.argument(t === 1, "GSUB Multiple Substitution Subtable identifier-format must be 1"), {
15124
15126
  substFormat: t,
@@ -15126,7 +15128,7 @@ ue[2] = function() {
15126
15128
  sequences: this.parseListOfLists()
15127
15129
  };
15128
15130
  };
15129
- ue[3] = function() {
15131
+ fe[3] = function() {
15130
15132
  const t = this.parseUShort();
15131
15133
  return V.argument(t === 1, "GSUB Alternate Substitution Subtable identifier-format must be 1"), {
15132
15134
  substFormat: t,
@@ -15134,7 +15136,7 @@ ue[3] = function() {
15134
15136
  alternateSets: this.parseListOfLists()
15135
15137
  };
15136
15138
  };
15137
- ue[4] = function() {
15139
+ fe[4] = function() {
15138
15140
  const t = this.parseUShort();
15139
15141
  return V.argument(t === 1, "GSUB ligature table identifier-format must be 1"), {
15140
15142
  substFormat: t,
@@ -15151,7 +15153,7 @@ var Nn = {
15151
15153
  sequenceIndex: A.uShort,
15152
15154
  lookupListIndex: A.uShort
15153
15155
  };
15154
- ue[5] = function() {
15156
+ fe[5] = function() {
15155
15157
  const t = this.offset + this.relativeOffset, e = this.parseUShort();
15156
15158
  if (e === 1)
15157
15159
  return {
@@ -15188,7 +15190,7 @@ ue[5] = function() {
15188
15190
  }
15189
15191
  V.assert(!1, "0x" + t.toString(16) + ": lookup type 5 format must be 1, 2 or 3.");
15190
15192
  };
15191
- ue[6] = function() {
15193
+ fe[6] = function() {
15192
15194
  const t = this.offset + this.relativeOffset, e = this.parseUShort();
15193
15195
  if (e === 1)
15194
15196
  return {
@@ -15229,17 +15231,17 @@ ue[6] = function() {
15229
15231
  };
15230
15232
  V.assert(!1, "0x" + t.toString(16) + ": lookup type 6 format must be 1, 2 or 3.");
15231
15233
  };
15232
- ue[7] = function() {
15234
+ fe[7] = function() {
15233
15235
  const t = this.parseUShort();
15234
15236
  V.argument(t === 1, "GSUB Extension Substitution subtable identifier-format must be 1");
15235
15237
  const e = this.parseUShort(), s = new A(this.data, this.offset + this.parseULong());
15236
15238
  return {
15237
15239
  substFormat: 1,
15238
15240
  lookupType: e,
15239
- extension: ue[e].call(s)
15241
+ extension: fe[e].call(s)
15240
15242
  };
15241
15243
  };
15242
- ue[8] = function() {
15244
+ fe[8] = function() {
15243
15245
  const t = this.parseUShort();
15244
15246
  return V.argument(t === 1, "GSUB Reverse Chaining Contextual Single Substitution Subtable identifier-format must be 1"), {
15245
15247
  substFormat: t,
@@ -15256,12 +15258,12 @@ function Yd(n, t) {
15256
15258
  version: s,
15257
15259
  scripts: e.parseScriptList(),
15258
15260
  features: e.parseFeatureList(),
15259
- lookups: e.parseLookupList(ue)
15261
+ lookups: e.parseLookupList(fe)
15260
15262
  } : {
15261
15263
  version: s,
15262
15264
  scripts: e.parseScriptList(),
15263
15265
  features: e.parseFeatureList(),
15264
- lookups: e.parseLookupList(ue),
15266
+ lookups: e.parseLookupList(fe),
15265
15267
  variations: e.parseFeatureVariationsList()
15266
15268
  };
15267
15269
  }
@@ -16047,7 +16049,7 @@ function F0(n) {
16047
16049
  unitsPerEm: n.unitsPerEm,
16048
16050
  fontBBox: [0, d.yMin, d.ascender, d.advanceWidthMax],
16049
16051
  topDict: n.tables.cff && n.tables.cff.topDict || {}
16050
- }), Ct = n.metas && Object.keys(n.metas).length > 0 ? Sl.make(n.metas) : void 0, ut = [x, b, S, v, P, F, yt, Pt, w];
16052
+ }), Tt = n.metas && Object.keys(n.metas).length > 0 ? Sl.make(n.metas) : void 0, ut = [x, b, S, v, P, F, yt, Pt, w];
16051
16053
  Q && ut.push(Q);
16052
16054
  const j = {
16053
16055
  gsub: vl,
@@ -16071,12 +16073,12 @@ function F0(n) {
16071
16073
  Nt && ut.push(Nt);
16072
16074
  }
16073
16075
  }
16074
- Ct && ut.push(Ct);
16075
- const bt = Ol(ut), kt = bt.encode(), St = Fa(kt), Tt = bt.fields;
16076
+ Tt && ut.push(Tt);
16077
+ const bt = Ol(ut), kt = bt.encode(), St = Fa(kt), Ft = bt.fields;
16076
16078
  let ht = !1;
16077
- for (let tt = 0; tt < Tt.length; tt += 1)
16078
- if (Tt[tt].name === "head table") {
16079
- Tt[tt].value.checkSumAdjustment = 2981146554 - St, ht = !0;
16079
+ for (let tt = 0; tt < Ft.length; tt += 1)
16080
+ if (Ft[tt].name === "head table") {
16081
+ Ft[tt].value.checkSumAdjustment = 2981146554 - St, ht = !0;
16080
16082
  break;
16081
16083
  }
16082
16084
  if (!ht)
@@ -17235,18 +17237,18 @@ function Rl(n, t) {
17235
17237
  return ka(t.points);
17236
17238
  }
17237
17239
  function q0(n, t, e, s) {
17238
- const i = new Se.GlyphSet(s);
17240
+ const i = new we.GlyphSet(s);
17239
17241
  for (let r = 0; r < e.length - 1; r += 1) {
17240
17242
  const a = e[r], o = e[r + 1];
17241
- a !== o ? i.push(r, Se.ttfGlyphLoader(s, r, Bl, n, t + a, Rl)) : i.push(r, Se.glyphLoader(s, r));
17243
+ a !== o ? i.push(r, we.ttfGlyphLoader(s, r, Bl, n, t + a, Rl)) : i.push(r, we.glyphLoader(s, r));
17242
17244
  }
17243
17245
  return i;
17244
17246
  }
17245
17247
  function j0(n, t, e, s) {
17246
- const i = new Se.GlyphSet(s);
17248
+ const i = new we.GlyphSet(s);
17247
17249
  return s._push = function(r) {
17248
17250
  const a = e[r], o = e[r + 1];
17249
- a !== o ? i.push(r, Se.ttfGlyphLoader(s, r, Bl, n, t + a, Rl)) : i.push(r, Se.glyphLoader(s, r));
17251
+ a !== o ? i.push(r, we.ttfGlyphLoader(s, r, Bl, n, t + a, Rl)) : i.push(r, we.glyphLoader(s, r));
17250
17252
  }, i;
17251
17253
  }
17252
17254
  function X0(n, t, e, s, i) {
@@ -17726,7 +17728,7 @@ var Hl = function(n) {
17726
17728
  const s = this.srThreshold;
17727
17729
  let i = 1;
17728
17730
  return n < 0 && (n = -n, i = -1), n += s - e, n = Math.trunc(n / t) * t, n += e, n < 0 ? e * i : n * i;
17729
- }, be = {
17731
+ }, ve = {
17730
17732
  x: 1,
17731
17733
  y: 0,
17732
17734
  axis: "x",
@@ -17751,10 +17753,10 @@ var Hl = function(n) {
17751
17753
  return;
17752
17754
  }
17753
17755
  if (i = s.distance(n, t, !0, !0), r = s.distance(n, e, !0, !0), c = s.distance(t, t, !1, !0), h = s.distance(e, e, !1, !0), a = Math.abs(i), o = Math.abs(r), l = a + o, l === 0) {
17754
- be.setRelative(n, n, (c + h) / 2, s, !0);
17756
+ ve.setRelative(n, n, (c + h) / 2, s, !0);
17755
17757
  return;
17756
17758
  }
17757
- be.setRelative(n, n, (c * o + h * a) / l, s, !0);
17759
+ ve.setRelative(n, n, (c * o + h * a) / l, s, !0);
17758
17760
  },
17759
17761
  // Slope of line normal to this
17760
17762
  normalSlope: Number.NEGATIVE_INFINITY,
@@ -17790,7 +17792,7 @@ var Hl = function(n) {
17790
17792
  untouch: function(n) {
17791
17793
  n.xTouched = !1;
17792
17794
  }
17793
- }, Ie = {
17795
+ }, Be = {
17794
17796
  x: 0,
17795
17797
  y: 1,
17796
17798
  axis: "y",
@@ -17815,10 +17817,10 @@ var Hl = function(n) {
17815
17817
  return;
17816
17818
  }
17817
17819
  if (i = s.distance(n, t, !0, !0), r = s.distance(n, e, !0, !0), c = s.distance(t, t, !1, !0), h = s.distance(e, e, !1, !0), a = Math.abs(i), o = Math.abs(r), l = a + o, l === 0) {
17818
- Ie.setRelative(n, n, (c + h) / 2, s, !0);
17820
+ Be.setRelative(n, n, (c + h) / 2, s, !0);
17819
17821
  return;
17820
17822
  }
17821
- Ie.setRelative(n, n, (c * o + h * a) / l, s, !0);
17823
+ Be.setRelative(n, n, (c * o + h * a) / l, s, !0);
17822
17824
  },
17823
17825
  // Slope of line normal to this.
17824
17826
  normalSlope: 0,
@@ -17855,13 +17857,13 @@ var Hl = function(n) {
17855
17857
  n.yTouched = !1;
17856
17858
  }
17857
17859
  };
17858
- Object.freeze(be);
17859
- Object.freeze(Ie);
17860
+ Object.freeze(ve);
17861
+ Object.freeze(Be);
17860
17862
  function As(n, t) {
17861
17863
  this.x = n, this.y = t, this.axis = void 0, this.slope = t / n, this.normalSlope = -n / t, Object.freeze(this);
17862
17864
  }
17863
17865
  As.prototype.distance = function(n, t, e, s) {
17864
- return this.x * be.distance(n, t, e, s) + this.y * Ie.distance(n, t, e, s);
17866
+ return this.x * ve.distance(n, t, e, s) + this.y * Be.distance(n, t, e, s);
17865
17867
  };
17866
17868
  As.prototype.interpolate = function(n, t, e, s) {
17867
17869
  let i, r, a, o, c, h, l;
@@ -17881,22 +17883,22 @@ As.prototype.touch = function(n) {
17881
17883
  };
17882
17884
  function ks(n, t) {
17883
17885
  const e = Math.sqrt(n * n + t * t);
17884
- return n /= e, t /= e, n === 1 && t === 0 ? be : n === 0 && t === 1 ? Ie : new As(n, t);
17886
+ return n /= e, t /= e, n === 1 && t === 0 ? ve : n === 0 && t === 1 ? Be : new As(n, t);
17885
17887
  }
17886
- function Re(n, t, e, s) {
17888
+ function De(n, t, e, s) {
17887
17889
  this.x = this.xo = Math.round(n * 64) / 64, this.y = this.yo = Math.round(t * 64) / 64, this.lastPointOfContour = e, this.onCurve = s, this.prevPointOnContour = void 0, this.nextPointOnContour = void 0, this.xTouched = !1, this.yTouched = !1, Object.preventExtensions(this);
17888
17890
  }
17889
- Re.prototype.nextTouched = function(n) {
17891
+ De.prototype.nextTouched = function(n) {
17890
17892
  let t = this.nextPointOnContour;
17891
17893
  for (; !n.touched(t) && t !== this; ) t = t.nextPointOnContour;
17892
17894
  return t;
17893
17895
  };
17894
- Re.prototype.prevTouched = function(n) {
17896
+ De.prototype.prevTouched = function(n) {
17895
17897
  let t = this.prevPointOnContour;
17896
17898
  for (; !n.touched(t) && t !== this; ) t = t.prevPointOnContour;
17897
17899
  return t;
17898
17900
  };
17899
- var bs = Object.freeze(new Re(0, 0)), e1 = {
17901
+ var bs = Object.freeze(new De(0, 0)), e1 = {
17900
17902
  cvCutIn: 17 / 16,
17901
17903
  // control value cut in
17902
17904
  deltaBase: 9,
@@ -17912,7 +17914,7 @@ function $e(n, t) {
17912
17914
  case "glyf":
17913
17915
  this.zp0 = this.zp1 = this.zp2 = 1, this.rp0 = this.rp1 = this.rp2 = 0;
17914
17916
  case "prep":
17915
- this.fv = this.pv = this.dpv = be, this.round = zl;
17917
+ this.fv = this.pv = this.dpv = ve, this.round = zl;
17916
17918
  }
17917
17919
  }
17918
17920
  Nl.prototype.exec = function(n, t) {
@@ -17976,8 +17978,8 @@ Pl = function(n, t) {
17976
17978
  r.push(g[b] + x);
17977
17979
  }
17978
17980
  n.instructions && !o.inhibitGridFit && (o = new $e("glyf", n.instructions), o.gZone = o.z0 = o.z1 = o.z2 = a, o.contours = r, a.push(
17979
- new Re(0, 0),
17980
- new Re(Math.round(n.advanceWidth * e), 0)
17981
+ new De(0, 0),
17982
+ new De(Math.round(n.advanceWidth * e), 0)
17981
17983
  ), dn(o), a.length -= 2);
17982
17984
  }
17983
17985
  return a;
@@ -17986,7 +17988,7 @@ ha = function(n, t, e, s) {
17986
17988
  const i = n.points || [], r = i.length, a = t.gZone = t.z0 = t.z1 = t.z2 = [], o = t.contours = [];
17987
17989
  let c;
17988
17990
  for (let u = 0; u < r; u++)
17989
- c = i[u], a[u] = new Re(
17991
+ c = i[u], a[u] = new De(
17990
17992
  c.x * e,
17991
17993
  c.y * s,
17992
17994
  c.lastPointOfContour,
@@ -17996,8 +17998,8 @@ ha = function(n, t, e, s) {
17996
17998
  for (let u = 0; u < r; u++)
17997
17999
  c = a[u], h || (h = c, o.push(u)), c.lastPointOfContour ? (c.nextPointOnContour = h, h.prevPointOnContour = c, h = void 0) : (l = a[u + 1], c.nextPointOnContour = l, l.prevPointOnContour = c);
17998
18000
  t.inhibitGridFit || (a.push(
17999
- new Re(0, 0),
18000
- new Re(Math.round(n.advanceWidth * e), 0)
18001
+ new De(0, 0),
18002
+ new De(Math.round(n.advanceWidth * e), 0)
18001
18003
  ), dn(t), a.length -= 2);
18002
18004
  };
18003
18005
  dn = function(n) {
@@ -18020,7 +18022,7 @@ dn = function(n) {
18020
18022
  function zi(n) {
18021
18023
  const t = n.tZone = new Array(n.gZone.length);
18022
18024
  for (let e = 0; e < t.length; e++)
18023
- t[e] = new Re(0, 0);
18025
+ t[e] = new De(0, 0);
18024
18026
  }
18025
18027
  function Gl(n, t) {
18026
18028
  const e = n.prog;
@@ -18601,13 +18603,13 @@ function Tg(n) {
18601
18603
  throw new Error("invalid INSTCTRL[] selector");
18602
18604
  }
18603
18605
  }
18604
- function He(n, t) {
18606
+ function Ge(n, t) {
18605
18607
  const e = t.stack, s = t.prog;
18606
18608
  let i = t.ip;
18607
18609
  for (let r = 0; r < n; r++) e.push(s[++i]);
18608
18610
  t.ip = i;
18609
18611
  }
18610
- function Ge(n, t) {
18612
+ function Ve(n, t) {
18611
18613
  let e = t.ip;
18612
18614
  const s = t.prog, i = t.stack;
18613
18615
  for (let r = 0; r < n; r++) {
@@ -18623,17 +18625,17 @@ function G(n, t, e, s, i, r) {
18623
18625
  }
18624
18626
  Ul = [
18625
18627
  /* 0x00 */
18626
- rc.bind(void 0, Ie),
18628
+ rc.bind(void 0, Be),
18627
18629
  /* 0x01 */
18628
- rc.bind(void 0, be),
18630
+ rc.bind(void 0, ve),
18629
18631
  /* 0x02 */
18630
- ac.bind(void 0, Ie),
18632
+ ac.bind(void 0, Be),
18631
18633
  /* 0x03 */
18632
- ac.bind(void 0, be),
18634
+ ac.bind(void 0, ve),
18633
18635
  /* 0x04 */
18634
- oc.bind(void 0, Ie),
18636
+ oc.bind(void 0, Be),
18635
18637
  /* 0x05 */
18636
- oc.bind(void 0, be),
18638
+ oc.bind(void 0, ve),
18637
18639
  /* 0x06 */
18638
18640
  cc.bind(void 0, 0),
18639
18641
  /* 0x07 */
@@ -18724,9 +18726,9 @@ Ul = [
18724
18726
  /* 0x2F */
18725
18727
  lc.bind(void 0, 1),
18726
18728
  /* 0x30 */
18727
- uc.bind(void 0, Ie),
18729
+ uc.bind(void 0, Be),
18728
18730
  /* 0x31 */
18729
- uc.bind(void 0, be),
18731
+ uc.bind(void 0, ve),
18730
18732
  /* 0x32 */
18731
18733
  fc.bind(void 0, 0),
18732
18734
  /* 0x33 */
@@ -18996,37 +18998,37 @@ Ul = [
18996
18998
  /* 0xAF */
18997
18999
  void 0,
18998
19000
  /* 0xB0 */
18999
- He.bind(void 0, 1),
19001
+ Ge.bind(void 0, 1),
19000
19002
  /* 0xB1 */
19001
- He.bind(void 0, 2),
19003
+ Ge.bind(void 0, 2),
19002
19004
  /* 0xB2 */
19003
- He.bind(void 0, 3),
19005
+ Ge.bind(void 0, 3),
19004
19006
  /* 0xB3 */
19005
- He.bind(void 0, 4),
19007
+ Ge.bind(void 0, 4),
19006
19008
  /* 0xB4 */
19007
- He.bind(void 0, 5),
19009
+ Ge.bind(void 0, 5),
19008
19010
  /* 0xB5 */
19009
- He.bind(void 0, 6),
19011
+ Ge.bind(void 0, 6),
19010
19012
  /* 0xB6 */
19011
- He.bind(void 0, 7),
19013
+ Ge.bind(void 0, 7),
19012
19014
  /* 0xB7 */
19013
- He.bind(void 0, 8),
19015
+ Ge.bind(void 0, 8),
19014
19016
  /* 0xB8 */
19015
- Ge.bind(void 0, 1),
19017
+ Ve.bind(void 0, 1),
19016
19018
  /* 0xB9 */
19017
- Ge.bind(void 0, 2),
19019
+ Ve.bind(void 0, 2),
19018
19020
  /* 0xBA */
19019
- Ge.bind(void 0, 3),
19021
+ Ve.bind(void 0, 3),
19020
19022
  /* 0xBB */
19021
- Ge.bind(void 0, 4),
19023
+ Ve.bind(void 0, 4),
19022
19024
  /* 0xBC */
19023
- Ge.bind(void 0, 5),
19025
+ Ve.bind(void 0, 5),
19024
19026
  /* 0xBD */
19025
- Ge.bind(void 0, 6),
19027
+ Ve.bind(void 0, 6),
19026
19028
  /* 0xBE */
19027
- Ge.bind(void 0, 7),
19029
+ Ve.bind(void 0, 7),
19028
19030
  /* 0xBF */
19029
- Ge.bind(void 0, 8),
19031
+ Ve.bind(void 0, 8),
19030
19032
  /* 0xC0 */
19031
19033
  G.bind(void 0, 0, 0, 0, 0, 0),
19032
19034
  /* 0xC1 */
@@ -20332,7 +20334,7 @@ function it(n) {
20332
20334
  }, n.tables.os2)
20333
20335
  });
20334
20336
  }
20335
- this.supported = !0, this.glyphs = new Se.GlyphSet(this, n.glyphs || []), this.encoding = new nl(this), this.position = new k0(this), this.substitution = new B0(this), this.tables = this.tables || {}, this.tables = new Proxy(this.tables, {
20337
+ this.supported = !0, this.glyphs = new we.GlyphSet(this, n.glyphs || []), this.encoding = new nl(this), this.position = new k0(this), this.substitution = new B0(this), this.tables = this.tables || {}, this.tables = new Proxy(this.tables, {
20336
20338
  set: (t, e, s) => (t[e] = s, t.fvar && (t.gvar || t.cff2) && !this.variation && (this.variation = new $0(this)), !0)
20337
20339
  }), this.palettes = new Il(this), this.layers = new R0(this), this.svgImages = new D0(this), this._push = null, this._hmtxTableData = {}, Object.defineProperty(this, "hinting", {
20338
20340
  get: function() {
@@ -20641,8 +20643,8 @@ function Gm(n, t) {
20641
20643
  };
20642
20644
  return s >= 1.2 && (i.markGlyphSets = e.parsePointer(Hm)), i;
20643
20645
  }
20644
- var Vm = { parse: Gm }, fe = new Array(10);
20645
- fe[1] = function() {
20646
+ var Vm = { parse: Gm }, pe = new Array(10);
20647
+ pe[1] = function() {
20646
20648
  const t = this.offset + this.relativeOffset, e = this.parseUShort();
20647
20649
  if (e === 1)
20648
20650
  return {
@@ -20658,7 +20660,7 @@ fe[1] = function() {
20658
20660
  };
20659
20661
  V.assert(!1, "0x" + t.toString(16) + ": GPOS lookup type 1 format must be 1 or 2.");
20660
20662
  };
20661
- fe[2] = function() {
20663
+ pe[2] = function() {
20662
20664
  const t = this.offset + this.relativeOffset, e = this.parseUShort();
20663
20665
  V.assert(e === 1 || e === 2, "0x" + t.toString(16) + ": GPOS lookup type 2 format must be 1 or 2.");
20664
20666
  const s = this.parsePointer(A.coverage), i = this.parseUShort(), r = this.parseUShort();
@@ -20698,25 +20700,25 @@ fe[2] = function() {
20698
20700
  };
20699
20701
  }
20700
20702
  };
20701
- fe[3] = function() {
20703
+ pe[3] = function() {
20702
20704
  return { error: "GPOS Lookup 3 not supported" };
20703
20705
  };
20704
- fe[4] = function() {
20706
+ pe[4] = function() {
20705
20707
  return { error: "GPOS Lookup 4 not supported" };
20706
20708
  };
20707
- fe[5] = function() {
20709
+ pe[5] = function() {
20708
20710
  return { error: "GPOS Lookup 5 not supported" };
20709
20711
  };
20710
- fe[6] = function() {
20712
+ pe[6] = function() {
20711
20713
  return { error: "GPOS Lookup 6 not supported" };
20712
20714
  };
20713
- fe[7] = function() {
20715
+ pe[7] = function() {
20714
20716
  return { error: "GPOS Lookup 7 not supported" };
20715
20717
  };
20716
- fe[8] = function() {
20718
+ pe[8] = function() {
20717
20719
  return { error: "GPOS Lookup 8 not supported" };
20718
20720
  };
20719
- fe[9] = function() {
20721
+ pe[9] = function() {
20720
20722
  return { error: "GPOS Lookup 9 not supported" };
20721
20723
  };
20722
20724
  function Wm(n, t) {
@@ -20726,12 +20728,12 @@ function Wm(n, t) {
20726
20728
  version: s,
20727
20729
  scripts: e.parseScriptList(),
20728
20730
  features: e.parseFeatureList(),
20729
- lookups: e.parseLookupList(fe)
20731
+ lookups: e.parseLookupList(pe)
20730
20732
  } : {
20731
20733
  version: s,
20732
20734
  scripts: e.parseScriptList(),
20733
20735
  features: e.parseFeatureList(),
20734
- lookups: e.parseLookupList(fe),
20736
+ lookups: e.parseLookupList(pe),
20735
20737
  variations: e.parseFeatureVariationsList()
20736
20738
  };
20737
20739
  }
@@ -21119,7 +21121,7 @@ function Mc(n) {
21119
21121
  return console.error("THREE.BufferGeometryUtils: .mergeAttributes() failed. BufferAttribute.gpuType must be consistent across matching attributes."), null;
21120
21122
  r += l.count * e;
21121
21123
  }
21122
- const a = new t(r), o = new le(a, e, s);
21124
+ const a = new t(r), o = new ue(a, e, s);
21123
21125
  let c = 0;
21124
21126
  for (let h = 0; h < n.length; ++h) {
21125
21127
  const l = n[h];
@@ -21730,9 +21732,9 @@ var Wl = { exports: {} }, Ma = {}, Gi = {};
21730
21732
  Gi.byteLength = ky;
21731
21733
  Gi.toByteArray = My;
21732
21734
  Gi.fromByteArray = Ly;
21733
- var ye = [], Jt = [], Fy = typeof Uint8Array < "u" ? Uint8Array : Array, Or = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
21735
+ var xe = [], Jt = [], Fy = typeof Uint8Array < "u" ? Uint8Array : Array, Or = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
21734
21736
  for (var In = 0, Ay = Or.length; In < Ay; ++In)
21735
- ye[In] = Or[In], Jt[Or.charCodeAt(In)] = In;
21737
+ xe[In] = Or[In], Jt[Or.charCodeAt(In)] = In;
21736
21738
  Jt[45] = 62;
21737
21739
  Jt[95] = 63;
21738
21740
  function ql(n) {
@@ -21758,7 +21760,7 @@ function My(n) {
21758
21760
  return i === 2 && (t = Jt[n.charCodeAt(c)] << 2 | Jt[n.charCodeAt(c + 1)] >> 4, r[a++] = t & 255), i === 1 && (t = Jt[n.charCodeAt(c)] << 10 | Jt[n.charCodeAt(c + 1)] << 4 | Jt[n.charCodeAt(c + 2)] >> 2, r[a++] = t >> 8 & 255, r[a++] = t & 255), r;
21759
21761
  }
21760
21762
  function Oy(n) {
21761
- return ye[n >> 18 & 63] + ye[n >> 12 & 63] + ye[n >> 6 & 63] + ye[n & 63];
21763
+ return xe[n >> 18 & 63] + xe[n >> 12 & 63] + xe[n >> 6 & 63] + xe[n & 63];
21762
21764
  }
21763
21765
  function _y(n, t, e) {
21764
21766
  for (var s, i = [], r = t; r < e; r += 3)
@@ -21769,9 +21771,9 @@ function Ly(n) {
21769
21771
  for (var t, e = n.length, s = e % 3, i = [], r = 16383, a = 0, o = e - s; a < o; a += r)
21770
21772
  i.push(_y(n, a, a + r > o ? o : a + r));
21771
21773
  return s === 1 ? (t = n[e - 1], i.push(
21772
- ye[t >> 2] + ye[t << 4 & 63] + "=="
21774
+ xe[t >> 2] + xe[t << 4 & 63] + "=="
21773
21775
  )) : s === 2 && (t = (n[e - 2] << 8) + n[e - 1], i.push(
21774
- ye[t >> 10] + ye[t >> 4 & 63] + ye[t << 2 & 63] + "="
21776
+ xe[t >> 10] + xe[t >> 4 & 63] + xe[t << 2 & 63] + "="
21775
21777
  )), i.join("");
21776
21778
  }
21777
21779
  var Oa = {};
@@ -22049,7 +22051,7 @@ Oa.write = function(n, t, e, s, i, r) {
22049
22051
  for (C || (C = "utf8"); ; )
22050
22052
  switch (C) {
22051
22053
  case "hex":
22052
- return Ct(this, m, y);
22054
+ return Tt(this, m, y);
22053
22055
  case "utf8":
22054
22056
  case "utf-8":
22055
22057
  return U(this, m, y);
@@ -22297,11 +22299,11 @@ Oa.write = function(n, t, e, s, i, r) {
22297
22299
  T += String.fromCharCode(C[k]);
22298
22300
  return T;
22299
22301
  }
22300
- function Ct(C, m, y) {
22302
+ function Tt(C, m, y) {
22301
22303
  var T = C.length;
22302
22304
  (!m || m < 0) && (m = 0), (!y || y < 0 || y > T) && (y = T);
22303
22305
  for (var k = "", _ = m; _ < y; ++_)
22304
- k += Ce[C[_]];
22306
+ k += Te[C[_]];
22305
22307
  return k;
22306
22308
  }
22307
22309
  function ut(C, m, y) {
@@ -22496,9 +22498,9 @@ Oa.write = function(n, t, e, s, i, r) {
22496
22498
  }
22497
22499
  return this;
22498
22500
  };
22499
- var Tt = /[^+/0-9A-Za-z-_]/g;
22501
+ var Ft = /[^+/0-9A-Za-z-_]/g;
22500
22502
  function ht(C) {
22501
- if (C = C.split("=")[0], C = C.trim().replace(Tt, ""), C.length < 2) return "";
22503
+ if (C = C.split("=")[0], C = C.trim().replace(Ft, ""), C.length < 2) return "";
22502
22504
  for (; C.length % 4 !== 0; )
22503
22505
  C = C + "=";
22504
22506
  return C;
@@ -22577,7 +22579,7 @@ Oa.write = function(n, t, e, s, i, r) {
22577
22579
  function Mt(C) {
22578
22580
  return C !== C;
22579
22581
  }
22580
- var Ce = function() {
22582
+ var Te = function() {
22581
22583
  for (var C = "0123456789abcdef", m = new Array(256), y = 0; y < 16; ++y)
22582
22584
  for (var T = y * 16, k = 0; k < 16; ++k)
22583
22585
  m[T + k] = C[y] + C[k];
@@ -22920,16 +22922,16 @@ function Uy() {
22920
22922
  }
22921
22923
  }, Ir;
22922
22924
  }
22923
- var Oe = {}, Rc;
22925
+ var _e = {}, Rc;
22924
22926
  function Py() {
22925
- if (Rc) return Oe;
22927
+ if (Rc) return _e;
22926
22928
  Rc = 1;
22927
22929
  var n = en.Buffer;
22928
- Oe._utf32 = t;
22930
+ _e._utf32 = t;
22929
22931
  function t(h, l) {
22930
22932
  this.iconv = l, this.bomAware = !0, this.isLE = h.isLE;
22931
22933
  }
22932
- Oe.utf32le = { type: "_utf32", isLE: !0 }, Oe.utf32be = { type: "_utf32", isLE: !1 }, Oe.ucs4le = "utf32le", Oe.ucs4be = "utf32be", t.prototype.encoder = e, t.prototype.decoder = s;
22934
+ _e.utf32le = { type: "_utf32", isLE: !0 }, _e.utf32be = { type: "_utf32", isLE: !1 }, _e.ucs4le = "utf32le", _e.ucs4be = "utf32be", t.prototype.encoder = e, t.prototype.decoder = s;
22933
22935
  function e(h, l) {
22934
22936
  this.isLE = l.isLE, this.highSurrogate = 0;
22935
22937
  }
@@ -22982,7 +22984,7 @@ function Py() {
22982
22984
  }
22983
22985
  s.prototype.end = function() {
22984
22986
  this.overflow.length = 0;
22985
- }, Oe.utf32 = r, Oe.ucs4 = "utf32";
22987
+ }, _e.utf32 = r, _e.ucs4 = "utf32";
22986
22988
  function r(h, l) {
22987
22989
  this.iconv = l;
22988
22990
  }
@@ -23037,7 +23039,7 @@ function Py() {
23037
23039
  }
23038
23040
  return x - d > g - p ? "utf-32be" : x - d < g - p ? "utf-32le" : l || "utf-32le";
23039
23041
  }
23040
- return Oe;
23042
+ return _e;
23041
23043
  }
23042
23044
  var ri = {}, Dc;
23043
23045
  function Ny() {
@@ -33052,7 +33054,7 @@ const Xe = class Xe extends Ah {
33052
33054
  };
33053
33055
  Xe.NOT_ENCODABLE = -1;
33054
33056
  let ua = Xe;
33055
- class xe {
33057
+ class be {
33056
33058
  constructor() {
33057
33059
  }
33058
33060
  /**
@@ -33060,7 +33062,7 @@ class xe {
33060
33062
  * @returns The FontFactory instance
33061
33063
  */
33062
33064
  static get instance() {
33063
- return xe._instance || (xe._instance = new xe()), xe._instance;
33065
+ return be._instance || (be._instance = new be()), be._instance;
33064
33066
  }
33065
33067
  /**
33066
33068
  * Creates a font instance based on the provided font data.
@@ -33078,7 +33080,7 @@ class xe {
33078
33080
  throw new Error("Unsupported font data type");
33079
33081
  }
33080
33082
  }
33081
- class he {
33083
+ class le {
33082
33084
  constructor() {
33083
33085
  this.fontMapping = {}, this.loadedFontMap = /* @__PURE__ */ new Map(), this.unsupportedChars = {}, this.missedFonts = {}, this.enableFontCache = !0, this.lazyFontLoading = !0, this.awaitFontsBeforeDraw = !1, this.defaultFonts = /* @__PURE__ */ new Set(["simsun"]), this.symbolFonts = /* @__PURE__ */ new Set(["simplex", "amgdt"]), this.events = {
33084
33086
  /** Event triggered when a font cannot be found */
@@ -33092,7 +33094,7 @@ class he {
33092
33094
  * @returns The FontManager instance
33093
33095
  */
33094
33096
  static get instance() {
33095
- return he._instance || (he._instance = new he()), he._instance;
33097
+ return le._instance || (le._instance = new le()), le._instance;
33096
33098
  }
33097
33099
  /**
33098
33100
  * Base URL to load fonts
@@ -33166,10 +33168,10 @@ class he {
33166
33168
  return t.map((i) => ({ ...i, source: "remote" }));
33167
33169
  const e = /* @__PURE__ */ new Map();
33168
33170
  for (const i of t) {
33169
- const r = We(i.file).toLowerCase();
33171
+ const r = qe(i.file).toLowerCase();
33170
33172
  e.set(r, { ...i, source: "remote" });
33171
33173
  }
33172
- const s = await qe.instance.getAll();
33174
+ const s = await re.instance.getAll();
33173
33175
  for (const i of s) {
33174
33176
  const r = i.name.toLowerCase();
33175
33177
  e.has(r) || e.set(r, this.cachedFontDataToFontInfo(i));
@@ -33228,7 +33230,7 @@ class he {
33228
33230
  const s = this.fontRequestInFlight.get(e);
33229
33231
  if (s)
33230
33232
  return s;
33231
- const i = this.loadEpoch, r = this.loadFontsByNames(e).then((a) => (i !== this.loadEpoch || (this.isFontLoaded(e) ? this.fontRequestFailed.delete(e) : this.fontRequestFailed.add(e)), a)).catch(() => (i === this.loadEpoch && this.fontRequestFailed.add(e), [
33233
+ const i = this.loadEpoch, r = this.loadFontsByNames(e).then((a) => (i !== this.loadEpoch || (this.isFontLoaded(e) ? this.fontRequestFailed.delete(e) : a.some((c) => c.status === "FailedToLoad") && this.fontRequestFailed.add(e)), a)).catch(() => (i === this.loadEpoch && this.fontRequestFailed.add(e), [
33232
33234
  {
33233
33235
  fontName: e,
33234
33236
  url: "",
@@ -33254,7 +33256,7 @@ class he {
33254
33256
  return "";
33255
33257
  let e = String(t);
33256
33258
  const s = e.lastIndexOf(".");
33257
- return (s > 0 && s == e.length - 4 || s == e.length - 5) && (e = e.substring(0, s)), e.toLowerCase();
33259
+ return s > 0 && (s === e.length - 4 || s === e.length - 5) && (e = e.substring(0, s)), e.toLowerCase();
33258
33260
  }
33259
33261
  /**
33260
33262
  * Parses a user-uploaded font file, registers it for rendering, and stores
@@ -33272,7 +33274,7 @@ class he {
33272
33274
  let r, a;
33273
33275
  if (typeof File < "u" && t instanceof File ? (r = await t.arrayBuffer(), a = e ?? t.name) : (r = t, a = e ?? ""), !a)
33274
33276
  throw new Error("fileName is required when caching an ArrayBuffer");
33275
- const o = We(a).toLowerCase();
33277
+ const o = qe(a).toLowerCase();
33276
33278
  if (!o)
33277
33279
  return {
33278
33280
  fontName: "",
@@ -33304,8 +33306,8 @@ class he {
33304
33306
  data: r
33305
33307
  };
33306
33308
  try {
33307
- const u = xe.instance.createFont(l);
33308
- return h.forEach((f) => u.names.add(f)), this.registerFontInMap(o, u), this.enableFontCache && await qe.instance.set(o, l), this.events.fontLoaded.dispatch({ fontName: o }), {
33309
+ const u = be.instance.createFont(l);
33310
+ return h.forEach((f) => u.names.add(f)), this.registerFontInMap(o, u), this.enableFontCache && await re.instance.set(o, l), this.events.fontLoaded.dispatch({ fontName: o }), {
33309
33311
  fontName: o,
33310
33312
  url: "",
33311
33313
  status: "Success"
@@ -33329,14 +33331,14 @@ class he {
33329
33331
  var i;
33330
33332
  if (!this.enableFontCache || !t)
33331
33333
  return !1;
33332
- const e = We(t).toLowerCase();
33334
+ const e = qe(t).toLowerCase();
33333
33335
  if (this.isFontLoaded(e))
33334
33336
  return !0;
33335
- const s = await qe.instance.find(t);
33337
+ const s = await re.instance.find(t);
33336
33338
  if (!s)
33337
33339
  return !1;
33338
33340
  try {
33339
- const r = xe.instance.createFont(s);
33341
+ const r = be.instance.createFont(s);
33340
33342
  return (i = s.alias) == null || i.forEach((a) => r.names.add(a)), this.registerFontInMap(s.name, r), this.events.fontLoaded.dispatch({ fontName: s.name }), !0;
33341
33343
  } catch {
33342
33344
  return !1;
@@ -33355,14 +33357,14 @@ class he {
33355
33357
  const s = [];
33356
33358
  return await Promise.allSettled(e).then((i) => {
33357
33359
  i.forEach((r, a) => {
33358
- const o = t[a].url, c = We(
33360
+ const o = t[a].url, c = qe(
33359
33361
  t[a].file || o
33360
- ).toLowerCase(), h = r.status === "fulfilled" && this.isFontLoaded(c);
33362
+ ).toLowerCase(), h = t[a].name ?? [], l = r.status === "fulfilled" && (this.isFontLoaded(c) || h.some((u) => this.isFontLoaded(u)));
33361
33363
  s.push({
33362
33364
  fontName: c,
33363
33365
  url: o,
33364
- status: h ? "Success" : "FailedToLoad"
33365
- }), h && this.fileNames.push(c);
33366
+ status: l ? "Success" : "FailedToLoad"
33367
+ }), l && this.fileNames.push(c);
33366
33368
  });
33367
33369
  }), s;
33368
33370
  }
@@ -33386,7 +33388,7 @@ class he {
33386
33388
  return i = this.loadedFontMap.get(c.toLowerCase()), !i && this.lazyFontLoading && this.requestFont(c), this.recordMissedFonts(s, !1), c;
33387
33389
  }
33388
33390
  if (i)
33389
- return e;
33391
+ return s || e;
33390
33392
  this.recordMissedFonts(s, !0);
33391
33393
  const r = this.pickLoadedDefaultFont(!0);
33392
33394
  if (r)
@@ -33421,7 +33423,7 @@ class he {
33421
33423
  getFontByName(t, e = !0) {
33422
33424
  t == null && (t = "");
33423
33425
  const s = t.lastIndexOf(".");
33424
- (s > 0 && s == t.length - 4 || s == t.length - 5) && (t = t.substring(0, s));
33426
+ s > 0 && (s === t.length - 4 || s === t.length - 5) && (t = t.substring(0, s));
33425
33427
  const i = this.loadedFontMap.get(t.toLowerCase());
33426
33428
  if (!i) {
33427
33429
  e && this.recordMissedFonts(t);
@@ -33502,7 +33504,7 @@ class he {
33502
33504
  * @returns The scale factor for the font, or 1 if the font is not found
33503
33505
  */
33504
33506
  getFontScaleFactor(t) {
33505
- const e = this.loadedFontMap.get(t.toLowerCase());
33507
+ const e = this.getFontByName(t, !1);
33506
33508
  return e ? e.getScaleFactor() : 1;
33507
33509
  }
33508
33510
  /**
@@ -33511,8 +33513,8 @@ class he {
33511
33513
  * @returns The type of the font. If the specified font can't be found, `undefined` is returned
33512
33514
  */
33513
33515
  getFontType(t) {
33514
- const e = this.loadedFontMap.get(t.toLowerCase());
33515
- return e == null ? void 0 : e.type;
33516
+ var e;
33517
+ return (e = this.getFontByName(t, !1)) == null ? void 0 : e.type;
33516
33518
  }
33517
33519
  /**
33518
33520
  * Gets the type of the SHX font. Such as BIGFONT, SHAPES, UNIFONT.
@@ -33520,7 +33522,7 @@ class he {
33520
33522
  * @returns The type of the SHX font, or undefined if the specified font is not a SHX font
33521
33523
  */
33522
33524
  getShxFontType(t) {
33523
- const e = this.loadedFontMap.get(t.toLowerCase());
33525
+ const e = this.getFontByName(t, !1);
33524
33526
  return (e == null ? void 0 : e.type) === "shx" ? e.data.header.fontType : void 0;
33525
33527
  }
33526
33528
  /**
@@ -33540,7 +33542,8 @@ class he {
33540
33542
  * @returns True if the font is loaded, false otherwise
33541
33543
  */
33542
33544
  isFontLoaded(t) {
33543
- return this.loadedFontMap.has(t.toLowerCase());
33545
+ const e = this.normalizeFontName(t);
33546
+ return !!e && this.loadedFontMap.has(e);
33544
33547
  }
33545
33548
  /**
33546
33549
  * Applies a missed-font report from another isolate (e.g. a web worker).
@@ -33587,7 +33590,7 @@ class he {
33587
33590
  if (!t)
33588
33591
  return t;
33589
33592
  const e = t.lastIndexOf(".");
33590
- return e > 0 && e == t.length - 4 || e == t.length - 5 ? t.substring(0, e) : t;
33593
+ return e > 0 && (e === t.length - 4 || e === t.length - 5) ? t.substring(0, e) : t;
33591
33594
  }
33592
33595
  /**
33593
33596
  * Removes {@link missedFonts} entries whose name matches `fontName`
@@ -33609,6 +33612,51 @@ class he {
33609
33612
  count: this.missedFonts[t]
33610
33613
  }), e && this.lazyFontLoading && this.requestFont(t)));
33611
33614
  }
33615
+ /**
33616
+ * Adds catalog / `fonts.json` names onto a font instance.
33617
+ */
33618
+ applyCatalogNames(t, e) {
33619
+ e.forEach((s) => {
33620
+ s && t.names.add(s);
33621
+ });
33622
+ }
33623
+ /**
33624
+ * Ensures an already-loaded primary face is also addressable under the
33625
+ * current catalog names. Needed when IndexedDB still has an older alias
33626
+ * list (e.g. `noto-sans-kr` cached before `malgun` was added) or when the
33627
+ * binary was loaded under the file basename first.
33628
+ */
33629
+ ensureCatalogAliases(t, e) {
33630
+ const s = this.loadedFontMap.get(t.toLowerCase()) ?? e.map((i) => this.loadedFontMap.get(i.toLowerCase())).find((i) => i != null);
33631
+ s && (this.applyCatalogNames(s, e), this.registerFontInMap(t, s));
33632
+ }
33633
+ /**
33634
+ * Merges catalog / primary names into an existing IndexedDB alias list so
33635
+ * cold starts after `getAllFontsFromCache` pick up newly added style names.
33636
+ */
33637
+ async persistCatalogAliases(t, e) {
33638
+ if (!this.enableFontCache)
33639
+ return;
33640
+ const s = await re.instance.get(t);
33641
+ if (!s)
33642
+ return;
33643
+ const i = [
33644
+ .../* @__PURE__ */ new Set([...s.alias ?? [], ...e, t])
33645
+ ], r = s.alias ?? [];
33646
+ i.length === r.length && i.every((a) => r.includes(a)) || await re.instance.set(t, {
33647
+ ...s,
33648
+ alias: i
33649
+ });
33650
+ }
33651
+ /**
33652
+ * Clears miss / failed-request bookkeeping for a primary name and aliases
33653
+ * so a later alias request is not permanently blocked after the binary
33654
+ * loaded under a different key.
33655
+ */
33656
+ clearRequestStateForNames(t) {
33657
+ for (const e of t)
33658
+ e && (this.clearMissedFontEntry(e), this.fontRequestFailed.delete(e.toLowerCase()));
33659
+ }
33612
33660
  /**
33613
33661
  * Loads a single font
33614
33662
  * @param fontInfo - The matadata of the font to be loaded
@@ -33616,30 +33664,49 @@ class he {
33616
33664
  async loadFont(t) {
33617
33665
  if (!Eh(t.file))
33618
33666
  throw new Error(`Invalid font file name: ${t.file}`);
33619
- const s = this.fontInfoToFontData(t), i = s.name;
33620
- if (this.isFontLoaded(s.name))
33667
+ const s = this.fontInfoToFontData(t), i = s.name, r = t.name ?? [];
33668
+ if (this.isFontLoaded(s.name)) {
33669
+ this.ensureCatalogAliases(i, r), this.clearRequestStateForNames([i, ...r]), await this.persistCatalogAliases(i, r);
33621
33670
  return;
33622
- const r = this.loadEpoch, a = await qe.instance.get(i);
33623
- if (r === this.loadEpoch) {
33624
- if (a) {
33625
- if (await new Promise((c) => setTimeout(c, 0)), r !== this.loadEpoch || this.isFontLoaded(i))
33626
- return;
33627
- const o = xe.instance.createFont(a);
33628
- o && this.registerFontInMap(i, o);
33629
- } else {
33630
- const o = await this.loader.loadAsync(t.url);
33631
- if (r !== this.loadEpoch || (s.data = o, await new Promise((h) => setTimeout(h, 0)), r !== this.loadEpoch || this.isFontLoaded(i)))
33632
- return;
33633
- const c = xe.instance.createFont(s);
33634
- c && (t.name.forEach((h) => c.names.add(h)), this.registerFontInMap(i, c), this.enableFontCache && await qe.instance.set(i, s));
33671
+ }
33672
+ const a = this.loadEpoch, o = this.enableFontCache ? await re.instance.get(i) : void 0;
33673
+ if (a !== this.loadEpoch)
33674
+ return;
33675
+ let c = !1;
33676
+ if (o) {
33677
+ if (await new Promise((h) => setTimeout(h, 0)), a !== this.loadEpoch)
33678
+ return;
33679
+ if (this.isFontLoaded(i)) {
33680
+ this.ensureCatalogAliases(i, r), this.clearRequestStateForNames([i, ...r]), await this.persistCatalogAliases(i, r);
33681
+ return;
33635
33682
  }
33636
- r !== this.loadEpoch || !this.isFontLoaded(i) || (this.clearMissedFontEntry(i), this.fontRequestFailed.delete(i.toLowerCase()), this.events.fontLoaded.dispatch({
33637
- fontName: i
33638
- }));
33683
+ try {
33684
+ const h = be.instance.createFont(o);
33685
+ h && (this.applyCatalogNames(h, r), this.registerFontInMap(i, h), await this.persistCatalogAliases(i, r), c = !0);
33686
+ } catch {
33687
+ try {
33688
+ await re.instance.delete(i);
33689
+ } catch {
33690
+ }
33691
+ }
33692
+ }
33693
+ if (!c && !this.isFontLoaded(i)) {
33694
+ const h = await this.loader.loadAsync(t.url);
33695
+ if (a !== this.loadEpoch || (s.data = h, await new Promise((u) => setTimeout(u, 0)), a !== this.loadEpoch))
33696
+ return;
33697
+ if (this.isFontLoaded(i)) {
33698
+ this.ensureCatalogAliases(i, r), this.clearRequestStateForNames([i, ...r]), await this.persistCatalogAliases(i, r);
33699
+ return;
33700
+ }
33701
+ const l = be.instance.createFont(s);
33702
+ l && (this.applyCatalogNames(l, r), this.registerFontInMap(i, l), this.enableFontCache && await re.instance.set(i, s));
33639
33703
  }
33704
+ a !== this.loadEpoch || !this.isFontLoaded(i) || (this.clearRequestStateForNames([i, ...r]), this.events.fontLoaded.dispatch({
33705
+ fontName: i
33706
+ }));
33640
33707
  }
33641
33708
  fontInfoToFontData(t) {
33642
- const e = We(t.file).toLowerCase(), s = ["ttf", "otf", "woff"].includes(t.type) ? "mesh" : t.type;
33709
+ const e = qe(t.file).toLowerCase(), s = ["ttf", "otf", "woff"].includes(t.type) ? "mesh" : t.type;
33643
33710
  return {
33644
33711
  name: e,
33645
33712
  alias: t.name,
@@ -33653,12 +33720,12 @@ class he {
33653
33720
  async getAllFontsFromCache() {
33654
33721
  if (this.loadedFontMap.size !== 0)
33655
33722
  return;
33656
- const t = await qe.instance.getAll();
33723
+ const t = await re.instance.getAll();
33657
33724
  for (const e of t) {
33658
33725
  const { name: s } = e;
33659
33726
  if (this.fileNames && !this.fileNames.includes(s))
33660
33727
  continue;
33661
- const i = xe.instance.createFont(e);
33728
+ const i = be.instance.createFont(e);
33662
33729
  this.registerFontInMap(s, i);
33663
33730
  }
33664
33731
  }
@@ -33682,7 +33749,7 @@ class he {
33682
33749
  }
33683
33750
  buildUploadedFontAliases(t, e, s) {
33684
33751
  const i = /* @__PURE__ */ new Set();
33685
- return i.add(t), i.add(We(e)), s == null || s.forEach((r) => {
33752
+ return i.add(t), i.add(qe(e)), s == null || s.forEach((r) => {
33686
33753
  r && i.add(r);
33687
33754
  }), [...i];
33688
33755
  }
@@ -33746,7 +33813,9 @@ class he {
33746
33813
  const e = /* @__PURE__ */ new Set();
33747
33814
  for (const a of this.loadedFontMap.values())
33748
33815
  e.add(a);
33749
- const s = Array.from(e).map((a) => a.estimateMemoryUsage()), i = (t == null ? void 0 : t.materials) ?? Uh(), r = s.reduce((a, o) => a + o.estimatedBytes, 0);
33816
+ const s = Array.from(e).map(
33817
+ (a) => a.estimateMemoryUsage()
33818
+ ), i = (t == null ? void 0 : t.materials) ?? Uh(), r = s.reduce((a, o) => a + o.estimatedBytes, 0);
33750
33819
  return {
33751
33820
  id: (t == null ? void 0 : t.id) ?? "main",
33752
33821
  inFlightRequests: t == null ? void 0 : t.inFlightRequests,
@@ -33761,7 +33830,7 @@ class rx {
33761
33830
  * Creates a new instance of DefaultFontLoader
33762
33831
  */
33763
33832
  constructor() {
33764
- this._availableFontsPromise = null, this._avaiableFonts = [], this._avaiableFontMap = /* @__PURE__ */ new Map(), this._baseUrl = "https://cdn.jsdelivr.net/gh/mlightcad/cad-data/fonts/";
33833
+ this._availableFontsPromise = null, this._catalogRefreshAttempted = !1, this._avaiableFonts = [], this._avaiableFontMap = /* @__PURE__ */ new Map(), this._baseUrl = "https://cdn.jsdelivr.net/gh/mlightcad/cad-data/fonts/";
33765
33834
  }
33766
33835
  /**
33767
33836
  * Base URL to load fonts
@@ -33770,7 +33839,7 @@ class rx {
33770
33839
  return this._baseUrl;
33771
33840
  }
33772
33841
  set baseUrl(t) {
33773
- this._baseUrl !== t && (this._baseUrl = t, this._avaiableFonts = [], this._avaiableFontMap.clear(), this._availableFontsPromise = null, this.onFontUrlChanged(t));
33842
+ this._baseUrl !== t && (this._baseUrl = t, this.clearAvailableFontsCache(), this._catalogRefreshAttempted = !1, this.onFontUrlChanged(t));
33774
33843
  }
33775
33844
  /**
33776
33845
  * Gets the list of available fonts
@@ -33813,81 +33882,99 @@ class rx {
33813
33882
  async load(t) {
33814
33883
  if (t == null || t.length === 0)
33815
33884
  return [];
33816
- await this.getAvailableFonts();
33817
- const e = [], s = [], i = /* @__PURE__ */ new Map();
33818
- t.forEach((c) => {
33819
- const h = c.toLowerCase(), l = this._avaiableFontMap.get(h);
33820
- l && (i.set(h, l), he.instance.isFontLoaded(h) && e.push({
33821
- fontName: h,
33822
- url: l.url,
33885
+ await this.getAvailableFonts(), t.some(
33886
+ (h) => !this._avaiableFontMap.has(h.toLowerCase())
33887
+ ) && !this._catalogRefreshAttempted && (this._catalogRefreshAttempted = !0, await this.refreshAvailableFontsFromNetwork());
33888
+ const s = [], i = [], r = /* @__PURE__ */ new Map();
33889
+ t.forEach((h) => {
33890
+ const l = h.toLowerCase(), u = this._avaiableFontMap.get(l);
33891
+ u && (r.set(l, u), le.instance.isFontLoaded(l) && s.push({
33892
+ fontName: l,
33893
+ url: u.url,
33823
33894
  status: "Success"
33824
- }), s.push(l));
33895
+ }), i.push(u));
33825
33896
  });
33826
- const r = await he.instance.loadFonts(s), a = {};
33827
- [...e, ...r].forEach((c) => {
33828
- a[c.fontName] = c;
33897
+ const a = await le.instance.loadFonts(i), o = {};
33898
+ [...s, ...a].forEach((h) => {
33899
+ o[h.fontName] = h;
33829
33900
  });
33830
- const o = [];
33831
- for (const c of t) {
33832
- const h = c.toLowerCase(), l = a[h];
33833
- if (l) {
33834
- o.push(l);
33901
+ const c = [];
33902
+ for (const h of t) {
33903
+ const l = h.toLowerCase(), u = o[l];
33904
+ if (u) {
33905
+ c.push(u);
33835
33906
  continue;
33836
33907
  }
33837
- const u = i.get(h);
33838
- if (u) {
33839
- if (he.instance.isFontLoaded(h)) {
33840
- o.push({
33841
- fontName: h,
33842
- url: u.url,
33908
+ const f = r.get(l);
33909
+ if (f) {
33910
+ if (le.instance.isFontLoaded(l)) {
33911
+ c.push({
33912
+ fontName: l,
33913
+ url: f.url,
33843
33914
  status: "Success"
33844
33915
  });
33845
33916
  continue;
33846
33917
  }
33847
- const f = We(
33848
- u.file
33849
- ).toLowerCase(), p = a[f];
33850
- if (p) {
33851
- o.push({
33852
- fontName: h,
33853
- url: u.url,
33854
- status: p.status
33918
+ const p = qe(
33919
+ f.file
33920
+ ).toLowerCase(), d = o[p];
33921
+ if (d) {
33922
+ c.push({
33923
+ fontName: l,
33924
+ url: f.url,
33925
+ status: d.status
33855
33926
  });
33856
33927
  continue;
33857
33928
  }
33858
33929
  }
33859
- if (await he.instance.loadFontFromCache(c)) {
33860
- o.push({
33861
- fontName: h,
33930
+ if (await le.instance.loadFontFromCache(h)) {
33931
+ c.push({
33932
+ fontName: l,
33862
33933
  url: "",
33863
33934
  status: "Success"
33864
33935
  });
33865
33936
  continue;
33866
33937
  }
33867
- o.push({
33868
- fontName: h,
33938
+ c.push({
33939
+ fontName: l,
33869
33940
  url: "",
33870
33941
  status: "NotFound"
33871
33942
  });
33872
33943
  }
33873
- return o;
33944
+ return c;
33945
+ }
33946
+ clearAvailableFontsCache() {
33947
+ this._avaiableFonts = [], this._avaiableFontMap.clear(), this._availableFontsPromise = null;
33948
+ }
33949
+ /**
33950
+ * Drops the in-memory catalog and refetches `fonts.json`, bypassing the HTTP
33951
+ * cache so CDN updates are visible after a miss.
33952
+ */
33953
+ async refreshAvailableFontsFromNetwork() {
33954
+ this.clearAvailableFontsCache();
33955
+ const t = this._baseUrl, e = this.fetchAvailableFonts(t, {
33956
+ bypassHttpCache: !0
33957
+ }).finally(() => {
33958
+ this._availableFontsPromise === e && (this._availableFontsPromise = null);
33959
+ });
33960
+ return this._availableFontsPromise = e, e;
33874
33961
  }
33875
33962
  /**
33876
33963
  * Fetches and caches remote font metadata for the given base URL.
33877
33964
  */
33878
- async fetchAvailableFonts(t) {
33879
- const e = t + "fonts.json";
33880
- let s;
33965
+ async fetchAvailableFonts(t, e) {
33966
+ const s = t + "fonts.json";
33967
+ let i;
33881
33968
  try {
33882
- s = await (await fetch(e)).json();
33883
- } catch (i) {
33969
+ i = await (e != null && e.bypassHttpCache ? await fetch(s, { cache: "no-cache" }) : await fetch(s)).json();
33970
+ } catch (r) {
33884
33971
  throw new Error(
33885
- `Filed to get avaiable font from '${e}' due to ${i}!`
33972
+ `Filed to get avaiable font from '${s}' due to ${r}!`
33886
33973
  );
33887
33974
  }
33888
- return this._baseUrl !== t ? this.getAvailableFonts() : (s.forEach((i) => {
33889
- i.url = t + i.file;
33890
- }), this._avaiableFonts = s, this.buildFontMap(), this._avaiableFonts);
33975
+ return this._baseUrl !== t ? this.getAvailableFonts() : (i.forEach((r) => {
33976
+ r.url = t + r.file;
33977
+ }), this._avaiableFonts = i, this.buildFontMap(), this._avaiableFonts);
33891
33978
  }
33892
33979
  /**
33893
33980
  * Build one font map. The key is font name. The value is font info.
@@ -33966,12 +34053,12 @@ class cx {
33966
34053
  return e && t.layer ? `layer_${t.layer}_${s}` : `entity_${s}`;
33967
34054
  }
33968
34055
  }
33969
- var oe = /* @__PURE__ */ ((n) => (n[n.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", n[n.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", n[n.TOP_TO_BOTTOM = 3] = "TOP_TO_BOTTOM", n[n.BOTTOM_TO_TOP = 4] = "BOTTOM_TO_TOP", n[n.BY_STYLE = 5] = "BY_STYLE", n))(oe || {}), nt = /* @__PURE__ */ ((n) => (n[n.TopLeft = 1] = "TopLeft", n[n.TopCenter = 2] = "TopCenter", n[n.TopRight = 3] = "TopRight", n[n.MiddleLeft = 4] = "MiddleLeft", n[n.MiddleCenter = 5] = "MiddleCenter", n[n.MiddleRight = 6] = "MiddleRight", n[n.BottomLeft = 7] = "BottomLeft", n[n.BottomCenter = 8] = "BottomCenter", n[n.BottomRight = 9] = "BottomRight", n[n.BaselineLeft = 10] = "BaselineLeft", n[n.BaselineCenter = 11] = "BaselineCenter", n[n.BaselineRight = 12] = "BaselineRight", n))(nt || {}), dt = /* @__PURE__ */ ((n) => (n.CHAR = "CHAR", n.STACK = "STACK", n))(dt || {});
34056
+ var ce = /* @__PURE__ */ ((n) => (n[n.LEFT_TO_RIGHT = 1] = "LEFT_TO_RIGHT", n[n.RIGHT_TO_LEFT = 2] = "RIGHT_TO_LEFT", n[n.TOP_TO_BOTTOM = 3] = "TOP_TO_BOTTOM", n[n.BOTTOM_TO_TOP = 4] = "BOTTOM_TO_TOP", n[n.BY_STYLE = 5] = "BY_STYLE", n))(ce || {}), nt = /* @__PURE__ */ ((n) => (n[n.TopLeft = 1] = "TopLeft", n[n.TopCenter = 2] = "TopCenter", n[n.TopRight = 3] = "TopRight", n[n.MiddleLeft = 4] = "MiddleLeft", n[n.MiddleCenter = 5] = "MiddleCenter", n[n.MiddleRight = 6] = "MiddleRight", n[n.BottomLeft = 7] = "BottomLeft", n[n.BottomCenter = 8] = "BottomCenter", n[n.BottomRight = 9] = "BottomRight", n[n.BaselineLeft = 10] = "BaselineLeft", n[n.BaselineCenter = 11] = "BaselineCenter", n[n.BaselineRight = 12] = "BaselineRight", n))(nt || {}), dt = /* @__PURE__ */ ((n) => (n.CHAR = "CHAR", n.STACK = "STACK", n))(dt || {});
33970
34057
  const di = "", hx = () => ({
33971
34058
  byLayerColor: 16777215,
33972
34059
  byBlockColor: 16777215,
33973
34060
  layer: "0",
33974
- color: new ve()
34061
+ color: new Se()
33975
34062
  });
33976
34063
  function lx(n) {
33977
34064
  if (!(!n || [
@@ -34067,7 +34154,7 @@ class hn {
34067
34154
  i
34068
34155
  );
34069
34156
  const r = new Dt();
34070
- return r.setAttribute("position", new le(s, 3)), r;
34157
+ return r.setAttribute("position", new ue(s, 3)), r;
34071
34158
  }
34072
34159
  /**
34073
34160
  * Counts how many line segments a geometry represents.
@@ -34097,7 +34184,7 @@ class hn {
34097
34184
  0
34098
34185
  );
34099
34186
  const r = new Dt();
34100
- return r.setAttribute("position", new le(i, 3)), r;
34187
+ return r.setAttribute("position", new ue(i, 3)), r;
34101
34188
  }
34102
34189
  /**
34103
34190
  * Writes transformed line-segment vertices from a source geometry into a flat position buffer.
@@ -34587,7 +34674,7 @@ class sh {
34587
34674
  if (!s)
34588
34675
  return;
34589
34676
  this._lineBatchEntries = [];
34590
- const i = [], r = [], a = [], o = [], c = this.flowDirection === oe.BOTTOM_TO_TOP ? 0 : -this.currentLayoutFontSize, h = this.buildShapeGeometry(
34677
+ const i = [], r = [], a = [], o = [], c = this.flowDirection === ce.BOTTOM_TO_TOP ? 0 : -this.currentLayoutFontSize, h = this.buildShapeGeometry(
34591
34678
  s.shape,
34592
34679
  s.label,
34593
34680
  0,
@@ -34731,7 +34818,7 @@ class sh {
34731
34818
  */
34732
34819
  pushDecorationLine(t, e) {
34733
34820
  const s = new Dt();
34734
- s.setAttribute("position", new le(new Float32Array(e), 3)), s.setIndex([0, 1]), s.userData = { isDecoration: !0 }, t.push(s);
34821
+ s.setAttribute("position", new ue(new Float32Array(e), 3)), s.setIndex([0, 1]), s.userData = { isDecoration: !0 }, t.push(s);
34735
34822
  }
34736
34823
  /**
34737
34824
  * Render the specified texts
@@ -34970,7 +35057,7 @@ class sh {
34970
35057
  P
34971
35058
  );
34972
35059
  e.push(...J), s.push(...D), i.push(...U), r.push(...P);
34973
- const Q = [], yt = [], Pt = [], Ct = [];
35060
+ const Q = [], yt = [], Pt = [], Tt = [];
34974
35061
  this._hOffset = h + I, this._vOffset = R;
34975
35062
  for (const ut of o)
34976
35063
  this.processChar(
@@ -34978,9 +35065,9 @@ class sh {
34978
35065
  Q,
34979
35066
  yt,
34980
35067
  Pt,
34981
- Ct
35068
+ Tt
34982
35069
  );
34983
- e.push(...Q), s.push(...yt), i.push(...Pt), r.push(...Ct), this._hOffset = h + M, F && (this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams());
35070
+ e.push(...Q), s.push(...yt), i.push(...Pt), r.push(...Tt), this._hOffset = h + M, F && (this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams());
34984
35071
  }
34985
35072
  } else {
34986
35073
  const v = [], w = [], F = [], M = [];
@@ -35027,7 +35114,7 @@ class sh {
35027
35114
  ]);
35028
35115
  W.setAttribute(
35029
35116
  "position",
35030
- new le(J, 3)
35117
+ new ue(J, 3)
35031
35118
  ), W.setIndex([0, 1]), W.userData = { isDecoration: !0 }, s.push(W);
35032
35119
  }
35033
35120
  this._hOffset = h + x;
@@ -35083,7 +35170,7 @@ class sh {
35083
35170
  */
35084
35171
  processBlank(t, e) {
35085
35172
  if (this._options.collectCharBoxes !== !1) {
35086
- const s = this._hOffset, i = this.flowDirection == oe.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.currentLayoutFontSize, r = new At(
35173
+ const s = this._hOffset, i = this.flowDirection == ce.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.currentLayoutFontSize, r = new At(
35087
35174
  new E(s, i, 0),
35088
35175
  new E(
35089
35176
  s + this.currentBlankAdvance,
@@ -35123,7 +35210,7 @@ class sh {
35123
35210
  * Appends vertical layout metadata for the current visual line to {@link _lineLayouts}.
35124
35211
  */
35125
35212
  recordCurrentLineLayout() {
35126
- const t = this.flowDirection == oe.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.defaultFontSize, e = this.currentLineHeight;
35213
+ const t = this.flowDirection == ce.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.defaultFontSize, e = this.currentLineHeight;
35127
35214
  this._lineLayouts.push({
35128
35215
  y: t + e / 2,
35129
35216
  height: e
@@ -35173,7 +35260,7 @@ class sh {
35173
35260
  return;
35174
35261
  }
35175
35262
  this._lineHasRenderableChar || this.applyPendingEmptyLineYAdjust(), this.hOffset > (this.maxLineWidth || 1 / 0) && (this.recordVisualLineBreak(i, r), this.advanceToNextLine(!1));
35176
- const h = this.hOffset, l = this.flowDirection == oe.BOTTOM_TO_TOP ? this.vOffset : this.vOffset - this.currentLayoutFontSize, u = this.currentLayoutFontSize, f = c.width * this.currentWidthFactor, { matrix: p, obliqueExtraAdvance: d } = this.buildCharTransformMatrix(
35263
+ const h = this.hOffset, l = this.flowDirection == ce.BOTTOM_TO_TOP ? this.vOffset : this.vOffset - this.currentLayoutFontSize, u = this.currentLayoutFontSize, f = c.width * this.currentWidthFactor, { matrix: p, obliqueExtraAdvance: d } = this.buildCharTransformMatrix(
35177
35264
  h,
35178
35265
  l,
35179
35266
  u
@@ -35360,7 +35447,7 @@ class sh {
35360
35447
  * @param collectBreakIndex When `true`, records a char index for automatic wrapping.
35361
35448
  */
35362
35449
  advanceToNextLine(t = !0) {
35363
- t && this.recordVisualLineBreak(), this.captureCurrentLineAdvance(), this.recordCurrentLineLayout(), this._hOffset = 0, this._lineHasRenderableChar ? this._pendingEmptyLineFontSizeAdjust = void 0 : this._pendingEmptyLineFontSizeAdjust = this.currentFontSize, this.flowDirection == oe.BOTTOM_TO_TOP ? this._vOffset += this.currentLineHeight : this._vOffset -= this.currentLineHeight, this._lineCount++, this.processAlignment(), this._currentLineObjects = [], this._lineCount == 2 ? this._totalHeight = this.currentMaxFontSize : this._totalHeight = this._totalHeight + this.currentLineHeight, this._maxFontSize = 0, this._lineHasRenderableChar = !1;
35450
+ t && this.recordVisualLineBreak(), this.captureCurrentLineAdvance(), this.recordCurrentLineLayout(), this._hOffset = 0, this._lineHasRenderableChar ? this._pendingEmptyLineFontSizeAdjust = void 0 : this._pendingEmptyLineFontSizeAdjust = this.currentFontSize, this.flowDirection == ce.BOTTOM_TO_TOP ? this._vOffset += this.currentLineHeight : this._vOffset -= this.currentLineHeight, this._lineCount++, this.processAlignment(), this._currentLineObjects = [], this._lineCount == 2 ? this._totalHeight = this.currentMaxFontSize : this._totalHeight = this._totalHeight + this.currentLineHeight, this._maxFontSize = 0, this._lineHasRenderableChar = !1;
35364
35451
  }
35365
35452
  /**
35366
35453
  * Updates {@link _maxLineAdvance} from the current line's horizontal pen position.
@@ -35402,7 +35489,7 @@ class sh {
35402
35489
  applyPendingEmptyLineYAdjust() {
35403
35490
  if (this._pendingEmptyLineFontSizeAdjust === void 0) return;
35404
35491
  const t = this.currentFontSize - this._pendingEmptyLineFontSizeAdjust;
35405
- t !== 0 && (this.flowDirection == oe.BOTTOM_TO_TOP ? this._vOffset += t : this._vOffset -= t), this._pendingEmptyLineFontSizeAdjust = void 0;
35492
+ t !== 0 && (this.flowDirection == ce.BOTTOM_TO_TOP ? this._vOffset += t : this._vOffset -= t), this._pendingEmptyLineFontSizeAdjust = void 0;
35406
35493
  }
35407
35494
  /**
35408
35495
  * Chooses whether subsequent char boxes should attach to mesh or line geometry owners.
@@ -35611,7 +35698,7 @@ function Tx(n) {
35611
35698
  return String.fromCharCode(s);
35612
35699
  });
35613
35700
  }
35614
- const as = /* @__PURE__ */ new E(), _e = /* @__PURE__ */ new E(), Le = /* @__PURE__ */ new E(), ih = /* @__PURE__ */ new E(1, 0, 0);
35701
+ const as = /* @__PURE__ */ new E(), Le = /* @__PURE__ */ new E(), Ie = /* @__PURE__ */ new E(), ih = /* @__PURE__ */ new E(1, 0, 0);
35615
35702
  class Da extends Xt {
35616
35703
  /**
35617
35704
  * Extracts all unique font names used in an MText string.
@@ -35687,7 +35774,15 @@ class Da extends Xt {
35687
35774
  }
35688
35775
  }
35689
35776
  const s = (t == null ? void 0 : t.awaitFonts) ?? (!this._fontManager.lazyFontLoading || this._fontManager.awaitFontsBeforeDraw), i = s ? [.../* @__PURE__ */ new Set([...e, ...this._fontManager.getFontsToLoad()])] : e;
35690
- i.length > 0 && (this._fontManager.lazyFontLoading ? s ? await this._fontManager.requestFonts(i) : this._fontManager.requestFonts(i) : await this._fontManager.loadFontsByNames(i), e.length > 0 && (this._fontsInStyleLoaded = !0)), this.syncDraw();
35777
+ if (i.length > 0 && (this._fontManager.lazyFontLoading ? s ? await this._fontManager.requestFonts(i) : this._fontManager.requestFonts(i) : await this._fontManager.loadFontsByNames(i), e.length > 0)) {
35778
+ const r = [
35779
+ this._style.font ? this.getFontName(this._style.font) : void 0,
35780
+ this._style.bigFont ? this.getFontName(this._style.bigFont) : void 0,
35781
+ this._style.extendedFont ? this.getFontName(this._style.extendedFont) : void 0
35782
+ ].filter((o) => !!o);
35783
+ (r.length === 0 || r.every((o) => this._fontManager.isFontLoaded(o))) && (this._fontsInStyleLoaded = !0);
35784
+ }
35785
+ this.syncDraw();
35691
35786
  }
35692
35787
  /**
35693
35788
  * Draw the MText object. This method assumes that fonts needed are loaded. If font needed
@@ -35795,18 +35890,15 @@ class Da extends Xt {
35795
35890
  position: t.position,
35796
35891
  rotation: t.rotation,
35797
35892
  directionVector: t.directionVector,
35798
- drawingDirection: oe.BOTTOM_TO_TOP,
35893
+ drawingDirection: ce.BOTTOM_TO_TOP,
35799
35894
  collectCharBoxes: !1
35800
35895
  };
35801
- return this.finalizePlacement(
35802
- s,
35803
- r,
35804
- i,
35805
- { shxFontType: this._fontManager.getShxFontType(e.font) }
35806
- );
35896
+ return this.finalizePlacement(s, r, i, {
35897
+ shxFontType: this._fontManager.getShxFontType(e.font)
35898
+ });
35807
35899
  }
35808
35900
  /**
35809
- *
35901
+ *
35810
35902
  * @param options.shxFontType The type of SHX font.
35811
35903
  */
35812
35904
  finalizePlacement(t, e, s, i) {
@@ -35826,7 +35918,10 @@ class Da extends Xt {
35826
35918
  e.drawingDirection
35827
35919
  );
35828
35920
  let c = { x: 0, y: 0 };
35829
- (i == null ? void 0 : i.shxFontType) === K.SHAPES ? c = { x: 0, y: 0 } : c = this.calculateAnchorPoint(o, e.attachmentPoint), t.userData.logicalBounds = {
35921
+ (i == null ? void 0 : i.shxFontType) === K.SHAPES ? c = { x: 0, y: 0 } : c = this.calculateAnchorPoint(
35922
+ o,
35923
+ e.attachmentPoint
35924
+ ), t.userData.logicalBounds = {
35830
35925
  minX: o.minX + c.x,
35831
35926
  maxX: o.maxX + c.x,
35832
35927
  minY: o.minY + c.y,
@@ -35871,7 +35966,7 @@ class Da extends Xt {
35871
35966
  lineSpaceFactor: Zc,
35872
35967
  horizontalAlignment: ct.LEFT,
35873
35968
  maxWidth: 0,
35874
- flowDirection: oe.BOTTOM_TO_TOP,
35969
+ flowDirection: ce.BOTTOM_TO_TOP,
35875
35970
  byBlockColor: this._colorSettings.byBlockColor,
35876
35971
  byLayerColor: this._colorSettings.byLayerColor,
35877
35972
  removeFontExtension: !0,
@@ -35930,7 +36025,7 @@ class Da extends Xt {
35930
36025
  nt.MiddleCenter,
35931
36026
  nt.MiddleRight
35932
36027
  ].includes(t.attachmentPoint) ? a = Ye.MIDDLE : a = Ye.BOTTOM);
35933
- const o = t.height || e.fixedTextHeight || 0, c = t.widthFactor || e.widthFactor || 1, h = t.lineSpaceFactor ?? Zc, l = t.drawingDirection ?? oe.LEFT_TO_RIGHT, u = {
36028
+ const o = t.height || e.fixedTextHeight || 0, c = t.widthFactor || e.widthFactor || 1, h = t.lineSpaceFactor ?? Zc, l = t.drawingDirection ?? ce.LEFT_TO_RIGHT, u = {
35934
36029
  fontSize: o,
35935
36030
  widthFactor: c,
35936
36031
  lineSpaceFactor: h,
@@ -36012,7 +36107,7 @@ class Da extends Xt {
36012
36107
  let l = 0, u = Number.isFinite(e) && e > 0 ? e : 0;
36013
36108
  u <= l && !i.isEmpty() && (l = i.min.x, u = i.max.x);
36014
36109
  let f = 0, p = 0;
36015
- r == oe.BOTTOM_TO_TOP ? (f = i.isEmpty() ? 0 : i.min.y, p = f + h) : (p = i.isEmpty() ? 0 : i.max.y, f = p - h);
36110
+ r == ce.BOTTOM_TO_TOP ? (f = i.isEmpty() ? 0 : i.min.y, p = f + h) : (p = i.isEmpty() ? 0 : i.max.y, f = p - h);
36016
36111
  const d = a.hasLine ? a.baselineY : f;
36017
36112
  return { minX: l, maxX: u, minY: f, maxY: p, baselineY: d };
36018
36113
  }
@@ -36098,9 +36193,9 @@ class Da extends Xt {
36098
36193
  t.updateWorldMatrix(!1, !1);
36099
36194
  const i = (c = (o = t.userData) == null ? void 0 : o.layout) == null ? void 0 : c.chars, r = (h = t.userData) == null ? void 0 : h.lineLayouts;
36100
36195
  if (r && r.length > 0 && r.forEach((f) => {
36101
- as.set(0, f.y, 0).applyMatrix4(t.matrixWorld), _e.set(0, f.y - f.height / 2, 0).applyMatrix4(t.matrixWorld), Le.set(0, f.y + f.height / 2, 0).applyMatrix4(t.matrixWorld), s.push({
36196
+ as.set(0, f.y, 0).applyMatrix4(t.matrixWorld), Le.set(0, f.y - f.height / 2, 0).applyMatrix4(t.matrixWorld), Ie.set(0, f.y + f.height / 2, 0).applyMatrix4(t.matrixWorld), s.push({
36102
36197
  y: as.y,
36103
- height: Math.abs(Le.y - _e.y),
36198
+ height: Math.abs(Ie.y - Le.y),
36104
36199
  breakIndex: f.breakIndex
36105
36200
  });
36106
36201
  }), i && i.length > 0) {
@@ -36165,7 +36260,7 @@ class Da extends Xt {
36165
36260
  }
36166
36261
  const i = (c = t.userData) == null ? void 0 : c.lineLayouts;
36167
36262
  i && i.length > 0 && i.forEach((p) => {
36168
- _e.set(0, p.y - p.height / 2, 0).applyMatrix4(t.matrixWorld), Le.set(0, p.y + p.height / 2, 0).applyMatrix4(t.matrixWorld), e.hasLine = !0, e.minX = Math.min(e.minX, _e.x, Le.x), e.maxX = Math.max(e.maxX, _e.x, Le.x), e.minY = Math.min(e.minY, _e.y, Le.y), e.maxY = Math.max(e.maxY, _e.y, Le.y), e.minZ = Math.min(e.minZ, _e.z, Le.z), e.maxZ = Math.max(e.maxZ, _e.z, Le.z);
36263
+ Le.set(0, p.y - p.height / 2, 0).applyMatrix4(t.matrixWorld), Ie.set(0, p.y + p.height / 2, 0).applyMatrix4(t.matrixWorld), e.hasLine = !0, e.minX = Math.min(e.minX, Le.x, Ie.x), e.maxX = Math.max(e.maxX, Le.x, Ie.x), e.minY = Math.min(e.minY, Le.y, Ie.y), e.maxY = Math.max(e.maxY, Le.y, Ie.y), e.minZ = Math.min(e.minZ, Le.z, Ie.z), e.maxZ = Math.max(e.maxZ, Le.z, Ie.z);
36169
36264
  });
36170
36265
  const r = (l = (h = t.userData) == null ? void 0 : h.layout) == null ? void 0 : l.chars;
36171
36266
  if (r && r.length > 0) {
@@ -36229,8 +36324,8 @@ class Da extends Xt {
36229
36324
  }
36230
36325
  }
36231
36326
  }
36232
- const Ft = he.instance, rh = new cx();
36233
- Ft.events.fontLoaded.addEventListener((n) => {
36327
+ const Ct = le.instance, rh = new cx();
36328
+ Ct.events.fontLoaded.addEventListener((n) => {
36234
36329
  self.postMessage({
36235
36330
  type: "fontLoaded",
36236
36331
  id: "",
@@ -36238,7 +36333,7 @@ Ft.events.fontLoaded.addEventListener((n) => {
36238
36333
  data: { fontName: n == null ? void 0 : n.fontName }
36239
36334
  });
36240
36335
  });
36241
- Ft.events.fontNotFound.addEventListener((n) => {
36336
+ Ct.events.fontNotFound.addEventListener((n) => {
36242
36337
  self.postMessage({
36243
36338
  type: "fontNotFound",
36244
36339
  id: "",
@@ -36257,7 +36352,7 @@ self.addEventListener("message", async (n) => {
36257
36352
  i,
36258
36353
  r,
36259
36354
  rh,
36260
- Ft,
36355
+ Ct,
36261
36356
  o
36262
36357
  );
36263
36358
  await c.asyncDraw(), c.updateMatrixWorld(!0);
@@ -36276,8 +36371,8 @@ self.addEventListener("message", async (n) => {
36276
36371
  case "loadFonts": {
36277
36372
  if (!s) throw new Error("Missing data for loadFonts message");
36278
36373
  const { fonts: i } = s;
36279
- await Ft.loadFontsByNames(i);
36280
- const r = i.filter((a) => Ft.isFontLoaded(a));
36374
+ await Ct.loadFontsByNames(i);
36375
+ const r = i.filter((a) => Ct.isFontLoaded(a));
36281
36376
  self.postMessage({
36282
36377
  type: "loadFonts",
36283
36378
  id: e,
@@ -36289,13 +36384,13 @@ self.addEventListener("message", async (n) => {
36289
36384
  case "setDefaultFonts": {
36290
36385
  if (!s) throw new Error("Missing data for setDefaultFonts message");
36291
36386
  const { fonts: i, symbolFonts: r } = s;
36292
- Ft.setDefaultFonts(i), Ft.setSymbolFonts(r), self.postMessage({
36387
+ Ct.setDefaultFonts(i), Ct.setSymbolFonts(r), self.postMessage({
36293
36388
  type: "setDefaultFonts",
36294
36389
  id: e,
36295
36390
  success: !0,
36296
36391
  data: {
36297
- fonts: [...Ft.defaultFonts],
36298
- symbolFonts: [...Ft.symbolFonts]
36392
+ fonts: [...Ct.defaultFonts],
36393
+ symbolFonts: [...Ct.symbolFonts]
36299
36394
  }
36300
36395
  });
36301
36396
  break;
@@ -36303,11 +36398,11 @@ self.addEventListener("message", async (n) => {
36303
36398
  case "setLazyFontLoading": {
36304
36399
  if (!s) throw new Error("Missing data for setLazyFontLoading message");
36305
36400
  const { enabled: i } = s;
36306
- Ft.lazyFontLoading = i, self.postMessage({
36401
+ Ct.lazyFontLoading = i, self.postMessage({
36307
36402
  type: "setLazyFontLoading",
36308
36403
  id: e,
36309
36404
  success: !0,
36310
- data: { enabled: Ft.lazyFontLoading }
36405
+ data: { enabled: Ct.lazyFontLoading }
36311
36406
  });
36312
36407
  break;
36313
36408
  }
@@ -36315,18 +36410,23 @@ self.addEventListener("message", async (n) => {
36315
36410
  if (!s)
36316
36411
  throw new Error("Missing data for setAwaitFontsBeforeDraw message");
36317
36412
  const { enabled: i } = s;
36318
- Ft.awaitFontsBeforeDraw = i, self.postMessage({
36413
+ Ct.awaitFontsBeforeDraw = i, self.postMessage({
36319
36414
  type: "setAwaitFontsBeforeDraw",
36320
36415
  id: e,
36321
36416
  success: !0,
36322
- data: { enabled: Ft.awaitFontsBeforeDraw }
36417
+ data: { enabled: Ct.awaitFontsBeforeDraw }
36323
36418
  });
36324
36419
  break;
36325
36420
  }
36326
36421
  case "setFontUrl": {
36327
36422
  if (!s) throw new Error("Missing data for setFontUrl message");
36328
36423
  const { url: i } = s;
36329
- Ft.baseUrl = i, self.postMessage({
36424
+ Ct.baseUrl = i;
36425
+ try {
36426
+ await Ct.getAvailableFonts();
36427
+ } catch {
36428
+ }
36429
+ self.postMessage({
36330
36430
  type: "setFontUrl",
36331
36431
  id: e,
36332
36432
  success: !0,
@@ -36336,16 +36436,16 @@ self.addEventListener("message", async (n) => {
36336
36436
  }
36337
36437
  case "setMissedFonts": {
36338
36438
  const { missedFonts: i } = s ?? {};
36339
- Ft.replaceMissedFonts(i ?? {}), self.postMessage({
36439
+ Ct.replaceMissedFonts(i ?? {}), self.postMessage({
36340
36440
  type: "setMissedFonts",
36341
36441
  id: e,
36342
36442
  success: !0,
36343
- data: { missedFonts: { ...Ft.missedFonts } }
36443
+ data: { missedFonts: { ...Ct.missedFonts } }
36344
36444
  });
36345
36445
  break;
36346
36446
  }
36347
36447
  case "getAvailableFonts": {
36348
- const i = await he.instance.getAvailableFonts();
36448
+ const i = await le.instance.getAvailableFonts();
36349
36449
  self.postMessage({
36350
36450
  type: "getAvailableFonts",
36351
36451
  id: e,
@@ -36356,7 +36456,7 @@ self.addEventListener("message", async (n) => {
36356
36456
  }
36357
36457
  case "getMemoryStats": {
36358
36458
  const i = ox(
36359
- Ft,
36459
+ Ct,
36360
36460
  {
36361
36461
  id: "worker",
36362
36462
  styleManager: rh
@@ -36387,11 +36487,11 @@ function Fx(n) {
36387
36487
  byLayerColor: 16777215,
36388
36488
  byBlockColor: 16777215,
36389
36489
  layer: "0",
36390
- color: new ve()
36490
+ color: new Se()
36391
36491
  }, e = n ?? t, s = e.color;
36392
- if (s instanceof ve)
36492
+ if (s instanceof Se)
36393
36493
  return e;
36394
- const i = new ve();
36494
+ const i = new Se();
36395
36495
  if (s && typeof s == "object") {
36396
36496
  const r = s;
36397
36497
  typeof r._aci == "number" && (i.aci = r._aci), typeof r._rgbValue == "number" && (i.rgbValue = r._rgbValue);
@@ -36491,10 +36591,10 @@ function kx(n) {
36491
36591
  transparent: l.transparent,
36492
36592
  opacity: l.opacity
36493
36593
  }, b = (i = s.userData) == null ? void 0 : i.mtextColor;
36494
- if (b instanceof ve)
36594
+ if (b instanceof Se)
36495
36595
  x.mtextColor = Yc(b);
36496
36596
  else if (b && typeof b == "object") {
36497
- const v = b, w = new ve();
36597
+ const v = b, w = new Se();
36498
36598
  typeof v.aci == "number" ? w.aci = v.aci : typeof v._aci == "number" && (w.aci = v._aci), typeof v.rgbValue == "number" ? w.rgbValue = v.rgbValue : typeof v._rgbValue == "number" && (w.rgbValue = v._rgbValue), x.mtextColor = Yc(w);
36499
36599
  }
36500
36600
  "side" in l && typeof l.side == "number" && (x.side = l.side), "linewidth" in l && typeof l.linewidth == "number" && (x.linewidth = l.linewidth);