const e = -2,
  t = -3,
  n = -5,
  i = [0, 1, 3, 7, 15, 31, 63, 127, 255, 511, 1023, 2047, 4095, 8191, 16383, 32767, 65535],
  r = [
    96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8, 112, 0, 8, 48, 0, 9, 192, 80, 7,
    10, 0, 8, 96, 0, 8, 32, 0, 9, 160, 0, 8, 0, 0, 8, 128, 0, 8, 64, 0, 9, 224, 80, 7, 6, 0, 8, 88,
    0, 8, 24, 0, 9, 144, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9, 208, 81, 7, 17, 0, 8, 104, 0, 8, 40,
    0, 9, 176, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 240, 80, 7, 4, 0, 8, 84, 0, 8, 20, 85, 8, 227,
    83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 200, 81, 7, 13, 0, 8, 100, 0, 8, 36, 0, 9, 168, 0, 8, 4,
    0, 8, 132, 0, 8, 68, 0, 9, 232, 80, 7, 8, 0, 8, 92, 0, 8, 28, 0, 9, 152, 84, 7, 83, 0, 8, 124,
    0, 8, 60, 0, 9, 216, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 184, 0, 8, 12, 0, 8, 140, 0, 8, 76,
    0, 9, 248, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35, 0, 8, 114, 0, 8, 50, 0, 9, 196,
    81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 164, 0, 8, 2, 0, 8, 130, 0, 8, 66, 0, 9, 228, 80, 7, 7, 0,
    8, 90, 0, 8, 26, 0, 9, 148, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9, 212, 82, 7, 19, 0, 8, 106, 0,
    8, 42, 0, 9, 180, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 244, 80, 7, 5, 0, 8, 86, 0, 8, 22, 192,
    8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 204, 81, 7, 15, 0, 8, 102, 0, 8, 38, 0, 9, 172, 0,
    8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 236, 80, 7, 9, 0, 8, 94, 0, 8, 30, 0, 9, 156, 84, 7, 99, 0, 8,
    126, 0, 8, 62, 0, 9, 220, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 188, 0, 8, 14, 0, 8, 142, 0, 8,
    78, 0, 9, 252, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31, 0, 8, 113, 0, 8, 49, 0, 9,
    194, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 162, 0, 8, 1, 0, 8, 129, 0, 8, 65, 0, 9, 226, 80, 7,
    6, 0, 8, 89, 0, 8, 25, 0, 9, 146, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9, 210, 81, 7, 17, 0, 8,
    105, 0, 8, 41, 0, 9, 178, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 242, 80, 7, 4, 0, 8, 85, 0, 8, 21,
    80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 202, 81, 7, 13, 0, 8, 101, 0, 8, 37, 0, 9,
    170, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 234, 80, 7, 8, 0, 8, 93, 0, 8, 29, 0, 9, 154, 84, 7,
    83, 0, 8, 125, 0, 8, 61, 0, 9, 218, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 186, 0, 8, 13, 0, 8,
    141, 0, 8, 77, 0, 9, 250, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35, 0, 8, 115, 0, 8,
    51, 0, 9, 198, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 166, 0, 8, 3, 0, 8, 131, 0, 8, 67, 0, 9,
    230, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 150, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9, 214, 82, 7,
    19, 0, 8, 107, 0, 8, 43, 0, 9, 182, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 246, 80, 7, 5, 0, 8,
    87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 206, 81, 7, 15, 0, 8, 103, 0, 8,
    39, 0, 9, 174, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 238, 80, 7, 9, 0, 8, 95, 0, 8, 31, 0, 9, 158,
    84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 222, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 190, 0, 8, 15,
    0, 8, 143, 0, 8, 79, 0, 9, 254, 96, 7, 256, 0, 8, 80, 0, 8, 16, 84, 8, 115, 82, 7, 31, 0, 8,
    112, 0, 8, 48, 0, 9, 193, 80, 7, 10, 0, 8, 96, 0, 8, 32, 0, 9, 161, 0, 8, 0, 0, 8, 128, 0, 8,
    64, 0, 9, 225, 80, 7, 6, 0, 8, 88, 0, 8, 24, 0, 9, 145, 83, 7, 59, 0, 8, 120, 0, 8, 56, 0, 9,
    209, 81, 7, 17, 0, 8, 104, 0, 8, 40, 0, 9, 177, 0, 8, 8, 0, 8, 136, 0, 8, 72, 0, 9, 241, 80, 7,
    4, 0, 8, 84, 0, 8, 20, 85, 8, 227, 83, 7, 43, 0, 8, 116, 0, 8, 52, 0, 9, 201, 81, 7, 13, 0, 8,
    100, 0, 8, 36, 0, 9, 169, 0, 8, 4, 0, 8, 132, 0, 8, 68, 0, 9, 233, 80, 7, 8, 0, 8, 92, 0, 8, 28,
    0, 9, 153, 84, 7, 83, 0, 8, 124, 0, 8, 60, 0, 9, 217, 82, 7, 23, 0, 8, 108, 0, 8, 44, 0, 9, 185,
    0, 8, 12, 0, 8, 140, 0, 8, 76, 0, 9, 249, 80, 7, 3, 0, 8, 82, 0, 8, 18, 85, 8, 163, 83, 7, 35,
    0, 8, 114, 0, 8, 50, 0, 9, 197, 81, 7, 11, 0, 8, 98, 0, 8, 34, 0, 9, 165, 0, 8, 2, 0, 8, 130, 0,
    8, 66, 0, 9, 229, 80, 7, 7, 0, 8, 90, 0, 8, 26, 0, 9, 149, 84, 7, 67, 0, 8, 122, 0, 8, 58, 0, 9,
    213, 82, 7, 19, 0, 8, 106, 0, 8, 42, 0, 9, 181, 0, 8, 10, 0, 8, 138, 0, 8, 74, 0, 9, 245, 80, 7,
    5, 0, 8, 86, 0, 8, 22, 192, 8, 0, 83, 7, 51, 0, 8, 118, 0, 8, 54, 0, 9, 205, 81, 7, 15, 0, 8,
    102, 0, 8, 38, 0, 9, 173, 0, 8, 6, 0, 8, 134, 0, 8, 70, 0, 9, 237, 80, 7, 9, 0, 8, 94, 0, 8, 30,
    0, 9, 157, 84, 7, 99, 0, 8, 126, 0, 8, 62, 0, 9, 221, 82, 7, 27, 0, 8, 110, 0, 8, 46, 0, 9, 189,
    0, 8, 14, 0, 8, 142, 0, 8, 78, 0, 9, 253, 96, 7, 256, 0, 8, 81, 0, 8, 17, 85, 8, 131, 82, 7, 31,
    0, 8, 113, 0, 8, 49, 0, 9, 195, 80, 7, 10, 0, 8, 97, 0, 8, 33, 0, 9, 163, 0, 8, 1, 0, 8, 129, 0,
    8, 65, 0, 9, 227, 80, 7, 6, 0, 8, 89, 0, 8, 25, 0, 9, 147, 83, 7, 59, 0, 8, 121, 0, 8, 57, 0, 9,
    211, 81, 7, 17, 0, 8, 105, 0, 8, 41, 0, 9, 179, 0, 8, 9, 0, 8, 137, 0, 8, 73, 0, 9, 243, 80, 7,
    4, 0, 8, 85, 0, 8, 21, 80, 8, 258, 83, 7, 43, 0, 8, 117, 0, 8, 53, 0, 9, 203, 81, 7, 13, 0, 8,
    101, 0, 8, 37, 0, 9, 171, 0, 8, 5, 0, 8, 133, 0, 8, 69, 0, 9, 235, 80, 7, 8, 0, 8, 93, 0, 8, 29,
    0, 9, 155, 84, 7, 83, 0, 8, 125, 0, 8, 61, 0, 9, 219, 82, 7, 23, 0, 8, 109, 0, 8, 45, 0, 9, 187,
    0, 8, 13, 0, 8, 141, 0, 8, 77, 0, 9, 251, 80, 7, 3, 0, 8, 83, 0, 8, 19, 85, 8, 195, 83, 7, 35,
    0, 8, 115, 0, 8, 51, 0, 9, 199, 81, 7, 11, 0, 8, 99, 0, 8, 35, 0, 9, 167, 0, 8, 3, 0, 8, 131, 0,
    8, 67, 0, 9, 231, 80, 7, 7, 0, 8, 91, 0, 8, 27, 0, 9, 151, 84, 7, 67, 0, 8, 123, 0, 8, 59, 0, 9,
    215, 82, 7, 19, 0, 8, 107, 0, 8, 43, 0, 9, 183, 0, 8, 11, 0, 8, 139, 0, 8, 75, 0, 9, 247, 80, 7,
    5, 0, 8, 87, 0, 8, 23, 192, 8, 0, 83, 7, 51, 0, 8, 119, 0, 8, 55, 0, 9, 207, 81, 7, 15, 0, 8,
    103, 0, 8, 39, 0, 9, 175, 0, 8, 7, 0, 8, 135, 0, 8, 71, 0, 9, 239, 80, 7, 9, 0, 8, 95, 0, 8, 31,
    0, 9, 159, 84, 7, 99, 0, 8, 127, 0, 8, 63, 0, 9, 223, 82, 7, 27, 0, 8, 111, 0, 8, 47, 0, 9, 191,
    0, 8, 15, 0, 8, 143, 0, 8, 79, 0, 9, 255,
  ],
  a = [
    80, 5, 1, 87, 5, 257, 83, 5, 17, 91, 5, 4097, 81, 5, 5, 89, 5, 1025, 85, 5, 65, 93, 5, 16385,
    80, 5, 3, 88, 5, 513, 84, 5, 33, 92, 5, 8193, 82, 5, 9, 90, 5, 2049, 86, 5, 129, 192, 5, 24577,
    80, 5, 2, 87, 5, 385, 83, 5, 25, 91, 5, 6145, 81, 5, 7, 89, 5, 1537, 85, 5, 97, 93, 5, 24577,
    80, 5, 4, 88, 5, 769, 84, 5, 49, 92, 5, 12289, 82, 5, 13, 90, 5, 3073, 86, 5, 193, 192, 5,
    24577,
  ],
  s = [
    3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131,
    163, 195, 227, 258, 0, 0,
  ],
  o = [
    0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 112, 112,
  ],
  l = [
    1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049,
    3073, 4097, 6145, 8193, 12289, 16385, 24577,
  ],
  c = [
    0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13,
    13,
  ],
  u = 15;
