var ei = Object.defineProperty;
var ni = (i, t, n) => t in i ? ei(i, t, { enumerable: !0, configurable: !0, writable: !0, value: n }) : i[t] = n;
var ee = (i, t, n) => (ni(i, typeof t != "symbol" ? t + "" : t, n), n), $e = (i, t, n) => {
  if (!t.has(i))
    throw TypeError("Cannot " + n);
};
var r = (i, t, n) => ($e(i, t, "read from private field"), n ? n.call(i) : t.get(i)), W = (i, t, n) => {
  if (t.has(i))
    throw TypeError("Cannot add the same private member more than once");
  t instanceof WeakSet ? t.add(i) : t.set(i, n);
}, ot = (i, t, n, e) => ($e(i, t, "write to private field"), e ? e.call(i, n) : t.set(i, n), n);
var ge = (i, t, n, e) => ({
  set _(s) {
    ot(i, t, s, n);
  },
  get _() {
    return r(i, t, e);
  }
}), J = (i, t, n) => ($e(i, t, "access private method"), n);
const {
  SvelteComponent: SvelteComponent$e,
  append: append$d,
  attr: attr$d,
  detach: detach$e,
  init: init$e,
  insert: insert$e,
  noop: noop$7,
  safe_not_equal: safe_not_equal$f,
  set_style: set_style$6,
  svg_element: svg_element$5
} = window.__gradio__svelte__internal;
function create_fragment$e(i) {
  let t, n, e, s;
  return {
    c() {
      t = svg_element$5("svg"), n = svg_element$5("g"), e = svg_element$5("path"), s = svg_element$5("path"), attr$d(e, "d", "M18,6L6.087,17.913"), set_style$6(e, "fill", "none"), set_style$6(e, "fill-rule", "nonzero"), set_style$6(e, "stroke-width", "2px"), attr$d(n, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), attr$d(s, "d", "M4.364,4.364L19.636,19.636"), set_style$6(s, "fill", "none"), set_style$6(s, "fill-rule", "nonzero"), set_style$6(s, "stroke-width", "2px"), attr$d(t, "width", "100%"), attr$d(t, "height", "100%"), attr$d(t, "viewBox", "0 0 24 24"), attr$d(t, "version", "1.1"), attr$d(t, "xmlns", "http://www.w3.org/2000/svg"), attr$d(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), attr$d(t, "xml:space", "preserve"), attr$d(t, "stroke", "currentColor"), set_style$6(t, "fill-rule", "evenodd"), set_style$6(t, "clip-rule", "evenodd"), set_style$6(t, "stroke-linecap", "round"), set_style$6(t, "stroke-linejoin", "round");
    },
    m(p, f) {
      insert$e(p, t, f), append$d(t, n), append$d(n, e), append$d(t, s);
    },
    p: noop$7,
    i: noop$7,
    o: noop$7,
    d(p) {
      p && detach$e(t);
    }
  };
}
class Clear extends SvelteComponent$e {
  constructor(t) {
    super(), init$e(this, t, null, create_fragment$e, safe_not_equal$f, {});
  }
}
const {
  SvelteComponent: SvelteComponent$d,
  append: append$c,
  attr: attr$c,
  detach: detach$d,
  init: init$d,
  insert: insert$d,
  noop: noop$6,
  safe_not_equal: safe_not_equal$e,
  svg_element: svg_element$4
} = window.__gradio__svelte__internal;
function create_fragment$d(i) {
  let t, n;
  return {
    c() {
      t = svg_element$4("svg"), n = svg_element$4("path"), attr$c(n, "d", "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z"), attr$c(t, "xmlns", "http://www.w3.org/2000/svg"), attr$c(t, "width", "100%"), attr$c(t, "height", "100%"), attr$c(t, "viewBox", "0 0 24 24"), attr$c(t, "fill", "none"), attr$c(t, "stroke", "currentColor"), attr$c(t, "stroke-width", "1.5"), attr$c(t, "stroke-linecap", "round"), attr$c(t, "stroke-linejoin", "round"), attr$c(t, "class", "feather feather-edit-2");
    },
    m(e, s) {
      insert$d(e, t, s), append$c(t, n);
    },
    p: noop$6,
    i: noop$6,
    o: noop$6,
    d(e) {
      e && detach$d(t);
    }
  };
}
class Edit extends SvelteComponent$d {
  constructor(t) {
    super(), init$d(this, t, null, create_fragment$d, safe_not_equal$e, {});
  }
}
const {
  SvelteComponent: SvelteComponent$c,
  append: append$b,
  attr: attr$b,
  detach: detach$c,
  init: init$c,
  insert: insert$c,
  noop: noop$5,
  safe_not_equal: safe_not_equal$d,
  svg_element: svg_element$3
} = window.__gradio__svelte__internal;
function create_fragment$c(i) {
  let t, n, e;
  return {
    c() {
      t = svg_element$3("svg"), n = svg_element$3("path"), e = svg_element$3("polyline"), attr$b(n, "d", "M13 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z"), attr$b(e, "points", "13 2 13 9 20 9"), attr$b(t, "xmlns", "http://www.w3.org/2000/svg"), attr$b(t, "width", "100%"), attr$b(t, "height", "100%"), attr$b(t, "viewBox", "0 0 24 24"), attr$b(t, "fill", "none"), attr$b(t, "stroke", "currentColor"), attr$b(t, "stroke-width", "1.5"), attr$b(t, "stroke-linecap", "round"), attr$b(t, "stroke-linejoin", "round"), attr$b(t, "class", "feather feather-file");
    },
    m(s, p) {
      insert$c(s, t, p), append$b(t, n), append$b(t, e);
    },
    p: noop$5,
    i: noop$5,
    o: noop$5,
    d(s) {
      s && detach$c(t);
    }
  };
}
let File$1 = class extends SvelteComponent$c {
  constructor(t) {
    super(), init$c(this, t, null, create_fragment$c, safe_not_equal$d, {});
  }
};
const {
  SvelteComponent: SvelteComponent$b,
  append: append$a,
  attr: attr$a,
  detach: detach$b,
  init: init$b,
  insert: insert$b,
  noop: noop$4,
  safe_not_equal: safe_not_equal$c,
  svg_element: svg_element$2
} = window.__gradio__svelte__internal;
function create_fragment$b(i) {
  let t, n, e;
  return {
    c() {
      t = svg_element$2("svg"), n = svg_element$2("polyline"), e = svg_element$2("path"), attr$a(n, "points", "1 4 1 10 7 10"), attr$a(e, "d", "M3.51 15a9 9 0 1 0 2.13-9.36L1 10"), attr$a(t, "xmlns", "http://www.w3.org/2000/svg"), attr$a(t, "width", "100%"), attr$a(t, "height", "100%"), attr$a(t, "viewBox", "0 0 24 24"), attr$a(t, "fill", "none"), attr$a(t, "stroke", "currentColor"), attr$a(t, "stroke-width", "2"), attr$a(t, "stroke-linecap", "round"), attr$a(t, "stroke-linejoin", "round"), attr$a(t, "class", "feather feather-rotate-ccw");
    },
    m(s, p) {
      insert$b(s, t, p), append$a(t, n), append$a(t, e);
    },
    p: noop$4,
    i: noop$4,
    o: noop$4,
    d(s) {
      s && detach$b(t);
    }
  };
}
class Undo extends SvelteComponent$b {
  constructor(t) {
    super(), init$b(this, t, null, create_fragment$b, safe_not_equal$c, {});
  }
}
const {
  SvelteComponent: SvelteComponent$a,
  append: append$9,
  attr: attr$9,
  detach: detach$a,
  init: init$a,
  insert: insert$a,
  noop: noop$3,
  safe_not_equal: safe_not_equal$b,
  svg_element: svg_element$1
} = window.__gradio__svelte__internal;
function create_fragment$a(i) {
  let t, n, e, s;
  return {
    c() {
      t = svg_element$1("svg"), n = svg_element$1("path"), e = svg_element$1("polyline"), s = svg_element$1("line"), attr$9(n, "d", "M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"), attr$9(e, "points", "17 8 12 3 7 8"), attr$9(s, "x1", "12"), attr$9(s, "y1", "3"), attr$9(s, "x2", "12"), attr$9(s, "y2", "15"), attr$9(t, "xmlns", "http://www.w3.org/2000/svg"), attr$9(t, "width", "90%"), attr$9(t, "height", "90%"), attr$9(t, "viewBox", "0 0 24 24"), attr$9(t, "fill", "none"), attr$9(t, "stroke", "currentColor"), attr$9(t, "stroke-width", "2"), attr$9(t, "stroke-linecap", "round"), attr$9(t, "stroke-linejoin", "round"), attr$9(t, "class", "feather feather-upload");
    },
    m(p, f) {
      insert$a(p, t, f), append$9(t, n), append$9(t, e), append$9(t, s);
    },
    p: noop$3,
    i: noop$3,
    o: noop$3,
    d(p) {
      p && detach$a(t);
    }
  };
}
let Upload$1 = class extends SvelteComponent$a {
  constructor(t) {
    super(), init$a(this, t, null, create_fragment$a, safe_not_equal$b, {});
  }
};
const {
  SvelteComponent: SvelteComponent$9,
  append: append$8,
  attr: attr$8,
  create_component: create_component$5,
  destroy_component: destroy_component$5,
  detach: detach$9,
  element: element$9,
  init: init$9,
  insert: insert$9,
  mount_component: mount_component$5,
  safe_not_equal: safe_not_equal$a,
  text: text$4,
  toggle_class: toggle_class$8,
  transition_in: transition_in$8,
  transition_out: transition_out$8
} = window.__gradio__svelte__internal;
function create_fragment$9(i) {
  let t, n, e, s, p, f, A;
  return e = new Upload$1({}), {
    c() {
      t = element$9("div"), n = element$9("span"), create_component$5(e.$$.fragment), s = text$4(`
    Drop PDF
    `), p = element$9("span"), p.textContent = "- or -", f = text$4(`
    Click to Upload`), attr$8(n, "class", "icon-wrap svelte-kzcjhc"), toggle_class$8(
        n,
        "hovered",
        /*hovered*/
        i[0]
      ), attr$8(p, "class", "or svelte-kzcjhc"), attr$8(t, "class", "wrap svelte-kzcjhc");
    },
    m(a, h) {
      insert$9(a, t, h), append$8(t, n), mount_component$5(e, n, null), append$8(t, s), append$8(t, p), append$8(t, f), A = !0;
    },
    p(a, [h]) {
      (!A || h & /*hovered*/
      1) && toggle_class$8(
        n,
        "hovered",
        /*hovered*/
        a[0]
      );
    },
    i(a) {
      A || (transition_in$8(e.$$.fragment, a), A = !0);
    },
    o(a) {
      transition_out$8(e.$$.fragment, a), A = !1;
    },
    d(a) {
      a && detach$9(t), destroy_component$5(e);
    }
  };
}
function instance$9(i, t, n) {
  let { hovered: e = !1 } = t;
  return i.$$set = (s) => {
    "hovered" in s && n(0, e = s.hovered);
  }, [e];
}
class PdfUploadText extends SvelteComponent$9 {
  constructor(t) {
    super(), init$9(this, t, instance$9, create_fragment$9, safe_not_equal$a, { hovered: 0 });
  }
}
const {
  SvelteComponent: SvelteComponent$8,
  assign: assign$1,
  create_slot: create_slot$3,
  detach: detach$8,
  element: element$8,
  get_all_dirty_from_scope: get_all_dirty_from_scope$3,
  get_slot_changes: get_slot_changes$3,
  get_spread_update: get_spread_update$1,
  init: init$8,
  insert: insert$8,
  safe_not_equal: safe_not_equal$9,
  set_dynamic_element_data,
  set_style: set_style$5,
  toggle_class: toggle_class$7,
  transition_in: transition_in$7,
  transition_out: transition_out$7,
  update_slot_base: update_slot_base$3
} = window.__gradio__svelte__internal;
function create_dynamic_element(i) {
  let t, n, e;
  const s = (
    /*#slots*/
    i[17].default
  ), p = create_slot$3(
    s,
    i,
    /*$$scope*/
    i[16],
    null
  );
  let f = [
    { "data-testid": (
      /*test_id*/
      i[7]
    ) },
    { id: (
      /*elem_id*/
      i[2]
    ) },
    {
      class: n = "block " + /*elem_classes*/
      i[3].join(" ") + " svelte-1t38q2d"
    }
  ], A = {};
  for (let a = 0; a < f.length; a += 1)
    A = assign$1(A, f[a]);
  return {
    c() {
      t = element$8(
        /*tag*/
        i[14]
      ), p && p.c(), set_dynamic_element_data(
        /*tag*/
        i[14]
      )(t, A), toggle_class$7(
        t,
        "hidden",
        /*visible*/
        i[10] === !1
      ), toggle_class$7(
        t,
        "padded",
        /*padding*/
        i[6]
      ), toggle_class$7(
        t,
        "border_focus",
        /*border_mode*/
        i[5] === "focus"
      ), toggle_class$7(t, "hide-container", !/*explicit_call*/
      i[8] && !/*container*/
      i[9]), set_style$5(t, "height", typeof /*height*/
      i[0] == "number" ? (
        /*height*/
        i[0] + "px"
      ) : void 0), set_style$5(t, "width", typeof /*width*/
      i[1] == "number" ? `calc(min(${/*width*/
      i[1]}px, 100%))` : void 0), set_style$5(
        t,
        "border-style",
        /*variant*/
        i[4]
      ), set_style$5(
        t,
        "overflow",
        /*allow_overflow*/
        i[11] ? "visible" : "hidden"
      ), set_style$5(
        t,
        "flex-grow",
        /*scale*/
        i[12]
      ), set_style$5(t, "min-width", `calc(min(${/*min_width*/
      i[13]}px, 100%))`), set_style$5(t, "border-width", "var(--block-border-width)");
    },
    m(a, h) {
      insert$8(a, t, h), p && p.m(t, null), e = !0;
    },
    p(a, h) {
      p && p.p && (!e || h & /*$$scope*/
      65536) && update_slot_base$3(
        p,
        s,
        a,
        /*$$scope*/
        a[16],
        e ? get_slot_changes$3(
          s,
          /*$$scope*/
          a[16],
          h,
          null
        ) : get_all_dirty_from_scope$3(
          /*$$scope*/
          a[16]
        ),
        null
      ), set_dynamic_element_data(
        /*tag*/
        a[14]
      )(t, A = get_spread_update$1(f, [
        (!e || h & /*test_id*/
        128) && { "data-testid": (
          /*test_id*/
          a[7]
        ) },
        (!e || h & /*elem_id*/
        4) && { id: (
          /*elem_id*/
          a[2]
        ) },
        (!e || h & /*elem_classes*/
        8 && n !== (n = "block " + /*elem_classes*/
        a[3].join(" ") + " svelte-1t38q2d")) && { class: n }
      ])), toggle_class$7(
        t,
        "hidden",
        /*visible*/
        a[10] === !1
      ), toggle_class$7(
        t,
        "padded",
        /*padding*/
        a[6]
      ), toggle_class$7(
        t,
        "border_focus",
        /*border_mode*/
        a[5] === "focus"
      ), toggle_class$7(t, "hide-container", !/*explicit_call*/
      a[8] && !/*container*/
      a[9]), h & /*height*/
      1 && set_style$5(t, "height", typeof /*height*/
      a[0] == "number" ? (
        /*height*/
        a[0] + "px"
      ) : void 0), h & /*width*/
      2 && set_style$5(t, "width", typeof /*width*/
      a[1] == "number" ? `calc(min(${/*width*/
      a[1]}px, 100%))` : void 0), h & /*variant*/
      16 && set_style$5(
        t,
        "border-style",
        /*variant*/
        a[4]
      ), h & /*allow_overflow*/
      2048 && set_style$5(
        t,
        "overflow",
        /*allow_overflow*/
        a[11] ? "visible" : "hidden"
      ), h & /*scale*/
      4096 && set_style$5(
        t,
        "flex-grow",
        /*scale*/
        a[12]
      ), h & /*min_width*/
      8192 && set_style$5(t, "min-width", `calc(min(${/*min_width*/
      a[13]}px, 100%))`);
    },
    i(a) {
      e || (transition_in$7(p, a), e = !0);
    },
    o(a) {
      transition_out$7(p, a), e = !1;
    },
    d(a) {
      a && detach$8(t), p && p.d(a);
    }
  };
}
function create_fragment$8(i) {
  let t, n = (
    /*tag*/
    i[14] && create_dynamic_element(i)
  );
  return {
    c() {
      n && n.c();
    },
    m(e, s) {
      n && n.m(e, s), t = !0;
    },
    p(e, [s]) {
      /*tag*/
      e[14] && n.p(e, s);
    },
    i(e) {
      t || (transition_in$7(n, e), t = !0);
    },
    o(e) {
      transition_out$7(n, e), t = !1;
    },
    d(e) {
      n && n.d(e);
    }
  };
}
function instance$8(i, t, n) {
  let { $$slots: e = {}, $$scope: s } = t, { height: p = void 0 } = t, { width: f = void 0 } = t, { elem_id: A = "" } = t, { elem_classes: a = [] } = t, { variant: h = "solid" } = t, { border_mode: o = "base" } = t, { padding: F = !0 } = t, { type: R = "normal" } = t, { test_id: w = void 0 } = t, { explicit_call: T = !1 } = t, { container: P = !0 } = t, { visible: m = !0 } = t, { allow_overflow: C = !0 } = t, { scale: x = null } = t, { min_width: E = 0 } = t, S = R === "fieldset" ? "fieldset" : "div";
  return i.$$set = (g) => {
    "height" in g && n(0, p = g.height), "width" in g && n(1, f = g.width), "elem_id" in g && n(2, A = g.elem_id), "elem_classes" in g && n(3, a = g.elem_classes), "variant" in g && n(4, h = g.variant), "border_mode" in g && n(5, o = g.border_mode), "padding" in g && n(6, F = g.padding), "type" in g && n(15, R = g.type), "test_id" in g && n(7, w = g.test_id), "explicit_call" in g && n(8, T = g.explicit_call), "container" in g && n(9, P = g.container), "visible" in g && n(10, m = g.visible), "allow_overflow" in g && n(11, C = g.allow_overflow), "scale" in g && n(12, x = g.scale), "min_width" in g && n(13, E = g.min_width), "$$scope" in g && n(16, s = g.$$scope);
  }, [
    p,
    f,
    A,
    a,
    h,
    o,
    F,
    w,
    T,
    P,
    m,
    C,
    x,
    E,
    S,
    R,
    s,
    e
  ];
}
class Block extends SvelteComponent$8 {
  constructor(t) {
    super(), init$8(this, t, instance$8, create_fragment$8, safe_not_equal$9, {
      height: 0,
      width: 1,
      elem_id: 2,
      elem_classes: 3,
      variant: 4,
      border_mode: 5,
      padding: 6,
      type: 15,
      test_id: 7,
      explicit_call: 8,
      container: 9,
      visible: 10,
      allow_overflow: 11,
      scale: 12,
      min_width: 13
    });
  }
}
const {
  SvelteComponent: SvelteComponent$7,
  append: append$7,
  attr: attr$7,
  create_component: create_component$4,
  destroy_component: destroy_component$4,
  detach: detach$7,
  element: element$7,
  init: init$7,
  insert: insert$7,
  mount_component: mount_component$4,
  safe_not_equal: safe_not_equal$8,
  set_data: set_data$3,
  space: space$6,
  text: text$3,
  toggle_class: toggle_class$6,
  transition_in: transition_in$6,
  transition_out: transition_out$6
} = window.__gradio__svelte__internal;
function create_fragment$7(i) {
  let t, n, e, s, p, f;
  return e = new /*Icon*/
  i[1]({}), {
    c() {
      t = element$7("label"), n = element$7("span"), create_component$4(e.$$.fragment), s = space$6(), p = text$3(
        /*label*/
        i[0]
      ), attr$7(n, "class", "svelte-9gxdi0"), attr$7(t, "for", ""), attr$7(t, "data-testid", "block-label"), attr$7(t, "class", "svelte-9gxdi0"), toggle_class$6(t, "hide", !/*show_label*/
      i[2]), toggle_class$6(t, "sr-only", !/*show_label*/
      i[2]), toggle_class$6(
        t,
        "float",
        /*float*/
        i[4]
      ), toggle_class$6(
        t,
        "hide-label",
        /*disable*/
        i[3]
      );
    },
    m(A, a) {
      insert$7(A, t, a), append$7(t, n), mount_component$4(e, n, null), append$7(t, s), append$7(t, p), f = !0;
    },
    p(A, [a]) {
      (!f || a & /*label*/
      1) && set_data$3(
        p,
        /*label*/
        A[0]
      ), (!f || a & /*show_label*/
      4) && toggle_class$6(t, "hide", !/*show_label*/
      A[2]), (!f || a & /*show_label*/
      4) && toggle_class$6(t, "sr-only", !/*show_label*/
      A[2]), (!f || a & /*float*/
      16) && toggle_class$6(
        t,
        "float",
        /*float*/
        A[4]
      ), (!f || a & /*disable*/
      8) && toggle_class$6(
        t,
        "hide-label",
        /*disable*/
        A[3]
      );
    },
    i(A) {
      f || (transition_in$6(e.$$.fragment, A), f = !0);
    },
    o(A) {
      transition_out$6(e.$$.fragment, A), f = !1;
    },
    d(A) {
      A && detach$7(t), destroy_component$4(e);
    }
  };
}
function instance$7(i, t, n) {
  let { label: e = null } = t, { Icon: s } = t, { show_label: p = !0 } = t, { disable: f = !1 } = t, { float: A = !0 } = t;
  return i.$$set = (a) => {
    "label" in a && n(0, e = a.label), "Icon" in a && n(1, s = a.Icon), "show_label" in a && n(2, p = a.show_label), "disable" in a && n(3, f = a.disable), "float" in a && n(4, A = a.float);
  }, [e, s, p, f, A];
}
class BlockLabel extends SvelteComponent$7 {
  constructor(t) {
    super(), init$7(this, t, instance$7, create_fragment$7, safe_not_equal$8, {
      label: 0,
      Icon: 1,
      show_label: 2,
      disable: 3,
      float: 4
    });
  }
}
const {
  SvelteComponent: SvelteComponent$6,
  append: append$6,
  attr: attr$6,
  bubble: bubble$2,
  create_component: create_component$3,
  destroy_component: destroy_component$3,
  detach: detach$6,
  element: element$6,
  init: init$6,
  insert: insert$6,
  listen: listen$2,
  mount_component: mount_component$3,
  safe_not_equal: safe_not_equal$7,
  set_data: set_data$2,
  space: space$5,
  text: text$2,
  toggle_class: toggle_class$5,
  transition_in: transition_in$5,
  transition_out: transition_out$5
} = window.__gradio__svelte__internal;
function create_if_block$4(i) {
  let t, n;
  return {
    c() {
      t = element$6("span"), n = text$2(
        /*label*/
        i[1]
      ), attr$6(t, "class", "svelte-xtz2g8");
    },
    m(e, s) {
      insert$6(e, t, s), append$6(t, n);
    },
    p(e, s) {
      s & /*label*/
      2 && set_data$2(
        n,
        /*label*/
        e[1]
      );
    },
    d(e) {
      e && detach$6(t);
    }
  };
}
function create_fragment$6(i) {
  let t, n, e, s, p, f, A, a = (
    /*show_label*/
    i[2] && create_if_block$4(i)
  );
  return s = new /*Icon*/
  i[0]({}), {
    c() {
      t = element$6("button"), a && a.c(), n = space$5(), e = element$6("div"), create_component$3(s.$$.fragment), attr$6(e, "class", "svelte-xtz2g8"), toggle_class$5(
        e,
        "small",
        /*size*/
        i[4] === "small"
      ), toggle_class$5(
        e,
        "large",
        /*size*/
        i[4] === "large"
      ), attr$6(
        t,
        "aria-label",
        /*label*/
        i[1]
      ), attr$6(
        t,
        "title",
        /*label*/
        i[1]
      ), attr$6(t, "class", "svelte-xtz2g8"), toggle_class$5(
        t,
        "pending",
        /*pending*/
        i[3]
      ), toggle_class$5(
        t,
        "padded",
        /*padded*/
        i[5]
      );
    },
    m(h, o) {
      insert$6(h, t, o), a && a.m(t, null), append$6(t, n), append$6(t, e), mount_component$3(s, e, null), p = !0, f || (A = listen$2(
        t,
        "click",
        /*click_handler*/
        i[6]
      ), f = !0);
    },
    p(h, [o]) {
      /*show_label*/
      h[2] ? a ? a.p(h, o) : (a = create_if_block$4(h), a.c(), a.m(t, n)) : a && (a.d(1), a = null), (!p || o & /*size*/
      16) && toggle_class$5(
        e,
        "small",
        /*size*/
        h[4] === "small"
      ), (!p || o & /*size*/
      16) && toggle_class$5(
        e,
        "large",
        /*size*/
        h[4] === "large"
      ), (!p || o & /*label*/
      2) && attr$6(
        t,
        "aria-label",
        /*label*/
        h[1]
      ), (!p || o & /*label*/
      2) && attr$6(
        t,
        "title",
        /*label*/
        h[1]
      ), (!p || o & /*pending*/
      8) && toggle_class$5(
        t,
        "pending",
        /*pending*/
        h[3]
      ), (!p || o & /*padded*/
      32) && toggle_class$5(
        t,
        "padded",
        /*padded*/
        h[5]
      );
    },
    i(h) {
      p || (transition_in$5(s.$$.fragment, h), p = !0);
    },
    o(h) {
      transition_out$5(s.$$.fragment, h), p = !1;
    },
    d(h) {
      h && detach$6(t), a && a.d(), destroy_component$3(s), f = !1, A();
    }
  };
}
function instance$6(i, t, n) {
  let { Icon: e } = t, { label: s = "" } = t, { show_label: p = !1 } = t, { pending: f = !1 } = t, { size: A = "small" } = t, { padded: a = !0 } = t;
  function h(o) {
    bubble$2.call(this, i, o);
  }
  return i.$$set = (o) => {
    "Icon" in o && n(0, e = o.Icon), "label" in o && n(1, s = o.label), "show_label" in o && n(2, p = o.show_label), "pending" in o && n(3, f = o.pending), "size" in o && n(4, A = o.size), "padded" in o && n(5, a = o.padded);
  }, [e, s, p, f, A, a, h];
}
class IconButton extends SvelteComponent$6 {
  constructor(t) {
    super(), init$6(this, t, instance$6, create_fragment$6, safe_not_equal$7, {
      Icon: 0,
      label: 1,
      show_label: 2,
      pending: 3,
      size: 4,
      padded: 5
    });
  }
}
const color_values = [
  { color: "red", primary: 600, secondary: 100 },
  { color: "green", primary: 600, secondary: 100 },
  { color: "blue", primary: 600, secondary: 100 },
  { color: "yellow", primary: 500, secondary: 100 },
  { color: "purple", primary: 600, secondary: 100 },
  { color: "teal", primary: 600, secondary: 100 },
  { color: "orange", primary: 600, secondary: 100 },
  { color: "cyan", primary: 600, secondary: 100 },
  { color: "lime", primary: 500, secondary: 100 },
  { color: "pink", primary: 600, secondary: 100 }
], tw_colors = {
  inherit: "inherit",
  current: "currentColor",
  transparent: "transparent",
  black: "#000",
  white: "#fff",
  slate: {
    50: "#f8fafc",
    100: "#f1f5f9",
    200: "#e2e8f0",
    300: "#cbd5e1",
    400: "#94a3b8",
    500: "#64748b",
    600: "#475569",
    700: "#334155",
    800: "#1e293b",
    900: "#0f172a",
    950: "#020617"
  },
  gray: {
    50: "#f9fafb",
    100: "#f3f4f6",
    200: "#e5e7eb",
    300: "#d1d5db",
    400: "#9ca3af",
    500: "#6b7280",
    600: "#4b5563",
    700: "#374151",
    800: "#1f2937",
    900: "#111827",
    950: "#030712"
  },
  zinc: {
    50: "#fafafa",
    100: "#f4f4f5",
    200: "#e4e4e7",
    300: "#d4d4d8",
    400: "#a1a1aa",
    500: "#71717a",
    600: "#52525b",
    700: "#3f3f46",
    800: "#27272a",
    900: "#18181b",
    950: "#09090b"
  },
  neutral: {
    50: "#fafafa",
    100: "#f5f5f5",
    200: "#e5e5e5",
    300: "#d4d4d4",
    400: "#a3a3a3",
    500: "#737373",
    600: "#525252",
    700: "#404040",
    800: "#262626",
    900: "#171717",
    950: "#0a0a0a"
  },
  stone: {
    50: "#fafaf9",
    100: "#f5f5f4",
    200: "#e7e5e4",
    300: "#d6d3d1",
    400: "#a8a29e",
    500: "#78716c",
    600: "#57534e",
    700: "#44403c",
    800: "#292524",
    900: "#1c1917",
    950: "#0c0a09"
  },
  red: {
    50: "#fef2f2",
    100: "#fee2e2",
    200: "#fecaca",
    300: "#fca5a5",
    400: "#f87171",
    500: "#ef4444",
    600: "#dc2626",
    700: "#b91c1c",
    800: "#991b1b",
    900: "#7f1d1d",
    950: "#450a0a"
  },
  orange: {
    50: "#fff7ed",
    100: "#ffedd5",
    200: "#fed7aa",
    300: "#fdba74",
    400: "#fb923c",
    500: "#f97316",
    600: "#ea580c",
    700: "#c2410c",
    800: "#9a3412",
    900: "#7c2d12",
    950: "#431407"
  },
  amber: {
    50: "#fffbeb",
    100: "#fef3c7",
    200: "#fde68a",
    300: "#fcd34d",
    400: "#fbbf24",
    500: "#f59e0b",
    600: "#d97706",
    700: "#b45309",
    800: "#92400e",
    900: "#78350f",
    950: "#451a03"
  },
  yellow: {
    50: "#fefce8",
    100: "#fef9c3",
    200: "#fef08a",
    300: "#fde047",
    400: "#facc15",
    500: "#eab308",
    600: "#ca8a04",
    700: "#a16207",
    800: "#854d0e",
    900: "#713f12",
    950: "#422006"
  },
  lime: {
    50: "#f7fee7",
    100: "#ecfccb",
    200: "#d9f99d",
    300: "#bef264",
    400: "#a3e635",
    500: "#84cc16",
    600: "#65a30d",
    700: "#4d7c0f",
    800: "#3f6212",
    900: "#365314",
    950: "#1a2e05"
  },
  green: {
    50: "#f0fdf4",
    100: "#dcfce7",
    200: "#bbf7d0",
    300: "#86efac",
    400: "#4ade80",
    500: "#22c55e",
    600: "#16a34a",
    700: "#15803d",
    800: "#166534",
    900: "#14532d",
    950: "#052e16"
  },
  emerald: {
    50: "#ecfdf5",
    100: "#d1fae5",
    200: "#a7f3d0",
    300: "#6ee7b7",
    400: "#34d399",
    500: "#10b981",
    600: "#059669",
    700: "#047857",
    800: "#065f46",
    900: "#064e3b",
    950: "#022c22"
  },
  teal: {
    50: "#f0fdfa",
    100: "#ccfbf1",
    200: "#99f6e4",
    300: "#5eead4",
    400: "#2dd4bf",
    500: "#14b8a6",
    600: "#0d9488",
    700: "#0f766e",
    800: "#115e59",
    900: "#134e4a",
    950: "#042f2e"
  },
  cyan: {
    50: "#ecfeff",
    100: "#cffafe",
    200: "#a5f3fc",
    300: "#67e8f9",
    400: "#22d3ee",
    500: "#06b6d4",
    600: "#0891b2",
    700: "#0e7490",
    800: "#155e75",
    900: "#164e63",
    950: "#083344"
  },
  sky: {
    50: "#f0f9ff",
    100: "#e0f2fe",
    200: "#bae6fd",
    300: "#7dd3fc",
    400: "#38bdf8",
    500: "#0ea5e9",
    600: "#0284c7",
    700: "#0369a1",
    800: "#075985",
    900: "#0c4a6e",
    950: "#082f49"
  },
  blue: {
    50: "#eff6ff",
    100: "#dbeafe",
    200: "#bfdbfe",
    300: "#93c5fd",
    400: "#60a5fa",
    500: "#3b82f6",
    600: "#2563eb",
    700: "#1d4ed8",
    800: "#1e40af",
    900: "#1e3a8a",
    950: "#172554"
  },
  indigo: {
    50: "#eef2ff",
    100: "#e0e7ff",
    200: "#c7d2fe",
    300: "#a5b4fc",
    400: "#818cf8",
    500: "#6366f1",
    600: "#4f46e5",
    700: "#4338ca",
    800: "#3730a3",
    900: "#312e81",
    950: "#1e1b4b"
  },
  violet: {
    50: "#f5f3ff",
    100: "#ede9fe",
    200: "#ddd6fe",
    300: "#c4b5fd",
    400: "#a78bfa",
    500: "#8b5cf6",
    600: "#7c3aed",
    700: "#6d28d9",
    800: "#5b21b6",
    900: "#4c1d95",
    950: "#2e1065"
  },
  purple: {
    50: "#faf5ff",
    100: "#f3e8ff",
    200: "#e9d5ff",
    300: "#d8b4fe",
    400: "#c084fc",
    500: "#a855f7",
    600: "#9333ea",
    700: "#7e22ce",
    800: "#6b21a8",
    900: "#581c87",
    950: "#3b0764"
  },
  fuchsia: {
    50: "#fdf4ff",
    100: "#fae8ff",
    200: "#f5d0fe",
    300: "#f0abfc",
    400: "#e879f9",
    500: "#d946ef",
    600: "#c026d3",
    700: "#a21caf",
    800: "#86198f",
    900: "#701a75",
    950: "#4a044e"
  },
  pink: {
    50: "#fdf2f8",
    100: "#fce7f3",
    200: "#fbcfe8",
    300: "#f9a8d4",
    400: "#f472b6",
    500: "#ec4899",
    600: "#db2777",
    700: "#be185d",
    800: "#9d174d",
    900: "#831843",
    950: "#500724"
  },
  rose: {
    50: "#fff1f2",
    100: "#ffe4e6",
    200: "#fecdd3",
    300: "#fda4af",
    400: "#fb7185",
    500: "#f43f5e",
    600: "#e11d48",
    700: "#be123c",
    800: "#9f1239",
    900: "#881337",
    950: "#4c0519"
  }
};
color_values.reduce(
  (i, { color: t, primary: n, secondary: e }) => ({
    ...i,
    [t]: {
      primary: tw_colors[t][n],
      secondary: tw_colors[t][e]
    }
  }),
  {}
);
new Intl.Collator(0, { numeric: 1 }).compare;
function is_url$1(i) {
  try {
    const t = new URL(i);
    return t.protocol === "http:" || t.protocol === "https:";
  } catch {
    return !1;
  }
}
function get_fetchable_url_or_file$1(i, t, n) {
  return i == null ? n ? `/proxy=${n}file=` : `${t}/file=` : is_url$1(i) ? i : n ? `/proxy=${n}file=${i}` : `${t}/file=${i}`;
}
const {
  SvelteComponent: SvelteComponent$5,
  append: append$5,
  attr: attr$5,
  bubble: bubble$1,
  check_outros: check_outros$3,
  create_slot: create_slot$2,
  detach: detach$5,
  element: element$5,
  empty: empty$2,
  get_all_dirty_from_scope: get_all_dirty_from_scope$2,
  get_slot_changes: get_slot_changes$2,
  group_outros: group_outros$3,
  init: init$5,
  insert: insert$5,
  listen: listen$1,
  safe_not_equal: safe_not_equal$6,
  set_style: set_style$4,
  space: space$4,
  src_url_equal,
  toggle_class: toggle_class$4,
  transition_in: transition_in$4,
  transition_out: transition_out$4,
  update_slot_base: update_slot_base$2
} = window.__gradio__svelte__internal;
function create_else_block$2(i) {
  let t, n, e, s, p, f, A = (
    /*icon*/
    i[7] && create_if_block_2$1(i)
  );
  const a = (
    /*#slots*/
    i[15].default
  ), h = create_slot$2(
    a,
    i,
    /*$$scope*/
    i[14],
    null
  );
  return {
    c() {
      t = element$5("button"), A && A.c(), n = space$4(), h && h.c(), attr$5(t, "class", e = /*size*/
      i[4] + " " + /*variant*/
      i[3] + " " + /*elem_classes*/
      i[1].join(" ") + " svelte-8huxfn"), attr$5(
        t,
        "id",
        /*elem_id*/
        i[0]
      ), t.disabled = /*disabled*/
      i[8], toggle_class$4(t, "hidden", !/*visible*/
      i[2]), set_style$4(
        t,
        "flex-grow",
        /*scale*/
        i[9]
      ), set_style$4(
        t,
        "width",
        /*scale*/
        i[9] === 0 ? "fit-content" : null
      ), set_style$4(t, "min-width", typeof /*min_width*/
      i[10] == "number" ? `calc(min(${/*min_width*/
      i[10]}px, 100%))` : null);
    },
    m(o, F) {
      insert$5(o, t, F), A && A.m(t, null), append$5(t, n), h && h.m(t, null), s = !0, p || (f = listen$1(
        t,
        "click",
        /*click_handler*/
        i[16]
      ), p = !0);
    },
    p(o, F) {
      /*icon*/
      o[7] ? A ? A.p(o, F) : (A = create_if_block_2$1(o), A.c(), A.m(t, n)) : A && (A.d(1), A = null), h && h.p && (!s || F & /*$$scope*/
      16384) && update_slot_base$2(
        h,
        a,
        o,
        /*$$scope*/
        o[14],
        s ? get_slot_changes$2(
          a,
          /*$$scope*/
          o[14],
          F,
          null
        ) : get_all_dirty_from_scope$2(
          /*$$scope*/
          o[14]
        ),
        null
      ), (!s || F & /*size, variant, elem_classes*/
      26 && e !== (e = /*size*/
      o[4] + " " + /*variant*/
      o[3] + " " + /*elem_classes*/
      o[1].join(" ") + " svelte-8huxfn")) && attr$5(t, "class", e), (!s || F & /*elem_id*/
      1) && attr$5(
        t,
        "id",
        /*elem_id*/
        o[0]
      ), (!s || F & /*disabled*/
      256) && (t.disabled = /*disabled*/
      o[8]), (!s || F & /*size, variant, elem_classes, visible*/
      30) && toggle_class$4(t, "hidden", !/*visible*/
      o[2]), F & /*scale*/
      512 && set_style$4(
        t,
        "flex-grow",
        /*scale*/
        o[9]
      ), F & /*scale*/
      512 && set_style$4(
        t,
        "width",
        /*scale*/
        o[9] === 0 ? "fit-content" : null
      ), F & /*min_width*/
      1024 && set_style$4(t, "min-width", typeof /*min_width*/
      o[10] == "number" ? `calc(min(${/*min_width*/
      o[10]}px, 100%))` : null);
    },
    i(o) {
      s || (transition_in$4(h, o), s = !0);
    },
    o(o) {
      transition_out$4(h, o), s = !1;
    },
    d(o) {
      o && detach$5(t), A && A.d(), h && h.d(o), p = !1, f();
    }
  };
}
function create_if_block$3(i) {
  let t, n, e, s, p = (
    /*icon*/
    i[7] && create_if_block_1$3(i)
  );
  const f = (
    /*#slots*/
    i[15].default
  ), A = create_slot$2(
    f,
    i,
    /*$$scope*/
    i[14],
    null
  );
  return {
    c() {
      t = element$5("a"), p && p.c(), n = space$4(), A && A.c(), attr$5(
        t,
        "href",
        /*link*/
        i[6]
      ), attr$5(t, "rel", "noopener noreferrer"), attr$5(
        t,
        "aria-disabled",
        /*disabled*/
        i[8]
      ), attr$5(t, "class", e = /*size*/
      i[4] + " " + /*variant*/
      i[3] + " " + /*elem_classes*/
      i[1].join(" ") + " svelte-8huxfn"), attr$5(
        t,
        "id",
        /*elem_id*/
        i[0]
      ), toggle_class$4(t, "hidden", !/*visible*/
      i[2]), toggle_class$4(
        t,
        "disabled",
        /*disabled*/
        i[8]
      ), set_style$4(
        t,
        "flex-grow",
        /*scale*/
        i[9]
      ), set_style$4(
        t,
        "pointer-events",
        /*disabled*/
        i[8] ? "none" : null
      ), set_style$4(
        t,
        "width",
        /*scale*/
        i[9] === 0 ? "fit-content" : null
      ), set_style$4(t, "min-width", typeof /*min_width*/
      i[10] == "number" ? `calc(min(${/*min_width*/
      i[10]}px, 100%))` : null);
    },
    m(a, h) {
      insert$5(a, t, h), p && p.m(t, null), append$5(t, n), A && A.m(t, null), s = !0;
    },
    p(a, h) {
      /*icon*/
      a[7] ? p ? p.p(a, h) : (p = create_if_block_1$3(a), p.c(), p.m(t, n)) : p && (p.d(1), p = null), A && A.p && (!s || h & /*$$scope*/
      16384) && update_slot_base$2(
        A,
        f,
        a,
        /*$$scope*/
        a[14],
        s ? get_slot_changes$2(
          f,
          /*$$scope*/
          a[14],
          h,
          null
        ) : get_all_dirty_from_scope$2(
          /*$$scope*/
          a[14]
        ),
        null
      ), (!s || h & /*link*/
      64) && attr$5(
        t,
        "href",
        /*link*/
        a[6]
      ), (!s || h & /*disabled*/
      256) && attr$5(
        t,
        "aria-disabled",
        /*disabled*/
        a[8]
      ), (!s || h & /*size, variant, elem_classes*/
      26 && e !== (e = /*size*/
      a[4] + " " + /*variant*/
      a[3] + " " + /*elem_classes*/
      a[1].join(" ") + " svelte-8huxfn")) && attr$5(t, "class", e), (!s || h & /*elem_id*/
      1) && attr$5(
        t,
        "id",
        /*elem_id*/
        a[0]
      ), (!s || h & /*size, variant, elem_classes, visible*/
      30) && toggle_class$4(t, "hidden", !/*visible*/
      a[2]), (!s || h & /*size, variant, elem_classes, disabled*/
      282) && toggle_class$4(
        t,
        "disabled",
        /*disabled*/
        a[8]
      ), h & /*scale*/
      512 && set_style$4(
        t,
        "flex-grow",
        /*scale*/
        a[9]
      ), h & /*disabled*/
      256 && set_style$4(
        t,
        "pointer-events",
        /*disabled*/
        a[8] ? "none" : null
      ), h & /*scale*/
      512 && set_style$4(
        t,
        "width",
        /*scale*/
        a[9] === 0 ? "fit-content" : null
      ), h & /*min_width*/
      1024 && set_style$4(t, "min-width", typeof /*min_width*/
      a[10] == "number" ? `calc(min(${/*min_width*/
      a[10]}px, 100%))` : null);
    },
    i(a) {
      s || (transition_in$4(A, a), s = !0);
    },
    o(a) {
      transition_out$4(A, a), s = !1;
    },
    d(a) {
      a && detach$5(t), p && p.d(), A && A.d(a);
    }
  };
}
function create_if_block_2$1(i) {
  let t, n, e;
  return {
    c() {
      t = element$5("img"), attr$5(t, "class", "button-icon svelte-8huxfn"), src_url_equal(t.src, n = /*icon_path*/
      i[11]) || attr$5(t, "src", n), attr$5(t, "alt", e = `${/*value*/
      i[5]} icon`);
    },
    m(s, p) {
      insert$5(s, t, p);
    },
    p(s, p) {
      p & /*icon_path*/
      2048 && !src_url_equal(t.src, n = /*icon_path*/
      s[11]) && attr$5(t, "src", n), p & /*value*/
      32 && e !== (e = `${/*value*/
      s[5]} icon`) && attr$5(t, "alt", e);
    },
    d(s) {
      s && detach$5(t);
    }
  };
}
function create_if_block_1$3(i) {
  let t, n, e;
  return {
    c() {
      t = element$5("img"), attr$5(t, "class", "button-icon svelte-8huxfn"), src_url_equal(t.src, n = /*icon_path*/
      i[11]) || attr$5(t, "src", n), attr$5(t, "alt", e = `${/*value*/
      i[5]} icon`);
    },
    m(s, p) {
      insert$5(s, t, p);
    },
    p(s, p) {
      p & /*icon_path*/
      2048 && !src_url_equal(t.src, n = /*icon_path*/
      s[11]) && attr$5(t, "src", n), p & /*value*/
      32 && e !== (e = `${/*value*/
      s[5]} icon`) && attr$5(t, "alt", e);
    },
    d(s) {
      s && detach$5(t);
    }
  };
}
function create_fragment$5(i) {
  let t, n, e, s;
  const p = [create_if_block$3, create_else_block$2], f = [];
  function A(a, h) {
    return (
      /*link*/
      a[6] && /*link*/
      a[6].length > 0 ? 0 : 1
    );
  }
  return t = A(i), n = f[t] = p[t](i), {
    c() {
      n.c(), e = empty$2();
    },
    m(a, h) {
      f[t].m(a, h), insert$5(a, e, h), s = !0;
    },
    p(a, [h]) {
      let o = t;
      t = A(a), t === o ? f[t].p(a, h) : (group_outros$3(), transition_out$4(f[o], 1, 1, () => {
        f[o] = null;
      }), check_outros$3(), n = f[t], n ? n.p(a, h) : (n = f[t] = p[t](a), n.c()), transition_in$4(n, 1), n.m(e.parentNode, e));
    },
    i(a) {
      s || (transition_in$4(n), s = !0);
    },
    o(a) {
      transition_out$4(n), s = !1;
    },
    d(a) {
      a && detach$5(e), f[t].d(a);
    }
  };
}
function instance$5(i, t, n) {
  let e, { $$slots: s = {}, $$scope: p } = t, { elem_id: f = "" } = t, { elem_classes: A = [] } = t, { visible: a = !0 } = t, { variant: h = "secondary" } = t, { size: o = "lg" } = t, { value: F = null } = t, { link: R = null } = t, { icon: w = null } = t, { disabled: T = !1 } = t, { scale: P = null } = t, { min_width: m = void 0 } = t, { root: C = "" } = t, { proxy_url: x = null } = t;
  function E(S) {
    bubble$1.call(this, i, S);
  }
  return i.$$set = (S) => {
    "elem_id" in S && n(0, f = S.elem_id), "elem_classes" in S && n(1, A = S.elem_classes), "visible" in S && n(2, a = S.visible), "variant" in S && n(3, h = S.variant), "size" in S && n(4, o = S.size), "value" in S && n(5, F = S.value), "link" in S && n(6, R = S.link), "icon" in S && n(7, w = S.icon), "disabled" in S && n(8, T = S.disabled), "scale" in S && n(9, P = S.scale), "min_width" in S && n(10, m = S.min_width), "root" in S && n(12, C = S.root), "proxy_url" in S && n(13, x = S.proxy_url), "$$scope" in S && n(14, p = S.$$scope);
  }, i.$$.update = () => {
    i.$$.dirty & /*icon, root, proxy_url*/
    12416 && n(11, e = get_fetchable_url_or_file$1(w, C, x));
  }, [
    f,
    A,
    a,
    h,
    o,
    F,
    R,
    w,
    T,
    P,
    m,
    e,
    C,
    x,
    p,
    s,
    E
  ];
}
class Button extends SvelteComponent$5 {
  constructor(t) {
    super(), init$5(this, t, instance$5, create_fragment$5, safe_not_equal$6, {
      elem_id: 0,
      elem_classes: 1,
      visible: 2,
      variant: 3,
      size: 4,
      value: 5,
      link: 6,
      icon: 7,
      disabled: 8,
      scale: 9,
      min_width: 10,
      root: 12,
      proxy_url: 13
    });
  }
}
function pretty_si(i) {
  let t = ["", "k", "M", "G", "T", "P", "E", "Z"], n = 0;
  for (; i > 1e3 && n < t.length - 1; )
    i /= 1e3, n++;
  let e = t[n];
  return (Number.isInteger(i) ? i : i.toFixed(1)) + e;
}
function noop$2() {
}
function safe_not_equal$5(i, t) {
  return i != i ? t == t : i !== t || i && typeof i == "object" || typeof i == "function";
}
const is_client = typeof window < "u";
let now = is_client ? () => window.performance.now() : () => Date.now(), raf = is_client ? (i) => requestAnimationFrame(i) : noop$2;
const tasks = /* @__PURE__ */ new Set();
function run_tasks(i) {
  tasks.forEach((t) => {
    t.c(i) || (tasks.delete(t), t.f());
  }), tasks.size !== 0 && raf(run_tasks);
}
function loop(i) {
  let t;
  return tasks.size === 0 && raf(run_tasks), {
    promise: new Promise((n) => {
      tasks.add(t = { c: i, f: n });
    }),
    abort() {
      tasks.delete(t);
    }
  };
}
const subscriber_queue = [];
function writable(i, t = noop$2) {
  let n;
  const e = /* @__PURE__ */ new Set();
  function s(A) {
    if (safe_not_equal$5(i, A) && (i = A, n)) {
      const a = !subscriber_queue.length;
      for (const h of e)
        h[1](), subscriber_queue.push(h, i);
      if (a) {
        for (let h = 0; h < subscriber_queue.length; h += 2)
          subscriber_queue[h][0](subscriber_queue[h + 1]);
        subscriber_queue.length = 0;
      }
    }
  }
  function p(A) {
    s(A(i));
  }
  function f(A, a = noop$2) {
    const h = [A, a];
    return e.add(h), e.size === 1 && (n = t(s, p) || noop$2), A(i), () => {
      e.delete(h), e.size === 0 && n && (n(), n = null);
    };
  }
  return { set: s, update: p, subscribe: f };
}
function is_date(i) {
  return Object.prototype.toString.call(i) === "[object Date]";
}
function tick_spring(i, t, n, e) {
  if (typeof n == "number" || is_date(n)) {
    const s = e - n, p = (n - t) / (i.dt || 1 / 60), f = i.opts.stiffness * s, A = i.opts.damping * p, a = (f - A) * i.inv_mass, h = (p + a) * i.dt;
    return Math.abs(h) < i.opts.precision && Math.abs(s) < i.opts.precision ? e : (i.settled = !1, is_date(n) ? new Date(n.getTime() + h) : n + h);
  } else {
    if (Array.isArray(n))
      return n.map(
        (s, p) => tick_spring(i, t[p], n[p], e[p])
      );
    if (typeof n == "object") {
      const s = {};
      for (const p in n)
        s[p] = tick_spring(i, t[p], n[p], e[p]);
      return s;
    } else
      throw new Error(`Cannot spring ${typeof n} values`);
  }
}
function spring(i, t = {}) {
  const n = writable(i), { stiffness: e = 0.15, damping: s = 0.8, precision: p = 0.01 } = t;
  let f, A, a, h = i, o = i, F = 1, R = 0, w = !1;
  function T(m, C = {}) {
    o = m;
    const x = a = {};
    return i == null || C.hard || P.stiffness >= 1 && P.damping >= 1 ? (w = !0, f = now(), h = m, n.set(i = o), Promise.resolve()) : (C.soft && (R = 1 / ((C.soft === !0 ? 0.5 : +C.soft) * 60), F = 0), A || (f = now(), w = !1, A = loop((E) => {
      if (w)
        return w = !1, A = null, !1;
      F = Math.min(F + R, 1);
      const S = {
        inv_mass: F,
        opts: P,
        settled: !0,
        dt: (E - f) * 60 / 1e3
      }, g = tick_spring(S, h, i, o);
      return f = E, h = i, n.set(i = g), S.settled && (A = null), !S.settled;
    })), new Promise((E) => {
      A.promise.then(() => {
        x === a && E();
      });
    }));
  }
  const P = {
    set: T,
    update: (m, C) => T(m(o, i), C),
    subscribe: n.subscribe,
    stiffness: e,
    damping: s,
    precision: p
  };
  return P;
}
const {
  SvelteComponent: SvelteComponent$4,
  append: append$4,
  attr: attr$4,
  component_subscribe,
  detach: detach$4,
  element: element$4,
  init: init$4,
  insert: insert$4,
  noop: noop$1,
  safe_not_equal: safe_not_equal$4,
  set_style: set_style$3,
  svg_element,
  toggle_class: toggle_class$3
} = window.__gradio__svelte__internal, { onMount } = window.__gradio__svelte__internal;
function create_fragment$4(i) {
  let t, n, e, s, p, f, A, a, h, o, F, R;
  return {
    c() {
      t = element$4("div"), n = svg_element("svg"), e = svg_element("g"), s = svg_element("path"), p = svg_element("path"), f = svg_element("path"), A = svg_element("path"), a = svg_element("g"), h = svg_element("path"), o = svg_element("path"), F = svg_element("path"), R = svg_element("path"), attr$4(s, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), attr$4(s, "fill", "#FF7C00"), attr$4(s, "fill-opacity", "0.4"), attr$4(s, "class", "svelte-43sxxs"), attr$4(p, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), attr$4(p, "fill", "#FF7C00"), attr$4(p, "class", "svelte-43sxxs"), attr$4(f, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), attr$4(f, "fill", "#FF7C00"), attr$4(f, "fill-opacity", "0.4"), attr$4(f, "class", "svelte-43sxxs"), attr$4(A, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), attr$4(A, "fill", "#FF7C00"), attr$4(A, "class", "svelte-43sxxs"), set_style$3(e, "transform", "translate(" + /*$top*/
      i[1][0] + "px, " + /*$top*/
      i[1][1] + "px)"), attr$4(h, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), attr$4(h, "fill", "#FF7C00"), attr$4(h, "fill-opacity", "0.4"), attr$4(h, "class", "svelte-43sxxs"), attr$4(o, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), attr$4(o, "fill", "#FF7C00"), attr$4(o, "class", "svelte-43sxxs"), attr$4(F, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), attr$4(F, "fill", "#FF7C00"), attr$4(F, "fill-opacity", "0.4"), attr$4(F, "class", "svelte-43sxxs"), attr$4(R, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), attr$4(R, "fill", "#FF7C00"), attr$4(R, "class", "svelte-43sxxs"), set_style$3(a, "transform", "translate(" + /*$bottom*/
      i[2][0] + "px, " + /*$bottom*/
      i[2][1] + "px)"), attr$4(n, "viewBox", "-1200 -1200 3000 3000"), attr$4(n, "fill", "none"), attr$4(n, "xmlns", "http://www.w3.org/2000/svg"), attr$4(n, "class", "svelte-43sxxs"), attr$4(t, "class", "svelte-43sxxs"), toggle_class$3(
        t,
        "margin",
        /*margin*/
        i[0]
      );
    },
    m(w, T) {
      insert$4(w, t, T), append$4(t, n), append$4(n, e), append$4(e, s), append$4(e, p), append$4(e, f), append$4(e, A), append$4(n, a), append$4(a, h), append$4(a, o), append$4(a, F), append$4(a, R);
    },
    p(w, [T]) {
      T & /*$top*/
      2 && set_style$3(e, "transform", "translate(" + /*$top*/
      w[1][0] + "px, " + /*$top*/
      w[1][1] + "px)"), T & /*$bottom*/
      4 && set_style$3(a, "transform", "translate(" + /*$bottom*/
      w[2][0] + "px, " + /*$bottom*/
      w[2][1] + "px)"), T & /*margin*/
      1 && toggle_class$3(
        t,
        "margin",
        /*margin*/
        w[0]
      );
    },
    i: noop$1,
    o: noop$1,
    d(w) {
      w && detach$4(t);
    }
  };
}
function instance$4(i, t, n) {
  let e, s;
  var p = this && this.__awaiter || function(w, T, P, m) {
    function C(x) {
      return x instanceof P ? x : new P(function(E) {
        E(x);
      });
    }
    return new (P || (P = Promise))(function(x, E) {
      function S($) {
        try {
          v(m.next($));
        } catch (M) {
          E(M);
        }
      }
      function g($) {
        try {
          v(m.throw($));
        } catch (M) {
          E(M);
        }
      }
      function v($) {
        $.done ? x($.value) : C($.value).then(S, g);
      }
      v((m = m.apply(w, T || [])).next());
    });
  };
  let { margin: f = !0 } = t;
  const A = spring([0, 0]);
  component_subscribe(i, A, (w) => n(1, e = w));
  const a = spring([0, 0]);
  component_subscribe(i, a, (w) => n(2, s = w));
  let h;
  function o() {
    return p(this, void 0, void 0, function* () {
      yield Promise.all([A.set([125, 140]), a.set([-125, -140])]), yield Promise.all([A.set([-125, 140]), a.set([125, -140])]), yield Promise.all([A.set([-125, 0]), a.set([125, -0])]), yield Promise.all([A.set([125, 0]), a.set([-125, 0])]);
    });
  }
  function F() {
    return p(this, void 0, void 0, function* () {
      yield o(), h || F();
    });
  }
  function R() {
    return p(this, void 0, void 0, function* () {
      yield Promise.all([A.set([125, 0]), a.set([-125, 0])]), F();
    });
  }
  return onMount(() => (R(), () => h = !0)), i.$$set = (w) => {
    "margin" in w && n(0, f = w.margin);
  }, [f, e, s, A, a];
}
class Loader extends SvelteComponent$4 {
  constructor(t) {
    super(), init$4(this, t, instance$4, create_fragment$4, safe_not_equal$4, { margin: 0 });
  }
}
const {
  SvelteComponent: SvelteComponent$3,
  append: append$3,
  attr: attr$3,
  binding_callbacks: binding_callbacks$2,
  check_outros: check_outros$2,
  create_component: create_component$2,
  create_slot: create_slot$1,
  destroy_component: destroy_component$2,
  destroy_each,
  detach: detach$3,
  element: element$3,
  empty: empty$1,
  ensure_array_like,
  get_all_dirty_from_scope: get_all_dirty_from_scope$1,
  get_slot_changes: get_slot_changes$1,
  group_outros: group_outros$2,
  init: init$3,
  insert: insert$3,
  mount_component: mount_component$2,
  noop,
  safe_not_equal: safe_not_equal$3,
  set_data: set_data$1,
  set_style: set_style$2,
  space: space$3,
  text: text$1,
  toggle_class: toggle_class$2,
  transition_in: transition_in$3,
  transition_out: transition_out$3,
  update_slot_base: update_slot_base$1
} = window.__gradio__svelte__internal, { tick: tick$2 } = window.__gradio__svelte__internal, { onDestroy } = window.__gradio__svelte__internal, get_error_slot_changes = (i) => ({}), get_error_slot_context = (i) => ({});
function get_each_context(i, t, n) {
  const e = i.slice();
  return e[39] = t[n], e[41] = n, e;
}
function get_each_context_1(i, t, n) {
  const e = i.slice();
  return e[39] = t[n], e;
}
function create_if_block_17(i) {
  let t, n = (
    /*i18n*/
    i[1]("common.error") + ""
  ), e, s, p;
  const f = (
    /*#slots*/
    i[29].error
  ), A = create_slot$1(
    f,
    i,
    /*$$scope*/
    i[28],
    get_error_slot_context
  );
  return {
    c() {
      t = element$3("span"), e = text$1(n), s = space$3(), A && A.c(), attr$3(t, "class", "error svelte-14miwb5");
    },
    m(a, h) {
      insert$3(a, t, h), append$3(t, e), insert$3(a, s, h), A && A.m(a, h), p = !0;
    },
    p(a, h) {
      (!p || h[0] & /*i18n*/
      2) && n !== (n = /*i18n*/
      a[1]("common.error") + "") && set_data$1(e, n), A && A.p && (!p || h[0] & /*$$scope*/
      268435456) && update_slot_base$1(
        A,
        f,
        a,
        /*$$scope*/
        a[28],
        p ? get_slot_changes$1(
          f,
          /*$$scope*/
          a[28],
          h,
          get_error_slot_changes
        ) : get_all_dirty_from_scope$1(
          /*$$scope*/
          a[28]
        ),
        get_error_slot_context
      );
    },
    i(a) {
      p || (transition_in$3(A, a), p = !0);
    },
    o(a) {
      transition_out$3(A, a), p = !1;
    },
    d(a) {
      a && (detach$3(t), detach$3(s)), A && A.d(a);
    }
  };
}
function create_if_block$2(i) {
  let t, n, e, s, p, f, A, a, h, o = (
    /*variant*/
    i[8] === "default" && /*show_eta_bar*/
    i[18] && /*show_progress*/
    i[6] === "full" && create_if_block_16(i)
  );
  function F(E, S) {
    if (
      /*progress*/
      E[7]
    )
      return create_if_block_11;
    if (
      /*queue_position*/
      E[2] !== null && /*queue_size*/
      E[3] !== void 0 && /*queue_position*/
      E[2] >= 0
    )
      return create_if_block_14;
    if (
      /*queue_position*/
      E[2] === 0
    )
      return create_if_block_15;
  }
  let R = F(i), w = R && R(i), T = (
    /*timer*/
    i[5] && create_if_block_10(i)
  );
  const P = [create_if_block_2, create_if_block_9], m = [];
  function C(E, S) {
    return (
      /*last_progress_level*/
      E[15] != null ? 0 : (
        /*show_progress*/
        E[6] === "full" ? 1 : -1
      )
    );
  }
  ~(p = C(i)) && (f = m[p] = P[p](i));
  let x = !/*timer*/
  i[5] && create_if_block_1$2(i);
  return {
    c() {
      o && o.c(), t = space$3(), n = element$3("div"), w && w.c(), e = space$3(), T && T.c(), s = space$3(), f && f.c(), A = space$3(), x && x.c(), a = empty$1(), attr$3(n, "class", "progress-text svelte-14miwb5"), toggle_class$2(
        n,
        "meta-text-center",
        /*variant*/
        i[8] === "center"
      ), toggle_class$2(
        n,
        "meta-text",
        /*variant*/
        i[8] === "default"
      );
    },
    m(E, S) {
      o && o.m(E, S), insert$3(E, t, S), insert$3(E, n, S), w && w.m(n, null), append$3(n, e), T && T.m(n, null), insert$3(E, s, S), ~p && m[p].m(E, S), insert$3(E, A, S), x && x.m(E, S), insert$3(E, a, S), h = !0;
    },
    p(E, S) {
      /*variant*/
      E[8] === "default" && /*show_eta_bar*/
      E[18] && /*show_progress*/
      E[6] === "full" ? o ? o.p(E, S) : (o = create_if_block_16(E), o.c(), o.m(t.parentNode, t)) : o && (o.d(1), o = null), R === (R = F(E)) && w ? w.p(E, S) : (w && w.d(1), w = R && R(E), w && (w.c(), w.m(n, e))), /*timer*/
      E[5] ? T ? T.p(E, S) : (T = create_if_block_10(E), T.c(), T.m(n, null)) : T && (T.d(1), T = null), (!h || S[0] & /*variant*/
      256) && toggle_class$2(
        n,
        "meta-text-center",
        /*variant*/
        E[8] === "center"
      ), (!h || S[0] & /*variant*/
      256) && toggle_class$2(
        n,
        "meta-text",
        /*variant*/
        E[8] === "default"
      );
      let g = p;
      p = C(E), p === g ? ~p && m[p].p(E, S) : (f && (group_outros$2(), transition_out$3(m[g], 1, 1, () => {
        m[g] = null;
      }), check_outros$2()), ~p ? (f = m[p], f ? f.p(E, S) : (f = m[p] = P[p](E), f.c()), transition_in$3(f, 1), f.m(A.parentNode, A)) : f = null), /*timer*/
      E[5] ? x && (x.d(1), x = null) : x ? x.p(E, S) : (x = create_if_block_1$2(E), x.c(), x.m(a.parentNode, a));
    },
    i(E) {
      h || (transition_in$3(f), h = !0);
    },
    o(E) {
      transition_out$3(f), h = !1;
    },
    d(E) {
      E && (detach$3(t), detach$3(n), detach$3(s), detach$3(A), detach$3(a)), o && o.d(E), w && w.d(), T && T.d(), ~p && m[p].d(E), x && x.d(E);
    }
  };
}
function create_if_block_16(i) {
  let t, n = `translateX(${/*eta_level*/
  (i[17] || 0) * 100 - 100}%)`;
  return {
    c() {
      t = element$3("div"), attr$3(t, "class", "eta-bar svelte-14miwb5"), set_style$2(t, "transform", n);
    },
    m(e, s) {
      insert$3(e, t, s);
    },
    p(e, s) {
      s[0] & /*eta_level*/
      131072 && n !== (n = `translateX(${/*eta_level*/
      (e[17] || 0) * 100 - 100}%)`) && set_style$2(t, "transform", n);
    },
    d(e) {
      e && detach$3(t);
    }
  };
}
function create_if_block_15(i) {
  let t;
  return {
    c() {
      t = text$1("processing |");
    },
    m(n, e) {
      insert$3(n, t, e);
    },
    p: noop,
    d(n) {
      n && detach$3(t);
    }
  };
}
function create_if_block_14(i) {
  let t, n = (
    /*queue_position*/
    i[2] + 1 + ""
  ), e, s, p, f;
  return {
    c() {
      t = text$1("queue: "), e = text$1(n), s = text$1("/"), p = text$1(
        /*queue_size*/
        i[3]
      ), f = text$1(" |");
    },
    m(A, a) {
      insert$3(A, t, a), insert$3(A, e, a), insert$3(A, s, a), insert$3(A, p, a), insert$3(A, f, a);
    },
    p(A, a) {
      a[0] & /*queue_position*/
      4 && n !== (n = /*queue_position*/
      A[2] + 1 + "") && set_data$1(e, n), a[0] & /*queue_size*/
      8 && set_data$1(
        p,
        /*queue_size*/
        A[3]
      );
    },
    d(A) {
      A && (detach$3(t), detach$3(e), detach$3(s), detach$3(p), detach$3(f));
    }
  };
}
function create_if_block_11(i) {
  let t, n = ensure_array_like(
    /*progress*/
    i[7]
  ), e = [];
  for (let s = 0; s < n.length; s += 1)
    e[s] = create_each_block_1(get_each_context_1(i, n, s));
  return {
    c() {
      for (let s = 0; s < e.length; s += 1)
        e[s].c();
      t = empty$1();
    },
    m(s, p) {
      for (let f = 0; f < e.length; f += 1)
        e[f] && e[f].m(s, p);
      insert$3(s, t, p);
    },
    p(s, p) {
      if (p[0] & /*progress*/
      128) {
        n = ensure_array_like(
          /*progress*/
          s[7]
        );
        let f;
        for (f = 0; f < n.length; f += 1) {
          const A = get_each_context_1(s, n, f);
          e[f] ? e[f].p(A, p) : (e[f] = create_each_block_1(A), e[f].c(), e[f].m(t.parentNode, t));
        }
        for (; f < e.length; f += 1)
          e[f].d(1);
        e.length = n.length;
      }
    },
    d(s) {
      s && detach$3(t), destroy_each(e, s);
    }
  };
}
function create_if_block_12(i) {
  let t, n = (
    /*p*/
    i[39].unit + ""
  ), e, s, p = " ", f;
  function A(o, F) {
    return (
      /*p*/
      o[39].length != null ? create_if_block_13 : create_else_block$1
    );
  }
  let a = A(i), h = a(i);
  return {
    c() {
      h.c(), t = space$3(), e = text$1(n), s = text$1(" | "), f = text$1(p);
    },
    m(o, F) {
      h.m(o, F), insert$3(o, t, F), insert$3(o, e, F), insert$3(o, s, F), insert$3(o, f, F);
    },
    p(o, F) {
      a === (a = A(o)) && h ? h.p(o, F) : (h.d(1), h = a(o), h && (h.c(), h.m(t.parentNode, t))), F[0] & /*progress*/
      128 && n !== (n = /*p*/
      o[39].unit + "") && set_data$1(e, n);
    },
    d(o) {
      o && (detach$3(t), detach$3(e), detach$3(s), detach$3(f)), h.d(o);
    }
  };
}
function create_else_block$1(i) {
  let t = pretty_si(
    /*p*/
    i[39].index || 0
  ) + "", n;
  return {
    c() {
      n = text$1(t);
    },
    m(e, s) {
      insert$3(e, n, s);
    },
    p(e, s) {
      s[0] & /*progress*/
      128 && t !== (t = pretty_si(
        /*p*/
        e[39].index || 0
      ) + "") && set_data$1(n, t);
    },
    d(e) {
      e && detach$3(n);
    }
  };
}
function create_if_block_13(i) {
  let t = pretty_si(
    /*p*/
    i[39].index || 0
  ) + "", n, e, s = pretty_si(
    /*p*/
    i[39].length
  ) + "", p;
  return {
    c() {
      n = text$1(t), e = text$1("/"), p = text$1(s);
    },
    m(f, A) {
      insert$3(f, n, A), insert$3(f, e, A), insert$3(f, p, A);
    },
    p(f, A) {
      A[0] & /*progress*/
      128 && t !== (t = pretty_si(
        /*p*/
        f[39].index || 0
      ) + "") && set_data$1(n, t), A[0] & /*progress*/
      128 && s !== (s = pretty_si(
        /*p*/
        f[39].length
      ) + "") && set_data$1(p, s);
    },
    d(f) {
      f && (detach$3(n), detach$3(e), detach$3(p));
    }
  };
}
function create_each_block_1(i) {
  let t, n = (
    /*p*/
    i[39].index != null && create_if_block_12(i)
  );
  return {
    c() {
      n && n.c(), t = empty$1();
    },
    m(e, s) {
      n && n.m(e, s), insert$3(e, t, s);
    },
    p(e, s) {
      /*p*/
      e[39].index != null ? n ? n.p(e, s) : (n = create_if_block_12(e), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
    },
    d(e) {
      e && detach$3(t), n && n.d(e);
    }
  };
}
function create_if_block_10(i) {
  let t, n = (
    /*eta*/
    i[0] ? `/${/*formatted_eta*/
    i[19]}` : ""
  ), e, s;
  return {
    c() {
      t = text$1(
        /*formatted_timer*/
        i[20]
      ), e = text$1(n), s = text$1("s");
    },
    m(p, f) {
      insert$3(p, t, f), insert$3(p, e, f), insert$3(p, s, f);
    },
    p(p, f) {
      f[0] & /*formatted_timer*/
      1048576 && set_data$1(
        t,
        /*formatted_timer*/
        p[20]
      ), f[0] & /*eta, formatted_eta*/
      524289 && n !== (n = /*eta*/
      p[0] ? `/${/*formatted_eta*/
      p[19]}` : "") && set_data$1(e, n);
    },
    d(p) {
      p && (detach$3(t), detach$3(e), detach$3(s));
    }
  };
}
function create_if_block_9(i) {
  let t, n;
  return t = new Loader({
    props: { margin: (
      /*variant*/
      i[8] === "default"
    ) }
  }), {
    c() {
      create_component$2(t.$$.fragment);
    },
    m(e, s) {
      mount_component$2(t, e, s), n = !0;
    },
    p(e, s) {
      const p = {};
      s[0] & /*variant*/
      256 && (p.margin = /*variant*/
      e[8] === "default"), t.$set(p);
    },
    i(e) {
      n || (transition_in$3(t.$$.fragment, e), n = !0);
    },
    o(e) {
      transition_out$3(t.$$.fragment, e), n = !1;
    },
    d(e) {
      destroy_component$2(t, e);
    }
  };
}
function create_if_block_2(i) {
  let t, n, e, s, p, f = `${/*last_progress_level*/
  i[15] * 100}%`, A = (
    /*progress*/
    i[7] != null && create_if_block_3(i)
  );
  return {
    c() {
      t = element$3("div"), n = element$3("div"), A && A.c(), e = space$3(), s = element$3("div"), p = element$3("div"), attr$3(n, "class", "progress-level-inner svelte-14miwb5"), attr$3(p, "class", "progress-bar svelte-14miwb5"), set_style$2(p, "width", f), attr$3(s, "class", "progress-bar-wrap svelte-14miwb5"), attr$3(t, "class", "progress-level svelte-14miwb5");
    },
    m(a, h) {
      insert$3(a, t, h), append$3(t, n), A && A.m(n, null), append$3(t, e), append$3(t, s), append$3(s, p), i[30](p);
    },
    p(a, h) {
      /*progress*/
      a[7] != null ? A ? A.p(a, h) : (A = create_if_block_3(a), A.c(), A.m(n, null)) : A && (A.d(1), A = null), h[0] & /*last_progress_level*/
      32768 && f !== (f = `${/*last_progress_level*/
      a[15] * 100}%`) && set_style$2(p, "width", f);
    },
    i: noop,
    o: noop,
    d(a) {
      a && detach$3(t), A && A.d(), i[30](null);
    }
  };
}
function create_if_block_3(i) {
  let t, n = ensure_array_like(
    /*progress*/
    i[7]
  ), e = [];
  for (let s = 0; s < n.length; s += 1)
    e[s] = create_each_block(get_each_context(i, n, s));
  return {
    c() {
      for (let s = 0; s < e.length; s += 1)
        e[s].c();
      t = empty$1();
    },
    m(s, p) {
      for (let f = 0; f < e.length; f += 1)
        e[f] && e[f].m(s, p);
      insert$3(s, t, p);
    },
    p(s, p) {
      if (p[0] & /*progress_level, progress*/
      16512) {
        n = ensure_array_like(
          /*progress*/
          s[7]
        );
        let f;
        for (f = 0; f < n.length; f += 1) {
          const A = get_each_context(s, n, f);
          e[f] ? e[f].p(A, p) : (e[f] = create_each_block(A), e[f].c(), e[f].m(t.parentNode, t));
        }
        for (; f < e.length; f += 1)
          e[f].d(1);
        e.length = n.length;
      }
    },
    d(s) {
      s && detach$3(t), destroy_each(e, s);
    }
  };
}
function create_if_block_4(i) {
  let t, n, e, s, p = (
    /*i*/
    i[41] !== 0 && create_if_block_8()
  ), f = (
    /*p*/
    i[39].desc != null && create_if_block_7(i)
  ), A = (
    /*p*/
    i[39].desc != null && /*progress_level*/
    i[14] && /*progress_level*/
    i[14][
      /*i*/
      i[41]
    ] != null && create_if_block_6()
  ), a = (
    /*progress_level*/
    i[14] != null && create_if_block_5(i)
  );
  return {
    c() {
      p && p.c(), t = space$3(), f && f.c(), n = space$3(), A && A.c(), e = space$3(), a && a.c(), s = empty$1();
    },
    m(h, o) {
      p && p.m(h, o), insert$3(h, t, o), f && f.m(h, o), insert$3(h, n, o), A && A.m(h, o), insert$3(h, e, o), a && a.m(h, o), insert$3(h, s, o);
    },
    p(h, o) {
      /*p*/
      h[39].desc != null ? f ? f.p(h, o) : (f = create_if_block_7(h), f.c(), f.m(n.parentNode, n)) : f && (f.d(1), f = null), /*p*/
      h[39].desc != null && /*progress_level*/
      h[14] && /*progress_level*/
      h[14][
        /*i*/
        h[41]
      ] != null ? A || (A = create_if_block_6(), A.c(), A.m(e.parentNode, e)) : A && (A.d(1), A = null), /*progress_level*/
      h[14] != null ? a ? a.p(h, o) : (a = create_if_block_5(h), a.c(), a.m(s.parentNode, s)) : a && (a.d(1), a = null);
    },
    d(h) {
      h && (detach$3(t), detach$3(n), detach$3(e), detach$3(s)), p && p.d(h), f && f.d(h), A && A.d(h), a && a.d(h);
    }
  };
}
function create_if_block_8(i) {
  let t;
  return {
    c() {
      t = text$1(" /");
    },
    m(n, e) {
      insert$3(n, t, e);
    },
    d(n) {
      n && detach$3(t);
    }
  };
}
function create_if_block_7(i) {
  let t = (
    /*p*/
    i[39].desc + ""
  ), n;
  return {
    c() {
      n = text$1(t);
    },
    m(e, s) {
      insert$3(e, n, s);
    },
    p(e, s) {
      s[0] & /*progress*/
      128 && t !== (t = /*p*/
      e[39].desc + "") && set_data$1(n, t);
    },
    d(e) {
      e && detach$3(n);
    }
  };
}
function create_if_block_6(i) {
  let t;
  return {
    c() {
      t = text$1("-");
    },
    m(n, e) {
      insert$3(n, t, e);
    },
    d(n) {
      n && detach$3(t);
    }
  };
}
function create_if_block_5(i) {
  let t = (100 * /*progress_level*/
  (i[14][
    /*i*/
    i[41]
  ] || 0)).toFixed(1) + "", n, e;
  return {
    c() {
      n = text$1(t), e = text$1("%");
    },
    m(s, p) {
      insert$3(s, n, p), insert$3(s, e, p);
    },
    p(s, p) {
      p[0] & /*progress_level*/
      16384 && t !== (t = (100 * /*progress_level*/
      (s[14][
        /*i*/
        s[41]
      ] || 0)).toFixed(1) + "") && set_data$1(n, t);
    },
    d(s) {
      s && (detach$3(n), detach$3(e));
    }
  };
}
function create_each_block(i) {
  let t, n = (
    /*p*/
    (i[39].desc != null || /*progress_level*/
    i[14] && /*progress_level*/
    i[14][
      /*i*/
      i[41]
    ] != null) && create_if_block_4(i)
  );
  return {
    c() {
      n && n.c(), t = empty$1();
    },
    m(e, s) {
      n && n.m(e, s), insert$3(e, t, s);
    },
    p(e, s) {
      /*p*/
      e[39].desc != null || /*progress_level*/
      e[14] && /*progress_level*/
      e[14][
        /*i*/
        e[41]
      ] != null ? n ? n.p(e, s) : (n = create_if_block_4(e), n.c(), n.m(t.parentNode, t)) : n && (n.d(1), n = null);
    },
    d(e) {
      e && detach$3(t), n && n.d(e);
    }
  };
}
function create_if_block_1$2(i) {
  let t, n;
  return {
    c() {
      t = element$3("p"), n = text$1(
        /*loading_text*/
        i[9]
      ), attr$3(t, "class", "loading svelte-14miwb5");
    },
    m(e, s) {
      insert$3(e, t, s), append$3(t, n);
    },
    p(e, s) {
      s[0] & /*loading_text*/
      512 && set_data$1(
        n,
        /*loading_text*/
        e[9]
      );
    },
    d(e) {
      e && detach$3(t);
    }
  };
}
function create_fragment$3(i) {
  let t, n, e, s, p;
  const f = [create_if_block$2, create_if_block_17], A = [];
  function a(h, o) {
    return (
      /*status*/
      h[4] === "pending" ? 0 : (
        /*status*/
        h[4] === "error" ? 1 : -1
      )
    );
  }
  return ~(n = a(i)) && (e = A[n] = f[n](i)), {
    c() {
      t = element$3("div"), e && e.c(), attr$3(t, "class", s = "wrap " + /*variant*/
      i[8] + " " + /*show_progress*/
      i[6] + " svelte-14miwb5"), toggle_class$2(t, "hide", !/*status*/
      i[4] || /*status*/
      i[4] === "complete" || /*show_progress*/
      i[6] === "hidden"), toggle_class$2(
        t,
        "translucent",
        /*variant*/
        i[8] === "center" && /*status*/
        (i[4] === "pending" || /*status*/
        i[4] === "error") || /*translucent*/
        i[11] || /*show_progress*/
        i[6] === "minimal"
      ), toggle_class$2(
        t,
        "generating",
        /*status*/
        i[4] === "generating"
      ), toggle_class$2(
        t,
        "border",
        /*border*/
        i[12]
      ), set_style$2(
        t,
        "position",
        /*absolute*/
        i[10] ? "absolute" : "static"
      ), set_style$2(
        t,
        "padding",
        /*absolute*/
        i[10] ? "0" : "var(--size-8) 0"
      );
    },
    m(h, o) {
      insert$3(h, t, o), ~n && A[n].m(t, null), i[31](t), p = !0;
    },
    p(h, o) {
      let F = n;
      n = a(h), n === F ? ~n && A[n].p(h, o) : (e && (group_outros$2(), transition_out$3(A[F], 1, 1, () => {
        A[F] = null;
      }), check_outros$2()), ~n ? (e = A[n], e ? e.p(h, o) : (e = A[n] = f[n](h), e.c()), transition_in$3(e, 1), e.m(t, null)) : e = null), (!p || o[0] & /*variant, show_progress*/
      320 && s !== (s = "wrap " + /*variant*/
      h[8] + " " + /*show_progress*/
      h[6] + " svelte-14miwb5")) && attr$3(t, "class", s), (!p || o[0] & /*variant, show_progress, status, show_progress*/
      336) && toggle_class$2(t, "hide", !/*status*/
      h[4] || /*status*/
      h[4] === "complete" || /*show_progress*/
      h[6] === "hidden"), (!p || o[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
      2384) && toggle_class$2(
        t,
        "translucent",
        /*variant*/
        h[8] === "center" && /*status*/
        (h[4] === "pending" || /*status*/
        h[4] === "error") || /*translucent*/
        h[11] || /*show_progress*/
        h[6] === "minimal"
      ), (!p || o[0] & /*variant, show_progress, status*/
      336) && toggle_class$2(
        t,
        "generating",
        /*status*/
        h[4] === "generating"
      ), (!p || o[0] & /*variant, show_progress, border*/
      4416) && toggle_class$2(
        t,
        "border",
        /*border*/
        h[12]
      ), o[0] & /*absolute*/
      1024 && set_style$2(
        t,
        "position",
        /*absolute*/
        h[10] ? "absolute" : "static"
      ), o[0] & /*absolute*/
      1024 && set_style$2(
        t,
        "padding",
        /*absolute*/
        h[10] ? "0" : "var(--size-8) 0"
      );
    },
    i(h) {
      p || (transition_in$3(e), p = !0);
    },
    o(h) {
      transition_out$3(e), p = !1;
    },
    d(h) {
      h && detach$3(t), ~n && A[n].d(), i[31](null);
    }
  };
}
var __awaiter = function(i, t, n, e) {
  function s(p) {
    return p instanceof n ? p : new n(function(f) {
      f(p);
    });
  }
  return new (n || (n = Promise))(function(p, f) {
    function A(o) {
      try {
        h(e.next(o));
      } catch (F) {
        f(F);
      }
    }
    function a(o) {
      try {
        h(e.throw(o));
      } catch (F) {
        f(F);
      }
    }
    function h(o) {
      o.done ? p(o.value) : s(o.value).then(A, a);
    }
    h((e = e.apply(i, t || [])).next());
  });
};
let items = [], called = !1;
function scroll_into_view(i) {
  return __awaiter(this, arguments, void 0, function* (t, n = !0) {
    if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && n !== !0)) {
      if (items.push(t), !called)
        called = !0;
      else
        return;
      yield tick$2(), requestAnimationFrame(() => {
        let e = [0, 0];
        for (let s = 0; s < items.length; s++) {
          const f = items[s].getBoundingClientRect();
          (s === 0 || f.top + window.scrollY <= e[0]) && (e[0] = f.top + window.scrollY, e[1] = s);
        }
        window.scrollTo({ top: e[0] - 20, behavior: "smooth" }), called = !1, items = [];
      });
    }
  });
}
function instance$3(i, t, n) {
  let e, { $$slots: s = {}, $$scope: p } = t;
  this && this.__awaiter;
  let { i18n: f } = t, { eta: A = null } = t, { queue: a = !1 } = t, { queue_position: h } = t, { queue_size: o } = t, { status: F } = t, { scroll_to_output: R = !1 } = t, { timer: w = !0 } = t, { show_progress: T = "full" } = t, { message: P = null } = t, { progress: m = null } = t, { variant: C = "default" } = t, { loading_text: x = "Loading..." } = t, { absolute: E = !0 } = t, { translucent: S = !1 } = t, { border: g = !1 } = t, { autoscroll: v } = t, $, M = !1, _ = 0, N = 0, D = null, X = 0, Y = null, I, U = null, G = !0;
  const V = () => {
    n(25, _ = performance.now()), n(26, N = 0), M = !0, H();
  };
  function H() {
    requestAnimationFrame(() => {
      n(26, N = (performance.now() - _) / 1e3), M && H();
    });
  }
  function st() {
    n(26, N = 0), M && (M = !1);
  }
  onDestroy(() => {
    M && st();
  });
  let dt = null;
  function yt(k) {
    binding_callbacks$2[k ? "unshift" : "push"](() => {
      U = k, n(16, U), n(7, m), n(14, Y), n(15, I);
    });
  }
  function gt(k) {
    binding_callbacks$2[k ? "unshift" : "push"](() => {
      $ = k, n(13, $);
    });
  }
  return i.$$set = (k) => {
    "i18n" in k && n(1, f = k.i18n), "eta" in k && n(0, A = k.eta), "queue" in k && n(21, a = k.queue), "queue_position" in k && n(2, h = k.queue_position), "queue_size" in k && n(3, o = k.queue_size), "status" in k && n(4, F = k.status), "scroll_to_output" in k && n(22, R = k.scroll_to_output), "timer" in k && n(5, w = k.timer), "show_progress" in k && n(6, T = k.show_progress), "message" in k && n(23, P = k.message), "progress" in k && n(7, m = k.progress), "variant" in k && n(8, C = k.variant), "loading_text" in k && n(9, x = k.loading_text), "absolute" in k && n(10, E = k.absolute), "translucent" in k && n(11, S = k.translucent), "border" in k && n(12, g = k.border), "autoscroll" in k && n(24, v = k.autoscroll), "$$scope" in k && n(28, p = k.$$scope);
  }, i.$$.update = () => {
    i.$$.dirty[0] & /*eta, old_eta, queue, timer_start*/
    169869313 && (A === null ? n(0, A = D) : a && n(0, A = (performance.now() - _) / 1e3 + A), A != null && (n(19, dt = A.toFixed(1)), n(27, D = A))), i.$$.dirty[0] & /*eta, timer_diff*/
    67108865 && n(17, X = A === null || A <= 0 || !N ? null : Math.min(N / A, 1)), i.$$.dirty[0] & /*progress*/
    128 && m != null && n(18, G = !1), i.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
    114816 && (m != null ? n(14, Y = m.map((k) => {
      if (k.index != null && k.length != null)
        return k.index / k.length;
      if (k.progress != null)
        return k.progress;
    })) : n(14, Y = null), Y ? (n(15, I = Y[Y.length - 1]), U && (I === 0 ? n(16, U.style.transition = "0", U) : n(16, U.style.transition = "150ms", U))) : n(15, I = void 0)), i.$$.dirty[0] & /*status*/
    16 && (F === "pending" ? V() : st()), i.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
    20979728 && $ && R && (F === "pending" || F === "complete") && scroll_into_view($, v), i.$$.dirty[0] & /*status, message*/
    8388624, i.$$.dirty[0] & /*timer_diff*/
    67108864 && n(20, e = N.toFixed(1));
  }, [
    A,
    f,
    h,
    o,
    F,
    w,
    T,
    m,
    C,
    x,
    E,
    S,
    g,
    $,
    Y,
    I,
    U,
    X,
    G,
    dt,
    e,
    a,
    R,
    P,
    v,
    _,
    N,
    D,
    p,
    s,
    yt,
    gt
  ];
}
class Static extends SvelteComponent$3 {
  constructor(t) {
    super(), init$3(
      this,
      t,
      instance$3,
      create_fragment$3,
      safe_not_equal$3,
      {
        i18n: 1,
        eta: 0,
        queue: 21,
        queue_position: 2,
        queue_size: 3,
        status: 4,
        scroll_to_output: 22,
        timer: 5,
        show_progress: 6,
        message: 23,
        progress: 7,
        variant: 8,
        loading_text: 9,
        absolute: 10,
        translucent: 11,
        border: 12,
        autoscroll: 24
      },
      null,
      [-1, -1]
    );
  }
}
var fn = new Intl.Collator(0, { numeric: 1 }).compare;
function semiver(i, t, n) {
  return i = i.split("."), t = t.split("."), fn(i[0], t[0]) || fn(i[1], t[1]) || (t[2] = t.slice(2).join("."), n = /[.-]/.test(i[2] = i.slice(2).join(".")), n == /[.-]/.test(t[2]) ? fn(i[2], t[2]) : n ? -1 : 1);
}
function resolve_root(i, t, n) {
  return t.startsWith("http://") || t.startsWith("https://") ? n ? i : t : i + t;
}
function determine_protocol(i) {
  if (i.startsWith("http")) {
    const { protocol: t, host: n } = new URL(i);
    return n.endsWith("hf.space") ? {
      ws_protocol: "wss",
      host: n,
      http_protocol: t
    } : {
      ws_protocol: t === "https:" ? "wss" : "ws",
      http_protocol: t,
      host: n
    };
  } else if (i.startsWith("file:"))
    return {
      ws_protocol: "ws",
      http_protocol: "http:",
      host: "lite.local"
      // Special fake hostname only used for this case. This matches the hostname allowed in `is_self_host()` in `js/wasm/network/host.ts`.
    };
  return {
    ws_protocol: "wss",
    http_protocol: "https:",
    host: i
  };
}
const RE_SPACE_NAME = /^[^\/]*\/[^\/]*$/, RE_SPACE_DOMAIN = /.*hf\.space\/{0,1}$/;
async function process_endpoint(i, t) {
  const n = {};
  t && (n.Authorization = `Bearer ${t}`);
  const e = i.trim();
  if (RE_SPACE_NAME.test(e))
    try {
      const s = await fetch(
        `https://huggingface.co/api/spaces/${e}/host`,
        { headers: n }
      );
      if (s.status !== 200)
        throw new Error("Space metadata could not be loaded.");
      const p = (await s.json()).host;
      return {
        space_id: i,
        ...determine_protocol(p)
      };
    } catch (s) {
      throw new Error("Space metadata could not be loaded." + s.message);
    }
  if (RE_SPACE_DOMAIN.test(e)) {
    const { ws_protocol: s, http_protocol: p, host: f } = determine_protocol(e);
    return {
      space_id: f.replace(".hf.space", ""),
      ws_protocol: s,
      http_protocol: p,
      host: f
    };
  }
  return {
    space_id: !1,
    ...determine_protocol(e)
  };
}
function map_names_to_ids(i) {
  let t = {};
  return i.forEach(({ api_name: n }, e) => {
    n && (t[n] = e);
  }), t;
}
const RE_DISABLED_DISCUSSION = /^(?=[^]*\b[dD]iscussions{0,1}\b)(?=[^]*\b[dD]isabled\b)[^]*$/;
async function discussions_enabled(i) {
  try {
    const n = (await fetch(
      `https://huggingface.co/api/spaces/${i}/discussions`,
      {
        method: "HEAD"
      }
    )).headers.get("x-error-message");
    return !(n && RE_DISABLED_DISCUSSION.test(n));
  } catch {
    return !1;
  }
}
function normalise_file(i, t, n) {
  if (i == null)
    return null;
  if (Array.isArray(i)) {
    const e = [];
    for (const s of i)
      s == null ? e.push(null) : e.push(normalise_file(s, t, n));
    return e;
  }
  return i.is_stream ? n == null ? new FileData({
    ...i,
    url: t + "/stream/" + i.path
  }) : new FileData({
    ...i,
    url: "/proxy=" + n + "stream/" + i.path
  }) : new FileData({
    ...i,
    url: get_fetchable_url_or_file(i.path, t, n)
  });
}
function is_url(i) {
  try {
    const t = new URL(i);
    return t.protocol === "http:" || t.protocol === "https:";
  } catch {
    return !1;
  }
}
function get_fetchable_url_or_file(i, t, n) {
  return i == null ? n ? `/proxy=${n}file=` : `${t}/file=` : is_url(i) ? i : n ? `/proxy=${n}file=${i}` : `${t}/file=${i}`;
}
async function upload(i, t, n = upload_files) {
  let e = (Array.isArray(i) ? i : [i]).map(
    (s) => s.blob
  );
  return await Promise.all(
    await n(t, e).then(
      async (s) => {
        if (s.error)
          throw new Error(s.error);
        return s.files ? s.files.map((p, f) => {
          const A = new FileData({ ...i[f], path: p });
          return normalise_file(A, t, null);
        }) : [];
      }
    )
  );
}
async function prepare_files(i, t) {
  return i.map(
    (n, e) => new FileData({
      path: n.name,
      orig_name: n.name,
      blob: n,
      size: n.size,
      mime_type: n.type,
      is_stream: t
    })
  );
}
class FileData {
  constructor({
    path: t,
    url: n,
    orig_name: e,
    size: s,
    blob: p,
    is_stream: f,
    mime_type: A,
    alt_text: a
  }) {
    this.path = t, this.url = n, this.orig_name = e, this.size = s, this.blob = n ? void 0 : p, this.is_stream = f, this.mime_type = A, this.alt_text = a;
  }
}
const QUEUE_FULL_MSG = "This application is too busy. Keep trying!", BROKEN_CONNECTION_MSG = "Connection errored out.";
let NodeBlob;
function api_factory(i, t) {
  return { post_data: n, upload_files: e, client: s, handle_blob: p };
  async function n(f, A, a) {
    const h = { "Content-Type": "application/json" };
    a && (h.Authorization = `Bearer ${a}`);
    try {
      var o = await i(f, {
        method: "POST",
        body: JSON.stringify(A),
        headers: h
      });
    } catch {
      return [{ error: BROKEN_CONNECTION_MSG }, 500];
    }
    return [await o.json(), o.status];
  }
  async function e(f, A, a) {
    const h = {};
    a && (h.Authorization = `Bearer ${a}`);
    const o = 1e3, F = [];
    for (let w = 0; w < A.length; w += o) {
      const T = A.slice(w, w + o), P = new FormData();
      T.forEach((C) => {
        P.append("files", C);
      });
      try {
        var R = await i(`${f}/upload`, {
          method: "POST",
          body: P,
          headers: h
        });
      } catch {
        return { error: BROKEN_CONNECTION_MSG };
      }
      const m = await R.json();
      F.push(...m);
    }
    return { files: F };
  }
  async function s(f, A = { normalise_files: !0 }) {
    return new Promise(async (a) => {
      const { status_callback: h, hf_token: o, normalise_files: F } = A, R = {
        predict: N,
        submit: D,
        view_api: Y,
        component_server: X
      }, w = F ?? !0;
      if ((typeof window > "u" || !("WebSocket" in window)) && !global.Websocket) {
        const I = await import("./wrapper-98f94c21-DqR3tIm1.js");
        NodeBlob = (await Promise.resolve().then(() => __viteBrowserExternal)).Blob, global.WebSocket = I.WebSocket;
      }
      const { ws_protocol: T, http_protocol: P, host: m, space_id: C } = await process_endpoint(f, o), x = Math.random().toString(36).substring(2), E = {};
      let S, g = {}, v = !1;
      o && C && (v = await get_jwt(C, o));
      async function $(I) {
        if (S = I, g = map_names_to_ids((I == null ? void 0 : I.dependencies) || []), S.auth_required)
          return {
            config: S,
            ...R
          };
        try {
          M = await Y(S);
        } catch (U) {
          console.error(`Could not get api details: ${U.message}`);
        }
        return {
          config: S,
          ...R
        };
      }
      let M;
      async function _(I) {
        if (h && h(I), I.status === "running")
          try {
            S = await resolve_config(
              i,
              `${P}//${m}`,
              o
            );
            const U = await $(S);
            a(U);
          } catch (U) {
            console.error(U), h && h({
              status: "error",
              message: "Could not load this space.",
              load_status: "error",
              detail: "NOT_FOUND"
            });
          }
      }
      try {
        S = await resolve_config(
          i,
          `${P}//${m}`,
          o
        );
        const I = await $(S);
        a(I);
      } catch (I) {
        console.error(I), C ? check_space_status(
          C,
          RE_SPACE_NAME.test(C) ? "space_name" : "subdomain",
          _
        ) : h && h({
          status: "error",
          message: "Could not load this space.",
          load_status: "error",
          detail: "NOT_FOUND"
        });
      }
      function N(I, U, G) {
        let V = !1, H = !1, st;
        if (typeof I == "number")
          st = S.dependencies[I];
        else {
          const dt = I.replace(/^\//, "");
          st = S.dependencies[g[dt]];
        }
        if (st.types.continuous)
          throw new Error(
            "Cannot call predict on this function as it may run forever. Use submit instead"
          );
        return new Promise((dt, yt) => {
          const gt = D(I, U, G);
          let k;
          gt.on("data", (l) => {
            H && (gt.destroy(), dt(l)), V = !0, k = l;
          }).on("status", (l) => {
            l.stage === "error" && yt(l), l.stage === "complete" && (H = !0, V && (gt.destroy(), dt(k)));
          });
        });
      }
      function D(I, U, G) {
        let V, H;
        if (typeof I == "number")
          V = I, H = M.unnamed_endpoints[V];
        else {
          const Z = I.replace(/^\//, "");
          V = g[Z], H = M.named_endpoints[I.trim()];
        }
        if (typeof V != "number")
          throw new Error(
            "There is no endpoint matching that name of fn_index matching that number."
          );
        let st, dt, yt = S.protocol ?? "sse";
        const gt = typeof I == "number" ? "/predict" : I;
        let k, l = null, u = !1;
        const d = {};
        let b = "";
        typeof window < "u" && (b = new URLSearchParams(window.location.search).toString()), p(
          `${P}//${resolve_root(m, S.path, !0)}`,
          U,
          H,
          o
        ).then((Z) => {
          if (k = { data: Z || [], event_data: G, fn_index: V }, skip_queue(V, S))
            y({
              type: "status",
              endpoint: gt,
              stage: "pending",
              queue: !1,
              fn_index: V,
              time: /* @__PURE__ */ new Date()
            }), n(
              `${P}//${resolve_root(m, S.path, !0)}/run${gt.startsWith("/") ? gt : `/${gt}`}${b ? "?" + b : ""}`,
              {
                ...k,
                session_hash: x
              },
              o
            ).then(([ht, mt]) => {
              const ft = w ? transform_output(
                ht.data,
                H,
                S.root,
                S.root_url
              ) : ht.data;
              mt == 200 ? (y({
                type: "data",
                endpoint: gt,
                fn_index: V,
                data: ft,
                time: /* @__PURE__ */ new Date()
              }), y({
                type: "status",
                endpoint: gt,
                fn_index: V,
                stage: "complete",
                eta: ht.average_duration,
                queue: !1,
                time: /* @__PURE__ */ new Date()
              })) : y({
                type: "status",
                stage: "error",
                endpoint: gt,
                fn_index: V,
                message: ht.error,
                queue: !1,
                time: /* @__PURE__ */ new Date()
              });
            }).catch((ht) => {
              y({
                type: "status",
                stage: "error",
                message: ht.message,
                endpoint: gt,
                fn_index: V,
                queue: !1,
                time: /* @__PURE__ */ new Date()
              });
            });
          else if (yt == "ws") {
            y({
              type: "status",
              stage: "pending",
              queue: !0,
              endpoint: gt,
              fn_index: V,
              time: /* @__PURE__ */ new Date()
            });
            let ht = new URL(`${T}://${resolve_root(
              m,
              S.path,
              !0
            )}
							/queue/join${b ? "?" + b : ""}`);
            v && ht.searchParams.set("__sign", v), st = t(ht), st.onclose = (mt) => {
              mt.wasClean || y({
                type: "status",
                stage: "error",
                broken: !0,
                message: BROKEN_CONNECTION_MSG,
                queue: !0,
                endpoint: gt,
                fn_index: V,
                time: /* @__PURE__ */ new Date()
              });
            }, st.onmessage = function(mt) {
              const ft = JSON.parse(mt.data), { type: kt, status: Rt, data: St } = handle_message(
                ft,
                E[V]
              );
              if (kt === "update" && Rt && !u)
                y({
                  type: "status",
                  endpoint: gt,
                  fn_index: V,
                  time: /* @__PURE__ */ new Date(),
                  ...Rt
                }), Rt.stage === "error" && st.close();
              else if (kt === "hash") {
                st.send(JSON.stringify({ fn_index: V, session_hash: x }));
                return;
              } else
                kt === "data" ? st.send(JSON.stringify({ ...k, session_hash: x })) : kt === "complete" ? u = Rt : kt === "log" ? y({
                  type: "log",
                  log: St.log,
                  level: St.level,
                  endpoint: gt,
                  fn_index: V
                }) : kt === "generating" && y({
                  type: "status",
                  time: /* @__PURE__ */ new Date(),
                  ...Rt,
                  stage: Rt == null ? void 0 : Rt.stage,
                  queue: !0,
                  endpoint: gt,
                  fn_index: V
                });
              St && (y({
                type: "data",
                time: /* @__PURE__ */ new Date(),
                data: w ? transform_output(
                  St.data,
                  H,
                  S.root,
                  S.root_url
                ) : St.data,
                endpoint: gt,
                fn_index: V
              }), u && (y({
                type: "status",
                time: /* @__PURE__ */ new Date(),
                ...u,
                stage: Rt == null ? void 0 : Rt.stage,
                queue: !0,
                endpoint: gt,
                fn_index: V
              }), st.close()));
            }, semiver(S.version || "2.0.0", "3.6") < 0 && addEventListener(
              "open",
              () => st.send(JSON.stringify({ hash: x }))
            );
          } else {
            y({
              type: "status",
              stage: "pending",
              queue: !0,
              endpoint: gt,
              fn_index: V,
              time: /* @__PURE__ */ new Date()
            });
            var lt = new URLSearchParams({
              fn_index: V.toString(),
              session_hash: x
            }).toString();
            let ht = new URL(
              `${P}//${resolve_root(
                m,
                S.path,
                !0
              )}/queue/join?${lt}`
            );
            dt = new EventSource(ht), dt.onmessage = async function(mt) {
              const ft = JSON.parse(mt.data), { type: kt, status: Rt, data: St } = handle_message(
                ft,
                E[V]
              );
              if (kt === "update" && Rt && !u)
                y({
                  type: "status",
                  endpoint: gt,
                  fn_index: V,
                  time: /* @__PURE__ */ new Date(),
                  ...Rt
                }), Rt.stage === "error" && dt.close();
              else if (kt === "data") {
                l = ft.event_id;
                let [It, _t] = await n(
                  `${P}//${resolve_root(
                    m,
                    S.path,
                    !0
                  )}/queue/data`,
                  {
                    ...k,
                    session_hash: x,
                    event_id: l
                  },
                  o
                );
                _t !== 200 && (y({
                  type: "status",
                  stage: "error",
                  message: BROKEN_CONNECTION_MSG,
                  queue: !0,
                  endpoint: gt,
                  fn_index: V,
                  time: /* @__PURE__ */ new Date()
                }), dt.close());
              } else
                kt === "complete" ? u = Rt : kt === "log" ? y({
                  type: "log",
                  log: St.log,
                  level: St.level,
                  endpoint: gt,
                  fn_index: V
                }) : kt === "generating" && y({
                  type: "status",
                  time: /* @__PURE__ */ new Date(),
                  ...Rt,
                  stage: Rt == null ? void 0 : Rt.stage,
                  queue: !0,
                  endpoint: gt,
                  fn_index: V
                });
              St && (y({
                type: "data",
                time: /* @__PURE__ */ new Date(),
                data: w ? transform_output(
                  St.data,
                  H,
                  S.root,
                  S.root_url
                ) : St.data,
                endpoint: gt,
                fn_index: V
              }), u && (y({
                type: "status",
                time: /* @__PURE__ */ new Date(),
                ...u,
                stage: Rt == null ? void 0 : Rt.stage,
                queue: !0,
                endpoint: gt,
                fn_index: V
              }), dt.close()));
            };
          }
        });
        function y(Z) {
          const ht = d[Z.type] || [];
          ht == null || ht.forEach((mt) => mt(Z));
        }
        function O(Z, lt) {
          const ht = d, mt = ht[Z] || [];
          return ht[Z] = mt, mt == null || mt.push(lt), { on: O, off: B, cancel: z, destroy: it };
        }
        function B(Z, lt) {
          const ht = d;
          let mt = ht[Z] || [];
          return mt = mt == null ? void 0 : mt.filter((ft) => ft !== lt), ht[Z] = mt, { on: O, off: B, cancel: z, destroy: it };
        }
        async function z() {
          const Z = {
            stage: "complete",
            queue: !1,
            time: /* @__PURE__ */ new Date()
          };
          u = Z, y({
            ...Z,
            type: "status",
            endpoint: gt,
            fn_index: V
          });
          let lt = {};
          yt === "ws" ? (st && st.readyState === 0 ? st.addEventListener("open", () => {
            st.close();
          }) : st.close(), lt = { fn_index: V, session_hash: x }) : (dt.close(), lt = { event_id: l });
          try {
            await i(
              `${P}//${resolve_root(
                m,
                S.path,
                !0
              )}/reset`,
              {
                headers: { "Content-Type": "application/json" },
                method: "POST",
                body: JSON.stringify(lt)
              }
            );
          } catch {
            console.warn(
              "The `/reset` endpoint could not be called. Subsequent endpoint results may be unreliable."
            );
          }
        }
        function it() {
          for (const Z in d)
            d[Z].forEach((lt) => {
              B(Z, lt);
            });
        }
        return {
          on: O,
          off: B,
          cancel: z,
          destroy: it
        };
      }
      async function X(I, U, G) {
        var V;
        const H = { "Content-Type": "application/json" };
        o && (H.Authorization = `Bearer ${o}`);
        let st, dt = S.components.find(
          (k) => k.id === I
        );
        (V = dt == null ? void 0 : dt.props) != null && V.root_url ? st = dt.props.root_url : st = `${P}//${resolve_root(
          m,
          S.path,
          !0
        )}/`;
        const yt = await i(
          `${st}component_server/`,
          {
            method: "POST",
            body: JSON.stringify({
              data: G,
              component_id: I,
              fn_name: U,
              session_hash: x
            }),
            headers: H
          }
        );
        if (!yt.ok)
          throw new Error(
            "Could not connect to component server: " + yt.statusText
          );
        return await yt.json();
      }
      async function Y(I) {
        if (M)
          return M;
        const U = { "Content-Type": "application/json" };
        o && (U.Authorization = `Bearer ${o}`);
        let G;
        if (semiver(I.version || "2.0.0", "3.30") < 0 ? G = await i(
          "https://gradio-space-api-fetcher-v2.hf.space/api",
          {
            method: "POST",
            body: JSON.stringify({
              serialize: !1,
              config: JSON.stringify(I)
            }),
            headers: U
          }
        ) : G = await i(`${I.root}/info`, {
          headers: U
        }), !G.ok)
          throw new Error(BROKEN_CONNECTION_MSG);
        let V = await G.json();
        return "api" in V && (V = V.api), V.named_endpoints["/predict"] && !V.unnamed_endpoints[0] && (V.unnamed_endpoints[0] = V.named_endpoints["/predict"]), transform_api_info(V, I, g);
      }
    });
  }
  async function p(f, A, a, h) {
    const o = await walk_and_store_blobs(
      A,
      void 0,
      [],
      !0,
      a
    );
    return Promise.all(
      o.map(async ({ path: F, blob: R, type: w }) => {
        if (R) {
          const T = (await e(f, [R], h)).files[0];
          return { path: F, file_url: T, type: w, name: R == null ? void 0 : R.name };
        }
        return { path: F, type: w };
      })
    ).then((F) => (F.forEach(({ path: R, file_url: w, type: T, name: P }) => {
      if (T === "Gallery")
        update_object(A, w, R);
      else if (w) {
        const m = new FileData({ path: w, orig_name: P });
        update_object(A, m, R);
      }
    }), A));
  }
}
const { post_data, upload_files, client, handle_blob } = api_factory(
  fetch,
  (...i) => new WebSocket(...i)
);
function transform_output(i, t, n, e) {
  return i.map((s, p) => {
    var f, A, a, h;
    return ((A = (f = t == null ? void 0 : t.returns) == null ? void 0 : f[p]) == null ? void 0 : A.component) === "File" ? normalise_file(s, n, e) : ((h = (a = t == null ? void 0 : t.returns) == null ? void 0 : a[p]) == null ? void 0 : h.component) === "Gallery" ? s.map((o) => Array.isArray(o) ? [normalise_file(o[0], n, e), o[1]] : [normalise_file(o, n, e), null]) : typeof s == "object" && s.path ? normalise_file(s, n, e) : s;
  });
}
function get_type(i, t, n, e) {
  switch (i.type) {
    case "string":
      return "string";
    case "boolean":
      return "boolean";
    case "number":
      return "number";
  }
  if (n === "JSONSerializable" || n === "StringSerializable")
    return "any";
  if (n === "ListStringSerializable")
    return "string[]";
  if (t === "Image")
    return e === "parameter" ? "Blob | File | Buffer" : "string";
  if (n === "FileSerializable")
    return (i == null ? void 0 : i.type) === "array" ? e === "parameter" ? "(Blob | File | Buffer)[]" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}[]" : e === "parameter" ? "Blob | File | Buffer" : "{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}";
  if (n === "GallerySerializable")
    return e === "parameter" ? "[(Blob | File | Buffer), (string | null)][]" : "[{ name: string; data: string; size?: number; is_file?: boolean; orig_name?: string}, (string | null))][]";
}
function get_description(i, t) {
  return t === "GallerySerializable" ? "array of [file, label] tuples" : t === "ListStringSerializable" ? "array of strings" : t === "FileSerializable" ? "array of files or single file" : i.description;
}
function transform_api_info(i, t, n) {
  const e = {
    named_endpoints: {},
    unnamed_endpoints: {}
  };
  for (const s in i) {
    const p = i[s];
    for (const f in p) {
      const A = t.dependencies[f] ? f : n[f.replace("/", "")], a = p[f];
      e[s][f] = {}, e[s][f].parameters = {}, e[s][f].returns = {}, e[s][f].type = t.dependencies[A].types, e[s][f].parameters = a.parameters.map(
        ({ label: h, component: o, type: F, serializer: R }) => ({
          label: h,
          component: o,
          type: get_type(F, o, R, "parameter"),
          description: get_description(F, R)
        })
      ), e[s][f].returns = a.returns.map(
        ({ label: h, component: o, type: F, serializer: R }) => ({
          label: h,
          component: o,
          type: get_type(F, o, R, "return"),
          description: get_description(F, R)
        })
      );
    }
  }
  return e;
}
async function get_jwt(i, t) {
  try {
    return (await (await fetch(`https://huggingface.co/api/spaces/${i}/jwt`, {
      headers: {
        Authorization: `Bearer ${t}`
      }
    })).json()).token || !1;
  } catch (n) {
    return console.error(n), !1;
  }
}
function update_object(i, t, n) {
  for (; n.length > 1; )
    i = i[n.shift()];
  i[n.shift()] = t;
}
async function walk_and_store_blobs(i, t = void 0, n = [], e = !1, s = void 0) {
  if (Array.isArray(i)) {
    let p = [];
    return await Promise.all(
      i.map(async (f, A) => {
        var a;
        let h = n.slice();
        h.push(A);
        const o = await walk_and_store_blobs(
          i[A],
          e ? ((a = s == null ? void 0 : s.parameters[A]) == null ? void 0 : a.component) || void 0 : t,
          h,
          !1,
          s
        );
        p = p.concat(o);
      })
    ), p;
  } else {
    if (globalThis.Buffer && i instanceof globalThis.Buffer)
      return [
        {
          path: n,
          blob: t === "Image" ? !1 : new NodeBlob([i]),
          type: t
        }
      ];
    if (typeof i == "object") {
      let p = [];
      for (let f in i)
        if (i.hasOwnProperty(f)) {
          let A = n.slice();
          A.push(f), p = p.concat(
            await walk_and_store_blobs(
              i[f],
              void 0,
              A,
              !1,
              s
            )
          );
        }
      return p;
    }
  }
  return [];
}
function skip_queue(i, t) {
  var n, e, s, p;
  return !(((e = (n = t == null ? void 0 : t.dependencies) == null ? void 0 : n[i]) == null ? void 0 : e.queue) === null ? t.enable_queue : (p = (s = t == null ? void 0 : t.dependencies) == null ? void 0 : s[i]) != null && p.queue) || !1;
}
async function resolve_config(i, t, n) {
  const e = {};
  if (n && (e.Authorization = `Bearer ${n}`), typeof window < "u" && window.gradio_config && location.origin !== "http://localhost:9876" && !window.gradio_config.dev_mode) {
    const s = window.gradio_config.root, p = window.gradio_config;
    return p.root = resolve_root(t, p.root, !1), { ...p, path: s };
  } else if (t) {
    let s = await i(`${t}/config`, {
      headers: e
    });
    if (s.status === 200) {
      const p = await s.json();
      return p.path = p.path ?? "", p.root = t, p;
    }
    throw new Error("Could not get config.");
  }
  throw new Error("No config or app endpoint found");
}
async function check_space_status(i, t, n) {
  let e = t === "subdomain" ? `https://huggingface.co/api/spaces/by-subdomain/${i}` : `https://huggingface.co/api/spaces/${i}`, s, p;
  try {
    if (s = await fetch(e), p = s.status, p !== 200)
      throw new Error();
    s = await s.json();
  } catch {
    n({
      status: "error",
      load_status: "error",
      message: "Could not get space status",
      detail: "NOT_FOUND"
    });
    return;
  }
  if (!s || p !== 200)
    return;
  const {
    runtime: { stage: f },
    id: A
  } = s;
  switch (f) {
    case "STOPPED":
    case "SLEEPING":
      n({
        status: "sleeping",
        load_status: "pending",
        message: "Space is asleep. Waking it up...",
        detail: f
      }), setTimeout(() => {
        check_space_status(i, t, n);
      }, 1e3);
      break;
    case "PAUSED":
      n({
        status: "paused",
        load_status: "error",
        message: "This space has been paused by the author. If you would like to try this demo, consider duplicating the space.",
        detail: f,
        discussions_enabled: await discussions_enabled(A)
      });
      break;
    case "RUNNING":
    case "RUNNING_BUILDING":
      n({
        status: "running",
        load_status: "complete",
        message: "",
        detail: f
      });
      break;
    case "BUILDING":
      n({
        status: "building",
        load_status: "pending",
        message: "Space is building...",
        detail: f
      }), setTimeout(() => {
        check_space_status(i, t, n);
      }, 1e3);
      break;
    default:
      n({
        status: "space_error",
        load_status: "error",
        message: "This space is experiencing an issue.",
        detail: f,
        discussions_enabled: await discussions_enabled(A)
      });
      break;
  }
}
function handle_message(i, t) {
  switch (i.msg) {
    case "send_data":
      return { type: "data" };
    case "send_hash":
      return { type: "hash" };
    case "queue_full":
      return {
        type: "update",
        status: {
          queue: !0,
          message: QUEUE_FULL_MSG,
          stage: "error",
          code: i.code,
          success: i.success
        }
      };
    case "estimation":
      return {
        type: "update",
        status: {
          queue: !0,
          stage: t || "pending",
          code: i.code,
          size: i.queue_size,
          position: i.rank,
          eta: i.rank_eta,
          success: i.success
        }
      };
    case "progress":
      return {
        type: "update",
        status: {
          queue: !0,
          stage: "pending",
          code: i.code,
          progress_data: i.progress_data,
          success: i.success
        }
      };
    case "log":
      return { type: "log", data: i };
    case "process_generating":
      return {
        type: "generating",
        status: {
          queue: !0,
          message: i.success ? null : i.output.error,
          stage: i.success ? "generating" : "error",
          code: i.code,
          progress_data: i.progress_data,
          eta: i.average_duration
        },
        data: i.success ? i.output : null
      };
    case "process_completed":
      return "error" in i.output ? {
        type: "update",
        status: {
          queue: !0,
          message: i.output.error,
          stage: "error",
          code: i.code,
          success: i.success
        }
      } : {
        type: "complete",
        status: {
          queue: !0,
          message: i.success ? void 0 : i.output.error,
          stage: i.success ? "complete" : "error",
          code: i.code,
          progress_data: i.progress_data,
          eta: i.output.average_duration
        },
        data: i.success ? i.output : null
      };
    case "process_starts":
      return {
        type: "update",
        status: {
          queue: !0,
          stage: "pending",
          code: i.code,
          size: i.rank,
          position: 0,
          success: i.success
        }
      };
  }
  return { type: "none", status: { stage: "error", queue: !0 } };
}
const {
  SvelteComponent: SvelteComponent$2,
  append: append$2,
  attr: attr$2,
  binding_callbacks: binding_callbacks$1,
  bubble,
  create_slot,
  detach: detach$2,
  element: element$2,
  get_all_dirty_from_scope,
  get_slot_changes,
  init: init$2,
  insert: insert$2,
  listen,
  prevent_default,
  run_all,
  safe_not_equal: safe_not_equal$2,
  space: space$2,
  stop_propagation,
  toggle_class: toggle_class$1,
  transition_in: transition_in$2,
  transition_out: transition_out$2,
  update_slot_base
} = window.__gradio__svelte__internal, { createEventDispatcher: createEventDispatcher$1, tick: tick$1, getContext } = window.__gradio__svelte__internal;
function create_fragment$2(i) {
  let t, n, e, s, p, f, A, a, h;
  const o = (
    /*#slots*/
    i[16].default
  ), F = create_slot(
    o,
    i,
    /*$$scope*/
    i[15],
    null
  );
  return {
    c() {
      t = element$2("button"), F && F.c(), n = space$2(), e = element$2("input"), attr$2(e, "type", "file"), attr$2(
        e,
        "accept",
        /*filetype*/
        i[0]
      ), e.multiple = s = /*file_count*/
      i[4] === "multiple" || void 0, attr$2(e, "webkitdirectory", p = /*file_count*/
      i[4] === "directory" || void 0), attr$2(e, "mozdirectory", f = /*file_count*/
      i[4] === "directory" || void 0), attr$2(e, "class", "svelte-18dlsnh"), attr$2(t, "class", "svelte-18dlsnh"), toggle_class$1(
        t,
        "hidden",
        /*hidden*/
        i[5]
      ), toggle_class$1(
        t,
        "center",
        /*center*/
        i[2]
      ), toggle_class$1(
        t,
        "boundedheight",
        /*boundedheight*/
        i[1]
      ), toggle_class$1(
        t,
        "flex",
        /*flex*/
        i[3]
      );
    },
    m(R, w) {
      insert$2(R, t, w), F && F.m(t, null), append$2(t, n), append$2(t, e), i[24](e), A = !0, a || (h = [
        listen(
          e,
          "change",
          /*load_files_from_upload*/
          i[9]
        ),
        listen(t, "drag", stop_propagation(prevent_default(
          /*drag_handler*/
          i[17]
        ))),
        listen(t, "dragstart", stop_propagation(prevent_default(
          /*dragstart_handler*/
          i[18]
        ))),
        listen(t, "dragend", stop_propagation(prevent_default(
          /*dragend_handler*/
          i[19]
        ))),
        listen(t, "dragover", stop_propagation(prevent_default(
          /*dragover_handler*/
          i[20]
        ))),
        listen(t, "dragenter", stop_propagation(prevent_default(
          /*dragenter_handler*/
          i[21]
        ))),
        listen(t, "dragleave", stop_propagation(prevent_default(
          /*dragleave_handler*/
          i[22]
        ))),
        listen(t, "drop", stop_propagation(prevent_default(
          /*drop_handler*/
          i[23]
        ))),
        listen(
          t,
          "click",
          /*open_file_upload*/
          i[6]
        ),
        listen(
          t,
          "drop",
          /*loadFilesFromDrop*/
          i[10]
        ),
        listen(
          t,
          "dragenter",
          /*updateDragging*/
          i[8]
        ),
        listen(
          t,
          "dragleave",
          /*updateDragging*/
          i[8]
        )
      ], a = !0);
    },
    p(R, [w]) {
      F && F.p && (!A || w & /*$$scope*/
      32768) && update_slot_base(
        F,
        o,
        R,
        /*$$scope*/
        R[15],
        A ? get_slot_changes(
          o,
          /*$$scope*/
          R[15],
          w,
          null
        ) : get_all_dirty_from_scope(
          /*$$scope*/
          R[15]
        ),
        null
      ), (!A || w & /*filetype*/
      1) && attr$2(
        e,
        "accept",
        /*filetype*/
        R[0]
      ), (!A || w & /*file_count*/
      16 && s !== (s = /*file_count*/
      R[4] === "multiple" || void 0)) && (e.multiple = s), (!A || w & /*file_count*/
      16 && p !== (p = /*file_count*/
      R[4] === "directory" || void 0)) && attr$2(e, "webkitdirectory", p), (!A || w & /*file_count*/
      16 && f !== (f = /*file_count*/
      R[4] === "directory" || void 0)) && attr$2(e, "mozdirectory", f), (!A || w & /*hidden*/
      32) && toggle_class$1(
        t,
        "hidden",
        /*hidden*/
        R[5]
      ), (!A || w & /*center*/
      4) && toggle_class$1(
        t,
        "center",
        /*center*/
        R[2]
      ), (!A || w & /*boundedheight*/
      2) && toggle_class$1(
        t,
        "boundedheight",
        /*boundedheight*/
        R[1]
      ), (!A || w & /*flex*/
      8) && toggle_class$1(
        t,
        "flex",
        /*flex*/
        R[3]
      );
    },
    i(R) {
      A || (transition_in$2(F, R), A = !0);
    },
    o(R) {
      transition_out$2(F, R), A = !1;
    },
    d(R) {
      R && detach$2(t), F && F.d(R), i[24](null), a = !1, run_all(h);
    }
  };
}
function is_valid_mimetype(i, t) {
  return !i || i === "*" ? !0 : i.endsWith("/*") ? t.startsWith(i.slice(0, -1)) : i === t;
}
function instance$2(i, t, n) {
  let { $$slots: e = {}, $$scope: s } = t;
  var p = this && this.__awaiter || function(G, V, H, st) {
    function dt(yt) {
      return yt instanceof H ? yt : new H(function(gt) {
        gt(yt);
      });
    }
    return new (H || (H = Promise))(function(yt, gt) {
      function k(d) {
        try {
          u(st.next(d));
        } catch (b) {
          gt(b);
        }
      }
      function l(d) {
        try {
          u(st.throw(d));
        } catch (b) {
          gt(b);
        }
      }
      function u(d) {
        d.done ? yt(d.value) : dt(d.value).then(k, l);
      }
      u((st = st.apply(G, V || [])).next());
    });
  };
  let { filetype: f = null } = t, { dragging: A = !1 } = t, { boundedheight: a = !0 } = t, { center: h = !0 } = t, { flex: o = !0 } = t, { file_count: F = "single" } = t, { disable_click: R = !1 } = t, { root: w } = t, { hidden: T = !1 } = t;
  const P = getContext("upload_files");
  let m;
  const C = createEventDispatcher$1();
  function x() {
    n(11, A = !A);
  }
  function E() {
    R || (n(7, m.value = "", m), m.click());
  }
  function S(G) {
    return p(this, void 0, void 0, function* () {
      yield tick$1();
      const V = yield upload(G, w, P);
      return C("load", F === "single" ? V == null ? void 0 : V[0] : V), V || [];
    });
  }
  function g(G) {
    return p(this, void 0, void 0, function* () {
      if (!G.length)
        return;
      let V = G.map((st) => new File([st], st.name)), H = yield prepare_files(V);
      return yield S(H);
    });
  }
  function v(G) {
    return p(this, void 0, void 0, function* () {
      const V = G.target;
      V.files && (yield g(Array.from(V.files)));
    });
  }
  function $(G) {
    return p(this, void 0, void 0, function* () {
      var V;
      if (n(11, A = !1), !(!((V = G.dataTransfer) === null || V === void 0) && V.files))
        return;
      const H = Array.from(G.dataTransfer.files).filter((st) => f != null && f.split(",").some((dt) => is_valid_mimetype(dt, st.type)) ? !0 : (C("error", `Invalid file type only ${f} allowed.`), !1));
      yield g(H);
    });
  }
  function M(G) {
    bubble.call(this, i, G);
  }
  function _(G) {
    bubble.call(this, i, G);
  }
  function N(G) {
    bubble.call(this, i, G);
  }
  function D(G) {
    bubble.call(this, i, G);
  }
  function X(G) {
    bubble.call(this, i, G);
  }
  function Y(G) {
    bubble.call(this, i, G);
  }
  function I(G) {
    bubble.call(this, i, G);
  }
  function U(G) {
    binding_callbacks$1[G ? "unshift" : "push"](() => {
      m = G, n(7, m);
    });
  }
  return i.$$set = (G) => {
    "filetype" in G && n(0, f = G.filetype), "dragging" in G && n(11, A = G.dragging), "boundedheight" in G && n(1, a = G.boundedheight), "center" in G && n(2, h = G.center), "flex" in G && n(3, o = G.flex), "file_count" in G && n(4, F = G.file_count), "disable_click" in G && n(12, R = G.disable_click), "root" in G && n(13, w = G.root), "hidden" in G && n(5, T = G.hidden), "$$scope" in G && n(15, s = G.$$scope);
  }, [
    f,
    a,
    h,
    o,
    F,
    T,
    E,
    m,
    x,
    v,
    $,
    A,
    R,
    w,
    g,
    s,
    e,
    M,
    _,
    N,
    D,
    X,
    Y,
    I,
    U
  ];
}
class Upload extends SvelteComponent$2 {
  constructor(t) {
    super(), init$2(this, t, instance$2, create_fragment$2, safe_not_equal$2, {
      filetype: 0,
      dragging: 11,
      boundedheight: 1,
      center: 2,
      flex: 3,
      file_count: 4,
      disable_click: 12,
      root: 13,
      hidden: 5,
      open_file_upload: 6,
      load_files: 14
    });
  }
  get open_file_upload() {
    return this.$$.ctx[6];
  }
  get load_files() {
    return this.$$.ctx[14];
  }
}
const {
  SvelteComponent: SvelteComponent$1,
  append: append$1,
  attr: attr$1,
  check_outros: check_outros$1,
  create_component: create_component$1,
  destroy_component: destroy_component$1,
  detach: detach$1,
  element: element$1,
  group_outros: group_outros$1,
  init: init$1,
  insert: insert$1,
  mount_component: mount_component$1,
  safe_not_equal: safe_not_equal$1,
  set_style: set_style$1,
  space: space$1,
  toggle_class,
  transition_in: transition_in$1,
  transition_out: transition_out$1
} = window.__gradio__svelte__internal, { createEventDispatcher } = window.__gradio__svelte__internal;
function create_if_block_1$1(i) {
  let t, n;
  return t = new IconButton({
    props: {
      Icon: Edit,
      label: (
        /*i18n*/
        i[3]("common.edit")
      )
    }
  }), t.$on(
    "click",
    /*click_handler*/
    i[5]
  ), {
    c() {
      create_component$1(t.$$.fragment);
    },
    m(e, s) {
      mount_component$1(t, e, s), n = !0;
    },
    p(e, s) {
      const p = {};
      s & /*i18n*/
      8 && (p.label = /*i18n*/
      e[3]("common.edit")), t.$set(p);
    },
    i(e) {
      n || (transition_in$1(t.$$.fragment, e), n = !0);
    },
    o(e) {
      transition_out$1(t.$$.fragment, e), n = !1;
    },
    d(e) {
      destroy_component$1(t, e);
    }
  };
}
function create_if_block$1(i) {
  let t, n;
  return t = new IconButton({
    props: {
      Icon: Undo,
      label: (
        /*i18n*/
        i[3]("common.undo")
      )
    }
  }), t.$on(
    "click",
    /*click_handler_1*/
    i[6]
  ), {
    c() {
      create_component$1(t.$$.fragment);
    },
    m(e, s) {
      mount_component$1(t, e, s), n = !0;
    },
    p(e, s) {
      const p = {};
      s & /*i18n*/
      8 && (p.label = /*i18n*/
      e[3]("common.undo")), t.$set(p);
    },
    i(e) {
      n || (transition_in$1(t.$$.fragment, e), n = !0);
    },
    o(e) {
      transition_out$1(t.$$.fragment, e), n = !1;
    },
    d(e) {
      destroy_component$1(t, e);
    }
  };
}
function create_fragment$1(i) {
  let t, n, e, s, p, f = (
    /*editable*/
    i[0] && create_if_block_1$1(i)
  ), A = (
    /*undoable*/
    i[1] && create_if_block$1(i)
  );
  return s = new IconButton({
    props: {
      Icon: Clear,
      label: (
        /*i18n*/
        i[3]("common.clear")
      )
    }
  }), s.$on(
    "click",
    /*click_handler_2*/
    i[7]
  ), {
    c() {
      t = element$1("div"), f && f.c(), n = space$1(), A && A.c(), e = space$1(), create_component$1(s.$$.fragment), attr$1(t, "class", "svelte-1wj0ocy"), toggle_class(t, "not-absolute", !/*absolute*/
      i[2]), set_style$1(
        t,
        "position",
        /*absolute*/
        i[2] ? "absolute" : "static"
      );
    },
    m(a, h) {
      insert$1(a, t, h), f && f.m(t, null), append$1(t, n), A && A.m(t, null), append$1(t, e), mount_component$1(s, t, null), p = !0;
    },
    p(a, [h]) {
      /*editable*/
      a[0] ? f ? (f.p(a, h), h & /*editable*/
      1 && transition_in$1(f, 1)) : (f = create_if_block_1$1(a), f.c(), transition_in$1(f, 1), f.m(t, n)) : f && (group_outros$1(), transition_out$1(f, 1, 1, () => {
        f = null;
      }), check_outros$1()), /*undoable*/
      a[1] ? A ? (A.p(a, h), h & /*undoable*/
      2 && transition_in$1(A, 1)) : (A = create_if_block$1(a), A.c(), transition_in$1(A, 1), A.m(t, e)) : A && (group_outros$1(), transition_out$1(A, 1, 1, () => {
        A = null;
      }), check_outros$1());
      const o = {};
      h & /*i18n*/
      8 && (o.label = /*i18n*/
      a[3]("common.clear")), s.$set(o), (!p || h & /*absolute*/
      4) && toggle_class(t, "not-absolute", !/*absolute*/
      a[2]), h & /*absolute*/
      4 && set_style$1(
        t,
        "position",
        /*absolute*/
        a[2] ? "absolute" : "static"
      );
    },
    i(a) {
      p || (transition_in$1(f), transition_in$1(A), transition_in$1(s.$$.fragment, a), p = !0);
    },
    o(a) {
      transition_out$1(f), transition_out$1(A), transition_out$1(s.$$.fragment, a), p = !1;
    },
    d(a) {
      a && detach$1(t), f && f.d(), A && A.d(), destroy_component$1(s);
    }
  };
}
function instance$1(i, t, n) {
  let { editable: e = !1 } = t, { undoable: s = !1 } = t, { absolute: p = !0 } = t, { i18n: f } = t;
  const A = createEventDispatcher(), a = () => A("edit"), h = () => A("undo"), o = (F) => {
    A("clear"), F.stopPropagation();
  };
  return i.$$set = (F) => {
    "editable" in F && n(0, e = F.editable), "undoable" in F && n(1, s = F.undoable), "absolute" in F && n(2, p = F.absolute), "i18n" in F && n(3, f = F.i18n);
  }, [
    e,
    s,
    p,
    f,
    A,
    a,
    h,
    o
  ];
}
class ModifyUpload extends SvelteComponent$1 {
  constructor(t) {
    super(), init$1(this, t, instance$1, create_fragment$1, safe_not_equal$1, {
      editable: 0,
      undoable: 1,
      absolute: 2,
      i18n: 3
    });
  }
}
function getAugmentedNamespace(i) {
  if (i.__esModule)
    return i;
  var t = i.default;
  if (typeof t == "function") {
    var n = function e() {
      return this instanceof e ? Reflect.construct(t, arguments, this.constructor) : t.apply(this, arguments);
    };
    n.prototype = t.prototype;
  } else
    n = {};
  return Object.defineProperty(n, "__esModule", { value: !0 }), Object.keys(i).forEach(function(e) {
    var s = Object.getOwnPropertyDescriptor(i, e);
    Object.defineProperty(n, e, s.get ? s : {
      enumerable: !0,
      get: function() {
        return i[e];
      }
    });
  }), n;
}
function commonjsRequire(i) {
  throw new Error('Could not dynamically require "' + i + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var pdf = { exports: {} };
const require$$5$1 = {}, __viteBrowserExternal = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: require$$5$1
}, Symbol.toStringTag, { value: "Module" })), require$$5 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal);
(function(module, exports) {
  (function(t, n) {
    module.exports = t.pdfjsLib = n();
  })(globalThis, () => (
    /******/
    (() => {
      var __webpack_modules__ = [
        ,
        /* 1 */
        /***/
        (i, t) => {
          var Vt;
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.VerbosityLevel = t.Util = t.UnknownErrorException = t.UnexpectedResponseException = t.TextRenderingMode = t.RenderingIntentFlag = t.PromiseCapability = t.PermissionFlag = t.PasswordResponses = t.PasswordException = t.PageActionEventType = t.OPS = t.MissingPDFException = t.MAX_IMAGE_SIZE_TO_CACHE = t.LINE_FACTOR = t.LINE_DESCENT_FACTOR = t.InvalidPDFException = t.ImageKind = t.IDENTITY_MATRIX = t.FormatError = t.FeatureTest = t.FONT_IDENTITY_MATRIX = t.DocumentActionEventType = t.CMapCompressionType = t.BaseException = t.BASELINE_FACTOR = t.AnnotationType = t.AnnotationReplyType = t.AnnotationPrefix = t.AnnotationMode = t.AnnotationFlag = t.AnnotationFieldFlag = t.AnnotationEditorType = t.AnnotationEditorPrefix = t.AnnotationEditorParamsType = t.AnnotationBorderStyleType = t.AnnotationActionEventType = t.AbortException = void 0, t.assert = st, t.bytesToString = z, t.createValidAbsoluteUrl = yt, t.getModificationDate = Tt, t.getUuid = Gt, t.getVerbosityLevel = U, t.info = G, t.isArrayBuffer = pt, t.isArrayEqual = Ct, t.isNodeJS = void 0, t.normalizeUnicode = zt, t.objectFromMap = ht, t.objectSize = lt, t.setVerbosityLevel = I, t.shadow = gt, t.string32 = Z, t.stringToBytes = it, t.stringToPDFString = _t, t.stringToUTF8String = rt, t.unreachable = H, t.utf8StringToString = at, t.warn = V;
          const n = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser");
          t.isNodeJS = n;
          const e = [1, 0, 0, 1, 0, 0];
          t.IDENTITY_MATRIX = e;
          const s = [1e-3, 0, 0, 1e-3, 0, 0];
          t.FONT_IDENTITY_MATRIX = s;
          const p = 1e7;
          t.MAX_IMAGE_SIZE_TO_CACHE = p;
          const f = 1.35;
          t.LINE_FACTOR = f;
          const A = 0.35;
          t.LINE_DESCENT_FACTOR = A;
          const a = A / f;
          t.BASELINE_FACTOR = a;
          const h = {
            ANY: 1,
            DISPLAY: 2,
            PRINT: 4,
            SAVE: 8,
            ANNOTATIONS_FORMS: 16,
            ANNOTATIONS_STORAGE: 32,
            ANNOTATIONS_DISABLE: 64,
            OPLIST: 256
          };
          t.RenderingIntentFlag = h;
          const o = {
            DISABLE: 0,
            ENABLE: 1,
            ENABLE_FORMS: 2,
            ENABLE_STORAGE: 3
          };
          t.AnnotationMode = o;
          const F = "pdfjs_internal_editor_";
          t.AnnotationEditorPrefix = F;
          const R = {
            DISABLE: -1,
            NONE: 0,
            FREETEXT: 3,
            STAMP: 13,
            INK: 15
          };
          t.AnnotationEditorType = R;
          const w = {
            RESIZE: 1,
            CREATE: 2,
            FREETEXT_SIZE: 11,
            FREETEXT_COLOR: 12,
            FREETEXT_OPACITY: 13,
            INK_COLOR: 21,
            INK_THICKNESS: 22,
            INK_OPACITY: 23
          };
          t.AnnotationEditorParamsType = w;
          const T = {
            PRINT: 4,
            MODIFY_CONTENTS: 8,
            COPY: 16,
            MODIFY_ANNOTATIONS: 32,
            FILL_INTERACTIVE_FORMS: 256,
            COPY_FOR_ACCESSIBILITY: 512,
            ASSEMBLE: 1024,
            PRINT_HIGH_QUALITY: 2048
          };
          t.PermissionFlag = T;
          const P = {
            FILL: 0,
            STROKE: 1,
            FILL_STROKE: 2,
            INVISIBLE: 3,
            FILL_ADD_TO_PATH: 4,
            STROKE_ADD_TO_PATH: 5,
            FILL_STROKE_ADD_TO_PATH: 6,
            ADD_TO_PATH: 7,
            FILL_STROKE_MASK: 3,
            ADD_TO_PATH_FLAG: 4
          };
          t.TextRenderingMode = P;
          const m = {
            GRAYSCALE_1BPP: 1,
            RGB_24BPP: 2,
            RGBA_32BPP: 3
          };
          t.ImageKind = m;
          const C = {
            TEXT: 1,
            LINK: 2,
            FREETEXT: 3,
            LINE: 4,
            SQUARE: 5,
            CIRCLE: 6,
            POLYGON: 7,
            POLYLINE: 8,
            HIGHLIGHT: 9,
            UNDERLINE: 10,
            SQUIGGLY: 11,
            STRIKEOUT: 12,
            STAMP: 13,
            CARET: 14,
            INK: 15,
            POPUP: 16,
            FILEATTACHMENT: 17,
            SOUND: 18,
            MOVIE: 19,
            WIDGET: 20,
            SCREEN: 21,
            PRINTERMARK: 22,
            TRAPNET: 23,
            WATERMARK: 24,
            THREED: 25,
            REDACT: 26
          };
          t.AnnotationType = C;
          const x = {
            GROUP: "Group",
            REPLY: "R"
          };
          t.AnnotationReplyType = x;
          const E = {
            INVISIBLE: 1,
            HIDDEN: 2,
            PRINT: 4,
            NOZOOM: 8,
            NOROTATE: 16,
            NOVIEW: 32,
            READONLY: 64,
            LOCKED: 128,
            TOGGLENOVIEW: 256,
            LOCKEDCONTENTS: 512
          };
          t.AnnotationFlag = E;
          const S = {
            READONLY: 1,
            REQUIRED: 2,
            NOEXPORT: 4,
            MULTILINE: 4096,
            PASSWORD: 8192,
            NOTOGGLETOOFF: 16384,
            RADIO: 32768,
            PUSHBUTTON: 65536,
            COMBO: 131072,
            EDIT: 262144,
            SORT: 524288,
            FILESELECT: 1048576,
            MULTISELECT: 2097152,
            DONOTSPELLCHECK: 4194304,
            DONOTSCROLL: 8388608,
            COMB: 16777216,
            RICHTEXT: 33554432,
            RADIOSINUNISON: 33554432,
            COMMITONSELCHANGE: 67108864
          };
          t.AnnotationFieldFlag = S;
          const g = {
            SOLID: 1,
            DASHED: 2,
            BEVELED: 3,
            INSET: 4,
            UNDERLINE: 5
          };
          t.AnnotationBorderStyleType = g;
          const v = {
            E: "Mouse Enter",
            X: "Mouse Exit",
            D: "Mouse Down",
            U: "Mouse Up",
            Fo: "Focus",
            Bl: "Blur",
            PO: "PageOpen",
            PC: "PageClose",
            PV: "PageVisible",
            PI: "PageInvisible",
            K: "Keystroke",
            F: "Format",
            V: "Validate",
            C: "Calculate"
          };
          t.AnnotationActionEventType = v;
          const $ = {
            WC: "WillClose",
            WS: "WillSave",
            DS: "DidSave",
            WP: "WillPrint",
            DP: "DidPrint"
          };
          t.DocumentActionEventType = $;
          const M = {
            O: "PageOpen",
            C: "PageClose"
          };
          t.PageActionEventType = M;
          const _ = {
            ERRORS: 0,
            WARNINGS: 1,
            INFOS: 5
          };
          t.VerbosityLevel = _;
          const N = {
            NONE: 0,
            BINARY: 1
          };
          t.CMapCompressionType = N;
          const D = {
            dependency: 1,
            setLineWidth: 2,
            setLineCap: 3,
            setLineJoin: 4,
            setMiterLimit: 5,
            setDash: 6,
            setRenderingIntent: 7,
            setFlatness: 8,
            setGState: 9,
            save: 10,
            restore: 11,
            transform: 12,
            moveTo: 13,
            lineTo: 14,
            curveTo: 15,
            curveTo2: 16,
            curveTo3: 17,
            closePath: 18,
            rectangle: 19,
            stroke: 20,
            closeStroke: 21,
            fill: 22,
            eoFill: 23,
            fillStroke: 24,
            eoFillStroke: 25,
            closeFillStroke: 26,
            closeEOFillStroke: 27,
            endPath: 28,
            clip: 29,
            eoClip: 30,
            beginText: 31,
            endText: 32,
            setCharSpacing: 33,
            setWordSpacing: 34,
            setHScale: 35,
            setLeading: 36,
            setFont: 37,
            setTextRenderingMode: 38,
            setTextRise: 39,
            moveText: 40,
            setLeadingMoveText: 41,
            setTextMatrix: 42,
            nextLine: 43,
            showText: 44,
            showSpacedText: 45,
            nextLineShowText: 46,
            nextLineSetSpacingShowText: 47,
            setCharWidth: 48,
            setCharWidthAndBounds: 49,
            setStrokeColorSpace: 50,
            setFillColorSpace: 51,
            setStrokeColor: 52,
            setStrokeColorN: 53,
            setFillColor: 54,
            setFillColorN: 55,
            setStrokeGray: 56,
            setFillGray: 57,
            setStrokeRGBColor: 58,
            setFillRGBColor: 59,
            setStrokeCMYKColor: 60,
            setFillCMYKColor: 61,
            shadingFill: 62,
            beginInlineImage: 63,
            beginImageData: 64,
            endInlineImage: 65,
            paintXObject: 66,
            markPoint: 67,
            markPointProps: 68,
            beginMarkedContent: 69,
            beginMarkedContentProps: 70,
            endMarkedContent: 71,
            beginCompat: 72,
            endCompat: 73,
            paintFormXObjectBegin: 74,
            paintFormXObjectEnd: 75,
            beginGroup: 76,
            endGroup: 77,
            beginAnnotation: 80,
            endAnnotation: 81,
            paintImageMaskXObject: 83,
            paintImageMaskXObjectGroup: 84,
            paintImageXObject: 85,
            paintInlineImageXObject: 86,
            paintInlineImageXObjectGroup: 87,
            paintImageXObjectRepeat: 88,
            paintImageMaskXObjectRepeat: 89,
            paintSolidColorImageMask: 90,
            constructPath: 91
          };
          t.OPS = D;
          const X = {
            NEED_PASSWORD: 1,
            INCORRECT_PASSWORD: 2
          };
          t.PasswordResponses = X;
          let Y = _.WARNINGS;
          function I(ut) {
            Number.isInteger(ut) && (Y = ut);
          }
          function U() {
            return Y;
          }
          function G(ut) {
            Y >= _.INFOS && console.log(`Info: ${ut}`);
          }
          function V(ut) {
            Y >= _.WARNINGS && console.log(`Warning: ${ut}`);
          }
          function H(ut) {
            throw new Error(ut);
          }
          function st(ut, nt) {
            ut || H(nt);
          }
          function dt(ut) {
            switch (ut == null ? void 0 : ut.protocol) {
              case "http:":
              case "https:":
              case "ftp:":
              case "mailto:":
              case "tel:":
                return !0;
              default:
                return !1;
            }
          }
          function yt(ut, nt = null, Q = null) {
            if (!ut)
              return null;
            try {
              if (Q && typeof ut == "string") {
                if (Q.addDefaultProtocol && ut.startsWith("www.")) {
                  const wt = ut.match(/\./g);
                  (wt == null ? void 0 : wt.length) >= 2 && (ut = `http://${ut}`);
                }
                if (Q.tryConvertEncoding)
                  try {
                    ut = rt(ut);
                  } catch {
                  }
              }
              const At = nt ? new URL(ut, nt) : new URL(ut);
              if (dt(At))
                return At;
            } catch {
            }
            return null;
          }
          function gt(ut, nt, Q, At = !1) {
            return Object.defineProperty(ut, nt, {
              value: Q,
              enumerable: !At,
              configurable: !0,
              writable: !1
            }), Q;
          }
          const k = function() {
            function nt(Q, At) {
              this.constructor === nt && H("Cannot initialize BaseException."), this.message = Q, this.name = At;
            }
            return nt.prototype = new Error(), nt.constructor = nt, nt;
          }();
          t.BaseException = k;
          class l extends k {
            constructor(nt, Q) {
              super(nt, "PasswordException"), this.code = Q;
            }
          }
          t.PasswordException = l;
          class u extends k {
            constructor(nt, Q) {
              super(nt, "UnknownErrorException"), this.details = Q;
            }
          }
          t.UnknownErrorException = u;
          class d extends k {
            constructor(nt) {
              super(nt, "InvalidPDFException");
            }
          }
          t.InvalidPDFException = d;
          class b extends k {
            constructor(nt) {
              super(nt, "MissingPDFException");
            }
          }
          t.MissingPDFException = b;
          class y extends k {
            constructor(nt, Q) {
              super(nt, "UnexpectedResponseException"), this.status = Q;
            }
          }
          t.UnexpectedResponseException = y;
          class O extends k {
            constructor(nt) {
              super(nt, "FormatError");
            }
          }
          t.FormatError = O;
          class B extends k {
            constructor(nt) {
              super(nt, "AbortException");
            }
          }
          t.AbortException = B;
          function z(ut) {
            (typeof ut != "object" || (ut == null ? void 0 : ut.length) === void 0) && H("Invalid argument for bytesToString");
            const nt = ut.length, Q = 8192;
            if (nt < Q)
              return String.fromCharCode.apply(null, ut);
            const At = [];
            for (let wt = 0; wt < nt; wt += Q) {
              const te = Math.min(wt + Q, nt), Qt = ut.subarray(wt, te);
              At.push(String.fromCharCode.apply(null, Qt));
            }
            return At.join("");
          }
          function it(ut) {
            typeof ut != "string" && H("Invalid argument for stringToBytes");
            const nt = ut.length, Q = new Uint8Array(nt);
            for (let At = 0; At < nt; ++At)
              Q[At] = ut.charCodeAt(At) & 255;
            return Q;
          }
          function Z(ut) {
            return String.fromCharCode(ut >> 24 & 255, ut >> 16 & 255, ut >> 8 & 255, ut & 255);
          }
          function lt(ut) {
            return Object.keys(ut).length;
          }
          function ht(ut) {
            const nt = /* @__PURE__ */ Object.create(null);
            for (const [Q, At] of ut)
              nt[Q] = At;
            return nt;
          }
          function mt() {
            const ut = new Uint8Array(4);
            return ut[0] = 1, new Uint32Array(ut.buffer, 0, 1)[0] === 1;
          }
          function ft() {
            try {
              return new Function(""), !0;
            } catch {
              return !1;
            }
          }
          class kt {
            static get isLittleEndian() {
              return gt(this, "isLittleEndian", mt());
            }
            static get isEvalSupported() {
              return gt(this, "isEvalSupported", ft());
            }
            static get isOffscreenCanvasSupported() {
              return gt(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
            }
            static get platform() {
              return typeof navigator > "u" ? gt(this, "platform", {
                isWin: !1,
                isMac: !1
              }) : gt(this, "platform", {
                isWin: navigator.platform.includes("Win"),
                isMac: navigator.platform.includes("Mac")
              });
            }
            static get isCSSRoundSupported() {
              var nt, Q;
              return gt(this, "isCSSRoundSupported", (Q = (nt = globalThis.CSS) == null ? void 0 : nt.supports) == null ? void 0 : Q.call(nt, "width: round(1.5px, 1px)"));
            }
          }
          t.FeatureTest = kt;
          const Rt = [...Array(256).keys()].map((ut) => ut.toString(16).padStart(2, "0"));
          class St {
            static makeHexColor(nt, Q, At) {
              return `#${Rt[nt]}${Rt[Q]}${Rt[At]}`;
            }
            static scaleMinMax(nt, Q) {
              let At;
              nt[0] ? (nt[0] < 0 && (At = Q[0], Q[0] = Q[1], Q[1] = At), Q[0] *= nt[0], Q[1] *= nt[0], nt[3] < 0 && (At = Q[2], Q[2] = Q[3], Q[3] = At), Q[2] *= nt[3], Q[3] *= nt[3]) : (At = Q[0], Q[0] = Q[2], Q[2] = At, At = Q[1], Q[1] = Q[3], Q[3] = At, nt[1] < 0 && (At = Q[2], Q[2] = Q[3], Q[3] = At), Q[2] *= nt[1], Q[3] *= nt[1], nt[2] < 0 && (At = Q[0], Q[0] = Q[1], Q[1] = At), Q[0] *= nt[2], Q[1] *= nt[2]), Q[0] += nt[4], Q[1] += nt[4], Q[2] += nt[5], Q[3] += nt[5];
            }
            static transform(nt, Q) {
              return [nt[0] * Q[0] + nt[2] * Q[1], nt[1] * Q[0] + nt[3] * Q[1], nt[0] * Q[2] + nt[2] * Q[3], nt[1] * Q[2] + nt[3] * Q[3], nt[0] * Q[4] + nt[2] * Q[5] + nt[4], nt[1] * Q[4] + nt[3] * Q[5] + nt[5]];
            }
            static applyTransform(nt, Q) {
              const At = nt[0] * Q[0] + nt[1] * Q[2] + Q[4], wt = nt[0] * Q[1] + nt[1] * Q[3] + Q[5];
              return [At, wt];
            }
            static applyInverseTransform(nt, Q) {
              const At = Q[0] * Q[3] - Q[1] * Q[2], wt = (nt[0] * Q[3] - nt[1] * Q[2] + Q[2] * Q[5] - Q[4] * Q[3]) / At, te = (-nt[0] * Q[1] + nt[1] * Q[0] + Q[4] * Q[1] - Q[5] * Q[0]) / At;
              return [wt, te];
            }
            static getAxialAlignedBoundingBox(nt, Q) {
              const At = this.applyTransform(nt, Q), wt = this.applyTransform(nt.slice(2, 4), Q), te = this.applyTransform([nt[0], nt[3]], Q), Qt = this.applyTransform([nt[2], nt[1]], Q);
              return [Math.min(At[0], wt[0], te[0], Qt[0]), Math.min(At[1], wt[1], te[1], Qt[1]), Math.max(At[0], wt[0], te[0], Qt[0]), Math.max(At[1], wt[1], te[1], Qt[1])];
            }
            static inverseTransform(nt) {
              const Q = nt[0] * nt[3] - nt[1] * nt[2];
              return [nt[3] / Q, -nt[1] / Q, -nt[2] / Q, nt[0] / Q, (nt[2] * nt[5] - nt[4] * nt[3]) / Q, (nt[4] * nt[1] - nt[5] * nt[0]) / Q];
            }
            static singularValueDecompose2dScale(nt) {
              const Q = [nt[0], nt[2], nt[1], nt[3]], At = nt[0] * Q[0] + nt[1] * Q[2], wt = nt[0] * Q[1] + nt[1] * Q[3], te = nt[2] * Q[0] + nt[3] * Q[2], Qt = nt[2] * Q[1] + nt[3] * Q[3], et = (At + Qt) / 2, Et = Math.sqrt((At + Qt) ** 2 - 4 * (At * Qt - te * wt)) / 2, Ot = et + Et || 1, Pt = et - Et || 1;
              return [Math.sqrt(Ot), Math.sqrt(Pt)];
            }
            static normalizeRect(nt) {
              const Q = nt.slice(0);
              return nt[0] > nt[2] && (Q[0] = nt[2], Q[2] = nt[0]), nt[1] > nt[3] && (Q[1] = nt[3], Q[3] = nt[1]), Q;
            }
            static intersect(nt, Q) {
              const At = Math.max(Math.min(nt[0], nt[2]), Math.min(Q[0], Q[2])), wt = Math.min(Math.max(nt[0], nt[2]), Math.max(Q[0], Q[2]));
              if (At > wt)
                return null;
              const te = Math.max(Math.min(nt[1], nt[3]), Math.min(Q[1], Q[3])), Qt = Math.min(Math.max(nt[1], nt[3]), Math.max(Q[1], Q[3]));
              return te > Qt ? null : [At, te, wt, Qt];
            }
            static bezierBoundingBox(nt, Q, At, wt, te, Qt, et, Et) {
              const Ot = [], Pt = [[], []];
              let $t, Nt, Jt, vt, Yt, Lt, j, c;
              for (let tt = 0; tt < 2; ++tt) {
                if (tt === 0 ? (Nt = 6 * nt - 12 * At + 6 * te, $t = -3 * nt + 9 * At - 9 * te + 3 * et, Jt = 3 * At - 3 * nt) : (Nt = 6 * Q - 12 * wt + 6 * Qt, $t = -3 * Q + 9 * wt - 9 * Qt + 3 * Et, Jt = 3 * wt - 3 * Q), Math.abs($t) < 1e-12) {
                  if (Math.abs(Nt) < 1e-12)
                    continue;
                  vt = -Jt / Nt, 0 < vt && vt < 1 && Ot.push(vt);
                  continue;
                }
                j = Nt * Nt - 4 * Jt * $t, c = Math.sqrt(j), !(j < 0) && (Yt = (-Nt + c) / (2 * $t), 0 < Yt && Yt < 1 && Ot.push(Yt), Lt = (-Nt - c) / (2 * $t), 0 < Lt && Lt < 1 && Ot.push(Lt));
              }
              let L = Ot.length, q;
              const K = L;
              for (; L--; )
                vt = Ot[L], q = 1 - vt, Pt[0][L] = q * q * q * nt + 3 * q * q * vt * At + 3 * q * vt * vt * te + vt * vt * vt * et, Pt[1][L] = q * q * q * Q + 3 * q * q * vt * wt + 3 * q * vt * vt * Qt + vt * vt * vt * Et;
              return Pt[0][K] = nt, Pt[1][K] = Q, Pt[0][K + 1] = et, Pt[1][K + 1] = Et, Pt[0].length = Pt[1].length = K + 2, [Math.min(...Pt[0]), Math.min(...Pt[1]), Math.max(...Pt[0]), Math.max(...Pt[1])];
            }
          }
          t.Util = St;
          const It = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 728, 711, 710, 729, 733, 731, 730, 732, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 8226, 8224, 8225, 8230, 8212, 8211, 402, 8260, 8249, 8250, 8722, 8240, 8222, 8220, 8221, 8216, 8217, 8218, 8482, 64257, 64258, 321, 338, 352, 376, 381, 305, 322, 339, 353, 382, 0, 8364];
          function _t(ut) {
            if (ut[0] >= "ï") {
              let Q;
              if (ut[0] === "þ" && ut[1] === "ÿ" ? Q = "utf-16be" : ut[0] === "ÿ" && ut[1] === "þ" ? Q = "utf-16le" : ut[0] === "ï" && ut[1] === "»" && ut[2] === "¿" && (Q = "utf-8"), Q)
                try {
                  const At = new TextDecoder(Q, {
                    fatal: !0
                  }), wt = it(ut);
                  return At.decode(wt);
                } catch (At) {
                  V(`stringToPDFString: "${At}".`);
                }
            }
            const nt = [];
            for (let Q = 0, At = ut.length; Q < At; Q++) {
              const wt = It[ut.charCodeAt(Q)];
              nt.push(wt ? String.fromCharCode(wt) : ut.charAt(Q));
            }
            return nt.join("");
          }
          function rt(ut) {
            return decodeURIComponent(escape(ut));
          }
          function at(ut) {
            return unescape(encodeURIComponent(ut));
          }
          function pt(ut) {
            return typeof ut == "object" && (ut == null ? void 0 : ut.byteLength) !== void 0;
          }
          function Ct(ut, nt) {
            if (ut.length !== nt.length)
              return !1;
            for (let Q = 0, At = ut.length; Q < At; Q++)
              if (ut[Q] !== nt[Q])
                return !1;
            return !0;
          }
          function Tt(ut = /* @__PURE__ */ new Date()) {
            return [ut.getUTCFullYear().toString(), (ut.getUTCMonth() + 1).toString().padStart(2, "0"), ut.getUTCDate().toString().padStart(2, "0"), ut.getUTCHours().toString().padStart(2, "0"), ut.getUTCMinutes().toString().padStart(2, "0"), ut.getUTCSeconds().toString().padStart(2, "0")].join("");
          }
          class Bt {
            constructor() {
              W(this, Vt, !1);
              this.promise = new Promise((nt, Q) => {
                this.resolve = (At) => {
                  ot(this, Vt, !0), nt(At);
                }, this.reject = (At) => {
                  ot(this, Vt, !0), Q(At);
                };
              });
            }
            get settled() {
              return r(this, Vt);
            }
          }
          Vt = new WeakMap(), t.PromiseCapability = Bt;
          let Wt = null, jt = null;
          function zt(ut) {
            return Wt || (Wt = /([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu, jt = /* @__PURE__ */ new Map([["ﬅ", "ſt"]])), ut.replaceAll(Wt, (nt, Q, At) => Q ? Q.normalize("NFKC") : jt.get(At));
          }
          function Gt() {
            if (typeof crypto < "u" && typeof (crypto == null ? void 0 : crypto.randomUUID) == "function")
              return crypto.randomUUID();
            const ut = new Uint8Array(32);
            if (typeof crypto < "u" && typeof (crypto == null ? void 0 : crypto.getRandomValues) == "function")
              crypto.getRandomValues(ut);
            else
              for (let nt = 0; nt < 32; nt++)
                ut[nt] = Math.floor(Math.random() * 255);
            return z(ut);
          }
          const qt = "pdfjs_internal_id_";
          t.AnnotationPrefix = qt;
        },
        /* 2 */
        /***/
        (__unused_webpack_module, exports, __w_pdfjs_require__) => {
          var i, n, e, s, he, f, we, a, h, o, F, R, w, T, P, m, Ee, x, E, Ne, g, v;
          Object.defineProperty(exports, "__esModule", {
            value: !0
          }), exports.RenderTask = exports.PDFWorkerUtil = exports.PDFWorker = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFDocumentLoadingTask = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.DefaultStandardFontDataFactory = exports.DefaultFilterFactory = exports.DefaultCanvasFactory = exports.DefaultCMapReaderFactory = void 0, Object.defineProperty(exports, "SVGGraphics", {
            enumerable: !0,
            get: function() {
              return _displaySvg.SVGGraphics;
            }
          }), exports.build = void 0, exports.getDocument = getDocument, exports.version = void 0;
          var _util = __w_pdfjs_require__(1), _annotation_storage = __w_pdfjs_require__(3), _display_utils = __w_pdfjs_require__(6), _font_loader = __w_pdfjs_require__(9), _displayNode_utils = __w_pdfjs_require__(10), _canvas = __w_pdfjs_require__(11), _worker_options = __w_pdfjs_require__(14), _message_handler = __w_pdfjs_require__(15), _metadata = __w_pdfjs_require__(16), _optional_content_config = __w_pdfjs_require__(17), _transport_stream = __w_pdfjs_require__(18), _displayFetch_stream = __w_pdfjs_require__(19), _displayNetwork = __w_pdfjs_require__(22), _displayNode_stream = __w_pdfjs_require__(23), _displaySvg = __w_pdfjs_require__(24), _xfa_text = __w_pdfjs_require__(25);
          const DEFAULT_RANGE_CHUNK_SIZE = 65536, RENDERING_CANCELLED_TIMEOUT = 100, DELAYED_CLEANUP_TIMEOUT = 5e3, DefaultCanvasFactory = _util.isNodeJS ? _displayNode_utils.NodeCanvasFactory : _display_utils.DOMCanvasFactory;
          exports.DefaultCanvasFactory = DefaultCanvasFactory;
          const DefaultCMapReaderFactory = _util.isNodeJS ? _displayNode_utils.NodeCMapReaderFactory : _display_utils.DOMCMapReaderFactory;
          exports.DefaultCMapReaderFactory = DefaultCMapReaderFactory;
          const DefaultFilterFactory = _util.isNodeJS ? _displayNode_utils.NodeFilterFactory : _display_utils.DOMFilterFactory;
          exports.DefaultFilterFactory = DefaultFilterFactory;
          const DefaultStandardFontDataFactory = _util.isNodeJS ? _displayNode_utils.NodeStandardFontDataFactory : _display_utils.DOMStandardFontDataFactory;
          exports.DefaultStandardFontDataFactory = DefaultStandardFontDataFactory;
          function getDocument(M) {
            if (typeof M == "string" || M instanceof URL ? M = {
              url: M
            } : (0, _util.isArrayBuffer)(M) && (M = {
              data: M
            }), typeof M != "object")
              throw new Error("Invalid parameter in getDocument, need parameter object.");
            if (!M.url && !M.data && !M.range)
              throw new Error("Invalid parameter object: need either .data, .range or .url");
            const _ = new PDFDocumentLoadingTask(), {
              docId: N
            } = _, D = M.url ? getUrlProp(M.url) : null, X = M.data ? getDataProp(M.data) : null, Y = M.httpHeaders || null, I = M.withCredentials === !0, U = M.password ?? null, G = M.range instanceof PDFDataRangeTransport ? M.range : null, V = Number.isInteger(M.rangeChunkSize) && M.rangeChunkSize > 0 ? M.rangeChunkSize : DEFAULT_RANGE_CHUNK_SIZE;
            let H = M.worker instanceof PDFWorker ? M.worker : null;
            const st = M.verbosity, dt = typeof M.docBaseUrl == "string" && !(0, _display_utils.isDataScheme)(M.docBaseUrl) ? M.docBaseUrl : null, yt = typeof M.cMapUrl == "string" ? M.cMapUrl : null, gt = M.cMapPacked !== !1, k = M.CMapReaderFactory || DefaultCMapReaderFactory, l = typeof M.standardFontDataUrl == "string" ? M.standardFontDataUrl : null, u = M.StandardFontDataFactory || DefaultStandardFontDataFactory, d = M.stopAtErrors !== !0, b = Number.isInteger(M.maxImageSize) && M.maxImageSize > -1 ? M.maxImageSize : -1, y = M.isEvalSupported !== !1, O = typeof M.isOffscreenCanvasSupported == "boolean" ? M.isOffscreenCanvasSupported : !_util.isNodeJS, B = Number.isInteger(M.canvasMaxAreaInBytes) ? M.canvasMaxAreaInBytes : -1, z = typeof M.disableFontFace == "boolean" ? M.disableFontFace : _util.isNodeJS, it = M.fontExtraProperties === !0, Z = M.enableXfa === !0, lt = M.ownerDocument || globalThis.document, ht = M.disableRange === !0, mt = M.disableStream === !0, ft = M.disableAutoFetch === !0, kt = M.pdfBug === !0, Rt = G ? G.length : M.length ?? NaN, St = typeof M.useSystemFonts == "boolean" ? M.useSystemFonts : !_util.isNodeJS && !z, It = typeof M.useWorkerFetch == "boolean" ? M.useWorkerFetch : k === _display_utils.DOMCMapReaderFactory && u === _display_utils.DOMStandardFontDataFactory && yt && l && (0, _display_utils.isValidFetchUrl)(yt, document.baseURI) && (0, _display_utils.isValidFetchUrl)(l, document.baseURI), _t = M.canvasFactory || new DefaultCanvasFactory({
              ownerDocument: lt
            }), rt = M.filterFactory || new DefaultFilterFactory({
              docId: N,
              ownerDocument: lt
            }), at = null;
            (0, _util.setVerbosityLevel)(st);
            const pt = {
              canvasFactory: _t,
              filterFactory: rt
            };
            if (It || (pt.cMapReaderFactory = new k({
              baseUrl: yt,
              isCompressed: gt
            }), pt.standardFontDataFactory = new u({
              baseUrl: l
            })), !H) {
              const Bt = {
                verbosity: st,
                port: _worker_options.GlobalWorkerOptions.workerPort
              };
              H = Bt.port ? PDFWorker.fromPort(Bt) : new PDFWorker(Bt), _._worker = H;
            }
            const Ct = {
              docId: N,
              apiVersion: "3.11.174",
              data: X,
              password: U,
              disableAutoFetch: ft,
              rangeChunkSize: V,
              length: Rt,
              docBaseUrl: dt,
              enableXfa: Z,
              evaluatorOptions: {
                maxImageSize: b,
                disableFontFace: z,
                ignoreErrors: d,
                isEvalSupported: y,
                isOffscreenCanvasSupported: O,
                canvasMaxAreaInBytes: B,
                fontExtraProperties: it,
                useSystemFonts: St,
                cMapUrl: It ? yt : null,
                standardFontDataUrl: It ? l : null
              }
            }, Tt = {
              ignoreErrors: d,
              isEvalSupported: y,
              disableFontFace: z,
              fontExtraProperties: it,
              enableXfa: Z,
              ownerDocument: lt,
              disableAutoFetch: ft,
              pdfBug: kt,
              styleElement: at
            };
            return H.promise.then(function() {
              if (_.destroyed)
                throw new Error("Loading aborted");
              const Bt = _fetchDocument(H, Ct), Wt = new Promise(function(jt) {
                let zt;
                G ? zt = new _transport_stream.PDFDataTransportStream({
                  length: Rt,
                  initialData: G.initialData,
                  progressiveDone: G.progressiveDone,
                  contentDispositionFilename: G.contentDispositionFilename,
                  disableRange: ht,
                  disableStream: mt
                }, G) : X || (zt = ((qt) => _util.isNodeJS ? new _displayNode_stream.PDFNodeStream(qt) : (0, _display_utils.isValidFetchUrl)(qt.url) ? new _displayFetch_stream.PDFFetchStream(qt) : new _displayNetwork.PDFNetworkStream(qt))({
                  url: D,
                  length: Rt,
                  httpHeaders: Y,
                  withCredentials: I,
                  rangeChunkSize: V,
                  disableRange: ht,
                  disableStream: mt
                })), jt(zt);
              });
              return Promise.all([Bt, Wt]).then(function([jt, zt]) {
                if (_.destroyed)
                  throw new Error("Loading aborted");
                const Gt = new _message_handler.MessageHandler(N, jt, H.port), qt = new WorkerTransport(Gt, _, zt, Tt, pt);
                _._transport = qt, Gt.send("Ready", null);
              });
            }).catch(_._capability.reject), _;
          }
          async function _fetchDocument(M, _) {
            if (M.destroyed)
              throw new Error("Worker was destroyed");
            const N = await M.messageHandler.sendWithPromise("GetDocRequest", _, _.data ? [_.data.buffer] : null);
            if (M.destroyed)
              throw new Error("Worker was destroyed");
            return N;
          }
          function getUrlProp(M) {
            if (M instanceof URL)
              return M.href;
            try {
              return new URL(M, window.location).href;
            } catch {
              if (_util.isNodeJS && typeof M == "string")
                return M;
            }
            throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
          }
          function getDataProp(M) {
            if (_util.isNodeJS && typeof Buffer < "u" && M instanceof Buffer)
              throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
            if (M instanceof Uint8Array && M.byteLength === M.buffer.byteLength)
              return M;
            if (typeof M == "string")
              return (0, _util.stringToBytes)(M);
            if (typeof M == "object" && !isNaN(M == null ? void 0 : M.length) || (0, _util.isArrayBuffer)(M))
              return new Uint8Array(M);
            throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");
          }
          const t = class t {
            constructor() {
              this._capability = new _util.PromiseCapability(), this._transport = null, this._worker = null, this.docId = `d${ge(t, i)._++}`, this.destroyed = !1, this.onPassword = null, this.onProgress = null;
            }
            get promise() {
              return this._capability.promise;
            }
            async destroy() {
              var _, N, D;
              this.destroyed = !0;
              try {
                (_ = this._worker) != null && _.port && (this._worker._pendingDestroy = !0), await ((N = this._transport) == null ? void 0 : N.destroy());
              } catch (X) {
                throw (D = this._worker) != null && D.port && delete this._worker._pendingDestroy, X;
              }
              this._transport = null, this._worker && (this._worker.destroy(), this._worker = null);
            }
          };
          i = new WeakMap(), W(t, i, 0);
          let PDFDocumentLoadingTask = t;
          exports.PDFDocumentLoadingTask = PDFDocumentLoadingTask;
          class PDFDataRangeTransport {
            constructor(_, N, D = !1, X = null) {
              this.length = _, this.initialData = N, this.progressiveDone = D, this.contentDispositionFilename = X, this._rangeListeners = [], this._progressListeners = [], this._progressiveReadListeners = [], this._progressiveDoneListeners = [], this._readyCapability = new _util.PromiseCapability();
            }
            addRangeListener(_) {
              this._rangeListeners.push(_);
            }
            addProgressListener(_) {
              this._progressListeners.push(_);
            }
            addProgressiveReadListener(_) {
              this._progressiveReadListeners.push(_);
            }
            addProgressiveDoneListener(_) {
              this._progressiveDoneListeners.push(_);
            }
            onDataRange(_, N) {
              for (const D of this._rangeListeners)
                D(_, N);
            }
            onDataProgress(_, N) {
              this._readyCapability.promise.then(() => {
                for (const D of this._progressListeners)
                  D(_, N);
              });
            }
            onDataProgressiveRead(_) {
              this._readyCapability.promise.then(() => {
                for (const N of this._progressiveReadListeners)
                  N(_);
              });
            }
            onDataProgressiveDone() {
              this._readyCapability.promise.then(() => {
                for (const _ of this._progressiveDoneListeners)
                  _();
              });
            }
            transportReady() {
              this._readyCapability.resolve();
            }
            requestDataRange(_, N) {
              (0, _util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange");
            }
            abort() {
            }
          }
          exports.PDFDataRangeTransport = PDFDataRangeTransport;
          class PDFDocumentProxy {
            constructor(_, N) {
              this._pdfInfo = _, this._transport = N, Object.defineProperty(this, "getJavaScript", {
                value: () => ((0, _display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."), this.getJSActions().then((D) => {
                  if (!D)
                    return D;
                  const X = [];
                  for (const Y in D)
                    X.push(...D[Y]);
                  return X;
                }))
              });
            }
            get annotationStorage() {
              return this._transport.annotationStorage;
            }
            get filterFactory() {
              return this._transport.filterFactory;
            }
            get numPages() {
              return this._pdfInfo.numPages;
            }
            get fingerprints() {
              return this._pdfInfo.fingerprints;
            }
            get isPureXfa() {
              return (0, _util.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa);
            }
            get allXfaHtml() {
              return this._transport._htmlForXfa;
            }
            getPage(_) {
              return this._transport.getPage(_);
            }
            getPageIndex(_) {
              return this._transport.getPageIndex(_);
            }
            getDestinations() {
              return this._transport.getDestinations();
            }
            getDestination(_) {
              return this._transport.getDestination(_);
            }
            getPageLabels() {
              return this._transport.getPageLabels();
            }
            getPageLayout() {
              return this._transport.getPageLayout();
            }
            getPageMode() {
              return this._transport.getPageMode();
            }
            getViewerPreferences() {
              return this._transport.getViewerPreferences();
            }
            getOpenAction() {
              return this._transport.getOpenAction();
            }
            getAttachments() {
              return this._transport.getAttachments();
            }
            getJSActions() {
              return this._transport.getDocJSActions();
            }
            getOutline() {
              return this._transport.getOutline();
            }
            getOptionalContentConfig() {
              return this._transport.getOptionalContentConfig();
            }
            getPermissions() {
              return this._transport.getPermissions();
            }
            getMetadata() {
              return this._transport.getMetadata();
            }
            getMarkInfo() {
              return this._transport.getMarkInfo();
            }
            getData() {
              return this._transport.getData();
            }
            saveDocument() {
              return this._transport.saveDocument();
            }
            getDownloadInfo() {
              return this._transport.downloadInfoCapability.promise;
            }
            cleanup(_ = !1) {
              return this._transport.startCleanup(_ || this.isPureXfa);
            }
            destroy() {
              return this.loadingTask.destroy();
            }
            get loadingParams() {
              return this._transport.loadingParams;
            }
            get loadingTask() {
              return this._transport.loadingTask;
            }
            getFieldObjects() {
              return this._transport.getFieldObjects();
            }
            hasJSActions() {
              return this._transport.hasJSActions();
            }
            getCalculationOrderIds() {
              return this._transport.getCalculationOrderIds();
            }
          }
          exports.PDFDocumentProxy = PDFDocumentProxy;
          class PDFPageProxy {
            constructor(_, N, D, X = !1) {
              W(this, s);
              W(this, f);
              W(this, n, null);
              W(this, e, !1);
              this._pageIndex = _, this._pageInfo = N, this._transport = D, this._stats = X ? new _display_utils.StatTimer() : null, this._pdfBug = X, this.commonObjs = D.commonObjs, this.objs = new PDFObjects(), this._maybeCleanupAfterRender = !1, this._intentStates = /* @__PURE__ */ new Map(), this.destroyed = !1;
            }
            get pageNumber() {
              return this._pageIndex + 1;
            }
            get rotate() {
              return this._pageInfo.rotate;
            }
            get ref() {
              return this._pageInfo.ref;
            }
            get userUnit() {
              return this._pageInfo.userUnit;
            }
            get view() {
              return this._pageInfo.view;
            }
            getViewport({
              scale: _,
              rotation: N = this.rotate,
              offsetX: D = 0,
              offsetY: X = 0,
              dontFlip: Y = !1
            } = {}) {
              return new _display_utils.PageViewport({
                viewBox: this.view,
                scale: _,
                rotation: N,
                offsetX: D,
                offsetY: X,
                dontFlip: Y
              });
            }
            getAnnotations({
              intent: _ = "display"
            } = {}) {
              const N = this._transport.getRenderingIntent(_);
              return this._transport.getAnnotations(this._pageIndex, N.renderingIntent);
            }
            getJSActions() {
              return this._transport.getPageJSActions(this._pageIndex);
            }
            get filterFactory() {
              return this._transport.filterFactory;
            }
            get isPureXfa() {
              return (0, _util.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa);
            }
            async getXfa() {
              var _;
              return ((_ = this._transport._htmlForXfa) == null ? void 0 : _.children[this._pageIndex]) || null;
            }
            render({
              canvasContext: _,
              viewport: N,
              intent: D = "display",
              annotationMode: X = _util.AnnotationMode.ENABLE,
              transform: Y = null,
              background: I = null,
              optionalContentConfigPromise: U = null,
              annotationCanvasMap: G = null,
              pageColors: V = null,
              printAnnotationStorage: H = null
            }) {
              var u, d;
              (u = this._stats) == null || u.time("Overall");
              const st = this._transport.getRenderingIntent(D, X, H);
              ot(this, e, !1), J(this, f, we).call(this), U || (U = this._transport.getOptionalContentConfig());
              let dt = this._intentStates.get(st.cacheKey);
              dt || (dt = /* @__PURE__ */ Object.create(null), this._intentStates.set(st.cacheKey, dt)), dt.streamReaderCancelTimeout && (clearTimeout(dt.streamReaderCancelTimeout), dt.streamReaderCancelTimeout = null);
              const yt = !!(st.renderingIntent & _util.RenderingIntentFlag.PRINT);
              dt.displayReadyCapability || (dt.displayReadyCapability = new _util.PromiseCapability(), dt.operatorList = {
                fnArray: [],
                argsArray: [],
                lastChunk: !1,
                separateAnnots: null
              }, (d = this._stats) == null || d.time("Page Request"), this._pumpOperatorList(st));
              const gt = (b) => {
                var y, O;
                dt.renderTasks.delete(k), (this._maybeCleanupAfterRender || yt) && ot(this, e, !0), J(this, s, he).call(this, !yt), b ? (k.capability.reject(b), this._abortOperatorList({
                  intentState: dt,
                  reason: b instanceof Error ? b : new Error(b)
                })) : k.capability.resolve(), (y = this._stats) == null || y.timeEnd("Rendering"), (O = this._stats) == null || O.timeEnd("Overall");
              }, k = new InternalRenderTask({
                callback: gt,
                params: {
                  canvasContext: _,
                  viewport: N,
                  transform: Y,
                  background: I
                },
                objs: this.objs,
                commonObjs: this.commonObjs,
                annotationCanvasMap: G,
                operatorList: dt.operatorList,
                pageIndex: this._pageIndex,
                canvasFactory: this._transport.canvasFactory,
                filterFactory: this._transport.filterFactory,
                useRequestAnimationFrame: !yt,
                pdfBug: this._pdfBug,
                pageColors: V
              });
              (dt.renderTasks || (dt.renderTasks = /* @__PURE__ */ new Set())).add(k);
              const l = k.task;
              return Promise.all([dt.displayReadyCapability.promise, U]).then(([b, y]) => {
                var O;
                if (this.destroyed) {
                  gt();
                  return;
                }
                (O = this._stats) == null || O.time("Rendering"), k.initializeGraphics({
                  transparency: b,
                  optionalContentConfig: y
                }), k.operatorListChanged();
              }).catch(gt), l;
            }
            getOperatorList({
              intent: _ = "display",
              annotationMode: N = _util.AnnotationMode.ENABLE,
              printAnnotationStorage: D = null
            } = {}) {
              var G;
              function X() {
                I.operatorList.lastChunk && (I.opListReadCapability.resolve(I.operatorList), I.renderTasks.delete(U));
              }
              const Y = this._transport.getRenderingIntent(_, N, D, !0);
              let I = this._intentStates.get(Y.cacheKey);
              I || (I = /* @__PURE__ */ Object.create(null), this._intentStates.set(Y.cacheKey, I));
              let U;
              return I.opListReadCapability || (U = /* @__PURE__ */ Object.create(null), U.operatorListChanged = X, I.opListReadCapability = new _util.PromiseCapability(), (I.renderTasks || (I.renderTasks = /* @__PURE__ */ new Set())).add(U), I.operatorList = {
                fnArray: [],
                argsArray: [],
                lastChunk: !1,
                separateAnnots: null
              }, (G = this._stats) == null || G.time("Page Request"), this._pumpOperatorList(Y)), I.opListReadCapability.promise;
            }
            streamTextContent({
              includeMarkedContent: _ = !1,
              disableNormalization: N = !1
            } = {}) {
              return this._transport.messageHandler.sendWithStream("GetTextContent", {
                pageIndex: this._pageIndex,
                includeMarkedContent: _ === !0,
                disableNormalization: N === !0
              }, {
                highWaterMark: 100,
                size(X) {
                  return X.items.length;
                }
              });
            }
            getTextContent(_ = {}) {
              if (this._transport._htmlForXfa)
                return this.getXfa().then((D) => _xfa_text.XfaText.textContent(D));
              const N = this.streamTextContent(_);
              return new Promise(function(D, X) {
                function Y() {
                  I.read().then(function({
                    value: G,
                    done: V
                  }) {
                    if (V) {
                      D(U);
                      return;
                    }
                    Object.assign(U.styles, G.styles), U.items.push(...G.items), Y();
                  }, X);
                }
                const I = N.getReader(), U = {
                  items: [],
                  styles: /* @__PURE__ */ Object.create(null)
                };
                Y();
              });
            }
            getStructTree() {
              return this._transport.getStructTree(this._pageIndex);
            }
            _destroy() {
              this.destroyed = !0;
              const _ = [];
              for (const N of this._intentStates.values())
                if (this._abortOperatorList({
                  intentState: N,
                  reason: new Error("Page was destroyed."),
                  force: !0
                }), !N.opListReadCapability)
                  for (const D of N.renderTasks)
                    _.push(D.completed), D.cancel();
              return this.objs.clear(), ot(this, e, !1), J(this, f, we).call(this), Promise.all(_);
            }
            cleanup(_ = !1) {
              ot(this, e, !0);
              const N = J(this, s, he).call(this, !1);
              return _ && N && this._stats && (this._stats = new _display_utils.StatTimer()), N;
            }
            _startRenderPage(_, N) {
              var X, Y;
              const D = this._intentStates.get(N);
              D && ((X = this._stats) == null || X.timeEnd("Page Request"), (Y = D.displayReadyCapability) == null || Y.resolve(_));
            }
            _renderPageChunk(_, N) {
              for (let D = 0, X = _.length; D < X; D++)
                N.operatorList.fnArray.push(_.fnArray[D]), N.operatorList.argsArray.push(_.argsArray[D]);
              N.operatorList.lastChunk = _.lastChunk, N.operatorList.separateAnnots = _.separateAnnots;
              for (const D of N.renderTasks)
                D.operatorListChanged();
              _.lastChunk && J(this, s, he).call(this, !0);
            }
            _pumpOperatorList({
              renderingIntent: _,
              cacheKey: N,
              annotationStorageSerializable: D
            }) {
              const {
                map: X,
                transfers: Y
              } = D, U = this._transport.messageHandler.sendWithStream("GetOperatorList", {
                pageIndex: this._pageIndex,
                intent: _,
                cacheKey: N,
                annotationStorage: X
              }, Y).getReader(), G = this._intentStates.get(N);
              G.streamReader = U;
              const V = () => {
                U.read().then(({
                  value: H,
                  done: st
                }) => {
                  if (st) {
                    G.streamReader = null;
                    return;
                  }
                  this._transport.destroyed || (this._renderPageChunk(H, G), V());
                }, (H) => {
                  if (G.streamReader = null, !this._transport.destroyed) {
                    if (G.operatorList) {
                      G.operatorList.lastChunk = !0;
                      for (const st of G.renderTasks)
                        st.operatorListChanged();
                      J(this, s, he).call(this, !0);
                    }
                    if (G.displayReadyCapability)
                      G.displayReadyCapability.reject(H);
                    else if (G.opListReadCapability)
                      G.opListReadCapability.reject(H);
                    else
                      throw H;
                  }
                });
              };
              V();
            }
            _abortOperatorList({
              intentState: _,
              reason: N,
              force: D = !1
            }) {
              if (_.streamReader) {
                if (_.streamReaderCancelTimeout && (clearTimeout(_.streamReaderCancelTimeout), _.streamReaderCancelTimeout = null), !D) {
                  if (_.renderTasks.size > 0)
                    return;
                  if (N instanceof _display_utils.RenderingCancelledException) {
                    let X = RENDERING_CANCELLED_TIMEOUT;
                    N.extraDelay > 0 && N.extraDelay < 1e3 && (X += N.extraDelay), _.streamReaderCancelTimeout = setTimeout(() => {
                      _.streamReaderCancelTimeout = null, this._abortOperatorList({
                        intentState: _,
                        reason: N,
                        force: !0
                      });
                    }, X);
                    return;
                  }
                }
                if (_.streamReader.cancel(new _util.AbortException(N.message)).catch(() => {
                }), _.streamReader = null, !this._transport.destroyed) {
                  for (const [X, Y] of this._intentStates)
                    if (Y === _) {
                      this._intentStates.delete(X);
                      break;
                    }
                  this.cleanup();
                }
              }
            }
            get stats() {
              return this._stats;
            }
          }
          n = new WeakMap(), e = new WeakMap(), s = new WeakSet(), he = function(_ = !1) {
            if (J(this, f, we).call(this), !r(this, e) || this.destroyed)
              return !1;
            if (_)
              return ot(this, n, setTimeout(() => {
                ot(this, n, null), J(this, s, he).call(this, !1);
              }, DELAYED_CLEANUP_TIMEOUT)), !1;
            for (const {
              renderTasks: N,
              operatorList: D
            } of this._intentStates.values())
              if (N.size > 0 || !D.lastChunk)
                return !1;
            return this._intentStates.clear(), this.objs.clear(), ot(this, e, !1), !0;
          }, f = new WeakSet(), we = function() {
            r(this, n) && (clearTimeout(r(this, n)), ot(this, n, null));
          }, exports.PDFPageProxy = PDFPageProxy;
          class LoopbackPort {
            constructor() {
              W(this, a, /* @__PURE__ */ new Set());
              W(this, h, Promise.resolve());
            }
            postMessage(_, N) {
              const D = {
                data: structuredClone(_, N ? {
                  transfer: N
                } : null)
              };
              r(this, h).then(() => {
                for (const X of r(this, a))
                  X.call(this, D);
              });
            }
            addEventListener(_, N) {
              r(this, a).add(N);
            }
            removeEventListener(_, N) {
              r(this, a).delete(N);
            }
            terminate() {
              r(this, a).clear();
            }
          }
          a = new WeakMap(), h = new WeakMap(), exports.LoopbackPort = LoopbackPort;
          const PDFWorkerUtil = {
            isWorkerDisabled: !1,
            fallbackWorkerSrc: null,
            fakeWorkerId: 0
          };
          exports.PDFWorkerUtil = PDFWorkerUtil;
          {
            if (_util.isNodeJS && typeof commonjsRequire == "function")
              PDFWorkerUtil.isWorkerDisabled = !0, PDFWorkerUtil.fallbackWorkerSrc = "./pdf.worker.js";
            else if (typeof document == "object") {
              const M = (o = document == null ? void 0 : document.currentScript) == null ? void 0 : o.src;
              M && (PDFWorkerUtil.fallbackWorkerSrc = M.replace(/(\.(?:min\.)?js)(\?.*)?$/i, ".worker$1$2"));
            }
            PDFWorkerUtil.isSameOrigin = function(M, _) {
              let N;
              try {
                if (N = new URL(M), !N.origin || N.origin === "null")
                  return !1;
              } catch {
                return !1;
              }
              const D = new URL(_, N);
              return N.origin === D.origin;
            }, PDFWorkerUtil.createCDNWrapper = function(M) {
              const _ = `importScripts("${M}");`;
              return URL.createObjectURL(new Blob([_]));
            };
          }
          const _PDFWorker = class _PDFWorker {
            constructor({
              name: M = null,
              port: _ = null,
              verbosity: N = (0, _util.getVerbosityLevel)()
            } = {}) {
              var D;
              if (this.name = M, this.destroyed = !1, this.verbosity = N, this._readyCapability = new _util.PromiseCapability(), this._port = null, this._webWorker = null, this._messageHandler = null, _) {
                if ((D = r(_PDFWorker, F)) != null && D.has(_))
                  throw new Error("Cannot use more than one PDFWorker per port.");
                (r(_PDFWorker, F) || ot(_PDFWorker, F, /* @__PURE__ */ new WeakMap())).set(_, this), this._initializeFromPort(_);
                return;
              }
              this._initialize();
            }
            get promise() {
              return this._readyCapability.promise;
            }
            get port() {
              return this._port;
            }
            get messageHandler() {
              return this._messageHandler;
            }
            _initializeFromPort(M) {
              this._port = M, this._messageHandler = new _message_handler.MessageHandler("main", "worker", M), this._messageHandler.on("ready", function() {
              }), this._readyCapability.resolve(), this._messageHandler.send("configure", {
                verbosity: this.verbosity
              });
            }
            _initialize() {
              if (!PDFWorkerUtil.isWorkerDisabled && !_PDFWorker._mainThreadWorkerMessageHandler) {
                let {
                  workerSrc: M
                } = _PDFWorker;
                try {
                  PDFWorkerUtil.isSameOrigin(window.location.href, M) || (M = PDFWorkerUtil.createCDNWrapper(new URL(M, window.location).href));
                  const _ = new Worker(M), N = new _message_handler.MessageHandler("main", "worker", _), D = () => {
                    _.removeEventListener("error", X), N.destroy(), _.terminate(), this.destroyed ? this._readyCapability.reject(new Error("Worker was destroyed")) : this._setupFakeWorker();
                  }, X = () => {
                    this._webWorker || D();
                  };
                  _.addEventListener("error", X), N.on("test", (I) => {
                    if (_.removeEventListener("error", X), this.destroyed) {
                      D();
                      return;
                    }
                    I ? (this._messageHandler = N, this._port = _, this._webWorker = _, this._readyCapability.resolve(), N.send("configure", {
                      verbosity: this.verbosity
                    })) : (this._setupFakeWorker(), N.destroy(), _.terminate());
                  }), N.on("ready", (I) => {
                    if (_.removeEventListener("error", X), this.destroyed) {
                      D();
                      return;
                    }
                    try {
                      Y();
                    } catch {
                      this._setupFakeWorker();
                    }
                  });
                  const Y = () => {
                    const I = new Uint8Array();
                    N.send("test", I, [I.buffer]);
                  };
                  Y();
                  return;
                } catch {
                  (0, _util.info)("The worker has been disabled.");
                }
              }
              this._setupFakeWorker();
            }
            _setupFakeWorker() {
              PDFWorkerUtil.isWorkerDisabled || ((0, _util.warn)("Setting up fake worker."), PDFWorkerUtil.isWorkerDisabled = !0), _PDFWorker._setupFakeWorkerGlobal.then((M) => {
                if (this.destroyed) {
                  this._readyCapability.reject(new Error("Worker was destroyed"));
                  return;
                }
                const _ = new LoopbackPort();
                this._port = _;
                const N = `fake${PDFWorkerUtil.fakeWorkerId++}`, D = new _message_handler.MessageHandler(N + "_worker", N, _);
                M.setup(D, _);
                const X = new _message_handler.MessageHandler(N, N + "_worker", _);
                this._messageHandler = X, this._readyCapability.resolve(), X.send("configure", {
                  verbosity: this.verbosity
                });
              }).catch((M) => {
                this._readyCapability.reject(new Error(`Setting up fake worker failed: "${M.message}".`));
              });
            }
            destroy() {
              var M;
              this.destroyed = !0, this._webWorker && (this._webWorker.terminate(), this._webWorker = null), (M = r(_PDFWorker, F)) == null || M.delete(this._port), this._port = null, this._messageHandler && (this._messageHandler.destroy(), this._messageHandler = null);
            }
            static fromPort(M) {
              var N;
              if (!(M != null && M.port))
                throw new Error("PDFWorker.fromPort - invalid method signature.");
              const _ = (N = r(this, F)) == null ? void 0 : N.get(M.port);
              if (_) {
                if (_._pendingDestroy)
                  throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");
                return _;
              }
              return new _PDFWorker(M);
            }
            static get workerSrc() {
              if (_worker_options.GlobalWorkerOptions.workerSrc)
                return _worker_options.GlobalWorkerOptions.workerSrc;
              if (PDFWorkerUtil.fallbackWorkerSrc !== null)
                return _util.isNodeJS || (0, _display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'), PDFWorkerUtil.fallbackWorkerSrc;
              throw new Error('No "GlobalWorkerOptions.workerSrc" specified.');
            }
            static get _mainThreadWorkerMessageHandler() {
              var M;
              try {
                return ((M = globalThis.pdfjsWorker) == null ? void 0 : M.WorkerMessageHandler) || null;
              } catch {
                return null;
              }
            }
            static get _setupFakeWorkerGlobal() {
              const loader = async () => {
                const mainWorkerMessageHandler = this._mainThreadWorkerMessageHandler;
                if (mainWorkerMessageHandler)
                  return mainWorkerMessageHandler;
                if (_util.isNodeJS && typeof commonjsRequire == "function") {
                  const worker = eval("require")(this.workerSrc);
                  return worker.WorkerMessageHandler;
                }
                return await (0, _display_utils.loadScript)(this.workerSrc), window.pdfjsWorker.WorkerMessageHandler;
              };
              return (0, _util.shadow)(this, "_setupFakeWorkerGlobal", loader());
            }
          };
          F = new WeakMap(), W(_PDFWorker, F, void 0);
          let PDFWorker = _PDFWorker;
          exports.PDFWorker = PDFWorker;
          class WorkerTransport {
            constructor(_, N, D, X, Y) {
              W(this, m);
              W(this, R, /* @__PURE__ */ new Map());
              W(this, w, /* @__PURE__ */ new Map());
              W(this, T, /* @__PURE__ */ new Map());
              W(this, P, null);
              this.messageHandler = _, this.loadingTask = N, this.commonObjs = new PDFObjects(), this.fontLoader = new _font_loader.FontLoader({
                ownerDocument: X.ownerDocument,
                styleElement: X.styleElement
              }), this._params = X, this.canvasFactory = Y.canvasFactory, this.filterFactory = Y.filterFactory, this.cMapReaderFactory = Y.cMapReaderFactory, this.standardFontDataFactory = Y.standardFontDataFactory, this.destroyed = !1, this.destroyCapability = null, this._networkStream = D, this._fullReader = null, this._lastProgress = null, this.downloadInfoCapability = new _util.PromiseCapability(), this.setupMessageHandler();
            }
            get annotationStorage() {
              return (0, _util.shadow)(this, "annotationStorage", new _annotation_storage.AnnotationStorage());
            }
            getRenderingIntent(_, N = _util.AnnotationMode.ENABLE, D = null, X = !1) {
              let Y = _util.RenderingIntentFlag.DISPLAY, I = _annotation_storage.SerializableEmpty;
              switch (_) {
                case "any":
                  Y = _util.RenderingIntentFlag.ANY;
                  break;
                case "display":
                  break;
                case "print":
                  Y = _util.RenderingIntentFlag.PRINT;
                  break;
                default:
                  (0, _util.warn)(`getRenderingIntent - invalid intent: ${_}`);
              }
              switch (N) {
                case _util.AnnotationMode.DISABLE:
                  Y += _util.RenderingIntentFlag.ANNOTATIONS_DISABLE;
                  break;
                case _util.AnnotationMode.ENABLE:
                  break;
                case _util.AnnotationMode.ENABLE_FORMS:
                  Y += _util.RenderingIntentFlag.ANNOTATIONS_FORMS;
                  break;
                case _util.AnnotationMode.ENABLE_STORAGE:
                  Y += _util.RenderingIntentFlag.ANNOTATIONS_STORAGE, I = (Y & _util.RenderingIntentFlag.PRINT && D instanceof _annotation_storage.PrintAnnotationStorage ? D : this.annotationStorage).serializable;
                  break;
                default:
                  (0, _util.warn)(`getRenderingIntent - invalid annotationMode: ${N}`);
              }
              return X && (Y += _util.RenderingIntentFlag.OPLIST), {
                renderingIntent: Y,
                cacheKey: `${Y}_${I.hash}`,
                annotationStorageSerializable: I
              };
            }
            destroy() {
              var D;
              if (this.destroyCapability)
                return this.destroyCapability.promise;
              this.destroyed = !0, this.destroyCapability = new _util.PromiseCapability(), (D = r(this, P)) == null || D.reject(new Error("Worker was destroyed during onPassword callback"));
              const _ = [];
              for (const X of r(this, w).values())
                _.push(X._destroy());
              r(this, w).clear(), r(this, T).clear(), this.hasOwnProperty("annotationStorage") && this.annotationStorage.resetModified();
              const N = this.messageHandler.sendWithPromise("Terminate", null);
              return _.push(N), Promise.all(_).then(() => {
                var X;
                this.commonObjs.clear(), this.fontLoader.clear(), r(this, R).clear(), this.filterFactory.destroy(), (X = this._networkStream) == null || X.cancelAllRequests(new _util.AbortException("Worker was terminated.")), this.messageHandler && (this.messageHandler.destroy(), this.messageHandler = null), this.destroyCapability.resolve();
              }, this.destroyCapability.reject), this.destroyCapability.promise;
            }
            setupMessageHandler() {
              const {
                messageHandler: _,
                loadingTask: N
              } = this;
              _.on("GetReader", (D, X) => {
                (0, _util.assert)(this._networkStream, "GetReader - no `IPDFStream` instance available."), this._fullReader = this._networkStream.getFullReader(), this._fullReader.onProgress = (Y) => {
                  this._lastProgress = {
                    loaded: Y.loaded,
                    total: Y.total
                  };
                }, X.onPull = () => {
                  this._fullReader.read().then(function({
                    value: Y,
                    done: I
                  }) {
                    if (I) {
                      X.close();
                      return;
                    }
                    (0, _util.assert)(Y instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."), X.enqueue(new Uint8Array(Y), 1, [Y]);
                  }).catch((Y) => {
                    X.error(Y);
                  });
                }, X.onCancel = (Y) => {
                  this._fullReader.cancel(Y), X.ready.catch((I) => {
                    if (!this.destroyed)
                      throw I;
                  });
                };
              }), _.on("ReaderHeadersReady", (D) => {
                const X = new _util.PromiseCapability(), Y = this._fullReader;
                return Y.headersReady.then(() => {
                  var I;
                  (!Y.isStreamingSupported || !Y.isRangeSupported) && (this._lastProgress && ((I = N.onProgress) == null || I.call(N, this._lastProgress)), Y.onProgress = (U) => {
                    var G;
                    (G = N.onProgress) == null || G.call(N, {
                      loaded: U.loaded,
                      total: U.total
                    });
                  }), X.resolve({
                    isStreamingSupported: Y.isStreamingSupported,
                    isRangeSupported: Y.isRangeSupported,
                    contentLength: Y.contentLength
                  });
                }, X.reject), X.promise;
              }), _.on("GetRangeReader", (D, X) => {
                (0, _util.assert)(this._networkStream, "GetRangeReader - no `IPDFStream` instance available.");
                const Y = this._networkStream.getRangeReader(D.begin, D.end);
                if (!Y) {
                  X.close();
                  return;
                }
                X.onPull = () => {
                  Y.read().then(function({
                    value: I,
                    done: U
                  }) {
                    if (U) {
                      X.close();
                      return;
                    }
                    (0, _util.assert)(I instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."), X.enqueue(new Uint8Array(I), 1, [I]);
                  }).catch((I) => {
                    X.error(I);
                  });
                }, X.onCancel = (I) => {
                  Y.cancel(I), X.ready.catch((U) => {
                    if (!this.destroyed)
                      throw U;
                  });
                };
              }), _.on("GetDoc", ({
                pdfInfo: D
              }) => {
                this._numPages = D.numPages, this._htmlForXfa = D.htmlForXfa, delete D.htmlForXfa, N._capability.resolve(new PDFDocumentProxy(D, this));
              }), _.on("DocException", function(D) {
                let X;
                switch (D.name) {
                  case "PasswordException":
                    X = new _util.PasswordException(D.message, D.code);
                    break;
                  case "InvalidPDFException":
                    X = new _util.InvalidPDFException(D.message);
                    break;
                  case "MissingPDFException":
                    X = new _util.MissingPDFException(D.message);
                    break;
                  case "UnexpectedResponseException":
                    X = new _util.UnexpectedResponseException(D.message, D.status);
                    break;
                  case "UnknownErrorException":
                    X = new _util.UnknownErrorException(D.message, D.details);
                    break;
                  default:
                    (0, _util.unreachable)("DocException - expected a valid Error.");
                }
                N._capability.reject(X);
              }), _.on("PasswordRequest", (D) => {
                if (ot(this, P, new _util.PromiseCapability()), N.onPassword) {
                  const X = (Y) => {
                    Y instanceof Error ? r(this, P).reject(Y) : r(this, P).resolve({
                      password: Y
                    });
                  };
                  try {
                    N.onPassword(X, D.code);
                  } catch (Y) {
                    r(this, P).reject(Y);
                  }
                } else
                  r(this, P).reject(new _util.PasswordException(D.message, D.code));
                return r(this, P).promise;
              }), _.on("DataLoaded", (D) => {
                var X;
                (X = N.onProgress) == null || X.call(N, {
                  loaded: D.length,
                  total: D.length
                }), this.downloadInfoCapability.resolve(D);
              }), _.on("StartRenderPage", (D) => {
                if (this.destroyed)
                  return;
                r(this, w).get(D.pageIndex)._startRenderPage(D.transparency, D.cacheKey);
              }), _.on("commonobj", ([D, X, Y]) => {
                var I;
                if (!this.destroyed && !this.commonObjs.has(D))
                  switch (X) {
                    case "Font":
                      const U = this._params;
                      if ("error" in Y) {
                        const H = Y.error;
                        (0, _util.warn)(`Error during font loading: ${H}`), this.commonObjs.resolve(D, H);
                        break;
                      }
                      const G = U.pdfBug && ((I = globalThis.FontInspector) != null && I.enabled) ? (H, st) => globalThis.FontInspector.fontAdded(H, st) : null, V = new _font_loader.FontFaceObject(Y, {
                        isEvalSupported: U.isEvalSupported,
                        disableFontFace: U.disableFontFace,
                        ignoreErrors: U.ignoreErrors,
                        inspectFont: G
                      });
                      this.fontLoader.bind(V).catch((H) => _.sendWithPromise("FontFallback", {
                        id: D
                      })).finally(() => {
                        !U.fontExtraProperties && V.data && (V.data = null), this.commonObjs.resolve(D, V);
                      });
                      break;
                    case "FontPath":
                    case "Image":
                    case "Pattern":
                      this.commonObjs.resolve(D, Y);
                      break;
                    default:
                      throw new Error(`Got unknown common object type ${X}`);
                  }
              }), _.on("obj", ([D, X, Y, I]) => {
                var G;
                if (this.destroyed)
                  return;
                const U = r(this, w).get(X);
                if (!U.objs.has(D))
                  switch (Y) {
                    case "Image":
                      if (U.objs.resolve(D, I), I) {
                        let V;
                        if (I.bitmap) {
                          const {
                            width: H,
                            height: st
                          } = I;
                          V = H * st * 4;
                        } else
                          V = ((G = I.data) == null ? void 0 : G.length) || 0;
                        V > _util.MAX_IMAGE_SIZE_TO_CACHE && (U._maybeCleanupAfterRender = !0);
                      }
                      break;
                    case "Pattern":
                      U.objs.resolve(D, I);
                      break;
                    default:
                      throw new Error(`Got unknown object type ${Y}`);
                  }
              }), _.on("DocProgress", (D) => {
                var X;
                this.destroyed || (X = N.onProgress) == null || X.call(N, {
                  loaded: D.loaded,
                  total: D.total
                });
              }), _.on("FetchBuiltInCMap", (D) => this.destroyed ? Promise.reject(new Error("Worker was destroyed.")) : this.cMapReaderFactory ? this.cMapReaderFactory.fetch(D) : Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))), _.on("FetchStandardFontData", (D) => this.destroyed ? Promise.reject(new Error("Worker was destroyed.")) : this.standardFontDataFactory ? this.standardFontDataFactory.fetch(D) : Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")));
            }
            getData() {
              return this.messageHandler.sendWithPromise("GetData", null);
            }
            saveDocument() {
              var D;
              this.annotationStorage.size <= 0 && (0, _util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");
              const {
                map: _,
                transfers: N
              } = this.annotationStorage.serializable;
              return this.messageHandler.sendWithPromise("SaveDocument", {
                isPureXfa: !!this._htmlForXfa,
                numPages: this._numPages,
                annotationStorage: _,
                filename: ((D = this._fullReader) == null ? void 0 : D.filename) ?? null
              }, N).finally(() => {
                this.annotationStorage.resetModified();
              });
            }
            getPage(_) {
              if (!Number.isInteger(_) || _ <= 0 || _ > this._numPages)
                return Promise.reject(new Error("Invalid page request."));
              const N = _ - 1, D = r(this, T).get(N);
              if (D)
                return D;
              const X = this.messageHandler.sendWithPromise("GetPage", {
                pageIndex: N
              }).then((Y) => {
                if (this.destroyed)
                  throw new Error("Transport destroyed");
                const I = new PDFPageProxy(N, Y, this, this._params.pdfBug);
                return r(this, w).set(N, I), I;
              });
              return r(this, T).set(N, X), X;
            }
            getPageIndex(_) {
              return typeof _ != "object" || _ === null || !Number.isInteger(_.num) || _.num < 0 || !Number.isInteger(_.gen) || _.gen < 0 ? Promise.reject(new Error("Invalid pageIndex request.")) : this.messageHandler.sendWithPromise("GetPageIndex", {
                num: _.num,
                gen: _.gen
              });
            }
            getAnnotations(_, N) {
              return this.messageHandler.sendWithPromise("GetAnnotations", {
                pageIndex: _,
                intent: N
              });
            }
            getFieldObjects() {
              return J(this, m, Ee).call(this, "GetFieldObjects");
            }
            hasJSActions() {
              return J(this, m, Ee).call(this, "HasJSActions");
            }
            getCalculationOrderIds() {
              return this.messageHandler.sendWithPromise("GetCalculationOrderIds", null);
            }
            getDestinations() {
              return this.messageHandler.sendWithPromise("GetDestinations", null);
            }
            getDestination(_) {
              return typeof _ != "string" ? Promise.reject(new Error("Invalid destination request.")) : this.messageHandler.sendWithPromise("GetDestination", {
                id: _
              });
            }
            getPageLabels() {
              return this.messageHandler.sendWithPromise("GetPageLabels", null);
            }
            getPageLayout() {
              return this.messageHandler.sendWithPromise("GetPageLayout", null);
            }
            getPageMode() {
              return this.messageHandler.sendWithPromise("GetPageMode", null);
            }
            getViewerPreferences() {
              return this.messageHandler.sendWithPromise("GetViewerPreferences", null);
            }
            getOpenAction() {
              return this.messageHandler.sendWithPromise("GetOpenAction", null);
            }
            getAttachments() {
              return this.messageHandler.sendWithPromise("GetAttachments", null);
            }
            getDocJSActions() {
              return J(this, m, Ee).call(this, "GetDocJSActions");
            }
            getPageJSActions(_) {
              return this.messageHandler.sendWithPromise("GetPageJSActions", {
                pageIndex: _
              });
            }
            getStructTree(_) {
              return this.messageHandler.sendWithPromise("GetStructTree", {
                pageIndex: _
              });
            }
            getOutline() {
              return this.messageHandler.sendWithPromise("GetOutline", null);
            }
            getOptionalContentConfig() {
              return this.messageHandler.sendWithPromise("GetOptionalContentConfig", null).then((_) => new _optional_content_config.OptionalContentConfig(_));
            }
            getPermissions() {
              return this.messageHandler.sendWithPromise("GetPermissions", null);
            }
            getMetadata() {
              const _ = "GetMetadata", N = r(this, R).get(_);
              if (N)
                return N;
              const D = this.messageHandler.sendWithPromise(_, null).then((X) => {
                var Y, I;
                return {
                  info: X[0],
                  metadata: X[1] ? new _metadata.Metadata(X[1]) : null,
                  contentDispositionFilename: ((Y = this._fullReader) == null ? void 0 : Y.filename) ?? null,
                  contentLength: ((I = this._fullReader) == null ? void 0 : I.contentLength) ?? null
                };
              });
              return r(this, R).set(_, D), D;
            }
            getMarkInfo() {
              return this.messageHandler.sendWithPromise("GetMarkInfo", null);
            }
            async startCleanup(_ = !1) {
              if (!this.destroyed) {
                await this.messageHandler.sendWithPromise("Cleanup", null);
                for (const N of r(this, w).values())
                  if (!N.cleanup())
                    throw new Error(`startCleanup: Page ${N.pageNumber} is currently rendering.`);
                this.commonObjs.clear(), _ || this.fontLoader.clear(), r(this, R).clear(), this.filterFactory.destroy(!0);
              }
            }
            get loadingParams() {
              const {
                disableAutoFetch: _,
                enableXfa: N
              } = this._params;
              return (0, _util.shadow)(this, "loadingParams", {
                disableAutoFetch: _,
                enableXfa: N
              });
            }
          }
          R = new WeakMap(), w = new WeakMap(), T = new WeakMap(), P = new WeakMap(), m = new WeakSet(), Ee = function(_, N = null) {
            const D = r(this, R).get(_);
            if (D)
              return D;
            const X = this.messageHandler.sendWithPromise(_, N);
            return r(this, R).set(_, X), X;
          };
          class PDFObjects {
            constructor() {
              W(this, E);
              W(this, x, /* @__PURE__ */ Object.create(null));
            }
            get(_, N = null) {
              if (N) {
                const X = J(this, E, Ne).call(this, _);
                return X.capability.promise.then(() => N(X.data)), null;
              }
              const D = r(this, x)[_];
              if (!(D != null && D.capability.settled))
                throw new Error(`Requesting object that isn't resolved yet ${_}.`);
              return D.data;
            }
            has(_) {
              const N = r(this, x)[_];
              return (N == null ? void 0 : N.capability.settled) || !1;
            }
            resolve(_, N = null) {
              const D = J(this, E, Ne).call(this, _);
              D.data = N, D.capability.resolve();
            }
            clear() {
              var _;
              for (const N in r(this, x)) {
                const {
                  data: D
                } = r(this, x)[N];
                (_ = D == null ? void 0 : D.bitmap) == null || _.close();
              }
              ot(this, x, /* @__PURE__ */ Object.create(null));
            }
          }
          x = new WeakMap(), E = new WeakSet(), Ne = function(_) {
            var N;
            return (N = r(this, x))[_] || (N[_] = {
              capability: new _util.PromiseCapability(),
              data: null
            });
          };
          class RenderTask {
            constructor(_) {
              W(this, g, null);
              ot(this, g, _), this.onContinue = null;
            }
            get promise() {
              return r(this, g).capability.promise;
            }
            cancel(_ = 0) {
              r(this, g).cancel(null, _);
            }
            get separateAnnots() {
              const {
                separateAnnots: _
              } = r(this, g).operatorList;
              if (!_)
                return !1;
              const {
                annotationCanvasMap: N
              } = r(this, g);
              return _.form || _.canvas && (N == null ? void 0 : N.size) > 0;
            }
          }
          g = new WeakMap(), exports.RenderTask = RenderTask;
          const $ = class $ {
            constructor({
              callback: _,
              params: N,
              objs: D,
              commonObjs: X,
              annotationCanvasMap: Y,
              operatorList: I,
              pageIndex: U,
              canvasFactory: G,
              filterFactory: V,
              useRequestAnimationFrame: H = !1,
              pdfBug: st = !1,
              pageColors: dt = null
            }) {
              this.callback = _, this.params = N, this.objs = D, this.commonObjs = X, this.annotationCanvasMap = Y, this.operatorListIdx = null, this.operatorList = I, this._pageIndex = U, this.canvasFactory = G, this.filterFactory = V, this._pdfBug = st, this.pageColors = dt, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = H === !0 && typeof window < "u", this.cancelled = !1, this.capability = new _util.PromiseCapability(), this.task = new RenderTask(this), this._cancelBound = this.cancel.bind(this), this._continueBound = this._continue.bind(this), this._scheduleNextBound = this._scheduleNext.bind(this), this._nextBound = this._next.bind(this), this._canvas = N.canvasContext.canvas;
            }
            get completed() {
              return this.capability.promise.catch(function() {
              });
            }
            initializeGraphics({
              transparency: _ = !1,
              optionalContentConfig: N
            }) {
              var U, G;
              if (this.cancelled)
                return;
              if (this._canvas) {
                if (r($, v).has(this._canvas))
                  throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");
                r($, v).add(this._canvas);
              }
              this._pdfBug && ((U = globalThis.StepperManager) != null && U.enabled) && (this.stepper = globalThis.StepperManager.create(this._pageIndex), this.stepper.init(this.operatorList), this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint());
              const {
                canvasContext: D,
                viewport: X,
                transform: Y,
                background: I
              } = this.params;
              this.gfx = new _canvas.CanvasGraphics(D, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
                optionalContentConfig: N
              }, this.annotationCanvasMap, this.pageColors), this.gfx.beginDrawing({
                transform: Y,
                viewport: X,
                transparency: _,
                background: I
              }), this.operatorListIdx = 0, this.graphicsReady = !0, (G = this.graphicsReadyCallback) == null || G.call(this);
            }
            cancel(_ = null, N = 0) {
              var D;
              this.running = !1, this.cancelled = !0, (D = this.gfx) == null || D.endDrawing(), r($, v).delete(this._canvas), this.callback(_ || new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex + 1}`, N));
            }
            operatorListChanged() {
              var _;
              if (!this.graphicsReady) {
                this.graphicsReadyCallback || (this.graphicsReadyCallback = this._continueBound);
                return;
              }
              (_ = this.stepper) == null || _.updateOperatorList(this.operatorList), !this.running && this._continue();
            }
            _continue() {
              this.running = !0, !this.cancelled && (this.task.onContinue ? this.task.onContinue(this._scheduleNextBound) : this._scheduleNext());
            }
            _scheduleNext() {
              this._useRequestAnimationFrame ? window.requestAnimationFrame(() => {
                this._nextBound().catch(this._cancelBound);
              }) : Promise.resolve().then(this._nextBound).catch(this._cancelBound);
            }
            async _next() {
              this.cancelled || (this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper), this.operatorListIdx === this.operatorList.argsArray.length && (this.running = !1, this.operatorList.lastChunk && (this.gfx.endDrawing(), r($, v).delete(this._canvas), this.callback())));
            }
          };
          v = new WeakMap(), W($, v, /* @__PURE__ */ new WeakSet());
          let InternalRenderTask = $;
          const version = "3.11.174";
          exports.version = version;
          const build = "ce8716743";
          exports.build = build;
        },
        /* 3 */
        /***/
        (i, t, n) => {
          var h, o, F, vn, w;
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.SerializableEmpty = t.PrintAnnotationStorage = t.AnnotationStorage = void 0;
          var e = n(1), s = n(4), p = n(8);
          const f = Object.freeze({
            map: null,
            hash: "",
            transfers: void 0
          });
          t.SerializableEmpty = f;
          class A {
            constructor() {
              W(this, F);
              W(this, h, !1);
              W(this, o, /* @__PURE__ */ new Map());
              this.onSetModified = null, this.onResetModified = null, this.onAnnotationEditor = null;
            }
            getValue(P, m) {
              const C = r(this, o).get(P);
              return C === void 0 ? m : Object.assign(m, C);
            }
            getRawValue(P) {
              return r(this, o).get(P);
            }
            remove(P) {
              if (r(this, o).delete(P), r(this, o).size === 0 && this.resetModified(), typeof this.onAnnotationEditor == "function") {
                for (const m of r(this, o).values())
                  if (m instanceof s.AnnotationEditor)
                    return;
                this.onAnnotationEditor(null);
              }
            }
            setValue(P, m) {
              const C = r(this, o).get(P);
              let x = !1;
              if (C !== void 0)
                for (const [E, S] of Object.entries(m))
                  C[E] !== S && (x = !0, C[E] = S);
              else
                x = !0, r(this, o).set(P, m);
              x && J(this, F, vn).call(this), m instanceof s.AnnotationEditor && typeof this.onAnnotationEditor == "function" && this.onAnnotationEditor(m.constructor._type);
            }
            has(P) {
              return r(this, o).has(P);
            }
            getAll() {
              return r(this, o).size > 0 ? (0, e.objectFromMap)(r(this, o)) : null;
            }
            setAll(P) {
              for (const [m, C] of Object.entries(P))
                this.setValue(m, C);
            }
            get size() {
              return r(this, o).size;
            }
            resetModified() {
              r(this, h) && (ot(this, h, !1), typeof this.onResetModified == "function" && this.onResetModified());
            }
            get print() {
              return new a(this);
            }
            get serializable() {
              if (r(this, o).size === 0)
                return f;
              const P = /* @__PURE__ */ new Map(), m = new p.MurmurHash3_64(), C = [], x = /* @__PURE__ */ Object.create(null);
              let E = !1;
              for (const [S, g] of r(this, o)) {
                const v = g instanceof s.AnnotationEditor ? g.serialize(!1, x) : g;
                v && (P.set(S, v), m.update(`${S}:${JSON.stringify(v)}`), E || (E = !!v.bitmap));
              }
              if (E)
                for (const S of P.values())
                  S.bitmap && C.push(S.bitmap);
              return P.size > 0 ? {
                map: P,
                hash: m.hexdigest(),
                transfers: C
              } : f;
            }
          }
          h = new WeakMap(), o = new WeakMap(), F = new WeakSet(), vn = function() {
            r(this, h) || (ot(this, h, !0), typeof this.onSetModified == "function" && this.onSetModified());
          }, t.AnnotationStorage = A;
          class a extends A {
            constructor(m) {
              super();
              W(this, w, void 0);
              const {
                map: C,
                hash: x,
                transfers: E
              } = m.serializable, S = structuredClone(C, E ? {
                transfer: E
              } : null);
              ot(this, w, {
                map: S,
                hash: x,
                transfers: E
              });
            }
            get print() {
              (0, e.unreachable)("Should not call PrintAnnotationStorage.print");
            }
            get serializable() {
              return r(this, w);
            }
          }
          w = new WeakMap(), t.PrintAnnotationStorage = a;
        },
        /* 4 */
        /***/
        (i, t, n) => {
          var a, h, o, F, R, w, T, P, m, C, x, E, S, g, v, Be, M, Ue, N, je, X, qe, I, Sn, G, wn, H, En, dt, We, gt, Cn;
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.AnnotationEditor = void 0;
          var e = n(5), s = n(1), p = n(6);
          const l = class l {
            constructor(d) {
              W(this, v);
              W(this, M);
              W(this, X);
              W(this, I);
              W(this, G);
              W(this, H);
              W(this, dt);
              W(this, gt);
              W(this, a, "");
              W(this, h, !1);
              W(this, o, null);
              W(this, F, null);
              W(this, R, null);
              W(this, w, !1);
              W(this, T, null);
              W(this, P, this.focusin.bind(this));
              W(this, m, this.focusout.bind(this));
              W(this, C, !1);
              W(this, x, !1);
              W(this, E, !1);
              ee(this, "_initialOptions", /* @__PURE__ */ Object.create(null));
              ee(this, "_uiManager", null);
              ee(this, "_focusEventsAllowed", !0);
              ee(this, "_l10nPromise", null);
              W(this, S, !1);
              W(this, g, l._zIndex++);
              this.constructor === l && (0, s.unreachable)("Cannot initialize AnnotationEditor."), this.parent = d.parent, this.id = d.id, this.width = this.height = null, this.pageIndex = d.parent.pageIndex, this.name = d.name, this.div = null, this._uiManager = d.uiManager, this.annotationElementId = null, this._willKeepAspectRatio = !1, this._initialOptions.isCentered = d.isCentered, this._structTreeParentId = null;
              const {
                rotation: b,
                rawDims: {
                  pageWidth: y,
                  pageHeight: O,
                  pageX: B,
                  pageY: z
                }
              } = this.parent.viewport;
              this.rotation = b, this.pageRotation = (360 + b - this._uiManager.viewParameters.rotation) % 360, this.pageDimensions = [y, O], this.pageTranslation = [B, z];
              const [it, Z] = this.parentDimensions;
              this.x = d.x / it, this.y = d.y / Z, this.isAttachedToDOM = !1, this.deleted = !1;
            }
            get editorType() {
              return Object.getPrototypeOf(this).constructor._type;
            }
            static get _defaultLineColor() {
              return (0, s.shadow)(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
            }
            static deleteAnnotationElement(d) {
              const b = new A({
                id: d.parent.getNextId(),
                parent: d.parent,
                uiManager: d._uiManager
              });
              b.annotationElementId = d.annotationElementId, b.deleted = !0, b._uiManager.addToAnnotationStorage(b);
            }
            static initialize(d, b = null) {
              if (l._l10nPromise || (l._l10nPromise = new Map(["editor_alt_text_button_label", "editor_alt_text_edit_button_label", "editor_alt_text_decorative_tooltip"].map((O) => [O, d.get(O)]))), b != null && b.strings)
                for (const O of b.strings)
                  l._l10nPromise.set(O, d.get(O));
              if (l._borderLineWidth !== -1)
                return;
              const y = getComputedStyle(document.documentElement);
              l._borderLineWidth = parseFloat(y.getPropertyValue("--outline-width")) || 0;
            }
            static updateDefaultParams(d, b) {
            }
            static get defaultPropertiesToUpdate() {
              return [];
            }
            static isHandlingMimeForPasting(d) {
              return !1;
            }
            static paste(d, b) {
              (0, s.unreachable)("Not implemented");
            }
            get propertiesToUpdate() {
              return [];
            }
            get _isDraggable() {
              return r(this, S);
            }
            set _isDraggable(d) {
              var b;
              ot(this, S, d), (b = this.div) == null || b.classList.toggle("draggable", d);
            }
            center() {
              const [d, b] = this.pageDimensions;
              switch (this.parentRotation) {
                case 90:
                  this.x -= this.height * b / (d * 2), this.y += this.width * d / (b * 2);
                  break;
                case 180:
                  this.x += this.width / 2, this.y += this.height / 2;
                  break;
                case 270:
                  this.x += this.height * b / (d * 2), this.y -= this.width * d / (b * 2);
                  break;
                default:
                  this.x -= this.width / 2, this.y -= this.height / 2;
                  break;
              }
              this.fixAndSetPosition();
            }
            addCommands(d) {
              this._uiManager.addCommands(d);
            }
            get currentLayer() {
              return this._uiManager.currentLayer;
            }
            setInBackground() {
              this.div.style.zIndex = 0;
            }
            setInForeground() {
              this.div.style.zIndex = r(this, g);
            }
            setParent(d) {
              d !== null && (this.pageIndex = d.pageIndex, this.pageDimensions = d.pageDimensions), this.parent = d;
            }
            focusin(d) {
              this._focusEventsAllowed && (r(this, C) ? ot(this, C, !1) : this.parent.setSelected(this));
            }
            focusout(d) {
              var y;
              if (!this._focusEventsAllowed || !this.isAttachedToDOM)
                return;
              const b = d.relatedTarget;
              b != null && b.closest(`#${this.id}`) || (d.preventDefault(), (y = this.parent) != null && y.isMultipleSelection || this.commitOrRemove());
            }
            commitOrRemove() {
              this.isEmpty() ? this.remove() : this.commit();
            }
            commit() {
              this.addToAnnotationStorage();
            }
            addToAnnotationStorage() {
              this._uiManager.addToAnnotationStorage(this);
            }
            setAt(d, b, y, O) {
              const [B, z] = this.parentDimensions;
              [y, O] = this.screenToPageTranslation(y, O), this.x = (d + y) / B, this.y = (b + O) / z, this.fixAndSetPosition();
            }
            translate(d, b) {
              J(this, v, Be).call(this, this.parentDimensions, d, b);
            }
            translateInPage(d, b) {
              J(this, v, Be).call(this, this.pageDimensions, d, b), this.div.scrollIntoView({
                block: "nearest"
              });
            }
            drag(d, b) {
              const [y, O] = this.parentDimensions;
              if (this.x += d / y, this.y += b / O, this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {
                const {
                  x: lt,
                  y: ht
                } = this.div.getBoundingClientRect();
                this.parent.findNewParent(this, lt, ht) && (this.x -= Math.floor(this.x), this.y -= Math.floor(this.y));
              }
              let {
                x: B,
                y: z
              } = this;
              const [it, Z] = J(this, M, Ue).call(this);
              B += it, z += Z, this.div.style.left = `${(100 * B).toFixed(2)}%`, this.div.style.top = `${(100 * z).toFixed(2)}%`, this.div.scrollIntoView({
                block: "nearest"
              });
            }
            fixAndSetPosition() {
              const [d, b] = this.pageDimensions;
              let {
                x: y,
                y: O,
                width: B,
                height: z
              } = this;
              switch (B *= d, z *= b, y *= d, O *= b, this.rotation) {
                case 0:
                  y = Math.max(0, Math.min(d - B, y)), O = Math.max(0, Math.min(b - z, O));
                  break;
                case 90:
                  y = Math.max(0, Math.min(d - z, y)), O = Math.min(b, Math.max(B, O));
                  break;
                case 180:
                  y = Math.min(d, Math.max(B, y)), O = Math.min(b, Math.max(z, O));
                  break;
                case 270:
                  y = Math.min(d, Math.max(z, y)), O = Math.max(0, Math.min(b - B, O));
                  break;
              }
              this.x = y /= d, this.y = O /= b;
              const [it, Z] = J(this, M, Ue).call(this);
              y += it, O += Z;
              const {
                style: lt
              } = this.div;
              lt.left = `${(100 * y).toFixed(2)}%`, lt.top = `${(100 * O).toFixed(2)}%`, this.moveInDOM();
            }
            screenToPageTranslation(d, b) {
              var y;
              return J(y = l, N, je).call(y, d, b, this.parentRotation);
            }
            pageTranslationToScreen(d, b) {
              var y;
              return J(y = l, N, je).call(y, d, b, 360 - this.parentRotation);
            }
            get parentScale() {
              return this._uiManager.viewParameters.realScale;
            }
            get parentRotation() {
              return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360;
            }
            get parentDimensions() {
              const {
                parentScale: d,
                pageDimensions: [b, y]
              } = this, O = b * d, B = y * d;
              return s.FeatureTest.isCSSRoundSupported ? [Math.round(O), Math.round(B)] : [O, B];
            }
            setDims(d, b) {
              var B;
              const [y, O] = this.parentDimensions;
              this.div.style.width = `${(100 * d / y).toFixed(2)}%`, r(this, w) || (this.div.style.height = `${(100 * b / O).toFixed(2)}%`), (B = r(this, o)) == null || B.classList.toggle("small", d < l.SMALL_EDITOR_SIZE || b < l.SMALL_EDITOR_SIZE);
            }
            fixDims() {
              const {
                style: d
              } = this.div, {
                height: b,
                width: y
              } = d, O = y.endsWith("%"), B = !r(this, w) && b.endsWith("%");
              if (O && B)
                return;
              const [z, it] = this.parentDimensions;
              O || (d.width = `${(100 * parseFloat(y) / z).toFixed(2)}%`), !r(this, w) && !B && (d.height = `${(100 * parseFloat(b) / it).toFixed(2)}%`);
            }
            getInitialTranslation() {
              return [0, 0];
            }
            async addAltTextButton() {
              if (r(this, o))
                return;
              const d = ot(this, o, document.createElement("button"));
              d.className = "altText";
              const b = await l._l10nPromise.get("editor_alt_text_button_label");
              d.textContent = b, d.setAttribute("aria-label", b), d.tabIndex = "0", d.addEventListener("contextmenu", p.noContextMenu), d.addEventListener("pointerdown", (y) => y.stopPropagation()), d.addEventListener("click", (y) => {
                y.preventDefault(), this._uiManager.editAltText(this);
              }, {
                capture: !0
              }), d.addEventListener("keydown", (y) => {
                y.target === d && y.key === "Enter" && (y.preventDefault(), this._uiManager.editAltText(this));
              }), J(this, dt, We).call(this), this.div.append(d), l.SMALL_EDITOR_SIZE || (l.SMALL_EDITOR_SIZE = Math.min(128, Math.round(d.getBoundingClientRect().width * 1.4)));
            }
            getClientDimensions() {
              return this.div.getBoundingClientRect();
            }
            get altTextData() {
              return {
                altText: r(this, a),
                decorative: r(this, h)
              };
            }
            set altTextData({
              altText: d,
              decorative: b
            }) {
              r(this, a) === d && r(this, h) === b || (ot(this, a, d), ot(this, h, b), J(this, dt, We).call(this));
            }
            render() {
              this.div = document.createElement("div"), this.div.setAttribute("data-editor-rotation", (360 - this.rotation) % 360), this.div.className = this.name, this.div.setAttribute("id", this.id), this.div.setAttribute("tabIndex", 0), this.setInForeground(), this.div.addEventListener("focusin", r(this, P)), this.div.addEventListener("focusout", r(this, m));
              const [d, b] = this.parentDimensions;
              this.parentRotation % 180 !== 0 && (this.div.style.maxWidth = `${(100 * b / d).toFixed(2)}%`, this.div.style.maxHeight = `${(100 * d / b).toFixed(2)}%`);
              const [y, O] = this.getInitialTranslation();
              return this.translate(y, O), (0, e.bindEvents)(this, this.div, ["pointerdown"]), this.div;
            }
            pointerdown(d) {
              const {
                isMac: b
              } = s.FeatureTest.platform;
              if (d.button !== 0 || d.ctrlKey && b) {
                d.preventDefault();
                return;
              }
              ot(this, C, !0), J(this, gt, Cn).call(this, d);
            }
            moveInDOM() {
              var d;
              (d = this.parent) == null || d.moveEditorInDOM(this);
            }
            _setParentAndPosition(d, b, y) {
              d.changeParent(this), this.x = b, this.y = y, this.fixAndSetPosition();
            }
            getRect(d, b) {
              const y = this.parentScale, [O, B] = this.pageDimensions, [z, it] = this.pageTranslation, Z = d / y, lt = b / y, ht = this.x * O, mt = this.y * B, ft = this.width * O, kt = this.height * B;
              switch (this.rotation) {
                case 0:
                  return [ht + Z + z, B - mt - lt - kt + it, ht + Z + ft + z, B - mt - lt + it];
                case 90:
                  return [ht + lt + z, B - mt + Z + it, ht + lt + kt + z, B - mt + Z + ft + it];
                case 180:
                  return [ht - Z - ft + z, B - mt + lt + it, ht - Z + z, B - mt + lt + kt + it];
                case 270:
                  return [ht - lt - kt + z, B - mt - Z - ft + it, ht - lt + z, B - mt - Z + it];
                default:
                  throw new Error("Invalid rotation");
              }
            }
            getRectInCurrentCoords(d, b) {
              const [y, O, B, z] = d, it = B - y, Z = z - O;
              switch (this.rotation) {
                case 0:
                  return [y, b - z, it, Z];
                case 90:
                  return [y, b - O, Z, it];
                case 180:
                  return [B, b - O, it, Z];
                case 270:
                  return [B, b - z, Z, it];
                default:
                  throw new Error("Invalid rotation");
              }
            }
            onceAdded() {
            }
            isEmpty() {
              return !1;
            }
            enableEditMode() {
              ot(this, E, !0);
            }
            disableEditMode() {
              ot(this, E, !1);
            }
            isInEditMode() {
              return r(this, E);
            }
            shouldGetKeyboardEvents() {
              return !1;
            }
            needsToBeRebuilt() {
              return this.div && !this.isAttachedToDOM;
            }
            rebuild() {
              var d, b;
              (d = this.div) == null || d.addEventListener("focusin", r(this, P)), (b = this.div) == null || b.addEventListener("focusout", r(this, m));
            }
            serialize(d = !1, b = null) {
              (0, s.unreachable)("An editor must be serializable");
            }
            static deserialize(d, b, y) {
              const O = new this.prototype.constructor({
                parent: b,
                id: b.getNextId(),
                uiManager: y
              });
              O.rotation = d.rotation;
              const [B, z] = O.pageDimensions, [it, Z, lt, ht] = O.getRectInCurrentCoords(d.rect, z);
              return O.x = it / B, O.y = Z / z, O.width = lt / B, O.height = ht / z, O;
            }
            remove() {
              var d;
              this.div.removeEventListener("focusin", r(this, P)), this.div.removeEventListener("focusout", r(this, m)), this.isEmpty() || this.commit(), this.parent ? this.parent.remove(this) : this._uiManager.removeEditor(this), (d = r(this, o)) == null || d.remove(), ot(this, o, null), ot(this, F, null);
            }
            get isResizable() {
              return !1;
            }
            makeResizable() {
              this.isResizable && (J(this, I, Sn).call(this), r(this, T).classList.remove("hidden"));
            }
            select() {
              var d;
              this.makeResizable(), (d = this.div) == null || d.classList.add("selectedEditor");
            }
            unselect() {
              var d, b, y;
              (d = r(this, T)) == null || d.classList.add("hidden"), (b = this.div) == null || b.classList.remove("selectedEditor"), (y = this.div) != null && y.contains(document.activeElement) && this._uiManager.currentLayer.div.focus();
            }
            updateParams(d, b) {
            }
            disableEditing() {
              r(this, o) && (r(this, o).hidden = !0);
            }
            enableEditing() {
              r(this, o) && (r(this, o).hidden = !1);
            }
            enterInEditMode() {
            }
            get contentDiv() {
              return this.div;
            }
            get isEditing() {
              return r(this, x);
            }
            set isEditing(d) {
              ot(this, x, d), this.parent && (d ? (this.parent.setSelected(this), this.parent.setActiveEditor(this)) : this.parent.setActiveEditor(null));
            }
            setAspectRatio(d, b) {
              ot(this, w, !0);
              const y = d / b, {
                style: O
              } = this.div;
              O.aspectRatio = y, O.height = "auto";
            }
            static get MIN_SIZE() {
              return 16;
            }
          };
          a = new WeakMap(), h = new WeakMap(), o = new WeakMap(), F = new WeakMap(), R = new WeakMap(), w = new WeakMap(), T = new WeakMap(), P = new WeakMap(), m = new WeakMap(), C = new WeakMap(), x = new WeakMap(), E = new WeakMap(), S = new WeakMap(), g = new WeakMap(), v = new WeakSet(), Be = function([d, b], y, O) {
            [y, O] = this.screenToPageTranslation(y, O), this.x += y / d, this.y += O / b, this.fixAndSetPosition();
          }, M = new WeakSet(), Ue = function() {
            const [d, b] = this.parentDimensions, {
              _borderLineWidth: y
            } = l, O = y / d, B = y / b;
            switch (this.rotation) {
              case 90:
                return [-O, B];
              case 180:
                return [O, B];
              case 270:
                return [O, -B];
              default:
                return [-O, -B];
            }
          }, N = new WeakSet(), je = function(d, b, y) {
            switch (y) {
              case 90:
                return [b, -d];
              case 180:
                return [-d, -b];
              case 270:
                return [-b, d];
              default:
                return [d, b];
            }
          }, X = new WeakSet(), qe = function(d) {
            switch (d) {
              case 90: {
                const [b, y] = this.pageDimensions;
                return [0, -b / y, y / b, 0];
              }
              case 180:
                return [-1, 0, 0, -1];
              case 270: {
                const [b, y] = this.pageDimensions;
                return [0, b / y, -y / b, 0];
              }
              default:
                return [1, 0, 0, 1];
            }
          }, I = new WeakSet(), Sn = function() {
            if (r(this, T))
              return;
            ot(this, T, document.createElement("div")), r(this, T).classList.add("resizers");
            const d = ["topLeft", "topRight", "bottomRight", "bottomLeft"];
            this._willKeepAspectRatio || d.push("topMiddle", "middleRight", "bottomMiddle", "middleLeft");
            for (const b of d) {
              const y = document.createElement("div");
              r(this, T).append(y), y.classList.add("resizer", b), y.addEventListener("pointerdown", J(this, G, wn).bind(this, b)), y.addEventListener("contextmenu", p.noContextMenu);
            }
            this.div.prepend(r(this, T));
          }, G = new WeakSet(), wn = function(d, b) {
            b.preventDefault();
            const {
              isMac: y
            } = s.FeatureTest.platform;
            if (b.button !== 0 || b.ctrlKey && y)
              return;
            const O = J(this, H, En).bind(this, d), B = this._isDraggable;
            this._isDraggable = !1;
            const z = {
              passive: !0,
              capture: !0
            };
            window.addEventListener("pointermove", O, z);
            const it = this.x, Z = this.y, lt = this.width, ht = this.height, mt = this.parent.div.style.cursor, ft = this.div.style.cursor;
            this.div.style.cursor = this.parent.div.style.cursor = window.getComputedStyle(b.target).cursor;
            const kt = () => {
              this._isDraggable = B, window.removeEventListener("pointerup", kt), window.removeEventListener("blur", kt), window.removeEventListener("pointermove", O, z), this.parent.div.style.cursor = mt, this.div.style.cursor = ft;
              const Rt = this.x, St = this.y, It = this.width, _t = this.height;
              Rt === it && St === Z && It === lt && _t === ht || this.addCommands({
                cmd: () => {
                  this.width = It, this.height = _t, this.x = Rt, this.y = St;
                  const [rt, at] = this.parentDimensions;
                  this.setDims(rt * It, at * _t), this.fixAndSetPosition();
                },
                undo: () => {
                  this.width = lt, this.height = ht, this.x = it, this.y = Z;
                  const [rt, at] = this.parentDimensions;
                  this.setDims(rt * lt, at * ht), this.fixAndSetPosition();
                },
                mustExec: !0
              });
            };
            window.addEventListener("pointerup", kt), window.addEventListener("blur", kt);
          }, H = new WeakSet(), En = function(d, b) {
            const [y, O] = this.parentDimensions, B = this.x, z = this.y, it = this.width, Z = this.height, lt = l.MIN_SIZE / y, ht = l.MIN_SIZE / O, mt = (At) => Math.round(At * 1e4) / 1e4, ft = J(this, X, qe).call(this, this.rotation), kt = (At, wt) => [ft[0] * At + ft[2] * wt, ft[1] * At + ft[3] * wt], Rt = J(this, X, qe).call(this, 360 - this.rotation), St = (At, wt) => [Rt[0] * At + Rt[2] * wt, Rt[1] * At + Rt[3] * wt];
            let It, _t, rt = !1, at = !1;
            switch (d) {
              case "topLeft":
                rt = !0, It = (At, wt) => [0, 0], _t = (At, wt) => [At, wt];
                break;
              case "topMiddle":
                It = (At, wt) => [At / 2, 0], _t = (At, wt) => [At / 2, wt];
                break;
              case "topRight":
                rt = !0, It = (At, wt) => [At, 0], _t = (At, wt) => [0, wt];
                break;
              case "middleRight":
                at = !0, It = (At, wt) => [At, wt / 2], _t = (At, wt) => [0, wt / 2];
                break;
              case "bottomRight":
                rt = !0, It = (At, wt) => [At, wt], _t = (At, wt) => [0, 0];
                break;
              case "bottomMiddle":
                It = (At, wt) => [At / 2, wt], _t = (At, wt) => [At / 2, 0];
                break;
              case "bottomLeft":
                rt = !0, It = (At, wt) => [0, wt], _t = (At, wt) => [At, 0];
                break;
              case "middleLeft":
                at = !0, It = (At, wt) => [0, wt / 2], _t = (At, wt) => [At, wt / 2];
                break;
            }
            const pt = It(it, Z), Ct = _t(it, Z);
            let Tt = kt(...Ct);
            const Bt = mt(B + Tt[0]), Wt = mt(z + Tt[1]);
            let jt = 1, zt = 1, [Gt, qt] = this.screenToPageTranslation(b.movementX, b.movementY);
            if ([Gt, qt] = St(Gt / y, qt / O), rt) {
              const At = Math.hypot(it, Z);
              jt = zt = Math.max(Math.min(Math.hypot(Ct[0] - pt[0] - Gt, Ct[1] - pt[1] - qt) / At, 1 / it, 1 / Z), lt / it, ht / Z);
            } else
              at ? jt = Math.max(lt, Math.min(1, Math.abs(Ct[0] - pt[0] - Gt))) / it : zt = Math.max(ht, Math.min(1, Math.abs(Ct[1] - pt[1] - qt))) / Z;
            const Vt = mt(it * jt), ut = mt(Z * zt);
            Tt = kt(..._t(Vt, ut));
            const nt = Bt - Tt[0], Q = Wt - Tt[1];
            this.width = Vt, this.height = ut, this.x = nt, this.y = Q, this.setDims(y * Vt, O * ut), this.fixAndSetPosition();
          }, dt = new WeakSet(), We = async function() {
            var y;
            const d = r(this, o);
            if (!d)
              return;
            if (!r(this, a) && !r(this, h)) {
              d.classList.remove("done"), (y = r(this, F)) == null || y.remove();
              return;
            }
            l._l10nPromise.get("editor_alt_text_edit_button_label").then((O) => {
              d.setAttribute("aria-label", O);
            });
            let b = r(this, F);
            if (!b) {
              ot(this, F, b = document.createElement("span")), b.className = "tooltip", b.setAttribute("role", "tooltip");
              const O = b.id = `alt-text-tooltip-${this.id}`;
              d.setAttribute("aria-describedby", O);
              const B = 100;
              d.addEventListener("mouseenter", () => {
                ot(this, R, setTimeout(() => {
                  ot(this, R, null), r(this, F).classList.add("show"), this._uiManager._eventBus.dispatch("reporttelemetry", {
                    source: this,
                    details: {
                      type: "editing",
                      subtype: this.editorType,
                      data: {
                        action: "alt_text_tooltip"
                      }
                    }
                  });
                }, B));
              }), d.addEventListener("mouseleave", () => {
                var z;
                clearTimeout(r(this, R)), ot(this, R, null), (z = r(this, F)) == null || z.classList.remove("show");
              });
            }
            d.classList.add("done"), b.innerText = r(this, h) ? await l._l10nPromise.get("editor_alt_text_decorative_tooltip") : r(this, a), b.parentNode || d.append(b);
          }, gt = new WeakSet(), Cn = function(d) {
            if (!this._isDraggable)
              return;
            const b = this._uiManager.isSelected(this);
            this._uiManager.setUpDragSession();
            let y, O;
            b && (y = {
              passive: !0,
              capture: !0
            }, O = (z) => {
              const [it, Z] = this.screenToPageTranslation(z.movementX, z.movementY);
              this._uiManager.dragSelectedEditors(it, Z);
            }, window.addEventListener("pointermove", O, y));
            const B = () => {
              if (window.removeEventListener("pointerup", B), window.removeEventListener("blur", B), b && window.removeEventListener("pointermove", O, y), ot(this, C, !1), !this._uiManager.endDragSession()) {
                const {
                  isMac: z
                } = s.FeatureTest.platform;
                d.ctrlKey && !z || d.shiftKey || d.metaKey && z ? this.parent.toggleSelected(this) : this.parent.setSelected(this);
              }
            };
            window.addEventListener("pointerup", B), window.addEventListener("blur", B);
          }, W(l, N), ee(l, "_borderLineWidth", -1), ee(l, "_colorManager", new e.ColorManager()), ee(l, "_zIndex", 1), ee(l, "SMALL_EDITOR_SIZE", 0);
          let f = l;
          t.AnnotationEditor = f;
          class A extends f {
            constructor(d) {
              super(d), this.annotationElementId = d.annotationElementId, this.deleted = !0;
            }
            serialize() {
              return {
                id: this.annotationElementId,
                deleted: !0,
                pageIndex: this.pageIndex
              };
            }
          }
        },
        /* 5 */
        /***/
        (i, t, n) => {
          var w, T, P, m, C, He, S, g, v, $, M, kn, D, X, Y, I, U, G, V, H, st, dt, yt, gt, k, l, u, d, b, y, O, B, z, it, Z, lt, ht, mt, ft, kt, Rt, St, It, _t, rt, at, pt, Tn, Tt, ze, Wt, Ge, zt, Ce, qt, Xe, ut, Ve, Q, re, wt, _e, Qt, Pn, Et, Fn, Pt, Ye, Nt, me, vt, Ke;
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.KeyboardManager = t.CommandManager = t.ColorManager = t.AnnotationEditorUIManager = void 0, t.bindEvents = p, t.opacityToHex = f;
          var e = n(1), s = n(6);
          function p(j, c, L) {
            for (const q of L)
              c.addEventListener(q, j[q].bind(j));
          }
          function f(j) {
            return Math.round(Math.min(255, Math.max(1, 255 * j))).toString(16).padStart(2, "0");
          }
          class A {
            constructor() {
              W(this, w, 0);
            }
            getId() {
              return `${e.AnnotationEditorPrefix}${ge(this, w)._++}`;
            }
          }
          w = new WeakMap();
          const E = class E {
            constructor() {
              W(this, C);
              W(this, T, (0, e.getUuid)());
              W(this, P, 0);
              W(this, m, null);
            }
            static get _isSVGFittingCanvas() {
              const c = 'data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>', q = new OffscreenCanvas(1, 3).getContext("2d"), K = new Image();
              K.src = c;
              const tt = K.decode().then(() => (q.drawImage(K, 0, 0, 1, 1, 0, 0, 1, 3), new Uint32Array(q.getImageData(0, 0, 1, 1).data.buffer)[0] === 0));
              return (0, e.shadow)(this, "_isSVGFittingCanvas", tt);
            }
            async getFromFile(c) {
              const {
                lastModified: L,
                name: q,
                size: K,
                type: tt
              } = c;
              return J(this, C, He).call(this, `${L}_${q}_${K}_${tt}`, c);
            }
            async getFromUrl(c) {
              return J(this, C, He).call(this, c, c);
            }
            async getFromId(c) {
              r(this, m) || ot(this, m, /* @__PURE__ */ new Map());
              const L = r(this, m).get(c);
              return L ? L.bitmap ? (L.refCounter += 1, L) : L.file ? this.getFromFile(L.file) : this.getFromUrl(L.url) : null;
            }
            getSvgUrl(c) {
              const L = r(this, m).get(c);
              return L != null && L.isSvg ? L.svgUrl : null;
            }
            deleteId(c) {
              r(this, m) || ot(this, m, /* @__PURE__ */ new Map());
              const L = r(this, m).get(c);
              L && (L.refCounter -= 1, L.refCounter === 0 && (L.bitmap = null));
            }
            isValidId(c) {
              return c.startsWith(`image_${r(this, T)}_`);
            }
          };
          T = new WeakMap(), P = new WeakMap(), m = new WeakMap(), C = new WeakSet(), He = async function(c, L) {
            r(this, m) || ot(this, m, /* @__PURE__ */ new Map());
            let q = r(this, m).get(c);
            if (q === null)
              return null;
            if (q != null && q.bitmap)
              return q.refCounter += 1, q;
            try {
              q || (q = {
                bitmap: null,
                id: `image_${r(this, T)}_${ge(this, P)._++}`,
                refCounter: 0,
                isSvg: !1
              });
              let K;
              if (typeof L == "string") {
                q.url = L;
                const tt = await fetch(L);
                if (!tt.ok)
                  throw new Error(tt.statusText);
                K = await tt.blob();
              } else
                K = q.file = L;
              if (K.type === "image/svg+xml") {
                const tt = E._isSVGFittingCanvas, ct = new FileReader(), bt = new Image(), Mt = new Promise((Ft, Ht) => {
                  bt.onload = () => {
                    q.bitmap = bt, q.isSvg = !0, Ft();
                  }, ct.onload = async () => {
                    const xt = q.svgUrl = ct.result;
                    bt.src = await tt ? `${xt}#svgView(preserveAspectRatio(none))` : xt;
                  }, bt.onerror = ct.onerror = Ht;
                });
                ct.readAsDataURL(K), await Mt;
              } else
                q.bitmap = await createImageBitmap(K);
              q.refCounter = 1;
            } catch (K) {
              console.error(K), q = null;
            }
            return r(this, m).set(c, q), q && r(this, m).set(q.id, q), q;
          };
          let a = E;
          class h {
            constructor(c = 128) {
              W(this, S, []);
              W(this, g, !1);
              W(this, v, void 0);
              W(this, $, -1);
              ot(this, v, c);
            }
            add({
              cmd: c,
              undo: L,
              mustExec: q,
              type: K = NaN,
              overwriteIfSameType: tt = !1,
              keepUndo: ct = !1
            }) {
              if (q && c(), r(this, g))
                return;
              const bt = {
                cmd: c,
                undo: L,
                type: K
              };
              if (r(this, $) === -1) {
                r(this, S).length > 0 && (r(this, S).length = 0), ot(this, $, 0), r(this, S).push(bt);
                return;
              }
              if (tt && r(this, S)[r(this, $)].type === K) {
                ct && (bt.undo = r(this, S)[r(this, $)].undo), r(this, S)[r(this, $)] = bt;
                return;
              }
              const Mt = r(this, $) + 1;
              Mt === r(this, v) ? r(this, S).splice(0, 1) : (ot(this, $, Mt), Mt < r(this, S).length && r(this, S).splice(Mt)), r(this, S).push(bt);
            }
            undo() {
              r(this, $) !== -1 && (ot(this, g, !0), r(this, S)[r(this, $)].undo(), ot(this, g, !1), ot(this, $, r(this, $) - 1));
            }
            redo() {
              r(this, $) < r(this, S).length - 1 && (ot(this, $, r(this, $) + 1), ot(this, g, !0), r(this, S)[r(this, $)].cmd(), ot(this, g, !1));
            }
            hasSomethingToUndo() {
              return r(this, $) !== -1;
            }
            hasSomethingToRedo() {
              return r(this, $) < r(this, S).length - 1;
            }
            destroy() {
              ot(this, S, null);
            }
          }
          S = new WeakMap(), g = new WeakMap(), v = new WeakMap(), $ = new WeakMap(), t.CommandManager = h;
          class o {
            constructor(c) {
              W(this, M);
              this.buffer = [], this.callbacks = /* @__PURE__ */ new Map(), this.allKeys = /* @__PURE__ */ new Set();
              const {
                isMac: L
              } = e.FeatureTest.platform;
              for (const [q, K, tt = {}] of c)
                for (const ct of q) {
                  const bt = ct.startsWith("mac+");
                  L && bt ? (this.callbacks.set(ct.slice(4), {
                    callback: K,
                    options: tt
                  }), this.allKeys.add(ct.split("+").at(-1))) : !L && !bt && (this.callbacks.set(ct, {
                    callback: K,
                    options: tt
                  }), this.allKeys.add(ct.split("+").at(-1)));
                }
            }
            exec(c, L) {
              if (!this.allKeys.has(L.key))
                return;
              const q = this.callbacks.get(J(this, M, kn).call(this, L));
              if (!q)
                return;
              const {
                callback: K,
                options: {
                  bubbles: tt = !1,
                  args: ct = [],
                  checker: bt = null
                }
              } = q;
              bt && !bt(c, L) || (K.bind(c, ...ct)(), tt || (L.stopPropagation(), L.preventDefault()));
            }
          }
          M = new WeakSet(), kn = function(c) {
            c.altKey && this.buffer.push("alt"), c.ctrlKey && this.buffer.push("ctrl"), c.metaKey && this.buffer.push("meta"), c.shiftKey && this.buffer.push("shift"), this.buffer.push(c.key);
            const L = this.buffer.join("+");
            return this.buffer.length = 0, L;
          }, t.KeyboardManager = o;
          const N = class N {
            get _colors() {
              const c = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
              return (0, s.getColorValues)(c), (0, e.shadow)(this, "_colors", c);
            }
            convert(c) {
              const L = (0, s.getRGB)(c);
              if (!window.matchMedia("(forced-colors: active)").matches)
                return L;
              for (const [q, K] of this._colors)
                if (K.every((tt, ct) => tt === L[ct]))
                  return N._colorsMapping.get(q);
              return L;
            }
            getHexCode(c) {
              const L = this._colors.get(c);
              return L ? e.Util.makeHexColor(...L) : c;
            }
          };
          ee(N, "_colorsMapping", /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]));
          let F = N;
          t.ColorManager = F;
          const Lt = class Lt {
            constructor(c, L, q, K, tt, ct) {
              W(this, pt);
              W(this, Tt);
              W(this, Wt);
              W(this, zt);
              W(this, qt);
              W(this, ut);
              W(this, Q);
              W(this, wt);
              W(this, Qt);
              W(this, Et);
              W(this, Pt);
              W(this, Nt);
              W(this, vt);
              W(this, D, null);
              W(this, X, /* @__PURE__ */ new Map());
              W(this, Y, /* @__PURE__ */ new Map());
              W(this, I, null);
              W(this, U, null);
              W(this, G, new h());
              W(this, V, 0);
              W(this, H, /* @__PURE__ */ new Set());
              W(this, st, null);
              W(this, dt, null);
              W(this, yt, /* @__PURE__ */ new Set());
              W(this, gt, null);
              W(this, k, new A());
              W(this, l, !1);
              W(this, u, !1);
              W(this, d, null);
              W(this, b, e.AnnotationEditorType.NONE);
              W(this, y, /* @__PURE__ */ new Set());
              W(this, O, null);
              W(this, B, this.blur.bind(this));
              W(this, z, this.focus.bind(this));
              W(this, it, this.copy.bind(this));
              W(this, Z, this.cut.bind(this));
              W(this, lt, this.paste.bind(this));
              W(this, ht, this.keydown.bind(this));
              W(this, mt, this.onEditingAction.bind(this));
              W(this, ft, this.onPageChanging.bind(this));
              W(this, kt, this.onScaleChanging.bind(this));
              W(this, Rt, this.onRotationChanging.bind(this));
              W(this, St, {
                isEditing: !1,
                isEmpty: !0,
                hasSomethingToUndo: !1,
                hasSomethingToRedo: !1,
                hasSelectedEditor: !1
              });
              W(this, It, [0, 0]);
              W(this, _t, null);
              W(this, rt, null);
              W(this, at, null);
              ot(this, rt, c), ot(this, at, L), ot(this, I, q), this._eventBus = K, this._eventBus._on("editingaction", r(this, mt)), this._eventBus._on("pagechanging", r(this, ft)), this._eventBus._on("scalechanging", r(this, kt)), this._eventBus._on("rotationchanging", r(this, Rt)), ot(this, U, tt.annotationStorage), ot(this, gt, tt.filterFactory), ot(this, O, ct), this.viewParameters = {
                realScale: s.PixelsPerInch.PDF_TO_CSS_UNITS,
                rotation: 0
              };
            }
            static get _keyboardManager() {
              const c = Lt.prototype, L = (tt) => {
                const {
                  activeElement: ct
                } = document;
                return ct && r(tt, rt).contains(ct) && tt.hasSomethingToControl();
              }, q = this.TRANSLATE_SMALL, K = this.TRANSLATE_BIG;
              return (0, e.shadow)(this, "_keyboardManager", new o([[["ctrl+a", "mac+meta+a"], c.selectAll], [["ctrl+z", "mac+meta+z"], c.undo], [["ctrl+y", "ctrl+shift+z", "mac+meta+shift+z", "ctrl+shift+Z", "mac+meta+shift+Z"], c.redo], [["Backspace", "alt+Backspace", "ctrl+Backspace", "shift+Backspace", "mac+Backspace", "mac+alt+Backspace", "mac+ctrl+Backspace", "Delete", "ctrl+Delete", "shift+Delete", "mac+Delete"], c.delete], [["Escape", "mac+Escape"], c.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], c.translateSelectedEditors, {
                args: [-q, 0],
                checker: L
              }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], c.translateSelectedEditors, {
                args: [-K, 0],
                checker: L
              }], [["ArrowRight", "mac+ArrowRight"], c.translateSelectedEditors, {
                args: [q, 0],
                checker: L
              }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], c.translateSelectedEditors, {
                args: [K, 0],
                checker: L
              }], [["ArrowUp", "mac+ArrowUp"], c.translateSelectedEditors, {
                args: [0, -q],
                checker: L
              }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], c.translateSelectedEditors, {
                args: [0, -K],
                checker: L
              }], [["ArrowDown", "mac+ArrowDown"], c.translateSelectedEditors, {
                args: [0, q],
                checker: L
              }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], c.translateSelectedEditors, {
                args: [0, K],
                checker: L
              }]]));
            }
            destroy() {
              J(this, zt, Ce).call(this), J(this, Tt, ze).call(this), this._eventBus._off("editingaction", r(this, mt)), this._eventBus._off("pagechanging", r(this, ft)), this._eventBus._off("scalechanging", r(this, kt)), this._eventBus._off("rotationchanging", r(this, Rt));
              for (const c of r(this, Y).values())
                c.destroy();
              r(this, Y).clear(), r(this, X).clear(), r(this, yt).clear(), ot(this, D, null), r(this, y).clear(), r(this, G).destroy(), r(this, I).destroy();
            }
            get hcmFilter() {
              return (0, e.shadow)(this, "hcmFilter", r(this, O) ? r(this, gt).addHCMFilter(r(this, O).foreground, r(this, O).background) : "none");
            }
            get direction() {
              return (0, e.shadow)(this, "direction", getComputedStyle(r(this, rt)).direction);
            }
            editAltText(c) {
              var L;
              (L = r(this, I)) == null || L.editAltText(this, c);
            }
            onPageChanging({
              pageNumber: c
            }) {
              ot(this, V, c - 1);
            }
            focusMainContainer() {
              r(this, rt).focus();
            }
            findParent(c, L) {
              for (const q of r(this, Y).values()) {
                const {
                  x: K,
                  y: tt,
                  width: ct,
                  height: bt
                } = q.div.getBoundingClientRect();
                if (c >= K && c <= K + ct && L >= tt && L <= tt + bt)
                  return q;
              }
              return null;
            }
            disableUserSelect(c = !1) {
              r(this, at).classList.toggle("noUserSelect", c);
            }
            addShouldRescale(c) {
              r(this, yt).add(c);
            }
            removeShouldRescale(c) {
              r(this, yt).delete(c);
            }
            onScaleChanging({
              scale: c
            }) {
              this.commitOrRemove(), this.viewParameters.realScale = c * s.PixelsPerInch.PDF_TO_CSS_UNITS;
              for (const L of r(this, yt))
                L.onScaleChanging();
            }
            onRotationChanging({
              pagesRotation: c
            }) {
              this.commitOrRemove(), this.viewParameters.rotation = c;
            }
            addToAnnotationStorage(c) {
              !c.isEmpty() && r(this, U) && !r(this, U).has(c.id) && r(this, U).setValue(c.id, c);
            }
            blur() {
              if (!this.hasSelection)
                return;
              const {
                activeElement: c
              } = document;
              for (const L of r(this, y))
                if (L.div.contains(c)) {
                  ot(this, d, [L, c]), L._focusEventsAllowed = !1;
                  break;
                }
            }
            focus() {
              if (!r(this, d))
                return;
              const [c, L] = r(this, d);
              ot(this, d, null), L.addEventListener("focusin", () => {
                c._focusEventsAllowed = !0;
              }, {
                once: !0
              }), L.focus();
            }
            addEditListeners() {
              J(this, Wt, Ge).call(this), J(this, qt, Xe).call(this);
            }
            removeEditListeners() {
              J(this, zt, Ce).call(this), J(this, ut, Ve).call(this);
            }
            copy(c) {
              var q;
              if (c.preventDefault(), (q = r(this, D)) == null || q.commitOrRemove(), !this.hasSelection)
                return;
              const L = [];
              for (const K of r(this, y)) {
                const tt = K.serialize(!0);
                tt && L.push(tt);
              }
              L.length !== 0 && c.clipboardData.setData("application/pdfjs", JSON.stringify(L));
            }
            cut(c) {
              this.copy(c), this.delete();
            }
            paste(c) {
              c.preventDefault();
              const {
                clipboardData: L
              } = c;
              for (const tt of L.items)
                for (const ct of r(this, dt))
                  if (ct.isHandlingMimeForPasting(tt.type)) {
                    ct.paste(tt, this.currentLayer);
                    return;
                  }
              let q = L.getData("application/pdfjs");
              if (!q)
                return;
              try {
                q = JSON.parse(q);
              } catch (tt) {
                (0, e.warn)(`paste: "${tt.message}".`);
                return;
              }
              if (!Array.isArray(q))
                return;
              this.unselectAll();
              const K = this.currentLayer;
              try {
                const tt = [];
                for (const Mt of q) {
                  const Ft = K.deserialize(Mt);
                  if (!Ft)
                    return;
                  tt.push(Ft);
                }
                const ct = () => {
                  for (const Mt of tt)
                    J(this, Pt, Ye).call(this, Mt);
                  J(this, vt, Ke).call(this, tt);
                }, bt = () => {
                  for (const Mt of tt)
                    Mt.remove();
                };
                this.addCommands({
                  cmd: ct,
                  undo: bt,
                  mustExec: !0
                });
              } catch (tt) {
                (0, e.warn)(`paste: "${tt.message}".`);
              }
            }
            keydown(c) {
              var L;
              (L = this.getActive()) != null && L.shouldGetKeyboardEvents() || Lt._keyboardManager.exec(this, c);
            }
            onEditingAction(c) {
              ["undo", "redo", "delete", "selectAll"].includes(c.name) && this[c.name]();
            }
            setEditingState(c) {
              c ? (J(this, pt, Tn).call(this), J(this, Wt, Ge).call(this), J(this, qt, Xe).call(this), J(this, Q, re).call(this, {
                isEditing: r(this, b) !== e.AnnotationEditorType.NONE,
                isEmpty: J(this, Nt, me).call(this),
                hasSomethingToUndo: r(this, G).hasSomethingToUndo(),
                hasSomethingToRedo: r(this, G).hasSomethingToRedo(),
                hasSelectedEditor: !1
              })) : (J(this, Tt, ze).call(this), J(this, zt, Ce).call(this), J(this, ut, Ve).call(this), J(this, Q, re).call(this, {
                isEditing: !1
              }), this.disableUserSelect(!1));
            }
            registerEditorTypes(c) {
              if (!r(this, dt)) {
                ot(this, dt, c);
                for (const L of r(this, dt))
                  J(this, wt, _e).call(this, L.defaultPropertiesToUpdate);
              }
            }
            getId() {
              return r(this, k).getId();
            }
            get currentLayer() {
              return r(this, Y).get(r(this, V));
            }
            getLayer(c) {
              return r(this, Y).get(c);
            }
            get currentPageIndex() {
              return r(this, V);
            }
            addLayer(c) {
              r(this, Y).set(c.pageIndex, c), r(this, l) ? c.enable() : c.disable();
            }
            removeLayer(c) {
              r(this, Y).delete(c.pageIndex);
            }
            updateMode(c, L = null) {
              if (r(this, b) !== c) {
                if (ot(this, b, c), c === e.AnnotationEditorType.NONE) {
                  this.setEditingState(!1), J(this, Et, Fn).call(this);
                  return;
                }
                this.setEditingState(!0), J(this, Qt, Pn).call(this), this.unselectAll();
                for (const q of r(this, Y).values())
                  q.updateMode(c);
                if (L) {
                  for (const q of r(this, X).values())
                    if (q.annotationElementId === L) {
                      this.setSelected(q), q.enterInEditMode();
                      break;
                    }
                }
              }
            }
            updateToolbar(c) {
              c !== r(this, b) && this._eventBus.dispatch("switchannotationeditormode", {
                source: this,
                mode: c
              });
            }
            updateParams(c, L) {
              if (r(this, dt)) {
                if (c === e.AnnotationEditorParamsType.CREATE) {
                  this.currentLayer.addNewEditor(c);
                  return;
                }
                for (const q of r(this, y))
                  q.updateParams(c, L);
                for (const q of r(this, dt))
                  q.updateDefaultParams(c, L);
              }
            }
            enableWaiting(c = !1) {
              if (r(this, u) !== c) {
                ot(this, u, c);
                for (const L of r(this, Y).values())
                  c ? L.disableClick() : L.enableClick(), L.div.classList.toggle("waiting", c);
              }
            }
            getEditors(c) {
              const L = [];
              for (const q of r(this, X).values())
                q.pageIndex === c && L.push(q);
              return L;
            }
            getEditor(c) {
              return r(this, X).get(c);
            }
            addEditor(c) {
              r(this, X).set(c.id, c);
            }
            removeEditor(c) {
              var L;
              r(this, X).delete(c.id), this.unselect(c), (!c.annotationElementId || !r(this, H).has(c.annotationElementId)) && ((L = r(this, U)) == null || L.remove(c.id));
            }
            addDeletedAnnotationElement(c) {
              r(this, H).add(c.annotationElementId), c.deleted = !0;
            }
            isDeletedAnnotationElement(c) {
              return r(this, H).has(c);
            }
            removeDeletedAnnotationElement(c) {
              r(this, H).delete(c.annotationElementId), c.deleted = !1;
            }
            setActiveEditor(c) {
              r(this, D) !== c && (ot(this, D, c), c && J(this, wt, _e).call(this, c.propertiesToUpdate));
            }
            toggleSelected(c) {
              if (r(this, y).has(c)) {
                r(this, y).delete(c), c.unselect(), J(this, Q, re).call(this, {
                  hasSelectedEditor: this.hasSelection
                });
                return;
              }
              r(this, y).add(c), c.select(), J(this, wt, _e).call(this, c.propertiesToUpdate), J(this, Q, re).call(this, {
                hasSelectedEditor: !0
              });
            }
            setSelected(c) {
              for (const L of r(this, y))
                L !== c && L.unselect();
              r(this, y).clear(), r(this, y).add(c), c.select(), J(this, wt, _e).call(this, c.propertiesToUpdate), J(this, Q, re).call(this, {
                hasSelectedEditor: !0
              });
            }
            isSelected(c) {
              return r(this, y).has(c);
            }
            unselect(c) {
              c.unselect(), r(this, y).delete(c), J(this, Q, re).call(this, {
                hasSelectedEditor: this.hasSelection
              });
            }
            get hasSelection() {
              return r(this, y).size !== 0;
            }
            undo() {
              r(this, G).undo(), J(this, Q, re).call(this, {
                hasSomethingToUndo: r(this, G).hasSomethingToUndo(),
                hasSomethingToRedo: !0,
                isEmpty: J(this, Nt, me).call(this)
              });
            }
            redo() {
              r(this, G).redo(), J(this, Q, re).call(this, {
                hasSomethingToUndo: !0,
                hasSomethingToRedo: r(this, G).hasSomethingToRedo(),
                isEmpty: J(this, Nt, me).call(this)
              });
            }
            addCommands(c) {
              r(this, G).add(c), J(this, Q, re).call(this, {
                hasSomethingToUndo: !0,
                hasSomethingToRedo: !1,
                isEmpty: J(this, Nt, me).call(this)
              });
            }
            delete() {
              if (this.commitOrRemove(), !this.hasSelection)
                return;
              const c = [...r(this, y)], L = () => {
                for (const K of c)
                  K.remove();
              }, q = () => {
                for (const K of c)
                  J(this, Pt, Ye).call(this, K);
              };
              this.addCommands({
                cmd: L,
                undo: q,
                mustExec: !0
              });
            }
            commitOrRemove() {
              var c;
              (c = r(this, D)) == null || c.commitOrRemove();
            }
            hasSomethingToControl() {
              return r(this, D) || this.hasSelection;
            }
            selectAll() {
              for (const c of r(this, y))
                c.commit();
              J(this, vt, Ke).call(this, r(this, X).values());
            }
            unselectAll() {
              if (r(this, D)) {
                r(this, D).commitOrRemove();
                return;
              }
              if (this.hasSelection) {
                for (const c of r(this, y))
                  c.unselect();
                r(this, y).clear(), J(this, Q, re).call(this, {
                  hasSelectedEditor: !1
                });
              }
            }
            translateSelectedEditors(c, L, q = !1) {
              if (q || this.commitOrRemove(), !this.hasSelection)
                return;
              r(this, It)[0] += c, r(this, It)[1] += L;
              const [K, tt] = r(this, It), ct = [...r(this, y)], bt = 1e3;
              r(this, _t) && clearTimeout(r(this, _t)), ot(this, _t, setTimeout(() => {
                ot(this, _t, null), r(this, It)[0] = r(this, It)[1] = 0, this.addCommands({
                  cmd: () => {
                    for (const Mt of ct)
                      r(this, X).has(Mt.id) && Mt.translateInPage(K, tt);
                  },
                  undo: () => {
                    for (const Mt of ct)
                      r(this, X).has(Mt.id) && Mt.translateInPage(-K, -tt);
                  },
                  mustExec: !1
                });
              }, bt));
              for (const Mt of ct)
                Mt.translateInPage(c, L);
            }
            setUpDragSession() {
              if (this.hasSelection) {
                this.disableUserSelect(!0), ot(this, st, /* @__PURE__ */ new Map());
                for (const c of r(this, y))
                  r(this, st).set(c, {
                    savedX: c.x,
                    savedY: c.y,
                    savedPageIndex: c.pageIndex,
                    newX: 0,
                    newY: 0,
                    newPageIndex: -1
                  });
              }
            }
            endDragSession() {
              if (!r(this, st))
                return !1;
              this.disableUserSelect(!1);
              const c = r(this, st);
              ot(this, st, null);
              let L = !1;
              for (const [{
                x: K,
                y: tt,
                pageIndex: ct
              }, bt] of c)
                bt.newX = K, bt.newY = tt, bt.newPageIndex = ct, L || (L = K !== bt.savedX || tt !== bt.savedY || ct !== bt.savedPageIndex);
              if (!L)
                return !1;
              const q = (K, tt, ct, bt) => {
                if (r(this, X).has(K.id)) {
                  const Mt = r(this, Y).get(bt);
                  Mt ? K._setParentAndPosition(Mt, tt, ct) : (K.pageIndex = bt, K.x = tt, K.y = ct);
                }
              };
              return this.addCommands({
                cmd: () => {
                  for (const [K, {
                    newX: tt,
                    newY: ct,
                    newPageIndex: bt
                  }] of c)
                    q(K, tt, ct, bt);
                },
                undo: () => {
                  for (const [K, {
                    savedX: tt,
                    savedY: ct,
                    savedPageIndex: bt
                  }] of c)
                    q(K, tt, ct, bt);
                },
                mustExec: !0
              }), !0;
            }
            dragSelectedEditors(c, L) {
              if (r(this, st))
                for (const q of r(this, st).keys())
                  q.drag(c, L);
            }
            rebuild(c) {
              if (c.parent === null) {
                const L = this.getLayer(c.pageIndex);
                L ? (L.changeParent(c), L.addOrRebuild(c)) : (this.addEditor(c), this.addToAnnotationStorage(c), c.rebuild());
              } else
                c.parent.addOrRebuild(c);
            }
            isActive(c) {
              return r(this, D) === c;
            }
            getActive() {
              return r(this, D);
            }
            getMode() {
              return r(this, b);
            }
            get imageManager() {
              return (0, e.shadow)(this, "imageManager", new a());
            }
          };
          D = new WeakMap(), X = new WeakMap(), Y = new WeakMap(), I = new WeakMap(), U = new WeakMap(), G = new WeakMap(), V = new WeakMap(), H = new WeakMap(), st = new WeakMap(), dt = new WeakMap(), yt = new WeakMap(), gt = new WeakMap(), k = new WeakMap(), l = new WeakMap(), u = new WeakMap(), d = new WeakMap(), b = new WeakMap(), y = new WeakMap(), O = new WeakMap(), B = new WeakMap(), z = new WeakMap(), it = new WeakMap(), Z = new WeakMap(), lt = new WeakMap(), ht = new WeakMap(), mt = new WeakMap(), ft = new WeakMap(), kt = new WeakMap(), Rt = new WeakMap(), St = new WeakMap(), It = new WeakMap(), _t = new WeakMap(), rt = new WeakMap(), at = new WeakMap(), pt = new WeakSet(), Tn = function() {
            window.addEventListener("focus", r(this, z)), window.addEventListener("blur", r(this, B));
          }, Tt = new WeakSet(), ze = function() {
            window.removeEventListener("focus", r(this, z)), window.removeEventListener("blur", r(this, B));
          }, Wt = new WeakSet(), Ge = function() {
            window.addEventListener("keydown", r(this, ht), {
              capture: !0
            });
          }, zt = new WeakSet(), Ce = function() {
            window.removeEventListener("keydown", r(this, ht), {
              capture: !0
            });
          }, qt = new WeakSet(), Xe = function() {
            document.addEventListener("copy", r(this, it)), document.addEventListener("cut", r(this, Z)), document.addEventListener("paste", r(this, lt));
          }, ut = new WeakSet(), Ve = function() {
            document.removeEventListener("copy", r(this, it)), document.removeEventListener("cut", r(this, Z)), document.removeEventListener("paste", r(this, lt));
          }, Q = new WeakSet(), re = function(c) {
            Object.entries(c).some(([q, K]) => r(this, St)[q] !== K) && this._eventBus.dispatch("annotationeditorstateschanged", {
              source: this,
              details: Object.assign(r(this, St), c)
            });
          }, wt = new WeakSet(), _e = function(c) {
            this._eventBus.dispatch("annotationeditorparamschanged", {
              source: this,
              details: c
            });
          }, Qt = new WeakSet(), Pn = function() {
            if (!r(this, l)) {
              ot(this, l, !0);
              for (const c of r(this, Y).values())
                c.enable();
            }
          }, Et = new WeakSet(), Fn = function() {
            if (this.unselectAll(), r(this, l)) {
              ot(this, l, !1);
              for (const c of r(this, Y).values())
                c.disable();
            }
          }, Pt = new WeakSet(), Ye = function(c) {
            const L = r(this, Y).get(c.pageIndex);
            L ? L.addOrRebuild(c) : this.addEditor(c);
          }, Nt = new WeakSet(), me = function() {
            if (r(this, X).size === 0)
              return !0;
            if (r(this, X).size === 1)
              for (const c of r(this, X).values())
                return c.isEmpty();
            return !1;
          }, vt = new WeakSet(), Ke = function(c) {
            r(this, y).clear();
            for (const L of c)
              L.isEmpty() || (r(this, y).add(L), L.select());
            J(this, Q, re).call(this, {
              hasSelectedEditor: !0
            });
          }, ee(Lt, "TRANSLATE_SMALL", 1), ee(Lt, "TRANSLATE_BIG", 10);
          let R = Lt;
          t.AnnotationEditorUIManager = R;
        },
        /* 6 */
        /***/
        (i, t, n) => {
          var V, H, st, dt, yt, gt, k, l, u, d, b, y, de, B, ue, it, Je, lt, ke, mt, Te, kt, be, St, ye;
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.StatTimer = t.RenderingCancelledException = t.PixelsPerInch = t.PageViewport = t.PDFDateString = t.DOMStandardFontDataFactory = t.DOMSVGFactory = t.DOMFilterFactory = t.DOMCanvasFactory = t.DOMCMapReaderFactory = void 0, t.deprecated = $, t.getColorValues = X, t.getCurrentTransform = Y, t.getCurrentTransformInverse = I, t.getFilenameFromUrl = C, t.getPdfFilenameFromUrl = x, t.getRGB = D, t.getXfaPageViewport = N, t.isDataScheme = P, t.isPdfFile = m, t.isValidFetchUrl = S, t.loadScript = v, t.noContextMenu = g, t.setLayerDimensions = U;
          var e = n(7), s = n(1);
          const p = "http://www.w3.org/2000/svg", G = class G {
          };
          ee(G, "CSS", 96), ee(G, "PDF", 72), ee(G, "PDF_TO_CSS_UNITS", G.CSS / G.PDF);
          let f = G;
          t.PixelsPerInch = f;
          class A extends e.BaseFilterFactory {
            constructor({
              docId: at,
              ownerDocument: pt = globalThis.document
            } = {}) {
              super();
              W(this, y);
              W(this, B);
              W(this, it);
              W(this, lt);
              W(this, mt);
              W(this, kt);
              W(this, St);
              W(this, V, void 0);
              W(this, H, void 0);
              W(this, st, void 0);
              W(this, dt, void 0);
              W(this, yt, void 0);
              W(this, gt, void 0);
              W(this, k, void 0);
              W(this, l, void 0);
              W(this, u, void 0);
              W(this, d, void 0);
              W(this, b, 0);
              ot(this, st, at), ot(this, dt, pt);
            }
            addFilter(at) {
              if (!at)
                return "none";
              let pt = r(this, y, de).get(at);
              if (pt)
                return pt;
              let Ct, Tt, Bt, Wt;
              if (at.length === 1) {
                const qt = at[0], Vt = new Array(256);
                for (let ut = 0; ut < 256; ut++)
                  Vt[ut] = qt[ut] / 255;
                Wt = Ct = Tt = Bt = Vt.join(",");
              } else {
                const [qt, Vt, ut] = at, nt = new Array(256), Q = new Array(256), At = new Array(256);
                for (let wt = 0; wt < 256; wt++)
                  nt[wt] = qt[wt] / 255, Q[wt] = Vt[wt] / 255, At[wt] = ut[wt] / 255;
                Ct = nt.join(","), Tt = Q.join(","), Bt = At.join(","), Wt = `${Ct}${Tt}${Bt}`;
              }
              if (pt = r(this, y, de).get(Wt), pt)
                return r(this, y, de).set(at, pt), pt;
              const jt = `g_${r(this, st)}_transfer_map_${ge(this, b)._++}`, zt = `url(#${jt})`;
              r(this, y, de).set(at, zt), r(this, y, de).set(Wt, zt);
              const Gt = J(this, lt, ke).call(this, jt);
              return J(this, kt, be).call(this, Ct, Tt, Bt, Gt), zt;
            }
            addHCMFilter(at, pt) {
              var Vt;
              const Ct = `${at}-${pt}`;
              if (r(this, gt) === Ct)
                return r(this, k);
              if (ot(this, gt, Ct), ot(this, k, "none"), (Vt = r(this, yt)) == null || Vt.remove(), !at || !pt)
                return r(this, k);
              const Tt = J(this, St, ye).call(this, at);
              at = s.Util.makeHexColor(...Tt);
              const Bt = J(this, St, ye).call(this, pt);
              if (pt = s.Util.makeHexColor(...Bt), r(this, B, ue).style.color = "", at === "#000000" && pt === "#ffffff" || at === pt)
                return r(this, k);
              const Wt = new Array(256);
              for (let ut = 0; ut <= 255; ut++) {
                const nt = ut / 255;
                Wt[ut] = nt <= 0.03928 ? nt / 12.92 : ((nt + 0.055) / 1.055) ** 2.4;
              }
              const jt = Wt.join(","), zt = `g_${r(this, st)}_hcm_filter`, Gt = ot(this, l, J(this, lt, ke).call(this, zt));
              J(this, kt, be).call(this, jt, jt, jt, Gt), J(this, it, Je).call(this, Gt);
              const qt = (ut, nt) => {
                const Q = Tt[ut] / 255, At = Bt[ut] / 255, wt = new Array(nt + 1);
                for (let te = 0; te <= nt; te++)
                  wt[te] = Q + te / nt * (At - Q);
                return wt.join(",");
              };
              return J(this, kt, be).call(this, qt(0, 5), qt(1, 5), qt(2, 5), Gt), ot(this, k, `url(#${zt})`), r(this, k);
            }
            addHighlightHCMFilter(at, pt, Ct, Tt) {
              var At;
              const Bt = `${at}-${pt}-${Ct}-${Tt}`;
              if (r(this, u) === Bt)
                return r(this, d);
              if (ot(this, u, Bt), ot(this, d, "none"), (At = r(this, l)) == null || At.remove(), !at || !pt)
                return r(this, d);
              const [Wt, jt] = [at, pt].map(J(this, St, ye).bind(this));
              let zt = Math.round(0.2126 * Wt[0] + 0.7152 * Wt[1] + 0.0722 * Wt[2]), Gt = Math.round(0.2126 * jt[0] + 0.7152 * jt[1] + 0.0722 * jt[2]), [qt, Vt] = [Ct, Tt].map(J(this, St, ye).bind(this));
              Gt < zt && ([zt, Gt, qt, Vt] = [Gt, zt, Vt, qt]), r(this, B, ue).style.color = "";
              const ut = (wt, te, Qt) => {
                const et = new Array(256), Et = (Gt - zt) / Qt, Ot = wt / 255, Pt = (te - wt) / (255 * Qt);
                let $t = 0;
                for (let Nt = 0; Nt <= Qt; Nt++) {
                  const Jt = Math.round(zt + Nt * Et), vt = Ot + Nt * Pt;
                  for (let Yt = $t; Yt <= Jt; Yt++)
                    et[Yt] = vt;
                  $t = Jt + 1;
                }
                for (let Nt = $t; Nt < 256; Nt++)
                  et[Nt] = et[$t - 1];
                return et.join(",");
              }, nt = `g_${r(this, st)}_hcm_highlight_filter`, Q = ot(this, l, J(this, lt, ke).call(this, nt));
              return J(this, it, Je).call(this, Q), J(this, kt, be).call(this, ut(qt[0], Vt[0], 5), ut(qt[1], Vt[1], 5), ut(qt[2], Vt[2], 5), Q), ot(this, d, `url(#${nt})`), r(this, d);
            }
            destroy(at = !1) {
              at && (r(this, k) || r(this, d)) || (r(this, H) && (r(this, H).parentNode.parentNode.remove(), ot(this, H, null)), r(this, V) && (r(this, V).clear(), ot(this, V, null)), ot(this, b, 0));
            }
          }
          V = new WeakMap(), H = new WeakMap(), st = new WeakMap(), dt = new WeakMap(), yt = new WeakMap(), gt = new WeakMap(), k = new WeakMap(), l = new WeakMap(), u = new WeakMap(), d = new WeakMap(), b = new WeakMap(), y = new WeakSet(), de = function() {
            return r(this, V) || ot(this, V, /* @__PURE__ */ new Map());
          }, B = new WeakSet(), ue = function() {
            if (!r(this, H)) {
              const at = r(this, dt).createElement("div"), {
                style: pt
              } = at;
              pt.visibility = "hidden", pt.contain = "strict", pt.width = pt.height = 0, pt.position = "absolute", pt.top = pt.left = 0, pt.zIndex = -1;
              const Ct = r(this, dt).createElementNS(p, "svg");
              Ct.setAttribute("width", 0), Ct.setAttribute("height", 0), ot(this, H, r(this, dt).createElementNS(p, "defs")), at.append(Ct), Ct.append(r(this, H)), r(this, dt).body.append(at);
            }
            return r(this, H);
          }, it = new WeakSet(), Je = function(at) {
            const pt = r(this, dt).createElementNS(p, "feColorMatrix");
            pt.setAttribute("type", "matrix"), pt.setAttribute("values", "0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"), at.append(pt);
          }, lt = new WeakSet(), ke = function(at) {
            const pt = r(this, dt).createElementNS(p, "filter");
            return pt.setAttribute("color-interpolation-filters", "sRGB"), pt.setAttribute("id", at), r(this, B, ue).append(pt), pt;
          }, mt = new WeakSet(), Te = function(at, pt, Ct) {
            const Tt = r(this, dt).createElementNS(p, pt);
            Tt.setAttribute("type", "discrete"), Tt.setAttribute("tableValues", Ct), at.append(Tt);
          }, kt = new WeakSet(), be = function(at, pt, Ct, Tt) {
            const Bt = r(this, dt).createElementNS(p, "feComponentTransfer");
            Tt.append(Bt), J(this, mt, Te).call(this, Bt, "feFuncR", at), J(this, mt, Te).call(this, Bt, "feFuncG", pt), J(this, mt, Te).call(this, Bt, "feFuncB", Ct);
          }, St = new WeakSet(), ye = function(at) {
            return r(this, B, ue).style.color = at, D(getComputedStyle(r(this, B, ue)).getPropertyValue("color"));
          }, t.DOMFilterFactory = A;
          class a extends e.BaseCanvasFactory {
            constructor({
              ownerDocument: rt = globalThis.document
            } = {}) {
              super(), this._document = rt;
            }
            _createCanvas(rt, at) {
              const pt = this._document.createElement("canvas");
              return pt.width = rt, pt.height = at, pt;
            }
          }
          t.DOMCanvasFactory = a;
          async function h(_t, rt = !1) {
            if (S(_t, document.baseURI)) {
              const at = await fetch(_t);
              if (!at.ok)
                throw new Error(at.statusText);
              return rt ? new Uint8Array(await at.arrayBuffer()) : (0, s.stringToBytes)(await at.text());
            }
            return new Promise((at, pt) => {
              const Ct = new XMLHttpRequest();
              Ct.open("GET", _t, !0), rt && (Ct.responseType = "arraybuffer"), Ct.onreadystatechange = () => {
                if (Ct.readyState === XMLHttpRequest.DONE) {
                  if (Ct.status === 200 || Ct.status === 0) {
                    let Tt;
                    if (rt && Ct.response ? Tt = new Uint8Array(Ct.response) : !rt && Ct.responseText && (Tt = (0, s.stringToBytes)(Ct.responseText)), Tt) {
                      at(Tt);
                      return;
                    }
                  }
                  pt(new Error(Ct.statusText));
                }
              }, Ct.send(null);
            });
          }
          class o extends e.BaseCMapReaderFactory {
            _fetchData(rt, at) {
              return h(rt, this.isCompressed).then((pt) => ({
                cMapData: pt,
                compressionType: at
              }));
            }
          }
          t.DOMCMapReaderFactory = o;
          class F extends e.BaseStandardFontDataFactory {
            _fetchData(rt) {
              return h(rt, !0);
            }
          }
          t.DOMStandardFontDataFactory = F;
          class R extends e.BaseSVGFactory {
            _createSVG(rt) {
              return document.createElementNS(p, rt);
            }
          }
          t.DOMSVGFactory = R;
          class w {
            constructor({
              viewBox: rt,
              scale: at,
              rotation: pt,
              offsetX: Ct = 0,
              offsetY: Tt = 0,
              dontFlip: Bt = !1
            }) {
              this.viewBox = rt, this.scale = at, this.rotation = pt, this.offsetX = Ct, this.offsetY = Tt;
              const Wt = (rt[2] + rt[0]) / 2, jt = (rt[3] + rt[1]) / 2;
              let zt, Gt, qt, Vt;
              switch (pt %= 360, pt < 0 && (pt += 360), pt) {
                case 180:
                  zt = -1, Gt = 0, qt = 0, Vt = 1;
                  break;
                case 90:
                  zt = 0, Gt = 1, qt = 1, Vt = 0;
                  break;
                case 270:
                  zt = 0, Gt = -1, qt = -1, Vt = 0;
                  break;
                case 0:
                  zt = 1, Gt = 0, qt = 0, Vt = -1;
                  break;
                default:
                  throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.");
              }
              Bt && (qt = -qt, Vt = -Vt);
              let ut, nt, Q, At;
              zt === 0 ? (ut = Math.abs(jt - rt[1]) * at + Ct, nt = Math.abs(Wt - rt[0]) * at + Tt, Q = (rt[3] - rt[1]) * at, At = (rt[2] - rt[0]) * at) : (ut = Math.abs(Wt - rt[0]) * at + Ct, nt = Math.abs(jt - rt[1]) * at + Tt, Q = (rt[2] - rt[0]) * at, At = (rt[3] - rt[1]) * at), this.transform = [zt * at, Gt * at, qt * at, Vt * at, ut - zt * at * Wt - qt * at * jt, nt - Gt * at * Wt - Vt * at * jt], this.width = Q, this.height = At;
            }
            get rawDims() {
              const {
                viewBox: rt
              } = this;
              return (0, s.shadow)(this, "rawDims", {
                pageWidth: rt[2] - rt[0],
                pageHeight: rt[3] - rt[1],
                pageX: rt[0],
                pageY: rt[1]
              });
            }
            clone({
              scale: rt = this.scale,
              rotation: at = this.rotation,
              offsetX: pt = this.offsetX,
              offsetY: Ct = this.offsetY,
              dontFlip: Tt = !1
            } = {}) {
              return new w({
                viewBox: this.viewBox.slice(),
                scale: rt,
                rotation: at,
                offsetX: pt,
                offsetY: Ct,
                dontFlip: Tt
              });
            }
            convertToViewportPoint(rt, at) {
              return s.Util.applyTransform([rt, at], this.transform);
            }
            convertToViewportRectangle(rt) {
              const at = s.Util.applyTransform([rt[0], rt[1]], this.transform), pt = s.Util.applyTransform([rt[2], rt[3]], this.transform);
              return [at[0], at[1], pt[0], pt[1]];
            }
            convertToPdfPoint(rt, at) {
              return s.Util.applyInverseTransform([rt, at], this.transform);
            }
          }
          t.PageViewport = w;
          class T extends s.BaseException {
            constructor(rt, at = 0) {
              super(rt, "RenderingCancelledException"), this.extraDelay = at;
            }
          }
          t.RenderingCancelledException = T;
          function P(_t) {
            const rt = _t.length;
            let at = 0;
            for (; at < rt && _t[at].trim() === ""; )
              at++;
            return _t.substring(at, at + 5).toLowerCase() === "data:";
          }
          function m(_t) {
            return typeof _t == "string" && /\.pdf$/i.test(_t);
          }
          function C(_t, rt = !1) {
            return rt || ([_t] = _t.split(/[#?]/, 1)), _t.substring(_t.lastIndexOf("/") + 1);
          }
          function x(_t, rt = "document.pdf") {
            if (typeof _t != "string")
              return rt;
            if (P(_t))
              return (0, s.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'), rt;
            const at = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/, pt = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i, Ct = at.exec(_t);
            let Tt = pt.exec(Ct[1]) || pt.exec(Ct[2]) || pt.exec(Ct[3]);
            if (Tt && (Tt = Tt[0], Tt.includes("%")))
              try {
                Tt = pt.exec(decodeURIComponent(Tt))[0];
              } catch {
              }
            return Tt || rt;
          }
          class E {
            constructor() {
              ee(this, "started", /* @__PURE__ */ Object.create(null));
              ee(this, "times", []);
            }
            time(rt) {
              rt in this.started && (0, s.warn)(`Timer is already running for ${rt}`), this.started[rt] = Date.now();
            }
            timeEnd(rt) {
              rt in this.started || (0, s.warn)(`Timer has not been started for ${rt}`), this.times.push({
                name: rt,
                start: this.started[rt],
                end: Date.now()
              }), delete this.started[rt];
            }
            toString() {
              const rt = [];
              let at = 0;
              for (const {
                name: pt
              } of this.times)
                at = Math.max(pt.length, at);
              for (const {
                name: pt,
                start: Ct,
                end: Tt
              } of this.times)
                rt.push(`${pt.padEnd(at)} ${Tt - Ct}ms
`);
              return rt.join("");
            }
          }
          t.StatTimer = E;
          function S(_t, rt) {
            try {
              const {
                protocol: at
              } = rt ? new URL(_t, rt) : new URL(_t);
              return at === "http:" || at === "https:";
            } catch {
              return !1;
            }
          }
          function g(_t) {
            _t.preventDefault();
          }
          function v(_t, rt = !1) {
            return new Promise((at, pt) => {
              const Ct = document.createElement("script");
              Ct.src = _t, Ct.onload = function(Tt) {
                rt && Ct.remove(), at(Tt);
              }, Ct.onerror = function() {
                pt(new Error(`Cannot load script at: ${Ct.src}`));
              }, (document.head || document.documentElement).append(Ct);
            });
          }
          function $(_t) {
            console.log("Deprecated API usage: " + _t);
          }
          let M;
          class _ {
            static toDateObject(rt) {
              if (!rt || typeof rt != "string")
                return null;
              M || (M = new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));
              const at = M.exec(rt);
              if (!at)
                return null;
              const pt = parseInt(at[1], 10);
              let Ct = parseInt(at[2], 10);
              Ct = Ct >= 1 && Ct <= 12 ? Ct - 1 : 0;
              let Tt = parseInt(at[3], 10);
              Tt = Tt >= 1 && Tt <= 31 ? Tt : 1;
              let Bt = parseInt(at[4], 10);
              Bt = Bt >= 0 && Bt <= 23 ? Bt : 0;
              let Wt = parseInt(at[5], 10);
              Wt = Wt >= 0 && Wt <= 59 ? Wt : 0;
              let jt = parseInt(at[6], 10);
              jt = jt >= 0 && jt <= 59 ? jt : 0;
              const zt = at[7] || "Z";
              let Gt = parseInt(at[8], 10);
              Gt = Gt >= 0 && Gt <= 23 ? Gt : 0;
              let qt = parseInt(at[9], 10) || 0;
              return qt = qt >= 0 && qt <= 59 ? qt : 0, zt === "-" ? (Bt += Gt, Wt += qt) : zt === "+" && (Bt -= Gt, Wt -= qt), new Date(Date.UTC(pt, Ct, Tt, Bt, Wt, jt));
            }
          }
          t.PDFDateString = _;
          function N(_t, {
            scale: rt = 1,
            rotation: at = 0
          }) {
            const {
              width: pt,
              height: Ct
            } = _t.attributes.style, Tt = [0, 0, parseInt(pt), parseInt(Ct)];
            return new w({
              viewBox: Tt,
              scale: rt,
              rotation: at
            });
          }
          function D(_t) {
            if (_t.startsWith("#")) {
              const rt = parseInt(_t.slice(1), 16);
              return [(rt & 16711680) >> 16, (rt & 65280) >> 8, rt & 255];
            }
            return _t.startsWith("rgb(") ? _t.slice(4, -1).split(",").map((rt) => parseInt(rt)) : _t.startsWith("rgba(") ? _t.slice(5, -1).split(",").map((rt) => parseInt(rt)).slice(0, 3) : ((0, s.warn)(`Not a valid color format: "${_t}"`), [0, 0, 0]);
          }
          function X(_t) {
            const rt = document.createElement("span");
            rt.style.visibility = "hidden", document.body.append(rt);
            for (const at of _t.keys()) {
              rt.style.color = at;
              const pt = window.getComputedStyle(rt).color;
              _t.set(at, D(pt));
            }
            rt.remove();
          }
          function Y(_t) {
            const {
              a: rt,
              b: at,
              c: pt,
              d: Ct,
              e: Tt,
              f: Bt
            } = _t.getTransform();
            return [rt, at, pt, Ct, Tt, Bt];
          }
          function I(_t) {
            const {
              a: rt,
              b: at,
              c: pt,
              d: Ct,
              e: Tt,
              f: Bt
            } = _t.getTransform().invertSelf();
            return [rt, at, pt, Ct, Tt, Bt];
          }
          function U(_t, rt, at = !1, pt = !0) {
            if (rt instanceof w) {
              const {
                pageWidth: Ct,
                pageHeight: Tt
              } = rt.rawDims, {
                style: Bt
              } = _t, Wt = s.FeatureTest.isCSSRoundSupported, jt = `var(--scale-factor) * ${Ct}px`, zt = `var(--scale-factor) * ${Tt}px`, Gt = Wt ? `round(${jt}, 1px)` : `calc(${jt})`, qt = Wt ? `round(${zt}, 1px)` : `calc(${zt})`;
              !at || rt.rotation % 180 === 0 ? (Bt.width = Gt, Bt.height = qt) : (Bt.width = qt, Bt.height = Gt);
            }
            pt && _t.setAttribute("data-main-rotation", rt.rotation);
          }
        },
        /* 7 */
        /***/
        (i, t, n) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.BaseStandardFontDataFactory = t.BaseSVGFactory = t.BaseFilterFactory = t.BaseCanvasFactory = t.BaseCMapReaderFactory = void 0;
          var e = n(1);
          class s {
            constructor() {
              this.constructor === s && (0, e.unreachable)("Cannot initialize BaseFilterFactory.");
            }
            addFilter(o) {
              return "none";
            }
            addHCMFilter(o, F) {
              return "none";
            }
            addHighlightHCMFilter(o, F, R, w) {
              return "none";
            }
            destroy(o = !1) {
            }
          }
          t.BaseFilterFactory = s;
          class p {
            constructor() {
              this.constructor === p && (0, e.unreachable)("Cannot initialize BaseCanvasFactory.");
            }
            create(o, F) {
              if (o <= 0 || F <= 0)
                throw new Error("Invalid canvas size");
              const R = this._createCanvas(o, F);
              return {
                canvas: R,
                context: R.getContext("2d")
              };
            }
            reset(o, F, R) {
              if (!o.canvas)
                throw new Error("Canvas is not specified");
              if (F <= 0 || R <= 0)
                throw new Error("Invalid canvas size");
              o.canvas.width = F, o.canvas.height = R;
            }
            destroy(o) {
              if (!o.canvas)
                throw new Error("Canvas is not specified");
              o.canvas.width = 0, o.canvas.height = 0, o.canvas = null, o.context = null;
            }
            _createCanvas(o, F) {
              (0, e.unreachable)("Abstract method `_createCanvas` called.");
            }
          }
          t.BaseCanvasFactory = p;
          class f {
            constructor({
              baseUrl: o = null,
              isCompressed: F = !0
            }) {
              this.constructor === f && (0, e.unreachable)("Cannot initialize BaseCMapReaderFactory."), this.baseUrl = o, this.isCompressed = F;
            }
            async fetch({
              name: o
            }) {
              if (!this.baseUrl)
                throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');
              if (!o)
                throw new Error("CMap name must be specified.");
              const F = this.baseUrl + o + (this.isCompressed ? ".bcmap" : ""), R = this.isCompressed ? e.CMapCompressionType.BINARY : e.CMapCompressionType.NONE;
              return this._fetchData(F, R).catch((w) => {
                throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${F}`);
              });
            }
            _fetchData(o, F) {
              (0, e.unreachable)("Abstract method `_fetchData` called.");
            }
          }
          t.BaseCMapReaderFactory = f;
          class A {
            constructor({
              baseUrl: o = null
            }) {
              this.constructor === A && (0, e.unreachable)("Cannot initialize BaseStandardFontDataFactory."), this.baseUrl = o;
            }
            async fetch({
              filename: o
            }) {
              if (!this.baseUrl)
                throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');
              if (!o)
                throw new Error("Font filename must be specified.");
              const F = `${this.baseUrl}${o}`;
              return this._fetchData(F).catch((R) => {
                throw new Error(`Unable to load font data at: ${F}`);
              });
            }
            _fetchData(o) {
              (0, e.unreachable)("Abstract method `_fetchData` called.");
            }
          }
          t.BaseStandardFontDataFactory = A;
          class a {
            constructor() {
              this.constructor === a && (0, e.unreachable)("Cannot initialize BaseSVGFactory.");
            }
            create(o, F, R = !1) {
              if (o <= 0 || F <= 0)
                throw new Error("Invalid SVG dimensions");
              const w = this._createSVG("svg:svg");
              return w.setAttribute("version", "1.1"), R || (w.setAttribute("width", `${o}px`), w.setAttribute("height", `${F}px`)), w.setAttribute("preserveAspectRatio", "none"), w.setAttribute("viewBox", `0 0 ${o} ${F}`), w;
            }
            createElement(o) {
              if (typeof o != "string")
                throw new Error("Invalid SVG element type");
              return this._createSVG(o);
            }
            _createSVG(o) {
              (0, e.unreachable)("Abstract method `_createSVG` called.");
            }
          }
          t.BaseSVGFactory = a;
        },
        /* 8 */
        /***/
        (i, t, n) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.MurmurHash3_64 = void 0;
          var e = n(1);
          const s = 3285377520, p = 4294901760, f = 65535;
          class A {
            constructor(h) {
              this.h1 = h ? h & 4294967295 : s, this.h2 = h ? h & 4294967295 : s;
            }
            update(h) {
              let o, F;
              if (typeof h == "string") {
                o = new Uint8Array(h.length * 2), F = 0;
                for (let $ = 0, M = h.length; $ < M; $++) {
                  const _ = h.charCodeAt($);
                  _ <= 255 ? o[F++] = _ : (o[F++] = _ >>> 8, o[F++] = _ & 255);
                }
              } else if ((0, e.isArrayBuffer)(h))
                o = h.slice(), F = o.byteLength;
              else
                throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");
              const R = F >> 2, w = F - R * 4, T = new Uint32Array(o.buffer, 0, R);
              let P = 0, m = 0, C = this.h1, x = this.h2;
              const E = 3432918353, S = 461845907, g = E & f, v = S & f;
              for (let $ = 0; $ < R; $++)
                $ & 1 ? (P = T[$], P = P * E & p | P * g & f, P = P << 15 | P >>> 17, P = P * S & p | P * v & f, C ^= P, C = C << 13 | C >>> 19, C = C * 5 + 3864292196) : (m = T[$], m = m * E & p | m * g & f, m = m << 15 | m >>> 17, m = m * S & p | m * v & f, x ^= m, x = x << 13 | x >>> 19, x = x * 5 + 3864292196);
              switch (P = 0, w) {
                case 3:
                  P ^= o[R * 4 + 2] << 16;
                case 2:
                  P ^= o[R * 4 + 1] << 8;
                case 1:
                  P ^= o[R * 4], P = P * E & p | P * g & f, P = P << 15 | P >>> 17, P = P * S & p | P * v & f, R & 1 ? C ^= P : x ^= P;
              }
              this.h1 = C, this.h2 = x;
            }
            hexdigest() {
              let h = this.h1, o = this.h2;
              return h ^= o >>> 1, h = h * 3981806797 & p | h * 36045 & f, o = o * 4283543511 & p | ((o << 16 | h >>> 16) * 2950163797 & p) >>> 16, h ^= o >>> 1, h = h * 444984403 & p | h * 60499 & f, o = o * 3301882366 & p | ((o << 16 | h >>> 16) * 3120437893 & p) >>> 16, h ^= o >>> 1, (h >>> 0).toString(16).padStart(8, "0") + (o >>> 0).toString(16).padStart(8, "0");
            }
          }
          t.MurmurHash3_64 = A;
        },
        /* 9 */
        /***/
        (i, t, n) => {
          var f;
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.FontLoader = t.FontFaceObject = void 0;
          var e = n(1);
          class s {
            constructor({
              ownerDocument: a = globalThis.document,
              styleElement: h = null
            }) {
              W(this, f, /* @__PURE__ */ new Set());
              this._document = a, this.nativeFontFaces = /* @__PURE__ */ new Set(), this.styleElement = null, this.loadingRequests = [], this.loadTestFontId = 0;
            }
            addNativeFontFace(a) {
              this.nativeFontFaces.add(a), this._document.fonts.add(a);
            }
            removeNativeFontFace(a) {
              this.nativeFontFaces.delete(a), this._document.fonts.delete(a);
            }
            insertRule(a) {
              this.styleElement || (this.styleElement = this._document.createElement("style"), this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));
              const h = this.styleElement.sheet;
              h.insertRule(a, h.cssRules.length);
            }
            clear() {
              for (const a of this.nativeFontFaces)
                this._document.fonts.delete(a);
              this.nativeFontFaces.clear(), r(this, f).clear(), this.styleElement && (this.styleElement.remove(), this.styleElement = null);
            }
            async loadSystemFont(a) {
              if (!(!a || r(this, f).has(a.loadedName))) {
                if ((0, e.assert)(!this.disableFontFace, "loadSystemFont shouldn't be called when `disableFontFace` is set."), this.isFontLoadingAPISupported) {
                  const {
                    loadedName: h,
                    src: o,
                    style: F
                  } = a, R = new FontFace(h, o, F);
                  this.addNativeFontFace(R);
                  try {
                    await R.load(), r(this, f).add(h);
                  } catch {
                    (0, e.warn)(`Cannot load system font: ${a.baseFontName}, installing it could help to improve PDF rendering.`), this.removeNativeFontFace(R);
                  }
                  return;
                }
                (0, e.unreachable)("Not implemented: loadSystemFont without the Font Loading API.");
              }
            }
            async bind(a) {
              if (a.attached || a.missingFile && !a.systemFontInfo)
                return;
              if (a.attached = !0, a.systemFontInfo) {
                await this.loadSystemFont(a.systemFontInfo);
                return;
              }
              if (this.isFontLoadingAPISupported) {
                const o = a.createNativeFontFace();
                if (o) {
                  this.addNativeFontFace(o);
                  try {
                    await o.loaded;
                  } catch (F) {
                    throw (0, e.warn)(`Failed to load font '${o.family}': '${F}'.`), a.disableFontFace = !0, F;
                  }
                }
                return;
              }
              const h = a.createFontFaceRule();
              if (h) {
                if (this.insertRule(h), this.isSyncFontLoadingSupported)
                  return;
                await new Promise((o) => {
                  const F = this._queueLoadingCallback(o);
                  this._prepareFontLoadEvent(a, F);
                });
              }
            }
            get isFontLoadingAPISupported() {
              var h;
              const a = !!((h = this._document) != null && h.fonts);
              return (0, e.shadow)(this, "isFontLoadingAPISupported", a);
            }
            get isSyncFontLoadingSupported() {
              let a = !1;
              return (e.isNodeJS || typeof navigator < "u" && /Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)) && (a = !0), (0, e.shadow)(this, "isSyncFontLoadingSupported", a);
            }
            _queueLoadingCallback(a) {
              function h() {
                for ((0, e.assert)(!F.done, "completeRequest() cannot be called twice."), F.done = !0; o.length > 0 && o[0].done; ) {
                  const R = o.shift();
                  setTimeout(R.callback, 0);
                }
              }
              const {
                loadingRequests: o
              } = this, F = {
                done: !1,
                complete: h,
                callback: a
              };
              return o.push(F), F;
            }
            get _loadTestFont() {
              const a = atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");
              return (0, e.shadow)(this, "_loadTestFont", a);
            }
            _prepareFontLoadEvent(a, h) {
              function o(D, X) {
                return D.charCodeAt(X) << 24 | D.charCodeAt(X + 1) << 16 | D.charCodeAt(X + 2) << 8 | D.charCodeAt(X + 3) & 255;
              }
              function F(D, X, Y, I) {
                const U = D.substring(0, X), G = D.substring(X + Y);
                return U + I + G;
              }
              let R, w;
              const T = this._document.createElement("canvas");
              T.width = 1, T.height = 1;
              const P = T.getContext("2d");
              let m = 0;
              function C(D, X) {
                if (++m > 30) {
                  (0, e.warn)("Load test font never loaded."), X();
                  return;
                }
                if (P.font = "30px " + D, P.fillText(".", 0, 20), P.getImageData(0, 0, 1, 1).data[3] > 0) {
                  X();
                  return;
                }
                setTimeout(C.bind(null, D, X));
              }
              const x = `lt${Date.now()}${this.loadTestFontId++}`;
              let E = this._loadTestFont;
              E = F(E, 976, x.length, x);
              const g = 16, v = 1482184792;
              let $ = o(E, g);
              for (R = 0, w = x.length - 3; R < w; R += 4)
                $ = $ - v + o(x, R) | 0;
              R < x.length && ($ = $ - v + o(x + "XXX", R) | 0), E = F(E, g, 4, (0, e.string32)($));
              const M = `url(data:font/opentype;base64,${btoa(E)});`, _ = `@font-face {font-family:"${x}";src:${M}}`;
              this.insertRule(_);
              const N = this._document.createElement("div");
              N.style.visibility = "hidden", N.style.width = N.style.height = "10px", N.style.position = "absolute", N.style.top = N.style.left = "0px";
              for (const D of [a.loadedName, x]) {
                const X = this._document.createElement("span");
                X.textContent = "Hi", X.style.fontFamily = D, N.append(X);
              }
              this._document.body.append(N), C(x, () => {
                N.remove(), h.complete();
              });
            }
          }
          f = new WeakMap(), t.FontLoader = s;
          class p {
            constructor(a, {
              isEvalSupported: h = !0,
              disableFontFace: o = !1,
              ignoreErrors: F = !1,
              inspectFont: R = null
            }) {
              this.compiledGlyphs = /* @__PURE__ */ Object.create(null);
              for (const w in a)
                this[w] = a[w];
              this.isEvalSupported = h !== !1, this.disableFontFace = o === !0, this.ignoreErrors = F === !0, this._inspectFont = R;
            }
            createNativeFontFace() {
              var h;
              if (!this.data || this.disableFontFace)
                return null;
              let a;
              if (!this.cssFontInfo)
                a = new FontFace(this.loadedName, this.data, {});
              else {
                const o = {
                  weight: this.cssFontInfo.fontWeight
                };
                this.cssFontInfo.italicAngle && (o.style = `oblique ${this.cssFontInfo.italicAngle}deg`), a = new FontFace(this.cssFontInfo.fontFamily, this.data, o);
              }
              return (h = this._inspectFont) == null || h.call(this, this), a;
            }
            createFontFaceRule() {
              var F;
              if (!this.data || this.disableFontFace)
                return null;
              const a = (0, e.bytesToString)(this.data), h = `url(data:${this.mimetype};base64,${btoa(a)});`;
              let o;
              if (!this.cssFontInfo)
                o = `@font-face {font-family:"${this.loadedName}";src:${h}}`;
              else {
                let R = `font-weight: ${this.cssFontInfo.fontWeight};`;
                this.cssFontInfo.italicAngle && (R += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`), o = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${R}src:${h}}`;
              }
              return (F = this._inspectFont) == null || F.call(this, this, h), o;
            }
            getPathGenerator(a, h) {
              if (this.compiledGlyphs[h] !== void 0)
                return this.compiledGlyphs[h];
              let o;
              try {
                o = a.get(this.loadedName + "_path_" + h);
              } catch (F) {
                if (!this.ignoreErrors)
                  throw F;
                return (0, e.warn)(`getPathGenerator - ignoring character: "${F}".`), this.compiledGlyphs[h] = function(R, w) {
                };
              }
              if (this.isEvalSupported && e.FeatureTest.isEvalSupported) {
                const F = [];
                for (const R of o) {
                  const w = R.args !== void 0 ? R.args.join(",") : "";
                  F.push("c.", R.cmd, "(", w, `);
`);
                }
                return this.compiledGlyphs[h] = new Function("c", "size", F.join(""));
              }
              return this.compiledGlyphs[h] = function(F, R) {
                for (const w of o)
                  w.cmd === "scale" && (w.args = [R, -R]), F[w.cmd].apply(F, w.args);
              };
            }
          }
          t.FontFaceObject = p;
        },
        /* 10 */
        /***/
        (i, t, n) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.NodeStandardFontDataFactory = t.NodeFilterFactory = t.NodeCanvasFactory = t.NodeCMapReaderFactory = void 0;
          var e = n(7);
          n(1);
          const s = function(h) {
            return new Promise((o, F) => {
              require$$5.readFile(h, (w, T) => {
                if (w || !T) {
                  F(new Error(w));
                  return;
                }
                o(new Uint8Array(T));
              });
            });
          };
          class p extends e.BaseFilterFactory {
          }
          t.NodeFilterFactory = p;
          class f extends e.BaseCanvasFactory {
            _createCanvas(o, F) {
              return require$$5.createCanvas(o, F);
            }
          }
          t.NodeCanvasFactory = f;
          class A extends e.BaseCMapReaderFactory {
            _fetchData(o, F) {
              return s(o).then((R) => ({
                cMapData: R,
                compressionType: F
              }));
            }
          }
          t.NodeCMapReaderFactory = A;
          class a extends e.BaseStandardFontDataFactory {
            _fetchData(o) {
              return s(o);
            }
          }
          t.NodeStandardFontDataFactory = a;
        },
        /* 11 */
        /***/
        (i, t, n) => {
          var H, Ze, dt, Qe;
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.CanvasGraphics = void 0;
          var e = n(1), s = n(6), p = n(12), f = n(13);
          const A = 16, a = 100, h = 4096, o = 15, F = 10, R = 1e3, w = 16;
          function T(k, l) {
            if (k._removeMirroring)
              throw new Error("Context is already forwarding operations.");
            k.__originalSave = k.save, k.__originalRestore = k.restore, k.__originalRotate = k.rotate, k.__originalScale = k.scale, k.__originalTranslate = k.translate, k.__originalTransform = k.transform, k.__originalSetTransform = k.setTransform, k.__originalResetTransform = k.resetTransform, k.__originalClip = k.clip, k.__originalMoveTo = k.moveTo, k.__originalLineTo = k.lineTo, k.__originalBezierCurveTo = k.bezierCurveTo, k.__originalRect = k.rect, k.__originalClosePath = k.closePath, k.__originalBeginPath = k.beginPath, k._removeMirroring = () => {
              k.save = k.__originalSave, k.restore = k.__originalRestore, k.rotate = k.__originalRotate, k.scale = k.__originalScale, k.translate = k.__originalTranslate, k.transform = k.__originalTransform, k.setTransform = k.__originalSetTransform, k.resetTransform = k.__originalResetTransform, k.clip = k.__originalClip, k.moveTo = k.__originalMoveTo, k.lineTo = k.__originalLineTo, k.bezierCurveTo = k.__originalBezierCurveTo, k.rect = k.__originalRect, k.closePath = k.__originalClosePath, k.beginPath = k.__originalBeginPath, delete k._removeMirroring;
            }, k.save = function() {
              l.save(), this.__originalSave();
            }, k.restore = function() {
              l.restore(), this.__originalRestore();
            }, k.translate = function(d, b) {
              l.translate(d, b), this.__originalTranslate(d, b);
            }, k.scale = function(d, b) {
              l.scale(d, b), this.__originalScale(d, b);
            }, k.transform = function(d, b, y, O, B, z) {
              l.transform(d, b, y, O, B, z), this.__originalTransform(d, b, y, O, B, z);
            }, k.setTransform = function(d, b, y, O, B, z) {
              l.setTransform(d, b, y, O, B, z), this.__originalSetTransform(d, b, y, O, B, z);
            }, k.resetTransform = function() {
              l.resetTransform(), this.__originalResetTransform();
            }, k.rotate = function(d) {
              l.rotate(d), this.__originalRotate(d);
            }, k.clip = function(d) {
              l.clip(d), this.__originalClip(d);
            }, k.moveTo = function(u, d) {
              l.moveTo(u, d), this.__originalMoveTo(u, d);
            }, k.lineTo = function(u, d) {
              l.lineTo(u, d), this.__originalLineTo(u, d);
            }, k.bezierCurveTo = function(u, d, b, y, O, B) {
              l.bezierCurveTo(u, d, b, y, O, B), this.__originalBezierCurveTo(u, d, b, y, O, B);
            }, k.rect = function(u, d, b, y) {
              l.rect(u, d, b, y), this.__originalRect(u, d, b, y);
            }, k.closePath = function() {
              l.closePath(), this.__originalClosePath();
            }, k.beginPath = function() {
              l.beginPath(), this.__originalBeginPath();
            };
          }
          class P {
            constructor(l) {
              this.canvasFactory = l, this.cache = /* @__PURE__ */ Object.create(null);
            }
            getCanvas(l, u, d) {
              let b;
              return this.cache[l] !== void 0 ? (b = this.cache[l], this.canvasFactory.reset(b, u, d)) : (b = this.canvasFactory.create(u, d), this.cache[l] = b), b;
            }
            delete(l) {
              delete this.cache[l];
            }
            clear() {
              for (const l in this.cache) {
                const u = this.cache[l];
                this.canvasFactory.destroy(u), delete this.cache[l];
              }
            }
          }
          function m(k, l, u, d, b, y, O, B, z, it) {
            const [Z, lt, ht, mt, ft, kt] = (0, s.getCurrentTransform)(k);
            if (lt === 0 && ht === 0) {
              const It = O * Z + ft, _t = Math.round(It), rt = B * mt + kt, at = Math.round(rt), pt = (O + z) * Z + ft, Ct = Math.abs(Math.round(pt) - _t) || 1, Tt = (B + it) * mt + kt, Bt = Math.abs(Math.round(Tt) - at) || 1;
              return k.setTransform(Math.sign(Z), 0, 0, Math.sign(mt), _t, at), k.drawImage(l, u, d, b, y, 0, 0, Ct, Bt), k.setTransform(Z, lt, ht, mt, ft, kt), [Ct, Bt];
            }
            if (Z === 0 && mt === 0) {
              const It = B * ht + ft, _t = Math.round(It), rt = O * lt + kt, at = Math.round(rt), pt = (B + it) * ht + ft, Ct = Math.abs(Math.round(pt) - _t) || 1, Tt = (O + z) * lt + kt, Bt = Math.abs(Math.round(Tt) - at) || 1;
              return k.setTransform(0, Math.sign(lt), Math.sign(ht), 0, _t, at), k.drawImage(l, u, d, b, y, 0, 0, Bt, Ct), k.setTransform(Z, lt, ht, mt, ft, kt), [Bt, Ct];
            }
            k.drawImage(l, u, d, b, y, O, B, z, it);
            const Rt = Math.hypot(Z, lt), St = Math.hypot(ht, mt);
            return [Rt * z, St * it];
          }
          function C(k) {
            const {
              width: l,
              height: u
            } = k;
            if (l > R || u > R)
              return null;
            const d = 1e3, b = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]), y = l + 1;
            let O = new Uint8Array(y * (u + 1)), B, z, it;
            const Z = l + 7 & -8;
            let lt = new Uint8Array(Z * u), ht = 0;
            for (const St of k.data) {
              let It = 128;
              for (; It > 0; )
                lt[ht++] = St & It ? 0 : 255, It >>= 1;
            }
            let mt = 0;
            for (ht = 0, lt[ht] !== 0 && (O[0] = 1, ++mt), z = 1; z < l; z++)
              lt[ht] !== lt[ht + 1] && (O[z] = lt[ht] ? 2 : 1, ++mt), ht++;
            for (lt[ht] !== 0 && (O[z] = 2, ++mt), B = 1; B < u; B++) {
              ht = B * Z, it = B * y, lt[ht - Z] !== lt[ht] && (O[it] = lt[ht] ? 1 : 8, ++mt);
              let St = (lt[ht] ? 4 : 0) + (lt[ht - Z] ? 8 : 0);
              for (z = 1; z < l; z++)
                St = (St >> 2) + (lt[ht + 1] ? 4 : 0) + (lt[ht - Z + 1] ? 8 : 0), b[St] && (O[it + z] = b[St], ++mt), ht++;
              if (lt[ht - Z] !== lt[ht] && (O[it + z] = lt[ht] ? 2 : 4, ++mt), mt > d)
                return null;
            }
            for (ht = Z * (u - 1), it = B * y, lt[ht] !== 0 && (O[it] = 8, ++mt), z = 1; z < l; z++)
              lt[ht] !== lt[ht + 1] && (O[it + z] = lt[ht] ? 4 : 8, ++mt), ht++;
            if (lt[ht] !== 0 && (O[it + z] = 4, ++mt), mt > d)
              return null;
            const ft = new Int32Array([0, y, -1, 0, -y, 0, 0, 0, 1]), kt = new Path2D();
            for (B = 0; mt && B <= u; B++) {
              let St = B * y;
              const It = St + l;
              for (; St < It && !O[St]; )
                St++;
              if (St === It)
                continue;
              kt.moveTo(St % y, B);
              const _t = St;
              let rt = O[St];
              do {
                const at = ft[rt];
                do
                  St += at;
                while (!O[St]);
                const pt = O[St];
                pt !== 5 && pt !== 10 ? (rt = pt, O[St] = 0) : (rt = pt & 51 * rt >> 4, O[St] &= rt >> 2 | rt << 2), kt.lineTo(St % y, St / y | 0), O[St] || --mt;
              } while (_t !== St);
              --B;
            }
            return lt = null, O = null, function(St) {
              St.save(), St.scale(1 / l, -1 / u), St.translate(0, -u), St.fill(kt), St.beginPath(), St.restore();
            };
          }
          class x {
            constructor(l, u) {
              this.alphaIsShape = !1, this.fontSize = 0, this.fontSizeScale = 1, this.textMatrix = e.IDENTITY_MATRIX, this.textMatrixScale = 1, this.fontMatrix = e.FONT_IDENTITY_MATRIX, this.leading = 0, this.x = 0, this.y = 0, this.lineX = 0, this.lineY = 0, this.charSpacing = 0, this.wordSpacing = 0, this.textHScale = 1, this.textRenderingMode = e.TextRenderingMode.FILL, this.textRise = 0, this.fillColor = "#000000", this.strokeColor = "#000000", this.patternFill = !1, this.fillAlpha = 1, this.strokeAlpha = 1, this.lineWidth = 1, this.activeSMask = null, this.transferMaps = "none", this.startNewPathAndClipBox([0, 0, l, u]);
            }
            clone() {
              const l = Object.create(this);
              return l.clipBox = this.clipBox.slice(), l;
            }
            setCurrentPoint(l, u) {
              this.x = l, this.y = u;
            }
            updatePathMinMax(l, u, d) {
              [u, d] = e.Util.applyTransform([u, d], l), this.minX = Math.min(this.minX, u), this.minY = Math.min(this.minY, d), this.maxX = Math.max(this.maxX, u), this.maxY = Math.max(this.maxY, d);
            }
            updateRectMinMax(l, u) {
              const d = e.Util.applyTransform(u, l), b = e.Util.applyTransform(u.slice(2), l);
              this.minX = Math.min(this.minX, d[0], b[0]), this.minY = Math.min(this.minY, d[1], b[1]), this.maxX = Math.max(this.maxX, d[0], b[0]), this.maxY = Math.max(this.maxY, d[1], b[1]);
            }
            updateScalingPathMinMax(l, u) {
              e.Util.scaleMinMax(l, u), this.minX = Math.min(this.minX, u[0]), this.maxX = Math.max(this.maxX, u[1]), this.minY = Math.min(this.minY, u[2]), this.maxY = Math.max(this.maxY, u[3]);
            }
            updateCurvePathMinMax(l, u, d, b, y, O, B, z, it, Z) {
              const lt = e.Util.bezierBoundingBox(u, d, b, y, O, B, z, it);
              if (Z) {
                Z[0] = Math.min(Z[0], lt[0], lt[2]), Z[1] = Math.max(Z[1], lt[0], lt[2]), Z[2] = Math.min(Z[2], lt[1], lt[3]), Z[3] = Math.max(Z[3], lt[1], lt[3]);
                return;
              }
              this.updateRectMinMax(l, lt);
            }
            getPathBoundingBox(l = p.PathType.FILL, u = null) {
              const d = [this.minX, this.minY, this.maxX, this.maxY];
              if (l === p.PathType.STROKE) {
                u || (0, e.unreachable)("Stroke bounding box must include transform.");
                const b = e.Util.singularValueDecompose2dScale(u), y = b[0] * this.lineWidth / 2, O = b[1] * this.lineWidth / 2;
                d[0] -= y, d[1] -= O, d[2] += y, d[3] += O;
              }
              return d;
            }
            updateClipFromPath() {
              const l = e.Util.intersect(this.clipBox, this.getPathBoundingBox());
              this.startNewPathAndClipBox(l || [0, 0, 0, 0]);
            }
            isEmptyClip() {
              return this.minX === 1 / 0;
            }
            startNewPathAndClipBox(l) {
              this.clipBox = l, this.minX = 1 / 0, this.minY = 1 / 0, this.maxX = 0, this.maxY = 0;
            }
            getClippedPathBoundingBox(l = p.PathType.FILL, u = null) {
              return e.Util.intersect(this.clipBox, this.getPathBoundingBox(l, u));
            }
          }
          function E(k, l) {
            if (typeof ImageData < "u" && l instanceof ImageData) {
              k.putImageData(l, 0, 0);
              return;
            }
            const u = l.height, d = l.width, b = u % w, y = (u - b) / w, O = b === 0 ? y : y + 1, B = k.createImageData(d, w);
            let z = 0, it;
            const Z = l.data, lt = B.data;
            let ht, mt, ft, kt;
            if (l.kind === e.ImageKind.GRAYSCALE_1BPP) {
              const Rt = Z.byteLength, St = new Uint32Array(lt.buffer, 0, lt.byteLength >> 2), It = St.length, _t = d + 7 >> 3, rt = 4294967295, at = e.FeatureTest.isLittleEndian ? 4278190080 : 255;
              for (ht = 0; ht < O; ht++) {
                for (ft = ht < y ? w : b, it = 0, mt = 0; mt < ft; mt++) {
                  const pt = Rt - z;
                  let Ct = 0;
                  const Tt = pt > _t ? d : pt * 8 - 7, Bt = Tt & -8;
                  let Wt = 0, jt = 0;
                  for (; Ct < Bt; Ct += 8)
                    jt = Z[z++], St[it++] = jt & 128 ? rt : at, St[it++] = jt & 64 ? rt : at, St[it++] = jt & 32 ? rt : at, St[it++] = jt & 16 ? rt : at, St[it++] = jt & 8 ? rt : at, St[it++] = jt & 4 ? rt : at, St[it++] = jt & 2 ? rt : at, St[it++] = jt & 1 ? rt : at;
                  for (; Ct < Tt; Ct++)
                    Wt === 0 && (jt = Z[z++], Wt = 128), St[it++] = jt & Wt ? rt : at, Wt >>= 1;
                }
                for (; it < It; )
                  St[it++] = 0;
                k.putImageData(B, 0, ht * w);
              }
            } else if (l.kind === e.ImageKind.RGBA_32BPP) {
              for (mt = 0, kt = d * w * 4, ht = 0; ht < y; ht++)
                lt.set(Z.subarray(z, z + kt)), z += kt, k.putImageData(B, 0, mt), mt += w;
              ht < O && (kt = d * b * 4, lt.set(Z.subarray(z, z + kt)), k.putImageData(B, 0, mt));
            } else if (l.kind === e.ImageKind.RGB_24BPP)
              for (ft = w, kt = d * ft, ht = 0; ht < O; ht++) {
                for (ht >= y && (ft = b, kt = d * ft), it = 0, mt = kt; mt--; )
                  lt[it++] = Z[z++], lt[it++] = Z[z++], lt[it++] = Z[z++], lt[it++] = 255;
                k.putImageData(B, 0, ht * w);
              }
            else
              throw new Error(`bad image kind: ${l.kind}`);
          }
          function S(k, l) {
            if (l.bitmap) {
              k.drawImage(l.bitmap, 0, 0);
              return;
            }
            const u = l.height, d = l.width, b = u % w, y = (u - b) / w, O = b === 0 ? y : y + 1, B = k.createImageData(d, w);
            let z = 0;
            const it = l.data, Z = B.data;
            for (let lt = 0; lt < O; lt++) {
              const ht = lt < y ? w : b;
              ({
                srcPos: z
              } = (0, f.convertBlackAndWhiteToRGBA)({
                src: it,
                srcPos: z,
                dest: Z,
                width: d,
                height: ht,
                nonBlackColor: 0
              })), k.putImageData(B, 0, lt * w);
            }
          }
          function g(k, l) {
            const u = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font", "filter"];
            for (const d of u)
              k[d] !== void 0 && (l[d] = k[d]);
            k.setLineDash !== void 0 && (l.setLineDash(k.getLineDash()), l.lineDashOffset = k.lineDashOffset);
          }
          function v(k) {
            if (k.strokeStyle = k.fillStyle = "#000000", k.fillRule = "nonzero", k.globalAlpha = 1, k.lineWidth = 1, k.lineCap = "butt", k.lineJoin = "miter", k.miterLimit = 10, k.globalCompositeOperation = "source-over", k.font = "10px sans-serif", k.setLineDash !== void 0 && (k.setLineDash([]), k.lineDashOffset = 0), !e.isNodeJS) {
              const {
                filter: l
              } = k;
              l !== "none" && l !== "" && (k.filter = "none");
            }
          }
          function $(k, l, u, d) {
            const b = k.length;
            for (let y = 3; y < b; y += 4) {
              const O = k[y];
              if (O === 0)
                k[y - 3] = l, k[y - 2] = u, k[y - 1] = d;
              else if (O < 255) {
                const B = 255 - O;
                k[y - 3] = k[y - 3] * O + l * B >> 8, k[y - 2] = k[y - 2] * O + u * B >> 8, k[y - 1] = k[y - 1] * O + d * B >> 8;
              }
            }
          }
          function M(k, l, u) {
            const d = k.length, b = 1 / 255;
            for (let y = 3; y < d; y += 4) {
              const O = u ? u[k[y]] : k[y];
              l[y] = l[y] * O * b | 0;
            }
          }
          function _(k, l, u) {
            const d = k.length;
            for (let b = 3; b < d; b += 4) {
              const y = k[b - 3] * 77 + k[b - 2] * 152 + k[b - 1] * 28;
              l[b] = u ? l[b] * u[y >> 8] >> 8 : l[b] * y >> 16;
            }
          }
          function N(k, l, u, d, b, y, O, B, z, it, Z) {
            const lt = !!y, ht = lt ? y[0] : 0, mt = lt ? y[1] : 0, ft = lt ? y[2] : 0, kt = b === "Luminosity" ? _ : M, St = Math.min(d, Math.ceil(1048576 / u));
            for (let It = 0; It < d; It += St) {
              const _t = Math.min(St, d - It), rt = k.getImageData(B - it, It + (z - Z), u, _t), at = l.getImageData(B, It + z, u, _t);
              lt && $(rt.data, ht, mt, ft), kt(rt.data, at.data, O), l.putImageData(at, B, It + z);
            }
          }
          function D(k, l, u, d) {
            const b = d[0], y = d[1], O = d[2] - b, B = d[3] - y;
            O === 0 || B === 0 || (N(l.context, u, O, B, l.subtype, l.backdrop, l.transferMap, b, y, l.offsetX, l.offsetY), k.save(), k.globalAlpha = 1, k.globalCompositeOperation = "source-over", k.setTransform(1, 0, 0, 1, 0, 0), k.drawImage(u.canvas, 0, 0), k.restore());
          }
          function X(k, l) {
            const u = e.Util.singularValueDecompose2dScale(k);
            u[0] = Math.fround(u[0]), u[1] = Math.fround(u[1]);
            const d = Math.fround((globalThis.devicePixelRatio || 1) * s.PixelsPerInch.PDF_TO_CSS_UNITS);
            return l !== void 0 ? l : u[0] <= d || u[1] <= d;
          }
          const Y = ["butt", "round", "square"], I = ["miter", "round", "bevel"], U = {}, G = {}, gt = class gt {
            constructor(l, u, d, b, y, {
              optionalContentConfig: O,
              markedContentStack: B = null
            }, z, it) {
              W(this, H);
              W(this, dt);
              this.ctx = l, this.current = new x(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = u, this.objs = d, this.canvasFactory = b, this.filterFactory = y, this.groupStack = [], this.processingType3 = null, this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = B || [], this.optionalContentConfig = O, this.cachedCanvases = new P(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = z, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.pageColors = it, this._cachedScaleForStroking = [-1, 0], this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
            }
            getObject(l, u = null) {
              return typeof l == "string" ? l.startsWith("g_") ? this.commonObjs.get(l) : this.objs.get(l) : u;
            }
            beginDrawing({
              transform: l,
              viewport: u,
              transparency: d = !1,
              background: b = null
            }) {
              const y = this.ctx.canvas.width, O = this.ctx.canvas.height, B = this.ctx.fillStyle;
              if (this.ctx.fillStyle = b || "#ffffff", this.ctx.fillRect(0, 0, y, O), this.ctx.fillStyle = B, d) {
                const z = this.cachedCanvases.getCanvas("transparent", y, O);
                this.compositeCtx = this.ctx, this.transparentCanvas = z.canvas, this.ctx = z.context, this.ctx.save(), this.ctx.transform(...(0, s.getCurrentTransform)(this.compositeCtx));
              }
              this.ctx.save(), v(this.ctx), l && (this.ctx.transform(...l), this.outputScaleX = l[0], this.outputScaleY = l[0]), this.ctx.transform(...u.transform), this.viewportScale = u.scale, this.baseTransform = (0, s.getCurrentTransform)(this.ctx);
            }
            executeOperatorList(l, u, d, b) {
              const y = l.argsArray, O = l.fnArray;
              let B = u || 0;
              const z = y.length;
              if (z === B)
                return B;
              const it = z - B > F && typeof d == "function", Z = it ? Date.now() + o : 0;
              let lt = 0;
              const ht = this.commonObjs, mt = this.objs;
              let ft;
              for (; ; ) {
                if (b !== void 0 && B === b.nextBreakPoint)
                  return b.breakIt(B, d), B;
                if (ft = O[B], ft !== e.OPS.dependency)
                  this[ft].apply(this, y[B]);
                else
                  for (const kt of y[B]) {
                    const Rt = kt.startsWith("g_") ? ht : mt;
                    if (!Rt.has(kt))
                      return Rt.get(kt, d), B;
                  }
                if (B++, B === z)
                  return B;
                if (it && ++lt > F) {
                  if (Date.now() > Z)
                    return d(), B;
                  lt = 0;
                }
              }
            }
            endDrawing() {
              J(this, H, Ze).call(this), this.cachedCanvases.clear(), this.cachedPatterns.clear();
              for (const l of this._cachedBitmapsMap.values()) {
                for (const u of l.values())
                  typeof HTMLCanvasElement < "u" && u instanceof HTMLCanvasElement && (u.width = u.height = 0);
                l.clear();
              }
              this._cachedBitmapsMap.clear(), J(this, dt, Qe).call(this);
            }
            _scaleImage(l, u) {
              const d = l.width, b = l.height;
              let y = Math.max(Math.hypot(u[0], u[1]), 1), O = Math.max(Math.hypot(u[2], u[3]), 1), B = d, z = b, it = "prescale1", Z, lt;
              for (; y > 2 && B > 1 || O > 2 && z > 1; ) {
                let ht = B, mt = z;
                y > 2 && B > 1 && (ht = B >= 16384 ? Math.floor(B / 2) - 1 || 1 : Math.ceil(B / 2), y /= B / ht), O > 2 && z > 1 && (mt = z >= 16384 ? Math.floor(z / 2) - 1 || 1 : Math.ceil(z) / 2, O /= z / mt), Z = this.cachedCanvases.getCanvas(it, ht, mt), lt = Z.context, lt.clearRect(0, 0, ht, mt), lt.drawImage(l, 0, 0, B, z, 0, 0, ht, mt), l = Z.canvas, B = ht, z = mt, it = it === "prescale1" ? "prescale2" : "prescale1";
              }
              return {
                img: l,
                paintWidth: B,
                paintHeight: z
              };
            }
            _createMaskCanvas(l) {
              const u = this.ctx, {
                width: d,
                height: b
              } = l, y = this.current.fillColor, O = this.current.patternFill, B = (0, s.getCurrentTransform)(u);
              let z, it, Z, lt;
              if ((l.bitmap || l.data) && l.count > 1) {
                const Ct = l.bitmap || l.data.buffer;
                it = JSON.stringify(O ? B : [B.slice(0, 4), y]), z = this._cachedBitmapsMap.get(Ct), z || (z = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(Ct, z));
                const Tt = z.get(it);
                if (Tt && !O) {
                  const Bt = Math.round(Math.min(B[0], B[2]) + B[4]), Wt = Math.round(Math.min(B[1], B[3]) + B[5]);
                  return {
                    canvas: Tt,
                    offsetX: Bt,
                    offsetY: Wt
                  };
                }
                Z = Tt;
              }
              Z || (lt = this.cachedCanvases.getCanvas("maskCanvas", d, b), S(lt.context, l));
              let ht = e.Util.transform(B, [1 / d, 0, 0, -1 / b, 0, 0]);
              ht = e.Util.transform(ht, [1, 0, 0, 1, 0, -b]);
              const mt = e.Util.applyTransform([0, 0], ht), ft = e.Util.applyTransform([d, b], ht), kt = e.Util.normalizeRect([mt[0], mt[1], ft[0], ft[1]]), Rt = Math.round(kt[2] - kt[0]) || 1, St = Math.round(kt[3] - kt[1]) || 1, It = this.cachedCanvases.getCanvas("fillCanvas", Rt, St), _t = It.context, rt = Math.min(mt[0], ft[0]), at = Math.min(mt[1], ft[1]);
              _t.translate(-rt, -at), _t.transform(...ht), Z || (Z = this._scaleImage(lt.canvas, (0, s.getCurrentTransformInverse)(_t)), Z = Z.img, z && O && z.set(it, Z)), _t.imageSmoothingEnabled = X((0, s.getCurrentTransform)(_t), l.interpolate), m(_t, Z, 0, 0, Z.width, Z.height, 0, 0, d, b), _t.globalCompositeOperation = "source-in";
              const pt = e.Util.transform((0, s.getCurrentTransformInverse)(_t), [1, 0, 0, 1, -rt, -at]);
              return _t.fillStyle = O ? y.getPattern(u, this, pt, p.PathType.FILL) : y, _t.fillRect(0, 0, d, b), z && !O && (this.cachedCanvases.delete("fillCanvas"), z.set(it, It.canvas)), {
                canvas: It.canvas,
                offsetX: Math.round(rt),
                offsetY: Math.round(at)
              };
            }
            setLineWidth(l) {
              l !== this.current.lineWidth && (this._cachedScaleForStroking[0] = -1), this.current.lineWidth = l, this.ctx.lineWidth = l;
            }
            setLineCap(l) {
              this.ctx.lineCap = Y[l];
            }
            setLineJoin(l) {
              this.ctx.lineJoin = I[l];
            }
            setMiterLimit(l) {
              this.ctx.miterLimit = l;
            }
            setDash(l, u) {
              const d = this.ctx;
              d.setLineDash !== void 0 && (d.setLineDash(l), d.lineDashOffset = u);
            }
            setRenderingIntent(l) {
            }
            setFlatness(l) {
            }
            setGState(l) {
              for (const [u, d] of l)
                switch (u) {
                  case "LW":
                    this.setLineWidth(d);
                    break;
                  case "LC":
                    this.setLineCap(d);
                    break;
                  case "LJ":
                    this.setLineJoin(d);
                    break;
                  case "ML":
                    this.setMiterLimit(d);
                    break;
                  case "D":
                    this.setDash(d[0], d[1]);
                    break;
                  case "RI":
                    this.setRenderingIntent(d);
                    break;
                  case "FL":
                    this.setFlatness(d);
                    break;
                  case "Font":
                    this.setFont(d[0], d[1]);
                    break;
                  case "CA":
                    this.current.strokeAlpha = d;
                    break;
                  case "ca":
                    this.current.fillAlpha = d, this.ctx.globalAlpha = d;
                    break;
                  case "BM":
                    this.ctx.globalCompositeOperation = d;
                    break;
                  case "SMask":
                    this.current.activeSMask = d ? this.tempSMask : null, this.tempSMask = null, this.checkSMaskState();
                    break;
                  case "TR":
                    this.ctx.filter = this.current.transferMaps = this.filterFactory.addFilter(d);
                    break;
                }
            }
            get inSMaskMode() {
              return !!this.suspendedCtx;
            }
            checkSMaskState() {
              const l = this.inSMaskMode;
              this.current.activeSMask && !l ? this.beginSMaskMode() : !this.current.activeSMask && l && this.endSMaskMode();
            }
            beginSMaskMode() {
              if (this.inSMaskMode)
                throw new Error("beginSMaskMode called while already in smask mode");
              const l = this.ctx.canvas.width, u = this.ctx.canvas.height, d = "smaskGroupAt" + this.groupLevel, b = this.cachedCanvases.getCanvas(d, l, u);
              this.suspendedCtx = this.ctx, this.ctx = b.context;
              const y = this.ctx;
              y.setTransform(...(0, s.getCurrentTransform)(this.suspendedCtx)), g(this.suspendedCtx, y), T(y, this.suspendedCtx), this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
            }
            endSMaskMode() {
              if (!this.inSMaskMode)
                throw new Error("endSMaskMode called while not in smask mode");
              this.ctx._removeMirroring(), g(this.ctx, this.suspendedCtx), this.ctx = this.suspendedCtx, this.suspendedCtx = null;
            }
            compose(l) {
              if (!this.current.activeSMask)
                return;
              l ? (l[0] = Math.floor(l[0]), l[1] = Math.floor(l[1]), l[2] = Math.ceil(l[2]), l[3] = Math.ceil(l[3])) : l = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];
              const u = this.current.activeSMask, d = this.suspendedCtx;
              D(d, u, this.ctx, l), this.ctx.save(), this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height), this.ctx.restore();
            }
            save() {
              this.inSMaskMode ? (g(this.ctx, this.suspendedCtx), this.suspendedCtx.save()) : this.ctx.save();
              const l = this.current;
              this.stateStack.push(l), this.current = l.clone();
            }
            restore() {
              this.stateStack.length === 0 && this.inSMaskMode && this.endSMaskMode(), this.stateStack.length !== 0 && (this.current = this.stateStack.pop(), this.inSMaskMode ? (this.suspendedCtx.restore(), g(this.suspendedCtx, this.ctx)) : this.ctx.restore(), this.checkSMaskState(), this.pendingClip = null, this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null);
            }
            transform(l, u, d, b, y, O) {
              this.ctx.transform(l, u, d, b, y, O), this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null;
            }
            constructPath(l, u, d) {
              const b = this.ctx, y = this.current;
              let O = y.x, B = y.y, z, it;
              const Z = (0, s.getCurrentTransform)(b), lt = Z[0] === 0 && Z[3] === 0 || Z[1] === 0 && Z[2] === 0, ht = lt ? d.slice(0) : null;
              for (let mt = 0, ft = 0, kt = l.length; mt < kt; mt++)
                switch (l[mt] | 0) {
                  case e.OPS.rectangle:
                    O = u[ft++], B = u[ft++];
                    const Rt = u[ft++], St = u[ft++], It = O + Rt, _t = B + St;
                    b.moveTo(O, B), Rt === 0 || St === 0 ? b.lineTo(It, _t) : (b.lineTo(It, B), b.lineTo(It, _t), b.lineTo(O, _t)), lt || y.updateRectMinMax(Z, [O, B, It, _t]), b.closePath();
                    break;
                  case e.OPS.moveTo:
                    O = u[ft++], B = u[ft++], b.moveTo(O, B), lt || y.updatePathMinMax(Z, O, B);
                    break;
                  case e.OPS.lineTo:
                    O = u[ft++], B = u[ft++], b.lineTo(O, B), lt || y.updatePathMinMax(Z, O, B);
                    break;
                  case e.OPS.curveTo:
                    z = O, it = B, O = u[ft + 4], B = u[ft + 5], b.bezierCurveTo(u[ft], u[ft + 1], u[ft + 2], u[ft + 3], O, B), y.updateCurvePathMinMax(Z, z, it, u[ft], u[ft + 1], u[ft + 2], u[ft + 3], O, B, ht), ft += 6;
                    break;
                  case e.OPS.curveTo2:
                    z = O, it = B, b.bezierCurveTo(O, B, u[ft], u[ft + 1], u[ft + 2], u[ft + 3]), y.updateCurvePathMinMax(Z, z, it, O, B, u[ft], u[ft + 1], u[ft + 2], u[ft + 3], ht), O = u[ft + 2], B = u[ft + 3], ft += 4;
                    break;
                  case e.OPS.curveTo3:
                    z = O, it = B, O = u[ft + 2], B = u[ft + 3], b.bezierCurveTo(u[ft], u[ft + 1], O, B, O, B), y.updateCurvePathMinMax(Z, z, it, u[ft], u[ft + 1], O, B, O, B, ht), ft += 4;
                    break;
                  case e.OPS.closePath:
                    b.closePath();
                    break;
                }
              lt && y.updateScalingPathMinMax(Z, ht), y.setCurrentPoint(O, B);
            }
            closePath() {
              this.ctx.closePath();
            }
            stroke(l = !0) {
              const u = this.ctx, d = this.current.strokeColor;
              u.globalAlpha = this.current.strokeAlpha, this.contentVisible && (typeof d == "object" && (d != null && d.getPattern) ? (u.save(), u.strokeStyle = d.getPattern(u, this, (0, s.getCurrentTransformInverse)(u), p.PathType.STROKE), this.rescaleAndStroke(!1), u.restore()) : this.rescaleAndStroke(!0)), l && this.consumePath(this.current.getClippedPathBoundingBox()), u.globalAlpha = this.current.fillAlpha;
            }
            closeStroke() {
              this.closePath(), this.stroke();
            }
            fill(l = !0) {
              const u = this.ctx, d = this.current.fillColor, b = this.current.patternFill;
              let y = !1;
              b && (u.save(), u.fillStyle = d.getPattern(u, this, (0, s.getCurrentTransformInverse)(u), p.PathType.FILL), y = !0);
              const O = this.current.getClippedPathBoundingBox();
              this.contentVisible && O !== null && (this.pendingEOFill ? (u.fill("evenodd"), this.pendingEOFill = !1) : u.fill()), y && u.restore(), l && this.consumePath(O);
            }
            eoFill() {
              this.pendingEOFill = !0, this.fill();
            }
            fillStroke() {
              this.fill(!1), this.stroke(!1), this.consumePath();
            }
            eoFillStroke() {
              this.pendingEOFill = !0, this.fillStroke();
            }
            closeFillStroke() {
              this.closePath(), this.fillStroke();
            }
            closeEOFillStroke() {
              this.pendingEOFill = !0, this.closePath(), this.fillStroke();
            }
            endPath() {
              this.consumePath();
            }
            clip() {
              this.pendingClip = U;
            }
            eoClip() {
              this.pendingClip = G;
            }
            beginText() {
              this.current.textMatrix = e.IDENTITY_MATRIX, this.current.textMatrixScale = 1, this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
            }
            endText() {
              const l = this.pendingTextPaths, u = this.ctx;
              if (l === void 0) {
                u.beginPath();
                return;
              }
              u.save(), u.beginPath();
              for (const d of l)
                u.setTransform(...d.transform), u.translate(d.x, d.y), d.addToPath(u, d.fontSize);
              u.restore(), u.clip(), u.beginPath(), delete this.pendingTextPaths;
            }
            setCharSpacing(l) {
              this.current.charSpacing = l;
            }
            setWordSpacing(l) {
              this.current.wordSpacing = l;
            }
            setHScale(l) {
              this.current.textHScale = l / 100;
            }
            setLeading(l) {
              this.current.leading = -l;
            }
            setFont(l, u) {
              var Z;
              const d = this.commonObjs.get(l), b = this.current;
              if (!d)
                throw new Error(`Can't find font for ${l}`);
              if (b.fontMatrix = d.fontMatrix || e.FONT_IDENTITY_MATRIX, (b.fontMatrix[0] === 0 || b.fontMatrix[3] === 0) && (0, e.warn)("Invalid font matrix for font " + l), u < 0 ? (u = -u, b.fontDirection = -1) : b.fontDirection = 1, this.current.font = d, this.current.fontSize = u, d.isType3Font)
                return;
              const y = d.loadedName || "sans-serif", O = ((Z = d.systemFontInfo) == null ? void 0 : Z.css) || `"${y}", ${d.fallbackName}`;
              let B = "normal";
              d.black ? B = "900" : d.bold && (B = "bold");
              const z = d.italic ? "italic" : "normal";
              let it = u;
              u < A ? it = A : u > a && (it = a), this.current.fontSizeScale = u / it, this.ctx.font = `${z} ${B} ${it}px ${O}`;
            }
            setTextRenderingMode(l) {
              this.current.textRenderingMode = l;
            }
            setTextRise(l) {
              this.current.textRise = l;
            }
            moveText(l, u) {
              this.current.x = this.current.lineX += l, this.current.y = this.current.lineY += u;
            }
            setLeadingMoveText(l, u) {
              this.setLeading(-u), this.moveText(l, u);
            }
            setTextMatrix(l, u, d, b, y, O) {
              this.current.textMatrix = [l, u, d, b, y, O], this.current.textMatrixScale = Math.hypot(l, u), this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
            }
            nextLine() {
              this.moveText(0, this.current.leading);
            }
            paintChar(l, u, d, b) {
              const y = this.ctx, O = this.current, B = O.font, z = O.textRenderingMode, it = O.fontSize / O.fontSizeScale, Z = z & e.TextRenderingMode.FILL_STROKE_MASK, lt = !!(z & e.TextRenderingMode.ADD_TO_PATH_FLAG), ht = O.patternFill && !B.missingFile;
              let mt;
              (B.disableFontFace || lt || ht) && (mt = B.getPathGenerator(this.commonObjs, l)), B.disableFontFace || ht ? (y.save(), y.translate(u, d), y.beginPath(), mt(y, it), b && y.setTransform(...b), (Z === e.TextRenderingMode.FILL || Z === e.TextRenderingMode.FILL_STROKE) && y.fill(), (Z === e.TextRenderingMode.STROKE || Z === e.TextRenderingMode.FILL_STROKE) && y.stroke(), y.restore()) : ((Z === e.TextRenderingMode.FILL || Z === e.TextRenderingMode.FILL_STROKE) && y.fillText(l, u, d), (Z === e.TextRenderingMode.STROKE || Z === e.TextRenderingMode.FILL_STROKE) && y.strokeText(l, u, d)), lt && (this.pendingTextPaths || (this.pendingTextPaths = [])).push({
                transform: (0, s.getCurrentTransform)(y),
                x: u,
                y: d,
                fontSize: it,
                addToPath: mt
              });
            }
            get isFontSubpixelAAEnabled() {
              const {
                context: l
              } = this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled", 10, 10);
              l.scale(1.5, 1), l.fillText("I", 0, 10);
              const u = l.getImageData(0, 0, 10, 10).data;
              let d = !1;
              for (let b = 3; b < u.length; b += 4)
                if (u[b] > 0 && u[b] < 255) {
                  d = !0;
                  break;
                }
              return (0, e.shadow)(this, "isFontSubpixelAAEnabled", d);
            }
            showText(l) {
              const u = this.current, d = u.font;
              if (d.isType3Font)
                return this.showType3Text(l);
              const b = u.fontSize;
              if (b === 0)
                return;
              const y = this.ctx, O = u.fontSizeScale, B = u.charSpacing, z = u.wordSpacing, it = u.fontDirection, Z = u.textHScale * it, lt = l.length, ht = d.vertical, mt = ht ? 1 : -1, ft = d.defaultVMetrics, kt = b * u.fontMatrix[0], Rt = u.textRenderingMode === e.TextRenderingMode.FILL && !d.disableFontFace && !u.patternFill;
              y.save(), y.transform(...u.textMatrix), y.translate(u.x, u.y + u.textRise), it > 0 ? y.scale(Z, -1) : y.scale(Z, 1);
              let St;
              if (u.patternFill) {
                y.save();
                const pt = u.fillColor.getPattern(y, this, (0, s.getCurrentTransformInverse)(y), p.PathType.FILL);
                St = (0, s.getCurrentTransform)(y), y.restore(), y.fillStyle = pt;
              }
              let It = u.lineWidth;
              const _t = u.textMatrixScale;
              if (_t === 0 || It === 0) {
                const pt = u.textRenderingMode & e.TextRenderingMode.FILL_STROKE_MASK;
                (pt === e.TextRenderingMode.STROKE || pt === e.TextRenderingMode.FILL_STROKE) && (It = this.getSinglePixelWidth());
              } else
                It /= _t;
              if (O !== 1 && (y.scale(O, O), It /= O), y.lineWidth = It, d.isInvalidPDFjsFont) {
                const pt = [];
                let Ct = 0;
                for (const Tt of l)
                  pt.push(Tt.unicode), Ct += Tt.width;
                y.fillText(pt.join(""), 0, 0), u.x += Ct * kt * Z, y.restore(), this.compose();
                return;
              }
              let rt = 0, at;
              for (at = 0; at < lt; ++at) {
                const pt = l[at];
                if (typeof pt == "number") {
                  rt += mt * pt * b / 1e3;
                  continue;
                }
                let Ct = !1;
                const Tt = (pt.isSpace ? z : 0) + B, Bt = pt.fontChar, Wt = pt.accent;
                let jt, zt, Gt = pt.width;
                if (ht) {
                  const Vt = pt.vmetric || ft, ut = -(pt.vmetric ? Vt[1] : Gt * 0.5) * kt, nt = Vt[2] * kt;
                  Gt = Vt ? -Vt[0] : Gt, jt = ut / O, zt = (rt + nt) / O;
                } else
                  jt = rt / O, zt = 0;
                if (d.remeasure && Gt > 0) {
                  const Vt = y.measureText(Bt).width * 1e3 / b * O;
                  if (Gt < Vt && this.isFontSubpixelAAEnabled) {
                    const ut = Gt / Vt;
                    Ct = !0, y.save(), y.scale(ut, 1), jt /= ut;
                  } else
                    Gt !== Vt && (jt += (Gt - Vt) / 2e3 * b / O);
                }
                if (this.contentVisible && (pt.isInFont || d.missingFile)) {
                  if (Rt && !Wt)
                    y.fillText(Bt, jt, zt);
                  else if (this.paintChar(Bt, jt, zt, St), Wt) {
                    const Vt = jt + b * Wt.offset.x / O, ut = zt - b * Wt.offset.y / O;
                    this.paintChar(Wt.fontChar, Vt, ut, St);
                  }
                }
                const qt = ht ? Gt * kt - Tt * it : Gt * kt + Tt * it;
                rt += qt, Ct && y.restore();
              }
              ht ? u.y -= rt : u.x += rt * Z, y.restore(), this.compose();
            }
            showType3Text(l) {
              const u = this.ctx, d = this.current, b = d.font, y = d.fontSize, O = d.fontDirection, B = b.vertical ? 1 : -1, z = d.charSpacing, it = d.wordSpacing, Z = d.textHScale * O, lt = d.fontMatrix || e.FONT_IDENTITY_MATRIX, ht = l.length, mt = d.textRenderingMode === e.TextRenderingMode.INVISIBLE;
              let ft, kt, Rt, St;
              if (!(mt || y === 0)) {
                for (this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null, u.save(), u.transform(...d.textMatrix), u.translate(d.x, d.y), u.scale(Z, O), ft = 0; ft < ht; ++ft) {
                  if (kt = l[ft], typeof kt == "number") {
                    St = B * kt * y / 1e3, this.ctx.translate(St, 0), d.x += St * Z;
                    continue;
                  }
                  const It = (kt.isSpace ? it : 0) + z, _t = b.charProcOperatorList[kt.operatorListId];
                  if (!_t) {
                    (0, e.warn)(`Type3 character "${kt.operatorListId}" is not available.`);
                    continue;
                  }
                  this.contentVisible && (this.processingType3 = kt, this.save(), u.scale(y, y), u.transform(...lt), this.executeOperatorList(_t), this.restore()), Rt = e.Util.applyTransform([kt.width, 0], lt)[0] * y + It, u.translate(Rt, 0), d.x += Rt * Z;
                }
                u.restore(), this.processingType3 = null;
              }
            }
            setCharWidth(l, u) {
            }
            setCharWidthAndBounds(l, u, d, b, y, O) {
              this.ctx.rect(d, b, y - d, O - b), this.ctx.clip(), this.endPath();
            }
            getColorN_Pattern(l) {
              let u;
              if (l[0] === "TilingPattern") {
                const d = l[1], b = this.baseTransform || (0, s.getCurrentTransform)(this.ctx), y = {
                  createCanvasGraphics: (O) => new gt(O, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
                    optionalContentConfig: this.optionalContentConfig,
                    markedContentStack: this.markedContentStack
                  })
                };
                u = new p.TilingPattern(l, d, this.ctx, y, b);
              } else
                u = this._getPattern(l[1], l[2]);
              return u;
            }
            setStrokeColorN() {
              this.current.strokeColor = this.getColorN_Pattern(arguments);
            }
            setFillColorN() {
              this.current.fillColor = this.getColorN_Pattern(arguments), this.current.patternFill = !0;
            }
            setStrokeRGBColor(l, u, d) {
              const b = e.Util.makeHexColor(l, u, d);
              this.ctx.strokeStyle = b, this.current.strokeColor = b;
            }
            setFillRGBColor(l, u, d) {
              const b = e.Util.makeHexColor(l, u, d);
              this.ctx.fillStyle = b, this.current.fillColor = b, this.current.patternFill = !1;
            }
            _getPattern(l, u = null) {
              let d;
              return this.cachedPatterns.has(l) ? d = this.cachedPatterns.get(l) : (d = (0, p.getShadingPattern)(this.getObject(l)), this.cachedPatterns.set(l, d)), u && (d.matrix = u), d;
            }
            shadingFill(l) {
              if (!this.contentVisible)
                return;
              const u = this.ctx;
              this.save();
              const d = this._getPattern(l);
              u.fillStyle = d.getPattern(u, this, (0, s.getCurrentTransformInverse)(u), p.PathType.SHADING);
              const b = (0, s.getCurrentTransformInverse)(u);
              if (b) {
                const {
                  width: y,
                  height: O
                } = u.canvas, [B, z, it, Z] = e.Util.getAxialAlignedBoundingBox([0, 0, y, O], b);
                this.ctx.fillRect(B, z, it - B, Z - z);
              } else
                this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);
              this.compose(this.current.getClippedPathBoundingBox()), this.restore();
            }
            beginInlineImage() {
              (0, e.unreachable)("Should not call beginInlineImage");
            }
            beginImageData() {
              (0, e.unreachable)("Should not call beginImageData");
            }
            paintFormXObjectBegin(l, u) {
              if (this.contentVisible && (this.save(), this.baseTransformStack.push(this.baseTransform), Array.isArray(l) && l.length === 6 && this.transform(...l), this.baseTransform = (0, s.getCurrentTransform)(this.ctx), u)) {
                const d = u[2] - u[0], b = u[3] - u[1];
                this.ctx.rect(u[0], u[1], d, b), this.current.updateRectMinMax((0, s.getCurrentTransform)(this.ctx), u), this.clip(), this.endPath();
              }
            }
            paintFormXObjectEnd() {
              this.contentVisible && (this.restore(), this.baseTransform = this.baseTransformStack.pop());
            }
            beginGroup(l) {
              if (!this.contentVisible)
                return;
              this.save(), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
              const u = this.ctx;
              l.isolated || (0, e.info)("TODO: Support non-isolated groups."), l.knockout && (0, e.warn)("Knockout groups not supported.");
              const d = (0, s.getCurrentTransform)(u);
              if (l.matrix && u.transform(...l.matrix), !l.bbox)
                throw new Error("Bounding box is required.");
              let b = e.Util.getAxialAlignedBoundingBox(l.bbox, (0, s.getCurrentTransform)(u));
              const y = [0, 0, u.canvas.width, u.canvas.height];
              b = e.Util.intersect(b, y) || [0, 0, 0, 0];
              const O = Math.floor(b[0]), B = Math.floor(b[1]);
              let z = Math.max(Math.ceil(b[2]) - O, 1), it = Math.max(Math.ceil(b[3]) - B, 1), Z = 1, lt = 1;
              z > h && (Z = z / h, z = h), it > h && (lt = it / h, it = h), this.current.startNewPathAndClipBox([0, 0, z, it]);
              let ht = "groupAt" + this.groupLevel;
              l.smask && (ht += "_smask_" + this.smaskCounter++ % 2);
              const mt = this.cachedCanvases.getCanvas(ht, z, it), ft = mt.context;
              ft.scale(1 / Z, 1 / lt), ft.translate(-O, -B), ft.transform(...d), l.smask ? this.smaskStack.push({
                canvas: mt.canvas,
                context: ft,
                offsetX: O,
                offsetY: B,
                scaleX: Z,
                scaleY: lt,
                subtype: l.smask.subtype,
                backdrop: l.smask.backdrop,
                transferMap: l.smask.transferMap || null,
                startTransformInverse: null
              }) : (u.setTransform(1, 0, 0, 1, 0, 0), u.translate(O, B), u.scale(Z, lt), u.save()), g(u, ft), this.ctx = ft, this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]), this.groupStack.push(u), this.groupLevel++;
            }
            endGroup(l) {
              if (!this.contentVisible)
                return;
              this.groupLevel--;
              const u = this.ctx, d = this.groupStack.pop();
              if (this.ctx = d, this.ctx.imageSmoothingEnabled = !1, l.smask)
                this.tempSMask = this.smaskStack.pop(), this.restore();
              else {
                this.ctx.restore();
                const b = (0, s.getCurrentTransform)(this.ctx);
                this.restore(), this.ctx.save(), this.ctx.setTransform(...b);
                const y = e.Util.getAxialAlignedBoundingBox([0, 0, u.canvas.width, u.canvas.height], b);
                this.ctx.drawImage(u.canvas, 0, 0), this.ctx.restore(), this.compose(y);
              }
            }
            beginAnnotation(l, u, d, b, y) {
              if (J(this, H, Ze).call(this), v(this.ctx), this.ctx.save(), this.save(), this.baseTransform && this.ctx.setTransform(...this.baseTransform), Array.isArray(u) && u.length === 4) {
                const O = u[2] - u[0], B = u[3] - u[1];
                if (y && this.annotationCanvasMap) {
                  d = d.slice(), d[4] -= u[0], d[5] -= u[1], u = u.slice(), u[0] = u[1] = 0, u[2] = O, u[3] = B;
                  const [z, it] = e.Util.singularValueDecompose2dScale((0, s.getCurrentTransform)(this.ctx)), {
                    viewportScale: Z
                  } = this, lt = Math.ceil(O * this.outputScaleX * Z), ht = Math.ceil(B * this.outputScaleY * Z);
                  this.annotationCanvas = this.canvasFactory.create(lt, ht);
                  const {
                    canvas: mt,
                    context: ft
                  } = this.annotationCanvas;
                  this.annotationCanvasMap.set(l, mt), this.annotationCanvas.savedCtx = this.ctx, this.ctx = ft, this.ctx.save(), this.ctx.setTransform(z, 0, 0, -it, 0, B * it), v(this.ctx);
                } else
                  v(this.ctx), this.ctx.rect(u[0], u[1], O, B), this.ctx.clip(), this.endPath();
              }
              this.current = new x(this.ctx.canvas.width, this.ctx.canvas.height), this.transform(...d), this.transform(...b);
            }
            endAnnotation() {
              this.annotationCanvas && (this.ctx.restore(), J(this, dt, Qe).call(this), this.ctx = this.annotationCanvas.savedCtx, delete this.annotationCanvas.savedCtx, delete this.annotationCanvas);
            }
            paintImageMaskXObject(l) {
              if (!this.contentVisible)
                return;
              const u = l.count;
              l = this.getObject(l.data, l), l.count = u;
              const d = this.ctx, b = this.processingType3;
              if (b && (b.compiled === void 0 && (b.compiled = C(l)), b.compiled)) {
                b.compiled(d);
                return;
              }
              const y = this._createMaskCanvas(l), O = y.canvas;
              d.save(), d.setTransform(1, 0, 0, 1, 0, 0), d.drawImage(O, y.offsetX, y.offsetY), d.restore(), this.compose();
            }
            paintImageMaskXObjectRepeat(l, u, d = 0, b = 0, y, O) {
              if (!this.contentVisible)
                return;
              l = this.getObject(l.data, l);
              const B = this.ctx;
              B.save();
              const z = (0, s.getCurrentTransform)(B);
              B.transform(u, d, b, y, 0, 0);
              const it = this._createMaskCanvas(l);
              B.setTransform(1, 0, 0, 1, it.offsetX - z[4], it.offsetY - z[5]);
              for (let Z = 0, lt = O.length; Z < lt; Z += 2) {
                const ht = e.Util.transform(z, [u, d, b, y, O[Z], O[Z + 1]]), [mt, ft] = e.Util.applyTransform([0, 0], ht);
                B.drawImage(it.canvas, mt, ft);
              }
              B.restore(), this.compose();
            }
            paintImageMaskXObjectGroup(l) {
              if (!this.contentVisible)
                return;
              const u = this.ctx, d = this.current.fillColor, b = this.current.patternFill;
              for (const y of l) {
                const {
                  data: O,
                  width: B,
                  height: z,
                  transform: it
                } = y, Z = this.cachedCanvases.getCanvas("maskCanvas", B, z), lt = Z.context;
                lt.save();
                const ht = this.getObject(O, y);
                S(lt, ht), lt.globalCompositeOperation = "source-in", lt.fillStyle = b ? d.getPattern(lt, this, (0, s.getCurrentTransformInverse)(u), p.PathType.FILL) : d, lt.fillRect(0, 0, B, z), lt.restore(), u.save(), u.transform(...it), u.scale(1, -1), m(u, Z.canvas, 0, 0, B, z, 0, -1, 1, 1), u.restore();
              }
              this.compose();
            }
            paintImageXObject(l) {
              if (!this.contentVisible)
                return;
              const u = this.getObject(l);
              if (!u) {
                (0, e.warn)("Dependent image isn't ready yet");
                return;
              }
              this.paintInlineImageXObject(u);
            }
            paintImageXObjectRepeat(l, u, d, b) {
              if (!this.contentVisible)
                return;
              const y = this.getObject(l);
              if (!y) {
                (0, e.warn)("Dependent image isn't ready yet");
                return;
              }
              const O = y.width, B = y.height, z = [];
              for (let it = 0, Z = b.length; it < Z; it += 2)
                z.push({
                  transform: [u, 0, 0, d, b[it], b[it + 1]],
                  x: 0,
                  y: 0,
                  w: O,
                  h: B
                });
              this.paintInlineImageXObjectGroup(y, z);
            }
            applyTransferMapsToCanvas(l) {
              return this.current.transferMaps !== "none" && (l.filter = this.current.transferMaps, l.drawImage(l.canvas, 0, 0), l.filter = "none"), l.canvas;
            }
            applyTransferMapsToBitmap(l) {
              if (this.current.transferMaps === "none")
                return l.bitmap;
              const {
                bitmap: u,
                width: d,
                height: b
              } = l, y = this.cachedCanvases.getCanvas("inlineImage", d, b), O = y.context;
              return O.filter = this.current.transferMaps, O.drawImage(u, 0, 0), O.filter = "none", y.canvas;
            }
            paintInlineImageXObject(l) {
              if (!this.contentVisible)
                return;
              const u = l.width, d = l.height, b = this.ctx;
              if (this.save(), !e.isNodeJS) {
                const {
                  filter: B
                } = b;
                B !== "none" && B !== "" && (b.filter = "none");
              }
              b.scale(1 / u, -1 / d);
              let y;
              if (l.bitmap)
                y = this.applyTransferMapsToBitmap(l);
              else if (typeof HTMLElement == "function" && l instanceof HTMLElement || !l.data)
                y = l;
              else {
                const z = this.cachedCanvases.getCanvas("inlineImage", u, d).context;
                E(z, l), y = this.applyTransferMapsToCanvas(z);
              }
              const O = this._scaleImage(y, (0, s.getCurrentTransformInverse)(b));
              b.imageSmoothingEnabled = X((0, s.getCurrentTransform)(b), l.interpolate), m(b, O.img, 0, 0, O.paintWidth, O.paintHeight, 0, -d, u, d), this.compose(), this.restore();
            }
            paintInlineImageXObjectGroup(l, u) {
              if (!this.contentVisible)
                return;
              const d = this.ctx;
              let b;
              if (l.bitmap)
                b = l.bitmap;
              else {
                const y = l.width, O = l.height, z = this.cachedCanvases.getCanvas("inlineImage", y, O).context;
                E(z, l), b = this.applyTransferMapsToCanvas(z);
              }
              for (const y of u)
                d.save(), d.transform(...y.transform), d.scale(1, -1), m(d, b, y.x, y.y, y.w, y.h, 0, -1, 1, 1), d.restore();
              this.compose();
            }
            paintSolidColorImageMask() {
              this.contentVisible && (this.ctx.fillRect(0, 0, 1, 1), this.compose());
            }
            markPoint(l) {
            }
            markPointProps(l, u) {
            }
            beginMarkedContent(l) {
              this.markedContentStack.push({
                visible: !0
              });
            }
            beginMarkedContentProps(l, u) {
              l === "OC" ? this.markedContentStack.push({
                visible: this.optionalContentConfig.isVisible(u)
              }) : this.markedContentStack.push({
                visible: !0
              }), this.contentVisible = this.isContentVisible();
            }
            endMarkedContent() {
              this.markedContentStack.pop(), this.contentVisible = this.isContentVisible();
            }
            beginCompat() {
            }
            endCompat() {
            }
            consumePath(l) {
              const u = this.current.isEmptyClip();
              this.pendingClip && this.current.updateClipFromPath(), this.pendingClip || this.compose(l);
              const d = this.ctx;
              this.pendingClip && (u || (this.pendingClip === G ? d.clip("evenodd") : d.clip()), this.pendingClip = null), this.current.startNewPathAndClipBox(this.current.clipBox), d.beginPath();
            }
            getSinglePixelWidth() {
              if (!this._cachedGetSinglePixelWidth) {
                const l = (0, s.getCurrentTransform)(this.ctx);
                if (l[1] === 0 && l[2] === 0)
                  this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(l[0]), Math.abs(l[3]));
                else {
                  const u = Math.abs(l[0] * l[3] - l[2] * l[1]), d = Math.hypot(l[0], l[2]), b = Math.hypot(l[1], l[3]);
                  this._cachedGetSinglePixelWidth = Math.max(d, b) / u;
                }
              }
              return this._cachedGetSinglePixelWidth;
            }
            getScaleForStroking() {
              if (this._cachedScaleForStroking[0] === -1) {
                const {
                  lineWidth: l
                } = this.current, {
                  a: u,
                  b: d,
                  c: b,
                  d: y
                } = this.ctx.getTransform();
                let O, B;
                if (d === 0 && b === 0) {
                  const z = Math.abs(u), it = Math.abs(y);
                  if (z === it)
                    if (l === 0)
                      O = B = 1 / z;
                    else {
                      const Z = z * l;
                      O = B = Z < 1 ? 1 / Z : 1;
                    }
                  else if (l === 0)
                    O = 1 / z, B = 1 / it;
                  else {
                    const Z = z * l, lt = it * l;
                    O = Z < 1 ? 1 / Z : 1, B = lt < 1 ? 1 / lt : 1;
                  }
                } else {
                  const z = Math.abs(u * y - d * b), it = Math.hypot(u, d), Z = Math.hypot(b, y);
                  if (l === 0)
                    O = Z / z, B = it / z;
                  else {
                    const lt = l * z;
                    O = Z > lt ? Z / lt : 1, B = it > lt ? it / lt : 1;
                  }
                }
                this._cachedScaleForStroking[0] = O, this._cachedScaleForStroking[1] = B;
              }
              return this._cachedScaleForStroking;
            }
            rescaleAndStroke(l) {
              const {
                ctx: u
              } = this, {
                lineWidth: d
              } = this.current, [b, y] = this.getScaleForStroking();
              if (u.lineWidth = d || 1, b === 1 && y === 1) {
                u.stroke();
                return;
              }
              const O = u.getLineDash();
              if (l && u.save(), u.scale(b, y), O.length > 0) {
                const B = Math.max(b, y);
                u.setLineDash(O.map((z) => z / B)), u.lineDashOffset /= B;
              }
              u.stroke(), l && u.restore();
            }
            isContentVisible() {
              for (let l = this.markedContentStack.length - 1; l >= 0; l--)
                if (!this.markedContentStack[l].visible)
                  return !1;
              return !0;
            }
          };
          H = new WeakSet(), Ze = function() {
            for (; this.stateStack.length || this.inSMaskMode; )
              this.restore();
            this.ctx.restore(), this.transparentCanvas && (this.ctx = this.compositeCtx, this.ctx.save(), this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.drawImage(this.transparentCanvas, 0, 0), this.ctx.restore(), this.transparentCanvas = null);
          }, dt = new WeakSet(), Qe = function() {
            if (this.pageColors) {
              const l = this.filterFactory.addHCMFilter(this.pageColors.foreground, this.pageColors.background);
              if (l !== "none") {
                const u = this.ctx.filter;
                this.ctx.filter = l, this.ctx.drawImage(this.ctx.canvas, 0, 0), this.ctx.filter = u;
              }
            }
          };
          let V = gt;
          t.CanvasGraphics = V;
          for (const k in e.OPS)
            V.prototype[k] !== void 0 && (V.prototype[e.OPS[k]] = V.prototype[k]);
        },
        /* 12 */
        /***/
        (i, t, n) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.TilingPattern = t.PathType = void 0, t.getShadingPattern = w;
          var e = n(1), s = n(6);
          const p = {
            FILL: "Fill",
            STROKE: "Stroke",
            SHADING: "Shading"
          };
          t.PathType = p;
          function f(C, x) {
            if (!x)
              return;
            const E = x[2] - x[0], S = x[3] - x[1], g = new Path2D();
            g.rect(x[0], x[1], E, S), C.clip(g);
          }
          class A {
            constructor() {
              this.constructor === A && (0, e.unreachable)("Cannot initialize BaseShadingPattern.");
            }
            getPattern() {
              (0, e.unreachable)("Abstract method `getPattern` called.");
            }
          }
          class a extends A {
            constructor(x) {
              super(), this._type = x[1], this._bbox = x[2], this._colorStops = x[3], this._p0 = x[4], this._p1 = x[5], this._r0 = x[6], this._r1 = x[7], this.matrix = null;
            }
            _createGradient(x) {
              let E;
              this._type === "axial" ? E = x.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]) : this._type === "radial" && (E = x.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1));
              for (const S of this._colorStops)
                E.addColorStop(S[0], S[1]);
              return E;
            }
            getPattern(x, E, S, g) {
              let v;
              if (g === p.STROKE || g === p.FILL) {
                const $ = E.current.getClippedPathBoundingBox(g, (0, s.getCurrentTransform)(x)) || [0, 0, 0, 0], M = Math.ceil($[2] - $[0]) || 1, _ = Math.ceil($[3] - $[1]) || 1, N = E.cachedCanvases.getCanvas("pattern", M, _, !0), D = N.context;
                D.clearRect(0, 0, D.canvas.width, D.canvas.height), D.beginPath(), D.rect(0, 0, D.canvas.width, D.canvas.height), D.translate(-$[0], -$[1]), S = e.Util.transform(S, [1, 0, 0, 1, $[0], $[1]]), D.transform(...E.baseTransform), this.matrix && D.transform(...this.matrix), f(D, this._bbox), D.fillStyle = this._createGradient(D), D.fill(), v = x.createPattern(N.canvas, "no-repeat");
                const X = new DOMMatrix(S);
                v.setTransform(X);
              } else
                f(x, this._bbox), v = this._createGradient(x);
              return v;
            }
          }
          function h(C, x, E, S, g, v, $, M) {
            const _ = x.coords, N = x.colors, D = C.data, X = C.width * 4;
            let Y;
            _[E + 1] > _[S + 1] && (Y = E, E = S, S = Y, Y = v, v = $, $ = Y), _[S + 1] > _[g + 1] && (Y = S, S = g, g = Y, Y = $, $ = M, M = Y), _[E + 1] > _[S + 1] && (Y = E, E = S, S = Y, Y = v, v = $, $ = Y);
            const I = (_[E] + x.offsetX) * x.scaleX, U = (_[E + 1] + x.offsetY) * x.scaleY, G = (_[S] + x.offsetX) * x.scaleX, V = (_[S + 1] + x.offsetY) * x.scaleY, H = (_[g] + x.offsetX) * x.scaleX, st = (_[g + 1] + x.offsetY) * x.scaleY;
            if (U >= st)
              return;
            const dt = N[v], yt = N[v + 1], gt = N[v + 2], k = N[$], l = N[$ + 1], u = N[$ + 2], d = N[M], b = N[M + 1], y = N[M + 2], O = Math.round(U), B = Math.round(st);
            let z, it, Z, lt, ht, mt, ft, kt;
            for (let Rt = O; Rt <= B; Rt++) {
              if (Rt < V) {
                const at = Rt < U ? 0 : (U - Rt) / (U - V);
                z = I - (I - G) * at, it = dt - (dt - k) * at, Z = yt - (yt - l) * at, lt = gt - (gt - u) * at;
              } else {
                let at;
                Rt > st ? at = 1 : V === st ? at = 0 : at = (V - Rt) / (V - st), z = G - (G - H) * at, it = k - (k - d) * at, Z = l - (l - b) * at, lt = u - (u - y) * at;
              }
              let St;
              Rt < U ? St = 0 : Rt > st ? St = 1 : St = (U - Rt) / (U - st), ht = I - (I - H) * St, mt = dt - (dt - d) * St, ft = yt - (yt - b) * St, kt = gt - (gt - y) * St;
              const It = Math.round(Math.min(z, ht)), _t = Math.round(Math.max(z, ht));
              let rt = X * Rt + It * 4;
              for (let at = It; at <= _t; at++)
                St = (z - at) / (z - ht), St < 0 ? St = 0 : St > 1 && (St = 1), D[rt++] = it - (it - mt) * St | 0, D[rt++] = Z - (Z - ft) * St | 0, D[rt++] = lt - (lt - kt) * St | 0, D[rt++] = 255;
            }
          }
          function o(C, x, E) {
            const S = x.coords, g = x.colors;
            let v, $;
            switch (x.type) {
              case "lattice":
                const M = x.verticesPerRow, _ = Math.floor(S.length / M) - 1, N = M - 1;
                for (v = 0; v < _; v++) {
                  let D = v * M;
                  for (let X = 0; X < N; X++, D++)
                    h(C, E, S[D], S[D + 1], S[D + M], g[D], g[D + 1], g[D + M]), h(C, E, S[D + M + 1], S[D + 1], S[D + M], g[D + M + 1], g[D + 1], g[D + M]);
                }
                break;
              case "triangles":
                for (v = 0, $ = S.length; v < $; v += 3)
                  h(C, E, S[v], S[v + 1], S[v + 2], g[v], g[v + 1], g[v + 2]);
                break;
              default:
                throw new Error("illegal figure");
            }
          }
          class F extends A {
            constructor(x) {
              super(), this._coords = x[2], this._colors = x[3], this._figures = x[4], this._bounds = x[5], this._bbox = x[7], this._background = x[8], this.matrix = null;
            }
            _createMeshCanvas(x, E, S) {
              const M = Math.floor(this._bounds[0]), _ = Math.floor(this._bounds[1]), N = Math.ceil(this._bounds[2]) - M, D = Math.ceil(this._bounds[3]) - _, X = Math.min(Math.ceil(Math.abs(N * x[0] * 1.1)), 3e3), Y = Math.min(Math.ceil(Math.abs(D * x[1] * 1.1)), 3e3), I = N / X, U = D / Y, G = {
                coords: this._coords,
                colors: this._colors,
                offsetX: -M,
                offsetY: -_,
                scaleX: 1 / I,
                scaleY: 1 / U
              }, V = X + 2 * 2, H = Y + 2 * 2, st = S.getCanvas("mesh", V, H, !1), dt = st.context, yt = dt.createImageData(X, Y);
              if (E) {
                const k = yt.data;
                for (let l = 0, u = k.length; l < u; l += 4)
                  k[l] = E[0], k[l + 1] = E[1], k[l + 2] = E[2], k[l + 3] = 255;
              }
              for (const k of this._figures)
                o(yt, k, G);
              return dt.putImageData(yt, 2, 2), {
                canvas: st.canvas,
                offsetX: M - 2 * I,
                offsetY: _ - 2 * U,
                scaleX: I,
                scaleY: U
              };
            }
            getPattern(x, E, S, g) {
              f(x, this._bbox);
              let v;
              if (g === p.SHADING)
                v = e.Util.singularValueDecompose2dScale((0, s.getCurrentTransform)(x));
              else if (v = e.Util.singularValueDecompose2dScale(E.baseTransform), this.matrix) {
                const M = e.Util.singularValueDecompose2dScale(this.matrix);
                v = [v[0] * M[0], v[1] * M[1]];
              }
              const $ = this._createMeshCanvas(v, g === p.SHADING ? null : this._background, E.cachedCanvases);
              return g !== p.SHADING && (x.setTransform(...E.baseTransform), this.matrix && x.transform(...this.matrix)), x.translate($.offsetX, $.offsetY), x.scale($.scaleX, $.scaleY), x.createPattern($.canvas, "no-repeat");
            }
          }
          class R extends A {
            getPattern() {
              return "hotpink";
            }
          }
          function w(C) {
            switch (C[0]) {
              case "RadialAxial":
                return new a(C);
              case "Mesh":
                return new F(C);
              case "Dummy":
                return new R();
            }
            throw new Error(`Unknown IR type: ${C[0]}`);
          }
          const T = {
            COLORED: 1,
            UNCOLORED: 2
          }, m = class m {
            constructor(x, E, S, g, v) {
              this.operatorList = x[2], this.matrix = x[3] || [1, 0, 0, 1, 0, 0], this.bbox = x[4], this.xstep = x[5], this.ystep = x[6], this.paintType = x[7], this.tilingType = x[8], this.color = E, this.ctx = S, this.canvasGraphicsFactory = g, this.baseTransform = v;
            }
            createPatternCanvas(x) {
              const E = this.operatorList, S = this.bbox, g = this.xstep, v = this.ystep, $ = this.paintType, M = this.tilingType, _ = this.color, N = this.canvasGraphicsFactory;
              (0, e.info)("TilingType: " + M);
              const D = S[0], X = S[1], Y = S[2], I = S[3], U = e.Util.singularValueDecompose2dScale(this.matrix), G = e.Util.singularValueDecompose2dScale(this.baseTransform), V = [U[0] * G[0], U[1] * G[1]], H = this.getSizeAndScale(g, this.ctx.canvas.width, V[0]), st = this.getSizeAndScale(v, this.ctx.canvas.height, V[1]), dt = x.cachedCanvases.getCanvas("pattern", H.size, st.size, !0), yt = dt.context, gt = N.createCanvasGraphics(yt);
              gt.groupLevel = x.groupLevel, this.setFillAndStrokeStyleToContext(gt, $, _);
              let k = D, l = X, u = Y, d = I;
              return D < 0 && (k = 0, u += Math.abs(D)), X < 0 && (l = 0, d += Math.abs(X)), yt.translate(-(H.scale * k), -(st.scale * l)), gt.transform(H.scale, 0, 0, st.scale, 0, 0), yt.save(), this.clipBbox(gt, k, l, u, d), gt.baseTransform = (0, s.getCurrentTransform)(gt.ctx), gt.executeOperatorList(E), gt.endDrawing(), {
                canvas: dt.canvas,
                scaleX: H.scale,
                scaleY: st.scale,
                offsetX: k,
                offsetY: l
              };
            }
            getSizeAndScale(x, E, S) {
              x = Math.abs(x);
              const g = Math.max(m.MAX_PATTERN_SIZE, E);
              let v = Math.ceil(x * S);
              return v >= g ? v = g : S = v / x, {
                scale: S,
                size: v
              };
            }
            clipBbox(x, E, S, g, v) {
              const $ = g - E, M = v - S;
              x.ctx.rect(E, S, $, M), x.current.updateRectMinMax((0, s.getCurrentTransform)(x.ctx), [E, S, g, v]), x.clip(), x.endPath();
            }
            setFillAndStrokeStyleToContext(x, E, S) {
              const g = x.ctx, v = x.current;
              switch (E) {
                case T.COLORED:
                  const $ = this.ctx;
                  g.fillStyle = $.fillStyle, g.strokeStyle = $.strokeStyle, v.fillColor = $.fillStyle, v.strokeColor = $.strokeStyle;
                  break;
                case T.UNCOLORED:
                  const M = e.Util.makeHexColor(S[0], S[1], S[2]);
                  g.fillStyle = M, g.strokeStyle = M, v.fillColor = M, v.strokeColor = M;
                  break;
                default:
                  throw new e.FormatError(`Unsupported paint type: ${E}`);
              }
            }
            getPattern(x, E, S, g) {
              let v = S;
              g !== p.SHADING && (v = e.Util.transform(v, E.baseTransform), this.matrix && (v = e.Util.transform(v, this.matrix)));
              const $ = this.createPatternCanvas(E);
              let M = new DOMMatrix(v);
              M = M.translate($.offsetX, $.offsetY), M = M.scale(1 / $.scaleX, 1 / $.scaleY);
              const _ = x.createPattern($.canvas, "repeat");
              return _.setTransform(M), _;
            }
          };
          ee(m, "MAX_PATTERN_SIZE", 3e3);
          let P = m;
          t.TilingPattern = P;
        },
        /* 13 */
        /***/
        (i, t, n) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.convertBlackAndWhiteToRGBA = p, t.convertToRGBA = s, t.grayToRGBA = A;
          var e = n(1);
          function s(a) {
            switch (a.kind) {
              case e.ImageKind.GRAYSCALE_1BPP:
                return p(a);
              case e.ImageKind.RGB_24BPP:
                return f(a);
            }
            return null;
          }
          function p({
            src: a,
            srcPos: h = 0,
            dest: o,
            width: F,
            height: R,
            nonBlackColor: w = 4294967295,
            inverseDecode: T = !1
          }) {
            const P = e.FeatureTest.isLittleEndian ? 4278190080 : 255, [m, C] = T ? [w, P] : [P, w], x = F >> 3, E = F & 7, S = a.length;
            o = new Uint32Array(o.buffer);
            let g = 0;
            for (let v = 0; v < R; v++) {
              for (const M = h + x; h < M; h++) {
                const _ = h < S ? a[h] : 255;
                o[g++] = _ & 128 ? C : m, o[g++] = _ & 64 ? C : m, o[g++] = _ & 32 ? C : m, o[g++] = _ & 16 ? C : m, o[g++] = _ & 8 ? C : m, o[g++] = _ & 4 ? C : m, o[g++] = _ & 2 ? C : m, o[g++] = _ & 1 ? C : m;
              }
              if (E === 0)
                continue;
              const $ = h < S ? a[h++] : 255;
              for (let M = 0; M < E; M++)
                o[g++] = $ & 1 << 7 - M ? C : m;
            }
            return {
              srcPos: h,
              destPos: g
            };
          }
          function f({
            src: a,
            srcPos: h = 0,
            dest: o,
            destPos: F = 0,
            width: R,
            height: w
          }) {
            let T = 0;
            const P = a.length >> 2, m = new Uint32Array(a.buffer, h, P);
            if (e.FeatureTest.isLittleEndian) {
              for (; T < P - 2; T += 3, F += 4) {
                const C = m[T], x = m[T + 1], E = m[T + 2];
                o[F] = C | 4278190080, o[F + 1] = C >>> 24 | x << 8 | 4278190080, o[F + 2] = x >>> 16 | E << 16 | 4278190080, o[F + 3] = E >>> 8 | 4278190080;
              }
              for (let C = T * 4, x = a.length; C < x; C += 3)
                o[F++] = a[C] | a[C + 1] << 8 | a[C + 2] << 16 | 4278190080;
            } else {
              for (; T < P - 2; T += 3, F += 4) {
                const C = m[T], x = m[T + 1], E = m[T + 2];
                o[F] = C | 255, o[F + 1] = C << 24 | x >>> 8 | 255, o[F + 2] = x << 16 | E >>> 16 | 255, o[F + 3] = E << 8 | 255;
              }
              for (let C = T * 4, x = a.length; C < x; C += 3)
                o[F++] = a[C] << 24 | a[C + 1] << 16 | a[C + 2] << 8 | 255;
            }
            return {
              srcPos: h,
              destPos: F
            };
          }
          function A(a, h) {
            if (e.FeatureTest.isLittleEndian)
              for (let o = 0, F = a.length; o < F; o++)
                h[o] = a[o] * 65793 | 4278190080;
            else
              for (let o = 0, F = a.length; o < F; o++)
                h[o] = a[o] * 16843008 | 255;
          }
        },
        /* 14 */
        /***/
        (i, t) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.GlobalWorkerOptions = void 0;
          const n = /* @__PURE__ */ Object.create(null);
          t.GlobalWorkerOptions = n, n.workerPort = null, n.workerSrc = "";
        },
        /* 15 */
        /***/
        (i, t, n) => {
          var a, Mn, o, Rn, R, Pe;
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.MessageHandler = void 0;
          var e = n(1);
          const s = {
            UNKNOWN: 0,
            DATA: 1,
            ERROR: 2
          }, p = {
            UNKNOWN: 0,
            CANCEL: 1,
            CANCEL_COMPLETE: 2,
            CLOSE: 3,
            ENQUEUE: 4,
            ERROR: 5,
            PULL: 6,
            PULL_COMPLETE: 7,
            START_COMPLETE: 8
          };
          function f(T) {
            switch (T instanceof Error || typeof T == "object" && T !== null || (0, e.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), T.name) {
              case "AbortException":
                return new e.AbortException(T.message);
              case "MissingPDFException":
                return new e.MissingPDFException(T.message);
              case "PasswordException":
                return new e.PasswordException(T.message, T.code);
              case "UnexpectedResponseException":
                return new e.UnexpectedResponseException(T.message, T.status);
              case "UnknownErrorException":
                return new e.UnknownErrorException(T.message, T.details);
              default:
                return new e.UnknownErrorException(T.message, T.toString());
            }
          }
          class A {
            constructor(P, m, C) {
              W(this, a);
              W(this, o);
              W(this, R);
              this.sourceName = P, this.targetName = m, this.comObj = C, this.callbackId = 1, this.streamId = 1, this.streamSinks = /* @__PURE__ */ Object.create(null), this.streamControllers = /* @__PURE__ */ Object.create(null), this.callbackCapabilities = /* @__PURE__ */ Object.create(null), this.actionHandler = /* @__PURE__ */ Object.create(null), this._onComObjOnMessage = (x) => {
                const E = x.data;
                if (E.targetName !== this.sourceName)
                  return;
                if (E.stream) {
                  J(this, o, Rn).call(this, E);
                  return;
                }
                if (E.callback) {
                  const g = E.callbackId, v = this.callbackCapabilities[g];
                  if (!v)
                    throw new Error(`Cannot resolve callback ${g}`);
                  if (delete this.callbackCapabilities[g], E.callback === s.DATA)
                    v.resolve(E.data);
                  else if (E.callback === s.ERROR)
                    v.reject(f(E.reason));
                  else
                    throw new Error("Unexpected callback case");
                  return;
                }
                const S = this.actionHandler[E.action];
                if (!S)
                  throw new Error(`Unknown action from worker: ${E.action}`);
                if (E.callbackId) {
                  const g = this.sourceName, v = E.sourceName;
                  new Promise(function($) {
                    $(S(E.data));
                  }).then(function($) {
                    C.postMessage({
                      sourceName: g,
                      targetName: v,
                      callback: s.DATA,
                      callbackId: E.callbackId,
                      data: $
                    });
                  }, function($) {
                    C.postMessage({
                      sourceName: g,
                      targetName: v,
                      callback: s.ERROR,
                      callbackId: E.callbackId,
                      reason: f($)
                    });
                  });
                  return;
                }
                if (E.streamId) {
                  J(this, a, Mn).call(this, E);
                  return;
                }
                S(E.data);
              }, C.addEventListener("message", this._onComObjOnMessage);
            }
            on(P, m) {
              const C = this.actionHandler;
              if (C[P])
                throw new Error(`There is already an actionName called "${P}"`);
              C[P] = m;
            }
            send(P, m, C) {
              this.comObj.postMessage({
                sourceName: this.sourceName,
                targetName: this.targetName,
                action: P,
                data: m
              }, C);
            }
            sendWithPromise(P, m, C) {
              const x = this.callbackId++, E = new e.PromiseCapability();
              this.callbackCapabilities[x] = E;
              try {
                this.comObj.postMessage({
                  sourceName: this.sourceName,
                  targetName: this.targetName,
                  action: P,
                  callbackId: x,
                  data: m
                }, C);
              } catch (S) {
                E.reject(S);
              }
              return E.promise;
            }
            sendWithStream(P, m, C, x) {
              const E = this.streamId++, S = this.sourceName, g = this.targetName, v = this.comObj;
              return new ReadableStream({
                start: ($) => {
                  const M = new e.PromiseCapability();
                  return this.streamControllers[E] = {
                    controller: $,
                    startCall: M,
                    pullCall: null,
                    cancelCall: null,
                    isClosed: !1
                  }, v.postMessage({
                    sourceName: S,
                    targetName: g,
                    action: P,
                    streamId: E,
                    data: m,
                    desiredSize: $.desiredSize
                  }, x), M.promise;
                },
                pull: ($) => {
                  const M = new e.PromiseCapability();
                  return this.streamControllers[E].pullCall = M, v.postMessage({
                    sourceName: S,
                    targetName: g,
                    stream: p.PULL,
                    streamId: E,
                    desiredSize: $.desiredSize
                  }), M.promise;
                },
                cancel: ($) => {
                  (0, e.assert)($ instanceof Error, "cancel must have a valid reason");
                  const M = new e.PromiseCapability();
                  return this.streamControllers[E].cancelCall = M, this.streamControllers[E].isClosed = !0, v.postMessage({
                    sourceName: S,
                    targetName: g,
                    stream: p.CANCEL,
                    streamId: E,
                    reason: f($)
                  }), M.promise;
                }
              }, C);
            }
            destroy() {
              this.comObj.removeEventListener("message", this._onComObjOnMessage);
            }
          }
          a = new WeakSet(), Mn = function(P) {
            const m = P.streamId, C = this.sourceName, x = P.sourceName, E = this.comObj, S = this, g = this.actionHandler[P.action], v = {
              enqueue($, M = 1, _) {
                if (this.isCancelled)
                  return;
                const N = this.desiredSize;
                this.desiredSize -= M, N > 0 && this.desiredSize <= 0 && (this.sinkCapability = new e.PromiseCapability(), this.ready = this.sinkCapability.promise), E.postMessage({
                  sourceName: C,
                  targetName: x,
                  stream: p.ENQUEUE,
                  streamId: m,
                  chunk: $
                }, _);
              },
              close() {
                this.isCancelled || (this.isCancelled = !0, E.postMessage({
                  sourceName: C,
                  targetName: x,
                  stream: p.CLOSE,
                  streamId: m
                }), delete S.streamSinks[m]);
              },
              error($) {
                (0, e.assert)($ instanceof Error, "error must have a valid reason"), !this.isCancelled && (this.isCancelled = !0, E.postMessage({
                  sourceName: C,
                  targetName: x,
                  stream: p.ERROR,
                  streamId: m,
                  reason: f($)
                }));
              },
              sinkCapability: new e.PromiseCapability(),
              onPull: null,
              onCancel: null,
              isCancelled: !1,
              desiredSize: P.desiredSize,
              ready: null
            };
            v.sinkCapability.resolve(), v.ready = v.sinkCapability.promise, this.streamSinks[m] = v, new Promise(function($) {
              $(g(P.data, v));
            }).then(function() {
              E.postMessage({
                sourceName: C,
                targetName: x,
                stream: p.START_COMPLETE,
                streamId: m,
                success: !0
              });
            }, function($) {
              E.postMessage({
                sourceName: C,
                targetName: x,
                stream: p.START_COMPLETE,
                streamId: m,
                reason: f($)
              });
            });
          }, o = new WeakSet(), Rn = function(P) {
            const m = P.streamId, C = this.sourceName, x = P.sourceName, E = this.comObj, S = this.streamControllers[m], g = this.streamSinks[m];
            switch (P.stream) {
              case p.START_COMPLETE:
                P.success ? S.startCall.resolve() : S.startCall.reject(f(P.reason));
                break;
              case p.PULL_COMPLETE:
                P.success ? S.pullCall.resolve() : S.pullCall.reject(f(P.reason));
                break;
              case p.PULL:
                if (!g) {
                  E.postMessage({
                    sourceName: C,
                    targetName: x,
                    stream: p.PULL_COMPLETE,
                    streamId: m,
                    success: !0
                  });
                  break;
                }
                g.desiredSize <= 0 && P.desiredSize > 0 && g.sinkCapability.resolve(), g.desiredSize = P.desiredSize, new Promise(function(v) {
                  var $;
                  v(($ = g.onPull) == null ? void 0 : $.call(g));
                }).then(function() {
                  E.postMessage({
                    sourceName: C,
                    targetName: x,
                    stream: p.PULL_COMPLETE,
                    streamId: m,
                    success: !0
                  });
                }, function(v) {
                  E.postMessage({
                    sourceName: C,
                    targetName: x,
                    stream: p.PULL_COMPLETE,
                    streamId: m,
                    reason: f(v)
                  });
                });
                break;
              case p.ENQUEUE:
                if ((0, e.assert)(S, "enqueue should have stream controller"), S.isClosed)
                  break;
                S.controller.enqueue(P.chunk);
                break;
              case p.CLOSE:
                if ((0, e.assert)(S, "close should have stream controller"), S.isClosed)
                  break;
                S.isClosed = !0, S.controller.close(), J(this, R, Pe).call(this, S, m);
                break;
              case p.ERROR:
                (0, e.assert)(S, "error should have stream controller"), S.controller.error(f(P.reason)), J(this, R, Pe).call(this, S, m);
                break;
              case p.CANCEL_COMPLETE:
                P.success ? S.cancelCall.resolve() : S.cancelCall.reject(f(P.reason)), J(this, R, Pe).call(this, S, m);
                break;
              case p.CANCEL:
                if (!g)
                  break;
                new Promise(function(v) {
                  var $;
                  v(($ = g.onCancel) == null ? void 0 : $.call(g, f(P.reason)));
                }).then(function() {
                  E.postMessage({
                    sourceName: C,
                    targetName: x,
                    stream: p.CANCEL_COMPLETE,
                    streamId: m,
                    success: !0
                  });
                }, function(v) {
                  E.postMessage({
                    sourceName: C,
                    targetName: x,
                    stream: p.CANCEL_COMPLETE,
                    streamId: m,
                    reason: f(v)
                  });
                }), g.sinkCapability.reject(f(P.reason)), g.isCancelled = !0, delete this.streamSinks[m];
                break;
              default:
                throw new Error("Unexpected stream case");
            }
          }, R = new WeakSet(), Pe = async function(P, m) {
            var C, x, E;
            await Promise.allSettled([(C = P.startCall) == null ? void 0 : C.promise, (x = P.pullCall) == null ? void 0 : x.promise, (E = P.cancelCall) == null ? void 0 : E.promise]), delete this.streamControllers[m];
          }, t.MessageHandler = A;
        },
        /* 16 */
        /***/
        (i, t, n) => {
          var p, f;
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.Metadata = void 0;
          var e = n(1);
          class s {
            constructor({
              parsedData: a,
              rawData: h
            }) {
              W(this, p, void 0);
              W(this, f, void 0);
              ot(this, p, a), ot(this, f, h);
            }
            getRaw() {
              return r(this, f);
            }
            get(a) {
              return r(this, p).get(a) ?? null;
            }
            getAll() {
              return (0, e.objectFromMap)(r(this, p));
            }
            has(a) {
              return r(this, p).has(a);
            }
          }
          p = new WeakMap(), f = new WeakMap(), t.Metadata = s;
        },
        /* 17 */
        /***/
        (i, t, n) => {
          var a, h, o, F, R, w, tn;
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.OptionalContentConfig = void 0;
          var e = n(1), s = n(8);
          const p = Symbol("INTERNAL");
          class f {
            constructor(m, C) {
              W(this, a, !0);
              this.name = m, this.intent = C;
            }
            get visible() {
              return r(this, a);
            }
            _setVisible(m, C) {
              m !== p && (0, e.unreachable)("Internal method `_setVisible` called."), ot(this, a, C);
            }
          }
          a = new WeakMap();
          class A {
            constructor(m) {
              W(this, w);
              W(this, h, null);
              W(this, o, /* @__PURE__ */ new Map());
              W(this, F, null);
              W(this, R, null);
              if (this.name = null, this.creator = null, m !== null) {
                this.name = m.name, this.creator = m.creator, ot(this, R, m.order);
                for (const C of m.groups)
                  r(this, o).set(C.id, new f(C.name, C.intent));
                if (m.baseState === "OFF")
                  for (const C of r(this, o).values())
                    C._setVisible(p, !1);
                for (const C of m.on)
                  r(this, o).get(C)._setVisible(p, !0);
                for (const C of m.off)
                  r(this, o).get(C)._setVisible(p, !1);
                ot(this, F, this.getHash());
              }
            }
            isVisible(m) {
              if (r(this, o).size === 0)
                return !0;
              if (!m)
                return (0, e.warn)("Optional content group not defined."), !0;
              if (m.type === "OCG")
                return r(this, o).has(m.id) ? r(this, o).get(m.id).visible : ((0, e.warn)(`Optional content group not found: ${m.id}`), !0);
              if (m.type === "OCMD") {
                if (m.expression)
                  return J(this, w, tn).call(this, m.expression);
                if (!m.policy || m.policy === "AnyOn") {
                  for (const C of m.ids) {
                    if (!r(this, o).has(C))
                      return (0, e.warn)(`Optional content group not found: ${C}`), !0;
                    if (r(this, o).get(C).visible)
                      return !0;
                  }
                  return !1;
                } else if (m.policy === "AllOn") {
                  for (const C of m.ids) {
                    if (!r(this, o).has(C))
                      return (0, e.warn)(`Optional content group not found: ${C}`), !0;
                    if (!r(this, o).get(C).visible)
                      return !1;
                  }
                  return !0;
                } else if (m.policy === "AnyOff") {
                  for (const C of m.ids) {
                    if (!r(this, o).has(C))
                      return (0, e.warn)(`Optional content group not found: ${C}`), !0;
                    if (!r(this, o).get(C).visible)
                      return !0;
                  }
                  return !1;
                } else if (m.policy === "AllOff") {
                  for (const C of m.ids) {
                    if (!r(this, o).has(C))
                      return (0, e.warn)(`Optional content group not found: ${C}`), !0;
                    if (r(this, o).get(C).visible)
                      return !1;
                  }
                  return !0;
                }
                return (0, e.warn)(`Unknown optional content policy ${m.policy}.`), !0;
              }
              return (0, e.warn)(`Unknown group type ${m.type}.`), !0;
            }
            setVisibility(m, C = !0) {
              if (!r(this, o).has(m)) {
                (0, e.warn)(`Optional content group not found: ${m}`);
                return;
              }
              r(this, o).get(m)._setVisible(p, !!C), ot(this, h, null);
            }
            get hasInitialVisibility() {
              return r(this, F) === null || this.getHash() === r(this, F);
            }
            getOrder() {
              return r(this, o).size ? r(this, R) ? r(this, R).slice() : [...r(this, o).keys()] : null;
            }
            getGroups() {
              return r(this, o).size > 0 ? (0, e.objectFromMap)(r(this, o)) : null;
            }
            getGroup(m) {
              return r(this, o).get(m) || null;
            }
            getHash() {
              if (r(this, h) !== null)
                return r(this, h);
              const m = new s.MurmurHash3_64();
              for (const [C, x] of r(this, o))
                m.update(`${C}:${x.visible}`);
              return ot(this, h, m.hexdigest());
            }
          }
          h = new WeakMap(), o = new WeakMap(), F = new WeakMap(), R = new WeakMap(), w = new WeakSet(), tn = function(m) {
            const C = m.length;
            if (C < 2)
              return !0;
            const x = m[0];
            for (let E = 1; E < C; E++) {
              const S = m[E];
              let g;
              if (Array.isArray(S))
                g = J(this, w, tn).call(this, S);
              else if (r(this, o).has(S))
                g = r(this, o).get(S).visible;
              else
                return (0, e.warn)(`Optional content group not found: ${S}`), !0;
              switch (x) {
                case "And":
                  if (!g)
                    return !1;
                  break;
                case "Or":
                  if (g)
                    return !0;
                  break;
                case "Not":
                  return !g;
                default:
                  return !0;
              }
            }
            return x === "And";
          }, t.OptionalContentConfig = A;
        },
        /* 18 */
        /***/
        (i, t, n) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.PDFDataTransportStream = void 0;
          var e = n(1), s = n(6);
          class p {
            constructor({
              length: h,
              initialData: o,
              progressiveDone: F = !1,
              contentDispositionFilename: R = null,
              disableRange: w = !1,
              disableStream: T = !1
            }, P) {
              if ((0, e.assert)(P, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'), this._queuedChunks = [], this._progressiveDone = F, this._contentDispositionFilename = R, (o == null ? void 0 : o.length) > 0) {
                const m = o instanceof Uint8Array && o.byteLength === o.buffer.byteLength ? o.buffer : new Uint8Array(o).buffer;
                this._queuedChunks.push(m);
              }
              this._pdfDataRangeTransport = P, this._isStreamingSupported = !T, this._isRangeSupported = !w, this._contentLength = h, this._fullRequestReader = null, this._rangeReaders = [], this._pdfDataRangeTransport.addRangeListener((m, C) => {
                this._onReceiveData({
                  begin: m,
                  chunk: C
                });
              }), this._pdfDataRangeTransport.addProgressListener((m, C) => {
                this._onProgress({
                  loaded: m,
                  total: C
                });
              }), this._pdfDataRangeTransport.addProgressiveReadListener((m) => {
                this._onReceiveData({
                  chunk: m
                });
              }), this._pdfDataRangeTransport.addProgressiveDoneListener(() => {
                this._onProgressiveDone();
              }), this._pdfDataRangeTransport.transportReady();
            }
            _onReceiveData({
              begin: h,
              chunk: o
            }) {
              const F = o instanceof Uint8Array && o.byteLength === o.buffer.byteLength ? o.buffer : new Uint8Array(o).buffer;
              if (h === void 0)
                this._fullRequestReader ? this._fullRequestReader._enqueue(F) : this._queuedChunks.push(F);
              else {
                const R = this._rangeReaders.some(function(w) {
                  return w._begin !== h ? !1 : (w._enqueue(F), !0);
                });
                (0, e.assert)(R, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");
              }
            }
            get _progressiveDataLength() {
              var h;
              return ((h = this._fullRequestReader) == null ? void 0 : h._loaded) ?? 0;
            }
            _onProgress(h) {
              var o, F, R, w;
              h.total === void 0 ? (F = (o = this._rangeReaders[0]) == null ? void 0 : o.onProgress) == null || F.call(o, {
                loaded: h.loaded
              }) : (w = (R = this._fullRequestReader) == null ? void 0 : R.onProgress) == null || w.call(R, {
                loaded: h.loaded,
                total: h.total
              });
            }
            _onProgressiveDone() {
              var h;
              (h = this._fullRequestReader) == null || h.progressiveDone(), this._progressiveDone = !0;
            }
            _removeRangeReader(h) {
              const o = this._rangeReaders.indexOf(h);
              o >= 0 && this._rangeReaders.splice(o, 1);
            }
            getFullReader() {
              (0, e.assert)(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
              const h = this._queuedChunks;
              return this._queuedChunks = null, new f(this, h, this._progressiveDone, this._contentDispositionFilename);
            }
            getRangeReader(h, o) {
              if (o <= this._progressiveDataLength)
                return null;
              const F = new A(this, h, o);
              return this._pdfDataRangeTransport.requestDataRange(h, o), this._rangeReaders.push(F), F;
            }
            cancelAllRequests(h) {
              var o;
              (o = this._fullRequestReader) == null || o.cancel(h);
              for (const F of this._rangeReaders.slice(0))
                F.cancel(h);
              this._pdfDataRangeTransport.abort();
            }
          }
          t.PDFDataTransportStream = p;
          class f {
            constructor(h, o, F = !1, R = null) {
              this._stream = h, this._done = F || !1, this._filename = (0, s.isPdfFile)(R) ? R : null, this._queuedChunks = o || [], this._loaded = 0;
              for (const w of this._queuedChunks)
                this._loaded += w.byteLength;
              this._requests = [], this._headersReady = Promise.resolve(), h._fullRequestReader = this, this.onProgress = null;
            }
            _enqueue(h) {
              this._done || (this._requests.length > 0 ? this._requests.shift().resolve({
                value: h,
                done: !1
              }) : this._queuedChunks.push(h), this._loaded += h.byteLength);
            }
            get headersReady() {
              return this._headersReady;
            }
            get filename() {
              return this._filename;
            }
            get isRangeSupported() {
              return this._stream._isRangeSupported;
            }
            get isStreamingSupported() {
              return this._stream._isStreamingSupported;
            }
            get contentLength() {
              return this._stream._contentLength;
            }
            async read() {
              if (this._queuedChunks.length > 0)
                return {
                  value: this._queuedChunks.shift(),
                  done: !1
                };
              if (this._done)
                return {
                  value: void 0,
                  done: !0
                };
              const h = new e.PromiseCapability();
              return this._requests.push(h), h.promise;
            }
            cancel(h) {
              this._done = !0;
              for (const o of this._requests)
                o.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0;
            }
            progressiveDone() {
              this._done || (this._done = !0);
            }
          }
          class A {
            constructor(h, o, F) {
              this._stream = h, this._begin = o, this._end = F, this._queuedChunk = null, this._requests = [], this._done = !1, this.onProgress = null;
            }
            _enqueue(h) {
              if (!this._done) {
                if (this._requests.length === 0)
                  this._queuedChunk = h;
                else {
                  this._requests.shift().resolve({
                    value: h,
                    done: !1
                  });
                  for (const F of this._requests)
                    F.resolve({
                      value: void 0,
                      done: !0
                    });
                  this._requests.length = 0;
                }
                this._done = !0, this._stream._removeRangeReader(this);
              }
            }
            get isStreamingSupported() {
              return !1;
            }
            async read() {
              if (this._queuedChunk) {
                const o = this._queuedChunk;
                return this._queuedChunk = null, {
                  value: o,
                  done: !1
                };
              }
              if (this._done)
                return {
                  value: void 0,
                  done: !0
                };
              const h = new e.PromiseCapability();
              return this._requests.push(h), h.promise;
            }
            cancel(h) {
              this._done = !0;
              for (const o of this._requests)
                o.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._stream._removeRangeReader(this);
            }
          }
        },
        /* 19 */
        /***/
        (i, t, n) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.PDFFetchStream = void 0;
          var e = n(1), s = n(20);
          function p(F, R, w) {
            return {
              method: "GET",
              headers: F,
              signal: w.signal,
              mode: "cors",
              credentials: R ? "include" : "same-origin",
              redirect: "follow"
            };
          }
          function f(F) {
            const R = new Headers();
            for (const w in F) {
              const T = F[w];
              T !== void 0 && R.append(w, T);
            }
            return R;
          }
          function A(F) {
            return F instanceof Uint8Array ? F.buffer : F instanceof ArrayBuffer ? F : ((0, e.warn)(`getArrayBuffer - unexpected data format: ${F}`), new Uint8Array(F).buffer);
          }
          class a {
            constructor(R) {
              this.source = R, this.isHttp = /^https?:/i.test(R.url), this.httpHeaders = this.isHttp && R.httpHeaders || {}, this._fullRequestReader = null, this._rangeRequestReaders = [];
            }
            get _progressiveDataLength() {
              var R;
              return ((R = this._fullRequestReader) == null ? void 0 : R._loaded) ?? 0;
            }
            getFullReader() {
              return (0, e.assert)(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new h(this), this._fullRequestReader;
            }
            getRangeReader(R, w) {
              if (w <= this._progressiveDataLength)
                return null;
              const T = new o(this, R, w);
              return this._rangeRequestReaders.push(T), T;
            }
            cancelAllRequests(R) {
              var w;
              (w = this._fullRequestReader) == null || w.cancel(R);
              for (const T of this._rangeRequestReaders.slice(0))
                T.cancel(R);
            }
          }
          t.PDFFetchStream = a;
          class h {
            constructor(R) {
              this._stream = R, this._reader = null, this._loaded = 0, this._filename = null;
              const w = R.source;
              this._withCredentials = w.withCredentials || !1, this._contentLength = w.length, this._headersCapability = new e.PromiseCapability(), this._disableRange = w.disableRange || !1, this._rangeChunkSize = w.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._abortController = new AbortController(), this._isStreamingSupported = !w.disableStream, this._isRangeSupported = !w.disableRange, this._headers = f(this._stream.httpHeaders);
              const T = w.url;
              fetch(T, p(this._headers, this._withCredentials, this._abortController)).then((P) => {
                if (!(0, s.validateResponseStatus)(P.status))
                  throw (0, s.createResponseStatusError)(P.status, T);
                this._reader = P.body.getReader(), this._headersCapability.resolve();
                const m = (E) => P.headers.get(E), {
                  allowRangeRequests: C,
                  suggestedLength: x
                } = (0, s.validateRangeRequestCapabilities)({
                  getResponseHeader: m,
                  isHttp: this._stream.isHttp,
                  rangeChunkSize: this._rangeChunkSize,
                  disableRange: this._disableRange
                });
                this._isRangeSupported = C, this._contentLength = x || this._contentLength, this._filename = (0, s.extractFilenameFromHeader)(m), !this._isStreamingSupported && this._isRangeSupported && this.cancel(new e.AbortException("Streaming is disabled."));
              }).catch(this._headersCapability.reject), this.onProgress = null;
            }
            get headersReady() {
              return this._headersCapability.promise;
            }
            get filename() {
              return this._filename;
            }
            get contentLength() {
              return this._contentLength;
            }
            get isRangeSupported() {
              return this._isRangeSupported;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              var T;
              await this._headersCapability.promise;
              const {
                value: R,
                done: w
              } = await this._reader.read();
              return w ? {
                value: R,
                done: w
              } : (this._loaded += R.byteLength, (T = this.onProgress) == null || T.call(this, {
                loaded: this._loaded,
                total: this._contentLength
              }), {
                value: A(R),
                done: !1
              });
            }
            cancel(R) {
              var w;
              (w = this._reader) == null || w.cancel(R), this._abortController.abort();
            }
          }
          class o {
            constructor(R, w, T) {
              this._stream = R, this._reader = null, this._loaded = 0;
              const P = R.source;
              this._withCredentials = P.withCredentials || !1, this._readCapability = new e.PromiseCapability(), this._isStreamingSupported = !P.disableStream, this._abortController = new AbortController(), this._headers = f(this._stream.httpHeaders), this._headers.append("Range", `bytes=${w}-${T - 1}`);
              const m = P.url;
              fetch(m, p(this._headers, this._withCredentials, this._abortController)).then((C) => {
                if (!(0, s.validateResponseStatus)(C.status))
                  throw (0, s.createResponseStatusError)(C.status, m);
                this._readCapability.resolve(), this._reader = C.body.getReader();
              }).catch(this._readCapability.reject), this.onProgress = null;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              var T;
              await this._readCapability.promise;
              const {
                value: R,
                done: w
              } = await this._reader.read();
              return w ? {
                value: R,
                done: w
              } : (this._loaded += R.byteLength, (T = this.onProgress) == null || T.call(this, {
                loaded: this._loaded
              }), {
                value: A(R),
                done: !1
              });
            }
            cancel(R) {
              var w;
              (w = this._reader) == null || w.cancel(R), this._abortController.abort();
            }
          }
        },
        /* 20 */
        /***/
        (i, t, n) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.createResponseStatusError = a, t.extractFilenameFromHeader = A, t.validateRangeRequestCapabilities = f, t.validateResponseStatus = h;
          var e = n(1), s = n(21), p = n(6);
          function f({
            getResponseHeader: o,
            isHttp: F,
            rangeChunkSize: R,
            disableRange: w
          }) {
            const T = {
              allowRangeRequests: !1,
              suggestedLength: void 0
            }, P = parseInt(o("Content-Length"), 10);
            return !Number.isInteger(P) || (T.suggestedLength = P, P <= 2 * R) || w || !F || o("Accept-Ranges") !== "bytes" || (o("Content-Encoding") || "identity") !== "identity" || (T.allowRangeRequests = !0), T;
          }
          function A(o) {
            const F = o("Content-Disposition");
            if (F) {
              let R = (0, s.getFilenameFromContentDispositionHeader)(F);
              if (R.includes("%"))
                try {
                  R = decodeURIComponent(R);
                } catch {
                }
              if ((0, p.isPdfFile)(R))
                return R;
            }
            return null;
          }
          function a(o, F) {
            return o === 404 || o === 0 && F.startsWith("file:") ? new e.MissingPDFException('Missing PDF "' + F + '".') : new e.UnexpectedResponseException(`Unexpected server response (${o}) while retrieving PDF "${F}".`, o);
          }
          function h(o) {
            return o === 200 || o === 206;
          }
        },
        /* 21 */
        /***/
        (i, t, n) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.getFilenameFromContentDispositionHeader = s;
          var e = n(1);
          function s(p) {
            let f = !0, A = a("filename\\*", "i").exec(p);
            if (A) {
              A = A[1];
              let P = R(A);
              return P = unescape(P), P = w(P), P = T(P), o(P);
            }
            if (A = F(p), A) {
              const P = T(A);
              return o(P);
            }
            if (A = a("filename", "i").exec(p), A) {
              A = A[1];
              let P = R(A);
              return P = T(P), o(P);
            }
            function a(P, m) {
              return new RegExp("(?:^|;)\\s*" + P + '\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)', m);
            }
            function h(P, m) {
              if (P) {
                if (!/^[\x00-\xFF]+$/.test(m))
                  return m;
                try {
                  const C = new TextDecoder(P, {
                    fatal: !0
                  }), x = (0, e.stringToBytes)(m);
                  m = C.decode(x), f = !1;
                } catch {
                }
              }
              return m;
            }
            function o(P) {
              return f && /[\x80-\xff]/.test(P) && (P = h("utf-8", P), f && (P = h("iso-8859-1", P))), P;
            }
            function F(P) {
              const m = [];
              let C;
              const x = a("filename\\*((?!0\\d)\\d+)(\\*?)", "ig");
              for (; (C = x.exec(P)) !== null; ) {
                let [, S, g, v] = C;
                if (S = parseInt(S, 10), S in m) {
                  if (S === 0)
                    break;
                  continue;
                }
                m[S] = [g, v];
              }
              const E = [];
              for (let S = 0; S < m.length && S in m; ++S) {
                let [g, v] = m[S];
                v = R(v), g && (v = unescape(v), S === 0 && (v = w(v))), E.push(v);
              }
              return E.join("");
            }
            function R(P) {
              if (P.startsWith('"')) {
                const m = P.slice(1).split('\\"');
                for (let C = 0; C < m.length; ++C) {
                  const x = m[C].indexOf('"');
                  x !== -1 && (m[C] = m[C].slice(0, x), m.length = C + 1), m[C] = m[C].replaceAll(/\\(.)/g, "$1");
                }
                P = m.join('"');
              }
              return P;
            }
            function w(P) {
              const m = P.indexOf("'");
              if (m === -1)
                return P;
              const C = P.slice(0, m), E = P.slice(m + 1).replace(/^[^']*'/, "");
              return h(C, E);
            }
            function T(P) {
              return !P.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(P) ? P : P.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function(m, C, x, E) {
                if (x === "q" || x === "Q")
                  return E = E.replaceAll("_", " "), E = E.replaceAll(/=([0-9a-fA-F]{2})/g, function(S, g) {
                    return String.fromCharCode(parseInt(g, 16));
                  }), h(C, E);
                try {
                  E = atob(E);
                } catch {
                }
                return h(C, E);
              });
            }
            return "";
          }
        },
        /* 22 */
        /***/
        (i, t, n) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.PDFNetworkStream = void 0;
          var e = n(1), s = n(20);
          const p = 200, f = 206;
          function A(R) {
            const w = R.response;
            return typeof w != "string" ? w : (0, e.stringToBytes)(w).buffer;
          }
          class a {
            constructor(w, T = {}) {
              this.url = w, this.isHttp = /^https?:/i.test(w), this.httpHeaders = this.isHttp && T.httpHeaders || /* @__PURE__ */ Object.create(null), this.withCredentials = T.withCredentials || !1, this.currXhrId = 0, this.pendingRequests = /* @__PURE__ */ Object.create(null);
            }
            requestRange(w, T, P) {
              const m = {
                begin: w,
                end: T
              };
              for (const C in P)
                m[C] = P[C];
              return this.request(m);
            }
            requestFull(w) {
              return this.request(w);
            }
            request(w) {
              const T = new XMLHttpRequest(), P = this.currXhrId++, m = this.pendingRequests[P] = {
                xhr: T
              };
              T.open("GET", this.url), T.withCredentials = this.withCredentials;
              for (const C in this.httpHeaders) {
                const x = this.httpHeaders[C];
                x !== void 0 && T.setRequestHeader(C, x);
              }
              return this.isHttp && "begin" in w && "end" in w ? (T.setRequestHeader("Range", `bytes=${w.begin}-${w.end - 1}`), m.expectedStatus = f) : m.expectedStatus = p, T.responseType = "arraybuffer", w.onError && (T.onerror = function(C) {
                w.onError(T.status);
              }), T.onreadystatechange = this.onStateChange.bind(this, P), T.onprogress = this.onProgress.bind(this, P), m.onHeadersReceived = w.onHeadersReceived, m.onDone = w.onDone, m.onError = w.onError, m.onProgress = w.onProgress, T.send(null), P;
            }
            onProgress(w, T) {
              var m;
              const P = this.pendingRequests[w];
              P && ((m = P.onProgress) == null || m.call(P, T));
            }
            onStateChange(w, T) {
              var S, g, v;
              const P = this.pendingRequests[w];
              if (!P)
                return;
              const m = P.xhr;
              if (m.readyState >= 2 && P.onHeadersReceived && (P.onHeadersReceived(), delete P.onHeadersReceived), m.readyState !== 4 || !(w in this.pendingRequests))
                return;
              if (delete this.pendingRequests[w], m.status === 0 && this.isHttp) {
                (S = P.onError) == null || S.call(P, m.status);
                return;
              }
              const C = m.status || p;
              if (!(C === p && P.expectedStatus === f) && C !== P.expectedStatus) {
                (g = P.onError) == null || g.call(P, m.status);
                return;
              }
              const E = A(m);
              if (C === f) {
                const $ = m.getResponseHeader("Content-Range"), M = /bytes (\d+)-(\d+)\/(\d+)/.exec($);
                P.onDone({
                  begin: parseInt(M[1], 10),
                  chunk: E
                });
              } else
                E ? P.onDone({
                  begin: 0,
                  chunk: E
                }) : (v = P.onError) == null || v.call(P, m.status);
            }
            getRequestXhr(w) {
              return this.pendingRequests[w].xhr;
            }
            isPendingRequest(w) {
              return w in this.pendingRequests;
            }
            abortRequest(w) {
              const T = this.pendingRequests[w].xhr;
              delete this.pendingRequests[w], T.abort();
            }
          }
          class h {
            constructor(w) {
              this._source = w, this._manager = new a(w.url, {
                httpHeaders: w.httpHeaders,
                withCredentials: w.withCredentials
              }), this._rangeChunkSize = w.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
            }
            _onRangeRequestReaderClosed(w) {
              const T = this._rangeRequestReaders.indexOf(w);
              T >= 0 && this._rangeRequestReaders.splice(T, 1);
            }
            getFullReader() {
              return (0, e.assert)(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new o(this._manager, this._source), this._fullRequestReader;
            }
            getRangeReader(w, T) {
              const P = new F(this._manager, w, T);
              return P.onClosed = this._onRangeRequestReaderClosed.bind(this), this._rangeRequestReaders.push(P), P;
            }
            cancelAllRequests(w) {
              var T;
              (T = this._fullRequestReader) == null || T.cancel(w);
              for (const P of this._rangeRequestReaders.slice(0))
                P.cancel(w);
            }
          }
          t.PDFNetworkStream = h;
          class o {
            constructor(w, T) {
              this._manager = w;
              const P = {
                onHeadersReceived: this._onHeadersReceived.bind(this),
                onDone: this._onDone.bind(this),
                onError: this._onError.bind(this),
                onProgress: this._onProgress.bind(this)
              };
              this._url = T.url, this._fullRequestId = w.requestFull(P), this._headersReceivedCapability = new e.PromiseCapability(), this._disableRange = T.disableRange || !1, this._contentLength = T.length, this._rangeChunkSize = T.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._isStreamingSupported = !1, this._isRangeSupported = !1, this._cachedChunks = [], this._requests = [], this._done = !1, this._storedError = void 0, this._filename = null, this.onProgress = null;
            }
            _onHeadersReceived() {
              const w = this._fullRequestId, T = this._manager.getRequestXhr(w), P = (x) => T.getResponseHeader(x), {
                allowRangeRequests: m,
                suggestedLength: C
              } = (0, s.validateRangeRequestCapabilities)({
                getResponseHeader: P,
                isHttp: this._manager.isHttp,
                rangeChunkSize: this._rangeChunkSize,
                disableRange: this._disableRange
              });
              m && (this._isRangeSupported = !0), this._contentLength = C || this._contentLength, this._filename = (0, s.extractFilenameFromHeader)(P), this._isRangeSupported && this._manager.abortRequest(w), this._headersReceivedCapability.resolve();
            }
            _onDone(w) {
              if (w && (this._requests.length > 0 ? this._requests.shift().resolve({
                value: w.chunk,
                done: !1
              }) : this._cachedChunks.push(w.chunk)), this._done = !0, !(this._cachedChunks.length > 0)) {
                for (const T of this._requests)
                  T.resolve({
                    value: void 0,
                    done: !0
                  });
                this._requests.length = 0;
              }
            }
            _onError(w) {
              this._storedError = (0, s.createResponseStatusError)(w, this._url), this._headersReceivedCapability.reject(this._storedError);
              for (const T of this._requests)
                T.reject(this._storedError);
              this._requests.length = 0, this._cachedChunks.length = 0;
            }
            _onProgress(w) {
              var T;
              (T = this.onProgress) == null || T.call(this, {
                loaded: w.loaded,
                total: w.lengthComputable ? w.total : this._contentLength
              });
            }
            get filename() {
              return this._filename;
            }
            get isRangeSupported() {
              return this._isRangeSupported;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            get contentLength() {
              return this._contentLength;
            }
            get headersReady() {
              return this._headersReceivedCapability.promise;
            }
            async read() {
              if (this._storedError)
                throw this._storedError;
              if (this._cachedChunks.length > 0)
                return {
                  value: this._cachedChunks.shift(),
                  done: !1
                };
              if (this._done)
                return {
                  value: void 0,
                  done: !0
                };
              const w = new e.PromiseCapability();
              return this._requests.push(w), w.promise;
            }
            cancel(w) {
              this._done = !0, this._headersReceivedCapability.reject(w);
              for (const T of this._requests)
                T.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._manager.isPendingRequest(this._fullRequestId) && this._manager.abortRequest(this._fullRequestId), this._fullRequestReader = null;
            }
          }
          class F {
            constructor(w, T, P) {
              this._manager = w;
              const m = {
                onDone: this._onDone.bind(this),
                onError: this._onError.bind(this),
                onProgress: this._onProgress.bind(this)
              };
              this._url = w.url, this._requestId = w.requestRange(T, P, m), this._requests = [], this._queuedChunk = null, this._done = !1, this._storedError = void 0, this.onProgress = null, this.onClosed = null;
            }
            _close() {
              var w;
              (w = this.onClosed) == null || w.call(this, this);
            }
            _onDone(w) {
              const T = w.chunk;
              this._requests.length > 0 ? this._requests.shift().resolve({
                value: T,
                done: !1
              }) : this._queuedChunk = T, this._done = !0;
              for (const P of this._requests)
                P.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._close();
            }
            _onError(w) {
              this._storedError = (0, s.createResponseStatusError)(w, this._url);
              for (const T of this._requests)
                T.reject(this._storedError);
              this._requests.length = 0, this._queuedChunk = null;
            }
            _onProgress(w) {
              var T;
              this.isStreamingSupported || (T = this.onProgress) == null || T.call(this, {
                loaded: w.loaded
              });
            }
            get isStreamingSupported() {
              return !1;
            }
            async read() {
              if (this._storedError)
                throw this._storedError;
              if (this._queuedChunk !== null) {
                const T = this._queuedChunk;
                return this._queuedChunk = null, {
                  value: T,
                  done: !1
                };
              }
              if (this._done)
                return {
                  value: void 0,
                  done: !0
                };
              const w = new e.PromiseCapability();
              return this._requests.push(w), w.promise;
            }
            cancel(w) {
              this._done = !0;
              for (const T of this._requests)
                T.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close();
            }
          }
        },
        /* 23 */
        /***/
        (i, t, n) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.PDFNodeStream = void 0;
          var e = n(1), s = n(20);
          const p = /^file:\/\/\/[a-zA-Z]:\//;
          function f(P) {
            const m = require$$5, C = m.parse(P);
            return C.protocol === "file:" || C.host ? C : /^[a-z]:[/\\]/i.test(P) ? m.parse(`file:///${P}`) : (C.host || (C.protocol = "file:"), C);
          }
          class A {
            constructor(m) {
              this.source = m, this.url = f(m.url), this.isHttp = this.url.protocol === "http:" || this.url.protocol === "https:", this.isFsUrl = this.url.protocol === "file:", this.httpHeaders = this.isHttp && m.httpHeaders || {}, this._fullRequestReader = null, this._rangeRequestReaders = [];
            }
            get _progressiveDataLength() {
              var m;
              return ((m = this._fullRequestReader) == null ? void 0 : m._loaded) ?? 0;
            }
            getFullReader() {
              return (0, e.assert)(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = this.isFsUrl ? new w(this) : new F(this), this._fullRequestReader;
            }
            getRangeReader(m, C) {
              if (C <= this._progressiveDataLength)
                return null;
              const x = this.isFsUrl ? new T(this, m, C) : new R(this, m, C);
              return this._rangeRequestReaders.push(x), x;
            }
            cancelAllRequests(m) {
              var C;
              (C = this._fullRequestReader) == null || C.cancel(m);
              for (const x of this._rangeRequestReaders.slice(0))
                x.cancel(m);
            }
          }
          t.PDFNodeStream = A;
          class a {
            constructor(m) {
              this._url = m.url, this._done = !1, this._storedError = null, this.onProgress = null;
              const C = m.source;
              this._contentLength = C.length, this._loaded = 0, this._filename = null, this._disableRange = C.disableRange || !1, this._rangeChunkSize = C.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._isStreamingSupported = !C.disableStream, this._isRangeSupported = !C.disableRange, this._readableStream = null, this._readCapability = new e.PromiseCapability(), this._headersCapability = new e.PromiseCapability();
            }
            get headersReady() {
              return this._headersCapability.promise;
            }
            get filename() {
              return this._filename;
            }
            get contentLength() {
              return this._contentLength;
            }
            get isRangeSupported() {
              return this._isRangeSupported;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              var x;
              if (await this._readCapability.promise, this._done)
                return {
                  value: void 0,
                  done: !0
                };
              if (this._storedError)
                throw this._storedError;
              const m = this._readableStream.read();
              return m === null ? (this._readCapability = new e.PromiseCapability(), this.read()) : (this._loaded += m.length, (x = this.onProgress) == null || x.call(this, {
                loaded: this._loaded,
                total: this._contentLength
              }), {
                value: new Uint8Array(m).buffer,
                done: !1
              });
            }
            cancel(m) {
              if (!this._readableStream) {
                this._error(m);
                return;
              }
              this._readableStream.destroy(m);
            }
            _error(m) {
              this._storedError = m, this._readCapability.resolve();
            }
            _setReadableStream(m) {
              this._readableStream = m, m.on("readable", () => {
                this._readCapability.resolve();
              }), m.on("end", () => {
                m.destroy(), this._done = !0, this._readCapability.resolve();
              }), m.on("error", (C) => {
                this._error(C);
              }), !this._isStreamingSupported && this._isRangeSupported && this._error(new e.AbortException("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
            }
          }
          class h {
            constructor(m) {
              this._url = m.url, this._done = !1, this._storedError = null, this.onProgress = null, this._loaded = 0, this._readableStream = null, this._readCapability = new e.PromiseCapability();
              const C = m.source;
              this._isStreamingSupported = !C.disableStream;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              var x;
              if (await this._readCapability.promise, this._done)
                return {
                  value: void 0,
                  done: !0
                };
              if (this._storedError)
                throw this._storedError;
              const m = this._readableStream.read();
              return m === null ? (this._readCapability = new e.PromiseCapability(), this.read()) : (this._loaded += m.length, (x = this.onProgress) == null || x.call(this, {
                loaded: this._loaded
              }), {
                value: new Uint8Array(m).buffer,
                done: !1
              });
            }
            cancel(m) {
              if (!this._readableStream) {
                this._error(m);
                return;
              }
              this._readableStream.destroy(m);
            }
            _error(m) {
              this._storedError = m, this._readCapability.resolve();
            }
            _setReadableStream(m) {
              this._readableStream = m, m.on("readable", () => {
                this._readCapability.resolve();
              }), m.on("end", () => {
                m.destroy(), this._done = !0, this._readCapability.resolve();
              }), m.on("error", (C) => {
                this._error(C);
              }), this._storedError && this._readableStream.destroy(this._storedError);
            }
          }
          function o(P, m) {
            return {
              protocol: P.protocol,
              auth: P.auth,
              host: P.hostname,
              port: P.port,
              path: P.path,
              method: "GET",
              headers: m
            };
          }
          class F extends a {
            constructor(m) {
              super(m);
              const C = (x) => {
                if (x.statusCode === 404) {
                  const v = new e.MissingPDFException(`Missing PDF "${this._url}".`);
                  this._storedError = v, this._headersCapability.reject(v);
                  return;
                }
                this._headersCapability.resolve(), this._setReadableStream(x);
                const E = (v) => this._readableStream.headers[v.toLowerCase()], {
                  allowRangeRequests: S,
                  suggestedLength: g
                } = (0, s.validateRangeRequestCapabilities)({
                  getResponseHeader: E,
                  isHttp: m.isHttp,
                  rangeChunkSize: this._rangeChunkSize,
                  disableRange: this._disableRange
                });
                this._isRangeSupported = S, this._contentLength = g || this._contentLength, this._filename = (0, s.extractFilenameFromHeader)(E);
              };
              if (this._request = null, this._url.protocol === "http:") {
                const x = require$$5;
                this._request = x.request(o(this._url, m.httpHeaders), C);
              } else {
                const x = require$$5;
                this._request = x.request(o(this._url, m.httpHeaders), C);
              }
              this._request.on("error", (x) => {
                this._storedError = x, this._headersCapability.reject(x);
              }), this._request.end();
            }
          }
          class R extends h {
            constructor(m, C, x) {
              super(m), this._httpHeaders = {};
              for (const S in m.httpHeaders) {
                const g = m.httpHeaders[S];
                g !== void 0 && (this._httpHeaders[S] = g);
              }
              this._httpHeaders.Range = `bytes=${C}-${x - 1}`;
              const E = (S) => {
                if (S.statusCode === 404) {
                  const g = new e.MissingPDFException(`Missing PDF "${this._url}".`);
                  this._storedError = g;
                  return;
                }
                this._setReadableStream(S);
              };
              if (this._request = null, this._url.protocol === "http:") {
                const S = require$$5;
                this._request = S.request(o(this._url, this._httpHeaders), E);
              } else {
                const S = require$$5;
                this._request = S.request(o(this._url, this._httpHeaders), E);
              }
              this._request.on("error", (S) => {
                this._storedError = S;
              }), this._request.end();
            }
          }
          class w extends a {
            constructor(m) {
              super(m);
              let C = decodeURIComponent(this._url.path);
              p.test(this._url.href) && (C = C.replace(/^\//, ""));
              const x = require$$5;
              x.lstat(C, (E, S) => {
                if (E) {
                  E.code === "ENOENT" && (E = new e.MissingPDFException(`Missing PDF "${C}".`)), this._storedError = E, this._headersCapability.reject(E);
                  return;
                }
                this._contentLength = S.size, this._setReadableStream(x.createReadStream(C)), this._headersCapability.resolve();
              });
            }
          }
          class T extends h {
            constructor(m, C, x) {
              super(m);
              let E = decodeURIComponent(this._url.path);
              p.test(this._url.href) && (E = E.replace(/^\//, ""));
              const S = require$$5;
              this._setReadableStream(S.createReadStream(E, {
                start: C,
                end: x - 1
              }));
            }
          }
        },
        /* 24 */
        /***/
        (i, t, n) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.SVGGraphics = void 0;
          var e = n(6), s = n(1);
          const p = {
            fontStyle: "normal",
            fontWeight: "normal",
            fillColor: "#000000"
          }, f = "http://www.w3.org/XML/1998/namespace", A = "http://www.w3.org/1999/xlink", a = ["butt", "round", "square"], h = ["miter", "round", "bevel"], o = function(S, g = "", v = !1) {
            if (URL.createObjectURL && typeof Blob < "u" && !v)
              return URL.createObjectURL(new Blob([S], {
                type: g
              }));
            const $ = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
            let M = `data:${g};base64,`;
            for (let _ = 0, N = S.length; _ < N; _ += 3) {
              const D = S[_] & 255, X = S[_ + 1] & 255, Y = S[_ + 2] & 255, I = D >> 2, U = (D & 3) << 4 | X >> 4, G = _ + 1 < N ? (X & 15) << 2 | Y >> 6 : 64, V = _ + 2 < N ? Y & 63 : 64;
              M += $[I] + $[U] + $[G] + $[V];
            }
            return M;
          }, F = function() {
            const S = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]), g = 12, v = new Int32Array(256);
            for (let Y = 0; Y < 256; Y++) {
              let I = Y;
              for (let U = 0; U < 8; U++)
                I = I & 1 ? 3988292384 ^ I >> 1 & 2147483647 : I >> 1 & 2147483647;
              v[Y] = I;
            }
            function $(Y, I, U) {
              let G = -1;
              for (let V = I; V < U; V++) {
                const H = (G ^ Y[V]) & 255, st = v[H];
                G = G >>> 8 ^ st;
              }
              return G ^ -1;
            }
            function M(Y, I, U, G) {
              let V = G;
              const H = I.length;
              U[V] = H >> 24 & 255, U[V + 1] = H >> 16 & 255, U[V + 2] = H >> 8 & 255, U[V + 3] = H & 255, V += 4, U[V] = Y.charCodeAt(0) & 255, U[V + 1] = Y.charCodeAt(1) & 255, U[V + 2] = Y.charCodeAt(2) & 255, U[V + 3] = Y.charCodeAt(3) & 255, V += 4, U.set(I, V), V += I.length;
              const st = $(U, G + 4, V);
              U[V] = st >> 24 & 255, U[V + 1] = st >> 16 & 255, U[V + 2] = st >> 8 & 255, U[V + 3] = st & 255;
            }
            function _(Y, I, U) {
              let G = 1, V = 0;
              for (let H = I; H < U; ++H)
                G = (G + (Y[H] & 255)) % 65521, V = (V + G) % 65521;
              return V << 16 | G;
            }
            function N(Y) {
              if (!s.isNodeJS)
                return D(Y);
              try {
                const I = parseInt(process.versions.node) >= 8 ? Y : Buffer.from(Y), U = require$$5.deflateSync(I, {
                  level: 9
                });
                return U instanceof Uint8Array ? U : new Uint8Array(U);
              } catch (I) {
                (0, s.warn)("Not compressing PNG because zlib.deflateSync is unavailable: " + I);
              }
              return D(Y);
            }
            function D(Y) {
              let I = Y.length;
              const U = 65535, G = Math.ceil(I / U), V = new Uint8Array(2 + I + G * 5 + 4);
              let H = 0;
              V[H++] = 120, V[H++] = 156;
              let st = 0;
              for (; I > U; )
                V[H++] = 0, V[H++] = 255, V[H++] = 255, V[H++] = 0, V[H++] = 0, V.set(Y.subarray(st, st + U), H), H += U, st += U, I -= U;
              V[H++] = 1, V[H++] = I & 255, V[H++] = I >> 8 & 255, V[H++] = ~I & 65535 & 255, V[H++] = (~I & 65535) >> 8 & 255, V.set(Y.subarray(st), H), H += Y.length - st;
              const dt = _(Y, 0, Y.length);
              return V[H++] = dt >> 24 & 255, V[H++] = dt >> 16 & 255, V[H++] = dt >> 8 & 255, V[H++] = dt & 255, V;
            }
            function X(Y, I, U, G) {
              const V = Y.width, H = Y.height;
              let st, dt, yt;
              const gt = Y.data;
              switch (I) {
                case s.ImageKind.GRAYSCALE_1BPP:
                  dt = 0, st = 1, yt = V + 7 >> 3;
                  break;
                case s.ImageKind.RGB_24BPP:
                  dt = 2, st = 8, yt = V * 3;
                  break;
                case s.ImageKind.RGBA_32BPP:
                  dt = 6, st = 8, yt = V * 4;
                  break;
                default:
                  throw new Error("invalid format");
              }
              const k = new Uint8Array((1 + yt) * H);
              let l = 0, u = 0;
              for (let z = 0; z < H; ++z)
                k[l++] = 0, k.set(gt.subarray(u, u + yt), l), u += yt, l += yt;
              if (I === s.ImageKind.GRAYSCALE_1BPP && G) {
                l = 0;
                for (let z = 0; z < H; z++) {
                  l++;
                  for (let it = 0; it < yt; it++)
                    k[l++] ^= 255;
                }
              }
              const d = new Uint8Array([V >> 24 & 255, V >> 16 & 255, V >> 8 & 255, V & 255, H >> 24 & 255, H >> 16 & 255, H >> 8 & 255, H & 255, st, dt, 0, 0, 0]), b = N(k), y = S.length + g * 3 + d.length + b.length, O = new Uint8Array(y);
              let B = 0;
              return O.set(S, B), B += S.length, M("IHDR", d, O, B), B += g + d.length, M("IDATA", b, O, B), B += g + b.length, M("IEND", new Uint8Array(0), O, B), o(O, "image/png", U);
            }
            return function(I, U, G) {
              const V = I.kind === void 0 ? s.ImageKind.GRAYSCALE_1BPP : I.kind;
              return X(I, V, U, G);
            };
          }();
          class R {
            constructor() {
              this.fontSizeScale = 1, this.fontWeight = p.fontWeight, this.fontSize = 0, this.textMatrix = s.IDENTITY_MATRIX, this.fontMatrix = s.FONT_IDENTITY_MATRIX, this.leading = 0, this.textRenderingMode = s.TextRenderingMode.FILL, this.textMatrixScale = 1, this.x = 0, this.y = 0, this.lineX = 0, this.lineY = 0, this.charSpacing = 0, this.wordSpacing = 0, this.textHScale = 1, this.textRise = 0, this.fillColor = p.fillColor, this.strokeColor = "#000000", this.fillAlpha = 1, this.strokeAlpha = 1, this.lineWidth = 1, this.lineJoin = "", this.lineCap = "", this.miterLimit = 0, this.dashArray = [], this.dashPhase = 0, this.dependencies = [], this.activeClipUrl = null, this.clipGroup = null, this.maskId = "";
            }
            clone() {
              return Object.create(this);
            }
            setCurrentPoint(g, v) {
              this.x = g, this.y = v;
            }
          }
          function w(S) {
            let g = [];
            const v = [];
            for (const $ of S) {
              if ($.fn === "save") {
                g.push({
                  fnId: 92,
                  fn: "group",
                  items: []
                }), v.push(g), g = g.at(-1).items;
                continue;
              }
              $.fn === "restore" ? g = v.pop() : g.push($);
            }
            return g;
          }
          function T(S) {
            if (Number.isInteger(S))
              return S.toString();
            const g = S.toFixed(10);
            let v = g.length - 1;
            if (g[v] !== "0")
              return g;
            do
              v--;
            while (g[v] === "0");
            return g.substring(0, g[v] === "." ? v : v + 1);
          }
          function P(S) {
            if (S[4] === 0 && S[5] === 0) {
              if (S[1] === 0 && S[2] === 0)
                return S[0] === 1 && S[3] === 1 ? "" : `scale(${T(S[0])} ${T(S[3])})`;
              if (S[0] === S[3] && S[1] === -S[2]) {
                const g = Math.acos(S[0]) * 180 / Math.PI;
                return `rotate(${T(g)})`;
              }
            } else if (S[0] === 1 && S[1] === 0 && S[2] === 0 && S[3] === 1)
              return `translate(${T(S[4])} ${T(S[5])})`;
            return `matrix(${T(S[0])} ${T(S[1])} ${T(S[2])} ${T(S[3])} ${T(S[4])} ${T(S[5])})`;
          }
          let m = 0, C = 0, x = 0;
          class E {
            constructor(g, v, $ = !1) {
              (0, e.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."), this.svgFactory = new e.DOMSVGFactory(), this.current = new R(), this.transformMatrix = s.IDENTITY_MATRIX, this.transformStack = [], this.extraStack = [], this.commonObjs = g, this.objs = v, this.pendingClip = null, this.pendingEOFill = !1, this.embedFonts = !1, this.embeddedFonts = /* @__PURE__ */ Object.create(null), this.cssStyle = null, this.forceDataSchema = !!$, this._operatorIdMapping = [];
              for (const M in s.OPS)
                this._operatorIdMapping[s.OPS[M]] = M;
            }
            getObject(g, v = null) {
              return typeof g == "string" ? g.startsWith("g_") ? this.commonObjs.get(g) : this.objs.get(g) : v;
            }
            save() {
              this.transformStack.push(this.transformMatrix);
              const g = this.current;
              this.extraStack.push(g), this.current = g.clone();
            }
            restore() {
              this.transformMatrix = this.transformStack.pop(), this.current = this.extraStack.pop(), this.pendingClip = null, this.tgrp = null;
            }
            group(g) {
              this.save(), this.executeOpTree(g), this.restore();
            }
            loadDependencies(g) {
              const v = g.fnArray, $ = g.argsArray;
              for (let M = 0, _ = v.length; M < _; M++)
                if (v[M] === s.OPS.dependency)
                  for (const N of $[M]) {
                    const D = N.startsWith("g_") ? this.commonObjs : this.objs, X = new Promise((Y) => {
                      D.get(N, Y);
                    });
                    this.current.dependencies.push(X);
                  }
              return Promise.all(this.current.dependencies);
            }
            transform(g, v, $, M, _, N) {
              const D = [g, v, $, M, _, N];
              this.transformMatrix = s.Util.transform(this.transformMatrix, D), this.tgrp = null;
            }
            getSVG(g, v) {
              this.viewport = v;
              const $ = this._initialize(v);
              return this.loadDependencies(g).then(() => (this.transformMatrix = s.IDENTITY_MATRIX, this.executeOpTree(this.convertOpList(g)), $));
            }
            convertOpList(g) {
              const v = this._operatorIdMapping, $ = g.argsArray, M = g.fnArray, _ = [];
              for (let N = 0, D = M.length; N < D; N++) {
                const X = M[N];
                _.push({
                  fnId: X,
                  fn: v[X],
                  args: $[N]
                });
              }
              return w(_);
            }
            executeOpTree(g) {
              for (const v of g) {
                const $ = v.fn, M = v.fnId, _ = v.args;
                switch (M | 0) {
                  case s.OPS.beginText:
                    this.beginText();
                    break;
                  case s.OPS.dependency:
                    break;
                  case s.OPS.setLeading:
                    this.setLeading(_);
                    break;
                  case s.OPS.setLeadingMoveText:
                    this.setLeadingMoveText(_[0], _[1]);
                    break;
                  case s.OPS.setFont:
                    this.setFont(_);
                    break;
                  case s.OPS.showText:
                    this.showText(_[0]);
                    break;
                  case s.OPS.showSpacedText:
                    this.showText(_[0]);
                    break;
                  case s.OPS.endText:
                    this.endText();
                    break;
                  case s.OPS.moveText:
                    this.moveText(_[0], _[1]);
                    break;
                  case s.OPS.setCharSpacing:
                    this.setCharSpacing(_[0]);
                    break;
                  case s.OPS.setWordSpacing:
                    this.setWordSpacing(_[0]);
                    break;
                  case s.OPS.setHScale:
                    this.setHScale(_[0]);
                    break;
                  case s.OPS.setTextMatrix:
                    this.setTextMatrix(_[0], _[1], _[2], _[3], _[4], _[5]);
                    break;
                  case s.OPS.setTextRise:
                    this.setTextRise(_[0]);
                    break;
                  case s.OPS.setTextRenderingMode:
                    this.setTextRenderingMode(_[0]);
                    break;
                  case s.OPS.setLineWidth:
                    this.setLineWidth(_[0]);
                    break;
                  case s.OPS.setLineJoin:
                    this.setLineJoin(_[0]);
                    break;
                  case s.OPS.setLineCap:
                    this.setLineCap(_[0]);
                    break;
                  case s.OPS.setMiterLimit:
                    this.setMiterLimit(_[0]);
                    break;
                  case s.OPS.setFillRGBColor:
                    this.setFillRGBColor(_[0], _[1], _[2]);
                    break;
                  case s.OPS.setStrokeRGBColor:
                    this.setStrokeRGBColor(_[0], _[1], _[2]);
                    break;
                  case s.OPS.setStrokeColorN:
                    this.setStrokeColorN(_);
                    break;
                  case s.OPS.setFillColorN:
                    this.setFillColorN(_);
                    break;
                  case s.OPS.shadingFill:
                    this.shadingFill(_[0]);
                    break;
                  case s.OPS.setDash:
                    this.setDash(_[0], _[1]);
                    break;
                  case s.OPS.setRenderingIntent:
                    this.setRenderingIntent(_[0]);
                    break;
                  case s.OPS.setFlatness:
                    this.setFlatness(_[0]);
                    break;
                  case s.OPS.setGState:
                    this.setGState(_[0]);
                    break;
                  case s.OPS.fill:
                    this.fill();
                    break;
                  case s.OPS.eoFill:
                    this.eoFill();
                    break;
                  case s.OPS.stroke:
                    this.stroke();
                    break;
                  case s.OPS.fillStroke:
                    this.fillStroke();
                    break;
                  case s.OPS.eoFillStroke:
                    this.eoFillStroke();
                    break;
                  case s.OPS.clip:
                    this.clip("nonzero");
                    break;
                  case s.OPS.eoClip:
                    this.clip("evenodd");
                    break;
                  case s.OPS.paintSolidColorImageMask:
                    this.paintSolidColorImageMask();
                    break;
                  case s.OPS.paintImageXObject:
                    this.paintImageXObject(_[0]);
                    break;
                  case s.OPS.paintInlineImageXObject:
                    this.paintInlineImageXObject(_[0]);
                    break;
                  case s.OPS.paintImageMaskXObject:
                    this.paintImageMaskXObject(_[0]);
                    break;
                  case s.OPS.paintFormXObjectBegin:
                    this.paintFormXObjectBegin(_[0], _[1]);
                    break;
                  case s.OPS.paintFormXObjectEnd:
                    this.paintFormXObjectEnd();
                    break;
                  case s.OPS.closePath:
                    this.closePath();
                    break;
                  case s.OPS.closeStroke:
                    this.closeStroke();
                    break;
                  case s.OPS.closeFillStroke:
                    this.closeFillStroke();
                    break;
                  case s.OPS.closeEOFillStroke:
                    this.closeEOFillStroke();
                    break;
                  case s.OPS.nextLine:
                    this.nextLine();
                    break;
                  case s.OPS.transform:
                    this.transform(_[0], _[1], _[2], _[3], _[4], _[5]);
                    break;
                  case s.OPS.constructPath:
                    this.constructPath(_[0], _[1]);
                    break;
                  case s.OPS.endPath:
                    this.endPath();
                    break;
                  case 92:
                    this.group(v.items);
                    break;
                  default:
                    (0, s.warn)(`Unimplemented operator ${$}`);
                    break;
                }
              }
            }
            setWordSpacing(g) {
              this.current.wordSpacing = g;
            }
            setCharSpacing(g) {
              this.current.charSpacing = g;
            }
            nextLine() {
              this.moveText(0, this.current.leading);
            }
            setTextMatrix(g, v, $, M, _, N) {
              const D = this.current;
              D.textMatrix = D.lineMatrix = [g, v, $, M, _, N], D.textMatrixScale = Math.hypot(g, v), D.x = D.lineX = 0, D.y = D.lineY = 0, D.xcoords = [], D.ycoords = [], D.tspan = this.svgFactory.createElement("svg:tspan"), D.tspan.setAttributeNS(null, "font-family", D.fontFamily), D.tspan.setAttributeNS(null, "font-size", `${T(D.fontSize)}px`), D.tspan.setAttributeNS(null, "y", T(-D.y)), D.txtElement = this.svgFactory.createElement("svg:text"), D.txtElement.append(D.tspan);
            }
            beginText() {
              const g = this.current;
              g.x = g.lineX = 0, g.y = g.lineY = 0, g.textMatrix = s.IDENTITY_MATRIX, g.lineMatrix = s.IDENTITY_MATRIX, g.textMatrixScale = 1, g.tspan = this.svgFactory.createElement("svg:tspan"), g.txtElement = this.svgFactory.createElement("svg:text"), g.txtgrp = this.svgFactory.createElement("svg:g"), g.xcoords = [], g.ycoords = [];
            }
            moveText(g, v) {
              const $ = this.current;
              $.x = $.lineX += g, $.y = $.lineY += v, $.xcoords = [], $.ycoords = [], $.tspan = this.svgFactory.createElement("svg:tspan"), $.tspan.setAttributeNS(null, "font-family", $.fontFamily), $.tspan.setAttributeNS(null, "font-size", `${T($.fontSize)}px`), $.tspan.setAttributeNS(null, "y", T(-$.y));
            }
            showText(g) {
              const v = this.current, $ = v.font, M = v.fontSize;
              if (M === 0)
                return;
              const _ = v.fontSizeScale, N = v.charSpacing, D = v.wordSpacing, X = v.fontDirection, Y = v.textHScale * X, I = $.vertical, U = I ? 1 : -1, G = $.defaultVMetrics, V = M * v.fontMatrix[0];
              let H = 0;
              for (const yt of g) {
                if (yt === null) {
                  H += X * D;
                  continue;
                } else if (typeof yt == "number") {
                  H += U * yt * M / 1e3;
                  continue;
                }
                const gt = (yt.isSpace ? D : 0) + N, k = yt.fontChar;
                let l, u, d = yt.width;
                if (I) {
                  let y;
                  const O = yt.vmetric || G;
                  y = yt.vmetric ? O[1] : d * 0.5, y = -y * V;
                  const B = O[2] * V;
                  d = O ? -O[0] : d, l = y / _, u = (H + B) / _;
                } else
                  l = H / _, u = 0;
                (yt.isInFont || $.missingFile) && (v.xcoords.push(v.x + l), I && v.ycoords.push(-v.y + u), v.tspan.textContent += k);
                const b = I ? d * V - gt * X : d * V + gt * X;
                H += b;
              }
              v.tspan.setAttributeNS(null, "x", v.xcoords.map(T).join(" ")), I ? v.tspan.setAttributeNS(null, "y", v.ycoords.map(T).join(" ")) : v.tspan.setAttributeNS(null, "y", T(-v.y)), I ? v.y -= H : v.x += H * Y, v.tspan.setAttributeNS(null, "font-family", v.fontFamily), v.tspan.setAttributeNS(null, "font-size", `${T(v.fontSize)}px`), v.fontStyle !== p.fontStyle && v.tspan.setAttributeNS(null, "font-style", v.fontStyle), v.fontWeight !== p.fontWeight && v.tspan.setAttributeNS(null, "font-weight", v.fontWeight);
              const st = v.textRenderingMode & s.TextRenderingMode.FILL_STROKE_MASK;
              if (st === s.TextRenderingMode.FILL || st === s.TextRenderingMode.FILL_STROKE ? (v.fillColor !== p.fillColor && v.tspan.setAttributeNS(null, "fill", v.fillColor), v.fillAlpha < 1 && v.tspan.setAttributeNS(null, "fill-opacity", v.fillAlpha)) : v.textRenderingMode === s.TextRenderingMode.ADD_TO_PATH ? v.tspan.setAttributeNS(null, "fill", "transparent") : v.tspan.setAttributeNS(null, "fill", "none"), st === s.TextRenderingMode.STROKE || st === s.TextRenderingMode.FILL_STROKE) {
                const yt = 1 / (v.textMatrixScale || 1);
                this._setStrokeAttributes(v.tspan, yt);
              }
              let dt = v.textMatrix;
              v.textRise !== 0 && (dt = dt.slice(), dt[5] += v.textRise), v.txtElement.setAttributeNS(null, "transform", `${P(dt)} scale(${T(Y)}, -1)`), v.txtElement.setAttributeNS(f, "xml:space", "preserve"), v.txtElement.append(v.tspan), v.txtgrp.append(v.txtElement), this._ensureTransformGroup().append(v.txtElement);
            }
            setLeadingMoveText(g, v) {
              this.setLeading(-v), this.moveText(g, v);
            }
            addFontStyle(g) {
              if (!g.data)
                throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');
              this.cssStyle || (this.cssStyle = this.svgFactory.createElement("svg:style"), this.cssStyle.setAttributeNS(null, "type", "text/css"), this.defs.append(this.cssStyle));
              const v = o(g.data, g.mimetype, this.forceDataSchema);
              this.cssStyle.textContent += `@font-face { font-family: "${g.loadedName}"; src: url(${v}); }
`;
            }
            setFont(g) {
              const v = this.current, $ = this.commonObjs.get(g[0]);
              let M = g[1];
              v.font = $, this.embedFonts && !$.missingFile && !this.embeddedFonts[$.loadedName] && (this.addFontStyle($), this.embeddedFonts[$.loadedName] = $), v.fontMatrix = $.fontMatrix || s.FONT_IDENTITY_MATRIX;
              let _ = "normal";
              $.black ? _ = "900" : $.bold && (_ = "bold");
              const N = $.italic ? "italic" : "normal";
              M < 0 ? (M = -M, v.fontDirection = -1) : v.fontDirection = 1, v.fontSize = M, v.fontFamily = $.loadedName, v.fontWeight = _, v.fontStyle = N, v.tspan = this.svgFactory.createElement("svg:tspan"), v.tspan.setAttributeNS(null, "y", T(-v.y)), v.xcoords = [], v.ycoords = [];
            }
            endText() {
              var v;
              const g = this.current;
              g.textRenderingMode & s.TextRenderingMode.ADD_TO_PATH_FLAG && ((v = g.txtElement) != null && v.hasChildNodes()) && (g.element = g.txtElement, this.clip("nonzero"), this.endPath());
            }
            setLineWidth(g) {
              g > 0 && (this.current.lineWidth = g);
            }
            setLineCap(g) {
              this.current.lineCap = a[g];
            }
            setLineJoin(g) {
              this.current.lineJoin = h[g];
            }
            setMiterLimit(g) {
              this.current.miterLimit = g;
            }
            setStrokeAlpha(g) {
              this.current.strokeAlpha = g;
            }
            setStrokeRGBColor(g, v, $) {
              this.current.strokeColor = s.Util.makeHexColor(g, v, $);
            }
            setFillAlpha(g) {
              this.current.fillAlpha = g;
            }
            setFillRGBColor(g, v, $) {
              this.current.fillColor = s.Util.makeHexColor(g, v, $), this.current.tspan = this.svgFactory.createElement("svg:tspan"), this.current.xcoords = [], this.current.ycoords = [];
            }
            setStrokeColorN(g) {
              this.current.strokeColor = this._makeColorN_Pattern(g);
            }
            setFillColorN(g) {
              this.current.fillColor = this._makeColorN_Pattern(g);
            }
            shadingFill(g) {
              const {
                width: v,
                height: $
              } = this.viewport, M = s.Util.inverseTransform(this.transformMatrix), [_, N, D, X] = s.Util.getAxialAlignedBoundingBox([0, 0, v, $], M), Y = this.svgFactory.createElement("svg:rect");
              Y.setAttributeNS(null, "x", _), Y.setAttributeNS(null, "y", N), Y.setAttributeNS(null, "width", D - _), Y.setAttributeNS(null, "height", X - N), Y.setAttributeNS(null, "fill", this._makeShadingPattern(g)), this.current.fillAlpha < 1 && Y.setAttributeNS(null, "fill-opacity", this.current.fillAlpha), this._ensureTransformGroup().append(Y);
            }
            _makeColorN_Pattern(g) {
              return g[0] === "TilingPattern" ? this._makeTilingPattern(g) : this._makeShadingPattern(g);
            }
            _makeTilingPattern(g) {
              const v = g[1], $ = g[2], M = g[3] || s.IDENTITY_MATRIX, [_, N, D, X] = g[4], Y = g[5], I = g[6], U = g[7], G = `shading${x++}`, [V, H, st, dt] = s.Util.normalizeRect([...s.Util.applyTransform([_, N], M), ...s.Util.applyTransform([D, X], M)]), [yt, gt] = s.Util.singularValueDecompose2dScale(M), k = Y * yt, l = I * gt, u = this.svgFactory.createElement("svg:pattern");
              u.setAttributeNS(null, "id", G), u.setAttributeNS(null, "patternUnits", "userSpaceOnUse"), u.setAttributeNS(null, "width", k), u.setAttributeNS(null, "height", l), u.setAttributeNS(null, "x", `${V}`), u.setAttributeNS(null, "y", `${H}`);
              const d = this.svg, b = this.transformMatrix, y = this.current.fillColor, O = this.current.strokeColor, B = this.svgFactory.create(st - V, dt - H);
              if (this.svg = B, this.transformMatrix = M, U === 2) {
                const z = s.Util.makeHexColor(...v);
                this.current.fillColor = z, this.current.strokeColor = z;
              }
              return this.executeOpTree(this.convertOpList($)), this.svg = d, this.transformMatrix = b, this.current.fillColor = y, this.current.strokeColor = O, u.append(B.childNodes[0]), this.defs.append(u), `url(#${G})`;
            }
            _makeShadingPattern(g) {
              switch (typeof g == "string" && (g = this.objs.get(g)), g[0]) {
                case "RadialAxial":
                  const v = `shading${x++}`, $ = g[3];
                  let M;
                  switch (g[1]) {
                    case "axial":
                      const _ = g[4], N = g[5];
                      M = this.svgFactory.createElement("svg:linearGradient"), M.setAttributeNS(null, "id", v), M.setAttributeNS(null, "gradientUnits", "userSpaceOnUse"), M.setAttributeNS(null, "x1", _[0]), M.setAttributeNS(null, "y1", _[1]), M.setAttributeNS(null, "x2", N[0]), M.setAttributeNS(null, "y2", N[1]);
                      break;
                    case "radial":
                      const D = g[4], X = g[5], Y = g[6], I = g[7];
                      M = this.svgFactory.createElement("svg:radialGradient"), M.setAttributeNS(null, "id", v), M.setAttributeNS(null, "gradientUnits", "userSpaceOnUse"), M.setAttributeNS(null, "cx", X[0]), M.setAttributeNS(null, "cy", X[1]), M.setAttributeNS(null, "r", I), M.setAttributeNS(null, "fx", D[0]), M.setAttributeNS(null, "fy", D[1]), M.setAttributeNS(null, "fr", Y);
                      break;
                    default:
                      throw new Error(`Unknown RadialAxial type: ${g[1]}`);
                  }
                  for (const _ of $) {
                    const N = this.svgFactory.createElement("svg:stop");
                    N.setAttributeNS(null, "offset", _[0]), N.setAttributeNS(null, "stop-color", _[1]), M.append(N);
                  }
                  return this.defs.append(M), `url(#${v})`;
                case "Mesh":
                  return (0, s.warn)("Unimplemented pattern Mesh"), null;
                case "Dummy":
                  return "hotpink";
                default:
                  throw new Error(`Unknown IR type: ${g[0]}`);
              }
            }
            setDash(g, v) {
              this.current.dashArray = g, this.current.dashPhase = v;
            }
            constructPath(g, v) {
              const $ = this.current;
              let M = $.x, _ = $.y, N = [], D = 0;
              for (const X of g)
                switch (X | 0) {
                  case s.OPS.rectangle:
                    M = v[D++], _ = v[D++];
                    const Y = v[D++], I = v[D++], U = M + Y, G = _ + I;
                    N.push("M", T(M), T(_), "L", T(U), T(_), "L", T(U), T(G), "L", T(M), T(G), "Z");
                    break;
                  case s.OPS.moveTo:
                    M = v[D++], _ = v[D++], N.push("M", T(M), T(_));
                    break;
                  case s.OPS.lineTo:
                    M = v[D++], _ = v[D++], N.push("L", T(M), T(_));
                    break;
                  case s.OPS.curveTo:
                    M = v[D + 4], _ = v[D + 5], N.push("C", T(v[D]), T(v[D + 1]), T(v[D + 2]), T(v[D + 3]), T(M), T(_)), D += 6;
                    break;
                  case s.OPS.curveTo2:
                    N.push("C", T(M), T(_), T(v[D]), T(v[D + 1]), T(v[D + 2]), T(v[D + 3])), M = v[D + 2], _ = v[D + 3], D += 4;
                    break;
                  case s.OPS.curveTo3:
                    M = v[D + 2], _ = v[D + 3], N.push("C", T(v[D]), T(v[D + 1]), T(M), T(_), T(M), T(_)), D += 4;
                    break;
                  case s.OPS.closePath:
                    N.push("Z");
                    break;
                }
              N = N.join(" "), $.path && g.length > 0 && g[0] !== s.OPS.rectangle && g[0] !== s.OPS.moveTo ? N = $.path.getAttributeNS(null, "d") + N : ($.path = this.svgFactory.createElement("svg:path"), this._ensureTransformGroup().append($.path)), $.path.setAttributeNS(null, "d", N), $.path.setAttributeNS(null, "fill", "none"), $.element = $.path, $.setCurrentPoint(M, _);
            }
            endPath() {
              const g = this.current;
              if (g.path = null, !this.pendingClip)
                return;
              if (!g.element) {
                this.pendingClip = null;
                return;
              }
              const v = `clippath${m++}`, $ = this.svgFactory.createElement("svg:clipPath");
              $.setAttributeNS(null, "id", v), $.setAttributeNS(null, "transform", P(this.transformMatrix));
              const M = g.element.cloneNode(!0);
              if (this.pendingClip === "evenodd" ? M.setAttributeNS(null, "clip-rule", "evenodd") : M.setAttributeNS(null, "clip-rule", "nonzero"), this.pendingClip = null, $.append(M), this.defs.append($), g.activeClipUrl) {
                g.clipGroup = null;
                for (const _ of this.extraStack)
                  _.clipGroup = null;
                $.setAttributeNS(null, "clip-path", g.activeClipUrl);
              }
              g.activeClipUrl = `url(#${v})`, this.tgrp = null;
            }
            clip(g) {
              this.pendingClip = g;
            }
            closePath() {
              const g = this.current;
              if (g.path) {
                const v = `${g.path.getAttributeNS(null, "d")}Z`;
                g.path.setAttributeNS(null, "d", v);
              }
            }
            setLeading(g) {
              this.current.leading = -g;
            }
            setTextRise(g) {
              this.current.textRise = g;
            }
            setTextRenderingMode(g) {
              this.current.textRenderingMode = g;
            }
            setHScale(g) {
              this.current.textHScale = g / 100;
            }
            setRenderingIntent(g) {
            }
            setFlatness(g) {
            }
            setGState(g) {
              for (const [v, $] of g)
                switch (v) {
                  case "LW":
                    this.setLineWidth($);
                    break;
                  case "LC":
                    this.setLineCap($);
                    break;
                  case "LJ":
                    this.setLineJoin($);
                    break;
                  case "ML":
                    this.setMiterLimit($);
                    break;
                  case "D":
                    this.setDash($[0], $[1]);
                    break;
                  case "RI":
                    this.setRenderingIntent($);
                    break;
                  case "FL":
                    this.setFlatness($);
                    break;
                  case "Font":
                    this.setFont($);
                    break;
                  case "CA":
                    this.setStrokeAlpha($);
                    break;
                  case "ca":
                    this.setFillAlpha($);
                    break;
                  default:
                    (0, s.warn)(`Unimplemented graphic state operator ${v}`);
                    break;
                }
            }
            fill() {
              const g = this.current;
              g.element && (g.element.setAttributeNS(null, "fill", g.fillColor), g.element.setAttributeNS(null, "fill-opacity", g.fillAlpha), this.endPath());
            }
            stroke() {
              const g = this.current;
              g.element && (this._setStrokeAttributes(g.element), g.element.setAttributeNS(null, "fill", "none"), this.endPath());
            }
            _setStrokeAttributes(g, v = 1) {
              const $ = this.current;
              let M = $.dashArray;
              v !== 1 && M.length > 0 && (M = M.map(function(_) {
                return v * _;
              })), g.setAttributeNS(null, "stroke", $.strokeColor), g.setAttributeNS(null, "stroke-opacity", $.strokeAlpha), g.setAttributeNS(null, "stroke-miterlimit", T($.miterLimit)), g.setAttributeNS(null, "stroke-linecap", $.lineCap), g.setAttributeNS(null, "stroke-linejoin", $.lineJoin), g.setAttributeNS(null, "stroke-width", T(v * $.lineWidth) + "px"), g.setAttributeNS(null, "stroke-dasharray", M.map(T).join(" ")), g.setAttributeNS(null, "stroke-dashoffset", T(v * $.dashPhase) + "px");
            }
            eoFill() {
              var g;
              (g = this.current.element) == null || g.setAttributeNS(null, "fill-rule", "evenodd"), this.fill();
            }
            fillStroke() {
              this.stroke(), this.fill();
            }
            eoFillStroke() {
              var g;
              (g = this.current.element) == null || g.setAttributeNS(null, "fill-rule", "evenodd"), this.fillStroke();
            }
            closeStroke() {
              this.closePath(), this.stroke();
            }
            closeFillStroke() {
              this.closePath(), this.fillStroke();
            }
            closeEOFillStroke() {
              this.closePath(), this.eoFillStroke();
            }
            paintSolidColorImageMask() {
              const g = this.svgFactory.createElement("svg:rect");
              g.setAttributeNS(null, "x", "0"), g.setAttributeNS(null, "y", "0"), g.setAttributeNS(null, "width", "1px"), g.setAttributeNS(null, "height", "1px"), g.setAttributeNS(null, "fill", this.current.fillColor), this._ensureTransformGroup().append(g);
            }
            paintImageXObject(g) {
              const v = this.getObject(g);
              if (!v) {
                (0, s.warn)(`Dependent image with object ID ${g} is not ready yet`);
                return;
              }
              this.paintInlineImageXObject(v);
            }
            paintInlineImageXObject(g, v) {
              const $ = g.width, M = g.height, _ = F(g, this.forceDataSchema, !!v), N = this.svgFactory.createElement("svg:rect");
              N.setAttributeNS(null, "x", "0"), N.setAttributeNS(null, "y", "0"), N.setAttributeNS(null, "width", T($)), N.setAttributeNS(null, "height", T(M)), this.current.element = N, this.clip("nonzero");
              const D = this.svgFactory.createElement("svg:image");
              D.setAttributeNS(A, "xlink:href", _), D.setAttributeNS(null, "x", "0"), D.setAttributeNS(null, "y", T(-M)), D.setAttributeNS(null, "width", T($) + "px"), D.setAttributeNS(null, "height", T(M) + "px"), D.setAttributeNS(null, "transform", `scale(${T(1 / $)} ${T(-1 / M)})`), v ? v.append(D) : this._ensureTransformGroup().append(D);
            }
            paintImageMaskXObject(g) {
              const v = this.getObject(g.data, g);
              if (v.bitmap) {
                (0, s.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");
                return;
              }
              const $ = this.current, M = v.width, _ = v.height, N = $.fillColor;
              $.maskId = `mask${C++}`;
              const D = this.svgFactory.createElement("svg:mask");
              D.setAttributeNS(null, "id", $.maskId);
              const X = this.svgFactory.createElement("svg:rect");
              X.setAttributeNS(null, "x", "0"), X.setAttributeNS(null, "y", "0"), X.setAttributeNS(null, "width", T(M)), X.setAttributeNS(null, "height", T(_)), X.setAttributeNS(null, "fill", N), X.setAttributeNS(null, "mask", `url(#${$.maskId})`), this.defs.append(D), this._ensureTransformGroup().append(X), this.paintInlineImageXObject(v, D);
            }
            paintFormXObjectBegin(g, v) {
              if (Array.isArray(g) && g.length === 6 && this.transform(g[0], g[1], g[2], g[3], g[4], g[5]), v) {
                const $ = v[2] - v[0], M = v[3] - v[1], _ = this.svgFactory.createElement("svg:rect");
                _.setAttributeNS(null, "x", v[0]), _.setAttributeNS(null, "y", v[1]), _.setAttributeNS(null, "width", T($)), _.setAttributeNS(null, "height", T(M)), this.current.element = _, this.clip("nonzero"), this.endPath();
              }
            }
            paintFormXObjectEnd() {
            }
            _initialize(g) {
              const v = this.svgFactory.create(g.width, g.height), $ = this.svgFactory.createElement("svg:defs");
              v.append($), this.defs = $;
              const M = this.svgFactory.createElement("svg:g");
              return M.setAttributeNS(null, "transform", P(g.transform)), v.append(M), this.svg = M, v;
            }
            _ensureClipGroup() {
              if (!this.current.clipGroup) {
                const g = this.svgFactory.createElement("svg:g");
                g.setAttributeNS(null, "clip-path", this.current.activeClipUrl), this.svg.append(g), this.current.clipGroup = g;
              }
              return this.current.clipGroup;
            }
            _ensureTransformGroup() {
              return this.tgrp || (this.tgrp = this.svgFactory.createElement("svg:g"), this.tgrp.setAttributeNS(null, "transform", P(this.transformMatrix)), this.current.activeClipUrl ? this._ensureClipGroup().append(this.tgrp) : this.svg.append(this.tgrp)), this.tgrp;
            }
          }
          t.SVGGraphics = E;
        },
        /* 25 */
        /***/
        (i, t) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.XfaText = void 0;
          class n {
            static textContent(s) {
              const p = [], f = {
                items: p,
                styles: /* @__PURE__ */ Object.create(null)
              };
              function A(a) {
                var F;
                if (!a)
                  return;
                let h = null;
                const o = a.name;
                if (o === "#text")
                  h = a.value;
                else if (n.shouldBuildText(o))
                  (F = a == null ? void 0 : a.attributes) != null && F.textContent ? h = a.attributes.textContent : a.value && (h = a.value);
                else
                  return;
                if (h !== null && p.push({
                  str: h
                }), !!a.children)
                  for (const R of a.children)
                    A(R);
              }
              return A(s), f;
            }
            static shouldBuildText(s) {
              return !(s === "textarea" || s === "input" || s === "option" || s === "select");
            }
          }
          t.XfaText = n;
        },
        /* 26 */
        /***/
        (i, t, n) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.TextLayerRenderTask = void 0, t.renderTextLayer = P, t.updateTextLayer = m;
          var e = n(1), s = n(6);
          const p = 1e5, f = 30, A = 0.8, a = /* @__PURE__ */ new Map();
          function h(C, x) {
            let E;
            if (x && e.FeatureTest.isOffscreenCanvasSupported)
              E = new OffscreenCanvas(C, C).getContext("2d", {
                alpha: !1
              });
            else {
              const S = document.createElement("canvas");
              S.width = S.height = C, E = S.getContext("2d", {
                alpha: !1
              });
            }
            return E;
          }
          function o(C, x) {
            const E = a.get(C);
            if (E)
              return E;
            const S = h(f, x);
            S.font = `${f}px ${C}`;
            const g = S.measureText("");
            let v = g.fontBoundingBoxAscent, $ = Math.abs(g.fontBoundingBoxDescent);
            if (v) {
              const _ = v / (v + $);
              return a.set(C, _), S.canvas.width = S.canvas.height = 0, _;
            }
            S.strokeStyle = "red", S.clearRect(0, 0, f, f), S.strokeText("g", 0, 0);
            let M = S.getImageData(0, 0, f, f).data;
            $ = 0;
            for (let _ = M.length - 1 - 3; _ >= 0; _ -= 4)
              if (M[_] > 0) {
                $ = Math.ceil(_ / 4 / f);
                break;
              }
            S.clearRect(0, 0, f, f), S.strokeText("A", 0, f), M = S.getImageData(0, 0, f, f).data, v = 0;
            for (let _ = 0, N = M.length; _ < N; _ += 4)
              if (M[_] > 0) {
                v = f - Math.floor(_ / 4 / f);
                break;
              }
            if (S.canvas.width = S.canvas.height = 0, v) {
              const _ = v / (v + $);
              return a.set(C, _), _;
            }
            return a.set(C, A), A;
          }
          function F(C, x, E) {
            const S = document.createElement("span"), g = {
              angle: 0,
              canvasWidth: 0,
              hasText: x.str !== "",
              hasEOL: x.hasEOL,
              fontSize: 0
            };
            C._textDivs.push(S);
            const v = e.Util.transform(C._transform, x.transform);
            let $ = Math.atan2(v[1], v[0]);
            const M = E[x.fontName];
            M.vertical && ($ += Math.PI / 2);
            const _ = Math.hypot(v[2], v[3]), N = _ * o(M.fontFamily, C._isOffscreenCanvasSupported);
            let D, X;
            $ === 0 ? (D = v[4], X = v[5] - N) : (D = v[4] + N * Math.sin($), X = v[5] - N * Math.cos($));
            const Y = "calc(var(--scale-factor)*", I = S.style;
            C._container === C._rootContainer ? (I.left = `${(100 * D / C._pageWidth).toFixed(2)}%`, I.top = `${(100 * X / C._pageHeight).toFixed(2)}%`) : (I.left = `${Y}${D.toFixed(2)}px)`, I.top = `${Y}${X.toFixed(2)}px)`), I.fontSize = `${Y}${_.toFixed(2)}px)`, I.fontFamily = M.fontFamily, g.fontSize = _, S.setAttribute("role", "presentation"), S.textContent = x.str, S.dir = x.dir, C._fontInspectorEnabled && (S.dataset.fontName = x.fontName), $ !== 0 && (g.angle = $ * (180 / Math.PI));
            let U = !1;
            if (x.str.length > 1)
              U = !0;
            else if (x.str !== " " && x.transform[0] !== x.transform[3]) {
              const G = Math.abs(x.transform[0]), V = Math.abs(x.transform[3]);
              G !== V && Math.max(G, V) / Math.min(G, V) > 1.5 && (U = !0);
            }
            U && (g.canvasWidth = M.vertical ? x.height : x.width), C._textDivProperties.set(S, g), C._isReadableStream && C._layoutText(S);
          }
          function R(C) {
            const {
              div: x,
              scale: E,
              properties: S,
              ctx: g,
              prevFontSize: v,
              prevFontFamily: $
            } = C, {
              style: M
            } = x;
            let _ = "";
            if (S.canvasWidth !== 0 && S.hasText) {
              const {
                fontFamily: N
              } = M, {
                canvasWidth: D,
                fontSize: X
              } = S;
              (v !== X || $ !== N) && (g.font = `${X * E}px ${N}`, C.prevFontSize = X, C.prevFontFamily = N);
              const {
                width: Y
              } = g.measureText(x.textContent);
              Y > 0 && (_ = `scaleX(${D * E / Y})`);
            }
            S.angle !== 0 && (_ = `rotate(${S.angle}deg) ${_}`), _.length > 0 && (M.transform = _);
          }
          function w(C) {
            if (C._canceled)
              return;
            const x = C._textDivs, E = C._capability;
            if (x.length > p) {
              E.resolve();
              return;
            }
            if (!C._isReadableStream)
              for (const g of x)
                C._layoutText(g);
            E.resolve();
          }
          class T {
            constructor({
              textContentSource: x,
              container: E,
              viewport: S,
              textDivs: g,
              textDivProperties: v,
              textContentItemsStr: $,
              isOffscreenCanvasSupported: M
            }) {
              var Y;
              this._textContentSource = x, this._isReadableStream = x instanceof ReadableStream, this._container = this._rootContainer = E, this._textDivs = g || [], this._textContentItemsStr = $ || [], this._isOffscreenCanvasSupported = M, this._fontInspectorEnabled = !!((Y = globalThis.FontInspector) != null && Y.enabled), this._reader = null, this._textDivProperties = v || /* @__PURE__ */ new WeakMap(), this._canceled = !1, this._capability = new e.PromiseCapability(), this._layoutTextParams = {
                prevFontSize: null,
                prevFontFamily: null,
                div: null,
                scale: S.scale * (globalThis.devicePixelRatio || 1),
                properties: null,
                ctx: h(0, M)
              };
              const {
                pageWidth: _,
                pageHeight: N,
                pageX: D,
                pageY: X
              } = S.rawDims;
              this._transform = [1, 0, 0, -1, -D, X + N], this._pageWidth = _, this._pageHeight = N, (0, s.setLayerDimensions)(E, S), this._capability.promise.finally(() => {
                this._layoutTextParams = null;
              }).catch(() => {
              });
            }
            get promise() {
              return this._capability.promise;
            }
            cancel() {
              this._canceled = !0, this._reader && (this._reader.cancel(new e.AbortException("TextLayer task cancelled.")).catch(() => {
              }), this._reader = null), this._capability.reject(new e.AbortException("TextLayer task cancelled."));
            }
            _processItems(x, E) {
              for (const S of x) {
                if (S.str === void 0) {
                  if (S.type === "beginMarkedContentProps" || S.type === "beginMarkedContent") {
                    const g = this._container;
                    this._container = document.createElement("span"), this._container.classList.add("markedContent"), S.id !== null && this._container.setAttribute("id", `${S.id}`), g.append(this._container);
                  } else
                    S.type === "endMarkedContent" && (this._container = this._container.parentNode);
                  continue;
                }
                this._textContentItemsStr.push(S.str), F(this, S, E);
              }
            }
            _layoutText(x) {
              const E = this._layoutTextParams.properties = this._textDivProperties.get(x);
              if (this._layoutTextParams.div = x, R(this._layoutTextParams), E.hasText && this._container.append(x), E.hasEOL) {
                const S = document.createElement("br");
                S.setAttribute("role", "presentation"), this._container.append(S);
              }
            }
            _render() {
              const x = new e.PromiseCapability();
              let E = /* @__PURE__ */ Object.create(null);
              if (this._isReadableStream) {
                const S = () => {
                  this._reader.read().then(({
                    value: g,
                    done: v
                  }) => {
                    if (v) {
                      x.resolve();
                      return;
                    }
                    Object.assign(E, g.styles), this._processItems(g.items, E), S();
                  }, x.reject);
                };
                this._reader = this._textContentSource.getReader(), S();
              } else if (this._textContentSource) {
                const {
                  items: S,
                  styles: g
                } = this._textContentSource;
                this._processItems(S, g), x.resolve();
              } else
                throw new Error('No "textContentSource" parameter specified.');
              x.promise.then(() => {
                E = null, w(this);
              }, this._capability.reject);
            }
          }
          t.TextLayerRenderTask = T;
          function P(C) {
            !C.textContentSource && (C.textContent || C.textContentStream) && ((0, s.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."), C.textContentSource = C.textContent || C.textContentStream);
            const {
              container: x,
              viewport: E
            } = C, S = getComputedStyle(x), g = S.getPropertyValue("visibility"), v = parseFloat(S.getPropertyValue("--scale-factor"));
            g === "visible" && (!v || Math.abs(v - E.scale) > 1e-5) && console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");
            const $ = new T(C);
            return $._render(), $;
          }
          function m({
            container: C,
            viewport: x,
            textDivs: E,
            textDivProperties: S,
            isOffscreenCanvasSupported: g,
            mustRotate: v = !0,
            mustRescale: $ = !0
          }) {
            if (v && (0, s.setLayerDimensions)(C, {
              rotation: x.rotation
            }), $) {
              const M = h(0, g), N = {
                prevFontSize: null,
                prevFontFamily: null,
                div: null,
                scale: x.scale * (globalThis.devicePixelRatio || 1),
                properties: null,
                ctx: M
              };
              for (const D of E)
                N.properties = S.get(D), N.div = D, R(N);
            }
          }
        },
        /* 27 */
        /***/
        (i, t, n) => {
          var o, F, R, w, T, P, m, C, x, E, S, en, v, Fe, M, nn, N, sn;
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.AnnotationEditorLayer = void 0;
          var e = n(1), s = n(4), p = n(28), f = n(33), A = n(6), a = n(34);
          const X = class X {
            constructor({
              uiManager: I,
              pageIndex: U,
              div: G,
              accessibilityManager: V,
              annotationLayer: H,
              viewport: st,
              l10n: dt
            }) {
              W(this, S);
              W(this, v);
              W(this, M);
              W(this, N);
              W(this, o, void 0);
              W(this, F, !1);
              W(this, R, null);
              W(this, w, this.pointerup.bind(this));
              W(this, T, this.pointerdown.bind(this));
              W(this, P, /* @__PURE__ */ new Map());
              W(this, m, !1);
              W(this, C, !1);
              W(this, x, !1);
              W(this, E, void 0);
              const yt = [p.FreeTextEditor, f.InkEditor, a.StampEditor];
              if (!X._initialized) {
                X._initialized = !0;
                for (const gt of yt)
                  gt.initialize(dt);
              }
              I.registerEditorTypes(yt), ot(this, E, I), this.pageIndex = U, this.div = G, ot(this, o, V), ot(this, R, H), this.viewport = st, r(this, E).addLayer(this);
            }
            get isEmpty() {
              return r(this, P).size === 0;
            }
            updateToolbar(I) {
              r(this, E).updateToolbar(I);
            }
            updateMode(I = r(this, E).getMode()) {
              J(this, N, sn).call(this), I === e.AnnotationEditorType.INK ? (this.addInkEditorIfNeeded(!1), this.disableClick()) : this.enableClick(), I !== e.AnnotationEditorType.NONE && (this.div.classList.toggle("freeTextEditing", I === e.AnnotationEditorType.FREETEXT), this.div.classList.toggle("inkEditing", I === e.AnnotationEditorType.INK), this.div.classList.toggle("stampEditing", I === e.AnnotationEditorType.STAMP), this.div.hidden = !1);
            }
            addInkEditorIfNeeded(I) {
              if (!I && r(this, E).getMode() !== e.AnnotationEditorType.INK)
                return;
              if (!I) {
                for (const G of r(this, P).values())
                  if (G.isEmpty()) {
                    G.setInBackground();
                    return;
                  }
              }
              J(this, v, Fe).call(this, {
                offsetX: 0,
                offsetY: 0
              }, !1).setInBackground();
            }
            setEditingState(I) {
              r(this, E).setEditingState(I);
            }
            addCommands(I) {
              r(this, E).addCommands(I);
            }
            enable() {
              this.div.style.pointerEvents = "auto";
              const I = /* @__PURE__ */ new Set();
              for (const G of r(this, P).values())
                G.enableEditing(), G.annotationElementId && I.add(G.annotationElementId);
              if (!r(this, R))
                return;
              const U = r(this, R).getEditableAnnotations();
              for (const G of U) {
                if (G.hide(), r(this, E).isDeletedAnnotationElement(G.data.id) || I.has(G.data.id))
                  continue;
                const V = this.deserialize(G);
                V && (this.addOrRebuild(V), V.enableEditing());
              }
            }
            disable() {
              var U;
              ot(this, x, !0), this.div.style.pointerEvents = "none";
              const I = /* @__PURE__ */ new Set();
              for (const G of r(this, P).values()) {
                if (G.disableEditing(), !G.annotationElementId || G.serialize() !== null) {
                  I.add(G.annotationElementId);
                  continue;
                }
                (U = this.getEditableAnnotation(G.annotationElementId)) == null || U.show(), G.remove();
              }
              if (r(this, R)) {
                const G = r(this, R).getEditableAnnotations();
                for (const V of G) {
                  const {
                    id: H
                  } = V.data;
                  I.has(H) || r(this, E).isDeletedAnnotationElement(H) || V.show();
                }
              }
              J(this, N, sn).call(this), this.isEmpty && (this.div.hidden = !0), ot(this, x, !1);
            }
            getEditableAnnotation(I) {
              var U;
              return ((U = r(this, R)) == null ? void 0 : U.getEditableAnnotation(I)) || null;
            }
            setActiveEditor(I) {
              r(this, E).getActive() !== I && r(this, E).setActiveEditor(I);
            }
            enableClick() {
              this.div.addEventListener("pointerdown", r(this, T)), this.div.addEventListener("pointerup", r(this, w));
            }
            disableClick() {
              this.div.removeEventListener("pointerdown", r(this, T)), this.div.removeEventListener("pointerup", r(this, w));
            }
            attach(I) {
              r(this, P).set(I.id, I);
              const {
                annotationElementId: U
              } = I;
              U && r(this, E).isDeletedAnnotationElement(U) && r(this, E).removeDeletedAnnotationElement(I);
            }
            detach(I) {
              var U;
              r(this, P).delete(I.id), (U = r(this, o)) == null || U.removePointerInTextLayer(I.contentDiv), !r(this, x) && I.annotationElementId && r(this, E).addDeletedAnnotationElement(I);
            }
            remove(I) {
              this.detach(I), r(this, E).removeEditor(I), I.div.contains(document.activeElement) && setTimeout(() => {
                r(this, E).focusMainContainer();
              }, 0), I.div.remove(), I.isAttachedToDOM = !1, r(this, C) || this.addInkEditorIfNeeded(!1);
            }
            changeParent(I) {
              var U;
              I.parent !== this && (I.annotationElementId && (r(this, E).addDeletedAnnotationElement(I.annotationElementId), s.AnnotationEditor.deleteAnnotationElement(I), I.annotationElementId = null), this.attach(I), (U = I.parent) == null || U.detach(I), I.setParent(this), I.div && I.isAttachedToDOM && (I.div.remove(), this.div.append(I.div)));
            }
            add(I) {
              if (this.changeParent(I), r(this, E).addEditor(I), this.attach(I), !I.isAttachedToDOM) {
                const U = I.render();
                this.div.append(U), I.isAttachedToDOM = !0;
              }
              I.fixAndSetPosition(), I.onceAdded(), r(this, E).addToAnnotationStorage(I);
            }
            moveEditorInDOM(I) {
              var G;
              if (!I.isAttachedToDOM)
                return;
              const {
                activeElement: U
              } = document;
              I.div.contains(U) && (I._focusEventsAllowed = !1, setTimeout(() => {
                I.div.contains(document.activeElement) ? I._focusEventsAllowed = !0 : (I.div.addEventListener("focusin", () => {
                  I._focusEventsAllowed = !0;
                }, {
                  once: !0
                }), U.focus());
              }, 0)), I._structTreeParentId = (G = r(this, o)) == null ? void 0 : G.moveElementInDOM(this.div, I.div, I.contentDiv, !0);
            }
            addOrRebuild(I) {
              I.needsToBeRebuilt() ? I.rebuild() : this.add(I);
            }
            addUndoableEditor(I) {
              const U = () => I._uiManager.rebuild(I), G = () => {
                I.remove();
              };
              this.addCommands({
                cmd: U,
                undo: G,
                mustExec: !1
              });
            }
            getNextId() {
              return r(this, E).getId();
            }
            pasteEditor(I, U) {
              r(this, E).updateToolbar(I), r(this, E).updateMode(I);
              const {
                offsetX: G,
                offsetY: V
              } = J(this, M, nn).call(this), H = this.getNextId(), st = J(this, S, en).call(this, {
                parent: this,
                id: H,
                x: G,
                y: V,
                uiManager: r(this, E),
                isCentered: !0,
                ...U
              });
              st && this.add(st);
            }
            deserialize(I) {
              switch (I.annotationType ?? I.annotationEditorType) {
                case e.AnnotationEditorType.FREETEXT:
                  return p.FreeTextEditor.deserialize(I, this, r(this, E));
                case e.AnnotationEditorType.INK:
                  return f.InkEditor.deserialize(I, this, r(this, E));
                case e.AnnotationEditorType.STAMP:
                  return a.StampEditor.deserialize(I, this, r(this, E));
              }
              return null;
            }
            addNewEditor() {
              J(this, v, Fe).call(this, J(this, M, nn).call(this), !0);
            }
            setSelected(I) {
              r(this, E).setSelected(I);
            }
            toggleSelected(I) {
              r(this, E).toggleSelected(I);
            }
            isSelected(I) {
              return r(this, E).isSelected(I);
            }
            unselect(I) {
              r(this, E).unselect(I);
            }
            pointerup(I) {
              const {
                isMac: U
              } = e.FeatureTest.platform;
              if (!(I.button !== 0 || I.ctrlKey && U) && I.target === this.div && r(this, m)) {
                if (ot(this, m, !1), !r(this, F)) {
                  ot(this, F, !0);
                  return;
                }
                if (r(this, E).getMode() === e.AnnotationEditorType.STAMP) {
                  r(this, E).unselectAll();
                  return;
                }
                J(this, v, Fe).call(this, I, !1);
              }
            }
            pointerdown(I) {
              if (r(this, m)) {
                ot(this, m, !1);
                return;
              }
              const {
                isMac: U
              } = e.FeatureTest.platform;
              if (I.button !== 0 || I.ctrlKey && U || I.target !== this.div)
                return;
              ot(this, m, !0);
              const G = r(this, E).getActive();
              ot(this, F, !G || G.isEmpty());
            }
            findNewParent(I, U, G) {
              const V = r(this, E).findParent(U, G);
              return V === null || V === this ? !1 : (V.changeParent(I), !0);
            }
            destroy() {
              var I, U;
              ((I = r(this, E).getActive()) == null ? void 0 : I.parent) === this && (r(this, E).commitOrRemove(), r(this, E).setActiveEditor(null));
              for (const G of r(this, P).values())
                (U = r(this, o)) == null || U.removePointerInTextLayer(G.contentDiv), G.setParent(null), G.isAttachedToDOM = !1, G.div.remove();
              this.div = null, r(this, P).clear(), r(this, E).removeLayer(this);
            }
            render({
              viewport: I
            }) {
              this.viewport = I, (0, A.setLayerDimensions)(this.div, I);
              for (const U of r(this, E).getEditors(this.pageIndex))
                this.add(U);
              this.updateMode();
            }
            update({
              viewport: I
            }) {
              r(this, E).commitOrRemove(), this.viewport = I, (0, A.setLayerDimensions)(this.div, {
                rotation: I.rotation
              }), this.updateMode();
            }
            get pageDimensions() {
              const {
                pageWidth: I,
                pageHeight: U
              } = this.viewport.rawDims;
              return [I, U];
            }
          };
          o = new WeakMap(), F = new WeakMap(), R = new WeakMap(), w = new WeakMap(), T = new WeakMap(), P = new WeakMap(), m = new WeakMap(), C = new WeakMap(), x = new WeakMap(), E = new WeakMap(), S = new WeakSet(), en = function(I) {
            switch (r(this, E).getMode()) {
              case e.AnnotationEditorType.FREETEXT:
                return new p.FreeTextEditor(I);
              case e.AnnotationEditorType.INK:
                return new f.InkEditor(I);
              case e.AnnotationEditorType.STAMP:
                return new a.StampEditor(I);
            }
            return null;
          }, v = new WeakSet(), Fe = function(I, U) {
            const G = this.getNextId(), V = J(this, S, en).call(this, {
              parent: this,
              id: G,
              x: I.offsetX,
              y: I.offsetY,
              uiManager: r(this, E),
              isCentered: U
            });
            return V && this.add(V), V;
          }, M = new WeakSet(), nn = function() {
            const {
              x: I,
              y: U,
              width: G,
              height: V
            } = this.div.getBoundingClientRect(), H = Math.max(0, I), st = Math.max(0, U), dt = Math.min(window.innerWidth, I + G), yt = Math.min(window.innerHeight, U + V), gt = (H + dt) / 2 - I, k = (st + yt) / 2 - U, [l, u] = this.viewport.rotation % 180 === 0 ? [gt, k] : [k, gt];
            return {
              offsetX: l,
              offsetY: u
            };
          }, N = new WeakSet(), sn = function() {
            ot(this, C, !0);
            for (const I of r(this, P).values())
              I.isEmpty() && I.remove();
            ot(this, C, !1);
          }, ee(X, "_initialized", !1);
          let h = X;
          t.AnnotationEditorLayer = h;
        },
        /* 28 */
        /***/
        (i, t, n) => {
          var a, h, o, F, R, w, T, P, m, C, xn, E, Dn, g, In, $, Ae, _, rn, D, Ln, Y, an;
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.FreeTextEditor = void 0;
          var e = n(1), s = n(5), p = n(4), f = n(29);
          const U = class U extends p.AnnotationEditor {
            constructor(H) {
              super({
                ...H,
                name: "freeTextEditor"
              });
              W(this, C);
              W(this, E);
              W(this, g);
              W(this, $);
              W(this, _);
              W(this, D);
              W(this, Y);
              W(this, a, this.editorDivBlur.bind(this));
              W(this, h, this.editorDivFocus.bind(this));
              W(this, o, this.editorDivInput.bind(this));
              W(this, F, this.editorDivKeydown.bind(this));
              W(this, R, void 0);
              W(this, w, "");
              W(this, T, `${this.id}-editor`);
              W(this, P, void 0);
              W(this, m, null);
              ot(this, R, H.color || U._defaultColor || p.AnnotationEditor._defaultLineColor), ot(this, P, H.fontSize || U._defaultFontSize);
            }
            static get _keyboardManager() {
              const H = U.prototype, st = (gt) => gt.isEmpty(), dt = s.AnnotationEditorUIManager.TRANSLATE_SMALL, yt = s.AnnotationEditorUIManager.TRANSLATE_BIG;
              return (0, e.shadow)(this, "_keyboardManager", new s.KeyboardManager([[["ctrl+s", "mac+meta+s", "ctrl+p", "mac+meta+p"], H.commitOrRemove, {
                bubbles: !0
              }], [["ctrl+Enter", "mac+meta+Enter", "Escape", "mac+Escape"], H.commitOrRemove], [["ArrowLeft", "mac+ArrowLeft"], H._translateEmpty, {
                args: [-dt, 0],
                checker: st
              }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], H._translateEmpty, {
                args: [-yt, 0],
                checker: st
              }], [["ArrowRight", "mac+ArrowRight"], H._translateEmpty, {
                args: [dt, 0],
                checker: st
              }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], H._translateEmpty, {
                args: [yt, 0],
                checker: st
              }], [["ArrowUp", "mac+ArrowUp"], H._translateEmpty, {
                args: [0, -dt],
                checker: st
              }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], H._translateEmpty, {
                args: [0, -yt],
                checker: st
              }], [["ArrowDown", "mac+ArrowDown"], H._translateEmpty, {
                args: [0, dt],
                checker: st
              }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], H._translateEmpty, {
                args: [0, yt],
                checker: st
              }]]));
            }
            static initialize(H) {
              p.AnnotationEditor.initialize(H, {
                strings: ["free_text2_default_content", "editor_free_text2_aria_label"]
              });
              const st = getComputedStyle(document.documentElement);
              this._internalPadding = parseFloat(st.getPropertyValue("--freetext-padding"));
            }
            static updateDefaultParams(H, st) {
              switch (H) {
                case e.AnnotationEditorParamsType.FREETEXT_SIZE:
                  U._defaultFontSize = st;
                  break;
                case e.AnnotationEditorParamsType.FREETEXT_COLOR:
                  U._defaultColor = st;
                  break;
              }
            }
            updateParams(H, st) {
              switch (H) {
                case e.AnnotationEditorParamsType.FREETEXT_SIZE:
                  J(this, C, xn).call(this, st);
                  break;
                case e.AnnotationEditorParamsType.FREETEXT_COLOR:
                  J(this, E, Dn).call(this, st);
                  break;
              }
            }
            static get defaultPropertiesToUpdate() {
              return [[e.AnnotationEditorParamsType.FREETEXT_SIZE, U._defaultFontSize], [e.AnnotationEditorParamsType.FREETEXT_COLOR, U._defaultColor || p.AnnotationEditor._defaultLineColor]];
            }
            get propertiesToUpdate() {
              return [[e.AnnotationEditorParamsType.FREETEXT_SIZE, r(this, P)], [e.AnnotationEditorParamsType.FREETEXT_COLOR, r(this, R)]];
            }
            _translateEmpty(H, st) {
              this._uiManager.translateSelectedEditors(H, st, !0);
            }
            getInitialTranslation() {
              const H = this.parentScale;
              return [-U._internalPadding * H, -(U._internalPadding + r(this, P)) * H];
            }
            rebuild() {
              this.parent && (super.rebuild(), this.div !== null && (this.isAttachedToDOM || this.parent.add(this)));
            }
            enableEditMode() {
              this.isInEditMode() || (this.parent.setEditingState(!1), this.parent.updateToolbar(e.AnnotationEditorType.FREETEXT), super.enableEditMode(), this.overlayDiv.classList.remove("enabled"), this.editorDiv.contentEditable = !0, this._isDraggable = !1, this.div.removeAttribute("aria-activedescendant"), this.editorDiv.addEventListener("keydown", r(this, F)), this.editorDiv.addEventListener("focus", r(this, h)), this.editorDiv.addEventListener("blur", r(this, a)), this.editorDiv.addEventListener("input", r(this, o)));
            }
            disableEditMode() {
              this.isInEditMode() && (this.parent.setEditingState(!0), super.disableEditMode(), this.overlayDiv.classList.add("enabled"), this.editorDiv.contentEditable = !1, this.div.setAttribute("aria-activedescendant", r(this, T)), this._isDraggable = !0, this.editorDiv.removeEventListener("keydown", r(this, F)), this.editorDiv.removeEventListener("focus", r(this, h)), this.editorDiv.removeEventListener("blur", r(this, a)), this.editorDiv.removeEventListener("input", r(this, o)), this.div.focus({
                preventScroll: !0
              }), this.isEditing = !1, this.parent.div.classList.add("freeTextEditing"));
            }
            focusin(H) {
              this._focusEventsAllowed && (super.focusin(H), H.target !== this.editorDiv && this.editorDiv.focus());
            }
            onceAdded() {
              var H;
              if (this.width) {
                J(this, Y, an).call(this);
                return;
              }
              this.enableEditMode(), this.editorDiv.focus(), (H = this._initialOptions) != null && H.isCentered && this.center(), this._initialOptions = null;
            }
            isEmpty() {
              return !this.editorDiv || this.editorDiv.innerText.trim() === "";
            }
            remove() {
              this.isEditing = !1, this.parent && (this.parent.setEditingState(!0), this.parent.div.classList.add("freeTextEditing")), super.remove();
            }
            commit() {
              if (!this.isInEditMode())
                return;
              super.commit(), this.disableEditMode();
              const H = r(this, w), st = ot(this, w, J(this, g, In).call(this).trimEnd());
              if (H === st)
                return;
              const dt = (yt) => {
                if (ot(this, w, yt), !yt) {
                  this.remove();
                  return;
                }
                J(this, _, rn).call(this), this._uiManager.rebuild(this), J(this, $, Ae).call(this);
              };
              this.addCommands({
                cmd: () => {
                  dt(st);
                },
                undo: () => {
                  dt(H);
                },
                mustExec: !1
              }), J(this, $, Ae).call(this);
            }
            shouldGetKeyboardEvents() {
              return this.isInEditMode();
            }
            enterInEditMode() {
              this.enableEditMode(), this.editorDiv.focus();
            }
            dblclick(H) {
              this.enterInEditMode();
            }
            keydown(H) {
              H.target === this.div && H.key === "Enter" && (this.enterInEditMode(), H.preventDefault());
            }
            editorDivKeydown(H) {
              U._keyboardManager.exec(this, H);
            }
            editorDivFocus(H) {
              this.isEditing = !0;
            }
            editorDivBlur(H) {
              this.isEditing = !1;
            }
            editorDivInput(H) {
              this.parent.div.classList.toggle("freeTextEditing", this.isEmpty());
            }
            disableEditing() {
              this.editorDiv.setAttribute("role", "comment"), this.editorDiv.removeAttribute("aria-multiline");
            }
            enableEditing() {
              this.editorDiv.setAttribute("role", "textbox"), this.editorDiv.setAttribute("aria-multiline", !0);
            }
            render() {
              if (this.div)
                return this.div;
              let H, st;
              this.width && (H = this.x, st = this.y), super.render(), this.editorDiv = document.createElement("div"), this.editorDiv.className = "internal", this.editorDiv.setAttribute("id", r(this, T)), this.enableEditing(), p.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then((yt) => {
                var gt;
                return (gt = this.editorDiv) == null ? void 0 : gt.setAttribute("aria-label", yt);
              }), p.AnnotationEditor._l10nPromise.get("free_text2_default_content").then((yt) => {
                var gt;
                return (gt = this.editorDiv) == null ? void 0 : gt.setAttribute("default-content", yt);
              }), this.editorDiv.contentEditable = !0;
              const {
                style: dt
              } = this.editorDiv;
              if (dt.fontSize = `calc(${r(this, P)}px * var(--scale-factor))`, dt.color = r(this, R), this.div.append(this.editorDiv), this.overlayDiv = document.createElement("div"), this.overlayDiv.classList.add("overlay", "enabled"), this.div.append(this.overlayDiv), (0, s.bindEvents)(this, this.div, ["dblclick", "keydown"]), this.width) {
                const [yt, gt] = this.parentDimensions;
                if (this.annotationElementId) {
                  const {
                    position: k
                  } = r(this, m);
                  let [l, u] = this.getInitialTranslation();
                  [l, u] = this.pageTranslationToScreen(l, u);
                  const [d, b] = this.pageDimensions, [y, O] = this.pageTranslation;
                  let B, z;
                  switch (this.rotation) {
                    case 0:
                      B = H + (k[0] - y) / d, z = st + this.height - (k[1] - O) / b;
                      break;
                    case 90:
                      B = H + (k[0] - y) / d, z = st - (k[1] - O) / b, [l, u] = [u, -l];
                      break;
                    case 180:
                      B = H - this.width + (k[0] - y) / d, z = st - (k[1] - O) / b, [l, u] = [-l, -u];
                      break;
                    case 270:
                      B = H + (k[0] - y - this.height * b) / d, z = st + (k[1] - O - this.width * d) / b, [l, u] = [-u, l];
                      break;
                  }
                  this.setAt(B * yt, z * gt, l, u);
                } else
                  this.setAt(H * yt, st * gt, this.width * yt, this.height * gt);
                J(this, _, rn).call(this), this._isDraggable = !0, this.editorDiv.contentEditable = !1;
              } else
                this._isDraggable = !1, this.editorDiv.contentEditable = !0;
              return this.div;
            }
            get contentDiv() {
              return this.editorDiv;
            }
            static deserialize(H, st, dt) {
              let yt = null;
              if (H instanceof f.FreeTextAnnotationElement) {
                const {
                  data: {
                    defaultAppearanceData: {
                      fontSize: k,
                      fontColor: l
                    },
                    rect: u,
                    rotation: d,
                    id: b
                  },
                  textContent: y,
                  textPosition: O,
                  parent: {
                    page: {
                      pageNumber: B
                    }
                  }
                } = H;
                if (!y || y.length === 0)
                  return null;
                yt = H = {
                  annotationType: e.AnnotationEditorType.FREETEXT,
                  color: Array.from(l),
                  fontSize: k,
                  value: y.join(`
`),
                  position: O,
                  pageIndex: B - 1,
                  rect: u,
                  rotation: d,
                  id: b,
                  deleted: !1
                };
              }
              const gt = super.deserialize(H, st, dt);
              return ot(gt, P, H.fontSize), ot(gt, R, e.Util.makeHexColor(...H.color)), ot(gt, w, H.value), gt.annotationElementId = H.id || null, ot(gt, m, yt), gt;
            }
            serialize(H = !1) {
              if (this.isEmpty())
                return null;
              if (this.deleted)
                return {
                  pageIndex: this.pageIndex,
                  id: this.annotationElementId,
                  deleted: !0
                };
              const st = U._internalPadding * this.parentScale, dt = this.getRect(st, st), yt = p.AnnotationEditor._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : r(this, R)), gt = {
                annotationType: e.AnnotationEditorType.FREETEXT,
                color: yt,
                fontSize: r(this, P),
                value: r(this, w),
                pageIndex: this.pageIndex,
                rect: dt,
                rotation: this.rotation,
                structTreeParentId: this._structTreeParentId
              };
              return H ? gt : this.annotationElementId && !J(this, D, Ln).call(this, gt) ? null : (gt.id = this.annotationElementId, gt);
            }
          };
          a = new WeakMap(), h = new WeakMap(), o = new WeakMap(), F = new WeakMap(), R = new WeakMap(), w = new WeakMap(), T = new WeakMap(), P = new WeakMap(), m = new WeakMap(), C = new WeakSet(), xn = function(H) {
            const st = (yt) => {
              this.editorDiv.style.fontSize = `calc(${yt}px * var(--scale-factor))`, this.translate(0, -(yt - r(this, P)) * this.parentScale), ot(this, P, yt), J(this, $, Ae).call(this);
            }, dt = r(this, P);
            this.addCommands({
              cmd: () => {
                st(H);
              },
              undo: () => {
                st(dt);
              },
              mustExec: !0,
              type: e.AnnotationEditorParamsType.FREETEXT_SIZE,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, E = new WeakSet(), Dn = function(H) {
            const st = r(this, R);
            this.addCommands({
              cmd: () => {
                ot(this, R, this.editorDiv.style.color = H);
              },
              undo: () => {
                ot(this, R, this.editorDiv.style.color = st);
              },
              mustExec: !0,
              type: e.AnnotationEditorParamsType.FREETEXT_COLOR,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, g = new WeakSet(), In = function() {
            const H = this.editorDiv.getElementsByTagName("div");
            if (H.length === 0)
              return this.editorDiv.innerText;
            const st = [];
            for (const dt of H)
              st.push(dt.innerText.replace(/\r\n?|\n/, ""));
            return st.join(`
`);
          }, $ = new WeakSet(), Ae = function() {
            const [H, st] = this.parentDimensions;
            let dt;
            if (this.isAttachedToDOM)
              dt = this.div.getBoundingClientRect();
            else {
              const {
                currentLayer: yt,
                div: gt
              } = this, k = gt.style.display;
              gt.style.display = "hidden", yt.div.append(this.div), dt = gt.getBoundingClientRect(), gt.remove(), gt.style.display = k;
            }
            this.rotation % 180 === this.parentRotation % 180 ? (this.width = dt.width / H, this.height = dt.height / st) : (this.width = dt.height / H, this.height = dt.width / st), this.fixAndSetPosition();
          }, _ = new WeakSet(), rn = function() {
            if (this.editorDiv.replaceChildren(), !!r(this, w))
              for (const H of r(this, w).split(`
`)) {
                const st = document.createElement("div");
                st.append(H ? document.createTextNode(H) : document.createElement("br")), this.editorDiv.append(st);
              }
          }, D = new WeakSet(), Ln = function(H) {
            const {
              value: st,
              fontSize: dt,
              color: yt,
              rect: gt,
              pageIndex: k
            } = r(this, m);
            return H.value !== st || H.fontSize !== dt || H.rect.some((l, u) => Math.abs(l - gt[u]) >= 1) || H.color.some((l, u) => l !== yt[u]) || H.pageIndex !== k;
          }, Y = new WeakSet(), an = function(H = !1) {
            if (!this.annotationElementId)
              return;
            if (J(this, $, Ae).call(this), !H && (this.width === 0 || this.height === 0)) {
              setTimeout(() => J(this, Y, an).call(this, !0), 0);
              return;
            }
            const st = U._internalPadding * this.parentScale;
            r(this, m).rect = this.getRect(st, st);
          }, ee(U, "_freeTextDefaultContent", ""), ee(U, "_internalPadding", 0), ee(U, "_defaultColor", null), ee(U, "_defaultFontSize", 10), ee(U, "_type", "freetext");
          let A = U;
          t.FreeTextEditor = A;
        },
        /* 29 */
        /***/
        (i, t, n) => {
          var u, b, ce, O, On, z, it, Z, lt, ht, mt, ft, kt, Rt, St, It, _t, rt, at, pt, Ct, Tt, Bt, $n, jt, Me, Gt, on, Vt, ln, nt, Q, At, wt, te, Qt, et, cn, Ot, Pt, $t, Nt, Nn, vt, hn;
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.StampAnnotationElement = t.InkAnnotationElement = t.FreeTextAnnotationElement = t.AnnotationLayer = void 0;
          var e = n(1), s = n(6), p = n(3), f = n(30), A = n(31), a = n(32);
          const h = 1e3, o = 9, F = /* @__PURE__ */ new WeakSet();
          function R(Lt) {
            return {
              width: Lt[2] - Lt[0],
              height: Lt[3] - Lt[1]
            };
          }
          class w {
            static create(j) {
              switch (j.data.annotationType) {
                case e.AnnotationType.LINK:
                  return new P(j);
                case e.AnnotationType.TEXT:
                  return new m(j);
                case e.AnnotationType.WIDGET:
                  switch (j.data.fieldType) {
                    case "Tx":
                      return new x(j);
                    case "Btn":
                      return j.data.radioButton ? new g(j) : j.data.checkBox ? new S(j) : new v(j);
                    case "Ch":
                      return new $(j);
                    case "Sig":
                      return new E(j);
                  }
                  return new C(j);
                case e.AnnotationType.POPUP:
                  return new M(j);
                case e.AnnotationType.FREETEXT:
                  return new N(j);
                case e.AnnotationType.LINE:
                  return new D(j);
                case e.AnnotationType.SQUARE:
                  return new X(j);
                case e.AnnotationType.CIRCLE:
                  return new Y(j);
                case e.AnnotationType.POLYLINE:
                  return new I(j);
                case e.AnnotationType.CARET:
                  return new G(j);
                case e.AnnotationType.INK:
                  return new V(j);
                case e.AnnotationType.POLYGON:
                  return new U(j);
                case e.AnnotationType.HIGHLIGHT:
                  return new H(j);
                case e.AnnotationType.UNDERLINE:
                  return new st(j);
                case e.AnnotationType.SQUIGGLY:
                  return new dt(j);
                case e.AnnotationType.STRIKEOUT:
                  return new yt(j);
                case e.AnnotationType.STAMP:
                  return new gt(j);
                case e.AnnotationType.FILEATTACHMENT:
                  return new k(j);
                default:
                  return new T(j);
              }
            }
          }
          const d = class d {
            constructor(j, {
              isRenderable: c = !1,
              ignoreBorder: L = !1,
              createQuadrilaterals: q = !1
            } = {}) {
              W(this, u, !1);
              this.isRenderable = c, this.data = j.data, this.layer = j.layer, this.linkService = j.linkService, this.downloadManager = j.downloadManager, this.imageResourcesPath = j.imageResourcesPath, this.renderForms = j.renderForms, this.svgFactory = j.svgFactory, this.annotationStorage = j.annotationStorage, this.enableScripting = j.enableScripting, this.hasJSActions = j.hasJSActions, this._fieldObjects = j.fieldObjects, this.parent = j.parent, c && (this.container = this._createContainer(L)), q && this._createQuadrilaterals();
            }
            static _hasPopupData({
              titleObj: j,
              contentsObj: c,
              richText: L
            }) {
              return !!(j != null && j.str || c != null && c.str || L != null && L.str);
            }
            get hasPopupData() {
              return d._hasPopupData(this.data);
            }
            _createContainer(j) {
              const {
                data: c,
                parent: {
                  page: L,
                  viewport: q
                }
              } = this, K = document.createElement("section");
              K.setAttribute("data-annotation-id", c.id), this instanceof C || (K.tabIndex = h), K.style.zIndex = this.parent.zIndex++, this.data.popupRef && K.setAttribute("aria-haspopup", "dialog"), c.noRotate && K.classList.add("norotate");
              const {
                pageWidth: tt,
                pageHeight: ct,
                pageX: bt,
                pageY: Mt
              } = q.rawDims;
              if (!c.rect || this instanceof M) {
                const {
                  rotation: Ut
                } = c;
                return !c.hasOwnCanvas && Ut !== 0 && this.setRotation(Ut, K), K;
              }
              const {
                width: Ft,
                height: Ht
              } = R(c.rect), xt = e.Util.normalizeRect([c.rect[0], L.view[3] - c.rect[1] + L.view[1], c.rect[2], L.view[3] - c.rect[3] + L.view[1]]);
              if (!j && c.borderStyle.width > 0) {
                K.style.borderWidth = `${c.borderStyle.width}px`;
                const Ut = c.borderStyle.horizontalCornerRadius, Xt = c.borderStyle.verticalCornerRadius;
                if (Ut > 0 || Xt > 0) {
                  const Zt = `calc(${Ut}px * var(--scale-factor)) / calc(${Xt}px * var(--scale-factor))`;
                  K.style.borderRadius = Zt;
                } else if (this instanceof g) {
                  const Zt = `calc(${Ft}px * var(--scale-factor)) / calc(${Ht}px * var(--scale-factor))`;
                  K.style.borderRadius = Zt;
                }
                switch (c.borderStyle.style) {
                  case e.AnnotationBorderStyleType.SOLID:
                    K.style.borderStyle = "solid";
                    break;
                  case e.AnnotationBorderStyleType.DASHED:
                    K.style.borderStyle = "dashed";
                    break;
                  case e.AnnotationBorderStyleType.BEVELED:
                    (0, e.warn)("Unimplemented border style: beveled");
                    break;
                  case e.AnnotationBorderStyleType.INSET:
                    (0, e.warn)("Unimplemented border style: inset");
                    break;
                  case e.AnnotationBorderStyleType.UNDERLINE:
                    K.style.borderBottomStyle = "solid";
                    break;
                }
                const Kt = c.borderColor || null;
                Kt ? (ot(this, u, !0), K.style.borderColor = e.Util.makeHexColor(Kt[0] | 0, Kt[1] | 0, Kt[2] | 0)) : K.style.borderWidth = 0;
              }
              K.style.left = `${100 * (xt[0] - bt) / tt}%`, K.style.top = `${100 * (xt[1] - Mt) / ct}%`;
              const {
                rotation: Dt
              } = c;
              return c.hasOwnCanvas || Dt === 0 ? (K.style.width = `${100 * Ft / tt}%`, K.style.height = `${100 * Ht / ct}%`) : this.setRotation(Dt, K), K;
            }
            setRotation(j, c = this.container) {
              if (!this.data.rect)
                return;
              const {
                pageWidth: L,
                pageHeight: q
              } = this.parent.viewport.rawDims, {
                width: K,
                height: tt
              } = R(this.data.rect);
              let ct, bt;
              j % 180 === 0 ? (ct = 100 * K / L, bt = 100 * tt / q) : (ct = 100 * tt / L, bt = 100 * K / q), c.style.width = `${ct}%`, c.style.height = `${bt}%`, c.setAttribute("data-main-rotation", (360 - j) % 360);
            }
            get _commonActions() {
              const j = (c, L, q) => {
                const K = q.detail[c], tt = K[0], ct = K.slice(1);
                q.target.style[L] = f.ColorConverters[`${tt}_HTML`](ct), this.annotationStorage.setValue(this.data.id, {
                  [L]: f.ColorConverters[`${tt}_rgb`](ct)
                });
              };
              return (0, e.shadow)(this, "_commonActions", {
                display: (c) => {
                  const {
                    display: L
                  } = c.detail, q = L % 2 === 1;
                  this.container.style.visibility = q ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
                    noView: q,
                    noPrint: L === 1 || L === 2
                  });
                },
                print: (c) => {
                  this.annotationStorage.setValue(this.data.id, {
                    noPrint: !c.detail.print
                  });
                },
                hidden: (c) => {
                  const {
                    hidden: L
                  } = c.detail;
                  this.container.style.visibility = L ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
                    noPrint: L,
                    noView: L
                  });
                },
                focus: (c) => {
                  setTimeout(() => c.target.focus({
                    preventScroll: !1
                  }), 0);
                },
                userName: (c) => {
                  c.target.title = c.detail.userName;
                },
                readonly: (c) => {
                  c.target.disabled = c.detail.readonly;
                },
                required: (c) => {
                  this._setRequired(c.target, c.detail.required);
                },
                bgColor: (c) => {
                  j("bgColor", "backgroundColor", c);
                },
                fillColor: (c) => {
                  j("fillColor", "backgroundColor", c);
                },
                fgColor: (c) => {
                  j("fgColor", "color", c);
                },
                textColor: (c) => {
                  j("textColor", "color", c);
                },
                borderColor: (c) => {
                  j("borderColor", "borderColor", c);
                },
                strokeColor: (c) => {
                  j("strokeColor", "borderColor", c);
                },
                rotation: (c) => {
                  const L = c.detail.rotation;
                  this.setRotation(L), this.annotationStorage.setValue(this.data.id, {
                    rotation: L
                  });
                }
              });
            }
            _dispatchEventFromSandbox(j, c) {
              const L = this._commonActions;
              for (const q of Object.keys(c.detail)) {
                const K = j[q] || L[q];
                K == null || K(c);
              }
            }
            _setDefaultPropertiesFromJS(j) {
              if (!this.enableScripting)
                return;
              const c = this.annotationStorage.getRawValue(this.data.id);
              if (!c)
                return;
              const L = this._commonActions;
              for (const [q, K] of Object.entries(c)) {
                const tt = L[q];
                if (tt) {
                  const ct = {
                    detail: {
                      [q]: K
                    },
                    target: j
                  };
                  tt(ct), delete c[q];
                }
              }
            }
            _createQuadrilaterals() {
              if (!this.container)
                return;
              const {
                quadPoints: j
              } = this.data;
              if (!j)
                return;
              const [c, L, q, K] = this.data.rect;
              if (j.length === 1) {
                const [, {
                  x: Xt,
                  y: Kt
                }, {
                  x: Zt,
                  y: ie
                }] = j[0];
                if (q === Xt && K === Kt && c === Zt && L === ie)
                  return;
              }
              const {
                style: tt
              } = this.container;
              let ct;
              if (r(this, u)) {
                const {
                  borderColor: Xt,
                  borderWidth: Kt
                } = tt;
                tt.borderWidth = 0, ct = ["url('data:image/svg+xml;utf8,", '<svg xmlns="http://www.w3.org/2000/svg"', ' preserveAspectRatio="none" viewBox="0 0 1 1">', `<g fill="transparent" stroke="${Xt}" stroke-width="${Kt}">`], this.container.classList.add("hasBorder");
              }
              const bt = q - c, Mt = K - L, {
                svgFactory: Ft
              } = this, Ht = Ft.createElement("svg");
              Ht.classList.add("quadrilateralsContainer"), Ht.setAttribute("width", 0), Ht.setAttribute("height", 0);
              const xt = Ft.createElement("defs");
              Ht.append(xt);
              const Dt = Ft.createElement("clipPath"), Ut = `clippath_${this.data.id}`;
              Dt.setAttribute("id", Ut), Dt.setAttribute("clipPathUnits", "objectBoundingBox"), xt.append(Dt);
              for (const [, {
                x: Xt,
                y: Kt
              }, {
                x: Zt,
                y: ie
              }] of j) {
                const ne = Ft.createElement("rect"), se = (Zt - c) / bt, oe = (K - Kt) / Mt, le = (Xt - Zt) / bt, An = (Kt - ie) / Mt;
                ne.setAttribute("x", se), ne.setAttribute("y", oe), ne.setAttribute("width", le), ne.setAttribute("height", An), Dt.append(ne), ct == null || ct.push(`<rect vector-effect="non-scaling-stroke" x="${se}" y="${oe}" width="${le}" height="${An}"/>`);
              }
              r(this, u) && (ct.push("</g></svg>')"), tt.backgroundImage = ct.join("")), this.container.append(Ht), this.container.style.clipPath = `url(#${Ut})`;
            }
            _createPopup() {
              const {
                container: j,
                data: c
              } = this;
              j.setAttribute("aria-haspopup", "dialog");
              const L = new M({
                data: {
                  color: c.color,
                  titleObj: c.titleObj,
                  modificationDate: c.modificationDate,
                  contentsObj: c.contentsObj,
                  richText: c.richText,
                  parentRect: c.rect,
                  borderStyle: 0,
                  id: `popup_${c.id}`,
                  rotation: c.rotation
                },
                parent: this.parent,
                elements: [this]
              });
              this.parent.div.append(L.render());
            }
            render() {
              (0, e.unreachable)("Abstract method `AnnotationElement.render` called");
            }
            _getElementsByName(j, c = null) {
              const L = [];
              if (this._fieldObjects) {
                const q = this._fieldObjects[j];
                if (q)
                  for (const {
                    page: K,
                    id: tt,
                    exportValues: ct
                  } of q) {
                    if (K === -1 || tt === c)
                      continue;
                    const bt = typeof ct == "string" ? ct : null, Mt = document.querySelector(`[data-element-id="${tt}"]`);
                    if (Mt && !F.has(Mt)) {
                      (0, e.warn)(`_getElementsByName - element not allowed: ${tt}`);
                      continue;
                    }
                    L.push({
                      id: tt,
                      exportValue: bt,
                      domElement: Mt
                    });
                  }
                return L;
              }
              for (const q of document.getElementsByName(j)) {
                const {
                  exportValue: K
                } = q, tt = q.getAttribute("data-element-id");
                tt !== c && F.has(q) && L.push({
                  id: tt,
                  exportValue: K,
                  domElement: q
                });
              }
              return L;
            }
            show() {
              var j;
              this.container && (this.container.hidden = !1), (j = this.popup) == null || j.maybeShow();
            }
            hide() {
              var j;
              this.container && (this.container.hidden = !0), (j = this.popup) == null || j.forceHide();
            }
            getElementsToTriggerPopup() {
              return this.container;
            }
            addHighlightArea() {
              const j = this.getElementsToTriggerPopup();
              if (Array.isArray(j))
                for (const c of j)
                  c.classList.add("highlightArea");
              else
                j.classList.add("highlightArea");
            }
            _editOnDoubleClick() {
              const {
                annotationEditorType: j,
                data: {
                  id: c
                }
              } = this;
              this.container.addEventListener("dblclick", () => {
                var L;
                (L = this.linkService.eventBus) == null || L.dispatch("switchannotationeditormode", {
                  source: this,
                  mode: j,
                  editId: c
                });
              });
            }
          };
          u = new WeakMap();
          let T = d;
          class P extends T {
            constructor(c, L = null) {
              super(c, {
                isRenderable: !0,
                ignoreBorder: !!(L != null && L.ignoreBorder),
                createQuadrilaterals: !0
              });
              W(this, b);
              W(this, O);
              this.isTooltipOnly = c.data.isTooltipOnly;
            }
            render() {
              const {
                data: c,
                linkService: L
              } = this, q = document.createElement("a");
              q.setAttribute("data-element-id", c.id);
              let K = !1;
              return c.url ? (L.addLinkAttributes(q, c.url, c.newWindow), K = !0) : c.action ? (this._bindNamedAction(q, c.action), K = !0) : c.attachment ? (this._bindAttachment(q, c.attachment), K = !0) : c.setOCGState ? (J(this, O, On).call(this, q, c.setOCGState), K = !0) : c.dest ? (this._bindLink(q, c.dest), K = !0) : (c.actions && (c.actions.Action || c.actions["Mouse Up"] || c.actions["Mouse Down"]) && this.enableScripting && this.hasJSActions && (this._bindJSAction(q, c), K = !0), c.resetForm ? (this._bindResetFormAction(q, c.resetForm), K = !0) : this.isTooltipOnly && !K && (this._bindLink(q, ""), K = !0)), this.container.classList.add("linkAnnotation"), K && this.container.append(q), this.container;
            }
            _bindLink(c, L) {
              c.href = this.linkService.getDestinationHash(L), c.onclick = () => (L && this.linkService.goToDestination(L), !1), (L || L === "") && J(this, b, ce).call(this);
            }
            _bindNamedAction(c, L) {
              c.href = this.linkService.getAnchorUrl(""), c.onclick = () => (this.linkService.executeNamedAction(L), !1), J(this, b, ce).call(this);
            }
            _bindAttachment(c, L) {
              c.href = this.linkService.getAnchorUrl(""), c.onclick = () => {
                var q;
                return (q = this.downloadManager) == null || q.openOrDownloadData(this.container, L.content, L.filename), !1;
              }, J(this, b, ce).call(this);
            }
            _bindJSAction(c, L) {
              c.href = this.linkService.getAnchorUrl("");
              const q = /* @__PURE__ */ new Map([["Action", "onclick"], ["Mouse Up", "onmouseup"], ["Mouse Down", "onmousedown"]]);
              for (const K of Object.keys(L.actions)) {
                const tt = q.get(K);
                tt && (c[tt] = () => {
                  var ct;
                  return (ct = this.linkService.eventBus) == null || ct.dispatch("dispatcheventinsandbox", {
                    source: this,
                    detail: {
                      id: L.id,
                      name: K
                    }
                  }), !1;
                });
              }
              c.onclick || (c.onclick = () => !1), J(this, b, ce).call(this);
            }
            _bindResetFormAction(c, L) {
              const q = c.onclick;
              if (q || (c.href = this.linkService.getAnchorUrl("")), J(this, b, ce).call(this), !this._fieldObjects) {
                (0, e.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'), q || (c.onclick = () => !1);
                return;
              }
              c.onclick = () => {
                var Ht;
                q == null || q();
                const {
                  fields: K,
                  refs: tt,
                  include: ct
                } = L, bt = [];
                if (K.length !== 0 || tt.length !== 0) {
                  const xt = new Set(tt);
                  for (const Dt of K) {
                    const Ut = this._fieldObjects[Dt] || [];
                    for (const {
                      id: Xt
                    } of Ut)
                      xt.add(Xt);
                  }
                  for (const Dt of Object.values(this._fieldObjects))
                    for (const Ut of Dt)
                      xt.has(Ut.id) === ct && bt.push(Ut);
                } else
                  for (const xt of Object.values(this._fieldObjects))
                    bt.push(...xt);
                const Mt = this.annotationStorage, Ft = [];
                for (const xt of bt) {
                  const {
                    id: Dt
                  } = xt;
                  switch (Ft.push(Dt), xt.type) {
                    case "text": {
                      const Xt = xt.defaultValue || "";
                      Mt.setValue(Dt, {
                        value: Xt
                      });
                      break;
                    }
                    case "checkbox":
                    case "radiobutton": {
                      const Xt = xt.defaultValue === xt.exportValues;
                      Mt.setValue(Dt, {
                        value: Xt
                      });
                      break;
                    }
                    case "combobox":
                    case "listbox": {
                      const Xt = xt.defaultValue || "";
                      Mt.setValue(Dt, {
                        value: Xt
                      });
                      break;
                    }
                    default:
                      continue;
                  }
                  const Ut = document.querySelector(`[data-element-id="${Dt}"]`);
                  if (Ut) {
                    if (!F.has(Ut)) {
                      (0, e.warn)(`_bindResetFormAction - element not allowed: ${Dt}`);
                      continue;
                    }
                  } else
                    continue;
                  Ut.dispatchEvent(new Event("resetform"));
                }
                return this.enableScripting && ((Ht = this.linkService.eventBus) == null || Ht.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: "app",
                    ids: Ft,
                    name: "ResetForm"
                  }
                })), !1;
              };
            }
          }
          b = new WeakSet(), ce = function() {
            this.container.setAttribute("data-internal-link", "");
          }, O = new WeakSet(), On = function(c, L) {
            c.href = this.linkService.getAnchorUrl(""), c.onclick = () => (this.linkService.executeSetOCGState(L), !1), J(this, b, ce).call(this);
          };
          class m extends T {
            constructor(j) {
              super(j, {
                isRenderable: !0
              });
            }
            render() {
              this.container.classList.add("textAnnotation");
              const j = document.createElement("img");
              return j.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg", j.alt = "[{{type}} Annotation]", j.dataset.l10nId = "text_annotation_type", j.dataset.l10nArgs = JSON.stringify({
                type: this.data.name
              }), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.append(j), this.container;
            }
          }
          class C extends T {
            render() {
              return this.data.alternativeText && (this.container.title = this.data.alternativeText), this.container;
            }
            showElementAndHideCanvas(j) {
              var c;
              this.data.hasOwnCanvas && (((c = j.previousSibling) == null ? void 0 : c.nodeName) === "CANVAS" && (j.previousSibling.hidden = !0), j.hidden = !1);
            }
            _getKeyModifier(j) {
              const {
                isWin: c,
                isMac: L
              } = e.FeatureTest.platform;
              return c && j.ctrlKey || L && j.metaKey;
            }
            _setEventListener(j, c, L, q, K) {
              L.includes("mouse") ? j.addEventListener(L, (tt) => {
                var ct;
                (ct = this.linkService.eventBus) == null || ct.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: this.data.id,
                    name: q,
                    value: K(tt),
                    shift: tt.shiftKey,
                    modifier: this._getKeyModifier(tt)
                  }
                });
              }) : j.addEventListener(L, (tt) => {
                var ct;
                if (L === "blur") {
                  if (!c.focused || !tt.relatedTarget)
                    return;
                  c.focused = !1;
                } else if (L === "focus") {
                  if (c.focused)
                    return;
                  c.focused = !0;
                }
                K && ((ct = this.linkService.eventBus) == null || ct.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: this.data.id,
                    name: q,
                    value: K(tt)
                  }
                }));
              });
            }
            _setEventListeners(j, c, L, q) {
              var K, tt, ct;
              for (const [bt, Mt] of L)
                (Mt === "Action" || (K = this.data.actions) != null && K[Mt]) && ((Mt === "Focus" || Mt === "Blur") && (c || (c = {
                  focused: !1
                })), this._setEventListener(j, c, bt, Mt, q), Mt === "Focus" && !((tt = this.data.actions) != null && tt.Blur) ? this._setEventListener(j, c, "blur", "Blur", null) : Mt === "Blur" && !((ct = this.data.actions) != null && ct.Focus) && this._setEventListener(j, c, "focus", "Focus", null));
            }
            _setBackgroundColor(j) {
              const c = this.data.backgroundColor || null;
              j.style.backgroundColor = c === null ? "transparent" : e.Util.makeHexColor(c[0], c[1], c[2]);
            }
            _setTextStyle(j) {
              const c = ["left", "center", "right"], {
                fontColor: L
              } = this.data.defaultAppearanceData, q = this.data.defaultAppearanceData.fontSize || o, K = j.style;
              let tt;
              const ct = 2, bt = (Mt) => Math.round(10 * Mt) / 10;
              if (this.data.multiLine) {
                const Mt = Math.abs(this.data.rect[3] - this.data.rect[1] - ct), Ft = Math.round(Mt / (e.LINE_FACTOR * q)) || 1, Ht = Mt / Ft;
                tt = Math.min(q, bt(Ht / e.LINE_FACTOR));
              } else {
                const Mt = Math.abs(this.data.rect[3] - this.data.rect[1] - ct);
                tt = Math.min(q, bt(Mt / e.LINE_FACTOR));
              }
              K.fontSize = `calc(${tt}px * var(--scale-factor))`, K.color = e.Util.makeHexColor(L[0], L[1], L[2]), this.data.textAlignment !== null && (K.textAlign = c[this.data.textAlignment]);
            }
            _setRequired(j, c) {
              c ? j.setAttribute("required", !0) : j.removeAttribute("required"), j.setAttribute("aria-required", c);
            }
          }
          class x extends C {
            constructor(j) {
              const c = j.renderForms || !j.data.hasAppearance && !!j.data.fieldValue;
              super(j, {
                isRenderable: c
              });
            }
            setPropertyOnSiblings(j, c, L, q) {
              const K = this.annotationStorage;
              for (const tt of this._getElementsByName(j.name, j.id))
                tt.domElement && (tt.domElement[c] = L), K.setValue(tt.id, {
                  [q]: L
                });
            }
            render() {
              var q, K;
              const j = this.annotationStorage, c = this.data.id;
              this.container.classList.add("textWidgetAnnotation");
              let L = null;
              if (this.renderForms) {
                const tt = j.getValue(c, {
                  value: this.data.fieldValue
                });
                let ct = tt.value || "";
                const bt = j.getValue(c, {
                  charLimit: this.data.maxLen
                }).charLimit;
                bt && ct.length > bt && (ct = ct.slice(0, bt));
                let Mt = tt.formattedValue || ((q = this.data.textContent) == null ? void 0 : q.join(`
`)) || null;
                Mt && this.data.comb && (Mt = Mt.replaceAll(/\s+/g, ""));
                const Ft = {
                  userValue: ct,
                  formattedValue: Mt,
                  lastCommittedValue: null,
                  commitKey: 1,
                  focused: !1
                };
                this.data.multiLine ? (L = document.createElement("textarea"), L.textContent = Mt ?? ct, this.data.doNotScroll && (L.style.overflowY = "hidden")) : (L = document.createElement("input"), L.type = "text", L.setAttribute("value", Mt ?? ct), this.data.doNotScroll && (L.style.overflowX = "hidden")), this.data.hasOwnCanvas && (L.hidden = !0), F.add(L), L.setAttribute("data-element-id", c), L.disabled = this.data.readOnly, L.name = this.data.fieldName, L.tabIndex = h, this._setRequired(L, this.data.required), bt && (L.maxLength = bt), L.addEventListener("input", (xt) => {
                  j.setValue(c, {
                    value: xt.target.value
                  }), this.setPropertyOnSiblings(L, "value", xt.target.value, "value"), Ft.formattedValue = null;
                }), L.addEventListener("resetform", (xt) => {
                  const Dt = this.data.defaultFieldValue ?? "";
                  L.value = Ft.userValue = Dt, Ft.formattedValue = null;
                });
                let Ht = (xt) => {
                  const {
                    formattedValue: Dt
                  } = Ft;
                  Dt != null && (xt.target.value = Dt), xt.target.scrollLeft = 0;
                };
                if (this.enableScripting && this.hasJSActions) {
                  L.addEventListener("focus", (Dt) => {
                    if (Ft.focused)
                      return;
                    const {
                      target: Ut
                    } = Dt;
                    Ft.userValue && (Ut.value = Ft.userValue), Ft.lastCommittedValue = Ut.value, Ft.commitKey = 1, Ft.focused = !0;
                  }), L.addEventListener("updatefromsandbox", (Dt) => {
                    this.showElementAndHideCanvas(Dt.target);
                    const Ut = {
                      value(Xt) {
                        Ft.userValue = Xt.detail.value ?? "", j.setValue(c, {
                          value: Ft.userValue.toString()
                        }), Xt.target.value = Ft.userValue;
                      },
                      formattedValue(Xt) {
                        const {
                          formattedValue: Kt
                        } = Xt.detail;
                        Ft.formattedValue = Kt, Kt != null && Xt.target !== document.activeElement && (Xt.target.value = Kt), j.setValue(c, {
                          formattedValue: Kt
                        });
                      },
                      selRange(Xt) {
                        Xt.target.setSelectionRange(...Xt.detail.selRange);
                      },
                      charLimit: (Xt) => {
                        var ne;
                        const {
                          charLimit: Kt
                        } = Xt.detail, {
                          target: Zt
                        } = Xt;
                        if (Kt === 0) {
                          Zt.removeAttribute("maxLength");
                          return;
                        }
                        Zt.setAttribute("maxLength", Kt);
                        let ie = Ft.userValue;
                        !ie || ie.length <= Kt || (ie = ie.slice(0, Kt), Zt.value = Ft.userValue = ie, j.setValue(c, {
                          value: ie
                        }), (ne = this.linkService.eventBus) == null || ne.dispatch("dispatcheventinsandbox", {
                          source: this,
                          detail: {
                            id: c,
                            name: "Keystroke",
                            value: ie,
                            willCommit: !0,
                            commitKey: 1,
                            selStart: Zt.selectionStart,
                            selEnd: Zt.selectionEnd
                          }
                        }));
                      }
                    };
                    this._dispatchEventFromSandbox(Ut, Dt);
                  }), L.addEventListener("keydown", (Dt) => {
                    var Kt;
                    Ft.commitKey = 1;
                    let Ut = -1;
                    if (Dt.key === "Escape" ? Ut = 0 : Dt.key === "Enter" && !this.data.multiLine ? Ut = 2 : Dt.key === "Tab" && (Ft.commitKey = 3), Ut === -1)
                      return;
                    const {
                      value: Xt
                    } = Dt.target;
                    Ft.lastCommittedValue !== Xt && (Ft.lastCommittedValue = Xt, Ft.userValue = Xt, (Kt = this.linkService.eventBus) == null || Kt.dispatch("dispatcheventinsandbox", {
                      source: this,
                      detail: {
                        id: c,
                        name: "Keystroke",
                        value: Xt,
                        willCommit: !0,
                        commitKey: Ut,
                        selStart: Dt.target.selectionStart,
                        selEnd: Dt.target.selectionEnd
                      }
                    }));
                  });
                  const xt = Ht;
                  Ht = null, L.addEventListener("blur", (Dt) => {
                    var Xt;
                    if (!Ft.focused || !Dt.relatedTarget)
                      return;
                    Ft.focused = !1;
                    const {
                      value: Ut
                    } = Dt.target;
                    Ft.userValue = Ut, Ft.lastCommittedValue !== Ut && ((Xt = this.linkService.eventBus) == null || Xt.dispatch("dispatcheventinsandbox", {
                      source: this,
                      detail: {
                        id: c,
                        name: "Keystroke",
                        value: Ut,
                        willCommit: !0,
                        commitKey: Ft.commitKey,
                        selStart: Dt.target.selectionStart,
                        selEnd: Dt.target.selectionEnd
                      }
                    })), xt(Dt);
                  }), (K = this.data.actions) != null && K.Keystroke && L.addEventListener("beforeinput", (Dt) => {
                    var oe;
                    Ft.lastCommittedValue = null;
                    const {
                      data: Ut,
                      target: Xt
                    } = Dt, {
                      value: Kt,
                      selectionStart: Zt,
                      selectionEnd: ie
                    } = Xt;
                    let ne = Zt, se = ie;
                    switch (Dt.inputType) {
                      case "deleteWordBackward": {
                        const le = Kt.substring(0, Zt).match(/\w*[^\w]*$/);
                        le && (ne -= le[0].length);
                        break;
                      }
                      case "deleteWordForward": {
                        const le = Kt.substring(Zt).match(/^[^\w]*\w*/);
                        le && (se += le[0].length);
                        break;
                      }
                      case "deleteContentBackward":
                        Zt === ie && (ne -= 1);
                        break;
                      case "deleteContentForward":
                        Zt === ie && (se += 1);
                        break;
                    }
                    Dt.preventDefault(), (oe = this.linkService.eventBus) == null || oe.dispatch("dispatcheventinsandbox", {
                      source: this,
                      detail: {
                        id: c,
                        name: "Keystroke",
                        value: Kt,
                        change: Ut || "",
                        willCommit: !1,
                        selStart: ne,
                        selEnd: se
                      }
                    });
                  }), this._setEventListeners(L, Ft, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (Dt) => Dt.target.value);
                }
                if (Ht && L.addEventListener("blur", Ht), this.data.comb) {
                  const Dt = (this.data.rect[2] - this.data.rect[0]) / bt;
                  L.classList.add("comb"), L.style.letterSpacing = `calc(${Dt}px * var(--scale-factor) - 1ch)`;
                }
              } else
                L = document.createElement("div"), L.textContent = this.data.fieldValue, L.style.verticalAlign = "middle", L.style.display = "table-cell";
              return this._setTextStyle(L), this._setBackgroundColor(L), this._setDefaultPropertiesFromJS(L), this.container.append(L), this.container;
            }
          }
          class E extends C {
            constructor(j) {
              super(j, {
                isRenderable: !!j.data.hasOwnCanvas
              });
            }
          }
          class S extends C {
            constructor(j) {
              super(j, {
                isRenderable: j.renderForms
              });
            }
            render() {
              const j = this.annotationStorage, c = this.data, L = c.id;
              let q = j.getValue(L, {
                value: c.exportValue === c.fieldValue
              }).value;
              typeof q == "string" && (q = q !== "Off", j.setValue(L, {
                value: q
              })), this.container.classList.add("buttonWidgetAnnotation", "checkBox");
              const K = document.createElement("input");
              return F.add(K), K.setAttribute("data-element-id", L), K.disabled = c.readOnly, this._setRequired(K, this.data.required), K.type = "checkbox", K.name = c.fieldName, q && K.setAttribute("checked", !0), K.setAttribute("exportValue", c.exportValue), K.tabIndex = h, K.addEventListener("change", (tt) => {
                const {
                  name: ct,
                  checked: bt
                } = tt.target;
                for (const Mt of this._getElementsByName(ct, L)) {
                  const Ft = bt && Mt.exportValue === c.exportValue;
                  Mt.domElement && (Mt.domElement.checked = Ft), j.setValue(Mt.id, {
                    value: Ft
                  });
                }
                j.setValue(L, {
                  value: bt
                });
              }), K.addEventListener("resetform", (tt) => {
                const ct = c.defaultFieldValue || "Off";
                tt.target.checked = ct === c.exportValue;
              }), this.enableScripting && this.hasJSActions && (K.addEventListener("updatefromsandbox", (tt) => {
                const ct = {
                  value(bt) {
                    bt.target.checked = bt.detail.value !== "Off", j.setValue(L, {
                      value: bt.target.checked
                    });
                  }
                };
                this._dispatchEventFromSandbox(ct, tt);
              }), this._setEventListeners(K, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (tt) => tt.target.checked)), this._setBackgroundColor(K), this._setDefaultPropertiesFromJS(K), this.container.append(K), this.container;
            }
          }
          class g extends C {
            constructor(j) {
              super(j, {
                isRenderable: j.renderForms
              });
            }
            render() {
              this.container.classList.add("buttonWidgetAnnotation", "radioButton");
              const j = this.annotationStorage, c = this.data, L = c.id;
              let q = j.getValue(L, {
                value: c.fieldValue === c.buttonValue
              }).value;
              typeof q == "string" && (q = q !== c.buttonValue, j.setValue(L, {
                value: q
              }));
              const K = document.createElement("input");
              if (F.add(K), K.setAttribute("data-element-id", L), K.disabled = c.readOnly, this._setRequired(K, this.data.required), K.type = "radio", K.name = c.fieldName, q && K.setAttribute("checked", !0), K.tabIndex = h, K.addEventListener("change", (tt) => {
                const {
                  name: ct,
                  checked: bt
                } = tt.target;
                for (const Mt of this._getElementsByName(ct, L))
                  j.setValue(Mt.id, {
                    value: !1
                  });
                j.setValue(L, {
                  value: bt
                });
              }), K.addEventListener("resetform", (tt) => {
                const ct = c.defaultFieldValue;
                tt.target.checked = ct != null && ct === c.buttonValue;
              }), this.enableScripting && this.hasJSActions) {
                const tt = c.buttonValue;
                K.addEventListener("updatefromsandbox", (ct) => {
                  const bt = {
                    value: (Mt) => {
                      const Ft = tt === Mt.detail.value;
                      for (const Ht of this._getElementsByName(Mt.target.name)) {
                        const xt = Ft && Ht.id === L;
                        Ht.domElement && (Ht.domElement.checked = xt), j.setValue(Ht.id, {
                          value: xt
                        });
                      }
                    }
                  };
                  this._dispatchEventFromSandbox(bt, ct);
                }), this._setEventListeners(K, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (ct) => ct.target.checked);
              }
              return this._setBackgroundColor(K), this._setDefaultPropertiesFromJS(K), this.container.append(K), this.container;
            }
          }
          class v extends P {
            constructor(j) {
              super(j, {
                ignoreBorder: j.data.hasAppearance
              });
            }
            render() {
              const j = super.render();
              j.classList.add("buttonWidgetAnnotation", "pushButton"), this.data.alternativeText && (j.title = this.data.alternativeText);
              const c = j.lastChild;
              return this.enableScripting && this.hasJSActions && c && (this._setDefaultPropertiesFromJS(c), c.addEventListener("updatefromsandbox", (L) => {
                this._dispatchEventFromSandbox({}, L);
              })), j;
            }
          }
          class $ extends C {
            constructor(j) {
              super(j, {
                isRenderable: j.renderForms
              });
            }
            render() {
              this.container.classList.add("choiceWidgetAnnotation");
              const j = this.annotationStorage, c = this.data.id, L = j.getValue(c, {
                value: this.data.fieldValue
              }), q = document.createElement("select");
              F.add(q), q.setAttribute("data-element-id", c), q.disabled = this.data.readOnly, this._setRequired(q, this.data.required), q.name = this.data.fieldName, q.tabIndex = h;
              let K = this.data.combo && this.data.options.length > 0;
              this.data.combo || (q.size = this.data.options.length, this.data.multiSelect && (q.multiple = !0)), q.addEventListener("resetform", (Ft) => {
                const Ht = this.data.defaultFieldValue;
                for (const xt of q.options)
                  xt.selected = xt.value === Ht;
              });
              for (const Ft of this.data.options) {
                const Ht = document.createElement("option");
                Ht.textContent = Ft.displayValue, Ht.value = Ft.exportValue, L.value.includes(Ft.exportValue) && (Ht.setAttribute("selected", !0), K = !1), q.append(Ht);
              }
              let tt = null;
              if (K) {
                const Ft = document.createElement("option");
                Ft.value = " ", Ft.setAttribute("hidden", !0), Ft.setAttribute("selected", !0), q.prepend(Ft), tt = () => {
                  Ft.remove(), q.removeEventListener("input", tt), tt = null;
                }, q.addEventListener("input", tt);
              }
              const ct = (Ft) => {
                const Ht = Ft ? "value" : "textContent", {
                  options: xt,
                  multiple: Dt
                } = q;
                return Dt ? Array.prototype.filter.call(xt, (Ut) => Ut.selected).map((Ut) => Ut[Ht]) : xt.selectedIndex === -1 ? null : xt[xt.selectedIndex][Ht];
              };
              let bt = ct(!1);
              const Mt = (Ft) => {
                const Ht = Ft.target.options;
                return Array.prototype.map.call(Ht, (xt) => ({
                  displayValue: xt.textContent,
                  exportValue: xt.value
                }));
              };
              return this.enableScripting && this.hasJSActions ? (q.addEventListener("updatefromsandbox", (Ft) => {
                const Ht = {
                  value(xt) {
                    tt == null || tt();
                    const Dt = xt.detail.value, Ut = new Set(Array.isArray(Dt) ? Dt : [Dt]);
                    for (const Xt of q.options)
                      Xt.selected = Ut.has(Xt.value);
                    j.setValue(c, {
                      value: ct(!0)
                    }), bt = ct(!1);
                  },
                  multipleSelection(xt) {
                    q.multiple = !0;
                  },
                  remove(xt) {
                    const Dt = q.options, Ut = xt.detail.remove;
                    Dt[Ut].selected = !1, q.remove(Ut), Dt.length > 0 && Array.prototype.findIndex.call(Dt, (Kt) => Kt.selected) === -1 && (Dt[0].selected = !0), j.setValue(c, {
                      value: ct(!0),
                      items: Mt(xt)
                    }), bt = ct(!1);
                  },
                  clear(xt) {
                    for (; q.length !== 0; )
                      q.remove(0);
                    j.setValue(c, {
                      value: null,
                      items: []
                    }), bt = ct(!1);
                  },
                  insert(xt) {
                    const {
                      index: Dt,
                      displayValue: Ut,
                      exportValue: Xt
                    } = xt.detail.insert, Kt = q.children[Dt], Zt = document.createElement("option");
                    Zt.textContent = Ut, Zt.value = Xt, Kt ? Kt.before(Zt) : q.append(Zt), j.setValue(c, {
                      value: ct(!0),
                      items: Mt(xt)
                    }), bt = ct(!1);
                  },
                  items(xt) {
                    const {
                      items: Dt
                    } = xt.detail;
                    for (; q.length !== 0; )
                      q.remove(0);
                    for (const Ut of Dt) {
                      const {
                        displayValue: Xt,
                        exportValue: Kt
                      } = Ut, Zt = document.createElement("option");
                      Zt.textContent = Xt, Zt.value = Kt, q.append(Zt);
                    }
                    q.options.length > 0 && (q.options[0].selected = !0), j.setValue(c, {
                      value: ct(!0),
                      items: Mt(xt)
                    }), bt = ct(!1);
                  },
                  indices(xt) {
                    const Dt = new Set(xt.detail.indices);
                    for (const Ut of xt.target.options)
                      Ut.selected = Dt.has(Ut.index);
                    j.setValue(c, {
                      value: ct(!0)
                    }), bt = ct(!1);
                  },
                  editable(xt) {
                    xt.target.disabled = !xt.detail.editable;
                  }
                };
                this._dispatchEventFromSandbox(Ht, Ft);
              }), q.addEventListener("input", (Ft) => {
                var xt;
                const Ht = ct(!0);
                j.setValue(c, {
                  value: Ht
                }), Ft.preventDefault(), (xt = this.linkService.eventBus) == null || xt.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: c,
                    name: "Keystroke",
                    value: bt,
                    changeEx: Ht,
                    willCommit: !1,
                    commitKey: 1,
                    keyDown: !1
                  }
                });
              }), this._setEventListeners(q, null, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"], ["input", "Action"], ["input", "Validate"]], (Ft) => Ft.target.value)) : q.addEventListener("input", function(Ft) {
                j.setValue(c, {
                  value: ct(!0)
                });
              }), this.data.combo && this._setTextStyle(q), this._setBackgroundColor(q), this._setDefaultPropertiesFromJS(q), this.container.append(q), this.container;
            }
          }
          class M extends T {
            constructor(j) {
              const {
                data: c,
                elements: L
              } = j;
              super(j, {
                isRenderable: T._hasPopupData(c)
              }), this.elements = L;
            }
            render() {
              this.container.classList.add("popupAnnotation");
              const j = new _({
                container: this.container,
                color: this.data.color,
                titleObj: this.data.titleObj,
                modificationDate: this.data.modificationDate,
                contentsObj: this.data.contentsObj,
                richText: this.data.richText,
                rect: this.data.rect,
                parentRect: this.data.parentRect || null,
                parent: this.parent,
                elements: this.elements,
                open: this.data.open
              }), c = [];
              for (const L of this.elements)
                L.popup = j, c.push(L.data.id), L.addHighlightArea();
              return this.container.setAttribute("aria-controls", c.map((L) => `${e.AnnotationPrefix}${L}`).join(",")), this.container;
            }
          }
          class _ {
            constructor({
              container: j,
              color: c,
              elements: L,
              titleObj: q,
              modificationDate: K,
              contentsObj: tt,
              richText: ct,
              parent: bt,
              rect: Mt,
              parentRect: Ft,
              open: Ht
            }) {
              W(this, Bt);
              W(this, jt);
              W(this, Gt);
              W(this, Vt);
              W(this, z, null);
              W(this, it, J(this, Bt, $n).bind(this));
              W(this, Z, J(this, Vt, ln).bind(this));
              W(this, lt, J(this, Gt, on).bind(this));
              W(this, ht, J(this, jt, Me).bind(this));
              W(this, mt, null);
              W(this, ft, null);
              W(this, kt, null);
              W(this, Rt, null);
              W(this, St, null);
              W(this, It, null);
              W(this, _t, !1);
              W(this, rt, null);
              W(this, at, null);
              W(this, pt, null);
              W(this, Ct, null);
              W(this, Tt, !1);
              var Dt;
              ot(this, ft, j), ot(this, Ct, q), ot(this, kt, tt), ot(this, pt, ct), ot(this, St, bt), ot(this, mt, c), ot(this, at, Mt), ot(this, It, Ft), ot(this, Rt, L);
              const xt = s.PDFDateString.toDateObject(K);
              xt && ot(this, z, bt.l10n.get("annotation_date_string", {
                date: xt.toLocaleDateString(),
                time: xt.toLocaleTimeString()
              })), this.trigger = L.flatMap((Ut) => Ut.getElementsToTriggerPopup());
              for (const Ut of this.trigger)
                Ut.addEventListener("click", r(this, ht)), Ut.addEventListener("mouseenter", r(this, lt)), Ut.addEventListener("mouseleave", r(this, Z)), Ut.classList.add("popupTriggerArea");
              for (const Ut of L)
                (Dt = Ut.container) == null || Dt.addEventListener("keydown", r(this, it));
              r(this, ft).hidden = !0, Ht && J(this, jt, Me).call(this);
            }
            render() {
              if (r(this, rt))
                return;
              const {
                page: {
                  view: j
                },
                viewport: {
                  rawDims: {
                    pageWidth: c,
                    pageHeight: L,
                    pageX: q,
                    pageY: K
                  }
                }
              } = r(this, St), tt = ot(this, rt, document.createElement("div"));
              if (tt.className = "popup", r(this, mt)) {
                const ne = tt.style.outlineColor = e.Util.makeHexColor(...r(this, mt));
                CSS.supports("background-color", "color-mix(in srgb, red 30%, white)") ? tt.style.backgroundColor = `color-mix(in srgb, ${ne} 30%, white)` : tt.style.backgroundColor = e.Util.makeHexColor(...r(this, mt).map((oe) => Math.floor(0.7 * (255 - oe) + oe)));
              }
              const ct = document.createElement("span");
              ct.className = "header";
              const bt = document.createElement("h1");
              if (ct.append(bt), {
                dir: bt.dir,
                str: bt.textContent
              } = r(this, Ct), tt.append(ct), r(this, z)) {
                const ne = document.createElement("span");
                ne.classList.add("popupDate"), r(this, z).then((se) => {
                  ne.textContent = se;
                }), ct.append(ne);
              }
              const Mt = r(this, kt), Ft = r(this, pt);
              if (Ft != null && Ft.str && (!(Mt != null && Mt.str) || Mt.str === Ft.str))
                a.XfaLayer.render({
                  xfaHtml: Ft.html,
                  intent: "richText",
                  div: tt
                }), tt.lastChild.classList.add("richText", "popupContent");
              else {
                const ne = this._formatContents(Mt);
                tt.append(ne);
              }
              let Ht = !!r(this, It), xt = Ht ? r(this, It) : r(this, at);
              for (const ne of r(this, Rt))
                if (!xt || e.Util.intersect(ne.data.rect, xt) !== null) {
                  xt = ne.data.rect, Ht = !0;
                  break;
                }
              const Dt = e.Util.normalizeRect([xt[0], j[3] - xt[1] + j[1], xt[2], j[3] - xt[3] + j[1]]), Xt = Ht ? xt[2] - xt[0] + 5 : 0, Kt = Dt[0] + Xt, Zt = Dt[1], {
                style: ie
              } = r(this, ft);
              ie.left = `${100 * (Kt - q) / c}%`, ie.top = `${100 * (Zt - K) / L}%`, r(this, ft).append(tt);
            }
            _formatContents({
              str: j,
              dir: c
            }) {
              const L = document.createElement("p");
              L.classList.add("popupContent"), L.dir = c;
              const q = j.split(/(?:\r\n?|\n)/);
              for (let K = 0, tt = q.length; K < tt; ++K) {
                const ct = q[K];
                L.append(document.createTextNode(ct)), K < tt - 1 && L.append(document.createElement("br"));
              }
              return L;
            }
            forceHide() {
              ot(this, Tt, this.isVisible), r(this, Tt) && (r(this, ft).hidden = !0);
            }
            maybeShow() {
              r(this, Tt) && (ot(this, Tt, !1), r(this, ft).hidden = !1);
            }
            get isVisible() {
              return r(this, ft).hidden === !1;
            }
          }
          z = new WeakMap(), it = new WeakMap(), Z = new WeakMap(), lt = new WeakMap(), ht = new WeakMap(), mt = new WeakMap(), ft = new WeakMap(), kt = new WeakMap(), Rt = new WeakMap(), St = new WeakMap(), It = new WeakMap(), _t = new WeakMap(), rt = new WeakMap(), at = new WeakMap(), pt = new WeakMap(), Ct = new WeakMap(), Tt = new WeakMap(), Bt = new WeakSet(), $n = function(j) {
            j.altKey || j.shiftKey || j.ctrlKey || j.metaKey || (j.key === "Enter" || j.key === "Escape" && r(this, _t)) && J(this, jt, Me).call(this);
          }, jt = new WeakSet(), Me = function() {
            ot(this, _t, !r(this, _t)), r(this, _t) ? (J(this, Gt, on).call(this), r(this, ft).addEventListener("click", r(this, ht)), r(this, ft).addEventListener("keydown", r(this, it))) : (J(this, Vt, ln).call(this), r(this, ft).removeEventListener("click", r(this, ht)), r(this, ft).removeEventListener("keydown", r(this, it)));
          }, Gt = new WeakSet(), on = function() {
            r(this, rt) || this.render(), this.isVisible ? r(this, _t) && r(this, ft).classList.add("focused") : (r(this, ft).hidden = !1, r(this, ft).style.zIndex = parseInt(r(this, ft).style.zIndex) + 1e3);
          }, Vt = new WeakSet(), ln = function() {
            r(this, ft).classList.remove("focused"), !(r(this, _t) || !this.isVisible) && (r(this, ft).hidden = !0, r(this, ft).style.zIndex = parseInt(r(this, ft).style.zIndex) - 1e3);
          };
          class N extends T {
            constructor(j) {
              super(j, {
                isRenderable: !0,
                ignoreBorder: !0
              }), this.textContent = j.data.textContent, this.textPosition = j.data.textPosition, this.annotationEditorType = e.AnnotationEditorType.FREETEXT;
            }
            render() {
              if (this.container.classList.add("freeTextAnnotation"), this.textContent) {
                const j = document.createElement("div");
                j.classList.add("annotationTextContent"), j.setAttribute("role", "comment");
                for (const c of this.textContent) {
                  const L = document.createElement("span");
                  L.textContent = c, j.append(L);
                }
                this.container.append(j);
              }
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
            }
          }
          t.FreeTextAnnotationElement = N;
          class D extends T {
            constructor(c) {
              super(c, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              W(this, nt, null);
            }
            render() {
              this.container.classList.add("lineAnnotation");
              const c = this.data, {
                width: L,
                height: q
              } = R(c.rect), K = this.svgFactory.create(L, q, !0), tt = ot(this, nt, this.svgFactory.createElement("svg:line"));
              return tt.setAttribute("x1", c.rect[2] - c.lineCoordinates[0]), tt.setAttribute("y1", c.rect[3] - c.lineCoordinates[1]), tt.setAttribute("x2", c.rect[2] - c.lineCoordinates[2]), tt.setAttribute("y2", c.rect[3] - c.lineCoordinates[3]), tt.setAttribute("stroke-width", c.borderStyle.width || 1), tt.setAttribute("stroke", "transparent"), tt.setAttribute("fill", "transparent"), K.append(tt), this.container.append(K), !c.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return r(this, nt);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          nt = new WeakMap();
          class X extends T {
            constructor(c) {
              super(c, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              W(this, Q, null);
            }
            render() {
              this.container.classList.add("squareAnnotation");
              const c = this.data, {
                width: L,
                height: q
              } = R(c.rect), K = this.svgFactory.create(L, q, !0), tt = c.borderStyle.width, ct = ot(this, Q, this.svgFactory.createElement("svg:rect"));
              return ct.setAttribute("x", tt / 2), ct.setAttribute("y", tt / 2), ct.setAttribute("width", L - tt), ct.setAttribute("height", q - tt), ct.setAttribute("stroke-width", tt || 1), ct.setAttribute("stroke", "transparent"), ct.setAttribute("fill", "transparent"), K.append(ct), this.container.append(K), !c.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return r(this, Q);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          Q = new WeakMap();
          class Y extends T {
            constructor(c) {
              super(c, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              W(this, At, null);
            }
            render() {
              this.container.classList.add("circleAnnotation");
              const c = this.data, {
                width: L,
                height: q
              } = R(c.rect), K = this.svgFactory.create(L, q, !0), tt = c.borderStyle.width, ct = ot(this, At, this.svgFactory.createElement("svg:ellipse"));
              return ct.setAttribute("cx", L / 2), ct.setAttribute("cy", q / 2), ct.setAttribute("rx", L / 2 - tt / 2), ct.setAttribute("ry", q / 2 - tt / 2), ct.setAttribute("stroke-width", tt || 1), ct.setAttribute("stroke", "transparent"), ct.setAttribute("fill", "transparent"), K.append(ct), this.container.append(K), !c.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return r(this, At);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          At = new WeakMap();
          class I extends T {
            constructor(c) {
              super(c, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              W(this, wt, null);
              this.containerClassName = "polylineAnnotation", this.svgElementName = "svg:polyline";
            }
            render() {
              this.container.classList.add(this.containerClassName);
              const c = this.data, {
                width: L,
                height: q
              } = R(c.rect), K = this.svgFactory.create(L, q, !0);
              let tt = [];
              for (const bt of c.vertices) {
                const Mt = bt.x - c.rect[0], Ft = c.rect[3] - bt.y;
                tt.push(Mt + "," + Ft);
              }
              tt = tt.join(" ");
              const ct = ot(this, wt, this.svgFactory.createElement(this.svgElementName));
              return ct.setAttribute("points", tt), ct.setAttribute("stroke-width", c.borderStyle.width || 1), ct.setAttribute("stroke", "transparent"), ct.setAttribute("fill", "transparent"), K.append(ct), this.container.append(K), !c.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return r(this, wt);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          wt = new WeakMap();
          class U extends I {
            constructor(j) {
              super(j), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
            }
          }
          class G extends T {
            constructor(j) {
              super(j, {
                isRenderable: !0,
                ignoreBorder: !0
              });
            }
            render() {
              return this.container.classList.add("caretAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
          }
          class V extends T {
            constructor(c) {
              super(c, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              W(this, te, []);
              this.containerClassName = "inkAnnotation", this.svgElementName = "svg:polyline", this.annotationEditorType = e.AnnotationEditorType.INK;
            }
            render() {
              this.container.classList.add(this.containerClassName);
              const c = this.data, {
                width: L,
                height: q
              } = R(c.rect), K = this.svgFactory.create(L, q, !0);
              for (const tt of c.inkLists) {
                let ct = [];
                for (const Mt of tt) {
                  const Ft = Mt.x - c.rect[0], Ht = c.rect[3] - Mt.y;
                  ct.push(`${Ft},${Ht}`);
                }
                ct = ct.join(" ");
                const bt = this.svgFactory.createElement(this.svgElementName);
                r(this, te).push(bt), bt.setAttribute("points", ct), bt.setAttribute("stroke-width", c.borderStyle.width || 1), bt.setAttribute("stroke", "transparent"), bt.setAttribute("fill", "transparent"), !c.popupRef && this.hasPopupData && this._createPopup(), K.append(bt);
              }
              return this.container.append(K), this.container;
            }
            getElementsToTriggerPopup() {
              return r(this, te);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          te = new WeakMap(), t.InkAnnotationElement = V;
          class H extends T {
            constructor(j) {
              super(j, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("highlightAnnotation"), this.container;
            }
          }
          class st extends T {
            constructor(j) {
              super(j, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("underlineAnnotation"), this.container;
            }
          }
          class dt extends T {
            constructor(j) {
              super(j, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("squigglyAnnotation"), this.container;
            }
          }
          class yt extends T {
            constructor(j) {
              super(j, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("strikeoutAnnotation"), this.container;
            }
          }
          class gt extends T {
            constructor(j) {
              super(j, {
                isRenderable: !0,
                ignoreBorder: !0
              });
            }
            render() {
              return this.container.classList.add("stampAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
          }
          t.StampAnnotationElement = gt;
          class k extends T {
            constructor(c) {
              var K;
              super(c, {
                isRenderable: !0
              });
              W(this, et);
              W(this, Qt, null);
              const {
                filename: L,
                content: q
              } = this.data.file;
              this.filename = (0, s.getFilenameFromUrl)(L, !0), this.content = q, (K = this.linkService.eventBus) == null || K.dispatch("fileattachmentannotation", {
                source: this,
                filename: L,
                content: q
              });
            }
            render() {
              this.container.classList.add("fileAttachmentAnnotation");
              const {
                container: c,
                data: L
              } = this;
              let q;
              L.hasAppearance || L.fillAlpha === 0 ? q = document.createElement("div") : (q = document.createElement("img"), q.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(L.name) ? "paperclip" : "pushpin"}.svg`, L.fillAlpha && L.fillAlpha < 1 && (q.style = `filter: opacity(${Math.round(L.fillAlpha * 100)}%);`)), q.addEventListener("dblclick", J(this, et, cn).bind(this)), ot(this, Qt, q);
              const {
                isMac: K
              } = e.FeatureTest.platform;
              return c.addEventListener("keydown", (tt) => {
                tt.key === "Enter" && (K ? tt.metaKey : tt.ctrlKey) && J(this, et, cn).call(this);
              }), !L.popupRef && this.hasPopupData ? this._createPopup() : q.classList.add("popupTriggerArea"), c.append(q), c;
            }
            getElementsToTriggerPopup() {
              return r(this, Qt);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          Qt = new WeakMap(), et = new WeakSet(), cn = function() {
            var c;
            (c = this.downloadManager) == null || c.openOrDownloadData(this.container, this.content, this.filename);
          };
          class l {
            constructor({
              div: j,
              accessibilityManager: c,
              annotationCanvasMap: L,
              l10n: q,
              page: K,
              viewport: tt
            }) {
              W(this, Nt);
              W(this, vt);
              W(this, Ot, null);
              W(this, Pt, null);
              W(this, $t, /* @__PURE__ */ new Map());
              this.div = j, ot(this, Ot, c), ot(this, Pt, L), this.l10n = q, this.page = K, this.viewport = tt, this.zIndex = 0, this.l10n || (this.l10n = A.NullL10n);
            }
            async render(j) {
              const {
                annotations: c
              } = j, L = this.div;
              (0, s.setLayerDimensions)(L, this.viewport);
              const q = /* @__PURE__ */ new Map(), K = {
                data: null,
                layer: L,
                linkService: j.linkService,
                downloadManager: j.downloadManager,
                imageResourcesPath: j.imageResourcesPath || "",
                renderForms: j.renderForms !== !1,
                svgFactory: new s.DOMSVGFactory(),
                annotationStorage: j.annotationStorage || new p.AnnotationStorage(),
                enableScripting: j.enableScripting === !0,
                hasJSActions: j.hasJSActions,
                fieldObjects: j.fieldObjects,
                parent: this,
                elements: null
              };
              for (const tt of c) {
                if (tt.noHTML)
                  continue;
                const ct = tt.annotationType === e.AnnotationType.POPUP;
                if (ct) {
                  const Ft = q.get(tt.id);
                  if (!Ft)
                    continue;
                  K.elements = Ft;
                } else {
                  const {
                    width: Ft,
                    height: Ht
                  } = R(tt.rect);
                  if (Ft <= 0 || Ht <= 0)
                    continue;
                }
                K.data = tt;
                const bt = w.create(K);
                if (!bt.isRenderable)
                  continue;
                if (!ct && tt.popupRef) {
                  const Ft = q.get(tt.popupRef);
                  Ft ? Ft.push(bt) : q.set(tt.popupRef, [bt]);
                }
                bt.annotationEditorType > 0 && r(this, $t).set(bt.data.id, bt);
                const Mt = bt.render();
                tt.hidden && (Mt.style.visibility = "hidden"), J(this, Nt, Nn).call(this, Mt, tt.id);
              }
              J(this, vt, hn).call(this), await this.l10n.translate(L);
            }
            update({
              viewport: j
            }) {
              const c = this.div;
              this.viewport = j, (0, s.setLayerDimensions)(c, {
                rotation: j.rotation
              }), J(this, vt, hn).call(this), c.hidden = !1;
            }
            getEditableAnnotations() {
              return Array.from(r(this, $t).values());
            }
            getEditableAnnotation(j) {
              return r(this, $t).get(j);
            }
          }
          Ot = new WeakMap(), Pt = new WeakMap(), $t = new WeakMap(), Nt = new WeakSet(), Nn = function(j, c) {
            var q;
            const L = j.firstChild || j;
            L.id = `${e.AnnotationPrefix}${c}`, this.div.append(j), (q = r(this, Ot)) == null || q.moveElementInDOM(this.div, j, L, !1);
          }, vt = new WeakSet(), hn = function() {
            if (!r(this, Pt))
              return;
            const j = this.div;
            for (const [c, L] of r(this, Pt)) {
              const q = j.querySelector(`[data-annotation-id="${c}"]`);
              if (!q)
                continue;
              const {
                firstChild: K
              } = q;
              K ? K.nodeName === "CANVAS" ? K.replaceWith(L) : K.before(L) : q.append(L);
            }
            r(this, Pt).clear();
          }, t.AnnotationLayer = l;
        },
        /* 30 */
        /***/
        (i, t) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.ColorConverters = void 0;
          function n(p) {
            return Math.floor(Math.max(0, Math.min(1, p)) * 255).toString(16).padStart(2, "0");
          }
          function e(p) {
            return Math.max(0, Math.min(255, 255 * p));
          }
          class s {
            static CMYK_G([f, A, a, h]) {
              return ["G", 1 - Math.min(1, 0.3 * f + 0.59 * a + 0.11 * A + h)];
            }
            static G_CMYK([f]) {
              return ["CMYK", 0, 0, 0, 1 - f];
            }
            static G_RGB([f]) {
              return ["RGB", f, f, f];
            }
            static G_rgb([f]) {
              return f = e(f), [f, f, f];
            }
            static G_HTML([f]) {
              const A = n(f);
              return `#${A}${A}${A}`;
            }
            static RGB_G([f, A, a]) {
              return ["G", 0.3 * f + 0.59 * A + 0.11 * a];
            }
            static RGB_rgb(f) {
              return f.map(e);
            }
            static RGB_HTML(f) {
              return `#${f.map(n).join("")}`;
            }
            static T_HTML() {
              return "#00000000";
            }
            static T_rgb() {
              return [null];
            }
            static CMYK_RGB([f, A, a, h]) {
              return ["RGB", 1 - Math.min(1, f + h), 1 - Math.min(1, a + h), 1 - Math.min(1, A + h)];
            }
            static CMYK_rgb([f, A, a, h]) {
              return [e(1 - Math.min(1, f + h)), e(1 - Math.min(1, a + h)), e(1 - Math.min(1, A + h))];
            }
            static CMYK_HTML(f) {
              const A = this.CMYK_RGB(f).slice(1);
              return this.RGB_HTML(A);
            }
            static RGB_CMYK([f, A, a]) {
              const h = 1 - f, o = 1 - A, F = 1 - a, R = Math.min(h, o, F);
              return ["CMYK", h, o, F, R];
            }
          }
          t.ColorConverters = s;
        },
        /* 31 */
        /***/
        (i, t) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.NullL10n = void 0, t.getL10nFallback = e;
          const n = {
            of_pages: "of {{pagesCount}}",
            page_of_pages: "({{pageNumber}} of {{pagesCount}})",
            document_properties_kb: "{{size_kb}} KB ({{size_b}} bytes)",
            document_properties_mb: "{{size_mb}} MB ({{size_b}} bytes)",
            document_properties_date_string: "{{date}}, {{time}}",
            document_properties_page_size_unit_inches: "in",
            document_properties_page_size_unit_millimeters: "mm",
            document_properties_page_size_orientation_portrait: "portrait",
            document_properties_page_size_orientation_landscape: "landscape",
            document_properties_page_size_name_a3: "A3",
            document_properties_page_size_name_a4: "A4",
            document_properties_page_size_name_letter: "Letter",
            document_properties_page_size_name_legal: "Legal",
            document_properties_page_size_dimension_string: "{{width}} × {{height}} {{unit}} ({{orientation}})",
            document_properties_page_size_dimension_name_string: "{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",
            document_properties_linearized_yes: "Yes",
            document_properties_linearized_no: "No",
            additional_layers: "Additional Layers",
            page_landmark: "Page {{page}}",
            thumb_page_title: "Page {{page}}",
            thumb_page_canvas: "Thumbnail of Page {{page}}",
            find_reached_top: "Reached top of document, continued from bottom",
            find_reached_bottom: "Reached end of document, continued from top",
            "find_match_count[one]": "{{current}} of {{total}} match",
            "find_match_count[other]": "{{current}} of {{total}} matches",
            "find_match_count_limit[one]": "More than {{limit}} match",
            "find_match_count_limit[other]": "More than {{limit}} matches",
            find_not_found: "Phrase not found",
            page_scale_width: "Page Width",
            page_scale_fit: "Page Fit",
            page_scale_auto: "Automatic Zoom",
            page_scale_actual: "Actual Size",
            page_scale_percent: "{{scale}}%",
            loading_error: "An error occurred while loading the PDF.",
            invalid_file_error: "Invalid or corrupted PDF file.",
            missing_file_error: "Missing PDF file.",
            unexpected_response_error: "Unexpected server response.",
            rendering_error: "An error occurred while rendering the page.",
            annotation_date_string: "{{date}}, {{time}}",
            printing_not_supported: "Warning: Printing is not fully supported by this browser.",
            printing_not_ready: "Warning: The PDF is not fully loaded for printing.",
            web_fonts_disabled: "Web fonts are disabled: unable to use embedded PDF fonts.",
            free_text2_default_content: "Start typing…",
            editor_free_text2_aria_label: "Text Editor",
            editor_ink2_aria_label: "Draw Editor",
            editor_ink_canvas_aria_label: "User-created image",
            editor_alt_text_button_label: "Alt text",
            editor_alt_text_edit_button_label: "Edit alt text",
            editor_alt_text_decorative_tooltip: "Marked as decorative"
          };
          n.print_progress_percent = "{{progress}}%";
          function e(f, A) {
            switch (f) {
              case "find_match_count":
                f = `find_match_count[${A.total === 1 ? "one" : "other"}]`;
                break;
              case "find_match_count_limit":
                f = `find_match_count_limit[${A.limit === 1 ? "one" : "other"}]`;
                break;
            }
            return n[f] || "";
          }
          function s(f, A) {
            return A ? f.replaceAll(/\{\{\s*(\w+)\s*\}\}/g, (a, h) => h in A ? A[h] : "{{" + h + "}}") : f;
          }
          const p = {
            async getLanguage() {
              return "en-us";
            },
            async getDirection() {
              return "ltr";
            },
            async get(f, A = null, a = e(f, A)) {
              return s(a, A);
            },
            async translate(f) {
            }
          };
          t.NullL10n = p;
        },
        /* 32 */
        /***/
        (i, t, n) => {
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.XfaLayer = void 0;
          var e = n(25);
          class s {
            static setupStorage(f, A, a, h, o) {
              const F = h.getValue(A, {
                value: null
              });
              switch (a.name) {
                case "textarea":
                  if (F.value !== null && (f.textContent = F.value), o === "print")
                    break;
                  f.addEventListener("input", (R) => {
                    h.setValue(A, {
                      value: R.target.value
                    });
                  });
                  break;
                case "input":
                  if (a.attributes.type === "radio" || a.attributes.type === "checkbox") {
                    if (F.value === a.attributes.xfaOn ? f.setAttribute("checked", !0) : F.value === a.attributes.xfaOff && f.removeAttribute("checked"), o === "print")
                      break;
                    f.addEventListener("change", (R) => {
                      h.setValue(A, {
                        value: R.target.checked ? R.target.getAttribute("xfaOn") : R.target.getAttribute("xfaOff")
                      });
                    });
                  } else {
                    if (F.value !== null && f.setAttribute("value", F.value), o === "print")
                      break;
                    f.addEventListener("input", (R) => {
                      h.setValue(A, {
                        value: R.target.value
                      });
                    });
                  }
                  break;
                case "select":
                  if (F.value !== null) {
                    f.setAttribute("value", F.value);
                    for (const R of a.children)
                      R.attributes.value === F.value ? R.attributes.selected = !0 : R.attributes.hasOwnProperty("selected") && delete R.attributes.selected;
                  }
                  f.addEventListener("input", (R) => {
                    const w = R.target.options, T = w.selectedIndex === -1 ? "" : w[w.selectedIndex].value;
                    h.setValue(A, {
                      value: T
                    });
                  });
                  break;
              }
            }
            static setAttributes({
              html: f,
              element: A,
              storage: a = null,
              intent: h,
              linkService: o
            }) {
              const {
                attributes: F
              } = A, R = f instanceof HTMLAnchorElement;
              F.type === "radio" && (F.name = `${F.name}-${h}`);
              for (const [w, T] of Object.entries(F))
                if (T != null)
                  switch (w) {
                    case "class":
                      T.length && f.setAttribute(w, T.join(" "));
                      break;
                    case "dataId":
                      break;
                    case "id":
                      f.setAttribute("data-element-id", T);
                      break;
                    case "style":
                      Object.assign(f.style, T);
                      break;
                    case "textContent":
                      f.textContent = T;
                      break;
                    default:
                      (!R || w !== "href" && w !== "newWindow") && f.setAttribute(w, T);
                  }
              R && o.addLinkAttributes(f, F.href, F.newWindow), a && F.dataId && this.setupStorage(f, F.dataId, A, a);
            }
            static render(f) {
              var P;
              const A = f.annotationStorage, a = f.linkService, h = f.xfaHtml, o = f.intent || "display", F = document.createElement(h.name);
              h.attributes && this.setAttributes({
                html: F,
                element: h,
                intent: o,
                linkService: a
              });
              const R = [[h, -1, F]], w = f.div;
              if (w.append(F), f.viewport) {
                const m = `matrix(${f.viewport.transform.join(",")})`;
                w.style.transform = m;
              }
              o !== "richText" && w.setAttribute("class", "xfaLayer xfaFont");
              const T = [];
              for (; R.length > 0; ) {
                const [m, C, x] = R.at(-1);
                if (C + 1 === m.children.length) {
                  R.pop();
                  continue;
                }
                const E = m.children[++R.at(-1)[1]];
                if (E === null)
                  continue;
                const {
                  name: S
                } = E;
                if (S === "#text") {
                  const v = document.createTextNode(E.value);
                  T.push(v), x.append(v);
                  continue;
                }
                const g = (P = E == null ? void 0 : E.attributes) != null && P.xmlns ? document.createElementNS(E.attributes.xmlns, S) : document.createElement(S);
                if (x.append(g), E.attributes && this.setAttributes({
                  html: g,
                  element: E,
                  storage: A,
                  intent: o,
                  linkService: a
                }), E.children && E.children.length > 0)
                  R.push([E, -1, g]);
                else if (E.value) {
                  const v = document.createTextNode(E.value);
                  e.XfaText.shouldBuildText(S) && T.push(v), g.append(v);
                }
              }
              for (const m of w.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))
                m.setAttribute("readOnly", !0);
              return {
                textDivs: T
              };
            }
            static update(f) {
              const A = `matrix(${f.viewport.transform.join(",")})`;
              f.div.style.transform = A, f.div.hidden = !1;
            }
          }
          t.XfaLayer = s;
        },
        /* 33 */
        /***/
        (i, t, n) => {
          var h, o, F, R, w, T, P, m, C, x, E, S, g, v, $, Bn, _, Un, D, jn, Y, qn, U, dn, V, Wn, st, un, yt, Hn, k, zn, u, Gn, b, Xn, O, Vn, z, ae, Z, pn, ht, Re, ft, xe, Rt, fe, It, gn, rt, De, pt, Yn, Tt, _n, Wt, Kn, zt, Jn, qt, mn, ut, Ie, Q, pe;
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.InkEditor = void 0;
          var e = n(1), s = n(4), p = n(29), f = n(6), A = n(5);
          const wt = class wt extends s.AnnotationEditor {
            constructor(et) {
              super({
                ...et,
                name: "inkEditor"
              });
              W(this, $);
              W(this, _);
              W(this, D);
              W(this, Y);
              W(this, U);
              W(this, V);
              W(this, st);
              W(this, yt);
              W(this, k);
              W(this, u);
              W(this, b);
              W(this, O);
              W(this, z);
              W(this, Z);
              W(this, ht);
              W(this, ft);
              W(this, Rt);
              W(this, It);
              W(this, rt);
              W(this, zt);
              W(this, qt);
              W(this, ut);
              W(this, Q);
              W(this, h, 0);
              W(this, o, 0);
              W(this, F, this.canvasPointermove.bind(this));
              W(this, R, this.canvasPointerleave.bind(this));
              W(this, w, this.canvasPointerup.bind(this));
              W(this, T, this.canvasPointerdown.bind(this));
              W(this, P, new Path2D());
              W(this, m, !1);
              W(this, C, !1);
              W(this, x, !1);
              W(this, E, null);
              W(this, S, 0);
              W(this, g, 0);
              W(this, v, null);
              this.color = et.color || null, this.thickness = et.thickness || null, this.opacity = et.opacity || null, this.paths = [], this.bezierPath2D = [], this.allRawPaths = [], this.currentPath = [], this.scaleFactor = 1, this.translationX = this.translationY = 0, this.x = 0, this.y = 0, this._willKeepAspectRatio = !0;
            }
            static initialize(et) {
              s.AnnotationEditor.initialize(et, {
                strings: ["editor_ink_canvas_aria_label", "editor_ink2_aria_label"]
              });
            }
            static updateDefaultParams(et, Et) {
              switch (et) {
                case e.AnnotationEditorParamsType.INK_THICKNESS:
                  wt._defaultThickness = Et;
                  break;
                case e.AnnotationEditorParamsType.INK_COLOR:
                  wt._defaultColor = Et;
                  break;
                case e.AnnotationEditorParamsType.INK_OPACITY:
                  wt._defaultOpacity = Et / 100;
                  break;
              }
            }
            updateParams(et, Et) {
              switch (et) {
                case e.AnnotationEditorParamsType.INK_THICKNESS:
                  J(this, $, Bn).call(this, Et);
                  break;
                case e.AnnotationEditorParamsType.INK_COLOR:
                  J(this, _, Un).call(this, Et);
                  break;
                case e.AnnotationEditorParamsType.INK_OPACITY:
                  J(this, D, jn).call(this, Et);
                  break;
              }
            }
            static get defaultPropertiesToUpdate() {
              return [[e.AnnotationEditorParamsType.INK_THICKNESS, wt._defaultThickness], [e.AnnotationEditorParamsType.INK_COLOR, wt._defaultColor || s.AnnotationEditor._defaultLineColor], [e.AnnotationEditorParamsType.INK_OPACITY, Math.round(wt._defaultOpacity * 100)]];
            }
            get propertiesToUpdate() {
              return [[e.AnnotationEditorParamsType.INK_THICKNESS, this.thickness || wt._defaultThickness], [e.AnnotationEditorParamsType.INK_COLOR, this.color || wt._defaultColor || s.AnnotationEditor._defaultLineColor], [e.AnnotationEditorParamsType.INK_OPACITY, Math.round(100 * (this.opacity ?? wt._defaultOpacity))]];
            }
            rebuild() {
              this.parent && (super.rebuild(), this.div !== null && (this.canvas || (J(this, ht, Re).call(this), J(this, ft, xe).call(this)), this.isAttachedToDOM || (this.parent.add(this), J(this, Rt, fe).call(this)), J(this, Q, pe).call(this)));
            }
            remove() {
              this.canvas !== null && (this.isEmpty() || this.commit(), this.canvas.width = this.canvas.height = 0, this.canvas.remove(), this.canvas = null, r(this, E).disconnect(), ot(this, E, null), super.remove());
            }
            setParent(et) {
              !this.parent && et ? this._uiManager.removeShouldRescale(this) : this.parent && et === null && this._uiManager.addShouldRescale(this), super.setParent(et);
            }
            onScaleChanging() {
              const [et, Et] = this.parentDimensions, Ot = this.width * et, Pt = this.height * Et;
              this.setDimensions(Ot, Pt);
            }
            enableEditMode() {
              r(this, m) || this.canvas === null || (super.enableEditMode(), this._isDraggable = !1, this.canvas.addEventListener("pointerdown", r(this, T)));
            }
            disableEditMode() {
              !this.isInEditMode() || this.canvas === null || (super.disableEditMode(), this._isDraggable = !this.isEmpty(), this.div.classList.remove("editing"), this.canvas.removeEventListener("pointerdown", r(this, T)));
            }
            onceAdded() {
              this._isDraggable = !this.isEmpty();
            }
            isEmpty() {
              return this.paths.length === 0 || this.paths.length === 1 && this.paths[0].length === 0;
            }
            commit() {
              r(this, m) || (super.commit(), this.isEditing = !1, this.disableEditMode(), this.setInForeground(), ot(this, m, !0), this.div.classList.add("disabled"), J(this, Q, pe).call(this, !0), this.makeResizable(), this.parent.addInkEditorIfNeeded(!0), this.moveInDOM(), this.div.focus({
                preventScroll: !0
              }));
            }
            focusin(et) {
              this._focusEventsAllowed && (super.focusin(et), this.enableEditMode());
            }
            canvasPointerdown(et) {
              et.button !== 0 || !this.isInEditMode() || r(this, m) || (this.setInForeground(), et.preventDefault(), et.type !== "mouse" && this.div.focus(), J(this, V, Wn).call(this, et.offsetX, et.offsetY));
            }
            canvasPointermove(et) {
              et.preventDefault(), J(this, st, un).call(this, et.offsetX, et.offsetY);
            }
            canvasPointerup(et) {
              et.preventDefault(), J(this, Z, pn).call(this, et);
            }
            canvasPointerleave(et) {
              J(this, Z, pn).call(this, et);
            }
            get isResizable() {
              return !this.isEmpty() && r(this, m);
            }
            render() {
              if (this.div)
                return this.div;
              let et, Et;
              this.width && (et = this.x, Et = this.y), super.render(), s.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then((Jt) => {
                var vt;
                return (vt = this.div) == null ? void 0 : vt.setAttribute("aria-label", Jt);
              });
              const [Ot, Pt, $t, Nt] = J(this, Y, qn).call(this);
              if (this.setAt(Ot, Pt, 0, 0), this.setDims($t, Nt), J(this, ht, Re).call(this), this.width) {
                const [Jt, vt] = this.parentDimensions;
                this.setAspectRatio(this.width * Jt, this.height * vt), this.setAt(et * Jt, Et * vt, this.width * Jt, this.height * vt), ot(this, x, !0), J(this, Rt, fe).call(this), this.setDims(this.width * Jt, this.height * vt), J(this, z, ae).call(this), this.div.classList.add("disabled");
              } else
                this.div.classList.add("editing"), this.enableEditMode();
              return J(this, ft, xe).call(this), this.div;
            }
            setDimensions(et, Et) {
              const Ot = Math.round(et), Pt = Math.round(Et);
              if (r(this, S) === Ot && r(this, g) === Pt)
                return;
              ot(this, S, Ot), ot(this, g, Pt), this.canvas.style.visibility = "hidden";
              const [$t, Nt] = this.parentDimensions;
              this.width = et / $t, this.height = Et / Nt, this.fixAndSetPosition(), r(this, m) && J(this, It, gn).call(this, et, Et), J(this, Rt, fe).call(this), J(this, z, ae).call(this), this.canvas.style.visibility = "visible", this.fixDims();
            }
            static deserialize(et, Et, Ot) {
              var K, tt, ct;
              if (et instanceof p.InkAnnotationElement)
                return null;
              const Pt = super.deserialize(et, Et, Ot);
              Pt.thickness = et.thickness, Pt.color = e.Util.makeHexColor(...et.color), Pt.opacity = et.opacity;
              const [$t, Nt] = Pt.pageDimensions, Jt = Pt.width * $t, vt = Pt.height * Nt, Yt = Pt.parentScale, Lt = et.thickness / 2;
              ot(Pt, m, !0), ot(Pt, S, Math.round(Jt)), ot(Pt, g, Math.round(vt));
              const {
                paths: j,
                rect: c,
                rotation: L
              } = et;
              for (let {
                bezier: bt
              } of j) {
                bt = J(K = wt, Wt, Kn).call(K, bt, c, L);
                const Mt = [];
                Pt.paths.push(Mt);
                let Ft = Yt * (bt[0] - Lt), Ht = Yt * (bt[1] - Lt);
                for (let Dt = 2, Ut = bt.length; Dt < Ut; Dt += 6) {
                  const Xt = Yt * (bt[Dt] - Lt), Kt = Yt * (bt[Dt + 1] - Lt), Zt = Yt * (bt[Dt + 2] - Lt), ie = Yt * (bt[Dt + 3] - Lt), ne = Yt * (bt[Dt + 4] - Lt), se = Yt * (bt[Dt + 5] - Lt);
                  Mt.push([[Ft, Ht], [Xt, Kt], [Zt, ie], [ne, se]]), Ft = ne, Ht = se;
                }
                const xt = J(this, pt, Yn).call(this, Mt);
                Pt.bezierPath2D.push(xt);
              }
              const q = J(tt = Pt, qt, mn).call(tt);
              return ot(Pt, o, Math.max(s.AnnotationEditor.MIN_SIZE, q[2] - q[0])), ot(Pt, h, Math.max(s.AnnotationEditor.MIN_SIZE, q[3] - q[1])), J(ct = Pt, It, gn).call(ct, Jt, vt), Pt;
            }
            serialize() {
              if (this.isEmpty())
                return null;
              const et = this.getRect(0, 0), Et = s.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);
              return {
                annotationType: e.AnnotationEditorType.INK,
                color: Et,
                thickness: this.thickness,
                opacity: this.opacity,
                paths: J(this, zt, Jn).call(this, this.scaleFactor / this.parentScale, this.translationX, this.translationY, et),
                pageIndex: this.pageIndex,
                rect: et,
                rotation: this.rotation,
                structTreeParentId: this._structTreeParentId
              };
            }
          };
          h = new WeakMap(), o = new WeakMap(), F = new WeakMap(), R = new WeakMap(), w = new WeakMap(), T = new WeakMap(), P = new WeakMap(), m = new WeakMap(), C = new WeakMap(), x = new WeakMap(), E = new WeakMap(), S = new WeakMap(), g = new WeakMap(), v = new WeakMap(), $ = new WeakSet(), Bn = function(et) {
            const Et = this.thickness;
            this.addCommands({
              cmd: () => {
                this.thickness = et, J(this, Q, pe).call(this);
              },
              undo: () => {
                this.thickness = Et, J(this, Q, pe).call(this);
              },
              mustExec: !0,
              type: e.AnnotationEditorParamsType.INK_THICKNESS,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, _ = new WeakSet(), Un = function(et) {
            const Et = this.color;
            this.addCommands({
              cmd: () => {
                this.color = et, J(this, z, ae).call(this);
              },
              undo: () => {
                this.color = Et, J(this, z, ae).call(this);
              },
              mustExec: !0,
              type: e.AnnotationEditorParamsType.INK_COLOR,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, D = new WeakSet(), jn = function(et) {
            et /= 100;
            const Et = this.opacity;
            this.addCommands({
              cmd: () => {
                this.opacity = et, J(this, z, ae).call(this);
              },
              undo: () => {
                this.opacity = Et, J(this, z, ae).call(this);
              },
              mustExec: !0,
              type: e.AnnotationEditorParamsType.INK_OPACITY,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, Y = new WeakSet(), qn = function() {
            const {
              parentRotation: et,
              parentDimensions: [Et, Ot]
            } = this;
            switch (et) {
              case 90:
                return [0, Ot, Ot, Et];
              case 180:
                return [Et, Ot, Et, Ot];
              case 270:
                return [Et, 0, Ot, Et];
              default:
                return [0, 0, Et, Ot];
            }
          }, U = new WeakSet(), dn = function() {
            const {
              ctx: et,
              color: Et,
              opacity: Ot,
              thickness: Pt,
              parentScale: $t,
              scaleFactor: Nt
            } = this;
            et.lineWidth = Pt * $t / Nt, et.lineCap = "round", et.lineJoin = "round", et.miterLimit = 10, et.strokeStyle = `${Et}${(0, A.opacityToHex)(Ot)}`;
          }, V = new WeakSet(), Wn = function(et, Et) {
            this.canvas.addEventListener("contextmenu", f.noContextMenu), this.canvas.addEventListener("pointerleave", r(this, R)), this.canvas.addEventListener("pointermove", r(this, F)), this.canvas.addEventListener("pointerup", r(this, w)), this.canvas.removeEventListener("pointerdown", r(this, T)), this.isEditing = !0, r(this, x) || (ot(this, x, !0), J(this, Rt, fe).call(this), this.thickness || (this.thickness = wt._defaultThickness), this.color || (this.color = wt._defaultColor || s.AnnotationEditor._defaultLineColor), this.opacity ?? (this.opacity = wt._defaultOpacity)), this.currentPath.push([et, Et]), ot(this, C, !1), J(this, U, dn).call(this), ot(this, v, () => {
              J(this, u, Gn).call(this), r(this, v) && window.requestAnimationFrame(r(this, v));
            }), window.requestAnimationFrame(r(this, v));
          }, st = new WeakSet(), un = function(et, Et) {
            const [Ot, Pt] = this.currentPath.at(-1);
            if (this.currentPath.length > 1 && et === Ot && Et === Pt)
              return;
            const $t = this.currentPath;
            let Nt = r(this, P);
            if ($t.push([et, Et]), ot(this, C, !0), $t.length <= 2) {
              Nt.moveTo(...$t[0]), Nt.lineTo(et, Et);
              return;
            }
            $t.length === 3 && (ot(this, P, Nt = new Path2D()), Nt.moveTo(...$t[0])), J(this, b, Xn).call(this, Nt, ...$t.at(-3), ...$t.at(-2), et, Et);
          }, yt = new WeakSet(), Hn = function() {
            if (this.currentPath.length === 0)
              return;
            const et = this.currentPath.at(-1);
            r(this, P).lineTo(...et);
          }, k = new WeakSet(), zn = function(et, Et) {
            ot(this, v, null), et = Math.min(Math.max(et, 0), this.canvas.width), Et = Math.min(Math.max(Et, 0), this.canvas.height), J(this, st, un).call(this, et, Et), J(this, yt, Hn).call(this);
            let Ot;
            if (this.currentPath.length !== 1)
              Ot = J(this, O, Vn).call(this);
            else {
              const vt = [et, Et];
              Ot = [[vt, vt.slice(), vt.slice(), vt]];
            }
            const Pt = r(this, P), $t = this.currentPath;
            this.currentPath = [], ot(this, P, new Path2D());
            const Nt = () => {
              this.allRawPaths.push($t), this.paths.push(Ot), this.bezierPath2D.push(Pt), this.rebuild();
            }, Jt = () => {
              this.allRawPaths.pop(), this.paths.pop(), this.bezierPath2D.pop(), this.paths.length === 0 ? this.remove() : (this.canvas || (J(this, ht, Re).call(this), J(this, ft, xe).call(this)), J(this, Q, pe).call(this));
            };
            this.addCommands({
              cmd: Nt,
              undo: Jt,
              mustExec: !0
            });
          }, u = new WeakSet(), Gn = function() {
            if (!r(this, C))
              return;
            ot(this, C, !1);
            const et = Math.ceil(this.thickness * this.parentScale), Et = this.currentPath.slice(-3), Ot = Et.map((Nt) => Nt[0]), Pt = Et.map((Nt) => Nt[1]);
            Math.min(...Ot) - et, Math.max(...Ot) + et, Math.min(...Pt) - et, Math.max(...Pt) + et;
            const {
              ctx: $t
            } = this;
            $t.save(), $t.clearRect(0, 0, this.canvas.width, this.canvas.height);
            for (const Nt of this.bezierPath2D)
              $t.stroke(Nt);
            $t.stroke(r(this, P)), $t.restore();
          }, b = new WeakSet(), Xn = function(et, Et, Ot, Pt, $t, Nt, Jt) {
            const vt = (Et + Pt) / 2, Yt = (Ot + $t) / 2, Lt = (Pt + Nt) / 2, j = ($t + Jt) / 2;
            et.bezierCurveTo(vt + 2 * (Pt - vt) / 3, Yt + 2 * ($t - Yt) / 3, Lt + 2 * (Pt - Lt) / 3, j + 2 * ($t - j) / 3, Lt, j);
          }, O = new WeakSet(), Vn = function() {
            const et = this.currentPath;
            if (et.length <= 2)
              return [[et[0], et[0], et.at(-1), et.at(-1)]];
            const Et = [];
            let Ot, [Pt, $t] = et[0];
            for (Ot = 1; Ot < et.length - 2; Ot++) {
              const [c, L] = et[Ot], [q, K] = et[Ot + 1], tt = (c + q) / 2, ct = (L + K) / 2, bt = [Pt + 2 * (c - Pt) / 3, $t + 2 * (L - $t) / 3], Mt = [tt + 2 * (c - tt) / 3, ct + 2 * (L - ct) / 3];
              Et.push([[Pt, $t], bt, Mt, [tt, ct]]), [Pt, $t] = [tt, ct];
            }
            const [Nt, Jt] = et[Ot], [vt, Yt] = et[Ot + 1], Lt = [Pt + 2 * (Nt - Pt) / 3, $t + 2 * (Jt - $t) / 3], j = [vt + 2 * (Nt - vt) / 3, Yt + 2 * (Jt - Yt) / 3];
            return Et.push([[Pt, $t], Lt, j, [vt, Yt]]), Et;
          }, z = new WeakSet(), ae = function() {
            if (this.isEmpty()) {
              J(this, rt, De).call(this);
              return;
            }
            J(this, U, dn).call(this);
            const {
              canvas: et,
              ctx: Et
            } = this;
            Et.setTransform(1, 0, 0, 1, 0, 0), Et.clearRect(0, 0, et.width, et.height), J(this, rt, De).call(this);
            for (const Ot of this.bezierPath2D)
              Et.stroke(Ot);
          }, Z = new WeakSet(), pn = function(et) {
            this.canvas.removeEventListener("pointerleave", r(this, R)), this.canvas.removeEventListener("pointermove", r(this, F)), this.canvas.removeEventListener("pointerup", r(this, w)), this.canvas.addEventListener("pointerdown", r(this, T)), setTimeout(() => {
              this.canvas.removeEventListener("contextmenu", f.noContextMenu);
            }, 10), J(this, k, zn).call(this, et.offsetX, et.offsetY), this.addToAnnotationStorage(), this.setInBackground();
          }, ht = new WeakSet(), Re = function() {
            this.canvas = document.createElement("canvas"), this.canvas.width = this.canvas.height = 0, this.canvas.className = "inkEditorCanvas", s.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then((et) => {
              var Et;
              return (Et = this.canvas) == null ? void 0 : Et.setAttribute("aria-label", et);
            }), this.div.append(this.canvas), this.ctx = this.canvas.getContext("2d");
          }, ft = new WeakSet(), xe = function() {
            ot(this, E, new ResizeObserver((et) => {
              const Et = et[0].contentRect;
              Et.width && Et.height && this.setDimensions(Et.width, Et.height);
            })), r(this, E).observe(this.div);
          }, Rt = new WeakSet(), fe = function() {
            if (!r(this, x))
              return;
            const [et, Et] = this.parentDimensions;
            this.canvas.width = Math.ceil(this.width * et), this.canvas.height = Math.ceil(this.height * Et), J(this, rt, De).call(this);
          }, It = new WeakSet(), gn = function(et, Et) {
            const Ot = J(this, ut, Ie).call(this), Pt = (et - Ot) / r(this, o), $t = (Et - Ot) / r(this, h);
            this.scaleFactor = Math.min(Pt, $t);
          }, rt = new WeakSet(), De = function() {
            const et = J(this, ut, Ie).call(this) / 2;
            this.ctx.setTransform(this.scaleFactor, 0, 0, this.scaleFactor, this.translationX * this.scaleFactor + et, this.translationY * this.scaleFactor + et);
          }, pt = new WeakSet(), Yn = function(et) {
            const Et = new Path2D();
            for (let Ot = 0, Pt = et.length; Ot < Pt; Ot++) {
              const [$t, Nt, Jt, vt] = et[Ot];
              Ot === 0 && Et.moveTo(...$t), Et.bezierCurveTo(Nt[0], Nt[1], Jt[0], Jt[1], vt[0], vt[1]);
            }
            return Et;
          }, Tt = new WeakSet(), _n = function(et, Et, Ot) {
            const [Pt, $t, Nt, Jt] = Et;
            switch (Ot) {
              case 0:
                for (let vt = 0, Yt = et.length; vt < Yt; vt += 2)
                  et[vt] += Pt, et[vt + 1] = Jt - et[vt + 1];
                break;
              case 90:
                for (let vt = 0, Yt = et.length; vt < Yt; vt += 2) {
                  const Lt = et[vt];
                  et[vt] = et[vt + 1] + Pt, et[vt + 1] = Lt + $t;
                }
                break;
              case 180:
                for (let vt = 0, Yt = et.length; vt < Yt; vt += 2)
                  et[vt] = Nt - et[vt], et[vt + 1] += $t;
                break;
              case 270:
                for (let vt = 0, Yt = et.length; vt < Yt; vt += 2) {
                  const Lt = et[vt];
                  et[vt] = Nt - et[vt + 1], et[vt + 1] = Jt - Lt;
                }
                break;
              default:
                throw new Error("Invalid rotation");
            }
            return et;
          }, Wt = new WeakSet(), Kn = function(et, Et, Ot) {
            const [Pt, $t, Nt, Jt] = Et;
            switch (Ot) {
              case 0:
                for (let vt = 0, Yt = et.length; vt < Yt; vt += 2)
                  et[vt] -= Pt, et[vt + 1] = Jt - et[vt + 1];
                break;
              case 90:
                for (let vt = 0, Yt = et.length; vt < Yt; vt += 2) {
                  const Lt = et[vt];
                  et[vt] = et[vt + 1] - $t, et[vt + 1] = Lt - Pt;
                }
                break;
              case 180:
                for (let vt = 0, Yt = et.length; vt < Yt; vt += 2)
                  et[vt] = Nt - et[vt], et[vt + 1] -= $t;
                break;
              case 270:
                for (let vt = 0, Yt = et.length; vt < Yt; vt += 2) {
                  const Lt = et[vt];
                  et[vt] = Jt - et[vt + 1], et[vt + 1] = Nt - Lt;
                }
                break;
              default:
                throw new Error("Invalid rotation");
            }
            return et;
          }, zt = new WeakSet(), Jn = function(et, Et, Ot, Pt) {
            var Yt, Lt;
            const $t = [], Nt = this.thickness / 2, Jt = et * Et + Nt, vt = et * Ot + Nt;
            for (const j of this.paths) {
              const c = [], L = [];
              for (let q = 0, K = j.length; q < K; q++) {
                const [tt, ct, bt, Mt] = j[q], Ft = et * tt[0] + Jt, Ht = et * tt[1] + vt, xt = et * ct[0] + Jt, Dt = et * ct[1] + vt, Ut = et * bt[0] + Jt, Xt = et * bt[1] + vt, Kt = et * Mt[0] + Jt, Zt = et * Mt[1] + vt;
                q === 0 && (c.push(Ft, Ht), L.push(Ft, Ht)), c.push(xt, Dt, Ut, Xt, Kt, Zt), L.push(xt, Dt), q === K - 1 && L.push(Kt, Zt);
              }
              $t.push({
                bezier: J(Yt = wt, Tt, _n).call(Yt, c, Pt, this.rotation),
                points: J(Lt = wt, Tt, _n).call(Lt, L, Pt, this.rotation)
              });
            }
            return $t;
          }, qt = new WeakSet(), mn = function() {
            let et = 1 / 0, Et = -1 / 0, Ot = 1 / 0, Pt = -1 / 0;
            for (const $t of this.paths)
              for (const [Nt, Jt, vt, Yt] of $t) {
                const Lt = e.Util.bezierBoundingBox(...Nt, ...Jt, ...vt, ...Yt);
                et = Math.min(et, Lt[0]), Ot = Math.min(Ot, Lt[1]), Et = Math.max(Et, Lt[2]), Pt = Math.max(Pt, Lt[3]);
              }
            return [et, Ot, Et, Pt];
          }, ut = new WeakSet(), Ie = function() {
            return r(this, m) ? Math.ceil(this.thickness * this.parentScale) : 0;
          }, Q = new WeakSet(), pe = function(et = !1) {
            if (this.isEmpty())
              return;
            if (!r(this, m)) {
              J(this, z, ae).call(this);
              return;
            }
            const Et = J(this, qt, mn).call(this), Ot = J(this, ut, Ie).call(this);
            ot(this, o, Math.max(s.AnnotationEditor.MIN_SIZE, Et[2] - Et[0])), ot(this, h, Math.max(s.AnnotationEditor.MIN_SIZE, Et[3] - Et[1]));
            const Pt = Math.ceil(Ot + r(this, o) * this.scaleFactor), $t = Math.ceil(Ot + r(this, h) * this.scaleFactor), [Nt, Jt] = this.parentDimensions;
            this.width = Pt / Nt, this.height = $t / Jt, this.setAspectRatio(Pt, $t);
            const vt = this.translationX, Yt = this.translationY;
            this.translationX = -Et[0], this.translationY = -Et[1], J(this, Rt, fe).call(this), J(this, z, ae).call(this), ot(this, S, Pt), ot(this, g, $t), this.setDims(Pt, $t);
            const Lt = et ? Ot / this.scaleFactor / 2 : 0;
            this.translate(vt - this.translationX - Lt, Yt - this.translationY - Lt);
          }, W(wt, pt), W(wt, Tt), W(wt, Wt), ee(wt, "_defaultColor", null), ee(wt, "_defaultOpacity", 1), ee(wt, "_defaultThickness", 1), ee(wt, "_type", "ink");
          let a = wt;
          t.InkEditor = a;
        },
        /* 34 */
        /***/
        (i, t, n) => {
          var a, h, o, F, R, w, T, P, m, C, x, ve, S, Se, v, Le, M, bn, N, Zn, X, Qn, I, yn, G, Oe, H, ti;
          Object.defineProperty(t, "__esModule", {
            value: !0
          }), t.StampEditor = void 0;
          var e = n(1), s = n(4), p = n(6), f = n(29);
          const dt = class dt extends s.AnnotationEditor {
            constructor(k) {
              super({
                ...k,
                name: "stampEditor"
              });
              W(this, x);
              W(this, S);
              W(this, v);
              W(this, M);
              W(this, N);
              W(this, X);
              W(this, I);
              W(this, G);
              W(this, H);
              W(this, a, null);
              W(this, h, null);
              W(this, o, null);
              W(this, F, null);
              W(this, R, null);
              W(this, w, null);
              W(this, T, null);
              W(this, P, null);
              W(this, m, !1);
              W(this, C, !1);
              ot(this, F, k.bitmapUrl), ot(this, R, k.bitmapFile);
            }
            static initialize(k) {
              s.AnnotationEditor.initialize(k);
            }
            static get supportedTypes() {
              const k = ["apng", "avif", "bmp", "gif", "jpeg", "png", "svg+xml", "webp", "x-icon"];
              return (0, e.shadow)(this, "supportedTypes", k.map((l) => `image/${l}`));
            }
            static get supportedTypesStr() {
              return (0, e.shadow)(this, "supportedTypesStr", this.supportedTypes.join(","));
            }
            static isHandlingMimeForPasting(k) {
              return this.supportedTypes.includes(k);
            }
            static paste(k, l) {
              l.pasteEditor(e.AnnotationEditorType.STAMP, {
                bitmapFile: k.getAsFile()
              });
            }
            remove() {
              var k, l;
              r(this, h) && (ot(this, a, null), this._uiManager.imageManager.deleteId(r(this, h)), (k = r(this, w)) == null || k.remove(), ot(this, w, null), (l = r(this, T)) == null || l.disconnect(), ot(this, T, null)), super.remove();
            }
            rebuild() {
              if (!this.parent) {
                r(this, h) && J(this, v, Le).call(this);
                return;
              }
              super.rebuild(), this.div !== null && (r(this, h) && J(this, v, Le).call(this), this.isAttachedToDOM || this.parent.add(this));
            }
            onceAdded() {
              this._isDraggable = !0, this.div.focus();
            }
            isEmpty() {
              return !(r(this, o) || r(this, a) || r(this, F) || r(this, R));
            }
            get isResizable() {
              return !0;
            }
            render() {
              if (this.div)
                return this.div;
              let k, l;
              if (this.width && (k = this.x, l = this.y), super.render(), this.div.hidden = !0, r(this, a) ? J(this, M, bn).call(this) : J(this, v, Le).call(this), this.width) {
                const [u, d] = this.parentDimensions;
                this.setAt(k * u, l * d, this.width * u, this.height * d);
              }
              return this.div;
            }
            static deserialize(k, l, u) {
              if (k instanceof f.StampAnnotationElement)
                return null;
              const d = super.deserialize(k, l, u), {
                rect: b,
                bitmapUrl: y,
                bitmapId: O,
                isSvg: B,
                accessibilityData: z
              } = k;
              O && u.imageManager.isValidId(O) ? ot(d, h, O) : ot(d, F, y), ot(d, m, B);
              const [it, Z] = d.pageDimensions;
              return d.width = (b[2] - b[0]) / it, d.height = (b[3] - b[1]) / Z, z && (d.altTextData = z), d;
            }
            serialize(k = !1, l = null) {
              if (this.isEmpty())
                return null;
              const u = {
                annotationType: e.AnnotationEditorType.STAMP,
                bitmapId: r(this, h),
                pageIndex: this.pageIndex,
                rect: this.getRect(0, 0),
                rotation: this.rotation,
                isSvg: r(this, m),
                structTreeParentId: this._structTreeParentId
              };
              if (k)
                return u.bitmapUrl = J(this, G, Oe).call(this, !0), u.accessibilityData = this.altTextData, u;
              const {
                decorative: d,
                altText: b
              } = this.altTextData;
              if (!d && b && (u.accessibilityData = {
                type: "Figure",
                alt: b
              }), l === null)
                return u;
              l.stamps || (l.stamps = /* @__PURE__ */ new Map());
              const y = r(this, m) ? (u.rect[2] - u.rect[0]) * (u.rect[3] - u.rect[1]) : null;
              if (!l.stamps.has(r(this, h)))
                l.stamps.set(r(this, h), {
                  area: y,
                  serialized: u
                }), u.bitmap = J(this, G, Oe).call(this, !1);
              else if (r(this, m)) {
                const O = l.stamps.get(r(this, h));
                y > O.area && (O.area = y, O.serialized.bitmap.close(), O.serialized.bitmap = J(this, G, Oe).call(this, !1));
              }
              return u;
            }
          };
          a = new WeakMap(), h = new WeakMap(), o = new WeakMap(), F = new WeakMap(), R = new WeakMap(), w = new WeakMap(), T = new WeakMap(), P = new WeakMap(), m = new WeakMap(), C = new WeakMap(), x = new WeakSet(), ve = function(k, l = !1) {
            if (!k) {
              this.remove();
              return;
            }
            ot(this, a, k.bitmap), l || (ot(this, h, k.id), ot(this, m, k.isSvg)), J(this, M, bn).call(this);
          }, S = new WeakSet(), Se = function() {
            ot(this, o, null), this._uiManager.enableWaiting(!1), r(this, w) && this.div.focus();
          }, v = new WeakSet(), Le = function() {
            if (r(this, h)) {
              this._uiManager.enableWaiting(!0), this._uiManager.imageManager.getFromId(r(this, h)).then((l) => J(this, x, ve).call(this, l, !0)).finally(() => J(this, S, Se).call(this));
              return;
            }
            if (r(this, F)) {
              const l = r(this, F);
              ot(this, F, null), this._uiManager.enableWaiting(!0), ot(this, o, this._uiManager.imageManager.getFromUrl(l).then((u) => J(this, x, ve).call(this, u)).finally(() => J(this, S, Se).call(this)));
              return;
            }
            if (r(this, R)) {
              const l = r(this, R);
              ot(this, R, null), this._uiManager.enableWaiting(!0), ot(this, o, this._uiManager.imageManager.getFromFile(l).then((u) => J(this, x, ve).call(this, u)).finally(() => J(this, S, Se).call(this)));
              return;
            }
            const k = document.createElement("input");
            k.type = "file", k.accept = dt.supportedTypesStr, ot(this, o, new Promise((l) => {
              k.addEventListener("change", async () => {
                if (!k.files || k.files.length === 0)
                  this.remove();
                else {
                  this._uiManager.enableWaiting(!0);
                  const u = await this._uiManager.imageManager.getFromFile(k.files[0]);
                  J(this, x, ve).call(this, u);
                }
                l();
              }), k.addEventListener("cancel", () => {
                this.remove(), l();
              });
            }).finally(() => J(this, S, Se).call(this))), k.click();
          }, M = new WeakSet(), bn = function() {
            const {
              div: k
            } = this;
            let {
              width: l,
              height: u
            } = r(this, a);
            const [d, b] = this.pageDimensions, y = 0.75;
            if (this.width)
              l = this.width * d, u = this.height * b;
            else if (l > y * d || u > y * b) {
              const it = Math.min(y * d / l, y * b / u);
              l *= it, u *= it;
            }
            const [O, B] = this.parentDimensions;
            this.setDims(l * O / d, u * B / b), this._uiManager.enableWaiting(!1);
            const z = ot(this, w, document.createElement("canvas"));
            k.append(z), k.hidden = !1, J(this, I, yn).call(this, l, u), J(this, H, ti).call(this), r(this, C) || (this.parent.addUndoableEditor(this), ot(this, C, !0)), this._uiManager._eventBus.dispatch("reporttelemetry", {
              source: this,
              details: {
                type: "editing",
                subtype: this.editorType,
                data: {
                  action: "inserted_image"
                }
              }
            }), this.addAltTextButton();
          }, N = new WeakSet(), Zn = function(k, l) {
            var y;
            const [u, d] = this.parentDimensions;
            this.width = k / u, this.height = l / d, this.setDims(k, l), (y = this._initialOptions) != null && y.isCentered ? this.center() : this.fixAndSetPosition(), this._initialOptions = null, r(this, P) !== null && clearTimeout(r(this, P)), ot(this, P, setTimeout(() => {
              ot(this, P, null), J(this, I, yn).call(this, k, l);
            }, 200));
          }, X = new WeakSet(), Qn = function(k, l) {
            const {
              width: u,
              height: d
            } = r(this, a);
            let b = u, y = d, O = r(this, a);
            for (; b > 2 * k || y > 2 * l; ) {
              const B = b, z = y;
              b > 2 * k && (b = b >= 16384 ? Math.floor(b / 2) - 1 : Math.ceil(b / 2)), y > 2 * l && (y = y >= 16384 ? Math.floor(y / 2) - 1 : Math.ceil(y / 2));
              const it = new OffscreenCanvas(b, y);
              it.getContext("2d").drawImage(O, 0, 0, B, z, 0, 0, b, y), O = it.transferToImageBitmap();
            }
            return O;
          }, I = new WeakSet(), yn = function(k, l) {
            k = Math.ceil(k), l = Math.ceil(l);
            const u = r(this, w);
            if (!u || u.width === k && u.height === l)
              return;
            u.width = k, u.height = l;
            const d = r(this, m) ? r(this, a) : J(this, X, Qn).call(this, k, l), b = u.getContext("2d");
            b.filter = this._uiManager.hcmFilter, b.drawImage(d, 0, 0, d.width, d.height, 0, 0, k, l);
          }, G = new WeakSet(), Oe = function(k) {
            if (k) {
              if (r(this, m)) {
                const d = this._uiManager.imageManager.getSvgUrl(r(this, h));
                if (d)
                  return d;
              }
              const l = document.createElement("canvas");
              return {
                width: l.width,
                height: l.height
              } = r(this, a), l.getContext("2d").drawImage(r(this, a), 0, 0), l.toDataURL();
            }
            if (r(this, m)) {
              const [l, u] = this.pageDimensions, d = Math.round(this.width * l * p.PixelsPerInch.PDF_TO_CSS_UNITS), b = Math.round(this.height * u * p.PixelsPerInch.PDF_TO_CSS_UNITS), y = new OffscreenCanvas(d, b);
              return y.getContext("2d").drawImage(r(this, a), 0, 0, r(this, a).width, r(this, a).height, 0, 0, d, b), y.transferToImageBitmap();
            }
            return structuredClone(r(this, a));
          }, H = new WeakSet(), ti = function() {
            ot(this, T, new ResizeObserver((k) => {
              const l = k[0].contentRect;
              l.width && l.height && J(this, N, Zn).call(this, l.width, l.height);
            })), r(this, T).observe(this.div);
          }, ee(dt, "_type", "stamp");
          let A = dt;
          t.StampEditor = A;
        }
        /******/
      ], __webpack_module_cache__ = {};
      function __w_pdfjs_require__(i) {
        var t = __webpack_module_cache__[i];
        if (t !== void 0)
          return t.exports;
        var n = __webpack_module_cache__[i] = {
          /******/
          // no module.id needed
          /******/
          // no module.loaded needed
          /******/
          exports: {}
          /******/
        };
        return __webpack_modules__[i](n, n.exports, __w_pdfjs_require__), n.exports;
      }
      var __webpack_exports__ = {};
      return (() => {
        var i = __webpack_exports__;
        Object.defineProperty(i, "__esModule", {
          value: !0
        }), Object.defineProperty(i, "AbortException", {
          enumerable: !0,
          get: function() {
            return t.AbortException;
          }
        }), Object.defineProperty(i, "AnnotationEditorLayer", {
          enumerable: !0,
          get: function() {
            return p.AnnotationEditorLayer;
          }
        }), Object.defineProperty(i, "AnnotationEditorParamsType", {
          enumerable: !0,
          get: function() {
            return t.AnnotationEditorParamsType;
          }
        }), Object.defineProperty(i, "AnnotationEditorType", {
          enumerable: !0,
          get: function() {
            return t.AnnotationEditorType;
          }
        }), Object.defineProperty(i, "AnnotationEditorUIManager", {
          enumerable: !0,
          get: function() {
            return f.AnnotationEditorUIManager;
          }
        }), Object.defineProperty(i, "AnnotationLayer", {
          enumerable: !0,
          get: function() {
            return A.AnnotationLayer;
          }
        }), Object.defineProperty(i, "AnnotationMode", {
          enumerable: !0,
          get: function() {
            return t.AnnotationMode;
          }
        }), Object.defineProperty(i, "CMapCompressionType", {
          enumerable: !0,
          get: function() {
            return t.CMapCompressionType;
          }
        }), Object.defineProperty(i, "DOMSVGFactory", {
          enumerable: !0,
          get: function() {
            return e.DOMSVGFactory;
          }
        }), Object.defineProperty(i, "FeatureTest", {
          enumerable: !0,
          get: function() {
            return t.FeatureTest;
          }
        }), Object.defineProperty(i, "GlobalWorkerOptions", {
          enumerable: !0,
          get: function() {
            return a.GlobalWorkerOptions;
          }
        }), Object.defineProperty(i, "ImageKind", {
          enumerable: !0,
          get: function() {
            return t.ImageKind;
          }
        }), Object.defineProperty(i, "InvalidPDFException", {
          enumerable: !0,
          get: function() {
            return t.InvalidPDFException;
          }
        }), Object.defineProperty(i, "MissingPDFException", {
          enumerable: !0,
          get: function() {
            return t.MissingPDFException;
          }
        }), Object.defineProperty(i, "OPS", {
          enumerable: !0,
          get: function() {
            return t.OPS;
          }
        }), Object.defineProperty(i, "PDFDataRangeTransport", {
          enumerable: !0,
          get: function() {
            return n.PDFDataRangeTransport;
          }
        }), Object.defineProperty(i, "PDFDateString", {
          enumerable: !0,
          get: function() {
            return e.PDFDateString;
          }
        }), Object.defineProperty(i, "PDFWorker", {
          enumerable: !0,
          get: function() {
            return n.PDFWorker;
          }
        }), Object.defineProperty(i, "PasswordResponses", {
          enumerable: !0,
          get: function() {
            return t.PasswordResponses;
          }
        }), Object.defineProperty(i, "PermissionFlag", {
          enumerable: !0,
          get: function() {
            return t.PermissionFlag;
          }
        }), Object.defineProperty(i, "PixelsPerInch", {
          enumerable: !0,
          get: function() {
            return e.PixelsPerInch;
          }
        }), Object.defineProperty(i, "PromiseCapability", {
          enumerable: !0,
          get: function() {
            return t.PromiseCapability;
          }
        }), Object.defineProperty(i, "RenderingCancelledException", {
          enumerable: !0,
          get: function() {
            return e.RenderingCancelledException;
          }
        }), Object.defineProperty(i, "SVGGraphics", {
          enumerable: !0,
          get: function() {
            return n.SVGGraphics;
          }
        }), Object.defineProperty(i, "UnexpectedResponseException", {
          enumerable: !0,
          get: function() {
            return t.UnexpectedResponseException;
          }
        }), Object.defineProperty(i, "Util", {
          enumerable: !0,
          get: function() {
            return t.Util;
          }
        }), Object.defineProperty(i, "VerbosityLevel", {
          enumerable: !0,
          get: function() {
            return t.VerbosityLevel;
          }
        }), Object.defineProperty(i, "XfaLayer", {
          enumerable: !0,
          get: function() {
            return h.XfaLayer;
          }
        }), Object.defineProperty(i, "build", {
          enumerable: !0,
          get: function() {
            return n.build;
          }
        }), Object.defineProperty(i, "createValidAbsoluteUrl", {
          enumerable: !0,
          get: function() {
            return t.createValidAbsoluteUrl;
          }
        }), Object.defineProperty(i, "getDocument", {
          enumerable: !0,
          get: function() {
            return n.getDocument;
          }
        }), Object.defineProperty(i, "getFilenameFromUrl", {
          enumerable: !0,
          get: function() {
            return e.getFilenameFromUrl;
          }
        }), Object.defineProperty(i, "getPdfFilenameFromUrl", {
          enumerable: !0,
          get: function() {
            return e.getPdfFilenameFromUrl;
          }
        }), Object.defineProperty(i, "getXfaPageViewport", {
          enumerable: !0,
          get: function() {
            return e.getXfaPageViewport;
          }
        }), Object.defineProperty(i, "isDataScheme", {
          enumerable: !0,
          get: function() {
            return e.isDataScheme;
          }
        }), Object.defineProperty(i, "isPdfFile", {
          enumerable: !0,
          get: function() {
            return e.isPdfFile;
          }
        }), Object.defineProperty(i, "loadScript", {
          enumerable: !0,
          get: function() {
            return e.loadScript;
          }
        }), Object.defineProperty(i, "noContextMenu", {
          enumerable: !0,
          get: function() {
            return e.noContextMenu;
          }
        }), Object.defineProperty(i, "normalizeUnicode", {
          enumerable: !0,
          get: function() {
            return t.normalizeUnicode;
          }
        }), Object.defineProperty(i, "renderTextLayer", {
          enumerable: !0,
          get: function() {
            return s.renderTextLayer;
          }
        }), Object.defineProperty(i, "setLayerDimensions", {
          enumerable: !0,
          get: function() {
            return e.setLayerDimensions;
          }
        }), Object.defineProperty(i, "shadow", {
          enumerable: !0,
          get: function() {
            return t.shadow;
          }
        }), Object.defineProperty(i, "updateTextLayer", {
          enumerable: !0,
          get: function() {
            return s.updateTextLayer;
          }
        }), Object.defineProperty(i, "version", {
          enumerable: !0,
          get: function() {
            return n.version;
          }
        });
        var t = __w_pdfjs_require__(1), n = __w_pdfjs_require__(2), e = __w_pdfjs_require__(6), s = __w_pdfjs_require__(26), p = __w_pdfjs_require__(27), f = __w_pdfjs_require__(5), A = __w_pdfjs_require__(29), a = __w_pdfjs_require__(14), h = __w_pdfjs_require__(32);
      })(), __webpack_exports__;
    })()
  ));
})(pdf);
var pdfExports = pdf.exports;
const {
  SvelteComponent,
  append,
  assign,
  attr,
  binding_callbacks,
  check_outros,
  create_component,
  destroy_component,
  detach,
  element,
  empty,
  get_spread_object,
  get_spread_update,
  group_outros,
  init,
  insert,
  mount_component,
  safe_not_equal,
  set_data,
  set_style,
  space,
  text,
  transition_in,
  transition_out
} = window.__gradio__svelte__internal, { tick } = window.__gradio__svelte__internal;
function create_if_block_1(i) {
  let t, n;
  const e = [
    {
      autoscroll: (
        /*gradio*/
        i[11].autoscroll
      )
    },
    { i18n: (
      /*gradio*/
      i[11].i18n
    ) },
    /*loading_status*/
    i[10]
  ];
  let s = {};
  for (let p = 0; p < e.length; p += 1)
    s = assign(s, e[p]);
  return t = new Static({ props: s }), {
    c() {
      create_component(t.$$.fragment);
    },
    m(p, f) {
      mount_component(t, p, f), n = !0;
    },
    p(p, f) {
      const A = f & /*gradio, loading_status*/
      3072 ? get_spread_update(e, [
        f & /*gradio*/
        2048 && {
          autoscroll: (
            /*gradio*/
            p[11].autoscroll
          )
        },
        f & /*gradio*/
        2048 && { i18n: (
          /*gradio*/
          p[11].i18n
        ) },
        f & /*loading_status*/
        1024 && get_spread_object(
          /*loading_status*/
          p[10]
        )
      ]) : {};
      t.$set(A);
    },
    i(p) {
      n || (transition_in(t.$$.fragment, p), n = !0);
    },
    o(p) {
      transition_out(t.$$.fragment, p), n = !1;
    },
    d(p) {
      destroy_component(t, p);
    }
  };
}
function create_else_block(i) {
  let t, n;
  return t = new Upload({
    props: {
      filetype: "application/pdf",
      file_count: "single",
      root: (
        /*root*/
        i[7]
      ),
      $$slots: { default: [create_default_slot_3] },
      $$scope: { ctx: i }
    }
  }), t.$on(
    "load",
    /*handle_upload*/
    i[17]
  ), {
    c() {
      create_component(t.$$.fragment);
    },
    m(e, s) {
      mount_component(t, e, s), n = !0;
    },
    p(e, s) {
      const p = {};
      s & /*root*/
      128 && (p.root = /*root*/
      e[7]), s & /*$$scope*/
      536870912 && (p.$$scope = { dirty: s, ctx: e }), t.$set(p);
    },
    i(e) {
      n || (transition_in(t.$$.fragment, e), n = !0);
    },
    o(e) {
      transition_out(t.$$.fragment, e), n = !1;
    },
    d(e) {
      destroy_component(t, e);
    }
  };
}
function create_if_block(i) {
  let t, n, e, s, p, f, A, a, h, o, F, R, w, T, P;
  return t = new ModifyUpload({
    props: {
      i18n: (
        /*gradio*/
        i[11].i18n
      ),
      absolute: !0
    }
  }), t.$on(
    "clear",
    /*handle_clear*/
    i[16]
  ), A = new Button({
    props: {
      $$slots: { default: [create_default_slot_2] },
      $$scope: { ctx: i }
    }
  }), A.$on(
    "click",
    /*prev_page*/
    i[19]
  ), T = new Button({
    props: {
      $$slots: { default: [create_default_slot_1] },
      $$scope: { ctx: i }
    }
  }), T.$on(
    "click",
    /*next_page*/
    i[18]
  ), {
    c() {
      create_component(t.$$.fragment), n = space(), e = element("div"), s = element("canvas"), p = space(), f = element("div"), create_component(A.$$.fragment), a = space(), h = element("span"), o = text(
        /*currentPage*/
        i[15]
      ), F = text(" / "), R = text(
        /*numPages*/
        i[13]
      ), w = space(), create_component(T.$$.fragment), attr(e, "class", "pdf-canvas svelte-qxsbof"), set_style(
        e,
        "height",
        /*height*/
        i[1] + "px"
      ), attr(h, "class", "page-count svelte-qxsbof"), attr(f, "class", "button-row svelte-qxsbof");
    },
    m(m, C) {
      mount_component(t, m, C), insert(m, n, C), insert(m, e, C), append(e, s), i[23](s), insert(m, p, C), insert(m, f, C), mount_component(A, f, null), append(f, a), append(f, h), append(h, o), append(h, F), append(h, R), append(f, w), mount_component(T, f, null), P = !0;
    },
    p(m, C) {
      const x = {};
      C & /*gradio*/
      2048 && (x.i18n = /*gradio*/
      m[11].i18n), t.$set(x), (!P || C & /*height*/
      2) && set_style(
        e,
        "height",
        /*height*/
        m[1] + "px"
      );
      const E = {};
      C & /*$$scope*/
      536870912 && (E.$$scope = { dirty: C, ctx: m }), A.$set(E), (!P || C & /*currentPage*/
      32768) && set_data(
        o,
        /*currentPage*/
        m[15]
      ), (!P || C & /*numPages*/
      8192) && set_data(
        R,
        /*numPages*/
        m[13]
      );
      const S = {};
      C & /*$$scope*/
      536870912 && (S.$$scope = { dirty: C, ctx: m }), T.$set(S);
    },
    i(m) {
      P || (transition_in(t.$$.fragment, m), transition_in(A.$$.fragment, m), transition_in(T.$$.fragment, m), P = !0);
    },
    o(m) {
      transition_out(t.$$.fragment, m), transition_out(A.$$.fragment, m), transition_out(T.$$.fragment, m), P = !1;
    },
    d(m) {
      m && (detach(n), detach(e), detach(p), detach(f)), destroy_component(t, m), i[23](null), destroy_component(A), destroy_component(T);
    }
  };
}
function create_default_slot_3(i) {
  let t, n;
  return t = new PdfUploadText({}), {
    c() {
      create_component(t.$$.fragment);
    },
    m(e, s) {
      mount_component(t, e, s), n = !0;
    },
    i(e) {
      n || (transition_in(t.$$.fragment, e), n = !0);
    },
    o(e) {
      transition_out(t.$$.fragment, e), n = !1;
    },
    d(e) {
      destroy_component(t, e);
    }
  };
}
function create_default_slot_2(i) {
  let t;
  return {
    c() {
      t = text("⬅️");
    },
    m(n, e) {
      insert(n, t, e);
    },
    d(n) {
      n && detach(t);
    }
  };
}
function create_default_slot_1(i) {
  let t;
  return {
    c() {
      t = text("➡️");
    },
    m(n, e) {
      insert(n, t, e);
    },
    d(n) {
      n && detach(t);
    }
  };
}
function create_default_slot(i) {
  let t, n, e, s, p, f, A, a = (
    /*loading_status*/
    i[10] && create_if_block_1(i)
  );
  n = new BlockLabel({
    props: {
      show_label: (
        /*label*/
        i[8] !== null
      ),
      Icon: File$1,
      float: (
        /*value*/
        i[0] === null
      ),
      label: (
        /*label*/
        i[8] || "File"
      )
    }
  });
  const h = [create_if_block, create_else_block], o = [];
  function F(R, w) {
    return (
      /*_value*/
      R[12] ? 0 : 1
    );
  }
  return s = F(i), p = o[s] = h[s](i), {
    c() {
      a && a.c(), t = space(), create_component(n.$$.fragment), e = space(), p.c(), f = empty();
    },
    m(R, w) {
      a && a.m(R, w), insert(R, t, w), mount_component(n, R, w), insert(R, e, w), o[s].m(R, w), insert(R, f, w), A = !0;
    },
    p(R, w) {
      /*loading_status*/
      R[10] ? a ? (a.p(R, w), w & /*loading_status*/
      1024 && transition_in(a, 1)) : (a = create_if_block_1(R), a.c(), transition_in(a, 1), a.m(t.parentNode, t)) : a && (group_outros(), transition_out(a, 1, 1, () => {
        a = null;
      }), check_outros());
      const T = {};
      w & /*label*/
      256 && (T.show_label = /*label*/
      R[8] !== null), w & /*value*/
      1 && (T.float = /*value*/
      R[0] === null), w & /*label*/
      256 && (T.label = /*label*/
      R[8] || "File"), n.$set(T);
      let P = s;
      s = F(R), s === P ? o[s].p(R, w) : (group_outros(), transition_out(o[P], 1, 1, () => {
        o[P] = null;
      }), check_outros(), p = o[s], p ? p.p(R, w) : (p = o[s] = h[s](R), p.c()), transition_in(p, 1), p.m(f.parentNode, f));
    },
    i(R) {
      A || (transition_in(a), transition_in(n.$$.fragment, R), transition_in(p), A = !0);
    },
    o(R) {
      transition_out(a), transition_out(n.$$.fragment, R), transition_out(p), A = !1;
    },
    d(R) {
      R && (detach(t), detach(e), detach(f)), a && a.d(R), destroy_component(n, R), o[s].d(R);
    }
  };
}
function create_fragment(i) {
  let t, n;
  return t = new Block({
    props: {
      visible: (
        /*visible*/
        i[4]
      ),
      elem_id: (
        /*elem_id*/
        i[2]
      ),
      elem_classes: (
        /*elem_classes*/
        i[3]
      ),
      container: (
        /*container*/
        i[5]
      ),
      scale: (
        /*scale*/
        i[6]
      ),
      min_width: (
        /*min_width*/
        i[9]
      ),
      $$slots: { default: [create_default_slot] },
      $$scope: { ctx: i }
    }
  }), {
    c() {
      create_component(t.$$.fragment);
    },
    m(e, s) {
      mount_component(t, e, s), n = !0;
    },
    p(e, [s]) {
      const p = {};
      s & /*visible*/
      16 && (p.visible = /*visible*/
      e[4]), s & /*elem_id*/
      4 && (p.elem_id = /*elem_id*/
      e[2]), s & /*elem_classes*/
      8 && (p.elem_classes = /*elem_classes*/
      e[3]), s & /*container*/
      32 && (p.container = /*container*/
      e[5]), s & /*scale*/
      64 && (p.scale = /*scale*/
      e[6]), s & /*min_width*/
      512 && (p.min_width = /*min_width*/
      e[9]), s & /*$$scope, numPages, currentPage, height, canvasRef, gradio, _value, root, label, value, loading_status*/
      536935811 && (p.$$scope = { dirty: s, ctx: e }), t.$set(p);
    },
    i(e) {
      n || (transition_in(t.$$.fragment, e), n = !0);
    },
    o(e) {
      transition_out(t.$$.fragment, e), n = !1;
    },
    d(e) {
      destroy_component(t, e);
    }
  };
}
function instance(i, t, n) {
  let e;
  var s = this && this.__awaiter || function(U, G, V, H) {
    function st(dt) {
      return dt instanceof V ? dt : new V(function(yt) {
        yt(dt);
      });
    }
    return new (V || (V = Promise))(function(dt, yt) {
      function gt(u) {
        try {
          l(H.next(u));
        } catch (d) {
          yt(d);
        }
      }
      function k(u) {
        try {
          l(H.throw(u));
        } catch (d) {
          yt(d);
        }
      }
      function l(u) {
        u.done ? dt(u.value) : st(u.value).then(gt, k);
      }
      l((H = H.apply(U, G || [])).next());
    });
  };
  let { elem_id: p = "" } = t, { elem_classes: f = [] } = t, { visible: A = !0 } = t, { value: a = null } = t, { container: h = !0 } = t, { scale: o = null } = t, { root: F } = t, { height: R = 500 } = t, { starting_page: w } = t, { label: T } = t, { proxy_url: P } = t, { min_width: m = void 0 } = t, { loading_status: C } = t, { gradio: x } = t;
  pdfExports.GlobalWorkerOptions.workerSrc = "https://cdn.bootcss.com/pdf.js/3.11.174/pdf.worker.js";
  let E = a, S = E, g, v = 1, $;
  function M() {
    return s(this, void 0, void 0, function* () {
      n(12, E = null), yield tick(), x.dispatch("change");
    });
  }
  function _(U) {
    return s(this, arguments, void 0, function* ({ detail: G }) {
      n(0, a = G), yield tick(), x.dispatch("change"), x.dispatch("upload");
    });
  }
  function N(U) {
    return s(this, void 0, void 0, function* () {
      g = yield pdfExports.getDocument(U.url).promise, n(13, v = g.numPages), D();
    });
  }
  function D() {
    g.getPage(e).then((U) => {
      const G = $.getContext("2d");
      G.clearRect(0, 0, $.width, $.height);
      let V = U.getViewport({ scale: 1 }), H = R / V.height;
      V = U.getViewport({ scale: H });
      const st = { canvasContext: G, viewport: V };
      n(14, $.width = V.width, $), n(14, $.height = V.height, $), U.render(st);
    });
  }
  function X() {
    e >= v || (n(15, e++, e), D());
  }
  function Y() {
    e != 1 && (n(15, e--, e), D());
  }
  function I(U) {
    binding_callbacks[U ? "unshift" : "push"](() => {
      $ = U, n(14, $);
    });
  }
  return i.$$set = (U) => {
    "elem_id" in U && n(2, p = U.elem_id), "elem_classes" in U && n(3, f = U.elem_classes), "visible" in U && n(4, A = U.visible), "value" in U && n(0, a = U.value), "container" in U && n(5, h = U.container), "scale" in U && n(6, o = U.scale), "root" in U && n(7, F = U.root), "height" in U && n(1, R = U.height), "starting_page" in U && n(20, w = U.starting_page), "label" in U && n(8, T = U.label), "proxy_url" in U && n(21, P = U.proxy_url), "min_width" in U && n(9, m = U.min_width), "loading_status" in U && n(10, C = U.loading_status), "gradio" in U && n(11, x = U.gradio);
  }, i.$$.update = () => {
    i.$$.dirty & /*starting_page, numPages*/
    1056768 && n(15, e = Math.min(Math.max(w, 1), v)), i.$$.dirty & /*height*/
    2 && n(1, R = R || 500), i.$$.dirty & /*value, root, proxy_url*/
    2097281 && n(12, E = normalise_file(a, F, P)), i.$$.dirty & /*old_value, _value, gradio*/
    4200448 && JSON.stringify(S) != JSON.stringify(E) && (E && N(E), n(22, S = E), x.dispatch("change"));
  }, [
    a,
    R,
    p,
    f,
    A,
    h,
    o,
    F,
    T,
    m,
    C,
    x,
    E,
    v,
    $,
    e,
    M,
    _,
    X,
    Y,
    w,
    P,
    S,
    I
  ];
}
class Index extends SvelteComponent {
  constructor(t) {
    super(), init(this, t, instance, create_fragment, safe_not_equal, {
      elem_id: 2,
      elem_classes: 3,
      visible: 4,
      value: 0,
      container: 5,
      scale: 6,
      root: 7,
      height: 1,
      starting_page: 20,
      label: 8,
      proxy_url: 21,
      min_width: 9,
      loading_status: 10,
      gradio: 11
    });
  }
}
export {
  Index as I,
  require$$5$1 as r
};
