xasdd6 1.0.2 → 1.0.4
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/package.json +7 -7
- package/{dist/xasdd6.es.js → xasdd6.es.js} +211 -213
- package/xasdd6.umd.cjs +87 -0
- package/THIRD_PARTY_LICENSES.txt +0 -411
- package/dist/xasdd6.umd.cjs +0 -87
|
@@ -474,29 +474,29 @@ var E = T({
|
|
|
474
474
|
encodingLength(e) {
|
|
475
475
|
return E.encodingLength(e) + 2;
|
|
476
476
|
}
|
|
477
|
-
}),
|
|
477
|
+
}), j = T({
|
|
478
478
|
encode(e, t, n) {
|
|
479
|
-
t ||= new Uint8Array(
|
|
479
|
+
t ||= new Uint8Array(j.encodingLength(e)), n ||= 0;
|
|
480
480
|
let r = n;
|
|
481
|
-
return n += 2, E.encode(e.mname, t, n), n += E.encode.bytes, E.encode(e.rname, t, n), n += E.encode.bytes, S(t, e.serial || 0, n), n += 4, S(t, e.refresh || 0, n), n += 4, S(t, e.retry || 0, n), n += 4, S(t, e.expire || 0, n), n += 4, S(t, e.minimum || 0, n), n += 4, C(t, n - r - 2, r),
|
|
481
|
+
return n += 2, E.encode(e.mname, t, n), n += E.encode.bytes, E.encode(e.rname, t, n), n += E.encode.bytes, S(t, e.serial || 0, n), n += 4, S(t, e.refresh || 0, n), n += 4, S(t, e.retry || 0, n), n += 4, S(t, e.expire || 0, n), n += 4, S(t, e.minimum || 0, n), n += 4, C(t, n - r - 2, r), j.encode.bytes = n - r, t;
|
|
482
482
|
},
|
|
483
483
|
decode(e, t) {
|
|
484
484
|
t ||= 0;
|
|
485
485
|
let n = t, r = {};
|
|
486
|
-
return t += 2, r.mname = E.decode(e, t), t += E.decode.bytes, r.rname = E.decode(e, t), t += E.decode.bytes, r.serial = b(e, t), t += 4, r.refresh = b(e, t), t += 4, r.retry = b(e, t), t += 4, r.expire = b(e, t), t += 4, r.minimum = b(e, t), t += 4,
|
|
486
|
+
return t += 2, r.mname = E.decode(e, t), t += E.decode.bytes, r.rname = E.decode(e, t), t += E.decode.bytes, r.serial = b(e, t), t += 4, r.refresh = b(e, t), t += 4, r.retry = b(e, t), t += 4, r.expire = b(e, t), t += 4, r.minimum = b(e, t), t += 4, j.decode.bytes = t - n, r;
|
|
487
487
|
},
|
|
488
488
|
encodingLength(e) {
|
|
489
489
|
return 22 + E.encodingLength(e.mname) + E.encodingLength(e.rname);
|
|
490
490
|
}
|
|
491
|
-
}),
|
|
491
|
+
}), M = T({
|
|
492
492
|
encode(e, t, n) {
|
|
493
493
|
Array.isArray(e) || (e = [e]);
|
|
494
494
|
for (let t = 0; t < e.length; t++) if (typeof e[t] == "string" && (e[t] = oe(e[t])), !v(e[t])) throw Error("Must be a Buffer");
|
|
495
|
-
t ||= new Uint8Array(
|
|
495
|
+
t ||= new Uint8Array(M.encodingLength(e)), n ||= 0;
|
|
496
496
|
let r = n;
|
|
497
497
|
return n += 2, e.forEach(function(e) {
|
|
498
498
|
t[n++] = e.length, w(e, t, n, 0, e.length), n += e.length;
|
|
499
|
-
}), C(t, n - r - 2, r),
|
|
499
|
+
}), C(t, n - r - 2, r), M.encode.bytes = n - r, t;
|
|
500
500
|
},
|
|
501
501
|
decode(e, t) {
|
|
502
502
|
t ||= 0;
|
|
@@ -508,7 +508,7 @@ var E = T({
|
|
|
508
508
|
if (--r, r < n) throw Error("Buffer overflow");
|
|
509
509
|
i.push(e.slice(t, t + n)), t += n, r -= n;
|
|
510
510
|
}
|
|
511
|
-
return
|
|
511
|
+
return M.decode.bytes = t - n, i;
|
|
512
512
|
},
|
|
513
513
|
encodingLength(e) {
|
|
514
514
|
Array.isArray(e) || (e = [e]);
|
|
@@ -517,122 +517,122 @@ var E = T({
|
|
|
517
517
|
t += typeof e == "string" ? y(e) + 1 : e.length + 1;
|
|
518
518
|
}), t;
|
|
519
519
|
}
|
|
520
|
-
}),
|
|
520
|
+
}), N = T({
|
|
521
521
|
encode(e, t, n) {
|
|
522
|
-
t ||= new Uint8Array(
|
|
522
|
+
t ||= new Uint8Array(N.encodingLength(e)), n ||= 0, typeof e == "string" && (e = oe(e)), e ||= /* @__PURE__ */ new Uint8Array();
|
|
523
523
|
let r = n;
|
|
524
524
|
n += 2;
|
|
525
525
|
let i = e.length;
|
|
526
|
-
return w(e, t, n, 0, i), n += i, C(t, n - r - 2, r),
|
|
526
|
+
return w(e, t, n, 0, i), n += i, C(t, n - r - 2, r), N.encode.bytes = n - r, t;
|
|
527
527
|
},
|
|
528
528
|
decode(e, t) {
|
|
529
529
|
t ||= 0;
|
|
530
530
|
let n = t, r = x(e, t);
|
|
531
531
|
t += 2;
|
|
532
532
|
let i = e.slice(t, t + r);
|
|
533
|
-
return t += r,
|
|
533
|
+
return t += r, N.decode.bytes = t - n, i;
|
|
534
534
|
},
|
|
535
535
|
encodingLength(e) {
|
|
536
536
|
return e ? (v(e) ? e.length : y(e)) + 2 : 2;
|
|
537
537
|
}
|
|
538
|
-
}),
|
|
538
|
+
}), P = T({
|
|
539
539
|
encode(e, t, n) {
|
|
540
|
-
t ||= new Uint8Array(
|
|
540
|
+
t ||= new Uint8Array(P.encodingLength(e)), n ||= 0;
|
|
541
541
|
let r = n;
|
|
542
|
-
return n += 2, D.encode(e.cpu, t, n), n += D.encode.bytes, D.encode(e.os, t, n), n += D.encode.bytes, C(t, n - r - 2, r),
|
|
542
|
+
return n += 2, D.encode(e.cpu, t, n), n += D.encode.bytes, D.encode(e.os, t, n), n += D.encode.bytes, C(t, n - r - 2, r), P.encode.bytes = n - r, t;
|
|
543
543
|
},
|
|
544
544
|
decode(e, t) {
|
|
545
545
|
t ||= 0;
|
|
546
546
|
let n = t, r = {};
|
|
547
|
-
return t += 2, r.cpu = D.decode(e, t), t += D.decode.bytes, r.os = D.decode(e, t), t += D.decode.bytes,
|
|
547
|
+
return t += 2, r.cpu = D.decode(e, t), t += D.decode.bytes, r.os = D.decode(e, t), t += D.decode.bytes, P.decode.bytes = t - n, r;
|
|
548
548
|
},
|
|
549
549
|
encodingLength(e) {
|
|
550
550
|
return D.encodingLength(e.cpu) + D.encodingLength(e.os) + 2;
|
|
551
551
|
}
|
|
552
|
-
}),
|
|
552
|
+
}), F = T({
|
|
553
553
|
encode(e, t, n) {
|
|
554
|
-
return t ||= new Uint8Array(
|
|
554
|
+
return t ||= new Uint8Array(F.encodingLength(e)), n ||= 0, E.encode(e, t, n + 2), C(t, E.encode.bytes, n), F.encode.bytes = E.encode.bytes + 2, t;
|
|
555
555
|
},
|
|
556
556
|
decode(e, t) {
|
|
557
557
|
t ||= 0;
|
|
558
558
|
let n = E.decode(e, t + 2);
|
|
559
|
-
return
|
|
559
|
+
return F.decode.bytes = E.decode.bytes + 2, n;
|
|
560
560
|
},
|
|
561
561
|
encodingLength(e) {
|
|
562
562
|
return E.encodingLength(e) + 2;
|
|
563
563
|
}
|
|
564
|
-
}),
|
|
564
|
+
}), I = T({
|
|
565
565
|
encode(e, t, n) {
|
|
566
|
-
t ||= new Uint8Array(
|
|
566
|
+
t ||= new Uint8Array(I.encodingLength(e)), n ||= 0, C(t, e.priority || 0, n + 2), C(t, e.weight || 0, n + 4), C(t, e.port || 0, n + 6), E.encode(e.target, t, n + 8);
|
|
567
567
|
let r = E.encode.bytes + 6;
|
|
568
|
-
return C(t, r, n),
|
|
568
|
+
return C(t, r, n), I.encode.bytes = r + 2, t;
|
|
569
569
|
},
|
|
570
570
|
decode(e, t) {
|
|
571
571
|
t ||= 0;
|
|
572
572
|
let n = x(e, t), r = {};
|
|
573
|
-
return r.priority = x(e, t + 2), r.weight = x(e, t + 4), r.port = x(e, t + 6), r.target = E.decode(e, t + 8),
|
|
573
|
+
return r.priority = x(e, t + 2), r.weight = x(e, t + 4), r.port = x(e, t + 6), r.target = E.decode(e, t + 8), I.decode.bytes = n + 2, r;
|
|
574
574
|
},
|
|
575
575
|
encodingLength(e) {
|
|
576
576
|
return 8 + E.encodingLength(e.target);
|
|
577
577
|
}
|
|
578
|
-
}),
|
|
578
|
+
}), L = T({
|
|
579
579
|
encode(e, t, n) {
|
|
580
|
-
let r =
|
|
581
|
-
return t ||= new Uint8Array(
|
|
580
|
+
let r = L.encodingLength(e);
|
|
581
|
+
return t ||= new Uint8Array(L.encodingLength(e)), n ||= 0, e.issuerCritical && (e.flags = L.ISSUER_CRITICAL), C(t, r - 2, n), n += 2, t[n] = e.flags || 0, n += 1, D.encode(e.tag, t, n), n += D.encode.bytes, se(t, e.value, n), n += y(e.value), L.encode.bytes = r, t;
|
|
582
582
|
},
|
|
583
583
|
decode(e, t) {
|
|
584
584
|
t ||= 0;
|
|
585
585
|
let n = x(e, t);
|
|
586
586
|
t += 2;
|
|
587
587
|
let r = t, i = {};
|
|
588
|
-
return i.flags = e[t], t += 1, i.tag = D.decode(e, t), t += D.decode.bytes, i.value = _(e, t, r + n), i.issuerCritical = !!(i.flags &
|
|
588
|
+
return i.flags = e[t], t += 1, i.tag = D.decode(e, t), t += D.decode.bytes, i.value = _(e, t, r + n), i.issuerCritical = !!(i.flags & L.ISSUER_CRITICAL), L.decode.bytes = n + 2, i;
|
|
589
589
|
},
|
|
590
590
|
encodingLength(e) {
|
|
591
591
|
return D.encodingLength(e.tag) + D.encodingLength(e.value) + 2;
|
|
592
592
|
}
|
|
593
593
|
});
|
|
594
|
-
|
|
595
|
-
var
|
|
594
|
+
L.ISSUER_CRITICAL = 128;
|
|
595
|
+
var ve = T({
|
|
596
596
|
encode(e, t, n) {
|
|
597
|
-
t ||= new Uint8Array(
|
|
597
|
+
t ||= new Uint8Array(ve.encodingLength(e)), n ||= 0;
|
|
598
598
|
let r = n;
|
|
599
|
-
return n += 2, C(t, e.preference || 0, n), n += 2, E.encode(e.exchange, t, n), n += E.encode.bytes, C(t, n - r - 2, r),
|
|
599
|
+
return n += 2, C(t, e.preference || 0, n), n += 2, E.encode(e.exchange, t, n), n += E.encode.bytes, C(t, n - r - 2, r), ve.encode.bytes = n - r, t;
|
|
600
600
|
},
|
|
601
601
|
decode(e, t) {
|
|
602
602
|
t ||= 0;
|
|
603
603
|
let n = t, r = {};
|
|
604
|
-
return t += 2, r.preference = x(e, t), t += 2, r.exchange = E.decode(e, t), t += E.decode.bytes,
|
|
604
|
+
return t += 2, r.preference = x(e, t), t += 2, r.exchange = E.decode(e, t), t += E.decode.bytes, ve.decode.bytes = t - n, r;
|
|
605
605
|
},
|
|
606
606
|
encodingLength(e) {
|
|
607
607
|
return 4 + E.encodingLength(e.exchange);
|
|
608
608
|
}
|
|
609
|
-
}),
|
|
609
|
+
}), ye = T({
|
|
610
610
|
encode(e, t, n) {
|
|
611
|
-
return t ||= new Uint8Array(
|
|
611
|
+
return t ||= new Uint8Array(ye.encodingLength(e)), n ||= 0, C(t, 4, n), n += 2, a.encode(e, t, n), t;
|
|
612
612
|
},
|
|
613
613
|
decode(e, t) {
|
|
614
614
|
return t ||= 0, t += 2, a.decode(e, t);
|
|
615
615
|
},
|
|
616
616
|
bytes: 6
|
|
617
|
-
}),
|
|
617
|
+
}), be = T({
|
|
618
618
|
encode(e, t, n) {
|
|
619
|
-
return t ||= new Uint8Array(
|
|
619
|
+
return t ||= new Uint8Array(be.encodingLength(e)), n ||= 0, C(t, 16, n), n += 2, o.encode(e, t, n), be.encode.bytes = 18, t;
|
|
620
620
|
},
|
|
621
621
|
decode(e, t) {
|
|
622
622
|
t ||= 0, t += 2;
|
|
623
623
|
let n = o.decode(e, t);
|
|
624
|
-
return
|
|
624
|
+
return be.decode.bytes = 18, n;
|
|
625
625
|
},
|
|
626
626
|
bytes: 18
|
|
627
|
-
}),
|
|
627
|
+
}), xe = (e) => new Uint8Array(e), R = T({
|
|
628
628
|
encode(e, t, n) {
|
|
629
|
-
t ||= new Uint8Array(
|
|
629
|
+
t ||= new Uint8Array(R.encodingLength(e)), n ||= 0;
|
|
630
630
|
let r = n, i = re(e.code);
|
|
631
631
|
if (C(t, i, n), n += 2, e.data) C(t, e.data.length, n), n += 2, w(e.data, t, n), n += e.data.length;
|
|
632
632
|
else switch (i) {
|
|
633
633
|
case 8:
|
|
634
634
|
{
|
|
635
|
-
let r = e.sourcePrefixLength || 0, i = e.family || c(e.ip,
|
|
635
|
+
let r = e.sourcePrefixLength || 0, i = e.family || c(e.ip, xe), a = l(e.ip, xe), o = Math.ceil(r / 8);
|
|
636
636
|
C(t, o + 4, n), n += 2, C(t, i, n), n += 2, t[n++] = r, t[n++] = e.scopePrefixLength || 0, w(a, t, n, 0, o), n += o;
|
|
637
637
|
}
|
|
638
638
|
break;
|
|
@@ -654,7 +654,7 @@ var F = T({
|
|
|
654
654
|
break;
|
|
655
655
|
default: throw Error(`Unknown roption code: ${e.code}`);
|
|
656
656
|
}
|
|
657
|
-
return
|
|
657
|
+
return R.encode.bytes = n - r, t;
|
|
658
658
|
},
|
|
659
659
|
decode(e, t) {
|
|
660
660
|
t ||= 0;
|
|
@@ -676,7 +676,7 @@ var F = T({
|
|
|
676
676
|
n.tags = [];
|
|
677
677
|
for (let i = 0; i < r; i += 2) n.tags.push(x(e, t)), t += 2;
|
|
678
678
|
}
|
|
679
|
-
return
|
|
679
|
+
return R.decode.bytes = r + 4, n;
|
|
680
680
|
},
|
|
681
681
|
encodingLength(e) {
|
|
682
682
|
if (e.data) return e.data.length + 4;
|
|
@@ -691,73 +691,73 @@ var F = T({
|
|
|
691
691
|
}
|
|
692
692
|
throw Error(`Unknown roption code: ${e.code}`);
|
|
693
693
|
}
|
|
694
|
-
}),
|
|
694
|
+
}), z = T({
|
|
695
695
|
encode(e, t, n) {
|
|
696
|
-
t ||= new Uint8Array(
|
|
697
|
-
let r = n, i = X(e,
|
|
698
|
-
return C(t, i, n), n = Z(e,
|
|
696
|
+
t ||= new Uint8Array(z.encodingLength(e)), n ||= 0;
|
|
697
|
+
let r = n, i = X(e, R);
|
|
698
|
+
return C(t, i, n), n = Z(e, R, t, n + 2), z.encode.bytes = n - r, t;
|
|
699
699
|
},
|
|
700
700
|
decode(e, t) {
|
|
701
701
|
t ||= 0;
|
|
702
702
|
let n = t, r = [], i = x(e, t);
|
|
703
703
|
t += 2;
|
|
704
704
|
let a = 0;
|
|
705
|
-
for (; i > 0;) r[a++] =
|
|
706
|
-
return
|
|
705
|
+
for (; i > 0;) r[a++] = R.decode(e, t), t += R.decode.bytes, i -= R.decode.bytes;
|
|
706
|
+
return z.decode.bytes = t - n, r;
|
|
707
707
|
},
|
|
708
708
|
encodingLength(e) {
|
|
709
|
-
return 2 + X(e || [],
|
|
709
|
+
return 2 + X(e || [], R);
|
|
710
710
|
}
|
|
711
|
-
}),
|
|
711
|
+
}), B = T({
|
|
712
712
|
encode(e, t, n) {
|
|
713
|
-
t ||= new Uint8Array(
|
|
713
|
+
t ||= new Uint8Array(B.encodingLength(e)), n ||= 0;
|
|
714
714
|
let r = n, i = e.key;
|
|
715
715
|
if (!v(i)) throw Error("Key must be a Buffer");
|
|
716
|
-
return n += 2, C(t, e.flags, n), n += 2, t[n] =
|
|
716
|
+
return n += 2, C(t, e.flags, n), n += 2, t[n] = B.PROTOCOL_DNSSEC, n += 1, t[n] = e.algorithm, n += 1, w(i, t, n, 0, i.length), n += i.length, B.encode.bytes = n - r, C(t, B.encode.bytes - 2, r), t;
|
|
717
717
|
},
|
|
718
718
|
decode(e, t) {
|
|
719
719
|
t ||= 0;
|
|
720
720
|
let n = t, r = {}, i = x(e, t);
|
|
721
|
-
if (t += 2, r.flags = x(e, t), t += 2, e[t] !==
|
|
722
|
-
return t += 1, r.algorithm = e[t], t += 1, r.key = e.slice(t, n + i + 2), t += r.key.length,
|
|
721
|
+
if (t += 2, r.flags = x(e, t), t += 2, e[t] !== B.PROTOCOL_DNSSEC) throw Error("Protocol must be 3");
|
|
722
|
+
return t += 1, r.algorithm = e[t], t += 1, r.key = e.slice(t, n + i + 2), t += r.key.length, B.decode.bytes = t - n, r;
|
|
723
723
|
},
|
|
724
724
|
encodingLength(e) {
|
|
725
725
|
return 6 + y(e.key);
|
|
726
726
|
}
|
|
727
727
|
});
|
|
728
|
-
|
|
729
|
-
var
|
|
728
|
+
B.PROTOCOL_DNSSEC = 3, B.ZONE_KEY = 128, B.SECURE_ENTRYPOINT = 32768;
|
|
729
|
+
var V = T({
|
|
730
730
|
encode(e, t, n) {
|
|
731
|
-
t ||= new Uint8Array(
|
|
731
|
+
t ||= new Uint8Array(V.encodingLength(e)), n ||= 0;
|
|
732
732
|
let r = n, i = e.signature;
|
|
733
733
|
if (!v(i)) throw Error("Signature must be a Buffer");
|
|
734
|
-
return n += 2, C(t, f(e.typeCovered), n), n += 2, t[n] = e.algorithm, n += 1, t[n] = e.labels, n += 1, S(t, e.originalTTL, n), n += 4, S(t, e.expiration, n), n += 4, S(t, e.inception, n), n += 4, C(t, e.keyTag, n), n += 2, E.encode(e.signersName, t, n), n += E.encode.bytes, w(i, t, n, 0, i.length), n += i.length,
|
|
734
|
+
return n += 2, C(t, f(e.typeCovered), n), n += 2, t[n] = e.algorithm, n += 1, t[n] = e.labels, n += 1, S(t, e.originalTTL, n), n += 4, S(t, e.expiration, n), n += 4, S(t, e.inception, n), n += 4, C(t, e.keyTag, n), n += 2, E.encode(e.signersName, t, n), n += E.encode.bytes, w(i, t, n, 0, i.length), n += i.length, V.encode.bytes = n - r, C(t, V.encode.bytes - 2, r), t;
|
|
735
735
|
},
|
|
736
736
|
decode(e, t) {
|
|
737
737
|
t ||= 0;
|
|
738
738
|
let n = t, r = {}, i = x(e, t);
|
|
739
|
-
return t += 2, r.typeCovered = d(x(e, t)), t += 2, r.algorithm = e[t], t += 1, r.labels = e[t], t += 1, r.originalTTL = b(e, t), t += 4, r.expiration = b(e, t), t += 4, r.inception = b(e, t), t += 4, r.keyTag = x(e, t), t += 2, r.signersName = E.decode(e, t), t += E.decode.bytes, r.signature = e.slice(t, n + i + 2), t += r.signature.length,
|
|
739
|
+
return t += 2, r.typeCovered = d(x(e, t)), t += 2, r.algorithm = e[t], t += 1, r.labels = e[t], t += 1, r.originalTTL = b(e, t), t += 4, r.expiration = b(e, t), t += 4, r.inception = b(e, t), t += 4, r.keyTag = x(e, t), t += 2, r.signersName = E.decode(e, t), t += E.decode.bytes, r.signature = e.slice(t, n + i + 2), t += r.signature.length, V.decode.bytes = t - n, r;
|
|
740
740
|
},
|
|
741
741
|
encodingLength(e) {
|
|
742
742
|
return 20 + E.encodingLength(e.signersName) + y(e.signature);
|
|
743
743
|
}
|
|
744
|
-
}),
|
|
744
|
+
}), H = T({
|
|
745
745
|
encode(e, t, n) {
|
|
746
|
-
t ||= new Uint8Array(
|
|
746
|
+
t ||= new Uint8Array(H.encodingLength(e)), n ||= 0;
|
|
747
747
|
let r = n;
|
|
748
|
-
return n += 2, E.encode(e.mbox || ".", t, n), n += E.encode.bytes, E.encode(e.txt || ".", t, n), n += E.encode.bytes,
|
|
748
|
+
return n += 2, E.encode(e.mbox || ".", t, n), n += E.encode.bytes, E.encode(e.txt || ".", t, n), n += E.encode.bytes, H.encode.bytes = n - r, C(t, H.encode.bytes - 2, r), t;
|
|
749
749
|
},
|
|
750
750
|
decode(e, t) {
|
|
751
751
|
t ||= 0;
|
|
752
752
|
let n = t, r = {};
|
|
753
|
-
return t += 2, r.mbox = E.decode(e, t) || ".", t += E.decode.bytes, r.txt = E.decode(e, t) || ".", t += E.decode.bytes,
|
|
753
|
+
return t += 2, r.mbox = E.decode(e, t) || ".", t += E.decode.bytes, r.txt = E.decode(e, t) || ".", t += E.decode.bytes, H.decode.bytes = t - n, r;
|
|
754
754
|
},
|
|
755
755
|
encodingLength(e) {
|
|
756
756
|
return 2 + E.encodingLength(e.mbox || ".") + E.encodingLength(e.txt || ".");
|
|
757
757
|
}
|
|
758
|
-
}),
|
|
758
|
+
}), U = T({
|
|
759
759
|
encode(e, t, n) {
|
|
760
|
-
t ||= new Uint8Array(
|
|
760
|
+
t ||= new Uint8Array(U.encodingLength(e)), n ||= 0;
|
|
761
761
|
let r = n, i = [];
|
|
762
762
|
for (let t = 0; t < e.length; t++) {
|
|
763
763
|
let n = f(e[t]);
|
|
@@ -767,7 +767,7 @@ var B = T({
|
|
|
767
767
|
let r = oe(i[e]);
|
|
768
768
|
t[n] = e, n += 1, t[n] = r.length, n += 1, w(r, t, n, 0, r.length), n += r.length;
|
|
769
769
|
}
|
|
770
|
-
return
|
|
770
|
+
return U.encode.bytes = n - r, t;
|
|
771
771
|
},
|
|
772
772
|
decode(e, t, n) {
|
|
773
773
|
t ||= 0;
|
|
@@ -786,7 +786,7 @@ var B = T({
|
|
|
786
786
|
}
|
|
787
787
|
t += r;
|
|
788
788
|
}
|
|
789
|
-
return
|
|
789
|
+
return U.decode.bytes = t - r, i;
|
|
790
790
|
},
|
|
791
791
|
encodingLength(e) {
|
|
792
792
|
let t = [];
|
|
@@ -798,28 +798,28 @@ var B = T({
|
|
|
798
798
|
for (let e = 0; e < t.length; e++) t[e] !== void 0 && (n += 2 + Math.ceil((t[e] + 1) / 8));
|
|
799
799
|
return n;
|
|
800
800
|
}
|
|
801
|
-
}),
|
|
801
|
+
}), W = T({
|
|
802
802
|
encode(e, t, n) {
|
|
803
|
-
t ||= new Uint8Array(
|
|
803
|
+
t ||= new Uint8Array(W.encodingLength(e)), n ||= 0;
|
|
804
804
|
let r = n;
|
|
805
|
-
return n += 2, E.encode(e.nextDomain, t, n), n += E.encode.bytes,
|
|
805
|
+
return n += 2, E.encode(e.nextDomain, t, n), n += E.encode.bytes, U.encode(e.rrtypes, t, n), n += U.encode.bytes, W.encode.bytes = n - r, C(t, W.encode.bytes - 2, r), t;
|
|
806
806
|
},
|
|
807
807
|
decode(e, t) {
|
|
808
808
|
t ||= 0;
|
|
809
809
|
let n = t, r = {}, i = x(e, t);
|
|
810
|
-
return t += 2, r.nextDomain = E.decode(e, t), t += E.decode.bytes, r.rrtypes =
|
|
810
|
+
return t += 2, r.nextDomain = E.decode(e, t), t += E.decode.bytes, r.rrtypes = U.decode(e, t, i - (t - n)), t += U.decode.bytes, W.decode.bytes = t - n, r;
|
|
811
811
|
},
|
|
812
812
|
encodingLength(e) {
|
|
813
|
-
return 2 + E.encodingLength(e.nextDomain) +
|
|
813
|
+
return 2 + E.encodingLength(e.nextDomain) + U.encodingLength(e.rrtypes);
|
|
814
814
|
}
|
|
815
|
-
}),
|
|
815
|
+
}), G = T({
|
|
816
816
|
encode(e, t, n) {
|
|
817
|
-
t ||= new Uint8Array(
|
|
817
|
+
t ||= new Uint8Array(G.encodingLength(e)), n ||= 0;
|
|
818
818
|
let r = n, i = e.salt;
|
|
819
819
|
if (!v(i)) throw Error("salt must be a Buffer");
|
|
820
820
|
let a = e.nextDomain;
|
|
821
821
|
if (!v(a)) throw Error("nextDomain must be a Buffer");
|
|
822
|
-
return n += 2, t[n] = e.algorithm, n += 1, t[n] = e.flags, n += 1, C(t, e.iterations, n), n += 2, t[n] = i.length, n += 1, w(i, t, n, 0, i.length), n += i.length, t[n] = a.length, n += 1, w(a, t, n, 0, a.length), n += a.length,
|
|
822
|
+
return n += 2, t[n] = e.algorithm, n += 1, t[n] = e.flags, n += 1, C(t, e.iterations, n), n += 2, t[n] = i.length, n += 1, w(i, t, n, 0, i.length), n += i.length, t[n] = a.length, n += 1, w(a, t, n, 0, a.length), n += a.length, U.encode(e.rrtypes, t, n), n += U.encode.bytes, G.encode.bytes = n - r, C(t, G.encode.bytes - 2, r), t;
|
|
823
823
|
},
|
|
824
824
|
decode(e, t) {
|
|
825
825
|
t ||= 0;
|
|
@@ -828,146 +828,148 @@ var B = T({
|
|
|
828
828
|
let a = e[t];
|
|
829
829
|
t += 1, r.salt = e.slice(t, t + a), t += a;
|
|
830
830
|
let o = e[t];
|
|
831
|
-
return t += 1, r.nextDomain = e.slice(t, t + o), t += o, r.rrtypes =
|
|
831
|
+
return t += 1, r.nextDomain = e.slice(t, t + o), t += o, r.rrtypes = U.decode(e, t, i - (t - n)), t += U.decode.bytes, G.decode.bytes = t - n, r;
|
|
832
832
|
},
|
|
833
833
|
encodingLength(e) {
|
|
834
|
-
return 8 + e.salt.length + e.nextDomain.length +
|
|
834
|
+
return 8 + e.salt.length + e.nextDomain.length + U.encodingLength(e.rrtypes);
|
|
835
835
|
}
|
|
836
|
-
}),
|
|
836
|
+
}), K = T({
|
|
837
837
|
encode(e, t, n) {
|
|
838
|
-
t ||= new Uint8Array(
|
|
838
|
+
t ||= new Uint8Array(K.encodingLength(e)), n ||= 0;
|
|
839
839
|
let r = n, i = e.digest;
|
|
840
840
|
if (!v(i)) throw Error("Digest must be a Buffer");
|
|
841
|
-
return n += 2, C(t, e.keyTag, n), n += 2, t[n] = e.algorithm, n += 1, t[n] = e.digestType, n += 1, w(i, t, n, 0, i.length), n += i.length,
|
|
841
|
+
return n += 2, C(t, e.keyTag, n), n += 2, t[n] = e.algorithm, n += 1, t[n] = e.digestType, n += 1, w(i, t, n, 0, i.length), n += i.length, K.encode.bytes = n - r, C(t, K.encode.bytes - 2, r), t;
|
|
842
842
|
},
|
|
843
843
|
decode(e, t) {
|
|
844
844
|
t ||= 0;
|
|
845
845
|
let n = t, r = {}, i = x(e, t);
|
|
846
|
-
return t += 2, r.keyTag = x(e, t), t += 2, r.algorithm = e[t], t += 1, r.digestType = e[t], t += 1, r.digest = e.slice(t, n + i + 2), t += r.digest.length,
|
|
846
|
+
return t += 2, r.keyTag = x(e, t), t += 2, r.algorithm = e[t], t += 1, r.digestType = e[t], t += 1, r.digest = e.slice(t, n + i + 2), t += r.digest.length, K.decode.bytes = t - n, r;
|
|
847
847
|
},
|
|
848
848
|
encodingLength(e) {
|
|
849
849
|
return 6 + y(e.digest);
|
|
850
850
|
}
|
|
851
851
|
});
|
|
852
|
-
function
|
|
852
|
+
function Se(e) {
|
|
853
853
|
switch (e.toUpperCase()) {
|
|
854
|
-
case "A": return
|
|
855
|
-
case "PTR": return
|
|
856
|
-
case "CNAME": return
|
|
857
|
-
case "DNAME": return
|
|
858
|
-
case "TXT": return
|
|
859
|
-
case "NULL": return
|
|
860
|
-
case "AAAA": return
|
|
861
|
-
case "SRV": return
|
|
862
|
-
case "HINFO": return
|
|
863
|
-
case "CAA": return
|
|
854
|
+
case "A": return ye;
|
|
855
|
+
case "PTR": return F;
|
|
856
|
+
case "CNAME": return F;
|
|
857
|
+
case "DNAME": return F;
|
|
858
|
+
case "TXT": return M;
|
|
859
|
+
case "NULL": return N;
|
|
860
|
+
case "AAAA": return be;
|
|
861
|
+
case "SRV": return I;
|
|
862
|
+
case "HINFO": return P;
|
|
863
|
+
case "CAA": return L;
|
|
864
864
|
case "NS": return A;
|
|
865
|
-
case "SOA": return
|
|
866
|
-
case "MX": return
|
|
867
|
-
case "OPT": return
|
|
868
|
-
case "DNSKEY": return
|
|
869
|
-
case "RRSIG": return
|
|
870
|
-
case "RP": return
|
|
871
|
-
case "NSEC": return
|
|
872
|
-
case "NSEC3": return
|
|
873
|
-
case "DS": return
|
|
865
|
+
case "SOA": return j;
|
|
866
|
+
case "MX": return ve;
|
|
867
|
+
case "OPT": return z;
|
|
868
|
+
case "DNSKEY": return B;
|
|
869
|
+
case "RRSIG": return V;
|
|
870
|
+
case "RP": return H;
|
|
871
|
+
case "NSEC": return W;
|
|
872
|
+
case "NSEC3": return G;
|
|
873
|
+
case "DS": return K;
|
|
874
874
|
}
|
|
875
875
|
return k;
|
|
876
876
|
}
|
|
877
|
-
var
|
|
877
|
+
var q = T({
|
|
878
878
|
encode(e, t, n) {
|
|
879
|
-
t ||= new Uint8Array(
|
|
879
|
+
t ||= new Uint8Array(q.encodingLength(e)), n ||= 0;
|
|
880
880
|
let r = n;
|
|
881
881
|
if (E.encode(e.name, t, n), n += E.encode.bytes, C(t, f(e.type), n), e.type.toUpperCase() === "OPT") {
|
|
882
882
|
if (e.name !== ".") throw Error("OPT name must be root.");
|
|
883
|
-
C(t, e.udpPayloadSize || 4096, n + 2), t[n + 4] = e.extendedRcode || 0, t[n + 5] = e.ednsVersion || 0, C(t, e.flags || 0, n + 6), n += 8,
|
|
883
|
+
C(t, e.udpPayloadSize || 4096, n + 2), t[n + 4] = e.extendedRcode || 0, t[n + 5] = e.ednsVersion || 0, C(t, e.flags || 0, n + 6), n += 8, z.encode(e.options || [], t, n), n += z.encode.bytes;
|
|
884
884
|
} else {
|
|
885
885
|
let r = te(e.class === void 0 ? "IN" : e.class);
|
|
886
886
|
e.flush && (r |= me), C(t, r, n + 2), S(t, e.ttl || 0, n + 4), n += 8;
|
|
887
|
-
let i =
|
|
887
|
+
let i = Se(e.type);
|
|
888
888
|
i.encode(e.data, t, n), n += i.encode.bytes;
|
|
889
889
|
}
|
|
890
|
-
return
|
|
890
|
+
return q.encode.bytes = n - r, t;
|
|
891
891
|
},
|
|
892
892
|
decode(e, t) {
|
|
893
893
|
t ||= 0;
|
|
894
894
|
let n = {}, r = t;
|
|
895
|
-
if (n.name = E.decode(e, t), t += E.decode.bytes, n.type = d(x(e, t)), n.type === "OPT") n.udpPayloadSize = x(e, t + 2), n.extendedRcode = e[t + 4], n.ednsVersion = e[t + 5], n.flags = x(e, t + 6), n.flag_do = (n.flags >> 15 & 1) == 1, n.options =
|
|
895
|
+
if (n.name = E.decode(e, t), t += E.decode.bytes, n.type = d(x(e, t)), n.type === "OPT") n.udpPayloadSize = x(e, t + 2), n.extendedRcode = e[t + 4], n.ednsVersion = e[t + 5], n.flags = x(e, t + 6), n.flag_do = (n.flags >> 15 & 1) == 1, n.options = z.decode(e, t + 8), t += 8 + z.decode.bytes;
|
|
896
896
|
else {
|
|
897
897
|
let r = x(e, t + 2);
|
|
898
898
|
n.ttl = b(e, t + 4), n.class = m(r & he), n.flush = !!(r & me);
|
|
899
|
-
let i =
|
|
899
|
+
let i = Se(n.type);
|
|
900
900
|
n.data = i.decode(e, t + 8), t += 8 + i.decode.bytes;
|
|
901
901
|
}
|
|
902
|
-
return
|
|
902
|
+
return q.decode.bytes = t - r, n;
|
|
903
903
|
},
|
|
904
904
|
encodingLength(e) {
|
|
905
905
|
let t = e.data !== null && e.data !== void 0 ? e.data : e.options;
|
|
906
|
-
return E.encodingLength(e.name) + 8 +
|
|
906
|
+
return E.encodingLength(e.name) + 8 + Se(e.type).encodingLength(t);
|
|
907
907
|
}
|
|
908
|
-
}),
|
|
908
|
+
}), J = T({
|
|
909
909
|
encode(e, t, n) {
|
|
910
|
-
t ||= new Uint8Array(
|
|
910
|
+
t ||= new Uint8Array(J.encodingLength(e)), n ||= 0;
|
|
911
911
|
let r = n;
|
|
912
|
-
return E.encode(e.name, t, n), n += E.encode.bytes, C(t, f(e.type), n), n += 2, C(t, te(e.class === void 0 ? "IN" : e.class), n), n += 2,
|
|
912
|
+
return E.encode(e.name, t, n), n += E.encode.bytes, C(t, f(e.type), n), n += 2, C(t, te(e.class === void 0 ? "IN" : e.class), n), n += 2, J.encode.bytes = n - r, e;
|
|
913
913
|
},
|
|
914
914
|
decode(e, t) {
|
|
915
915
|
t ||= 0;
|
|
916
916
|
let n = t, r = {};
|
|
917
|
-
return r.name = E.decode(e, t), t += E.decode.bytes, r.type = d(x(e, t)), t += 2, r.class = m(x(e, t)), t += 2, r.class & ge && (r.class &= _e),
|
|
917
|
+
return r.name = E.decode(e, t), t += E.decode.bytes, r.type = d(x(e, t)), t += 2, r.class = m(x(e, t)), t += 2, r.class & ge && (r.class &= _e), J.decode.bytes = t - n, r;
|
|
918
918
|
},
|
|
919
919
|
encodingLength(e) {
|
|
920
920
|
return E.encodingLength(e.name) + 4;
|
|
921
921
|
}
|
|
922
|
-
}),
|
|
922
|
+
}), Y = {
|
|
923
923
|
encode: function(e, t, n) {
|
|
924
924
|
let r = !t;
|
|
925
|
-
r && (t = new Uint8Array(
|
|
925
|
+
r && (t = new Uint8Array(De(e))), n ||= 0;
|
|
926
926
|
let i = n;
|
|
927
|
-
return e.questions ||= [], e.answers ||= [], e.authorities ||= [], e.additionals ||= [], O.encode(e, t, n), n += O.encode.bytes, n = Z(e.questions,
|
|
927
|
+
return e.questions ||= [], e.answers ||= [], e.authorities ||= [], e.additionals ||= [], O.encode(e, t, n), n += O.encode.bytes, n = Z(e.questions, J, t, n), n = Z(e.answers, q, t, n), n = Z(e.authorities, q, t, n), n = Z(e.additionals, q, t, n), Y.encode.bytes = n - i, r && Ee.bytes !== t.length ? t.slice(0, Ee.bytes) : t;
|
|
928
928
|
},
|
|
929
929
|
decode: function(e, t) {
|
|
930
930
|
t ||= 0;
|
|
931
931
|
let n = t, r = O.decode(e, t);
|
|
932
|
-
return t += O.decode.bytes, t =
|
|
932
|
+
return t += O.decode.bytes, t = Oe(r.questions, J, e, t), t = Oe(r.answers, q, e, t), t = Oe(r.authorities, q, e, t), t = Oe(r.additionals, q, e, t), Y.decode.bytes = t - n, r;
|
|
933
933
|
},
|
|
934
934
|
encodingLength: function(e) {
|
|
935
|
-
return O.encodingLength(e) + X(e.questions || [],
|
|
935
|
+
return O.encodingLength(e) + X(e.questions || [], J) + X(e.answers || [], q) + X(e.authorities || [], q) + X(e.additionals || [], q);
|
|
936
936
|
}
|
|
937
937
|
};
|
|
938
|
-
|
|
939
|
-
function
|
|
938
|
+
Y.encode.bytes = 0, Y.decode.bytes = 0;
|
|
939
|
+
function Ce(e, t) {
|
|
940
940
|
if (e.questions) throw Error("Only one .question object expected instead of a .questions array!");
|
|
941
941
|
let n = Object.assign({ type: t }, e);
|
|
942
942
|
return n.question && (n.questions = [n.question], delete n.question), n;
|
|
943
943
|
}
|
|
944
944
|
var we = {
|
|
945
945
|
encode: function(e, t, n) {
|
|
946
|
-
return t =
|
|
946
|
+
return t = Y.encode(Ce(e, "query"), t, n), we.encode.bytes = Y.encode.bytes, t;
|
|
947
947
|
},
|
|
948
948
|
decode: function(e, t) {
|
|
949
|
-
let n =
|
|
950
|
-
return we.decode.bytes =
|
|
949
|
+
let n = Y.decode(e, t);
|
|
950
|
+
return we.decode.bytes = Y.decode.bytes, n.questions && (n.question = n.questions[0], delete n.questions), n;
|
|
951
951
|
},
|
|
952
952
|
encodingLength: function(e) {
|
|
953
|
-
return
|
|
953
|
+
return Y.encodingLength(Ce(e, "query"));
|
|
954
954
|
}
|
|
955
955
|
};
|
|
956
956
|
we.encode.bytes = 0, we.decode.bytes = 0;
|
|
957
957
|
var Te = {
|
|
958
958
|
encode: function(e, t, n) {
|
|
959
|
-
return t =
|
|
959
|
+
return t = Y.encode(Ce(e, "response"), t, n), Te.encode.bytes = Y.encode.bytes, t;
|
|
960
960
|
},
|
|
961
961
|
decode: function(e, t) {
|
|
962
|
-
let n =
|
|
963
|
-
return Te.decode.bytes =
|
|
962
|
+
let n = Y.decode(e, t);
|
|
963
|
+
return Te.decode.bytes = Y.decode.bytes, n.questions && (n.question = n.questions[0], delete n.questions), n;
|
|
964
964
|
},
|
|
965
965
|
encodingLength: function(e) {
|
|
966
|
-
return
|
|
966
|
+
return Y.encodingLength(Ce(e, "response"));
|
|
967
967
|
}
|
|
968
968
|
};
|
|
969
969
|
Te.encode.bytes = 0, Te.decode.bytes = 0;
|
|
970
|
-
var Ee =
|
|
970
|
+
var Ee = Y.encode;
|
|
971
|
+
Y.decode;
|
|
972
|
+
var De = Y.encodingLength;
|
|
971
973
|
function X(e, t) {
|
|
972
974
|
let n = 0;
|
|
973
975
|
for (let r = 0; r < e.length; r++) n += t.encodingLength(e[r]);
|
|
@@ -977,11 +979,11 @@ function Z(e, t, n, r) {
|
|
|
977
979
|
for (let i = 0; i < e.length; i++) t.encode(e[i], n, r), r += t.encode.bytes;
|
|
978
980
|
return r;
|
|
979
981
|
}
|
|
980
|
-
function
|
|
982
|
+
function Oe(e, t, n, r) {
|
|
981
983
|
for (let i = 0; i < e.length; i++) e[i] = t.decode(n, r), r += t.decode.bytes;
|
|
982
984
|
return r;
|
|
983
985
|
}
|
|
984
|
-
function
|
|
986
|
+
function ke(e, t, n, r) {
|
|
985
987
|
if (t.length !== 64) throw Error(`Charset needs to be 64 characters long! (${t.length})`);
|
|
986
988
|
let i = /* @__PURE__ */ new Uint8Array(256), a = /* @__PURE__ */ new Uint8Array(64);
|
|
987
989
|
for (let e = 0; e < 64; e += 1) {
|
|
@@ -1030,16 +1032,16 @@ function Ae(e, t, n, r) {
|
|
|
1030
1032
|
};
|
|
1031
1033
|
return s;
|
|
1032
1034
|
}
|
|
1033
|
-
|
|
1034
|
-
var
|
|
1035
|
+
ke("base64", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", "=", 1);
|
|
1036
|
+
var Ae = ke("base64-url", "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_", "=", 2), je = /* @__PURE__ */ e(((e, t) => {
|
|
1035
1037
|
t.exports = {};
|
|
1036
|
-
})),
|
|
1037
|
-
|
|
1038
|
+
})), Me = typeof global < "u" ? global.AbortError : typeof window < "u" ? window.AbortError : null;
|
|
1039
|
+
Me ||= class extends Error {
|
|
1038
1040
|
constructor(e = "Request aborted.") {
|
|
1039
1041
|
super(e);
|
|
1040
1042
|
}
|
|
1041
|
-
},
|
|
1042
|
-
var Ne = typeof globalThis < "u" && globalThis.URL ||
|
|
1043
|
+
}, Me.prototype.name = "AbortError", Me.prototype.code = "ABORT_ERR";
|
|
1044
|
+
var Ne = typeof globalThis < "u" && globalThis.URL || je().URL, Q = class extends Error {
|
|
1043
1045
|
constructor(e, t, n) {
|
|
1044
1046
|
super("status=" + t + " while requesting " + e + " [" + n + "]"), this.uri = e, this.status = t, this.method = n;
|
|
1045
1047
|
}
|
|
@@ -1053,7 +1055,7 @@ var Ne = typeof globalThis < "u" && globalThis.URL || Me().URL, $ = class extend
|
|
|
1053
1055
|
};
|
|
1054
1056
|
}
|
|
1055
1057
|
};
|
|
1056
|
-
|
|
1058
|
+
Q.prototype.name = "HTTPStatusError", Q.prototype.code = "HTTP_STATUS";
|
|
1057
1059
|
var Pe = class extends Error {
|
|
1058
1060
|
constructor(e, t) {
|
|
1059
1061
|
super(e), this.cause = t;
|
|
@@ -1227,16 +1229,13 @@ function Qe(e) {
|
|
|
1227
1229
|
//#region node_modules/dns-query/lib.browser.mjs
|
|
1228
1230
|
var $e = "application/dns-message";
|
|
1229
1231
|
function et() {}
|
|
1230
|
-
function tt() {
|
|
1231
|
-
throw Error("Only \"doh\" endpoints are supported in the browser");
|
|
1232
|
-
}
|
|
1233
|
-
async function nt(e, t, n, r) {
|
|
1232
|
+
async function tt(e, t, n, r) {
|
|
1234
1233
|
let i = t ? t.localStoragePrefix + t.name : null;
|
|
1235
1234
|
if (i) try {
|
|
1236
1235
|
let e = JSON.parse(localStorage.getItem(i));
|
|
1237
1236
|
if (e && e.time > t.maxTime) return e;
|
|
1238
1237
|
} catch {}
|
|
1239
|
-
let { data: a } = await
|
|
1238
|
+
let { data: a } = await nt(e, "GET", null, n, r), o = {
|
|
1240
1239
|
time: Date.now(),
|
|
1241
1240
|
data: JSON.parse(_(a))
|
|
1242
1241
|
};
|
|
@@ -1247,10 +1246,10 @@ async function nt(e, t, n, r) {
|
|
|
1247
1246
|
}
|
|
1248
1247
|
return o;
|
|
1249
1248
|
}
|
|
1250
|
-
function
|
|
1249
|
+
function nt(e, t, n, r, i) {
|
|
1251
1250
|
return new Promise((a, o) => {
|
|
1252
1251
|
let s = new Ne(e);
|
|
1253
|
-
t === "GET" && n && (s.search = "?dns=" +
|
|
1252
|
+
t === "GET" && n && (s.search = "?dns=" + Ae.decode(n));
|
|
1254
1253
|
let c = s.toString(), l = new XMLHttpRequest();
|
|
1255
1254
|
l.open(t, c, !0), l.setRequestHeader("Accept", $e), t === "POST" && l.setRequestHeader("Content-Type", $e), l.responseType = "arraybuffer", l.timeout = r, l.ontimeout = u, l.onreadystatechange = f, l.onerror = ee, l.onload = d, t === "POST" ? l.send(n) : l.send(), i && i.addEventListener("abort", m);
|
|
1256
1255
|
function u() {
|
|
@@ -1260,7 +1259,7 @@ function rt(e, t, n, r, i) {
|
|
|
1260
1259
|
} catch {}
|
|
1261
1260
|
}
|
|
1262
1261
|
function d() {
|
|
1263
|
-
if (l.status !== 200) p(new
|
|
1262
|
+
if (l.status !== 200) p(new Q(c, l.status, t));
|
|
1264
1263
|
else {
|
|
1265
1264
|
let e;
|
|
1266
1265
|
if (typeof l.response == "string") e = g(l.response);
|
|
@@ -1272,7 +1271,7 @@ function rt(e, t, n, r, i) {
|
|
|
1272
1271
|
}
|
|
1273
1272
|
function f() {
|
|
1274
1273
|
if (l.readyState > 1 && l.status !== 200 && l.status !== 0) {
|
|
1275
|
-
p(new
|
|
1274
|
+
p(new Q(c, l.status, t));
|
|
1276
1275
|
try {
|
|
1277
1276
|
l.abort();
|
|
1278
1277
|
} catch {}
|
|
@@ -1288,25 +1287,22 @@ function rt(e, t, n, r, i) {
|
|
|
1288
1287
|
});
|
|
1289
1288
|
};
|
|
1290
1289
|
function ee() {
|
|
1291
|
-
p(l.status === 200 ? /* @__PURE__ */ Error("Inexplicable XHR Error") : new
|
|
1290
|
+
p(l.status === 200 ? /* @__PURE__ */ Error("Inexplicable XHR Error") : new Q(c, l.status, t));
|
|
1292
1291
|
}
|
|
1293
1292
|
function m() {
|
|
1294
|
-
p(new
|
|
1293
|
+
p(new Me());
|
|
1295
1294
|
try {
|
|
1296
1295
|
l.abort();
|
|
1297
1296
|
} catch {}
|
|
1298
1297
|
}
|
|
1299
1298
|
});
|
|
1300
1299
|
}
|
|
1301
|
-
function
|
|
1302
|
-
return rt(e, t, n, r, i);
|
|
1303
|
-
}
|
|
1304
|
-
function at(e) {
|
|
1300
|
+
function rt(e) {
|
|
1305
1301
|
return e.filter((e) => e.cors || e.endpoint.cors);
|
|
1306
1302
|
}
|
|
1307
1303
|
//#endregion
|
|
1308
1304
|
//#region node_modules/dns-query/resolvers.mjs
|
|
1309
|
-
var
|
|
1305
|
+
var it = {
|
|
1310
1306
|
data: [
|
|
1311
1307
|
{
|
|
1312
1308
|
name: "adfree.usableprivacy.net",
|
|
@@ -2506,8 +2502,8 @@ var ot = {
|
|
|
2506
2502
|
};
|
|
2507
2503
|
//#endregion
|
|
2508
2504
|
//#region node_modules/dns-query/index.mjs
|
|
2509
|
-
function
|
|
2510
|
-
let t = e.time === null || e.time === void 0 ? Date.now() : e.time, n =
|
|
2505
|
+
function at(e) {
|
|
2506
|
+
let t = e.time === null || e.time === void 0 ? Date.now() : e.time, n = rt(e.data.map((e) => (e.endpoint = Qe(Object.assign({ name: e.name }, e.endpoint)), e))), r = n.map((e) => e.endpoint);
|
|
2511
2507
|
return {
|
|
2512
2508
|
data: {
|
|
2513
2509
|
resolvers: n,
|
|
@@ -2518,31 +2514,8 @@ function st(e) {
|
|
|
2518
2514
|
time: t
|
|
2519
2515
|
};
|
|
2520
2516
|
}
|
|
2521
|
-
var
|
|
2522
|
-
function
|
|
2523
|
-
let t = Object.assign({ type: "query" }, e);
|
|
2524
|
-
return delete t.question, t.questions = [], e.question && t.questions.push(e.question), t;
|
|
2525
|
-
}
|
|
2526
|
-
function ut(e, t, n, r) {
|
|
2527
|
-
return r && r.aborted ? Promise.reject(new Q()) : e.protocol === "udp4:" || e.protocol === "udp6:" ? tt(e, t, n, r) : dt(e, t, n, r);
|
|
2528
|
-
}
|
|
2529
|
-
function dt(e, t, n, r) {
|
|
2530
|
-
return it(e.url, e.method, Ee(Object.assign({ flags: 256 }, t)), n, r).then(function(e) {
|
|
2531
|
-
let t = e.data, n = e.response, r = e.error;
|
|
2532
|
-
if (r === void 0) {
|
|
2533
|
-
if (t.length === 0) r = new Pe("Empty.");
|
|
2534
|
-
else try {
|
|
2535
|
-
let e = De(t);
|
|
2536
|
-
return e.response = n, e;
|
|
2537
|
-
} catch (e) {
|
|
2538
|
-
r = new Pe("Invalid packet (cause=" + e.message + ")", e);
|
|
2539
|
-
}
|
|
2540
|
-
}
|
|
2541
|
-
throw Object.assign(r, { response: n });
|
|
2542
|
-
});
|
|
2543
|
-
}
|
|
2544
|
-
var ft = new Ne("https://martinheidegger.github.io/dns-query/resolvers.json");
|
|
2545
|
-
function pt(e) {
|
|
2517
|
+
var ot = at(it), st = new Ne("https://martinheidegger.github.io/dns-query/resolvers.json");
|
|
2518
|
+
function ct(e) {
|
|
2546
2519
|
return /^@/.test(e);
|
|
2547
2520
|
}
|
|
2548
2521
|
new class {
|
|
@@ -2550,36 +2523,36 @@ new class {
|
|
|
2550
2523
|
this.opts = Object.assign({
|
|
2551
2524
|
timeout: 5e3,
|
|
2552
2525
|
update: !0,
|
|
2553
|
-
updateURL:
|
|
2526
|
+
updateURL: st,
|
|
2554
2527
|
persist: !1,
|
|
2555
2528
|
localStoragePrefix: "dnsquery_",
|
|
2556
2529
|
maxAge: 3e5
|
|
2557
2530
|
}, e), this._dataP = null;
|
|
2558
2531
|
}
|
|
2559
2532
|
_data(e, t) {
|
|
2560
|
-
return !e && this._dataP !== null ? this._dataP.then((e) => e.time < Date.now() - this.opts.maxAge ? this._data(!0, e) : e) : (this._dataP = this.opts.update ?
|
|
2533
|
+
return !e && this._dataP !== null ? this._dataP.then((e) => e.time < Date.now() - this.opts.maxAge ? this._data(!0, e) : e) : (this._dataP = this.opts.update ? tt(this.opts.updateURL, this.opts.persist ? {
|
|
2561
2534
|
name: "resolvers.json",
|
|
2562
2535
|
localStoragePrefix: this.opts.localStoragePrefix,
|
|
2563
2536
|
maxTime: Date.now() - this.opts.maxAge
|
|
2564
|
-
} : null, this.opts.timeout).then((e) =>
|
|
2537
|
+
} : null, this.opts.timeout).then((e) => at({
|
|
2565
2538
|
data: e.data.resolvers,
|
|
2566
2539
|
time: e.time
|
|
2567
|
-
})).catch(() => t ||
|
|
2540
|
+
})).catch(() => t || ot) : Promise.resolve(ot), this._dataP);
|
|
2568
2541
|
}
|
|
2569
2542
|
data() {
|
|
2570
2543
|
return this._data(!1).then((e) => e.data);
|
|
2571
2544
|
}
|
|
2572
2545
|
endpoints(e) {
|
|
2573
2546
|
if (e == null) return this.data().then((e) => e.endpoints);
|
|
2574
|
-
if (e === "doh" && (e =
|
|
2547
|
+
if (e === "doh" && (e = lt), e === "dns" && (e = ut), typeof e == "function") return this.data().then((t) => t.endpoints.filter(e));
|
|
2575
2548
|
if (typeof e == "string" || typeof e[Symbol.iterator] != "function") return Promise.reject(/* @__PURE__ */ Error(`Endpoints (${e}) needs to be iterable (array).`));
|
|
2576
|
-
if (e = Array.from(e).filter(Boolean), e.findIndex(
|
|
2549
|
+
if (e = Array.from(e).filter(Boolean), e.findIndex(ct) === -1) try {
|
|
2577
2550
|
return Promise.resolve(e.map(Qe));
|
|
2578
2551
|
} catch (e) {
|
|
2579
2552
|
return Promise.reject(e);
|
|
2580
2553
|
}
|
|
2581
2554
|
return this.data().then((t) => e.map((e) => {
|
|
2582
|
-
if (
|
|
2555
|
+
if (ct(e)) {
|
|
2583
2556
|
let n = t.endpointByName[e.substring(1)];
|
|
2584
2557
|
if (!n) throw Error(`Endpoint ${e} is not known.`);
|
|
2585
2558
|
return n;
|
|
@@ -2588,36 +2561,61 @@ new class {
|
|
|
2588
2561
|
}));
|
|
2589
2562
|
}
|
|
2590
2563
|
}();
|
|
2591
|
-
function
|
|
2592
|
-
return
|
|
2564
|
+
function lt(e) {
|
|
2565
|
+
return e.protocol === "https:" || e.protocol === "http:";
|
|
2593
2566
|
}
|
|
2594
|
-
function
|
|
2595
|
-
return
|
|
2567
|
+
function ut(e) {
|
|
2568
|
+
return e.protocol === "udp4:" || e.protocol === "udp6:";
|
|
2596
2569
|
}
|
|
2597
|
-
|
|
2598
|
-
|
|
2599
|
-
|
|
2600
|
-
|
|
2601
|
-
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2570
|
+
//#endregion
|
|
2571
|
+
//#region src/crypto.js
|
|
2572
|
+
var $ = {
|
|
2573
|
+
name: "AES-GCM",
|
|
2574
|
+
length: 256,
|
|
2575
|
+
tagLength: 128,
|
|
2576
|
+
ivLength: 12,
|
|
2577
|
+
key: "Hello, World!"
|
|
2578
|
+
}, dt = new TextEncoder(), ft = new TextDecoder(), pt;
|
|
2579
|
+
function mt() {
|
|
2580
|
+
return pt ||= crypto.subtle.digest("SHA-256", dt.encode($.key)).then((e) => crypto.subtle.importKey("raw", e, { name: $.name }, !1, ["encrypt", "decrypt"])), pt;
|
|
2605
2581
|
}
|
|
2606
|
-
function
|
|
2607
|
-
|
|
2608
|
-
return ut(r, t, n.timeout, n.signal).then((e) => (e.endpoint = r.toString(), e), (i) => {
|
|
2609
|
-
if (i.name === "AbortError" || n.retries === 0) throw i.endpoint = r.toString(), i;
|
|
2610
|
-
return n.retries > 0 && --n.retries, _t(e, t, n);
|
|
2611
|
-
});
|
|
2582
|
+
function ht(e) {
|
|
2583
|
+
return Array.from(e, (e) => e.toString(16).padStart(2, "0")).join("");
|
|
2612
2584
|
}
|
|
2613
|
-
function
|
|
2614
|
-
|
|
2585
|
+
function gt(e) {
|
|
2586
|
+
if (e.length % 2 != 0) throw Error("Invalid ciphertext");
|
|
2587
|
+
let t = new Uint8Array(e.length / 2);
|
|
2588
|
+
for (let n = 0; n < t.length; n++) {
|
|
2589
|
+
let r = Number.parseInt(e.slice(n * 2, n * 2 + 2), 16);
|
|
2590
|
+
if (Number.isNaN(r)) throw Error("Invalid ciphertext");
|
|
2591
|
+
t[n] = r;
|
|
2592
|
+
}
|
|
2593
|
+
return t;
|
|
2615
2594
|
}
|
|
2616
|
-
function
|
|
2617
|
-
|
|
2595
|
+
async function _t(e) {
|
|
2596
|
+
let t = crypto.getRandomValues(new Uint8Array($.ivLength)), n = await crypto.subtle.encrypt({
|
|
2597
|
+
name: $.name,
|
|
2598
|
+
iv: t,
|
|
2599
|
+
tagLength: $.tagLength
|
|
2600
|
+
}, await mt(), dt.encode(e)), r = new Uint8Array($.ivLength + n.byteLength);
|
|
2601
|
+
return r.set(t), r.set(new Uint8Array(n), $.ivLength), ht(r);
|
|
2602
|
+
}
|
|
2603
|
+
async function vt(e) {
|
|
2604
|
+
let t = gt(e);
|
|
2605
|
+
if (t.length <= $.ivLength) throw Error("Invalid ciphertext");
|
|
2606
|
+
let n = await crypto.subtle.decrypt({
|
|
2607
|
+
name: $.name,
|
|
2608
|
+
iv: t.slice(0, $.ivLength),
|
|
2609
|
+
tagLength: $.tagLength
|
|
2610
|
+
}, await mt(), t.slice($.ivLength));
|
|
2611
|
+
return ft.decode(n);
|
|
2618
2612
|
}
|
|
2619
2613
|
//#endregion
|
|
2620
2614
|
//#region src/index.js
|
|
2621
|
-
|
|
2615
|
+
(async () => {
|
|
2616
|
+
let e = await _t("Fizz Buzz");
|
|
2617
|
+
console.log("Encrypted:", e);
|
|
2618
|
+
let t = await vt(e);
|
|
2619
|
+
console.log("Decrypted:", t);
|
|
2620
|
+
})();
|
|
2622
2621
|
//#endregion
|
|
2623
|
-
export { gt as query };
|