function d() {
  let e, i, r, a, d, f;
  function h(e, i, s, o, l, c, h, w, _, b, p) {
    let m, g, y, x, k, v, S, z, A, U, D, E, T, F, O;
    (U = 0), (k = s);
    do {
      r[e[i + U]]++, U++, k--;
    } while (0 !== k);
    if (r[0] == s) return (h[0] = -1), (w[0] = 0), 0;
    for (z = w[0], v = 1; v <= u && 0 === r[v]; v++);
    for (S = v, z < v && (z = v), k = u; 0 !== k && 0 === r[k]; k--);
    for (y = k, z > k && (z = k), w[0] = z, F = 1 << v; v < k; v++, F <<= 1)
      if ((F -= r[v]) < 0) return t;
    if ((F -= r[k]) < 0) return t;
    for (r[k] += F, f[1] = v = 0, U = 1, T = 2; 0 != --k; ) (f[T] = v += r[U]), T++, U++;
    (k = 0), (U = 0);
    do {
      0 !== (v = e[i + U]) && (p[f[v]++] = k), U++;
    } while (++k < s);
    for (s = f[y], f[0] = k = 0, U = 0, x = -1, E = -z, d[0] = 0, D = 0, O = 0; S <= y; S++)
      for (m = r[S]; 0 != m--; ) {
        while (S > E + z) {
          if (
            (x++,
            (E += z),
            (O = y - E),
            (O = O > z ? z : O),
            (g = 1 << (v = S - E)) > m + 1 && ((g -= m + 1), (T = S), v < O))
          )
            while (++v < O && !((g <<= 1) <= r[++T])) g -= r[T];
          if (((O = 1 << v), b[0] + O > 1440)) return t;
          (d[x] = D = b[0]),
            (b[0] += O),
            0 !== x
              ? ((f[x] = k),
                (a[0] = v),
                (a[1] = z),
                (v = k >>> (E - z)),
                (a[2] = D - d[x - 1] - v),
                _.set(a, 3 * (d[x - 1] + v)))
              : (h[0] = D);
        }
        for (
          a[1] = S - E,
            U >= s
              ? (a[0] = 192)
              : p[U] < o
                ? ((a[0] = p[U] < 256 ? 0 : 96), (a[2] = p[U++]))
                : ((a[0] = c[p[U] - o] + 16 + 64), (a[2] = l[p[U++] - o])),
            g = 1 << (S - E),
            v = k >>> E;
          v < O;
          v += g
        )
          _.set(a, 3 * (D + v));
        for (v = 1 << (S - 1); k & v; v >>>= 1) k ^= v;
        for (k ^= v, A = (1 << E) - 1; (k & A) != f[x]; ) x--, (E -= z), (A = (1 << E) - 1);
      }
    return 0 !== F && 1 != y ? n : 0;
  }
  function w(t) {
    let n;
    for (
      e ||
        ((e = []),
        (i = []),
        (r = new Int32Array(16)),
        (a = []),
        (d = new Int32Array(u)),
        (f = new Int32Array(16))),
        i.length < t && (i = []),
        n = 0;
      n < t;
      n++
    )
      i[n] = 0;
    for (n = 0; n < 16; n++) r[n] = 0;
    for (n = 0; n < 3; n++) a[n] = 0;
    d.set(r.subarray(0, u), 0), f.set(r.subarray(0, 16), 0);
  }
  (this.inflate_trees_bits = (r, a, s, o, l) => {
    let c;
    return (
      w(19),
      (e[0] = 0),
      (c = h(r, 0, 19, 19, null, null, s, a, o, e, i)),
      c == t
        ? (l.msg = "oversubscribed dynamic bit lengths tree")
        : (c != n && 0 !== a[0]) || ((l.msg = "incomplete dynamic bit lengths tree"), (c = t)),
      c
    );
  }),
    (this.inflate_trees_dynamic = (r, a, u, d, f, _, b, p, m) => {
      let g;
      return (
        w(288),
        (e[0] = 0),
        (g = h(u, 0, r, 257, s, o, _, d, p, e, i)),
        0 != g || 0 === d[0]
          ? (g == t
              ? (m.msg = "oversubscribed literal/length tree")
              : -4 != g && ((m.msg = "incomplete literal/length tree"), (g = t)),
            g)
          : (w(288),
            (g = h(u, r, a, 0, l, c, b, f, p, e, i)),
            0 != g || (0 === f[0] && r > 257)
              ? (g == t
                  ? (m.msg = "oversubscribed distance tree")
                  : g == n
                    ? ((m.msg = "incomplete distance tree"), (g = t))
                    : -4 != g && ((m.msg = "empty distance tree with lengths"), (g = t)),
                g)
              : 0)
      );
    });
}
d.inflate_trees_fixed = (e, t, n, i) => ((e[0] = 9), (t[0] = 5), (n[0] = r), (i[0] = a), 0);
function f() {
  let r,
    a,
    s,
    o,
    l = 0,
    c = 0,
    u = 0,
    d = 0,
    f = 0,
    h = 0,
    w = 0,
    _ = 0,
    b = 0,
    p = 0;
  function m(e, n, r, a, s, o, l, c) {
    let u, d, f, h, w, _, b, p, m, g, y, x, k, v, S, z;
    (b = c.next_in_index),
      (p = c.avail_in),
      (w = l.bitb),
      (_ = l.bitk),
      (m = l.write),
      (g = m < l.read ? l.read - m - 1 : l.end - m),
      (y = i[e]),
      (x = i[n]);
    do {
      while (_ < 20) p--, (w |= (255 & c.read_byte(b++)) << _), (_ += 8);
      if (((u = w & y), (d = r), (f = a), (z = 3 * (f + u)), 0 !== (h = d[z])))
        for (;;) {
          if (((w >>= d[z + 1]), (_ -= d[z + 1]), 16 & h)) {
            for (h &= 15, k = d[z + 2] + (w & i[h]), w >>= h, _ -= h; _ < 15; )
              p--, (w |= (255 & c.read_byte(b++)) << _), (_ += 8);
            for (u = w & x, d = s, f = o, z = 3 * (f + u), h = d[z]; ; ) {
              if (((w >>= d[z + 1]), (_ -= d[z + 1]), 16 & h)) {
                for (h &= 15; _ < h; ) p--, (w |= (255 & c.read_byte(b++)) << _), (_ += 8);
                if (((v = d[z + 2] + (w & i[h])), (w >>= h), (_ -= h), (g -= k), m >= v))
                  (S = m - v),
                    m - S > 0 && 2 > m - S
                      ? ((l.win[m++] = l.win[S++]), (l.win[m++] = l.win[S++]), (k -= 2))
                      : (l.win.set(l.win.subarray(S, S + 2), m), (m += 2), (S += 2), (k -= 2));
                else {
                  S = m - v;
                  do {
                    S += l.end;
                  } while (S < 0);
                  if (((h = l.end - S), k > h)) {
                    if (((k -= h), m - S > 0 && h > m - S))
                      do {
                        l.win[m++] = l.win[S++];
                      } while (0 != --h);
                    else l.win.set(l.win.subarray(S, S + h), m), (m += h), (S += h), (h = 0);
                    S = 0;
                  }
                }
                if (m - S > 0 && k > m - S)
                  do {
                    l.win[m++] = l.win[S++];
                  } while (0 != --k);
                else l.win.set(l.win.subarray(S, S + k), m), (m += k), (S += k), (k = 0);
                break;
              }
              if (64 & h)
                return (
                  (c.msg = "invalid distance code"),
                  (k = c.avail_in - p),
                  (k = _ >> 3 < k ? _ >> 3 : k),
                  (p += k),
                  (b -= k),
                  (_ -= k << 3),
                  (l.bitb = w),
                  (l.bitk = _),
                  (c.avail_in = p),
                  (c.total_in += b - c.next_in_index),
                  (c.next_in_index = b),
                  (l.write = m),
                  t
                );
              (u += d[z + 2]), (u += w & i[h]), (z = 3 * (f + u)), (h = d[z]);
            }
            break;
          }
          if (64 & h)
            return 32 & h
              ? ((k = c.avail_in - p),
                (k = _ >> 3 < k ? _ >> 3 : k),
                (p += k),
                (b -= k),
                (_ -= k << 3),
                (l.bitb = w),
                (l.bitk = _),
                (c.avail_in = p),
                (c.total_in += b - c.next_in_index),
                (c.next_in_index = b),
                (l.write = m),
                1)
              : ((c.msg = "invalid literal/length code"),
                (k = c.avail_in - p),
                (k = _ >> 3 < k ? _ >> 3 : k),
                (p += k),
                (b -= k),
                (_ -= k << 3),
                (l.bitb = w),
                (l.bitk = _),
                (c.avail_in = p),
                (c.total_in += b - c.next_in_index),
                (c.next_in_index = b),
                (l.write = m),
                t);
          if (((u += d[z + 2]), (u += w & i[h]), (z = 3 * (f + u)), 0 === (h = d[z]))) {
            (w >>= d[z + 1]), (_ -= d[z + 1]), (l.win[m++] = d[z + 2]), g--;
            break;
          }
        }
      else (w >>= d[z + 1]), (_ -= d[z + 1]), (l.win[m++] = d[z + 2]), g--;
    } while (g >= 258 && p >= 10);
    return (
      (k = c.avail_in - p),
      (k = _ >> 3 < k ? _ >> 3 : k),
      (p += k),
      (b -= k),
      (_ -= k << 3),
      (l.bitb = w),
      (l.bitk = _),
      (c.avail_in = p),
      (c.total_in += b - c.next_in_index),
      (c.next_in_index = b),
      (l.write = m),
      0
    );
  }
  (this.init = (e, t, n, i, l, c) => {
    (r = 0), (w = e), (_ = t), (s = n), (b = i), (o = l), (p = c), (a = null);
  }),
    (this.proc = (n, g, y) => {
      let x,
        k,
        v,
        S,
        z,
        A,
        U,
        D = 0,
        E = 0,
        T = 0;
      for (
        T = g.next_in_index,
          S = g.avail_in,
          D = n.bitb,
          E = n.bitk,
          z = n.write,
          A = z < n.read ? n.read - z - 1 : n.end - z;
        ;
      )
        switch (r) {
          case 0:
            if (
              A >= 258 &&
              S >= 10 &&
              ((n.bitb = D),
              (n.bitk = E),
              (g.avail_in = S),
              (g.total_in += T - g.next_in_index),
              (g.next_in_index = T),
              (n.write = z),
              (y = m(w, _, s, b, o, p, n, g)),
              (T = g.next_in_index),
              (S = g.avail_in),
              (D = n.bitb),
              (E = n.bitk),
              (z = n.write),
              (A = z < n.read ? n.read - z - 1 : n.end - z),
              0 != y)
            ) {
              r = 1 == y ? 7 : 9;
              break;
            }
            (u = w), (a = s), (c = b), (r = 1);
          case 1:
            for (x = u; E < x; ) {
              if (0 === S)
                return (
                  (n.bitb = D),
                  (n.bitk = E),
                  (g.avail_in = S),
                  (g.total_in += T - g.next_in_index),
                  (g.next_in_index = T),
                  (n.write = z),
                  n.inflate_flush(g, y)
                );
              (y = 0), S--, (D |= (255 & g.read_byte(T++)) << E), (E += 8);
            }
            if (
              ((k = 3 * (c + (D & i[x]))), (D >>>= a[k + 1]), (E -= a[k + 1]), (v = a[k]), 0 === v)
            ) {
              (d = a[k + 2]), (r = 6);
              break;
            }
            if (16 & v) {
              (f = 15 & v), (l = a[k + 2]), (r = 2);
              break;
            }
            if (!(64 & v)) {
              (u = v), (c = k / 3 + a[k + 2]);
              break;
            }
            if (32 & v) {
              r = 7;
              break;
            }
            return (
              (r = 9),
              (g.msg = "invalid literal/length code"),
              (y = t),
              (n.bitb = D),
              (n.bitk = E),
              (g.avail_in = S),
              (g.total_in += T - g.next_in_index),
              (g.next_in_index = T),
              (n.write = z),
              n.inflate_flush(g, y)
            );
          case 2:
            for (x = f; E < x; ) {
              if (0 === S)
                return (
                  (n.bitb = D),
                  (n.bitk = E),
                  (g.avail_in = S),
                  (g.total_in += T - g.next_in_index),
                  (g.next_in_index = T),
                  (n.write = z),
                  n.inflate_flush(g, y)
                );
              (y = 0), S--, (D |= (255 & g.read_byte(T++)) << E), (E += 8);
            }
            (l += D & i[x]), (D >>= x), (E -= x), (u = _), (a = o), (c = p), (r = 3);
          case 3:
            for (x = u; E < x; ) {
              if (0 === S)
                return (
                  (n.bitb = D),
                  (n.bitk = E),
                  (g.avail_in = S),
                  (g.total_in += T - g.next_in_index),
                  (g.next_in_index = T),
                  (n.write = z),
                  n.inflate_flush(g, y)
                );
              (y = 0), S--, (D |= (255 & g.read_byte(T++)) << E), (E += 8);
            }
            if (
              ((k = 3 * (c + (D & i[x]))), (D >>= a[k + 1]), (E -= a[k + 1]), (v = a[k]), 16 & v)
            ) {
              (f = 15 & v), (h = a[k + 2]), (r = 4);
              break;
            }
            if (!(64 & v)) {
              (u = v), (c = k / 3 + a[k + 2]);
              break;
            }
            return (
              (r = 9),
              (g.msg = "invalid distance code"),
              (y = t),
              (n.bitb = D),
              (n.bitk = E),
              (g.avail_in = S),
              (g.total_in += T - g.next_in_index),
              (g.next_in_index = T),
              (n.write = z),
              n.inflate_flush(g, y)
            );
          case 4:
            for (x = f; E < x; ) {
              if (0 === S)
                return (
                  (n.bitb = D),
                  (n.bitk = E),
                  (g.avail_in = S),
                  (g.total_in += T - g.next_in_index),
                  (g.next_in_index = T),
                  (n.write = z),
                  n.inflate_flush(g, y)
                );
              (y = 0), S--, (D |= (255 & g.read_byte(T++)) << E), (E += 8);
            }
            (h += D & i[x]), (D >>= x), (E -= x), (r = 5);
          case 5:
            for (U = z - h; U < 0; ) U += n.end;
            while (0 !== l) {
              if (
                0 === A &&
                (z == n.end &&
                  0 !== n.read &&
                  ((z = 0), (A = z < n.read ? n.read - z - 1 : n.end - z)),
                0 === A &&
                  ((n.write = z),
                  (y = n.inflate_flush(g, y)),
                  (z = n.write),
                  (A = z < n.read ? n.read - z - 1 : n.end - z),
                  z == n.end &&
                    0 !== n.read &&
                    ((z = 0), (A = z < n.read ? n.read - z - 1 : n.end - z)),
                  0 === A))
              )
                return (
                  (n.bitb = D),
                  (n.bitk = E),
                  (g.avail_in = S),
                  (g.total_in += T - g.next_in_index),
                  (g.next_in_index = T),
                  (n.write = z),
                  n.inflate_flush(g, y)
                );
              (n.win[z++] = n.win[U++]), A--, U == n.end && (U = 0), l--;
            }
            r = 0;
            break;
          case 6:
            if (
              0 === A &&
              (z == n.end &&
                0 !== n.read &&
                ((z = 0), (A = z < n.read ? n.read - z - 1 : n.end - z)),
              0 === A &&
                ((n.write = z),
                (y = n.inflate_flush(g, y)),
                (z = n.write),
                (A = z < n.read ? n.read - z - 1 : n.end - z),
                z == n.end &&
                  0 !== n.read &&
                  ((z = 0), (A = z < n.read ? n.read - z - 1 : n.end - z)),
                0 === A))
            )
              return (
                (n.bitb = D),
                (n.bitk = E),
                (g.avail_in = S),
                (g.total_in += T - g.next_in_index),
                (g.next_in_index = T),
                (n.write = z),
                n.inflate_flush(g, y)
              );
            (y = 0), (n.win[z++] = d), A--, (r = 0);
            break;
          case 7:
            if (
              (E > 7 && ((E -= 8), S++, T--),
              (n.write = z),
              (y = n.inflate_flush(g, y)),
              (z = n.write),
              (A = z < n.read ? n.read - z - 1 : n.end - z),
              n.read != n.write)
            )
              return (
                (n.bitb = D),
                (n.bitk = E),
                (g.avail_in = S),
                (g.total_in += T - g.next_in_index),
                (g.next_in_index = T),
                (n.write = z),
                n.inflate_flush(g, y)
              );
            r = 8;
          case 8:
            return (
              (y = 1),
              (n.bitb = D),
              (n.bitk = E),
              (g.avail_in = S),
              (g.total_in += T - g.next_in_index),
              (g.next_in_index = T),
              (n.write = z),
              n.inflate_flush(g, y)
            );
          case 9:
            return (
              (y = t),
              (n.bitb = D),
              (n.bitk = E),
              (g.avail_in = S),
              (g.total_in += T - g.next_in_index),
              (g.next_in_index = T),
              (n.write = z),
              n.inflate_flush(g, y)
            );
          default:
            return (
              (y = e),
              (n.bitb = D),
              (n.bitk = E),
              (g.avail_in = S),
              (g.total_in += T - g.next_in_index),
              (g.next_in_index = T),
              (n.write = z),
              n.inflate_flush(g, y)
            );
        }
    }),
    (this.free = () => {});
}
const h = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15];
function w(r, a) {
  let o,
    l = 0,
    c = 0,
    u = 0,
    w = 0;
  const _ = [0],
    b = [0],
    p = new f();
  let m = 0,
    g = new Int32Array(4320);
  const y = new d();
  (this.bitk = 0),
    (this.bitb = 0),
    (this.win = new Uint8Array(a)),
    (this.end = a),
    (this.read = 0),
    (this.write = 0),
    (this.reset = (e, t) => {
      t && (t[0] = 0),
        6 == l && p.free(e),
        (l = 0),
        (this.bitk = 0),
        (this.bitb = 0),
        (this.read = this.write = 0);
    }),
    this.reset(r, null),
    (this.inflate_flush = (e, t) => {
      let i, r, a;
      return (
        (r = e.next_out_index),
        (a = this.read),
        (i = (a <= this.write ? this.write : this.end) - a),
        i > e.avail_out && (i = e.avail_out),
        0 !== i && t == n && (t = 0),
        (e.avail_out -= i),
        (e.total_out += i),
        e.next_out.set(this.win.subarray(a, a + i), r),
        (r += i),
        (a += i),
        a == this.end &&
          ((a = 0),
          this.write == this.end && (this.write = 0),
          (i = this.write - a),
          i > e.avail_out && (i = e.avail_out),
          0 !== i && t == n && (t = 0),
          (e.avail_out -= i),
          (e.total_out += i),
          e.next_out.set(this.win.subarray(a, a + i), r),
          (r += i),
          (a += i)),
        (e.next_out_index = r),
        (this.read = a),
        t
      );
    }),
    (this.proc = (n, r) => {
      let a, f, x, k, v, S, z, A;
      for (
        k = n.next_in_index,
          v = n.avail_in,
          f = this.bitb,
          x = this.bitk,
          S = this.write,
          z = S < this.read ? this.read - S - 1 : this.end - S;
        ;
      ) {
        let U, D, E, T, F, O, C, W;
        switch (l) {
          case 0:
            while (x < 3) {
              if (0 === v)
                return (
                  (this.bitb = f),
                  (this.bitk = x),
                  (n.avail_in = v),
                  (n.total_in += k - n.next_in_index),
                  (n.next_in_index = k),
                  (this.write = S),
                  this.inflate_flush(n, r)
                );
              (r = 0), v--, (f |= (255 & n.read_byte(k++)) << x), (x += 8);
            }
            switch (((a = 7 & f), (m = 1 & a), a >>> 1)) {
              case 0:
                (f >>>= 3), (x -= 3), (a = 7 & x), (f >>>= a), (x -= a), (l = 1);
                break;
              case 1:
                (U = []),
                  (D = []),
                  (E = [[]]),
                  (T = [[]]),
                  d.inflate_trees_fixed(U, D, E, T),
                  p.init(U[0], D[0], E[0], 0, T[0], 0),
                  (f >>>= 3),
                  (x -= 3),
                  (l = 6);
                break;
              case 2:
                (f >>>= 3), (x -= 3), (l = 3);
                break;
              case 3:
                return (
                  (f >>>= 3),
                  (x -= 3),
                  (l = 9),
                  (n.msg = "invalid block type"),
                  (r = t),
                  (this.bitb = f),
                  (this.bitk = x),
                  (n.avail_in = v),
                  (n.total_in += k - n.next_in_index),
                  (n.next_in_index = k),
                  (this.write = S),
                  this.inflate_flush(n, r)
                );
            }
            break;
          case 1:
            while (x < 32) {
              if (0 === v)
                return (
                  (this.bitb = f),
                  (this.bitk = x),
                  (n.avail_in = v),
                  (n.total_in += k - n.next_in_index),
                  (n.next_in_index = k),
                  (this.write = S),
                  this.inflate_flush(n, r)
                );
              (r = 0), v--, (f |= (255 & n.read_byte(k++)) << x), (x += 8);
            }
            if (((~f >>> 16) & 65535) != (65535 & f))
              return (
                (l = 9),
                (n.msg = "invalid stored block lengths"),
                (r = t),
                (this.bitb = f),
                (this.bitk = x),
                (n.avail_in = v),
                (n.total_in += k - n.next_in_index),
                (n.next_in_index = k),
                (this.write = S),
                this.inflate_flush(n, r)
              );
            (c = 65535 & f), (f = x = 0), (l = 0 !== c ? 2 : 0 !== m ? 7 : 0);
            break;
          case 2:
            if (0 === v)
              return (
                (this.bitb = f),
                (this.bitk = x),
                (n.avail_in = v),
                (n.total_in += k - n.next_in_index),
                (n.next_in_index = k),
                (this.write = S),
                this.inflate_flush(n, r)
              );
            if (
              0 === z &&
              (S == this.end &&
                0 !== this.read &&
                ((S = 0), (z = S < this.read ? this.read - S - 1 : this.end - S)),
              0 === z &&
                ((this.write = S),
                (r = this.inflate_flush(n, r)),
                (S = this.write),
                (z = S < this.read ? this.read - S - 1 : this.end - S),
                S == this.end &&
                  0 !== this.read &&
                  ((S = 0), (z = S < this.read ? this.read - S - 1 : this.end - S)),
                0 === z))
            )
              return (
                (this.bitb = f),
                (this.bitk = x),
                (n.avail_in = v),
                (n.total_in += k - n.next_in_index),
                (n.next_in_index = k),
                (this.write = S),
                this.inflate_flush(n, r)
              );
            if (
              ((r = 0),
              (a = c),
              a > v && (a = v),
              a > z && (a = z),
              this.win.set(n.read_buf(k, a), S),
              (k += a),
              (v -= a),
              (S += a),
              (z -= a),
              0 != (c -= a))
            )
              break;
            l = 0 !== m ? 7 : 0;
            break;
          case 3:
            while (x < 14) {
              if (0 === v)
                return (
                  (this.bitb = f),
                  (this.bitk = x),
                  (n.avail_in = v),
                  (n.total_in += k - n.next_in_index),
                  (n.next_in_index = k),
                  (this.write = S),
                  this.inflate_flush(n, r)
                );
              (r = 0), v--, (f |= (255 & n.read_byte(k++)) << x), (x += 8);
            }
            if (((u = a = 16383 & f), (31 & a) > 29 || ((a >> 5) & 31) > 29))
              return (
                (l = 9),
                (n.msg = "too many length or distance symbols"),
                (r = t),
                (this.bitb = f),
                (this.bitk = x),
                (n.avail_in = v),
                (n.total_in += k - n.next_in_index),
                (n.next_in_index = k),
                (this.write = S),
                this.inflate_flush(n, r)
              );
            if (((a = 258 + (31 & a) + ((a >> 5) & 31)), !o || o.length < a)) o = [];
            else for (A = 0; A < a; A++) o[A] = 0;
            (f >>>= 14), (x -= 14), (w = 0), (l = 4);
          case 4:
            while (w < 4 + (u >>> 10)) {
              while (x < 3) {
                if (0 === v)
                  return (
                    (this.bitb = f),
                    (this.bitk = x),
                    (n.avail_in = v),
                    (n.total_in += k - n.next_in_index),
                    (n.next_in_index = k),
                    (this.write = S),
                    this.inflate_flush(n, r)
                  );
                (r = 0), v--, (f |= (255 & n.read_byte(k++)) << x), (x += 8);
              }
              (o[h[w++]] = 7 & f), (f >>>= 3), (x -= 3);
            }
            while (w < 19) o[h[w++]] = 0;
            if (((_[0] = 7), (a = y.inflate_trees_bits(o, _, b, g, n)), 0 != a))
              return (
                (r = a) == t && ((o = null), (l = 9)),
                (this.bitb = f),
                (this.bitk = x),
                (n.avail_in = v),
                (n.total_in += k - n.next_in_index),
                (n.next_in_index = k),
                (this.write = S),
                this.inflate_flush(n, r)
              );
            (w = 0), (l = 5);
          case 5:
            while (((a = u), !(w >= 258 + (31 & a) + ((a >> 5) & 31)))) {
              let e, c;
              for (a = _[0]; x < a; ) {
                if (0 === v)
                  return (
                    (this.bitb = f),
                    (this.bitk = x),
                    (n.avail_in = v),
                    (n.total_in += k - n.next_in_index),
                    (n.next_in_index = k),
                    (this.write = S),
                    this.inflate_flush(n, r)
                  );
                (r = 0), v--, (f |= (255 & n.read_byte(k++)) << x), (x += 8);
              }
              if (
                ((a = g[3 * (b[0] + (f & i[a])) + 1]), (c = g[3 * (b[0] + (f & i[a])) + 2]), c < 16)
              )
                (f >>>= a), (x -= a), (o[w++] = c);
              else {
                for (A = 18 == c ? 7 : c - 14, e = 18 == c ? 11 : 3; x < a + A; ) {
                  if (0 === v)
                    return (
                      (this.bitb = f),
                      (this.bitk = x),
                      (n.avail_in = v),
                      (n.total_in += k - n.next_in_index),
                      (n.next_in_index = k),
                      (this.write = S),
                      this.inflate_flush(n, r)
                    );
                  (r = 0), v--, (f |= (255 & n.read_byte(k++)) << x), (x += 8);
                }
                if (
                  ((f >>>= a),
                  (x -= a),
                  (e += f & i[A]),
                  (f >>>= A),
                  (x -= A),
                  (A = w),
                  (a = u),
                  A + e > 258 + (31 & a) + ((a >> 5) & 31) || (16 == c && A < 1))
                )
                  return (
                    (o = null),
                    (l = 9),
                    (n.msg = "invalid bit length repeat"),
                    (r = t),
                    (this.bitb = f),
                    (this.bitk = x),
                    (n.avail_in = v),
                    (n.total_in += k - n.next_in_index),
                    (n.next_in_index = k),
                    (this.write = S),
                    this.inflate_flush(n, r)
                  );
                c = 16 == c ? o[A - 1] : 0;
                do {
                  o[A++] = c;
                } while (0 != --e);
                w = A;
              }
            }
            if (
              ((b[0] = -1),
              (F = []),
              (O = []),
              (C = []),
              (W = []),
              (F[0] = 9),
              (O[0] = 6),
              (a = u),
              (a = y.inflate_trees_dynamic(
                257 + (31 & a),
                1 + ((a >> 5) & 31),
                o,
                F,
                O,
                C,
                W,
                g,
                n,
              )),
              0 != a)
            )
              return (
                a == t && ((o = null), (l = 9)),
                (r = a),
                (this.bitb = f),
                (this.bitk = x),
                (n.avail_in = v),
                (n.total_in += k - n.next_in_index),
                (n.next_in_index = k),
                (this.write = S),
                this.inflate_flush(n, r)
              );
            p.init(F[0], O[0], g, C[0], g, W[0]), (l = 6);
          case 6:
            if (
              ((this.bitb = f),
              (this.bitk = x),
              (n.avail_in = v),
              (n.total_in += k - n.next_in_index),
              (n.next_in_index = k),
              (this.write = S),
              1 != (r = p.proc(this, n, r)))
            )
              return this.inflate_flush(n, r);
            if (
              ((r = 0),
              p.free(n),
              (k = n.next_in_index),
              (v = n.avail_in),
              (f = this.bitb),
              (x = this.bitk),
              (S = this.write),
              (z = S < this.read ? this.read - S - 1 : this.end - S),
              0 === m)
            ) {
              l = 0;
              break;
            }
            l = 7;
          case 7:
            if (
              ((this.write = S),
              (r = this.inflate_flush(n, r)),
              (S = this.write),
              (z = S < this.read ? this.read - S - 1 : this.end - S),
              this.read != this.write)
            )
              return (
                (this.bitb = f),
                (this.bitk = x),
                (n.avail_in = v),
                (n.total_in += k - n.next_in_index),
                (n.next_in_index = k),
                (this.write = S),
                this.inflate_flush(n, r)
              );
            l = 8;
          case 8:
            return (
              (r = 1),
              (this.bitb = f),
              (this.bitk = x),
              (n.avail_in = v),
              (n.total_in += k - n.next_in_index),
              (n.next_in_index = k),
              (this.write = S),
              this.inflate_flush(n, r)
            );
          case 9:
            return (
              (r = t),
              (this.bitb = f),
              (this.bitk = x),
              (n.avail_in = v),
              (n.total_in += k - n.next_in_index),
              (n.next_in_index = k),
              (this.write = S),
              this.inflate_flush(n, r)
            );
          default:
            return (
              (r = e),
              (this.bitb = f),
              (this.bitk = x),
              (n.avail_in = v),
              (n.total_in += k - n.next_in_index),
              (n.next_in_index = k),
              (this.write = S),
              this.inflate_flush(n, r)
            );
        }
      }
    }),
    (this.free = (e) => {
      this.reset(e, null), (this.win = null), (g = null);
    }),
    (this.set_dictionary = (e, t, n) => {
      this.win.set(e.subarray(t, t + n), 0), (this.read = this.write = n);
    }),
    (this.sync_point = () => (1 == l ? 1 : 0));
}
const _ = 13,
  b = [0, 0, 255, 255];
