50p82u21t54k 0.0.34 → 0.0.36
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/50p82u21t54k.es.js +125 -126
- package/dist/50p82u21t54k.umd.js +3 -3
- package/dist/login/method.d.ts.map +1 -1
- package/dist/main.d.ts +1 -0
- package/package.json +1 -1
package/dist/50p82u21t54k.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Xt from "axios";
|
|
2
2
|
import { ref as Qt } from "vue";
|
|
3
|
-
import
|
|
3
|
+
import k from "crypto-js";
|
|
4
4
|
const Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
5
5
|
__proto__: null,
|
|
6
6
|
get DefaultHotGamesResponse() {
|
|
@@ -50,7 +50,7 @@ const Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
50
50
|
return Ft;
|
|
51
51
|
},
|
|
52
52
|
get GameType() {
|
|
53
|
-
return
|
|
53
|
+
return jt;
|
|
54
54
|
},
|
|
55
55
|
get getHome() {
|
|
56
56
|
return pe;
|
|
@@ -58,7 +58,7 @@ const Wt = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
|
58
58
|
}, Symbol.toStringTag, { value: "Module" })), ie = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
59
59
|
__proto__: null,
|
|
60
60
|
get DefaultCurrentLangResponse() {
|
|
61
|
-
return
|
|
61
|
+
return kt;
|
|
62
62
|
},
|
|
63
63
|
get getCurrentLang() {
|
|
64
64
|
return ge;
|
|
@@ -199,23 +199,23 @@ const ce = {
|
|
|
199
199
|
}, A = (r) => {
|
|
200
200
|
try {
|
|
201
201
|
const t = JSON.parse(
|
|
202
|
-
|
|
202
|
+
k.AES.decrypt(r, Pt.value, {
|
|
203
203
|
format: {
|
|
204
204
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
205
205
|
stringify: (e) => {
|
|
206
206
|
const n = {
|
|
207
|
-
ct: e.ciphertext.toString(
|
|
207
|
+
ct: e.ciphertext.toString(k.enc.Base64)
|
|
208
208
|
};
|
|
209
209
|
return e.iv && (n.iv = e.iv.toString()), e.salt && (n.s = e.salt.toString()), JSON.stringify(n);
|
|
210
210
|
},
|
|
211
211
|
parse: (e) => {
|
|
212
|
-
const n = JSON.parse(e), s =
|
|
213
|
-
ciphertext:
|
|
212
|
+
const n = JSON.parse(e), s = k.lib.CipherParams.create({
|
|
213
|
+
ciphertext: k.enc.Base64.parse(n.ct)
|
|
214
214
|
});
|
|
215
|
-
return n.iv && (s.iv =
|
|
215
|
+
return n.iv && (s.iv = k.enc.Hex.parse(n.iv)), n.s && (s.salt = k.enc.Hex.parse(n.s)), s;
|
|
216
216
|
}
|
|
217
217
|
}
|
|
218
|
-
}).toString(
|
|
218
|
+
}).toString(k.enc.Utf8)
|
|
219
219
|
);
|
|
220
220
|
return t !== "" ? JSON.parse(t) : t;
|
|
221
221
|
} catch (t) {
|
|
@@ -618,14 +618,14 @@ const L = (r) => ({
|
|
|
618
618
|
imgSport: r.imgSport ?? "",
|
|
619
619
|
imgTemplate: r.imgTemplate ?? ""
|
|
620
620
|
});
|
|
621
|
-
var
|
|
622
|
-
const
|
|
621
|
+
var jt = /* @__PURE__ */ ((r) => (r.SPORT = "SPORT", r.SPECIAL = "SPECIAL", r.PVP = "PVP", r.LIVE = "LIVE", r.EVENT = "EVENT", r.ESPORT = "ESPORT", r.EGAME = "EGAME", r.BINGO = "BINGO", r))(jt || {});
|
|
622
|
+
const kt = {
|
|
623
623
|
status: 200,
|
|
624
624
|
message: "",
|
|
625
625
|
data: ""
|
|
626
626
|
};
|
|
627
627
|
async function ge() {
|
|
628
|
-
const r =
|
|
628
|
+
const r = kt;
|
|
629
629
|
try {
|
|
630
630
|
const t = await O.get("/apis/currentLang", {
|
|
631
631
|
params: {
|
|
@@ -1180,17 +1180,17 @@ var ot = (
|
|
|
1180
1180
|
var n = new ot(e), s = new wt(e), i = r.decodeLength(e), o = e.pos, a = o - n.pos, u = null, h = function() {
|
|
1181
1181
|
var p = [];
|
|
1182
1182
|
if (i !== null) {
|
|
1183
|
-
for (var
|
|
1183
|
+
for (var y = o + i; e.pos < y; )
|
|
1184
1184
|
p[p.length] = r.decode(e);
|
|
1185
|
-
if (e.pos !=
|
|
1185
|
+
if (e.pos != y)
|
|
1186
1186
|
throw new Error("Content size is not correct for container starting at offset " + o);
|
|
1187
1187
|
} else
|
|
1188
1188
|
try {
|
|
1189
1189
|
for (; ; ) {
|
|
1190
|
-
var
|
|
1191
|
-
if (
|
|
1190
|
+
var d = r.decode(e);
|
|
1191
|
+
if (d.tag.isEOC())
|
|
1192
1192
|
break;
|
|
1193
|
-
p[p.length] =
|
|
1193
|
+
p[p.length] = d;
|
|
1194
1194
|
}
|
|
1195
1195
|
i = o - e.pos;
|
|
1196
1196
|
} catch (m) {
|
|
@@ -1394,19 +1394,19 @@ var ot = (
|
|
|
1394
1394
|
for (o.sqrTo(a[1], p); u <= l; )
|
|
1395
1395
|
a[u] = g(), o.mulTo(p, a[u - 2], a[u]), u += 2;
|
|
1396
1396
|
}
|
|
1397
|
-
var
|
|
1398
|
-
for (n = Q(t[
|
|
1399
|
-
for (n >= h ?
|
|
1400
|
-
|
|
1401
|
-
if ((n -= u) < 0 && (n += this.DB, --
|
|
1402
|
-
a[
|
|
1397
|
+
var y = t.t - 1, d, m = !0, S = g(), w;
|
|
1398
|
+
for (n = Q(t[y]) - 1; y >= 0; ) {
|
|
1399
|
+
for (n >= h ? d = t[y] >> n - h & l : (d = (t[y] & (1 << n + 1) - 1) << h - n, y > 0 && (d |= t[y - 1] >> this.DB + n - h)), u = s; !(d & 1); )
|
|
1400
|
+
d >>= 1, --u;
|
|
1401
|
+
if ((n -= u) < 0 && (n += this.DB, --y), m)
|
|
1402
|
+
a[d].copyTo(i), m = !1;
|
|
1403
1403
|
else {
|
|
1404
1404
|
for (; u > 1; )
|
|
1405
1405
|
o.sqrTo(i, S), o.sqrTo(S, i), u -= 2;
|
|
1406
|
-
u > 0 ? o.sqrTo(i, S) : (
|
|
1406
|
+
u > 0 ? o.sqrTo(i, S) : (w = i, i = S, S = w), o.mulTo(S, a[d], i);
|
|
1407
1407
|
}
|
|
1408
|
-
for (;
|
|
1409
|
-
o.sqrTo(i, S),
|
|
1408
|
+
for (; y >= 0 && !(t[y] & 1 << n); )
|
|
1409
|
+
o.sqrTo(i, S), w = i, i = S, S = w, --n < 0 && (n = this.DB - 1, --y);
|
|
1410
1410
|
}
|
|
1411
1411
|
return o.revert(i);
|
|
1412
1412
|
}, r.prototype.modInverse = function(t) {
|
|
@@ -1568,13 +1568,13 @@ var ot = (
|
|
|
1568
1568
|
h > 0 ? (s.lShiftTo(h, o), i.lShiftTo(h, n)) : (s.copyTo(o), i.copyTo(n));
|
|
1569
1569
|
var l = o.t, p = o[l - 1];
|
|
1570
1570
|
if (p != 0) {
|
|
1571
|
-
var
|
|
1572
|
-
for (o.dlShiftTo(
|
|
1571
|
+
var y = p * (1 << this.F1) + (l > 1 ? o[l - 2] >> this.F2 : 0), d = this.FV / y, m = (1 << this.F1) / y, S = 1 << this.F2, w = n.t, D = w - l, R = e ?? g();
|
|
1572
|
+
for (o.dlShiftTo(D, R), n.compareTo(R) >= 0 && (n[n.t++] = 1, n.subTo(R, n)), r.ONE.dlShiftTo(l, R), R.subTo(o, o); o.t < l; )
|
|
1573
1573
|
o[o.t++] = 0;
|
|
1574
|
-
for (; --
|
|
1575
|
-
var
|
|
1576
|
-
if ((n[
|
|
1577
|
-
for (o.dlShiftTo(
|
|
1574
|
+
for (; --D >= 0; ) {
|
|
1575
|
+
var _ = n[--w] == p ? this.DM : Math.floor(n[w] * d + (n[w - 1] + S) * m);
|
|
1576
|
+
if ((n[w] += o.am(0, _, n, D, 0, l)) < _)
|
|
1577
|
+
for (o.dlShiftTo(D, R), n.subTo(R, n); n[w] < --_; )
|
|
1578
1578
|
n.subTo(R, n);
|
|
1579
1579
|
}
|
|
1580
1580
|
e != null && (n.drShiftTo(l, e), a != u && r.ZERO.subTo(e, e)), n.t = l, n.clamp(), h > 0 && n.rShiftTo(h, n), a < 0 && r.ZERO.subTo(n, n);
|
|
@@ -2049,23 +2049,23 @@ var Me = (
|
|
|
2049
2049
|
var o = new c(e, 16), a = this, u = function() {
|
|
2050
2050
|
var h = function() {
|
|
2051
2051
|
if (a.p.compareTo(a.q) <= 0) {
|
|
2052
|
-
var
|
|
2053
|
-
a.p = a.q, a.q =
|
|
2052
|
+
var y = a.p;
|
|
2053
|
+
a.p = a.q, a.q = y;
|
|
2054
2054
|
}
|
|
2055
|
-
var
|
|
2056
|
-
S.gcd(o).compareTo(c.ONE) == 0 ? (a.n = a.p.multiply(a.q), a.d = o.modInverse(S), a.dmp1 = a.d.mod(
|
|
2055
|
+
var d = a.p.subtract(c.ONE), m = a.q.subtract(c.ONE), S = d.multiply(m);
|
|
2056
|
+
S.gcd(o).compareTo(c.ONE) == 0 ? (a.n = a.p.multiply(a.q), a.d = o.modInverse(S), a.dmp1 = a.d.mod(d), a.dmq1 = a.d.mod(m), a.coeff = a.q.modInverse(a.p), setTimeout(function() {
|
|
2057
2057
|
n();
|
|
2058
2058
|
}, 0)) : setTimeout(u, 0);
|
|
2059
2059
|
}, l = function() {
|
|
2060
2060
|
a.q = g(), a.q.fromNumberAsync(i, 1, s, function() {
|
|
2061
|
-
a.q.subtract(c.ONE).gcda(o, function(
|
|
2062
|
-
|
|
2061
|
+
a.q.subtract(c.ONE).gcda(o, function(y) {
|
|
2062
|
+
y.compareTo(c.ONE) == 0 && a.q.isProbablePrime(10) ? setTimeout(h, 0) : setTimeout(l, 0);
|
|
2063
2063
|
});
|
|
2064
2064
|
});
|
|
2065
2065
|
}, p = function() {
|
|
2066
2066
|
a.p = g(), a.p.fromNumberAsync(t - i, 1, s, function() {
|
|
2067
|
-
a.p.subtract(c.ONE).gcda(o, function(
|
|
2068
|
-
|
|
2067
|
+
a.p.subtract(c.ONE).gcda(o, function(y) {
|
|
2068
|
+
y.compareTo(c.ONE) == 0 && a.p.isProbablePrime(10) ? setTimeout(l, 0) : setTimeout(p, 0);
|
|
2069
2069
|
});
|
|
2070
2070
|
});
|
|
2071
2071
|
};
|
|
@@ -2073,7 +2073,7 @@ var Me = (
|
|
|
2073
2073
|
};
|
|
2074
2074
|
setTimeout(u, 0);
|
|
2075
2075
|
}, r.prototype.sign = function(t, e, n) {
|
|
2076
|
-
var s =
|
|
2076
|
+
var s = je(n), i = s + e(t).toString(), o = Le(i, this.n.bitLength() / 4);
|
|
2077
2077
|
if (o == null)
|
|
2078
2078
|
return null;
|
|
2079
2079
|
var a = this.doPrivate(o);
|
|
@@ -2085,7 +2085,7 @@ var Me = (
|
|
|
2085
2085
|
var s = T(e, 16), i = this.doPublic(s);
|
|
2086
2086
|
if (i == null)
|
|
2087
2087
|
return null;
|
|
2088
|
-
var o = i.toString(16).replace(/^1f+00/, ""), a =
|
|
2088
|
+
var o = i.toString(16).replace(/^1f+00/, ""), a = ke(o);
|
|
2089
2089
|
return a == n(t).toString();
|
|
2090
2090
|
}, r;
|
|
2091
2091
|
}()
|
|
@@ -2114,10 +2114,10 @@ var nt = {
|
|
|
2114
2114
|
sha512: "3051300d060960864801650304020305000440",
|
|
2115
2115
|
ripemd160: "3021300906052b2403020105000414"
|
|
2116
2116
|
};
|
|
2117
|
-
function
|
|
2117
|
+
function je(r) {
|
|
2118
2118
|
return nt[r] || "";
|
|
2119
2119
|
}
|
|
2120
|
-
function
|
|
2120
|
+
function ke(r) {
|
|
2121
2121
|
for (var t in nt)
|
|
2122
2122
|
if (nt.hasOwnProperty(t)) {
|
|
2123
2123
|
var e = nt[t], n = e.length;
|
|
@@ -2202,59 +2202,59 @@ f.asn1.ASN1Util = new function() {
|
|
|
2202
2202
|
}, this.getPEMStringFromHex = function(r, t) {
|
|
2203
2203
|
return hextopem(r, t);
|
|
2204
2204
|
}, this.newObject = function(r) {
|
|
2205
|
-
var t = f, e = t.asn1, n = e.DERBoolean, s = e.DERInteger, i = e.DERBitString, o = e.DEROctetString, a = e.DERNull, u = e.DERObjectIdentifier, h = e.DEREnumerated, l = e.DERUTF8String, p = e.DERNumericString,
|
|
2205
|
+
var t = f, e = t.asn1, n = e.DERBoolean, s = e.DERInteger, i = e.DERBitString, o = e.DEROctetString, a = e.DERNull, u = e.DERObjectIdentifier, h = e.DEREnumerated, l = e.DERUTF8String, p = e.DERNumericString, y = e.DERPrintableString, d = e.DERTeletexString, m = e.DERIA5String, S = e.DERUTCTime, w = e.DERGeneralizedTime, D = e.DERSequence, R = e.DERSet, _ = e.DERTaggedObject, z = e.ASN1Util.newObject, St = Object.keys(r);
|
|
2206
2206
|
if (St.length != 1)
|
|
2207
2207
|
throw "key of param shall be only one.";
|
|
2208
|
-
var
|
|
2209
|
-
if (":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" +
|
|
2210
|
-
throw "undefined key: " +
|
|
2211
|
-
if (
|
|
2212
|
-
return new n(r[
|
|
2213
|
-
if (
|
|
2214
|
-
return new s(r[
|
|
2215
|
-
if (
|
|
2216
|
-
return new i(r[
|
|
2217
|
-
if (
|
|
2218
|
-
return new o(r[
|
|
2219
|
-
if (
|
|
2220
|
-
return new a(r[
|
|
2221
|
-
if (
|
|
2222
|
-
return new u(r[
|
|
2223
|
-
if (
|
|
2224
|
-
return new h(r[
|
|
2225
|
-
if (
|
|
2226
|
-
return new l(r[
|
|
2227
|
-
if (
|
|
2228
|
-
return new p(r[
|
|
2229
|
-
if (
|
|
2230
|
-
return new
|
|
2231
|
-
if (
|
|
2232
|
-
return new
|
|
2233
|
-
if (
|
|
2234
|
-
return new m(r[
|
|
2235
|
-
if (
|
|
2236
|
-
return new S(r[
|
|
2237
|
-
if (
|
|
2238
|
-
return new
|
|
2239
|
-
if (
|
|
2240
|
-
for (var J = r[
|
|
2241
|
-
var at = z(J[
|
|
2208
|
+
var v = St[0];
|
|
2209
|
+
if (":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":" + v + ":") == -1)
|
|
2210
|
+
throw "undefined key: " + v;
|
|
2211
|
+
if (v == "bool")
|
|
2212
|
+
return new n(r[v]);
|
|
2213
|
+
if (v == "int")
|
|
2214
|
+
return new s(r[v]);
|
|
2215
|
+
if (v == "bitstr")
|
|
2216
|
+
return new i(r[v]);
|
|
2217
|
+
if (v == "octstr")
|
|
2218
|
+
return new o(r[v]);
|
|
2219
|
+
if (v == "null")
|
|
2220
|
+
return new a(r[v]);
|
|
2221
|
+
if (v == "oid")
|
|
2222
|
+
return new u(r[v]);
|
|
2223
|
+
if (v == "enum")
|
|
2224
|
+
return new h(r[v]);
|
|
2225
|
+
if (v == "utf8str")
|
|
2226
|
+
return new l(r[v]);
|
|
2227
|
+
if (v == "numstr")
|
|
2228
|
+
return new p(r[v]);
|
|
2229
|
+
if (v == "prnstr")
|
|
2230
|
+
return new y(r[v]);
|
|
2231
|
+
if (v == "telstr")
|
|
2232
|
+
return new d(r[v]);
|
|
2233
|
+
if (v == "ia5str")
|
|
2234
|
+
return new m(r[v]);
|
|
2235
|
+
if (v == "utctime")
|
|
2236
|
+
return new S(r[v]);
|
|
2237
|
+
if (v == "gentime")
|
|
2238
|
+
return new w(r[v]);
|
|
2239
|
+
if (v == "seq") {
|
|
2240
|
+
for (var J = r[v], Z = [], j = 0; j < J.length; j++) {
|
|
2241
|
+
var at = z(J[j]);
|
|
2242
2242
|
Z.push(at);
|
|
2243
2243
|
}
|
|
2244
|
-
return new
|
|
2244
|
+
return new D({ array: Z });
|
|
2245
2245
|
}
|
|
2246
|
-
if (
|
|
2247
|
-
for (var J = r[
|
|
2248
|
-
var at = z(J[
|
|
2246
|
+
if (v == "set") {
|
|
2247
|
+
for (var J = r[v], Z = [], j = 0; j < J.length; j++) {
|
|
2248
|
+
var at = z(J[j]);
|
|
2249
2249
|
Z.push(at);
|
|
2250
2250
|
}
|
|
2251
2251
|
return new R({ array: Z });
|
|
2252
2252
|
}
|
|
2253
|
-
if (
|
|
2254
|
-
var P = r[
|
|
2253
|
+
if (v == "tag") {
|
|
2254
|
+
var P = r[v];
|
|
2255
2255
|
if (Object.prototype.toString.call(P) === "[object Array]" && P.length == 3) {
|
|
2256
2256
|
var Yt = z(P[2]);
|
|
2257
|
-
return new
|
|
2257
|
+
return new _({
|
|
2258
2258
|
tag: P[0],
|
|
2259
2259
|
explicit: P[1],
|
|
2260
2260
|
obj: Yt
|
|
@@ -2263,7 +2263,7 @@ f.asn1.ASN1Util = new function() {
|
|
|
2263
2263
|
var Y = {};
|
|
2264
2264
|
if (P.explicit !== void 0 && (Y.explicit = P.explicit), P.tag !== void 0 && (Y.tag = P.tag), P.obj === void 0)
|
|
2265
2265
|
throw "obj shall be specified for 'tag'.";
|
|
2266
|
-
return Y.obj = z(P.obj), new
|
|
2266
|
+
return Y.obj = z(P.obj), new _(Y);
|
|
2267
2267
|
}
|
|
2268
2268
|
}
|
|
2269
2269
|
}, this.jsonToASN1HEX = function(r) {
|
|
@@ -2288,12 +2288,12 @@ f.asn1.ASN1Util.oidIntToHex = function(r) {
|
|
|
2288
2288
|
}, e = function(a) {
|
|
2289
2289
|
var u = "", h = new c(a, 10), l = h.toString(2), p = 7 - l.length % 7;
|
|
2290
2290
|
p == 7 && (p = 0);
|
|
2291
|
-
for (var
|
|
2292
|
-
|
|
2293
|
-
l =
|
|
2294
|
-
for (var
|
|
2295
|
-
var m = l.substr(
|
|
2296
|
-
|
|
2291
|
+
for (var y = "", d = 0; d < p; d++)
|
|
2292
|
+
y += "0";
|
|
2293
|
+
l = y + l;
|
|
2294
|
+
for (var d = 0; d < l.length - 1; d += 7) {
|
|
2295
|
+
var m = l.substr(d, 7);
|
|
2296
|
+
d != l.length - 7 && (m = "1" + m), u += t(parseInt(m, 2));
|
|
2297
2297
|
}
|
|
2298
2298
|
return u;
|
|
2299
2299
|
};
|
|
@@ -2348,15 +2348,15 @@ f.asn1.DERAbstractTime = function(r) {
|
|
|
2348
2348
|
}, this.formatDate = function(t, e, n) {
|
|
2349
2349
|
var s = this.zeroPadding, i = this.localDateToUTC(t), o = String(i.getFullYear());
|
|
2350
2350
|
e == "utc" && (o = o.substr(2, 2));
|
|
2351
|
-
var a = s(String(i.getMonth() + 1), 2), u = s(String(i.getDate()), 2), h = s(String(i.getHours()), 2), l = s(String(i.getMinutes()), 2), p = s(String(i.getSeconds()), 2),
|
|
2351
|
+
var a = s(String(i.getMonth() + 1), 2), u = s(String(i.getDate()), 2), h = s(String(i.getHours()), 2), l = s(String(i.getMinutes()), 2), p = s(String(i.getSeconds()), 2), y = o + a + u + h + l + p;
|
|
2352
2352
|
if (n === !0) {
|
|
2353
|
-
var
|
|
2354
|
-
if (
|
|
2355
|
-
var m = s(String(
|
|
2356
|
-
m = m.replace(/[0]+$/, ""),
|
|
2353
|
+
var d = i.getMilliseconds();
|
|
2354
|
+
if (d != 0) {
|
|
2355
|
+
var m = s(String(d), 3);
|
|
2356
|
+
m = m.replace(/[0]+$/, ""), y = y + "." + m;
|
|
2357
2357
|
}
|
|
2358
2358
|
}
|
|
2359
|
-
return
|
|
2359
|
+
return y + "Z";
|
|
2360
2360
|
}, this.zeroPadding = function(t, e) {
|
|
2361
2361
|
return t.length >= e ? t : new Array(e - t.length + 1).join("0") + t;
|
|
2362
2362
|
}, this.getString = function() {
|
|
@@ -2597,10 +2597,10 @@ var He = /* @__PURE__ */ function() {
|
|
|
2597
2597
|
this.q = T(l, 16);
|
|
2598
2598
|
var p = a.sub[6].getHexStringValue();
|
|
2599
2599
|
this.dmp1 = T(p, 16);
|
|
2600
|
-
var
|
|
2601
|
-
this.dmq1 = T(
|
|
2602
|
-
var
|
|
2603
|
-
this.coeff = T(
|
|
2600
|
+
var y = a.sub[7].getHexStringValue();
|
|
2601
|
+
this.dmq1 = T(y, 16);
|
|
2602
|
+
var d = a.sub[8].getHexStringValue();
|
|
2603
|
+
this.coeff = T(d, 16);
|
|
2604
2604
|
} else if (a.sub.length === 2)
|
|
2605
2605
|
if (a.sub[0].sub) {
|
|
2606
2606
|
var m = a.sub[1], S = m.sub[0];
|
|
@@ -2774,39 +2774,38 @@ const Ce = {
|
|
|
2774
2774
|
}
|
|
2775
2775
|
};
|
|
2776
2776
|
async function Ke(r, t, e, n, s, i, o, a) {
|
|
2777
|
-
const u = $t, h = r, l = t, p = e,
|
|
2777
|
+
const u = $t, h = r, l = t, p = e, y = s;
|
|
2778
2778
|
try {
|
|
2779
|
-
let
|
|
2780
|
-
i && (
|
|
2779
|
+
let d;
|
|
2780
|
+
i && (d = (await Zt()).data);
|
|
2781
2781
|
const m = new Ge();
|
|
2782
2782
|
m.setPublicKey(o);
|
|
2783
2783
|
let S = n.host.split(":")[0];
|
|
2784
|
-
const
|
|
2785
|
-
|
|
2786
|
-
const
|
|
2787
|
-
|
|
2788
|
-
const R = await O.post(
|
|
2784
|
+
const w = m.encrypt(S.trim());
|
|
2785
|
+
w && S.length < 53 ? S = w : S = S.trim();
|
|
2786
|
+
const D = {};
|
|
2787
|
+
D.fr_username = m.encrypt(h.trim()), D.fr_password = m.encrypt(l.trim()), D.fr_gdcode = p, D.isApp = y, D.domain = S, D._token = a, D.json = 1, D.encrypt = 1, d && Object.assign(D, d);
|
|
2788
|
+
const R = await O.post("/kdink8anl8z3", D, {
|
|
2789
2789
|
headers: {
|
|
2790
|
-
"X-CSRF-TOKEN":
|
|
2790
|
+
"X-CSRF-TOKEN": D._token
|
|
2791
2791
|
},
|
|
2792
2792
|
params: {
|
|
2793
2793
|
render: b()
|
|
2794
|
-
}
|
|
2795
|
-
data: _
|
|
2794
|
+
}
|
|
2796
2795
|
});
|
|
2797
|
-
let
|
|
2798
|
-
return b() ?
|
|
2799
|
-
msg:
|
|
2800
|
-
accessToken:
|
|
2801
|
-
fullName:
|
|
2802
|
-
unreadMailCount:
|
|
2803
|
-
status:
|
|
2804
|
-
username:
|
|
2805
|
-
walletAmount:
|
|
2806
|
-
captcha:
|
|
2796
|
+
let _;
|
|
2797
|
+
return b() ? _ = JSON.parse(A(R.data)) : _ = R.data, R.status != 200 ? (u.status = R.status, u.message = "", u) : (u.data = {
|
|
2798
|
+
msg: _.msg ?? "",
|
|
2799
|
+
accessToken: _.access_token ?? "",
|
|
2800
|
+
fullName: _.fullname ?? "",
|
|
2801
|
+
unreadMailCount: _.news ?? "",
|
|
2802
|
+
status: _.status ?? "",
|
|
2803
|
+
username: _.username ?? "",
|
|
2804
|
+
walletAmount: _.wallet ?? "",
|
|
2805
|
+
captcha: _.captcha ?? ""
|
|
2807
2806
|
}, u);
|
|
2808
|
-
} catch (
|
|
2809
|
-
const m =
|
|
2807
|
+
} catch (d) {
|
|
2808
|
+
const m = d;
|
|
2810
2809
|
return u.status = m.status || 500, u.message = m.message, u;
|
|
2811
2810
|
}
|
|
2812
2811
|
}
|
package/dist/50p82u21t54k.umd.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
`}s&&(n=n-256);for(var u=new Z(n),h=t+1;h<e;++h)u.mulAdd(256,this.get(h));return a+u.toString()},r.prototype.parseBitString=function(t,e,n){for(var s=this.get(t),i=(e-t-1<<3)-s,o="("+i+` bit)
|
|
6
6
|
`,a="",u=t+1;u<e;++u){for(var h=this.get(u),l=u==e-1?s:0,p=7;p>=l;--p)a+=h>>p&1?"1":"0";if(a.length>n)return o+U(a,n)}return o+a},r.prototype.parseOctetString=function(t,e,n){if(this.isASCII(t,e))return U(this.parseStringISO(t,e),n);var s=e-t,i="("+s+` byte)
|
|
7
7
|
`;n/=2,s>n&&(e=t+n);for(var o=t;o<e;++o)i+=this.hexByte(this.get(o));return s>n&&(i+=Qt),i},r.prototype.parseOID=function(t,e,n){for(var s="",i=new Z,o=0,a=t;a<e;++a){var u=this.get(a);if(i.mulAdd(128,u&127),o+=7,!(u&128)){if(s==="")if(i=i.simplify(),i instanceof Z)i.sub(80),s="2."+i.toString();else{var h=i<80?i<40?0:1:2;s=h+"."+(i-h*40)}else s+="."+i.toString();if(s.length>n)return U(s,n);i=new Z,o=0}}return o>0&&(s+=".incomplete"),s},r}(),xe=function(){function r(t,e,n,s,i){if(!(s instanceof Wt))throw new Error("Invalid tag value.");this.stream=t,this.header=e,this.length=n,this.tag=s,this.sub=i}return r.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},r.prototype.content=function(t){if(this.tag===void 0)return null;t===void 0&&(t=1/0);var e=this.posContent(),n=Math.abs(this.length);if(!this.tag.isUniversal())return this.sub!==null?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+n,t);switch(this.tag.tagNumber){case 1:return this.stream.get(e)===0?"false":"true";case 2:return this.stream.parseInteger(e,e+n);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(e,e+n,t);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(e,e+n,t);case 6:return this.stream.parseOID(e,e+n,t);case 16:case 17:return this.sub!==null?"("+this.sub.length+" elem)":"(no elem)";case 12:return U(this.stream.parseStringUTF(e,e+n),t);case 18:case 19:case 20:case 21:case 22:case 26:return U(this.stream.parseStringISO(e,e+n),t);case 30:return U(this.stream.parseStringBMP(e,e+n),t);case 23:case 24:return this.stream.parseTime(e,e+n,this.tag.tagNumber==23)}return null},r.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(this.sub===null?"null":this.sub.length)+"]"},r.prototype.toPrettyString=function(t){t===void 0&&(t="");var e=t+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(e+="+"),e+=this.length,this.tag.tagConstructed?e+=" (constructed)":this.tag.isUniversal()&&(this.tag.tagNumber==3||this.tag.tagNumber==4)&&this.sub!==null&&(e+=" (encapsulates)"),e+=`
|
|
8
|
-
`,this.sub!==null){t+=" ";for(var n=0,s=this.sub.length;n<s;++n)e+=this.sub[n].toPrettyString(t)}return e},r.prototype.posStart=function(){return this.stream.pos},r.prototype.posContent=function(){return this.stream.pos+this.header},r.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},r.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},r.decodeLength=function(t){var e=t.get(),n=e&127;if(n==e)return n;if(n>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(n===0)return null;e=0;for(var s=0;s<n;++s)e=e*256+t.get();return e},r.prototype.getHexStringValue=function(){var t=this.toHexString(),e=this.header*2,n=this.length*2;return t.substr(e,n)},r.decode=function(t){var e;t instanceof dt?e=t:e=new dt(t,0);var n=new dt(e),s=new Wt(e),i=r.decodeLength(e),o=e.pos,a=o-n.pos,u=null,h=function(){var p=[];if(i!==null){for(var v=o+i;e.pos<v;)p[p.length]=r.decode(e);if(e.pos!=v)throw new Error("Content size is not correct for container starting at offset "+o)}else try{for(;;){var y=r.decode(e);if(y.tag.isEOC())break;p[p.length]=y}i=o-e.pos}catch(m){throw new Error("Exception while decoding undefined length content: "+m)}return p};if(s.tagConstructed)u=h();else if(s.isUniversal()&&(s.tagNumber==3||s.tagNumber==4))try{if(s.tagNumber==3&&e.get()!=0)throw new Error("BIT STRINGs with unused bits cannot encapsulate.");u=h();for(var l=0;l<u.length;++l)if(u[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch{u=null}if(u===null){if(i===null)throw new Error("We can't skip over an invalid tag with undefined length at offset "+o);e.pos=o+Math.abs(i)}return new r(n,a,i,s,u)},r}(),Wt=function(){function r(t){var e=t.get();if(this.tagClass=e>>6,this.tagConstructed=(e&32)!==0,this.tagNumber=e&31,this.tagNumber==31){var n=new Z;do e=t.get(),n.mulAdd(128,e&127);while(e&128);this.tagNumber=n.simplify()}}return r.prototype.isUniversal=function(){return this.tagClass===0},r.prototype.isEOC=function(){return this.tagClass===0&&this.tagNumber===0},r}(),M,Oe=0xdeadbeefcafe,te=(Oe&16777215)==15715070,O=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Ae=(1<<26)/O[O.length-1],c=function(){function r(t,e,n){t!=null&&(typeof t=="number"?this.fromNumber(t,e,n):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}return r.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var n=(1<<e)-1,s,i=!1,o="",a=this.t,u=this.DB-a*this.DB%e;if(a-- >0)for(u<this.DB&&(s=this[a]>>u)>0&&(i=!0,o=L(s));a>=0;)u<e?(s=(this[a]&(1<<u)-1)<<e-u,s|=this[--a]>>(u+=this.DB-e)):(s=this[a]>>(u-=e)&n,u<=0&&(u+=this.DB,--a)),s>0&&(i=!0),i&&(o+=L(s));return i?o:"0"},r.prototype.negate=function(){var t=g();return r.ZERO.subTo(this,t),t},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(t){var e=this.s-t.s;if(e!=0)return e;var n=this.t;if(e=n-t.t,e!=0)return this.s<0?-e:e;for(;--n>=0;)if((e=this[n]-t[n])!=0)return e;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+et(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(t){var e=g();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e},r.prototype.modPowInt=function(t,e){var n;return t<256||e.isEven()?n=new ee(e):n=new re(e),this.exp(t,n)},r.prototype.clone=function(){var t=g();return this.copyTo(t),t},r.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var t=this.t,e=[];e[0]=this.s;var n=this.DB-t*this.DB%8,s,i=0;if(t-- >0)for(n<this.DB&&(s=this[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=s|this.s<<this.DB-n);t>=0;)n<8?(s=(this[t]&(1<<n)-1)<<8-n,s|=this[--t]>>(n+=this.DB-8)):(s=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),s&128&&(s|=-256),i==0&&(this.s&128)!=(s&128)&&++i,(i>0||s!=this.s)&&(e[i++]=s);return e},r.prototype.equals=function(t){return this.compareTo(t)==0},r.prototype.min=function(t){return this.compareTo(t)<0?this:t},r.prototype.max=function(t){return this.compareTo(t)>0?this:t},r.prototype.and=function(t){var e=g();return this.bitwiseTo(t,Te,e),e},r.prototype.or=function(t){var e=g();return this.bitwiseTo(t,Q,e),e},r.prototype.xor=function(t){var e=g();return this.bitwiseTo(t,Zt,e),e},r.prototype.andNot=function(t){var e=g();return this.bitwiseTo(t,$t,e),e},r.prototype.not=function(){for(var t=g(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},r.prototype.shiftLeft=function(t){var e=g();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},r.prototype.shiftRight=function(t){var e=g();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},r.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(this[t]!=0)return t*this.DB+Ee(this[t]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,n=0;n<this.t;++n)t+=De(this[n]^e);return t},r.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?this.s!=0:(this[e]&1<<t%this.DB)!=0},r.prototype.setBit=function(t){return this.changeBit(t,Q)},r.prototype.clearBit=function(t){return this.changeBit(t,$t)},r.prototype.flipBit=function(t){return this.changeBit(t,Zt)},r.prototype.add=function(t){var e=g();return this.addTo(t,e),e},r.prototype.subtract=function(t){var e=g();return this.subTo(t,e),e},r.prototype.multiply=function(t){var e=g();return this.multiplyTo(t,e),e},r.prototype.divide=function(t){var e=g();return this.divRemTo(t,e,null),e},r.prototype.remainder=function(t){var e=g();return this.divRemTo(t,null,e),e},r.prototype.divideAndRemainder=function(t){var e=g(),n=g();return this.divRemTo(t,e,n),[e,n]},r.prototype.modPow=function(t,e){var n=t.bitLength(),s,i=F(1),o;if(n<=0)return i;n<18?s=1:n<48?s=3:n<144?s=4:n<768?s=5:s=6,n<8?o=new ee(e):e.isEven()?o=new Pe(e):o=new re(e);var a=[],u=3,h=s-1,l=(1<<s)-1;if(a[1]=o.convert(this),s>1){var p=g();for(o.sqrTo(a[1],p);u<=l;)a[u]=g(),o.mulTo(p,a[u-2],a[u]),u+=2}var v=t.t-1,y,m=!0,b=g(),w;for(n=et(t[v])-1;v>=0;){for(n>=h?y=t[v]>>n-h&l:(y=(t[v]&(1<<n+1)-1)<<h-n,v>0&&(y|=t[v-1]>>this.DB+n-h)),u=s;!(y&1);)y>>=1,--u;if((n-=u)<0&&(n+=this.DB,--v),m)a[y].copyTo(i),m=!1;else{for(;u>1;)o.sqrTo(i,b),o.sqrTo(b,i),u-=2;u>0?o.sqrTo(i,b):(w=i,i=b,b=w),o.mulTo(b,a[y],i)}for(;v>=0&&!(t[v]&1<<n);)o.sqrTo(i,b),w=i,i=b,b=w,--n<0&&(n=this.DB-1,--v)}return o.revert(i)},r.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return r.ZERO;for(var n=t.clone(),s=this.clone(),i=F(1),o=F(0),a=F(0),u=F(1);n.signum()!=0;){for(;n.isEven();)n.rShiftTo(1,n),e?((!i.isEven()||!o.isEven())&&(i.addTo(this,i),o.subTo(t,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;s.isEven();)s.rShiftTo(1,s),e?((!a.isEven()||!u.isEven())&&(a.addTo(this,a),u.subTo(t,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);n.compareTo(s)>=0?(n.subTo(s,n),e&&i.subTo(a,i),o.subTo(u,o)):(s.subTo(n,s),e&&a.subTo(i,a),u.subTo(o,u))}if(s.compareTo(r.ONE)!=0)return r.ZERO;if(u.compareTo(t)>=0)return u.subtract(t);if(u.signum()<0)u.addTo(t,u);else return u;return u.signum()<0?u.add(t):u},r.prototype.pow=function(t){return this.exp(t,new Be)},r.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var s=e;e=n,n=s}var i=e.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),o>0&&(e.rShiftTo(o,e),n.rShiftTo(o,n));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},r.prototype.isProbablePrime=function(t){var e,n=this.abs();if(n.t==1&&n[0]<=O[O.length-1]){for(e=0;e<O.length;++e)if(n[0]==O[e])return!0;return!1}if(n.isEven())return!1;for(e=1;e<O.length;){for(var s=O[e],i=e+1;i<O.length&&s<Ae;)s*=O[i++];for(s=n.modInt(s);e<i;)if(s%O[e++]==0)return!1}return n.millerRabin(t)},r.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},r.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},r.prototype.fromString=function(t,e){var n;if(e==16)n=4;else if(e==8)n=3;else if(e==256)n=8;else if(e==2)n=1;else if(e==32)n=5;else if(e==4)n=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var s=t.length,i=!1,o=0;--s>=0;){var a=n==8?+t[s]&255:se(t,s);if(a<0){t.charAt(s)=="-"&&(i=!0);continue}i=!1,o==0?this[this.t++]=a:o+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,o+=n,o>=this.DB&&(o-=this.DB)}n==8&&+t[0]&128&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s},r.prototype.drShiftTo=function(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s},r.prototype.lShiftTo=function(t,e){for(var n=t%this.DB,s=this.DB-n,i=(1<<s)-1,o=Math.floor(t/this.DB),a=this.s<<n&this.DM,u=this.t-1;u>=0;--u)e[u+o+1]=this[u]>>s|a,a=(this[u]&i)<<n;for(var u=o-1;u>=0;--u)e[u]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t){e.t=0;return}var s=t%this.DB,i=this.DB-s,o=(1<<s)-1;e[0]=this[n]>>s;for(var a=n+1;a<this.t;++a)e[a-n-1]|=(this[a]&o)<<i,e[a-n]=this[a]>>s;s>0&&(e[this.t-n-1]|=(this.s&o)<<i),e.t=this.t-n,e.clamp()},r.prototype.subTo=function(t,e){for(var n=0,s=0,i=Math.min(t.t,this.t);n<i;)s+=this[n]-t[n],e[n++]=s&this.DM,s>>=this.DB;if(t.t<this.t){for(s-=t.s;n<this.t;)s+=this[n],e[n++]=s&this.DM,s>>=this.DB;s+=this.s}else{for(s+=this.s;n<t.t;)s-=t[n],e[n++]=s&this.DM,s>>=this.DB;s-=t.s}e.s=s<0?-1:0,s<-1?e[n++]=this.DV+s:s>0&&(e[n++]=s),e.t=n,e.clamp()},r.prototype.multiplyTo=function(t,e){var n=this.abs(),s=t.abs(),i=n.t;for(e.t=i+s.t;--i>=0;)e[i]=0;for(i=0;i<s.t;++i)e[i+n.t]=n.am(0,s[i],e,i,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&r.ZERO.subTo(e,e)},r.prototype.squareTo=function(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var s=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,s,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function(t,e,n){var s=t.abs();if(!(s.t<=0)){var i=this.abs();if(i.t<s.t){e!=null&&e.fromInt(0),n!=null&&this.copyTo(n);return}n==null&&(n=g());var o=g(),a=this.s,u=t.s,h=this.DB-et(s[s.t-1]);h>0?(s.lShiftTo(h,o),i.lShiftTo(h,n)):(s.copyTo(o),i.copyTo(n));var l=o.t,p=o[l-1];if(p!=0){var v=p*(1<<this.F1)+(l>1?o[l-2]>>this.F2:0),y=this.FV/v,m=(1<<this.F1)/v,b=1<<this.F2,w=n.t,R=w-l,A=e??g();for(o.dlShiftTo(R,A),n.compareTo(A)>=0&&(n[n.t++]=1,n.subTo(A,n)),r.ONE.dlShiftTo(l,A),A.subTo(o,o);o.t<l;)o[o.t++]=0;for(;--R>=0;){var _=n[--w]==p?this.DM:Math.floor(n[w]*y+(n[w-1]+b)*m);if((n[w]+=o.am(0,_,n,R,0,l))<_)for(o.dlShiftTo(R,A),n.subTo(A,n);n[w]<--_;)n.subTo(A,n)}e!=null&&(n.drShiftTo(l,e),a!=u&&r.ZERO.subTo(e,e)),n.t=l,n.clamp(),h>0&&n.rShiftTo(h,n),a<0&&r.ZERO.subTo(n,n)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e},r.prototype.isEven=function(){return(this.t>0?this[0]&1:this.s)==0},r.prototype.exp=function(t,e){if(t>4294967295||t<1)return r.ONE;var n=g(),s=g(),i=e.convert(this),o=et(t)-1;for(i.copyTo(n);--o>=0;)if(e.sqrTo(n,s),(t&1<<o)>0)e.mulTo(s,i,n);else{var a=n;n=s,s=a}return e.revert(n)},r.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),s=F(n),i=g(),o=g(),a="";for(this.divRemTo(s,i,o);i.signum()>0;)a=(n+o.intValue()).toString(t).substr(1)+a,i.divRemTo(s,i,o);return o.intValue().toString(t)+a},r.prototype.fromRadix=function(t,e){this.fromInt(0),e==null&&(e=10);for(var n=this.chunkSize(e),s=Math.pow(e,n),i=!1,o=0,a=0,u=0;u<t.length;++u){var h=se(t,u);if(h<0){t.charAt(u)=="-"&&this.signum()==0&&(i=!0);continue}a=e*a+h,++o>=n&&(this.dMultiply(s),this.dAddOffset(a,0),o=0,a=0)}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(a,0)),i&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(t,e,n){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),Q,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var s=[],i=t&7;s.length=(t>>3)+1,e.nextBytes(s),i>0?s[0]&=(1<<i)-1:s[0]=0,this.fromString(s,256)}},r.prototype.bitwiseTo=function(t,e,n){var s,i,o=Math.min(t.t,this.t);for(s=0;s<o;++s)n[s]=e(this[s],t[s]);if(t.t<this.t){for(i=t.s&this.DM,s=o;s<this.t;++s)n[s]=e(this[s],i);n.t=this.t}else{for(i=this.s&this.DM,s=o;s<t.t;++s)n[s]=e(i,t[s]);n.t=t.t}n.s=e(this.s,t.s),n.clamp()},r.prototype.changeBit=function(t,e){var n=r.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n},r.prototype.addTo=function(t,e){for(var n=0,s=0,i=Math.min(t.t,this.t);n<i;)s+=this[n]+t[n],e[n++]=s&this.DM,s>>=this.DB;if(t.t<this.t){for(s+=t.s;n<this.t;)s+=this[n],e[n++]=s&this.DM,s>>=this.DB;s+=this.s}else{for(s+=this.s;n<t.t;)s+=t[n],e[n++]=s&this.DM,s>>=this.DB;s+=t.s}e.s=s<0?-1:0,s>0?e[n++]=s:s<-1&&(e[n++]=this.DV+s),e.t=n,e.clamp()},r.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(t,e){if(t!=0){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},r.prototype.multiplyLowerTo=function(t,e,n){var s=Math.min(this.t+t.t,e);for(n.s=0,n.t=s;s>0;)n[--s]=0;for(var i=n.t-this.t;s<i;++s)n[s+this.t]=this.am(0,t[s],n,s,0,this.t);for(var i=Math.min(t.t,e);s<i;++s)this.am(0,t[s],n,s,0,e-s);n.clamp()},r.prototype.multiplyUpperTo=function(t,e,n){--e;var s=n.t=this.t+t.t-e;for(n.s=0;--s>=0;)n[s]=0;for(s=Math.max(e-this.t,0);s<t.t;++s)n[this.t+s-e]=this.am(e-s,t[s],n,0,0,this.t+s-e);n.clamp(),n.drShiftTo(1,n)},r.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,n=this.s<0?t-1:0;if(this.t>0)if(e==0)n=this[0]%t;else for(var s=this.t-1;s>=0;--s)n=(e*n+this[s])%t;return n},r.prototype.millerRabin=function(t){var e=this.subtract(r.ONE),n=e.getLowestSetBit();if(n<=0)return!1;var s=e.shiftRight(n);t=t+1>>1,t>O.length&&(t=O.length);for(var i=g(),o=0;o<t;++o){i.fromInt(O[Math.floor(Math.random()*O.length)]);var a=i.modPow(s,this);if(a.compareTo(r.ONE)!=0&&a.compareTo(e)!=0){for(var u=1;u++<n&&a.compareTo(e)!=0;)if(a=a.modPowInt(2,this),a.compareTo(r.ONE)==0)return!1;if(a.compareTo(e)!=0)return!1}}return!0},r.prototype.square=function(){var t=g();return this.squareTo(t),t},r.prototype.gcda=function(t,e){var n=this.s<0?this.negate():this.clone(),s=t.s<0?t.negate():t.clone();if(n.compareTo(s)<0){var i=n;n=s,s=i}var o=n.getLowestSetBit(),a=s.getLowestSetBit();if(a<0){e(n);return}o<a&&(a=o),a>0&&(n.rShiftTo(a,n),s.rShiftTo(a,s));var u=function(){(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),(o=s.getLowestSetBit())>0&&s.rShiftTo(o,s),n.compareTo(s)>=0?(n.subTo(s,n),n.rShiftTo(1,n)):(s.subTo(n,s),s.rShiftTo(1,s)),n.signum()>0?setTimeout(u,0):(a>0&&s.lShiftTo(a,s),setTimeout(function(){e(s)},0))};setTimeout(u,10)},r.prototype.fromNumberAsync=function(t,e,n,s){if(typeof e=="number")if(t<2)this.fromInt(1);else{this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),Q,this),this.isEven()&&this.dAddOffset(1,0);var i=this,o=function(){i.dAddOffset(2,0),i.bitLength()>t&&i.subTo(r.ONE.shiftLeft(t-1),i),i.isProbablePrime(e)?setTimeout(function(){s()},0):setTimeout(o,0)};setTimeout(o,0)}else{var a=[],u=t&7;a.length=(t>>3)+1,e.nextBytes(a),u>0?a[0]&=(1<<u)-1:a[0]=0,this.fromString(a,256)}},r}(),Be=function(){function r(){}return r.prototype.convert=function(t){return t},r.prototype.revert=function(t){return t},r.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},r.prototype.sqrTo=function(t,e){t.squareTo(e)},r}(),ee=function(){function r(t){this.m=t}return r.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},r.prototype.revert=function(t){return t},r.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},r.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},r.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r}(),re=function(){function r(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}return r.prototype.convert=function(t){var e=g();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(c.ZERO)>0&&this.m.subTo(e,e),e},r.prototype.revert=function(t){var e=g();return t.copyTo(e),this.reduce(e),e},r.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=t[e]&32767,s=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t[n]+=this.m.am(0,s,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},r.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},r.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r}(),Pe=function(){function r(t){this.m=t,this.r2=g(),this.q3=g(),c.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return r.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=g();return t.copyTo(e),this.reduce(e),e},r.prototype.revert=function(t){return t},r.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},r.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},r.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r}();function g(){return new c(null)}function E(r,t){return new c(r,t)}var ne=typeof navigator<"u";ne&&te&&navigator.appName=="Microsoft Internet Explorer"?(c.prototype.am=function(t,e,n,s,i,o){for(var a=e&32767,u=e>>15;--o>=0;){var h=this[t]&32767,l=this[t++]>>15,p=u*h+l*a;h=a*h+((p&32767)<<15)+n[s]+(i&1073741823),i=(h>>>30)+(p>>>15)+u*l+(i>>>30),n[s++]=h&1073741823}return i},M=30):ne&&te&&navigator.appName!="Netscape"?(c.prototype.am=function(t,e,n,s,i,o){for(;--o>=0;){var a=e*this[t++]+n[s]+i;i=Math.floor(a/67108864),n[s++]=a&67108863}return i},M=26):(c.prototype.am=function(t,e,n,s,i,o){for(var a=e&16383,u=e>>14;--o>=0;){var h=this[t]&16383,l=this[t++]>>14,p=u*h+l*a;h=a*h+((p&16383)<<14)+n[s]+i,i=(h>>28)+(p>>14)+u*l,n[s++]=h&268435455}return i},M=28),c.prototype.DB=M,c.prototype.DM=(1<<M)-1,c.prototype.DV=1<<M;var vt=52;c.prototype.FV=Math.pow(2,vt),c.prototype.F1=vt-M,c.prototype.F2=2*M-vt;var tt=[],z,P;for(z=48,P=0;P<=9;++P)tt[z++]=P;for(z=97,P=10;P<36;++P)tt[z++]=P;for(z=65,P=10;P<36;++P)tt[z++]=P;function se(r,t){var e=tt[r.charCodeAt(t)];return e??-1}function F(r){var t=g();return t.fromInt(r),t}function et(r){var t=1,e;return(e=r>>>16)!=0&&(r=e,t+=16),(e=r>>8)!=0&&(r=e,t+=8),(e=r>>4)!=0&&(r=e,t+=4),(e=r>>2)!=0&&(r=e,t+=2),(e=r>>1)!=0&&(r=e,t+=1),t}c.ZERO=F(0),c.ONE=F(1);var Ne=function(){function r(){this.i=0,this.j=0,this.S=[]}return r.prototype.init=function(t){var e,n,s;for(e=0;e<256;++e)this.S[e]=e;for(n=0,e=0;e<256;++e)n=n+this.S[e]+t[e%t.length]&255,s=this.S[e],this.S[e]=this.S[n],this.S[n]=s;this.i=0,this.j=0},r.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},r}();function Ve(){return new Ne}var ie=256,rt,j=null,N;if(j==null){j=[],N=0;var nt=void 0;if(typeof window<"u"&&window.crypto&&window.crypto.getRandomValues){var yt=new Uint32Array(256);for(window.crypto.getRandomValues(yt),nt=0;nt<yt.length;++nt)j[N++]=yt[nt]&255}var st=0,it=function(r){if(st=st||0,st>=256||N>=ie){window.removeEventListener?window.removeEventListener("mousemove",it,!1):window.detachEvent&&window.detachEvent("onmousemove",it);return}try{var t=r.x+r.y;j[N++]=t&255,st+=1}catch{}};typeof window<"u"&&(window.addEventListener?window.addEventListener("mousemove",it,!1):window.attachEvent&&window.attachEvent("onmousemove",it))}function Le(){if(rt==null){for(rt=Ve();N<ie;){var r=Math.floor(65536*Math.random());j[N++]=r&255}for(rt.init(j),N=0;N<j.length;++N)j[N]=0;N=0}return rt.next()}var mt=function(){function r(){}return r.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=Le()},r}();function Ie(r,t){if(t<r.length+22)return console.error("Message too long for RSA"),null;for(var e=t-r.length-6,n="",s=0;s<e;s+=2)n+="ff";var i="0001"+n+"00"+r;return E(i,16)}function Me(r,t){if(t<r.length+11)return console.error("Message too long for RSA"),null;for(var e=[],n=r.length-1;n>=0&&t>0;){var s=r.charCodeAt(n--);s<128?e[--t]=s:s>127&&s<2048?(e[--t]=s&63|128,e[--t]=s>>6|192):(e[--t]=s&63|128,e[--t]=s>>6&63|128,e[--t]=s>>12|224)}e[--t]=0;for(var i=new mt,o=[];t>2;){for(o[0]=0;o[0]==0;)i.nextBytes(o);e[--t]=o[0]}return e[--t]=2,e[--t]=0,new c(e)}var Fe=function(){function r(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return r.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},r.prototype.doPrivate=function(t){if(this.p==null||this.q==null)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),n=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(n)<0;)e=e.add(this.p);return e.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)},r.prototype.setPublic=function(t,e){t!=null&&e!=null&&t.length>0&&e.length>0?(this.n=E(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},r.prototype.encrypt=function(t){var e=this.n.bitLength()+7>>3,n=Me(t,e);if(n==null)return null;var s=this.doPublic(n);if(s==null)return null;for(var i=s.toString(16),o=i.length,a=0;a<e*2-o;a++)i="0"+i;return i},r.prototype.setPrivate=function(t,e,n){t!=null&&e!=null&&t.length>0&&e.length>0?(this.n=E(t,16),this.e=parseInt(e,16),this.d=E(n,16)):console.error("Invalid RSA private key")},r.prototype.setPrivateEx=function(t,e,n,s,i,o,a,u){t!=null&&e!=null&&t.length>0&&e.length>0?(this.n=E(t,16),this.e=parseInt(e,16),this.d=E(n,16),this.p=E(s,16),this.q=E(i,16),this.dmp1=E(o,16),this.dmq1=E(a,16),this.coeff=E(u,16)):console.error("Invalid RSA private key")},r.prototype.generate=function(t,e){var n=new mt,s=t>>1;this.e=parseInt(e,16);for(var i=new c(e,16);;){for(;this.p=new c(t-s,1,n),!(this.p.subtract(c.ONE).gcd(i).compareTo(c.ONE)==0&&this.p.isProbablePrime(10)););for(;this.q=new c(s,1,n),!(this.q.subtract(c.ONE).gcd(i).compareTo(c.ONE)==0&&this.q.isProbablePrime(10)););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var a=this.p.subtract(c.ONE),u=this.q.subtract(c.ONE),h=a.multiply(u);if(h.gcd(i).compareTo(c.ONE)==0){this.n=this.p.multiply(this.q),this.d=i.modInverse(h),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(u),this.coeff=this.q.modInverse(this.p);break}}},r.prototype.decrypt=function(t){var e=E(t,16),n=this.doPrivate(e);return n==null?null:je(n,this.n.bitLength()+7>>3)},r.prototype.generateAsync=function(t,e,n){var s=new mt,i=t>>1;this.e=parseInt(e,16);var o=new c(e,16),a=this,u=function(){var h=function(){if(a.p.compareTo(a.q)<=0){var v=a.p;a.p=a.q,a.q=v}var y=a.p.subtract(c.ONE),m=a.q.subtract(c.ONE),b=y.multiply(m);b.gcd(o).compareTo(c.ONE)==0?(a.n=a.p.multiply(a.q),a.d=o.modInverse(b),a.dmp1=a.d.mod(y),a.dmq1=a.d.mod(m),a.coeff=a.q.modInverse(a.p),setTimeout(function(){n()},0)):setTimeout(u,0)},l=function(){a.q=g(),a.q.fromNumberAsync(i,1,s,function(){a.q.subtract(c.ONE).gcda(o,function(v){v.compareTo(c.ONE)==0&&a.q.isProbablePrime(10)?setTimeout(h,0):setTimeout(l,0)})})},p=function(){a.p=g(),a.p.fromNumberAsync(t-i,1,s,function(){a.p.subtract(c.ONE).gcda(o,function(v){v.compareTo(c.ONE)==0&&a.p.isProbablePrime(10)?setTimeout(l,0):setTimeout(p,0)})})};setTimeout(p,0)};setTimeout(u,0)},r.prototype.sign=function(t,e,n){var s=ke(n),i=s+e(t).toString(),o=Ie(i,this.n.bitLength()/4);if(o==null)return null;var a=this.doPrivate(o);if(a==null)return null;var u=a.toString(16);return u.length&1?"0"+u:u},r.prototype.verify=function(t,e,n){var s=E(e,16),i=this.doPublic(s);if(i==null)return null;var o=i.toString(16).replace(/^1f+00/,""),a=qe(o);return a==n(t).toString()},r}();function je(r,t){for(var e=r.toByteArray(),n=0;n<e.length&&e[n]==0;)++n;if(e.length-n!=t-1||e[n]!=2)return null;for(++n;e[n]!=0;)if(++n>=e.length)return null;for(var s="";++n<e.length;){var i=e[n]&255;i<128?s+=String.fromCharCode(i):i>191&&i<224?(s+=String.fromCharCode((i&31)<<6|e[n+1]&63),++n):(s+=String.fromCharCode((i&15)<<12|(e[n+1]&63)<<6|e[n+2]&63),n+=2)}return s}var at={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function ke(r){return at[r]||""}function qe(r){for(var t in at)if(at.hasOwnProperty(t)){var e=at[t],n=e.length;if(r.substr(0,n)==e)return r.substr(n)}return r}/*!
|
|
8
|
+
`,this.sub!==null){t+=" ";for(var n=0,s=this.sub.length;n<s;++n)e+=this.sub[n].toPrettyString(t)}return e},r.prototype.posStart=function(){return this.stream.pos},r.prototype.posContent=function(){return this.stream.pos+this.header},r.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},r.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},r.decodeLength=function(t){var e=t.get(),n=e&127;if(n==e)return n;if(n>6)throw new Error("Length over 48 bits not supported at position "+(t.pos-1));if(n===0)return null;e=0;for(var s=0;s<n;++s)e=e*256+t.get();return e},r.prototype.getHexStringValue=function(){var t=this.toHexString(),e=this.header*2,n=this.length*2;return t.substr(e,n)},r.decode=function(t){var e;t instanceof dt?e=t:e=new dt(t,0);var n=new dt(e),s=new Wt(e),i=r.decodeLength(e),o=e.pos,a=o-n.pos,u=null,h=function(){var p=[];if(i!==null){for(var y=o+i;e.pos<y;)p[p.length]=r.decode(e);if(e.pos!=y)throw new Error("Content size is not correct for container starting at offset "+o)}else try{for(;;){var d=r.decode(e);if(d.tag.isEOC())break;p[p.length]=d}i=o-e.pos}catch(m){throw new Error("Exception while decoding undefined length content: "+m)}return p};if(s.tagConstructed)u=h();else if(s.isUniversal()&&(s.tagNumber==3||s.tagNumber==4))try{if(s.tagNumber==3&&e.get()!=0)throw new Error("BIT STRINGs with unused bits cannot encapsulate.");u=h();for(var l=0;l<u.length;++l)if(u[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch{u=null}if(u===null){if(i===null)throw new Error("We can't skip over an invalid tag with undefined length at offset "+o);e.pos=o+Math.abs(i)}return new r(n,a,i,s,u)},r}(),Wt=function(){function r(t){var e=t.get();if(this.tagClass=e>>6,this.tagConstructed=(e&32)!==0,this.tagNumber=e&31,this.tagNumber==31){var n=new Z;do e=t.get(),n.mulAdd(128,e&127);while(e&128);this.tagNumber=n.simplify()}}return r.prototype.isUniversal=function(){return this.tagClass===0},r.prototype.isEOC=function(){return this.tagClass===0&&this.tagNumber===0},r}(),M,Oe=0xdeadbeefcafe,te=(Oe&16777215)==15715070,O=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],Ae=(1<<26)/O[O.length-1],c=function(){function r(t,e,n){t!=null&&(typeof t=="number"?this.fromNumber(t,e,n):e==null&&typeof t!="string"?this.fromString(t,256):this.fromString(t,e))}return r.prototype.toString=function(t){if(this.s<0)return"-"+this.negate().toString(t);var e;if(t==16)e=4;else if(t==8)e=3;else if(t==2)e=1;else if(t==32)e=5;else if(t==4)e=2;else return this.toRadix(t);var n=(1<<e)-1,s,i=!1,o="",a=this.t,u=this.DB-a*this.DB%e;if(a-- >0)for(u<this.DB&&(s=this[a]>>u)>0&&(i=!0,o=L(s));a>=0;)u<e?(s=(this[a]&(1<<u)-1)<<e-u,s|=this[--a]>>(u+=this.DB-e)):(s=this[a]>>(u-=e)&n,u<=0&&(u+=this.DB,--a)),s>0&&(i=!0),i&&(o+=L(s));return i?o:"0"},r.prototype.negate=function(){var t=g();return r.ZERO.subTo(this,t),t},r.prototype.abs=function(){return this.s<0?this.negate():this},r.prototype.compareTo=function(t){var e=this.s-t.s;if(e!=0)return e;var n=this.t;if(e=n-t.t,e!=0)return this.s<0?-e:e;for(;--n>=0;)if((e=this[n]-t[n])!=0)return e;return 0},r.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+et(this[this.t-1]^this.s&this.DM)},r.prototype.mod=function(t){var e=g();return this.abs().divRemTo(t,null,e),this.s<0&&e.compareTo(r.ZERO)>0&&t.subTo(e,e),e},r.prototype.modPowInt=function(t,e){var n;return t<256||e.isEven()?n=new ee(e):n=new re(e),this.exp(t,n)},r.prototype.clone=function(){var t=g();return this.copyTo(t),t},r.prototype.intValue=function(){if(this.s<0){if(this.t==1)return this[0]-this.DV;if(this.t==0)return-1}else{if(this.t==1)return this[0];if(this.t==0)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},r.prototype.byteValue=function(){return this.t==0?this.s:this[0]<<24>>24},r.prototype.shortValue=function(){return this.t==0?this.s:this[0]<<16>>16},r.prototype.signum=function(){return this.s<0?-1:this.t<=0||this.t==1&&this[0]<=0?0:1},r.prototype.toByteArray=function(){var t=this.t,e=[];e[0]=this.s;var n=this.DB-t*this.DB%8,s,i=0;if(t-- >0)for(n<this.DB&&(s=this[t]>>n)!=(this.s&this.DM)>>n&&(e[i++]=s|this.s<<this.DB-n);t>=0;)n<8?(s=(this[t]&(1<<n)-1)<<8-n,s|=this[--t]>>(n+=this.DB-8)):(s=this[t]>>(n-=8)&255,n<=0&&(n+=this.DB,--t)),s&128&&(s|=-256),i==0&&(this.s&128)!=(s&128)&&++i,(i>0||s!=this.s)&&(e[i++]=s);return e},r.prototype.equals=function(t){return this.compareTo(t)==0},r.prototype.min=function(t){return this.compareTo(t)<0?this:t},r.prototype.max=function(t){return this.compareTo(t)>0?this:t},r.prototype.and=function(t){var e=g();return this.bitwiseTo(t,Te,e),e},r.prototype.or=function(t){var e=g();return this.bitwiseTo(t,Q,e),e},r.prototype.xor=function(t){var e=g();return this.bitwiseTo(t,Zt,e),e},r.prototype.andNot=function(t){var e=g();return this.bitwiseTo(t,$t,e),e},r.prototype.not=function(){for(var t=g(),e=0;e<this.t;++e)t[e]=this.DM&~this[e];return t.t=this.t,t.s=~this.s,t},r.prototype.shiftLeft=function(t){var e=g();return t<0?this.rShiftTo(-t,e):this.lShiftTo(t,e),e},r.prototype.shiftRight=function(t){var e=g();return t<0?this.lShiftTo(-t,e):this.rShiftTo(t,e),e},r.prototype.getLowestSetBit=function(){for(var t=0;t<this.t;++t)if(this[t]!=0)return t*this.DB+Ee(this[t]);return this.s<0?this.t*this.DB:-1},r.prototype.bitCount=function(){for(var t=0,e=this.s&this.DM,n=0;n<this.t;++n)t+=De(this[n]^e);return t},r.prototype.testBit=function(t){var e=Math.floor(t/this.DB);return e>=this.t?this.s!=0:(this[e]&1<<t%this.DB)!=0},r.prototype.setBit=function(t){return this.changeBit(t,Q)},r.prototype.clearBit=function(t){return this.changeBit(t,$t)},r.prototype.flipBit=function(t){return this.changeBit(t,Zt)},r.prototype.add=function(t){var e=g();return this.addTo(t,e),e},r.prototype.subtract=function(t){var e=g();return this.subTo(t,e),e},r.prototype.multiply=function(t){var e=g();return this.multiplyTo(t,e),e},r.prototype.divide=function(t){var e=g();return this.divRemTo(t,e,null),e},r.prototype.remainder=function(t){var e=g();return this.divRemTo(t,null,e),e},r.prototype.divideAndRemainder=function(t){var e=g(),n=g();return this.divRemTo(t,e,n),[e,n]},r.prototype.modPow=function(t,e){var n=t.bitLength(),s,i=F(1),o;if(n<=0)return i;n<18?s=1:n<48?s=3:n<144?s=4:n<768?s=5:s=6,n<8?o=new ee(e):e.isEven()?o=new Pe(e):o=new re(e);var a=[],u=3,h=s-1,l=(1<<s)-1;if(a[1]=o.convert(this),s>1){var p=g();for(o.sqrTo(a[1],p);u<=l;)a[u]=g(),o.mulTo(p,a[u-2],a[u]),u+=2}var y=t.t-1,d,m=!0,b=g(),_;for(n=et(t[y])-1;y>=0;){for(n>=h?d=t[y]>>n-h&l:(d=(t[y]&(1<<n+1)-1)<<h-n,y>0&&(d|=t[y-1]>>this.DB+n-h)),u=s;!(d&1);)d>>=1,--u;if((n-=u)<0&&(n+=this.DB,--y),m)a[d].copyTo(i),m=!1;else{for(;u>1;)o.sqrTo(i,b),o.sqrTo(b,i),u-=2;u>0?o.sqrTo(i,b):(_=i,i=b,b=_),o.mulTo(b,a[d],i)}for(;y>=0&&!(t[y]&1<<n);)o.sqrTo(i,b),_=i,i=b,b=_,--n<0&&(n=this.DB-1,--y)}return o.revert(i)},r.prototype.modInverse=function(t){var e=t.isEven();if(this.isEven()&&e||t.signum()==0)return r.ZERO;for(var n=t.clone(),s=this.clone(),i=F(1),o=F(0),a=F(0),u=F(1);n.signum()!=0;){for(;n.isEven();)n.rShiftTo(1,n),e?((!i.isEven()||!o.isEven())&&(i.addTo(this,i),o.subTo(t,o)),i.rShiftTo(1,i)):o.isEven()||o.subTo(t,o),o.rShiftTo(1,o);for(;s.isEven();)s.rShiftTo(1,s),e?((!a.isEven()||!u.isEven())&&(a.addTo(this,a),u.subTo(t,u)),a.rShiftTo(1,a)):u.isEven()||u.subTo(t,u),u.rShiftTo(1,u);n.compareTo(s)>=0?(n.subTo(s,n),e&&i.subTo(a,i),o.subTo(u,o)):(s.subTo(n,s),e&&a.subTo(i,a),u.subTo(o,u))}if(s.compareTo(r.ONE)!=0)return r.ZERO;if(u.compareTo(t)>=0)return u.subtract(t);if(u.signum()<0)u.addTo(t,u);else return u;return u.signum()<0?u.add(t):u},r.prototype.pow=function(t){return this.exp(t,new Be)},r.prototype.gcd=function(t){var e=this.s<0?this.negate():this.clone(),n=t.s<0?t.negate():t.clone();if(e.compareTo(n)<0){var s=e;e=n,n=s}var i=e.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return e;for(i<o&&(o=i),o>0&&(e.rShiftTo(o,e),n.rShiftTo(o,n));e.signum()>0;)(i=e.getLowestSetBit())>0&&e.rShiftTo(i,e),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),e.compareTo(n)>=0?(e.subTo(n,e),e.rShiftTo(1,e)):(n.subTo(e,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},r.prototype.isProbablePrime=function(t){var e,n=this.abs();if(n.t==1&&n[0]<=O[O.length-1]){for(e=0;e<O.length;++e)if(n[0]==O[e])return!0;return!1}if(n.isEven())return!1;for(e=1;e<O.length;){for(var s=O[e],i=e+1;i<O.length&&s<Ae;)s*=O[i++];for(s=n.modInt(s);e<i;)if(s%O[e++]==0)return!1}return n.millerRabin(t)},r.prototype.copyTo=function(t){for(var e=this.t-1;e>=0;--e)t[e]=this[e];t.t=this.t,t.s=this.s},r.prototype.fromInt=function(t){this.t=1,this.s=t<0?-1:0,t>0?this[0]=t:t<-1?this[0]=t+this.DV:this.t=0},r.prototype.fromString=function(t,e){var n;if(e==16)n=4;else if(e==8)n=3;else if(e==256)n=8;else if(e==2)n=1;else if(e==32)n=5;else if(e==4)n=2;else{this.fromRadix(t,e);return}this.t=0,this.s=0;for(var s=t.length,i=!1,o=0;--s>=0;){var a=n==8?+t[s]&255:se(t,s);if(a<0){t.charAt(s)=="-"&&(i=!0);continue}i=!1,o==0?this[this.t++]=a:o+n>this.DB?(this[this.t-1]|=(a&(1<<this.DB-o)-1)<<o,this[this.t++]=a>>this.DB-o):this[this.t-1]|=a<<o,o+=n,o>=this.DB&&(o-=this.DB)}n==8&&+t[0]&128&&(this.s=-1,o>0&&(this[this.t-1]|=(1<<this.DB-o)-1<<o)),this.clamp(),i&&r.ZERO.subTo(this,this)},r.prototype.clamp=function(){for(var t=this.s&this.DM;this.t>0&&this[this.t-1]==t;)--this.t},r.prototype.dlShiftTo=function(t,e){var n;for(n=this.t-1;n>=0;--n)e[n+t]=this[n];for(n=t-1;n>=0;--n)e[n]=0;e.t=this.t+t,e.s=this.s},r.prototype.drShiftTo=function(t,e){for(var n=t;n<this.t;++n)e[n-t]=this[n];e.t=Math.max(this.t-t,0),e.s=this.s},r.prototype.lShiftTo=function(t,e){for(var n=t%this.DB,s=this.DB-n,i=(1<<s)-1,o=Math.floor(t/this.DB),a=this.s<<n&this.DM,u=this.t-1;u>=0;--u)e[u+o+1]=this[u]>>s|a,a=(this[u]&i)<<n;for(var u=o-1;u>=0;--u)e[u]=0;e[o]=a,e.t=this.t+o+1,e.s=this.s,e.clamp()},r.prototype.rShiftTo=function(t,e){e.s=this.s;var n=Math.floor(t/this.DB);if(n>=this.t){e.t=0;return}var s=t%this.DB,i=this.DB-s,o=(1<<s)-1;e[0]=this[n]>>s;for(var a=n+1;a<this.t;++a)e[a-n-1]|=(this[a]&o)<<i,e[a-n]=this[a]>>s;s>0&&(e[this.t-n-1]|=(this.s&o)<<i),e.t=this.t-n,e.clamp()},r.prototype.subTo=function(t,e){for(var n=0,s=0,i=Math.min(t.t,this.t);n<i;)s+=this[n]-t[n],e[n++]=s&this.DM,s>>=this.DB;if(t.t<this.t){for(s-=t.s;n<this.t;)s+=this[n],e[n++]=s&this.DM,s>>=this.DB;s+=this.s}else{for(s+=this.s;n<t.t;)s-=t[n],e[n++]=s&this.DM,s>>=this.DB;s-=t.s}e.s=s<0?-1:0,s<-1?e[n++]=this.DV+s:s>0&&(e[n++]=s),e.t=n,e.clamp()},r.prototype.multiplyTo=function(t,e){var n=this.abs(),s=t.abs(),i=n.t;for(e.t=i+s.t;--i>=0;)e[i]=0;for(i=0;i<s.t;++i)e[i+n.t]=n.am(0,s[i],e,i,0,n.t);e.s=0,e.clamp(),this.s!=t.s&&r.ZERO.subTo(e,e)},r.prototype.squareTo=function(t){for(var e=this.abs(),n=t.t=2*e.t;--n>=0;)t[n]=0;for(n=0;n<e.t-1;++n){var s=e.am(n,e[n],t,2*n,0,1);(t[n+e.t]+=e.am(n+1,2*e[n],t,2*n+1,s,e.t-n-1))>=e.DV&&(t[n+e.t]-=e.DV,t[n+e.t+1]=1)}t.t>0&&(t[t.t-1]+=e.am(n,e[n],t,2*n,0,1)),t.s=0,t.clamp()},r.prototype.divRemTo=function(t,e,n){var s=t.abs();if(!(s.t<=0)){var i=this.abs();if(i.t<s.t){e!=null&&e.fromInt(0),n!=null&&this.copyTo(n);return}n==null&&(n=g());var o=g(),a=this.s,u=t.s,h=this.DB-et(s[s.t-1]);h>0?(s.lShiftTo(h,o),i.lShiftTo(h,n)):(s.copyTo(o),i.copyTo(n));var l=o.t,p=o[l-1];if(p!=0){var y=p*(1<<this.F1)+(l>1?o[l-2]>>this.F2:0),d=this.FV/y,m=(1<<this.F1)/y,b=1<<this.F2,_=n.t,w=_-l,A=e??g();for(o.dlShiftTo(w,A),n.compareTo(A)>=0&&(n[n.t++]=1,n.subTo(A,n)),r.ONE.dlShiftTo(l,A),A.subTo(o,o);o.t<l;)o[o.t++]=0;for(;--w>=0;){var R=n[--_]==p?this.DM:Math.floor(n[_]*d+(n[_-1]+b)*m);if((n[_]+=o.am(0,R,n,w,0,l))<R)for(o.dlShiftTo(w,A),n.subTo(A,n);n[_]<--R;)n.subTo(A,n)}e!=null&&(n.drShiftTo(l,e),a!=u&&r.ZERO.subTo(e,e)),n.t=l,n.clamp(),h>0&&n.rShiftTo(h,n),a<0&&r.ZERO.subTo(n,n)}}},r.prototype.invDigit=function(){if(this.t<1)return 0;var t=this[0];if(!(t&1))return 0;var e=t&3;return e=e*(2-(t&15)*e)&15,e=e*(2-(t&255)*e)&255,e=e*(2-((t&65535)*e&65535))&65535,e=e*(2-t*e%this.DV)%this.DV,e>0?this.DV-e:-e},r.prototype.isEven=function(){return(this.t>0?this[0]&1:this.s)==0},r.prototype.exp=function(t,e){if(t>4294967295||t<1)return r.ONE;var n=g(),s=g(),i=e.convert(this),o=et(t)-1;for(i.copyTo(n);--o>=0;)if(e.sqrTo(n,s),(t&1<<o)>0)e.mulTo(s,i,n);else{var a=n;n=s,s=a}return e.revert(n)},r.prototype.chunkSize=function(t){return Math.floor(Math.LN2*this.DB/Math.log(t))},r.prototype.toRadix=function(t){if(t==null&&(t=10),this.signum()==0||t<2||t>36)return"0";var e=this.chunkSize(t),n=Math.pow(t,e),s=F(n),i=g(),o=g(),a="";for(this.divRemTo(s,i,o);i.signum()>0;)a=(n+o.intValue()).toString(t).substr(1)+a,i.divRemTo(s,i,o);return o.intValue().toString(t)+a},r.prototype.fromRadix=function(t,e){this.fromInt(0),e==null&&(e=10);for(var n=this.chunkSize(e),s=Math.pow(e,n),i=!1,o=0,a=0,u=0;u<t.length;++u){var h=se(t,u);if(h<0){t.charAt(u)=="-"&&this.signum()==0&&(i=!0);continue}a=e*a+h,++o>=n&&(this.dMultiply(s),this.dAddOffset(a,0),o=0,a=0)}o>0&&(this.dMultiply(Math.pow(e,o)),this.dAddOffset(a,0)),i&&r.ZERO.subTo(this,this)},r.prototype.fromNumber=function(t,e,n){if(typeof e=="number")if(t<2)this.fromInt(1);else for(this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),Q,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(e);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(r.ONE.shiftLeft(t-1),this);else{var s=[],i=t&7;s.length=(t>>3)+1,e.nextBytes(s),i>0?s[0]&=(1<<i)-1:s[0]=0,this.fromString(s,256)}},r.prototype.bitwiseTo=function(t,e,n){var s,i,o=Math.min(t.t,this.t);for(s=0;s<o;++s)n[s]=e(this[s],t[s]);if(t.t<this.t){for(i=t.s&this.DM,s=o;s<this.t;++s)n[s]=e(this[s],i);n.t=this.t}else{for(i=this.s&this.DM,s=o;s<t.t;++s)n[s]=e(i,t[s]);n.t=t.t}n.s=e(this.s,t.s),n.clamp()},r.prototype.changeBit=function(t,e){var n=r.ONE.shiftLeft(t);return this.bitwiseTo(n,e,n),n},r.prototype.addTo=function(t,e){for(var n=0,s=0,i=Math.min(t.t,this.t);n<i;)s+=this[n]+t[n],e[n++]=s&this.DM,s>>=this.DB;if(t.t<this.t){for(s+=t.s;n<this.t;)s+=this[n],e[n++]=s&this.DM,s>>=this.DB;s+=this.s}else{for(s+=this.s;n<t.t;)s+=t[n],e[n++]=s&this.DM,s>>=this.DB;s+=t.s}e.s=s<0?-1:0,s>0?e[n++]=s:s<-1&&(e[n++]=this.DV+s),e.t=n,e.clamp()},r.prototype.dMultiply=function(t){this[this.t]=this.am(0,t-1,this,0,0,this.t),++this.t,this.clamp()},r.prototype.dAddOffset=function(t,e){if(t!=0){for(;this.t<=e;)this[this.t++]=0;for(this[e]+=t;this[e]>=this.DV;)this[e]-=this.DV,++e>=this.t&&(this[this.t++]=0),++this[e]}},r.prototype.multiplyLowerTo=function(t,e,n){var s=Math.min(this.t+t.t,e);for(n.s=0,n.t=s;s>0;)n[--s]=0;for(var i=n.t-this.t;s<i;++s)n[s+this.t]=this.am(0,t[s],n,s,0,this.t);for(var i=Math.min(t.t,e);s<i;++s)this.am(0,t[s],n,s,0,e-s);n.clamp()},r.prototype.multiplyUpperTo=function(t,e,n){--e;var s=n.t=this.t+t.t-e;for(n.s=0;--s>=0;)n[s]=0;for(s=Math.max(e-this.t,0);s<t.t;++s)n[this.t+s-e]=this.am(e-s,t[s],n,0,0,this.t+s-e);n.clamp(),n.drShiftTo(1,n)},r.prototype.modInt=function(t){if(t<=0)return 0;var e=this.DV%t,n=this.s<0?t-1:0;if(this.t>0)if(e==0)n=this[0]%t;else for(var s=this.t-1;s>=0;--s)n=(e*n+this[s])%t;return n},r.prototype.millerRabin=function(t){var e=this.subtract(r.ONE),n=e.getLowestSetBit();if(n<=0)return!1;var s=e.shiftRight(n);t=t+1>>1,t>O.length&&(t=O.length);for(var i=g(),o=0;o<t;++o){i.fromInt(O[Math.floor(Math.random()*O.length)]);var a=i.modPow(s,this);if(a.compareTo(r.ONE)!=0&&a.compareTo(e)!=0){for(var u=1;u++<n&&a.compareTo(e)!=0;)if(a=a.modPowInt(2,this),a.compareTo(r.ONE)==0)return!1;if(a.compareTo(e)!=0)return!1}}return!0},r.prototype.square=function(){var t=g();return this.squareTo(t),t},r.prototype.gcda=function(t,e){var n=this.s<0?this.negate():this.clone(),s=t.s<0?t.negate():t.clone();if(n.compareTo(s)<0){var i=n;n=s,s=i}var o=n.getLowestSetBit(),a=s.getLowestSetBit();if(a<0){e(n);return}o<a&&(a=o),a>0&&(n.rShiftTo(a,n),s.rShiftTo(a,s));var u=function(){(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),(o=s.getLowestSetBit())>0&&s.rShiftTo(o,s),n.compareTo(s)>=0?(n.subTo(s,n),n.rShiftTo(1,n)):(s.subTo(n,s),s.rShiftTo(1,s)),n.signum()>0?setTimeout(u,0):(a>0&&s.lShiftTo(a,s),setTimeout(function(){e(s)},0))};setTimeout(u,10)},r.prototype.fromNumberAsync=function(t,e,n,s){if(typeof e=="number")if(t<2)this.fromInt(1);else{this.fromNumber(t,n),this.testBit(t-1)||this.bitwiseTo(r.ONE.shiftLeft(t-1),Q,this),this.isEven()&&this.dAddOffset(1,0);var i=this,o=function(){i.dAddOffset(2,0),i.bitLength()>t&&i.subTo(r.ONE.shiftLeft(t-1),i),i.isProbablePrime(e)?setTimeout(function(){s()},0):setTimeout(o,0)};setTimeout(o,0)}else{var a=[],u=t&7;a.length=(t>>3)+1,e.nextBytes(a),u>0?a[0]&=(1<<u)-1:a[0]=0,this.fromString(a,256)}},r}(),Be=function(){function r(){}return r.prototype.convert=function(t){return t},r.prototype.revert=function(t){return t},r.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n)},r.prototype.sqrTo=function(t,e){t.squareTo(e)},r}(),ee=function(){function r(t){this.m=t}return r.prototype.convert=function(t){return t.s<0||t.compareTo(this.m)>=0?t.mod(this.m):t},r.prototype.revert=function(t){return t},r.prototype.reduce=function(t){t.divRemTo(this.m,null,t)},r.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},r.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r}(),re=function(){function r(t){this.m=t,this.mp=t.invDigit(),this.mpl=this.mp&32767,this.mph=this.mp>>15,this.um=(1<<t.DB-15)-1,this.mt2=2*t.t}return r.prototype.convert=function(t){var e=g();return t.abs().dlShiftTo(this.m.t,e),e.divRemTo(this.m,null,e),t.s<0&&e.compareTo(c.ZERO)>0&&this.m.subTo(e,e),e},r.prototype.revert=function(t){var e=g();return t.copyTo(e),this.reduce(e),e},r.prototype.reduce=function(t){for(;t.t<=this.mt2;)t[t.t++]=0;for(var e=0;e<this.m.t;++e){var n=t[e]&32767,s=n*this.mpl+((n*this.mph+(t[e]>>15)*this.mpl&this.um)<<15)&t.DM;for(n=e+this.m.t,t[n]+=this.m.am(0,s,t,e,0,this.m.t);t[n]>=t.DV;)t[n]-=t.DV,t[++n]++}t.clamp(),t.drShiftTo(this.m.t,t),t.compareTo(this.m)>=0&&t.subTo(this.m,t)},r.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},r.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r}(),Pe=function(){function r(t){this.m=t,this.r2=g(),this.q3=g(),c.ONE.dlShiftTo(2*t.t,this.r2),this.mu=this.r2.divide(t)}return r.prototype.convert=function(t){if(t.s<0||t.t>2*this.m.t)return t.mod(this.m);if(t.compareTo(this.m)<0)return t;var e=g();return t.copyTo(e),this.reduce(e),e},r.prototype.revert=function(t){return t},r.prototype.reduce=function(t){for(t.drShiftTo(this.m.t-1,this.r2),t.t>this.m.t+1&&(t.t=this.m.t+1,t.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);t.compareTo(this.r2)<0;)t.dAddOffset(1,this.m.t+1);for(t.subTo(this.r2,t);t.compareTo(this.m)>=0;)t.subTo(this.m,t)},r.prototype.mulTo=function(t,e,n){t.multiplyTo(e,n),this.reduce(n)},r.prototype.sqrTo=function(t,e){t.squareTo(e),this.reduce(e)},r}();function g(){return new c(null)}function E(r,t){return new c(r,t)}var ne=typeof navigator<"u";ne&&te&&navigator.appName=="Microsoft Internet Explorer"?(c.prototype.am=function(t,e,n,s,i,o){for(var a=e&32767,u=e>>15;--o>=0;){var h=this[t]&32767,l=this[t++]>>15,p=u*h+l*a;h=a*h+((p&32767)<<15)+n[s]+(i&1073741823),i=(h>>>30)+(p>>>15)+u*l+(i>>>30),n[s++]=h&1073741823}return i},M=30):ne&&te&&navigator.appName!="Netscape"?(c.prototype.am=function(t,e,n,s,i,o){for(;--o>=0;){var a=e*this[t++]+n[s]+i;i=Math.floor(a/67108864),n[s++]=a&67108863}return i},M=26):(c.prototype.am=function(t,e,n,s,i,o){for(var a=e&16383,u=e>>14;--o>=0;){var h=this[t]&16383,l=this[t++]>>14,p=u*h+l*a;h=a*h+((p&16383)<<14)+n[s]+i,i=(h>>28)+(p>>14)+u*l,n[s++]=h&268435455}return i},M=28),c.prototype.DB=M,c.prototype.DM=(1<<M)-1,c.prototype.DV=1<<M;var vt=52;c.prototype.FV=Math.pow(2,vt),c.prototype.F1=vt-M,c.prototype.F2=2*M-vt;var tt=[],z,P;for(z=48,P=0;P<=9;++P)tt[z++]=P;for(z=97,P=10;P<36;++P)tt[z++]=P;for(z=65,P=10;P<36;++P)tt[z++]=P;function se(r,t){var e=tt[r.charCodeAt(t)];return e??-1}function F(r){var t=g();return t.fromInt(r),t}function et(r){var t=1,e;return(e=r>>>16)!=0&&(r=e,t+=16),(e=r>>8)!=0&&(r=e,t+=8),(e=r>>4)!=0&&(r=e,t+=4),(e=r>>2)!=0&&(r=e,t+=2),(e=r>>1)!=0&&(r=e,t+=1),t}c.ZERO=F(0),c.ONE=F(1);var Ne=function(){function r(){this.i=0,this.j=0,this.S=[]}return r.prototype.init=function(t){var e,n,s;for(e=0;e<256;++e)this.S[e]=e;for(n=0,e=0;e<256;++e)n=n+this.S[e]+t[e%t.length]&255,s=this.S[e],this.S[e]=this.S[n],this.S[n]=s;this.i=0,this.j=0},r.prototype.next=function(){var t;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,t=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=t,this.S[t+this.S[this.i]&255]},r}();function Ve(){return new Ne}var ie=256,rt,j=null,N;if(j==null){j=[],N=0;var nt=void 0;if(typeof window<"u"&&window.crypto&&window.crypto.getRandomValues){var yt=new Uint32Array(256);for(window.crypto.getRandomValues(yt),nt=0;nt<yt.length;++nt)j[N++]=yt[nt]&255}var st=0,it=function(r){if(st=st||0,st>=256||N>=ie){window.removeEventListener?window.removeEventListener("mousemove",it,!1):window.detachEvent&&window.detachEvent("onmousemove",it);return}try{var t=r.x+r.y;j[N++]=t&255,st+=1}catch{}};typeof window<"u"&&(window.addEventListener?window.addEventListener("mousemove",it,!1):window.attachEvent&&window.attachEvent("onmousemove",it))}function Le(){if(rt==null){for(rt=Ve();N<ie;){var r=Math.floor(65536*Math.random());j[N++]=r&255}for(rt.init(j),N=0;N<j.length;++N)j[N]=0;N=0}return rt.next()}var mt=function(){function r(){}return r.prototype.nextBytes=function(t){for(var e=0;e<t.length;++e)t[e]=Le()},r}();function Ie(r,t){if(t<r.length+22)return console.error("Message too long for RSA"),null;for(var e=t-r.length-6,n="",s=0;s<e;s+=2)n+="ff";var i="0001"+n+"00"+r;return E(i,16)}function Me(r,t){if(t<r.length+11)return console.error("Message too long for RSA"),null;for(var e=[],n=r.length-1;n>=0&&t>0;){var s=r.charCodeAt(n--);s<128?e[--t]=s:s>127&&s<2048?(e[--t]=s&63|128,e[--t]=s>>6|192):(e[--t]=s&63|128,e[--t]=s>>6&63|128,e[--t]=s>>12|224)}e[--t]=0;for(var i=new mt,o=[];t>2;){for(o[0]=0;o[0]==0;)i.nextBytes(o);e[--t]=o[0]}return e[--t]=2,e[--t]=0,new c(e)}var Fe=function(){function r(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return r.prototype.doPublic=function(t){return t.modPowInt(this.e,this.n)},r.prototype.doPrivate=function(t){if(this.p==null||this.q==null)return t.modPow(this.d,this.n);for(var e=t.mod(this.p).modPow(this.dmp1,this.p),n=t.mod(this.q).modPow(this.dmq1,this.q);e.compareTo(n)<0;)e=e.add(this.p);return e.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)},r.prototype.setPublic=function(t,e){t!=null&&e!=null&&t.length>0&&e.length>0?(this.n=E(t,16),this.e=parseInt(e,16)):console.error("Invalid RSA public key")},r.prototype.encrypt=function(t){var e=this.n.bitLength()+7>>3,n=Me(t,e);if(n==null)return null;var s=this.doPublic(n);if(s==null)return null;for(var i=s.toString(16),o=i.length,a=0;a<e*2-o;a++)i="0"+i;return i},r.prototype.setPrivate=function(t,e,n){t!=null&&e!=null&&t.length>0&&e.length>0?(this.n=E(t,16),this.e=parseInt(e,16),this.d=E(n,16)):console.error("Invalid RSA private key")},r.prototype.setPrivateEx=function(t,e,n,s,i,o,a,u){t!=null&&e!=null&&t.length>0&&e.length>0?(this.n=E(t,16),this.e=parseInt(e,16),this.d=E(n,16),this.p=E(s,16),this.q=E(i,16),this.dmp1=E(o,16),this.dmq1=E(a,16),this.coeff=E(u,16)):console.error("Invalid RSA private key")},r.prototype.generate=function(t,e){var n=new mt,s=t>>1;this.e=parseInt(e,16);for(var i=new c(e,16);;){for(;this.p=new c(t-s,1,n),!(this.p.subtract(c.ONE).gcd(i).compareTo(c.ONE)==0&&this.p.isProbablePrime(10)););for(;this.q=new c(s,1,n),!(this.q.subtract(c.ONE).gcd(i).compareTo(c.ONE)==0&&this.q.isProbablePrime(10)););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var a=this.p.subtract(c.ONE),u=this.q.subtract(c.ONE),h=a.multiply(u);if(h.gcd(i).compareTo(c.ONE)==0){this.n=this.p.multiply(this.q),this.d=i.modInverse(h),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(u),this.coeff=this.q.modInverse(this.p);break}}},r.prototype.decrypt=function(t){var e=E(t,16),n=this.doPrivate(e);return n==null?null:je(n,this.n.bitLength()+7>>3)},r.prototype.generateAsync=function(t,e,n){var s=new mt,i=t>>1;this.e=parseInt(e,16);var o=new c(e,16),a=this,u=function(){var h=function(){if(a.p.compareTo(a.q)<=0){var y=a.p;a.p=a.q,a.q=y}var d=a.p.subtract(c.ONE),m=a.q.subtract(c.ONE),b=d.multiply(m);b.gcd(o).compareTo(c.ONE)==0?(a.n=a.p.multiply(a.q),a.d=o.modInverse(b),a.dmp1=a.d.mod(d),a.dmq1=a.d.mod(m),a.coeff=a.q.modInverse(a.p),setTimeout(function(){n()},0)):setTimeout(u,0)},l=function(){a.q=g(),a.q.fromNumberAsync(i,1,s,function(){a.q.subtract(c.ONE).gcda(o,function(y){y.compareTo(c.ONE)==0&&a.q.isProbablePrime(10)?setTimeout(h,0):setTimeout(l,0)})})},p=function(){a.p=g(),a.p.fromNumberAsync(t-i,1,s,function(){a.p.subtract(c.ONE).gcda(o,function(y){y.compareTo(c.ONE)==0&&a.p.isProbablePrime(10)?setTimeout(l,0):setTimeout(p,0)})})};setTimeout(p,0)};setTimeout(u,0)},r.prototype.sign=function(t,e,n){var s=ke(n),i=s+e(t).toString(),o=Ie(i,this.n.bitLength()/4);if(o==null)return null;var a=this.doPrivate(o);if(a==null)return null;var u=a.toString(16);return u.length&1?"0"+u:u},r.prototype.verify=function(t,e,n){var s=E(e,16),i=this.doPublic(s);if(i==null)return null;var o=i.toString(16).replace(/^1f+00/,""),a=qe(o);return a==n(t).toString()},r}();function je(r,t){for(var e=r.toByteArray(),n=0;n<e.length&&e[n]==0;)++n;if(e.length-n!=t-1||e[n]!=2)return null;for(++n;e[n]!=0;)if(++n>=e.length)return null;for(var s="";++n<e.length;){var i=e[n]&255;i<128?s+=String.fromCharCode(i):i>191&&i<224?(s+=String.fromCharCode((i&31)<<6|e[n+1]&63),++n):(s+=String.fromCharCode((i&15)<<12|(e[n+1]&63)<<6|e[n+2]&63),n+=2)}return s}var at={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"};function ke(r){return at[r]||""}function qe(r){for(var t in at)if(at.hasOwnProperty(t)){var e=at[t],n=e.length;if(r.substr(0,n)==e)return r.substr(n)}return r}/*!
|
|
9
9
|
Copyright (c) 2011, Yahoo! Inc. All rights reserved.
|
|
10
10
|
Code licensed under the BSD License:
|
|
11
11
|
http://developer.yahoo.com/yui/license.html
|
|
@@ -17,10 +17,10 @@ version: 2.9.0
|
|
|
17
17
|
* @version asn1 1.0.13 (2017-Jun-02)
|
|
18
18
|
* @since jsrsasign 2.1
|
|
19
19
|
* @license <a href="https://kjur.github.io/jsrsasign/license/">MIT License</a>
|
|
20
|
-
*/var f={};(typeof f.asn1>"u"||!f.asn1)&&(f.asn1={}),f.asn1.ASN1Util=new function(){this.integerToByteHex=function(r){var t=r.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(r){var t=r.toString(16);if(t.substr(0,1)!="-")t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var e=t.substr(1),n=e.length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);for(var s="",i=0;i<n;i++)s+="f";var o=new c(s,16),a=o.xor(r).add(c.ONE);t=a.toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(r,t){return hextopem(r,t)},this.newObject=function(r){var t=f,e=t.asn1,n=e.DERBoolean,s=e.DERInteger,i=e.DERBitString,o=e.DEROctetString,a=e.DERNull,u=e.DERObjectIdentifier,h=e.DEREnumerated,l=e.DERUTF8String,p=e.DERNumericString,v=e.DERPrintableString,y=e.DERTeletexString,m=e.DERIA5String,b=e.DERUTCTime,w=e.DERGeneralizedTime,R=e.DERSequence,A=e.DERSet,_=e.DERTaggedObject,$=e.ASN1Util.newObject,he=Object.keys(r);if(he.length!=1)throw"key of param shall be only one.";var d=he[0];if(":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+d+":")==-1)throw"undefined key: "+d;if(d=="bool")return new n(r[d]);if(d=="int")return new s(r[d]);if(d=="bitstr")return new i(r[d]);if(d=="octstr")return new o(r[d]);if(d=="null")return new a(r[d]);if(d=="oid")return new u(r[d]);if(d=="enum")return new h(r[d]);if(d=="utf8str")return new l(r[d]);if(d=="numstr")return new p(r[d]);if(d=="prnstr")return new v(r[d]);if(d=="telstr")return new y(r[d]);if(d=="ia5str")return new m(r[d]);if(d=="utctime")return new b(r[d]);if(d=="gentime")return new w(r[d]);if(d=="seq"){for(var Y=r[d],X=[],H=0;H<Y.length;H++){var bt=$(Y[H]);X.push(bt)}return new R({array:X})}if(d=="set"){for(var Y=r[d],X=[],H=0;H<Y.length;H++){var bt=$(Y[H]);X.push(bt)}return new A({array:X})}if(d=="tag"){var V=r[d];if(Object.prototype.toString.call(V)==="[object Array]"&&V.length==3){var ze=$(V[2]);return new _({tag:V[0],explicit:V[1],obj:ze})}else{var ot={};if(V.explicit!==void 0&&(ot.explicit=V.explicit),V.tag!==void 0&&(ot.tag=V.tag),V.obj===void 0)throw"obj shall be specified for 'tag'.";return ot.obj=$(V.obj),new _(ot)}}},this.jsonToASN1HEX=function(r){var t=this.newObject(r);return t.getEncodedHex()}},f.asn1.ASN1Util.oidHexToInt=function(r){for(var s="",t=parseInt(r.substr(0,2),16),e=Math.floor(t/40),n=t%40,s=e+"."+n,i="",o=2;o<r.length;o+=2){var a=parseInt(r.substr(o,2),16),u=("00000000"+a.toString(2)).slice(-8);if(i=i+u.substr(1,7),u.substr(0,1)=="0"){var h=new c(i,2);s=s+"."+h.toString(10),i=""}}return s},f.asn1.ASN1Util.oidIntToHex=function(r){var t=function(a){var u=a.toString(16);return u.length==1&&(u="0"+u),u},e=function(a){var u="",h=new c(a,10),l=h.toString(2),p=7-l.length%7;p==7&&(p=0);for(var v="",y=0;y<p;y++)v+="0";l=v+l;for(var y=0;y<l.length-1;y+=7){var m=l.substr(y,7);y!=l.length-7&&(m="1"+m),u+=t(parseInt(m,2))}return u};if(!r.match(/^[0-9.]+$/))throw"malformed oid string: "+r;var n="",s=r.split("."),i=parseInt(s[0])*40+parseInt(s[1]);n+=t(i),s.splice(0,2);for(var o=0;o<s.length;o++)n+=e(s[o]);return n},f.asn1.ASN1Object=function(){var r="";this.getLengthHexFromValue=function(){if(typeof this.hV>"u"||this.hV==null)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+r.length+",v="+this.hV;var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var n=e.length/2;if(n>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);var s=128+n;return s.toString(16)+e},this.getEncodedHex=function(){return(this.hTLV==null||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},f.asn1.DERAbstractString=function(r){f.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r=="string"?this.setString(r):typeof r.str<"u"?this.setString(r.str):typeof r.hex<"u"&&this.setStringHex(r.hex))},D.lang.extend(f.asn1.DERAbstractString,f.asn1.ASN1Object),f.asn1.DERAbstractTime=function(r){f.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){utc=t.getTime()+t.getTimezoneOffset()*6e4;var e=new Date(utc);return e},this.formatDate=function(t,e,n){var s=this.zeroPadding,i=this.localDateToUTC(t),o=String(i.getFullYear());e=="utc"&&(o=o.substr(2,2));var a=s(String(i.getMonth()+1),2),u=s(String(i.getDate()),2),h=s(String(i.getHours()),2),l=s(String(i.getMinutes()),2),p=s(String(i.getSeconds()),2),v=o+a+u+h+l+p;if(n===!0){var y=i.getMilliseconds();if(y!=0){var m=s(String(y),3);m=m.replace(/[0]+$/,""),v=v+"."+m}}return v+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(t)},this.setByDateValue=function(t,e,n,s,i,o){var a=new Date(Date.UTC(t,e-1,n,s,i,o,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},D.lang.extend(f.asn1.DERAbstractTime,f.asn1.ASN1Object),f.asn1.DERAbstractStructured=function(r){f.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,typeof r<"u"&&typeof r.array<"u"&&(this.asn1Array=r.array)},D.lang.extend(f.asn1.DERAbstractStructured,f.asn1.ASN1Object),f.asn1.DERBoolean=function(){f.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},D.lang.extend(f.asn1.DERBoolean,f.asn1.ASN1Object),f.asn1.DERInteger=function(r){f.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=f.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new c(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r.bigint<"u"?this.setByBigInteger(r.bigint):typeof r.int<"u"?this.setByInteger(r.int):typeof r=="number"?this.setByInteger(r):typeof r.hex<"u"&&this.setValueHex(r.hex))},D.lang.extend(f.asn1.DERInteger,f.asn1.ASN1Object),f.asn1.DERBitString=function(r){if(r!==void 0&&typeof r.obj<"u"){var t=f.asn1.ASN1Util.newObject(r.obj);r.hex="00"+t.getEncodedHex()}f.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,n){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var s="0"+e;this.hTLV=null,this.isModified=!0,this.hV=s+n},this.setByBinaryString=function(e){e=e.replace(/0+$/,"");var n=8-e.length%8;n==8&&(n=0);for(var s=0;s<=n;s++)e+="0";for(var i="",s=0;s<e.length-1;s+=8){var o=e.substr(s,8),a=parseInt(o,2).toString(16);a.length==1&&(a="0"+a),i+=a}this.hTLV=null,this.isModified=!0,this.hV="0"+n+i},this.setByBooleanArray=function(e){for(var n="",s=0;s<e.length;s++)e[s]==!0?n+="1":n+="0";this.setByBinaryString(n)},this.newFalseArray=function(e){for(var n=new Array(e),s=0;s<e;s++)n[s]=!1;return n},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r=="string"&&r.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(r):typeof r.hex<"u"?this.setHexValueIncludingUnusedBits(r.hex):typeof r.bin<"u"?this.setByBinaryString(r.bin):typeof r.array<"u"&&this.setByBooleanArray(r.array))},D.lang.extend(f.asn1.DERBitString,f.asn1.ASN1Object),f.asn1.DEROctetString=function(r){if(r!==void 0&&typeof r.obj<"u"){var t=f.asn1.ASN1Util.newObject(r.obj);r.hex=t.getEncodedHex()}f.asn1.DEROctetString.superclass.constructor.call(this,r),this.hT="04"},D.lang.extend(f.asn1.DEROctetString,f.asn1.DERAbstractString),f.asn1.DERNull=function(){f.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},D.lang.extend(f.asn1.DERNull,f.asn1.ASN1Object),f.asn1.DERObjectIdentifier=function(r){var t=function(n){var s=n.toString(16);return s.length==1&&(s="0"+s),s},e=function(n){var s="",i=new c(n,10),o=i.toString(2),a=7-o.length%7;a==7&&(a=0);for(var u="",h=0;h<a;h++)u+="0";o=u+o;for(var h=0;h<o.length-1;h+=7){var l=o.substr(h,7);h!=o.length-7&&(l="1"+l),s+=t(parseInt(l,2))}return s};f.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(n){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueOidString=function(n){if(!n.match(/^[0-9.]+$/))throw"malformed oid string: "+n;var s="",i=n.split("."),o=parseInt(i[0])*40+parseInt(i[1]);s+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)s+=e(i[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=s},this.setValueName=function(n){var s=f.asn1.x509.OID.name2oid(n);if(s!=="")this.setValueOidString(s);else throw"DERObjectIdentifier oidName undefined: "+n},this.getFreshValueHex=function(){return this.hV},r!==void 0&&(typeof r=="string"?r.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(r):this.setValueName(r):r.oid!==void 0?this.setValueOidString(r.oid):r.hex!==void 0?this.setValueHex(r.hex):r.name!==void 0&&this.setValueName(r.name))},D.lang.extend(f.asn1.DERObjectIdentifier,f.asn1.ASN1Object),f.asn1.DEREnumerated=function(r){f.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=f.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new c(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r.int<"u"?this.setByInteger(r.int):typeof r=="number"?this.setByInteger(r):typeof r.hex<"u"&&this.setValueHex(r.hex))},D.lang.extend(f.asn1.DEREnumerated,f.asn1.ASN1Object),f.asn1.DERUTF8String=function(r){f.asn1.DERUTF8String.superclass.constructor.call(this,r),this.hT="0c"},D.lang.extend(f.asn1.DERUTF8String,f.asn1.DERAbstractString),f.asn1.DERNumericString=function(r){f.asn1.DERNumericString.superclass.constructor.call(this,r),this.hT="12"},D.lang.extend(f.asn1.DERNumericString,f.asn1.DERAbstractString),f.asn1.DERPrintableString=function(r){f.asn1.DERPrintableString.superclass.constructor.call(this,r),this.hT="13"},D.lang.extend(f.asn1.DERPrintableString,f.asn1.DERAbstractString),f.asn1.DERTeletexString=function(r){f.asn1.DERTeletexString.superclass.constructor.call(this,r),this.hT="14"},D.lang.extend(f.asn1.DERTeletexString,f.asn1.DERAbstractString),f.asn1.DERIA5String=function(r){f.asn1.DERIA5String.superclass.constructor.call(this,r),this.hT="16"},D.lang.extend(f.asn1.DERIA5String,f.asn1.DERAbstractString),f.asn1.DERUTCTime=function(r){f.asn1.DERUTCTime.superclass.constructor.call(this,r),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return typeof this.date>"u"&&typeof this.s>"u"&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},r!==void 0&&(r.str!==void 0?this.setString(r.str):typeof r=="string"&&r.match(/^[0-9]{12}Z$/)?this.setString(r):r.hex!==void 0?this.setStringHex(r.hex):r.date!==void 0&&this.setByDate(r.date))},D.lang.extend(f.asn1.DERUTCTime,f.asn1.DERAbstractTime),f.asn1.DERGeneralizedTime=function(r){f.asn1.DERGeneralizedTime.superclass.constructor.call(this,r),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return this.date===void 0&&this.s===void 0&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},r!==void 0&&(r.str!==void 0?this.setString(r.str):typeof r=="string"&&r.match(/^[0-9]{14}Z$/)?this.setString(r):r.hex!==void 0?this.setStringHex(r.hex):r.date!==void 0&&this.setByDate(r.date),r.millis===!0&&(this.withMillis=!0))},D.lang.extend(f.asn1.DERGeneralizedTime,f.asn1.DERAbstractTime),f.asn1.DERSequence=function(r){f.asn1.DERSequence.superclass.constructor.call(this,r),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++){var n=this.asn1Array[e];t+=n.getEncodedHex()}return this.hV=t,this.hV}},D.lang.extend(f.asn1.DERSequence,f.asn1.DERAbstractStructured),f.asn1.DERSet=function(r){f.asn1.DERSet.superclass.constructor.call(this,r),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var n=this.asn1Array[e];t.push(n.getEncodedHex())}return this.sortFlag==!0&&t.sort(),this.hV=t.join(""),this.hV},typeof r<"u"&&typeof r.sortflag<"u"&&r.sortflag==!1&&(this.sortFlag=!1)},D.lang.extend(f.asn1.DERSet,f.asn1.DERAbstractStructured),f.asn1.DERTaggedObject=function(r){f.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,n){this.hT=e,this.isExplicit=t,this.asn1Object=n,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=n.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r.tag<"u"&&(this.hT=r.tag),typeof r.explicit<"u"&&(this.isExplicit=r.explicit),typeof r.obj<"u"&&(this.asn1Object=r.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},D.lang.extend(f.asn1.DERTaggedObject,f.asn1.ASN1Object);var He=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ae=function(r){He(t,r);function t(e){var n=r.call(this)||this;return e&&(typeof e=="string"?n.parseKey(e):(t.hasPrivateKeyProperty(e)||t.hasPublicKeyProperty(e))&&n.parsePropertiesFrom(e)),n}return t.prototype.parseKey=function(e){try{var n=0,s=0,i=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/,o=i.test(e)?we.decode(e):gt.unarmor(e),a=xe.decode(o);if(a.sub.length===3&&(a=a.sub[2].sub[0]),a.sub.length===9){n=a.sub[1].getHexStringValue(),this.n=E(n,16),s=a.sub[2].getHexStringValue(),this.e=parseInt(s,16);var u=a.sub[3].getHexStringValue();this.d=E(u,16);var h=a.sub[4].getHexStringValue();this.p=E(h,16);var l=a.sub[5].getHexStringValue();this.q=E(l,16);var p=a.sub[6].getHexStringValue();this.dmp1=E(p,16);var v=a.sub[7].getHexStringValue();this.dmq1=E(v,16);var y=a.sub[8].getHexStringValue();this.coeff=E(y,16)}else if(a.sub.length===2)if(a.sub[0].sub){var m=a.sub[1],b=m.sub[0];n=b.sub[0].getHexStringValue(),this.n=E(n,16),s=b.sub[1].getHexStringValue(),this.e=parseInt(s,16)}else n=a.sub[0].getHexStringValue(),this.n=E(n,16),s=a.sub[1].getHexStringValue(),this.e=parseInt(s,16);else return!1;return!0}catch{return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new f.asn1.DERInteger({int:0}),new f.asn1.DERInteger({bigint:this.n}),new f.asn1.DERInteger({int:this.e}),new f.asn1.DERInteger({bigint:this.d}),new f.asn1.DERInteger({bigint:this.p}),new f.asn1.DERInteger({bigint:this.q}),new f.asn1.DERInteger({bigint:this.dmp1}),new f.asn1.DERInteger({bigint:this.dmq1}),new f.asn1.DERInteger({bigint:this.coeff})]},n=new f.asn1.DERSequence(e);return n.getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return W(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new f.asn1.DERSequence({array:[new f.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new f.asn1.DERNull]}),n=new f.asn1.DERSequence({array:[new f.asn1.DERInteger({bigint:this.n}),new f.asn1.DERInteger({int:this.e})]}),s=new f.asn1.DERBitString({hex:"00"+n.getEncodedHex()}),i=new f.asn1.DERSequence({array:[e,s]});return i.getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return W(this.getPublicBaseKey())},t.wordwrap=function(e,n){if(n=n||64,!e)return e;var s="(.{1,"+n+`})( +|$
|
|
20
|
+
*/var f={};(typeof f.asn1>"u"||!f.asn1)&&(f.asn1={}),f.asn1.ASN1Util=new function(){this.integerToByteHex=function(r){var t=r.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(r){var t=r.toString(16);if(t.substr(0,1)!="-")t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var e=t.substr(1),n=e.length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);for(var s="",i=0;i<n;i++)s+="f";var o=new c(s,16),a=o.xor(r).add(c.ONE);t=a.toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(r,t){return hextopem(r,t)},this.newObject=function(r){var t=f,e=t.asn1,n=e.DERBoolean,s=e.DERInteger,i=e.DERBitString,o=e.DEROctetString,a=e.DERNull,u=e.DERObjectIdentifier,h=e.DEREnumerated,l=e.DERUTF8String,p=e.DERNumericString,y=e.DERPrintableString,d=e.DERTeletexString,m=e.DERIA5String,b=e.DERUTCTime,_=e.DERGeneralizedTime,w=e.DERSequence,A=e.DERSet,R=e.DERTaggedObject,$=e.ASN1Util.newObject,he=Object.keys(r);if(he.length!=1)throw"key of param shall be only one.";var v=he[0];if(":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+v+":")==-1)throw"undefined key: "+v;if(v=="bool")return new n(r[v]);if(v=="int")return new s(r[v]);if(v=="bitstr")return new i(r[v]);if(v=="octstr")return new o(r[v]);if(v=="null")return new a(r[v]);if(v=="oid")return new u(r[v]);if(v=="enum")return new h(r[v]);if(v=="utf8str")return new l(r[v]);if(v=="numstr")return new p(r[v]);if(v=="prnstr")return new y(r[v]);if(v=="telstr")return new d(r[v]);if(v=="ia5str")return new m(r[v]);if(v=="utctime")return new b(r[v]);if(v=="gentime")return new _(r[v]);if(v=="seq"){for(var Y=r[v],X=[],H=0;H<Y.length;H++){var bt=$(Y[H]);X.push(bt)}return new w({array:X})}if(v=="set"){for(var Y=r[v],X=[],H=0;H<Y.length;H++){var bt=$(Y[H]);X.push(bt)}return new A({array:X})}if(v=="tag"){var V=r[v];if(Object.prototype.toString.call(V)==="[object Array]"&&V.length==3){var ze=$(V[2]);return new R({tag:V[0],explicit:V[1],obj:ze})}else{var ot={};if(V.explicit!==void 0&&(ot.explicit=V.explicit),V.tag!==void 0&&(ot.tag=V.tag),V.obj===void 0)throw"obj shall be specified for 'tag'.";return ot.obj=$(V.obj),new R(ot)}}},this.jsonToASN1HEX=function(r){var t=this.newObject(r);return t.getEncodedHex()}},f.asn1.ASN1Util.oidHexToInt=function(r){for(var s="",t=parseInt(r.substr(0,2),16),e=Math.floor(t/40),n=t%40,s=e+"."+n,i="",o=2;o<r.length;o+=2){var a=parseInt(r.substr(o,2),16),u=("00000000"+a.toString(2)).slice(-8);if(i=i+u.substr(1,7),u.substr(0,1)=="0"){var h=new c(i,2);s=s+"."+h.toString(10),i=""}}return s},f.asn1.ASN1Util.oidIntToHex=function(r){var t=function(a){var u=a.toString(16);return u.length==1&&(u="0"+u),u},e=function(a){var u="",h=new c(a,10),l=h.toString(2),p=7-l.length%7;p==7&&(p=0);for(var y="",d=0;d<p;d++)y+="0";l=y+l;for(var d=0;d<l.length-1;d+=7){var m=l.substr(d,7);d!=l.length-7&&(m="1"+m),u+=t(parseInt(m,2))}return u};if(!r.match(/^[0-9.]+$/))throw"malformed oid string: "+r;var n="",s=r.split("."),i=parseInt(s[0])*40+parseInt(s[1]);n+=t(i),s.splice(0,2);for(var o=0;o<s.length;o++)n+=e(s[o]);return n},f.asn1.ASN1Object=function(){var r="";this.getLengthHexFromValue=function(){if(typeof this.hV>"u"||this.hV==null)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+r.length+",v="+this.hV;var t=this.hV.length/2,e=t.toString(16);if(e.length%2==1&&(e="0"+e),t<128)return e;var n=e.length/2;if(n>15)throw"ASN.1 length too long to represent by 8x: n = "+t.toString(16);var s=128+n;return s.toString(16)+e},this.getEncodedHex=function(){return(this.hTLV==null||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},f.asn1.DERAbstractString=function(r){f.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(this.s)},this.setStringHex=function(t){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r=="string"?this.setString(r):typeof r.str<"u"?this.setString(r.str):typeof r.hex<"u"&&this.setStringHex(r.hex))},D.lang.extend(f.asn1.DERAbstractString,f.asn1.ASN1Object),f.asn1.DERAbstractTime=function(r){f.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(t){utc=t.getTime()+t.getTimezoneOffset()*6e4;var e=new Date(utc);return e},this.formatDate=function(t,e,n){var s=this.zeroPadding,i=this.localDateToUTC(t),o=String(i.getFullYear());e=="utc"&&(o=o.substr(2,2));var a=s(String(i.getMonth()+1),2),u=s(String(i.getDate()),2),h=s(String(i.getHours()),2),l=s(String(i.getMinutes()),2),p=s(String(i.getSeconds()),2),y=o+a+u+h+l+p;if(n===!0){var d=i.getMilliseconds();if(d!=0){var m=s(String(d),3);m=m.replace(/[0]+$/,""),y=y+"."+m}}return y+"Z"},this.zeroPadding=function(t,e){return t.length>=e?t:new Array(e-t.length+1).join("0")+t},this.getString=function(){return this.s},this.setString=function(t){this.hTLV=null,this.isModified=!0,this.s=t,this.hV=stohex(t)},this.setByDateValue=function(t,e,n,s,i,o){var a=new Date(Date.UTC(t,e-1,n,s,i,o,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},D.lang.extend(f.asn1.DERAbstractTime,f.asn1.ASN1Object),f.asn1.DERAbstractStructured=function(r){f.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array=t},this.appendASN1Object=function(t){this.hTLV=null,this.isModified=!0,this.asn1Array.push(t)},this.asn1Array=new Array,typeof r<"u"&&typeof r.array<"u"&&(this.asn1Array=r.array)},D.lang.extend(f.asn1.DERAbstractStructured,f.asn1.ASN1Object),f.asn1.DERBoolean=function(){f.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},D.lang.extend(f.asn1.DERBoolean,f.asn1.ASN1Object),f.asn1.DERInteger=function(r){f.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=f.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new c(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r.bigint<"u"?this.setByBigInteger(r.bigint):typeof r.int<"u"?this.setByInteger(r.int):typeof r=="number"?this.setByInteger(r):typeof r.hex<"u"&&this.setValueHex(r.hex))},D.lang.extend(f.asn1.DERInteger,f.asn1.ASN1Object),f.asn1.DERBitString=function(r){if(r!==void 0&&typeof r.obj<"u"){var t=f.asn1.ASN1Util.newObject(r.obj);r.hex="00"+t.getEncodedHex()}f.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,n){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var s="0"+e;this.hTLV=null,this.isModified=!0,this.hV=s+n},this.setByBinaryString=function(e){e=e.replace(/0+$/,"");var n=8-e.length%8;n==8&&(n=0);for(var s=0;s<=n;s++)e+="0";for(var i="",s=0;s<e.length-1;s+=8){var o=e.substr(s,8),a=parseInt(o,2).toString(16);a.length==1&&(a="0"+a),i+=a}this.hTLV=null,this.isModified=!0,this.hV="0"+n+i},this.setByBooleanArray=function(e){for(var n="",s=0;s<e.length;s++)e[s]==!0?n+="1":n+="0";this.setByBinaryString(n)},this.newFalseArray=function(e){for(var n=new Array(e),s=0;s<e;s++)n[s]=!1;return n},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r=="string"&&r.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(r):typeof r.hex<"u"?this.setHexValueIncludingUnusedBits(r.hex):typeof r.bin<"u"?this.setByBinaryString(r.bin):typeof r.array<"u"&&this.setByBooleanArray(r.array))},D.lang.extend(f.asn1.DERBitString,f.asn1.ASN1Object),f.asn1.DEROctetString=function(r){if(r!==void 0&&typeof r.obj<"u"){var t=f.asn1.ASN1Util.newObject(r.obj);r.hex=t.getEncodedHex()}f.asn1.DEROctetString.superclass.constructor.call(this,r),this.hT="04"},D.lang.extend(f.asn1.DEROctetString,f.asn1.DERAbstractString),f.asn1.DERNull=function(){f.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},D.lang.extend(f.asn1.DERNull,f.asn1.ASN1Object),f.asn1.DERObjectIdentifier=function(r){var t=function(n){var s=n.toString(16);return s.length==1&&(s="0"+s),s},e=function(n){var s="",i=new c(n,10),o=i.toString(2),a=7-o.length%7;a==7&&(a=0);for(var u="",h=0;h<a;h++)u+="0";o=u+o;for(var h=0;h<o.length-1;h+=7){var l=o.substr(h,7);h!=o.length-7&&(l="1"+l),s+=t(parseInt(l,2))}return s};f.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(n){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=n},this.setValueOidString=function(n){if(!n.match(/^[0-9.]+$/))throw"malformed oid string: "+n;var s="",i=n.split("."),o=parseInt(i[0])*40+parseInt(i[1]);s+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)s+=e(i[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=s},this.setValueName=function(n){var s=f.asn1.x509.OID.name2oid(n);if(s!=="")this.setValueOidString(s);else throw"DERObjectIdentifier oidName undefined: "+n},this.getFreshValueHex=function(){return this.hV},r!==void 0&&(typeof r=="string"?r.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(r):this.setValueName(r):r.oid!==void 0?this.setValueOidString(r.oid):r.hex!==void 0?this.setValueHex(r.hex):r.name!==void 0&&this.setValueName(r.name))},D.lang.extend(f.asn1.DERObjectIdentifier,f.asn1.ASN1Object),f.asn1.DEREnumerated=function(r){f.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(t){this.hTLV=null,this.isModified=!0,this.hV=f.asn1.ASN1Util.bigIntToMinTwosComplementsHex(t)},this.setByInteger=function(t){var e=new c(String(t),10);this.setByBigInteger(e)},this.setValueHex=function(t){this.hV=t},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r.int<"u"?this.setByInteger(r.int):typeof r=="number"?this.setByInteger(r):typeof r.hex<"u"&&this.setValueHex(r.hex))},D.lang.extend(f.asn1.DEREnumerated,f.asn1.ASN1Object),f.asn1.DERUTF8String=function(r){f.asn1.DERUTF8String.superclass.constructor.call(this,r),this.hT="0c"},D.lang.extend(f.asn1.DERUTF8String,f.asn1.DERAbstractString),f.asn1.DERNumericString=function(r){f.asn1.DERNumericString.superclass.constructor.call(this,r),this.hT="12"},D.lang.extend(f.asn1.DERNumericString,f.asn1.DERAbstractString),f.asn1.DERPrintableString=function(r){f.asn1.DERPrintableString.superclass.constructor.call(this,r),this.hT="13"},D.lang.extend(f.asn1.DERPrintableString,f.asn1.DERAbstractString),f.asn1.DERTeletexString=function(r){f.asn1.DERTeletexString.superclass.constructor.call(this,r),this.hT="14"},D.lang.extend(f.asn1.DERTeletexString,f.asn1.DERAbstractString),f.asn1.DERIA5String=function(r){f.asn1.DERIA5String.superclass.constructor.call(this,r),this.hT="16"},D.lang.extend(f.asn1.DERIA5String,f.asn1.DERAbstractString),f.asn1.DERUTCTime=function(r){f.asn1.DERUTCTime.superclass.constructor.call(this,r),this.hT="17",this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return typeof this.date>"u"&&typeof this.s>"u"&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},r!==void 0&&(r.str!==void 0?this.setString(r.str):typeof r=="string"&&r.match(/^[0-9]{12}Z$/)?this.setString(r):r.hex!==void 0?this.setStringHex(r.hex):r.date!==void 0&&this.setByDate(r.date))},D.lang.extend(f.asn1.DERUTCTime,f.asn1.DERAbstractTime),f.asn1.DERGeneralizedTime=function(r){f.asn1.DERGeneralizedTime.superclass.constructor.call(this,r),this.hT="18",this.withMillis=!1,this.setByDate=function(t){this.hTLV=null,this.isModified=!0,this.date=t,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return this.date===void 0&&this.s===void 0&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},r!==void 0&&(r.str!==void 0?this.setString(r.str):typeof r=="string"&&r.match(/^[0-9]{14}Z$/)?this.setString(r):r.hex!==void 0?this.setStringHex(r.hex):r.date!==void 0&&this.setByDate(r.date),r.millis===!0&&(this.withMillis=!0))},D.lang.extend(f.asn1.DERGeneralizedTime,f.asn1.DERAbstractTime),f.asn1.DERSequence=function(r){f.asn1.DERSequence.superclass.constructor.call(this,r),this.hT="30",this.getFreshValueHex=function(){for(var t="",e=0;e<this.asn1Array.length;e++){var n=this.asn1Array[e];t+=n.getEncodedHex()}return this.hV=t,this.hV}},D.lang.extend(f.asn1.DERSequence,f.asn1.DERAbstractStructured),f.asn1.DERSet=function(r){f.asn1.DERSet.superclass.constructor.call(this,r),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var t=new Array,e=0;e<this.asn1Array.length;e++){var n=this.asn1Array[e];t.push(n.getEncodedHex())}return this.sortFlag==!0&&t.sort(),this.hV=t.join(""),this.hV},typeof r<"u"&&typeof r.sortflag<"u"&&r.sortflag==!1&&(this.sortFlag=!1)},D.lang.extend(f.asn1.DERSet,f.asn1.DERAbstractStructured),f.asn1.DERTaggedObject=function(r){f.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(t,e,n){this.hT=e,this.isExplicit=t,this.asn1Object=n,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=n.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,e),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},typeof r<"u"&&(typeof r.tag<"u"&&(this.hT=r.tag),typeof r.explicit<"u"&&(this.isExplicit=r.explicit),typeof r.obj<"u"&&(this.asn1Object=r.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},D.lang.extend(f.asn1.DERTaggedObject,f.asn1.ASN1Object);var He=function(){var r=function(t,e){return r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,s){n.__proto__=s}||function(n,s){for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(n[i]=s[i])},r(t,e)};return function(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");r(t,e);function n(){this.constructor=t}t.prototype=e===null?Object.create(e):(n.prototype=e.prototype,new n)}}(),ae=function(r){He(t,r);function t(e){var n=r.call(this)||this;return e&&(typeof e=="string"?n.parseKey(e):(t.hasPrivateKeyProperty(e)||t.hasPublicKeyProperty(e))&&n.parsePropertiesFrom(e)),n}return t.prototype.parseKey=function(e){try{var n=0,s=0,i=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/,o=i.test(e)?we.decode(e):gt.unarmor(e),a=xe.decode(o);if(a.sub.length===3&&(a=a.sub[2].sub[0]),a.sub.length===9){n=a.sub[1].getHexStringValue(),this.n=E(n,16),s=a.sub[2].getHexStringValue(),this.e=parseInt(s,16);var u=a.sub[3].getHexStringValue();this.d=E(u,16);var h=a.sub[4].getHexStringValue();this.p=E(h,16);var l=a.sub[5].getHexStringValue();this.q=E(l,16);var p=a.sub[6].getHexStringValue();this.dmp1=E(p,16);var y=a.sub[7].getHexStringValue();this.dmq1=E(y,16);var d=a.sub[8].getHexStringValue();this.coeff=E(d,16)}else if(a.sub.length===2)if(a.sub[0].sub){var m=a.sub[1],b=m.sub[0];n=b.sub[0].getHexStringValue(),this.n=E(n,16),s=b.sub[1].getHexStringValue(),this.e=parseInt(s,16)}else n=a.sub[0].getHexStringValue(),this.n=E(n,16),s=a.sub[1].getHexStringValue(),this.e=parseInt(s,16);else return!1;return!0}catch{return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new f.asn1.DERInteger({int:0}),new f.asn1.DERInteger({bigint:this.n}),new f.asn1.DERInteger({int:this.e}),new f.asn1.DERInteger({bigint:this.d}),new f.asn1.DERInteger({bigint:this.p}),new f.asn1.DERInteger({bigint:this.q}),new f.asn1.DERInteger({bigint:this.dmp1}),new f.asn1.DERInteger({bigint:this.dmq1}),new f.asn1.DERInteger({bigint:this.coeff})]},n=new f.asn1.DERSequence(e);return n.getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return W(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new f.asn1.DERSequence({array:[new f.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new f.asn1.DERNull]}),n=new f.asn1.DERSequence({array:[new f.asn1.DERInteger({bigint:this.n}),new f.asn1.DERInteger({int:this.e})]}),s=new f.asn1.DERBitString({hex:"00"+n.getEncodedHex()}),i=new f.asn1.DERSequence({array:[e,s]});return i.getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return W(this.getPublicBaseKey())},t.wordwrap=function(e,n){if(n=n||64,!e)return e;var s="(.{1,"+n+`})( +|$
|
|
21
21
|
?)|(.{1,`+n+"})";return e.match(RegExp(s,"g")).join(`
|
|
22
22
|
`)},t.prototype.getPrivateKey=function(){var e=`-----BEGIN RSA PRIVATE KEY-----
|
|
23
23
|
`;return e+=t.wordwrap(this.getPrivateBaseKeyB64())+`
|
|
24
24
|
`,e+="-----END RSA PRIVATE KEY-----",e},t.prototype.getPublicKey=function(){var e=`-----BEGIN PUBLIC KEY-----
|
|
25
25
|
`;return e+=t.wordwrap(this.getPublicBaseKeyB64())+`
|
|
26
|
-
`,e+="-----END PUBLIC KEY-----",e},t.hasPublicKeyProperty=function(e){return e=e||{},e.hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return e=e||{},e.hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t}(Fe),St,Ge=typeof process<"u"?(St=process.env)===null||St===void 0?void 0:St.npm_package_version:void 0,Ce=function(){function r(t){t===void 0&&(t={}),t=t||{},this.default_key_size=t.default_key_size?parseInt(t.default_key_size,10):1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null}return r.prototype.setKey=function(t){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new ae(t)},r.prototype.setPrivateKey=function(t){this.setKey(t)},r.prototype.setPublicKey=function(t){this.setKey(t)},r.prototype.decrypt=function(t){try{return this.getKey().decrypt(Xt(t))}catch{return!1}},r.prototype.encrypt=function(t){try{return W(this.getKey().encrypt(t))}catch{return!1}},r.prototype.sign=function(t,e,n){try{return W(this.getKey().sign(t,e,n))}catch{return!1}},r.prototype.verify=function(t,e,n){try{return this.getKey().verify(t,Xt(e),n)}catch{return!1}},r.prototype.getKey=function(t){if(!this.key){if(this.key=new ae,t&&{}.toString.call(t)==="[object Function]"){this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);return}this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},r.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},r.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},r.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},r.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},r.version=Ge,r}();const oe={status:200,message:"",data:{key:""}};async function ue(){const r=oe;try{const t=await x.get("/mbuhx0as4kui",{params:{ajax:1,render:S()}});let e;return S()?e=JSON.parse(B(t.data)):e=t.data,t.status!=200?(r.status=t.status,r.message="",r):(r.data={key:e.key},r)}catch(t){const e=t;return r.status=e.status||500,r.message=e.message,r}}const Ke={status:200,message:"",key:""},fe={status:200,message:"",data:{msg:"",accessToken:"",fullName:"",unreadMailCount:"",status:"",username:"",walletAmount:"",captcha:""}};async function Ue(r,t,e,n,s,i,o,a){const u=fe,h=r,l=t,p=e,
|
|
26
|
+
`,e+="-----END PUBLIC KEY-----",e},t.hasPublicKeyProperty=function(e){return e=e||{},e.hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return e=e||{},e.hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t}(Fe),St,Ge=typeof process<"u"?(St=process.env)===null||St===void 0?void 0:St.npm_package_version:void 0,Ce=function(){function r(t){t===void 0&&(t={}),t=t||{},this.default_key_size=t.default_key_size?parseInt(t.default_key_size,10):1024,this.default_public_exponent=t.default_public_exponent||"010001",this.log=t.log||!1,this.key=null}return r.prototype.setKey=function(t){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new ae(t)},r.prototype.setPrivateKey=function(t){this.setKey(t)},r.prototype.setPublicKey=function(t){this.setKey(t)},r.prototype.decrypt=function(t){try{return this.getKey().decrypt(Xt(t))}catch{return!1}},r.prototype.encrypt=function(t){try{return W(this.getKey().encrypt(t))}catch{return!1}},r.prototype.sign=function(t,e,n){try{return W(this.getKey().sign(t,e,n))}catch{return!1}},r.prototype.verify=function(t,e,n){try{return this.getKey().verify(t,Xt(e),n)}catch{return!1}},r.prototype.getKey=function(t){if(!this.key){if(this.key=new ae,t&&{}.toString.call(t)==="[object Function]"){this.key.generateAsync(this.default_key_size,this.default_public_exponent,t);return}this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},r.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},r.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},r.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},r.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},r.version=Ge,r}();const oe={status:200,message:"",data:{key:""}};async function ue(){const r=oe;try{const t=await x.get("/mbuhx0as4kui",{params:{ajax:1,render:S()}});let e;return S()?e=JSON.parse(B(t.data)):e=t.data,t.status!=200?(r.status=t.status,r.message="",r):(r.data={key:e.key},r)}catch(t){const e=t;return r.status=e.status||500,r.message=e.message,r}}const Ke={status:200,message:"",key:""},fe={status:200,message:"",data:{msg:"",accessToken:"",fullName:"",unreadMailCount:"",status:"",username:"",walletAmount:"",captcha:""}};async function Ue(r,t,e,n,s,i,o,a){const u=fe,h=r,l=t,p=e,y=s;try{let d;i&&(d=(await ue()).data);const m=new Ce;m.setPublicKey(o);let b=n.host.split(":")[0];const _=m.encrypt(b.trim());_&&b.length<53?b=_:b=b.trim();const w={};w.fr_username=m.encrypt(h.trim()),w.fr_password=m.encrypt(l.trim()),w.fr_gdcode=p,w.isApp=y,w.domain=b,w._token=a,w.json=1,w.encrypt=1,d&&Object.assign(w,d);const A=await x.post("/kdink8anl8z3",w,{headers:{"X-CSRF-TOKEN":w._token},params:{render:S()}});let R;return S()?R=JSON.parse(B(A.data)):R=A.data,A.status!=200?(u.status=A.status,u.message="",u):(u.data={msg:R.msg??"",accessToken:R.access_token??"",fullName:R.fullname??"",unreadMailCount:R.news??"",status:R.status??"",username:R.username??"",walletAmount:R.wallet??"",captcha:R.captcha??""},u)}catch(d){const m=d;return u.status=m.status||500,u.message=m.message,u}}T.Repository=pe,T.cmsList=_t,T.csLink=At,T.currentLang=xt,T.eGame=Bt,T.fishGames=Et,T.getLocale=Ot,T.getLoginKey=Nt,T.getSetting=Pt,T.home=Rt,T.hotGames=Tt,T.login=Vt,T.promotion=wt,T.trialGames=Dt,Object.defineProperty(T,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../src/login/method.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAgBtC,eAAO,MAAM,0BAA0B;;;;CAItC,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;CAahC,CAAA;AAED,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,MAAM,EACb,qBAAqB,EAAE,OAAO,EAC9B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,
|
|
1
|
+
{"version":3,"file":"method.d.ts","sourceRoot":"","sources":["../../src/login/method.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,aAAa,EAAE,MAAM,QAAQ,CAAA;AAgBtC,eAAO,MAAM,0BAA0B;;;;CAItC,CAAA;AAED,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;CAahC,CAAA;AAED,wBAAsB,WAAW,CAC/B,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,GAAG,EACX,KAAK,EAAE,MAAM,EACb,qBAAqB,EAAE,OAAO,EAC9B,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,aAAa,CAAC,CAwFxB"}
|
package/dist/main.d.ts
CHANGED