@mlightcad/mtext-renderer 0.8.2 → 0.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  var Zh = (n, e) => () => (e || n((e = { exports: {} }).exports, e), e.exports);
2
- var Jd = Zh((O) => {
2
+ var $d = Zh((O) => {
3
3
  /**
4
4
  * @license
5
5
  * Copyright 2010-2024 Three.js Authors
@@ -15242,8 +15242,8 @@ var Jd = Zh((O) => {
15242
15242
  return t.trim();
15243
15243
  }
15244
15244
  }
15245
- const Le = 10;
15246
- class Vp {
15245
+ const Le = 10, Vp = [13, 10, 0];
15246
+ class Xp {
15247
15247
  parse(e) {
15248
15248
  try {
15249
15249
  e.readBytes(4);
@@ -15259,11 +15259,7 @@ var Jd = Zh((O) => {
15259
15259
  for (const a of r)
15260
15260
  try {
15261
15261
  const o = e.readBytes(a.length);
15262
- if (o.length === a.length) {
15263
- const h = o.indexOf(0);
15264
- let c = 0;
15265
- h >= 0 && h < o.length && (c = h + 1), c < o.length && (i[a.code] = o.subarray(c));
15266
- }
15262
+ o.length === a.length && (i[a.code] = o);
15267
15263
  } catch {
15268
15264
  console.warn(`Failed to read shape data for code ${a.code}`);
15269
15265
  }
@@ -15281,7 +15277,7 @@ var Jd = Zh((O) => {
15281
15277
  const a = i[0];
15282
15278
  try {
15283
15279
  const o = new TextDecoder().decode(a);
15284
- let h = o.indexOf("\0");
15280
+ let h = a.findIndex((c) => Vp.includes(c));
15285
15281
  h >= 0 && (s.info = o.substring(0, h), h + 3 < a.length && (s.baseUp = a[h + 1], s.baseDown = a[h + 2], s.height = s.baseDown + s.baseUp, s.width = s.height, s.orientation = a[h + 3] === 0 ? "horizontal" : "vertical"));
15286
15282
  } catch {
15287
15283
  console.warn("Failed to parse font info block");
@@ -15302,7 +15298,7 @@ var Jd = Zh((O) => {
15302
15298
  }
15303
15299
  }
15304
15300
  }
15305
- class Xp {
15301
+ class Yp {
15306
15302
  parse(e) {
15307
15303
  try {
15308
15304
  e.readInt16();
@@ -15393,7 +15389,7 @@ var Jd = Zh((O) => {
15393
15389
  return { text: t, pos: r };
15394
15390
  }
15395
15391
  }
15396
- class Yp {
15392
+ let Zp = class {
15397
15393
  parse(e) {
15398
15394
  try {
15399
15395
  const t = e.readInt32();
@@ -15446,16 +15442,15 @@ var Jd = Zh((O) => {
15446
15442
  };
15447
15443
  }
15448
15444
  }
15449
- }
15450
- let Zp = class {
15445
+ }, Jp = class {
15451
15446
  static createParser(e) {
15452
15447
  switch (e) {
15453
15448
  case we.SHAPES:
15454
- return new Vp();
15455
- case we.BIGFONT:
15456
15449
  return new Xp();
15457
- case we.UNIFONT:
15450
+ case we.BIGFONT:
15458
15451
  return new Yp();
15452
+ case we.UNIFONT:
15453
+ return new Zp();
15459
15454
  default:
15460
15455
  throw new Error(`Unsupported font type: ${e}`);
15461
15456
  }
@@ -15714,8 +15709,8 @@ var Jd = Zh((O) => {
15714
15709
  return `<svg width="100%" height="100%" viewBox="${s}" preserveAspectRatio="xMidYMid meet">${a}</svg>`;
15715
15710
  }
15716
15711
  }
15717
- const Jp = Math.PI / 18;
15718
- class $p {
15712
+ const $p = Math.PI / 18;
15713
+ class jp {
15719
15714
  constructor(e) {
15720
15715
  this.shapeCache = /* @__PURE__ */ new Map(), this.shapeData = /* @__PURE__ */ new Map(), this.fontData = e;
15721
15716
  }
@@ -15991,7 +15986,7 @@ var Jd = Zh((O) => {
15991
15986
  let l = u & 7;
15992
15987
  l === 0 && (l = 8), a !== 0 && l--;
15993
15988
  const p = Math.PI / 4;
15994
- let g = p * l, m = Jp, x = 1;
15989
+ let g = p * l, m = $p, x = 1;
15995
15990
  u < 0 && (m = -m, g = -g, x = -1);
15996
15991
  let v = p * f, w = v + g;
15997
15992
  v += p * s / 256 * x, w += p * a / 256 * x;
@@ -16140,7 +16135,7 @@ var Jd = Zh((O) => {
16140
16135
  return o.add(t), o;
16141
16136
  }
16142
16137
  }
16143
- class jp {
16138
+ let Qp = class {
16144
16139
  /**
16145
16140
  * Creates a new ShxFont instance.
16146
16141
  * @param data - Either raw binary data of the SHX font file (ArrayBuffer) or pre-parsed font data (ShxFontData)
@@ -16148,14 +16143,14 @@ var Jd = Zh((O) => {
16148
16143
  */
16149
16144
  constructor(e) {
16150
16145
  if (e instanceof ArrayBuffer) {
16151
- const t = new be(e), r = new qp().parse(t), i = Zp.createParser(r.fontType).parse(t);
16146
+ const t = new be(e), r = new qp().parse(t), i = Jp.createParser(r.fontType).parse(t);
16152
16147
  this.fontData = {
16153
16148
  header: r,
16154
16149
  content: i
16155
16150
  };
16156
16151
  } else
16157
16152
  this.fontData = e;
16158
- this.shapeParser = new $p(this.fontData);
16153
+ this.shapeParser = new jp(this.fontData);
16159
16154
  }
16160
16155
  /**
16161
16156
  * Return true if this font contains glyph of the specified character. Otherwise, return false.
@@ -16182,11 +16177,11 @@ var Jd = Zh((O) => {
16182
16177
  release() {
16183
16178
  this.shapeParser.release();
16184
16179
  }
16185
- }
16186
- function Qp(n) {
16180
+ };
16181
+ function Kp(n) {
16187
16182
  return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
16188
16183
  }
16189
- function Kp(n) {
16184
+ function ed(n) {
16190
16185
  if (n.__esModule) return n;
16191
16186
  var e = n.default;
16192
16187
  if (typeof e == "function") {
@@ -16206,11 +16201,11 @@ var Jd = Zh((O) => {
16206
16201
  }), t;
16207
16202
  }
16208
16203
  var Gh = { exports: {} }, Bs = {}, $n = {};
16209
- $n.byteLength = rd;
16210
- $n.toByteArray = id;
16211
- $n.fromByteArray = od;
16212
- var Qe = [], Ee = [], ed = typeof Uint8Array < "u" ? Uint8Array : Array, Ri = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
16213
- for (var nr = 0, td = Ri.length; nr < td; ++nr)
16204
+ $n.byteLength = nd;
16205
+ $n.toByteArray = sd;
16206
+ $n.fromByteArray = hd;
16207
+ var Qe = [], Ee = [], td = typeof Uint8Array < "u" ? Uint8Array : Array, Ri = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
16208
+ for (var nr = 0, rd = Ri.length; nr < rd; ++nr)
16214
16209
  Qe[nr] = Ri[nr], Ee[Ri.charCodeAt(nr)] = nr;
16215
16210
  Ee[45] = 62;
16216
16211
  Ee[95] = 63;
@@ -16223,30 +16218,30 @@ var Jd = Zh((O) => {
16223
16218
  var r = t === e ? 0 : 4 - t % 4;
16224
16219
  return [t, r];
16225
16220
  }
16226
- function rd(n) {
16221
+ function nd(n) {
16227
16222
  var e = Hh(n), t = e[0], r = e[1];
16228
16223
  return (t + r) * 3 / 4 - r;
16229
16224
  }
16230
- function nd(n, e, t) {
16225
+ function id(n, e, t) {
16231
16226
  return (e + t) * 3 / 4 - t;
16232
16227
  }
16233
- function id(n) {
16234
- var e, t = Hh(n), r = t[0], i = t[1], s = new ed(nd(n, r, i)), a = 0, o = i > 0 ? r - 4 : r, h;
16228
+ function sd(n) {
16229
+ var e, t = Hh(n), r = t[0], i = t[1], s = new td(id(n, r, i)), a = 0, o = i > 0 ? r - 4 : r, h;
16235
16230
  for (h = 0; h < o; h += 4)
16236
16231
  e = Ee[n.charCodeAt(h)] << 18 | Ee[n.charCodeAt(h + 1)] << 12 | Ee[n.charCodeAt(h + 2)] << 6 | Ee[n.charCodeAt(h + 3)], s[a++] = e >> 16 & 255, s[a++] = e >> 8 & 255, s[a++] = e & 255;
16237
16232
  return i === 2 && (e = Ee[n.charCodeAt(h)] << 2 | Ee[n.charCodeAt(h + 1)] >> 4, s[a++] = e & 255), i === 1 && (e = Ee[n.charCodeAt(h)] << 10 | Ee[n.charCodeAt(h + 1)] << 4 | Ee[n.charCodeAt(h + 2)] >> 2, s[a++] = e >> 8 & 255, s[a++] = e & 255), s;
16238
16233
  }
16239
- function sd(n) {
16234
+ function ad(n) {
16240
16235
  return Qe[n >> 18 & 63] + Qe[n >> 12 & 63] + Qe[n >> 6 & 63] + Qe[n & 63];
16241
16236
  }
16242
- function ad(n, e, t) {
16237
+ function od(n, e, t) {
16243
16238
  for (var r, i = [], s = e; s < t; s += 3)
16244
- r = (n[s] << 16 & 16711680) + (n[s + 1] << 8 & 65280) + (n[s + 2] & 255), i.push(sd(r));
16239
+ r = (n[s] << 16 & 16711680) + (n[s + 1] << 8 & 65280) + (n[s + 2] & 255), i.push(ad(r));
16245
16240
  return i.join("");
16246
16241
  }
16247
- function od(n) {
16242
+ function hd(n) {
16248
16243
  for (var e, t = n.length, r = t % 3, i = [], s = 16383, a = 0, o = t - r; a < o; a += s)
16249
- i.push(ad(n, a, a + s > o ? o : a + s));
16244
+ i.push(od(n, a, a + s > o ? o : a + s));
16250
16245
  return r === 1 ? (e = n[t - 1], i.push(
16251
16246
  Qe[e >> 2] + Qe[e << 4 & 63] + "=="
16252
16247
  )) : r === 2 && (e = (n[t - 2] << 8) + n[t - 1], i.push(
@@ -17115,15 +17110,15 @@ var Jd = Zh((O) => {
17115
17110
  Us.prototype.end = function() {
17116
17111
  return this.decoder.end();
17117
17112
  };
17118
- var hd = typeof Object.hasOwn > "u" ? Function.call.bind(Object.prototype.hasOwnProperty) : Object.hasOwn;
17119
- function cd(n, e) {
17113
+ var cd = typeof Object.hasOwn > "u" ? Function.call.bind(Object.prototype.hasOwnProperty) : Object.hasOwn;
17114
+ function ud(n, e) {
17120
17115
  for (var t in e)
17121
- hd(e, t) && (n[t] = e[t]);
17116
+ cd(e, t) && (n[t] = e[t]);
17122
17117
  }
17123
- var qh = cd, Di = {}, Ii = {}, En = { exports: {} };
17118
+ var qh = ud, Di = {}, Ii = {}, En = { exports: {} };
17124
17119
  /*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
17125
17120
  var po;
17126
- function ud() {
17121
+ function ld() {
17127
17122
  return po || (po = 1, function(n, e) {
17128
17123
  var t = Bs, r = t.Buffer;
17129
17124
  function i(a, o) {
@@ -17155,10 +17150,10 @@ var Jd = Zh((O) => {
17155
17150
  }(En, En.exports)), En.exports;
17156
17151
  }
17157
17152
  var go;
17158
- function ld() {
17153
+ function fd() {
17159
17154
  if (go) return Ii;
17160
17155
  go = 1;
17161
- var n = ud().Buffer, e = n.isEncoding || function(v) {
17156
+ var n = ld().Buffer, e = n.isEncoding || function(v) {
17162
17157
  switch (v = "" + v, v && v.toLowerCase()) {
17163
17158
  case "hex":
17164
17159
  case "utf8":
@@ -17313,7 +17308,7 @@ var Jd = Zh((O) => {
17313
17308
  return Ii;
17314
17309
  }
17315
17310
  var Pi, yo;
17316
- function fd() {
17311
+ function pd() {
17317
17312
  if (yo) return Pi;
17318
17313
  yo = 1;
17319
17314
  var n = Bt.Buffer;
@@ -17334,7 +17329,7 @@ var Jd = Zh((O) => {
17334
17329
  this.enc = c.encodingName, this.bomAware = c.bomAware, this.enc === "base64" ? this.encoder = s : this.enc === "utf8" ? this.encoder = h : this.enc === "cesu8" && (this.enc = "utf8", this.encoder = a, n.from("eda0bdedb2a9", "hex").toString() !== "💩" && (this.decoder = o, this.defaultCharUnicode = u.defaultCharUnicode));
17335
17330
  }
17336
17331
  e.prototype.encoder = i, e.prototype.decoder = r;
17337
- var t = ld().StringDecoder;
17332
+ var t = fd().StringDecoder;
17338
17333
  function r(c, u) {
17339
17334
  this.decoder = new t(u.enc);
17340
17335
  }
@@ -17400,7 +17395,7 @@ var Jd = Zh((O) => {
17400
17395
  }, Pi;
17401
17396
  }
17402
17397
  var ht = {}, mo;
17403
- function pd() {
17398
+ function dd() {
17404
17399
  if (mo) return ht;
17405
17400
  mo = 1;
17406
17401
  var n = Bt.Buffer;
@@ -17519,7 +17514,7 @@ var Jd = Zh((O) => {
17519
17514
  return ht;
17520
17515
  }
17521
17516
  var Bn = {}, vo;
17522
- function dd() {
17517
+ function gd() {
17523
17518
  if (vo) return Bn;
17524
17519
  vo = 1;
17525
17520
  var n = Bt.Buffer;
@@ -17605,7 +17600,7 @@ var Jd = Zh((O) => {
17605
17600
  return Bn;
17606
17601
  }
17607
17602
  var Tr = {}, xo;
17608
- function gd() {
17603
+ function yd() {
17609
17604
  if (xo) return Tr;
17610
17605
  xo = 1;
17611
17606
  var n = Bt.Buffer;
@@ -17701,7 +17696,7 @@ var Jd = Zh((O) => {
17701
17696
  }, Tr;
17702
17697
  }
17703
17698
  var zi = {}, bo;
17704
- function yd() {
17699
+ function md() {
17705
17700
  if (bo) return zi;
17706
17701
  bo = 1;
17707
17702
  var n = Bt.Buffer;
@@ -17742,7 +17737,7 @@ var Jd = Zh((O) => {
17742
17737
  }, zi;
17743
17738
  }
17744
17739
  var Ni, wo;
17745
- function md() {
17740
+ function vd() {
17746
17741
  return wo || (wo = 1, Ni = {
17747
17742
  // Not supported by iconv, not sure why.
17748
17743
  10029: "maccenteuro",
@@ -17891,7 +17886,7 @@ var Jd = Zh((O) => {
17891
17886
  }), Ni;
17892
17887
  }
17893
17888
  var Gi, So;
17894
- function vd() {
17889
+ function xd() {
17895
17890
  return So || (So = 1, Gi = {
17896
17891
  437: "cp437",
17897
17892
  737: "cp737",
@@ -18347,7 +18342,7 @@ var Jd = Zh((O) => {
18347
18342
  }), Gi;
18348
18343
  }
18349
18344
  var Hi = {}, Fo;
18350
- function xd() {
18345
+ function bd() {
18351
18346
  if (Fo) return Hi;
18352
18347
  Fo = 1;
18353
18348
  var n = Bt.Buffer;
@@ -18587,7 +18582,7 @@ var Jd = Zh((O) => {
18587
18582
  }
18588
18583
  return Hi;
18589
18584
  }
18590
- const bd = [
18585
+ const wd = [
18591
18586
  [
18592
18587
  "0",
18593
18588
  "\0",
@@ -19132,7 +19127,7 @@ var Jd = Zh((O) => {
19132
19127
  "fc40",
19133
19128
  "髜魵魲鮏鮱鮻鰀鵰鵫鶴鸙黑"
19134
19129
  ]
19135
- ], wd = [
19130
+ ], Sd = [
19136
19131
  [
19137
19132
  "0",
19138
19133
  "\0",
@@ -22830,7 +22825,7 @@ var Jd = Zh((O) => {
22830
22825
  "8135f437",
22831
22826
  ""
22832
22827
  ]
22833
- ], Sd = [
22828
+ ], Fd = [
22834
22829
  128,
22835
22830
  165,
22836
22831
  169,
@@ -23038,7 +23033,7 @@ var Jd = Zh((O) => {
23038
23033
  65375,
23039
23034
  65510,
23040
23035
  65536
23041
- ], Fd = [
23036
+ ], Td = [
23042
23037
  0,
23043
23038
  36,
23044
23039
  38,
@@ -23246,10 +23241,10 @@ var Jd = Zh((O) => {
23246
23241
  39265,
23247
23242
  39394,
23248
23243
  189e3
23249
- ], Td = {
23250
- uChars: Sd,
23251
- gbChars: Fd
23252
- }, kd = [
23244
+ ], kd = {
23245
+ uChars: Fd,
23246
+ gbChars: Td
23247
+ }, Cd = [
23253
23248
  [
23254
23249
  "0",
23255
23250
  "\0",
@@ -26352,7 +26347,7 @@ var Jd = Zh((O) => {
26352
26347
  "f9a1",
26353
26348
  "龤灨灥糷虪蠾蠽蠿讞貜躩軉靋顳顴飌饡馫驤驦驧鬤鸕鸗齈戇欞爧虌躨钂钀钁驩驨鬮鸙爩虋讟钃鱹麷癵驫鱺鸝灩灪麤齾齉龘碁銹裏墻恒粧嫺╔╦╗╠╬╣╚╩╝╒╤╕╞╪╡╘╧╛╓╥╖╟╫╢╙╨╜║═╭╮╰╯▓"
26354
26349
  ]
26355
- ], Cd = [
26350
+ ], Md = [
26356
26351
  [
26357
26352
  "8740",
26358
26353
  "䏰䰲䘃䖦䕸𧉧䵷䖳𧲱䳢𧳅㮕䜶䝄䱇䱀𤊿𣘗𧍒𦺋𧃒䱗𪍑䝏䗚䲅𧱬䴇䪤䚡𦬣爥𥩔𡩣𣸆𣽡晍囻"
@@ -26857,7 +26852,7 @@ var Jd = Zh((O) => {
26857
26852
  ]
26858
26853
  ];
26859
26854
  var qi, Co;
26860
- function Md() {
26855
+ function Ad() {
26861
26856
  return Co || (Co = 1, qi = {
26862
26857
  // == Japanese/ShiftJIS ====================================================
26863
26858
  // All japanese encodings are based on JIS X set of standards:
@@ -26892,7 +26887,7 @@ var Jd = Zh((O) => {
26892
26887
  shiftjis: {
26893
26888
  type: "_dbcs",
26894
26889
  table: function() {
26895
- return bd;
26890
+ return wd;
26896
26891
  },
26897
26892
  encodeAdd: { "¥": 92, "‾": 126 },
26898
26893
  encodeSkipVals: [{ from: 60736, to: 63808 }]
@@ -26910,7 +26905,7 @@ var Jd = Zh((O) => {
26910
26905
  eucjp: {
26911
26906
  type: "_dbcs",
26912
26907
  table: function() {
26913
- return wd;
26908
+ return Sd;
26914
26909
  },
26915
26910
  encodeAdd: { "¥": 92, "‾": 126 }
26916
26911
  },
@@ -26957,7 +26952,7 @@ var Jd = Zh((O) => {
26957
26952
  return Wi.concat(To);
26958
26953
  },
26959
26954
  gb18030: function() {
26960
- return Td;
26955
+ return kd;
26961
26956
  },
26962
26957
  encodeSkipVals: [128],
26963
26958
  encodeAdd: { "€": 41699 }
@@ -26971,7 +26966,7 @@ var Jd = Zh((O) => {
26971
26966
  cp949: {
26972
26967
  type: "_dbcs",
26973
26968
  table: function() {
26974
- return kd;
26969
+ return Cd;
26975
26970
  }
26976
26971
  },
26977
26972
  cseuckr: "cp949",
@@ -27018,7 +27013,7 @@ var Jd = Zh((O) => {
27018
27013
  big5hkscs: {
27019
27014
  type: "_dbcs",
27020
27015
  table: function() {
27021
- return ko.concat(Cd);
27016
+ return ko.concat(Md);
27022
27017
  },
27023
27018
  encodeSkipVals: [
27024
27019
  // Although Encoding Standard says we should avoid encoding to HKSCS area (See Step 1 of
@@ -27100,10 +27095,9 @@ var Jd = Zh((O) => {
27100
27095
  }), qi;
27101
27096
  }
27102
27097
  var Mo;
27103
- function Ad() {
27098
+ function Ed() {
27104
27099
  return Mo || (Mo = 1, function(n) {
27105
27100
  for (var e = qh, t = [
27106
- fd(),
27107
27101
  pd(),
27108
27102
  dd(),
27109
27103
  gd(),
@@ -27111,7 +27105,8 @@ var Jd = Zh((O) => {
27111
27105
  md(),
27112
27106
  vd(),
27113
27107
  xd(),
27114
- Md()
27108
+ bd(),
27109
+ Ad()
27115
27110
  ], r = 0; r < t.length; r++) {
27116
27111
  var i = t[r];
27117
27112
  e(n, i);
@@ -27119,7 +27114,7 @@ var Jd = Zh((O) => {
27119
27114
  }(Di)), Di;
27120
27115
  }
27121
27116
  var Vi, Ao;
27122
- function Ed() {
27117
+ function Bd() {
27123
27118
  if (Ao) return Vi;
27124
27119
  Ao = 1;
27125
27120
  var n = Bt.Buffer;
@@ -27188,10 +27183,10 @@ var Jd = Zh((O) => {
27188
27183
  };
27189
27184
  }, Vi;
27190
27185
  }
27191
- const Bd = {}, _d = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
27186
+ const _d = {}, Od = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
27192
27187
  __proto__: null,
27193
- default: Bd
27194
- }, Symbol.toStringTag, { value: "Module" })), Od = /* @__PURE__ */ Kp(_d);
27188
+ default: _d
27189
+ }, Symbol.toStringTag, { value: "Module" })), Ld = /* @__PURE__ */ ed(Od);
27195
27190
  (function(n) {
27196
27191
  var e = Bt.Buffer, t = Os, r = qh, i = n.exports;
27197
27192
  i.encodings = null, i.defaultCharUnicode = "�", i.defaultCharSingleByte = "?", i.encode = function(o, h, c) {
@@ -27210,7 +27205,7 @@ var Jd = Zh((O) => {
27210
27205
  }
27211
27206
  }, i.toEncoding = i.encode, i.fromEncoding = i.decode, i._codecDataCache = { __proto__: null }, i.getCodec = function(o) {
27212
27207
  if (!i.encodings) {
27213
- var h = Ad();
27208
+ var h = Ed();
27214
27209
  i.encodings = { __proto__: null }, r(i.encodings, h);
27215
27210
  }
27216
27211
  for (var c = i._canonicalizeEncoding(o), u = {}; ; ) {
@@ -27243,7 +27238,7 @@ var Jd = Zh((O) => {
27243
27238
  return c.bomAware && !(h && h.stripBOM === !1) && (u = new t.StripBOM(u, h)), u;
27244
27239
  }, i.enableStreamingAPI = function(o) {
27245
27240
  if (!i.supportsStreams) {
27246
- var h = Ed()(o);
27241
+ var h = Bd()(o);
27247
27242
  i.IconvLiteEncoderStream = h.IconvLiteEncoderStream, i.IconvLiteDecoderStream = h.IconvLiteDecoderStream, i.encodeStream = function(u, f) {
27248
27243
  return new i.IconvLiteEncoderStream(i.getEncoder(u, f), f);
27249
27244
  }, i.decodeStream = function(u, f) {
@@ -27253,15 +27248,15 @@ var Jd = Zh((O) => {
27253
27248
  };
27254
27249
  var s;
27255
27250
  try {
27256
- s = Od;
27251
+ s = Ld;
27257
27252
  } catch {
27258
27253
  }
27259
27254
  s && s.Transform ? i.enableStreamingAPI(s) : i.encodeStream = i.decodeStream = function() {
27260
27255
  throw new Error("iconv-lite Streaming API is not enabled. Use iconv.enableStreamingAPI(require('stream')); to enable it.");
27261
27256
  };
27262
27257
  })(Gh);
27263
- var Ld = Gh.exports;
27264
- const Ud = /* @__PURE__ */ Qp(Ld);
27258
+ var Ud = Gh.exports;
27259
+ const Rd = /* @__PURE__ */ Kp(Ud);
27265
27260
  class Rs extends Vo {
27266
27261
  /**
27267
27262
  * Creates a new instance of ShxTextShape
@@ -27309,9 +27304,9 @@ var Jd = Zh((O) => {
27309
27304
  return e;
27310
27305
  }
27311
27306
  }
27312
- class Rd extends qo {
27307
+ class Dd extends qo {
27313
27308
  constructor(e) {
27314
- super(e), this.type = "shx", this.font = new jp(e.data), this.data = this.font.fontData;
27309
+ super(e), this.type = "shx", this.font = new Qp(e.data), this.data = this.font.fontData;
27315
27310
  }
27316
27311
  /**
27317
27312
  * Return true if this font contains glyph of the specified character. Otherwise, return false.
@@ -27393,7 +27388,7 @@ var Jd = Zh((O) => {
27393
27388
  */
27394
27389
  getCode(e) {
27395
27390
  if (this.font.fontData.header.fontType === we.BIGFONT && this.encoding) {
27396
- const r = Ud.encode(e[0], this.encoding);
27391
+ const r = Rd.encode(e[0], this.encoding);
27397
27392
  return r.length === 1 ? r[0] : r[0] << 8 | r[1];
27398
27393
  } else
27399
27394
  return e.charCodeAt(0);
@@ -27419,7 +27414,7 @@ var Jd = Zh((O) => {
27419
27414
  */
27420
27415
  createFont(e) {
27421
27416
  if (e.type === "shx")
27422
- return new Rd(e);
27417
+ return new Dd(e);
27423
27418
  if (e.type === "mesh")
27424
27419
  return new Wp(e);
27425
27420
  throw new Error("Unsupported font data type");
@@ -27432,7 +27427,7 @@ var Jd = Zh((O) => {
27432
27427
  fontNotFound: new wa(),
27433
27428
  /** Event triggered when a font is successfully loaded */
27434
27429
  fontLoaded: new wa()
27435
- }, this.loader = new $c(), this.loader.setResponseType("arraybuffer"), this.fileNames = [], this.fontLoader = new Dd();
27430
+ }, this.loader = new $c(), this.loader.setResponseType("arraybuffer"), this.fileNames = [], this.fontLoader = new Id();
27436
27431
  }
27437
27432
  /**
27438
27433
  * Gets the singleton instance of the FontManager
@@ -27692,7 +27687,7 @@ var Jd = Zh((O) => {
27692
27687
  return e == null ? (this.loadedFontMap.clear(), !0) : this.loadedFontMap.delete(e);
27693
27688
  }
27694
27689
  }
27695
- class Dd {
27690
+ class Id {
27696
27691
  /**
27697
27692
  * Creates a new instance of DefaultFontLoader
27698
27693
  */
@@ -27788,7 +27783,7 @@ var Jd = Zh((O) => {
27788
27783
  });
27789
27784
  }
27790
27785
  }
27791
- class Id {
27786
+ class Pd {
27792
27787
  constructor() {
27793
27788
  this.lineBasicMaterials = {}, this.meshBasicMaterials = {}, this.unsupportedTextStyles = {};
27794
27789
  }
@@ -27813,12 +27808,12 @@ var Jd = Zh((O) => {
27813
27808
  }
27814
27809
  }
27815
27810
  var ir = /* @__PURE__ */ ((n) => (n[n.NONE = 0] = "NONE", n[n.WORD = 1] = "WORD", n[n.STACK = 2] = "STACK", n[n.SPACE = 3] = "SPACE", n[n.NBSP = 4] = "NBSP", n[n.TABULATOR = 5] = "TABULATOR", n[n.NEW_PARAGRAPH = 6] = "NEW_PARAGRAPH", n[n.NEW_COLUMN = 7] = "NEW_COLUMN", n[n.WRAP_AT_DIMLINE = 8] = "WRAP_AT_DIMLINE", n[n.PROPERTIES_CHANGED = 9] = "PROPERTIES_CHANGED", n))(ir || {}), kr = /* @__PURE__ */ ((n) => (n[n.BOTTOM = 0] = "BOTTOM", n[n.MIDDLE = 1] = "MIDDLE", n[n.TOP = 2] = "TOP", n))(kr || {}), Ge = /* @__PURE__ */ ((n) => (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", n))(Ge || {});
27816
- const Pd = {
27811
+ const zd = {
27817
27812
  c: "Ø",
27818
27813
  d: "°",
27819
27814
  p: "±",
27820
27815
  "%": "%"
27821
- }, zd = {
27816
+ }, Nd = {
27822
27817
  l: 1,
27823
27818
  r: 2,
27824
27819
  c: 3,
@@ -27826,14 +27821,14 @@ var Jd = Zh((O) => {
27826
27821
  d: 5
27827
27822
  /* DISTRIBUTED */
27828
27823
  };
27829
- function Nd(n, e = !1) {
27824
+ function Gd(n, e = !1) {
27830
27825
  const t = /* @__PURE__ */ new Set(), r = /\\[fF](.*?)[;|]/g;
27831
27826
  return [...n.matchAll(r)].forEach((i) => {
27832
27827
  let s = i[1].toLowerCase();
27833
27828
  e && (s = s.replace(/\.(ttf|otf|woff|shx)$/, "")), t.add(s);
27834
27829
  }), t;
27835
27830
  }
27836
- class Gd {
27831
+ class Hd {
27837
27832
  /**
27838
27833
  * Creates a new ContextStack with an initial context.
27839
27834
  * @param initial The initial MTextContext to use as the base of the stack.
@@ -27885,7 +27880,7 @@ var Jd = Zh((O) => {
27885
27880
  this.stack[this.stack.length - 1] = e;
27886
27881
  }
27887
27882
  }
27888
- class Hd {
27883
+ class Wd {
27889
27884
  /**
27890
27885
  * Creates a new MTextParser instance
27891
27886
  * @param content - The MText content to parse
@@ -27895,7 +27890,7 @@ var Jd = Zh((O) => {
27895
27890
  constructor(e, t, r = {}) {
27896
27891
  this.continueStroke = !1, this.inStackContext = !1, this.scanner = new Xi(e);
27897
27892
  const i = t ?? new $r();
27898
- this.ctxStack = new Gd(i), this.yieldPropertyCommands = r.yieldPropertyCommands ?? !1, this.resetParagraphParameters = r.resetParagraphParameters ?? !1, this.mifDecoder = r.mifDecoder ?? this.decodeMultiByteChar.bind(this), this.mifCodeLength = r.mifCodeLength ?? "auto";
27893
+ this.ctxStack = new Hd(i), this.yieldPropertyCommands = r.yieldPropertyCommands ?? !1, this.resetParagraphParameters = r.resetParagraphParameters ?? !1, this.mifDecoder = r.mifDecoder ?? this.decodeMultiByteChar.bind(this), this.mifCodeLength = r.mifCodeLength ?? "auto";
27899
27894
  }
27900
27895
  /**
27901
27896
  * Decode multi-byte character from hex code
@@ -28276,7 +28271,7 @@ var Jd = Zh((O) => {
28276
28271
  break;
28277
28272
  case "q": {
28278
28273
  const c = t.get();
28279
- for (a = zd[c] || 0; t.peek() === ","; )
28274
+ for (a = Nd[c] || 0; t.peek() === ","; )
28280
28275
  t.consume(1);
28281
28276
  break;
28282
28277
  }
@@ -28413,7 +28408,7 @@ var Jd = Zh((O) => {
28413
28408
  continue;
28414
28409
  }
28415
28410
  if (a === "%" && this.scanner.peek(1) === "%") {
28416
- const h = this.scanner.peek(2).toLowerCase(), c = Pd[h];
28411
+ const h = this.scanner.peek(2).toLowerCase(), c = zd[h];
28417
28412
  if (c) {
28418
28413
  this.scanner.consume(3), i += c;
28419
28414
  continue;
@@ -28874,7 +28869,7 @@ var Jd = Zh((O) => {
28874
28869
  }
28875
28870
  }
28876
28871
  var Hr = /* @__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))(Hr || {});
28877
- const Wd = /* @__PURE__ */ new A(), qd = 1.666666;
28872
+ const qd = /* @__PURE__ */ new A(), Vd = 1.666666;
28878
28873
  class Is extends $r {
28879
28874
  /**
28880
28875
  * Creates a new RenderContext instance with optional initial values.
@@ -28908,7 +28903,7 @@ var Jd = Zh((O) => {
28908
28903
  this.color.rgb = [t, r, i];
28909
28904
  }
28910
28905
  }
28911
- class Vd {
28906
+ class Xd {
28912
28907
  /**
28913
28908
  * Construct one instance of this class and initialize some properties with default values.
28914
28909
  * @param style Input text style
@@ -29007,7 +29002,7 @@ var Jd = Zh((O) => {
29007
29002
  * The height of current line of texts
29008
29003
  */
29009
29004
  get currentLineHeight() {
29010
- return this.defaultLineSpaceFactor * this.currentFontSize * qd + this.currentMaxFontSize;
29005
+ return this.defaultLineSpaceFactor * this.currentFontSize * Vd + this.currentMaxFontSize;
29011
29006
  }
29012
29007
  /**
29013
29008
  * The maximum font size in current line. Characters in one line may have different font and font
@@ -29410,7 +29405,7 @@ var Jd = Zh((O) => {
29410
29405
  if (e.forEach((r, i) => {
29411
29406
  r.boundingBox || r.computeBoundingBox(), i === 0 ? t = r.boundingBox : t.union(r.boundingBox);
29412
29407
  }), t) {
29413
- const r = t.getSize(Wd);
29408
+ const r = t.getSize(qd);
29414
29409
  switch (this.currentHorizontalAlignment) {
29415
29410
  case Ge.LEFT:
29416
29411
  e.forEach(
@@ -29515,7 +29510,7 @@ var Jd = Zh((O) => {
29515
29510
  * ```
29516
29511
  */
29517
29512
  static getFonts(e, t = !1) {
29518
- return Nd(e, t);
29513
+ return Gd(e, t);
29519
29514
  }
29520
29515
  /**
29521
29516
  * Creates a new instance of MText.
@@ -29683,12 +29678,12 @@ var Jd = Zh((O) => {
29683
29678
  value: e.widthFactor ?? 1,
29684
29679
  isRelative: !0
29685
29680
  }, u.align = s, u.paragraph.align = i;
29686
- const f = new Vd(
29681
+ const f = new Xd(
29687
29682
  t,
29688
29683
  this.styleManager,
29689
29684
  this.fontManager,
29690
29685
  c
29691
- ), p = new Hd(e.text, u, {
29686
+ ), p = new Wd(e.text, u, {
29692
29687
  resetParagraphParameters: !0,
29693
29688
  yieldPropertyCommands: !0
29694
29689
  }).parse();
@@ -29786,7 +29781,7 @@ var Jd = Zh((O) => {
29786
29781
  }
29787
29782
  }
29788
29783
  }
29789
- const Qi = ut.instance, Xd = new Id();
29784
+ const Qi = ut.instance, Yd = new Pd();
29790
29785
  self.addEventListener("message", async (n) => {
29791
29786
  const { type: e, id: t, data: r } = n.data;
29792
29787
  try {
@@ -29797,12 +29792,12 @@ var Jd = Zh((O) => {
29797
29792
  let o = new Ps(
29798
29793
  i,
29799
29794
  s,
29800
- Xd,
29795
+ Yd,
29801
29796
  Qi,
29802
29797
  a
29803
29798
  );
29804
29799
  await o.asyncDraw(), o.updateMatrixWorld(!0);
29805
- const { data: h, transferableObjects: c } = Yd(o);
29800
+ const { data: h, transferableObjects: c } = Zd(o);
29806
29801
  self.postMessage(
29807
29802
  {
29808
29803
  type: "render",
@@ -29858,12 +29853,12 @@ var Jd = Zh((O) => {
29858
29853
  });
29859
29854
  }
29860
29855
  });
29861
- function Yd(n) {
29856
+ function Zd(n) {
29862
29857
  const e = n.matrixWorld.clone(), t = new A(), r = new At(), i = new A();
29863
29858
  e.decompose(t, r, i);
29864
29859
  const s = n.box.clone();
29865
29860
  s.applyMatrix4(e);
29866
- const { children: a, transferableObjects: o } = Zd(n);
29861
+ const { children: a, transferableObjects: o } = Jd(n);
29867
29862
  return { data: {
29868
29863
  // Basic properties
29869
29864
  type: "MText",
@@ -29899,7 +29894,7 @@ var Jd = Zh((O) => {
29899
29894
  children: a
29900
29895
  }, transferableObjects: o };
29901
29896
  }
29902
- function Zd(n) {
29897
+ function Jd(n) {
29903
29898
  const e = [], t = [];
29904
29899
  return n.traverse((r) => {
29905
29900
  if (r instanceof Un || r instanceof ms) {
@@ -29974,4 +29969,4 @@ var Jd = Zh((O) => {
29974
29969
  }), { children: e, transferableObjects: t };
29975
29970
  }
29976
29971
  });
29977
- export default Jd();
29972
+ export default $d();