function p() {
  function r(t) {
    return t && t.istate
      ? ((t.total_in = t.total_out = 0),
        (t.msg = null),
        (t.istate.mode = 7),
        t.istate.blocks.reset(t, null),
        0)
      : e;
  }
  (this.mode = 0),
    (this.method = 0),
    (this.was = [0]),
    (this.need = 0),
    (this.marker = 0),
    (this.wbits = 0),
    (this.inflateEnd = (e) => (this.blocks && this.blocks.free(e), (this.blocks = null), 0)),
    (this.inflateInit = (t, n) => (
      (t.msg = null),
      (this.blocks = null),
      n < 8 || n > 15
        ? (this.inflateEnd(t), e)
        : ((this.wbits = n), (t.istate.blocks = new w(t, 1 << n)), r(t), 0)
    )),
    (this.inflate = (i, r) => {
      let a, s;
      if (!i || !i.istate || !i.next_in) return e;
      const o = i.istate;
      for (r = 4 == r ? n : 0, a = n; ; )
        switch (o.mode) {
          case 0:
            if (0 === i.avail_in) return a;
            if (
              ((a = r),
              i.avail_in--,
              i.total_in++,
              8 != (15 & (o.method = i.read_byte(i.next_in_index++))))
            ) {
              (o.mode = _), (i.msg = "unknown compression method"), (o.marker = 5);
              break;
            }
            if (8 + (o.method >> 4) > o.wbits) {
              (o.mode = _), (i.msg = "invalid win size"), (o.marker = 5);
              break;
            }
            o.mode = 1;
          case 1:
            if (0 === i.avail_in) return a;
            if (
              ((a = r),
              i.avail_in--,
              i.total_in++,
              (s = 255 & i.read_byte(i.next_in_index++)),
              ((o.method << 8) + s) % 31 != 0)
            ) {
              (o.mode = _), (i.msg = "incorrect header check"), (o.marker = 5);
              break;
            }
            if (!(32 & s)) {
              o.mode = 7;
              break;
            }
            o.mode = 2;
          case 2:
            if (0 === i.avail_in) return a;
            (a = r),
              i.avail_in--,
              i.total_in++,
              (o.need = ((255 & i.read_byte(i.next_in_index++)) << 24) & 4278190080),
              (o.mode = 3);
          case 3:
            if (0 === i.avail_in) return a;
            (a = r),
              i.avail_in--,
              i.total_in++,
              (o.need += ((255 & i.read_byte(i.next_in_index++)) << 16) & 16711680),
              (o.mode = 4);
          case 4:
            if (0 === i.avail_in) return a;
            (a = r),
              i.avail_in--,
              i.total_in++,
              (o.need += ((255 & i.read_byte(i.next_in_index++)) << 8) & 65280),
              (o.mode = 5);
          case 5:
            return 0 === i.avail_in
              ? a
              : ((a = r),
                i.avail_in--,
                i.total_in++,
                (o.need += 255 & i.read_byte(i.next_in_index++)),
                (o.mode = 6),
                2);
          case 6:
            return (o.mode = _), (i.msg = "need dictionary"), (o.marker = 0), e;
          case 7:
            if (((a = o.blocks.proc(i, a)), a == t)) {
              (o.mode = _), (o.marker = 0);
              break;
            }
            if ((0 == a && (a = r), 1 != a)) return a;
            (a = r), o.blocks.reset(i, o.was), (o.mode = 12);
          case 12:
            return (i.avail_in = 0), 1;
          case _:
            return t;
          default:
            return e;
        }
    }),
    (this.inflateSetDictionary = (t, n, i) => {
      let r = 0,
        a = i;
      if (!t || !t.istate || 6 != t.istate.mode) return e;
      const s = t.istate;
      return (
        a >= 1 << s.wbits && ((a = (1 << s.wbits) - 1), (r = i - a)),
        s.blocks.set_dictionary(n, r, a),
        (s.mode = 7),
        0
      );
    }),
    (this.inflateSync = (i) => {
      let a, s, o, l, c;
      if (!i || !i.istate) return e;
      const u = i.istate;
      if ((u.mode != _ && ((u.mode = _), (u.marker = 0)), 0 === (a = i.avail_in))) return n;
      for (s = i.next_in_index, o = u.marker; 0 !== a && o < 4; )
        i.read_byte(s) == b[o] ? o++ : (o = 0 !== i.read_byte(s) ? 0 : 4 - o), s++, a--;
      return (
        (i.total_in += s - i.next_in_index),
        (i.next_in_index = s),
        (i.avail_in = a),
        (u.marker = o),
        4 != o
          ? t
          : ((l = i.total_in),
            (c = i.total_out),
            r(i),
            (i.total_in = l),
            (i.total_out = c),
            (u.mode = 7),
            0)
      );
    }),
    (this.inflateSyncPoint = (t) =>
      t && t.istate && t.istate.blocks ? t.istate.blocks.sync_point() : e);
}
function m() {}
m.prototype = {
  inflateInit(e) {
    return (this.istate = new p()), e || (e = 15), this.istate.inflateInit(this, e);
  },
  inflate(t) {
    return this.istate ? this.istate.inflate(this, t) : e;
  },
  inflateEnd() {
    if (!this.istate) return e;
    const n = this.istate.inflateEnd(this);
    return (this.istate = null), n;
  },
  inflateSync() {
    return this.istate ? this.istate.inflateSync(this) : e;
  },
  inflateSetDictionary(t, n) {
    return this.istate ? this.istate.inflateSetDictionary(this, t, n) : e;
  },
  read_byte(e) {
    return this.next_in[e];
  },
  read_buf(e, t) {
    return this.next_in.subarray(e, e + t);
  },
};
const g = 4294967295,
  y = 65535,
  x = 33639248,
  k = 101075792,
  v = 22,
  S = void 0,
  z = "undefined",
  A = "function";
