@mlightcad/mtext-renderer 0.10.12 → 0.10.14
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.
- package/dist/index.js +1331 -1208
- package/dist/index.umd.cjs +6 -6
- package/dist/mtext-renderer-worker.js +785 -665
- package/lib/renderer/constants.d.ts +10 -0
- package/lib/renderer/index.d.ts +1 -0
- package/lib/renderer/mtext.d.ts +82 -9
- package/lib/renderer/mtextProcessor.d.ts +3 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as R from "three";
|
|
2
2
|
import { BufferGeometry as rs, BufferAttribute as ns, ShapePath as Ya, ShapeUtils as ja, Shape as as, LineCurve as dr, QuadraticBezierCurve as Cn, CubicBezierCurve as En, EllipseCurve as Ln } from "three";
|
|
3
3
|
class An {
|
|
4
4
|
constructor() {
|
|
@@ -369,7 +369,7 @@ class Ka {
|
|
|
369
369
|
this.unsupportedChars[e] || (this.unsupportedChars[e] = 0), this.unsupportedChars[e]++;
|
|
370
370
|
}
|
|
371
371
|
}
|
|
372
|
-
class Qa extends
|
|
372
|
+
class Qa extends R.Shape {
|
|
373
373
|
constructor() {
|
|
374
374
|
super(...arguments), this.width = 0;
|
|
375
375
|
}
|
|
@@ -801,9 +801,9 @@ function Fs(t, e, r) {
|
|
|
801
801
|
var h = jr(t, Dn);
|
|
802
802
|
switch (h) {
|
|
803
803
|
case 16:
|
|
804
|
-
var
|
|
804
|
+
var d = Ue[o - 1];
|
|
805
805
|
for (c = Oe(t, 2, 3); c; --c)
|
|
806
|
-
Ue[o++] =
|
|
806
|
+
Ue[o++] = d;
|
|
807
807
|
break;
|
|
808
808
|
case 17:
|
|
809
809
|
for (c = Oe(t, 3, 3); c; --c)
|
|
@@ -889,23 +889,23 @@ Je.prototype.addY = function(t) {
|
|
|
889
889
|
this.addPoint(null, t);
|
|
890
890
|
};
|
|
891
891
|
Je.prototype.addBezier = function(t, e, r, n, a, i, s, o) {
|
|
892
|
-
var c = [t, e], u = [r, n], h = [a, i],
|
|
892
|
+
var c = [t, e], u = [r, n], h = [a, i], d = [s, o];
|
|
893
893
|
this.addPoint(t, e), this.addPoint(s, o);
|
|
894
894
|
for (var l = 0; l <= 1; l++) {
|
|
895
|
-
var
|
|
895
|
+
var p = 6 * c[l] - 12 * u[l] + 6 * h[l], x = -3 * c[l] + 9 * u[l] - 9 * h[l] + 3 * d[l], v = 3 * u[l] - 3 * c[l];
|
|
896
896
|
if (x === 0) {
|
|
897
|
-
if (
|
|
897
|
+
if (p === 0)
|
|
898
898
|
continue;
|
|
899
|
-
var b = -v /
|
|
900
|
-
0 < b && b < 1 && (l === 0 && this.addX(ht(c[l], u[l], h[l],
|
|
899
|
+
var b = -v / p;
|
|
900
|
+
0 < b && b < 1 && (l === 0 && this.addX(ht(c[l], u[l], h[l], d[l], b)), l === 1 && this.addY(ht(c[l], u[l], h[l], d[l], b)));
|
|
901
901
|
continue;
|
|
902
902
|
}
|
|
903
|
-
var
|
|
904
|
-
if (!(
|
|
905
|
-
var F = (-
|
|
906
|
-
0 < F && F < 1 && (l === 0 && this.addX(ht(c[l], u[l], h[l],
|
|
907
|
-
var w = (-
|
|
908
|
-
0 < w && w < 1 && (l === 0 && this.addX(ht(c[l], u[l], h[l],
|
|
903
|
+
var y = Math.pow(p, 2) - 4 * v * x;
|
|
904
|
+
if (!(y < 0)) {
|
|
905
|
+
var F = (-p + Math.sqrt(y)) / (2 * x);
|
|
906
|
+
0 < F && F < 1 && (l === 0 && this.addX(ht(c[l], u[l], h[l], d[l], F)), l === 1 && this.addY(ht(c[l], u[l], h[l], d[l], F)));
|
|
907
|
+
var w = (-p - Math.sqrt(y)) / (2 * x);
|
|
908
|
+
0 < w && w < 1 && (l === 0 && this.addX(ht(c[l], u[l], h[l], d[l], w)), l === 1 && this.addY(ht(c[l], u[l], h[l], d[l], w)));
|
|
909
909
|
}
|
|
910
910
|
}
|
|
911
911
|
};
|
|
@@ -1030,21 +1030,21 @@ function oi(t) {
|
|
|
1030
1030
|
function Nn(t, e) {
|
|
1031
1031
|
t || oi(e);
|
|
1032
1032
|
}
|
|
1033
|
-
var P = { fail: oi, argument: Nn, assert: Nn }, Gn = 32768, Hn = 2147483648, gt = {},
|
|
1033
|
+
var P = { fail: oi, argument: Nn, assert: Nn }, Gn = 32768, Hn = 2147483648, gt = {}, M = {}, N = {};
|
|
1034
1034
|
function Le(t) {
|
|
1035
1035
|
return function() {
|
|
1036
1036
|
return t;
|
|
1037
1037
|
};
|
|
1038
1038
|
}
|
|
1039
|
-
|
|
1039
|
+
M.BYTE = function(t) {
|
|
1040
1040
|
return P.argument(t >= 0 && t <= 255, "Byte value should be between 0 and 255."), [t];
|
|
1041
1041
|
};
|
|
1042
1042
|
N.BYTE = Le(1);
|
|
1043
|
-
|
|
1043
|
+
M.CHAR = function(t) {
|
|
1044
1044
|
return [t.charCodeAt(0)];
|
|
1045
1045
|
};
|
|
1046
1046
|
N.CHAR = Le(1);
|
|
1047
|
-
|
|
1047
|
+
M.CHARARRAY = function(t) {
|
|
1048
1048
|
typeof t > "u" && (t = "", console.warn("Undefined CHARARRAY encountered and treated as an empty string. This is probably caused by a missing glyph name."));
|
|
1049
1049
|
for (var e = [], r = 0; r < t.length; r += 1)
|
|
1050
1050
|
e[r] = t.charCodeAt(r);
|
|
@@ -1053,37 +1053,37 @@ R.CHARARRAY = function(t) {
|
|
|
1053
1053
|
N.CHARARRAY = function(t) {
|
|
1054
1054
|
return typeof t > "u" ? 0 : t.length;
|
|
1055
1055
|
};
|
|
1056
|
-
|
|
1056
|
+
M.USHORT = function(t) {
|
|
1057
1057
|
return [t >> 8 & 255, t & 255];
|
|
1058
1058
|
};
|
|
1059
1059
|
N.USHORT = Le(2);
|
|
1060
|
-
|
|
1060
|
+
M.SHORT = function(t) {
|
|
1061
1061
|
return t >= Gn && (t = -(2 * Gn - t)), [t >> 8 & 255, t & 255];
|
|
1062
1062
|
};
|
|
1063
1063
|
N.SHORT = Le(2);
|
|
1064
|
-
|
|
1064
|
+
M.UINT24 = function(t) {
|
|
1065
1065
|
return [t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
1066
1066
|
};
|
|
1067
1067
|
N.UINT24 = Le(3);
|
|
1068
|
-
|
|
1068
|
+
M.ULONG = function(t) {
|
|
1069
1069
|
return [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
1070
1070
|
};
|
|
1071
1071
|
N.ULONG = Le(4);
|
|
1072
|
-
|
|
1072
|
+
M.LONG = function(t) {
|
|
1073
1073
|
return t >= Hn && (t = -(2 * Hn - t)), [t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
1074
1074
|
};
|
|
1075
1075
|
N.LONG = Le(4);
|
|
1076
|
-
|
|
1076
|
+
M.FIXED = M.ULONG;
|
|
1077
1077
|
N.FIXED = N.ULONG;
|
|
1078
|
-
|
|
1078
|
+
M.FWORD = M.SHORT;
|
|
1079
1079
|
N.FWORD = N.SHORT;
|
|
1080
|
-
|
|
1080
|
+
M.UFWORD = M.USHORT;
|
|
1081
1081
|
N.UFWORD = N.USHORT;
|
|
1082
|
-
|
|
1082
|
+
M.LONGDATETIME = function(t) {
|
|
1083
1083
|
return [0, 0, 0, 0, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
1084
1084
|
};
|
|
1085
1085
|
N.LONGDATETIME = Le(8);
|
|
1086
|
-
|
|
1086
|
+
M.TAG = function(t) {
|
|
1087
1087
|
return P.argument(t.length === 4, "Tag should be exactly 4 ASCII characters."), [
|
|
1088
1088
|
t.charCodeAt(0),
|
|
1089
1089
|
t.charCodeAt(1),
|
|
@@ -1092,29 +1092,29 @@ R.TAG = function(t) {
|
|
|
1092
1092
|
];
|
|
1093
1093
|
};
|
|
1094
1094
|
N.TAG = Le(4);
|
|
1095
|
-
|
|
1095
|
+
M.Card8 = M.BYTE;
|
|
1096
1096
|
N.Card8 = N.BYTE;
|
|
1097
|
-
|
|
1097
|
+
M.Card16 = M.USHORT;
|
|
1098
1098
|
N.Card16 = N.USHORT;
|
|
1099
|
-
|
|
1099
|
+
M.OffSize = M.BYTE;
|
|
1100
1100
|
N.OffSize = N.BYTE;
|
|
1101
|
-
|
|
1101
|
+
M.SID = M.USHORT;
|
|
1102
1102
|
N.SID = N.USHORT;
|
|
1103
|
-
|
|
1104
|
-
return t >= -107 && t <= 107 ? [t + 139] : t >= 108 && t <= 1131 ? (t = t - 108, [(t >> 8) + 247, t & 255]) : t >= -1131 && t <= -108 ? (t = -t - 108, [(t >> 8) + 251, t & 255]) : t >= -32768 && t <= 32767 ?
|
|
1103
|
+
M.NUMBER = function(t) {
|
|
1104
|
+
return t >= -107 && t <= 107 ? [t + 139] : t >= 108 && t <= 1131 ? (t = t - 108, [(t >> 8) + 247, t & 255]) : t >= -1131 && t <= -108 ? (t = -t - 108, [(t >> 8) + 251, t & 255]) : t >= -32768 && t <= 32767 ? M.NUMBER16(t) : M.NUMBER32(t);
|
|
1105
1105
|
};
|
|
1106
1106
|
N.NUMBER = function(t) {
|
|
1107
|
-
return
|
|
1107
|
+
return M.NUMBER(t).length;
|
|
1108
1108
|
};
|
|
1109
|
-
|
|
1109
|
+
M.NUMBER16 = function(t) {
|
|
1110
1110
|
return [28, t >> 8 & 255, t & 255];
|
|
1111
1111
|
};
|
|
1112
1112
|
N.NUMBER16 = Le(3);
|
|
1113
|
-
|
|
1113
|
+
M.NUMBER32 = function(t) {
|
|
1114
1114
|
return [29, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, t & 255];
|
|
1115
1115
|
};
|
|
1116
1116
|
N.NUMBER32 = Le(5);
|
|
1117
|
-
|
|
1117
|
+
M.REAL = function(t) {
|
|
1118
1118
|
var e = t.toString(), r = /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/.exec(e);
|
|
1119
1119
|
if (r) {
|
|
1120
1120
|
var n = parseFloat("1e" + ((r[2] ? +r[2] : 0) + r[1].length));
|
|
@@ -1130,11 +1130,11 @@ R.REAL = function(t) {
|
|
|
1130
1130
|
return c;
|
|
1131
1131
|
};
|
|
1132
1132
|
N.REAL = function(t) {
|
|
1133
|
-
return
|
|
1133
|
+
return M.REAL(t).length;
|
|
1134
1134
|
};
|
|
1135
|
-
|
|
1135
|
+
M.NAME = M.CHARARRAY;
|
|
1136
1136
|
N.NAME = N.CHARARRAY;
|
|
1137
|
-
|
|
1137
|
+
M.STRING = M.CHARARRAY;
|
|
1138
1138
|
N.STRING = N.CHARARRAY;
|
|
1139
1139
|
gt.UTF8 = function(t, e, r) {
|
|
1140
1140
|
for (var n = [], a = r, i = 0; i < a; i++, e += 1)
|
|
@@ -1146,7 +1146,7 @@ gt.UTF16 = function(t, e, r) {
|
|
|
1146
1146
|
n[i] = t.getUint16(e);
|
|
1147
1147
|
return String.fromCharCode.apply(null, n);
|
|
1148
1148
|
};
|
|
1149
|
-
|
|
1149
|
+
M.UTF16 = function(t) {
|
|
1150
1150
|
for (var e = [], r = 0; r < t.length; r += 1) {
|
|
1151
1151
|
var n = t.charCodeAt(r);
|
|
1152
1152
|
e[e.length] = n >> 8 & 255, e[e.length] = n & 255;
|
|
@@ -1229,7 +1229,7 @@ var zt = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap(), Wt, Es =
|
|
|
1229
1229
|
}
|
|
1230
1230
|
}
|
|
1231
1231
|
};
|
|
1232
|
-
|
|
1232
|
+
M.MACSTRING = function(t, e) {
|
|
1233
1233
|
var r = Es(e);
|
|
1234
1234
|
if (r !== void 0) {
|
|
1235
1235
|
for (var n = [], a = 0; a < t.length; a++) {
|
|
@@ -1242,7 +1242,7 @@ R.MACSTRING = function(t, e) {
|
|
|
1242
1242
|
}
|
|
1243
1243
|
};
|
|
1244
1244
|
N.MACSTRING = function(t, e) {
|
|
1245
|
-
var r =
|
|
1245
|
+
var r = M.MACSTRING(t, e);
|
|
1246
1246
|
return r !== void 0 ? r.length : 0;
|
|
1247
1247
|
};
|
|
1248
1248
|
function Zr(t) {
|
|
@@ -1279,68 +1279,68 @@ function Bs(t, e, r) {
|
|
|
1279
1279
|
}
|
|
1280
1280
|
return i;
|
|
1281
1281
|
}
|
|
1282
|
-
|
|
1282
|
+
M.VARDELTAS = function(t) {
|
|
1283
1283
|
for (var e = 0, r = []; e < t.length; ) {
|
|
1284
1284
|
var n = t[e];
|
|
1285
1285
|
n === 0 ? e = Ls(t, e, r) : n >= -128 && n <= 127 ? e = As(t, e, r) : e = Bs(t, e, r);
|
|
1286
1286
|
}
|
|
1287
1287
|
return r;
|
|
1288
1288
|
};
|
|
1289
|
-
|
|
1289
|
+
M.INDEX = function(t) {
|
|
1290
1290
|
for (var e = 1, r = [e], n = [], a = 0; a < t.length; a += 1) {
|
|
1291
|
-
var i =
|
|
1291
|
+
var i = M.OBJECT(t[a]);
|
|
1292
1292
|
Array.prototype.push.apply(n, i), e += i.length, r.push(e);
|
|
1293
1293
|
}
|
|
1294
1294
|
if (n.length === 0)
|
|
1295
1295
|
return [0, 0];
|
|
1296
|
-
for (var s = [], o = 1 + Math.floor(Math.log(e) / Math.log(2)) / 8 | 0, c = [void 0,
|
|
1296
|
+
for (var s = [], o = 1 + Math.floor(Math.log(e) / Math.log(2)) / 8 | 0, c = [void 0, M.BYTE, M.USHORT, M.UINT24, M.ULONG][o], u = 0; u < r.length; u += 1) {
|
|
1297
1297
|
var h = c(r[u]);
|
|
1298
1298
|
Array.prototype.push.apply(s, h);
|
|
1299
1299
|
}
|
|
1300
1300
|
return Array.prototype.concat(
|
|
1301
|
-
|
|
1302
|
-
|
|
1301
|
+
M.Card16(t.length),
|
|
1302
|
+
M.OffSize(o),
|
|
1303
1303
|
s,
|
|
1304
1304
|
n
|
|
1305
1305
|
);
|
|
1306
1306
|
};
|
|
1307
1307
|
N.INDEX = function(t) {
|
|
1308
|
-
return
|
|
1308
|
+
return M.INDEX(t).length;
|
|
1309
1309
|
};
|
|
1310
|
-
|
|
1310
|
+
M.DICT = function(t) {
|
|
1311
1311
|
for (var e = [], r = Object.keys(t), n = r.length, a = 0; a < n; a += 1) {
|
|
1312
1312
|
var i = parseInt(r[a], 0), s = t[i];
|
|
1313
|
-
e = e.concat(
|
|
1313
|
+
e = e.concat(M.OPERAND(s.value, s.type)), e = e.concat(M.OPERATOR(i));
|
|
1314
1314
|
}
|
|
1315
1315
|
return e;
|
|
1316
1316
|
};
|
|
1317
1317
|
N.DICT = function(t) {
|
|
1318
|
-
return
|
|
1318
|
+
return M.DICT(t).length;
|
|
1319
1319
|
};
|
|
1320
|
-
|
|
1320
|
+
M.OPERATOR = function(t) {
|
|
1321
1321
|
return t < 1200 ? [t] : [12, t - 1200];
|
|
1322
1322
|
};
|
|
1323
|
-
|
|
1323
|
+
M.OPERAND = function(t, e) {
|
|
1324
1324
|
var r = [];
|
|
1325
1325
|
if (Array.isArray(e))
|
|
1326
1326
|
for (var n = 0; n < e.length; n += 1)
|
|
1327
|
-
P.argument(t.length === e.length, "Not enough arguments given for type" + e), r = r.concat(
|
|
1327
|
+
P.argument(t.length === e.length, "Not enough arguments given for type" + e), r = r.concat(M.OPERAND(t[n], e[n]));
|
|
1328
1328
|
else if (e === "SID")
|
|
1329
|
-
r = r.concat(
|
|
1329
|
+
r = r.concat(M.NUMBER(t));
|
|
1330
1330
|
else if (e === "offset")
|
|
1331
|
-
r = r.concat(
|
|
1331
|
+
r = r.concat(M.NUMBER32(t));
|
|
1332
1332
|
else if (e === "number")
|
|
1333
|
-
r = r.concat(
|
|
1333
|
+
r = r.concat(M.NUMBER(t));
|
|
1334
1334
|
else if (e === "real")
|
|
1335
|
-
r = r.concat(
|
|
1335
|
+
r = r.concat(M.REAL(t));
|
|
1336
1336
|
else
|
|
1337
1337
|
throw new Error("Unknown operand type " + e);
|
|
1338
1338
|
return r;
|
|
1339
1339
|
};
|
|
1340
|
-
|
|
1340
|
+
M.OP = M.BYTE;
|
|
1341
1341
|
N.OP = N.BYTE;
|
|
1342
1342
|
var Vt = typeof WeakMap == "function" && /* @__PURE__ */ new WeakMap();
|
|
1343
|
-
|
|
1343
|
+
M.CHARSTRING = function(t) {
|
|
1344
1344
|
if (Vt) {
|
|
1345
1345
|
var e = Vt.get(t);
|
|
1346
1346
|
if (e !== void 0)
|
|
@@ -1348,24 +1348,24 @@ R.CHARSTRING = function(t) {
|
|
|
1348
1348
|
}
|
|
1349
1349
|
for (var r = [], n = t.length, a = 0; a < n; a += 1) {
|
|
1350
1350
|
var i = t[a];
|
|
1351
|
-
r = r.concat(
|
|
1351
|
+
r = r.concat(M[i.type](i.value));
|
|
1352
1352
|
}
|
|
1353
1353
|
return Vt && Vt.set(t, r), r;
|
|
1354
1354
|
};
|
|
1355
1355
|
N.CHARSTRING = function(t) {
|
|
1356
|
-
return
|
|
1356
|
+
return M.CHARSTRING(t).length;
|
|
1357
1357
|
};
|
|
1358
|
-
|
|
1359
|
-
var e =
|
|
1358
|
+
M.OBJECT = function(t) {
|
|
1359
|
+
var e = M[t.type];
|
|
1360
1360
|
return P.argument(e !== void 0, "No encoding function for type " + t.type), e(t.value);
|
|
1361
1361
|
};
|
|
1362
1362
|
N.OBJECT = function(t) {
|
|
1363
1363
|
var e = N[t.type];
|
|
1364
1364
|
return P.argument(e !== void 0, "No sizeOf function for type " + t.type), e(t.value);
|
|
1365
1365
|
};
|
|
1366
|
-
|
|
1366
|
+
M.TABLE = function(t) {
|
|
1367
1367
|
for (var e = [], r = t.fields.length, n = [], a = [], i = 0; i < r; i += 1) {
|
|
1368
|
-
var s = t.fields[i], o =
|
|
1368
|
+
var s = t.fields[i], o = M[s.type];
|
|
1369
1369
|
P.argument(o !== void 0, "No encoding function for field type " + s.type + " (" + s.name + ")");
|
|
1370
1370
|
var c = t[s.name];
|
|
1371
1371
|
c === void 0 && (c = s.value);
|
|
@@ -1373,8 +1373,8 @@ R.TABLE = function(t) {
|
|
|
1373
1373
|
s.type === "TABLE" ? (a.push(e.length), e = e.concat([0, 0]), n.push(u)) : e = e.concat(u);
|
|
1374
1374
|
}
|
|
1375
1375
|
for (var h = 0; h < n.length; h += 1) {
|
|
1376
|
-
var
|
|
1377
|
-
P.argument(l < 65536, "Table " + t.tableName + " too big."), e[
|
|
1376
|
+
var d = a[h], l = e.length;
|
|
1377
|
+
P.argument(l < 65536, "Table " + t.tableName + " too big."), e[d] = l >> 8, e[d + 1] = l & 255, e = e.concat(n[h]);
|
|
1378
1378
|
}
|
|
1379
1379
|
return e;
|
|
1380
1380
|
};
|
|
@@ -1387,9 +1387,9 @@ N.TABLE = function(t) {
|
|
|
1387
1387
|
}
|
|
1388
1388
|
return e;
|
|
1389
1389
|
};
|
|
1390
|
-
|
|
1390
|
+
M.RECORD = M.TABLE;
|
|
1391
1391
|
N.RECORD = N.TABLE;
|
|
1392
|
-
|
|
1392
|
+
M.LITERAL = function(t) {
|
|
1393
1393
|
return t;
|
|
1394
1394
|
};
|
|
1395
1395
|
N.LITERAL = function(t) {
|
|
@@ -1408,7 +1408,7 @@ function pe(t, e, r) {
|
|
|
1408
1408
|
}
|
|
1409
1409
|
}
|
|
1410
1410
|
pe.prototype.encode = function() {
|
|
1411
|
-
return
|
|
1411
|
+
return M.TABLE(this);
|
|
1412
1412
|
};
|
|
1413
1413
|
pe.prototype.sizeOf = function() {
|
|
1414
1414
|
return N.TABLE(this);
|
|
@@ -1881,9 +1881,9 @@ function Ps(t, e, r, n, a) {
|
|
|
1881
1881
|
t.length = e.parseUShort(), t.language = e.parseUShort();
|
|
1882
1882
|
var i;
|
|
1883
1883
|
t.segCount = i = e.parseUShort() >> 1, e.skip("uShort", 3), t.glyphIndexMap = {};
|
|
1884
|
-
for (var s = new _.Parser(r, n + a + 14), o = new _.Parser(r, n + a + 16 + i * 2), c = new _.Parser(r, n + a + 16 + i * 4), u = new _.Parser(r, n + a + 16 + i * 6), h = n + a + 16 + i * 8,
|
|
1885
|
-
for (var l = void 0,
|
|
1886
|
-
b !== 0 ? (h = u.offset + u.relativeOffset - 2, h += b, h += (
|
|
1884
|
+
for (var s = new _.Parser(r, n + a + 14), o = new _.Parser(r, n + a + 16 + i * 2), c = new _.Parser(r, n + a + 16 + i * 4), u = new _.Parser(r, n + a + 16 + i * 6), h = n + a + 16 + i * 8, d = 0; d < i - 1; d += 1)
|
|
1885
|
+
for (var l = void 0, p = s.parseUShort(), x = o.parseUShort(), v = c.parseShort(), b = u.parseUShort(), y = x; y <= p; y += 1)
|
|
1886
|
+
b !== 0 ? (h = u.offset + u.relativeOffset - 2, h += b, h += (y - x) * 2, l = _.getUShort(r, h), l !== 0 && (l = l + v & 65535)) : l = y + v & 65535, t.glyphIndexMap[y] = l;
|
|
1887
1887
|
}
|
|
1888
1888
|
function Ns(t, e) {
|
|
1889
1889
|
var r = {};
|
|
@@ -1965,20 +1965,20 @@ function zs(t) {
|
|
|
1965
1965
|
});
|
|
1966
1966
|
}
|
|
1967
1967
|
Hs(i);
|
|
1968
|
-
var c = i.segments.length, u = 0, h = [],
|
|
1968
|
+
var c = i.segments.length, u = 0, h = [], d = [], l = [], p = [], x = [], v = [];
|
|
1969
1969
|
for (r = 0; r < c; r += 1) {
|
|
1970
1970
|
var b = i.segments[r];
|
|
1971
|
-
b.end <= 65535 && b.start <= 65535 ? (h = h.concat({ name: "end_" + r, type: "USHORT", value: b.end }),
|
|
1971
|
+
b.end <= 65535 && b.start <= 65535 ? (h = h.concat({ name: "end_" + r, type: "USHORT", value: b.end }), d = d.concat({ name: "start_" + r, type: "USHORT", value: b.start }), l = l.concat({ name: "idDelta_" + r, type: "SHORT", value: b.delta }), p = p.concat({ name: "idRangeOffset_" + r, type: "USHORT", value: b.offset }), b.glyphId !== void 0 && (x = x.concat({ name: "glyph_" + r, type: "USHORT", value: b.glyphId }))) : u += 1, !e && b.glyphIndex !== void 0 && (v = v.concat({ name: "cmap12Start_" + r, type: "ULONG", value: b.start }), v = v.concat({ name: "cmap12End_" + r, type: "ULONG", value: b.end }), v = v.concat({ name: "cmap12Glyph_" + r, type: "ULONG", value: b.glyphIndex }));
|
|
1972
1972
|
}
|
|
1973
|
-
if (i.segCountX2 = (c - u) * 2, i.searchRange = Math.pow(2, Math.floor(Math.log(c - u) / Math.log(2))) * 2, i.entrySelector = Math.log(i.searchRange / 2) / Math.log(2), i.rangeShift = i.segCountX2 - i.searchRange, i.fields = i.fields.concat(h), i.fields.push({ name: "reservedPad", type: "USHORT", value: 0 }), i.fields = i.fields.concat(
|
|
1973
|
+
if (i.segCountX2 = (c - u) * 2, i.searchRange = Math.pow(2, Math.floor(Math.log(c - u) / Math.log(2))) * 2, i.entrySelector = Math.log(i.searchRange / 2) / Math.log(2), i.rangeShift = i.segCountX2 - i.searchRange, i.fields = i.fields.concat(h), i.fields.push({ name: "reservedPad", type: "USHORT", value: 0 }), i.fields = i.fields.concat(d), i.fields = i.fields.concat(l), i.fields = i.fields.concat(p), i.fields = i.fields.concat(x), i.cmap4Length = 14 + // Subtable header
|
|
1974
1974
|
h.length * 2 + 2 + // reservedPad
|
|
1975
|
-
|
|
1976
|
-
var
|
|
1975
|
+
d.length * 2 + l.length * 2 + p.length * 2 + x.length * 2, !e) {
|
|
1976
|
+
var y = 16 + // Subtable header
|
|
1977
1977
|
v.length * 4;
|
|
1978
1978
|
i.cmap12Offset = 12 + 2 * 2 + 4 + i.cmap4Length, i.fields = i.fields.concat([
|
|
1979
1979
|
{ name: "cmap12Format", type: "USHORT", value: 12 },
|
|
1980
1980
|
{ name: "cmap12Reserved", type: "USHORT", value: 0 },
|
|
1981
|
-
{ name: "cmap12Length", type: "ULONG", value:
|
|
1981
|
+
{ name: "cmap12Length", type: "ULONG", value: y },
|
|
1982
1982
|
{ name: "cmap12Language", type: "ULONG", value: 0 },
|
|
1983
1983
|
{ name: "cmap12nGroups", type: "ULONG", value: v.length / 3 }
|
|
1984
1984
|
]), i.fields = i.fields.concat(v);
|
|
@@ -3261,8 +3261,8 @@ ke.prototype.getPath = function(t, e, r, n, a) {
|
|
|
3261
3261
|
var u = 1 / (this.path.unitsPerEm || 1e3) * r;
|
|
3262
3262
|
o === void 0 && (o = u), c === void 0 && (c = u);
|
|
3263
3263
|
}
|
|
3264
|
-
for (var h = new he(),
|
|
3265
|
-
var l = i[
|
|
3264
|
+
for (var h = new he(), d = 0; d < i.length; d += 1) {
|
|
3265
|
+
var l = i[d];
|
|
3266
3266
|
l.type === "M" ? h.moveTo(t + l.x * o, e + -l.y * c) : l.type === "L" ? h.lineTo(t + l.x * o, e + -l.y * c) : l.type === "Q" ? h.quadraticCurveTo(
|
|
3267
3267
|
t + l.x1 * o,
|
|
3268
3268
|
e + -l.y1 * c,
|
|
@@ -3306,10 +3306,10 @@ ke.prototype.draw = function(t, e, r, n, a) {
|
|
|
3306
3306
|
this.getPath(e, r, n, a).draw(t);
|
|
3307
3307
|
};
|
|
3308
3308
|
ke.prototype.drawPoints = function(t, e, r, n) {
|
|
3309
|
-
function a(
|
|
3309
|
+
function a(d, l, p, x) {
|
|
3310
3310
|
t.beginPath();
|
|
3311
|
-
for (var v = 0; v <
|
|
3312
|
-
t.moveTo(l +
|
|
3311
|
+
for (var v = 0; v < d.length; v += 1)
|
|
3312
|
+
t.moveTo(l + d[v].x * x, p + d[v].y * x), t.arc(l + d[v].x * x, p + d[v].y * x, 2, 0, Math.PI * 2, !1);
|
|
3313
3313
|
t.closePath(), t.fill();
|
|
3314
3314
|
}
|
|
3315
3315
|
e = e !== void 0 ? e : 0, r = r !== void 0 ? r : 0, n = n !== void 0 ? n : 24;
|
|
@@ -3410,8 +3410,8 @@ function qe(t, e, r) {
|
|
|
3410
3410
|
o = s + n[i];
|
|
3411
3411
|
} else
|
|
3412
3412
|
o = e + 2;
|
|
3413
|
-
for (var
|
|
3414
|
-
var l = _.getBytes(t, s + n[
|
|
3413
|
+
for (var d = 0; d < n.length - 1; d += 1) {
|
|
3414
|
+
var l = _.getBytes(t, s + n[d], s + n[d + 1]);
|
|
3415
3415
|
r && (l = r(l)), a.push(l);
|
|
3416
3416
|
}
|
|
3417
3417
|
return { objects: a, startOffset: e, endOffset: o };
|
|
@@ -3558,7 +3558,7 @@ function Vn(t, e, r, n) {
|
|
|
3558
3558
|
if (c !== 0 && u !== 0) {
|
|
3559
3559
|
var h = yi(t, u + e, c, n);
|
|
3560
3560
|
if (o._defaultWidthX = h.defaultWidthX, o._nominalWidthX = h.nominalWidthX, h.subrs !== 0) {
|
|
3561
|
-
var
|
|
3561
|
+
var d = u + h.subrs, l = qe(t, d + e);
|
|
3562
3562
|
o._subrs = l.objects, o._subrsBias = Qr(o._subrs);
|
|
3563
3563
|
}
|
|
3564
3564
|
o._privateDict = h;
|
|
@@ -3583,7 +3583,7 @@ function so(t, e, r, n) {
|
|
|
3583
3583
|
else if (c === 2)
|
|
3584
3584
|
for (; o.length <= r; ) {
|
|
3585
3585
|
a = s.parseSID(), i = s.parseCard16();
|
|
3586
|
-
for (var
|
|
3586
|
+
for (var d = 0; d <= i; d += 1)
|
|
3587
3587
|
o.push(kt(n, a)), a += 1;
|
|
3588
3588
|
}
|
|
3589
3589
|
else
|
|
@@ -3599,26 +3599,26 @@ function oo(t, e, r) {
|
|
|
3599
3599
|
var u = i.parseCard8();
|
|
3600
3600
|
n = 1;
|
|
3601
3601
|
for (var h = 0; h < u; h += 1)
|
|
3602
|
-
for (var
|
|
3603
|
-
a[
|
|
3602
|
+
for (var d = i.parseCard8(), l = i.parseCard8(), p = d; p <= d + l; p += 1)
|
|
3603
|
+
a[p] = n, n += 1;
|
|
3604
3604
|
} else
|
|
3605
3605
|
throw new Error("Unknown encoding format " + s);
|
|
3606
3606
|
return new or(a, r);
|
|
3607
3607
|
}
|
|
3608
3608
|
function qn(t, e, r) {
|
|
3609
|
-
var n, a, i, s, o = new he(), c = [], u = 0, h = !1,
|
|
3609
|
+
var n, a, i, s, o = new he(), c = [], u = 0, h = !1, d = !1, l = 0, p = 0, x, v, b, y;
|
|
3610
3610
|
if (t.isCIDFont) {
|
|
3611
3611
|
var F = t.tables.cff.topDict._fdSelect[e.index], w = t.tables.cff.topDict._fdArray[F];
|
|
3612
|
-
x = w._subrs, v = w._subrsBias, b = w._defaultWidthX,
|
|
3612
|
+
x = w._subrs, v = w._subrsBias, b = w._defaultWidthX, y = w._nominalWidthX;
|
|
3613
3613
|
} else
|
|
3614
|
-
x = t.tables.cff.topDict._subrs, v = t.tables.cff.topDict._subrsBias, b = t.tables.cff.topDict._defaultWidthX,
|
|
3614
|
+
x = t.tables.cff.topDict._subrs, v = t.tables.cff.topDict._subrsBias, b = t.tables.cff.topDict._defaultWidthX, y = t.tables.cff.topDict._nominalWidthX;
|
|
3615
3615
|
var k = b;
|
|
3616
3616
|
function C(O, H) {
|
|
3617
|
-
|
|
3617
|
+
d && o.closePath(), o.moveTo(O, H), d = !0;
|
|
3618
3618
|
}
|
|
3619
3619
|
function U() {
|
|
3620
3620
|
var O;
|
|
3621
|
-
O = c.length % 2 !== 0, O && !h && (k = c.shift() +
|
|
3621
|
+
O = c.length % 2 !== 0, O && !h && (k = c.shift() + y), u += c.length >> 1, c.length = 0, h = !0;
|
|
3622
3622
|
}
|
|
3623
3623
|
function B(O) {
|
|
3624
3624
|
for (var H, W, z, le, ce, $, K, Q, ae, ue, oe, fe, G = 0; G < O.length; ) {
|
|
@@ -3631,23 +3631,23 @@ function qn(t, e, r) {
|
|
|
3631
3631
|
U();
|
|
3632
3632
|
break;
|
|
3633
3633
|
case 4:
|
|
3634
|
-
c.length > 1 && !h && (k = c.shift() +
|
|
3634
|
+
c.length > 1 && !h && (k = c.shift() + y, h = !0), p += c.pop(), C(l, p);
|
|
3635
3635
|
break;
|
|
3636
3636
|
case 5:
|
|
3637
3637
|
for (; c.length > 0; )
|
|
3638
|
-
l += c.shift(),
|
|
3638
|
+
l += c.shift(), p += c.shift(), o.lineTo(l, p);
|
|
3639
3639
|
break;
|
|
3640
3640
|
case 6:
|
|
3641
|
-
for (; c.length > 0 && (l += c.shift(), o.lineTo(l,
|
|
3642
|
-
|
|
3641
|
+
for (; c.length > 0 && (l += c.shift(), o.lineTo(l, p), c.length !== 0); )
|
|
3642
|
+
p += c.shift(), o.lineTo(l, p);
|
|
3643
3643
|
break;
|
|
3644
3644
|
case 7:
|
|
3645
|
-
for (; c.length > 0 && (
|
|
3646
|
-
l += c.shift(), o.lineTo(l,
|
|
3645
|
+
for (; c.length > 0 && (p += c.shift(), o.lineTo(l, p), c.length !== 0); )
|
|
3646
|
+
l += c.shift(), o.lineTo(l, p);
|
|
3647
3647
|
break;
|
|
3648
3648
|
case 8:
|
|
3649
3649
|
for (; c.length > 0; )
|
|
3650
|
-
n = l + c.shift(), a =
|
|
3650
|
+
n = l + c.shift(), a = p + c.shift(), i = n + c.shift(), s = a + c.shift(), l = i + c.shift(), p = s + c.shift(), o.curveTo(n, a, i, s, l, p);
|
|
3651
3651
|
break;
|
|
3652
3652
|
case 10:
|
|
3653
3653
|
ce = c.pop() + v, $ = x[ce], $ && B($);
|
|
@@ -3657,23 +3657,23 @@ function qn(t, e, r) {
|
|
|
3657
3657
|
case 12:
|
|
3658
3658
|
switch (q = O[G], G += 1, q) {
|
|
3659
3659
|
case 35:
|
|
3660
|
-
n = l + c.shift(), a =
|
|
3660
|
+
n = l + c.shift(), a = p + c.shift(), i = n + c.shift(), s = a + c.shift(), K = i + c.shift(), Q = s + c.shift(), ae = K + c.shift(), ue = Q + c.shift(), oe = ae + c.shift(), fe = ue + c.shift(), l = oe + c.shift(), p = fe + c.shift(), c.shift(), o.curveTo(n, a, i, s, K, Q), o.curveTo(ae, ue, oe, fe, l, p);
|
|
3661
3661
|
break;
|
|
3662
3662
|
case 34:
|
|
3663
|
-
n = l + c.shift(), a =
|
|
3663
|
+
n = l + c.shift(), a = p, i = n + c.shift(), s = a + c.shift(), K = i + c.shift(), Q = s, ae = K + c.shift(), ue = s, oe = ae + c.shift(), fe = p, l = oe + c.shift(), o.curveTo(n, a, i, s, K, Q), o.curveTo(ae, ue, oe, fe, l, p);
|
|
3664
3664
|
break;
|
|
3665
3665
|
case 36:
|
|
3666
|
-
n = l + c.shift(), a =
|
|
3666
|
+
n = l + c.shift(), a = p + c.shift(), i = n + c.shift(), s = a + c.shift(), K = i + c.shift(), Q = s, ae = K + c.shift(), ue = s, oe = ae + c.shift(), fe = ue + c.shift(), l = oe + c.shift(), o.curveTo(n, a, i, s, K, Q), o.curveTo(ae, ue, oe, fe, l, p);
|
|
3667
3667
|
break;
|
|
3668
3668
|
case 37:
|
|
3669
|
-
n = l + c.shift(), a =
|
|
3669
|
+
n = l + c.shift(), a = p + c.shift(), i = n + c.shift(), s = a + c.shift(), K = i + c.shift(), Q = s + c.shift(), ae = K + c.shift(), ue = Q + c.shift(), oe = ae + c.shift(), fe = ue + c.shift(), Math.abs(oe - l) > Math.abs(fe - p) ? l = oe + c.shift() : p = fe + c.shift(), o.curveTo(n, a, i, s, K, Q), o.curveTo(ae, ue, oe, fe, l, p);
|
|
3670
3670
|
break;
|
|
3671
3671
|
default:
|
|
3672
3672
|
console.log("Glyph " + e.index + ": unknown operator 1200" + q), c.length = 0;
|
|
3673
3673
|
}
|
|
3674
3674
|
break;
|
|
3675
3675
|
case 14:
|
|
3676
|
-
c.length > 0 && !h && (k = c.shift() +
|
|
3676
|
+
c.length > 0 && !h && (k = c.shift() + y, h = !0), d && (o.closePath(), d = !1);
|
|
3677
3677
|
break;
|
|
3678
3678
|
case 18:
|
|
3679
3679
|
U();
|
|
@@ -3683,31 +3683,31 @@ function qn(t, e, r) {
|
|
|
3683
3683
|
U(), G += u + 7 >> 3;
|
|
3684
3684
|
break;
|
|
3685
3685
|
case 21:
|
|
3686
|
-
c.length > 2 && !h && (k = c.shift() +
|
|
3686
|
+
c.length > 2 && !h && (k = c.shift() + y, h = !0), p += c.pop(), l += c.pop(), C(l, p);
|
|
3687
3687
|
break;
|
|
3688
3688
|
case 22:
|
|
3689
|
-
c.length > 1 && !h && (k = c.shift() +
|
|
3689
|
+
c.length > 1 && !h && (k = c.shift() + y, h = !0), l += c.pop(), C(l, p);
|
|
3690
3690
|
break;
|
|
3691
3691
|
case 23:
|
|
3692
3692
|
U();
|
|
3693
3693
|
break;
|
|
3694
3694
|
case 24:
|
|
3695
3695
|
for (; c.length > 2; )
|
|
3696
|
-
n = l + c.shift(), a =
|
|
3697
|
-
l += c.shift(),
|
|
3696
|
+
n = l + c.shift(), a = p + c.shift(), i = n + c.shift(), s = a + c.shift(), l = i + c.shift(), p = s + c.shift(), o.curveTo(n, a, i, s, l, p);
|
|
3697
|
+
l += c.shift(), p += c.shift(), o.lineTo(l, p);
|
|
3698
3698
|
break;
|
|
3699
3699
|
case 25:
|
|
3700
3700
|
for (; c.length > 6; )
|
|
3701
|
-
l += c.shift(),
|
|
3702
|
-
n = l + c.shift(), a =
|
|
3701
|
+
l += c.shift(), p += c.shift(), o.lineTo(l, p);
|
|
3702
|
+
n = l + c.shift(), a = p + c.shift(), i = n + c.shift(), s = a + c.shift(), l = i + c.shift(), p = s + c.shift(), o.curveTo(n, a, i, s, l, p);
|
|
3703
3703
|
break;
|
|
3704
3704
|
case 26:
|
|
3705
3705
|
for (c.length % 2 && (l += c.shift()); c.length > 0; )
|
|
3706
|
-
n = l, a =
|
|
3706
|
+
n = l, a = p + c.shift(), i = n + c.shift(), s = a + c.shift(), l = i, p = s + c.shift(), o.curveTo(n, a, i, s, l, p);
|
|
3707
3707
|
break;
|
|
3708
3708
|
case 27:
|
|
3709
|
-
for (c.length % 2 && (
|
|
3710
|
-
n = l + c.shift(), a =
|
|
3709
|
+
for (c.length % 2 && (p += c.shift()); c.length > 0; )
|
|
3710
|
+
n = l + c.shift(), a = p, i = n + c.shift(), s = a + c.shift(), l = i + c.shift(), p = s, o.curveTo(n, a, i, s, l, p);
|
|
3711
3711
|
break;
|
|
3712
3712
|
case 28:
|
|
3713
3713
|
H = O[G], W = O[G + 1], c.push((H << 24 | W << 16) >> 16), G += 2;
|
|
@@ -3716,12 +3716,12 @@ function qn(t, e, r) {
|
|
|
3716
3716
|
ce = c.pop() + t.gsubrsBias, $ = t.gsubrs[ce], $ && B($);
|
|
3717
3717
|
break;
|
|
3718
3718
|
case 30:
|
|
3719
|
-
for (; c.length > 0 && (n = l, a =
|
|
3720
|
-
n = l + c.shift(), a =
|
|
3719
|
+
for (; c.length > 0 && (n = l, a = p + c.shift(), i = n + c.shift(), s = a + c.shift(), l = i + c.shift(), p = s + (c.length === 1 ? c.shift() : 0), o.curveTo(n, a, i, s, l, p), c.length !== 0); )
|
|
3720
|
+
n = l + c.shift(), a = p, i = n + c.shift(), s = a + c.shift(), p = s + c.shift(), l = i + (c.length === 1 ? c.shift() : 0), o.curveTo(n, a, i, s, l, p);
|
|
3721
3721
|
break;
|
|
3722
3722
|
case 31:
|
|
3723
|
-
for (; c.length > 0 && (n = l + c.shift(), a =
|
|
3724
|
-
n = l, a =
|
|
3723
|
+
for (; c.length > 0 && (n = l + c.shift(), a = p, i = n + c.shift(), s = a + c.shift(), p = s + c.shift(), l = i + (c.length === 1 ? c.shift() : 0), o.curveTo(n, a, i, s, l, p), c.length !== 0); )
|
|
3724
|
+
n = l, a = p + c.shift(), i = n + c.shift(), s = a + c.shift(), l = i + c.shift(), p = s + (c.length === 1 ? c.shift() : 0), o.curveTo(n, a, i, s, l, p);
|
|
3725
3725
|
break;
|
|
3726
3726
|
default:
|
|
3727
3727
|
q < 32 ? console.log("Glyph " + e.index + ": unknown operator " + q) : q < 247 ? c.push(q - 139) : q < 251 ? (H = O[G], G += 1, c.push((q - 247) * 256 + H + 108)) : q < 255 ? (H = O[G], G += 1, c.push(-(q - 251) * 256 - H - 108)) : (H = O[G], W = O[G + 1], z = O[G + 2], le = O[G + 3], G += 4, c.push((H << 24 | W << 16 | z << 8 | le) / 65536));
|
|
@@ -3742,17 +3742,17 @@ function co(t, e, r, n) {
|
|
|
3742
3742
|
var u = s.parseCard16(), h = s.parseCard16();
|
|
3743
3743
|
if (h !== 0)
|
|
3744
3744
|
throw new Error("CFF Table CID Font FDSelect format 3 range has bad initial GID " + h);
|
|
3745
|
-
for (var
|
|
3746
|
-
if (i = s.parseCard8(),
|
|
3745
|
+
for (var d, l = 0; l < u; l++) {
|
|
3746
|
+
if (i = s.parseCard8(), d = s.parseCard16(), i >= n)
|
|
3747
3747
|
throw new Error("CFF table CID Font FDSelect has bad FD index value " + i + " (FD count " + n + ")");
|
|
3748
|
-
if (
|
|
3749
|
-
throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID " +
|
|
3750
|
-
for (; h <
|
|
3748
|
+
if (d > r)
|
|
3749
|
+
throw new Error("CFF Table CID Font FDSelect format 3 range has bad GID " + d);
|
|
3750
|
+
for (; h < d; h++)
|
|
3751
3751
|
a.push(i);
|
|
3752
|
-
h =
|
|
3752
|
+
h = d;
|
|
3753
3753
|
}
|
|
3754
|
-
if (
|
|
3755
|
-
throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID " +
|
|
3754
|
+
if (d !== r)
|
|
3755
|
+
throw new Error("CFF Table CID Font FDSelect format 3 range has bad final GID " + d);
|
|
3756
3756
|
} else
|
|
3757
3757
|
throw new Error("CFF Table CID Font FDSelect table has unsupported format " + o);
|
|
3758
3758
|
return a;
|
|
@@ -3766,16 +3766,16 @@ function uo(t, e, r, n) {
|
|
|
3766
3766
|
throw new Error("CFF table has too many fonts in 'FontSet' - count of fonts NameIndex.length = " + u.length);
|
|
3767
3767
|
var h = u[0];
|
|
3768
3768
|
if (r.tables.cff.topDict = h, h._privateDict && (r.defaultWidthX = h._privateDict.defaultWidthX, r.nominalWidthX = h._privateDict.nominalWidthX), h.ros[0] !== void 0 && h.ros[1] !== void 0 && (r.isCIDFont = !0), r.isCIDFont) {
|
|
3769
|
-
var
|
|
3770
|
-
if (
|
|
3769
|
+
var d = h.fdArray, l = h.fdSelect;
|
|
3770
|
+
if (d === 0 || l === 0)
|
|
3771
3771
|
throw new Error("Font is marked as a CID font, but FDArray and/or FDSelect information is missing");
|
|
3772
|
-
|
|
3773
|
-
var
|
|
3772
|
+
d += e;
|
|
3773
|
+
var p = qe(t, d), x = Vn(t, e, p.objects, o.objects);
|
|
3774
3774
|
h._fdArray = x, l += e, h._fdSelect = co(t, l, r.numGlyphs, x.length);
|
|
3775
3775
|
}
|
|
3776
3776
|
var v = e + h.private[1], b = yi(t, v, h.private[0], o.objects);
|
|
3777
3777
|
if (r.defaultWidthX = b.defaultWidthX, r.nominalWidthX = b.nominalWidthX, b.subrs !== 0) {
|
|
3778
|
-
var
|
|
3778
|
+
var y = v + b.subrs, F = qe(t, y);
|
|
3779
3779
|
r.subrs = F.objects, r.subrsBias = Qr(r.subrs);
|
|
3780
3780
|
} else
|
|
3781
3781
|
r.subrs = [], r.subrsBias = 0;
|
|
@@ -3878,8 +3878,8 @@ function vo(t) {
|
|
|
3878
3878
|
else if (c.type === "L")
|
|
3879
3879
|
s = Math.round(c.x - n), o = Math.round(c.y - a), e.push({ name: "dx", type: "NUMBER", value: s }), e.push({ name: "dy", type: "NUMBER", value: o }), e.push({ name: "rlineto", type: "OP", value: 5 }), n = Math.round(c.x), a = Math.round(c.y);
|
|
3880
3880
|
else if (c.type === "C") {
|
|
3881
|
-
var
|
|
3882
|
-
s = Math.round(c.x - c.x2), o = Math.round(c.y - c.y2), e.push({ name: "dx1", type: "NUMBER", value:
|
|
3881
|
+
var d = Math.round(c.x1 - n), l = Math.round(c.y1 - a), p = Math.round(c.x2 - c.x1), x = Math.round(c.y2 - c.y1);
|
|
3882
|
+
s = Math.round(c.x - c.x2), o = Math.round(c.y - c.y2), e.push({ name: "dx1", type: "NUMBER", value: d }), e.push({ name: "dy1", type: "NUMBER", value: l }), e.push({ name: "dx2", type: "NUMBER", value: p }), e.push({ name: "dy2", type: "NUMBER", value: x }), e.push({ name: "dx", type: "NUMBER", value: s }), e.push({ name: "dy", type: "NUMBER", value: o }), e.push({ name: "rrcurveto", type: "OP", value: 8 }), n = Math.round(c.x), a = Math.round(c.y);
|
|
3883
3883
|
}
|
|
3884
3884
|
}
|
|
3885
3885
|
return e.push({ name: "endchar", type: "OP", value: 14 }), e;
|
|
@@ -3926,8 +3926,8 @@ function xo(t, e) {
|
|
|
3926
3926
|
r.header = ho(), r.nameIndex = lo([e.postScriptName]);
|
|
3927
3927
|
var h = Xn(a, u);
|
|
3928
3928
|
r.topDictIndex = Yn(h), r.globalSubrIndex = po(), r.charsets = go(s, u), r.charStringsIndex = yo(t), r.privateDict = mo(i, u), r.stringIndex = fo(u);
|
|
3929
|
-
var
|
|
3930
|
-
return a.charset =
|
|
3929
|
+
var d = r.header.sizeOf() + r.nameIndex.sizeOf() + r.topDictIndex.sizeOf() + r.stringIndex.sizeOf() + r.globalSubrIndex.sizeOf();
|
|
3930
|
+
return a.charset = d, a.encoding = 0, a.charStrings = a.charset + r.charsets.sizeOf(), a.private[1] = a.charStrings + r.charStringsIndex.sizeOf(), h = Xn(a, u), r.topDictIndex = Yn(h), r;
|
|
3931
3931
|
}
|
|
3932
3932
|
var bi = { parse: uo, make: xo };
|
|
3933
3933
|
function bo(t, e) {
|
|
@@ -4780,12 +4780,12 @@ function Ai(t, e, r) {
|
|
|
4780
4780
|
}
|
|
4781
4781
|
function Do(t, e, r) {
|
|
4782
4782
|
for (var n = {}, a = new _.Parser(t, e), i = a.parseUShort(), s = a.parseUShort(), o = a.offset + a.parseUShort(), c = 0; c < s; c++) {
|
|
4783
|
-
var u = a.parseUShort(), h = a.parseUShort(),
|
|
4784
|
-
if (
|
|
4783
|
+
var u = a.parseUShort(), h = a.parseUShort(), d = a.parseUShort(), l = a.parseUShort(), p = Ci[l] || l, x = a.parseUShort(), v = a.parseUShort(), b = Ro(u, d, r), y = Ai(u, h, d);
|
|
4784
|
+
if (y !== void 0 && b !== void 0) {
|
|
4785
4785
|
var F = void 0;
|
|
4786
|
-
if (
|
|
4787
|
-
var w = n[
|
|
4788
|
-
w === void 0 && (w = n[
|
|
4786
|
+
if (y === Jr ? F = gt.UTF16(t, o + v, x) : F = gt.MACSTRING(t, o + v, x, y), F) {
|
|
4787
|
+
var w = n[p];
|
|
4788
|
+
w === void 0 && (w = n[p] = {}), w[b] = F;
|
|
4789
4789
|
}
|
|
4790
4790
|
}
|
|
4791
4791
|
}
|
|
@@ -4836,24 +4836,24 @@ function Po(t, e) {
|
|
|
4836
4836
|
throw new Error('Name table entry "' + s + '" does not exist, see nameTableNames for complete list.');
|
|
4837
4837
|
a[r] = t[s], n.push(r);
|
|
4838
4838
|
}
|
|
4839
|
-
for (var c = xr(Ei), u = xr(Li), h = [],
|
|
4839
|
+
for (var c = xr(Ei), u = xr(Li), h = [], d = [], l = 0; l < n.length; l++) {
|
|
4840
4840
|
r = n[l];
|
|
4841
|
-
var
|
|
4842
|
-
for (var x in
|
|
4843
|
-
var v =
|
|
4844
|
-
k === void 0 && (b = 0,
|
|
4845
|
-
var C = $n(k,
|
|
4841
|
+
var p = a[r];
|
|
4842
|
+
for (var x in p) {
|
|
4843
|
+
var v = p[x], b = 1, y = c[x], F = Oo[y], w = Ai(b, F, y), k = M.MACSTRING(v, w);
|
|
4844
|
+
k === void 0 && (b = 0, y = e.indexOf(x), y < 0 && (y = e.length, e.push(x)), F = 4, k = M.UTF16(v));
|
|
4845
|
+
var C = $n(k, d);
|
|
4846
4846
|
h.push(jn(
|
|
4847
4847
|
b,
|
|
4848
4848
|
F,
|
|
4849
|
-
|
|
4849
|
+
y,
|
|
4850
4850
|
r,
|
|
4851
4851
|
k.length,
|
|
4852
4852
|
C
|
|
4853
4853
|
));
|
|
4854
4854
|
var U = u[x];
|
|
4855
4855
|
if (U !== void 0) {
|
|
4856
|
-
var B =
|
|
4856
|
+
var B = M.UTF16(v), O = $n(B, d);
|
|
4857
4857
|
h.push(jn(
|
|
4858
4858
|
3,
|
|
4859
4859
|
1,
|
|
@@ -4874,7 +4874,7 @@ function Po(t, e) {
|
|
|
4874
4874
|
{ name: "stringOffset", type: "USHORT", value: 6 + h.length * 12 }
|
|
4875
4875
|
]), W = 0; W < h.length; W++)
|
|
4876
4876
|
H.fields.push({ name: "record_" + W, type: "RECORD", value: h[W] });
|
|
4877
|
-
return H.fields.push({ name: "strings", type: "LITERAL", value:
|
|
4877
|
+
return H.fields.push({ name: "strings", type: "LITERAL", value: d }), H;
|
|
4878
4878
|
}
|
|
4879
4879
|
var Bi = { parse: Do, make: Po }, en = [
|
|
4880
4880
|
{ begin: 0, end: 127 },
|
|
@@ -5536,8 +5536,8 @@ function Mi(t) {
|
|
|
5536
5536
|
for (n.push({ name: u.tag + " Table Record", type: "RECORD", value: u }), a.push({ name: o.tableName + " table", type: "RECORD", value: o }), i += c, P.argument(!isNaN(i), "Something went wrong calculating the offset."); i % 4 !== 0; )
|
|
5537
5537
|
i += 1, a.push({ name: "padding", type: "BYTE", value: 0 });
|
|
5538
5538
|
}
|
|
5539
|
-
return n.sort(function(h,
|
|
5540
|
-
return h.value.tag >
|
|
5539
|
+
return n.sort(function(h, d) {
|
|
5540
|
+
return h.value.tag > d.value.tag ? 1 : -1;
|
|
5541
5541
|
}), e.fields = e.fields.concat(n), e.fields = e.fields.concat(a), e;
|
|
5542
5542
|
}
|
|
5543
5543
|
function Qn(t, e, r) {
|
|
@@ -5556,20 +5556,20 @@ function jo(t) {
|
|
|
5556
5556
|
return e / t.length;
|
|
5557
5557
|
}
|
|
5558
5558
|
function $o(t) {
|
|
5559
|
-
for (var e = [], r = [], n = [], a = [], i = [], s = [], o = [], c, u = 0, h = 0,
|
|
5559
|
+
for (var e = [], r = [], n = [], a = [], i = [], s = [], o = [], c, u = 0, h = 0, d = 0, l = 0, p = 0, x = 0; x < t.glyphs.length; x += 1) {
|
|
5560
5560
|
var v = t.glyphs.get(x), b = v.unicode | 0;
|
|
5561
5561
|
if (isNaN(v.advanceWidth))
|
|
5562
5562
|
throw new Error("Glyph " + v.name + " (" + x + "): advanceWidth is not a number.");
|
|
5563
5563
|
(c > b || c === void 0) && b > 0 && (c = b), u < b && (u = b);
|
|
5564
|
-
var
|
|
5565
|
-
if (
|
|
5566
|
-
h |= 1 <<
|
|
5567
|
-
else if (
|
|
5568
|
-
|
|
5569
|
-
else if (
|
|
5570
|
-
l |= 1 <<
|
|
5571
|
-
else if (
|
|
5572
|
-
|
|
5564
|
+
var y = tn.getUnicodeRange(b);
|
|
5565
|
+
if (y < 32)
|
|
5566
|
+
h |= 1 << y;
|
|
5567
|
+
else if (y < 64)
|
|
5568
|
+
d |= 1 << y - 32;
|
|
5569
|
+
else if (y < 96)
|
|
5570
|
+
l |= 1 << y - 64;
|
|
5571
|
+
else if (y < 123)
|
|
5572
|
+
p |= 1 << y - 96;
|
|
5573
5573
|
else
|
|
5574
5574
|
throw new Error("Unicode ranges bits > 123 are reserved for internal usage");
|
|
5575
5575
|
if (v.name !== ".notdef") {
|
|
@@ -5612,9 +5612,9 @@ function $o(t) {
|
|
|
5612
5612
|
usFirstCharIndex: c,
|
|
5613
5613
|
usLastCharIndex: u,
|
|
5614
5614
|
ulUnicodeRange1: h,
|
|
5615
|
-
ulUnicodeRange2:
|
|
5615
|
+
ulUnicodeRange2: d,
|
|
5616
5616
|
ulUnicodeRange3: l,
|
|
5617
|
-
ulUnicodeRange4:
|
|
5617
|
+
ulUnicodeRange4: p,
|
|
5618
5618
|
// See http://typophile.com/node/13081 for more info on vertical metrics.
|
|
5619
5619
|
// We get metrics for typical characters (such as "x" for xHeight).
|
|
5620
5620
|
// We provide some fallback characters if characters are unavailable: their
|
|
@@ -5848,8 +5848,8 @@ Ut.prototype = {
|
|
|
5848
5848
|
subtables: [],
|
|
5849
5849
|
markFilteringSet: void 0
|
|
5850
5850
|
};
|
|
5851
|
-
var
|
|
5852
|
-
return u.push(o), c.push(
|
|
5851
|
+
var d = u.length;
|
|
5852
|
+
return u.push(o), c.push(d), [o];
|
|
5853
5853
|
}
|
|
5854
5854
|
}
|
|
5855
5855
|
return s;
|
|
@@ -5926,8 +5926,8 @@ Ot.prototype.getKerningValue = function(t, e, r) {
|
|
|
5926
5926
|
}
|
|
5927
5927
|
break;
|
|
5928
5928
|
case 2:
|
|
5929
|
-
var
|
|
5930
|
-
return
|
|
5929
|
+
var d = this.getGlyphClass(s.classDef1, e), l = this.getGlyphClass(s.classDef2, r), p = s.classRecords[d][l];
|
|
5930
|
+
return p.value1 && p.value1.xAdvance || 0;
|
|
5931
5931
|
}
|
|
5932
5932
|
}
|
|
5933
5933
|
return 0;
|
|
@@ -5977,15 +5977,15 @@ me.prototype.getSingle = function(t, e, r) {
|
|
|
5977
5977
|
for (var s = a[i].subtables, o = 0; o < s.length; o++) {
|
|
5978
5978
|
var c = s[o], u = this.expandCoverage(c.coverage), h = void 0;
|
|
5979
5979
|
if (c.substFormat === 1) {
|
|
5980
|
-
var
|
|
5980
|
+
var d = c.deltaGlyphId;
|
|
5981
5981
|
for (h = 0; h < u.length; h++) {
|
|
5982
5982
|
var l = u[h];
|
|
5983
|
-
n.push({ sub: l, by: l +
|
|
5983
|
+
n.push({ sub: l, by: l + d });
|
|
5984
5984
|
}
|
|
5985
5985
|
} else {
|
|
5986
|
-
var
|
|
5986
|
+
var p = c.substitute;
|
|
5987
5987
|
for (h = 0; h < u.length; h++)
|
|
5988
|
-
n.push({ sub: u[h], by:
|
|
5988
|
+
n.push({ sub: u[h], by: p[h] });
|
|
5989
5989
|
}
|
|
5990
5990
|
}
|
|
5991
5991
|
return n;
|
|
@@ -5995,8 +5995,8 @@ me.prototype.getMultiple = function(t, e, r) {
|
|
|
5995
5995
|
for (var s = a[i].subtables, o = 0; o < s.length; o++) {
|
|
5996
5996
|
var c = s[o], u = this.expandCoverage(c.coverage), h = void 0;
|
|
5997
5997
|
for (h = 0; h < u.length; h++) {
|
|
5998
|
-
var
|
|
5999
|
-
n.push({ sub:
|
|
5998
|
+
var d = u[h], l = c.sequences[h];
|
|
5999
|
+
n.push({ sub: d, by: l });
|
|
6000
6000
|
}
|
|
6001
6001
|
}
|
|
6002
6002
|
return n;
|
|
@@ -6004,16 +6004,16 @@ me.prototype.getMultiple = function(t, e, r) {
|
|
|
6004
6004
|
me.prototype.getAlternates = function(t, e, r) {
|
|
6005
6005
|
for (var n = [], a = this.getLookupTables(e, r, t, 3), i = 0; i < a.length; i++)
|
|
6006
6006
|
for (var s = a[i].subtables, o = 0; o < s.length; o++)
|
|
6007
|
-
for (var c = s[o], u = this.expandCoverage(c.coverage), h = c.alternateSets,
|
|
6008
|
-
n.push({ sub: u[
|
|
6007
|
+
for (var c = s[o], u = this.expandCoverage(c.coverage), h = c.alternateSets, d = 0; d < u.length; d++)
|
|
6008
|
+
n.push({ sub: u[d], by: h[d] });
|
|
6009
6009
|
return n;
|
|
6010
6010
|
};
|
|
6011
6011
|
me.prototype.getLigatures = function(t, e, r) {
|
|
6012
6012
|
for (var n = [], a = this.getLookupTables(e, r, t, 4), i = 0; i < a.length; i++)
|
|
6013
6013
|
for (var s = a[i].subtables, o = 0; o < s.length; o++)
|
|
6014
|
-
for (var c = s[o], u = this.expandCoverage(c.coverage), h = c.ligatureSets,
|
|
6015
|
-
for (var l = u[
|
|
6016
|
-
var v =
|
|
6014
|
+
for (var c = s[o], u = this.expandCoverage(c.coverage), h = c.ligatureSets, d = 0; d < u.length; d++)
|
|
6015
|
+
for (var l = u[d], p = h[d], x = 0; x < p.length; x++) {
|
|
6016
|
+
var v = p[x];
|
|
6017
6017
|
n.push({
|
|
6018
6018
|
sub: [l].concat(v.components),
|
|
6019
6019
|
by: v.ligGlyph
|
|
@@ -6068,8 +6068,8 @@ me.prototype.addLigature = function(t, e, r, n) {
|
|
|
6068
6068
|
components: o
|
|
6069
6069
|
}, u = this.binSearch(i.coverage.glyphs, s);
|
|
6070
6070
|
if (u >= 0) {
|
|
6071
|
-
for (var h = i.ligatureSets[u],
|
|
6072
|
-
if (Ko(h[
|
|
6071
|
+
for (var h = i.ligatureSets[u], d = 0; d < h.length; d++)
|
|
6072
|
+
if (Ko(h[d].components, o))
|
|
6073
6073
|
return;
|
|
6074
6074
|
h.push(c);
|
|
6075
6075
|
} else
|
|
@@ -6137,19 +6137,19 @@ function Ii(t, e, r) {
|
|
|
6137
6137
|
a = [];
|
|
6138
6138
|
for (var h = 0; h < u; h += 1)
|
|
6139
6139
|
if (i = n.parseByte(), a.push(i), (i & 8) > 0)
|
|
6140
|
-
for (var
|
|
6140
|
+
for (var d = n.parseByte(), l = 0; l < d; l += 1)
|
|
6141
6141
|
a.push(i), h += 1;
|
|
6142
6142
|
if (P.argument(a.length === u, "Bad flags."), s.length > 0) {
|
|
6143
|
-
var
|
|
6143
|
+
var p = [], x;
|
|
6144
6144
|
if (u > 0) {
|
|
6145
6145
|
for (var v = 0; v < u; v += 1)
|
|
6146
|
-
i = a[v], x = {}, x.onCurve = !!(i & 1), x.lastPointOfContour = s.indexOf(v) >= 0,
|
|
6147
|
-
for (var b = 0,
|
|
6148
|
-
i = a[
|
|
6146
|
+
i = a[v], x = {}, x.onCurve = !!(i & 1), x.lastPointOfContour = s.indexOf(v) >= 0, p.push(x);
|
|
6147
|
+
for (var b = 0, y = 0; y < u; y += 1)
|
|
6148
|
+
i = a[y], x = p[y], x.x = ta(n, i, b, 2, 16), b = x.x;
|
|
6149
6149
|
for (var F = 0, w = 0; w < u; w += 1)
|
|
6150
|
-
i = a[w], x =
|
|
6150
|
+
i = a[w], x = p[w], x.y = ta(n, i, F, 4, 32), F = x.y;
|
|
6151
6151
|
}
|
|
6152
|
-
t.points =
|
|
6152
|
+
t.points = p;
|
|
6153
6153
|
} else
|
|
6154
6154
|
t.points = [];
|
|
6155
6155
|
} else if (t.numberOfContours === 0)
|
|
@@ -6437,8 +6437,8 @@ Rt.prototype.interpolate = function(t, e, r, n) {
|
|
|
6437
6437
|
};
|
|
6438
6438
|
Rt.prototype.setRelative = function(t, e, r, n, a) {
|
|
6439
6439
|
n = n || this;
|
|
6440
|
-
var i = a ? e.xo : e.x, s = a ? e.yo : e.y, o = i + r * n.x, c = s + r * n.y, u = n.normalSlope, h = this.slope,
|
|
6441
|
-
t.x = (h *
|
|
6440
|
+
var i = a ? e.xo : e.x, s = a ? e.yo : e.y, o = i + r * n.x, c = s + r * n.y, u = n.normalSlope, h = this.slope, d = t.x, l = t.y;
|
|
6441
|
+
t.x = (h * d - u * o + c - l) / (h - u), t.y = h * (t.x - d) + l;
|
|
6442
6442
|
};
|
|
6443
6443
|
Rt.prototype.touch = function(t) {
|
|
6444
6444
|
t.xTouched = !0, t.yTouched = !0;
|
|
@@ -6526,11 +6526,11 @@ Gi = function(t, e) {
|
|
|
6526
6526
|
var c = e.font;
|
|
6527
6527
|
s = [], i = [];
|
|
6528
6528
|
for (var u = 0; u < a.length; u++) {
|
|
6529
|
-
var h = a[u],
|
|
6530
|
-
o = new je("glyf",
|
|
6531
|
-
for (var l = Math.round(h.dx * r),
|
|
6532
|
-
var
|
|
6533
|
-
|
|
6529
|
+
var h = a[u], d = c.glyphs.get(h.glyphIndex);
|
|
6530
|
+
o = new je("glyf", d.instructions), exports.DEBUG && (console.log("---EXEC COMP " + u + "---"), o.step = -1), rn(d, o, r, n);
|
|
6531
|
+
for (var l = Math.round(h.dx * r), p = Math.round(h.dy * n), x = o.gZone, v = o.contours, b = 0; b < x.length; b++) {
|
|
6532
|
+
var y = x[b];
|
|
6533
|
+
y.xTouched = y.yTouched = !1, y.xo = y.x = y.x + l, y.yo = y.y = y.y + p;
|
|
6534
6534
|
}
|
|
6535
6535
|
var F = s.length;
|
|
6536
6536
|
s.push.apply(s, x);
|
|
@@ -6552,13 +6552,13 @@ rn = function(t, e, r, n) {
|
|
|
6552
6552
|
c.lastPointOfContour,
|
|
6553
6553
|
c.onCurve
|
|
6554
6554
|
);
|
|
6555
|
-
for (var h,
|
|
6556
|
-
c = s[l], h || (h = c, o.push(l)), c.lastPointOfContour ? (c.nextPointOnContour = h, h.prevPointOnContour = c, h = void 0) : (
|
|
6555
|
+
for (var h, d, l = 0; l < i; l++)
|
|
6556
|
+
c = s[l], h || (h = c, o.push(l)), c.lastPointOfContour ? (c.nextPointOnContour = h, h.prevPointOnContour = c, h = void 0) : (d = s[l + 1], c.nextPointOnContour = d, d.prevPointOnContour = c);
|
|
6557
6557
|
if (!e.inhibitGridFit) {
|
|
6558
6558
|
if (exports.DEBUG) {
|
|
6559
6559
|
console.log("PROCESSING GLYPH", e.stack);
|
|
6560
|
-
for (var
|
|
6561
|
-
console.log(
|
|
6560
|
+
for (var p = 0; p < i; p++)
|
|
6561
|
+
console.log(p, s[p].x, s[p].y);
|
|
6562
6562
|
}
|
|
6563
6563
|
if (s.push(
|
|
6564
6564
|
new He(0, 0),
|
|
@@ -6648,10 +6648,10 @@ function dc(t) {
|
|
|
6648
6648
|
t.fv = t.pv, exports.DEBUG && console.log(t.step, "SFVTPV[]");
|
|
6649
6649
|
}
|
|
6650
6650
|
function gc(t) {
|
|
6651
|
-
var e = t.stack, r = e.pop(), n = e.pop(), a = e.pop(), i = e.pop(), s = e.pop(), o = t.z0, c = t.z1, u = o[r], h = o[n],
|
|
6651
|
+
var e = t.stack, r = e.pop(), n = e.pop(), a = e.pop(), i = e.pop(), s = e.pop(), o = t.z0, c = t.z1, u = o[r], h = o[n], d = c[a], l = c[i], p = t.z2[s];
|
|
6652
6652
|
exports.DEBUG && console.log("ISECT[], ", r, n, a, i, s);
|
|
6653
|
-
var x = u.x, v = u.y, b = h.x,
|
|
6654
|
-
|
|
6653
|
+
var x = u.x, v = u.y, b = h.x, y = h.y, F = d.x, w = d.y, k = l.x, C = l.y, U = (x - b) * (w - C) - (v - y) * (F - k), B = x * y - v * b, O = F * C - w * k;
|
|
6654
|
+
p.x = (B * (F - k) - O * (x - b)) / U, p.y = (B * (w - C) - O * (v - y)) / U;
|
|
6655
6655
|
}
|
|
6656
6656
|
function vc(t) {
|
|
6657
6657
|
t.rp0 = t.stack.pop(), exports.DEBUG && console.log(t.step, "SRP0[]", t.rp0);
|
|
@@ -6805,8 +6805,8 @@ function ca(t, e) {
|
|
|
6805
6805
|
}
|
|
6806
6806
|
function ua(t, e) {
|
|
6807
6807
|
for (var r = e.stack, n = t ? e.rp1 : e.rp2, a = (t ? e.z0 : e.z1)[n], i = e.fv, s = e.pv, o = e.loop, c = e.z2; o--; ) {
|
|
6808
|
-
var u = r.pop(), h = c[u],
|
|
6809
|
-
i.setRelative(h, h,
|
|
6808
|
+
var u = r.pop(), h = c[u], d = s.distance(a, a, !1, !0);
|
|
6809
|
+
i.setRelative(h, h, d, s), i.touch(h), exports.DEBUG && console.log(
|
|
6810
6810
|
e.step,
|
|
6811
6811
|
(e.loop > 1 ? "loop " + (e.loop - o) + ": " : "") + "SHP[" + (t ? "rp1" : "rp2") + "]",
|
|
6812
6812
|
u
|
|
@@ -6836,7 +6836,7 @@ function la(t, e) {
|
|
|
6836
6836
|
default:
|
|
6837
6837
|
throw new Error("Invalid zone");
|
|
6838
6838
|
}
|
|
6839
|
-
for (var u, h = s.distance(a, a, !1, !0),
|
|
6839
|
+
for (var u, h = s.distance(a, a, !1, !0), d = c.length - 2, l = 0; l < d; l++)
|
|
6840
6840
|
u = c[l], i.setRelative(u, u, h, s);
|
|
6841
6841
|
}
|
|
6842
6842
|
function Nc(t) {
|
|
@@ -6853,7 +6853,7 @@ function Nc(t) {
|
|
|
6853
6853
|
}
|
|
6854
6854
|
function Gc(t) {
|
|
6855
6855
|
for (var e = t.stack, r = t.rp1, n = t.rp2, a = t.loop, i = t.z0[r], s = t.z1[n], o = t.fv, c = t.dpv, u = t.z2; a--; ) {
|
|
6856
|
-
var h = e.pop(),
|
|
6856
|
+
var h = e.pop(), d = u[h];
|
|
6857
6857
|
exports.DEBUG && console.log(
|
|
6858
6858
|
t.step,
|
|
6859
6859
|
(t.loop > 1 ? "loop " + (t.loop - a) + ": " : "") + "IP[]",
|
|
@@ -6861,7 +6861,7 @@ function Gc(t) {
|
|
|
6861
6861
|
r,
|
|
6862
6862
|
"<->",
|
|
6863
6863
|
n
|
|
6864
|
-
), o.interpolate(
|
|
6864
|
+
), o.interpolate(d, i, s, c), o.touch(d);
|
|
6865
6865
|
}
|
|
6866
6866
|
t.loop = 1;
|
|
6867
6867
|
}
|
|
@@ -7002,11 +7002,11 @@ function Fr(t, e) {
|
|
|
7002
7002
|
var r = e.stack, n = r.pop(), a = e.fv, i = e.pv, s = e.ppem, o = e.deltaBase + (t - 1) * 16, c = e.deltaShift, u = e.z0;
|
|
7003
7003
|
exports.DEBUG && console.log(e.step, "DELTAP[" + t + "]", n, r);
|
|
7004
7004
|
for (var h = 0; h < n; h++) {
|
|
7005
|
-
var
|
|
7006
|
-
if (
|
|
7005
|
+
var d = r.pop(), l = r.pop(), p = o + ((l & 240) >> 4);
|
|
7006
|
+
if (p === s) {
|
|
7007
7007
|
var x = (l & 15) - 8;
|
|
7008
|
-
x >= 0 && x++, exports.DEBUG && console.log(e.step, "DELTAPFIX",
|
|
7009
|
-
var v = u[
|
|
7008
|
+
x >= 0 && x++, exports.DEBUG && console.log(e.step, "DELTAPFIX", d, "by", x * c);
|
|
7009
|
+
var v = u[d];
|
|
7010
7010
|
a.setRelative(v, v, x * c, i);
|
|
7011
7011
|
}
|
|
7012
7012
|
}
|
|
@@ -7065,9 +7065,9 @@ function kr(t, e) {
|
|
|
7065
7065
|
for (var o = 0; o < n; o++) {
|
|
7066
7066
|
var c = r.pop(), u = r.pop(), h = i + ((u & 240) >> 4);
|
|
7067
7067
|
if (h === a) {
|
|
7068
|
-
var
|
|
7069
|
-
|
|
7070
|
-
var l =
|
|
7068
|
+
var d = (u & 15) - 8;
|
|
7069
|
+
d >= 0 && d++;
|
|
7070
|
+
var l = d * s;
|
|
7071
7071
|
exports.DEBUG && console.log(e.step, "DELTACFIX", c, "by", l), e.cvt[c] += l;
|
|
7072
7072
|
}
|
|
7073
7073
|
}
|
|
@@ -7211,8 +7211,8 @@ function Ve(t, e) {
|
|
|
7211
7211
|
e.ip = r;
|
|
7212
7212
|
}
|
|
7213
7213
|
function D(t, e, r, n, a, i) {
|
|
7214
|
-
var s = i.stack, o = t && s.pop(), c = s.pop(), u = i.rp0, h = i.z0[u],
|
|
7215
|
-
b = v = x.distance(
|
|
7214
|
+
var s = i.stack, o = t && s.pop(), c = s.pop(), u = i.rp0, h = i.z0[u], d = i.z1[c], l = i.minDis, p = i.fv, x = i.dpv, v, b, y, F;
|
|
7215
|
+
b = v = x.distance(d, h, !0, !0), y = b >= 0 ? 1 : -1, b = Math.abs(b), t && (F = i.cvt[o], n && Math.abs(b - F) < i.cvCutIn && (b = F)), r && b < l && (b = l), n && (b = i.round(b)), p.setRelative(d, h, y * b, x), p.touch(d), exports.DEBUG && console.log(
|
|
7216
7216
|
i.step,
|
|
7217
7217
|
(t ? "MIRP[" : "MDRP[") + (e ? "M" : "m") + (r ? ">" : "_") + (n ? "R" : "_") + (a === 0 ? "Gr" : a === 1 ? "Bl" : a === 2 ? "Wh" : "") + "]",
|
|
7218
7218
|
t ? o + "(" + i.cvt[o] + "," + F + ")" : "",
|
|
@@ -7220,7 +7220,7 @@ function D(t, e, r, n, a, i) {
|
|
|
7220
7220
|
"(d =",
|
|
7221
7221
|
v,
|
|
7222
7222
|
"->",
|
|
7223
|
-
|
|
7223
|
+
y * b,
|
|
7224
7224
|
")"
|
|
7225
7225
|
), i.rp1 = i.rp0, i.rp2 = c, e && (i.rp0 = c);
|
|
7226
7226
|
}
|
|
@@ -8096,11 +8096,11 @@ function Pu(t, e) {
|
|
|
8096
8096
|
var u = new Ce(c, 0), h = Tr(
|
|
8097
8097
|
e.backtrackCoverage,
|
|
8098
8098
|
u
|
|
8099
|
-
),
|
|
8100
|
-
if (
|
|
8101
|
-
for (var
|
|
8102
|
-
for (var x = e.lookupRecords[
|
|
8103
|
-
var F = b.subtables[
|
|
8099
|
+
), d = n.length === e.inputCoverage.length && o.length === e.lookaheadCoverage.length && h.length === e.backtrackCoverage.length, l = [];
|
|
8100
|
+
if (d)
|
|
8101
|
+
for (var p = 0; p < e.lookupRecords.length; p++)
|
|
8102
|
+
for (var x = e.lookupRecords[p], v = x.lookupListIndex, b = this.getLookupByIndex(v), y = 0; y < b.subtables.length; y++) {
|
|
8103
|
+
var F = b.subtables[y], w = this.getLookupMethod(b, F), k = this.getSubstitutionType(b, F);
|
|
8104
8104
|
if (k === "12")
|
|
8105
8105
|
for (var C = 0; C < n.length; C++) {
|
|
8106
8106
|
var U = t.get(C), B = w(U);
|
|
@@ -8237,45 +8237,45 @@ xe.prototype.lookupFeature = function(t) {
|
|
|
8237
8237
|
);
|
|
8238
8238
|
for (var a = this.getFeatureLookups(n), i = [].concat(e.context), s = 0; s < a.length; s++)
|
|
8239
8239
|
for (var o = a[s], c = this.getLookupSubtables(o), u = 0; u < c.length; u++) {
|
|
8240
|
-
var h = c[u],
|
|
8241
|
-
switch (
|
|
8240
|
+
var h = c[u], d = this.getSubstitutionType(o, h), l = this.getLookupMethod(o, h), p = void 0;
|
|
8241
|
+
switch (d) {
|
|
8242
8242
|
case "11":
|
|
8243
|
-
|
|
8243
|
+
p = l(e.current), p && i.splice(r, 1, new it({
|
|
8244
8244
|
id: 11,
|
|
8245
8245
|
tag: t.tag,
|
|
8246
|
-
substitution:
|
|
8246
|
+
substitution: p
|
|
8247
8247
|
}));
|
|
8248
8248
|
break;
|
|
8249
8249
|
case "12":
|
|
8250
|
-
|
|
8250
|
+
p = l(e.current), p && i.splice(r, 1, new it({
|
|
8251
8251
|
id: 12,
|
|
8252
8252
|
tag: t.tag,
|
|
8253
|
-
substitution:
|
|
8253
|
+
substitution: p
|
|
8254
8254
|
}));
|
|
8255
8255
|
break;
|
|
8256
8256
|
case "63":
|
|
8257
|
-
|
|
8257
|
+
p = l(e), Array.isArray(p) && p.length && i.splice(r, 1, new it({
|
|
8258
8258
|
id: 63,
|
|
8259
8259
|
tag: t.tag,
|
|
8260
|
-
substitution:
|
|
8260
|
+
substitution: p
|
|
8261
8261
|
}));
|
|
8262
8262
|
break;
|
|
8263
8263
|
case "41":
|
|
8264
|
-
|
|
8264
|
+
p = l(e), p && i.splice(r, 1, new it({
|
|
8265
8265
|
id: 41,
|
|
8266
8266
|
tag: t.tag,
|
|
8267
|
-
substitution:
|
|
8267
|
+
substitution: p
|
|
8268
8268
|
}));
|
|
8269
8269
|
break;
|
|
8270
8270
|
case "21":
|
|
8271
|
-
|
|
8271
|
+
p = l(e.current), p && i.splice(r, 1, new it({
|
|
8272
8272
|
id: 21,
|
|
8273
8273
|
tag: t.tag,
|
|
8274
|
-
substitution:
|
|
8274
|
+
substitution: p
|
|
8275
8275
|
}));
|
|
8276
8276
|
break;
|
|
8277
8277
|
}
|
|
8278
|
-
e = new Ce(i, r), !(Array.isArray(
|
|
8278
|
+
e = new Ce(i, r), !(Array.isArray(p) && !p.length) && (p = null);
|
|
8279
8279
|
}
|
|
8280
8280
|
return i.length ? i : null;
|
|
8281
8281
|
};
|
|
@@ -8445,15 +8445,15 @@ function Ju(t) {
|
|
|
8445
8445
|
break;
|
|
8446
8446
|
}
|
|
8447
8447
|
if (n.indexOf(h) !== -1) {
|
|
8448
|
-
var
|
|
8448
|
+
var d = e.query.lookupFeature({
|
|
8449
8449
|
tag: h,
|
|
8450
8450
|
script: r,
|
|
8451
8451
|
contextParams: i
|
|
8452
8452
|
});
|
|
8453
|
-
if (
|
|
8454
|
-
return console.info(
|
|
8455
|
-
|
|
8456
|
-
l instanceof it && (dn(l, a,
|
|
8453
|
+
if (d instanceof Error)
|
|
8454
|
+
return console.info(d.message);
|
|
8455
|
+
d.forEach(function(l, p) {
|
|
8456
|
+
l instanceof it && (dn(l, a, p), i.context[p] = l.substitution);
|
|
8457
8457
|
});
|
|
8458
8458
|
}
|
|
8459
8459
|
}
|
|
@@ -8697,8 +8697,8 @@ j.prototype.updateFeatures = function(t) {
|
|
|
8697
8697
|
});
|
|
8698
8698
|
};
|
|
8699
8699
|
j.prototype.stringToGlyphs = function(t, e) {
|
|
8700
|
-
var r = this, n = new Ae(), a = function(
|
|
8701
|
-
return r.charToGlyphIndex(
|
|
8700
|
+
var r = this, n = new Ae(), a = function(d) {
|
|
8701
|
+
return r.charToGlyphIndex(d.char);
|
|
8702
8702
|
};
|
|
8703
8703
|
n.registerModifier("glyphIndex", null, a);
|
|
8704
8704
|
var i = e ? this.updateFeatures(e.features) : this.defaultRenderOptions.features;
|
|
@@ -8741,9 +8741,9 @@ j.prototype.forEachGlyph = function(t, e, r, n, a, i) {
|
|
|
8741
8741
|
c = this.position.getKerningTables(u, a.language);
|
|
8742
8742
|
}
|
|
8743
8743
|
for (var h = 0; h < o.length; h += 1) {
|
|
8744
|
-
var
|
|
8745
|
-
if (i.call(this,
|
|
8746
|
-
var l = c ? this.position.getKerningValue(c,
|
|
8744
|
+
var d = o[h];
|
|
8745
|
+
if (i.call(this, d, e, r, n, a), d.advanceWidth && (e += d.advanceWidth * s), a.kerning && h < o.length - 1) {
|
|
8746
|
+
var l = c ? this.position.getKerningValue(c, d.index, o[h + 1].index) : this.getKerningValue(d, o[h + 1]);
|
|
8747
8747
|
e += l * s;
|
|
8748
8748
|
}
|
|
8749
8749
|
a.letterSpacing ? e += a.letterSpacing * n : a.tracking && (e += a.tracking / 1e3 * n);
|
|
@@ -8938,10 +8938,10 @@ function gh(t, e, r) {
|
|
|
8938
8938
|
P.argument(a === 65536, "Unsupported fvar table version.");
|
|
8939
8939
|
var i = n.parseOffset16();
|
|
8940
8940
|
n.skip("uShort", 1);
|
|
8941
|
-
for (var s = n.parseUShort(), o = n.parseUShort(), c = n.parseUShort(), u = n.parseUShort(), h = [],
|
|
8942
|
-
h.push(lh(t, e + i +
|
|
8943
|
-
for (var l = [],
|
|
8944
|
-
l.push(ph(t,
|
|
8941
|
+
for (var s = n.parseUShort(), o = n.parseUShort(), c = n.parseUShort(), u = n.parseUShort(), h = [], d = 0; d < s; d++)
|
|
8942
|
+
h.push(lh(t, e + i + d * o, r));
|
|
8943
|
+
for (var l = [], p = e + i + s * o, x = 0; x < c; x++)
|
|
8944
|
+
l.push(ph(t, p + x * u, h, r));
|
|
8945
8945
|
return { axes: h, instances: l };
|
|
8946
8946
|
}
|
|
8947
8947
|
var vh = { make: dh, parse: gh }, yh = function() {
|
|
@@ -9184,7 +9184,7 @@ function Ih(t, e) {
|
|
|
9184
9184
|
s = _.getUShort(i, 12), o = Mh(i, s);
|
|
9185
9185
|
} else
|
|
9186
9186
|
throw new Error("Unsupported OpenType signature " + c);
|
|
9187
|
-
for (var h,
|
|
9187
|
+
for (var h, d, l, p, x, v, b, y, F, w, k, C, U = 0; U < s; U += 1) {
|
|
9188
9188
|
var B = o[U], O = void 0;
|
|
9189
9189
|
switch (B.tag) {
|
|
9190
9190
|
case "cmap":
|
|
@@ -9194,7 +9194,7 @@ function Ih(t, e) {
|
|
|
9194
9194
|
O = ie(i, B), C = new _.Parser(O.data, O.offset), a.tables.cvt = C.parseShortList(B.length / 2);
|
|
9195
9195
|
break;
|
|
9196
9196
|
case "fvar":
|
|
9197
|
-
|
|
9197
|
+
d = B;
|
|
9198
9198
|
break;
|
|
9199
9199
|
case "fpgm":
|
|
9200
9200
|
O = ie(i, B), C = new _.Parser(O.data, O.offset), a.tables.fpgm = C.parseByteList(B.length);
|
|
@@ -9236,10 +9236,10 @@ function Ih(t, e) {
|
|
|
9236
9236
|
h = B;
|
|
9237
9237
|
break;
|
|
9238
9238
|
case "kern":
|
|
9239
|
-
|
|
9239
|
+
y = B;
|
|
9240
9240
|
break;
|
|
9241
9241
|
case "GDEF":
|
|
9242
|
-
|
|
9242
|
+
p = B;
|
|
9243
9243
|
break;
|
|
9244
9244
|
case "GPOS":
|
|
9245
9245
|
x = B;
|
|
@@ -9262,13 +9262,13 @@ function Ih(t, e) {
|
|
|
9262
9262
|
} else
|
|
9263
9263
|
throw new Error("Font doesn't contain TrueType or CFF outlines.");
|
|
9264
9264
|
var K = ie(i, b);
|
|
9265
|
-
if (Fi.parse(a, K.data, K.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, e), Ys(a, e),
|
|
9266
|
-
var Q = ie(i,
|
|
9265
|
+
if (Fi.parse(a, K.data, K.offset, a.numberOfHMetrics, a.numGlyphs, a.glyphs, e), Ys(a, e), y) {
|
|
9266
|
+
var Q = ie(i, y);
|
|
9267
9267
|
a.kerningPairs = Uh.parse(Q.data, Q.offset);
|
|
9268
9268
|
} else
|
|
9269
9269
|
a.kerningPairs = {};
|
|
9270
|
-
if (
|
|
9271
|
-
var ae = ie(i,
|
|
9270
|
+
if (p) {
|
|
9271
|
+
var ae = ie(i, p);
|
|
9272
9272
|
a.tables.gdef = Fh.parse(ae.data, ae.offset);
|
|
9273
9273
|
}
|
|
9274
9274
|
if (x) {
|
|
@@ -9279,8 +9279,8 @@ function Ih(t, e) {
|
|
|
9279
9279
|
var oe = ie(i, v);
|
|
9280
9280
|
a.tables.gsub = Oi.parse(oe.data, oe.offset);
|
|
9281
9281
|
}
|
|
9282
|
-
if (
|
|
9283
|
-
var fe = ie(i,
|
|
9282
|
+
if (d) {
|
|
9283
|
+
var fe = ie(i, d);
|
|
9284
9284
|
a.tables.fvar = vh.parse(fe.data, fe.offset, a.names);
|
|
9285
9285
|
}
|
|
9286
9286
|
if (k) {
|
|
@@ -9293,61 +9293,61 @@ function Sa(t, e = !1) {
|
|
|
9293
9293
|
const r = t[0].index !== null, n = new Set(Object.keys(t[0].attributes)), a = new Set(Object.keys(t[0].morphAttributes)), i = {}, s = {}, o = t[0].morphTargetsRelative, c = new rs();
|
|
9294
9294
|
let u = 0;
|
|
9295
9295
|
for (let h = 0; h < t.length; ++h) {
|
|
9296
|
-
const
|
|
9296
|
+
const d = t[h];
|
|
9297
9297
|
let l = 0;
|
|
9298
|
-
if (r !== (
|
|
9298
|
+
if (r !== (d.index !== null))
|
|
9299
9299
|
return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + h + ". All geometries must have compatible attributes; make sure index attribute exists among all geometries, or in none of them."), null;
|
|
9300
|
-
for (const
|
|
9301
|
-
if (!n.has(
|
|
9302
|
-
return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + h + '. All geometries must have compatible attributes; make sure "' +
|
|
9303
|
-
i[
|
|
9300
|
+
for (const p in d.attributes) {
|
|
9301
|
+
if (!n.has(p))
|
|
9302
|
+
return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + h + '. All geometries must have compatible attributes; make sure "' + p + '" attribute exists among all geometries, or in none of them.'), null;
|
|
9303
|
+
i[p] === void 0 && (i[p] = []), i[p].push(d.attributes[p]), l++;
|
|
9304
9304
|
}
|
|
9305
9305
|
if (l !== n.size)
|
|
9306
9306
|
return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + h + ". Make sure all geometries have the same number of attributes."), null;
|
|
9307
|
-
if (o !==
|
|
9307
|
+
if (o !== d.morphTargetsRelative)
|
|
9308
9308
|
return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + h + ". .morphTargetsRelative must be consistent throughout all geometries."), null;
|
|
9309
|
-
for (const
|
|
9310
|
-
if (!a.has(
|
|
9309
|
+
for (const p in d.morphAttributes) {
|
|
9310
|
+
if (!a.has(p))
|
|
9311
9311
|
return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + h + ". .morphAttributes must be consistent throughout all geometries."), null;
|
|
9312
|
-
s[
|
|
9312
|
+
s[p] === void 0 && (s[p] = []), s[p].push(d.morphAttributes[p]);
|
|
9313
9313
|
}
|
|
9314
9314
|
if (e) {
|
|
9315
|
-
let
|
|
9315
|
+
let p;
|
|
9316
9316
|
if (r)
|
|
9317
|
-
|
|
9318
|
-
else if (
|
|
9319
|
-
|
|
9317
|
+
p = d.index.count;
|
|
9318
|
+
else if (d.attributes.position !== void 0)
|
|
9319
|
+
p = d.attributes.position.count;
|
|
9320
9320
|
else
|
|
9321
9321
|
return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed with geometry at index " + h + ". The geometry must have either an index or a position attribute"), null;
|
|
9322
|
-
c.addGroup(u,
|
|
9322
|
+
c.addGroup(u, p, h), u += p;
|
|
9323
9323
|
}
|
|
9324
9324
|
}
|
|
9325
9325
|
if (r) {
|
|
9326
9326
|
let h = 0;
|
|
9327
|
-
const
|
|
9327
|
+
const d = [];
|
|
9328
9328
|
for (let l = 0; l < t.length; ++l) {
|
|
9329
|
-
const
|
|
9330
|
-
for (let x = 0; x <
|
|
9331
|
-
|
|
9329
|
+
const p = t[l].index;
|
|
9330
|
+
for (let x = 0; x < p.count; ++x)
|
|
9331
|
+
d.push(p.getX(x) + h);
|
|
9332
9332
|
h += t[l].attributes.position.count;
|
|
9333
9333
|
}
|
|
9334
|
-
c.setIndex(
|
|
9334
|
+
c.setIndex(d);
|
|
9335
9335
|
}
|
|
9336
9336
|
for (const h in i) {
|
|
9337
|
-
const
|
|
9338
|
-
if (!
|
|
9337
|
+
const d = wa(i[h]);
|
|
9338
|
+
if (!d)
|
|
9339
9339
|
return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + h + " attribute."), null;
|
|
9340
|
-
c.setAttribute(h,
|
|
9340
|
+
c.setAttribute(h, d);
|
|
9341
9341
|
}
|
|
9342
9342
|
for (const h in s) {
|
|
9343
|
-
const
|
|
9344
|
-
if (
|
|
9343
|
+
const d = s[h][0].length;
|
|
9344
|
+
if (d === 0) break;
|
|
9345
9345
|
c.morphAttributes = c.morphAttributes || {}, c.morphAttributes[h] = [];
|
|
9346
|
-
for (let l = 0; l <
|
|
9347
|
-
const
|
|
9346
|
+
for (let l = 0; l < d; ++l) {
|
|
9347
|
+
const p = [];
|
|
9348
9348
|
for (let v = 0; v < s[h].length; ++v)
|
|
9349
|
-
|
|
9350
|
-
const x = wa(
|
|
9349
|
+
p.push(s[h][v][l]);
|
|
9350
|
+
const x = wa(p);
|
|
9351
9351
|
if (!x)
|
|
9352
9352
|
return console.error("THREE.BufferGeometryUtils: .mergeGeometries() failed while trying to merge the " + h + " morphAttribute."), null;
|
|
9353
9353
|
c.morphAttributes[h].push(x);
|
|
@@ -9374,11 +9374,11 @@ function wa(t) {
|
|
|
9374
9374
|
for (let u = 0; u < t.length; ++u) {
|
|
9375
9375
|
const h = t[u];
|
|
9376
9376
|
if (h.isInterleavedBufferAttribute) {
|
|
9377
|
-
const
|
|
9378
|
-
for (let l = 0,
|
|
9377
|
+
const d = c / r;
|
|
9378
|
+
for (let l = 0, p = h.count; l < p; l++)
|
|
9379
9379
|
for (let x = 0; x < r; x++) {
|
|
9380
9380
|
const v = h.getComponent(l, x);
|
|
9381
|
-
o.setComponent(l +
|
|
9381
|
+
o.setComponent(l + d, x, v);
|
|
9382
9382
|
}
|
|
9383
9383
|
} else
|
|
9384
9384
|
s.set(h.array, c);
|
|
@@ -9390,7 +9390,7 @@ function Dh(t, e = 1e-4) {
|
|
|
9390
9390
|
e = Math.max(e, Number.EPSILON);
|
|
9391
9391
|
const r = {}, n = t.getIndex(), a = t.getAttribute("position"), i = n ? n.count : a.count;
|
|
9392
9392
|
let s = 0;
|
|
9393
|
-
const o = Object.keys(t.attributes), c = {}, u = {}, h = [],
|
|
9393
|
+
const o = Object.keys(t.attributes), c = {}, u = {}, h = [], d = ["getX", "getY", "getZ", "getW"], l = ["setX", "setY", "setZ", "setW"];
|
|
9394
9394
|
for (let F = 0, w = o.length; F < w; F++) {
|
|
9395
9395
|
const k = o[F], C = t.attributes[k];
|
|
9396
9396
|
c[k] = new C.constructor(
|
|
@@ -9404,14 +9404,14 @@ function Dh(t, e = 1e-4) {
|
|
|
9404
9404
|
u[k][O] = new B.constructor(H, B.itemSize, B.normalized);
|
|
9405
9405
|
}));
|
|
9406
9406
|
}
|
|
9407
|
-
const
|
|
9407
|
+
const p = e * 0.5, x = Math.log10(1 / e), v = Math.pow(10, x), b = p * v;
|
|
9408
9408
|
for (let F = 0; F < i; F++) {
|
|
9409
9409
|
const w = n ? n.getX(F) : F;
|
|
9410
9410
|
let k = "";
|
|
9411
9411
|
for (let C = 0, U = o.length; C < U; C++) {
|
|
9412
9412
|
const B = o[C], O = t.getAttribute(B), H = O.itemSize;
|
|
9413
9413
|
for (let W = 0; W < H; W++)
|
|
9414
|
-
k += `${~~(O[
|
|
9414
|
+
k += `${~~(O[d[W]](w) * v + b)},`;
|
|
9415
9415
|
}
|
|
9416
9416
|
if (k in r)
|
|
9417
9417
|
h.push(r[k]);
|
|
@@ -9419,7 +9419,7 @@ function Dh(t, e = 1e-4) {
|
|
|
9419
9419
|
for (let C = 0, U = o.length; C < U; C++) {
|
|
9420
9420
|
const B = o[C], O = t.getAttribute(B), H = t.morphAttributes[B], W = O.itemSize, z = c[B], le = u[B];
|
|
9421
9421
|
for (let ce = 0; ce < W; ce++) {
|
|
9422
|
-
const $ =
|
|
9422
|
+
const $ = d[ce], K = l[ce];
|
|
9423
9423
|
if (z[K](s, O[$](w)), H)
|
|
9424
9424
|
for (let Q = 0, ae = H.length; Q < ae; Q++)
|
|
9425
9425
|
le[Q][K](s, H[Q][$](w));
|
|
@@ -9428,26 +9428,26 @@ function Dh(t, e = 1e-4) {
|
|
|
9428
9428
|
r[k] = s, h.push(s), s++;
|
|
9429
9429
|
}
|
|
9430
9430
|
}
|
|
9431
|
-
const
|
|
9431
|
+
const y = t.clone();
|
|
9432
9432
|
for (const F in t.attributes) {
|
|
9433
9433
|
const w = c[F];
|
|
9434
|
-
if (
|
|
9434
|
+
if (y.setAttribute(F, new w.constructor(
|
|
9435
9435
|
w.array.slice(0, s * w.itemSize),
|
|
9436
9436
|
w.itemSize,
|
|
9437
9437
|
w.normalized
|
|
9438
9438
|
)), F in u)
|
|
9439
9439
|
for (let k = 0; k < u[F].length; k++) {
|
|
9440
9440
|
const C = u[F][k];
|
|
9441
|
-
|
|
9441
|
+
y.morphAttributes[F][k] = new C.constructor(
|
|
9442
9442
|
C.array.slice(0, s * C.itemSize),
|
|
9443
9443
|
C.itemSize,
|
|
9444
9444
|
C.normalized
|
|
9445
9445
|
);
|
|
9446
9446
|
}
|
|
9447
9447
|
}
|
|
9448
|
-
return
|
|
9448
|
+
return y.setIndex(h), y;
|
|
9449
9449
|
}
|
|
9450
|
-
new
|
|
9450
|
+
new R.Vector2();
|
|
9451
9451
|
class Fa extends Qa {
|
|
9452
9452
|
constructor(e, r, n) {
|
|
9453
9453
|
super(), this.isFound = !1, this.char = e, this.fontSize = r, this.font = n, this.width = this.getCharWidth(e, r, n);
|
|
@@ -9464,7 +9464,7 @@ class Fa extends Qa {
|
|
|
9464
9464
|
);
|
|
9465
9465
|
if (e == null) {
|
|
9466
9466
|
const r = this.font.generateShapes(this.char, this.fontSize);
|
|
9467
|
-
return e = new
|
|
9467
|
+
return e = new R.ShapeGeometry(r, 4), e.hasAttribute("uv") && e.deleteAttribute("uv"), e.hasAttribute("normal") && e.deleteAttribute("normal"), Dh(e, 1e-6);
|
|
9468
9468
|
}
|
|
9469
9469
|
return e;
|
|
9470
9470
|
}
|
|
@@ -9500,8 +9500,8 @@ function Ph(t, e, r) {
|
|
|
9500
9500
|
`)
|
|
9501
9501
|
o = 0, c -= i;
|
|
9502
9502
|
else {
|
|
9503
|
-
const
|
|
9504
|
-
o +=
|
|
9503
|
+
const d = Nh(h, a, o, c, r);
|
|
9504
|
+
o += d.offsetX, s.push(d.path);
|
|
9505
9505
|
}
|
|
9506
9506
|
}
|
|
9507
9507
|
return s;
|
|
@@ -9513,10 +9513,10 @@ function Nh(t, e, r, n, a) {
|
|
|
9513
9513
|
return;
|
|
9514
9514
|
}
|
|
9515
9515
|
const s = new Ya();
|
|
9516
|
-
let o, c, u, h,
|
|
9516
|
+
let o, c, u, h, d, l, p, x;
|
|
9517
9517
|
if (i.o) {
|
|
9518
9518
|
const v = i._cachedOutline || (i._cachedOutline = i.o.split(" "));
|
|
9519
|
-
for (let b = 0,
|
|
9519
|
+
for (let b = 0, y = v.length; b < y; )
|
|
9520
9520
|
switch (v[b++]) {
|
|
9521
9521
|
case "m":
|
|
9522
9522
|
o = v[b++] * e + r, c = v[b++] * e + n, s.moveTo(o, c);
|
|
@@ -9525,10 +9525,10 @@ function Nh(t, e, r, n, a) {
|
|
|
9525
9525
|
o = v[b++] * e + r, c = v[b++] * e + n, s.lineTo(o, c);
|
|
9526
9526
|
break;
|
|
9527
9527
|
case "q":
|
|
9528
|
-
u = v[b++] * e + r, h = v[b++] * e + n,
|
|
9528
|
+
u = v[b++] * e + r, h = v[b++] * e + n, d = v[b++] * e + r, l = v[b++] * e + n, s.quadraticCurveTo(d, l, u, h);
|
|
9529
9529
|
break;
|
|
9530
9530
|
case "b":
|
|
9531
|
-
u = v[b++] * e + r, h = v[b++] * e + n,
|
|
9531
|
+
u = v[b++] * e + r, h = v[b++] * e + n, d = v[b++] * e + r, l = v[b++] * e + n, p = v[b++] * e + r, x = v[b++] * e + n, s.bezierCurveTo(d, l, p, x, u, h);
|
|
9532
9532
|
break;
|
|
9533
9533
|
}
|
|
9534
9534
|
}
|
|
@@ -9590,9 +9590,9 @@ function Hh(t, e, r, n = "ltr") {
|
|
|
9590
9590
|
`)
|
|
9591
9591
|
c = 0, u -= s;
|
|
9592
9592
|
else {
|
|
9593
|
-
const
|
|
9594
|
-
if (!
|
|
9595
|
-
n === "tb" ? (c = 0, u += r.ascender * i) : c +=
|
|
9593
|
+
const d = zh(h, i, c, u, r);
|
|
9594
|
+
if (!d) continue;
|
|
9595
|
+
n === "tb" ? (c = 0, u += r.ascender * i) : c += d.offsetX, o.push(d.path);
|
|
9596
9596
|
}
|
|
9597
9597
|
return o;
|
|
9598
9598
|
}
|
|
@@ -9610,19 +9610,19 @@ function zh(t, e, r, n, a) {
|
|
|
9610
9610
|
let c = 0;
|
|
9611
9611
|
for (; c < o.length; ) {
|
|
9612
9612
|
const u = o[c++];
|
|
9613
|
-
let h,
|
|
9613
|
+
let h, d, l, p, x, v, b, y;
|
|
9614
9614
|
switch (u) {
|
|
9615
9615
|
case "m":
|
|
9616
|
-
h = parseFloat(o[c++]) * e + r,
|
|
9616
|
+
h = parseFloat(o[c++]) * e + r, d = parseFloat(o[c++]) * e + n, s.moveTo(h, d);
|
|
9617
9617
|
break;
|
|
9618
9618
|
case "l":
|
|
9619
|
-
h = parseFloat(o[c++]) * e + r,
|
|
9619
|
+
h = parseFloat(o[c++]) * e + r, d = parseFloat(o[c++]) * e + n, s.lineTo(h, d);
|
|
9620
9620
|
break;
|
|
9621
9621
|
case "q":
|
|
9622
|
-
l = parseFloat(o[c++]) * e + r,
|
|
9622
|
+
l = parseFloat(o[c++]) * e + r, p = parseFloat(o[c++]) * e + n, x = parseFloat(o[c++]) * e + r, v = parseFloat(o[c++]) * e + n, s.quadraticCurveTo(x, v, l, p);
|
|
9623
9623
|
break;
|
|
9624
9624
|
case "b":
|
|
9625
|
-
l = parseFloat(o[c++]) * e + r,
|
|
9625
|
+
l = parseFloat(o[c++]) * e + r, p = parseFloat(o[c++]) * e + n, x = parseFloat(o[c++]) * e + r, v = parseFloat(o[c++]) * e + n, b = parseFloat(o[c++]) * e + r, y = parseFloat(o[c++]) * e + n, s.bezierCurveTo(x, v, b, y, l, p);
|
|
9626
9626
|
break;
|
|
9627
9627
|
}
|
|
9628
9628
|
}
|
|
@@ -9633,8 +9633,8 @@ function Wh(t, e) {
|
|
|
9633
9633
|
let r = !1;
|
|
9634
9634
|
const { x: n, y: a } = t, i = e.length;
|
|
9635
9635
|
for (let s = 0, o = i - 1; s < i; o = s++) {
|
|
9636
|
-
const c = e[s].x, u = e[s].y, h = e[o].x,
|
|
9637
|
-
u > a !=
|
|
9636
|
+
const c = e[s].x, u = e[s].y, h = e[o].x, d = e[o].y;
|
|
9637
|
+
u > a != d > a && n < (h - c) * (a - u) / (d - u) + c && (r = !r);
|
|
9638
9638
|
}
|
|
9639
9639
|
return r;
|
|
9640
9640
|
}
|
|
@@ -9709,29 +9709,29 @@ function ka(t, e) {
|
|
|
9709
9709
|
function jh(t, e = 32) {
|
|
9710
9710
|
const r = t.subPaths;
|
|
9711
9711
|
if (!r || r.length === 0) return [];
|
|
9712
|
-
const n = r.map((
|
|
9713
|
-
for (const
|
|
9714
|
-
const x = [{ idx:
|
|
9712
|
+
const n = r.map((p) => p.getPoints(e)), a = Vh(n), i = qh(a), s = Xh(a), o = r.length, c = Array(o).fill(-1), u = Array(o).fill(-1);
|
|
9713
|
+
for (const p of s) {
|
|
9714
|
+
const x = [{ idx: p, d: 0 }];
|
|
9715
9715
|
for (; x.length; ) {
|
|
9716
9716
|
const v = x.pop();
|
|
9717
|
-
c[v.idx] = v.d, u[v.idx] =
|
|
9717
|
+
c[v.idx] = v.d, u[v.idx] = p;
|
|
9718
9718
|
for (const b of i[v.idx]) x.push({ idx: b, d: v.d + 1 });
|
|
9719
9719
|
}
|
|
9720
9720
|
}
|
|
9721
|
-
const h = [],
|
|
9722
|
-
function l(
|
|
9723
|
-
const x = ka(r[
|
|
9724
|
-
|
|
9725
|
-
for (const v of i[
|
|
9726
|
-
if (!
|
|
9721
|
+
const h = [], d = /* @__PURE__ */ new Set();
|
|
9722
|
+
function l(p) {
|
|
9723
|
+
const x = ka(r[p], !0);
|
|
9724
|
+
d.add(p);
|
|
9725
|
+
for (const v of i[p])
|
|
9726
|
+
if (!d.has(v) && c[v] === c[p] + 1) {
|
|
9727
9727
|
const b = ka(r[v], !1);
|
|
9728
|
-
x.holes.push(b),
|
|
9728
|
+
x.holes.push(b), d.add(v);
|
|
9729
9729
|
}
|
|
9730
9730
|
h.push(x);
|
|
9731
9731
|
}
|
|
9732
|
-
for (const
|
|
9733
|
-
for (let
|
|
9734
|
-
|
|
9732
|
+
for (const p of s) l(p);
|
|
9733
|
+
for (let p = 0; p < o; p++)
|
|
9734
|
+
d.has(p) || l(p);
|
|
9735
9735
|
return h;
|
|
9736
9736
|
}
|
|
9737
9737
|
class $h {
|
|
@@ -10259,9 +10259,9 @@ class tl {
|
|
|
10259
10259
|
if (u > 0) {
|
|
10260
10260
|
const h = e.readBytes(u);
|
|
10261
10261
|
if (h.length === u) {
|
|
10262
|
-
const
|
|
10262
|
+
const d = h.indexOf(0);
|
|
10263
10263
|
let l = 0;
|
|
10264
|
-
|
|
10264
|
+
d >= 0 && d < h.length && (l = d + 1), l < h.length && (s[c] = h.subarray(l));
|
|
10265
10265
|
}
|
|
10266
10266
|
}
|
|
10267
10267
|
} catch {
|
|
@@ -10531,20 +10531,20 @@ class Tt {
|
|
|
10531
10531
|
const { strokeWidth: r = "0.5%", strokeColor: n = "black", isAutoFit: a = !1 } = e;
|
|
10532
10532
|
let i, s;
|
|
10533
10533
|
if (a) {
|
|
10534
|
-
const o = this.bbox, c = 0.2, u = o.maxX - o.minX, h = o.maxY - o.minY,
|
|
10535
|
-
s = this.polylines.map((
|
|
10534
|
+
const o = this.bbox, c = 0.2, u = o.maxX - o.minX, h = o.maxY - o.minY, d = u === 0 ? h : u, l = h === 0 ? u : h, p = o.minX - d * c, x = o.maxX + d * c, v = o.minY - l * c, b = o.maxY + l * c;
|
|
10535
|
+
s = this.polylines.map((y) => {
|
|
10536
10536
|
let F = "";
|
|
10537
|
-
return
|
|
10537
|
+
return y.forEach((w, k) => {
|
|
10538
10538
|
const C = w.x, U = -w.y;
|
|
10539
10539
|
F += k === 0 ? `M ${C} ${U} ` : `L ${C} ${U} `;
|
|
10540
10540
|
}), `<path d="${F}" stroke="${n}" stroke-width="${r}" fill="none"/>`;
|
|
10541
|
-
}).join(""), i = `${
|
|
10541
|
+
}).join(""), i = `${p} ${-b} ${x - p} ${b - v}`;
|
|
10542
10542
|
} else
|
|
10543
10543
|
i = "0 0 20 20", s = this.polylines.map((o) => {
|
|
10544
10544
|
let c = "";
|
|
10545
10545
|
return o.forEach((u, h) => {
|
|
10546
|
-
const
|
|
10547
|
-
c += h === 0 ? `M ${
|
|
10546
|
+
const d = u.x + 5, l = -u.y + 15;
|
|
10547
|
+
c += h === 0 ? `M ${d} ${l} ` : `L ${d} ${l} `;
|
|
10548
10548
|
}), `<path d="${c}" stroke="${n}" stroke-width="${r}" fill="none"/>`;
|
|
10549
10549
|
}).join("");
|
|
10550
10550
|
return `<svg width="100%" height="100%" viewBox="${i}" preserveAspectRatio="xMidYMid meet">${s}</svg>`;
|
|
@@ -10624,13 +10624,13 @@ class al {
|
|
|
10624
10624
|
var a;
|
|
10625
10625
|
const i = e.bbox, s = i.maxY - i.minY, o = i.maxX - i.minX, c = s > 0 ? r / s : 1, u = o > 0 ? n / o : 1, h = (a = e.lastPoint) == null ? void 0 : a.clone();
|
|
10626
10626
|
h && (h.x *= u, h.y *= c);
|
|
10627
|
-
const
|
|
10628
|
-
(l) => l.map((
|
|
10629
|
-
const x =
|
|
10627
|
+
const d = e.polylines.map(
|
|
10628
|
+
(l) => l.map((p) => {
|
|
10629
|
+
const x = p.clone();
|
|
10630
10630
|
return x.x *= u, x.y *= c, x;
|
|
10631
10631
|
})
|
|
10632
10632
|
);
|
|
10633
|
-
return new Tt(h,
|
|
10633
|
+
return new Tt(h, d);
|
|
10634
10634
|
}
|
|
10635
10635
|
/**
|
|
10636
10636
|
* Parses the shape of a character.
|
|
@@ -10814,26 +10814,26 @@ class al {
|
|
|
10814
10814
|
let i = r;
|
|
10815
10815
|
const s = e[++i] * n.scale, o = ge.byteToSByte(e[++i]), c = (o & 112) >> 4;
|
|
10816
10816
|
let u = o & 7;
|
|
10817
|
-
const h = o < 0,
|
|
10817
|
+
const h = o < 0, d = Math.PI / 4 * c, l = n.currentPoint.clone().subtract(new re(Math.cos(d) * s, Math.sin(d) * s)), p = Bt.fromOctant(l, s, c, u, h);
|
|
10818
10818
|
if (n.isPenDown) {
|
|
10819
|
-
const x =
|
|
10819
|
+
const x = p.tessellate();
|
|
10820
10820
|
n.currentPolyline.pop(), n.currentPolyline.push(...x.slice());
|
|
10821
10821
|
}
|
|
10822
|
-
return n.currentPoint = (a =
|
|
10822
|
+
return n.currentPoint = (a = p.tessellate().pop()) == null ? void 0 : a.clone(), i;
|
|
10823
10823
|
}
|
|
10824
10824
|
handleFractionalArc(e, r, n) {
|
|
10825
10825
|
let a = r;
|
|
10826
|
-
const i = e[++a], s = e[++a], o = e[++a], c = e[++a], u = (o * 255 + c) * n.scale, h = ge.byteToSByte(e[++a]),
|
|
10826
|
+
const i = e[++a], s = e[++a], o = e[++a], c = e[++a], u = (o * 255 + c) * n.scale, h = ge.byteToSByte(e[++a]), d = (h & 112) >> 4;
|
|
10827
10827
|
let l = h & 7;
|
|
10828
10828
|
l === 0 && (l = 8), s !== 0 && l--;
|
|
10829
|
-
const
|
|
10830
|
-
let x =
|
|
10829
|
+
const p = Math.PI / 4;
|
|
10830
|
+
let x = p * l, v = nl, b = 1;
|
|
10831
10831
|
h < 0 && (v = -v, x = -x, b = -1);
|
|
10832
|
-
let
|
|
10833
|
-
|
|
10834
|
-
const w = n.currentPoint.clone().subtract(new re(u * Math.cos(
|
|
10832
|
+
let y = p * d, F = y + x;
|
|
10833
|
+
y += p * i / 256 * b, F += p * s / 256 * b;
|
|
10834
|
+
const w = n.currentPoint.clone().subtract(new re(u * Math.cos(y), u * Math.sin(y)));
|
|
10835
10835
|
if (n.currentPoint = w.clone().add(new re(u * Math.cos(F), u * Math.sin(F))), n.isPenDown) {
|
|
10836
|
-
let k =
|
|
10836
|
+
let k = y;
|
|
10837
10837
|
const C = [];
|
|
10838
10838
|
if (C.push(
|
|
10839
10839
|
w.clone().add(new re(u * Math.cos(k), u * Math.sin(k)))
|
|
@@ -11092,27 +11092,27 @@ function gl(t) {
|
|
|
11092
11092
|
var yn = {};
|
|
11093
11093
|
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
11094
11094
|
yn.read = function(t, e, r, n, a) {
|
|
11095
|
-
var i, s, o = a * 8 - n - 1, c = (1 << o) - 1, u = c >> 1, h = -7,
|
|
11096
|
-
for (
|
|
11095
|
+
var i, s, o = a * 8 - n - 1, c = (1 << o) - 1, u = c >> 1, h = -7, d = r ? a - 1 : 0, l = r ? -1 : 1, p = t[e + d];
|
|
11096
|
+
for (d += l, i = p & (1 << -h) - 1, p >>= -h, h += o; h > 0; i = i * 256 + t[e + d], d += l, h -= 8)
|
|
11097
11097
|
;
|
|
11098
|
-
for (s = i & (1 << -h) - 1, i >>= -h, h += n; h > 0; s = s * 256 + t[e +
|
|
11098
|
+
for (s = i & (1 << -h) - 1, i >>= -h, h += n; h > 0; s = s * 256 + t[e + d], d += l, h -= 8)
|
|
11099
11099
|
;
|
|
11100
11100
|
if (i === 0)
|
|
11101
11101
|
i = 1 - u;
|
|
11102
11102
|
else {
|
|
11103
11103
|
if (i === c)
|
|
11104
|
-
return s ? NaN : (
|
|
11104
|
+
return s ? NaN : (p ? -1 : 1) * (1 / 0);
|
|
11105
11105
|
s = s + Math.pow(2, n), i = i - u;
|
|
11106
11106
|
}
|
|
11107
|
-
return (
|
|
11107
|
+
return (p ? -1 : 1) * s * Math.pow(2, i - n);
|
|
11108
11108
|
};
|
|
11109
11109
|
yn.write = function(t, e, r, n, a, i) {
|
|
11110
|
-
var s, o, c, u = i * 8 - a - 1, h = (1 << u) - 1,
|
|
11111
|
-
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (o = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (c = Math.pow(2, -s)) < 1 && (s--, c *= 2), s +
|
|
11110
|
+
var s, o, c, u = i * 8 - a - 1, h = (1 << u) - 1, d = h >> 1, l = a === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0, p = n ? 0 : i - 1, x = n ? 1 : -1, v = e < 0 || e === 0 && 1 / e < 0 ? 1 : 0;
|
|
11111
|
+
for (e = Math.abs(e), isNaN(e) || e === 1 / 0 ? (o = isNaN(e) ? 1 : 0, s = h) : (s = Math.floor(Math.log(e) / Math.LN2), e * (c = Math.pow(2, -s)) < 1 && (s--, c *= 2), s + d >= 1 ? e += l / c : e += l * Math.pow(2, 1 - d), e * c >= 2 && (s++, c /= 2), s + d >= h ? (o = 0, s = h) : s + d >= 1 ? (o = (e * c - 1) * Math.pow(2, a), s = s + d) : (o = e * Math.pow(2, d - 1) * Math.pow(2, a), s = 0)); a >= 8; t[r + p] = o & 255, p += x, o /= 256, a -= 8)
|
|
11112
11112
|
;
|
|
11113
|
-
for (s = s << a | o, u += a; u > 0; t[r +
|
|
11113
|
+
for (s = s << a | o, u += a; u > 0; t[r + p] = s & 255, p += x, s /= 256, u -= 8)
|
|
11114
11114
|
;
|
|
11115
|
-
t[r +
|
|
11115
|
+
t[r + p - x] |= v * 128;
|
|
11116
11116
|
};
|
|
11117
11117
|
/*!
|
|
11118
11118
|
* The buffer module from node.js, for the browser.
|
|
@@ -11129,10 +11129,10 @@ yn.write = function(t, e, r, n, a, i) {
|
|
|
11129
11129
|
);
|
|
11130
11130
|
function i() {
|
|
11131
11131
|
try {
|
|
11132
|
-
var
|
|
11132
|
+
var m = new Uint8Array(1), f = { foo: function() {
|
|
11133
11133
|
return 42;
|
|
11134
11134
|
} };
|
|
11135
|
-
return Object.setPrototypeOf(f, Uint8Array.prototype), Object.setPrototypeOf(
|
|
11135
|
+
return Object.setPrototypeOf(f, Uint8Array.prototype), Object.setPrototypeOf(m, f), m.foo() === 42;
|
|
11136
11136
|
} catch {
|
|
11137
11137
|
return !1;
|
|
11138
11138
|
}
|
|
@@ -11150,131 +11150,131 @@ yn.write = function(t, e, r, n, a, i) {
|
|
|
11150
11150
|
return this.byteOffset;
|
|
11151
11151
|
}
|
|
11152
11152
|
});
|
|
11153
|
-
function s(
|
|
11154
|
-
if (
|
|
11155
|
-
throw new RangeError('The value "' +
|
|
11156
|
-
var f = new Uint8Array(
|
|
11153
|
+
function s(m) {
|
|
11154
|
+
if (m > a)
|
|
11155
|
+
throw new RangeError('The value "' + m + '" is invalid for option "size"');
|
|
11156
|
+
var f = new Uint8Array(m);
|
|
11157
11157
|
return Object.setPrototypeOf(f, o.prototype), f;
|
|
11158
11158
|
}
|
|
11159
|
-
function o(
|
|
11160
|
-
if (typeof
|
|
11159
|
+
function o(m, f, g) {
|
|
11160
|
+
if (typeof m == "number") {
|
|
11161
11161
|
if (typeof f == "string")
|
|
11162
11162
|
throw new TypeError(
|
|
11163
11163
|
'The "string" argument must be of type string. Received type number'
|
|
11164
11164
|
);
|
|
11165
|
-
return
|
|
11165
|
+
return d(m);
|
|
11166
11166
|
}
|
|
11167
|
-
return c(
|
|
11167
|
+
return c(m, f, g);
|
|
11168
11168
|
}
|
|
11169
11169
|
o.poolSize = 8192;
|
|
11170
|
-
function c(
|
|
11171
|
-
if (typeof
|
|
11172
|
-
return l(
|
|
11173
|
-
if (ArrayBuffer.isView(
|
|
11174
|
-
return x(
|
|
11175
|
-
if (
|
|
11170
|
+
function c(m, f, g) {
|
|
11171
|
+
if (typeof m == "string")
|
|
11172
|
+
return l(m, f);
|
|
11173
|
+
if (ArrayBuffer.isView(m))
|
|
11174
|
+
return x(m);
|
|
11175
|
+
if (m == null)
|
|
11176
11176
|
throw new TypeError(
|
|
11177
|
-
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof
|
|
11177
|
+
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof m
|
|
11178
11178
|
);
|
|
11179
|
-
if (Be(
|
|
11180
|
-
return v(
|
|
11181
|
-
if (typeof
|
|
11179
|
+
if (Be(m, ArrayBuffer) || m && Be(m.buffer, ArrayBuffer) || typeof SharedArrayBuffer < "u" && (Be(m, SharedArrayBuffer) || m && Be(m.buffer, SharedArrayBuffer)))
|
|
11180
|
+
return v(m, f, g);
|
|
11181
|
+
if (typeof m == "number")
|
|
11182
11182
|
throw new TypeError(
|
|
11183
11183
|
'The "value" argument must not be of type number. Received type number'
|
|
11184
11184
|
);
|
|
11185
|
-
var S =
|
|
11186
|
-
if (S != null && S !==
|
|
11187
|
-
return o.from(S, f,
|
|
11188
|
-
var T = b(
|
|
11185
|
+
var S = m.valueOf && m.valueOf();
|
|
11186
|
+
if (S != null && S !== m)
|
|
11187
|
+
return o.from(S, f, g);
|
|
11188
|
+
var T = b(m);
|
|
11189
11189
|
if (T) return T;
|
|
11190
|
-
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof
|
|
11190
|
+
if (typeof Symbol < "u" && Symbol.toPrimitive != null && typeof m[Symbol.toPrimitive] == "function")
|
|
11191
11191
|
return o.from(
|
|
11192
|
-
|
|
11192
|
+
m[Symbol.toPrimitive]("string"),
|
|
11193
11193
|
f,
|
|
11194
|
-
|
|
11194
|
+
g
|
|
11195
11195
|
);
|
|
11196
11196
|
throw new TypeError(
|
|
11197
|
-
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof
|
|
11197
|
+
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type " + typeof m
|
|
11198
11198
|
);
|
|
11199
11199
|
}
|
|
11200
|
-
o.from = function(
|
|
11201
|
-
return c(
|
|
11200
|
+
o.from = function(m, f, g) {
|
|
11201
|
+
return c(m, f, g);
|
|
11202
11202
|
}, Object.setPrototypeOf(o.prototype, Uint8Array.prototype), Object.setPrototypeOf(o, Uint8Array);
|
|
11203
|
-
function u(
|
|
11204
|
-
if (typeof
|
|
11203
|
+
function u(m) {
|
|
11204
|
+
if (typeof m != "number")
|
|
11205
11205
|
throw new TypeError('"size" argument must be of type number');
|
|
11206
|
-
if (
|
|
11207
|
-
throw new RangeError('The value "' +
|
|
11206
|
+
if (m < 0)
|
|
11207
|
+
throw new RangeError('The value "' + m + '" is invalid for option "size"');
|
|
11208
11208
|
}
|
|
11209
|
-
function h(
|
|
11210
|
-
return u(
|
|
11209
|
+
function h(m, f, g) {
|
|
11210
|
+
return u(m), m <= 0 ? s(m) : f !== void 0 ? typeof g == "string" ? s(m).fill(f, g) : s(m).fill(f) : s(m);
|
|
11211
11211
|
}
|
|
11212
|
-
o.alloc = function(
|
|
11213
|
-
return h(
|
|
11212
|
+
o.alloc = function(m, f, g) {
|
|
11213
|
+
return h(m, f, g);
|
|
11214
11214
|
};
|
|
11215
|
-
function
|
|
11216
|
-
return u(
|
|
11215
|
+
function d(m) {
|
|
11216
|
+
return u(m), s(m < 0 ? 0 : y(m) | 0);
|
|
11217
11217
|
}
|
|
11218
|
-
o.allocUnsafe = function(
|
|
11219
|
-
return
|
|
11220
|
-
}, o.allocUnsafeSlow = function(
|
|
11221
|
-
return
|
|
11218
|
+
o.allocUnsafe = function(m) {
|
|
11219
|
+
return d(m);
|
|
11220
|
+
}, o.allocUnsafeSlow = function(m) {
|
|
11221
|
+
return d(m);
|
|
11222
11222
|
};
|
|
11223
|
-
function l(
|
|
11223
|
+
function l(m, f) {
|
|
11224
11224
|
if ((typeof f != "string" || f === "") && (f = "utf8"), !o.isEncoding(f))
|
|
11225
11225
|
throw new TypeError("Unknown encoding: " + f);
|
|
11226
|
-
var
|
|
11227
|
-
return T !==
|
|
11226
|
+
var g = w(m, f) | 0, S = s(g), T = S.write(m, f);
|
|
11227
|
+
return T !== g && (S = S.slice(0, T)), S;
|
|
11228
11228
|
}
|
|
11229
|
-
function
|
|
11230
|
-
for (var f =
|
|
11231
|
-
|
|
11232
|
-
return
|
|
11229
|
+
function p(m) {
|
|
11230
|
+
for (var f = m.length < 0 ? 0 : y(m.length) | 0, g = s(f), S = 0; S < f; S += 1)
|
|
11231
|
+
g[S] = m[S] & 255;
|
|
11232
|
+
return g;
|
|
11233
11233
|
}
|
|
11234
|
-
function x(
|
|
11235
|
-
if (Be(
|
|
11236
|
-
var f = new Uint8Array(
|
|
11234
|
+
function x(m) {
|
|
11235
|
+
if (Be(m, Uint8Array)) {
|
|
11236
|
+
var f = new Uint8Array(m);
|
|
11237
11237
|
return v(f.buffer, f.byteOffset, f.byteLength);
|
|
11238
11238
|
}
|
|
11239
|
-
return
|
|
11239
|
+
return p(m);
|
|
11240
11240
|
}
|
|
11241
|
-
function v(
|
|
11242
|
-
if (f < 0 ||
|
|
11241
|
+
function v(m, f, g) {
|
|
11242
|
+
if (f < 0 || m.byteLength < f)
|
|
11243
11243
|
throw new RangeError('"offset" is outside of buffer bounds');
|
|
11244
|
-
if (
|
|
11244
|
+
if (m.byteLength < f + (g || 0))
|
|
11245
11245
|
throw new RangeError('"length" is outside of buffer bounds');
|
|
11246
11246
|
var S;
|
|
11247
|
-
return f === void 0 &&
|
|
11247
|
+
return f === void 0 && g === void 0 ? S = new Uint8Array(m) : g === void 0 ? S = new Uint8Array(m, f) : S = new Uint8Array(m, f, g), Object.setPrototypeOf(S, o.prototype), S;
|
|
11248
11248
|
}
|
|
11249
|
-
function b(
|
|
11250
|
-
if (o.isBuffer(
|
|
11251
|
-
var f = m
|
|
11252
|
-
return
|
|
11249
|
+
function b(m) {
|
|
11250
|
+
if (o.isBuffer(m)) {
|
|
11251
|
+
var f = y(m.length) | 0, g = s(f);
|
|
11252
|
+
return g.length === 0 || m.copy(g, 0, 0, f), g;
|
|
11253
11253
|
}
|
|
11254
|
-
if (
|
|
11255
|
-
return typeof
|
|
11256
|
-
if (
|
|
11257
|
-
return
|
|
11254
|
+
if (m.length !== void 0)
|
|
11255
|
+
return typeof m.length != "number" || pr(m.length) ? s(0) : p(m);
|
|
11256
|
+
if (m.type === "Buffer" && Array.isArray(m.data))
|
|
11257
|
+
return p(m.data);
|
|
11258
11258
|
}
|
|
11259
|
-
function m
|
|
11260
|
-
if (
|
|
11259
|
+
function y(m) {
|
|
11260
|
+
if (m >= a)
|
|
11261
11261
|
throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x" + a.toString(16) + " bytes");
|
|
11262
|
-
return
|
|
11262
|
+
return m | 0;
|
|
11263
11263
|
}
|
|
11264
|
-
function F(
|
|
11265
|
-
return +
|
|
11264
|
+
function F(m) {
|
|
11265
|
+
return +m != m && (m = 0), o.alloc(+m);
|
|
11266
11266
|
}
|
|
11267
11267
|
o.isBuffer = function(f) {
|
|
11268
11268
|
return f != null && f._isBuffer === !0 && f !== o.prototype;
|
|
11269
|
-
}, o.compare = function(f,
|
|
11270
|
-
if (Be(f, Uint8Array) && (f = o.from(f, f.offset, f.byteLength)), Be(
|
|
11269
|
+
}, o.compare = function(f, g) {
|
|
11270
|
+
if (Be(f, Uint8Array) && (f = o.from(f, f.offset, f.byteLength)), Be(g, Uint8Array) && (g = o.from(g, g.offset, g.byteLength)), !o.isBuffer(f) || !o.isBuffer(g))
|
|
11271
11271
|
throw new TypeError(
|
|
11272
11272
|
'The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'
|
|
11273
11273
|
);
|
|
11274
|
-
if (f ===
|
|
11275
|
-
for (var S = f.length, T =
|
|
11276
|
-
if (f[L] !==
|
|
11277
|
-
S = f[L], T =
|
|
11274
|
+
if (f === g) return 0;
|
|
11275
|
+
for (var S = f.length, T = g.length, L = 0, A = Math.min(S, T); L < A; ++L)
|
|
11276
|
+
if (f[L] !== g[L]) {
|
|
11277
|
+
S = f[L], T = g[L];
|
|
11278
11278
|
break;
|
|
11279
11279
|
}
|
|
11280
11280
|
return S < T ? -1 : T < S ? 1 : 0;
|
|
@@ -11295,16 +11295,16 @@ yn.write = function(t, e, r, n, a, i) {
|
|
|
11295
11295
|
default:
|
|
11296
11296
|
return !1;
|
|
11297
11297
|
}
|
|
11298
|
-
}, o.concat = function(f,
|
|
11298
|
+
}, o.concat = function(f, g) {
|
|
11299
11299
|
if (!Array.isArray(f))
|
|
11300
11300
|
throw new TypeError('"list" argument must be an Array of Buffers');
|
|
11301
11301
|
if (f.length === 0)
|
|
11302
11302
|
return o.alloc(0);
|
|
11303
11303
|
var S;
|
|
11304
|
-
if (
|
|
11305
|
-
for (
|
|
11306
|
-
|
|
11307
|
-
var T = o.allocUnsafe(
|
|
11304
|
+
if (g === void 0)
|
|
11305
|
+
for (g = 0, S = 0; S < f.length; ++S)
|
|
11306
|
+
g += f[S].length;
|
|
11307
|
+
var T = o.allocUnsafe(g), L = 0;
|
|
11308
11308
|
for (S = 0; S < f.length; ++S) {
|
|
11309
11309
|
var A = f[S];
|
|
11310
11310
|
if (Be(A, Uint8Array))
|
|
@@ -11321,95 +11321,95 @@ yn.write = function(t, e, r, n, a, i) {
|
|
|
11321
11321
|
}
|
|
11322
11322
|
return T;
|
|
11323
11323
|
};
|
|
11324
|
-
function w(
|
|
11325
|
-
if (o.isBuffer(
|
|
11326
|
-
return
|
|
11327
|
-
if (ArrayBuffer.isView(
|
|
11328
|
-
return
|
|
11329
|
-
if (typeof
|
|
11324
|
+
function w(m, f) {
|
|
11325
|
+
if (o.isBuffer(m))
|
|
11326
|
+
return m.length;
|
|
11327
|
+
if (ArrayBuffer.isView(m) || Be(m, ArrayBuffer))
|
|
11328
|
+
return m.byteLength;
|
|
11329
|
+
if (typeof m != "string")
|
|
11330
11330
|
throw new TypeError(
|
|
11331
|
-
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof
|
|
11331
|
+
'The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type ' + typeof m
|
|
11332
11332
|
);
|
|
11333
|
-
var
|
|
11334
|
-
if (!S &&
|
|
11333
|
+
var g = m.length, S = arguments.length > 2 && arguments[2] === !0;
|
|
11334
|
+
if (!S && g === 0) return 0;
|
|
11335
11335
|
for (var T = !1; ; )
|
|
11336
11336
|
switch (f) {
|
|
11337
11337
|
case "ascii":
|
|
11338
11338
|
case "latin1":
|
|
11339
11339
|
case "binary":
|
|
11340
|
-
return
|
|
11340
|
+
return g;
|
|
11341
11341
|
case "utf8":
|
|
11342
11342
|
case "utf-8":
|
|
11343
|
-
return ze(
|
|
11343
|
+
return ze(m).length;
|
|
11344
11344
|
case "ucs2":
|
|
11345
11345
|
case "ucs-2":
|
|
11346
11346
|
case "utf16le":
|
|
11347
11347
|
case "utf-16le":
|
|
11348
|
-
return
|
|
11348
|
+
return g * 2;
|
|
11349
11349
|
case "hex":
|
|
11350
|
-
return
|
|
11350
|
+
return g >>> 1;
|
|
11351
11351
|
case "base64":
|
|
11352
|
-
return Fn(
|
|
11352
|
+
return Fn(m).length;
|
|
11353
11353
|
default:
|
|
11354
11354
|
if (T)
|
|
11355
|
-
return S ? -1 : ze(
|
|
11355
|
+
return S ? -1 : ze(m).length;
|
|
11356
11356
|
f = ("" + f).toLowerCase(), T = !0;
|
|
11357
11357
|
}
|
|
11358
11358
|
}
|
|
11359
11359
|
o.byteLength = w;
|
|
11360
|
-
function k(
|
|
11360
|
+
function k(m, f, g) {
|
|
11361
11361
|
var S = !1;
|
|
11362
|
-
if ((f === void 0 || f < 0) && (f = 0), f > this.length || ((
|
|
11362
|
+
if ((f === void 0 || f < 0) && (f = 0), f > this.length || ((g === void 0 || g > this.length) && (g = this.length), g <= 0) || (g >>>= 0, f >>>= 0, g <= f))
|
|
11363
11363
|
return "";
|
|
11364
|
-
for (
|
|
11365
|
-
switch (
|
|
11364
|
+
for (m || (m = "utf8"); ; )
|
|
11365
|
+
switch (m) {
|
|
11366
11366
|
case "hex":
|
|
11367
|
-
return oe(this, f,
|
|
11367
|
+
return oe(this, f, g);
|
|
11368
11368
|
case "utf8":
|
|
11369
11369
|
case "utf-8":
|
|
11370
|
-
return $(this, f,
|
|
11370
|
+
return $(this, f, g);
|
|
11371
11371
|
case "ascii":
|
|
11372
|
-
return ae(this, f,
|
|
11372
|
+
return ae(this, f, g);
|
|
11373
11373
|
case "latin1":
|
|
11374
11374
|
case "binary":
|
|
11375
|
-
return ue(this, f,
|
|
11375
|
+
return ue(this, f, g);
|
|
11376
11376
|
case "base64":
|
|
11377
|
-
return ce(this, f,
|
|
11377
|
+
return ce(this, f, g);
|
|
11378
11378
|
case "ucs2":
|
|
11379
11379
|
case "ucs-2":
|
|
11380
11380
|
case "utf16le":
|
|
11381
11381
|
case "utf-16le":
|
|
11382
|
-
return fe(this, f,
|
|
11382
|
+
return fe(this, f, g);
|
|
11383
11383
|
default:
|
|
11384
|
-
if (S) throw new TypeError("Unknown encoding: " +
|
|
11385
|
-
|
|
11384
|
+
if (S) throw new TypeError("Unknown encoding: " + m);
|
|
11385
|
+
m = (m + "").toLowerCase(), S = !0;
|
|
11386
11386
|
}
|
|
11387
11387
|
}
|
|
11388
11388
|
o.prototype._isBuffer = !0;
|
|
11389
|
-
function C(
|
|
11390
|
-
var S =
|
|
11391
|
-
|
|
11389
|
+
function C(m, f, g) {
|
|
11390
|
+
var S = m[f];
|
|
11391
|
+
m[f] = m[g], m[g] = S;
|
|
11392
11392
|
}
|
|
11393
11393
|
o.prototype.swap16 = function() {
|
|
11394
11394
|
var f = this.length;
|
|
11395
11395
|
if (f % 2 !== 0)
|
|
11396
11396
|
throw new RangeError("Buffer size must be a multiple of 16-bits");
|
|
11397
|
-
for (var
|
|
11398
|
-
C(this,
|
|
11397
|
+
for (var g = 0; g < f; g += 2)
|
|
11398
|
+
C(this, g, g + 1);
|
|
11399
11399
|
return this;
|
|
11400
11400
|
}, o.prototype.swap32 = function() {
|
|
11401
11401
|
var f = this.length;
|
|
11402
11402
|
if (f % 4 !== 0)
|
|
11403
11403
|
throw new RangeError("Buffer size must be a multiple of 32-bits");
|
|
11404
|
-
for (var
|
|
11405
|
-
C(this,
|
|
11404
|
+
for (var g = 0; g < f; g += 4)
|
|
11405
|
+
C(this, g, g + 3), C(this, g + 1, g + 2);
|
|
11406
11406
|
return this;
|
|
11407
11407
|
}, o.prototype.swap64 = function() {
|
|
11408
11408
|
var f = this.length;
|
|
11409
11409
|
if (f % 8 !== 0)
|
|
11410
11410
|
throw new RangeError("Buffer size must be a multiple of 64-bits");
|
|
11411
|
-
for (var
|
|
11412
|
-
C(this,
|
|
11411
|
+
for (var g = 0; g < f; g += 8)
|
|
11412
|
+
C(this, g, g + 7), C(this, g + 1, g + 6), C(this, g + 2, g + 5), C(this, g + 3, g + 4);
|
|
11413
11413
|
return this;
|
|
11414
11414
|
}, o.prototype.toString = function() {
|
|
11415
11415
|
var f = this.length;
|
|
@@ -11418,49 +11418,49 @@ yn.write = function(t, e, r, n, a, i) {
|
|
|
11418
11418
|
if (!o.isBuffer(f)) throw new TypeError("Argument must be a Buffer");
|
|
11419
11419
|
return this === f ? !0 : o.compare(this, f) === 0;
|
|
11420
11420
|
}, o.prototype.inspect = function() {
|
|
11421
|
-
var f = "",
|
|
11422
|
-
return f = this.toString("hex", 0,
|
|
11423
|
-
}, n && (o.prototype[n] = o.prototype.inspect), o.prototype.compare = function(f,
|
|
11421
|
+
var f = "", g = t.INSPECT_MAX_BYTES;
|
|
11422
|
+
return f = this.toString("hex", 0, g).replace(/(.{2})/g, "$1 ").trim(), this.length > g && (f += " ... "), "<Buffer " + f + ">";
|
|
11423
|
+
}, n && (o.prototype[n] = o.prototype.inspect), o.prototype.compare = function(f, g, S, T, L) {
|
|
11424
11424
|
if (Be(f, Uint8Array) && (f = o.from(f, f.offset, f.byteLength)), !o.isBuffer(f))
|
|
11425
11425
|
throw new TypeError(
|
|
11426
11426
|
'The "target" argument must be one of type Buffer or Uint8Array. Received type ' + typeof f
|
|
11427
11427
|
);
|
|
11428
|
-
if (
|
|
11428
|
+
if (g === void 0 && (g = 0), S === void 0 && (S = f ? f.length : 0), T === void 0 && (T = 0), L === void 0 && (L = this.length), g < 0 || S > f.length || T < 0 || L > this.length)
|
|
11429
11429
|
throw new RangeError("out of range index");
|
|
11430
|
-
if (T >= L &&
|
|
11430
|
+
if (T >= L && g >= S)
|
|
11431
11431
|
return 0;
|
|
11432
11432
|
if (T >= L)
|
|
11433
11433
|
return -1;
|
|
11434
|
-
if (
|
|
11434
|
+
if (g >= S)
|
|
11435
11435
|
return 1;
|
|
11436
|
-
if (
|
|
11437
|
-
for (var A = L - T, V = S -
|
|
11436
|
+
if (g >>>= 0, S >>>= 0, T >>>= 0, L >>>= 0, this === f) return 0;
|
|
11437
|
+
for (var A = L - T, V = S - g, Y = Math.min(A, V), J = this.slice(T, L), de = f.slice(g, S), te = 0; te < Y; ++te)
|
|
11438
11438
|
if (J[te] !== de[te]) {
|
|
11439
11439
|
A = J[te], V = de[te];
|
|
11440
11440
|
break;
|
|
11441
11441
|
}
|
|
11442
11442
|
return A < V ? -1 : V < A ? 1 : 0;
|
|
11443
11443
|
};
|
|
11444
|
-
function U(
|
|
11445
|
-
if (
|
|
11446
|
-
if (typeof
|
|
11444
|
+
function U(m, f, g, S, T) {
|
|
11445
|
+
if (m.length === 0) return -1;
|
|
11446
|
+
if (typeof g == "string" ? (S = g, g = 0) : g > 2147483647 ? g = 2147483647 : g < -2147483648 && (g = -2147483648), g = +g, pr(g) && (g = T ? 0 : m.length - 1), g < 0 && (g = m.length + g), g >= m.length) {
|
|
11447
11447
|
if (T) return -1;
|
|
11448
|
-
|
|
11449
|
-
} else if (
|
|
11450
|
-
if (T)
|
|
11448
|
+
g = m.length - 1;
|
|
11449
|
+
} else if (g < 0)
|
|
11450
|
+
if (T) g = 0;
|
|
11451
11451
|
else return -1;
|
|
11452
11452
|
if (typeof f == "string" && (f = o.from(f, S)), o.isBuffer(f))
|
|
11453
|
-
return f.length === 0 ? -1 : B(
|
|
11453
|
+
return f.length === 0 ? -1 : B(m, f, g, S, T);
|
|
11454
11454
|
if (typeof f == "number")
|
|
11455
|
-
return f = f & 255, typeof Uint8Array.prototype.indexOf == "function" ? T ? Uint8Array.prototype.indexOf.call(
|
|
11455
|
+
return f = f & 255, typeof Uint8Array.prototype.indexOf == "function" ? T ? Uint8Array.prototype.indexOf.call(m, f, g) : Uint8Array.prototype.lastIndexOf.call(m, f, g) : B(m, [f], g, S, T);
|
|
11456
11456
|
throw new TypeError("val must be string, number or Buffer");
|
|
11457
11457
|
}
|
|
11458
|
-
function B(
|
|
11459
|
-
var L = 1, A =
|
|
11458
|
+
function B(m, f, g, S, T) {
|
|
11459
|
+
var L = 1, A = m.length, V = f.length;
|
|
11460
11460
|
if (S !== void 0 && (S = String(S).toLowerCase(), S === "ucs2" || S === "ucs-2" || S === "utf16le" || S === "utf-16le")) {
|
|
11461
|
-
if (
|
|
11461
|
+
if (m.length < 2 || f.length < 2)
|
|
11462
11462
|
return -1;
|
|
11463
|
-
L = 2, A /= 2, V /= 2,
|
|
11463
|
+
L = 2, A /= 2, V /= 2, g /= 2;
|
|
11464
11464
|
}
|
|
11465
11465
|
function Y(kn, Tn) {
|
|
11466
11466
|
return L === 1 ? kn[Tn] : kn.readUInt16BE(Tn * L);
|
|
@@ -11468,15 +11468,15 @@ yn.write = function(t, e, r, n, a, i) {
|
|
|
11468
11468
|
var J;
|
|
11469
11469
|
if (T) {
|
|
11470
11470
|
var de = -1;
|
|
11471
|
-
for (J =
|
|
11472
|
-
if (Y(
|
|
11471
|
+
for (J = g; J < A; J++)
|
|
11472
|
+
if (Y(m, J) === Y(f, de === -1 ? 0 : J - de)) {
|
|
11473
11473
|
if (de === -1 && (de = J), J - de + 1 === V) return de * L;
|
|
11474
11474
|
} else
|
|
11475
11475
|
de !== -1 && (J -= J - de), de = -1;
|
|
11476
11476
|
} else
|
|
11477
|
-
for (
|
|
11477
|
+
for (g + V > A && (g = A - V), J = g; J >= 0; J--) {
|
|
11478
11478
|
for (var te = !0, Ht = 0; Ht < V; Ht++)
|
|
11479
|
-
if (Y(
|
|
11479
|
+
if (Y(m, J + Ht) !== Y(f, Ht)) {
|
|
11480
11480
|
te = !1;
|
|
11481
11481
|
break;
|
|
11482
11482
|
}
|
|
@@ -11484,71 +11484,71 @@ yn.write = function(t, e, r, n, a, i) {
|
|
|
11484
11484
|
}
|
|
11485
11485
|
return -1;
|
|
11486
11486
|
}
|
|
11487
|
-
o.prototype.includes = function(f,
|
|
11488
|
-
return this.indexOf(f,
|
|
11489
|
-
}, o.prototype.indexOf = function(f,
|
|
11490
|
-
return U(this, f,
|
|
11491
|
-
}, o.prototype.lastIndexOf = function(f,
|
|
11492
|
-
return U(this, f,
|
|
11487
|
+
o.prototype.includes = function(f, g, S) {
|
|
11488
|
+
return this.indexOf(f, g, S) !== -1;
|
|
11489
|
+
}, o.prototype.indexOf = function(f, g, S) {
|
|
11490
|
+
return U(this, f, g, S, !0);
|
|
11491
|
+
}, o.prototype.lastIndexOf = function(f, g, S) {
|
|
11492
|
+
return U(this, f, g, S, !1);
|
|
11493
11493
|
};
|
|
11494
|
-
function O(
|
|
11495
|
-
|
|
11496
|
-
var T =
|
|
11494
|
+
function O(m, f, g, S) {
|
|
11495
|
+
g = Number(g) || 0;
|
|
11496
|
+
var T = m.length - g;
|
|
11497
11497
|
S ? (S = Number(S), S > T && (S = T)) : S = T;
|
|
11498
11498
|
var L = f.length;
|
|
11499
11499
|
S > L / 2 && (S = L / 2);
|
|
11500
11500
|
for (var A = 0; A < S; ++A) {
|
|
11501
11501
|
var V = parseInt(f.substr(A * 2, 2), 16);
|
|
11502
11502
|
if (pr(V)) return A;
|
|
11503
|
-
|
|
11503
|
+
m[g + A] = V;
|
|
11504
11504
|
}
|
|
11505
11505
|
return A;
|
|
11506
11506
|
}
|
|
11507
|
-
function H(
|
|
11508
|
-
return Gt(ze(f,
|
|
11507
|
+
function H(m, f, g, S) {
|
|
11508
|
+
return Gt(ze(f, m.length - g), m, g, S);
|
|
11509
11509
|
}
|
|
11510
|
-
function W(
|
|
11511
|
-
return Gt(Ji(f),
|
|
11510
|
+
function W(m, f, g, S) {
|
|
11511
|
+
return Gt(Ji(f), m, g, S);
|
|
11512
11512
|
}
|
|
11513
|
-
function z(
|
|
11514
|
-
return Gt(Fn(f),
|
|
11513
|
+
function z(m, f, g, S) {
|
|
11514
|
+
return Gt(Fn(f), m, g, S);
|
|
11515
11515
|
}
|
|
11516
|
-
function le(
|
|
11517
|
-
return Gt(es(f,
|
|
11516
|
+
function le(m, f, g, S) {
|
|
11517
|
+
return Gt(es(f, m.length - g), m, g, S);
|
|
11518
11518
|
}
|
|
11519
|
-
o.prototype.write = function(f,
|
|
11520
|
-
if (
|
|
11521
|
-
T = "utf8", S = this.length,
|
|
11522
|
-
else if (S === void 0 && typeof
|
|
11523
|
-
T =
|
|
11524
|
-
else if (isFinite(
|
|
11525
|
-
|
|
11519
|
+
o.prototype.write = function(f, g, S, T) {
|
|
11520
|
+
if (g === void 0)
|
|
11521
|
+
T = "utf8", S = this.length, g = 0;
|
|
11522
|
+
else if (S === void 0 && typeof g == "string")
|
|
11523
|
+
T = g, S = this.length, g = 0;
|
|
11524
|
+
else if (isFinite(g))
|
|
11525
|
+
g = g >>> 0, isFinite(S) ? (S = S >>> 0, T === void 0 && (T = "utf8")) : (T = S, S = void 0);
|
|
11526
11526
|
else
|
|
11527
11527
|
throw new Error(
|
|
11528
11528
|
"Buffer.write(string, encoding, offset[, length]) is no longer supported"
|
|
11529
11529
|
);
|
|
11530
|
-
var L = this.length -
|
|
11531
|
-
if ((S === void 0 || S > L) && (S = L), f.length > 0 && (S < 0 ||
|
|
11530
|
+
var L = this.length - g;
|
|
11531
|
+
if ((S === void 0 || S > L) && (S = L), f.length > 0 && (S < 0 || g < 0) || g > this.length)
|
|
11532
11532
|
throw new RangeError("Attempt to write outside buffer bounds");
|
|
11533
11533
|
T || (T = "utf8");
|
|
11534
11534
|
for (var A = !1; ; )
|
|
11535
11535
|
switch (T) {
|
|
11536
11536
|
case "hex":
|
|
11537
|
-
return O(this, f,
|
|
11537
|
+
return O(this, f, g, S);
|
|
11538
11538
|
case "utf8":
|
|
11539
11539
|
case "utf-8":
|
|
11540
|
-
return H(this, f,
|
|
11540
|
+
return H(this, f, g, S);
|
|
11541
11541
|
case "ascii":
|
|
11542
11542
|
case "latin1":
|
|
11543
11543
|
case "binary":
|
|
11544
|
-
return W(this, f,
|
|
11544
|
+
return W(this, f, g, S);
|
|
11545
11545
|
case "base64":
|
|
11546
|
-
return z(this, f,
|
|
11546
|
+
return z(this, f, g, S);
|
|
11547
11547
|
case "ucs2":
|
|
11548
11548
|
case "ucs-2":
|
|
11549
11549
|
case "utf16le":
|
|
11550
11550
|
case "utf-16le":
|
|
11551
|
-
return le(this, f,
|
|
11551
|
+
return le(this, f, g, S);
|
|
11552
11552
|
default:
|
|
11553
11553
|
if (A) throw new TypeError("Unknown encoding: " + T);
|
|
11554
11554
|
T = ("" + T).toLowerCase(), A = !0;
|
|
@@ -11559,27 +11559,27 @@ yn.write = function(t, e, r, n, a, i) {
|
|
|
11559
11559
|
data: Array.prototype.slice.call(this._arr || this, 0)
|
|
11560
11560
|
};
|
|
11561
11561
|
};
|
|
11562
|
-
function ce(
|
|
11563
|
-
return f === 0 &&
|
|
11564
|
-
}
|
|
11565
|
-
function $(
|
|
11566
|
-
|
|
11567
|
-
for (var S = [], T = f; T <
|
|
11568
|
-
var L =
|
|
11569
|
-
if (T + V <=
|
|
11562
|
+
function ce(m, f, g) {
|
|
11563
|
+
return f === 0 && g === m.length ? e.fromByteArray(m) : e.fromByteArray(m.slice(f, g));
|
|
11564
|
+
}
|
|
11565
|
+
function $(m, f, g) {
|
|
11566
|
+
g = Math.min(m.length, g);
|
|
11567
|
+
for (var S = [], T = f; T < g; ) {
|
|
11568
|
+
var L = m[T], A = null, V = L > 239 ? 4 : L > 223 ? 3 : L > 191 ? 2 : 1;
|
|
11569
|
+
if (T + V <= g) {
|
|
11570
11570
|
var Y, J, de, te;
|
|
11571
11571
|
switch (V) {
|
|
11572
11572
|
case 1:
|
|
11573
11573
|
L < 128 && (A = L);
|
|
11574
11574
|
break;
|
|
11575
11575
|
case 2:
|
|
11576
|
-
Y =
|
|
11576
|
+
Y = m[T + 1], (Y & 192) === 128 && (te = (L & 31) << 6 | Y & 63, te > 127 && (A = te));
|
|
11577
11577
|
break;
|
|
11578
11578
|
case 3:
|
|
11579
|
-
Y =
|
|
11579
|
+
Y = m[T + 1], J = m[T + 2], (Y & 192) === 128 && (J & 192) === 128 && (te = (L & 15) << 12 | (Y & 63) << 6 | J & 63, te > 2047 && (te < 55296 || te > 57343) && (A = te));
|
|
11580
11580
|
break;
|
|
11581
11581
|
case 4:
|
|
11582
|
-
Y =
|
|
11582
|
+
Y = m[T + 1], J = m[T + 2], de = m[T + 3], (Y & 192) === 128 && (J & 192) === 128 && (de & 192) === 128 && (te = (L & 15) << 18 | (Y & 63) << 12 | (J & 63) << 6 | de & 63, te > 65535 && te < 1114112 && (A = te));
|
|
11583
11583
|
}
|
|
11584
11584
|
}
|
|
11585
11585
|
A === null ? (A = 65533, V = 1) : A > 65535 && (A -= 65536, S.push(A >>> 10 & 1023 | 55296), A = 56320 | A & 1023), S.push(A), T += V;
|
|
@@ -11587,204 +11587,204 @@ yn.write = function(t, e, r, n, a, i) {
|
|
|
11587
11587
|
return Q(S);
|
|
11588
11588
|
}
|
|
11589
11589
|
var K = 4096;
|
|
11590
|
-
function Q(
|
|
11591
|
-
var f =
|
|
11590
|
+
function Q(m) {
|
|
11591
|
+
var f = m.length;
|
|
11592
11592
|
if (f <= K)
|
|
11593
|
-
return String.fromCharCode.apply(String,
|
|
11594
|
-
for (var
|
|
11595
|
-
|
|
11593
|
+
return String.fromCharCode.apply(String, m);
|
|
11594
|
+
for (var g = "", S = 0; S < f; )
|
|
11595
|
+
g += String.fromCharCode.apply(
|
|
11596
11596
|
String,
|
|
11597
|
-
|
|
11597
|
+
m.slice(S, S += K)
|
|
11598
11598
|
);
|
|
11599
|
-
return
|
|
11599
|
+
return g;
|
|
11600
11600
|
}
|
|
11601
|
-
function ae(
|
|
11601
|
+
function ae(m, f, g) {
|
|
11602
11602
|
var S = "";
|
|
11603
|
-
|
|
11604
|
-
for (var T = f; T <
|
|
11605
|
-
S += String.fromCharCode(
|
|
11603
|
+
g = Math.min(m.length, g);
|
|
11604
|
+
for (var T = f; T < g; ++T)
|
|
11605
|
+
S += String.fromCharCode(m[T] & 127);
|
|
11606
11606
|
return S;
|
|
11607
11607
|
}
|
|
11608
|
-
function ue(
|
|
11608
|
+
function ue(m, f, g) {
|
|
11609
11609
|
var S = "";
|
|
11610
|
-
|
|
11611
|
-
for (var T = f; T <
|
|
11612
|
-
S += String.fromCharCode(
|
|
11610
|
+
g = Math.min(m.length, g);
|
|
11611
|
+
for (var T = f; T < g; ++T)
|
|
11612
|
+
S += String.fromCharCode(m[T]);
|
|
11613
11613
|
return S;
|
|
11614
11614
|
}
|
|
11615
|
-
function oe(
|
|
11616
|
-
var S =
|
|
11617
|
-
(!f || f < 0) && (f = 0), (!
|
|
11618
|
-
for (var T = "", L = f; L <
|
|
11619
|
-
T += ts[
|
|
11615
|
+
function oe(m, f, g) {
|
|
11616
|
+
var S = m.length;
|
|
11617
|
+
(!f || f < 0) && (f = 0), (!g || g < 0 || g > S) && (g = S);
|
|
11618
|
+
for (var T = "", L = f; L < g; ++L)
|
|
11619
|
+
T += ts[m[L]];
|
|
11620
11620
|
return T;
|
|
11621
11621
|
}
|
|
11622
|
-
function fe(
|
|
11623
|
-
for (var S =
|
|
11622
|
+
function fe(m, f, g) {
|
|
11623
|
+
for (var S = m.slice(f, g), T = "", L = 0; L < S.length - 1; L += 2)
|
|
11624
11624
|
T += String.fromCharCode(S[L] + S[L + 1] * 256);
|
|
11625
11625
|
return T;
|
|
11626
11626
|
}
|
|
11627
|
-
o.prototype.slice = function(f,
|
|
11627
|
+
o.prototype.slice = function(f, g) {
|
|
11628
11628
|
var S = this.length;
|
|
11629
|
-
f = ~~f,
|
|
11630
|
-
var T = this.subarray(f,
|
|
11629
|
+
f = ~~f, g = g === void 0 ? S : ~~g, f < 0 ? (f += S, f < 0 && (f = 0)) : f > S && (f = S), g < 0 ? (g += S, g < 0 && (g = 0)) : g > S && (g = S), g < f && (g = f);
|
|
11630
|
+
var T = this.subarray(f, g);
|
|
11631
11631
|
return Object.setPrototypeOf(T, o.prototype), T;
|
|
11632
11632
|
};
|
|
11633
|
-
function G(
|
|
11634
|
-
if (
|
|
11635
|
-
if (
|
|
11633
|
+
function G(m, f, g) {
|
|
11634
|
+
if (m % 1 !== 0 || m < 0) throw new RangeError("offset is not uint");
|
|
11635
|
+
if (m + f > g) throw new RangeError("Trying to access beyond buffer length");
|
|
11636
11636
|
}
|
|
11637
|
-
o.prototype.readUintLE = o.prototype.readUIntLE = function(f,
|
|
11638
|
-
f = f >>> 0,
|
|
11639
|
-
for (var T = this[f], L = 1, A = 0; ++A <
|
|
11637
|
+
o.prototype.readUintLE = o.prototype.readUIntLE = function(f, g, S) {
|
|
11638
|
+
f = f >>> 0, g = g >>> 0, S || G(f, g, this.length);
|
|
11639
|
+
for (var T = this[f], L = 1, A = 0; ++A < g && (L *= 256); )
|
|
11640
11640
|
T += this[f + A] * L;
|
|
11641
11641
|
return T;
|
|
11642
|
-
}, o.prototype.readUintBE = o.prototype.readUIntBE = function(f,
|
|
11643
|
-
f = f >>> 0,
|
|
11644
|
-
for (var T = this[f + --
|
|
11645
|
-
T += this[f + --
|
|
11642
|
+
}, o.prototype.readUintBE = o.prototype.readUIntBE = function(f, g, S) {
|
|
11643
|
+
f = f >>> 0, g = g >>> 0, S || G(f, g, this.length);
|
|
11644
|
+
for (var T = this[f + --g], L = 1; g > 0 && (L *= 256); )
|
|
11645
|
+
T += this[f + --g] * L;
|
|
11646
11646
|
return T;
|
|
11647
|
-
}, o.prototype.readUint8 = o.prototype.readUInt8 = function(f,
|
|
11648
|
-
return f = f >>> 0,
|
|
11649
|
-
}, o.prototype.readUint16LE = o.prototype.readUInt16LE = function(f,
|
|
11650
|
-
return f = f >>> 0,
|
|
11651
|
-
}, o.prototype.readUint16BE = o.prototype.readUInt16BE = function(f,
|
|
11652
|
-
return f = f >>> 0,
|
|
11653
|
-
}, o.prototype.readUint32LE = o.prototype.readUInt32LE = function(f,
|
|
11654
|
-
return f = f >>> 0,
|
|
11655
|
-
}, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(f,
|
|
11656
|
-
return f = f >>> 0,
|
|
11657
|
-
}, o.prototype.readIntLE = function(f,
|
|
11658
|
-
f = f >>> 0,
|
|
11659
|
-
for (var T = this[f], L = 1, A = 0; ++A <
|
|
11647
|
+
}, o.prototype.readUint8 = o.prototype.readUInt8 = function(f, g) {
|
|
11648
|
+
return f = f >>> 0, g || G(f, 1, this.length), this[f];
|
|
11649
|
+
}, o.prototype.readUint16LE = o.prototype.readUInt16LE = function(f, g) {
|
|
11650
|
+
return f = f >>> 0, g || G(f, 2, this.length), this[f] | this[f + 1] << 8;
|
|
11651
|
+
}, o.prototype.readUint16BE = o.prototype.readUInt16BE = function(f, g) {
|
|
11652
|
+
return f = f >>> 0, g || G(f, 2, this.length), this[f] << 8 | this[f + 1];
|
|
11653
|
+
}, o.prototype.readUint32LE = o.prototype.readUInt32LE = function(f, g) {
|
|
11654
|
+
return f = f >>> 0, g || G(f, 4, this.length), (this[f] | this[f + 1] << 8 | this[f + 2] << 16) + this[f + 3] * 16777216;
|
|
11655
|
+
}, o.prototype.readUint32BE = o.prototype.readUInt32BE = function(f, g) {
|
|
11656
|
+
return f = f >>> 0, g || G(f, 4, this.length), this[f] * 16777216 + (this[f + 1] << 16 | this[f + 2] << 8 | this[f + 3]);
|
|
11657
|
+
}, o.prototype.readIntLE = function(f, g, S) {
|
|
11658
|
+
f = f >>> 0, g = g >>> 0, S || G(f, g, this.length);
|
|
11659
|
+
for (var T = this[f], L = 1, A = 0; ++A < g && (L *= 256); )
|
|
11660
11660
|
T += this[f + A] * L;
|
|
11661
|
-
return L *= 128, T >= L && (T -= Math.pow(2, 8 *
|
|
11662
|
-
}, o.prototype.readIntBE = function(f,
|
|
11663
|
-
f = f >>> 0,
|
|
11664
|
-
for (var T =
|
|
11661
|
+
return L *= 128, T >= L && (T -= Math.pow(2, 8 * g)), T;
|
|
11662
|
+
}, o.prototype.readIntBE = function(f, g, S) {
|
|
11663
|
+
f = f >>> 0, g = g >>> 0, S || G(f, g, this.length);
|
|
11664
|
+
for (var T = g, L = 1, A = this[f + --T]; T > 0 && (L *= 256); )
|
|
11665
11665
|
A += this[f + --T] * L;
|
|
11666
|
-
return L *= 128, A >= L && (A -= Math.pow(2, 8 *
|
|
11667
|
-
}, o.prototype.readInt8 = function(f,
|
|
11668
|
-
return f = f >>> 0,
|
|
11669
|
-
}, o.prototype.readInt16LE = function(f,
|
|
11670
|
-
f = f >>> 0,
|
|
11666
|
+
return L *= 128, A >= L && (A -= Math.pow(2, 8 * g)), A;
|
|
11667
|
+
}, o.prototype.readInt8 = function(f, g) {
|
|
11668
|
+
return f = f >>> 0, g || G(f, 1, this.length), this[f] & 128 ? (255 - this[f] + 1) * -1 : this[f];
|
|
11669
|
+
}, o.prototype.readInt16LE = function(f, g) {
|
|
11670
|
+
f = f >>> 0, g || G(f, 2, this.length);
|
|
11671
11671
|
var S = this[f] | this[f + 1] << 8;
|
|
11672
11672
|
return S & 32768 ? S | 4294901760 : S;
|
|
11673
|
-
}, o.prototype.readInt16BE = function(f,
|
|
11674
|
-
f = f >>> 0,
|
|
11673
|
+
}, o.prototype.readInt16BE = function(f, g) {
|
|
11674
|
+
f = f >>> 0, g || G(f, 2, this.length);
|
|
11675
11675
|
var S = this[f + 1] | this[f] << 8;
|
|
11676
11676
|
return S & 32768 ? S | 4294901760 : S;
|
|
11677
|
-
}, o.prototype.readInt32LE = function(f,
|
|
11678
|
-
return f = f >>> 0,
|
|
11679
|
-
}, o.prototype.readInt32BE = function(f,
|
|
11680
|
-
return f = f >>> 0,
|
|
11681
|
-
}, o.prototype.readFloatLE = function(f,
|
|
11682
|
-
return f = f >>> 0,
|
|
11683
|
-
}, o.prototype.readFloatBE = function(f,
|
|
11684
|
-
return f = f >>> 0,
|
|
11685
|
-
}, o.prototype.readDoubleLE = function(f,
|
|
11686
|
-
return f = f >>> 0,
|
|
11687
|
-
}, o.prototype.readDoubleBE = function(f,
|
|
11688
|
-
return f = f >>> 0,
|
|
11677
|
+
}, o.prototype.readInt32LE = function(f, g) {
|
|
11678
|
+
return f = f >>> 0, g || G(f, 4, this.length), this[f] | this[f + 1] << 8 | this[f + 2] << 16 | this[f + 3] << 24;
|
|
11679
|
+
}, o.prototype.readInt32BE = function(f, g) {
|
|
11680
|
+
return f = f >>> 0, g || G(f, 4, this.length), this[f] << 24 | this[f + 1] << 16 | this[f + 2] << 8 | this[f + 3];
|
|
11681
|
+
}, o.prototype.readFloatLE = function(f, g) {
|
|
11682
|
+
return f = f >>> 0, g || G(f, 4, this.length), r.read(this, f, !0, 23, 4);
|
|
11683
|
+
}, o.prototype.readFloatBE = function(f, g) {
|
|
11684
|
+
return f = f >>> 0, g || G(f, 4, this.length), r.read(this, f, !1, 23, 4);
|
|
11685
|
+
}, o.prototype.readDoubleLE = function(f, g) {
|
|
11686
|
+
return f = f >>> 0, g || G(f, 8, this.length), r.read(this, f, !0, 52, 8);
|
|
11687
|
+
}, o.prototype.readDoubleBE = function(f, g) {
|
|
11688
|
+
return f = f >>> 0, g || G(f, 8, this.length), r.read(this, f, !1, 52, 8);
|
|
11689
11689
|
};
|
|
11690
|
-
function q(
|
|
11691
|
-
if (!o.isBuffer(
|
|
11690
|
+
function q(m, f, g, S, T, L) {
|
|
11691
|
+
if (!o.isBuffer(m)) throw new TypeError('"buffer" argument must be a Buffer instance');
|
|
11692
11692
|
if (f > T || f < L) throw new RangeError('"value" argument is out of bounds');
|
|
11693
|
-
if (
|
|
11693
|
+
if (g + S > m.length) throw new RangeError("Index out of range");
|
|
11694
11694
|
}
|
|
11695
|
-
o.prototype.writeUintLE = o.prototype.writeUIntLE = function(f,
|
|
11696
|
-
if (f = +f,
|
|
11695
|
+
o.prototype.writeUintLE = o.prototype.writeUIntLE = function(f, g, S, T) {
|
|
11696
|
+
if (f = +f, g = g >>> 0, S = S >>> 0, !T) {
|
|
11697
11697
|
var L = Math.pow(2, 8 * S) - 1;
|
|
11698
|
-
q(this, f,
|
|
11698
|
+
q(this, f, g, S, L, 0);
|
|
11699
11699
|
}
|
|
11700
11700
|
var A = 1, V = 0;
|
|
11701
|
-
for (this[
|
|
11702
|
-
this[
|
|
11703
|
-
return
|
|
11704
|
-
}, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(f,
|
|
11705
|
-
if (f = +f,
|
|
11701
|
+
for (this[g] = f & 255; ++V < S && (A *= 256); )
|
|
11702
|
+
this[g + V] = f / A & 255;
|
|
11703
|
+
return g + S;
|
|
11704
|
+
}, o.prototype.writeUintBE = o.prototype.writeUIntBE = function(f, g, S, T) {
|
|
11705
|
+
if (f = +f, g = g >>> 0, S = S >>> 0, !T) {
|
|
11706
11706
|
var L = Math.pow(2, 8 * S) - 1;
|
|
11707
|
-
q(this, f,
|
|
11707
|
+
q(this, f, g, S, L, 0);
|
|
11708
11708
|
}
|
|
11709
11709
|
var A = S - 1, V = 1;
|
|
11710
|
-
for (this[
|
|
11711
|
-
this[
|
|
11712
|
-
return
|
|
11713
|
-
}, o.prototype.writeUint8 = o.prototype.writeUInt8 = function(f,
|
|
11714
|
-
return f = +f,
|
|
11715
|
-
}, o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function(f,
|
|
11716
|
-
return f = +f,
|
|
11717
|
-
}, o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function(f,
|
|
11718
|
-
return f = +f,
|
|
11719
|
-
}, o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function(f,
|
|
11720
|
-
return f = +f,
|
|
11721
|
-
}, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(f,
|
|
11722
|
-
return f = +f,
|
|
11723
|
-
}, o.prototype.writeIntLE = function(f,
|
|
11724
|
-
if (f = +f,
|
|
11710
|
+
for (this[g + A] = f & 255; --A >= 0 && (V *= 256); )
|
|
11711
|
+
this[g + A] = f / V & 255;
|
|
11712
|
+
return g + S;
|
|
11713
|
+
}, o.prototype.writeUint8 = o.prototype.writeUInt8 = function(f, g, S) {
|
|
11714
|
+
return f = +f, g = g >>> 0, S || q(this, f, g, 1, 255, 0), this[g] = f & 255, g + 1;
|
|
11715
|
+
}, o.prototype.writeUint16LE = o.prototype.writeUInt16LE = function(f, g, S) {
|
|
11716
|
+
return f = +f, g = g >>> 0, S || q(this, f, g, 2, 65535, 0), this[g] = f & 255, this[g + 1] = f >>> 8, g + 2;
|
|
11717
|
+
}, o.prototype.writeUint16BE = o.prototype.writeUInt16BE = function(f, g, S) {
|
|
11718
|
+
return f = +f, g = g >>> 0, S || q(this, f, g, 2, 65535, 0), this[g] = f >>> 8, this[g + 1] = f & 255, g + 2;
|
|
11719
|
+
}, o.prototype.writeUint32LE = o.prototype.writeUInt32LE = function(f, g, S) {
|
|
11720
|
+
return f = +f, g = g >>> 0, S || q(this, f, g, 4, 4294967295, 0), this[g + 3] = f >>> 24, this[g + 2] = f >>> 16, this[g + 1] = f >>> 8, this[g] = f & 255, g + 4;
|
|
11721
|
+
}, o.prototype.writeUint32BE = o.prototype.writeUInt32BE = function(f, g, S) {
|
|
11722
|
+
return f = +f, g = g >>> 0, S || q(this, f, g, 4, 4294967295, 0), this[g] = f >>> 24, this[g + 1] = f >>> 16, this[g + 2] = f >>> 8, this[g + 3] = f & 255, g + 4;
|
|
11723
|
+
}, o.prototype.writeIntLE = function(f, g, S, T) {
|
|
11724
|
+
if (f = +f, g = g >>> 0, !T) {
|
|
11725
11725
|
var L = Math.pow(2, 8 * S - 1);
|
|
11726
|
-
q(this, f,
|
|
11726
|
+
q(this, f, g, S, L - 1, -L);
|
|
11727
11727
|
}
|
|
11728
11728
|
var A = 0, V = 1, Y = 0;
|
|
11729
|
-
for (this[
|
|
11730
|
-
f < 0 && Y === 0 && this[
|
|
11731
|
-
return
|
|
11732
|
-
}, o.prototype.writeIntBE = function(f,
|
|
11733
|
-
if (f = +f,
|
|
11729
|
+
for (this[g] = f & 255; ++A < S && (V *= 256); )
|
|
11730
|
+
f < 0 && Y === 0 && this[g + A - 1] !== 0 && (Y = 1), this[g + A] = (f / V >> 0) - Y & 255;
|
|
11731
|
+
return g + S;
|
|
11732
|
+
}, o.prototype.writeIntBE = function(f, g, S, T) {
|
|
11733
|
+
if (f = +f, g = g >>> 0, !T) {
|
|
11734
11734
|
var L = Math.pow(2, 8 * S - 1);
|
|
11735
|
-
q(this, f,
|
|
11735
|
+
q(this, f, g, S, L - 1, -L);
|
|
11736
11736
|
}
|
|
11737
11737
|
var A = S - 1, V = 1, Y = 0;
|
|
11738
|
-
for (this[
|
|
11739
|
-
f < 0 && Y === 0 && this[
|
|
11740
|
-
return
|
|
11741
|
-
}, o.prototype.writeInt8 = function(f,
|
|
11742
|
-
return f = +f,
|
|
11743
|
-
}, o.prototype.writeInt16LE = function(f,
|
|
11744
|
-
return f = +f,
|
|
11745
|
-
}, o.prototype.writeInt16BE = function(f,
|
|
11746
|
-
return f = +f,
|
|
11747
|
-
}, o.prototype.writeInt32LE = function(f,
|
|
11748
|
-
return f = +f,
|
|
11749
|
-
}, o.prototype.writeInt32BE = function(f,
|
|
11750
|
-
return f = +f,
|
|
11738
|
+
for (this[g + A] = f & 255; --A >= 0 && (V *= 256); )
|
|
11739
|
+
f < 0 && Y === 0 && this[g + A + 1] !== 0 && (Y = 1), this[g + A] = (f / V >> 0) - Y & 255;
|
|
11740
|
+
return g + S;
|
|
11741
|
+
}, o.prototype.writeInt8 = function(f, g, S) {
|
|
11742
|
+
return f = +f, g = g >>> 0, S || q(this, f, g, 1, 127, -128), f < 0 && (f = 255 + f + 1), this[g] = f & 255, g + 1;
|
|
11743
|
+
}, o.prototype.writeInt16LE = function(f, g, S) {
|
|
11744
|
+
return f = +f, g = g >>> 0, S || q(this, f, g, 2, 32767, -32768), this[g] = f & 255, this[g + 1] = f >>> 8, g + 2;
|
|
11745
|
+
}, o.prototype.writeInt16BE = function(f, g, S) {
|
|
11746
|
+
return f = +f, g = g >>> 0, S || q(this, f, g, 2, 32767, -32768), this[g] = f >>> 8, this[g + 1] = f & 255, g + 2;
|
|
11747
|
+
}, o.prototype.writeInt32LE = function(f, g, S) {
|
|
11748
|
+
return f = +f, g = g >>> 0, S || q(this, f, g, 4, 2147483647, -2147483648), this[g] = f & 255, this[g + 1] = f >>> 8, this[g + 2] = f >>> 16, this[g + 3] = f >>> 24, g + 4;
|
|
11749
|
+
}, o.prototype.writeInt32BE = function(f, g, S) {
|
|
11750
|
+
return f = +f, g = g >>> 0, S || q(this, f, g, 4, 2147483647, -2147483648), f < 0 && (f = 4294967295 + f + 1), this[g] = f >>> 24, this[g + 1] = f >>> 16, this[g + 2] = f >>> 8, this[g + 3] = f & 255, g + 4;
|
|
11751
11751
|
};
|
|
11752
|
-
function ut(
|
|
11753
|
-
if (
|
|
11754
|
-
if (
|
|
11752
|
+
function ut(m, f, g, S, T, L) {
|
|
11753
|
+
if (g + S > m.length) throw new RangeError("Index out of range");
|
|
11754
|
+
if (g < 0) throw new RangeError("Index out of range");
|
|
11755
11755
|
}
|
|
11756
|
-
function _t(
|
|
11757
|
-
return f = +f,
|
|
11756
|
+
function _t(m, f, g, S, T) {
|
|
11757
|
+
return f = +f, g = g >>> 0, T || ut(m, f, g, 4), r.write(m, f, g, S, 23, 4), g + 4;
|
|
11758
11758
|
}
|
|
11759
|
-
o.prototype.writeFloatLE = function(f,
|
|
11760
|
-
return _t(this, f,
|
|
11761
|
-
}, o.prototype.writeFloatBE = function(f,
|
|
11762
|
-
return _t(this, f,
|
|
11759
|
+
o.prototype.writeFloatLE = function(f, g, S) {
|
|
11760
|
+
return _t(this, f, g, !0, S);
|
|
11761
|
+
}, o.prototype.writeFloatBE = function(f, g, S) {
|
|
11762
|
+
return _t(this, f, g, !1, S);
|
|
11763
11763
|
};
|
|
11764
|
-
function Pt(
|
|
11765
|
-
return f = +f,
|
|
11766
|
-
}
|
|
11767
|
-
o.prototype.writeDoubleLE = function(f,
|
|
11768
|
-
return Pt(this, f,
|
|
11769
|
-
}, o.prototype.writeDoubleBE = function(f,
|
|
11770
|
-
return Pt(this, f,
|
|
11771
|
-
}, o.prototype.copy = function(f,
|
|
11764
|
+
function Pt(m, f, g, S, T) {
|
|
11765
|
+
return f = +f, g = g >>> 0, T || ut(m, f, g, 8), r.write(m, f, g, S, 52, 8), g + 8;
|
|
11766
|
+
}
|
|
11767
|
+
o.prototype.writeDoubleLE = function(f, g, S) {
|
|
11768
|
+
return Pt(this, f, g, !0, S);
|
|
11769
|
+
}, o.prototype.writeDoubleBE = function(f, g, S) {
|
|
11770
|
+
return Pt(this, f, g, !1, S);
|
|
11771
|
+
}, o.prototype.copy = function(f, g, S, T) {
|
|
11772
11772
|
if (!o.isBuffer(f)) throw new TypeError("argument should be a Buffer");
|
|
11773
|
-
if (S || (S = 0), !T && T !== 0 && (T = this.length),
|
|
11774
|
-
if (
|
|
11773
|
+
if (S || (S = 0), !T && T !== 0 && (T = this.length), g >= f.length && (g = f.length), g || (g = 0), T > 0 && T < S && (T = S), T === S || f.length === 0 || this.length === 0) return 0;
|
|
11774
|
+
if (g < 0)
|
|
11775
11775
|
throw new RangeError("targetStart out of bounds");
|
|
11776
11776
|
if (S < 0 || S >= this.length) throw new RangeError("Index out of range");
|
|
11777
11777
|
if (T < 0) throw new RangeError("sourceEnd out of bounds");
|
|
11778
|
-
T > this.length && (T = this.length), f.length -
|
|
11778
|
+
T > this.length && (T = this.length), f.length - g < T - S && (T = f.length - g + S);
|
|
11779
11779
|
var L = T - S;
|
|
11780
|
-
return this === f && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(
|
|
11780
|
+
return this === f && typeof Uint8Array.prototype.copyWithin == "function" ? this.copyWithin(g, S, T) : Uint8Array.prototype.set.call(
|
|
11781
11781
|
f,
|
|
11782
11782
|
this.subarray(S, T),
|
|
11783
|
-
|
|
11783
|
+
g
|
|
11784
11784
|
), L;
|
|
11785
|
-
}, o.prototype.fill = function(f,
|
|
11785
|
+
}, o.prototype.fill = function(f, g, S, T) {
|
|
11786
11786
|
if (typeof f == "string") {
|
|
11787
|
-
if (typeof
|
|
11787
|
+
if (typeof g == "string" ? (T = g, g = 0, S = this.length) : typeof S == "string" && (T = S, S = this.length), T !== void 0 && typeof T != "string")
|
|
11788
11788
|
throw new TypeError("encoding must be a string");
|
|
11789
11789
|
if (typeof T == "string" && !o.isEncoding(T))
|
|
11790
11790
|
throw new TypeError("Unknown encoding: " + T);
|
|
@@ -11793,109 +11793,109 @@ yn.write = function(t, e, r, n, a, i) {
|
|
|
11793
11793
|
(T === "utf8" && L < 128 || T === "latin1") && (f = L);
|
|
11794
11794
|
}
|
|
11795
11795
|
} else typeof f == "number" ? f = f & 255 : typeof f == "boolean" && (f = Number(f));
|
|
11796
|
-
if (
|
|
11796
|
+
if (g < 0 || this.length < g || this.length < S)
|
|
11797
11797
|
throw new RangeError("Out of range index");
|
|
11798
|
-
if (S <=
|
|
11798
|
+
if (S <= g)
|
|
11799
11799
|
return this;
|
|
11800
|
-
|
|
11800
|
+
g = g >>> 0, S = S === void 0 ? this.length : S >>> 0, f || (f = 0);
|
|
11801
11801
|
var A;
|
|
11802
11802
|
if (typeof f == "number")
|
|
11803
|
-
for (A =
|
|
11803
|
+
for (A = g; A < S; ++A)
|
|
11804
11804
|
this[A] = f;
|
|
11805
11805
|
else {
|
|
11806
11806
|
var V = o.isBuffer(f) ? f : o.from(f, T), Y = V.length;
|
|
11807
11807
|
if (Y === 0)
|
|
11808
11808
|
throw new TypeError('The value "' + f + '" is invalid for argument "value"');
|
|
11809
|
-
for (A = 0; A < S -
|
|
11810
|
-
this[A +
|
|
11809
|
+
for (A = 0; A < S - g; ++A)
|
|
11810
|
+
this[A + g] = V[A % Y];
|
|
11811
11811
|
}
|
|
11812
11812
|
return this;
|
|
11813
11813
|
};
|
|
11814
11814
|
var xt = /[^+/0-9A-Za-z-_]/g;
|
|
11815
|
-
function Nt(
|
|
11816
|
-
if (
|
|
11817
|
-
for (;
|
|
11818
|
-
|
|
11819
|
-
return
|
|
11815
|
+
function Nt(m) {
|
|
11816
|
+
if (m = m.split("=")[0], m = m.trim().replace(xt, ""), m.length < 2) return "";
|
|
11817
|
+
for (; m.length % 4 !== 0; )
|
|
11818
|
+
m = m + "=";
|
|
11819
|
+
return m;
|
|
11820
11820
|
}
|
|
11821
|
-
function ze(
|
|
11821
|
+
function ze(m, f) {
|
|
11822
11822
|
f = f || 1 / 0;
|
|
11823
|
-
for (var
|
|
11824
|
-
if (
|
|
11823
|
+
for (var g, S = m.length, T = null, L = [], A = 0; A < S; ++A) {
|
|
11824
|
+
if (g = m.charCodeAt(A), g > 55295 && g < 57344) {
|
|
11825
11825
|
if (!T) {
|
|
11826
|
-
if (
|
|
11826
|
+
if (g > 56319) {
|
|
11827
11827
|
(f -= 3) > -1 && L.push(239, 191, 189);
|
|
11828
11828
|
continue;
|
|
11829
11829
|
} else if (A + 1 === S) {
|
|
11830
11830
|
(f -= 3) > -1 && L.push(239, 191, 189);
|
|
11831
11831
|
continue;
|
|
11832
11832
|
}
|
|
11833
|
-
T =
|
|
11833
|
+
T = g;
|
|
11834
11834
|
continue;
|
|
11835
11835
|
}
|
|
11836
|
-
if (
|
|
11837
|
-
(f -= 3) > -1 && L.push(239, 191, 189), T =
|
|
11836
|
+
if (g < 56320) {
|
|
11837
|
+
(f -= 3) > -1 && L.push(239, 191, 189), T = g;
|
|
11838
11838
|
continue;
|
|
11839
11839
|
}
|
|
11840
|
-
|
|
11840
|
+
g = (T - 55296 << 10 | g - 56320) + 65536;
|
|
11841
11841
|
} else T && (f -= 3) > -1 && L.push(239, 191, 189);
|
|
11842
|
-
if (T = null,
|
|
11842
|
+
if (T = null, g < 128) {
|
|
11843
11843
|
if ((f -= 1) < 0) break;
|
|
11844
|
-
L.push(
|
|
11845
|
-
} else if (
|
|
11844
|
+
L.push(g);
|
|
11845
|
+
} else if (g < 2048) {
|
|
11846
11846
|
if ((f -= 2) < 0) break;
|
|
11847
11847
|
L.push(
|
|
11848
|
-
|
|
11849
|
-
|
|
11848
|
+
g >> 6 | 192,
|
|
11849
|
+
g & 63 | 128
|
|
11850
11850
|
);
|
|
11851
|
-
} else if (
|
|
11851
|
+
} else if (g < 65536) {
|
|
11852
11852
|
if ((f -= 3) < 0) break;
|
|
11853
11853
|
L.push(
|
|
11854
|
-
|
|
11855
|
-
|
|
11856
|
-
|
|
11854
|
+
g >> 12 | 224,
|
|
11855
|
+
g >> 6 & 63 | 128,
|
|
11856
|
+
g & 63 | 128
|
|
11857
11857
|
);
|
|
11858
|
-
} else if (
|
|
11858
|
+
} else if (g < 1114112) {
|
|
11859
11859
|
if ((f -= 4) < 0) break;
|
|
11860
11860
|
L.push(
|
|
11861
|
-
|
|
11862
|
-
|
|
11863
|
-
|
|
11864
|
-
|
|
11861
|
+
g >> 18 | 240,
|
|
11862
|
+
g >> 12 & 63 | 128,
|
|
11863
|
+
g >> 6 & 63 | 128,
|
|
11864
|
+
g & 63 | 128
|
|
11865
11865
|
);
|
|
11866
11866
|
} else
|
|
11867
11867
|
throw new Error("Invalid code point");
|
|
11868
11868
|
}
|
|
11869
11869
|
return L;
|
|
11870
11870
|
}
|
|
11871
|
-
function Ji(
|
|
11872
|
-
for (var f = [],
|
|
11873
|
-
f.push(
|
|
11871
|
+
function Ji(m) {
|
|
11872
|
+
for (var f = [], g = 0; g < m.length; ++g)
|
|
11873
|
+
f.push(m.charCodeAt(g) & 255);
|
|
11874
11874
|
return f;
|
|
11875
11875
|
}
|
|
11876
|
-
function es(
|
|
11877
|
-
for (var
|
|
11878
|
-
|
|
11876
|
+
function es(m, f) {
|
|
11877
|
+
for (var g, S, T, L = [], A = 0; A < m.length && !((f -= 2) < 0); ++A)
|
|
11878
|
+
g = m.charCodeAt(A), S = g >> 8, T = g % 256, L.push(T), L.push(S);
|
|
11879
11879
|
return L;
|
|
11880
11880
|
}
|
|
11881
|
-
function Fn(
|
|
11882
|
-
return e.toByteArray(Nt(
|
|
11881
|
+
function Fn(m) {
|
|
11882
|
+
return e.toByteArray(Nt(m));
|
|
11883
11883
|
}
|
|
11884
|
-
function Gt(
|
|
11885
|
-
for (var T = 0; T < S && !(T +
|
|
11886
|
-
f[T +
|
|
11884
|
+
function Gt(m, f, g, S) {
|
|
11885
|
+
for (var T = 0; T < S && !(T + g >= f.length || T >= m.length); ++T)
|
|
11886
|
+
f[T + g] = m[T];
|
|
11887
11887
|
return T;
|
|
11888
11888
|
}
|
|
11889
|
-
function Be(
|
|
11890
|
-
return
|
|
11889
|
+
function Be(m, f) {
|
|
11890
|
+
return m instanceof f || m != null && m.constructor != null && m.constructor.name != null && m.constructor.name === f.name;
|
|
11891
11891
|
}
|
|
11892
|
-
function pr(
|
|
11893
|
-
return
|
|
11892
|
+
function pr(m) {
|
|
11893
|
+
return m !== m;
|
|
11894
11894
|
}
|
|
11895
11895
|
var ts = function() {
|
|
11896
|
-
for (var
|
|
11897
|
-
for (var S =
|
|
11898
|
-
f[S + T] =
|
|
11896
|
+
for (var m = "0123456789abcdef", f = new Array(256), g = 0; g < 16; ++g)
|
|
11897
|
+
for (var S = g * 16, T = 0; T < 16; ++T)
|
|
11898
|
+
f[S + T] = m[g] + m[T];
|
|
11899
11899
|
return f;
|
|
11900
11900
|
}();
|
|
11901
11901
|
})(vn);
|
|
@@ -11994,8 +11994,8 @@ var Ea;
|
|
|
11994
11994
|
function xl() {
|
|
11995
11995
|
if (Ea) return Ar;
|
|
11996
11996
|
Ea = 1;
|
|
11997
|
-
var t = ml().Buffer, e = t.isEncoding || function(
|
|
11998
|
-
switch (
|
|
11997
|
+
var t = ml().Buffer, e = t.isEncoding || function(y) {
|
|
11998
|
+
switch (y = "" + y, y && y.toLowerCase()) {
|
|
11999
11999
|
case "hex":
|
|
12000
12000
|
case "utf8":
|
|
12001
12001
|
case "utf-8":
|
|
@@ -12012,10 +12012,10 @@ function xl() {
|
|
|
12012
12012
|
return !1;
|
|
12013
12013
|
}
|
|
12014
12014
|
};
|
|
12015
|
-
function r(
|
|
12016
|
-
if (!
|
|
12015
|
+
function r(y) {
|
|
12016
|
+
if (!y) return "utf8";
|
|
12017
12017
|
for (var F; ; )
|
|
12018
|
-
switch (
|
|
12018
|
+
switch (y) {
|
|
12019
12019
|
case "utf8":
|
|
12020
12020
|
case "utf-8":
|
|
12021
12021
|
return "utf8";
|
|
@@ -12030,30 +12030,30 @@ function xl() {
|
|
|
12030
12030
|
case "base64":
|
|
12031
12031
|
case "ascii":
|
|
12032
12032
|
case "hex":
|
|
12033
|
-
return
|
|
12033
|
+
return y;
|
|
12034
12034
|
default:
|
|
12035
12035
|
if (F) return;
|
|
12036
|
-
|
|
12036
|
+
y = ("" + y).toLowerCase(), F = !0;
|
|
12037
12037
|
}
|
|
12038
12038
|
}
|
|
12039
|
-
function n(
|
|
12040
|
-
var F = r(
|
|
12041
|
-
if (typeof F != "string" && (t.isEncoding === e || !e(
|
|
12042
|
-
return F ||
|
|
12039
|
+
function n(y) {
|
|
12040
|
+
var F = r(y);
|
|
12041
|
+
if (typeof F != "string" && (t.isEncoding === e || !e(y))) throw new Error("Unknown encoding: " + y);
|
|
12042
|
+
return F || y;
|
|
12043
12043
|
}
|
|
12044
12044
|
Ar.StringDecoder = a;
|
|
12045
|
-
function a(
|
|
12046
|
-
this.encoding = n(
|
|
12045
|
+
function a(y) {
|
|
12046
|
+
this.encoding = n(y);
|
|
12047
12047
|
var F;
|
|
12048
12048
|
switch (this.encoding) {
|
|
12049
12049
|
case "utf16le":
|
|
12050
|
-
this.text =
|
|
12050
|
+
this.text = d, this.end = l, F = 4;
|
|
12051
12051
|
break;
|
|
12052
12052
|
case "utf8":
|
|
12053
12053
|
this.fillLast = c, F = 4;
|
|
12054
12054
|
break;
|
|
12055
12055
|
case "base64":
|
|
12056
|
-
this.text =
|
|
12056
|
+
this.text = p, this.end = x, F = 3;
|
|
12057
12057
|
break;
|
|
12058
12058
|
default:
|
|
12059
12059
|
this.write = v, this.end = b;
|
|
@@ -12061,90 +12061,90 @@ function xl() {
|
|
|
12061
12061
|
}
|
|
12062
12062
|
this.lastNeed = 0, this.lastTotal = 0, this.lastChar = t.allocUnsafe(F);
|
|
12063
12063
|
}
|
|
12064
|
-
a.prototype.write = function(
|
|
12065
|
-
if (
|
|
12064
|
+
a.prototype.write = function(y) {
|
|
12065
|
+
if (y.length === 0) return "";
|
|
12066
12066
|
var F, w;
|
|
12067
12067
|
if (this.lastNeed) {
|
|
12068
|
-
if (F = this.fillLast(
|
|
12068
|
+
if (F = this.fillLast(y), F === void 0) return "";
|
|
12069
12069
|
w = this.lastNeed, this.lastNeed = 0;
|
|
12070
12070
|
} else
|
|
12071
12071
|
w = 0;
|
|
12072
|
-
return w <
|
|
12073
|
-
}, a.prototype.end = h, a.prototype.text = u, a.prototype.fillLast = function(
|
|
12074
|
-
if (this.lastNeed <=
|
|
12075
|
-
return
|
|
12076
|
-
|
|
12072
|
+
return w < y.length ? F ? F + this.text(y, w) : this.text(y, w) : F || "";
|
|
12073
|
+
}, a.prototype.end = h, a.prototype.text = u, a.prototype.fillLast = function(y) {
|
|
12074
|
+
if (this.lastNeed <= y.length)
|
|
12075
|
+
return y.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
12076
|
+
y.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, y.length), this.lastNeed -= y.length;
|
|
12077
12077
|
};
|
|
12078
|
-
function i(
|
|
12079
|
-
return
|
|
12078
|
+
function i(y) {
|
|
12079
|
+
return y <= 127 ? 0 : y >> 5 === 6 ? 2 : y >> 4 === 14 ? 3 : y >> 3 === 30 ? 4 : y >> 6 === 2 ? -1 : -2;
|
|
12080
12080
|
}
|
|
12081
|
-
function s(
|
|
12081
|
+
function s(y, F, w) {
|
|
12082
12082
|
var k = F.length - 1;
|
|
12083
12083
|
if (k < w) return 0;
|
|
12084
12084
|
var C = i(F[k]);
|
|
12085
|
-
return C >= 0 ? (C > 0 && (
|
|
12085
|
+
return C >= 0 ? (C > 0 && (y.lastNeed = C - 1), C) : --k < w || C === -2 ? 0 : (C = i(F[k]), C >= 0 ? (C > 0 && (y.lastNeed = C - 2), C) : --k < w || C === -2 ? 0 : (C = i(F[k]), C >= 0 ? (C > 0 && (C === 2 ? C = 0 : y.lastNeed = C - 3), C) : 0));
|
|
12086
12086
|
}
|
|
12087
|
-
function o(
|
|
12087
|
+
function o(y, F, w) {
|
|
12088
12088
|
if ((F[0] & 192) !== 128)
|
|
12089
|
-
return
|
|
12090
|
-
if (
|
|
12089
|
+
return y.lastNeed = 0, "�";
|
|
12090
|
+
if (y.lastNeed > 1 && F.length > 1) {
|
|
12091
12091
|
if ((F[1] & 192) !== 128)
|
|
12092
|
-
return
|
|
12093
|
-
if (
|
|
12094
|
-
return
|
|
12092
|
+
return y.lastNeed = 1, "�";
|
|
12093
|
+
if (y.lastNeed > 2 && F.length > 2 && (F[2] & 192) !== 128)
|
|
12094
|
+
return y.lastNeed = 2, "�";
|
|
12095
12095
|
}
|
|
12096
12096
|
}
|
|
12097
|
-
function c(
|
|
12098
|
-
var F = this.lastTotal - this.lastNeed, w = o(this,
|
|
12097
|
+
function c(y) {
|
|
12098
|
+
var F = this.lastTotal - this.lastNeed, w = o(this, y);
|
|
12099
12099
|
if (w !== void 0) return w;
|
|
12100
|
-
if (this.lastNeed <=
|
|
12101
|
-
return
|
|
12102
|
-
|
|
12100
|
+
if (this.lastNeed <= y.length)
|
|
12101
|
+
return y.copy(this.lastChar, F, 0, this.lastNeed), this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
12102
|
+
y.copy(this.lastChar, F, 0, y.length), this.lastNeed -= y.length;
|
|
12103
12103
|
}
|
|
12104
|
-
function u(
|
|
12105
|
-
var w = s(this,
|
|
12106
|
-
if (!this.lastNeed) return
|
|
12104
|
+
function u(y, F) {
|
|
12105
|
+
var w = s(this, y, F);
|
|
12106
|
+
if (!this.lastNeed) return y.toString("utf8", F);
|
|
12107
12107
|
this.lastTotal = w;
|
|
12108
|
-
var k =
|
|
12109
|
-
return
|
|
12108
|
+
var k = y.length - (w - this.lastNeed);
|
|
12109
|
+
return y.copy(this.lastChar, 0, k), y.toString("utf8", F, k);
|
|
12110
12110
|
}
|
|
12111
|
-
function h(
|
|
12112
|
-
var F =
|
|
12111
|
+
function h(y) {
|
|
12112
|
+
var F = y && y.length ? this.write(y) : "";
|
|
12113
12113
|
return this.lastNeed ? F + "�" : F;
|
|
12114
12114
|
}
|
|
12115
|
-
function
|
|
12116
|
-
if ((
|
|
12117
|
-
var w =
|
|
12115
|
+
function d(y, F) {
|
|
12116
|
+
if ((y.length - F) % 2 === 0) {
|
|
12117
|
+
var w = y.toString("utf16le", F);
|
|
12118
12118
|
if (w) {
|
|
12119
12119
|
var k = w.charCodeAt(w.length - 1);
|
|
12120
12120
|
if (k >= 55296 && k <= 56319)
|
|
12121
|
-
return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] =
|
|
12121
|
+
return this.lastNeed = 2, this.lastTotal = 4, this.lastChar[0] = y[y.length - 2], this.lastChar[1] = y[y.length - 1], w.slice(0, -1);
|
|
12122
12122
|
}
|
|
12123
12123
|
return w;
|
|
12124
12124
|
}
|
|
12125
|
-
return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] =
|
|
12125
|
+
return this.lastNeed = 1, this.lastTotal = 2, this.lastChar[0] = y[y.length - 1], y.toString("utf16le", F, y.length - 1);
|
|
12126
12126
|
}
|
|
12127
|
-
function l(
|
|
12128
|
-
var F =
|
|
12127
|
+
function l(y) {
|
|
12128
|
+
var F = y && y.length ? this.write(y) : "";
|
|
12129
12129
|
if (this.lastNeed) {
|
|
12130
12130
|
var w = this.lastTotal - this.lastNeed;
|
|
12131
12131
|
return F + this.lastChar.toString("utf16le", 0, w);
|
|
12132
12132
|
}
|
|
12133
12133
|
return F;
|
|
12134
12134
|
}
|
|
12135
|
-
function
|
|
12136
|
-
var w = (
|
|
12137
|
-
return w === 0 ?
|
|
12135
|
+
function p(y, F) {
|
|
12136
|
+
var w = (y.length - F) % 3;
|
|
12137
|
+
return w === 0 ? y.toString("base64", F) : (this.lastNeed = 3 - w, this.lastTotal = 3, w === 1 ? this.lastChar[0] = y[y.length - 1] : (this.lastChar[0] = y[y.length - 2], this.lastChar[1] = y[y.length - 1]), y.toString("base64", F, y.length - w));
|
|
12138
12138
|
}
|
|
12139
|
-
function x(
|
|
12140
|
-
var F =
|
|
12139
|
+
function x(y) {
|
|
12140
|
+
var F = y && y.length ? this.write(y) : "";
|
|
12141
12141
|
return this.lastNeed ? F + this.lastChar.toString("base64", 0, 3 - this.lastNeed) : F;
|
|
12142
12142
|
}
|
|
12143
|
-
function v(
|
|
12144
|
-
return
|
|
12143
|
+
function v(y) {
|
|
12144
|
+
return y.toString(this.encoding);
|
|
12145
12145
|
}
|
|
12146
|
-
function b(
|
|
12147
|
-
return
|
|
12146
|
+
function b(y) {
|
|
12147
|
+
return y && y.length ? this.write(y) : "";
|
|
12148
12148
|
}
|
|
12149
12149
|
return Ar;
|
|
12150
12150
|
}
|
|
@@ -12199,22 +12199,22 @@ function bl() {
|
|
|
12199
12199
|
function s(u, h) {
|
|
12200
12200
|
}
|
|
12201
12201
|
s.prototype.write = function(u) {
|
|
12202
|
-
for (var h = t.alloc(u.length * 3),
|
|
12203
|
-
var
|
|
12204
|
-
|
|
12202
|
+
for (var h = t.alloc(u.length * 3), d = 0, l = 0; l < u.length; l++) {
|
|
12203
|
+
var p = u.charCodeAt(l);
|
|
12204
|
+
p < 128 ? h[d++] = p : p < 2048 ? (h[d++] = 192 + (p >>> 6), h[d++] = 128 + (p & 63)) : (h[d++] = 224 + (p >>> 12), h[d++] = 128 + (p >>> 6 & 63), h[d++] = 128 + (p & 63));
|
|
12205
12205
|
}
|
|
12206
|
-
return h.slice(0,
|
|
12206
|
+
return h.slice(0, d);
|
|
12207
12207
|
}, s.prototype.end = function() {
|
|
12208
12208
|
};
|
|
12209
12209
|
function o(u, h) {
|
|
12210
12210
|
this.acc = 0, this.contBytes = 0, this.accBytes = 0, this.defaultCharUnicode = h.defaultCharUnicode;
|
|
12211
12211
|
}
|
|
12212
12212
|
o.prototype.write = function(u) {
|
|
12213
|
-
for (var h = this.acc,
|
|
12213
|
+
for (var h = this.acc, d = this.contBytes, l = this.accBytes, p = "", x = 0; x < u.length; x++) {
|
|
12214
12214
|
var v = u[x];
|
|
12215
|
-
(v & 192) !== 128 ? (
|
|
12215
|
+
(v & 192) !== 128 ? (d > 0 && (p += this.defaultCharUnicode, d = 0), v < 128 ? p += String.fromCharCode(v) : v < 224 ? (h = v & 31, d = 1, l = 1) : v < 240 ? (h = v & 15, d = 2, l = 1) : p += this.defaultCharUnicode) : d > 0 ? (h = h << 6 | v & 63, d--, l++, d === 0 && (l === 2 && h < 128 && h > 0 ? p += this.defaultCharUnicode : l === 3 && h < 2048 ? p += this.defaultCharUnicode : p += String.fromCharCode(h))) : p += this.defaultCharUnicode;
|
|
12216
12216
|
}
|
|
12217
|
-
return this.acc = h, this.contBytes =
|
|
12217
|
+
return this.acc = h, this.contBytes = d, this.accBytes = l, p;
|
|
12218
12218
|
}, o.prototype.end = function() {
|
|
12219
12219
|
var u = 0;
|
|
12220
12220
|
return this.contBytes > 0 && (u += this.defaultCharUnicode), u;
|
|
@@ -12249,19 +12249,19 @@ function Sl() {
|
|
|
12249
12249
|
this.isLE = h.isLE, this.highSurrogate = 0;
|
|
12250
12250
|
}
|
|
12251
12251
|
r.prototype.write = function(u) {
|
|
12252
|
-
for (var h = t.from(u, "ucs2"),
|
|
12253
|
-
var v = h.readUInt16LE(x), b = v >= 55296 && v < 56320,
|
|
12252
|
+
for (var h = t.from(u, "ucs2"), d = t.alloc(h.length * 2), l = this.isLE ? d.writeUInt32LE : d.writeUInt32BE, p = 0, x = 0; x < h.length; x += 2) {
|
|
12253
|
+
var v = h.readUInt16LE(x), b = v >= 55296 && v < 56320, y = v >= 56320 && v < 57344;
|
|
12254
12254
|
if (this.highSurrogate)
|
|
12255
|
-
if (b || !
|
|
12256
|
-
l.call(
|
|
12255
|
+
if (b || !y)
|
|
12256
|
+
l.call(d, this.highSurrogate, p), p += 4;
|
|
12257
12257
|
else {
|
|
12258
12258
|
var F = (this.highSurrogate - 55296 << 10 | v - 56320) + 65536;
|
|
12259
|
-
l.call(
|
|
12259
|
+
l.call(d, F, p), p += 4, this.highSurrogate = 0;
|
|
12260
12260
|
continue;
|
|
12261
12261
|
}
|
|
12262
|
-
b ? this.highSurrogate = v : (l.call(
|
|
12262
|
+
b ? this.highSurrogate = v : (l.call(d, v, p), p += 4, this.highSurrogate = 0);
|
|
12263
12263
|
}
|
|
12264
|
-
return
|
|
12264
|
+
return p < d.length && (d = d.slice(0, p)), d;
|
|
12265
12265
|
}, r.prototype.end = function() {
|
|
12266
12266
|
if (this.highSurrogate) {
|
|
12267
12267
|
var u = t.alloc(4);
|
|
@@ -12274,26 +12274,26 @@ function Sl() {
|
|
|
12274
12274
|
n.prototype.write = function(u) {
|
|
12275
12275
|
if (u.length === 0)
|
|
12276
12276
|
return "";
|
|
12277
|
-
var h = 0,
|
|
12277
|
+
var h = 0, d = 0, l = t.alloc(u.length + 4), p = 0, x = this.isLE, v = this.overflow, b = this.badChar;
|
|
12278
12278
|
if (v.length > 0) {
|
|
12279
12279
|
for (; h < u.length && v.length < 4; h++)
|
|
12280
12280
|
v.push(u[h]);
|
|
12281
|
-
v.length === 4 && (x ?
|
|
12281
|
+
v.length === 4 && (x ? d = v[h] | v[h + 1] << 8 | v[h + 2] << 16 | v[h + 3] << 24 : d = v[h + 3] | v[h + 2] << 8 | v[h + 1] << 16 | v[h] << 24, v.length = 0, p = a(l, p, d, b));
|
|
12282
12282
|
}
|
|
12283
12283
|
for (; h < u.length - 3; h += 4)
|
|
12284
|
-
x ?
|
|
12284
|
+
x ? d = u[h] | u[h + 1] << 8 | u[h + 2] << 16 | u[h + 3] << 24 : d = u[h + 3] | u[h + 2] << 8 | u[h + 1] << 16 | u[h] << 24, p = a(l, p, d, b);
|
|
12285
12285
|
for (; h < u.length; h++)
|
|
12286
12286
|
v.push(u[h]);
|
|
12287
|
-
return l.slice(0,
|
|
12287
|
+
return l.slice(0, p).toString("ucs2");
|
|
12288
12288
|
};
|
|
12289
|
-
function a(u, h,
|
|
12290
|
-
if ((
|
|
12291
|
-
|
|
12292
|
-
var
|
|
12293
|
-
u[h++] =
|
|
12294
|
-
var
|
|
12289
|
+
function a(u, h, d, l) {
|
|
12290
|
+
if ((d < 0 || d > 1114111) && (d = l), d >= 65536) {
|
|
12291
|
+
d -= 65536;
|
|
12292
|
+
var p = 55296 | d >> 10;
|
|
12293
|
+
u[h++] = p & 255, u[h++] = p >> 8;
|
|
12294
|
+
var d = 56320 | d & 1023;
|
|
12295
12295
|
}
|
|
12296
|
-
return u[h++] =
|
|
12296
|
+
return u[h++] = d & 255, u[h++] = d >> 8, h;
|
|
12297
12297
|
}
|
|
12298
12298
|
n.prototype.end = function() {
|
|
12299
12299
|
this.overflow.length = 0;
|
|
@@ -12319,38 +12319,38 @@ function Sl() {
|
|
|
12319
12319
|
return "";
|
|
12320
12320
|
var h = c(this.initialBufs, this.options.defaultEncoding);
|
|
12321
12321
|
this.decoder = this.iconv.getDecoder(h, this.options);
|
|
12322
|
-
for (var
|
|
12323
|
-
|
|
12324
|
-
return this.initialBufs.length = this.initialBufsLen = 0,
|
|
12322
|
+
for (var d = "", l = 0; l < this.initialBufs.length; l++)
|
|
12323
|
+
d += this.decoder.write(this.initialBufs[l]);
|
|
12324
|
+
return this.initialBufs.length = this.initialBufsLen = 0, d;
|
|
12325
12325
|
}
|
|
12326
12326
|
return this.decoder.write(u);
|
|
12327
12327
|
}, o.prototype.end = function() {
|
|
12328
12328
|
if (!this.decoder) {
|
|
12329
12329
|
var u = c(this.initialBufs, this.options.defaultEncoding);
|
|
12330
12330
|
this.decoder = this.iconv.getDecoder(u, this.options);
|
|
12331
|
-
for (var h = "",
|
|
12332
|
-
h += this.decoder.write(this.initialBufs[
|
|
12331
|
+
for (var h = "", d = 0; d < this.initialBufs.length; d++)
|
|
12332
|
+
h += this.decoder.write(this.initialBufs[d]);
|
|
12333
12333
|
var l = this.decoder.end();
|
|
12334
12334
|
return l && (h += l), this.initialBufs.length = this.initialBufsLen = 0, h;
|
|
12335
12335
|
}
|
|
12336
12336
|
return this.decoder.end();
|
|
12337
12337
|
};
|
|
12338
12338
|
function c(u, h) {
|
|
12339
|
-
var
|
|
12339
|
+
var d = [], l = 0, p = 0, x = 0, v = 0, b = 0;
|
|
12340
12340
|
e:
|
|
12341
|
-
for (var
|
|
12342
|
-
for (var F = u[
|
|
12343
|
-
if (
|
|
12341
|
+
for (var y = 0; y < u.length; y++)
|
|
12342
|
+
for (var F = u[y], w = 0; w < F.length; w++)
|
|
12343
|
+
if (d.push(F[w]), d.length === 4) {
|
|
12344
12344
|
if (l === 0) {
|
|
12345
|
-
if (
|
|
12345
|
+
if (d[0] === 255 && d[1] === 254 && d[2] === 0 && d[3] === 0)
|
|
12346
12346
|
return "utf-32le";
|
|
12347
|
-
if (
|
|
12347
|
+
if (d[0] === 0 && d[1] === 0 && d[2] === 254 && d[3] === 255)
|
|
12348
12348
|
return "utf-32be";
|
|
12349
12349
|
}
|
|
12350
|
-
if ((
|
|
12350
|
+
if ((d[0] !== 0 || d[1] > 16) && x++, (d[3] !== 0 || d[2] > 16) && p++, d[0] === 0 && d[1] === 0 && (d[2] !== 0 || d[3] !== 0) && b++, (d[0] !== 0 || d[1] !== 0) && d[2] === 0 && d[3] === 0 && v++, d.length = 0, l++, l >= 100)
|
|
12351
12351
|
break e;
|
|
12352
12352
|
}
|
|
12353
|
-
return b - x > v -
|
|
12353
|
+
return b - x > v - p ? "utf-32be" : b - x < v - p ? "utf-32le" : h || "utf-32le";
|
|
12354
12354
|
}
|
|
12355
12355
|
return _e;
|
|
12356
12356
|
}
|
|
@@ -12367,8 +12367,8 @@ function wl() {
|
|
|
12367
12367
|
}
|
|
12368
12368
|
r.prototype.write = function(c) {
|
|
12369
12369
|
for (var u = t.from(c, "ucs2"), h = 0; h < u.length; h += 2) {
|
|
12370
|
-
var
|
|
12371
|
-
u[h] = u[h + 1], u[h + 1] =
|
|
12370
|
+
var d = u[h];
|
|
12371
|
+
u[h] = u[h + 1], u[h + 1] = d;
|
|
12372
12372
|
}
|
|
12373
12373
|
return u;
|
|
12374
12374
|
}, r.prototype.end = function() {
|
|
@@ -12379,10 +12379,10 @@ function wl() {
|
|
|
12379
12379
|
n.prototype.write = function(c) {
|
|
12380
12380
|
if (c.length == 0)
|
|
12381
12381
|
return "";
|
|
12382
|
-
var u = t.alloc(c.length + 1), h = 0,
|
|
12383
|
-
for (this.overflowByte !== -1 && (u[0] = c[0], u[1] = this.overflowByte, h = 1,
|
|
12384
|
-
u[
|
|
12385
|
-
return this.overflowByte = h == c.length - 1 ? c[c.length - 1] : -1, u.slice(0,
|
|
12382
|
+
var u = t.alloc(c.length + 1), h = 0, d = 0;
|
|
12383
|
+
for (this.overflowByte !== -1 && (u[0] = c[0], u[1] = this.overflowByte, h = 1, d = 2); h < c.length - 1; h += 2, d += 2)
|
|
12384
|
+
u[d] = c[h + 1], u[d + 1] = c[h];
|
|
12385
|
+
return this.overflowByte = h == c.length - 1 ? c[c.length - 1] : -1, u.slice(0, d).toString("ucs2");
|
|
12386
12386
|
}, n.prototype.end = function() {
|
|
12387
12387
|
this.overflowByte = -1;
|
|
12388
12388
|
}, jt.utf16 = a;
|
|
@@ -12407,8 +12407,8 @@ function wl() {
|
|
|
12407
12407
|
return "";
|
|
12408
12408
|
var u = o(this.initialBufs, this.options.defaultEncoding);
|
|
12409
12409
|
this.decoder = this.iconv.getDecoder(u, this.options);
|
|
12410
|
-
for (var h = "",
|
|
12411
|
-
h += this.decoder.write(this.initialBufs[
|
|
12410
|
+
for (var h = "", d = 0; d < this.initialBufs.length; d++)
|
|
12411
|
+
h += this.decoder.write(this.initialBufs[d]);
|
|
12412
12412
|
return this.initialBufs.length = this.initialBufsLen = 0, h;
|
|
12413
12413
|
}
|
|
12414
12414
|
return this.decoder.write(c);
|
|
@@ -12418,25 +12418,25 @@ function wl() {
|
|
|
12418
12418
|
this.decoder = this.iconv.getDecoder(c, this.options);
|
|
12419
12419
|
for (var u = "", h = 0; h < this.initialBufs.length; h++)
|
|
12420
12420
|
u += this.decoder.write(this.initialBufs[h]);
|
|
12421
|
-
var
|
|
12422
|
-
return
|
|
12421
|
+
var d = this.decoder.end();
|
|
12422
|
+
return d && (u += d), this.initialBufs.length = this.initialBufsLen = 0, u;
|
|
12423
12423
|
}
|
|
12424
12424
|
return this.decoder.end();
|
|
12425
12425
|
};
|
|
12426
12426
|
function o(c, u) {
|
|
12427
|
-
var h = [],
|
|
12427
|
+
var h = [], d = 0, l = 0, p = 0;
|
|
12428
12428
|
e:
|
|
12429
12429
|
for (var x = 0; x < c.length; x++)
|
|
12430
12430
|
for (var v = c[x], b = 0; b < v.length; b++)
|
|
12431
12431
|
if (h.push(v[b]), h.length === 2) {
|
|
12432
|
-
if (
|
|
12432
|
+
if (d === 0) {
|
|
12433
12433
|
if (h[0] === 255 && h[1] === 254) return "utf-16le";
|
|
12434
12434
|
if (h[0] === 254 && h[1] === 255) return "utf-16be";
|
|
12435
12435
|
}
|
|
12436
|
-
if (h[0] === 0 && h[1] !== 0 &&
|
|
12436
|
+
if (h[0] === 0 && h[1] !== 0 && p++, h[0] !== 0 && h[1] === 0 && l++, h.length = 0, d++, d >= 100)
|
|
12437
12437
|
break e;
|
|
12438
12438
|
}
|
|
12439
|
-
return
|
|
12439
|
+
return p > l ? "utf-16be" : p < l ? "utf-16le" : u || "utf-16le";
|
|
12440
12440
|
}
|
|
12441
12441
|
return jt;
|
|
12442
12442
|
}
|
|
@@ -12467,71 +12467,71 @@ function Fl() {
|
|
|
12467
12467
|
s[o] = i.test(String.fromCharCode(o));
|
|
12468
12468
|
var c = 43, u = 45, h = 38;
|
|
12469
12469
|
a.prototype.write = function(v) {
|
|
12470
|
-
for (var b = "",
|
|
12470
|
+
for (var b = "", y = 0, F = this.inBase64, w = this.base64Accum, k = 0; k < v.length; k++)
|
|
12471
12471
|
if (!F)
|
|
12472
|
-
v[k] == c && (b += this.iconv.decode(v.slice(
|
|
12472
|
+
v[k] == c && (b += this.iconv.decode(v.slice(y, k), "ascii"), y = k + 1, F = !0);
|
|
12473
12473
|
else if (!s[v[k]]) {
|
|
12474
|
-
if (k ==
|
|
12474
|
+
if (k == y && v[k] == u)
|
|
12475
12475
|
b += "+";
|
|
12476
12476
|
else {
|
|
12477
|
-
var C = w + this.iconv.decode(v.slice(
|
|
12477
|
+
var C = w + this.iconv.decode(v.slice(y, k), "ascii");
|
|
12478
12478
|
b += this.iconv.decode(t.from(C, "base64"), "utf16-be");
|
|
12479
12479
|
}
|
|
12480
|
-
v[k] != u && k--,
|
|
12480
|
+
v[k] != u && k--, y = k + 1, F = !1, w = "";
|
|
12481
12481
|
}
|
|
12482
12482
|
if (!F)
|
|
12483
|
-
b += this.iconv.decode(v.slice(
|
|
12483
|
+
b += this.iconv.decode(v.slice(y), "ascii");
|
|
12484
12484
|
else {
|
|
12485
|
-
var C = w + this.iconv.decode(v.slice(
|
|
12485
|
+
var C = w + this.iconv.decode(v.slice(y), "ascii"), U = C.length - C.length % 8;
|
|
12486
12486
|
w = C.slice(U), C = C.slice(0, U), b += this.iconv.decode(t.from(C, "base64"), "utf16-be");
|
|
12487
12487
|
}
|
|
12488
12488
|
return this.inBase64 = F, this.base64Accum = w, b;
|
|
12489
12489
|
}, a.prototype.end = function() {
|
|
12490
12490
|
var v = "";
|
|
12491
12491
|
return this.inBase64 && this.base64Accum.length > 0 && (v = this.iconv.decode(t.from(this.base64Accum, "base64"), "utf16-be")), this.inBase64 = !1, this.base64Accum = "", v;
|
|
12492
|
-
}, St.utf7imap =
|
|
12493
|
-
function
|
|
12492
|
+
}, St.utf7imap = d;
|
|
12493
|
+
function d(v, b) {
|
|
12494
12494
|
this.iconv = b;
|
|
12495
12495
|
}
|
|
12496
|
-
|
|
12496
|
+
d.prototype.encoder = l, d.prototype.decoder = p, d.prototype.bomAware = !0;
|
|
12497
12497
|
function l(v, b) {
|
|
12498
12498
|
this.iconv = b.iconv, this.inBase64 = !1, this.base64Accum = t.alloc(6), this.base64AccumIdx = 0;
|
|
12499
12499
|
}
|
|
12500
12500
|
l.prototype.write = function(v) {
|
|
12501
|
-
for (var b = this.inBase64,
|
|
12501
|
+
for (var b = this.inBase64, y = this.base64Accum, F = this.base64AccumIdx, w = t.alloc(v.length * 5 + 10), k = 0, C = 0; C < v.length; C++) {
|
|
12502
12502
|
var U = v.charCodeAt(C);
|
|
12503
|
-
U >= 32 && U <= 126 ? (b && (F > 0 && (k += w.write(
|
|
12503
|
+
U >= 32 && U <= 126 ? (b && (F > 0 && (k += w.write(y.slice(0, F).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), k), F = 0), w[k++] = u, b = !1), b || (w[k++] = U, U === h && (w[k++] = u))) : (b || (w[k++] = h, b = !0), b && (y[F++] = U >> 8, y[F++] = U & 255, F == y.length && (k += w.write(y.toString("base64").replace(/\//g, ","), k), F = 0)));
|
|
12504
12504
|
}
|
|
12505
12505
|
return this.inBase64 = b, this.base64AccumIdx = F, w.slice(0, k);
|
|
12506
12506
|
}, l.prototype.end = function() {
|
|
12507
12507
|
var v = t.alloc(10), b = 0;
|
|
12508
12508
|
return this.inBase64 && (this.base64AccumIdx > 0 && (b += v.write(this.base64Accum.slice(0, this.base64AccumIdx).toString("base64").replace(/\//g, ",").replace(/=+$/, ""), b), this.base64AccumIdx = 0), v[b++] = u, this.inBase64 = !1), v.slice(0, b);
|
|
12509
12509
|
};
|
|
12510
|
-
function
|
|
12510
|
+
function p(v, b) {
|
|
12511
12511
|
this.iconv = b.iconv, this.inBase64 = !1, this.base64Accum = "";
|
|
12512
12512
|
}
|
|
12513
12513
|
var x = s.slice();
|
|
12514
|
-
return x[44] = !0,
|
|
12515
|
-
for (var b = "",
|
|
12514
|
+
return x[44] = !0, p.prototype.write = function(v) {
|
|
12515
|
+
for (var b = "", y = 0, F = this.inBase64, w = this.base64Accum, k = 0; k < v.length; k++)
|
|
12516
12516
|
if (!F)
|
|
12517
|
-
v[k] == h && (b += this.iconv.decode(v.slice(
|
|
12517
|
+
v[k] == h && (b += this.iconv.decode(v.slice(y, k), "ascii"), y = k + 1, F = !0);
|
|
12518
12518
|
else if (!x[v[k]]) {
|
|
12519
|
-
if (k ==
|
|
12519
|
+
if (k == y && v[k] == u)
|
|
12520
12520
|
b += "&";
|
|
12521
12521
|
else {
|
|
12522
|
-
var C = w + this.iconv.decode(v.slice(
|
|
12522
|
+
var C = w + this.iconv.decode(v.slice(y, k), "ascii").replace(/,/g, "/");
|
|
12523
12523
|
b += this.iconv.decode(t.from(C, "base64"), "utf16-be");
|
|
12524
12524
|
}
|
|
12525
|
-
v[k] != u && k--,
|
|
12525
|
+
v[k] != u && k--, y = k + 1, F = !1, w = "";
|
|
12526
12526
|
}
|
|
12527
12527
|
if (!F)
|
|
12528
|
-
b += this.iconv.decode(v.slice(
|
|
12528
|
+
b += this.iconv.decode(v.slice(y), "ascii");
|
|
12529
12529
|
else {
|
|
12530
|
-
var C = w + this.iconv.decode(v.slice(
|
|
12530
|
+
var C = w + this.iconv.decode(v.slice(y), "ascii").replace(/,/g, "/"), U = C.length - C.length % 8;
|
|
12531
12531
|
w = C.slice(U), C = C.slice(0, U), b += this.iconv.decode(t.from(C, "base64"), "utf16-be");
|
|
12532
12532
|
}
|
|
12533
12533
|
return this.inBase64 = F, this.base64Accum = w, b;
|
|
12534
|
-
},
|
|
12534
|
+
}, p.prototype.end = function() {
|
|
12535
12535
|
var v = "";
|
|
12536
12536
|
return this.inBase64 && this.base64Accum.length > 0 && (v = this.iconv.decode(t.from(this.base64Accum, "base64"), "utf16-be")), this.inBase64 = !1, this.base64Accum = "", v;
|
|
12537
12537
|
}, St;
|
|
@@ -13190,7 +13190,7 @@ function El() {
|
|
|
13190
13190
|
Mr._dbcs = c;
|
|
13191
13191
|
for (var e = -1, r = -2, n = -10, a = -1e3, i = new Array(256), s = -1, o = 0; o < 256; o++)
|
|
13192
13192
|
i[o] = e;
|
|
13193
|
-
function c(l,
|
|
13193
|
+
function c(l, p) {
|
|
13194
13194
|
if (this.encodingName = l.encodingName, !l)
|
|
13195
13195
|
throw new Error("DBCS codec is called without the data.");
|
|
13196
13196
|
if (!l.table)
|
|
@@ -13203,7 +13203,7 @@ function El() {
|
|
|
13203
13203
|
this.gb18030 = l.gb18030();
|
|
13204
13204
|
var b = this.decodeTables.length;
|
|
13205
13205
|
this.decodeTables.push(i.slice(0));
|
|
13206
|
-
var
|
|
13206
|
+
var y = this.decodeTables.length;
|
|
13207
13207
|
this.decodeTables.push(i.slice(0));
|
|
13208
13208
|
for (var F = this.decodeTables[0], v = 129; v <= 254; v++)
|
|
13209
13209
|
for (var w = this.decodeTables[a - F[v]], k = 48; k <= 57; k++) {
|
|
@@ -13213,9 +13213,9 @@ function El() {
|
|
|
13213
13213
|
throw new Error("gb18030 decode tables conflict at byte 2");
|
|
13214
13214
|
for (var C = this.decodeTables[a - w[k]], U = 129; U <= 254; U++) {
|
|
13215
13215
|
if (C[U] === e)
|
|
13216
|
-
C[U] = a -
|
|
13216
|
+
C[U] = a - y;
|
|
13217
13217
|
else {
|
|
13218
|
-
if (C[U] === a -
|
|
13218
|
+
if (C[U] === a - y)
|
|
13219
13219
|
continue;
|
|
13220
13220
|
if (C[U] > a)
|
|
13221
13221
|
throw new Error("gb18030 decode tables conflict at byte 3");
|
|
@@ -13225,7 +13225,7 @@ function El() {
|
|
|
13225
13225
|
}
|
|
13226
13226
|
}
|
|
13227
13227
|
}
|
|
13228
|
-
this.defaultCharUnicode =
|
|
13228
|
+
this.defaultCharUnicode = p.defaultCharUnicode, this.encodeTable = [], this.encodeTableSeq = [];
|
|
13229
13229
|
var H = {};
|
|
13230
13230
|
if (l.encodeSkipVals)
|
|
13231
13231
|
for (var v = 0; v < l.encodeSkipVals.length; v++) {
|
|
@@ -13239,16 +13239,16 @@ function El() {
|
|
|
13239
13239
|
if (this._fillEncodeTable(0, 0, H), l.encodeAdd)
|
|
13240
13240
|
for (var z in l.encodeAdd)
|
|
13241
13241
|
Object.prototype.hasOwnProperty.call(l.encodeAdd, z) && this._setEncodeChar(z.charCodeAt(0), l.encodeAdd[z]);
|
|
13242
|
-
this.defCharSB = this.encodeTable[0][
|
|
13242
|
+
this.defCharSB = this.encodeTable[0][p.defaultCharSingleByte.charCodeAt(0)], this.defCharSB === e && (this.defCharSB = this.encodeTable[0]["?"]), this.defCharSB === e && (this.defCharSB = 63);
|
|
13243
13243
|
}
|
|
13244
13244
|
c.prototype.encoder = u, c.prototype.decoder = h, c.prototype._getDecodeTrieNode = function(l) {
|
|
13245
|
-
for (var
|
|
13246
|
-
|
|
13247
|
-
|
|
13248
|
-
for (var x = this.decodeTables[0], v =
|
|
13249
|
-
var b = x[
|
|
13245
|
+
for (var p = []; l > 0; l >>>= 8)
|
|
13246
|
+
p.push(l & 255);
|
|
13247
|
+
p.length == 0 && p.push(0);
|
|
13248
|
+
for (var x = this.decodeTables[0], v = p.length - 1; v > 0; v--) {
|
|
13249
|
+
var b = x[p[v]];
|
|
13250
13250
|
if (b == e)
|
|
13251
|
-
x[
|
|
13251
|
+
x[p[v]] = a - this.decodeTables.length, this.decodeTables.push(x = i.slice(0));
|
|
13252
13252
|
else if (b <= a)
|
|
13253
13253
|
x = this.decodeTables[a - b];
|
|
13254
13254
|
else
|
|
@@ -13256,72 +13256,72 @@ function El() {
|
|
|
13256
13256
|
}
|
|
13257
13257
|
return x;
|
|
13258
13258
|
}, c.prototype._addDecodeChunk = function(l) {
|
|
13259
|
-
var
|
|
13260
|
-
|
|
13259
|
+
var p = parseInt(l[0], 16), x = this._getDecodeTrieNode(p);
|
|
13260
|
+
p = p & 255;
|
|
13261
13261
|
for (var v = 1; v < l.length; v++) {
|
|
13262
13262
|
var b = l[v];
|
|
13263
13263
|
if (typeof b == "string")
|
|
13264
|
-
for (var
|
|
13265
|
-
var F = b.charCodeAt(
|
|
13264
|
+
for (var y = 0; y < b.length; ) {
|
|
13265
|
+
var F = b.charCodeAt(y++);
|
|
13266
13266
|
if (F >= 55296 && F < 56320) {
|
|
13267
|
-
var w = b.charCodeAt(
|
|
13267
|
+
var w = b.charCodeAt(y++);
|
|
13268
13268
|
if (w >= 56320 && w < 57344)
|
|
13269
|
-
x[
|
|
13269
|
+
x[p++] = 65536 + (F - 55296) * 1024 + (w - 56320);
|
|
13270
13270
|
else
|
|
13271
13271
|
throw new Error("Incorrect surrogate pair in " + this.encodingName + " at chunk " + l[0]);
|
|
13272
13272
|
} else if (F > 4080 && F <= 4095) {
|
|
13273
13273
|
for (var k = 4095 - F + 2, C = [], U = 0; U < k; U++)
|
|
13274
|
-
C.push(b.charCodeAt(
|
|
13275
|
-
x[
|
|
13274
|
+
C.push(b.charCodeAt(y++));
|
|
13275
|
+
x[p++] = n - this.decodeTableSeq.length, this.decodeTableSeq.push(C);
|
|
13276
13276
|
} else
|
|
13277
|
-
x[
|
|
13277
|
+
x[p++] = F;
|
|
13278
13278
|
}
|
|
13279
13279
|
else if (typeof b == "number")
|
|
13280
|
-
for (var B = x[
|
|
13281
|
-
x[
|
|
13280
|
+
for (var B = x[p - 1] + 1, y = 0; y < b; y++)
|
|
13281
|
+
x[p++] = B++;
|
|
13282
13282
|
else
|
|
13283
13283
|
throw new Error("Incorrect type '" + typeof b + "' given in " + this.encodingName + " at chunk " + l[0]);
|
|
13284
13284
|
}
|
|
13285
|
-
if (
|
|
13286
|
-
throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + l[0] + ": too long" +
|
|
13285
|
+
if (p > 255)
|
|
13286
|
+
throw new Error("Incorrect chunk in " + this.encodingName + " at addr " + l[0] + ": too long" + p);
|
|
13287
13287
|
}, c.prototype._getEncodeBucket = function(l) {
|
|
13288
|
-
var
|
|
13289
|
-
return this.encodeTable[
|
|
13290
|
-
}, c.prototype._setEncodeChar = function(l,
|
|
13288
|
+
var p = l >> 8;
|
|
13289
|
+
return this.encodeTable[p] === void 0 && (this.encodeTable[p] = i.slice(0)), this.encodeTable[p];
|
|
13290
|
+
}, c.prototype._setEncodeChar = function(l, p) {
|
|
13291
13291
|
var x = this._getEncodeBucket(l), v = l & 255;
|
|
13292
|
-
x[v] <= n ? this.encodeTableSeq[n - x[v]][s] =
|
|
13293
|
-
}, c.prototype._setEncodeSequence = function(l,
|
|
13294
|
-
var x = l[0], v = this._getEncodeBucket(x), b = x & 255,
|
|
13295
|
-
v[b] <= n ?
|
|
13292
|
+
x[v] <= n ? this.encodeTableSeq[n - x[v]][s] = p : x[v] == e && (x[v] = p);
|
|
13293
|
+
}, c.prototype._setEncodeSequence = function(l, p) {
|
|
13294
|
+
var x = l[0], v = this._getEncodeBucket(x), b = x & 255, y;
|
|
13295
|
+
v[b] <= n ? y = this.encodeTableSeq[n - v[b]] : (y = {}, v[b] !== e && (y[s] = v[b]), v[b] = n - this.encodeTableSeq.length, this.encodeTableSeq.push(y));
|
|
13296
13296
|
for (var F = 1; F < l.length - 1; F++) {
|
|
13297
|
-
var w =
|
|
13298
|
-
typeof w == "object" ?
|
|
13297
|
+
var w = y[x];
|
|
13298
|
+
typeof w == "object" ? y = w : (y = y[x] = {}, w !== void 0 && (y[s] = w));
|
|
13299
13299
|
}
|
|
13300
|
-
x = l[l.length - 1],
|
|
13301
|
-
}, c.prototype._fillEncodeTable = function(l,
|
|
13302
|
-
for (var v = this.decodeTables[l], b = !1,
|
|
13303
|
-
var w = v[F], k =
|
|
13300
|
+
x = l[l.length - 1], y[x] = p;
|
|
13301
|
+
}, c.prototype._fillEncodeTable = function(l, p, x) {
|
|
13302
|
+
for (var v = this.decodeTables[l], b = !1, y = {}, F = 0; F < 256; F++) {
|
|
13303
|
+
var w = v[F], k = p + F;
|
|
13304
13304
|
if (!x[k])
|
|
13305
13305
|
if (w >= 0)
|
|
13306
13306
|
this._setEncodeChar(w, k), b = !0;
|
|
13307
13307
|
else if (w <= a) {
|
|
13308
13308
|
var C = a - w;
|
|
13309
|
-
if (!
|
|
13309
|
+
if (!y[C]) {
|
|
13310
13310
|
var U = k << 8 >>> 0;
|
|
13311
|
-
this._fillEncodeTable(C, U, x) ? b = !0 :
|
|
13311
|
+
this._fillEncodeTable(C, U, x) ? b = !0 : y[C] = !0;
|
|
13312
13312
|
}
|
|
13313
13313
|
} else w <= n && (this._setEncodeSequence(this.decodeTableSeq[n - w], k), b = !0);
|
|
13314
13314
|
}
|
|
13315
13315
|
return b;
|
|
13316
13316
|
};
|
|
13317
|
-
function u(l,
|
|
13318
|
-
this.leadSurrogate = -1, this.seqObj = void 0, this.encodeTable =
|
|
13317
|
+
function u(l, p) {
|
|
13318
|
+
this.leadSurrogate = -1, this.seqObj = void 0, this.encodeTable = p.encodeTable, this.encodeTableSeq = p.encodeTableSeq, this.defaultCharSingleByte = p.defCharSB, this.gb18030 = p.gb18030;
|
|
13319
13319
|
}
|
|
13320
13320
|
u.prototype.write = function(l) {
|
|
13321
|
-
for (var
|
|
13321
|
+
for (var p = t.alloc(l.length * (this.gb18030 ? 4 : 3)), x = this.leadSurrogate, v = this.seqObj, b = -1, y = 0, F = 0; ; ) {
|
|
13322
13322
|
if (b === -1) {
|
|
13323
|
-
if (
|
|
13324
|
-
var w = l.charCodeAt(
|
|
13323
|
+
if (y == l.length) break;
|
|
13324
|
+
var w = l.charCodeAt(y++);
|
|
13325
13325
|
} else {
|
|
13326
13326
|
var w = b;
|
|
13327
13327
|
b = -1;
|
|
@@ -13351,73 +13351,73 @@ function El() {
|
|
|
13351
13351
|
continue;
|
|
13352
13352
|
}
|
|
13353
13353
|
if (k == e && this.gb18030) {
|
|
13354
|
-
var B =
|
|
13354
|
+
var B = d(this.gb18030.uChars, w);
|
|
13355
13355
|
if (B != -1) {
|
|
13356
13356
|
var k = this.gb18030.gbChars[B] + (w - this.gb18030.uChars[B]);
|
|
13357
|
-
|
|
13357
|
+
p[F++] = 129 + Math.floor(k / 12600), k = k % 12600, p[F++] = 48 + Math.floor(k / 1260), k = k % 1260, p[F++] = 129 + Math.floor(k / 10), k = k % 10, p[F++] = 48 + k;
|
|
13358
13358
|
continue;
|
|
13359
13359
|
}
|
|
13360
13360
|
}
|
|
13361
13361
|
}
|
|
13362
|
-
k === e && (k = this.defaultCharSingleByte), k < 256 ?
|
|
13362
|
+
k === e && (k = this.defaultCharSingleByte), k < 256 ? p[F++] = k : k < 65536 ? (p[F++] = k >> 8, p[F++] = k & 255) : k < 16777216 ? (p[F++] = k >> 16, p[F++] = k >> 8 & 255, p[F++] = k & 255) : (p[F++] = k >>> 24, p[F++] = k >>> 16 & 255, p[F++] = k >>> 8 & 255, p[F++] = k & 255);
|
|
13363
13363
|
}
|
|
13364
|
-
return this.seqObj = v, this.leadSurrogate = x,
|
|
13364
|
+
return this.seqObj = v, this.leadSurrogate = x, p.slice(0, F);
|
|
13365
13365
|
}, u.prototype.end = function() {
|
|
13366
13366
|
if (!(this.leadSurrogate === -1 && this.seqObj === void 0)) {
|
|
13367
|
-
var l = t.alloc(10),
|
|
13367
|
+
var l = t.alloc(10), p = 0;
|
|
13368
13368
|
if (this.seqObj) {
|
|
13369
13369
|
var x = this.seqObj[s];
|
|
13370
|
-
x !== void 0 && (x < 256 ? l[
|
|
13370
|
+
x !== void 0 && (x < 256 ? l[p++] = x : (l[p++] = x >> 8, l[p++] = x & 255)), this.seqObj = void 0;
|
|
13371
13371
|
}
|
|
13372
|
-
return this.leadSurrogate !== -1 && (l[
|
|
13372
|
+
return this.leadSurrogate !== -1 && (l[p++] = this.defaultCharSingleByte, this.leadSurrogate = -1), l.slice(0, p);
|
|
13373
13373
|
}
|
|
13374
|
-
}, u.prototype.findIdx =
|
|
13375
|
-
function h(l,
|
|
13376
|
-
this.nodeIdx = 0, this.prevBytes = [], this.decodeTables =
|
|
13374
|
+
}, u.prototype.findIdx = d;
|
|
13375
|
+
function h(l, p) {
|
|
13376
|
+
this.nodeIdx = 0, this.prevBytes = [], this.decodeTables = p.decodeTables, this.decodeTableSeq = p.decodeTableSeq, this.defaultCharUnicode = p.defaultCharUnicode, this.gb18030 = p.gb18030;
|
|
13377
13377
|
}
|
|
13378
13378
|
h.prototype.write = function(l) {
|
|
13379
|
-
for (var
|
|
13379
|
+
for (var p = t.alloc(l.length * 2), x = this.nodeIdx, v = this.prevBytes, b = this.prevBytes.length, y = -this.prevBytes.length, F, w = 0, k = 0; w < l.length; w++) {
|
|
13380
13380
|
var C = w >= 0 ? l[w] : v[w + b], F = this.decodeTables[x][C];
|
|
13381
13381
|
if (!(F >= 0)) if (F === e)
|
|
13382
|
-
F = this.defaultCharUnicode.charCodeAt(0), w =
|
|
13382
|
+
F = this.defaultCharUnicode.charCodeAt(0), w = y;
|
|
13383
13383
|
else if (F === r) {
|
|
13384
13384
|
if (w >= 3)
|
|
13385
13385
|
var U = (l[w - 3] - 129) * 12600 + (l[w - 2] - 48) * 1260 + (l[w - 1] - 129) * 10 + (C - 48);
|
|
13386
13386
|
else
|
|
13387
13387
|
var U = (v[w - 3 + b] - 129) * 12600 + ((w - 2 >= 0 ? l[w - 2] : v[w - 2 + b]) - 48) * 1260 + ((w - 1 >= 0 ? l[w - 1] : v[w - 1 + b]) - 129) * 10 + (C - 48);
|
|
13388
|
-
var B =
|
|
13388
|
+
var B = d(this.gb18030.gbChars, U);
|
|
13389
13389
|
F = this.gb18030.uChars[B] + U - this.gb18030.gbChars[B];
|
|
13390
13390
|
} else if (F <= a) {
|
|
13391
13391
|
x = a - F;
|
|
13392
13392
|
continue;
|
|
13393
13393
|
} else if (F <= n) {
|
|
13394
13394
|
for (var O = this.decodeTableSeq[n - F], H = 0; H < O.length - 1; H++)
|
|
13395
|
-
F = O[H],
|
|
13395
|
+
F = O[H], p[k++] = F & 255, p[k++] = F >> 8;
|
|
13396
13396
|
F = O[O.length - 1];
|
|
13397
13397
|
} else
|
|
13398
13398
|
throw new Error("iconv-lite internal error: invalid decoding table value " + F + " at " + x + "/" + C);
|
|
13399
13399
|
if (F >= 65536) {
|
|
13400
13400
|
F -= 65536;
|
|
13401
13401
|
var W = 55296 | F >> 10;
|
|
13402
|
-
|
|
13402
|
+
p[k++] = W & 255, p[k++] = W >> 8, F = 56320 | F & 1023;
|
|
13403
13403
|
}
|
|
13404
|
-
|
|
13404
|
+
p[k++] = F & 255, p[k++] = F >> 8, x = 0, y = w + 1;
|
|
13405
13405
|
}
|
|
13406
|
-
return this.nodeIdx = x, this.prevBytes =
|
|
13406
|
+
return this.nodeIdx = x, this.prevBytes = y >= 0 ? Array.prototype.slice.call(l, y) : v.slice(y + b).concat(Array.prototype.slice.call(l)), p.slice(0, k).toString("ucs2");
|
|
13407
13407
|
}, h.prototype.end = function() {
|
|
13408
13408
|
for (var l = ""; this.prevBytes.length > 0; ) {
|
|
13409
13409
|
l += this.defaultCharUnicode;
|
|
13410
|
-
var
|
|
13411
|
-
this.prevBytes = [], this.nodeIdx = 0,
|
|
13410
|
+
var p = this.prevBytes.slice(1);
|
|
13411
|
+
this.prevBytes = [], this.nodeIdx = 0, p.length > 0 && (l += this.write(p));
|
|
13412
13412
|
}
|
|
13413
13413
|
return this.prevBytes = [], this.nodeIdx = 0, l;
|
|
13414
13414
|
};
|
|
13415
|
-
function
|
|
13416
|
-
if (l[0] >
|
|
13415
|
+
function d(l, p) {
|
|
13416
|
+
if (l[0] > p)
|
|
13417
13417
|
return -1;
|
|
13418
13418
|
for (var x = 0, v = l.length; x < v - 1; ) {
|
|
13419
13419
|
var b = x + (v - x + 1 >> 1);
|
|
13420
|
-
l[b] <=
|
|
13420
|
+
l[b] <= p ? x = b : v = b;
|
|
13421
13421
|
}
|
|
13422
13422
|
return x;
|
|
13423
13423
|
}
|
|
@@ -22032,12 +22032,12 @@ const Pl = {}, Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
22032
22032
|
var e = et.Buffer, r = mn, n = Zi, a = t.exports;
|
|
22033
22033
|
a.encodings = null, a.defaultCharUnicode = "�", a.defaultCharSingleByte = "?", a.encode = function(o, c, u) {
|
|
22034
22034
|
o = "" + (o || "");
|
|
22035
|
-
var h = a.getEncoder(c, u),
|
|
22036
|
-
return l && l.length > 0 ? e.concat([
|
|
22035
|
+
var h = a.getEncoder(c, u), d = h.write(o), l = h.end();
|
|
22036
|
+
return l && l.length > 0 ? e.concat([d, l]) : d;
|
|
22037
22037
|
}, a.decode = function(o, c, u) {
|
|
22038
22038
|
typeof o == "string" && (a.skipDecodeWarning || (console.error("Iconv-lite warning: decode()-ing strings is deprecated. Refer to https://github.com/ashtuchkin/iconv-lite/wiki/Use-Buffers-when-decoding"), a.skipDecodeWarning = !0), o = e.from("" + (o || ""), "binary"));
|
|
22039
|
-
var h = a.getDecoder(c, u),
|
|
22040
|
-
return l ?
|
|
22039
|
+
var h = a.getDecoder(c, u), d = h.write(o), l = h.end();
|
|
22040
|
+
return l ? d + l : d;
|
|
22041
22041
|
}, a.encodingExists = function(o) {
|
|
22042
22042
|
try {
|
|
22043
22043
|
return a.getCodec(o), !0;
|
|
@@ -22050,21 +22050,21 @@ const Pl = {}, Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
22050
22050
|
a.encodings = { __proto__: null }, n(a.encodings, c);
|
|
22051
22051
|
}
|
|
22052
22052
|
for (var u = a._canonicalizeEncoding(o), h = {}; ; ) {
|
|
22053
|
-
var
|
|
22054
|
-
if (
|
|
22055
|
-
return
|
|
22053
|
+
var d = a._codecDataCache[u];
|
|
22054
|
+
if (d)
|
|
22055
|
+
return d;
|
|
22056
22056
|
var l = a.encodings[u];
|
|
22057
22057
|
switch (typeof l) {
|
|
22058
22058
|
case "string":
|
|
22059
22059
|
u = l;
|
|
22060
22060
|
break;
|
|
22061
22061
|
case "object":
|
|
22062
|
-
for (var
|
|
22063
|
-
h[
|
|
22062
|
+
for (var p in l)
|
|
22063
|
+
h[p] = l[p];
|
|
22064
22064
|
h.encodingName || (h.encodingName = u), u = l.type;
|
|
22065
22065
|
break;
|
|
22066
22066
|
case "function":
|
|
22067
|
-
return h.encodingName || (h.encodingName = u),
|
|
22067
|
+
return h.encodingName || (h.encodingName = u), d = new l(h, a), a._codecDataCache[h.encodingName] = d, d;
|
|
22068
22068
|
default:
|
|
22069
22069
|
throw new Error("Encoding not recognized: '" + o + "' (searched as: '" + u + "')");
|
|
22070
22070
|
}
|
|
@@ -22080,10 +22080,10 @@ const Pl = {}, Nl = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineP
|
|
|
22080
22080
|
}, a.enableStreamingAPI = function(o) {
|
|
22081
22081
|
if (!a.supportsStreams) {
|
|
22082
22082
|
var c = _l()(o);
|
|
22083
|
-
a.IconvLiteEncoderStream = c.IconvLiteEncoderStream, a.IconvLiteDecoderStream = c.IconvLiteDecoderStream, a.encodeStream = function(h,
|
|
22084
|
-
return new a.IconvLiteEncoderStream(a.getEncoder(h,
|
|
22085
|
-
}, a.decodeStream = function(h,
|
|
22086
|
-
return new a.IconvLiteDecoderStream(a.getDecoder(h,
|
|
22083
|
+
a.IconvLiteEncoderStream = c.IconvLiteEncoderStream, a.IconvLiteDecoderStream = c.IconvLiteDecoderStream, a.encodeStream = function(h, d) {
|
|
22084
|
+
return new a.IconvLiteEncoderStream(a.getEncoder(h, d), d);
|
|
22085
|
+
}, a.decodeStream = function(h, d) {
|
|
22086
|
+
return new a.IconvLiteDecoderStream(a.getDecoder(h, d), d);
|
|
22087
22087
|
}, a.supportsStreams = !0;
|
|
22088
22088
|
}
|
|
22089
22089
|
};
|
|
@@ -22129,7 +22129,7 @@ class Sn extends Qa {
|
|
|
22129
22129
|
if (e == null) {
|
|
22130
22130
|
const r = this.shape.polylines, n = [], a = [];
|
|
22131
22131
|
let i = 0;
|
|
22132
|
-
e = new
|
|
22132
|
+
e = new R.BufferGeometry();
|
|
22133
22133
|
for (let s = 0; s < r.length; s++) {
|
|
22134
22134
|
const o = r[s];
|
|
22135
22135
|
for (let c = 0; c < o.length; c++) {
|
|
@@ -22139,7 +22139,7 @@ class Sn extends Qa {
|
|
|
22139
22139
|
}
|
|
22140
22140
|
e.setAttribute(
|
|
22141
22141
|
"position",
|
|
22142
|
-
new
|
|
22142
|
+
new R.Float32BufferAttribute(n, 3)
|
|
22143
22143
|
), e.setIndex(a);
|
|
22144
22144
|
}
|
|
22145
22145
|
return e;
|
|
@@ -22268,7 +22268,7 @@ class Ie {
|
|
|
22268
22268
|
fontNotFound: new An(),
|
|
22269
22269
|
/** Event triggered when a font is successfully loaded */
|
|
22270
22270
|
fontLoaded: new An()
|
|
22271
|
-
}, this.loader = new
|
|
22271
|
+
}, this.loader = new R.FileLoader(), this.loader.setResponseType("arraybuffer"), this.fileNames = [], this.fontLoader = new Vl();
|
|
22272
22272
|
}
|
|
22273
22273
|
/**
|
|
22274
22274
|
* Gets the singleton instance of the FontManager
|
|
@@ -22631,6 +22631,7 @@ function er(t) {
|
|
|
22631
22631
|
const e = t.color, r = e.aci;
|
|
22632
22632
|
return r === 0 ? $t(t.byBlockColor) : r === 256 ? $t(t.byLayerColor) : r != null ? Za(r) : e.rgbValue !== null ? $t(e.rgbValue) : $t(t.byLayerColor);
|
|
22633
22633
|
}
|
|
22634
|
+
const ql = 1.666666, Zt = 0.3;
|
|
22634
22635
|
var Z;
|
|
22635
22636
|
(function(t) {
|
|
22636
22637
|
t[t.NONE = 0] = "NONE", t[t.WORD = 1] = "WORD", t[t.STACK = 2] = "STACK", t[t.SPACE = 3] = "SPACE", t[t.NBSP = 4] = "NBSP", t[t.TABULATOR = 5] = "TABULATOR", t[t.NEW_PARAGRAPH = 6] = "NEW_PARAGRAPH", t[t.NEW_COLUMN = 7] = "NEW_COLUMN", t[t.WRAP_AT_DIMLINE = 8] = "WRAP_AT_DIMLINE", t[t.PROPERTIES_CHANGED = 9] = "PROPERTIES_CHANGED";
|
|
@@ -22647,19 +22648,19 @@ var Xe;
|
|
|
22647
22648
|
(function(t) {
|
|
22648
22649
|
t[t.NONE = 0] = "NONE", t[t.UNDERLINE = 1] = "UNDERLINE", t[t.OVERLINE = 2] = "OVERLINE", t[t.STRIKE_THROUGH = 4] = "STRIKE_THROUGH";
|
|
22649
22650
|
})(Xe || (Xe = {}));
|
|
22650
|
-
const
|
|
22651
|
+
const Xl = {
|
|
22651
22652
|
c: "Ø",
|
|
22652
22653
|
d: "°",
|
|
22653
22654
|
p: "±",
|
|
22654
22655
|
"%": "%"
|
|
22655
|
-
},
|
|
22656
|
+
}, Yl = {
|
|
22656
22657
|
l: ee.LEFT,
|
|
22657
22658
|
r: ee.RIGHT,
|
|
22658
22659
|
c: ee.CENTER,
|
|
22659
22660
|
j: ee.JUSTIFIED,
|
|
22660
22661
|
d: ee.DISTRIBUTED
|
|
22661
22662
|
};
|
|
22662
|
-
function
|
|
22663
|
+
function jl(t) {
|
|
22663
22664
|
const [e, r, n] = t;
|
|
22664
22665
|
return e << 16 | r << 8 | n;
|
|
22665
22666
|
}
|
|
@@ -22673,10 +22674,10 @@ function Ha(t) {
|
|
|
22673
22674
|
function Ki(t) {
|
|
22674
22675
|
return Math.max(0, Math.min(16777215, Math.round(t)));
|
|
22675
22676
|
}
|
|
22676
|
-
function
|
|
22677
|
+
function $l(t) {
|
|
22677
22678
|
return t === null ? null : `#${Ki(t).toString(16).padStart(6, "0")}`;
|
|
22678
22679
|
}
|
|
22679
|
-
function
|
|
22680
|
+
function Zl(t) {
|
|
22680
22681
|
if (!t)
|
|
22681
22682
|
return null;
|
|
22682
22683
|
const e = t.trim().toLowerCase();
|
|
@@ -22694,13 +22695,13 @@ function $l(t) {
|
|
|
22694
22695
|
}
|
|
22695
22696
|
return null;
|
|
22696
22697
|
}
|
|
22697
|
-
function
|
|
22698
|
+
function Kl(t) {
|
|
22698
22699
|
if (!t)
|
|
22699
22700
|
return null;
|
|
22700
22701
|
const e = t.trim().toLowerCase();
|
|
22701
22702
|
if (e === "transparent")
|
|
22702
22703
|
return null;
|
|
22703
|
-
const r =
|
|
22704
|
+
const r = Zl(e);
|
|
22704
22705
|
if (r)
|
|
22705
22706
|
return Ki(Number.parseInt(r.slice(1), 16));
|
|
22706
22707
|
const n = e.match(/^rgba?\((.*)\)$/);
|
|
@@ -22711,13 +22712,13 @@ function Zl(t) {
|
|
|
22711
22712
|
return null;
|
|
22712
22713
|
const i = (u) => {
|
|
22713
22714
|
if (u.endsWith("%")) {
|
|
22714
|
-
const
|
|
22715
|
-
return Ha(
|
|
22715
|
+
const d = Number.parseFloat(u.slice(0, -1));
|
|
22716
|
+
return Ha(d / 100 * 255);
|
|
22716
22717
|
}
|
|
22717
22718
|
const h = Number.parseFloat(u);
|
|
22718
22719
|
return Ha(h);
|
|
22719
22720
|
}, s = i(a[0]), o = i(a[1]), c = i(a[2]);
|
|
22720
|
-
return
|
|
22721
|
+
return jl([s, o, c]);
|
|
22721
22722
|
}
|
|
22722
22723
|
function uf(t) {
|
|
22723
22724
|
return t.replace(/\r\n|\r|\n/g, "\\P");
|
|
@@ -22725,14 +22726,14 @@ function uf(t) {
|
|
|
22725
22726
|
function hf(t) {
|
|
22726
22727
|
return t.replace(/\\P/g, "").replace(/\\~/g, "").includes("\\");
|
|
22727
22728
|
}
|
|
22728
|
-
function
|
|
22729
|
+
function Ql(t, e = !1) {
|
|
22729
22730
|
const r = /* @__PURE__ */ new Set(), n = /\\[fF](.*?)[;|]/g;
|
|
22730
22731
|
return [...t.matchAll(n)].forEach((a) => {
|
|
22731
22732
|
let i = a[1].toLowerCase();
|
|
22732
22733
|
e && (i = i.replace(/\.(ttf|otf|woff|shx)$/, "")), r.add(i);
|
|
22733
22734
|
}), r;
|
|
22734
22735
|
}
|
|
22735
|
-
class
|
|
22736
|
+
class Jl {
|
|
22736
22737
|
/**
|
|
22737
22738
|
* Creates a new ContextStack with an initial context.
|
|
22738
22739
|
* @param initial The initial MTextContext to use as the base of the stack.
|
|
@@ -22785,7 +22786,7 @@ class Ql {
|
|
|
22785
22786
|
this.stack[this.stack.length - 1] = e;
|
|
22786
22787
|
}
|
|
22787
22788
|
}
|
|
22788
|
-
class
|
|
22789
|
+
class ef {
|
|
22789
22790
|
/**
|
|
22790
22791
|
* Creates a new MTextParser instance
|
|
22791
22792
|
* @param content - The MText content to parse
|
|
@@ -22795,7 +22796,7 @@ class Jl {
|
|
|
22795
22796
|
constructor(e, r, n = {}) {
|
|
22796
22797
|
this.continueStroke = !1, this.inStackContext = !1, this.scanner = new Pr(e);
|
|
22797
22798
|
const a = r ?? new Dt();
|
|
22798
|
-
this.ctxStack = new
|
|
22799
|
+
this.ctxStack = new Jl(a), this.yieldPropertyCommands = n.yieldPropertyCommands ?? !1, this.resetParagraphParameters = n.resetParagraphParameters ?? !1, this.mifDecoder = n.mifDecoder ?? this.decodeMultiByteChar.bind(this), this.mifCodeLength = n.mifCodeLength ?? "auto";
|
|
22799
22800
|
}
|
|
22800
22801
|
/**
|
|
22801
22802
|
* Decode multi-byte character from hex code
|
|
@@ -22879,11 +22880,11 @@ class Jl {
|
|
|
22879
22880
|
}, o = (c) => {
|
|
22880
22881
|
let u = "", h = c;
|
|
22881
22882
|
for (; e.hasData; ) {
|
|
22882
|
-
const [
|
|
22883
|
-
if (!(h &&
|
|
22884
|
-
if (h = !1, !l &&
|
|
22883
|
+
const [d, l] = i();
|
|
22884
|
+
if (!(h && d === " ")) {
|
|
22885
|
+
if (h = !1, !l && d === ";")
|
|
22885
22886
|
break;
|
|
22886
|
-
u +=
|
|
22887
|
+
u += d;
|
|
22887
22888
|
}
|
|
22888
22889
|
}
|
|
22889
22890
|
return u;
|
|
@@ -23179,7 +23180,7 @@ class Jl {
|
|
|
23179
23180
|
break;
|
|
23180
23181
|
case "q": {
|
|
23181
23182
|
const h = r.get();
|
|
23182
|
-
for (s =
|
|
23183
|
+
for (s = Yl[h] || ee.DEFAULT; r.peek() === ","; )
|
|
23183
23184
|
r.consume(1);
|
|
23184
23185
|
break;
|
|
23185
23186
|
}
|
|
@@ -23188,11 +23189,11 @@ class Jl {
|
|
|
23188
23189
|
const h = r.peek();
|
|
23189
23190
|
if (h === "r" || h === "c") {
|
|
23190
23191
|
r.consume(1);
|
|
23191
|
-
const
|
|
23192
|
-
o.push(h +
|
|
23192
|
+
const d = c();
|
|
23193
|
+
o.push(h + d.toString());
|
|
23193
23194
|
} else {
|
|
23194
|
-
const
|
|
23195
|
-
isNaN(
|
|
23195
|
+
const d = c();
|
|
23196
|
+
isNaN(d) ? r.consume(1) : o.push(d);
|
|
23196
23197
|
}
|
|
23197
23198
|
}
|
|
23198
23199
|
break;
|
|
@@ -23262,17 +23263,17 @@ class Jl {
|
|
|
23262
23263
|
return [Z.WRAP_AT_DIMLINE, null];
|
|
23263
23264
|
case "S": {
|
|
23264
23265
|
this.inStackContext = !0;
|
|
23265
|
-
const
|
|
23266
|
-
return this.inStackContext = !1,
|
|
23266
|
+
const d = this.parseStacking();
|
|
23267
|
+
return this.inStackContext = !1, d;
|
|
23267
23268
|
}
|
|
23268
23269
|
case "m":
|
|
23269
23270
|
case "M":
|
|
23270
23271
|
if (this.scanner.peek() === "+") {
|
|
23271
23272
|
this.scanner.consume(1);
|
|
23272
|
-
const
|
|
23273
|
-
if (
|
|
23274
|
-
this.scanner.consume(
|
|
23275
|
-
const l = this.mifDecoder(
|
|
23273
|
+
const d = this.extractMifCode(this.mifCodeLength);
|
|
23274
|
+
if (d) {
|
|
23275
|
+
this.scanner.consume(d.length);
|
|
23276
|
+
const l = this.mifDecoder(d);
|
|
23276
23277
|
return s ? [e, s] : [e, l];
|
|
23277
23278
|
}
|
|
23278
23279
|
this.scanner.consume(-1);
|
|
@@ -23282,14 +23283,14 @@ class Jl {
|
|
|
23282
23283
|
case "U":
|
|
23283
23284
|
if (this.scanner.peek() === "+") {
|
|
23284
23285
|
this.scanner.consume(1);
|
|
23285
|
-
const
|
|
23286
|
-
if (
|
|
23287
|
-
const l =
|
|
23286
|
+
const d = this.scanner.tail.match(/^[0-9A-Fa-f]{4,8}/);
|
|
23287
|
+
if (d) {
|
|
23288
|
+
const l = d[0];
|
|
23288
23289
|
this.scanner.consume(l.length);
|
|
23289
|
-
const
|
|
23290
|
+
const p = parseInt(l, 16);
|
|
23290
23291
|
let x = "";
|
|
23291
23292
|
try {
|
|
23292
|
-
x = String.fromCodePoint(
|
|
23293
|
+
x = String.fromCodePoint(p);
|
|
23293
23294
|
} catch {
|
|
23294
23295
|
x = "▯";
|
|
23295
23296
|
}
|
|
@@ -23302,27 +23303,27 @@ class Jl {
|
|
|
23302
23303
|
default:
|
|
23303
23304
|
if (h)
|
|
23304
23305
|
try {
|
|
23305
|
-
const
|
|
23306
|
-
if (this.yieldPropertyCommands &&
|
|
23307
|
-
return [Z.PROPERTIES_CHANGED,
|
|
23306
|
+
const d = this.parseProperties(h);
|
|
23307
|
+
if (this.yieldPropertyCommands && d)
|
|
23308
|
+
return [Z.PROPERTIES_CHANGED, d];
|
|
23308
23309
|
continue;
|
|
23309
23310
|
} catch {
|
|
23310
|
-
const
|
|
23311
|
-
s +=
|
|
23311
|
+
const d = this.scanner.tail.slice(u, this.scanner.currentIndex);
|
|
23312
|
+
s += d;
|
|
23312
23313
|
}
|
|
23313
23314
|
}
|
|
23314
23315
|
continue;
|
|
23315
23316
|
}
|
|
23316
23317
|
if (c === "%" && this.scanner.peek(1) === "%") {
|
|
23317
|
-
const h = this.scanner.peek(2).toLowerCase(),
|
|
23318
|
-
if (
|
|
23319
|
-
this.scanner.consume(3), s +=
|
|
23318
|
+
const h = this.scanner.peek(2).toLowerCase(), d = Xl[h];
|
|
23319
|
+
if (d) {
|
|
23320
|
+
this.scanner.consume(3), s += d;
|
|
23320
23321
|
continue;
|
|
23321
23322
|
} else {
|
|
23322
23323
|
const l = [h, this.scanner.peek(3), this.scanner.peek(4)];
|
|
23323
|
-
if (l.every((
|
|
23324
|
-
const
|
|
23325
|
-
this.scanner.consume(5), s += String.fromCharCode(
|
|
23324
|
+
if (l.every((p) => p >= "0" && p <= "9")) {
|
|
23325
|
+
const p = Number.parseInt(l.join(""), 10);
|
|
23326
|
+
this.scanner.consume(5), s += String.fromCharCode(p);
|
|
23326
23327
|
} else
|
|
23327
23328
|
this.scanner.consume(3);
|
|
23328
23329
|
continue;
|
|
@@ -23342,11 +23343,11 @@ class Jl {
|
|
|
23342
23343
|
if (this.scanner.consume(1), this.yieldPropertyCommands) {
|
|
23343
23344
|
const h = this.ctxStack.current;
|
|
23344
23345
|
this.popCtx();
|
|
23345
|
-
const
|
|
23346
|
-
if (Object.keys(
|
|
23346
|
+
const d = this.getPropertyChanges(h, this.ctxStack.current);
|
|
23347
|
+
if (Object.keys(d).length > 0)
|
|
23347
23348
|
return [
|
|
23348
23349
|
Z.PROPERTIES_CHANGED,
|
|
23349
|
-
{ command: void 0, changes:
|
|
23350
|
+
{ command: void 0, changes: d, depth: this.ctxStack.depth }
|
|
23350
23351
|
];
|
|
23351
23352
|
} else
|
|
23352
23353
|
this.popCtx();
|
|
@@ -23356,15 +23357,15 @@ class Jl {
|
|
|
23356
23357
|
if (!this.inStackContext && c === "^") {
|
|
23357
23358
|
const h = this.scanner.peek(1);
|
|
23358
23359
|
if (h) {
|
|
23359
|
-
const
|
|
23360
|
-
if (this.scanner.consume(2),
|
|
23360
|
+
const d = h.charCodeAt(0);
|
|
23361
|
+
if (this.scanner.consume(2), d === 32)
|
|
23361
23362
|
s += "^";
|
|
23362
23363
|
else {
|
|
23363
|
-
if (
|
|
23364
|
+
if (d === 73)
|
|
23364
23365
|
return s ? [e, s] : [Z.TABULATOR, null];
|
|
23365
|
-
if (
|
|
23366
|
+
if (d === 74)
|
|
23366
23367
|
return s ? [e, s] : [Z.NEW_PARAGRAPH, null];
|
|
23367
|
-
if (
|
|
23368
|
+
if (d === 77)
|
|
23368
23369
|
continue;
|
|
23369
23370
|
s += "▯";
|
|
23370
23371
|
}
|
|
@@ -23583,14 +23584,14 @@ class vt {
|
|
|
23583
23584
|
* Returns null if the color is ACI-based and has no RGB value.
|
|
23584
23585
|
*/
|
|
23585
23586
|
toCssColor() {
|
|
23586
|
-
return this._rgbValue !== null ?
|
|
23587
|
+
return this._rgbValue !== null ? $l(this._rgbValue) : null;
|
|
23587
23588
|
}
|
|
23588
23589
|
/**
|
|
23589
23590
|
* Create an MTextColor from a CSS color string.
|
|
23590
23591
|
* Supports #rgb, #rrggbb, rgb(...), rgba(...). Returns null if invalid or transparent.
|
|
23591
23592
|
*/
|
|
23592
23593
|
static fromCssColor(e) {
|
|
23593
|
-
const r =
|
|
23594
|
+
const r = Kl(e);
|
|
23594
23595
|
if (r === null)
|
|
23595
23596
|
return null;
|
|
23596
23597
|
const n = new vt();
|
|
@@ -23799,7 +23800,7 @@ const tr = "", ct = () => ({
|
|
|
23799
23800
|
layer: "0",
|
|
23800
23801
|
color: new vt()
|
|
23801
23802
|
});
|
|
23802
|
-
function
|
|
23803
|
+
function tf(t) {
|
|
23803
23804
|
if (!(!t || [
|
|
23804
23805
|
t.min.x,
|
|
23805
23806
|
t.min.y,
|
|
@@ -23813,12 +23814,12 @@ function ef(t) {
|
|
|
23813
23814
|
function nn(t, e, r) {
|
|
23814
23815
|
const n = [];
|
|
23815
23816
|
if (t.filter((l) => l.char !== tr).forEach((l) => {
|
|
23816
|
-
const
|
|
23817
|
-
new
|
|
23817
|
+
const p = tf(
|
|
23818
|
+
new R.Box3().copy(l.box).applyMatrix4(e)
|
|
23818
23819
|
);
|
|
23819
|
-
|
|
23820
|
+
p && n.push({
|
|
23820
23821
|
type: se.CHAR,
|
|
23821
|
-
box:
|
|
23822
|
+
box: p,
|
|
23822
23823
|
char: l.char,
|
|
23823
23824
|
children: []
|
|
23824
23825
|
});
|
|
@@ -23834,19 +23835,19 @@ function nn(t, e, r) {
|
|
|
23834
23835
|
}
|
|
23835
23836
|
const c = n.slice(0, s).filter(a), u = n.slice(o + 1).filter(a), h = n.slice(s, o + 1).filter(i);
|
|
23836
23837
|
if (h.length === 0) return [...c, ...u];
|
|
23837
|
-
const
|
|
23838
|
-
return h.slice(1).forEach((l) =>
|
|
23838
|
+
const d = new R.Box3().copy(h[0].box);
|
|
23839
|
+
return h.slice(1).forEach((l) => d.union(l.box)), [
|
|
23839
23840
|
...c,
|
|
23840
23841
|
{
|
|
23841
23842
|
type: se.STACK,
|
|
23842
23843
|
char: "",
|
|
23843
|
-
box:
|
|
23844
|
+
box: d,
|
|
23844
23845
|
children: h
|
|
23845
23846
|
},
|
|
23846
23847
|
...u
|
|
23847
23848
|
];
|
|
23848
23849
|
}
|
|
23849
|
-
const
|
|
23850
|
+
const rf = /* @__PURE__ */ new R.Vector3();
|
|
23850
23851
|
class wn extends Dt {
|
|
23851
23852
|
/**
|
|
23852
23853
|
* Creates a new RenderContext instance with optional initial values.
|
|
@@ -23992,7 +23993,7 @@ class nf {
|
|
|
23992
23993
|
* The height of current line of texts
|
|
23993
23994
|
*/
|
|
23994
23995
|
get currentLineHeight() {
|
|
23995
|
-
const e = this.defaultLineSpaceFactor * this.currentFontSize *
|
|
23996
|
+
const e = this.defaultLineSpaceFactor * this.currentFontSize * ql, r = this.currentMaxFontSize > 0 ? this.currentMaxFontSize : this.currentFontSize;
|
|
23996
23997
|
return e + r;
|
|
23997
23998
|
}
|
|
23998
23999
|
/**
|
|
@@ -24234,7 +24235,7 @@ class nf {
|
|
|
24234
24235
|
*/
|
|
24235
24236
|
processText(e) {
|
|
24236
24237
|
this._lastCharBoxTarget = void 0;
|
|
24237
|
-
const r = [], n = [], a = [], i = [], s = new
|
|
24238
|
+
const r = [], n = [], a = [], i = [], s = new R.Group();
|
|
24238
24239
|
for (const o of e)
|
|
24239
24240
|
if (o.type === Z.NEW_PARAGRAPH)
|
|
24240
24241
|
this.startNewParagraph(
|
|
@@ -24340,7 +24341,7 @@ class nf {
|
|
|
24340
24341
|
);
|
|
24341
24342
|
i.add(c), this._currentLineObjects.push(c), e.length = 0, r.length = 0, n.length = 0, a.length = 0, this._processedCharCount += o;
|
|
24342
24343
|
} else if (n.length > 0 || a.length > 0) {
|
|
24343
|
-
const c = new
|
|
24344
|
+
const c = new R.Object3D();
|
|
24344
24345
|
c.userData.bboxIntersectionCheck = !0, c.userData.charBoxType = s, c.userData.layout = {
|
|
24345
24346
|
chars: [...n, ...a]
|
|
24346
24347
|
}, i.add(c), this._currentLineObjects.push(c), n.length = 0, a.length = 0, this._processedCharCount += o;
|
|
@@ -24363,7 +24364,7 @@ class nf {
|
|
|
24363
24364
|
);
|
|
24364
24365
|
}
|
|
24365
24366
|
processStack(e, r, n, a, i) {
|
|
24366
|
-
const [s, o, c] = e, u = this._hOffset, h = this._vOffset,
|
|
24367
|
+
const [s, o, c] = e, u = this._hOffset, h = this._vOffset, d = this._currentContext.charTrackingFactor.value, l = this.currentFontSize, p = this._currentContext.fontSizeScaleFactor;
|
|
24367
24368
|
this._hOffset = u, this._currentContext.charTrackingFactor = { value: 1, isRelative: !1 };
|
|
24368
24369
|
let x = 0;
|
|
24369
24370
|
for (let w = 0; w < s.length; w++) {
|
|
@@ -24376,9 +24377,9 @@ class nf {
|
|
|
24376
24377
|
const k = this.getCharShape(o[w]);
|
|
24377
24378
|
k && (v += k.width * this.currentWidthFactor);
|
|
24378
24379
|
}
|
|
24379
|
-
const b = Math.max(x, v),
|
|
24380
|
+
const b = Math.max(x, v), y = (b - x) / 2, F = (b - v) / 2;
|
|
24380
24381
|
if (c === "^") {
|
|
24381
|
-
if (this._currentContext.fontSizeScaleFactor =
|
|
24382
|
+
if (this._currentContext.fontSizeScaleFactor = p * 0.7, this.calcuateLineParams(), s && !o) {
|
|
24382
24383
|
const w = [], k = [], C = [], U = [];
|
|
24383
24384
|
this._hOffset = u, this._vOffset = this.convertTopAlignedVOffset(
|
|
24384
24385
|
h + l * 0.1,
|
|
@@ -24409,10 +24410,10 @@ class nf {
|
|
|
24409
24410
|
);
|
|
24410
24411
|
r.push(...w), n.push(...k), a.push(...C), i.push(...U), this._hOffset = u + v;
|
|
24411
24412
|
}
|
|
24412
|
-
this._currentContext.fontSizeScaleFactor =
|
|
24413
|
+
this._currentContext.fontSizeScaleFactor = p, this.calcuateLineParams();
|
|
24413
24414
|
} else {
|
|
24414
24415
|
const w = [], k = [], C = [], U = [];
|
|
24415
|
-
this._hOffset = u +
|
|
24416
|
+
this._hOffset = u + y, this._vOffset = this.convertTopAlignedVOffset(
|
|
24416
24417
|
h + this.currentFontSize * 0.3,
|
|
24417
24418
|
this.currentFontSize
|
|
24418
24419
|
);
|
|
@@ -24445,7 +24446,7 @@ class nf {
|
|
|
24445
24446
|
W
|
|
24446
24447
|
);
|
|
24447
24448
|
if (r.push(...B), n.push(...O), a.push(...H), i.push(...W), c === "/" || c === "#") {
|
|
24448
|
-
const z = new
|
|
24449
|
+
const z = new R.BufferGeometry(), le = new Float32Array([
|
|
24449
24450
|
u,
|
|
24450
24451
|
h - this.currentFontSize * 0.8 + this.defaultFontSize * Zt,
|
|
24451
24452
|
0,
|
|
@@ -24455,21 +24456,21 @@ class nf {
|
|
|
24455
24456
|
]);
|
|
24456
24457
|
z.setAttribute(
|
|
24457
24458
|
"position",
|
|
24458
|
-
new
|
|
24459
|
+
new R.BufferAttribute(le, 3)
|
|
24459
24460
|
), z.setIndex(null), z.userData = { isDecoration: !0 }, n.push(z);
|
|
24460
24461
|
}
|
|
24461
24462
|
this._hOffset = u + b;
|
|
24462
24463
|
}
|
|
24463
24464
|
this._vOffset = h, this._currentContext.charTrackingFactor = {
|
|
24464
|
-
value:
|
|
24465
|
+
value: d,
|
|
24465
24466
|
isRelative: !1
|
|
24466
24467
|
};
|
|
24467
24468
|
}
|
|
24468
24469
|
recordStackDivider(e, r, n, a, i) {
|
|
24469
24470
|
if (this._options.collectCharBoxes === !1) return;
|
|
24470
|
-
const s = r - this.currentFontSize * 0.8 + this.defaultFontSize * Zt, o = new
|
|
24471
|
-
new
|
|
24472
|
-
new
|
|
24471
|
+
const s = r - this.currentFontSize * 0.8 + this.defaultFontSize * Zt, o = new R.Box3(
|
|
24472
|
+
new R.Vector3(e, s, 0),
|
|
24473
|
+
new R.Vector3(e + n, s, 0)
|
|
24473
24474
|
);
|
|
24474
24475
|
this.resolveCharBoxTarget(a, i) === "mesh" ? a.push({
|
|
24475
24476
|
type: se.CHAR,
|
|
@@ -24492,9 +24493,9 @@ class nf {
|
|
|
24492
24493
|
}
|
|
24493
24494
|
processBlank(e, r) {
|
|
24494
24495
|
if (this._options.collectCharBoxes !== !1) {
|
|
24495
|
-
const n = this._hOffset, a = this.flowDirection == Ye.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.currentLayoutFontSize, i = new
|
|
24496
|
-
new
|
|
24497
|
-
new
|
|
24496
|
+
const n = this._hOffset, a = this.flowDirection == Ye.BOTTOM_TO_TOP ? this._vOffset : this._vOffset - this.currentLayoutFontSize, i = new R.Box3(
|
|
24497
|
+
new R.Vector3(n, a, 0),
|
|
24498
|
+
new R.Vector3(
|
|
24498
24499
|
n + this._currentContext.blankWidth,
|
|
24499
24500
|
a + this.currentLayoutFontSize,
|
|
24500
24501
|
0
|
|
@@ -24540,8 +24541,8 @@ class nf {
|
|
|
24540
24541
|
o.scale(this.currentWidthFactor, 1, 1);
|
|
24541
24542
|
let c = this._currentContext.oblique;
|
|
24542
24543
|
if (this._currentContext.italic && (c += 15), c) {
|
|
24543
|
-
const b = c * Math.PI / 180,
|
|
24544
|
-
|
|
24544
|
+
const b = c * Math.PI / 180, y = new R.Matrix4();
|
|
24545
|
+
y.set(
|
|
24545
24546
|
1,
|
|
24546
24547
|
Math.tan(b),
|
|
24547
24548
|
0,
|
|
@@ -24558,15 +24559,15 @@ class nf {
|
|
|
24558
24559
|
0,
|
|
24559
24560
|
0,
|
|
24560
24561
|
1
|
|
24561
|
-
), o.applyMatrix4(
|
|
24562
|
+
), o.applyMatrix4(y);
|
|
24562
24563
|
}
|
|
24563
24564
|
const u = this.fontManager.getFontType(this.currentFont);
|
|
24564
24565
|
this._currentContext.bold && u === "mesh" && o.scale(1.06, 1.06, 1), this.hOffset > (this.maxLineWidth || 1 / 0) && (this.recordVisualLineBreak(a, i), this.advanceToNextLine(!1));
|
|
24565
|
-
const h = this.hOffset,
|
|
24566
|
-
if (o.translate(h,
|
|
24566
|
+
const h = this.hOffset, d = this.flowDirection == Ye.BOTTOM_TO_TOP ? this.vOffset : this.vOffset - this.currentLayoutFontSize, l = s.width * this.currentWidthFactor, p = this.currentLayoutFontSize;
|
|
24567
|
+
if (o.translate(h, d, 0), this.currentHorizontalAlignment == ee.DISTRIBUTED ? this._hOffset += s.width * this.currentWidthFactor : this._hOffset += s.width * this.currentWordSpace * this.currentWidthFactor, r.push(o), this._lineHasRenderableChar = !0, this._options.collectCharBoxes !== !1) {
|
|
24567
24568
|
o.userData.char = e, o.boundingBox || o.computeBoundingBox();
|
|
24568
|
-
const b = new
|
|
24569
|
-
o instanceof
|
|
24569
|
+
const b = new R.Box3().copy(o.boundingBox);
|
|
24570
|
+
o instanceof R.ShapeGeometry ? (this._lastCharBoxTarget = "mesh", a.push({
|
|
24570
24571
|
type: se.CHAR,
|
|
24571
24572
|
box: b,
|
|
24572
24573
|
char: e,
|
|
@@ -24578,18 +24579,18 @@ class nf {
|
|
|
24578
24579
|
children: []
|
|
24579
24580
|
}));
|
|
24580
24581
|
}
|
|
24581
|
-
const x =
|
|
24582
|
+
const x = p * 0.05, v = 1e-3;
|
|
24582
24583
|
if (this._currentContext.underline) {
|
|
24583
|
-
const b = new
|
|
24584
|
+
const b = new R.BufferGeometry(), y = d - x;
|
|
24584
24585
|
b.setAttribute(
|
|
24585
24586
|
"position",
|
|
24586
|
-
new
|
|
24587
|
+
new R.BufferAttribute(
|
|
24587
24588
|
new Float32Array([
|
|
24588
24589
|
h,
|
|
24589
|
-
|
|
24590
|
+
y,
|
|
24590
24591
|
v,
|
|
24591
24592
|
h + l,
|
|
24592
|
-
|
|
24593
|
+
y,
|
|
24593
24594
|
v
|
|
24594
24595
|
]),
|
|
24595
24596
|
3
|
|
@@ -24597,16 +24598,16 @@ class nf {
|
|
|
24597
24598
|
), b.setIndex(null), b.userData = { isDecoration: !0 }, n.push(b);
|
|
24598
24599
|
}
|
|
24599
24600
|
if (this._currentContext.overline) {
|
|
24600
|
-
const b = new
|
|
24601
|
+
const b = new R.BufferGeometry(), y = d + p + x;
|
|
24601
24602
|
b.setAttribute(
|
|
24602
24603
|
"position",
|
|
24603
|
-
new
|
|
24604
|
+
new R.BufferAttribute(
|
|
24604
24605
|
new Float32Array([
|
|
24605
24606
|
h,
|
|
24606
|
-
|
|
24607
|
+
y,
|
|
24607
24608
|
v,
|
|
24608
24609
|
h + l,
|
|
24609
|
-
|
|
24610
|
+
y,
|
|
24610
24611
|
v
|
|
24611
24612
|
]),
|
|
24612
24613
|
3
|
|
@@ -24614,16 +24615,16 @@ class nf {
|
|
|
24614
24615
|
), b.setIndex(null), b.userData = { isDecoration: !0 }, n.push(b);
|
|
24615
24616
|
}
|
|
24616
24617
|
if (this._currentContext.strikeThrough) {
|
|
24617
|
-
const b = new
|
|
24618
|
+
const b = new R.BufferGeometry(), y = d + p / 2 - p * 0.2;
|
|
24618
24619
|
b.setAttribute(
|
|
24619
24620
|
"position",
|
|
24620
|
-
new
|
|
24621
|
+
new R.BufferAttribute(
|
|
24621
24622
|
new Float32Array([
|
|
24622
24623
|
h,
|
|
24623
|
-
|
|
24624
|
+
y,
|
|
24624
24625
|
v,
|
|
24625
24626
|
h + l,
|
|
24626
|
-
|
|
24627
|
+
y,
|
|
24627
24628
|
v
|
|
24628
24629
|
]),
|
|
24629
24630
|
3
|
|
@@ -24676,16 +24677,16 @@ class nf {
|
|
|
24676
24677
|
}
|
|
24677
24678
|
countFinalCharBoxes(e, r, n) {
|
|
24678
24679
|
const a = [...e, ...r].filter(
|
|
24679
|
-
(
|
|
24680
|
+
(d) => d.char !== tr
|
|
24680
24681
|
);
|
|
24681
24682
|
if (n !== se.STACK)
|
|
24682
24683
|
return a.length;
|
|
24683
|
-
const i = (
|
|
24684
|
+
const i = (d) => d.type === se.CHAR && d.char.trim().length === 0, s = (d) => d.type === se.CHAR && d.char.trim().length > 0, o = a.findIndex(s);
|
|
24684
24685
|
if (o < 0) return a.filter(i).length;
|
|
24685
24686
|
let c = -1;
|
|
24686
|
-
for (let
|
|
24687
|
-
if (s(a[
|
|
24688
|
-
c =
|
|
24687
|
+
for (let d = a.length - 1; d >= 0; d--)
|
|
24688
|
+
if (s(a[d])) {
|
|
24689
|
+
c = d;
|
|
24689
24690
|
break;
|
|
24690
24691
|
}
|
|
24691
24692
|
const u = a.slice(0, o).filter(i), h = a.slice(c + 1).filter(i);
|
|
@@ -24716,14 +24717,14 @@ class nf {
|
|
|
24716
24717
|
if (e.forEach((s, o) => {
|
|
24717
24718
|
s.geometry.boundingBox || s.geometry.computeBoundingBox(), o === 0 ? r = s.geometry.boundingBox : r.union(s.geometry.boundingBox);
|
|
24718
24719
|
}), !r) return;
|
|
24719
|
-
const n = r, a = n.getSize(
|
|
24720
|
+
const n = r, a = n.getSize(rf), i = (s, o) => {
|
|
24720
24721
|
var u, h;
|
|
24721
24722
|
const c = (h = (u = s.userData) == null ? void 0 : u.layout) == null ? void 0 : h.chars;
|
|
24722
24723
|
if (c && c.length > 0) {
|
|
24723
|
-
const
|
|
24724
|
+
const d = new R.Vector3(o, 0, 0);
|
|
24724
24725
|
c.forEach((l) => {
|
|
24725
|
-
var
|
|
24726
|
-
return (
|
|
24726
|
+
var p;
|
|
24727
|
+
return (p = l.box) == null ? void 0 : p.translate(d);
|
|
24727
24728
|
});
|
|
24728
24729
|
}
|
|
24729
24730
|
};
|
|
@@ -24779,21 +24780,21 @@ class nf {
|
|
|
24779
24780
|
* @returns Return three.js object created from the specified text shape geometries
|
|
24780
24781
|
*/
|
|
24781
24782
|
toThreeObject(e, r, n, a, i) {
|
|
24782
|
-
const s = new
|
|
24783
|
+
const s = new R.Group(), o = this.getMaterialColorSettings(), c = this.styleManager.getMeshBasicMaterial(
|
|
24783
24784
|
o
|
|
24784
24785
|
), u = this.styleManager.getLineBasicMaterial(
|
|
24785
24786
|
o
|
|
24786
|
-
), h = this._options.collectCharBoxes !== !1,
|
|
24787
|
-
if (
|
|
24788
|
-
const
|
|
24787
|
+
), h = this._options.collectCharBoxes !== !1, d = e.filter((p) => p instanceof R.ShapeGeometry);
|
|
24788
|
+
if (d.length > 0) {
|
|
24789
|
+
const p = d.length > 1 ? Sa(d) : d[0], x = new R.Mesh(p, c);
|
|
24789
24790
|
x.userData.bboxIntersectionCheck = !0, x.userData.charBoxType = i, h && n.length > 0 && (x.userData.layout = { chars: n.slice() }), s.add(x);
|
|
24790
24791
|
}
|
|
24791
24792
|
const l = [
|
|
24792
24793
|
...r,
|
|
24793
|
-
...e.filter((
|
|
24794
|
+
...e.filter((p) => !(p instanceof R.ShapeGeometry))
|
|
24794
24795
|
];
|
|
24795
24796
|
if (l.length > 0) {
|
|
24796
|
-
const
|
|
24797
|
+
const p = l.length > 1 ? Sa(l) : l[0], x = new R.LineSegments(p, u);
|
|
24797
24798
|
x.userData.bboxIntersectionCheck = !0, x.userData.charBoxType = i, h && a.length > 0 && (x.userData.layout = { chars: a.slice() }), s.add(x);
|
|
24798
24799
|
}
|
|
24799
24800
|
return s.children.length === 1 ? s.children[0] : s;
|
|
@@ -24816,8 +24817,8 @@ class nf {
|
|
|
24816
24817
|
};
|
|
24817
24818
|
}
|
|
24818
24819
|
}
|
|
24819
|
-
const wt = /* @__PURE__ */ new
|
|
24820
|
-
class cr extends
|
|
24820
|
+
const wt = /* @__PURE__ */ new R.Vector3(), Pe = /* @__PURE__ */ new R.Vector3(), Ne = /* @__PURE__ */ new R.Vector3(), rt = /* @__PURE__ */ new R.Vector3(), Gr = /* @__PURE__ */ new R.Vector3(), Hr = /* @__PURE__ */ new R.Quaternion(), zr = /* @__PURE__ */ new R.Matrix4(), za = /* @__PURE__ */ new R.Matrix4(), Wa = /* @__PURE__ */ new R.Vector3(1, 0, 0);
|
|
24821
|
+
class cr extends R.Object3D {
|
|
24821
24822
|
/**
|
|
24822
24823
|
* Extracts all unique font names used in an MText string.
|
|
24823
24824
|
* This function searches for font commands in the format \f{fontname}| or \f{fontname}; and returns a set of unique font names.
|
|
@@ -24834,7 +24835,7 @@ class cr extends M.Object3D {
|
|
|
24834
24835
|
* ```
|
|
24835
24836
|
*/
|
|
24836
24837
|
static getFonts(e, r = !1) {
|
|
24837
|
-
return
|
|
24838
|
+
return Ql(e, r);
|
|
24838
24839
|
}
|
|
24839
24840
|
/**
|
|
24840
24841
|
* Creates a new instance of MText.
|
|
@@ -24850,7 +24851,7 @@ class cr extends M.Object3D {
|
|
|
24850
24851
|
byBlockColor: i.byBlockColor,
|
|
24851
24852
|
layer: i.layer,
|
|
24852
24853
|
color: i.color.copy()
|
|
24853
|
-
}, this._box = new
|
|
24854
|
+
}, this._box = new R.Box3(), this._layoutData = void 0, this._mtextData = e, this._fontsInStyleLoaded = !1;
|
|
24854
24855
|
}
|
|
24855
24856
|
/**
|
|
24856
24857
|
* Gets the font manager instance associated with this MText object.
|
|
@@ -24902,9 +24903,10 @@ class cr extends M.Object3D {
|
|
|
24902
24903
|
minY: 1 / 0,
|
|
24903
24904
|
maxY: -1 / 0,
|
|
24904
24905
|
minZ: 1 / 0,
|
|
24905
|
-
maxZ: -1 / 0
|
|
24906
|
+
maxZ: -1 / 0,
|
|
24907
|
+
hasLogicalBounds: !1
|
|
24906
24908
|
};
|
|
24907
|
-
this.updateBoxFromObject(e, r), r.hasLine && (this.box.isEmpty() ? (this.box.min.set(r.minX, r.minY, r.minZ), this.box.max.set(r.maxX, r.maxY, r.maxZ)) : (this.box.min.y = Math.min(this.box.min.y, r.minY), this.box.max.y = Math.max(this.box.max.y, r.maxY))), this.add(e);
|
|
24909
|
+
this.updateBoxFromObject(e, r), r.hasLine && !r.hasLogicalBounds && (this.box.isEmpty() ? (this.box.min.set(r.minX, r.minY, r.minZ), this.box.max.set(r.maxX, r.maxY, r.maxZ)) : (this.box.min.y = Math.min(this.box.min.y, r.minY), this.box.max.y = Math.max(this.box.max.y, r.maxY))), this.add(e);
|
|
24908
24910
|
}
|
|
24909
24911
|
}
|
|
24910
24912
|
/**
|
|
@@ -24974,50 +24976,57 @@ class cr extends M.Object3D {
|
|
|
24974
24976
|
if (!n)
|
|
24975
24977
|
return;
|
|
24976
24978
|
n.matrix.decompose(rt, Hr, Gr), e.position && (rt.x += e.position.x, rt.y += e.position.y, n.matrix.compose(rt, Hr, Gr));
|
|
24977
|
-
let i = e.width
|
|
24979
|
+
let i = e.width;
|
|
24978
24980
|
n.updateWorldMatrix(!0, !0);
|
|
24979
|
-
const
|
|
24980
|
-
if (!o.isEmpty()) {
|
|
24981
|
-
const g = o.max.y - o.min.y;
|
|
24982
|
-
Number.isFinite(g) && g > 0 && (s = g);
|
|
24983
|
-
}
|
|
24981
|
+
const s = new R.Box3().setFromObject(n);
|
|
24984
24982
|
if (!Number.isFinite(i)) {
|
|
24985
|
-
const
|
|
24986
|
-
i = Number.isFinite(
|
|
24983
|
+
const p = s.max.x - s.min.x;
|
|
24984
|
+
i = Number.isFinite(p) && p > 0 ? p : 0;
|
|
24987
24985
|
}
|
|
24988
|
-
const
|
|
24986
|
+
const o = this.measureAnchorMetrics(
|
|
24987
|
+
n,
|
|
24989
24988
|
i,
|
|
24989
|
+
a,
|
|
24990
24990
|
s,
|
|
24991
|
-
e.attachmentPoint,
|
|
24992
24991
|
e.drawingDirection
|
|
24993
|
-
),
|
|
24994
|
-
|
|
24995
|
-
|
|
24996
|
-
|
|
24997
|
-
|
|
24992
|
+
), c = this.calculateAnchorPoint(
|
|
24993
|
+
o,
|
|
24994
|
+
e.attachmentPoint
|
|
24995
|
+
);
|
|
24996
|
+
n.userData.logicalBounds = {
|
|
24997
|
+
minX: o.minX + c.x,
|
|
24998
|
+
maxX: o.maxX + c.x,
|
|
24999
|
+
minY: o.minY + c.y,
|
|
25000
|
+
maxY: o.maxY + c.y
|
|
25001
|
+
};
|
|
25002
|
+
const u = (p) => {
|
|
25003
|
+
if (!p || p.length === 0) return;
|
|
25004
|
+
const x = new R.Vector3(c.x, c.y, 0), v = (b) => {
|
|
25005
|
+
var y;
|
|
25006
|
+
(y = b.box) == null || y.translate(x), b.children && b.children.length > 0 && b.children.forEach(v);
|
|
24998
25007
|
};
|
|
24999
|
-
|
|
25000
|
-
}, h = (
|
|
25001
|
-
!
|
|
25008
|
+
p.forEach(v);
|
|
25009
|
+
}, h = (p) => {
|
|
25010
|
+
!p || p.length === 0 || p.forEach((x) => {
|
|
25002
25011
|
x.y += c.y;
|
|
25003
25012
|
});
|
|
25004
25013
|
};
|
|
25005
|
-
n.traverse((
|
|
25014
|
+
n.traverse((p) => {
|
|
25006
25015
|
var x, v, b;
|
|
25007
|
-
"geometry" in
|
|
25008
|
-
(v = (x =
|
|
25016
|
+
"geometry" in p && p.geometry.translate(c.x, c.y, 0), u(
|
|
25017
|
+
(v = (x = p.userData) == null ? void 0 : x.layout) == null ? void 0 : v.chars
|
|
25009
25018
|
), h(
|
|
25010
|
-
(b =
|
|
25011
|
-
),
|
|
25019
|
+
(b = p.userData) == null ? void 0 : b.lineLayouts
|
|
25020
|
+
), p.layers.enableAll();
|
|
25012
25021
|
});
|
|
25013
|
-
let
|
|
25022
|
+
let d = e.rotation || 0;
|
|
25014
25023
|
if (e.directionVector) {
|
|
25015
|
-
const
|
|
25016
|
-
|
|
25024
|
+
const p = e.directionVector, x = new R.Vector3(p.x, p.y, p.z), v = x.clone().cross(Wa), b = Wa.angleTo(x);
|
|
25025
|
+
d = v.z > 0 ? -b : b;
|
|
25017
25026
|
}
|
|
25018
25027
|
n.matrix.compose(rt, Hr, Gr);
|
|
25019
25028
|
const l = e.position ? rt.clone().sub(e.position) : rt;
|
|
25020
|
-
return zr.makeTranslation(-l.x, -l.y, 0), za.makeRotationZ(
|
|
25029
|
+
return zr.makeTranslation(-l.x, -l.y, 0), za.makeRotationZ(d), n.matrix.multiply(zr), n.matrix.multiply(za), n.matrix.multiply(zr.invert()), n.matrix.decompose(n.position, n.quaternion, n.scale), n;
|
|
25021
25030
|
}
|
|
25022
25031
|
/**
|
|
25023
25032
|
* Creates a group of text elements from MText data.
|
|
@@ -25027,8 +25036,8 @@ class cr extends M.Object3D {
|
|
|
25027
25036
|
*/
|
|
25028
25037
|
createMTextGroup(e, r) {
|
|
25029
25038
|
if (r && r.font && r.font.endsWith(".shx")) {
|
|
25030
|
-
const
|
|
25031
|
-
this.styleManager.unsupportedTextStyles[
|
|
25039
|
+
const y = `${r.font}_${r.name}`;
|
|
25040
|
+
this.styleManager.unsupportedTextStyles[y] || (this.styleManager.unsupportedTextStyles[y] = 0), this.styleManager.unsupportedTextStyles[y]++;
|
|
25032
25041
|
}
|
|
25033
25042
|
const n = e.width || 0, a = Number.isFinite(n) && n > 0;
|
|
25034
25043
|
let i = ee.LEFT;
|
|
@@ -25058,7 +25067,7 @@ class cr extends M.Object3D {
|
|
|
25058
25067
|
X.MiddleCenter,
|
|
25059
25068
|
X.MiddleRight
|
|
25060
25069
|
].includes(e.attachmentPoint) ? s = Ze.MIDDLE : s = Ze.BOTTOM);
|
|
25061
|
-
const o = e.height || r.fixedTextHeight || 0, c = e.widthFactor || r.widthFactor || 1, u = e.lineSpaceFactor || 0.3, h = e.drawingDirection ?? Ye.LEFT_TO_RIGHT,
|
|
25070
|
+
const o = e.height || r.fixedTextHeight || 0, c = e.widthFactor || r.widthFactor || 1, u = e.lineSpaceFactor || 0.3, h = e.drawingDirection ?? Ye.LEFT_TO_RIGHT, d = {
|
|
25062
25071
|
fontSize: o,
|
|
25063
25072
|
widthFactor: c,
|
|
25064
25073
|
lineSpaceFactor: u,
|
|
@@ -25077,73 +25086,147 @@ class cr extends M.Object3D {
|
|
|
25077
25086
|
value: c,
|
|
25078
25087
|
isRelative: !1
|
|
25079
25088
|
}, l.align = s, l.paragraph.align = i;
|
|
25080
|
-
const
|
|
25089
|
+
const p = new nf(
|
|
25081
25090
|
r,
|
|
25082
25091
|
this._colorSettings,
|
|
25083
25092
|
this.styleManager,
|
|
25084
25093
|
this.fontManager,
|
|
25085
|
-
|
|
25086
|
-
), v = new
|
|
25094
|
+
d
|
|
25095
|
+
), v = new ef(e.text, l, {
|
|
25087
25096
|
resetParagraphParameters: !0,
|
|
25088
25097
|
yieldPropertyCommands: !0
|
|
25089
25098
|
}).parse();
|
|
25090
25099
|
return {
|
|
25091
|
-
object:
|
|
25092
|
-
height:
|
|
25100
|
+
object: p.processText(v),
|
|
25101
|
+
height: p.totalHeight
|
|
25093
25102
|
};
|
|
25094
25103
|
}
|
|
25095
25104
|
/**
|
|
25096
|
-
*
|
|
25097
|
-
*
|
|
25098
|
-
* @
|
|
25099
|
-
*
|
|
25100
|
-
*
|
|
25101
|
-
*
|
|
25102
|
-
|
|
25103
|
-
|
|
25105
|
+
* Measures the logical text frame used by attachment-point anchoring.
|
|
25106
|
+
*
|
|
25107
|
+
* @remarks
|
|
25108
|
+
* Line-layout boxes include inter-line leading that is useful for hit testing, but
|
|
25109
|
+
* that leading must not become extra padding above the first rendered line when
|
|
25110
|
+
* aligning to top/middle/bottom attachment points. This method therefore prefers the
|
|
25111
|
+
* visible geometry height from `geometryBox` when it is non-empty, and only falls
|
|
25112
|
+
* back to `layoutHeight` when there are no measurable glyphs (e.g. empty or
|
|
25113
|
+
* whitespace-only runs).
|
|
25114
|
+
*
|
|
25115
|
+
* @param object - Root group produced by layout; traversed for {@link LineLayout}
|
|
25116
|
+
* metadata to locate the first line baseline.
|
|
25117
|
+
* @param width - Column width used for horizontal anchoring when finite and
|
|
25118
|
+
* positive; if not, horizontal extents are taken from `geometryBox`.
|
|
25119
|
+
* @param layoutHeight - Total laid-out height from {@link MTextProcessor} when
|
|
25120
|
+
* geometry height is unavailable or zero.
|
|
25121
|
+
* @param geometryBox - Axis-aligned bounds of rendered primitives under `object`,
|
|
25122
|
+
* typically from {@link THREE.Box3.setFromObject}.
|
|
25123
|
+
* @param flowDirection - Optional flow; when {@link MTextFlowDirection.BOTTOM_TO_TOP},
|
|
25124
|
+
* the vertical frame is anchored from the geometry minimum upward.
|
|
25125
|
+
* @returns Metrics consumed by {@link MText.calculateAnchorPoint}.
|
|
25126
|
+
*/
|
|
25127
|
+
measureAnchorMetrics(e, r, n, a, i) {
|
|
25128
|
+
const s = {
|
|
25129
|
+
hasLine: !1,
|
|
25130
|
+
minY: 1 / 0,
|
|
25131
|
+
maxY: -1 / 0,
|
|
25132
|
+
baselineY: 0
|
|
25133
|
+
};
|
|
25134
|
+
let o = !1;
|
|
25135
|
+
e.traverse((v) => {
|
|
25136
|
+
var y;
|
|
25137
|
+
const b = (y = v.userData) == null ? void 0 : y.lineLayouts;
|
|
25138
|
+
!b || b.length === 0 || b.forEach((F) => {
|
|
25139
|
+
const w = F.y - F.height / 2, k = F.y + F.height / 2;
|
|
25140
|
+
s.hasLine = !0, s.minY = Math.min(s.minY, w), s.maxY = Math.max(s.maxY, k), o || (s.baselineY = w, o = !0);
|
|
25141
|
+
});
|
|
25142
|
+
});
|
|
25143
|
+
const c = a.isEmpty() ? 0 : a.max.y - a.min.y, u = Number.isFinite(c) && c > 0 ? c : Number.isFinite(n) && n > 0 ? n : 0;
|
|
25144
|
+
let h = 0, d = Number.isFinite(r) && r > 0 ? r : 0;
|
|
25145
|
+
d <= h && !a.isEmpty() && (h = a.min.x, d = a.max.x);
|
|
25146
|
+
let l = 0, p = 0;
|
|
25147
|
+
i == Ye.BOTTOM_TO_TOP ? (l = a.isEmpty() ? 0 : a.min.y, p = l + u) : (p = a.isEmpty() ? 0 : a.max.y, l = p - u);
|
|
25148
|
+
const x = s.hasLine ? s.baselineY : l;
|
|
25149
|
+
return { minX: h, maxX: d, minY: l, maxY: p, baselineY: x };
|
|
25150
|
+
}
|
|
25151
|
+
/**
|
|
25152
|
+
* Computes the 2D translation that maps the logical frame described by `metrics`
|
|
25153
|
+
* so that the chosen AutoCAD-style attachment point coincides with the insertion
|
|
25154
|
+
* origin (before rotation/insertion-point transforms applied later in
|
|
25155
|
+
* {@link MText.loadMText}).
|
|
25156
|
+
*
|
|
25157
|
+
* @remarks
|
|
25158
|
+
* The returned vector is **added** to vertex positions and char-box metadata via
|
|
25159
|
+
* `geometry.translate` / `CharBox.box.translate` / line `y` offsets. For `undefined`
|
|
25160
|
+
* attachment, behavior matches {@link MTextAttachmentPoint.TopLeft}.
|
|
25161
|
+
*
|
|
25162
|
+
* @param metrics - Pre-anchoring frame from {@link MText.measureAnchorMetrics}.
|
|
25163
|
+
* @param attachmentPoint - DWG attachment constant; determines which corner, edge
|
|
25164
|
+
* center, or baseline of the frame is pinned to `(0,0)` in anchored space.
|
|
25165
|
+
* @returns Translation `(x, y)` in drawing units applied uniformly to the laid-out
|
|
25166
|
+
* group and its layout sidecars.
|
|
25167
|
+
*/
|
|
25168
|
+
calculateAnchorPoint(e, r) {
|
|
25169
|
+
const n = (e.minX + e.maxX) / 2, a = (e.minY + e.maxY) / 2;
|
|
25104
25170
|
let i = 0, s = 0;
|
|
25105
|
-
switch (
|
|
25171
|
+
switch (r) {
|
|
25106
25172
|
case void 0:
|
|
25107
25173
|
case X.TopLeft:
|
|
25108
|
-
i =
|
|
25174
|
+
i = -e.minX, s = -e.maxY;
|
|
25109
25175
|
break;
|
|
25110
25176
|
case X.TopCenter:
|
|
25111
|
-
i
|
|
25177
|
+
i = -n, s = -e.maxY;
|
|
25112
25178
|
break;
|
|
25113
25179
|
case X.TopRight:
|
|
25114
|
-
i
|
|
25180
|
+
i = -e.maxX, s = -e.maxY;
|
|
25115
25181
|
break;
|
|
25116
25182
|
case X.MiddleLeft:
|
|
25117
|
-
i =
|
|
25183
|
+
i = -e.minX, s = -a;
|
|
25118
25184
|
break;
|
|
25119
25185
|
case X.MiddleCenter:
|
|
25120
|
-
i
|
|
25186
|
+
i = -n, s = -a;
|
|
25121
25187
|
break;
|
|
25122
25188
|
case X.MiddleRight:
|
|
25123
|
-
i
|
|
25189
|
+
i = -e.maxX, s = -a;
|
|
25124
25190
|
break;
|
|
25125
25191
|
case X.BottomLeft:
|
|
25126
|
-
|
|
25127
|
-
i = 0, s += r;
|
|
25192
|
+
i = -e.minX, s = -e.minY;
|
|
25128
25193
|
break;
|
|
25129
25194
|
case X.BottomCenter:
|
|
25130
|
-
|
|
25131
|
-
i -= e / 2, s += r;
|
|
25195
|
+
i = -n, s = -e.minY;
|
|
25132
25196
|
break;
|
|
25133
25197
|
case X.BottomRight:
|
|
25198
|
+
i = -e.maxX, s = -e.minY;
|
|
25199
|
+
break;
|
|
25200
|
+
case X.BaselineLeft:
|
|
25201
|
+
i = -e.minX, s = -e.baselineY;
|
|
25202
|
+
break;
|
|
25203
|
+
case X.BaselineCenter:
|
|
25204
|
+
i = -n, s = -e.baselineY;
|
|
25205
|
+
break;
|
|
25134
25206
|
case X.BaselineRight:
|
|
25135
|
-
i
|
|
25207
|
+
i = -e.maxX, s = -e.baselineY;
|
|
25136
25208
|
break;
|
|
25137
25209
|
}
|
|
25138
|
-
return
|
|
25210
|
+
return { x: i, y: s };
|
|
25139
25211
|
}
|
|
25140
25212
|
/**
|
|
25141
|
-
*
|
|
25142
|
-
*
|
|
25143
|
-
*
|
|
25213
|
+
* Walks a laid-out MText subgraph and accumulates world-space character hit boxes and
|
|
25214
|
+
* soft line rectangles for {@link MText.createLayoutData} (raycasting, cursors, debug).
|
|
25215
|
+
*
|
|
25216
|
+
* @remarks
|
|
25217
|
+
* - When `userData.layout.chars` is present, entries are transformed with
|
|
25218
|
+
* {@link buildCharBoxesFromObject} and appended to `chars`, then recursion stops
|
|
25219
|
+
* for that branch (char metadata is authoritative).
|
|
25220
|
+
* - When only mesh/line geometry exists, a single synthetic {@link CharBox} wrapping
|
|
25221
|
+
* the geometry AABB may be emitted.
|
|
25222
|
+
* - `userData.lineLayouts` rows are converted to world-space center `y` and height.
|
|
25223
|
+
*
|
|
25224
|
+
* @param object - Node to traverse (typically the root group from {@link MText.loadMText}).
|
|
25225
|
+
* @param chars - Output collection; receives merged {@link CharBox} entries in world space.
|
|
25226
|
+
* @param lines - Output collection; receives {@link LineLayout} summaries per line break.
|
|
25144
25227
|
*/
|
|
25145
25228
|
getLayout(e, r, n) {
|
|
25146
|
-
var o, c, u, h,
|
|
25229
|
+
var o, c, u, h, d;
|
|
25147
25230
|
e.updateWorldMatrix(!1, !1);
|
|
25148
25231
|
const a = (c = (o = e.userData) == null ? void 0 : o.layout) == null ? void 0 : c.chars, i = (u = e.userData) == null ? void 0 : u.lineLayouts;
|
|
25149
25232
|
if (i && i.length > 0 && i.forEach((l) => {
|
|
@@ -25153,61 +25236,92 @@ class cr extends M.Object3D {
|
|
|
25153
25236
|
breakIndex: l.breakIndex
|
|
25154
25237
|
});
|
|
25155
25238
|
}), a && a.length > 0) {
|
|
25156
|
-
const l = (h = e.userData) == null ? void 0 : h.charBoxType,
|
|
25239
|
+
const l = (h = e.userData) == null ? void 0 : h.charBoxType, p = nn(
|
|
25157
25240
|
a,
|
|
25158
25241
|
e.matrixWorld,
|
|
25159
25242
|
l
|
|
25160
25243
|
);
|
|
25161
|
-
r.push(...
|
|
25244
|
+
r.push(...p);
|
|
25162
25245
|
return;
|
|
25163
25246
|
}
|
|
25164
|
-
if (e instanceof
|
|
25247
|
+
if (e instanceof R.Line || e instanceof R.Mesh) {
|
|
25165
25248
|
const l = e.geometry;
|
|
25166
|
-
if (!((
|
|
25249
|
+
if (!((d = l.userData) != null && d.isDecoration)) {
|
|
25167
25250
|
l.boundingBox === null && l.computeBoundingBox();
|
|
25168
|
-
const
|
|
25169
|
-
|
|
25251
|
+
const p = new R.Box3().copy(l.boundingBox);
|
|
25252
|
+
p.applyMatrix4(e.matrixWorld), r.push({
|
|
25170
25253
|
type: se.CHAR,
|
|
25171
|
-
box:
|
|
25254
|
+
box: p,
|
|
25172
25255
|
char: "",
|
|
25173
25256
|
children: []
|
|
25174
25257
|
});
|
|
25175
25258
|
}
|
|
25176
25259
|
}
|
|
25177
25260
|
const s = e.children;
|
|
25178
|
-
for (let l = 0,
|
|
25261
|
+
for (let l = 0, p = s.length; l < p; l++)
|
|
25179
25262
|
this.getLayout(s[l], r, n);
|
|
25180
25263
|
}
|
|
25264
|
+
/**
|
|
25265
|
+
* Depth-first union of this MText’s {@link MText.box} from layout metadata and mesh
|
|
25266
|
+
* geometry, while optionally tracking coarse line AABB in `lineBounds`.
|
|
25267
|
+
*
|
|
25268
|
+
* @remarks
|
|
25269
|
+
* Priority order per node:
|
|
25270
|
+
* 1. If `userData.logicalBounds` exists (set in {@link MText.loadMText}), union that
|
|
25271
|
+
* axis-aligned rectangle transformed by `matrixWorld` — this reflects anchored
|
|
25272
|
+
* logical extents even when individual glyphs are expensive to union.
|
|
25273
|
+
* 2. Else if `userData.lineLayouts` exists, expand `lineBounds` from the world-space
|
|
25274
|
+
* top/bottom of each line strip (used as a fallback when no logical bounds were
|
|
25275
|
+
* written, e.g. legacy paths).
|
|
25276
|
+
* 3. Else if `userData.layout.chars` exists, union each transformed char AABB.
|
|
25277
|
+
* 4. Else for mesh/line primitives, union non-decoration geometry bounds.
|
|
25278
|
+
* 5. Always recurse into children.
|
|
25279
|
+
*
|
|
25280
|
+
* @param object - Current scene graph node.
|
|
25281
|
+
* @param lineBounds - Mutable accumulator: `hasLine`/`min*`/`max*` track the union of
|
|
25282
|
+
* line-layout strips in world space; `hasLogicalBounds` flips true when any child
|
|
25283
|
+
* contributed `logicalBounds` so {@link MText.syncDraw} can avoid double-counting
|
|
25284
|
+
* vertical extent from line strips alone.
|
|
25285
|
+
*/
|
|
25181
25286
|
updateBoxFromObject(e, r) {
|
|
25182
|
-
var
|
|
25287
|
+
var o, c, u, h, d, l;
|
|
25183
25288
|
e.updateWorldMatrix(!1, !1);
|
|
25184
|
-
const n = (
|
|
25185
|
-
|
|
25289
|
+
const n = (o = e.userData) == null ? void 0 : o.logicalBounds;
|
|
25290
|
+
if (n) {
|
|
25291
|
+
r.hasLogicalBounds = !0;
|
|
25292
|
+
const p = new R.Box3(
|
|
25293
|
+
new R.Vector3(n.minX, n.minY, 0),
|
|
25294
|
+
new R.Vector3(n.maxX, n.maxY, 0)
|
|
25295
|
+
);
|
|
25296
|
+
p.applyMatrix4(e.matrixWorld), this.box.union(p);
|
|
25297
|
+
}
|
|
25298
|
+
const a = (c = e.userData) == null ? void 0 : c.lineLayouts;
|
|
25299
|
+
a && a.length > 0 && a.forEach((p) => {
|
|
25186
25300
|
Pe.set(0, p.y - p.height / 2, 0).applyMatrix4(e.matrixWorld), Ne.set(0, p.y + p.height / 2, 0).applyMatrix4(e.matrixWorld), r.hasLine = !0, r.minX = Math.min(r.minX, Pe.x, Ne.x), r.maxX = Math.max(r.maxX, Pe.x, Ne.x), r.minY = Math.min(r.minY, Pe.y, Ne.y), r.maxY = Math.max(r.maxY, Pe.y, Ne.y), r.minZ = Math.min(r.minZ, Pe.z, Ne.z), r.maxZ = Math.max(r.maxZ, Pe.z, Ne.z);
|
|
25187
25301
|
});
|
|
25188
|
-
const
|
|
25189
|
-
if (
|
|
25190
|
-
const p = (
|
|
25302
|
+
const i = (h = (u = e.userData) == null ? void 0 : u.layout) == null ? void 0 : h.chars;
|
|
25303
|
+
if (i && i.length > 0) {
|
|
25304
|
+
const p = (d = e.userData) == null ? void 0 : d.charBoxType;
|
|
25191
25305
|
nn(
|
|
25192
|
-
|
|
25306
|
+
i,
|
|
25193
25307
|
e.matrixWorld,
|
|
25194
25308
|
p
|
|
25195
|
-
).forEach((
|
|
25196
|
-
|
|
25309
|
+
).forEach((v) => {
|
|
25310
|
+
v.box && this.box.union(v.box);
|
|
25197
25311
|
});
|
|
25198
25312
|
return;
|
|
25199
25313
|
}
|
|
25200
|
-
if (e instanceof
|
|
25314
|
+
if (e instanceof R.Line || e instanceof R.Mesh) {
|
|
25201
25315
|
const p = e.geometry;
|
|
25202
|
-
if (!((
|
|
25316
|
+
if (!((l = p.userData) != null && l.isDecoration)) {
|
|
25203
25317
|
p.boundingBox === null && p.computeBoundingBox();
|
|
25204
|
-
const
|
|
25205
|
-
|
|
25318
|
+
const x = new R.Box3().copy(p.boundingBox);
|
|
25319
|
+
x.applyMatrix4(e.matrixWorld), this.box.union(x);
|
|
25206
25320
|
}
|
|
25207
25321
|
}
|
|
25208
|
-
const
|
|
25209
|
-
for (let p = 0,
|
|
25210
|
-
this.updateBoxFromObject(
|
|
25322
|
+
const s = e.children;
|
|
25323
|
+
for (let p = 0, x = s.length; p < x; p++)
|
|
25324
|
+
this.updateBoxFromObject(s[p], r);
|
|
25211
25325
|
}
|
|
25212
25326
|
/**
|
|
25213
25327
|
* Remove the specified object from its parent and release geometry and material resource used
|
|
@@ -25233,6 +25347,13 @@ class cr extends M.Object3D {
|
|
|
25233
25347
|
}
|
|
25234
25348
|
});
|
|
25235
25349
|
}
|
|
25350
|
+
/**
|
|
25351
|
+
* Normalizes a font file reference to the lowercase stem used by
|
|
25352
|
+
* {@link FontManager.loadFontsByNames} (strip extension).
|
|
25353
|
+
*
|
|
25354
|
+
* @param fontFileName - Style font path such as `arial.ttf` or extension-less name.
|
|
25355
|
+
* @returns Lowercase name without the last extension segment, or `undefined` if empty.
|
|
25356
|
+
*/
|
|
25236
25357
|
getFontName(e) {
|
|
25237
25358
|
if (e) {
|
|
25238
25359
|
const r = e.lastIndexOf(".");
|
|
@@ -25248,7 +25369,7 @@ class Qi {
|
|
|
25248
25369
|
const r = this.buildKey(e);
|
|
25249
25370
|
if (!this.meshBasicMaterials[r]) {
|
|
25250
25371
|
const n = er(e);
|
|
25251
|
-
this.meshBasicMaterials[r] = new
|
|
25372
|
+
this.meshBasicMaterials[r] = new R.MeshBasicMaterial({
|
|
25252
25373
|
color: n
|
|
25253
25374
|
});
|
|
25254
25375
|
}
|
|
@@ -25258,7 +25379,7 @@ class Qi {
|
|
|
25258
25379
|
const r = this.buildKey(e);
|
|
25259
25380
|
if (!this.lineBasicMaterials[r]) {
|
|
25260
25381
|
const n = er(e);
|
|
25261
|
-
this.lineBasicMaterials[r] = new
|
|
25382
|
+
this.lineBasicMaterials[r] = new R.LineBasicMaterial({
|
|
25262
25383
|
color: n
|
|
25263
25384
|
});
|
|
25264
25385
|
}
|
|
@@ -25273,7 +25394,7 @@ class Qi {
|
|
|
25273
25394
|
return r && e.layer ? `layer_${e.layer}_${n}` : `entity_${n}`;
|
|
25274
25395
|
}
|
|
25275
25396
|
}
|
|
25276
|
-
const Va = /* @__PURE__ */ new
|
|
25397
|
+
const Va = /* @__PURE__ */ new R.Vector3(), qa = /* @__PURE__ */ new R.Vector3(), Xa = /* @__PURE__ */ new R.Vector3();
|
|
25277
25398
|
class af {
|
|
25278
25399
|
constructor(e = {}) {
|
|
25279
25400
|
this.workers = [], this.inFlightPerWorker = [], this.pendingRequests = /* @__PURE__ */ new Map(), this.requestId = 0, this.readyPromise = null, this.poolSize = e.poolSize ?? Math.max(
|
|
@@ -25430,35 +25551,35 @@ class af {
|
|
|
25430
25551
|
* Reconstruct MText object from JSON serialized data
|
|
25431
25552
|
*/
|
|
25432
25553
|
reconstructMText(e, r) {
|
|
25433
|
-
const n = r.color.aci === 256, a = new
|
|
25554
|
+
const n = r.color.aci === 256, a = new R.Group();
|
|
25434
25555
|
e.children.forEach((s) => {
|
|
25435
|
-
const o = new
|
|
25556
|
+
const o = new R.BufferGeometry();
|
|
25436
25557
|
if (Object.keys(s.geometry.attributes).forEach((h) => {
|
|
25437
|
-
const
|
|
25438
|
-
|
|
25439
|
-
|
|
25440
|
-
|
|
25441
|
-
),
|
|
25558
|
+
const d = s.geometry.attributes[h], l = new Float32Array(
|
|
25559
|
+
d.arrayBuffer,
|
|
25560
|
+
d.byteOffset,
|
|
25561
|
+
d.length
|
|
25562
|
+
), p = new R.BufferAttribute(
|
|
25442
25563
|
l,
|
|
25443
|
-
|
|
25444
|
-
|
|
25564
|
+
d.itemSize,
|
|
25565
|
+
d.normalized
|
|
25445
25566
|
);
|
|
25446
|
-
o.setAttribute(h,
|
|
25567
|
+
o.setAttribute(h, p);
|
|
25447
25568
|
}), s.geometry.index)
|
|
25448
25569
|
if (s.geometry.index.componentType === "uint32") {
|
|
25449
|
-
const
|
|
25570
|
+
const d = new Uint32Array(
|
|
25450
25571
|
s.geometry.index.arrayBuffer,
|
|
25451
25572
|
s.geometry.index.byteOffset,
|
|
25452
25573
|
s.geometry.index.length
|
|
25453
25574
|
);
|
|
25454
|
-
o.setIndex(new
|
|
25575
|
+
o.setIndex(new R.Uint32BufferAttribute(d, 1));
|
|
25455
25576
|
} else {
|
|
25456
|
-
const
|
|
25577
|
+
const d = new Uint16Array(
|
|
25457
25578
|
s.geometry.index.arrayBuffer,
|
|
25458
25579
|
s.geometry.index.byteOffset,
|
|
25459
25580
|
s.geometry.index.length
|
|
25460
25581
|
);
|
|
25461
|
-
o.setIndex(new
|
|
25582
|
+
o.setIndex(new R.Uint16BufferAttribute(d, 1));
|
|
25462
25583
|
}
|
|
25463
25584
|
let c;
|
|
25464
25585
|
if (s.type === "mesh") {
|
|
@@ -25481,7 +25602,7 @@ class af {
|
|
|
25481
25602
|
}), s.material.transparent !== void 0 && (c.transparent = s.material.transparent), s.material.opacity !== void 0 && (c.opacity = s.material.opacity), s.material.linewidth !== void 0 && (c.linewidth = s.material.linewidth);
|
|
25482
25603
|
}
|
|
25483
25604
|
let u;
|
|
25484
|
-
s.type === "mesh" ? u = new
|
|
25605
|
+
s.type === "mesh" ? u = new R.Mesh(o, c) : u = new R.LineSegments(
|
|
25485
25606
|
o,
|
|
25486
25607
|
c
|
|
25487
25608
|
), o.boundingBox || o.computeBoundingBox(), o.boundingSphere || o.computeBoundingSphere(), u.position.set(
|
|
@@ -25500,13 +25621,13 @@ class af {
|
|
|
25500
25621
|
}))), s.charBoxes && s.charBoxes.length > 0 && (u.userData.layout = {
|
|
25501
25622
|
chars: this.deserializeCharBoxes(s.charBoxes)
|
|
25502
25623
|
}), a.add(u);
|
|
25503
|
-
}), a.box = new
|
|
25504
|
-
new
|
|
25624
|
+
}), a.box = new R.Box3(
|
|
25625
|
+
new R.Vector3(
|
|
25505
25626
|
e.box.min.x,
|
|
25506
25627
|
e.box.min.y,
|
|
25507
25628
|
e.box.min.z
|
|
25508
25629
|
),
|
|
25509
|
-
new
|
|
25630
|
+
new R.Vector3(
|
|
25510
25631
|
e.box.max.x,
|
|
25511
25632
|
e.box.max.y,
|
|
25512
25633
|
e.box.max.z
|
|
@@ -25535,15 +25656,15 @@ class af {
|
|
|
25535
25656
|
return e.map((r) => ({
|
|
25536
25657
|
type: r.type,
|
|
25537
25658
|
char: r.char,
|
|
25538
|
-
box: new
|
|
25539
|
-
new
|
|
25540
|
-
new
|
|
25659
|
+
box: new R.Box3(
|
|
25660
|
+
new R.Vector3(r.box.min.x, r.box.min.y, r.box.min.z),
|
|
25661
|
+
new R.Vector3(r.box.max.x, r.box.max.y, r.box.max.z)
|
|
25541
25662
|
),
|
|
25542
25663
|
children: this.deserializeCharBoxes(r.children ?? [])
|
|
25543
25664
|
}));
|
|
25544
25665
|
}
|
|
25545
25666
|
collectLayout(e, r, n) {
|
|
25546
|
-
var o, c, u, h,
|
|
25667
|
+
var o, c, u, h, d;
|
|
25547
25668
|
e.updateWorldMatrix(!1, !1);
|
|
25548
25669
|
const a = (c = (o = e.userData) == null ? void 0 : o.layout) == null ? void 0 : c.chars, i = (u = e.userData) == null ? void 0 : u.lineLayouts;
|
|
25549
25670
|
if (i && i.length > 0 && i.forEach((l) => {
|
|
@@ -25553,29 +25674,29 @@ class af {
|
|
|
25553
25674
|
breakIndex: l.breakIndex
|
|
25554
25675
|
});
|
|
25555
25676
|
}), a && a.length > 0) {
|
|
25556
|
-
const l = (h = e.userData) == null ? void 0 : h.charBoxType,
|
|
25677
|
+
const l = (h = e.userData) == null ? void 0 : h.charBoxType, p = nn(
|
|
25557
25678
|
a,
|
|
25558
25679
|
e.matrixWorld,
|
|
25559
25680
|
l
|
|
25560
25681
|
);
|
|
25561
|
-
r.push(...
|
|
25682
|
+
r.push(...p);
|
|
25562
25683
|
return;
|
|
25563
25684
|
}
|
|
25564
|
-
if (e instanceof
|
|
25685
|
+
if (e instanceof R.Line || e instanceof R.Mesh) {
|
|
25565
25686
|
const l = e.geometry;
|
|
25566
|
-
if (!((
|
|
25687
|
+
if (!((d = l.userData) != null && d.isDecoration)) {
|
|
25567
25688
|
l.boundingBox === null && l.computeBoundingBox();
|
|
25568
|
-
const
|
|
25569
|
-
|
|
25689
|
+
const p = new R.Box3().copy(l.boundingBox);
|
|
25690
|
+
p.applyMatrix4(e.matrixWorld), r.push({
|
|
25570
25691
|
type: se.CHAR,
|
|
25571
|
-
box:
|
|
25692
|
+
box: p,
|
|
25572
25693
|
char: "",
|
|
25573
25694
|
children: []
|
|
25574
25695
|
});
|
|
25575
25696
|
}
|
|
25576
25697
|
}
|
|
25577
25698
|
const s = e.children;
|
|
25578
|
-
for (let l = 0,
|
|
25699
|
+
for (let l = 0, p = s.length; l < p; l++)
|
|
25579
25700
|
this.collectLayout(s[l], r, n);
|
|
25580
25701
|
}
|
|
25581
25702
|
/**
|
|
@@ -25752,6 +25873,7 @@ export {
|
|
|
25752
25873
|
An as EventManager,
|
|
25753
25874
|
$e as FontFactory,
|
|
25754
25875
|
Ie as FontManager,
|
|
25876
|
+
ql as LINE_SPACING_SCALE_FACTOR,
|
|
25755
25877
|
cr as MText,
|
|
25756
25878
|
X as MTextAttachmentPoint,
|
|
25757
25879
|
vt as MTextColor,
|
|
@@ -25759,11 +25881,12 @@ export {
|
|
|
25759
25881
|
Ye as MTextFlowDirection,
|
|
25760
25882
|
Ze as MTextLineAlignment,
|
|
25761
25883
|
ee as MTextParagraphAlignment,
|
|
25762
|
-
|
|
25884
|
+
ef as MTextParser,
|
|
25763
25885
|
Xe as MTextStroke,
|
|
25764
25886
|
Nr as MTextToken,
|
|
25765
25887
|
sf as MainThreadRenderer,
|
|
25766
25888
|
tr as STACK_DIVIDER_CHAR,
|
|
25889
|
+
Zt as STACK_VERTICAL_SHIFT_FACTOR,
|
|
25767
25890
|
il as ShxParserFont,
|
|
25768
25891
|
Pr as TextScanner,
|
|
25769
25892
|
Z as TokenType,
|
|
@@ -25772,9 +25895,9 @@ export {
|
|
|
25772
25895
|
ct as createDefaultColorSettings,
|
|
25773
25896
|
uf as escapeDxfLineEndings,
|
|
25774
25897
|
Za as getColorByIndex,
|
|
25775
|
-
|
|
25898
|
+
Ql as getFonts,
|
|
25776
25899
|
hf as hasInlineFormattingCodes,
|
|
25777
25900
|
cf as int2rgb,
|
|
25778
25901
|
er as resolveMTextColor,
|
|
25779
|
-
|
|
25902
|
+
jl as rgb2int
|
|
25780
25903
|
};
|