class U {
  constructor(e) {
    return class extends TransformStream {
      constructor(t, n) {
        const i = new e(n);
        super({
          transform(e, t) {
            t.enqueue(i.append(e));
          },
          flush(e) {
            const t = i.flush();
            t && e.enqueue(t);
          },
        });
      }
    };
  }
}
let D = 2;
try {
  typeof navigator != z && navigator.hardwareConcurrency && (D = navigator.hardwareConcurrency);
} catch (e) {}
const E = {
    chunkSize: 524288,
    maxWorkers: D,
    terminateWorkerTimeout: 5e3,
    useWebWorkers: !0,
    useCompressionStream: !0,
    workerScripts: S,
    CompressionStreamNative: typeof CompressionStream != z && CompressionStream,
    DecompressionStreamNative: typeof DecompressionStream != z && DecompressionStream,
  },
  T = Object.assign({}, E);
function F(e) {
  const {
    baseURL: t,
    chunkSize: n,
    maxWorkers: i,
    terminateWorkerTimeout: r,
    useCompressionStream: a,
    useWebWorkers: s,
    Deflate: o,
    Inflate: l,
    CompressionStream: c,
    DecompressionStream: u,
    workerScripts: d,
  } = e;
  if (
    (O("baseURL", t),
    O("chunkSize", n),
    O("maxWorkers", i),
    O("terminateWorkerTimeout", r),
    O("useCompressionStream", a),
    O("useWebWorkers", s),
    o && (T.CompressionStream = new U(o)),
    l && (T.DecompressionStream = new U(l)),
    O("CompressionStream", c),
    O("DecompressionStream", u),
    d !== S)
  ) {
    const { deflate: e, inflate: t } = d;
    if (((e || t) && (T.workerScripts || (T.workerScripts = {})), e)) {
      if (!Array.isArray(e)) throw new Error("workerScripts.deflate must be an array");
      T.workerScripts.deflate = e;
    }
    if (t) {
      if (!Array.isArray(t)) throw new Error("workerScripts.inflate must be an array");
      T.workerScripts.inflate = t;
    }
  }
}
function O(e, t) {
  t !== S && (T[e] = t);
}
const C = [];
for (let e = 0; e < 256; e++) {
  let t = e;
  for (let e = 0; e < 8; e++) 1 & t ? (t = (t >>> 1) ^ 3988292384) : (t >>>= 1);
  C[e] = t;
}
class W {
  constructor(e) {
    this.crc = e || -1;
  }
  append(e) {
    let t = 0 | this.crc;
    for (let n = 0, i = 0 | e.length; n < i; n++) t = (t >>> 8) ^ C[255 & (t ^ e[n])];
    this.crc = t;
  }
  get() {
    return ~this.crc;
  }
}
class j extends TransformStream {
  constructor() {
    let e;
    const t = new W();
    super({
      transform(e, n) {
        t.append(e), n.enqueue(e);
      },
      flush() {
        const n = new Uint8Array(4);
        new DataView(n.buffer).setUint32(0, t.get()), (e.value = n);
      },
    }),
      (e = this);
  }
}
const M = {
    concat(e, t) {
      if (0 === e.length || 0 === t.length) return e.concat(t);
      const n = e[e.length - 1],
        i = M.getPartial(n);
      return 32 === i ? e.concat(t) : M._shiftRight(t, i, 0 | n, e.slice(0, e.length - 1));
    },
    bitLength(e) {
      const t = e.length;
      if (0 === t) return 0;
      const n = e[t - 1];
      return 32 * (t - 1) + M.getPartial(n);
    },
    clamp(e, t) {
      if (32 * e.length < t) return e;
      const n = (e = e.slice(0, Math.ceil(t / 32))).length;
      return (
        (t &= 31), n > 0 && t && (e[n - 1] = M.partial(t, e[n - 1] & (2147483648 >> (t - 1)), 1)), e
      );
    },
    partial: (e, t, n) => (32 === e ? t : (n ? 0 | t : t << (32 - e)) + 1099511627776 * e),
    getPartial: (e) => Math.round(e / 1099511627776) || 32,
    _shiftRight(e, t, n, i) {
      for (void 0 === i && (i = []); t >= 32; t -= 32) i.push(n), (n = 0);
      if (0 === t) return i.concat(e);
      for (let r = 0; r < e.length; r++) i.push(n | (e[r] >>> t)), (n = e[r] << (32 - t));
      const r = e.length ? e[e.length - 1] : 0,
        a = M.getPartial(r);
      return i.push(M.partial((t + a) & 31, t + a > 32 ? n : i.pop(), 1)), i;
    },
  },
  L = {
    bytes: {
      fromBits(e) {
        const t = M.bitLength(e) / 8,
          n = new Uint8Array(t);
        let i;
        for (let r = 0; r < t; r++) 3 & r || (i = e[r / 4]), (n[r] = i >>> 24), (i <<= 8);
        return n;
      },
      toBits(e) {
        const t = [];
        let n,
          i = 0;
        for (n = 0; n < e.length; n++) (i = (i << 8) | e[n]), 3 & ~n || (t.push(i), (i = 0));
        return 3 & n && t.push(M.partial(8 * (3 & n), i)), t;
      },
    },
  },
  P = {
    sha1: class {
      constructor(e) {
        (this.blockSize = 512),
          (this._init = [1732584193, 4023233417, 2562383102, 271733878, 3285377520]),
          (this._key = [1518500249, 1859775393, 2400959708, 3395469782]),
          e
            ? ((this._h = e._h.slice(0)),
              (this._buffer = e._buffer.slice(0)),
              (this._length = e._length))
            : this.reset();
      }
      reset() {
        return (this._h = this._init.slice(0)), (this._buffer = []), (this._length = 0), this;
      }
      update(e) {
        "string" == typeof e && (e = L.utf8String.toBits(e));
        const n = (this._buffer = M.concat(this._buffer, e)),
          i = this._length,
          r = (this._length = i + M.bitLength(e));
        if (r > 9007199254740991) throw new Error("Cannot hash more than 2^53 - 1 bits");
        const a = new Uint32Array(n);
        let s = 0;
        for (
          let e = this.blockSize + i - ((this.blockSize + i) & (this.blockSize - 1));
          e <= r;
          e += this.blockSize
        )
          this._block(a.subarray(16 * s, 16 * (s + 1))), (s += 1);
        return n.splice(0, 16 * s), this;
      }
      finalize() {
        let t = this._buffer;
        const n = this._h;
        t = M.concat(t, [M.partial(1, 1)]);
        for (let e = t.length + 2; 15 & e; e++) t.push(0);
        for (t.push(Math.floor(this._length / 4294967296)), t.push(0 | this._length); t.length; )
          this._block(t.splice(0, 16));
        return this.reset(), n;
      }
      _f(e, t, n, i) {
        return e <= 19
          ? (t & n) | (~t & i)
          : e <= 39
            ? t ^ n ^ i
            : e <= 59
              ? (t & n) | (t & i) | (n & i)
              : e <= 79
                ? t ^ n ^ i
                : void 0;
      }
      _S(e, t) {
        return (t << e) | (t >>> (32 - e));
      }
      _block(e) {
        const n = this._h,
          i = Array(80);
        for (let t = 0; t < 16; t++) i[t] = e[t];
        let r = n[0],
          a = n[1],
          s = n[2],
          o = n[3],
          l = n[4];
        for (let e = 0; e <= 79; e++) {
          e >= 16 && (i[e] = this._S(1, i[e - 3] ^ i[e - 8] ^ i[e - 14] ^ i[e - 16]));
          const n =
            (this._S(5, r) + this._f(e, a, s, o) + l + i[e] + this._key[Math.floor(e / 20)]) | 0;
          (l = o), (o = s), (s = this._S(30, a)), (a = r), (r = n);
        }
        (n[0] = (n[0] + r) | 0),
          (n[1] = (n[1] + a) | 0),
          (n[2] = (n[2] + s) | 0),
          (n[3] = (n[3] + o) | 0),
          (n[4] = (n[4] + l) | 0);
      }
    },
  },
  R = {
    aes: class {
      constructor(e) {
        (this._tables = [
          [[], [], [], [], []],
          [[], [], [], [], []],
        ]),
          this._tables[0][0][0] || this._precompute();
        const n = this._tables[0][4],
          i = this._tables[1],
          r = e.length;
        let a,
          s,
          o,
          l = 1;
        if (4 !== r && 6 !== r && 8 !== r) throw new Error("invalid aes key size");
        for (this._key = [(s = e.slice(0)), (o = [])], a = r; a < 4 * r + 28; a++) {
          let e = s[a - 1];
          (a % r == 0 || (8 === r && a % r == 4)) &&
            ((e =
              (n[e >>> 24] << 24) ^
              (n[(e >> 16) & 255] << 16) ^
              (n[(e >> 8) & 255] << 8) ^
              n[255 & e]),
            a % r == 0 &&
              ((e = (e << 8) ^ (e >>> 24) ^ (l << 24)), (l = (l << 1) ^ (283 * (l >> 7))))),
            (s[a] = s[a - r] ^ e);
        }
        for (let e = 0; a; e++, a--) {
          const t = s[3 & e ? a : a - 4];
          o[e] =
            a <= 4 || e < 4
              ? t
              : i[0][n[t >>> 24]] ^
                i[1][n[(t >> 16) & 255]] ^
                i[2][n[(t >> 8) & 255]] ^
                i[3][n[255 & t]];
        }
      }
      encrypt(e) {
        return this._crypt(e, 0);
      }
      decrypt(e) {
        return this._crypt(e, 1);
      }
      _precompute() {
        const e = this._tables[0],
          t = this._tables[1],
          n = e[4],
          i = t[4],
          r = [],
          a = [];
        let s, o, l, c;
        for (let e = 0; e < 256; e++) a[(r[e] = (e << 1) ^ (283 * (e >> 7))) ^ e] = e;
        for (let u = (s = 0); !n[u]; u ^= o || 1, s = a[s] || 1) {
          let a = s ^ (s << 1) ^ (s << 2) ^ (s << 3) ^ (s << 4);
          (a = (a >> 8) ^ (255 & a) ^ 99), (n[u] = a), (i[a] = u), (c = r[(l = r[(o = r[u])])]);
          let d = (16843009 * c) ^ (65537 * l) ^ (257 * o) ^ (16843008 * u),
            f = (257 * r[a]) ^ (16843008 * a);
          for (let n = 0; n < 4; n++)
            (e[n][u] = f = (f << 24) ^ (f >>> 8)), (t[n][a] = d = (d << 24) ^ (d >>> 8));
        }
        for (let n = 0; n < 5; n++) (e[n] = e[n].slice(0)), (t[n] = t[n].slice(0));
      }
      _crypt(e, t) {
        if (4 !== e.length) throw new Error("invalid aes block size");
        const n = this._key[t],
          i = n.length / 4 - 2,
          r = [0, 0, 0, 0],
          a = this._tables[t],
          s = a[0],
          o = a[1],
          l = a[2],
          c = a[3],
          u = a[4];
        let d,
          f,
          h,
          w = e[0] ^ n[0],
          _ = e[t ? 3 : 1] ^ n[1],
          b = e[2] ^ n[2],
          p = e[t ? 1 : 3] ^ n[3],
          m = 4;
        for (let e = 0; e < i; e++)
          (d = s[w >>> 24] ^ o[(_ >> 16) & 255] ^ l[(b >> 8) & 255] ^ c[255 & p] ^ n[m]),
            (f = s[_ >>> 24] ^ o[(b >> 16) & 255] ^ l[(p >> 8) & 255] ^ c[255 & w] ^ n[m + 1]),
            (h = s[b >>> 24] ^ o[(p >> 16) & 255] ^ l[(w >> 8) & 255] ^ c[255 & _] ^ n[m + 2]),
            (p = s[p >>> 24] ^ o[(w >> 16) & 255] ^ l[(_ >> 8) & 255] ^ c[255 & b] ^ n[m + 3]),
            (m += 4),
            (w = d),
            (_ = f),
            (b = h);
        for (let e = 0; e < 4; e++)
          (r[t ? 3 & -e : e] =
            (u[w >>> 24] << 24) ^
            (u[(_ >> 16) & 255] << 16) ^
            (u[(b >> 8) & 255] << 8) ^
            u[255 & p] ^
            n[m++]),
            (d = w),
            (w = _),
            (_ = b),
            (b = p),
            (p = d);
        return r;
      }
    },
  },
  B = {
    getRandomValues(e) {
      const t = new Uint32Array(e.buffer),
        n = (e) => {
          let t = 987654321;
          const n = 4294967295;
          return () => {
            t = (36969 * (65535 & t) + (t >> 16)) & n;
            return (
              ((((t << 16) + (e = (18e3 * (65535 & e) + (e >> 16)) & n)) & n) / 4294967296 + 0.5) *
              (Math.random() > 0.5 ? 1 : -1)
            );
          };
        };
      for (let i, r = 0; r < e.length; r += 4) {
        const e = n(4294967296 * (i || Math.random()));
        (i = 987654071 * e()), (t[r / 4] = (4294967296 * e()) | 0);
      }
      return e;
    },
  },
  I = {
    ctrGladman: class {
      constructor(e, t) {
        (this._prf = e), (this._initIv = t), (this._iv = t);
      }
      reset() {
        this._iv = this._initIv;
      }
      update(e) {
        return this.calculate(this._prf, e, this._iv);
      }
      incWord(e) {
        if (255 & ~(e >> 24)) e += 1 << 24;
        else {
          let t = (e >> 16) & 255,
            n = (e >> 8) & 255,
            i = 255 & e;
          255 === t ? ((t = 0), 255 === n ? ((n = 0), 255 === i ? (i = 0) : ++i) : ++n) : ++t,
            (e = 0),
            (e += t << 16),
            (e += n << 8),
            (e += i);
        }
        return e;
      }
      incCounter(e) {
        0 === (e[0] = this.incWord(e[0])) && (e[1] = this.incWord(e[1]));
      }
      calculate(e, t, n) {
        let i;
        if (!(i = t.length)) return [];
        const r = M.bitLength(t);
        for (let r = 0; r < i; r += 4) {
          this.incCounter(n);
          const i = e.encrypt(n);
          (t[r] ^= i[0]), (t[r + 1] ^= i[1]), (t[r + 2] ^= i[2]), (t[r + 3] ^= i[3]);
        }
        return M.clamp(t, r);
      }
    },
  },
  N = {
    importKey: (e) => new N.hmacSha1(L.bytes.toBits(e)),
    pbkdf2(e, t, n, i) {
      if (((n = n || 1e4), i < 0 || n < 0)) throw new Error("invalid params to pbkdf2");
      const r = (1 + (i >> 5)) << 2;
      let a, s, o, l, c;
      const u = new ArrayBuffer(r),
        d = new DataView(u);
      let f = 0;
      const h = M;
      for (t = L.bytes.toBits(t), c = 1; f < (r || 1); c++) {
        for (a = s = e.encrypt(h.concat(t, [c])), o = 1; o < n; o++)
          for (s = e.encrypt(s), l = 0; l < s.length; l++) a[l] ^= s[l];
        for (o = 0; f < (r || 1) && o < a.length; o++) d.setInt32(f, a[o]), (f += 4);
      }
      return u.slice(0, i / 8);
    },
    hmacSha1: class {
      constructor(e) {
        const n = (this._hash = P.sha1),
          i = [[], []];
        this._baseHash = [new n(), new n()];
        const r = this._baseHash[0].blockSize / 32;
        e.length > r && (e = new n().update(e).finalize());
        for (let t = 0; t < r; t++) (i[0][t] = 909522486 ^ e[t]), (i[1][t] = 1549556828 ^ e[t]);
        this._baseHash[0].update(i[0]),
          this._baseHash[1].update(i[1]),
          (this._resultHash = new n(this._baseHash[0]));
      }
      reset() {
        (this._resultHash = new this._hash(this._baseHash[0])), (this._updated = !1);
      }
      update(e) {
        (this._updated = !0), this._resultHash.update(e);
      }
      digest() {
        const t = this._resultHash.finalize(),
          n = new this._hash(this._baseHash[1]).update(t).finalize();
        return this.reset(), n;
      }
      encrypt(e) {
        if (this._updated) throw new Error("encrypt on already updated hmac called!");
        return this.update(e), this.digest(e);
      }
    },
  },
  V = typeof crypto != z && typeof crypto.getRandomValues == A,
  q = "Invalid password",
  H = "Invalid signature",
  K = "zipjs-abort-check-password";
function Z(e) {
  return V ? crypto.getRandomValues(e) : B.getRandomValues(e);
}
const G = 16,
  J = { name: "PBKDF2" },
  Q = Object.assign({ hash: { name: "HMAC" } }, J),
  X = Object.assign({ iterations: 1e3, hash: { name: "SHA-1" } }, J),
  Y = ["deriveBits"],
  $ = [8, 12, 16],
  ee = [16, 24, 32],
  te = 10,
  ne = [0, 0, 0, 0],
  ie = typeof crypto != z,
  re = ie && crypto.subtle,
  ae = ie && typeof re != z,
  se = L.bytes,
  oe = R.aes,
  le = I.ctrGladman,
  ce = N.hmacSha1;
let ue = ie && ae && typeof re.importKey == A,
  de = ie && ae && typeof re.deriveBits == A;
class fe extends TransformStream {
  constructor({
    password: e,
    rawPassword: t,
    signed: n,
    encryptionStrength: i,
    checkPasswordOnly: r,
  }) {
    super({
      start() {
        Object.assign(this, {
          ready: new Promise((e) => (this.resolveReady = e)),
          password: be(e, t),
          signed: n,
          strength: i - 1,
          pending: new Uint8Array(),
        });
      },
      async transform(e, t) {
        const { password: i, strength: a, resolveReady: s, ready: o } = this;
        i
          ? (await (async (e, t, n, i) => {
              const r = await _e(e, t, n, me(i, 0, $[t])),
                a = me(i, $[t]);
              if (r[0] != a[0] || r[1] != a[1]) throw new Error(q);
            })(this, a, i, me(e, 0, $[a] + 2)),
            (e = me(e, $[a] + 2)),
            r ? t.error(new Error(K)) : s())
          : await o;
        const l = new Uint8Array(e.length - te - ((e.length - te) % G));
        t.enqueue(we(this, e, l, 0, te, !0));
      },
      async flush(e) {
        const { signed: t, ctr: n, hmac: i, pending: r, ready: a } = this;
        if (i && n) {
          await a;
          const s = me(r, 0, r.length - te),
            o = me(r, r.length - te);
          let l = new Uint8Array();
          if (s.length) {
            const e = ye(se, s);
            i.update(e);
            const t = n.update(e);
            l = ge(se, t);
          }
          if (t) {
            const e = me(ge(se, i.digest()), 0, te);
            for (let t = 0; t < te; t++) if (e[t] != o[t]) throw new Error(H);
          }
          e.enqueue(l);
        }
      },
    });
  }
}
class he extends TransformStream {
  constructor({ password: e, rawPassword: t, encryptionStrength: n }) {
    let i;
    super({
      start() {
        Object.assign(this, {
          ready: new Promise((e) => (this.resolveReady = e)),
          password: be(e, t),
          strength: n - 1,
          pending: new Uint8Array(),
        });
      },
      async transform(e, t) {
        const { password: i, strength: r, resolveReady: a, ready: s } = this;
        let o = new Uint8Array();
        i
          ? ((o = await (async (e, t, n) => {
              const i = Z(new Uint8Array($[t])),
                r = await _e(e, t, n, i);
              return pe(i, r);
            })(this, r, i)),
            a())
          : await s;
        const l = new Uint8Array(o.length + e.length - (e.length % G));
        l.set(o, 0), t.enqueue(we(this, e, l, o.length, 0));
      },
      async flush(e) {
        const { ctr: t, hmac: n, pending: r, ready: a } = this;
        if (n && t) {
          await a;
          let s = new Uint8Array();
          if (r.length) {
            const e = t.update(ye(se, r));
            n.update(e), (s = ge(se, e));
          }
          (i.signature = ge(se, n.digest()).slice(0, te)), e.enqueue(pe(s, i.signature));
        }
      },
    }),
      (i = this);
  }
}
function we(e, t, n, i, r, a) {
  const { ctr: s, hmac: o, pending: l } = e,
    c = t.length - r;
  let u;
  for (
    l.length &&
      ((t = pe(l, t)),
      (n = ((e, t) => {
        if (t && t > e.length) {
          const n = e;
          (e = new Uint8Array(t)).set(n, 0);
        }
        return e;
      })(n, c - (c % G)))),
      u = 0;
    u <= c - G;
    u += G
  ) {
    const e = ye(se, me(t, u, u + G));
    a && o.update(e);
    const r = s.update(e);
    a || o.update(r), n.set(ge(se, r), u + i);
  }
  return (e.pending = me(t, u)), n;
}
async function _e(e, t, n, i) {
  e.password = null;
  const r = await (async (e, t, n, i, r) => {
      if (!ue) return N.importKey(t);
      try {
        return await re.importKey(e, t, n, i, r);
      } catch (e) {
        return (ue = !1), N.importKey(t);
      }
    })("raw", n, Q, !1, Y),
    a = await (async (e, t, n) => {
      if (!de) return N.pbkdf2(t, e.salt, X.iterations, n);
      try {
        return await re.deriveBits(e, t, n);
      } catch (i) {
        return (de = !1), N.pbkdf2(t, e.salt, X.iterations, n);
      }
    })(Object.assign({ salt: i }, X), r, 8 * (2 * ee[t] + 2)),
    s = new Uint8Array(a),
    o = ye(se, me(s, 0, ee[t])),
    l = ye(se, me(s, ee[t], 2 * ee[t])),
    c = me(s, 2 * ee[t]);
  return (
    Object.assign(e, {
      keys: { key: o, authentication: l, passwordVerification: c },
      ctr: new le(new oe(o), Array.from(ne)),
      hmac: new ce(l),
    }),
    c
  );
}
function be(e, t) {
  return t === S
    ? ((e) => {
        if (typeof TextEncoder == z) {
          e = unescape(encodeURIComponent(e));
          const t = new Uint8Array(e.length);
          for (let n = 0; n < t.length; n++) t[n] = e.charCodeAt(n);
          return t;
        }
        return new TextEncoder().encode(e);
      })(e)
    : t;
}
function pe(e, t) {
  let n = e;
  return (
    e.length + t.length &&
      ((n = new Uint8Array(e.length + t.length)), n.set(e, 0), n.set(t, e.length)),
    n
  );
}
function me(e, t, n) {
  return e.subarray(t, n);
}
function ge(e, t) {
  return e.fromBits(t);
}
function ye(e, t) {
  return e.toBits(t);
}
const xe = 12;
class ke extends TransformStream {
  constructor({ password: e, passwordVerification: t, checkPasswordOnly: n }) {
    super({
      start() {
        Object.assign(this, { password: e, passwordVerification: t }), Ae(this, e);
      },
      transform(e, t) {
        if (this.password) {
          const t = Se(this, e.subarray(0, xe));
          if (((this.password = null), t[11] != this.passwordVerification)) throw new Error(q);
          e = e.subarray(xe);
        }
        n ? t.error(new Error(K)) : t.enqueue(Se(this, e));
      },
    });
  }
}
class ve extends TransformStream {
  constructor({ password: e, passwordVerification: t }) {
    super({
      start() {
        Object.assign(this, { password: e, passwordVerification: t }), Ae(this, e);
      },
      transform(e, t) {
        let i, r;
        if (this.password) {
          this.password = null;
          const t = Z(new Uint8Array(xe));
          (t[11] = this.passwordVerification),
            (i = new Uint8Array(e.length + t.length)),
            i.set(ze(this, t), 0),
            (r = xe);
        } else (i = new Uint8Array(e.length)), (r = 0);
        i.set(ze(this, e), r), t.enqueue(i);
      },
    });
  }
}
function Se(e, t) {
  const n = new Uint8Array(t.length);
  for (let i = 0; i < t.length; i++) (n[i] = De(e) ^ t[i]), Ue(e, n[i]);
  return n;
}
function ze(e, t) {
  const n = new Uint8Array(t.length);
  for (let i = 0; i < t.length; i++) (n[i] = De(e) ^ t[i]), Ue(e, t[i]);
  return n;
}
function Ae(e, t) {
  const n = [305419896, 591751049, 878082192];
  Object.assign(e, { keys: n, crcKey0: new W(n[0]), crcKey2: new W(n[2]) });
  for (let n = 0; n < t.length; n++) Ue(e, t.charCodeAt(n));
}
function Ue(e, t) {
  let [n, i, r] = e.keys;
  e.crcKey0.append([t]),
    (n = ~e.crcKey0.get()),
    (i = Te(Math.imul(Te(i + Ee(n)), 134775813) + 1)),
    e.crcKey2.append([i >>> 24]),
    (r = ~e.crcKey2.get()),
    (e.keys = [n, i, r]);
}
function De(e) {
  const t = 2 | e.keys[2];
  return Ee(Math.imul(t, 1 ^ t) >>> 8);
}
function Ee(e) {
  return 255 & e;
}
function Te(e) {
  return 4294967295 & e;
}
const Fe = "deflate-raw";
class Oe extends TransformStream {
  constructor(e, { chunkSize: t, CompressionStream: n, CompressionStreamNative: i }) {
    super({});
    const {
      compressed: r,
      encrypted: a,
      useCompressionStream: s,
      zipCrypto: o,
      signed: l,
      level: c,
    } = e;
    let d,
      f,
      h = We(super.readable);
    (a && !o) || !l || ((d = new j()), (h = Le(h, d))),
      r && (h = Me(h, s, { level: c, chunkSize: t }, i, n)),
      a && (o ? (h = Le(h, new ve(e))) : ((f = new he(e)), (h = Le(h, f)))),
      je(this, h, () => {
        let e;
        a && !o && (e = f.signature),
          (a && !o) || !l || (e = new DataView(d.value.buffer).getUint32(0)),
          (this.signature = e);
      });
  }
}
class Ce extends TransformStream {
  constructor(e, { chunkSize: t, DecompressionStream: n, DecompressionStreamNative: i }) {
    super({});
    const {
      zipCrypto: r,
      encrypted: a,
      signed: s,
      signature: o,
      compressed: l,
      useCompressionStream: c,
    } = e;
    let u,
      d,
      f = We(super.readable);
    a && (r ? (f = Le(f, new ke(e))) : ((d = new fe(e)), (f = Le(f, d)))),
      l && (f = Me(f, c, { chunkSize: t }, i, n)),
      (a && !r) || !s || ((u = new j()), (f = Le(f, u))),
      je(this, f, () => {
        if ((!a || r) && s) {
          const e = new DataView(u.value.buffer);
          if (o != e.getUint32(0, !1)) throw new Error(H);
        }
      });
  }
}
function We(e) {
  return Le(
    e,
    new TransformStream({
      transform(e, t) {
        e && e.length && t.enqueue(e);
      },
    }),
  );
}
function je(e, t, n) {
  (t = Le(t, new TransformStream({ flush: n }))),
    Object.defineProperty(e, "readable", { get: () => t });
}
function Me(e, t, n, i, r) {
  try {
    e = Le(e, new (t && i ? i : r)(Fe, n));
  } catch (i) {
    if (!t) return e;
    try {
      e = Le(e, new r(Fe, n));
    } catch (t) {
      return e;
    }
  }
  return e;
}
function Le(e, t) {
  return e.pipeThrough(t);
}
const Pe = "message",
  Re = "start",
  Be = "pull",
  Ie = "data",
  Ne = "close",
  Ve = "inflate";
class qe extends TransformStream {
  constructor(e, t) {
    super({});
    const n = this,
      { codecType: i } = e;
    let r;
    i.startsWith("deflate") ? (r = Oe) : i.startsWith(Ve) && (r = Ce);
    let a = 0,
      s = 0;
    const o = new r(e, t),
      l = super.readable,
      c = new TransformStream({
        transform(e, t) {
          e && e.length && ((s += e.length), t.enqueue(e));
        },
        flush() {
          Object.assign(n, { inputSize: s });
        },
      }),
      u = new TransformStream({
        transform(e, t) {
          e && e.length && ((a += e.length), t.enqueue(e));
        },
        flush() {
          const { signature: e } = o;
          Object.assign(n, { signature: e, outputSize: a, inputSize: s });
        },
      });
    Object.defineProperty(n, "readable", {
      get: () => l.pipeThrough(c).pipeThrough(o).pipeThrough(u),
    });
  }
}
class He extends TransformStream {
  constructor(e) {
    let t;
    super({
      transform: function n(i, r) {
        if (t) {
          const e = new Uint8Array(t.length + i.length);
          e.set(t), e.set(i, t.length), (i = e), (t = null);
        }
        i.length > e ? (r.enqueue(i.slice(0, e)), n(i.slice(e), r)) : (t = i);
      },
      flush(e) {
        t && t.length && e.enqueue(t);
      },
    });
  }
}
let Ke = typeof Worker != z;
class Ze {
  constructor(
    e,
    { readable: t, writable: n },
    { options: i, config: r, streamOptions: a, useWebWorkers: s, transferStreams: o, scripts: l },
    c,
  ) {
    const { signal: u } = a;
    return (
      Object.assign(e, {
        busy: !0,
        readable: t.pipeThrough(new He(r.chunkSize)).pipeThrough(new Ge(t, a), { signal: u }),
        writable: n,
        options: Object.assign({}, i),
        scripts: l,
        transferStreams: o,
        terminate: () =>
          new Promise((t) => {
            const { worker: n, busy: i } = e;
            n ? (i ? (e.resolveTerminated = t) : (n.terminate(), t()), (e.interface = null)) : t();
          }),
        onTaskFinished() {
          const { resolveTerminated: t } = e;
          t && ((e.resolveTerminated = null), (e.terminated = !0), e.worker.terminate(), t()),
            (e.busy = !1),
            c(e);
        },
      }),
      (s && Ke ? Xe : Qe)(e, r)
    );
  }
}
class Ge extends TransformStream {
  constructor(e, { onstart: t, onprogress: n, size: i, onend: r }) {
    let a = 0;
    super({
      async start() {
        t && (await Je(t, i));
      },
      async transform(e, t) {
        (a += e.length), n && (await Je(n, a, i)), t.enqueue(e);
      },
      async flush() {
        (e.size = a), r && (await Je(r, a));
      },
    });
  }
}
async function Je(e, ...t) {
  try {
    await e(...t);
  } catch (e) {}
}
function Qe(e, t) {
  return {
    run: () =>
      (async ({ options: e, readable: t, writable: n, onTaskFinished: i }, r) => {
        try {
          const i = new qe(e, r);
          await t.pipeThrough(i).pipeTo(n, { preventClose: !0, preventAbort: !0 });
          const { signature: a, inputSize: s, outputSize: o } = i;
          return { signature: a, inputSize: s, outputSize: o };
        } finally {
          i();
        }
      })(e, t),
  };
}
function Xe(e, t) {
  const { baseURL: n, chunkSize: i } = t;
  if (!e.interface) {
    let r;
    try {
      r = ((e, t, n) => {
        const i = { type: "module" };
        let r, a;
        typeof e == A && (e = e());
        try {
          r = new URL(e, t);
        } catch (t) {
          r = e;
        }
        if (Ye)
          try {
            a = new Worker(r);
          } catch (e) {
            (Ye = !1), (a = new Worker(r, i));
          }
        else a = new Worker(r, i);
        return (
          a.addEventListener(Pe, (e) =>
            (async ({ data: e }, t) => {
              const { type: n, value: i, messageId: r, result: a, error: s } = e,
                { reader: o, writer: l, resolveResult: c, rejectResult: u, onTaskFinished: d } = t;
              try {
                if (s) {
                  const { message: e, stack: t, code: n, name: i } = s,
                    r = new Error(e);
                  Object.assign(r, { stack: t, code: n, name: i }), f(r);
                } else {
                  if (n == Be) {
                    const { value: e, done: n } = await o.read();
                    et({ type: Ie, value: e, done: n, messageId: r }, t);
                  }
                  n == Ie &&
                    (await l.ready,
                    await l.write(new Uint8Array(i)),
                    et({ type: "ack", messageId: r }, t)),
                    n == Ne && f(null, a);
                }
              } catch (s) {
                et({ type: Ne, messageId: r }, t), f(s);
              }
              function f(e, t) {
                e ? u(e) : c(t), l && l.releaseLock(), d();
              }
            })(e, n),
          ),
          a
        );
      })(e.scripts[0], n, e);
    } catch (n) {
      return (Ke = !1), Qe(e, t);
    }
    Object.assign(e, {
      worker: r,
      interface: {
        run: () =>
          (async (e, t) => {
            let n, i;
            const r = new Promise((e, t) => {
              (n = e), (i = t);
            });
            Object.assign(e, {
              reader: null,
              writer: null,
              resolveResult: n,
              rejectResult: i,
              result: r,
            });
            const { readable: a, options: s, scripts: o } = e,
              { writable: l, closed: c } = ((e) => {
                let t;
                const n = new Promise((e) => (t = e)),
                  i = new WritableStream({
                    async write(t) {
                      const n = e.getWriter();
                      await n.ready, await n.write(t), n.releaseLock();
                    },
                    close() {
                      t();
                    },
                    abort: (t) => e.getWriter().abort(t),
                  });
                return { writable: i, closed: n };
              })(e.writable),
              u = et(
                { type: Re, scripts: o.slice(1), options: s, config: t, readable: a, writable: l },
                e,
              );
            u || Object.assign(e, { reader: a.getReader(), writer: l.getWriter() });
            const d = await r;
            u || (await l.getWriter().close());
            return await c, d;
          })(e, { chunkSize: i }),
      },
    });
  }
  return e.interface;
}
let Ye = !0,
  $e = !0;
function et(e, { worker: t, writer: n, onTaskFinished: i, transferStreams: r }) {
  try {
    const { value: n, readable: i, writable: a } = e;
    const s = [];
    if (
      (n &&
        (n.byteLength < n.buffer.byteLength
          ? (e.value = n.buffer.slice(0, n.byteLength))
          : (e.value = n.buffer),
        s.push(e.value)),
      r && $e ? (i && s.push(i), a && s.push(a)) : (e.readable = e.writable = null),
      s.length)
    )
      try {
        return t.postMessage(e, s), !0;
      } catch (n) {
        ($e = !1), (e.readable = e.writable = null), t.postMessage(e);
      }
    else t.postMessage(e);
  } catch (e) {
    throw (n && n.releaseLock(), i(), e);
  }
}
let tt = [];
const nt = [];
let it = 0;
async function rt(e, t) {
  const { options: n, config: i } = t,
    {
      transferStreams: r,
      useWebWorkers: a,
      useCompressionStream: s,
      codecType: o,
      compressed: l,
      signed: c,
      encrypted: u,
    } = n,
    { workerScripts: d, maxWorkers: f } = i;
  t.transferStreams = r || r === S;
  const h = !(l || c || u || t.transferStreams);
  return (
    (t.useWebWorkers = !h && (a || (a === S && i.useWebWorkers))),
    (t.scripts = t.useWebWorkers && d ? d[o] : []),
    (n.useCompressionStream = s || (s === S && i.useCompressionStream)),
    (
      await (async () => {
        const n = tt.find((e) => !e.busy);
        if (n) return at(n), new Ze(n, e, t, w);
        if (tt.length < f) {
          const n = { indexWorker: it };
          return it++, tt.push(n), new Ze(n, e, t, w);
        }
        return new Promise((n) => nt.push({ resolve: n, stream: e, workerOptions: t }));
      })()
    ).run()
  );
  function w(e) {
    if (nt.length) {
      const [{ resolve: t, stream: n, workerOptions: i }] = nt.splice(0, 1);
      t(new Ze(e, n, i, w));
    } else
      e.worker
        ? (at(e),
          ((e, t) => {
            const { config: n } = t,
              { terminateWorkerTimeout: i } = n;
            Number.isFinite(i) &&
              i >= 0 &&
              (e.terminated
                ? (e.terminated = !1)
                : (e.terminateTimeout = setTimeout(async () => {
                    tt = tt.filter((t) => t != e);
                    try {
                      await e.terminate();
                    } catch (e) {}
                  }, i)));
          })(e, t))
        : (tt = tt.filter((t) => t != e));
  }
}
function at(e) {
  const { terminateTimeout: t } = e;
  t && (clearTimeout(t), (e.terminateTimeout = null));
}
const st = 65536,
  ot = "writable";
class lt {
  constructor() {
    this.size = 0;
  }
  init() {
    this.initialized = !0;
  }
}
class ct extends lt {
  get readable() {
    const e = this,
      { chunkSize: t = st } = e,
      n = new ReadableStream({
        start() {
          this.chunkOffset = 0;
        },
        async pull(i) {
          const { offset: r = 0, size: a, diskNumberStart: s } = n,
            { chunkOffset: o } = this;
          i.enqueue(await pt(e, r + o, Math.min(t, a - o), s)),
            o + t > a ? i.close() : (this.chunkOffset += t);
        },
      });
    return n;
  }
}
class ut extends ct {
  constructor(e) {
    super(), Object.assign(this, { blob: e, size: e.size });
  }
  async readUint8Array(e, t) {
    const i = e + t,
      r = e || i < this.size ? this.blob.slice(e, i) : this.blob;
    let a = await r.arrayBuffer();
    return a.byteLength > t && (a = a.slice(e, i)), new Uint8Array(a);
  }
}
class dt extends lt {
  constructor(e) {
    super();
    const t = new TransformStream(),
      n = [];
    e && n.push(["Content-Type", e]),
      Object.defineProperty(this, ot, { get: () => t.writable }),
      (this.blob = new Response(t.readable, { headers: n }).blob());
  }
  getData() {
    return this.blob;
  }
}
class ft extends dt {
  constructor(e) {
    super(e), Object.assign(this, { encoding: e, utf8: !e || "utf-8" == e.toLowerCase() });
  }
  async getData() {
    const { encoding: e, utf8: t } = this,
      n = await super.getData();
    if (n.text && t) return n.text();
    {
      const t = new FileReader();
      return new Promise((i, r) => {
        Object.assign(t, { onload: ({ target: e }) => i(e.result), onerror: () => r(t.error) }),
          t.readAsText(n, e);
      });
    }
  }
}
class ht extends ct {
  constructor(e) {
    super(), (this.readers = e);
  }
  async init() {
    const { readers: t } = this;
    (this.lastDiskNumber = 0),
      (this.lastDiskOffset = 0),
      await Promise.all(
        t.map(async (n, i) => {
          await n.init(),
            i != t.length - 1 && (this.lastDiskOffset += n.size),
            (this.size += n.size);
        }),
      ),
      super.init();
  }
  async readUint8Array(e, t, n = 0) {
    const { readers: r } = this;
    let a,
      s = n;
    -1 == s && (s = r.length - 1);
    let o = e;
    while (o >= r[s].size) (o -= r[s].size), s++;
    const l = r[s],
      c = l.size;
    if (o + t <= c) a = await pt(l, o, t);
    else {
      const r = c - o;
      (a = new Uint8Array(t)),
        a.set(await pt(l, o, r)),
        a.set(await this.readUint8Array(e + r, t - r, n), r);
    }
    return (this.lastDiskNumber = Math.max(s, this.lastDiskNumber)), a;
  }
}
class wt extends lt {
  constructor(e, t = 4294967295) {
    super();
    const n = this;
    let i, r, a;
    Object.assign(n, { diskNumber: 0, diskOffset: 0, size: 0, maxSize: t, availableSize: t });
    const s = new WritableStream({
      async write(t) {
        const { availableSize: s } = n;
        if (a)
          t.length >= s
            ? (await o(t.slice(0, s)),
              await l(),
              (n.diskOffset += i.size),
              n.diskNumber++,
              (a = null),
              await this.write(t.slice(s)))
            : await o(t);
        else {
          const { value: s, done: o } = await e.next();
          if (o && !s) throw new Error("Writer iterator completed too soon");
          (i = s),
            (i.size = 0),
            i.maxSize && (n.maxSize = i.maxSize),
            (n.availableSize = n.maxSize),
            await _t(i),
            (r = s.writable),
            (a = r.getWriter()),
            await this.write(t);
        }
      },
      async close() {
        await a.ready, await l();
      },
    });
    async function o(e) {
      const t = e.length;
      t && (await a.ready, await a.write(e), (i.size += t), (n.size += t), (n.availableSize -= t));
    }
    async function l() {
      (r.size = i.size), await a.close();
    }
    Object.defineProperty(n, ot, { get: () => s });
  }
}
async function _t(e, t) {
  if (!e.init || e.initialized) return Promise.resolve();
  await e.init(t);
}
function bt(e) {
  return (
    Array.isArray(e) && (e = new ht(e)), e instanceof ReadableStream && (e = { readable: e }), e
  );
}
function pt(e, t, n, i) {
  return e.readUint8Array(t, n, i);
}
const mt =
    "\0☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼ !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~⌂ÇüéâäàåçêëèïîìÄÅÉæÆôöòûùÿÖÜ¢£¥₧ƒáíóúñÑªº¿⌐¬½¼¡«»░▒▓│┤╡╢╖╕╣║╗╝╜╛┐└┴┬├─┼╞╟╚╔╩╦╠═╬╧╨╤╥╙╘╒╓╫╪┘┌█▄▌▐▀αßΓπΣσµτΦΘΩδ∞φε∩≡±≥≤⌠⌡÷≈°∙·√ⁿ²■ ".split(
      "",
    ),
  gt = 256 == mt.length;
function yt(e, t) {
  return t && "cp437" == t.trim().toLowerCase()
    ? ((e) => {
        if (gt) {
          let t = "";
          for (let n = 0; n < e.length; n++) t += mt[e[n]];
          return t;
        }
        return new TextDecoder().decode(e);
      })(e)
    : new TextDecoder(t).decode(e);
}
const xt = "filename",
  kt = "rawFilename",
  vt = "comment",
  St = "rawComment",
  zt = "uncompressedSize",
  At = "compressedSize",
  Ut = "offset",
  Dt = "diskNumberStart",
  Et = "lastModDate",
  Tt = "rawLastModDate",
  Ft = "lastAccessDate",
  Ot = "rawLastAccessDate",
  Ct = "creationDate",
  Wt = "rawCreationDate",
  jt = [
    xt,
    kt,
    At,
    zt,
    Et,
    Tt,
    vt,
    St,
    Ft,
    Ct,
    Ut,
    Dt,
    Dt,
    "internalFileAttribute",
    "externalFileAttribute",
    "msDosCompatible",
    "zip64",
    "encrypted",
    "version",
    "versionMadeBy",
    "zipCrypto",
    "directory",
    "bitFlag",
    "signature",
    "filenameUTF8",
    "commentUTF8",
    "compressionMethod",
    "extraField",
    "rawExtraField",
    "extraFieldZip64",
    "extraFieldUnicodePath",
    "extraFieldUnicodeComment",
    "extraFieldAES",
    "extraFieldNTFS",
    "extraFieldExtendedTimestamp",
  ];
class Mt {
  constructor(e) {
    jt.forEach((t) => (this[t] = e[t]));
  }
}
const Lt = "File format is not recognized",
  Pt = "Zip64 extra field not found",
  Rt = "Compression method not supported",
  Bt = "Split zip file",
  It = "utf-8",
  Nt = "cp437",
  Vt = [
    [zt, g],
    [At, g],
    [Ut, g],
    [Dt, y],
  ],
  qt = { [y]: { getValue: tn, bytes: 4 }, [g]: { getValue: nn, bytes: 8 } };
class Ht {
  constructor(e, t = {}) {
    Object.assign(this, { reader: bt(e), options: t, config: T });
  }
  async *getEntriesGenerator(e = {}) {
    let { reader: n } = this;
    const { config: i } = this;
    if (
      (await _t(n),
      (n.size !== S && n.readUint8Array) ||
        ((n = new ut(await new Response(n.readable).blob())), await _t(n)),
      n.size < v)
    )
      throw new Error(Lt);
    n.chunkSize = ((e) => Math.max(e.chunkSize, 64))(i);
    const r = await (async (e, t, n, i, r) => {
      const a = new Uint8Array(4);
      !((e, t, n) => {
        e.setUint32(t, n, !0);
      })(rn(a), 0, t);
      const s = i + r;
      return (await o(i)) || (await o(Math.min(s, n)));
      async function o(t) {
        const r = n - t,
          s = await pt(e, r, t);
        for (let e = s.length - i; e >= 0; e--)
          if (s[e] == a[0] && s[e + 1] == a[1] && s[e + 2] == a[2] && s[e + 3] == a[3])
            return { offset: r + e, buffer: s.slice(e, e + i).buffer };
      }
    })(n, 101010256, n.size, v, 1048560);
    if (!r) {
      throw 134695760 == tn(rn(await pt(n, 0, 4)))
        ? new Error(Bt)
        : new Error("End of central directory not found");
    }
    const a = rn(r);
    let s = tn(a, 12),
      o = tn(a, 16);
    const l = r.offset,
      c = en(a, 20),
      u = l + v + c;
    let d = en(a, 4);
    const f = n.lastDiskNumber || 0;
    let h = en(a, 6),
      w = en(a, 8),
      _ = 0,
      b = 0;
    if (o == g || s == g || w == y || h == y) {
      const e = rn(await pt(n, r.offset - 20, 20));
      if (117853008 == tn(e, 0)) {
        o = nn(e, 8);
        let t = await pt(n, o, 56, -1),
          i = rn(t);
        const a = r.offset - 20 - 56;
        if (tn(i, 0) != k && o != a) {
          const e = o;
          (o = a), (_ = o - e), (t = await pt(n, o, 56, -1)), (i = rn(t));
        }
        if (tn(i, 0) != k) throw new Error("End of Zip64 central directory locator not found");
        d == y && (d = tn(i, 16)),
          h == y && (h = tn(i, 20)),
          w == y && (w = nn(i, 32)),
          s == g && (s = nn(i, 40)),
          (o -= s);
      }
    }
    if ((o >= n.size && ((_ = n.size - o - s - v), (o = n.size - s - v)), f != d))
      throw new Error(Bt);
    if (o < 0) throw new Error(Lt);
    let p = 0,
      m = await pt(n, o, s, h),
      z = rn(m);
    if (s) {
      const e = r.offset - s;
      if (tn(z, p) != x && o != e) {
        const t = o;
        (o = e), (_ += o - t), (m = await pt(n, o, s, h)), (z = rn(m));
      }
    }
    const A = r.offset - o - (n.lastDiskOffset || 0);
    if (
      (s != A && A >= 0 && ((s = A), (m = await pt(n, o, s, h)), (z = rn(m))), o < 0 || o >= n.size)
    )
      throw new Error(Lt);
    const U = Qt(this, e, "filenameEncoding"),
      D = Qt(this, e, "commentEncoding");
    for (let r = 0; r < w; r++) {
      const a = new Kt(n, i, this.options);
      if (tn(z, p) != x) throw new Error("Central directory header not found");
      Zt(a, z, p + 6);
      const s = Boolean(a.bitFlag.languageEncodingFlag),
        o = p + 46,
        l = o + a.filenameLength,
        c = l + a.extraFieldLength,
        u = en(z, p + 4),
        d = !0,
        f = m.subarray(o, l),
        h = en(z, p + 32),
        g = c + h,
        y = m.subarray(c, g),
        k = s,
        v = s,
        A = d && !(16 & ~$t(z, p + 38)),
        E = tn(z, p + 42) + _;
      Object.assign(a, {
        versionMadeBy: u,
        msDosCompatible: d,
        compressedSize: 0,
        uncompressedSize: 0,
        commentLength: h,
        directory: A,
        offset: E,
        diskNumberStart: en(z, p + 34),
        internalFileAttribute: en(z, p + 36),
        externalFileAttribute: tn(z, p + 38),
        rawFilename: f,
        filenameUTF8: k,
        commentUTF8: v,
        rawExtraField: m.subarray(l, c),
      });
      const T = Qt(this, e, "decodeText") || yt,
        F = k ? It : U || Nt,
        O = v ? It : D || Nt;
      let C = T(f, F);
      C === S && (C = yt(f, F));
      let W = T(y, O);
      W === S && (W = yt(y, O)),
        Object.assign(a, {
          rawComment: y,
          filename: C,
          comment: W,
          directory: A || C.endsWith("/"),
        }),
        (b = Math.max(E, b)),
        await Gt(a, a, z, p + 6),
        (a.zipCrypto = a.encrypted && !a.extraFieldAES);
      const j = new Mt(a);
      (j.getData = (e, t) => a.getData(e, j, t)), (p = g);
      const { onprogress: M } = e;
      if (M)
        try {
          await M(r + 1, w, new Mt(a));
        } catch (e) {}
      yield j;
    }
    const E = Qt(this, e, "extractPrependedData"),
      T = Qt(this, e, "extractAppendedData");
    return (
      E && (this.prependedData = b > 0 ? await pt(n, 0, b) : new Uint8Array()),
      (this.comment = c ? await pt(n, l + v, c) : new Uint8Array()),
      T && (this.appendedData = u < n.size ? await pt(n, u, n.size - u) : new Uint8Array()),
      !0
    );
  }
  async getEntries(e = {}) {
    const t = [];
    for await (const n of this.getEntriesGenerator(e)) t.push(n);
    return t;
  }
  async close() {}
}
class Kt {
  constructor(e, t, n) {
    Object.assign(this, { reader: e, config: t, options: n });
  }
  async getData(e, t, n = {}) {
    const {
        reader: r,
        offset: a,
        diskNumberStart: s,
        extraFieldAES: o,
        compressionMethod: l,
        config: c,
        bitFlag: u,
        signature: d,
        rawLastModDate: f,
        uncompressedSize: h,
        compressedSize: w,
      } = this,
      _ = (t.localDirectory = {}),
      b = rn(await pt(r, a, 30, s));
    let p = Qt(this, n, "password"),
      m = Qt(this, n, "rawPassword");
    const g = Qt(this, n, "passThrough");
    if (
      ((p = p && p.length && p), (m = m && m.length && m), o && 99 != o.originalCompressionMethod)
    )
      throw new Error(Rt);
    if (0 != l && 8 != l && !g) throw new Error(Rt);
    if (67324752 != tn(b, 0)) throw new Error("Local file header not found");
    Zt(_, b, 4),
      (_.rawExtraField = _.extraFieldLength
        ? await pt(r, a + 30 + _.filenameLength, _.extraFieldLength, s)
        : new Uint8Array()),
      await Gt(this, _, b, 4, !0),
      Object.assign(t, { lastAccessDate: _.lastAccessDate, creationDate: _.creationDate });
    const y = this.encrypted && _.encrypted && !g,
      x = y && !o;
    if ((g || (t.zipCrypto = x), y)) {
      if (!x && o.strength === S) throw new Error("Encryption method not supported");
      if (!p && !m) throw new Error("File contains encrypted entry");
    }
    const k = a + 30 + _.filenameLength + _.extraFieldLength,
      v = w,
      z = r.readable;
    Object.assign(z, { diskNumberStart: s, offset: k, size: v });
    const U = Qt(this, n, "signal"),
      D = Qt(this, n, "checkPasswordOnly");
    D && (e = new WritableStream()),
      (e = ((e) => {
        e.writable === S && typeof e.next == A && (e = new wt(e)),
          e instanceof WritableStream && (e = { writable: e });
        const { writable: t } = e;
        return (
          t.size === S && (t.size = 0),
          e instanceof wt ||
            Object.assign(e, {
              diskNumber: 0,
              diskOffset: 0,
              availableSize: 1 / 0,
              maxSize: 1 / 0,
            }),
          e
        );
      })(e)),
      await _t(e, g ? w : h);
    const { writable: E } = e,
      { onstart: T, onprogress: F, onend: O } = n,
      C = {
        options: {
          codecType: Ve,
          password: p,
          rawPassword: m,
          zipCrypto: x,
          encryptionStrength: o && o.strength,
          signed: Qt(this, n, "checkSignature") && !g,
          passwordVerification: x && (u.dataDescriptor ? (f >>> 8) & 255 : (d >>> 24) & 255),
          signature: d,
          compressed: 0 != l && !g,
          encrypted: this.encrypted && !g,
          useWebWorkers: Qt(this, n, "useWebWorkers"),
          useCompressionStream: Qt(this, n, "useCompressionStream"),
          transferStreams: Qt(this, n, "transferStreams"),
          checkPasswordOnly: D,
        },
        config: c,
        streamOptions: { signal: U, size: v, onstart: T, onprogress: F, onend: O },
      };
    let W = 0;
    try {
      ({ outputSize: W } = await rt({ readable: z, writable: E }, C));
    } catch (e) {
      if (!D || e.message != K) throw e;
    } finally {
      const e = Qt(this, n, "preventClose");
      (E.size += W), e || E.locked || (await E.getWriter().close());
    }
    return D ? S : e.getData ? e.getData() : E;
  }
}
function Zt(e, t, n) {
  const i = (e.rawBitFlag = en(t, n + 2)),
    r = !(1 & ~i),
    a = tn(t, n + 6);
  Object.assign(e, {
    encrypted: r,
    version: en(t, n),
    bitFlag: { level: (6 & i) >> 1, dataDescriptor: !(8 & ~i), languageEncodingFlag: !(2048 & ~i) },
    rawLastModDate: a,
    lastModDate: Xt(a),
    filenameLength: en(t, n + 22),
    extraFieldLength: en(t, n + 24),
  });
}
async function Gt(e, t, n, i, r) {
  const { rawExtraField: a } = t,
    s = (t.extraField = new Map()),
    o = rn(new Uint8Array(a));
  let l = 0;
  try {
    while (l < a.length) {
      const e = en(o, l),
        t = en(o, l + 2);
      s.set(e, { type: e, data: a.slice(l + 4, l + 4 + t) }), (l += 4 + t);
    }
  } catch (e) {}
  const c = en(n, i + 4);
  Object.assign(t, {
    signature: tn(n, i + 10),
    uncompressedSize: tn(n, i + 18),
    compressedSize: tn(n, i + 14),
  });
  const u = s.get(1);
  u &&
    (!((e, t) => {
      t.zip64 = !0;
      const n = rn(e.data),
        i = Vt.filter(([e, n]) => t[e] == n);
      for (let r = 0, a = 0; r < i.length; r++) {
        const [s, o] = i[r];
        if (t[s] == o) {
          const i = qt[o];
          (t[s] = e[s] = i.getValue(n, a)), (a += i.bytes);
        } else if (e[s]) throw new Error(Pt);
      }
    })(u, t),
    (t.extraFieldZip64 = u));
  const d = s.get(28789);
  d && (await Jt(d, xt, kt, t, e), (t.extraFieldUnicodePath = d));
  const f = s.get(25461);
  f && (await Jt(f, vt, St, t, e), (t.extraFieldUnicodeComment = f));
  const h = s.get(39169);
  h
    ? (!((e, t, n) => {
        const i = rn(e.data),
          r = $t(i, 4);
        Object.assign(e, {
          vendorVersion: $t(i, 0),
          vendorId: $t(i, 2),
          strength: r,
          originalCompressionMethod: n,
          compressionMethod: en(i, 5),
        }),
          (t.compressionMethod = e.compressionMethod);
      })(h, t, c),
      (t.extraFieldAES = h))
    : (t.compressionMethod = c);
  const w = s.get(10);
  w &&
    (!((e, t) => {
      const n = rn(e.data);
      let i,
        r = 4;
      try {
        while (r < e.data.length && !i) {
          const t = en(n, r),
            a = en(n, r + 2);
          1 == t && (i = e.data.slice(r + 4, r + 4 + a)), (r += 4 + a);
        }
      } catch (e) {}
      try {
        if (i && 24 == i.length) {
          const n = rn(i),
            r = n.getBigUint64(0, !0),
            a = n.getBigUint64(8, !0),
            s = n.getBigUint64(16, !0);
          Object.assign(e, { rawLastModDate: r, rawLastAccessDate: a, rawCreationDate: s });
          const o = Yt(r),
            l = Yt(a),
            c = { lastModDate: o, lastAccessDate: l, creationDate: Yt(s) };
          Object.assign(e, c), Object.assign(t, c);
        }
      } catch (e) {}
    })(w, t),
    (t.extraFieldNTFS = w));
  const _ = s.get(21589);
  _ &&
    (!((e, t, n) => {
      const i = rn(e.data),
        r = $t(i, 0),
        a = [],
        s = [];
      n
        ? (1 & ~r || (a.push(Et), s.push(Tt)),
          2 & ~r || (a.push(Ft), s.push(Ot)),
          4 & ~r || (a.push(Ct), s.push(Wt)))
        : e.data.length >= 5 && (a.push(Et), s.push(Tt));
      let o = 1;
      a.forEach((n, r) => {
        if (e.data.length >= o + 4) {
          const a = tn(i, o);
          t[n] = e[n] = new Date(1e3 * a);
          const l = s[r];
          e[l] = a;
        }
        o += 4;
      });
    })(_, t, r),
    (t.extraFieldExtendedTimestamp = _));
  const b = s.get(6534);
  b && (t.extraFieldUSDZ = b);
}
async function Jt(e, t, n, i, r) {
  const a = rn(e.data),
    s = new W();
  s.append(r[n]);
  const o = rn(new Uint8Array(4));
  o.setUint32(0, s.get(), !0);
  const l = tn(a, 1);
  Object.assign(e, {
    version: $t(a, 0),
    [t]: yt(e.data.subarray(5)),
    valid: !r.bitFlag.languageEncodingFlag && l == tn(o, 0),
  }),
    e.valid && ((i[t] = e[t]), (i[t + "UTF8"] = !0));
}
function Qt(e, t, n) {
  return t[n] === S ? e.options[n] : t[n];
}
function Xt(e) {
  const t = (4294901760 & e) >> 16,
    n = 65535 & e;
  try {
    return new Date(
      1980 + ((65024 & t) >> 9),
      ((480 & t) >> 5) - 1,
      31 & t,
      (63488 & n) >> 11,
      (2016 & n) >> 5,
      2 * (31 & n),
      0,
    );
  } catch (e) {}
}
function Yt(e) {
  return new Date(Number(e / BigInt(1e4) - BigInt(116444736e5)));
}
function $t(e, t) {
  return e.getUint8(t);
}
function en(e, t) {
  return e.getUint16(t, !0);
}
function tn(e, t) {
  return e.getUint32(t, !0);
}
function nn(e, t) {
  return Number(e.getBigUint64(t, !0));
}
function rn(e) {
  return new DataView(e.buffer);
}
F({
  Inflate: function (e) {
    const t = new m(),
      i = e && e.chunkSize ? Math.floor(2 * e.chunkSize) : 131072,
      r = new Uint8Array(i);
    let a = !1;
    t.inflateInit(),
      (t.next_out = r),
      (this.append = (e, s) => {
        const o = [];
        let l,
          c,
          u = 0,
          d = 0,
          f = 0;
        if (0 !== e.length) {
          (t.next_in_index = 0), (t.next_in = e), (t.avail_in = e.length);
          do {
            if (
              ((t.next_out_index = 0),
              (t.avail_out = i),
              0 !== t.avail_in || a || ((t.next_in_index = 0), (a = !0)),
              (l = t.inflate(0)),
              a && l === n)
            ) {
              if (0 !== t.avail_in) throw new Error("inflating: bad input");
            } else if (0 !== l && 1 !== l) throw new Error("inflating: " + t.msg);
            if ((a || 1 === l) && t.avail_in === e.length) throw new Error("inflating: bad input");
            t.next_out_index &&
              (t.next_out_index === i
                ? o.push(new Uint8Array(r))
                : o.push(r.subarray(0, t.next_out_index))),
              (f += t.next_out_index),
              s &&
                t.next_in_index > 0 &&
                t.next_in_index != u &&
                (s(t.next_in_index), (u = t.next_in_index));
          } while (t.avail_in > 0 || 0 === t.avail_out);
          return (
            o.length > 1
              ? ((c = new Uint8Array(f)),
                o.forEach((e) => {
                  c.set(e, d), (d += e.length);
                }))
              : (c = o[0] ? new Uint8Array(o[0]) : new Uint8Array()),
            c
          );
        }
      }),
      (this.flush = () => {
        t.inflateEnd();
      });
  },
});
export { ut as BlobReader, dt as BlobWriter, ft as TextWriter, Ht as ZipReader, F as configure };
