var qI = Object.defineProperty;
var _v = (i) => {
  throw TypeError(i);
};
var zI = (i, t, e) => t in i ? qI(i, t, { enumerable: !0, configurable: !0, writable: !0, value: e }) : i[t] = e;
var ft = (i, t, e) => zI(i, typeof t != "symbol" ? t + "" : t, e), r6 = (i, t, e) => t.has(i) || _v("Cannot " + e);
var m = (i, t, e) => (r6(i, t, "read from private field"), e ? e.call(i) : t.get(i)), F = (i, t, e) => t.has(i) ? _v("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(i) : t.set(i, e), E = (i, t, e, n) => (r6(i, t, "write to private field"), n ? n.call(i, e) : t.set(i, e), e), D = (i, t, e) => (r6(i, t, "access private method"), e);
var Zn = (i, t, e, n) => ({
  set _(s) {
    E(i, t, s, e);
  },
  get _() {
    return m(i, t, n);
  }
});
const os = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser"), k7 = [1e-3, 0, 0, 1e-3, 0, 0], a6 = 1.35, tr = {
  ANY: 1,
  DISPLAY: 2,
  PRINT: 4,
  ANNOTATIONS_FORMS: 16,
  ANNOTATIONS_STORAGE: 32,
  ANNOTATIONS_DISABLE: 64,
  IS_EDITING: 128,
  OPLIST: 256
}, Dl = {
  DISABLE: 0,
  ENABLE: 1,
  ENABLE_FORMS: 2,
  ENABLE_STORAGE: 3
}, UI = "pdfjs_internal_editor_", fe = {
  DISABLE: -1,
  NONE: 0,
  FREETEXT: 3,
  HIGHLIGHT: 9,
  STAMP: 13,
  INK: 15,
  SIGNATURE: 101
}, Ie = {
  RESIZE: 1,
  CREATE: 2,
  FREETEXT_SIZE: 11,
  FREETEXT_COLOR: 12,
  FREETEXT_OPACITY: 13,
  INK_COLOR: 21,
  INK_THICKNESS: 22,
  INK_OPACITY: 23,
  HIGHLIGHT_COLOR: 31,
  HIGHLIGHT_DEFAULT_COLOR: 32,
  HIGHLIGHT_THICKNESS: 33,
  HIGHLIGHT_FREE: 34,
  HIGHLIGHT_SHOW_ALL: 35,
  DRAW_STEP: 41
}, YA = {
  PRINT: 4,
  MODIFY_CONTENTS: 8,
  COPY: 16,
  MODIFY_ANNOTATIONS: 32,
  FILL_INTERACTIVE_FORMS: 256,
  COPY_FOR_ACCESSIBILITY: 512,
  ASSEMBLE: 1024,
  PRINT_HIGH_QUALITY: 2048
}, On = {
  FILL: 0,
  STROKE: 1,
  FILL_STROKE: 2,
  INVISIBLE: 3,
  FILL_STROKE_MASK: 3,
  ADD_TO_PATH_FLAG: 4
}, C2 = {
  GRAYSCALE_1BPP: 1,
  RGB_24BPP: 2,
  RGBA_32BPP: 3
}, Bi = {
  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
}, Z1 = {
  SOLID: 1,
  DASHED: 2,
  BEVELED: 3,
  INSET: 4,
  UNDERLINE: 5
}, pg = {
  ERRORS: 0,
  WARNINGS: 1,
  INFOS: 5
}, Y2 = {
  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,
  setStrokeTransparent: 92,
  setFillTransparent: 93,
  rawFillPath: 94
}, qg = {
  moveTo: 0,
  lineTo: 1,
  curveTo: 2,
  closePath: 3
}, KA = {
  NEED_PASSWORD: 1,
  INCORRECT_PASSWORD: 2
};
let _4 = pg.WARNINGS;
function HI(i) {
  Number.isInteger(i) && (_4 = i);
}
function jI() {
  return _4;
}
function x4(i) {
  _4 >= pg.INFOS && console.log(`Info: ${i}`);
}
function me(i) {
  _4 >= pg.WARNINGS && console.log(`Warning: ${i}`);
}
function Ze(i) {
  throw new Error(i);
}
function Vi(i, t) {
  i || Ze(t);
}
function GI(i) {
  switch (i == null ? void 0 : i.protocol) {
    case "http:":
    case "https:":
    case "ftp:":
    case "mailto:":
    case "tel:":
      return !0;
    default:
      return !1;
  }
}
function Ay(i, t = null, e = null) {
  if (!i)
    return null;
  if (e && typeof i == "string") {
    if (e.addDefaultProtocol && i.startsWith("www.")) {
      const s = i.match(/\./g);
      (s == null ? void 0 : s.length) >= 2 && (i = `http://${i}`);
    }
    if (e.tryConvertEncoding)
      try {
        i = KI(i);
      } catch {
      }
  }
  const n = t ? URL.parse(i, t) : URL.parse(i);
  return GI(n) ? n : null;
}
function Sy(i, t, e = !1) {
  const n = URL.parse(i);
  return n ? (n.hash = t, n.href) : e && Ay(i, "http://example.com") ? i.split("#", 1)[0] + `${t ? `#${t}` : ""}` : "";
}
function Fe(i, t, e, n = !1) {
  return Object.defineProperty(i, t, {
    value: e,
    enumerable: !n,
    configurable: !0,
    writable: !1
  }), e;
}
const M1 = function() {
  function t(e, n) {
    this.message = e, this.name = n;
  }
  return t.prototype = new Error(), t.constructor = t, t;
}();
let xv = class extends M1 {
  constructor(t, e) {
    super(t, "PasswordException"), this.code = e;
  }
}, o6 = class extends M1 {
  constructor(t, e) {
    super(t, "UnknownErrorException"), this.details = e;
  }
}, N9 = class extends M1 {
  constructor(t) {
    super(t, "InvalidPDFException");
  }
}, K2 = class extends M1 {
  constructor(t, e, n) {
    super(t, "ResponseException"), this.status = e, this.missing = n;
  }
}, VI = class extends M1 {
  constructor(t) {
    super(t, "FormatError");
  }
}, Hl = class extends M1 {
  constructor(t) {
    super(t, "AbortException");
  }
};
function ZA(i) {
  (typeof i != "object" || (i == null ? void 0 : i.length) === void 0) && Ze("Invalid argument for bytesToString");
  const t = i.length, e = 8192;
  if (t < e)
    return String.fromCharCode.apply(null, i);
  const n = [];
  for (let s = 0; s < t; s += e) {
    const r = Math.min(s + e, t), a = i.subarray(s, r);
    n.push(String.fromCharCode.apply(null, a));
  }
  return n.join("");
}
function mg(i) {
  typeof i != "string" && Ze("Invalid argument for stringToBytes");
  const t = i.length, e = new Uint8Array(t);
  for (let n = 0; n < t; ++n)
    e[n] = i.charCodeAt(n) & 255;
  return e;
}
function WI(i) {
  return String.fromCharCode(i >> 24 & 255, i >> 16 & 255, i >> 8 & 255, i & 255);
}
function XI() {
  const i = new Uint8Array(4);
  return i[0] = 1, new Uint32Array(i.buffer, 0, 1)[0] === 1;
}
function YI() {
  try {
    return new Function(""), !0;
  } catch {
    return !1;
  }
}
class gn {
  static get isLittleEndian() {
    return Fe(this, "isLittleEndian", XI());
  }
  static get isEvalSupported() {
    return Fe(this, "isEvalSupported", YI());
  }
  static get isOffscreenCanvasSupported() {
    return Fe(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
  }
  static get isImageDecoderSupported() {
    return Fe(this, "isImageDecoderSupported", typeof ImageDecoder < "u");
  }
  static get platform() {
    const {
      platform: t,
      userAgent: e
    } = navigator;
    return Fe(this, "platform", {
      isAndroid: e.includes("Android"),
      isLinux: t.includes("Linux"),
      isMac: t.includes("Mac"),
      isWindows: t.includes("Win"),
      isFirefox: e.includes("Firefox")
    });
  }
  static get isCSSRoundSupported() {
    var t, e;
    return Fe(this, "isCSSRoundSupported", (e = (t = globalThis.CSS) == null ? void 0 : t.supports) == null ? void 0 : e.call(t, "width: round(1.5px, 1px)"));
  }
}
const l6 = Array.from(Array(256).keys(), (i) => i.toString(16).padStart(2, "0"));
var ql, x7, R5, A7;
let Zt = (x7 = class {
  static makeHexColor(t, e, n) {
    return `#${l6[t]}${l6[e]}${l6[n]}`;
  }
  static scaleMinMax(t, e) {
    let n;
    t[0] ? (t[0] < 0 && (n = e[0], e[0] = e[2], e[2] = n), e[0] *= t[0], e[2] *= t[0], t[3] < 0 && (n = e[1], e[1] = e[3], e[3] = n), e[1] *= t[3], e[3] *= t[3]) : (n = e[0], e[0] = e[1], e[1] = n, n = e[2], e[2] = e[3], e[3] = n, t[1] < 0 && (n = e[1], e[1] = e[3], e[3] = n), e[1] *= t[1], e[3] *= t[1], t[2] < 0 && (n = e[0], e[0] = e[2], e[2] = n), e[0] *= t[2], e[2] *= t[2]), e[0] += t[4], e[1] += t[5], e[2] += t[4], e[3] += t[5];
  }
  static transform(t, e) {
    return [t[0] * e[0] + t[2] * e[1], t[1] * e[0] + t[3] * e[1], t[0] * e[2] + t[2] * e[3], t[1] * e[2] + t[3] * e[3], t[0] * e[4] + t[2] * e[5] + t[4], t[1] * e[4] + t[3] * e[5] + t[5]];
  }
  static applyTransform(t, e, n = 0) {
    const s = t[n], r = t[n + 1];
    t[n] = s * e[0] + r * e[2] + e[4], t[n + 1] = s * e[1] + r * e[3] + e[5];
  }
  static applyTransformToBezier(t, e, n = 0) {
    const s = e[0], r = e[1], a = e[2], o = e[3], l = e[4], c = e[5];
    for (let h = 0; h < 6; h += 2) {
      const u = t[n + h], f = t[n + h + 1];
      t[n + h] = u * s + f * a + l, t[n + h + 1] = u * r + f * o + c;
    }
  }
  static applyInverseTransform(t, e) {
    const n = t[0], s = t[1], r = e[0] * e[3] - e[1] * e[2];
    t[0] = (n * e[3] - s * e[2] + e[2] * e[5] - e[4] * e[3]) / r, t[1] = (-n * e[1] + s * e[0] + e[4] * e[1] - e[5] * e[0]) / r;
  }
  static axialAlignedBoundingBox(t, e, n) {
    const s = e[0], r = e[1], a = e[2], o = e[3], l = e[4], c = e[5], h = t[0], u = t[1], f = t[2], d = t[3];
    let p = s * h + l, g = p, b = s * f + l, y = b, v = o * u + c, w = v, _ = o * d + c, x = _;
    if (r !== 0 || a !== 0) {
      const k = r * h, S = r * f, T = a * u, I = a * d;
      p += T, y += T, b += I, g += I, v += k, x += k, _ += S, w += S;
    }
    n[0] = Math.min(n[0], p, b, g, y), n[1] = Math.min(n[1], v, _, w, x), n[2] = Math.max(n[2], p, b, g, y), n[3] = Math.max(n[3], v, _, w, x);
  }
  static inverseTransform(t) {
    const e = t[0] * t[3] - t[1] * t[2];
    return [t[3] / e, -t[1] / e, -t[2] / e, t[0] / e, (t[2] * t[5] - t[4] * t[3]) / e, (t[4] * t[1] - t[5] * t[0]) / e];
  }
  static singularValueDecompose2dScale(t, e) {
    const n = t[0], s = t[1], r = t[2], a = t[3], o = n ** 2 + s ** 2, l = n * r + s * a, c = r ** 2 + a ** 2, h = (o + c) / 2, u = Math.sqrt(h ** 2 - (o * c - l ** 2));
    e[0] = Math.sqrt(h + u || 1), e[1] = Math.sqrt(h - u || 1);
  }
  static normalizeRect(t) {
    const e = t.slice(0);
    return t[0] > t[2] && (e[0] = t[2], e[2] = t[0]), t[1] > t[3] && (e[1] = t[3], e[3] = t[1]), e;
  }
  static intersect(t, e) {
    const n = Math.max(Math.min(t[0], t[2]), Math.min(e[0], e[2])), s = Math.min(Math.max(t[0], t[2]), Math.max(e[0], e[2]));
    if (n > s)
      return null;
    const r = Math.max(Math.min(t[1], t[3]), Math.min(e[1], e[3])), a = Math.min(Math.max(t[1], t[3]), Math.max(e[1], e[3]));
    return r > a ? null : [n, r, s, a];
  }
  static pointBoundingBox(t, e, n) {
    n[0] = Math.min(n[0], t), n[1] = Math.min(n[1], e), n[2] = Math.max(n[2], t), n[3] = Math.max(n[3], e);
  }
  static rectBoundingBox(t, e, n, s, r) {
    r[0] = Math.min(r[0], t, n), r[1] = Math.min(r[1], e, s), r[2] = Math.max(r[2], t, n), r[3] = Math.max(r[3], e, s);
  }
  static bezierBoundingBox(t, e, n, s, r, a, o, l, c) {
    c[0] = Math.min(c[0], t, o), c[1] = Math.min(c[1], e, l), c[2] = Math.max(c[2], t, o), c[3] = Math.max(c[3], e, l), D(this, ql, A7).call(this, t, n, r, o, e, s, a, l, 3 * (-t + 3 * (n - r) + o), 6 * (t - 2 * n + r), 3 * (n - t), c), D(this, ql, A7).call(this, t, n, r, o, e, s, a, l, 3 * (-e + 3 * (s - a) + l), 6 * (e - 2 * s + a), 3 * (s - e), c);
  }
}, ql = new WeakSet(), R5 = function(t, e, n, s, r, a, o, l, c, h) {
  if (c <= 0 || c >= 1)
    return;
  const u = 1 - c, f = c * c, d = f * c, p = u * (u * (u * t + 3 * c * e) + 3 * f * n) + d * s, g = u * (u * (u * r + 3 * c * a) + 3 * f * o) + d * l;
  h[0] = Math.min(h[0], p), h[1] = Math.min(h[1], g), h[2] = Math.max(h[2], p), h[3] = Math.max(h[3], g);
}, A7 = function(t, e, n, s, r, a, o, l, c, h, u, f) {
  if (Math.abs(c) < 1e-12) {
    Math.abs(h) >= 1e-12 && D(this, ql, R5).call(this, t, e, n, s, r, a, o, l, -u / h, f);
    return;
  }
  const d = h ** 2 - 4 * u * c;
  if (d < 0)
    return;
  const p = Math.sqrt(d), g = 2 * c;
  D(this, ql, R5).call(this, t, e, n, s, r, a, o, l, (-h + p) / g, f), D(this, ql, R5).call(this, t, e, n, s, r, a, o, l, (-h - p) / g, f);
}, F(x7, ql), x7);
function KI(i) {
  return decodeURIComponent(escape(i));
}
let c6 = null, kv = null;
function JA(i) {
  return c6 || (c6 = /([\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, kv = /* @__PURE__ */ new Map([["ﬅ", "ſt"]])), i.replaceAll(c6, (t, e, n) => e ? e.normalize("NFKC") : kv.get(n));
}
function Cy() {
  if (typeof crypto.randomUUID == "function")
    return crypto.randomUUID();
  const i = new Uint8Array(32);
  return crypto.getRandomValues(i), ZA(i);
}
const Ey = "pdfjs_internal_id_";
function ZI(i, t, e) {
  if (!Array.isArray(e) || e.length < 2)
    return !1;
  const [n, s, ...r] = e;
  if (!i(n) && !Number.isInteger(n) || !t(s))
    return !1;
  const a = r.length;
  let o = !0;
  switch (s.name) {
    case "XYZ":
      if (a < 2 || a > 3)
        return !1;
      break;
    case "Fit":
    case "FitB":
      return a === 0;
    case "FitH":
    case "FitBH":
    case "FitV":
    case "FitBV":
      if (a > 1)
        return !1;
      break;
    case "FitR":
      if (a !== 4)
        return !1;
      o = !1;
      break;
    default:
      return !1;
  }
  for (const l of r)
    if (!(typeof l == "number" || o && l === null))
      return !1;
  return !0;
}
function Gn(i, t, e) {
  return Math.min(Math.max(i, t), e);
}
function QA(i) {
  return Uint8Array.prototype.toBase64 ? i.toBase64() : btoa(ZA(i));
}
function JI(i) {
  return Uint8Array.fromBase64 ? Uint8Array.fromBase64(i) : mg(atob(i));
}
typeof Promise.try != "function" && (Promise.try = function(i, ...t) {
  return new Promise((e) => {
    e(i(...t));
  });
});
typeof Math.sumPrecise != "function" && (Math.sumPrecise = function(i) {
  return i.reduce((t, e) => t + e, 0);
});
const Uo = "http://www.w3.org/2000/svg", Z0 = class Z0 {
};
ft(Z0, "CSS", 96), ft(Z0, "PDF", 72), ft(Z0, "PDF_TO_CSS_UNITS", Z0.CSS / Z0.PDF);
let jl = Z0;
async function ff(i, t = "text") {
  if (Kf(i, document.baseURI)) {
    const e = await fetch(i);
    if (!e.ok)
      throw new Error(e.statusText);
    switch (t) {
      case "arraybuffer":
        return e.arrayBuffer();
      case "blob":
        return e.blob();
      case "json":
        return e.json();
    }
    return e.text();
  }
  return new Promise((e, n) => {
    const s = new XMLHttpRequest();
    s.open("GET", i, !0), s.responseType = t, s.onreadystatechange = () => {
      if (s.readyState === XMLHttpRequest.DONE) {
        if (s.status === 200 || s.status === 0) {
          switch (t) {
            case "arraybuffer":
            case "blob":
            case "json":
              e(s.response);
              return;
          }
          e(s.responseText);
          return;
        }
        n(new Error(s.statusText));
      }
    }, s.send(null);
  });
}
class gg {
  constructor({
    viewBox: t,
    userUnit: e,
    scale: n,
    rotation: s,
    offsetX: r = 0,
    offsetY: a = 0,
    dontFlip: o = !1
  }) {
    this.viewBox = t, this.userUnit = e, this.scale = n, this.rotation = s, this.offsetX = r, this.offsetY = a, n *= e;
    const l = (t[2] + t[0]) / 2, c = (t[3] + t[1]) / 2;
    let h, u, f, d;
    switch (s %= 360, s < 0 && (s += 360), s) {
      case 180:
        h = -1, u = 0, f = 0, d = 1;
        break;
      case 90:
        h = 0, u = 1, f = 1, d = 0;
        break;
      case 270:
        h = 0, u = -1, f = -1, d = 0;
        break;
      case 0:
        h = 1, u = 0, f = 0, d = -1;
        break;
      default:
        throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.");
    }
    o && (f = -f, d = -d);
    let p, g, b, y;
    h === 0 ? (p = Math.abs(c - t[1]) * n + r, g = Math.abs(l - t[0]) * n + a, b = (t[3] - t[1]) * n, y = (t[2] - t[0]) * n) : (p = Math.abs(l - t[0]) * n + r, g = Math.abs(c - t[1]) * n + a, b = (t[2] - t[0]) * n, y = (t[3] - t[1]) * n), this.transform = [h * n, u * n, f * n, d * n, p - h * n * l - f * n * c, g - u * n * l - d * n * c], this.width = b, this.height = y;
  }
  get rawDims() {
    const t = this.viewBox;
    return Fe(this, "rawDims", {
      pageWidth: t[2] - t[0],
      pageHeight: t[3] - t[1],
      pageX: t[0],
      pageY: t[1]
    });
  }
  clone({
    scale: t = this.scale,
    rotation: e = this.rotation,
    offsetX: n = this.offsetX,
    offsetY: s = this.offsetY,
    dontFlip: r = !1
  } = {}) {
    return new gg({
      viewBox: this.viewBox.slice(),
      userUnit: this.userUnit,
      scale: t,
      rotation: e,
      offsetX: n,
      offsetY: s,
      dontFlip: r
    });
  }
  convertToViewportPoint(t, e) {
    const n = [t, e];
    return Zt.applyTransform(n, this.transform), n;
  }
  convertToViewportRectangle(t) {
    const e = [t[0], t[1]];
    Zt.applyTransform(e, this.transform);
    const n = [t[2], t[3]];
    return Zt.applyTransform(n, this.transform), [e[0], e[1], n[0], n[1]];
  }
  convertToPdfPoint(t, e) {
    const n = [t, e];
    return Zt.applyInverseTransform(n, this.transform), n;
  }
}
class k4 extends M1 {
  constructor(t, e = 0) {
    super(t, "RenderingCancelledException"), this.extraDelay = e;
  }
}
function bg(i) {
  const t = i.length;
  let e = 0;
  for (; e < t && i[e].trim() === ""; )
    e++;
  return i.substring(e, e + 5).toLowerCase() === "data:";
}
function A4(i) {
  return typeof i == "string" && /\.pdf$/i.test(i);
}
function tS(i) {
  return [i] = i.split(/[#?]/, 1), i.substring(i.lastIndexOf("/") + 1);
}
function eS(i, t = "document.pdf") {
  if (typeof i != "string")
    return t;
  if (bg(i))
    return me('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'), t;
  const e = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/, n = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i, s = e.exec(i);
  let r = n.exec(s[1]) || n.exec(s[2]) || n.exec(s[3]);
  if (r && (r = r[0], r.includes("%")))
    try {
      r = n.exec(decodeURIComponent(r))[0];
    } catch {
    }
  return r || t;
}
class Av {
  constructor() {
    ft(this, "started", /* @__PURE__ */ Object.create(null));
    ft(this, "times", []);
  }
  time(t) {
    t in this.started && me(`Timer is already running for ${t}`), this.started[t] = Date.now();
  }
  timeEnd(t) {
    t in this.started || me(`Timer has not been started for ${t}`), this.times.push({
      name: t,
      start: this.started[t],
      end: Date.now()
    }), delete this.started[t];
  }
  toString() {
    const t = [];
    let e = 0;
    for (const {
      name: n
    } of this.times)
      e = Math.max(n.length, e);
    for (const {
      name: n,
      start: s,
      end: r
    } of this.times)
      t.push(`${n.padEnd(e)} ${r - s}ms
`);
    return t.join("");
  }
}
function Kf(i, t) {
  const e = t ? URL.parse(i, t) : URL.parse(i);
  return (e == null ? void 0 : e.protocol) === "http:" || (e == null ? void 0 : e.protocol) === "https:";
}
function Gr(i) {
  i.preventDefault();
}
function Oi(i) {
  i.preventDefault(), i.stopPropagation();
}
function QI(i) {
  console.log("Deprecated API usage: " + i);
}
var kp;
class S4 {
  static toDateObject(t) {
    if (!t || typeof t != "string")
      return null;
    m(this, kp) || E(this, kp, new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));
    const e = m(this, kp).exec(t);
    if (!e)
      return null;
    const n = parseInt(e[1], 10);
    let s = parseInt(e[2], 10);
    s = s >= 1 && s <= 12 ? s - 1 : 0;
    let r = parseInt(e[3], 10);
    r = r >= 1 && r <= 31 ? r : 1;
    let a = parseInt(e[4], 10);
    a = a >= 0 && a <= 23 ? a : 0;
    let o = parseInt(e[5], 10);
    o = o >= 0 && o <= 59 ? o : 0;
    let l = parseInt(e[6], 10);
    l = l >= 0 && l <= 59 ? l : 0;
    const c = e[7] || "Z";
    let h = parseInt(e[8], 10);
    h = h >= 0 && h <= 23 ? h : 0;
    let u = parseInt(e[9], 10) || 0;
    return u = u >= 0 && u <= 59 ? u : 0, c === "-" ? (a += h, o += u) : c === "+" && (a -= h, o -= u), new Date(Date.UTC(n, s, r, a, o, l));
  }
}
kp = new WeakMap(), F(S4, kp);
function iS(i, {
  scale: t = 1,
  rotation: e = 0
}) {
  const {
    width: n,
    height: s
  } = i.attributes.style, r = [0, 0, parseInt(n), parseInt(s)];
  return new gg({
    viewBox: r,
    userUnit: 1,
    scale: t,
    rotation: e
  });
}
function Dy(i) {
  if (i.startsWith("#")) {
    const t = parseInt(i.slice(1), 16);
    return [(t & 16711680) >> 16, (t & 65280) >> 8, t & 255];
  }
  return i.startsWith("rgb(") ? i.slice(4, -1).split(",").map((t) => parseInt(t)) : i.startsWith("rgba(") ? i.slice(5, -1).split(",").map((t) => parseInt(t)).slice(0, 3) : (me(`Not a valid color format: "${i}"`), [0, 0, 0]);
}
function tM(i) {
  const t = document.createElement("span");
  t.style.visibility = "hidden", t.style.colorScheme = "only light", document.body.append(t);
  for (const e of i.keys()) {
    t.style.color = e;
    const n = window.getComputedStyle(t).color;
    i.set(e, Dy(n));
  }
  t.remove();
}
function _i(i) {
  const {
    a: t,
    b: e,
    c: n,
    d: s,
    e: r,
    f: a
  } = i.getTransform();
  return [t, e, n, s, r, a];
}
function $a(i) {
  const {
    a: t,
    b: e,
    c: n,
    d: s,
    e: r,
    f: a
  } = i.getTransform().invertSelf();
  return [t, e, n, s, r, a];
}
function h0(i, t, e = !1, n = !0) {
  if (t instanceof gg) {
    const {
      pageWidth: s,
      pageHeight: r
    } = t.rawDims, {
      style: a
    } = i, o = gn.isCSSRoundSupported, l = `var(--total-scale-factor) * ${s}px`, c = `var(--total-scale-factor) * ${r}px`, h = o ? `round(down, ${l}, var(--scale-round-x))` : `calc(${l})`, u = o ? `round(down, ${c}, var(--scale-round-y))` : `calc(${c})`;
    !e || t.rotation % 180 === 0 ? (a.width = h, a.height = u) : (a.width = u, a.height = h);
  }
  n && i.setAttribute("data-main-rotation", t.rotation);
}
class Ia {
  constructor() {
    const {
      pixelRatio: t
    } = Ia;
    this.sx = t, this.sy = t;
  }
  get scaled() {
    return this.sx !== 1 || this.sy !== 1;
  }
  get symmetric() {
    return this.sx === this.sy;
  }
  limitCanvas(t, e, n, s, r = -1) {
    let a = 1 / 0, o = 1 / 0, l = 1 / 0;
    n = Ia.capPixels(n, r), n > 0 && (a = Math.sqrt(n / (t * e))), s !== -1 && (o = s / t, l = s / e);
    const c = Math.min(a, o, l);
    return this.sx > c || this.sy > c ? (this.sx = c, this.sy = c, !0) : !1;
  }
  static get pixelRatio() {
    return globalThis.devicePixelRatio || 1;
  }
  static capPixels(t, e) {
    if (e >= 0) {
      const n = Math.ceil(window.screen.availWidth * window.screen.availHeight * this.pixelRatio ** 2 * (1 + e / 100));
      return t > 0 ? Math.min(t, n) : n;
    }
    return t;
  }
}
const L9 = ["image/apng", "image/avif", "image/bmp", "image/gif", "image/jpeg", "image/png", "image/svg+xml", "image/webp", "image/x-icon"];
var mc, nh, yr, gc, Ap, Bu, Sp, H3, nS, In, sS, rS, Zf, aS, B5;
const Wo = class Wo {
  constructor(t) {
    F(this, In);
    F(this, mc, null);
    F(this, nh, null);
    F(this, yr);
    F(this, gc, null);
    F(this, Ap, null);
    F(this, Bu, null);
    E(this, yr, t), m(Wo, Sp) || E(Wo, Sp, Object.freeze({
      freetext: "pdfjs-editor-remove-freetext-button",
      highlight: "pdfjs-editor-remove-highlight-button",
      ink: "pdfjs-editor-remove-ink-button",
      stamp: "pdfjs-editor-remove-stamp-button",
      signature: "pdfjs-editor-remove-signature-button"
    }));
  }
  render() {
    const t = E(this, mc, document.createElement("div"));
    t.classList.add("editToolbar", "hidden"), t.setAttribute("role", "toolbar");
    const e = m(this, yr)._uiManager._signal;
    t.addEventListener("contextmenu", Gr, {
      signal: e
    }), t.addEventListener("pointerdown", D(Wo, H3, nS), {
      signal: e
    });
    const n = E(this, gc, document.createElement("div"));
    n.className = "buttons", t.append(n);
    const s = m(this, yr).toolbarPosition;
    if (s) {
      const {
        style: r
      } = t, a = m(this, yr)._uiManager.direction === "ltr" ? 1 - s[0] : s[0];
      r.insetInlineEnd = `${100 * a}%`, r.top = `calc(${100 * s[1]}% + var(--editor-toolbar-vert-offset))`;
    }
    return D(this, In, aS).call(this), t;
  }
  get div() {
    return m(this, mc);
  }
  hide() {
    var t;
    m(this, mc).classList.add("hidden"), (t = m(this, nh)) == null || t.hideDropdown();
  }
  show() {
    var t;
    m(this, mc).classList.remove("hidden"), (t = m(this, Ap)) == null || t.shown();
  }
  async addAltText(t) {
    const e = await t.render();
    D(this, In, Zf).call(this, e), m(this, gc).prepend(e, m(this, In, B5)), E(this, Ap, t);
  }
  addColorPicker(t) {
    E(this, nh, t);
    const e = t.renderButton();
    D(this, In, Zf).call(this, e), m(this, gc).prepend(e, m(this, In, B5));
  }
  async addEditSignatureButton(t) {
    const e = E(this, Bu, await t.renderEditButton(m(this, yr)));
    D(this, In, Zf).call(this, e), m(this, gc).prepend(e, m(this, In, B5));
  }
  updateEditSignatureButton(t) {
    m(this, Bu) && (m(this, Bu).title = t);
  }
  remove() {
    var t;
    m(this, mc).remove(), (t = m(this, nh)) == null || t.destroy(), E(this, nh, null);
  }
};
mc = new WeakMap(), nh = new WeakMap(), yr = new WeakMap(), gc = new WeakMap(), Ap = new WeakMap(), Bu = new WeakMap(), Sp = new WeakMap(), H3 = new WeakSet(), nS = function(t) {
  t.stopPropagation();
}, In = new WeakSet(), sS = function(t) {
  m(this, yr)._focusEventsAllowed = !1, Oi(t);
}, rS = function(t) {
  m(this, yr)._focusEventsAllowed = !0, Oi(t);
}, Zf = function(t) {
  const e = m(this, yr)._uiManager._signal;
  t.addEventListener("focusin", D(this, In, sS).bind(this), {
    capture: !0,
    signal: e
  }), t.addEventListener("focusout", D(this, In, rS).bind(this), {
    capture: !0,
    signal: e
  }), t.addEventListener("contextmenu", Gr, {
    signal: e
  });
}, aS = function() {
  const {
    editorType: t,
    _uiManager: e
  } = m(this, yr), n = document.createElement("button");
  n.className = "delete", n.tabIndex = 0, n.setAttribute("data-l10n-id", m(Wo, Sp)[t]), D(this, In, Zf).call(this, n), n.addEventListener("click", (s) => {
    e.delete();
  }, {
    signal: e._signal
  }), m(this, gc).append(n);
}, B5 = function() {
  const t = document.createElement("div");
  return t.className = "divider", t;
}, F(Wo, H3), F(Wo, Sp, null);
let S7 = Wo;
var Cp, sh, rh, b0, oS, lS, cS;
class eM {
  constructor(t) {
    F(this, b0);
    F(this, Cp, null);
    F(this, sh, null);
    F(this, rh);
    E(this, rh, t);
  }
  show(t, e, n) {
    const [s, r] = D(this, b0, lS).call(this, e, n), {
      style: a
    } = m(this, sh) || E(this, sh, D(this, b0, oS).call(this));
    t.append(m(this, sh)), a.insetInlineEnd = `${100 * s}%`, a.top = `calc(${100 * r}% + var(--editor-toolbar-vert-offset))`;
  }
  hide() {
    m(this, sh).remove();
  }
}
Cp = new WeakMap(), sh = new WeakMap(), rh = new WeakMap(), b0 = new WeakSet(), oS = function() {
  const t = E(this, sh, document.createElement("div"));
  t.className = "editToolbar", t.setAttribute("role", "toolbar"), t.addEventListener("contextmenu", Gr, {
    signal: m(this, rh)._signal
  });
  const e = E(this, Cp, document.createElement("div"));
  return e.className = "buttons", t.append(e), D(this, b0, cS).call(this), t;
}, lS = function(t, e) {
  let n = 0, s = 0;
  for (const r of t) {
    const a = r.y + r.height;
    if (a < n)
      continue;
    const o = r.x + (e ? r.width : 0);
    if (a > n) {
      s = o, n = a;
      continue;
    }
    e ? o > s && (s = o) : o < s && (s = o);
  }
  return [e ? 1 - s : s, n];
}, cS = function() {
  const t = document.createElement("button");
  t.className = "highlightButton", t.tabIndex = 0, t.setAttribute("data-l10n-id", "pdfjs-highlight-floating-button1");
  const e = document.createElement("span");
  t.append(e), e.className = "visuallyHidden", e.setAttribute("data-l10n-id", "pdfjs-highlight-floating-button-label");
  const n = m(this, rh)._signal;
  t.addEventListener("contextmenu", Gr, {
    signal: n
  }), t.addEventListener("click", () => {
    m(this, rh).highlightSelection("floating_button");
  }, {
    signal: n
  }), m(this, Cp).append(t);
};
function hS(i, t, e) {
  for (const n of e)
    t.addEventListener(n, i[n].bind(i));
}
var j3;
class iM {
  constructor() {
    F(this, j3, 0);
  }
  get id() {
    return `${UI}${Zn(this, j3)._++}`;
  }
}
j3 = new WeakMap();
var Pu, Ep, zn, Nu, P5;
const iv = class iv {
  constructor() {
    F(this, Nu);
    F(this, Pu, Cy());
    F(this, Ep, 0);
    F(this, zn, null);
  }
  static get _isSVGFittingCanvas() {
    const t = '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>', n = new OffscreenCanvas(1, 3).getContext("2d", {
      willReadFrequently: !0
    }), s = new Image();
    s.src = t;
    const r = s.decode().then(() => (n.drawImage(s, 0, 0, 1, 1, 0, 0, 1, 3), new Uint32Array(n.getImageData(0, 0, 1, 1).data.buffer)[0] === 0));
    return Fe(this, "_isSVGFittingCanvas", r);
  }
  async getFromFile(t) {
    const {
      lastModified: e,
      name: n,
      size: s,
      type: r
    } = t;
    return D(this, Nu, P5).call(this, `${e}_${n}_${s}_${r}`, t);
  }
  async getFromUrl(t) {
    return D(this, Nu, P5).call(this, t, t);
  }
  async getFromBlob(t, e) {
    const n = await e;
    return D(this, Nu, P5).call(this, t, n);
  }
  async getFromId(t) {
    m(this, zn) || E(this, zn, /* @__PURE__ */ new Map());
    const e = m(this, zn).get(t);
    if (!e)
      return null;
    if (e.bitmap)
      return e.refCounter += 1, e;
    if (e.file)
      return this.getFromFile(e.file);
    if (e.blobPromise) {
      const {
        blobPromise: n
      } = e;
      return delete e.blobPromise, this.getFromBlob(e.id, n);
    }
    return this.getFromUrl(e.url);
  }
  getFromCanvas(t, e) {
    m(this, zn) || E(this, zn, /* @__PURE__ */ new Map());
    let n = m(this, zn).get(t);
    if (n != null && n.bitmap)
      return n.refCounter += 1, n;
    const s = new OffscreenCanvas(e.width, e.height);
    return s.getContext("2d").drawImage(e, 0, 0), n = {
      bitmap: s.transferToImageBitmap(),
      id: `image_${m(this, Pu)}_${Zn(this, Ep)._++}`,
      refCounter: 1,
      isSvg: !1
    }, m(this, zn).set(t, n), m(this, zn).set(n.id, n), n;
  }
  getSvgUrl(t) {
    const e = m(this, zn).get(t);
    return e != null && e.isSvg ? e.svgUrl : null;
  }
  deleteId(t) {
    var s;
    m(this, zn) || E(this, zn, /* @__PURE__ */ new Map());
    const e = m(this, zn).get(t);
    if (!e || (e.refCounter -= 1, e.refCounter !== 0))
      return;
    const {
      bitmap: n
    } = e;
    if (!e.url && !e.file) {
      const r = new OffscreenCanvas(n.width, n.height);
      r.getContext("bitmaprenderer").transferFromImageBitmap(n), e.blobPromise = r.convertToBlob();
    }
    (s = n.close) == null || s.call(n), e.bitmap = null;
  }
  isValidId(t) {
    return t.startsWith(`image_${m(this, Pu)}_`);
  }
};
Pu = new WeakMap(), Ep = new WeakMap(), zn = new WeakMap(), Nu = new WeakSet(), P5 = async function(t, e) {
  m(this, zn) || E(this, zn, /* @__PURE__ */ new Map());
  let n = m(this, zn).get(t);
  if (n === null)
    return null;
  if (n != null && n.bitmap)
    return n.refCounter += 1, n;
  try {
    n || (n = {
      bitmap: null,
      id: `image_${m(this, Pu)}_${Zn(this, Ep)._++}`,
      refCounter: 0,
      isSvg: !1
    });
    let s;
    if (typeof e == "string" ? (n.url = e, s = await ff(e, "blob")) : e instanceof File ? s = n.file = e : e instanceof Blob && (s = e), s.type === "image/svg+xml") {
      const r = iv._isSVGFittingCanvas, a = new FileReader(), o = new Image(), l = new Promise((c, h) => {
        o.onload = () => {
          n.bitmap = o, n.isSvg = !0, c();
        }, a.onload = async () => {
          const u = n.svgUrl = a.result;
          o.src = await r ? `${u}#svgView(preserveAspectRatio(none))` : u;
        }, o.onerror = a.onerror = h;
      });
      a.readAsDataURL(s), await l;
    } else
      n.bitmap = await createImageBitmap(s);
    n.refCounter = 1;
  } catch (s) {
    me(s), n = null;
  }
  return m(this, zn).set(t, n), n && m(this, zn).set(n.id, n), n;
};
let C7 = iv;
var Pi, bc, Dp, vi;
class nM {
  constructor(t = 128) {
    F(this, Pi, []);
    F(this, bc, !1);
    F(this, Dp);
    F(this, vi, -1);
    E(this, Dp, t);
  }
  add({
    cmd: t,
    undo: e,
    post: n,
    mustExec: s,
    type: r = NaN,
    overwriteIfSameType: a = !1,
    keepUndo: o = !1
  }) {
    if (s && t(), m(this, bc))
      return;
    const l = {
      cmd: t,
      undo: e,
      post: n,
      type: r
    };
    if (m(this, vi) === -1) {
      m(this, Pi).length > 0 && (m(this, Pi).length = 0), E(this, vi, 0), m(this, Pi).push(l);
      return;
    }
    if (a && m(this, Pi)[m(this, vi)].type === r) {
      o && (l.undo = m(this, Pi)[m(this, vi)].undo), m(this, Pi)[m(this, vi)] = l;
      return;
    }
    const c = m(this, vi) + 1;
    c === m(this, Dp) ? m(this, Pi).splice(0, 1) : (E(this, vi, c), c < m(this, Pi).length && m(this, Pi).splice(c)), m(this, Pi).push(l);
  }
  undo() {
    if (m(this, vi) === -1)
      return;
    E(this, bc, !0);
    const {
      undo: t,
      post: e
    } = m(this, Pi)[m(this, vi)];
    t(), e == null || e(), E(this, bc, !1), E(this, vi, m(this, vi) - 1);
  }
  redo() {
    if (m(this, vi) < m(this, Pi).length - 1) {
      E(this, vi, m(this, vi) + 1), E(this, bc, !0);
      const {
        cmd: t,
        post: e
      } = m(this, Pi)[m(this, vi)];
      t(), e == null || e(), E(this, bc, !1);
    }
  }
  hasSomethingToUndo() {
    return m(this, vi) !== -1;
  }
  hasSomethingToRedo() {
    return m(this, vi) < m(this, Pi).length - 1;
  }
  cleanType(t) {
    if (m(this, vi) !== -1) {
      for (let e = m(this, vi); e >= 0; e--)
        if (m(this, Pi)[e].type !== t) {
          m(this, Pi).splice(e + 1, m(this, vi) - e), E(this, vi, e);
          return;
        }
      m(this, Pi).length = 0, E(this, vi, -1);
    }
  }
  destroy() {
    E(this, Pi, null);
  }
}
Pi = new WeakMap(), bc = new WeakMap(), Dp = new WeakMap(), vi = new WeakMap();
var G3, uS;
class yg {
  constructor(t) {
    F(this, G3);
    this.buffer = [], this.callbacks = /* @__PURE__ */ new Map(), this.allKeys = /* @__PURE__ */ new Set();
    const {
      isMac: e
    } = gn.platform;
    for (const [n, s, r = {}] of t)
      for (const a of n) {
        const o = a.startsWith("mac+");
        e && o ? (this.callbacks.set(a.slice(4), {
          callback: s,
          options: r
        }), this.allKeys.add(a.split("+").at(-1))) : !e && !o && (this.callbacks.set(a, {
          callback: s,
          options: r
        }), this.allKeys.add(a.split("+").at(-1)));
      }
  }
  exec(t, e) {
    if (!this.allKeys.has(e.key))
      return;
    const n = this.callbacks.get(D(this, G3, uS).call(this, e));
    if (!n)
      return;
    const {
      callback: s,
      options: {
        bubbles: r = !1,
        args: a = [],
        checker: o = null
      }
    } = n;
    o && !o(t, e) || (s.bind(t, ...a, e)(), r || Oi(e));
  }
}
G3 = new WeakSet(), uS = function(t) {
  t.altKey && this.buffer.push("alt"), t.ctrlKey && this.buffer.push("ctrl"), t.metaKey && this.buffer.push("meta"), t.shiftKey && this.buffer.push("shift"), this.buffer.push(t.key);
  const e = this.buffer.join("+");
  return this.buffer.length = 0, e;
};
const V3 = class V3 {
  get _colors() {
    const t = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
    return tM(t), Fe(this, "_colors", t);
  }
  convert(t) {
    const e = Dy(t);
    if (!window.matchMedia("(forced-colors: active)").matches)
      return e;
    for (const [n, s] of this._colors)
      if (s.every((r, a) => r === e[a]))
        return V3._colorsMapping.get(n);
    return e;
  }
  getHexCode(t) {
    const e = this._colors.get(t);
    return e ? Zt.makeHexColor(...e) : t;
  }
};
ft(V3, "_colorsMapping", /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]));
let E7 = V3;
var Lu, zs, tn, bn, Ou, Qo, $u, wr, yc, wc, qu, ah, Va, oa, oh, Tp, Fp, zu, Ip, Wa, vc, Uu, _c, Xa, W3, xc, Mp, kc, lh, ch, Ac, Rp, on, Ve, tl, Sc, hh, Bp, Pp, Cc, Ya, el, Np, vr, Lt, N5, D7, dS, fS, L5, pS, mS, gS, T7, bS, F7, I7, yS, es, Ho, wS, vS, M7, _S, Jf, R7;
const yu = class yu {
  constructor(t, e, n, s, r, a, o, l, c, h, u, f, d, p) {
    F(this, Lt);
    F(this, Lu, new AbortController());
    F(this, zs, null);
    F(this, tn, /* @__PURE__ */ new Map());
    F(this, bn, /* @__PURE__ */ new Map());
    F(this, Ou, null);
    F(this, Qo, null);
    F(this, $u, null);
    F(this, wr, new nM());
    F(this, yc, null);
    F(this, wc, null);
    F(this, qu, 0);
    F(this, ah, /* @__PURE__ */ new Set());
    F(this, Va, null);
    F(this, oa, null);
    F(this, oh, /* @__PURE__ */ new Set());
    ft(this, "_editorUndoBar", null);
    F(this, Tp, !1);
    F(this, Fp, !1);
    F(this, zu, !1);
    F(this, Ip, null);
    F(this, Wa, null);
    F(this, vc, null);
    F(this, Uu, null);
    F(this, _c, !1);
    F(this, Xa, null);
    F(this, W3, new iM());
    F(this, xc, !1);
    F(this, Mp, !1);
    F(this, kc, null);
    F(this, lh, null);
    F(this, ch, null);
    F(this, Ac, null);
    F(this, Rp, null);
    F(this, on, fe.NONE);
    F(this, Ve, /* @__PURE__ */ new Set());
    F(this, tl, null);
    F(this, Sc, null);
    F(this, hh, null);
    F(this, Bp, null);
    F(this, Pp, {
      isEditing: !1,
      isEmpty: !0,
      hasSomethingToUndo: !1,
      hasSomethingToRedo: !1,
      hasSelectedEditor: !1,
      hasSelectedText: !1
    });
    F(this, Cc, [0, 0]);
    F(this, Ya, null);
    F(this, el, null);
    F(this, Np, null);
    F(this, vr, null);
    const g = this._signal = m(this, Lu).signal;
    E(this, el, t), E(this, Np, e), E(this, Ou, n), E(this, Sc, s), this._eventBus = r, r._on("editingaction", this.onEditingAction.bind(this), {
      signal: g
    }), r._on("pagechanging", this.onPageChanging.bind(this), {
      signal: g
    }), r._on("scalechanging", this.onScaleChanging.bind(this), {
      signal: g
    }), r._on("rotationchanging", this.onRotationChanging.bind(this), {
      signal: g
    }), r._on("setpreference", this.onSetPreference.bind(this), {
      signal: g
    }), r._on("switchannotationeditorparams", (b) => this.updateParams(b.type, b.value), {
      signal: g
    }), D(this, Lt, pS).call(this), D(this, Lt, yS).call(this), D(this, Lt, T7).call(this), E(this, Qo, a.annotationStorage), E(this, Ip, a.filterFactory), E(this, hh, o), E(this, Uu, l || null), E(this, Tp, c), E(this, Fp, h), E(this, zu, u), E(this, Rp, f || null), this.viewParameters = {
      realScale: jl.PDF_TO_CSS_UNITS,
      rotation: 0
    }, this.isShiftKeyDown = !1, this._editorUndoBar = d || null, this._supportsPinchToZoom = p !== !1;
  }
  static get _keyboardManager() {
    const t = yu.prototype, e = (a) => m(a, el).contains(document.activeElement) && document.activeElement.tagName !== "BUTTON" && a.hasSomethingToControl(), n = (a, {
      target: o
    }) => {
      if (o instanceof HTMLInputElement) {
        const {
          type: l
        } = o;
        return l !== "text" && l !== "number";
      }
      return !0;
    }, s = this.TRANSLATE_SMALL, r = this.TRANSLATE_BIG;
    return Fe(this, "_keyboardManager", new yg([[["ctrl+a", "mac+meta+a"], t.selectAll, {
      checker: n
    }], [["ctrl+z", "mac+meta+z"], t.undo, {
      checker: n
    }], [["ctrl+y", "ctrl+shift+z", "mac+meta+shift+z", "ctrl+shift+Z", "mac+meta+shift+Z"], t.redo, {
      checker: n
    }], [["Backspace", "alt+Backspace", "ctrl+Backspace", "shift+Backspace", "mac+Backspace", "mac+alt+Backspace", "mac+ctrl+Backspace", "Delete", "ctrl+Delete", "shift+Delete", "mac+Delete"], t.delete, {
      checker: n
    }], [["Enter", "mac+Enter"], t.addNewEditorFromKeyboard, {
      checker: (a, {
        target: o
      }) => !(o instanceof HTMLButtonElement) && m(a, el).contains(o) && !a.isEnterHandled
    }], [[" ", "mac+ "], t.addNewEditorFromKeyboard, {
      checker: (a, {
        target: o
      }) => !(o instanceof HTMLButtonElement) && m(a, el).contains(document.activeElement)
    }], [["Escape", "mac+Escape"], t.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], t.translateSelectedEditors, {
      args: [-s, 0],
      checker: e
    }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], t.translateSelectedEditors, {
      args: [-r, 0],
      checker: e
    }], [["ArrowRight", "mac+ArrowRight"], t.translateSelectedEditors, {
      args: [s, 0],
      checker: e
    }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], t.translateSelectedEditors, {
      args: [r, 0],
      checker: e
    }], [["ArrowUp", "mac+ArrowUp"], t.translateSelectedEditors, {
      args: [0, -s],
      checker: e
    }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], t.translateSelectedEditors, {
      args: [0, -r],
      checker: e
    }], [["ArrowDown", "mac+ArrowDown"], t.translateSelectedEditors, {
      args: [0, s],
      checker: e
    }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], t.translateSelectedEditors, {
      args: [0, r],
      checker: e
    }]]));
  }
  destroy() {
    var t, e, n, s, r, a, o, l;
    (t = m(this, vr)) == null || t.resolve(), E(this, vr, null), (e = m(this, Lu)) == null || e.abort(), E(this, Lu, null), this._signal = null;
    for (const c of m(this, bn).values())
      c.destroy();
    m(this, bn).clear(), m(this, tn).clear(), m(this, oh).clear(), (n = m(this, Ac)) == null || n.clear(), E(this, zs, null), m(this, Ve).clear(), m(this, wr).destroy(), (s = m(this, Ou)) == null || s.destroy(), (r = m(this, Sc)) == null || r.destroy(), (a = m(this, Xa)) == null || a.hide(), E(this, Xa, null), (o = m(this, ch)) == null || o.destroy(), E(this, ch, null), m(this, Wa) && (clearTimeout(m(this, Wa)), E(this, Wa, null)), m(this, Ya) && (clearTimeout(m(this, Ya)), E(this, Ya, null)), (l = this._editorUndoBar) == null || l.destroy();
  }
  combinedSignal(t) {
    return AbortSignal.any([this._signal, t.signal]);
  }
  get mlManager() {
    return m(this, Rp);
  }
  get useNewAltTextFlow() {
    return m(this, Fp);
  }
  get useNewAltTextWhenAddingImage() {
    return m(this, zu);
  }
  get hcmFilter() {
    return Fe(this, "hcmFilter", m(this, hh) ? m(this, Ip).addHCMFilter(m(this, hh).foreground, m(this, hh).background) : "none");
  }
  get direction() {
    return Fe(this, "direction", getComputedStyle(m(this, el)).direction);
  }
  get highlightColors() {
    return Fe(this, "highlightColors", m(this, Uu) ? new Map(m(this, Uu).split(",").map((t) => t.split("=").map((e) => e.trim()))) : null);
  }
  get highlightColorNames() {
    return Fe(this, "highlightColorNames", this.highlightColors ? new Map(Array.from(this.highlightColors, (t) => t.reverse())) : null);
  }
  setCurrentDrawingSession(t) {
    t ? (this.unselectAll(), this.disableUserSelect(!0)) : this.disableUserSelect(!1), E(this, wc, t);
  }
  setMainHighlightColorPicker(t) {
    E(this, ch, t);
  }
  editAltText(t, e = !1) {
    var n;
    (n = m(this, Ou)) == null || n.editAltText(this, t, e);
  }
  getSignature(t) {
    var e;
    (e = m(this, Sc)) == null || e.getSignature({
      uiManager: this,
      editor: t
    });
  }
  get signatureManager() {
    return m(this, Sc);
  }
  switchToMode(t, e) {
    this._eventBus.on("annotationeditormodechanged", e, {
      once: !0,
      signal: this._signal
    }), this._eventBus.dispatch("showannotationeditorui", {
      source: this,
      mode: t
    });
  }
  setPreference(t, e) {
    this._eventBus.dispatch("setpreference", {
      source: this,
      name: t,
      value: e
    });
  }
  onSetPreference({
    name: t,
    value: e
  }) {
    switch (t) {
      case "enableNewAltTextWhenAddingImage":
        E(this, zu, e);
        break;
    }
  }
  onPageChanging({
    pageNumber: t
  }) {
    E(this, qu, t - 1);
  }
  focusMainContainer() {
    m(this, el).focus();
  }
  findParent(t, e) {
    for (const n of m(this, bn).values()) {
      const {
        x: s,
        y: r,
        width: a,
        height: o
      } = n.div.getBoundingClientRect();
      if (t >= s && t <= s + a && e >= r && e <= r + o)
        return n;
    }
    return null;
  }
  disableUserSelect(t = !1) {
    m(this, Np).classList.toggle("noUserSelect", t);
  }
  addShouldRescale(t) {
    m(this, oh).add(t);
  }
  removeShouldRescale(t) {
    m(this, oh).delete(t);
  }
  onScaleChanging({
    scale: t
  }) {
    var e;
    this.commitOrRemove(), this.viewParameters.realScale = t * jl.PDF_TO_CSS_UNITS;
    for (const n of m(this, oh))
      n.onScaleChanging();
    (e = m(this, wc)) == null || e.onScaleChanging();
  }
  onRotationChanging({
    pagesRotation: t
  }) {
    this.commitOrRemove(), this.viewParameters.rotation = t;
  }
  highlightSelection(t = "") {
    const e = document.getSelection();
    if (!e || e.isCollapsed)
      return;
    const {
      anchorNode: n,
      anchorOffset: s,
      focusNode: r,
      focusOffset: a
    } = e, o = e.toString(), c = D(this, Lt, N5).call(this, e).closest(".textLayer"), h = this.getSelectionBoxes(c);
    if (!h)
      return;
    e.empty();
    const u = D(this, Lt, D7).call(this, c), f = m(this, on) === fe.NONE, d = () => {
      u == null || u.createAndAddNewEditor({
        x: 0,
        y: 0
      }, !1, {
        methodOfCreation: t,
        boxes: h,
        anchorNode: n,
        anchorOffset: s,
        focusNode: r,
        focusOffset: a,
        text: o
      }), f && this.showAllEditors("highlight", !0, !0);
    };
    if (f) {
      this.switchToMode(fe.HIGHLIGHT, d);
      return;
    }
    d();
  }
  addToAnnotationStorage(t) {
    !t.isEmpty() && m(this, Qo) && !m(this, Qo).has(t.id) && m(this, Qo).setValue(t.id, t);
  }
  blur() {
    if (this.isShiftKeyDown = !1, m(this, _c) && (E(this, _c, !1), D(this, Lt, L5).call(this, "main_toolbar")), !this.hasSelection)
      return;
    const {
      activeElement: t
    } = document;
    for (const e of m(this, Ve))
      if (e.div.contains(t)) {
        E(this, lh, [e, t]), e._focusEventsAllowed = !1;
        break;
      }
  }
  focus() {
    if (!m(this, lh))
      return;
    const [t, e] = m(this, lh);
    E(this, lh, null), e.addEventListener("focusin", () => {
      t._focusEventsAllowed = !0;
    }, {
      once: !0,
      signal: this._signal
    }), e.focus();
  }
  addEditListeners() {
    D(this, Lt, T7).call(this), D(this, Lt, F7).call(this);
  }
  removeEditListeners() {
    D(this, Lt, bS).call(this), D(this, Lt, I7).call(this);
  }
  dragOver(t) {
    for (const {
      type: e
    } of t.dataTransfer.items)
      for (const n of m(this, oa))
        if (n.isHandlingMimeForPasting(e)) {
          t.dataTransfer.dropEffect = "copy", t.preventDefault();
          return;
        }
  }
  drop(t) {
    for (const e of t.dataTransfer.items)
      for (const n of m(this, oa))
        if (n.isHandlingMimeForPasting(e.type)) {
          n.paste(e, this.currentLayer), t.preventDefault();
          return;
        }
  }
  copy(t) {
    var n;
    if (t.preventDefault(), (n = m(this, zs)) == null || n.commitOrRemove(), !this.hasSelection)
      return;
    const e = [];
    for (const s of m(this, Ve)) {
      const r = s.serialize(!0);
      r && e.push(r);
    }
    e.length !== 0 && t.clipboardData.setData("application/pdfjs", JSON.stringify(e));
  }
  cut(t) {
    this.copy(t), this.delete();
  }
  async paste(t) {
    t.preventDefault();
    const {
      clipboardData: e
    } = t;
    for (const r of e.items)
      for (const a of m(this, oa))
        if (a.isHandlingMimeForPasting(r.type)) {
          a.paste(r, this.currentLayer);
          return;
        }
    let n = e.getData("application/pdfjs");
    if (!n)
      return;
    try {
      n = JSON.parse(n);
    } catch (r) {
      me(`paste: "${r.message}".`);
      return;
    }
    if (!Array.isArray(n))
      return;
    this.unselectAll();
    const s = this.currentLayer;
    try {
      const r = [];
      for (const l of n) {
        const c = await s.deserialize(l);
        if (!c)
          return;
        r.push(c);
      }
      const a = () => {
        for (const l of r)
          D(this, Lt, M7).call(this, l);
        D(this, Lt, R7).call(this, r);
      }, o = () => {
        for (const l of r)
          l.remove();
      };
      this.addCommands({
        cmd: a,
        undo: o,
        mustExec: !0
      });
    } catch (r) {
      me(`paste: "${r.message}".`);
    }
  }
  keydown(t) {
    !this.isShiftKeyDown && t.key === "Shift" && (this.isShiftKeyDown = !0), m(this, on) !== fe.NONE && !this.isEditorHandlingKeyboard && yu._keyboardManager.exec(this, t);
  }
  keyup(t) {
    this.isShiftKeyDown && t.key === "Shift" && (this.isShiftKeyDown = !1, m(this, _c) && (E(this, _c, !1), D(this, Lt, L5).call(this, "main_toolbar")));
  }
  onEditingAction({
    name: t
  }) {
    switch (t) {
      case "undo":
      case "redo":
      case "delete":
      case "selectAll":
        this[t]();
        break;
      case "highlightSelection":
        this.highlightSelection("context_menu");
        break;
    }
  }
  setEditingState(t) {
    t ? (D(this, Lt, mS).call(this), D(this, Lt, F7).call(this), D(this, Lt, es).call(this, {
      isEditing: m(this, on) !== fe.NONE,
      isEmpty: D(this, Lt, Jf).call(this),
      hasSomethingToUndo: m(this, wr).hasSomethingToUndo(),
      hasSomethingToRedo: m(this, wr).hasSomethingToRedo(),
      hasSelectedEditor: !1
    })) : (D(this, Lt, gS).call(this), D(this, Lt, I7).call(this), D(this, Lt, es).call(this, {
      isEditing: !1
    }), this.disableUserSelect(!1));
  }
  registerEditorTypes(t) {
    if (!m(this, oa)) {
      E(this, oa, t);
      for (const e of m(this, oa))
        D(this, Lt, Ho).call(this, e.defaultPropertiesToUpdate);
    }
  }
  getId() {
    return m(this, W3).id;
  }
  get currentLayer() {
    return m(this, bn).get(m(this, qu));
  }
  getLayer(t) {
    return m(this, bn).get(t);
  }
  get currentPageIndex() {
    return m(this, qu);
  }
  addLayer(t) {
    m(this, bn).set(t.pageIndex, t), m(this, xc) ? t.enable() : t.disable();
  }
  removeLayer(t) {
    m(this, bn).delete(t.pageIndex);
  }
  async updateMode(t, e = null, n = !1) {
    var s, r, a;
    if (m(this, on) !== t && !(m(this, vr) && (await m(this, vr).promise, !m(this, vr)))) {
      if (E(this, vr, Promise.withResolvers()), (s = m(this, wc)) == null || s.commitOrRemove(), E(this, on, t), t === fe.NONE) {
        this.setEditingState(!1), D(this, Lt, vS).call(this), (r = this._editorUndoBar) == null || r.hide(), m(this, vr).resolve();
        return;
      }
      t === fe.SIGNATURE && await ((a = m(this, Sc)) == null ? void 0 : a.loadSignatures()), this.setEditingState(!0), await D(this, Lt, wS).call(this), this.unselectAll();
      for (const o of m(this, bn).values())
        o.updateMode(t);
      if (!e) {
        n && this.addNewEditorFromKeyboard(), m(this, vr).resolve();
        return;
      }
      for (const o of m(this, tn).values())
        o.annotationElementId === e || o.id === e ? (this.setSelected(o), o.enterInEditMode()) : o.unselect();
      m(this, vr).resolve();
    }
  }
  addNewEditorFromKeyboard() {
    this.currentLayer.canCreateNewEmptyEditor() && this.currentLayer.addNewEditor();
  }
  updateToolbar(t) {
    t.mode !== m(this, on) && this._eventBus.dispatch("switchannotationeditormode", {
      source: this,
      ...t
    });
  }
  updateParams(t, e) {
    var n;
    if (m(this, oa)) {
      switch (t) {
        case Ie.CREATE:
          this.currentLayer.addNewEditor(e);
          return;
        case Ie.HIGHLIGHT_DEFAULT_COLOR:
          (n = m(this, ch)) == null || n.updateColor(e);
          break;
        case Ie.HIGHLIGHT_SHOW_ALL:
          this._eventBus.dispatch("reporttelemetry", {
            source: this,
            details: {
              type: "editing",
              data: {
                type: "highlight",
                action: "toggle_visibility"
              }
            }
          }), (m(this, Bp) || E(this, Bp, /* @__PURE__ */ new Map())).set(t, e), this.showAllEditors("highlight", e);
          break;
      }
      for (const s of m(this, Ve))
        s.updateParams(t, e);
      for (const s of m(this, oa))
        s.updateDefaultParams(t, e);
    }
  }
  showAllEditors(t, e, n = !1) {
    var r;
    for (const a of m(this, tn).values())
      a.editorType === t && a.show(e);
    (((r = m(this, Bp)) == null ? void 0 : r.get(Ie.HIGHLIGHT_SHOW_ALL)) ?? !0) !== e && D(this, Lt, Ho).call(this, [[Ie.HIGHLIGHT_SHOW_ALL, e]]);
  }
  enableWaiting(t = !1) {
    if (m(this, Mp) !== t) {
      E(this, Mp, t);
      for (const e of m(this, bn).values())
        t ? e.disableClick() : e.enableClick(), e.div.classList.toggle("waiting", t);
    }
  }
  getEditors(t) {
    const e = [];
    for (const n of m(this, tn).values())
      n.pageIndex === t && e.push(n);
    return e;
  }
  getEditor(t) {
    return m(this, tn).get(t);
  }
  addEditor(t) {
    m(this, tn).set(t.id, t);
  }
  removeEditor(t) {
    var e, n;
    t.div.contains(document.activeElement) && (m(this, Wa) && clearTimeout(m(this, Wa)), E(this, Wa, setTimeout(() => {
      this.focusMainContainer(), E(this, Wa, null);
    }, 0))), m(this, tn).delete(t.id), t.annotationElementId && ((e = m(this, Ac)) == null || e.delete(t.annotationElementId)), this.unselect(t), (!t.annotationElementId || !m(this, ah).has(t.annotationElementId)) && ((n = m(this, Qo)) == null || n.remove(t.id));
  }
  addDeletedAnnotationElement(t) {
    m(this, ah).add(t.annotationElementId), this.addChangedExistingAnnotation(t), t.deleted = !0;
  }
  isDeletedAnnotationElement(t) {
    return m(this, ah).has(t);
  }
  removeDeletedAnnotationElement(t) {
    m(this, ah).delete(t.annotationElementId), this.removeChangedExistingAnnotation(t), t.deleted = !1;
  }
  setActiveEditor(t) {
    m(this, zs) !== t && (E(this, zs, t), t && D(this, Lt, Ho).call(this, t.propertiesToUpdate));
  }
  updateUI(t) {
    m(this, Lt, _S) === t && D(this, Lt, Ho).call(this, t.propertiesToUpdate);
  }
  updateUIForDefaultProperties(t) {
    D(this, Lt, Ho).call(this, t.defaultPropertiesToUpdate);
  }
  toggleSelected(t) {
    if (m(this, Ve).has(t)) {
      m(this, Ve).delete(t), t.unselect(), D(this, Lt, es).call(this, {
        hasSelectedEditor: this.hasSelection
      });
      return;
    }
    m(this, Ve).add(t), t.select(), D(this, Lt, Ho).call(this, t.propertiesToUpdate), D(this, Lt, es).call(this, {
      hasSelectedEditor: !0
    });
  }
  setSelected(t) {
    var e;
    (e = m(this, wc)) == null || e.commitOrRemove();
    for (const n of m(this, Ve))
      n !== t && n.unselect();
    m(this, Ve).clear(), m(this, Ve).add(t), t.select(), D(this, Lt, Ho).call(this, t.propertiesToUpdate), D(this, Lt, es).call(this, {
      hasSelectedEditor: !0
    });
  }
  isSelected(t) {
    return m(this, Ve).has(t);
  }
  get firstSelectedEditor() {
    return m(this, Ve).values().next().value;
  }
  unselect(t) {
    t.unselect(), m(this, Ve).delete(t), D(this, Lt, es).call(this, {
      hasSelectedEditor: this.hasSelection
    });
  }
  get hasSelection() {
    return m(this, Ve).size !== 0;
  }
  get isEnterHandled() {
    return m(this, Ve).size === 1 && this.firstSelectedEditor.isEnterHandled;
  }
  undo() {
    var t;
    m(this, wr).undo(), D(this, Lt, es).call(this, {
      hasSomethingToUndo: m(this, wr).hasSomethingToUndo(),
      hasSomethingToRedo: !0,
      isEmpty: D(this, Lt, Jf).call(this)
    }), (t = this._editorUndoBar) == null || t.hide();
  }
  redo() {
    m(this, wr).redo(), D(this, Lt, es).call(this, {
      hasSomethingToUndo: !0,
      hasSomethingToRedo: m(this, wr).hasSomethingToRedo(),
      isEmpty: D(this, Lt, Jf).call(this)
    });
  }
  addCommands(t) {
    m(this, wr).add(t), D(this, Lt, es).call(this, {
      hasSomethingToUndo: !0,
      hasSomethingToRedo: !1,
      isEmpty: D(this, Lt, Jf).call(this)
    });
  }
  cleanUndoStack(t) {
    m(this, wr).cleanType(t);
  }
  delete() {
    var r;
    this.commitOrRemove();
    const t = (r = this.currentLayer) == null ? void 0 : r.endDrawingSession(!0);
    if (!this.hasSelection && !t)
      return;
    const e = t ? [t] : [...m(this, Ve)], n = () => {
      var a;
      (a = this._editorUndoBar) == null || a.show(s, e.length === 1 ? e[0].editorType : e.length);
      for (const o of e)
        o.remove();
    }, s = () => {
      for (const a of e)
        D(this, Lt, M7).call(this, a);
    };
    this.addCommands({
      cmd: n,
      undo: s,
      mustExec: !0
    });
  }
  commitOrRemove() {
    var t;
    (t = m(this, zs)) == null || t.commitOrRemove();
  }
  hasSomethingToControl() {
    return m(this, zs) || this.hasSelection;
  }
  selectAll() {
    for (const t of m(this, Ve))
      t.commit();
    D(this, Lt, R7).call(this, m(this, tn).values());
  }
  unselectAll() {
    var t;
    if (!(m(this, zs) && (m(this, zs).commitOrRemove(), m(this, on) !== fe.NONE)) && !((t = m(this, wc)) != null && t.commitOrRemove()) && this.hasSelection) {
      for (const e of m(this, Ve))
        e.unselect();
      m(this, Ve).clear(), D(this, Lt, es).call(this, {
        hasSelectedEditor: !1
      });
    }
  }
  translateSelectedEditors(t, e, n = !1) {
    if (n || this.commitOrRemove(), !this.hasSelection)
      return;
    m(this, Cc)[0] += t, m(this, Cc)[1] += e;
    const [s, r] = m(this, Cc), a = [...m(this, Ve)], o = 1e3;
    m(this, Ya) && clearTimeout(m(this, Ya)), E(this, Ya, setTimeout(() => {
      E(this, Ya, null), m(this, Cc)[0] = m(this, Cc)[1] = 0, this.addCommands({
        cmd: () => {
          for (const l of a)
            m(this, tn).has(l.id) && (l.translateInPage(s, r), l.translationDone());
        },
        undo: () => {
          for (const l of a)
            m(this, tn).has(l.id) && (l.translateInPage(-s, -r), l.translationDone());
        },
        mustExec: !1
      });
    }, o));
    for (const l of a)
      l.translateInPage(t, e), l.translationDone();
  }
  setUpDragSession() {
    if (this.hasSelection) {
      this.disableUserSelect(!0), E(this, Va, /* @__PURE__ */ new Map());
      for (const t of m(this, Ve))
        m(this, Va).set(t, {
          savedX: t.x,
          savedY: t.y,
          savedPageIndex: t.pageIndex,
          newX: 0,
          newY: 0,
          newPageIndex: -1
        });
    }
  }
  endDragSession() {
    if (!m(this, Va))
      return !1;
    this.disableUserSelect(!1);
    const t = m(this, Va);
    E(this, Va, null);
    let e = !1;
    for (const [{
      x: s,
      y: r,
      pageIndex: a
    }, o] of t)
      o.newX = s, o.newY = r, o.newPageIndex = a, e || (e = s !== o.savedX || r !== o.savedY || a !== o.savedPageIndex);
    if (!e)
      return !1;
    const n = (s, r, a, o) => {
      if (m(this, tn).has(s.id)) {
        const l = m(this, bn).get(o);
        l ? s._setParentAndPosition(l, r, a) : (s.pageIndex = o, s.x = r, s.y = a);
      }
    };
    return this.addCommands({
      cmd: () => {
        for (const [s, {
          newX: r,
          newY: a,
          newPageIndex: o
        }] of t)
          n(s, r, a, o);
      },
      undo: () => {
        for (const [s, {
          savedX: r,
          savedY: a,
          savedPageIndex: o
        }] of t)
          n(s, r, a, o);
      },
      mustExec: !0
    }), !0;
  }
  dragSelectedEditors(t, e) {
    if (m(this, Va))
      for (const n of m(this, Va).keys())
        n.drag(t, e);
  }
  rebuild(t) {
    if (t.parent === null) {
      const e = this.getLayer(t.pageIndex);
      e ? (e.changeParent(t), e.addOrRebuild(t)) : (this.addEditor(t), this.addToAnnotationStorage(t), t.rebuild());
    } else
      t.parent.addOrRebuild(t);
  }
  get isEditorHandlingKeyboard() {
    var t;
    return ((t = this.getActive()) == null ? void 0 : t.shouldGetKeyboardEvents()) || m(this, Ve).size === 1 && this.firstSelectedEditor.shouldGetKeyboardEvents();
  }
  isActive(t) {
    return m(this, zs) === t;
  }
  getActive() {
    return m(this, zs);
  }
  getMode() {
    return m(this, on);
  }
  get imageManager() {
    return Fe(this, "imageManager", new C7());
  }
  getSelectionBoxes(t) {
    if (!t)
      return null;
    const e = document.getSelection();
    for (let c = 0, h = e.rangeCount; c < h; c++)
      if (!t.contains(e.getRangeAt(c).commonAncestorContainer))
        return null;
    const {
      x: n,
      y: s,
      width: r,
      height: a
    } = t.getBoundingClientRect();
    let o;
    switch (t.getAttribute("data-main-rotation")) {
      case "90":
        o = (c, h, u, f) => ({
          x: (h - s) / a,
          y: 1 - (c + u - n) / r,
          width: f / a,
          height: u / r
        });
        break;
      case "180":
        o = (c, h, u, f) => ({
          x: 1 - (c + u - n) / r,
          y: 1 - (h + f - s) / a,
          width: u / r,
          height: f / a
        });
        break;
      case "270":
        o = (c, h, u, f) => ({
          x: 1 - (h + f - s) / a,
          y: (c - n) / r,
          width: f / a,
          height: u / r
        });
        break;
      default:
        o = (c, h, u, f) => ({
          x: (c - n) / r,
          y: (h - s) / a,
          width: u / r,
          height: f / a
        });
        break;
    }
    const l = [];
    for (let c = 0, h = e.rangeCount; c < h; c++) {
      const u = e.getRangeAt(c);
      if (!u.collapsed)
        for (const {
          x: f,
          y: d,
          width: p,
          height: g
        } of u.getClientRects())
          p === 0 || g === 0 || l.push(o(f, d, p, g));
    }
    return l.length === 0 ? null : l;
  }
  addChangedExistingAnnotation({
    annotationElementId: t,
    id: e
  }) {
    (m(this, $u) || E(this, $u, /* @__PURE__ */ new Map())).set(t, e);
  }
  removeChangedExistingAnnotation({
    annotationElementId: t
  }) {
    var e;
    (e = m(this, $u)) == null || e.delete(t);
  }
  renderAnnotationElement(t) {
    var s;
    const e = (s = m(this, $u)) == null ? void 0 : s.get(t.data.id);
    if (!e)
      return;
    const n = m(this, Qo).getRawValue(e);
    n && (m(this, on) === fe.NONE && !n.hasBeenModified || n.renderAnnotationElement(t));
  }
  setMissingCanvas(t, e, n) {
    var r;
    const s = (r = m(this, Ac)) == null ? void 0 : r.get(t);
    s && (s.setCanvas(e, n), m(this, Ac).delete(t));
  }
  addMissingCanvas(t, e) {
    (m(this, Ac) || E(this, Ac, /* @__PURE__ */ new Map())).set(t, e);
  }
};
Lu = new WeakMap(), zs = new WeakMap(), tn = new WeakMap(), bn = new WeakMap(), Ou = new WeakMap(), Qo = new WeakMap(), $u = new WeakMap(), wr = new WeakMap(), yc = new WeakMap(), wc = new WeakMap(), qu = new WeakMap(), ah = new WeakMap(), Va = new WeakMap(), oa = new WeakMap(), oh = new WeakMap(), Tp = new WeakMap(), Fp = new WeakMap(), zu = new WeakMap(), Ip = new WeakMap(), Wa = new WeakMap(), vc = new WeakMap(), Uu = new WeakMap(), _c = new WeakMap(), Xa = new WeakMap(), W3 = new WeakMap(), xc = new WeakMap(), Mp = new WeakMap(), kc = new WeakMap(), lh = new WeakMap(), ch = new WeakMap(), Ac = new WeakMap(), Rp = new WeakMap(), on = new WeakMap(), Ve = new WeakMap(), tl = new WeakMap(), Sc = new WeakMap(), hh = new WeakMap(), Bp = new WeakMap(), Pp = new WeakMap(), Cc = new WeakMap(), Ya = new WeakMap(), el = new WeakMap(), Np = new WeakMap(), vr = new WeakMap(), Lt = new WeakSet(), N5 = function({
  anchorNode: t
}) {
  return t.nodeType === Node.TEXT_NODE ? t.parentElement : t;
}, D7 = function(t) {
  const {
    currentLayer: e
  } = this;
  if (e.hasTextLayer(t))
    return e;
  for (const n of m(this, bn).values())
    if (n.hasTextLayer(t))
      return n;
  return null;
}, dS = function() {
  const t = document.getSelection();
  if (!t || t.isCollapsed)
    return;
  const n = D(this, Lt, N5).call(this, t).closest(".textLayer"), s = this.getSelectionBoxes(n);
  s && (m(this, Xa) || E(this, Xa, new eM(this)), m(this, Xa).show(n, s, this.direction === "ltr"));
}, fS = function() {
  var r, a, o;
  const t = document.getSelection();
  if (!t || t.isCollapsed) {
    m(this, tl) && ((r = m(this, Xa)) == null || r.hide(), E(this, tl, null), D(this, Lt, es).call(this, {
      hasSelectedText: !1
    }));
    return;
  }
  const {
    anchorNode: e
  } = t;
  if (e === m(this, tl))
    return;
  const s = D(this, Lt, N5).call(this, t).closest(".textLayer");
  if (!s) {
    m(this, tl) && ((a = m(this, Xa)) == null || a.hide(), E(this, tl, null), D(this, Lt, es).call(this, {
      hasSelectedText: !1
    }));
    return;
  }
  if ((o = m(this, Xa)) == null || o.hide(), E(this, tl, e), D(this, Lt, es).call(this, {
    hasSelectedText: !0
  }), !(m(this, on) !== fe.HIGHLIGHT && m(this, on) !== fe.NONE) && (m(this, on) === fe.HIGHLIGHT && this.showAllEditors("highlight", !0, !0), E(this, _c, this.isShiftKeyDown), !this.isShiftKeyDown)) {
    const l = m(this, on) === fe.HIGHLIGHT ? D(this, Lt, D7).call(this, s) : null;
    l == null || l.toggleDrawing();
    const c = new AbortController(), h = this.combinedSignal(c), u = (f) => {
      f.type === "pointerup" && f.button !== 0 || (c.abort(), l == null || l.toggleDrawing(!0), f.type === "pointerup" && D(this, Lt, L5).call(this, "main_toolbar"));
    };
    window.addEventListener("pointerup", u, {
      signal: h
    }), window.addEventListener("blur", u, {
      signal: h
    });
  }
}, L5 = function(t = "") {
  m(this, on) === fe.HIGHLIGHT ? this.highlightSelection(t) : m(this, Tp) && D(this, Lt, dS).call(this);
}, pS = function() {
  document.addEventListener("selectionchange", D(this, Lt, fS).bind(this), {
    signal: this._signal
  });
}, mS = function() {
  if (m(this, vc))
    return;
  E(this, vc, new AbortController());
  const t = this.combinedSignal(m(this, vc));
  window.addEventListener("focus", this.focus.bind(this), {
    signal: t
  }), window.addEventListener("blur", this.blur.bind(this), {
    signal: t
  });
}, gS = function() {
  var t;
  (t = m(this, vc)) == null || t.abort(), E(this, vc, null);
}, T7 = function() {
  if (m(this, kc))
    return;
  E(this, kc, new AbortController());
  const t = this.combinedSignal(m(this, kc));
  window.addEventListener("keydown", this.keydown.bind(this), {
    signal: t
  }), window.addEventListener("keyup", this.keyup.bind(this), {
    signal: t
  });
}, bS = function() {
  var t;
  (t = m(this, kc)) == null || t.abort(), E(this, kc, null);
}, F7 = function() {
  if (m(this, yc))
    return;
  E(this, yc, new AbortController());
  const t = this.combinedSignal(m(this, yc));
  document.addEventListener("copy", this.copy.bind(this), {
    signal: t
  }), document.addEventListener("cut", this.cut.bind(this), {
    signal: t
  }), document.addEventListener("paste", this.paste.bind(this), {
    signal: t
  });
}, I7 = function() {
  var t;
  (t = m(this, yc)) == null || t.abort(), E(this, yc, null);
}, yS = function() {
  const t = this._signal;
  document.addEventListener("dragover", this.dragOver.bind(this), {
    signal: t
  }), document.addEventListener("drop", this.drop.bind(this), {
    signal: t
  });
}, es = function(t) {
  Object.entries(t).some(([n, s]) => m(this, Pp)[n] !== s) && (this._eventBus.dispatch("annotationeditorstateschanged", {
    source: this,
    details: Object.assign(m(this, Pp), t)
  }), m(this, on) === fe.HIGHLIGHT && t.hasSelectedEditor === !1 && D(this, Lt, Ho).call(this, [[Ie.HIGHLIGHT_FREE, !0]]));
}, Ho = function(t) {
  this._eventBus.dispatch("annotationeditorparamschanged", {
    source: this,
    details: t
  });
}, wS = async function() {
  if (!m(this, xc)) {
    E(this, xc, !0);
    const t = [];
    for (const e of m(this, bn).values())
      t.push(e.enable());
    await Promise.all(t);
    for (const e of m(this, tn).values())
      e.enable();
  }
}, vS = function() {
  if (this.unselectAll(), m(this, xc)) {
    E(this, xc, !1);
    for (const t of m(this, bn).values())
      t.disable();
    for (const t of m(this, tn).values())
      t.disable();
  }
}, M7 = function(t) {
  const e = m(this, bn).get(t.pageIndex);
  e ? e.addOrRebuild(t) : (this.addEditor(t), this.addToAnnotationStorage(t));
}, _S = function() {
  let t = null;
  for (t of m(this, Ve))
    ;
  return t;
}, Jf = function() {
  if (m(this, tn).size === 0)
    return !0;
  if (m(this, tn).size === 1)
    for (const t of m(this, tn).values())
      return t.isEmpty();
  return !1;
}, R7 = function(t) {
  for (const e of m(this, Ve))
    e.unselect();
  m(this, Ve).clear();
  for (const e of t)
    e.isEmpty() || (m(this, Ve).add(e), e.select());
  D(this, Lt, es).call(this, {
    hasSelectedEditor: this.hasSelection
  });
}, ft(yu, "TRANSLATE_SMALL", 1), ft(yu, "TRANSLATE_BIG", 10);
let u0 = yu;
var ln, Ka, la, Hu, Za, Us, ju, Ja, As, il, uh, Qa, Ec, Da, Qf, O5;
const ns = class ns {
  constructor(t) {
    F(this, Da);
    F(this, ln, null);
    F(this, Ka, !1);
    F(this, la, null);
    F(this, Hu, null);
    F(this, Za, null);
    F(this, Us, null);
    F(this, ju, !1);
    F(this, Ja, null);
    F(this, As, null);
    F(this, il, null);
    F(this, uh, null);
    F(this, Qa, !1);
    E(this, As, t), E(this, Qa, t._uiManager.useNewAltTextFlow), m(ns, Ec) || E(ns, Ec, Object.freeze({
      added: "pdfjs-editor-new-alt-text-added-button",
      "added-label": "pdfjs-editor-new-alt-text-added-button-label",
      missing: "pdfjs-editor-new-alt-text-missing-button",
      "missing-label": "pdfjs-editor-new-alt-text-missing-button-label",
      review: "pdfjs-editor-new-alt-text-to-review-button",
      "review-label": "pdfjs-editor-new-alt-text-to-review-button-label"
    }));
  }
  static initialize(t) {
    ns._l10n ?? (ns._l10n = t);
  }
  async render() {
    const t = E(this, la, document.createElement("button"));
    t.className = "altText", t.tabIndex = "0";
    const e = E(this, Hu, document.createElement("span"));
    t.append(e), m(this, Qa) ? (t.classList.add("new"), t.setAttribute("data-l10n-id", m(ns, Ec).missing), e.setAttribute("data-l10n-id", m(ns, Ec)["missing-label"])) : (t.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button"), e.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-button-label"));
    const n = m(this, As)._uiManager._signal;
    t.addEventListener("contextmenu", Gr, {
      signal: n
    }), t.addEventListener("pointerdown", (r) => r.stopPropagation(), {
      signal: n
    });
    const s = (r) => {
      r.preventDefault(), m(this, As)._uiManager.editAltText(m(this, As)), m(this, Qa) && m(this, As)._reportTelemetry({
        action: "pdfjs.image.alt_text.image_status_label_clicked",
        data: {
          label: m(this, Da, Qf)
        }
      });
    };
    return t.addEventListener("click", s, {
      capture: !0,
      signal: n
    }), t.addEventListener("keydown", (r) => {
      r.target === t && r.key === "Enter" && (E(this, ju, !0), s(r));
    }, {
      signal: n
    }), await D(this, Da, O5).call(this), t;
  }
  finish() {
    m(this, la) && (m(this, la).focus({
      focusVisible: m(this, ju)
    }), E(this, ju, !1));
  }
  isEmpty() {
    return m(this, Qa) ? m(this, ln) === null : !m(this, ln) && !m(this, Ka);
  }
  hasData() {
    return m(this, Qa) ? m(this, ln) !== null || !!m(this, il) : this.isEmpty();
  }
  get guessedText() {
    return m(this, il);
  }
  async setGuessedText(t) {
    m(this, ln) === null && (E(this, il, t), E(this, uh, await ns._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer", {
      generatedAltText: t
    })), D(this, Da, O5).call(this));
  }
  toggleAltTextBadge(t = !1) {
    var e;
    if (!m(this, Qa) || m(this, ln)) {
      (e = m(this, Ja)) == null || e.remove(), E(this, Ja, null);
      return;
    }
    if (!m(this, Ja)) {
      const n = E(this, Ja, document.createElement("div"));
      n.className = "noAltTextBadge", m(this, As).div.append(n);
    }
    m(this, Ja).classList.toggle("hidden", !t);
  }
  serialize(t) {
    let e = m(this, ln);
    return !t && m(this, il) === e && (e = m(this, uh)), {
      altText: e,
      decorative: m(this, Ka),
      guessedText: m(this, il),
      textWithDisclaimer: m(this, uh)
    };
  }
  get data() {
    return {
      altText: m(this, ln),
      decorative: m(this, Ka)
    };
  }
  set data({
    altText: t,
    decorative: e,
    guessedText: n,
    textWithDisclaimer: s,
    cancel: r = !1
  }) {
    n && (E(this, il, n), E(this, uh, s)), !(m(this, ln) === t && m(this, Ka) === e) && (r || (E(this, ln, t), E(this, Ka, e)), D(this, Da, O5).call(this));
  }
  toggle(t = !1) {
    m(this, la) && (!t && m(this, Us) && (clearTimeout(m(this, Us)), E(this, Us, null)), m(this, la).disabled = !t);
  }
  shown() {
    m(this, As)._reportTelemetry({
      action: "pdfjs.image.alt_text.image_status_label_displayed",
      data: {
        label: m(this, Da, Qf)
      }
    });
  }
  destroy() {
    var t, e;
    (t = m(this, la)) == null || t.remove(), E(this, la, null), E(this, Hu, null), E(this, Za, null), (e = m(this, Ja)) == null || e.remove(), E(this, Ja, null);
  }
};
ln = new WeakMap(), Ka = new WeakMap(), la = new WeakMap(), Hu = new WeakMap(), Za = new WeakMap(), Us = new WeakMap(), ju = new WeakMap(), Ja = new WeakMap(), As = new WeakMap(), il = new WeakMap(), uh = new WeakMap(), Qa = new WeakMap(), Ec = new WeakMap(), Da = new WeakSet(), Qf = function() {
  return m(this, ln) && "added" || m(this, ln) === null && this.guessedText && "review" || "missing";
}, O5 = async function() {
  var s, r, a;
  const t = m(this, la);
  if (!t)
    return;
  if (m(this, Qa)) {
    if (t.classList.toggle("done", !!m(this, ln)), t.setAttribute("data-l10n-id", m(ns, Ec)[m(this, Da, Qf)]), (s = m(this, Hu)) == null || s.setAttribute("data-l10n-id", m(ns, Ec)[`${m(this, Da, Qf)}-label`]), !m(this, ln)) {
      (r = m(this, Za)) == null || r.remove();
      return;
    }
  } else {
    if (!m(this, ln) && !m(this, Ka)) {
      t.classList.remove("done"), (a = m(this, Za)) == null || a.remove();
      return;
    }
    t.classList.add("done"), t.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-edit-button");
  }
  let e = m(this, Za);
  if (!e) {
    E(this, Za, e = document.createElement("span")), e.className = "tooltip", e.setAttribute("role", "tooltip"), e.id = `alt-text-tooltip-${m(this, As).id}`;
    const o = 100, l = m(this, As)._uiManager._signal;
    l.addEventListener("abort", () => {
      clearTimeout(m(this, Us)), E(this, Us, null);
    }, {
      once: !0
    }), t.addEventListener("mouseenter", () => {
      E(this, Us, setTimeout(() => {
        E(this, Us, null), m(this, Za).classList.add("show"), m(this, As)._reportTelemetry({
          action: "alt_text_tooltip"
        });
      }, o));
    }, {
      signal: l
    }), t.addEventListener("mouseleave", () => {
      var c;
      m(this, Us) && (clearTimeout(m(this, Us)), E(this, Us, null)), (c = m(this, Za)) == null || c.classList.remove("show");
    }, {
      signal: l
    });
  }
  m(this, Ka) ? e.setAttribute("data-l10n-id", "pdfjs-editor-alt-text-decorative-tooltip") : (e.removeAttribute("data-l10n-id"), e.textContent = m(this, ln)), e.parentNode || t.append(e);
  const n = m(this, As).getElementForAltText();
  n == null || n.setAttribute("aria-describedby", e.id);
}, F(ns, Ec, null), ft(ns, "_l10n", null);
let O9 = ns;
var Gu, dh, Lp, Op, $p, qp, zp, nl, fh, sl, ph, rl, y0, xS, kS, AS;
const nv = class nv {
  constructor({
    container: t,
    isPinchingDisabled: e = null,
    isPinchingStopped: n = null,
    onPinchStart: s = null,
    onPinching: r = null,
    onPinchEnd: a = null,
    signal: o
  }) {
    F(this, y0);
    F(this, Gu);
    F(this, dh, !1);
    F(this, Lp, null);
    F(this, Op);
    F(this, $p);
    F(this, qp);
    F(this, zp);
    F(this, nl, null);
    F(this, fh);
    F(this, sl, null);
    F(this, ph);
    F(this, rl, null);
    E(this, Gu, t), E(this, Lp, n), E(this, Op, e), E(this, $p, s), E(this, qp, r), E(this, zp, a), E(this, ph, new AbortController()), E(this, fh, AbortSignal.any([o, m(this, ph).signal])), t.addEventListener("touchstart", D(this, y0, xS).bind(this), {
      passive: !1,
      signal: m(this, fh)
    });
  }
  get MIN_TOUCH_DISTANCE_TO_PINCH() {
    return 35 / Ia.pixelRatio;
  }
  destroy() {
    var t, e;
    (t = m(this, ph)) == null || t.abort(), E(this, ph, null), (e = m(this, nl)) == null || e.abort(), E(this, nl, null);
  }
};
Gu = new WeakMap(), dh = new WeakMap(), Lp = new WeakMap(), Op = new WeakMap(), $p = new WeakMap(), qp = new WeakMap(), zp = new WeakMap(), nl = new WeakMap(), fh = new WeakMap(), sl = new WeakMap(), ph = new WeakMap(), rl = new WeakMap(), y0 = new WeakSet(), xS = function(t) {
  var s, r, a;
  if ((s = m(this, Op)) != null && s.call(this))
    return;
  if (t.touches.length === 1) {
    if (m(this, nl))
      return;
    const o = E(this, nl, new AbortController()), l = AbortSignal.any([m(this, fh), o.signal]), c = m(this, Gu), h = {
      capture: !0,
      signal: l,
      passive: !1
    }, u = (f) => {
      var d;
      f.pointerType === "touch" && ((d = m(this, nl)) == null || d.abort(), E(this, nl, null));
    };
    c.addEventListener("pointerdown", (f) => {
      f.pointerType === "touch" && (Oi(f), u(f));
    }, h), c.addEventListener("pointerup", u, h), c.addEventListener("pointercancel", u, h);
    return;
  }
  if (!m(this, rl)) {
    E(this, rl, new AbortController());
    const o = AbortSignal.any([m(this, fh), m(this, rl).signal]), l = m(this, Gu), c = {
      signal: o,
      capture: !1,
      passive: !1
    };
    l.addEventListener("touchmove", D(this, y0, kS).bind(this), c);
    const h = D(this, y0, AS).bind(this);
    l.addEventListener("touchend", h, c), l.addEventListener("touchcancel", h, c), c.capture = !0, l.addEventListener("pointerdown", Oi, c), l.addEventListener("pointermove", Oi, c), l.addEventListener("pointercancel", Oi, c), l.addEventListener("pointerup", Oi, c), (r = m(this, $p)) == null || r.call(this);
  }
  if (Oi(t), t.touches.length !== 2 || (a = m(this, Lp)) != null && a.call(this)) {
    E(this, sl, null);
    return;
  }
  let [e, n] = t.touches;
  e.identifier > n.identifier && ([e, n] = [n, e]), E(this, sl, {
    touch0X: e.screenX,
    touch0Y: e.screenY,
    touch1X: n.screenX,
    touch1Y: n.screenY
  });
}, kS = function(t) {
  var _;
  if (!m(this, sl) || t.touches.length !== 2)
    return;
  Oi(t);
  let [e, n] = t.touches;
  e.identifier > n.identifier && ([e, n] = [n, e]);
  const {
    screenX: s,
    screenY: r
  } = e, {
    screenX: a,
    screenY: o
  } = n, l = m(this, sl), {
    touch0X: c,
    touch0Y: h,
    touch1X: u,
    touch1Y: f
  } = l, d = u - c, p = f - h, g = a - s, b = o - r, y = Math.hypot(g, b) || 1, v = Math.hypot(d, p) || 1;
  if (!m(this, dh) && Math.abs(v - y) <= nv.MIN_TOUCH_DISTANCE_TO_PINCH)
    return;
  if (l.touch0X = s, l.touch0Y = r, l.touch1X = a, l.touch1Y = o, !m(this, dh)) {
    E(this, dh, !0);
    return;
  }
  const w = [(s + a) / 2, (r + o) / 2];
  (_ = m(this, qp)) == null || _.call(this, w, v, y);
}, AS = function(t) {
  var e;
  t.touches.length >= 2 || (m(this, rl) && (m(this, rl).abort(), E(this, rl, null), (e = m(this, zp)) == null || e.call(this)), m(this, sl) && (Oi(t), E(this, sl, null), E(this, dh, !1)));
};
let Z2 = nv;
var mh, ca, ri, Vu, Dc, Up, gh, yn, bh, al, Tc, Hp, yh, Hs, jp, wh, ol, to, Wu, Xu, _r, vh, Gp, X3, se, B7, Vp, P7, $5, SS, CS, N7, q5, L7, ES, DS, TS, O7, FS, $7, IS, MS, RS, q7, t2;
const _e = class _e {
  constructor(t) {
    F(this, se);
    F(this, mh, null);
    F(this, ca, null);
    F(this, ri, null);
    F(this, Vu, !1);
    F(this, Dc, null);
    F(this, Up, "");
    F(this, gh, !1);
    F(this, yn, null);
    F(this, bh, null);
    F(this, al, null);
    F(this, Tc, null);
    F(this, Hp, "");
    F(this, yh, !1);
    F(this, Hs, null);
    F(this, jp, !1);
    F(this, wh, !1);
    F(this, ol, !1);
    F(this, to, null);
    F(this, Wu, 0);
    F(this, Xu, 0);
    F(this, _r, null);
    F(this, vh, null);
    ft(this, "isSelected", !1);
    ft(this, "_isCopy", !1);
    ft(this, "_editToolbar", null);
    ft(this, "_initialOptions", /* @__PURE__ */ Object.create(null));
    ft(this, "_initialData", null);
    ft(this, "_isVisible", !0);
    ft(this, "_uiManager", null);
    ft(this, "_focusEventsAllowed", !0);
    F(this, Gp, !1);
    F(this, X3, _e._zIndex++);
    this.parent = t.parent, this.id = t.id, this.width = this.height = null, this.pageIndex = t.parent.pageIndex, this.name = t.name, this.div = null, this._uiManager = t.uiManager, this.annotationElementId = null, this._willKeepAspectRatio = !1, this._initialOptions.isCentered = t.isCentered, this._structTreeParentId = null;
    const {
      rotation: e,
      rawDims: {
        pageWidth: n,
        pageHeight: s,
        pageX: r,
        pageY: a
      }
    } = this.parent.viewport;
    this.rotation = e, this.pageRotation = (360 + e - this._uiManager.viewParameters.rotation) % 360, this.pageDimensions = [n, s], this.pageTranslation = [r, a];
    const [o, l] = this.parentDimensions;
    this.x = t.x / o, this.y = t.y / l, this.isAttachedToDOM = !1, this.deleted = !1;
  }
  static get _resizerKeyboardManager() {
    const t = _e.prototype._resizeWithKeyboard, e = u0.TRANSLATE_SMALL, n = u0.TRANSLATE_BIG;
    return Fe(this, "_resizerKeyboardManager", new yg([[["ArrowLeft", "mac+ArrowLeft"], t, {
      args: [-e, 0]
    }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], t, {
      args: [-n, 0]
    }], [["ArrowRight", "mac+ArrowRight"], t, {
      args: [e, 0]
    }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], t, {
      args: [n, 0]
    }], [["ArrowUp", "mac+ArrowUp"], t, {
      args: [0, -e]
    }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], t, {
      args: [0, -n]
    }], [["ArrowDown", "mac+ArrowDown"], t, {
      args: [0, e]
    }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], t, {
      args: [0, n]
    }], [["Escape", "mac+Escape"], _e.prototype._stopResizingWithKeyboard]]));
  }
  get editorType() {
    return Object.getPrototypeOf(this).constructor._type;
  }
  static get isDrawer() {
    return !1;
  }
  static get _defaultLineColor() {
    return Fe(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
  }
  static deleteAnnotationElement(t) {
    const e = new sM({
      id: t.parent.getNextId(),
      parent: t.parent,
      uiManager: t._uiManager
    });
    e.annotationElementId = t.annotationElementId, e.deleted = !0, e._uiManager.addToAnnotationStorage(e);
  }
  static initialize(t, e) {
    if (_e._l10n ?? (_e._l10n = t), _e._l10nResizer || (_e._l10nResizer = Object.freeze({
      topLeft: "pdfjs-editor-resizer-top-left",
      topMiddle: "pdfjs-editor-resizer-top-middle",
      topRight: "pdfjs-editor-resizer-top-right",
      middleRight: "pdfjs-editor-resizer-middle-right",
      bottomRight: "pdfjs-editor-resizer-bottom-right",
      bottomMiddle: "pdfjs-editor-resizer-bottom-middle",
      bottomLeft: "pdfjs-editor-resizer-bottom-left",
      middleLeft: "pdfjs-editor-resizer-middle-left"
    })), _e._borderLineWidth !== -1)
      return;
    const n = getComputedStyle(document.documentElement);
    _e._borderLineWidth = parseFloat(n.getPropertyValue("--outline-width")) || 0;
  }
  static updateDefaultParams(t, e) {
  }
  static get defaultPropertiesToUpdate() {
    return [];
  }
  static isHandlingMimeForPasting(t) {
    return !1;
  }
  static paste(t, e) {
    Ze("Not implemented");
  }
  get propertiesToUpdate() {
    return [];
  }
  get _isDraggable() {
    return m(this, Gp);
  }
  set _isDraggable(t) {
    var e;
    E(this, Gp, t), (e = this.div) == null || e.classList.toggle("draggable", t);
  }
  get isEnterHandled() {
    return !0;
  }
  center() {
    const [t, e] = this.pageDimensions;
    switch (this.parentRotation) {
      case 90:
        this.x -= this.height * e / (t * 2), this.y += this.width * t / (e * 2);
        break;
      case 180:
        this.x += this.width / 2, this.y += this.height / 2;
        break;
      case 270:
        this.x += this.height * e / (t * 2), this.y -= this.width * t / (e * 2);
        break;
      default:
        this.x -= this.width / 2, this.y -= this.height / 2;
        break;
    }
    this.fixAndSetPosition();
  }
  addCommands(t) {
    this._uiManager.addCommands(t);
  }
  get currentLayer() {
    return this._uiManager.currentLayer;
  }
  setInBackground() {
    this.div.style.zIndex = 0;
  }
  setInForeground() {
    this.div.style.zIndex = m(this, X3);
  }
  setParent(t) {
    t !== null ? (this.pageIndex = t.pageIndex, this.pageDimensions = t.pageDimensions) : D(this, se, t2).call(this), this.parent = t;
  }
  focusin(t) {
    this._focusEventsAllowed && (m(this, yh) ? E(this, yh, !1) : this.parent.setSelected(this));
  }
  focusout(t) {
    var n;
    if (!this._focusEventsAllowed || !this.isAttachedToDOM)
      return;
    const e = t.relatedTarget;
    e != null && e.closest(`#${this.id}`) || (t.preventDefault(), (n = this.parent) != null && n.isMultipleSelection || this.commitOrRemove());
  }
  commitOrRemove() {
    this.isEmpty() ? this.remove() : this.commit();
  }
  commit() {
    this.addToAnnotationStorage();
  }
  addToAnnotationStorage() {
    this._uiManager.addToAnnotationStorage(this);
  }
  setAt(t, e, n, s) {
    const [r, a] = this.parentDimensions;
    [n, s] = this.screenToPageTranslation(n, s), this.x = (t + n) / r, this.y = (e + s) / a, this.fixAndSetPosition();
  }
  _moveAfterPaste(t, e) {
    const [n, s] = this.parentDimensions;
    this.setAt(t * n, e * s, this.width * n, this.height * s), this._onTranslated();
  }
  translate(t, e) {
    D(this, se, B7).call(this, this.parentDimensions, t, e);
  }
  translateInPage(t, e) {
    m(this, Hs) || E(this, Hs, [this.x, this.y, this.width, this.height]), D(this, se, B7).call(this, this.pageDimensions, t, e), this.div.scrollIntoView({
      block: "nearest"
    });
  }
  translationDone() {
    this._onTranslated(this.x, this.y);
  }
  drag(t, e) {
    m(this, Hs) || E(this, Hs, [this.x, this.y, this.width, this.height]);
    const {
      div: n,
      parentDimensions: [s, r]
    } = this;
    if (this.x += t / s, this.y += e / r, this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {
      const {
        x: u,
        y: f
      } = this.div.getBoundingClientRect();
      this.parent.findNewParent(this, u, f) && (this.x -= Math.floor(this.x), this.y -= Math.floor(this.y));
    }
    let {
      x: a,
      y: o
    } = this;
    const [l, c] = this.getBaseTranslation();
    a += l, o += c;
    const {
      style: h
    } = n;
    h.left = `${(100 * a).toFixed(2)}%`, h.top = `${(100 * o).toFixed(2)}%`, this._onTranslating(a, o), n.scrollIntoView({
      block: "nearest"
    });
  }
  _onTranslating(t, e) {
  }
  _onTranslated(t, e) {
  }
  get _hasBeenMoved() {
    return !!m(this, Hs) && (m(this, Hs)[0] !== this.x || m(this, Hs)[1] !== this.y);
  }
  get _hasBeenResized() {
    return !!m(this, Hs) && (m(this, Hs)[2] !== this.width || m(this, Hs)[3] !== this.height);
  }
  getBaseTranslation() {
    const [t, e] = this.parentDimensions, {
      _borderLineWidth: n
    } = _e, s = n / t, r = n / e;
    switch (this.rotation) {
      case 90:
        return [-s, r];
      case 180:
        return [s, r];
      case 270:
        return [s, -r];
      default:
        return [-s, -r];
    }
  }
  get _mustFixPosition() {
    return !0;
  }
  fixAndSetPosition(t = this.rotation) {
    const {
      div: {
        style: e
      },
      pageDimensions: [n, s]
    } = this;
    let {
      x: r,
      y: a,
      width: o,
      height: l
    } = this;
    if (o *= n, l *= s, r *= n, a *= s, this._mustFixPosition)
      switch (t) {
        case 0:
          r = Gn(r, 0, n - o), a = Gn(a, 0, s - l);
          break;
        case 90:
          r = Gn(r, 0, n - l), a = Gn(a, o, s);
          break;
        case 180:
          r = Gn(r, o, n), a = Gn(a, l, s);
          break;
        case 270:
          r = Gn(r, l, n), a = Gn(a, 0, s - o);
          break;
      }
    this.x = r /= n, this.y = a /= s;
    const [c, h] = this.getBaseTranslation();
    r += c, a += h, e.left = `${(100 * r).toFixed(2)}%`, e.top = `${(100 * a).toFixed(2)}%`, this.moveInDOM();
  }
  screenToPageTranslation(t, e) {
    var n;
    return D(n = _e, Vp, P7).call(n, t, e, this.parentRotation);
  }
  pageTranslationToScreen(t, e) {
    var n;
    return D(n = _e, Vp, P7).call(n, t, e, 360 - this.parentRotation);
  }
  get parentScale() {
    return this._uiManager.viewParameters.realScale;
  }
  get parentRotation() {
    return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360;
  }
  get parentDimensions() {
    const {
      parentScale: t,
      pageDimensions: [e, n]
    } = this;
    return [e * t, n * t];
  }
  setDims(t, e) {
    const [n, s] = this.parentDimensions, {
      style: r
    } = this.div;
    r.width = `${(100 * t / n).toFixed(2)}%`, m(this, gh) || (r.height = `${(100 * e / s).toFixed(2)}%`);
  }
  fixDims() {
    const {
      style: t
    } = this.div, {
      height: e,
      width: n
    } = t, s = n.endsWith("%"), r = !m(this, gh) && e.endsWith("%");
    if (s && r)
      return;
    const [a, o] = this.parentDimensions;
    s || (t.width = `${(100 * parseFloat(n) / a).toFixed(2)}%`), !m(this, gh) && !r && (t.height = `${(100 * parseFloat(e) / o).toFixed(2)}%`);
  }
  getInitialTranslation() {
    return [0, 0];
  }
  _onResized() {
  }
  static _round(t) {
    return Math.round(t * 1e4) / 1e4;
  }
  _onResizing() {
  }
  altTextFinish() {
    var t;
    (t = m(this, ri)) == null || t.finish();
  }
  async addEditToolbar() {
    return this._editToolbar || m(this, wh) ? this._editToolbar : (this._editToolbar = new S7(this), this.div.append(this._editToolbar.render()), m(this, ri) && await this._editToolbar.addAltText(m(this, ri)), this._editToolbar);
  }
  removeEditToolbar() {
    var t;
    this._editToolbar && (this._editToolbar.remove(), this._editToolbar = null, (t = m(this, ri)) == null || t.destroy());
  }
  addContainer(t) {
    var n;
    const e = (n = this._editToolbar) == null ? void 0 : n.div;
    e ? e.before(t) : this.div.append(t);
  }
  getClientDimensions() {
    return this.div.getBoundingClientRect();
  }
  async addAltTextButton() {
    m(this, ri) || (O9.initialize(_e._l10n), E(this, ri, new O9(this)), m(this, mh) && (m(this, ri).data = m(this, mh), E(this, mh, null)), await this.addEditToolbar());
  }
  get altTextData() {
    var t;
    return (t = m(this, ri)) == null ? void 0 : t.data;
  }
  set altTextData(t) {
    m(this, ri) && (m(this, ri).data = t);
  }
  get guessedAltText() {
    var t;
    return (t = m(this, ri)) == null ? void 0 : t.guessedText;
  }
  async setGuessedAltText(t) {
    var e;
    await ((e = m(this, ri)) == null ? void 0 : e.setGuessedText(t));
  }
  serializeAltText(t) {
    var e;
    return (e = m(this, ri)) == null ? void 0 : e.serialize(t);
  }
  hasAltText() {
    return !!m(this, ri) && !m(this, ri).isEmpty();
  }
  hasAltTextData() {
    var t;
    return ((t = m(this, ri)) == null ? void 0 : t.hasData()) ?? !1;
  }
  render() {
    var a;
    const t = this.div = document.createElement("div");
    t.setAttribute("data-editor-rotation", (360 - this.rotation) % 360), t.className = this.name, t.setAttribute("id", this.id), t.tabIndex = m(this, Vu) ? -1 : 0, t.setAttribute("role", "application"), this.defaultL10nId && t.setAttribute("data-l10n-id", this.defaultL10nId), this._isVisible || t.classList.add("hidden"), this.setInForeground(), D(this, se, $7).call(this);
    const [e, n] = this.parentDimensions;
    this.parentRotation % 180 !== 0 && (t.style.maxWidth = `${(100 * n / e).toFixed(2)}%`, t.style.maxHeight = `${(100 * e / n).toFixed(2)}%`);
    const [s, r] = this.getInitialTranslation();
    return this.translate(s, r), hS(this, t, ["keydown", "pointerdown", "dblclick"]), this.isResizable && this._uiManager._supportsPinchToZoom && (m(this, vh) || E(this, vh, new Z2({
      container: t,
      isPinchingDisabled: () => !this.isSelected,
      onPinchStart: D(this, se, ES).bind(this),
      onPinching: D(this, se, DS).bind(this),
      onPinchEnd: D(this, se, TS).bind(this),
      signal: this._uiManager._signal
    }))), (a = this._uiManager._editorUndoBar) == null || a.hide(), t;
  }
  pointerdown(t) {
    const {
      isMac: e
    } = gn.platform;
    if (t.button !== 0 || t.ctrlKey && e) {
      t.preventDefault();
      return;
    }
    if (E(this, yh, !0), this._isDraggable) {
      D(this, se, FS).call(this, t);
      return;
    }
    D(this, se, O7).call(this, t);
  }
  _onStartDragging() {
  }
  _onStopDragging() {
  }
  moveInDOM() {
    m(this, to) && clearTimeout(m(this, to)), E(this, to, setTimeout(() => {
      var t;
      E(this, to, null), (t = this.parent) == null || t.moveEditorInDOM(this);
    }, 0));
  }
  _setParentAndPosition(t, e, n) {
    t.changeParent(this), this.x = e, this.y = n, this.fixAndSetPosition(), this._onTranslated();
  }
  getRect(t, e, n = this.rotation) {
    const s = this.parentScale, [r, a] = this.pageDimensions, [o, l] = this.pageTranslation, c = t / s, h = e / s, u = this.x * r, f = this.y * a, d = this.width * r, p = this.height * a;
    switch (n) {
      case 0:
        return [u + c + o, a - f - h - p + l, u + c + d + o, a - f - h + l];
      case 90:
        return [u + h + o, a - f + c + l, u + h + p + o, a - f + c + d + l];
      case 180:
        return [u - c - d + o, a - f + h + l, u - c + o, a - f + h + p + l];
      case 270:
        return [u - h - p + o, a - f - c - d + l, u - h + o, a - f - c + l];
      default:
        throw new Error("Invalid rotation");
    }
  }
  getRectInCurrentCoords(t, e) {
    const [n, s, r, a] = t, o = r - n, l = a - s;
    switch (this.rotation) {
      case 0:
        return [n, e - a, o, l];
      case 90:
        return [n, e - s, l, o];
      case 180:
        return [r, e - s, o, l];
      case 270:
        return [r, e - a, l, o];
      default:
        throw new Error("Invalid rotation");
    }
  }
  onceAdded(t) {
  }
  isEmpty() {
    return !1;
  }
  enableEditMode() {
    return this.isInEditMode() ? !1 : (this.parent.setEditingState(!1), E(this, wh, !0), !0);
  }
  disableEditMode() {
    return this.isInEditMode() ? (this.parent.setEditingState(!0), E(this, wh, !1), !0) : !1;
  }
  isInEditMode() {
    return m(this, wh);
  }
  shouldGetKeyboardEvents() {
    return m(this, ol);
  }
  needsToBeRebuilt() {
    return this.div && !this.isAttachedToDOM;
  }
  get isOnScreen() {
    const {
      top: t,
      left: e,
      bottom: n,
      right: s
    } = this.getClientDimensions(), {
      innerHeight: r,
      innerWidth: a
    } = window;
    return e < a && s > 0 && t < r && n > 0;
  }
  rebuild() {
    D(this, se, $7).call(this);
  }
  rotate(t) {
  }
  resize() {
  }
  serializeDeleted() {
    var t;
    return {
      id: this.annotationElementId,
      deleted: !0,
      pageIndex: this.pageIndex,
      popupRef: ((t = this._initialData) == null ? void 0 : t.popupRef) || ""
    };
  }
  serialize(t = !1, e = null) {
    Ze("An editor must be serializable");
  }
  static async deserialize(t, e, n) {
    const s = new this.prototype.constructor({
      parent: e,
      id: e.getNextId(),
      uiManager: n
    });
    s.rotation = t.rotation, E(s, mh, t.accessibilityData), s._isCopy = t.isCopy || !1;
    const [r, a] = s.pageDimensions, [o, l, c, h] = s.getRectInCurrentCoords(t.rect, a);
    return s.x = o / r, s.y = l / a, s.width = c / r, s.height = h / a, s;
  }
  get hasBeenModified() {
    return !!this.annotationElementId && (this.deleted || this.serialize() !== null);
  }
  remove() {
    var t, e;
    if ((t = m(this, Tc)) == null || t.abort(), E(this, Tc, null), this.isEmpty() || this.commit(), this.parent ? this.parent.remove(this) : this._uiManager.removeEditor(this), m(this, to) && (clearTimeout(m(this, to)), E(this, to, null)), D(this, se, t2).call(this), this.removeEditToolbar(), m(this, _r)) {
      for (const n of m(this, _r).values())
        clearTimeout(n);
      E(this, _r, null);
    }
    this.parent = null, (e = m(this, vh)) == null || e.destroy(), E(this, vh, null);
  }
  get isResizable() {
    return !1;
  }
  makeResizable() {
    this.isResizable && (D(this, se, SS).call(this), m(this, yn).classList.remove("hidden"));
  }
  get toolbarPosition() {
    return null;
  }
  keydown(t) {
    if (!this.isResizable || t.target !== this.div || t.key !== "Enter")
      return;
    this._uiManager.setSelected(this), E(this, al, {
      savedX: this.x,
      savedY: this.y,
      savedWidth: this.width,
      savedHeight: this.height
    });
    const e = m(this, yn).children;
    if (!m(this, ca)) {
      E(this, ca, Array.from(e));
      const a = D(this, se, IS).bind(this), o = D(this, se, MS).bind(this), l = this._uiManager._signal;
      for (const c of m(this, ca)) {
        const h = c.getAttribute("data-resizer-name");
        c.setAttribute("role", "spinbutton"), c.addEventListener("keydown", a, {
          signal: l
        }), c.addEventListener("blur", o, {
          signal: l
        }), c.addEventListener("focus", D(this, se, RS).bind(this, h), {
          signal: l
        }), c.setAttribute("data-l10n-id", _e._l10nResizer[h]);
      }
    }
    const n = m(this, ca)[0];
    let s = 0;
    for (const a of e) {
      if (a === n)
        break;
      s++;
    }
    const r = (360 - this.rotation + this.parentRotation) % 360 / 90 * (m(this, ca).length / 4);
    if (r !== s) {
      if (r < s)
        for (let o = 0; o < s - r; o++)
          m(this, yn).append(m(this, yn).firstChild);
      else if (r > s)
        for (let o = 0; o < r - s; o++)
          m(this, yn).firstChild.before(m(this, yn).lastChild);
      let a = 0;
      for (const o of e) {
        const c = m(this, ca)[a++].getAttribute("data-resizer-name");
        o.setAttribute("data-l10n-id", _e._l10nResizer[c]);
      }
    }
    D(this, se, q7).call(this, 0), E(this, ol, !0), m(this, yn).firstChild.focus({
      focusVisible: !0
    }), t.preventDefault(), t.stopImmediatePropagation();
  }
  _resizeWithKeyboard(t, e) {
    m(this, ol) && D(this, se, L7).call(this, m(this, Hp), {
      deltaX: t,
      deltaY: e,
      fromKeyboard: !0
    });
  }
  _stopResizingWithKeyboard() {
    D(this, se, t2).call(this), this.div.focus();
  }
  select() {
    var t, e, n;
    if (!(this.isSelected && this._editToolbar)) {
      if (this.isSelected = !0, this.makeResizable(), (t = this.div) == null || t.classList.add("selectedEditor"), !this._editToolbar) {
        this.addEditToolbar().then(() => {
          var s, r;
          (s = this.div) != null && s.classList.contains("selectedEditor") && ((r = this._editToolbar) == null || r.show());
        });
        return;
      }
      (e = this._editToolbar) == null || e.show(), (n = m(this, ri)) == null || n.toggleAltTextBadge(!1);
    }
  }
  unselect() {
    var t, e, n, s, r;
    this.isSelected && (this.isSelected = !1, (t = m(this, yn)) == null || t.classList.add("hidden"), (e = this.div) == null || e.classList.remove("selectedEditor"), (n = this.div) != null && n.contains(document.activeElement) && this._uiManager.currentLayer.div.focus({
      preventScroll: !0
    }), (s = this._editToolbar) == null || s.hide(), (r = m(this, ri)) == null || r.toggleAltTextBadge(!0));
  }
  updateParams(t, e) {
  }
  disableEditing() {
  }
  enableEditing() {
  }
  get canChangeContent() {
    return !1;
  }
  enterInEditMode() {
    this.canChangeContent && (this.enableEditMode(), this.div.focus());
  }
  dblclick(t) {
    this.enterInEditMode(), this.parent.updateToolbar({
      mode: this.constructor._editorType,
      editId: this.id
    });
  }
  getElementForAltText() {
    return this.div;
  }
  get contentDiv() {
    return this.div;
  }
  get isEditing() {
    return m(this, jp);
  }
  set isEditing(t) {
    E(this, jp, t), this.parent && (t ? (this.parent.setSelected(this), this.parent.setActiveEditor(this)) : this.parent.setActiveEditor(null));
  }
  setAspectRatio(t, e) {
    E(this, gh, !0);
    const n = t / e, {
      style: s
    } = this.div;
    s.aspectRatio = n, s.height = "auto";
  }
  static get MIN_SIZE() {
    return 16;
  }
  static canCreateNewEmptyEditor() {
    return !0;
  }
  get telemetryInitialData() {
    return {
      action: "added"
    };
  }
  get telemetryFinalData() {
    return null;
  }
  _reportTelemetry(t, e = !1) {
    if (e) {
      m(this, _r) || E(this, _r, /* @__PURE__ */ new Map());
      const {
        action: n
      } = t;
      let s = m(this, _r).get(n);
      s && clearTimeout(s), s = setTimeout(() => {
        this._reportTelemetry(t), m(this, _r).delete(n), m(this, _r).size === 0 && E(this, _r, null);
      }, _e._telemetryTimeout), m(this, _r).set(n, s);
      return;
    }
    t.type || (t.type = this.editorType), this._uiManager._eventBus.dispatch("reporttelemetry", {
      source: this,
      details: {
        type: "editing",
        data: t
      }
    });
  }
  show(t = this._isVisible) {
    this.div.classList.toggle("hidden", !t), this._isVisible = t;
  }
  enable() {
    this.div && (this.div.tabIndex = 0), E(this, Vu, !1);
  }
  disable() {
    this.div && (this.div.tabIndex = -1), E(this, Vu, !0);
  }
  renderAnnotationElement(t) {
    let e = t.container.querySelector(".annotationContent");
    if (!e)
      e = document.createElement("div"), e.classList.add("annotationContent", this.editorType), t.container.prepend(e);
    else if (e.nodeName === "CANVAS") {
      const n = e;
      e = document.createElement("div"), e.classList.add("annotationContent", this.editorType), n.before(e);
    }
    return e;
  }
  resetAnnotationElement(t) {
    const {
      firstChild: e
    } = t.container;
    (e == null ? void 0 : e.nodeName) === "DIV" && e.classList.contains("annotationContent") && e.remove();
  }
};
mh = new WeakMap(), ca = new WeakMap(), ri = new WeakMap(), Vu = new WeakMap(), Dc = new WeakMap(), Up = new WeakMap(), gh = new WeakMap(), yn = new WeakMap(), bh = new WeakMap(), al = new WeakMap(), Tc = new WeakMap(), Hp = new WeakMap(), yh = new WeakMap(), Hs = new WeakMap(), jp = new WeakMap(), wh = new WeakMap(), ol = new WeakMap(), to = new WeakMap(), Wu = new WeakMap(), Xu = new WeakMap(), _r = new WeakMap(), vh = new WeakMap(), Gp = new WeakMap(), X3 = new WeakMap(), se = new WeakSet(), B7 = function([t, e], n, s) {
  [n, s] = this.screenToPageTranslation(n, s), this.x += n / t, this.y += s / e, this._onTranslating(this.x, this.y), this.fixAndSetPosition();
}, Vp = new WeakSet(), P7 = function(t, e, n) {
  switch (n) {
    case 90:
      return [e, -t];
    case 180:
      return [-t, -e];
    case 270:
      return [-e, t];
    default:
      return [t, e];
  }
}, $5 = function(t) {
  switch (t) {
    case 90: {
      const [e, n] = this.pageDimensions;
      return [0, -e / n, n / e, 0];
    }
    case 180:
      return [-1, 0, 0, -1];
    case 270: {
      const [e, n] = this.pageDimensions;
      return [0, e / n, -n / e, 0];
    }
    default:
      return [1, 0, 0, 1];
  }
}, SS = function() {
  if (m(this, yn))
    return;
  E(this, yn, document.createElement("div")), m(this, yn).classList.add("resizers");
  const t = this._willKeepAspectRatio ? ["topLeft", "topRight", "bottomRight", "bottomLeft"] : ["topLeft", "topMiddle", "topRight", "middleRight", "bottomRight", "bottomMiddle", "bottomLeft", "middleLeft"], e = this._uiManager._signal;
  for (const n of t) {
    const s = document.createElement("div");
    m(this, yn).append(s), s.classList.add("resizer", n), s.setAttribute("data-resizer-name", n), s.addEventListener("pointerdown", D(this, se, CS).bind(this, n), {
      signal: e
    }), s.addEventListener("contextmenu", Gr, {
      signal: e
    }), s.tabIndex = -1;
  }
  this.div.prepend(m(this, yn));
}, CS = function(t, e) {
  var h;
  e.preventDefault();
  const {
    isMac: n
  } = gn.platform;
  if (e.button !== 0 || e.ctrlKey && n)
    return;
  (h = m(this, ri)) == null || h.toggle(!1);
  const s = this._isDraggable;
  this._isDraggable = !1, E(this, bh, [e.screenX, e.screenY]);
  const r = new AbortController(), a = this._uiManager.combinedSignal(r);
  this.parent.togglePointerEvents(!1), window.addEventListener("pointermove", D(this, se, L7).bind(this, t), {
    passive: !0,
    capture: !0,
    signal: a
  }), window.addEventListener("touchmove", Oi, {
    passive: !1,
    signal: a
  }), window.addEventListener("contextmenu", Gr, {
    signal: a
  }), E(this, al, {
    savedX: this.x,
    savedY: this.y,
    savedWidth: this.width,
    savedHeight: this.height
  });
  const o = this.parent.div.style.cursor, l = this.div.style.cursor;
  this.div.style.cursor = this.parent.div.style.cursor = window.getComputedStyle(e.target).cursor;
  const c = () => {
    var u;
    r.abort(), this.parent.togglePointerEvents(!0), (u = m(this, ri)) == null || u.toggle(!0), this._isDraggable = s, this.parent.div.style.cursor = o, this.div.style.cursor = l, D(this, se, q5).call(this);
  };
  window.addEventListener("pointerup", c, {
    signal: a
  }), window.addEventListener("blur", c, {
    signal: a
  });
}, N7 = function(t, e, n, s) {
  this.width = n, this.height = s, this.x = t, this.y = e;
  const [r, a] = this.parentDimensions;
  this.setDims(r * n, a * s), this.fixAndSetPosition(), this._onResized();
}, q5 = function() {
  if (!m(this, al))
    return;
  const {
    savedX: t,
    savedY: e,
    savedWidth: n,
    savedHeight: s
  } = m(this, al);
  E(this, al, null);
  const r = this.x, a = this.y, o = this.width, l = this.height;
  r === t && a === e && o === n && l === s || this.addCommands({
    cmd: D(this, se, N7).bind(this, r, a, o, l),
    undo: D(this, se, N7).bind(this, t, e, n, s),
    mustExec: !0
  });
}, L7 = function(t, e) {
  const [n, s] = this.parentDimensions, r = this.x, a = this.y, o = this.width, l = this.height, c = _e.MIN_SIZE / n, h = _e.MIN_SIZE / s, u = D(this, se, $5).call(this, this.rotation), f = (W, q) => [u[0] * W + u[2] * q, u[1] * W + u[3] * q], d = D(this, se, $5).call(this, 360 - this.rotation), p = (W, q) => [d[0] * W + d[2] * q, d[1] * W + d[3] * q];
  let g, b, y = !1, v = !1;
  switch (t) {
    case "topLeft":
      y = !0, g = (W, q) => [0, 0], b = (W, q) => [W, q];
      break;
    case "topMiddle":
      g = (W, q) => [W / 2, 0], b = (W, q) => [W / 2, q];
      break;
    case "topRight":
      y = !0, g = (W, q) => [W, 0], b = (W, q) => [0, q];
      break;
    case "middleRight":
      v = !0, g = (W, q) => [W, q / 2], b = (W, q) => [0, q / 2];
      break;
    case "bottomRight":
      y = !0, g = (W, q) => [W, q], b = (W, q) => [0, 0];
      break;
    case "bottomMiddle":
      g = (W, q) => [W / 2, q], b = (W, q) => [W / 2, 0];
      break;
    case "bottomLeft":
      y = !0, g = (W, q) => [0, q], b = (W, q) => [W, 0];
      break;
    case "middleLeft":
      v = !0, g = (W, q) => [0, q / 2], b = (W, q) => [W, q / 2];
      break;
  }
  const w = g(o, l), _ = b(o, l);
  let x = f(..._);
  const k = _e._round(r + x[0]), S = _e._round(a + x[1]);
  let T = 1, I = 1, R, B;
  if (e.fromKeyboard)
    ({
      deltaX: R,
      deltaY: B
    } = e);
  else {
    const {
      screenX: W,
      screenY: q
    } = e, [K, z] = m(this, bh);
    [R, B] = this.screenToPageTranslation(W - K, q - z), m(this, bh)[0] = W, m(this, bh)[1] = q;
  }
  if ([R, B] = p(R / n, B / s), y) {
    const W = Math.hypot(o, l);
    T = I = Math.max(Math.min(Math.hypot(_[0] - w[0] - R, _[1] - w[1] - B) / W, 1 / o, 1 / l), c / o, h / l);
  } else v ? T = Gn(Math.abs(_[0] - w[0] - R), c, 1) / o : I = Gn(Math.abs(_[1] - w[1] - B), h, 1) / l;
  const L = _e._round(o * T), it = _e._round(l * I);
  x = f(...b(L, it));
  const O = k - x[0], at = S - x[1];
  m(this, Hs) || E(this, Hs, [this.x, this.y, this.width, this.height]), this.width = L, this.height = it, this.x = O, this.y = at, this.setDims(n * L, s * it), this.fixAndSetPosition(), this._onResizing();
}, ES = function() {
  var t;
  E(this, al, {
    savedX: this.x,
    savedY: this.y,
    savedWidth: this.width,
    savedHeight: this.height
  }), (t = m(this, ri)) == null || t.toggle(!1), this.parent.togglePointerEvents(!1);
}, DS = function(t, e, n) {
  let r = 0.7 * (n / e) + 1 - 0.7;
  if (r === 1)
    return;
  const a = D(this, se, $5).call(this, this.rotation), o = (k, S) => [a[0] * k + a[2] * S, a[1] * k + a[3] * S], [l, c] = this.parentDimensions, h = this.x, u = this.y, f = this.width, d = this.height, p = _e.MIN_SIZE / l, g = _e.MIN_SIZE / c;
  r = Math.max(Math.min(r, 1 / f, 1 / d), p / f, g / d);
  const b = _e._round(f * r), y = _e._round(d * r);
  if (b === f && y === d)
    return;
  m(this, Hs) || E(this, Hs, [h, u, f, d]);
  const v = o(f / 2, d / 2), w = _e._round(h + v[0]), _ = _e._round(u + v[1]), x = o(b / 2, y / 2);
  this.x = w - x[0], this.y = _ - x[1], this.width = b, this.height = y, this.setDims(l * b, c * y), this.fixAndSetPosition(), this._onResizing();
}, TS = function() {
  var t;
  (t = m(this, ri)) == null || t.toggle(!0), this.parent.togglePointerEvents(!0), D(this, se, q5).call(this);
}, O7 = function(t) {
  const {
    isMac: e
  } = gn.platform;
  t.ctrlKey && !e || t.shiftKey || t.metaKey && e ? this.parent.toggleSelected(this) : this.parent.setSelected(this);
}, FS = function(t) {
  const {
    isSelected: e
  } = this;
  this._uiManager.setUpDragSession();
  let n = !1;
  const s = new AbortController(), r = this._uiManager.combinedSignal(s), a = {
    capture: !0,
    passive: !1,
    signal: r
  }, o = (c) => {
    s.abort(), E(this, Dc, null), E(this, yh, !1), this._uiManager.endDragSession() || D(this, se, O7).call(this, c), n && this._onStopDragging();
  };
  e && (E(this, Wu, t.clientX), E(this, Xu, t.clientY), E(this, Dc, t.pointerId), E(this, Up, t.pointerType), window.addEventListener("pointermove", (c) => {
    n || (n = !0, this._onStartDragging());
    const {
      clientX: h,
      clientY: u,
      pointerId: f
    } = c;
    if (f !== m(this, Dc)) {
      Oi(c);
      return;
    }
    const [d, p] = this.screenToPageTranslation(h - m(this, Wu), u - m(this, Xu));
    E(this, Wu, h), E(this, Xu, u), this._uiManager.dragSelectedEditors(d, p);
  }, a), window.addEventListener("touchmove", Oi, a), window.addEventListener("pointerdown", (c) => {
    c.pointerType === m(this, Up) && (m(this, vh) || c.isPrimary) && o(c), Oi(c);
  }, a));
  const l = (c) => {
    if (!m(this, Dc) || m(this, Dc) === c.pointerId) {
      o(c);
      return;
    }
    Oi(c);
  };
  window.addEventListener("pointerup", l, {
    signal: r
  }), window.addEventListener("blur", l, {
    signal: r
  });
}, $7 = function() {
  if (m(this, Tc) || !this.div)
    return;
  E(this, Tc, new AbortController());
  const t = this._uiManager.combinedSignal(m(this, Tc));
  this.div.addEventListener("focusin", this.focusin.bind(this), {
    signal: t
  }), this.div.addEventListener("focusout", this.focusout.bind(this), {
    signal: t
  });
}, IS = function(t) {
  _e._resizerKeyboardManager.exec(this, t);
}, MS = function(t) {
  var e;
  m(this, ol) && ((e = t.relatedTarget) == null ? void 0 : e.parentNode) !== m(this, yn) && D(this, se, t2).call(this);
}, RS = function(t) {
  E(this, Hp, m(this, ol) ? t : "");
}, q7 = function(t) {
  if (m(this, ca))
    for (const e of m(this, ca))
      e.tabIndex = t;
}, t2 = function() {
  E(this, ol, !1), D(this, se, q7).call(this, -1), D(this, se, q5).call(this);
}, F(_e, Vp), ft(_e, "_l10n", null), ft(_e, "_l10nResizer", null), ft(_e, "_borderLineWidth", -1), ft(_e, "_colorManager", new E7()), ft(_e, "_zIndex", 1), ft(_e, "_telemetryTimeout", 1e3);
let si = _e;
class sM extends si {
  constructor(t) {
    super(t), this.annotationElementId = t.annotationElementId, this.deleted = !0;
  }
  serialize() {
    return this.serializeDeleted();
  }
}
const Sv = 3285377520, pr = 4294901760, qa = 65535;
let BS = class {
  constructor(t) {
    this.h1 = t ? t & 4294967295 : Sv, this.h2 = t ? t & 4294967295 : Sv;
  }
  update(t) {
    let e, n;
    if (typeof t == "string") {
      e = new Uint8Array(t.length * 2), n = 0;
      for (let g = 0, b = t.length; g < b; g++) {
        const y = t.charCodeAt(g);
        y <= 255 ? e[n++] = y : (e[n++] = y >>> 8, e[n++] = y & 255);
      }
    } else if (ArrayBuffer.isView(t))
      e = t.slice(), n = e.byteLength;
    else
      throw new Error("Invalid data format, must be a string or TypedArray.");
    const s = n >> 2, r = n - s * 4, a = new Uint32Array(e.buffer, 0, s);
    let o = 0, l = 0, c = this.h1, h = this.h2;
    const u = 3432918353, f = 461845907, d = u & qa, p = f & qa;
    for (let g = 0; g < s; g++)
      g & 1 ? (o = a[g], o = o * u & pr | o * d & qa, o = o << 15 | o >>> 17, o = o * f & pr | o * p & qa, c ^= o, c = c << 13 | c >>> 19, c = c * 5 + 3864292196) : (l = a[g], l = l * u & pr | l * d & qa, l = l << 15 | l >>> 17, l = l * f & pr | l * p & qa, h ^= l, h = h << 13 | h >>> 19, h = h * 5 + 3864292196);
    switch (o = 0, r) {
      case 3:
        o ^= e[s * 4 + 2] << 16;
      case 2:
        o ^= e[s * 4 + 1] << 8;
      case 1:
        o ^= e[s * 4], o = o * u & pr | o * d & qa, o = o << 15 | o >>> 17, o = o * f & pr | o * p & qa, s & 1 ? c ^= o : h ^= o;
    }
    this.h1 = c, this.h2 = h;
  }
  hexdigest() {
    let t = this.h1, e = this.h2;
    return t ^= e >>> 1, t = t * 3981806797 & pr | t * 36045 & qa, e = e * 4283543511 & pr | ((e << 16 | t >>> 16) * 2950163797 & pr) >>> 16, t ^= e >>> 1, t = t * 444984403 & pr | t * 60499 & qa, e = e * 3301882366 & pr | ((e << 16 | t >>> 16) * 3120437893 & pr) >>> 16, t ^= e >>> 1, (t >>> 0).toString(16).padStart(8, "0") + (e >>> 0).toString(16).padStart(8, "0");
  }
};
const z7 = Object.freeze({
  map: null,
  hash: "",
  transfer: void 0
});
var _h, xh, wn, Y3, PS;
class Ty {
  constructor() {
    F(this, Y3);
    F(this, _h, !1);
    F(this, xh, null);
    F(this, wn, /* @__PURE__ */ new Map());
    this.onSetModified = null, this.onResetModified = null, this.onAnnotationEditor = null;
  }
  getValue(t, e) {
    const n = m(this, wn).get(t);
    return n === void 0 ? e : Object.assign(e, n);
  }
  getRawValue(t) {
    return m(this, wn).get(t);
  }
  remove(t) {
    if (m(this, wn).delete(t), m(this, wn).size === 0 && this.resetModified(), typeof this.onAnnotationEditor == "function") {
      for (const e of m(this, wn).values())
        if (e instanceof si)
          return;
      this.onAnnotationEditor(null);
    }
  }
  setValue(t, e) {
    const n = m(this, wn).get(t);
    let s = !1;
    if (n !== void 0)
      for (const [r, a] of Object.entries(e))
        n[r] !== a && (s = !0, n[r] = a);
    else
      s = !0, m(this, wn).set(t, e);
    s && D(this, Y3, PS).call(this), e instanceof si && typeof this.onAnnotationEditor == "function" && this.onAnnotationEditor(e.constructor._type);
  }
  has(t) {
    return m(this, wn).has(t);
  }
  get size() {
    return m(this, wn).size;
  }
  resetModified() {
    m(this, _h) && (E(this, _h, !1), typeof this.onResetModified == "function" && this.onResetModified());
  }
  get print() {
    return new NS(this);
  }
  get serializable() {
    if (m(this, wn).size === 0)
      return z7;
    const t = /* @__PURE__ */ new Map(), e = new BS(), n = [], s = /* @__PURE__ */ Object.create(null);
    let r = !1;
    for (const [a, o] of m(this, wn)) {
      const l = o instanceof si ? o.serialize(!1, s) : o;
      l && (t.set(a, l), e.update(`${a}:${JSON.stringify(l)}`), r || (r = !!l.bitmap));
    }
    if (r)
      for (const a of t.values())
        a.bitmap && n.push(a.bitmap);
    return t.size > 0 ? {
      map: t,
      hash: e.hexdigest(),
      transfer: n
    } : z7;
  }
  get editorStats() {
    let t = null;
    const e = /* @__PURE__ */ new Map();
    for (const n of m(this, wn).values()) {
      if (!(n instanceof si))
        continue;
      const s = n.telemetryFinalData;
      if (!s)
        continue;
      const {
        type: r
      } = s;
      e.has(r) || e.set(r, Object.getPrototypeOf(n).constructor), t || (t = /* @__PURE__ */ Object.create(null));
      const a = t[r] || (t[r] = /* @__PURE__ */ new Map());
      for (const [o, l] of Object.entries(s)) {
        if (o === "type")
          continue;
        let c = a.get(o);
        c || (c = /* @__PURE__ */ new Map(), a.set(o, c));
        const h = c.get(l) ?? 0;
        c.set(l, h + 1);
      }
    }
    for (const [n, s] of e)
      t[n] = s.computeTelemetryFinalData(t[n]);
    return t;
  }
  resetModifiedIds() {
    E(this, xh, null);
  }
  get modifiedIds() {
    if (m(this, xh))
      return m(this, xh);
    const t = [];
    for (const e of m(this, wn).values())
      !(e instanceof si) || !e.annotationElementId || !e.serialize() || t.push(e.annotationElementId);
    return E(this, xh, {
      ids: new Set(t),
      hash: t.join(",")
    });
  }
  [Symbol.iterator]() {
    return m(this, wn).entries();
  }
}
_h = new WeakMap(), xh = new WeakMap(), wn = new WeakMap(), Y3 = new WeakSet(), PS = function() {
  m(this, _h) || (E(this, _h, !0), typeof this.onSetModified == "function" && this.onSetModified());
};
var Wp;
class NS extends Ty {
  constructor(e) {
    super();
    F(this, Wp);
    const {
      map: n,
      hash: s,
      transfer: r
    } = e.serializable, a = structuredClone(n, r ? {
      transfer: r
    } : null);
    E(this, Wp, {
      map: a,
      hash: s,
      transfer: r
    });
  }
  get print() {
    Ze("Should not call PrintAnnotationStorage.print");
  }
  get serializable() {
    return m(this, Wp);
  }
  get modifiedIds() {
    return Fe(this, "modifiedIds", {
      ids: /* @__PURE__ */ new Set(),
      hash: ""
    });
  }
}
Wp = new WeakMap();
var Yu;
class rM {
  constructor({
    ownerDocument: t = globalThis.document,
    styleElement: e = null
  }) {
    F(this, Yu, /* @__PURE__ */ new Set());
    this._document = t, this.nativeFontFaces = /* @__PURE__ */ new Set(), this.styleElement = null, this.loadingRequests = [], this.loadTestFontId = 0;
  }
  addNativeFontFace(t) {
    this.nativeFontFaces.add(t), this._document.fonts.add(t);
  }
  removeNativeFontFace(t) {
    this.nativeFontFaces.delete(t), this._document.fonts.delete(t);
  }
  insertRule(t) {
    this.styleElement || (this.styleElement = this._document.createElement("style"), this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));
    const e = this.styleElement.sheet;
    e.insertRule(t, e.cssRules.length);
  }
  clear() {
    for (const t of this.nativeFontFaces)
      this._document.fonts.delete(t);
    this.nativeFontFaces.clear(), m(this, Yu).clear(), this.styleElement && (this.styleElement.remove(), this.styleElement = null);
  }
  async loadSystemFont({
    systemFontInfo: t,
    disableFontFace: e,
    _inspectFont: n
  }) {
    if (!(!t || m(this, Yu).has(t.loadedName))) {
      if (Vi(!e, "loadSystemFont shouldn't be called when `disableFontFace` is set."), this.isFontLoadingAPISupported) {
        const {
          loadedName: s,
          src: r,
          style: a
        } = t, o = new FontFace(s, r, a);
        this.addNativeFontFace(o);
        try {
          await o.load(), m(this, Yu).add(s), n == null || n(t);
        } catch {
          me(`Cannot load system font: ${t.baseFontName}, installing it could help to improve PDF rendering.`), this.removeNativeFontFace(o);
        }
        return;
      }
      Ze("Not implemented: loadSystemFont without the Font Loading API.");
    }
  }
  async bind(t) {
    if (t.attached || t.missingFile && !t.systemFontInfo)
      return;
    if (t.attached = !0, t.systemFontInfo) {
      await this.loadSystemFont(t);
      return;
    }
    if (this.isFontLoadingAPISupported) {
      const n = t.createNativeFontFace();
      if (n) {
        this.addNativeFontFace(n);
        try {
          await n.loaded;
        } catch (s) {
          throw me(`Failed to load font '${n.family}': '${s}'.`), t.disableFontFace = !0, s;
        }
      }
      return;
    }
    const e = t.createFontFaceRule();
    if (e) {
      if (this.insertRule(e), this.isSyncFontLoadingSupported)
        return;
      await new Promise((n) => {
        const s = this._queueLoadingCallback(n);
        this._prepareFontLoadEvent(t, s);
      });
    }
  }
  get isFontLoadingAPISupported() {
    var e;
    const t = !!((e = this._document) != null && e.fonts);
    return Fe(this, "isFontLoadingAPISupported", t);
  }
  get isSyncFontLoadingSupported() {
    return Fe(this, "isSyncFontLoadingSupported", os || gn.platform.isFirefox);
  }
  _queueLoadingCallback(t) {
    function e() {
      for (Vi(!s.done, "completeRequest() cannot be called twice."), s.done = !0; n.length > 0 && n[0].done; ) {
        const r = n.shift();
        setTimeout(r.callback, 0);
      }
    }
    const {
      loadingRequests: n
    } = this, s = {
      done: !1,
      complete: e,
      callback: t
    };
    return n.push(s), s;
  }
  get _loadTestFont() {
    const t = atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");
    return Fe(this, "_loadTestFont", t);
  }
  _prepareFontLoadEvent(t, e) {
    function n(_, x) {
      return _.charCodeAt(x) << 24 | _.charCodeAt(x + 1) << 16 | _.charCodeAt(x + 2) << 8 | _.charCodeAt(x + 3) & 255;
    }
    function s(_, x, k, S) {
      const T = _.substring(0, x), I = _.substring(x + k);
      return T + S + I;
    }
    let r, a;
    const o = this._document.createElement("canvas");
    o.width = 1, o.height = 1;
    const l = o.getContext("2d");
    let c = 0;
    function h(_, x) {
      if (++c > 30) {
        me("Load test font never loaded."), x();
        return;
      }
      if (l.font = "30px " + _, l.fillText(".", 0, 20), l.getImageData(0, 0, 1, 1).data[3] > 0) {
        x();
        return;
      }
      setTimeout(h.bind(null, _, x));
    }
    const u = `lt${Date.now()}${this.loadTestFontId++}`;
    let f = this._loadTestFont;
    f = s(f, 976, u.length, u);
    const p = 16, g = 1482184792;
    let b = n(f, p);
    for (r = 0, a = u.length - 3; r < a; r += 4)
      b = b - g + n(u, r) | 0;
    r < u.length && (b = b - g + n(u + "XXX", r) | 0), f = s(f, p, 4, WI(b));
    const y = `url(data:font/opentype;base64,${btoa(f)});`, v = `@font-face {font-family:"${u}";src:${y}}`;
    this.insertRule(v);
    const w = this._document.createElement("div");
    w.style.visibility = "hidden", w.style.width = w.style.height = "10px", w.style.position = "absolute", w.style.top = w.style.left = "0px";
    for (const _ of [t.loadedName, u]) {
      const x = this._document.createElement("span");
      x.textContent = "Hi", x.style.fontFamily = _, w.append(x);
    }
    this._document.body.append(w), h(u, () => {
      w.remove(), e.complete();
    });
  }
}
Yu = new WeakMap();
class aM {
  constructor(t, e = null) {
    this.compiledGlyphs = /* @__PURE__ */ Object.create(null);
    for (const n in t)
      this[n] = t[n];
    this._inspectFont = e;
  }
  createNativeFontFace() {
    var e;
    if (!this.data || this.disableFontFace)
      return null;
    let t;
    if (!this.cssFontInfo)
      t = new FontFace(this.loadedName, this.data, {});
    else {
      const n = {
        weight: this.cssFontInfo.fontWeight
      };
      this.cssFontInfo.italicAngle && (n.style = `oblique ${this.cssFontInfo.italicAngle}deg`), t = new FontFace(this.cssFontInfo.fontFamily, this.data, n);
    }
    return (e = this._inspectFont) == null || e.call(this, this), t;
  }
  createFontFaceRule() {
    var n;
    if (!this.data || this.disableFontFace)
      return null;
    const t = `url(data:${this.mimetype};base64,${QA(this.data)});`;
    let e;
    if (!this.cssFontInfo)
      e = `@font-face {font-family:"${this.loadedName}";src:${t}}`;
    else {
      let s = `font-weight: ${this.cssFontInfo.fontWeight};`;
      this.cssFontInfo.italicAngle && (s += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`), e = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${s}src:${t}}`;
    }
    return (n = this._inspectFont) == null || n.call(this, this, t), e;
  }
  getPathGenerator(t, e) {
    if (this.compiledGlyphs[e] !== void 0)
      return this.compiledGlyphs[e];
    const n = this.loadedName + "_path_" + e;
    let s;
    try {
      s = t.get(n);
    } catch (a) {
      me(`getPathGenerator - ignoring character: "${a}".`);
    }
    const r = new Path2D(s || "");
    return this.fontExtraProperties || t.delete(n), this.compiledGlyphs[e] = r;
  }
}
function oM(i) {
  if (i instanceof URL)
    return i.href;
  if (typeof i == "string") {
    if (os)
      return i;
    const t = URL.parse(i, window.location);
    if (t)
      return t.href;
  }
  throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
}
function lM(i) {
  if (os && typeof Buffer < "u" && i instanceof Buffer)
    throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
  if (i instanceof Uint8Array && i.byteLength === i.buffer.byteLength)
    return i;
  if (typeof i == "string")
    return mg(i);
  if (i instanceof ArrayBuffer || ArrayBuffer.isView(i) || typeof i == "object" && !isNaN(i == null ? void 0 : i.length))
    return new Uint8Array(i);
  throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");
}
function zg(i) {
  if (typeof i != "string")
    return null;
  if (i.endsWith("/"))
    return i;
  throw new Error(`Invalid factory url: "${i}" must include trailing slash.`);
}
const U7 = (i) => typeof i == "object" && Number.isInteger(i == null ? void 0 : i.num) && i.num >= 0 && Number.isInteger(i == null ? void 0 : i.gen) && i.gen >= 0, cM = (i) => typeof i == "object" && typeof (i == null ? void 0 : i.name) == "string", LS = ZI.bind(null, U7, cM);
var ll, K3;
class hM {
  constructor() {
    F(this, ll, /* @__PURE__ */ new Map());
    F(this, K3, Promise.resolve());
  }
  postMessage(t, e) {
    const n = {
      data: structuredClone(t, e ? {
        transfer: e
      } : null)
    };
    m(this, K3).then(() => {
      for (const [s] of m(this, ll))
        s.call(this, n);
    });
  }
  addEventListener(t, e, n = null) {
    let s = null;
    if ((n == null ? void 0 : n.signal) instanceof AbortSignal) {
      const {
        signal: r
      } = n;
      if (r.aborted) {
        me("LoopbackPort - cannot use an `aborted` signal.");
        return;
      }
      const a = () => this.removeEventListener(t, e);
      s = () => r.removeEventListener("abort", a), r.addEventListener("abort", a);
    }
    m(this, ll).set(e, s);
  }
  removeEventListener(t, e) {
    const n = m(this, ll).get(e);
    n == null || n(), m(this, ll).delete(e);
  }
  terminate() {
    for (const [, t] of m(this, ll))
      t == null || t();
    m(this, ll).clear();
  }
}
ll = new WeakMap(), K3 = new WeakMap();
const Ug = {
  DATA: 1,
  ERROR: 2
}, Gi = {
  CANCEL: 1,
  CANCEL_COMPLETE: 2,
  CLOSE: 3,
  ENQUEUE: 4,
  ERROR: 5,
  PULL: 6,
  PULL_COMPLETE: 7,
  START_COMPLETE: 8
};
function Cv() {
}
function xs(i) {
  if (i instanceof Hl || i instanceof N9 || i instanceof xv || i instanceof K2 || i instanceof o6)
    return i;
  switch (i instanceof Error || typeof i == "object" && i !== null || Ze('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), i.name) {
    case "AbortException":
      return new Hl(i.message);
    case "InvalidPDFException":
      return new N9(i.message);
    case "PasswordException":
      return new xv(i.message, i.code);
    case "ResponseException":
      return new K2(i.message, i.status, i.missing);
    case "UnknownErrorException":
      return new o6(i.message, i.details);
  }
  return new o6(i.message, i.toString());
}
var Ku, Hr, OS, $S, qS, z5, WA;
let e2 = (WA = class {
  constructor(t, e, n) {
    F(this, Hr);
    F(this, Ku, new AbortController());
    this.sourceName = t, this.targetName = e, this.comObj = n, 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), n.addEventListener("message", D(this, Hr, OS).bind(this), {
      signal: m(this, Ku).signal
    });
  }
  on(t, e) {
    const n = this.actionHandler;
    if (n[t])
      throw new Error(`There is already an actionName called "${t}"`);
    n[t] = e;
  }
  send(t, e, n) {
    this.comObj.postMessage({
      sourceName: this.sourceName,
      targetName: this.targetName,
      action: t,
      data: e
    }, n);
  }
  sendWithPromise(t, e, n) {
    const s = this.callbackId++, r = Promise.withResolvers();
    this.callbackCapabilities[s] = r;
    try {
      this.comObj.postMessage({
        sourceName: this.sourceName,
        targetName: this.targetName,
        action: t,
        callbackId: s,
        data: e
      }, n);
    } catch (a) {
      r.reject(a);
    }
    return r.promise;
  }
  sendWithStream(t, e, n, s) {
    const r = this.streamId++, a = this.sourceName, o = this.targetName, l = this.comObj;
    return new ReadableStream({
      start: (c) => {
        const h = Promise.withResolvers();
        return this.streamControllers[r] = {
          controller: c,
          startCall: h,
          pullCall: null,
          cancelCall: null,
          isClosed: !1
        }, l.postMessage({
          sourceName: a,
          targetName: o,
          action: t,
          streamId: r,
          data: e,
          desiredSize: c.desiredSize
        }, s), h.promise;
      },
      pull: (c) => {
        const h = Promise.withResolvers();
        return this.streamControllers[r].pullCall = h, l.postMessage({
          sourceName: a,
          targetName: o,
          stream: Gi.PULL,
          streamId: r,
          desiredSize: c.desiredSize
        }), h.promise;
      },
      cancel: (c) => {
        Vi(c instanceof Error, "cancel must have a valid reason");
        const h = Promise.withResolvers();
        return this.streamControllers[r].cancelCall = h, this.streamControllers[r].isClosed = !0, l.postMessage({
          sourceName: a,
          targetName: o,
          stream: Gi.CANCEL,
          streamId: r,
          reason: xs(c)
        }), h.promise;
      }
    }, n);
  }
  destroy() {
    var t;
    (t = m(this, Ku)) == null || t.abort(), E(this, Ku, null);
  }
}, Ku = new WeakMap(), Hr = new WeakSet(), OS = function({
  data: t
}) {
  if (t.targetName !== this.sourceName)
    return;
  if (t.stream) {
    D(this, Hr, qS).call(this, t);
    return;
  }
  if (t.callback) {
    const n = t.callbackId, s = this.callbackCapabilities[n];
    if (!s)
      throw new Error(`Cannot resolve callback ${n}`);
    if (delete this.callbackCapabilities[n], t.callback === Ug.DATA)
      s.resolve(t.data);
    else if (t.callback === Ug.ERROR)
      s.reject(xs(t.reason));
    else
      throw new Error("Unexpected callback case");
    return;
  }
  const e = this.actionHandler[t.action];
  if (!e)
    throw new Error(`Unknown action from worker: ${t.action}`);
  if (t.callbackId) {
    const n = this.sourceName, s = t.sourceName, r = this.comObj;
    Promise.try(e, t.data).then(function(a) {
      r.postMessage({
        sourceName: n,
        targetName: s,
        callback: Ug.DATA,
        callbackId: t.callbackId,
        data: a
      });
    }, function(a) {
      r.postMessage({
        sourceName: n,
        targetName: s,
        callback: Ug.ERROR,
        callbackId: t.callbackId,
        reason: xs(a)
      });
    });
    return;
  }
  if (t.streamId) {
    D(this, Hr, $S).call(this, t);
    return;
  }
  e(t.data);
}, $S = function(t) {
  const e = t.streamId, n = this.sourceName, s = t.sourceName, r = this.comObj, a = this, o = this.actionHandler[t.action], l = {
    enqueue(c, h = 1, u) {
      if (this.isCancelled)
        return;
      const f = this.desiredSize;
      this.desiredSize -= h, f > 0 && this.desiredSize <= 0 && (this.sinkCapability = Promise.withResolvers(), this.ready = this.sinkCapability.promise), r.postMessage({
        sourceName: n,
        targetName: s,
        stream: Gi.ENQUEUE,
        streamId: e,
        chunk: c
      }, u);
    },
    close() {
      this.isCancelled || (this.isCancelled = !0, r.postMessage({
        sourceName: n,
        targetName: s,
        stream: Gi.CLOSE,
        streamId: e
      }), delete a.streamSinks[e]);
    },
    error(c) {
      Vi(c instanceof Error, "error must have a valid reason"), !this.isCancelled && (this.isCancelled = !0, r.postMessage({
        sourceName: n,
        targetName: s,
        stream: Gi.ERROR,
        streamId: e,
        reason: xs(c)
      }));
    },
    sinkCapability: Promise.withResolvers(),
    onPull: null,
    onCancel: null,
    isCancelled: !1,
    desiredSize: t.desiredSize,
    ready: null
  };
  l.sinkCapability.resolve(), l.ready = l.sinkCapability.promise, this.streamSinks[e] = l, Promise.try(o, t.data, l).then(function() {
    r.postMessage({
      sourceName: n,
      targetName: s,
      stream: Gi.START_COMPLETE,
      streamId: e,
      success: !0
    });
  }, function(c) {
    r.postMessage({
      sourceName: n,
      targetName: s,
      stream: Gi.START_COMPLETE,
      streamId: e,
      reason: xs(c)
    });
  });
}, qS = function(t) {
  const e = t.streamId, n = this.sourceName, s = t.sourceName, r = this.comObj, a = this.streamControllers[e], o = this.streamSinks[e];
  switch (t.stream) {
    case Gi.START_COMPLETE:
      t.success ? a.startCall.resolve() : a.startCall.reject(xs(t.reason));
      break;
    case Gi.PULL_COMPLETE:
      t.success ? a.pullCall.resolve() : a.pullCall.reject(xs(t.reason));
      break;
    case Gi.PULL:
      if (!o) {
        r.postMessage({
          sourceName: n,
          targetName: s,
          stream: Gi.PULL_COMPLETE,
          streamId: e,
          success: !0
        });
        break;
      }
      o.desiredSize <= 0 && t.desiredSize > 0 && o.sinkCapability.resolve(), o.desiredSize = t.desiredSize, Promise.try(o.onPull || Cv).then(function() {
        r.postMessage({
          sourceName: n,
          targetName: s,
          stream: Gi.PULL_COMPLETE,
          streamId: e,
          success: !0
        });
      }, function(c) {
        r.postMessage({
          sourceName: n,
          targetName: s,
          stream: Gi.PULL_COMPLETE,
          streamId: e,
          reason: xs(c)
        });
      });
      break;
    case Gi.ENQUEUE:
      if (Vi(a, "enqueue should have stream controller"), a.isClosed)
        break;
      a.controller.enqueue(t.chunk);
      break;
    case Gi.CLOSE:
      if (Vi(a, "close should have stream controller"), a.isClosed)
        break;
      a.isClosed = !0, a.controller.close(), D(this, Hr, z5).call(this, a, e);
      break;
    case Gi.ERROR:
      Vi(a, "error should have stream controller"), a.controller.error(xs(t.reason)), D(this, Hr, z5).call(this, a, e);
      break;
    case Gi.CANCEL_COMPLETE:
      t.success ? a.cancelCall.resolve() : a.cancelCall.reject(xs(t.reason)), D(this, Hr, z5).call(this, a, e);
      break;
    case Gi.CANCEL:
      if (!o)
        break;
      const l = xs(t.reason);
      Promise.try(o.onCancel || Cv, l).then(function() {
        r.postMessage({
          sourceName: n,
          targetName: s,
          stream: Gi.CANCEL_COMPLETE,
          streamId: e,
          success: !0
        });
      }, function(c) {
        r.postMessage({
          sourceName: n,
          targetName: s,
          stream: Gi.CANCEL_COMPLETE,
          streamId: e,
          reason: xs(c)
        });
      }), o.sinkCapability.reject(l), o.isCancelled = !0, delete this.streamSinks[e];
      break;
    default:
      throw new Error("Unexpected stream case");
  }
}, z5 = async function(t, e) {
  var n, s, r;
  await Promise.allSettled([(n = t.startCall) == null ? void 0 : n.promise, (s = t.pullCall) == null ? void 0 : s.promise, (r = t.cancelCall) == null ? void 0 : r.promise]), delete this.streamControllers[e];
}, WA);
var Xp;
class zS {
  constructor({
    enableHWA: t = !1
  }) {
    F(this, Xp, !1);
    E(this, Xp, t);
  }
  create(t, e) {
    if (t <= 0 || e <= 0)
      throw new Error("Invalid canvas size");
    const n = this._createCanvas(t, e);
    return {
      canvas: n,
      context: n.getContext("2d", {
        willReadFrequently: !m(this, Xp)
      })
    };
  }
  reset(t, e, n) {
    if (!t.canvas)
      throw new Error("Canvas is not specified");
    if (e <= 0 || n <= 0)
      throw new Error("Invalid canvas size");
    t.canvas.width = e, t.canvas.height = n;
  }
  destroy(t) {
    if (!t.canvas)
      throw new Error("Canvas is not specified");
    t.canvas.width = 0, t.canvas.height = 0, t.canvas = null, t.context = null;
  }
  _createCanvas(t, e) {
    Ze("Abstract method `_createCanvas` called.");
  }
}
Xp = new WeakMap();
class uM extends zS {
  constructor({
    ownerDocument: t = globalThis.document,
    enableHWA: e = !1
  }) {
    super({
      enableHWA: e
    }), this._document = t;
  }
  _createCanvas(t, e) {
    const n = this._document.createElement("canvas");
    return n.width = t, n.height = e, n;
  }
}
class US {
  constructor({
    baseUrl: t = null,
    isCompressed: e = !0
  }) {
    this.baseUrl = t, this.isCompressed = e;
  }
  async fetch({
    name: t
  }) {
    if (!this.baseUrl)
      throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");
    if (!t)
      throw new Error("CMap name must be specified.");
    const e = this.baseUrl + t + (this.isCompressed ? ".bcmap" : "");
    return this._fetch(e).then((n) => ({
      cMapData: n,
      isCompressed: this.isCompressed
    })).catch((n) => {
      throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${e}`);
    });
  }
  async _fetch(t) {
    Ze("Abstract method `_fetch` called.");
  }
}
class Ev extends US {
  async _fetch(t) {
    const e = await ff(t, this.isCompressed ? "arraybuffer" : "text");
    return e instanceof ArrayBuffer ? new Uint8Array(e) : mg(e);
  }
}
class HS {
  addFilter(t) {
    return "none";
  }
  addHCMFilter(t, e) {
    return "none";
  }
  addAlphaFilter(t) {
    return "none";
  }
  addLuminosityFilter(t) {
    return "none";
  }
  addHighlightHCMFilter(t, e, n, s, r) {
    return "none";
  }
  destroy(t = !1) {
  }
}
var kh, Zu, cl, hl, Un, Ah, Sh, Ut, $n, i2, J1, U5, Q1, jS, H7, tu, n2, s2, j7, r2;
class dM extends HS {
  constructor({
    docId: e,
    ownerDocument: n = globalThis.document
  }) {
    super();
    F(this, Ut);
    F(this, kh);
    F(this, Zu);
    F(this, cl);
    F(this, hl);
    F(this, Un);
    F(this, Ah);
    F(this, Sh, 0);
    E(this, hl, e), E(this, Un, n);
  }
  addFilter(e) {
    if (!e)
      return "none";
    let n = m(this, Ut, $n).get(e);
    if (n)
      return n;
    const [s, r, a] = D(this, Ut, U5).call(this, e), o = e.length === 1 ? s : `${s}${r}${a}`;
    if (n = m(this, Ut, $n).get(o), n)
      return m(this, Ut, $n).set(e, n), n;
    const l = `g_${m(this, hl)}_transfer_map_${Zn(this, Sh)._++}`, c = D(this, Ut, Q1).call(this, l);
    m(this, Ut, $n).set(e, c), m(this, Ut, $n).set(o, c);
    const h = D(this, Ut, tu).call(this, l);
    return D(this, Ut, s2).call(this, s, r, a, h), c;
  }
  addHCMFilter(e, n) {
    var p;
    const s = `${e}-${n}`, r = "base";
    let a = m(this, Ut, i2).get(r);
    if ((a == null ? void 0 : a.key) === s || (a ? ((p = a.filter) == null || p.remove(), a.key = s, a.url = "none", a.filter = null) : (a = {
      key: s,
      url: "none",
      filter: null
    }, m(this, Ut, i2).set(r, a)), !e || !n))
      return a.url;
    const o = D(this, Ut, r2).call(this, e);
    e = Zt.makeHexColor(...o);
    const l = D(this, Ut, r2).call(this, n);
    if (n = Zt.makeHexColor(...l), m(this, Ut, J1).style.color = "", e === "#000000" && n === "#ffffff" || e === n)
      return a.url;
    const c = new Array(256);
    for (let g = 0; g <= 255; g++) {
      const b = g / 255;
      c[g] = b <= 0.03928 ? b / 12.92 : ((b + 0.055) / 1.055) ** 2.4;
    }
    const h = c.join(","), u = `g_${m(this, hl)}_hcm_filter`, f = a.filter = D(this, Ut, tu).call(this, u);
    D(this, Ut, s2).call(this, h, h, h, f), D(this, Ut, H7).call(this, f);
    const d = (g, b) => {
      const y = o[g] / 255, v = l[g] / 255, w = new Array(b + 1);
      for (let _ = 0; _ <= b; _++)
        w[_] = y + _ / b * (v - y);
      return w.join(",");
    };
    return D(this, Ut, s2).call(this, d(0, 5), d(1, 5), d(2, 5), f), a.url = D(this, Ut, Q1).call(this, u), a.url;
  }
  addAlphaFilter(e) {
    let n = m(this, Ut, $n).get(e);
    if (n)
      return n;
    const [s] = D(this, Ut, U5).call(this, [e]), r = `alpha_${s}`;
    if (n = m(this, Ut, $n).get(r), n)
      return m(this, Ut, $n).set(e, n), n;
    const a = `g_${m(this, hl)}_alpha_map_${Zn(this, Sh)._++}`, o = D(this, Ut, Q1).call(this, a);
    m(this, Ut, $n).set(e, o), m(this, Ut, $n).set(r, o);
    const l = D(this, Ut, tu).call(this, a);
    return D(this, Ut, j7).call(this, s, l), o;
  }
  addLuminosityFilter(e) {
    let n = m(this, Ut, $n).get(e || "luminosity");
    if (n)
      return n;
    let s, r;
    if (e ? ([s] = D(this, Ut, U5).call(this, [e]), r = `luminosity_${s}`) : r = "luminosity", n = m(this, Ut, $n).get(r), n)
      return m(this, Ut, $n).set(e, n), n;
    const a = `g_${m(this, hl)}_luminosity_map_${Zn(this, Sh)._++}`, o = D(this, Ut, Q1).call(this, a);
    m(this, Ut, $n).set(e, o), m(this, Ut, $n).set(r, o);
    const l = D(this, Ut, tu).call(this, a);
    return D(this, Ut, jS).call(this, l), e && D(this, Ut, j7).call(this, s, l), o;
  }
  addHighlightHCMFilter(e, n, s, r, a) {
    var v;
    const o = `${n}-${s}-${r}-${a}`;
    let l = m(this, Ut, i2).get(e);
    if ((l == null ? void 0 : l.key) === o || (l ? ((v = l.filter) == null || v.remove(), l.key = o, l.url = "none", l.filter = null) : (l = {
      key: o,
      url: "none",
      filter: null
    }, m(this, Ut, i2).set(e, l)), !n || !s))
      return l.url;
    const [c, h] = [n, s].map(D(this, Ut, r2).bind(this));
    let u = Math.round(0.2126 * c[0] + 0.7152 * c[1] + 0.0722 * c[2]), f = Math.round(0.2126 * h[0] + 0.7152 * h[1] + 0.0722 * h[2]), [d, p] = [r, a].map(D(this, Ut, r2).bind(this));
    f < u && ([u, f, d, p] = [f, u, p, d]), m(this, Ut, J1).style.color = "";
    const g = (w, _, x) => {
      const k = new Array(256), S = (f - u) / x, T = w / 255, I = (_ - w) / (255 * x);
      let R = 0;
      for (let B = 0; B <= x; B++) {
        const L = Math.round(u + B * S), it = T + B * I;
        for (let O = R; O <= L; O++)
          k[O] = it;
        R = L + 1;
      }
      for (let B = R; B < 256; B++)
        k[B] = k[R - 1];
      return k.join(",");
    }, b = `g_${m(this, hl)}_hcm_${e}_filter`, y = l.filter = D(this, Ut, tu).call(this, b);
    return D(this, Ut, H7).call(this, y), D(this, Ut, s2).call(this, g(d[0], p[0], 5), g(d[1], p[1], 5), g(d[2], p[2], 5), y), l.url = D(this, Ut, Q1).call(this, b), l.url;
  }
  destroy(e = !1) {
    var n, s, r, a;
    e && ((n = m(this, Ah)) != null && n.size) || ((s = m(this, cl)) == null || s.parentNode.parentNode.remove(), E(this, cl, null), (r = m(this, Zu)) == null || r.clear(), E(this, Zu, null), (a = m(this, Ah)) == null || a.clear(), E(this, Ah, null), E(this, Sh, 0));
  }
}
kh = new WeakMap(), Zu = new WeakMap(), cl = new WeakMap(), hl = new WeakMap(), Un = new WeakMap(), Ah = new WeakMap(), Sh = new WeakMap(), Ut = new WeakSet(), $n = function() {
  return m(this, Zu) || E(this, Zu, /* @__PURE__ */ new Map());
}, i2 = function() {
  return m(this, Ah) || E(this, Ah, /* @__PURE__ */ new Map());
}, J1 = function() {
  if (!m(this, cl)) {
    const e = m(this, Un).createElement("div"), {
      style: n
    } = e;
    n.visibility = "hidden", n.contain = "strict", n.width = n.height = 0, n.position = "absolute", n.top = n.left = 0, n.zIndex = -1;
    const s = m(this, Un).createElementNS(Uo, "svg");
    s.setAttribute("width", 0), s.setAttribute("height", 0), E(this, cl, m(this, Un).createElementNS(Uo, "defs")), e.append(s), s.append(m(this, cl)), m(this, Un).body.append(e);
  }
  return m(this, cl);
}, U5 = function(e) {
  if (e.length === 1) {
    const c = e[0], h = new Array(256);
    for (let f = 0; f < 256; f++)
      h[f] = c[f] / 255;
    const u = h.join(",");
    return [u, u, u];
  }
  const [n, s, r] = e, a = new Array(256), o = new Array(256), l = new Array(256);
  for (let c = 0; c < 256; c++)
    a[c] = n[c] / 255, o[c] = s[c] / 255, l[c] = r[c] / 255;
  return [a.join(","), o.join(","), l.join(",")];
}, Q1 = function(e) {
  if (m(this, kh) === void 0) {
    E(this, kh, "");
    const n = m(this, Un).URL;
    n !== m(this, Un).baseURI && (bg(n) ? me('#createUrl: ignore "data:"-URL for performance reasons.') : E(this, kh, Sy(n, "")));
  }
  return `url(${m(this, kh)}#${e})`;
}, jS = function(e) {
  const n = m(this, Un).createElementNS(Uo, "feColorMatrix");
  n.setAttribute("type", "matrix"), n.setAttribute("values", "0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"), e.append(n);
}, H7 = function(e) {
  const n = m(this, Un).createElementNS(Uo, "feColorMatrix");
  n.setAttribute("type", "matrix"), n.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"), e.append(n);
}, tu = function(e) {
  const n = m(this, Un).createElementNS(Uo, "filter");
  return n.setAttribute("color-interpolation-filters", "sRGB"), n.setAttribute("id", e), m(this, Ut, J1).append(n), n;
}, n2 = function(e, n, s) {
  const r = m(this, Un).createElementNS(Uo, n);
  r.setAttribute("type", "discrete"), r.setAttribute("tableValues", s), e.append(r);
}, s2 = function(e, n, s, r) {
  const a = m(this, Un).createElementNS(Uo, "feComponentTransfer");
  r.append(a), D(this, Ut, n2).call(this, a, "feFuncR", e), D(this, Ut, n2).call(this, a, "feFuncG", n), D(this, Ut, n2).call(this, a, "feFuncB", s);
}, j7 = function(e, n) {
  const s = m(this, Un).createElementNS(Uo, "feComponentTransfer");
  n.append(s), D(this, Ut, n2).call(this, s, "feFuncA", e);
}, r2 = function(e) {
  return m(this, Ut, J1).style.color = e, Dy(getComputedStyle(m(this, Ut, J1)).getPropertyValue("color"));
};
class GS {
  constructor({
    baseUrl: t = null
  }) {
    this.baseUrl = t;
  }
  async fetch({
    filename: t
  }) {
    if (!this.baseUrl)
      throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");
    if (!t)
      throw new Error("Font filename must be specified.");
    const e = `${this.baseUrl}${t}`;
    return this._fetch(e).catch((n) => {
      throw new Error(`Unable to load font data at: ${e}`);
    });
  }
  async _fetch(t) {
    Ze("Abstract method `_fetch` called.");
  }
}
class Dv extends GS {
  async _fetch(t) {
    const e = await ff(t, "arraybuffer");
    return new Uint8Array(e);
  }
}
class VS {
  constructor({
    baseUrl: t = null
  }) {
    this.baseUrl = t;
  }
  async fetch({
    filename: t
  }) {
    if (!this.baseUrl)
      throw new Error("Ensure that the `wasmUrl` API parameter is provided.");
    if (!t)
      throw new Error("Wasm filename must be specified.");
    const e = `${this.baseUrl}${t}`;
    return this._fetch(e).catch((n) => {
      throw new Error(`Unable to load wasm data at: ${e}`);
    });
  }
  async _fetch(t) {
    Ze("Abstract method `_fetch` called.");
  }
}
class Tv extends VS {
  async _fetch(t) {
    const e = await ff(t, "arraybuffer");
    return new Uint8Array(e);
  }
}
os && me("Please use the `legacy` build in Node.js environments.");
async function Fy(i) {
  const e = await process.getBuiltinModule("fs").promises.readFile(i);
  return new Uint8Array(e);
}
class fM extends HS {
}
class pM extends zS {
  _createCanvas(t, e) {
    return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(t, e);
  }
}
class mM extends US {
  async _fetch(t) {
    return Fy(t);
  }
}
class gM extends GS {
  async _fetch(t) {
    return Fy(t);
  }
}
class bM extends VS {
  async _fetch(t) {
    return Fy(t);
  }
}
const Sn = {
  FILL: "Fill",
  STROKE: "Stroke",
  SHADING: "Shading"
};
function G7(i, t) {
  if (!t)
    return;
  const e = t[2] - t[0], n = t[3] - t[1], s = new Path2D();
  s.rect(t[0], t[1], e, n), i.clip(s);
}
class Iy {
  isModifyingCurrentTransform() {
    return !1;
  }
  getPattern() {
    Ze("Abstract method `getPattern` called.");
  }
}
class yM extends Iy {
  constructor(t) {
    super(), this._type = t[1], this._bbox = t[2], this._colorStops = t[3], this._p0 = t[4], this._p1 = t[5], this._r0 = t[6], this._r1 = t[7], this.matrix = null;
  }
  _createGradient(t) {
    let e;
    this._type === "axial" ? e = t.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]) : this._type === "radial" && (e = t.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1));
    for (const n of this._colorStops)
      e.addColorStop(n[0], n[1]);
    return e;
  }
  getPattern(t, e, n, s) {
    let r;
    if (s === Sn.STROKE || s === Sn.FILL) {
      const a = e.current.getClippedPathBoundingBox(s, _i(t)) || [0, 0, 0, 0], o = Math.ceil(a[2] - a[0]) || 1, l = Math.ceil(a[3] - a[1]) || 1, c = e.cachedCanvases.getCanvas("pattern", o, l), h = c.context;
      h.clearRect(0, 0, h.canvas.width, h.canvas.height), h.beginPath(), h.rect(0, 0, h.canvas.width, h.canvas.height), h.translate(-a[0], -a[1]), n = Zt.transform(n, [1, 0, 0, 1, a[0], a[1]]), h.transform(...e.baseTransform), this.matrix && h.transform(...this.matrix), G7(h, this._bbox), h.fillStyle = this._createGradient(h), h.fill(), r = t.createPattern(c.canvas, "no-repeat");
      const u = new DOMMatrix(n);
      r.setTransform(u);
    } else
      G7(t, this._bbox), r = this._createGradient(t);
    return r;
  }
}
function h6(i, t, e, n, s, r, a, o) {
  const l = t.coords, c = t.colors, h = i.data, u = i.width * 4;
  let f;
  l[e + 1] > l[n + 1] && (f = e, e = n, n = f, f = r, r = a, a = f), l[n + 1] > l[s + 1] && (f = n, n = s, s = f, f = a, a = o, o = f), l[e + 1] > l[n + 1] && (f = e, e = n, n = f, f = r, r = a, a = f);
  const d = (l[e] + t.offsetX) * t.scaleX, p = (l[e + 1] + t.offsetY) * t.scaleY, g = (l[n] + t.offsetX) * t.scaleX, b = (l[n + 1] + t.offsetY) * t.scaleY, y = (l[s] + t.offsetX) * t.scaleX, v = (l[s + 1] + t.offsetY) * t.scaleY;
  if (p >= v)
    return;
  const w = c[r], _ = c[r + 1], x = c[r + 2], k = c[a], S = c[a + 1], T = c[a + 2], I = c[o], R = c[o + 1], B = c[o + 2], L = Math.round(p), it = Math.round(v);
  let O, at, W, q, K, z, j, N;
  for (let Q = L; Q <= it; Q++) {
    if (Q < b) {
      const tt = Q < p ? 0 : (p - Q) / (p - b);
      O = d - (d - g) * tt, at = w - (w - k) * tt, W = _ - (_ - S) * tt, q = x - (x - T) * tt;
    } else {
      let tt;
      Q > v ? tt = 1 : b === v ? tt = 0 : tt = (b - Q) / (b - v), O = g - (g - y) * tt, at = k - (k - I) * tt, W = S - (S - R) * tt, q = T - (T - B) * tt;
    }
    let Y;
    Q < p ? Y = 0 : Q > v ? Y = 1 : Y = (p - Q) / (p - v), K = d - (d - y) * Y, z = w - (w - I) * Y, j = _ - (_ - R) * Y, N = x - (x - B) * Y;
    const et = Math.round(Math.min(O, K)), $ = Math.round(Math.max(O, K));
    let dt = u * Q + et * 4;
    for (let tt = et; tt <= $; tt++)
      Y = (O - tt) / (O - K), Y < 0 ? Y = 0 : Y > 1 && (Y = 1), h[dt++] = at - (at - z) * Y | 0, h[dt++] = W - (W - j) * Y | 0, h[dt++] = q - (q - N) * Y | 0, h[dt++] = 255;
  }
}
function wM(i, t, e) {
  const n = t.coords, s = t.colors;
  let r, a;
  switch (t.type) {
    case "lattice":
      const o = t.verticesPerRow, l = Math.floor(n.length / o) - 1, c = o - 1;
      for (r = 0; r < l; r++) {
        let h = r * o;
        for (let u = 0; u < c; u++, h++)
          h6(i, e, n[h], n[h + 1], n[h + o], s[h], s[h + 1], s[h + o]), h6(i, e, n[h + o + 1], n[h + 1], n[h + o], s[h + o + 1], s[h + 1], s[h + o]);
      }
      break;
    case "triangles":
      for (r = 0, a = n.length; r < a; r += 3)
        h6(i, e, n[r], n[r + 1], n[r + 2], s[r], s[r + 1], s[r + 2]);
      break;
    default:
      throw new Error("illegal figure");
  }
}
class vM extends Iy {
  constructor(t) {
    super(), this._coords = t[2], this._colors = t[3], this._figures = t[4], this._bounds = t[5], this._bbox = t[6], this._background = t[7], this.matrix = null;
  }
  _createMeshCanvas(t, e, n) {
    const o = Math.floor(this._bounds[0]), l = Math.floor(this._bounds[1]), c = Math.ceil(this._bounds[2]) - o, h = Math.ceil(this._bounds[3]) - l, u = Math.min(Math.ceil(Math.abs(c * t[0] * 1.1)), 3e3), f = Math.min(Math.ceil(Math.abs(h * t[1] * 1.1)), 3e3), d = c / u, p = h / f, g = {
      coords: this._coords,
      colors: this._colors,
      offsetX: -o,
      offsetY: -l,
      scaleX: 1 / d,
      scaleY: 1 / p
    }, b = u + 2 * 2, y = f + 2 * 2, v = n.getCanvas("mesh", b, y), w = v.context, _ = w.createImageData(u, f);
    if (e) {
      const k = _.data;
      for (let S = 0, T = k.length; S < T; S += 4)
        k[S] = e[0], k[S + 1] = e[1], k[S + 2] = e[2], k[S + 3] = 255;
    }
    for (const k of this._figures)
      wM(_, k, g);
    return w.putImageData(_, 2, 2), {
      canvas: v.canvas,
      offsetX: o - 2 * d,
      offsetY: l - 2 * p,
      scaleX: d,
      scaleY: p
    };
  }
  isModifyingCurrentTransform() {
    return !0;
  }
  getPattern(t, e, n, s) {
    G7(t, this._bbox);
    const r = new Float32Array(2);
    if (s === Sn.SHADING)
      Zt.singularValueDecompose2dScale(_i(t), r);
    else if (this.matrix) {
      Zt.singularValueDecompose2dScale(this.matrix, r);
      const [o, l] = r;
      Zt.singularValueDecompose2dScale(e.baseTransform, r), r[0] *= o, r[1] *= l;
    } else
      Zt.singularValueDecompose2dScale(e.baseTransform, r);
    const a = this._createMeshCanvas(r, s === Sn.SHADING ? null : this._background, e.cachedCanvases);
    return s !== Sn.SHADING && (t.setTransform(...e.baseTransform), this.matrix && t.transform(...this.matrix)), t.translate(a.offsetX, a.offsetY), t.scale(a.scaleX, a.scaleY), t.createPattern(a.canvas, "no-repeat");
  }
}
class _M extends Iy {
  getPattern() {
    return "hotpink";
  }
}
function xM(i) {
  switch (i[0]) {
    case "RadialAxial":
      return new yM(i);
    case "Mesh":
      return new vM(i);
    case "Dummy":
      return new _M();
  }
  throw new Error(`Unknown IR type: ${i[0]}`);
}
const Fv = {
  COLORED: 1,
  UNCOLORED: 2
}, Z3 = class Z3 {
  constructor(t, e, n, s) {
    this.color = t[1], this.operatorList = t[2], this.matrix = t[3], this.bbox = t[4], this.xstep = t[5], this.ystep = t[6], this.paintType = t[7], this.tilingType = t[8], this.ctx = e, this.canvasGraphicsFactory = n, this.baseTransform = s;
  }
  createPatternCanvas(t) {
    const {
      bbox: e,
      operatorList: n,
      paintType: s,
      tilingType: r,
      color: a,
      canvasGraphicsFactory: o
    } = this;
    let {
      xstep: l,
      ystep: c
    } = this;
    l = Math.abs(l), c = Math.abs(c), x4("TilingType: " + r);
    const h = e[0], u = e[1], f = e[2], d = e[3], p = f - h, g = d - u, b = new Float32Array(2);
    Zt.singularValueDecompose2dScale(this.matrix, b);
    const [y, v] = b;
    Zt.singularValueDecompose2dScale(this.baseTransform, b);
    const w = y * b[0], _ = v * b[1];
    let x = p, k = g, S = !1, T = !1;
    const I = Math.ceil(l * w), R = Math.ceil(c * _), B = Math.ceil(p * w), L = Math.ceil(g * _);
    I >= B ? x = l : S = !0, R >= L ? k = c : T = !0;
    const it = this.getSizeAndScale(x, this.ctx.canvas.width, w), O = this.getSizeAndScale(k, this.ctx.canvas.height, _), at = t.cachedCanvases.getCanvas("pattern", it.size, O.size), W = at.context, q = o.createCanvasGraphics(W);
    if (q.groupLevel = t.groupLevel, this.setFillAndStrokeStyleToContext(q, s, a), W.translate(-it.scale * h, -O.scale * u), q.transform(it.scale, 0, 0, O.scale, 0, 0), W.save(), this.clipBbox(q, h, u, f, d), q.baseTransform = _i(q.ctx), q.executeOperatorList(n), q.endDrawing(), W.restore(), S || T) {
      const K = at.canvas;
      S && (x = l), T && (k = c);
      const z = this.getSizeAndScale(x, this.ctx.canvas.width, w), j = this.getSizeAndScale(k, this.ctx.canvas.height, _), N = z.size, Q = j.size, Y = t.cachedCanvases.getCanvas("pattern-workaround", N, Q), et = Y.context, $ = S ? Math.floor(p / l) : 0, dt = T ? Math.floor(g / c) : 0;
      for (let tt = 0; tt <= $; tt++)
        for (let ut = 0; ut <= dt; ut++)
          et.drawImage(K, N * tt, Q * ut, N, Q, 0, 0, N, Q);
      return {
        canvas: Y.canvas,
        scaleX: z.scale,
        scaleY: j.scale,
        offsetX: h,
        offsetY: u
      };
    }
    return {
      canvas: at.canvas,
      scaleX: it.scale,
      scaleY: O.scale,
      offsetX: h,
      offsetY: u
    };
  }
  getSizeAndScale(t, e, n) {
    const s = Math.max(Z3.MAX_PATTERN_SIZE, e);
    let r = Math.ceil(t * n);
    return r >= s ? r = s : n = r / t, {
      scale: n,
      size: r
    };
  }
  clipBbox(t, e, n, s, r) {
    const a = s - e, o = r - n;
    t.ctx.rect(e, n, a, o), Zt.axialAlignedBoundingBox([e, n, s, r], _i(t.ctx), t.current.minMax), t.clip(), t.endPath();
  }
  setFillAndStrokeStyleToContext(t, e, n) {
    const s = t.ctx, r = t.current;
    switch (e) {
      case Fv.COLORED:
        const {
          fillStyle: a,
          strokeStyle: o
        } = this.ctx;
        s.fillStyle = r.fillColor = a, s.strokeStyle = r.strokeColor = o;
        break;
      case Fv.UNCOLORED:
        s.fillStyle = s.strokeStyle = n, r.fillColor = r.strokeColor = n;
        break;
      default:
        throw new VI(`Unsupported paint type: ${e}`);
    }
  }
  isModifyingCurrentTransform() {
    return !1;
  }
  getPattern(t, e, n, s) {
    let r = n;
    s !== Sn.SHADING && (r = Zt.transform(r, e.baseTransform), this.matrix && (r = Zt.transform(r, this.matrix)));
    const a = this.createPatternCanvas(e);
    let o = new DOMMatrix(r);
    o = o.translate(a.offsetX, a.offsetY), o = o.scale(1 / a.scaleX, 1 / a.scaleY);
    const l = t.createPattern(a.canvas, "repeat");
    return l.setTransform(o), l;
  }
};
ft(Z3, "MAX_PATTERN_SIZE", 3e3);
let V7 = Z3;
function kM({
  src: i,
  srcPos: t = 0,
  dest: e,
  width: n,
  height: s,
  nonBlackColor: r = 4294967295,
  inverseDecode: a = !1
}) {
  const o = gn.isLittleEndian ? 4278190080 : 255, [l, c] = a ? [r, o] : [o, r], h = n >> 3, u = n & 7, f = i.length;
  e = new Uint32Array(e.buffer);
  let d = 0;
  for (let p = 0; p < s; p++) {
    for (const b = t + h; t < b; t++) {
      const y = t < f ? i[t] : 255;
      e[d++] = y & 128 ? c : l, e[d++] = y & 64 ? c : l, e[d++] = y & 32 ? c : l, e[d++] = y & 16 ? c : l, e[d++] = y & 8 ? c : l, e[d++] = y & 4 ? c : l, e[d++] = y & 2 ? c : l, e[d++] = y & 1 ? c : l;
    }
    if (u === 0)
      continue;
    const g = t < f ? i[t++] : 255;
    for (let b = 0; b < u; b++)
      e[d++] = g & 1 << 7 - b ? c : l;
  }
  return {
    srcPos: t,
    destPos: d
  };
}
const Iv = 16, Mv = 100, AM = 15, Rv = 10, Ds = 16, u6 = new DOMMatrix(), er = new Float32Array(2), uu = new Float32Array([1 / 0, 1 / 0, -1 / 0, -1 / 0]);
function SM(i, t) {
  if (i._removeMirroring)
    throw new Error("Context is already forwarding operations.");
  i.__originalSave = i.save, i.__originalRestore = i.restore, i.__originalRotate = i.rotate, i.__originalScale = i.scale, i.__originalTranslate = i.translate, i.__originalTransform = i.transform, i.__originalSetTransform = i.setTransform, i.__originalResetTransform = i.resetTransform, i.__originalClip = i.clip, i.__originalMoveTo = i.moveTo, i.__originalLineTo = i.lineTo, i.__originalBezierCurveTo = i.bezierCurveTo, i.__originalRect = i.rect, i.__originalClosePath = i.closePath, i.__originalBeginPath = i.beginPath, i._removeMirroring = () => {
    i.save = i.__originalSave, i.restore = i.__originalRestore, i.rotate = i.__originalRotate, i.scale = i.__originalScale, i.translate = i.__originalTranslate, i.transform = i.__originalTransform, i.setTransform = i.__originalSetTransform, i.resetTransform = i.__originalResetTransform, i.clip = i.__originalClip, i.moveTo = i.__originalMoveTo, i.lineTo = i.__originalLineTo, i.bezierCurveTo = i.__originalBezierCurveTo, i.rect = i.__originalRect, i.closePath = i.__originalClosePath, i.beginPath = i.__originalBeginPath, delete i._removeMirroring;
  }, i.save = function() {
    t.save(), this.__originalSave();
  }, i.restore = function() {
    t.restore(), this.__originalRestore();
  }, i.translate = function(e, n) {
    t.translate(e, n), this.__originalTranslate(e, n);
  }, i.scale = function(e, n) {
    t.scale(e, n), this.__originalScale(e, n);
  }, i.transform = function(e, n, s, r, a, o) {
    t.transform(e, n, s, r, a, o), this.__originalTransform(e, n, s, r, a, o);
  }, i.setTransform = function(e, n, s, r, a, o) {
    t.setTransform(e, n, s, r, a, o), this.__originalSetTransform(e, n, s, r, a, o);
  }, i.resetTransform = function() {
    t.resetTransform(), this.__originalResetTransform();
  }, i.rotate = function(e) {
    t.rotate(e), this.__originalRotate(e);
  }, i.clip = function(e) {
    t.clip(e), this.__originalClip(e);
  }, i.moveTo = function(e, n) {
    t.moveTo(e, n), this.__originalMoveTo(e, n);
  }, i.lineTo = function(e, n) {
    t.lineTo(e, n), this.__originalLineTo(e, n);
  }, i.bezierCurveTo = function(e, n, s, r, a, o) {
    t.bezierCurveTo(e, n, s, r, a, o), this.__originalBezierCurveTo(e, n, s, r, a, o);
  }, i.rect = function(e, n, s, r) {
    t.rect(e, n, s, r), this.__originalRect(e, n, s, r);
  }, i.closePath = function() {
    t.closePath(), this.__originalClosePath();
  }, i.beginPath = function() {
    t.beginPath(), this.__originalBeginPath();
  };
}
class CM {
  constructor(t) {
    this.canvasFactory = t, this.cache = /* @__PURE__ */ Object.create(null);
  }
  getCanvas(t, e, n) {
    let s;
    return this.cache[t] !== void 0 ? (s = this.cache[t], this.canvasFactory.reset(s, e, n)) : (s = this.canvasFactory.create(e, n), this.cache[t] = s), s;
  }
  delete(t) {
    delete this.cache[t];
  }
  clear() {
    for (const t in this.cache) {
      const e = this.cache[t];
      this.canvasFactory.destroy(e), delete this.cache[t];
    }
  }
}
function Hg(i, t, e, n, s, r, a, o, l, c) {
  const [h, u, f, d, p, g] = _i(i);
  if (u === 0 && f === 0) {
    const v = a * h + p, w = Math.round(v), _ = o * d + g, x = Math.round(_), k = (a + l) * h + p, S = Math.abs(Math.round(k) - w) || 1, T = (o + c) * d + g, I = Math.abs(Math.round(T) - x) || 1;
    return i.setTransform(Math.sign(h), 0, 0, Math.sign(d), w, x), i.drawImage(t, e, n, s, r, 0, 0, S, I), i.setTransform(h, u, f, d, p, g), [S, I];
  }
  if (h === 0 && d === 0) {
    const v = o * f + p, w = Math.round(v), _ = a * u + g, x = Math.round(_), k = (o + c) * f + p, S = Math.abs(Math.round(k) - w) || 1, T = (a + l) * u + g, I = Math.abs(Math.round(T) - x) || 1;
    return i.setTransform(0, Math.sign(u), Math.sign(f), 0, w, x), i.drawImage(t, e, n, s, r, 0, 0, I, S), i.setTransform(h, u, f, d, p, g), [I, S];
  }
  i.drawImage(t, e, n, s, r, a, o, l, c);
  const b = Math.hypot(h, u), y = Math.hypot(f, d);
  return [b * l, y * c];
}
class Bv {
  constructor(t, e) {
    ft(this, "alphaIsShape", !1);
    ft(this, "fontSize", 0);
    ft(this, "fontSizeScale", 1);
    ft(this, "textMatrix", null);
    ft(this, "textMatrixScale", 1);
    ft(this, "fontMatrix", k7);
    ft(this, "leading", 0);
    ft(this, "x", 0);
    ft(this, "y", 0);
    ft(this, "lineX", 0);
    ft(this, "lineY", 0);
    ft(this, "charSpacing", 0);
    ft(this, "wordSpacing", 0);
    ft(this, "textHScale", 1);
    ft(this, "textRenderingMode", On.FILL);
    ft(this, "textRise", 0);
    ft(this, "fillColor", "#000000");
    ft(this, "strokeColor", "#000000");
    ft(this, "patternFill", !1);
    ft(this, "patternStroke", !1);
    ft(this, "fillAlpha", 1);
    ft(this, "strokeAlpha", 1);
    ft(this, "lineWidth", 1);
    ft(this, "activeSMask", null);
    ft(this, "transferMaps", "none");
    this.clipBox = new Float32Array([0, 0, t, e]), this.minMax = uu.slice();
  }
  clone() {
    const t = Object.create(this);
    return t.clipBox = this.clipBox.slice(), t.minMax = this.minMax.slice(), t;
  }
  getPathBoundingBox(t = Sn.FILL, e = null) {
    const n = this.minMax.slice();
    if (t === Sn.STROKE) {
      e || Ze("Stroke bounding box must include transform."), Zt.singularValueDecompose2dScale(e, er);
      const s = er[0] * this.lineWidth / 2, r = er[1] * this.lineWidth / 2;
      n[0] -= s, n[1] -= r, n[2] += s, n[3] += r;
    }
    return n;
  }
  updateClipFromPath() {
    const t = Zt.intersect(this.clipBox, this.getPathBoundingBox());
    this.startNewPathAndClipBox(t || [0, 0, 0, 0]);
  }
  isEmptyClip() {
    return this.minMax[0] === 1 / 0;
  }
  startNewPathAndClipBox(t) {
    this.clipBox.set(t, 0), this.minMax.set(uu, 0);
  }
  getClippedPathBoundingBox(t = Sn.FILL, e = null) {
    return Zt.intersect(this.clipBox, this.getPathBoundingBox(t, e));
  }
}
function Pv(i, t) {
  if (t instanceof ImageData) {
    i.putImageData(t, 0, 0);
    return;
  }
  const e = t.height, n = t.width, s = e % Ds, r = (e - s) / Ds, a = s === 0 ? r : r + 1, o = i.createImageData(n, Ds);
  let l = 0, c;
  const h = t.data, u = o.data;
  let f, d, p, g;
  if (t.kind === C2.GRAYSCALE_1BPP) {
    const b = h.byteLength, y = new Uint32Array(u.buffer, 0, u.byteLength >> 2), v = y.length, w = n + 7 >> 3, _ = 4294967295, x = gn.isLittleEndian ? 4278190080 : 255;
    for (f = 0; f < a; f++) {
      for (p = f < r ? Ds : s, c = 0, d = 0; d < p; d++) {
        const k = b - l;
        let S = 0;
        const T = k > w ? n : k * 8 - 7, I = T & -8;
        let R = 0, B = 0;
        for (; S < I; S += 8)
          B = h[l++], y[c++] = B & 128 ? _ : x, y[c++] = B & 64 ? _ : x, y[c++] = B & 32 ? _ : x, y[c++] = B & 16 ? _ : x, y[c++] = B & 8 ? _ : x, y[c++] = B & 4 ? _ : x, y[c++] = B & 2 ? _ : x, y[c++] = B & 1 ? _ : x;
        for (; S < T; S++)
          R === 0 && (B = h[l++], R = 128), y[c++] = B & R ? _ : x, R >>= 1;
      }
      for (; c < v; )
        y[c++] = 0;
      i.putImageData(o, 0, f * Ds);
    }
  } else if (t.kind === C2.RGBA_32BPP) {
    for (d = 0, g = n * Ds * 4, f = 0; f < r; f++)
      u.set(h.subarray(l, l + g)), l += g, i.putImageData(o, 0, d), d += Ds;
    f < a && (g = n * s * 4, u.set(h.subarray(l, l + g)), i.putImageData(o, 0, d));
  } else if (t.kind === C2.RGB_24BPP)
    for (p = Ds, g = n * p, f = 0; f < a; f++) {
      for (f >= r && (p = s, g = n * p), c = 0, d = g; d--; )
        u[c++] = h[l++], u[c++] = h[l++], u[c++] = h[l++], u[c++] = 255;
      i.putImageData(o, 0, f * Ds);
    }
  else
    throw new Error(`bad image kind: ${t.kind}`);
}
function Nv(i, t) {
  if (t.bitmap) {
    i.drawImage(t.bitmap, 0, 0);
    return;
  }
  const e = t.height, n = t.width, s = e % Ds, r = (e - s) / Ds, a = s === 0 ? r : r + 1, o = i.createImageData(n, Ds);
  let l = 0;
  const c = t.data, h = o.data;
  for (let u = 0; u < a; u++) {
    const f = u < r ? Ds : s;
    ({
      srcPos: l
    } = kM({
      src: c,
      srcPos: l,
      dest: h,
      width: n,
      height: f,
      nonBlackColor: 0
    })), i.putImageData(o, 0, u * Ds);
  }
}
function Af(i, t) {
  const e = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font", "filter"];
  for (const n of e)
    i[n] !== void 0 && (t[n] = i[n]);
  i.setLineDash !== void 0 && (t.setLineDash(i.getLineDash()), t.lineDashOffset = i.lineDashOffset);
}
function jg(i) {
  i.strokeStyle = i.fillStyle = "#000000", i.fillRule = "nonzero", i.globalAlpha = 1, i.lineWidth = 1, i.lineCap = "butt", i.lineJoin = "miter", i.miterLimit = 10, i.globalCompositeOperation = "source-over", i.font = "10px sans-serif", i.setLineDash !== void 0 && (i.setLineDash([]), i.lineDashOffset = 0);
  const {
    filter: t
  } = i;
  t !== "none" && t !== "" && (i.filter = "none");
}
function Lv(i, t) {
  if (t)
    return !0;
  Zt.singularValueDecompose2dScale(i, er);
  const e = Math.fround(Ia.pixelRatio * jl.PDF_TO_CSS_UNITS);
  return er[0] <= e && er[1] <= e;
}
const EM = ["butt", "round", "square"], DM = ["miter", "round", "bevel"], TM = {}, Ov = {};
var Ba, W7, X7, Y7;
const sv = class sv {
  constructor(t, e, n, s, r, {
    optionalContentConfig: a,
    markedContentStack: o = null
  }, l, c) {
    F(this, Ba);
    this.ctx = t, this.current = new Bv(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = e, this.objs = n, this.canvasFactory = s, this.filterFactory = r, this.groupStack = [], this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = o || [], this.optionalContentConfig = a, this.cachedCanvases = new CM(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = l, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.pageColors = c, this._cachedScaleForStroking = [-1, 0], this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
  }
  getObject(t, e = null) {
    return typeof t == "string" ? t.startsWith("g_") ? this.commonObjs.get(t) : this.objs.get(t) : e;
  }
  beginDrawing({
    transform: t,
    viewport: e,
    transparency: n = !1,
    background: s = null
  }) {
    const r = this.ctx.canvas.width, a = this.ctx.canvas.height, o = this.ctx.fillStyle;
    if (this.ctx.fillStyle = s || "#ffffff", this.ctx.fillRect(0, 0, r, a), this.ctx.fillStyle = o, n) {
      const l = this.cachedCanvases.getCanvas("transparent", r, a);
      this.compositeCtx = this.ctx, this.transparentCanvas = l.canvas, this.ctx = l.context, this.ctx.save(), this.ctx.transform(..._i(this.compositeCtx));
    }
    this.ctx.save(), jg(this.ctx), t && (this.ctx.transform(...t), this.outputScaleX = t[0], this.outputScaleY = t[0]), this.ctx.transform(...e.transform), this.viewportScale = e.scale, this.baseTransform = _i(this.ctx);
  }
  executeOperatorList(t, e, n, s) {
    const r = t.argsArray, a = t.fnArray;
    let o = e || 0;
    const l = r.length;
    if (l === o)
      return o;
    const c = l - o > Rv && typeof n == "function", h = c ? Date.now() + AM : 0;
    let u = 0;
    const f = this.commonObjs, d = this.objs;
    let p;
    for (; ; ) {
      if (s !== void 0 && o === s.nextBreakPoint)
        return s.breakIt(o, n), o;
      if (p = a[o], p !== Y2.dependency)
        this[p].apply(this, r[o]);
      else
        for (const g of r[o]) {
          const b = g.startsWith("g_") ? f : d;
          if (!b.has(g))
            return b.get(g, n), o;
        }
      if (o++, o === l)
        return o;
      if (c && ++u > Rv) {
        if (Date.now() > h)
          return n(), o;
        u = 0;
      }
    }
  }
  endDrawing() {
    D(this, Ba, W7).call(this), this.cachedCanvases.clear(), this.cachedPatterns.clear();
    for (const t of this._cachedBitmapsMap.values()) {
      for (const e of t.values())
        typeof HTMLCanvasElement < "u" && e instanceof HTMLCanvasElement && (e.width = e.height = 0);
      t.clear();
    }
    this._cachedBitmapsMap.clear(), D(this, Ba, X7).call(this);
  }
  _scaleImage(t, e) {
    const n = t.width ?? t.displayWidth, s = t.height ?? t.displayHeight;
    let r = Math.max(Math.hypot(e[0], e[1]), 1), a = Math.max(Math.hypot(e[2], e[3]), 1), o = n, l = s, c = "prescale1", h, u;
    for (; r > 2 && o > 1 || a > 2 && l > 1; ) {
      let f = o, d = l;
      r > 2 && o > 1 && (f = o >= 16384 ? Math.floor(o / 2) - 1 || 1 : Math.ceil(o / 2), r /= o / f), a > 2 && l > 1 && (d = l >= 16384 ? Math.floor(l / 2) - 1 || 1 : Math.ceil(l) / 2, a /= l / d), h = this.cachedCanvases.getCanvas(c, f, d), u = h.context, u.clearRect(0, 0, f, d), u.drawImage(t, 0, 0, o, l, 0, 0, f, d), t = h.canvas, o = f, l = d, c = c === "prescale1" ? "prescale2" : "prescale1";
    }
    return {
      img: t,
      paintWidth: o,
      paintHeight: l
    };
  }
  _createMaskCanvas(t) {
    const e = this.ctx, {
      width: n,
      height: s
    } = t, r = this.current.fillColor, a = this.current.patternFill, o = _i(e);
    let l, c, h, u;
    if ((t.bitmap || t.data) && t.count > 1) {
      const I = t.bitmap || t.data.buffer;
      c = JSON.stringify(a ? o : [o.slice(0, 4), r]), l = this._cachedBitmapsMap.get(I), l || (l = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(I, l));
      const R = l.get(c);
      if (R && !a) {
        const B = Math.round(Math.min(o[0], o[2]) + o[4]), L = Math.round(Math.min(o[1], o[3]) + o[5]);
        return {
          canvas: R,
          offsetX: B,
          offsetY: L
        };
      }
      h = R;
    }
    h || (u = this.cachedCanvases.getCanvas("maskCanvas", n, s), Nv(u.context, t));
    let f = Zt.transform(o, [1 / n, 0, 0, -1 / s, 0, 0]);
    f = Zt.transform(f, [1, 0, 0, 1, 0, -s]);
    const d = uu.slice();
    Zt.axialAlignedBoundingBox([0, 0, n, s], f, d);
    const [p, g, b, y] = d, v = Math.round(b - p) || 1, w = Math.round(y - g) || 1, _ = this.cachedCanvases.getCanvas("fillCanvas", v, w), x = _.context, k = p, S = g;
    x.translate(-k, -S), x.transform(...f), h || (h = this._scaleImage(u.canvas, $a(x)), h = h.img, l && a && l.set(c, h)), x.imageSmoothingEnabled = Lv(_i(x), t.interpolate), Hg(x, h, 0, 0, h.width, h.height, 0, 0, n, s), x.globalCompositeOperation = "source-in";
    const T = Zt.transform($a(x), [1, 0, 0, 1, -k, -S]);
    return x.fillStyle = a ? r.getPattern(e, this, T, Sn.FILL) : r, x.fillRect(0, 0, n, s), l && !a && (this.cachedCanvases.delete("fillCanvas"), l.set(c, _.canvas)), {
      canvas: _.canvas,
      offsetX: Math.round(k),
      offsetY: Math.round(S)
    };
  }
  setLineWidth(t) {
    t !== this.current.lineWidth && (this._cachedScaleForStroking[0] = -1), this.current.lineWidth = t, this.ctx.lineWidth = t;
  }
  setLineCap(t) {
    this.ctx.lineCap = EM[t];
  }
  setLineJoin(t) {
    this.ctx.lineJoin = DM[t];
  }
  setMiterLimit(t) {
    this.ctx.miterLimit = t;
  }
  setDash(t, e) {
    const n = this.ctx;
    n.setLineDash !== void 0 && (n.setLineDash(t), n.lineDashOffset = e);
  }
  setRenderingIntent(t) {
  }
  setFlatness(t) {
  }
  setGState(t) {
    for (const [e, n] of t)
      switch (e) {
        case "LW":
          this.setLineWidth(n);
          break;
        case "LC":
          this.setLineCap(n);
          break;
        case "LJ":
          this.setLineJoin(n);
          break;
        case "ML":
          this.setMiterLimit(n);
          break;
        case "D":
          this.setDash(n[0], n[1]);
          break;
        case "RI":
          this.setRenderingIntent(n);
          break;
        case "FL":
          this.setFlatness(n);
          break;
        case "Font":
          this.setFont(n[0], n[1]);
          break;
        case "CA":
          this.current.strokeAlpha = n;
          break;
        case "ca":
          this.ctx.globalAlpha = this.current.fillAlpha = n;
          break;
        case "BM":
          this.ctx.globalCompositeOperation = n;
          break;
        case "SMask":
          this.current.activeSMask = n ? this.tempSMask : null, this.tempSMask = null, this.checkSMaskState();
          break;
        case "TR":
          this.ctx.filter = this.current.transferMaps = this.filterFactory.addFilter(n);
          break;
      }
  }
  get inSMaskMode() {
    return !!this.suspendedCtx;
  }
  checkSMaskState() {
    const t = this.inSMaskMode;
    this.current.activeSMask && !t ? this.beginSMaskMode() : !this.current.activeSMask && t && this.endSMaskMode();
  }
  beginSMaskMode() {
    if (this.inSMaskMode)
      throw new Error("beginSMaskMode called while already in smask mode");
    const t = this.ctx.canvas.width, e = this.ctx.canvas.height, n = "smaskGroupAt" + this.groupLevel, s = this.cachedCanvases.getCanvas(n, t, e);
    this.suspendedCtx = this.ctx;
    const r = this.ctx = s.context;
    r.setTransform(this.suspendedCtx.getTransform()), Af(this.suspendedCtx, r), SM(r, this.suspendedCtx), this.setGState([["BM", "source-over"]]);
  }
  endSMaskMode() {
    if (!this.inSMaskMode)
      throw new Error("endSMaskMode called while not in smask mode");
    this.ctx._removeMirroring(), Af(this.ctx, this.suspendedCtx), this.ctx = this.suspendedCtx, this.suspendedCtx = null;
  }
  compose(t) {
    if (!this.current.activeSMask)
      return;
    t ? (t[0] = Math.floor(t[0]), t[1] = Math.floor(t[1]), t[2] = Math.ceil(t[2]), t[3] = Math.ceil(t[3])) : t = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];
    const e = this.current.activeSMask, n = this.suspendedCtx;
    this.composeSMask(n, e, this.ctx, t), 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();
  }
  composeSMask(t, e, n, s) {
    const r = s[0], a = s[1], o = s[2] - r, l = s[3] - a;
    o === 0 || l === 0 || (this.genericComposeSMask(e.context, n, o, l, e.subtype, e.backdrop, e.transferMap, r, a, e.offsetX, e.offsetY), t.save(), t.globalAlpha = 1, t.globalCompositeOperation = "source-over", t.setTransform(1, 0, 0, 1, 0, 0), t.drawImage(n.canvas, 0, 0), t.restore());
  }
  genericComposeSMask(t, e, n, s, r, a, o, l, c, h, u) {
    let f = t.canvas, d = l - h, p = c - u;
    if (a)
      if (d < 0 || p < 0 || d + n > f.width || p + s > f.height) {
        const b = this.cachedCanvases.getCanvas("maskExtension", n, s), y = b.context;
        y.drawImage(f, -d, -p), y.globalCompositeOperation = "destination-atop", y.fillStyle = a, y.fillRect(0, 0, n, s), y.globalCompositeOperation = "source-over", f = b.canvas, d = p = 0;
      } else {
        t.save(), t.globalAlpha = 1, t.setTransform(1, 0, 0, 1, 0, 0);
        const b = new Path2D();
        b.rect(d, p, n, s), t.clip(b), t.globalCompositeOperation = "destination-atop", t.fillStyle = a, t.fillRect(d, p, n, s), t.restore();
      }
    e.save(), e.globalAlpha = 1, e.setTransform(1, 0, 0, 1, 0, 0), r === "Alpha" && o ? e.filter = this.filterFactory.addAlphaFilter(o) : r === "Luminosity" && (e.filter = this.filterFactory.addLuminosityFilter(o));
    const g = new Path2D();
    g.rect(l, c, n, s), e.clip(g), e.globalCompositeOperation = "destination-in", e.drawImage(f, d, p, n, s, l, c, n, s), e.restore();
  }
  save() {
    this.inSMaskMode && Af(this.ctx, this.suspendedCtx), this.ctx.save();
    const t = this.current;
    this.stateStack.push(t), this.current = t.clone();
  }
  restore() {
    if (this.stateStack.length === 0) {
      this.inSMaskMode && this.endSMaskMode();
      return;
    }
    this.current = this.stateStack.pop(), this.ctx.restore(), this.inSMaskMode && Af(this.suspendedCtx, this.ctx), this.checkSMaskState(), this.pendingClip = null, this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null;
  }
  transform(t, e, n, s, r, a) {
    this.ctx.transform(t, e, n, s, r, a), this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null;
  }
  constructPath(t, e, n) {
    let [s] = e;
    if (!n) {
      s || (s = e[0] = new Path2D()), this[t](s);
      return;
    }
    if (!(s instanceof Path2D)) {
      const r = e[0] = new Path2D();
      for (let a = 0, o = s.length; a < o; )
        switch (s[a++]) {
          case qg.moveTo:
            r.moveTo(s[a++], s[a++]);
            break;
          case qg.lineTo:
            r.lineTo(s[a++], s[a++]);
            break;
          case qg.curveTo:
            r.bezierCurveTo(s[a++], s[a++], s[a++], s[a++], s[a++], s[a++]);
            break;
          case qg.closePath:
            r.closePath();
            break;
          default:
            me(`Unrecognized drawing path operator: ${s[a - 1]}`);
            break;
        }
      s = r;
    }
    Zt.axialAlignedBoundingBox(n, _i(this.ctx), this.current.minMax), this[t](s);
  }
  closePath() {
    this.ctx.closePath();
  }
  stroke(t, e = !0) {
    const n = this.ctx, s = this.current.strokeColor;
    if (n.globalAlpha = this.current.strokeAlpha, this.contentVisible)
      if (typeof s == "object" && (s != null && s.getPattern)) {
        const r = s.isModifyingCurrentTransform() ? n.getTransform() : null;
        if (n.save(), n.strokeStyle = s.getPattern(n, this, $a(n), Sn.STROKE), r) {
          const a = new Path2D();
          a.addPath(t, n.getTransform().invertSelf().multiplySelf(r)), t = a;
        }
        this.rescaleAndStroke(t, !1), n.restore();
      } else
        this.rescaleAndStroke(t, !0);
    e && this.consumePath(t, this.current.getClippedPathBoundingBox(Sn.STROKE, _i(this.ctx))), n.globalAlpha = this.current.fillAlpha;
  }
  closeStroke(t) {
    this.stroke(t);
  }
  fill(t, e = !0) {
    const n = this.ctx, s = this.current.fillColor, r = this.current.patternFill;
    let a = !1;
    if (r) {
      const l = s.isModifyingCurrentTransform() ? n.getTransform() : null;
      if (n.save(), n.fillStyle = s.getPattern(n, this, $a(n), Sn.FILL), l) {
        const c = new Path2D();
        c.addPath(t, n.getTransform().invertSelf().multiplySelf(l)), t = c;
      }
      a = !0;
    }
    const o = this.current.getClippedPathBoundingBox();
    this.contentVisible && o !== null && (this.pendingEOFill ? (n.fill(t, "evenodd"), this.pendingEOFill = !1) : n.fill(t)), a && n.restore(), e && this.consumePath(t, o);
  }
  eoFill(t) {
    this.pendingEOFill = !0, this.fill(t);
  }
  fillStroke(t) {
    this.fill(t, !1), this.stroke(t, !1), this.consumePath(t);
  }
  eoFillStroke(t) {
    this.pendingEOFill = !0, this.fillStroke(t);
  }
  closeFillStroke(t) {
    this.fillStroke(t);
  }
  closeEOFillStroke(t) {
    this.pendingEOFill = !0, this.fillStroke(t);
  }
  endPath(t) {
    this.consumePath(t);
  }
  rawFillPath(t) {
    this.ctx.fill(t);
  }
  clip() {
    this.pendingClip = TM;
  }
  eoClip() {
    this.pendingClip = Ov;
  }
  beginText() {
    this.current.textMatrix = null, this.current.textMatrixScale = 1, this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
  }
  endText() {
    const t = this.pendingTextPaths, e = this.ctx;
    if (t === void 0)
      return;
    const n = new Path2D(), s = e.getTransform().invertSelf();
    for (const {
      transform: r,
      x: a,
      y: o,
      fontSize: l,
      path: c
    } of t)
      n.addPath(c, new DOMMatrix(r).preMultiplySelf(s).translate(a, o).scale(l, -l));
    e.clip(n), delete this.pendingTextPaths;
  }
  setCharSpacing(t) {
    this.current.charSpacing = t;
  }
  setWordSpacing(t) {
    this.current.wordSpacing = t;
  }
  setHScale(t) {
    this.current.textHScale = t / 100;
  }
  setLeading(t) {
    this.current.leading = -t;
  }
  setFont(t, e) {
    var h;
    const n = this.commonObjs.get(t), s = this.current;
    if (!n)
      throw new Error(`Can't find font for ${t}`);
    if (s.fontMatrix = n.fontMatrix || k7, (s.fontMatrix[0] === 0 || s.fontMatrix[3] === 0) && me("Invalid font matrix for font " + t), e < 0 ? (e = -e, s.fontDirection = -1) : s.fontDirection = 1, this.current.font = n, this.current.fontSize = e, n.isType3Font)
      return;
    const r = n.loadedName || "sans-serif", a = ((h = n.systemFontInfo) == null ? void 0 : h.css) || `"${r}", ${n.fallbackName}`;
    let o = "normal";
    n.black ? o = "900" : n.bold && (o = "bold");
    const l = n.italic ? "italic" : "normal";
    let c = e;
    e < Iv ? c = Iv : e > Mv && (c = Mv), this.current.fontSizeScale = e / c, this.ctx.font = `${l} ${o} ${c}px ${a}`;
  }
  setTextRenderingMode(t) {
    this.current.textRenderingMode = t;
  }
  setTextRise(t) {
    this.current.textRise = t;
  }
  moveText(t, e) {
    this.current.x = this.current.lineX += t, this.current.y = this.current.lineY += e;
  }
  setLeadingMoveText(t, e) {
    this.setLeading(-e), this.moveText(t, e);
  }
  setTextMatrix(t) {
    const {
      current: e
    } = this;
    e.textMatrix = t, e.textMatrixScale = Math.hypot(t[0], t[1]), e.x = e.lineX = 0, e.y = e.lineY = 0;
  }
  nextLine() {
    this.moveText(0, this.current.leading);
  }
  paintChar(t, e, n, s, r) {
    const a = this.ctx, o = this.current, l = o.font, c = o.textRenderingMode, h = o.fontSize / o.fontSizeScale, u = c & On.FILL_STROKE_MASK, f = !!(c & On.ADD_TO_PATH_FLAG), d = o.patternFill && !l.missingFile, p = o.patternStroke && !l.missingFile;
    let g;
    if ((l.disableFontFace || f || d || p) && (g = l.getPathGenerator(this.commonObjs, t)), l.disableFontFace || d || p) {
      a.save(), a.translate(e, n), a.scale(h, -h);
      let b;
      if ((u === On.FILL || u === On.FILL_STROKE) && (s ? (b = a.getTransform(), a.setTransform(...s), a.fill(D(this, Ba, Y7).call(this, g, b, s))) : a.fill(g)), u === On.STROKE || u === On.FILL_STROKE)
        if (r) {
          b || (b = a.getTransform()), a.setTransform(...r);
          const {
            a: y,
            b: v,
            c: w,
            d: _
          } = b, x = Zt.inverseTransform(r), k = Zt.transform([y, v, w, _, 0, 0], x);
          Zt.singularValueDecompose2dScale(k, er), a.lineWidth *= Math.max(er[0], er[1]) / h, a.stroke(D(this, Ba, Y7).call(this, g, b, r));
        } else
          a.lineWidth /= h, a.stroke(g);
      a.restore();
    } else
      (u === On.FILL || u === On.FILL_STROKE) && a.fillText(t, e, n), (u === On.STROKE || u === On.FILL_STROKE) && a.strokeText(t, e, n);
    f && (this.pendingTextPaths || (this.pendingTextPaths = [])).push({
      transform: _i(a),
      x: e,
      y: n,
      fontSize: h,
      path: g
    });
  }
  get isFontSubpixelAAEnabled() {
    const {
      context: t
    } = this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled", 10, 10);
    t.scale(1.5, 1), t.fillText("I", 0, 10);
    const e = t.getImageData(0, 0, 10, 10).data;
    let n = !1;
    for (let s = 3; s < e.length; s += 4)
      if (e[s] > 0 && e[s] < 255) {
        n = !0;
        break;
      }
    return Fe(this, "isFontSubpixelAAEnabled", n);
  }
  showText(t) {
    const e = this.current, n = e.font;
    if (n.isType3Font)
      return this.showType3Text(t);
    const s = e.fontSize;
    if (s === 0)
      return;
    const r = this.ctx, a = e.fontSizeScale, o = e.charSpacing, l = e.wordSpacing, c = e.fontDirection, h = e.textHScale * c, u = t.length, f = n.vertical, d = f ? 1 : -1, p = n.defaultVMetrics, g = s * e.fontMatrix[0], b = e.textRenderingMode === On.FILL && !n.disableFontFace && !e.patternFill;
    r.save(), e.textMatrix && r.transform(...e.textMatrix), r.translate(e.x, e.y + e.textRise), c > 0 ? r.scale(h, -1) : r.scale(h, 1);
    let y, v;
    if (e.patternFill) {
      r.save();
      const S = e.fillColor.getPattern(r, this, $a(r), Sn.FILL);
      y = _i(r), r.restore(), r.fillStyle = S;
    }
    if (e.patternStroke) {
      r.save();
      const S = e.strokeColor.getPattern(r, this, $a(r), Sn.STROKE);
      v = _i(r), r.restore(), r.strokeStyle = S;
    }
    let w = e.lineWidth;
    const _ = e.textMatrixScale;
    if (_ === 0 || w === 0) {
      const S = e.textRenderingMode & On.FILL_STROKE_MASK;
      (S === On.STROKE || S === On.FILL_STROKE) && (w = this.getSinglePixelWidth());
    } else
      w /= _;
    if (a !== 1 && (r.scale(a, a), w /= a), r.lineWidth = w, n.isInvalidPDFjsFont) {
      const S = [];
      let T = 0;
      for (const I of t)
        S.push(I.unicode), T += I.width;
      r.fillText(S.join(""), 0, 0), e.x += T * g * h, r.restore(), this.compose();
      return;
    }
    let x = 0, k;
    for (k = 0; k < u; ++k) {
      const S = t[k];
      if (typeof S == "number") {
        x += d * S * s / 1e3;
        continue;
      }
      let T = !1;
      const I = (S.isSpace ? l : 0) + o, R = S.fontChar, B = S.accent;
      let L, it, O = S.width;
      if (f) {
        const W = S.vmetric || p, q = -(S.vmetric ? W[1] : O * 0.5) * g, K = W[2] * g;
        O = W ? -W[0] : O, L = q / a, it = (x + K) / a;
      } else
        L = x / a, it = 0;
      if (n.remeasure && O > 0) {
        const W = r.measureText(R).width * 1e3 / s * a;
        if (O < W && this.isFontSubpixelAAEnabled) {
          const q = O / W;
          T = !0, r.save(), r.scale(q, 1), L /= q;
        } else O !== W && (L += (O - W) / 2e3 * s / a);
      }
      if (this.contentVisible && (S.isInFont || n.missingFile)) {
        if (b && !B)
          r.fillText(R, L, it);
        else if (this.paintChar(R, L, it, y, v), B) {
          const W = L + s * B.offset.x / a, q = it - s * B.offset.y / a;
          this.paintChar(B.fontChar, W, q, y, v);
        }
      }
      const at = f ? O * g - I * c : O * g + I * c;
      x += at, T && r.restore();
    }
    f ? e.y -= x : e.x += x * h, r.restore(), this.compose();
  }
  showType3Text(t) {
    const e = this.ctx, n = this.current, s = n.font, r = n.fontSize, a = n.fontDirection, o = s.vertical ? 1 : -1, l = n.charSpacing, c = n.wordSpacing, h = n.textHScale * a, u = n.fontMatrix || k7, f = t.length, d = n.textRenderingMode === On.INVISIBLE;
    let p, g, b, y;
    if (!(d || r === 0)) {
      for (this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null, e.save(), n.textMatrix && e.transform(...n.textMatrix), e.translate(n.x, n.y + n.textRise), e.scale(h, a), p = 0; p < f; ++p) {
        if (g = t[p], typeof g == "number") {
          y = o * g * r / 1e3, this.ctx.translate(y, 0), n.x += y * h;
          continue;
        }
        const v = (g.isSpace ? c : 0) + l, w = s.charProcOperatorList[g.operatorListId];
        w ? this.contentVisible && (this.save(), e.scale(r, r), e.transform(...u), this.executeOperatorList(w), this.restore()) : me(`Type3 character "${g.operatorListId}" is not available.`);
        const _ = [g.width, 0];
        Zt.applyTransform(_, u), b = _[0] * r + v, e.translate(b, 0), n.x += b * h;
      }
      e.restore();
    }
  }
  setCharWidth(t, e) {
  }
  setCharWidthAndBounds(t, e, n, s, r, a) {
    const o = new Path2D();
    o.rect(n, s, r - n, a - s), this.ctx.clip(o), this.endPath();
  }
  getColorN_Pattern(t) {
    let e;
    if (t[0] === "TilingPattern") {
      const n = this.baseTransform || _i(this.ctx), s = {
        createCanvasGraphics: (r) => new sv(r, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
          optionalContentConfig: this.optionalContentConfig,
          markedContentStack: this.markedContentStack
        })
      };
      e = new V7(t, this.ctx, s, n);
    } else
      e = this._getPattern(t[1], t[2]);
    return e;
  }
  setStrokeColorN() {
    this.current.strokeColor = this.getColorN_Pattern(arguments), this.current.patternStroke = !0;
  }
  setFillColorN() {
    this.current.fillColor = this.getColorN_Pattern(arguments), this.current.patternFill = !0;
  }
  setStrokeRGBColor(t) {
    this.ctx.strokeStyle = this.current.strokeColor = t, this.current.patternStroke = !1;
  }
  setStrokeTransparent() {
    this.ctx.strokeStyle = this.current.strokeColor = "transparent", this.current.patternStroke = !1;
  }
  setFillRGBColor(t) {
    this.ctx.fillStyle = this.current.fillColor = t, this.current.patternFill = !1;
  }
  setFillTransparent() {
    this.ctx.fillStyle = this.current.fillColor = "transparent", this.current.patternFill = !1;
  }
  _getPattern(t, e = null) {
    let n;
    return this.cachedPatterns.has(t) ? n = this.cachedPatterns.get(t) : (n = xM(this.getObject(t)), this.cachedPatterns.set(t, n)), e && (n.matrix = e), n;
  }
  shadingFill(t) {
    if (!this.contentVisible)
      return;
    const e = this.ctx;
    this.save();
    const n = this._getPattern(t);
    e.fillStyle = n.getPattern(e, this, $a(e), Sn.SHADING);
    const s = $a(e);
    if (s) {
      const {
        width: r,
        height: a
      } = e.canvas, o = uu.slice();
      Zt.axialAlignedBoundingBox([0, 0, r, a], s, o);
      const [l, c, h, u] = o;
      this.ctx.fillRect(l, c, h - l, u - c);
    } else
      this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);
    this.compose(this.current.getClippedPathBoundingBox()), this.restore();
  }
  beginInlineImage() {
    Ze("Should not call beginInlineImage");
  }
  beginImageData() {
    Ze("Should not call beginImageData");
  }
  paintFormXObjectBegin(t, e) {
    if (this.contentVisible && (this.save(), this.baseTransformStack.push(this.baseTransform), t && this.transform(...t), this.baseTransform = _i(this.ctx), e)) {
      Zt.axialAlignedBoundingBox(e, this.baseTransform, this.current.minMax);
      const [n, s, r, a] = e, o = new Path2D();
      o.rect(n, s, r - n, a - s), this.ctx.clip(o), this.endPath();
    }
  }
  paintFormXObjectEnd() {
    this.contentVisible && (this.restore(), this.baseTransform = this.baseTransformStack.pop());
  }
  beginGroup(t) {
    if (!this.contentVisible)
      return;
    this.save(), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
    const e = this.ctx;
    t.isolated || x4("TODO: Support non-isolated groups."), t.knockout && me("Knockout groups not supported.");
    const n = _i(e);
    if (t.matrix && e.transform(...t.matrix), !t.bbox)
      throw new Error("Bounding box is required.");
    let s = uu.slice();
    Zt.axialAlignedBoundingBox(t.bbox, _i(e), s);
    const r = [0, 0, e.canvas.width, e.canvas.height];
    s = Zt.intersect(s, r) || [0, 0, 0, 0];
    const a = Math.floor(s[0]), o = Math.floor(s[1]), l = Math.max(Math.ceil(s[2]) - a, 1), c = Math.max(Math.ceil(s[3]) - o, 1);
    this.current.startNewPathAndClipBox([0, 0, l, c]);
    let h = "groupAt" + this.groupLevel;
    t.smask && (h += "_smask_" + this.smaskCounter++ % 2);
    const u = this.cachedCanvases.getCanvas(h, l, c), f = u.context;
    f.translate(-a, -o), f.transform(...n);
    let d = new Path2D();
    const [p, g, b, y] = t.bbox;
    if (d.rect(p, g, b - p, y - g), t.matrix) {
      const v = new Path2D();
      v.addPath(d, new DOMMatrix(t.matrix)), d = v;
    }
    f.clip(d), t.smask ? this.smaskStack.push({
      canvas: u.canvas,
      context: f,
      offsetX: a,
      offsetY: o,
      subtype: t.smask.subtype,
      backdrop: t.smask.backdrop,
      transferMap: t.smask.transferMap || null,
      startTransformInverse: null
    }) : (e.setTransform(1, 0, 0, 1, 0, 0), e.translate(a, o), e.save()), Af(e, f), this.ctx = f, this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]), this.groupStack.push(e), this.groupLevel++;
  }
  endGroup(t) {
    if (!this.contentVisible)
      return;
    this.groupLevel--;
    const e = this.ctx, n = this.groupStack.pop();
    if (this.ctx = n, this.ctx.imageSmoothingEnabled = !1, t.smask)
      this.tempSMask = this.smaskStack.pop(), this.restore();
    else {
      this.ctx.restore();
      const s = _i(this.ctx);
      this.restore(), this.ctx.save(), this.ctx.setTransform(...s);
      const r = uu.slice();
      Zt.axialAlignedBoundingBox([0, 0, e.canvas.width, e.canvas.height], s, r), this.ctx.drawImage(e.canvas, 0, 0), this.ctx.restore(), this.compose(r);
    }
  }
  beginAnnotation(t, e, n, s, r) {
    if (D(this, Ba, W7).call(this), jg(this.ctx), this.ctx.save(), this.save(), this.baseTransform && this.ctx.setTransform(...this.baseTransform), e) {
      const a = e[2] - e[0], o = e[3] - e[1];
      if (r && this.annotationCanvasMap) {
        n = n.slice(), n[4] -= e[0], n[5] -= e[1], e = e.slice(), e[0] = e[1] = 0, e[2] = a, e[3] = o, Zt.singularValueDecompose2dScale(_i(this.ctx), er);
        const {
          viewportScale: l
        } = this, c = Math.ceil(a * this.outputScaleX * l), h = Math.ceil(o * this.outputScaleY * l);
        this.annotationCanvas = this.canvasFactory.create(c, h);
        const {
          canvas: u,
          context: f
        } = this.annotationCanvas;
        this.annotationCanvasMap.set(t, u), this.annotationCanvas.savedCtx = this.ctx, this.ctx = f, this.ctx.save(), this.ctx.setTransform(er[0], 0, 0, -er[1], 0, o * er[1]), jg(this.ctx);
      } else {
        jg(this.ctx), this.endPath();
        const l = new Path2D();
        l.rect(e[0], e[1], a, o), this.ctx.clip(l);
      }
    }
    this.current = new Bv(this.ctx.canvas.width, this.ctx.canvas.height), this.transform(...n), this.transform(...s);
  }
  endAnnotation() {
    this.annotationCanvas && (this.ctx.restore(), D(this, Ba, X7).call(this), this.ctx = this.annotationCanvas.savedCtx, delete this.annotationCanvas.savedCtx, delete this.annotationCanvas);
  }
  paintImageMaskXObject(t) {
    if (!this.contentVisible)
      return;
    const e = t.count;
    t = this.getObject(t.data, t), t.count = e;
    const n = this.ctx, s = this._createMaskCanvas(t), r = s.canvas;
    n.save(), n.setTransform(1, 0, 0, 1, 0, 0), n.drawImage(r, s.offsetX, s.offsetY), n.restore(), this.compose();
  }
  paintImageMaskXObjectRepeat(t, e, n = 0, s = 0, r, a) {
    if (!this.contentVisible)
      return;
    t = this.getObject(t.data, t);
    const o = this.ctx;
    o.save();
    const l = _i(o);
    o.transform(e, n, s, r, 0, 0);
    const c = this._createMaskCanvas(t);
    o.setTransform(1, 0, 0, 1, c.offsetX - l[4], c.offsetY - l[5]);
    for (let h = 0, u = a.length; h < u; h += 2) {
      const f = Zt.transform(l, [e, n, s, r, a[h], a[h + 1]]);
      o.drawImage(c.canvas, f[4], f[5]);
    }
    o.restore(), this.compose();
  }
  paintImageMaskXObjectGroup(t) {
    if (!this.contentVisible)
      return;
    const e = this.ctx, n = this.current.fillColor, s = this.current.patternFill;
    for (const r of t) {
      const {
        data: a,
        width: o,
        height: l,
        transform: c
      } = r, h = this.cachedCanvases.getCanvas("maskCanvas", o, l), u = h.context;
      u.save();
      const f = this.getObject(a, r);
      Nv(u, f), u.globalCompositeOperation = "source-in", u.fillStyle = s ? n.getPattern(u, this, $a(e), Sn.FILL) : n, u.fillRect(0, 0, o, l), u.restore(), e.save(), e.transform(...c), e.scale(1, -1), Hg(e, h.canvas, 0, 0, o, l, 0, -1, 1, 1), e.restore();
    }
    this.compose();
  }
  paintImageXObject(t) {
    if (!this.contentVisible)
      return;
    const e = this.getObject(t);
    if (!e) {
      me("Dependent image isn't ready yet");
      return;
    }
    this.paintInlineImageXObject(e);
  }
  paintImageXObjectRepeat(t, e, n, s) {
    if (!this.contentVisible)
      return;
    const r = this.getObject(t);
    if (!r) {
      me("Dependent image isn't ready yet");
      return;
    }
    const a = r.width, o = r.height, l = [];
    for (let c = 0, h = s.length; c < h; c += 2)
      l.push({
        transform: [e, 0, 0, n, s[c], s[c + 1]],
        x: 0,
        y: 0,
        w: a,
        h: o
      });
    this.paintInlineImageXObjectGroup(r, l);
  }
  applyTransferMapsToCanvas(t) {
    return this.current.transferMaps !== "none" && (t.filter = this.current.transferMaps, t.drawImage(t.canvas, 0, 0), t.filter = "none"), t.canvas;
  }
  applyTransferMapsToBitmap(t) {
    if (this.current.transferMaps === "none")
      return t.bitmap;
    const {
      bitmap: e,
      width: n,
      height: s
    } = t, r = this.cachedCanvases.getCanvas("inlineImage", n, s), a = r.context;
    return a.filter = this.current.transferMaps, a.drawImage(e, 0, 0), a.filter = "none", r.canvas;
  }
  paintInlineImageXObject(t) {
    if (!this.contentVisible)
      return;
    const e = t.width, n = t.height, s = this.ctx;
    this.save();
    const {
      filter: r
    } = s;
    r !== "none" && r !== "" && (s.filter = "none"), s.scale(1 / e, -1 / n);
    let a;
    if (t.bitmap)
      a = this.applyTransferMapsToBitmap(t);
    else if (typeof HTMLElement == "function" && t instanceof HTMLElement || !t.data)
      a = t;
    else {
      const c = this.cachedCanvases.getCanvas("inlineImage", e, n).context;
      Pv(c, t), a = this.applyTransferMapsToCanvas(c);
    }
    const o = this._scaleImage(a, $a(s));
    s.imageSmoothingEnabled = Lv(_i(s), t.interpolate), Hg(s, o.img, 0, 0, o.paintWidth, o.paintHeight, 0, -n, e, n), this.compose(), this.restore();
  }
  paintInlineImageXObjectGroup(t, e) {
    if (!this.contentVisible)
      return;
    const n = this.ctx;
    let s;
    if (t.bitmap)
      s = t.bitmap;
    else {
      const r = t.width, a = t.height, l = this.cachedCanvases.getCanvas("inlineImage", r, a).context;
      Pv(l, t), s = this.applyTransferMapsToCanvas(l);
    }
    for (const r of e)
      n.save(), n.transform(...r.transform), n.scale(1, -1), Hg(n, s, r.x, r.y, r.w, r.h, 0, -1, 1, 1), n.restore();
    this.compose();
  }
  paintSolidColorImageMask() {
    this.contentVisible && (this.ctx.fillRect(0, 0, 1, 1), this.compose());
  }
  markPoint(t) {
  }
  markPointProps(t, e) {
  }
  beginMarkedContent(t) {
    this.markedContentStack.push({
      visible: !0
    });
  }
  beginMarkedContentProps(t, e) {
    t === "OC" ? this.markedContentStack.push({
      visible: this.optionalContentConfig.isVisible(e)
    }) : this.markedContentStack.push({
      visible: !0
    }), this.contentVisible = this.isContentVisible();
  }
  endMarkedContent() {
    this.markedContentStack.pop(), this.contentVisible = this.isContentVisible();
  }
  beginCompat() {
  }
  endCompat() {
  }
  consumePath(t, e) {
    const n = this.current.isEmptyClip();
    this.pendingClip && this.current.updateClipFromPath(), this.pendingClip || this.compose(e);
    const s = this.ctx;
    this.pendingClip && (n || (this.pendingClip === Ov ? s.clip(t, "evenodd") : s.clip(t)), this.pendingClip = null), this.current.startNewPathAndClipBox(this.current.clipBox);
  }
  getSinglePixelWidth() {
    if (!this._cachedGetSinglePixelWidth) {
      const t = _i(this.ctx);
      if (t[1] === 0 && t[2] === 0)
        this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(t[0]), Math.abs(t[3]));
      else {
        const e = Math.abs(t[0] * t[3] - t[2] * t[1]), n = Math.hypot(t[0], t[2]), s = Math.hypot(t[1], t[3]);
        this._cachedGetSinglePixelWidth = Math.max(n, s) / e;
      }
    }
    return this._cachedGetSinglePixelWidth;
  }
  getScaleForStroking() {
    if (this._cachedScaleForStroking[0] === -1) {
      const {
        lineWidth: t
      } = this.current, {
        a: e,
        b: n,
        c: s,
        d: r
      } = this.ctx.getTransform();
      let a, o;
      if (n === 0 && s === 0) {
        const l = Math.abs(e), c = Math.abs(r);
        if (l === c)
          if (t === 0)
            a = o = 1 / l;
          else {
            const h = l * t;
            a = o = h < 1 ? 1 / h : 1;
          }
        else if (t === 0)
          a = 1 / l, o = 1 / c;
        else {
          const h = l * t, u = c * t;
          a = h < 1 ? 1 / h : 1, o = u < 1 ? 1 / u : 1;
        }
      } else {
        const l = Math.abs(e * r - n * s), c = Math.hypot(e, n), h = Math.hypot(s, r);
        if (t === 0)
          a = h / l, o = c / l;
        else {
          const u = t * l;
          a = h > u ? h / u : 1, o = c > u ? c / u : 1;
        }
      }
      this._cachedScaleForStroking[0] = a, this._cachedScaleForStroking[1] = o;
    }
    return this._cachedScaleForStroking;
  }
  rescaleAndStroke(t, e) {
    const {
      ctx: n,
      current: {
        lineWidth: s
      }
    } = this, [r, a] = this.getScaleForStroking();
    if (r === a) {
      n.lineWidth = (s || 1) * r, n.stroke(t);
      return;
    }
    const o = n.getLineDash();
    e && n.save(), n.scale(r, a), u6.a = 1 / r, u6.d = 1 / a;
    const l = new Path2D();
    if (l.addPath(t, u6), o.length > 0) {
      const c = Math.max(r, a);
      n.setLineDash(o.map((h) => h / c)), n.lineDashOffset /= c;
    }
    n.lineWidth = s || 1, n.stroke(l), e && n.restore();
  }
  isContentVisible() {
    for (let t = this.markedContentStack.length - 1; t >= 0; t--)
      if (!this.markedContentStack[t].visible)
        return !1;
    return !0;
  }
};
Ba = new WeakSet(), W7 = function() {
  for (; this.stateStack.length || this.inSMaskMode; )
    this.restore();
  this.current.activeSMask = null, 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);
}, X7 = function() {
  if (this.pageColors) {
    const t = this.filterFactory.addHCMFilter(this.pageColors.foreground, this.pageColors.background);
    if (t !== "none") {
      const e = this.ctx.filter;
      this.ctx.filter = t, this.ctx.drawImage(this.ctx.canvas, 0, 0), this.ctx.filter = e;
    }
  }
}, Y7 = function(t, e, n) {
  const s = new Path2D();
  return s.addPath(t, new DOMMatrix(n).invertSelf().multiplySelf(e)), s;
};
let Au = sv;
for (const i in Y2)
  Au.prototype[i] !== void 0 && (Au.prototype[Y2[i]] = Au.prototype[i]);
var Yp, Kp;
class Ir {
  static get workerPort() {
    return m(this, Yp);
  }
  static set workerPort(t) {
    if (!(typeof Worker < "u" && t instanceof Worker) && t !== null)
      throw new Error("Invalid `workerPort` type.");
    E(this, Yp, t);
  }
  static get workerSrc() {
    return m(this, Kp);
  }
  static set workerSrc(t) {
    if (typeof t != "string")
      throw new Error("Invalid `workerSrc` type.");
    E(this, Kp, t);
  }
}
Yp = new WeakMap(), Kp = new WeakMap(), F(Ir, Yp, null), F(Ir, Kp, "");
var Ju, Zp;
class FM {
  constructor({
    parsedData: t,
    rawData: e
  }) {
    F(this, Ju);
    F(this, Zp);
    E(this, Ju, t), E(this, Zp, e);
  }
  getRaw() {
    return m(this, Zp);
  }
  get(t) {
    return m(this, Ju).get(t) ?? null;
  }
  [Symbol.iterator]() {
    return m(this, Ju).entries();
  }
}
Ju = new WeakMap(), Zp = new WeakMap();
const eu = Symbol("INTERNAL");
var Jp, Qp, tm, Qu;
class IM {
  constructor(t, {
    name: e,
    intent: n,
    usage: s,
    rbGroups: r
  }) {
    F(this, Jp, !1);
    F(this, Qp, !1);
    F(this, tm, !1);
    F(this, Qu, !0);
    E(this, Jp, !!(t & tr.DISPLAY)), E(this, Qp, !!(t & tr.PRINT)), this.name = e, this.intent = n, this.usage = s, this.rbGroups = r;
  }
  get visible() {
    if (m(this, tm))
      return m(this, Qu);
    if (!m(this, Qu))
      return !1;
    const {
      print: t,
      view: e
    } = this.usage;
    return m(this, Jp) ? (e == null ? void 0 : e.viewState) !== "OFF" : m(this, Qp) ? (t == null ? void 0 : t.printState) !== "OFF" : !0;
  }
  _setVisible(t, e, n = !1) {
    t !== eu && Ze("Internal method `_setVisible` called."), E(this, tm, n), E(this, Qu, e);
  }
}
Jp = new WeakMap(), Qp = new WeakMap(), tm = new WeakMap(), Qu = new WeakMap();
var Fc, Xe, td, ed, em, K7;
class MM {
  constructor(t, e = tr.DISPLAY) {
    F(this, em);
    F(this, Fc, null);
    F(this, Xe, /* @__PURE__ */ new Map());
    F(this, td, null);
    F(this, ed, null);
    if (this.renderingIntent = e, this.name = null, this.creator = null, t !== null) {
      this.name = t.name, this.creator = t.creator, E(this, ed, t.order);
      for (const n of t.groups)
        m(this, Xe).set(n.id, new IM(e, n));
      if (t.baseState === "OFF")
        for (const n of m(this, Xe).values())
          n._setVisible(eu, !1);
      for (const n of t.on)
        m(this, Xe).get(n)._setVisible(eu, !0);
      for (const n of t.off)
        m(this, Xe).get(n)._setVisible(eu, !1);
      E(this, td, this.getHash());
    }
  }
  isVisible(t) {
    if (m(this, Xe).size === 0)
      return !0;
    if (!t)
      return x4("Optional content group not defined."), !0;
    if (t.type === "OCG")
      return m(this, Xe).has(t.id) ? m(this, Xe).get(t.id).visible : (me(`Optional content group not found: ${t.id}`), !0);
    if (t.type === "OCMD") {
      if (t.expression)
        return D(this, em, K7).call(this, t.expression);
      if (!t.policy || t.policy === "AnyOn") {
        for (const e of t.ids) {
          if (!m(this, Xe).has(e))
            return me(`Optional content group not found: ${e}`), !0;
          if (m(this, Xe).get(e).visible)
            return !0;
        }
        return !1;
      } else if (t.policy === "AllOn") {
        for (const e of t.ids) {
          if (!m(this, Xe).has(e))
            return me(`Optional content group not found: ${e}`), !0;
          if (!m(this, Xe).get(e).visible)
            return !1;
        }
        return !0;
      } else if (t.policy === "AnyOff") {
        for (const e of t.ids) {
          if (!m(this, Xe).has(e))
            return me(`Optional content group not found: ${e}`), !0;
          if (!m(this, Xe).get(e).visible)
            return !0;
        }
        return !1;
      } else if (t.policy === "AllOff") {
        for (const e of t.ids) {
          if (!m(this, Xe).has(e))
            return me(`Optional content group not found: ${e}`), !0;
          if (m(this, Xe).get(e).visible)
            return !1;
        }
        return !0;
      }
      return me(`Unknown optional content policy ${t.policy}.`), !0;
    }
    return me(`Unknown group type ${t.type}.`), !0;
  }
  setVisibility(t, e = !0, n = !0) {
    var r;
    const s = m(this, Xe).get(t);
    if (!s) {
      me(`Optional content group not found: ${t}`);
      return;
    }
    if (n && e && s.rbGroups.length)
      for (const a of s.rbGroups)
        for (const o of a)
          o !== t && ((r = m(this, Xe).get(o)) == null || r._setVisible(eu, !1, !0));
    s._setVisible(eu, !!e, !0), E(this, Fc, null);
  }
  setOCGState({
    state: t,
    preserveRB: e
  }) {
    let n;
    for (const s of t) {
      switch (s) {
        case "ON":
        case "OFF":
        case "Toggle":
          n = s;
          continue;
      }
      const r = m(this, Xe).get(s);
      if (r)
        switch (n) {
          case "ON":
            this.setVisibility(s, !0, e);
            break;
          case "OFF":
            this.setVisibility(s, !1, e);
            break;
          case "Toggle":
            this.setVisibility(s, !r.visible, e);
            break;
        }
    }
    E(this, Fc, null);
  }
  get hasInitialVisibility() {
    return m(this, td) === null || this.getHash() === m(this, td);
  }
  getOrder() {
    return m(this, Xe).size ? m(this, ed) ? m(this, ed).slice() : [...m(this, Xe).keys()] : null;
  }
  getGroup(t) {
    return m(this, Xe).get(t) || null;
  }
  getHash() {
    if (m(this, Fc) !== null)
      return m(this, Fc);
    const t = new BS();
    for (const [e, n] of m(this, Xe))
      t.update(`${e}:${n.visible}`);
    return E(this, Fc, t.hexdigest());
  }
  [Symbol.iterator]() {
    return m(this, Xe).entries();
  }
}
Fc = new WeakMap(), Xe = new WeakMap(), td = new WeakMap(), ed = new WeakMap(), em = new WeakSet(), K7 = function(t) {
  const e = t.length;
  if (e < 2)
    return !0;
  const n = t[0];
  for (let s = 1; s < e; s++) {
    const r = t[s];
    let a;
    if (Array.isArray(r))
      a = D(this, em, K7).call(this, r);
    else if (m(this, Xe).has(r))
      a = m(this, Xe).get(r).visible;
    else
      return me(`Optional content group not found: ${r}`), !0;
    switch (n) {
      case "And":
        if (!a)
          return !1;
        break;
      case "Or":
        if (a)
          return !0;
        break;
      case "Not":
        return !a;
      default:
        return !0;
    }
  }
  return n === "And";
};
class RM {
  constructor(t, {
    disableRange: e = !1,
    disableStream: n = !1
  }) {
    Vi(t, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');
    const {
      length: s,
      initialData: r,
      progressiveDone: a,
      contentDispositionFilename: o
    } = t;
    if (this._queuedChunks = [], this._progressiveDone = a, this._contentDispositionFilename = o, (r == null ? void 0 : r.length) > 0) {
      const l = r instanceof Uint8Array && r.byteLength === r.buffer.byteLength ? r.buffer : new Uint8Array(r).buffer;
      this._queuedChunks.push(l);
    }
    this._pdfDataRangeTransport = t, this._isStreamingSupported = !n, this._isRangeSupported = !e, this._contentLength = s, this._fullRequestReader = null, this._rangeReaders = [], t.addRangeListener((l, c) => {
      this._onReceiveData({
        begin: l,
        chunk: c
      });
    }), t.addProgressListener((l, c) => {
      this._onProgress({
        loaded: l,
        total: c
      });
    }), t.addProgressiveReadListener((l) => {
      this._onReceiveData({
        chunk: l
      });
    }), t.addProgressiveDoneListener(() => {
      this._onProgressiveDone();
    }), t.transportReady();
  }
  _onReceiveData({
    begin: t,
    chunk: e
  }) {
    const n = e instanceof Uint8Array && e.byteLength === e.buffer.byteLength ? e.buffer : new Uint8Array(e).buffer;
    if (t === void 0)
      this._fullRequestReader ? this._fullRequestReader._enqueue(n) : this._queuedChunks.push(n);
    else {
      const s = this._rangeReaders.some(function(r) {
        return r._begin !== t ? !1 : (r._enqueue(n), !0);
      });
      Vi(s, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");
    }
  }
  get _progressiveDataLength() {
    var t;
    return ((t = this._fullRequestReader) == null ? void 0 : t._loaded) ?? 0;
  }
  _onProgress(t) {
    var e, n, s, r;
    t.total === void 0 ? (n = (e = this._rangeReaders[0]) == null ? void 0 : e.onProgress) == null || n.call(e, {
      loaded: t.loaded
    }) : (r = (s = this._fullRequestReader) == null ? void 0 : s.onProgress) == null || r.call(s, {
      loaded: t.loaded,
      total: t.total
    });
  }
  _onProgressiveDone() {
    var t;
    (t = this._fullRequestReader) == null || t.progressiveDone(), this._progressiveDone = !0;
  }
  _removeRangeReader(t) {
    const e = this._rangeReaders.indexOf(t);
    e >= 0 && this._rangeReaders.splice(e, 1);
  }
  getFullReader() {
    Vi(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
    const t = this._queuedChunks;
    return this._queuedChunks = null, new BM(this, t, this._progressiveDone, this._contentDispositionFilename);
  }
  getRangeReader(t, e) {
    if (e <= this._progressiveDataLength)
      return null;
    const n = new PM(this, t, e);
    return this._pdfDataRangeTransport.requestDataRange(t, e), this._rangeReaders.push(n), n;
  }
  cancelAllRequests(t) {
    var e;
    (e = this._fullRequestReader) == null || e.cancel(t);
    for (const n of this._rangeReaders.slice(0))
      n.cancel(t);
    this._pdfDataRangeTransport.abort();
  }
}
class BM {
  constructor(t, e, n = !1, s = null) {
    this._stream = t, this._done = n || !1, this._filename = A4(s) ? s : null, this._queuedChunks = e || [], this._loaded = 0;
    for (const r of this._queuedChunks)
      this._loaded += r.byteLength;
    this._requests = [], this._headersReady = Promise.resolve(), t._fullRequestReader = this, this.onProgress = null;
  }
  _enqueue(t) {
    this._done || (this._requests.length > 0 ? this._requests.shift().resolve({
      value: t,
      done: !1
    }) : this._queuedChunks.push(t), this._loaded += t.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 t = Promise.withResolvers();
    return this._requests.push(t), t.promise;
  }
  cancel(t) {
    this._done = !0;
    for (const e of this._requests)
      e.resolve({
        value: void 0,
        done: !0
      });
    this._requests.length = 0;
  }
  progressiveDone() {
    this._done || (this._done = !0);
  }
}
class PM {
  constructor(t, e, n) {
    this._stream = t, this._begin = e, this._end = n, this._queuedChunk = null, this._requests = [], this._done = !1, this.onProgress = null;
  }
  _enqueue(t) {
    if (!this._done) {
      if (this._requests.length === 0)
        this._queuedChunk = t;
      else {
        this._requests.shift().resolve({
          value: t,
          done: !1
        });
        for (const n of this._requests)
          n.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 e = this._queuedChunk;
      return this._queuedChunk = null, {
        value: e,
        done: !1
      };
    }
    if (this._done)
      return {
        value: void 0,
        done: !0
      };
    const t = Promise.withResolvers();
    return this._requests.push(t), t.promise;
  }
  cancel(t) {
    this._done = !0;
    for (const e of this._requests)
      e.resolve({
        value: void 0,
        done: !0
      });
    this._requests.length = 0, this._stream._removeRangeReader(this);
  }
}
function NM(i) {
  let t = !0, e = n("filename\\*", "i").exec(i);
  if (e) {
    e = e[1];
    let h = o(e);
    return h = unescape(h), h = l(h), h = c(h), r(h);
  }
  if (e = a(i), e) {
    const h = c(e);
    return r(h);
  }
  if (e = n("filename", "i").exec(i), e) {
    e = e[1];
    let h = o(e);
    return h = c(h), r(h);
  }
  function n(h, u) {
    return new RegExp("(?:^|;)\\s*" + h + '\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)', u);
  }
  function s(h, u) {
    if (h) {
      if (!/^[\x00-\xFF]+$/.test(u))
        return u;
      try {
        const f = new TextDecoder(h, {
          fatal: !0
        }), d = mg(u);
        u = f.decode(d), t = !1;
      } catch {
      }
    }
    return u;
  }
  function r(h) {
    return t && /[\x80-\xff]/.test(h) && (h = s("utf-8", h), t && (h = s("iso-8859-1", h))), h;
  }
  function a(h) {
    const u = [];
    let f;
    const d = n("filename\\*((?!0\\d)\\d+)(\\*?)", "ig");
    for (; (f = d.exec(h)) !== null; ) {
      let [, g, b, y] = f;
      if (g = parseInt(g, 10), g in u) {
        if (g === 0)
          break;
        continue;
      }
      u[g] = [b, y];
    }
    const p = [];
    for (let g = 0; g < u.length && g in u; ++g) {
      let [b, y] = u[g];
      y = o(y), b && (y = unescape(y), g === 0 && (y = l(y))), p.push(y);
    }
    return p.join("");
  }
  function o(h) {
    if (h.startsWith('"')) {
      const u = h.slice(1).split('\\"');
      for (let f = 0; f < u.length; ++f) {
        const d = u[f].indexOf('"');
        d !== -1 && (u[f] = u[f].slice(0, d), u.length = f + 1), u[f] = u[f].replaceAll(/\\(.)/g, "$1");
      }
      h = u.join('"');
    }
    return h;
  }
  function l(h) {
    const u = h.indexOf("'");
    if (u === -1)
      return h;
    const f = h.slice(0, u), p = h.slice(u + 1).replace(/^[^']*'/, "");
    return s(f, p);
  }
  function c(h) {
    return !h.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(h) ? h : h.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function(u, f, d, p) {
      if (d === "q" || d === "Q")
        return p = p.replaceAll("_", " "), p = p.replaceAll(/=([0-9a-fA-F]{2})/g, function(g, b) {
          return String.fromCharCode(parseInt(b, 16));
        }), s(f, p);
      try {
        p = atob(p);
      } catch {
      }
      return s(f, p);
    });
  }
  return "";
}
function WS(i, t) {
  const e = new Headers();
  if (!i || !t || typeof t != "object")
    return e;
  for (const n in t) {
    const s = t[n];
    s !== void 0 && e.append(n, s);
  }
  return e;
}
function C4(i) {
  var t;
  return ((t = URL.parse(i)) == null ? void 0 : t.origin) ?? null;
}
function XS({
  responseHeaders: i,
  isHttp: t,
  rangeChunkSize: e,
  disableRange: n
}) {
  const s = {
    allowRangeRequests: !1,
    suggestedLength: void 0
  }, r = parseInt(i.get("Content-Length"), 10);
  return !Number.isInteger(r) || (s.suggestedLength = r, r <= 2 * e) || n || !t || i.get("Accept-Ranges") !== "bytes" || (i.get("Content-Encoding") || "identity") !== "identity" || (s.allowRangeRequests = !0), s;
}
function YS(i) {
  const t = i.get("Content-Disposition");
  if (t) {
    let e = NM(t);
    if (e.includes("%"))
      try {
        e = decodeURIComponent(e);
      } catch {
      }
    if (A4(e))
      return e;
  }
  return null;
}
function wg(i, t) {
  return new K2(`Unexpected server response (${i}) while retrieving PDF "${t}".`, i, i === 404 || i === 0 && t.startsWith("file:"));
}
function KS(i) {
  return i === 200 || i === 206;
}
function ZS(i, t, e) {
  return {
    method: "GET",
    headers: i,
    signal: e.signal,
    mode: "cors",
    credentials: t ? "include" : "same-origin",
    redirect: "follow"
  };
}
function JS(i) {
  return i instanceof Uint8Array ? i.buffer : i instanceof ArrayBuffer ? i : (me(`getArrayBuffer - unexpected data format: ${i}`), new Uint8Array(i).buffer);
}
class LM {
  constructor(t) {
    ft(this, "_responseOrigin", null);
    this.source = t, this.isHttp = /^https?:/i.test(t.url), this.headers = WS(this.isHttp, t.httpHeaders), this._fullRequestReader = null, this._rangeRequestReaders = [];
  }
  get _progressiveDataLength() {
    var t;
    return ((t = this._fullRequestReader) == null ? void 0 : t._loaded) ?? 0;
  }
  getFullReader() {
    return Vi(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new OM(this), this._fullRequestReader;
  }
  getRangeReader(t, e) {
    if (e <= this._progressiveDataLength)
      return null;
    const n = new $M(this, t, e);
    return this._rangeRequestReaders.push(n), n;
  }
  cancelAllRequests(t) {
    var e;
    (e = this._fullRequestReader) == null || e.cancel(t);
    for (const n of this._rangeRequestReaders.slice(0))
      n.cancel(t);
  }
}
class OM {
  constructor(t) {
    this._stream = t, this._reader = null, this._loaded = 0, this._filename = null;
    const e = t.source;
    this._withCredentials = e.withCredentials || !1, this._contentLength = e.length, this._headersCapability = Promise.withResolvers(), this._disableRange = e.disableRange || !1, this._rangeChunkSize = e.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._abortController = new AbortController(), this._isStreamingSupported = !e.disableStream, this._isRangeSupported = !e.disableRange;
    const n = new Headers(t.headers), s = e.url;
    fetch(s, ZS(n, this._withCredentials, this._abortController)).then((r) => {
      if (t._responseOrigin = C4(r.url), !KS(r.status))
        throw wg(r.status, s);
      this._reader = r.body.getReader(), this._headersCapability.resolve();
      const a = r.headers, {
        allowRangeRequests: o,
        suggestedLength: l
      } = XS({
        responseHeaders: a,
        isHttp: t.isHttp,
        rangeChunkSize: this._rangeChunkSize,
        disableRange: this._disableRange
      });
      this._isRangeSupported = o, this._contentLength = l || this._contentLength, this._filename = YS(a), !this._isStreamingSupported && this._isRangeSupported && this.cancel(new Hl("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 n;
    await this._headersCapability.promise;
    const {
      value: t,
      done: e
    } = await this._reader.read();
    return e ? {
      value: t,
      done: e
    } : (this._loaded += t.byteLength, (n = this.onProgress) == null || n.call(this, {
      loaded: this._loaded,
      total: this._contentLength
    }), {
      value: JS(t),
      done: !1
    });
  }
  cancel(t) {
    var e;
    (e = this._reader) == null || e.cancel(t), this._abortController.abort();
  }
}
class $M {
  constructor(t, e, n) {
    this._stream = t, this._reader = null, this._loaded = 0;
    const s = t.source;
    this._withCredentials = s.withCredentials || !1, this._readCapability = Promise.withResolvers(), this._isStreamingSupported = !s.disableStream, this._abortController = new AbortController();
    const r = new Headers(t.headers);
    r.append("Range", `bytes=${e}-${n - 1}`);
    const a = s.url;
    fetch(a, ZS(r, this._withCredentials, this._abortController)).then((o) => {
      const l = C4(o.url);
      if (l !== t._responseOrigin)
        throw new Error(`Expected range response-origin "${l}" to match "${t._responseOrigin}".`);
      if (!KS(o.status))
        throw wg(o.status, a);
      this._readCapability.resolve(), this._reader = o.body.getReader();
    }).catch(this._readCapability.reject), this.onProgress = null;
  }
  get isStreamingSupported() {
    return this._isStreamingSupported;
  }
  async read() {
    var n;
    await this._readCapability.promise;
    const {
      value: t,
      done: e
    } = await this._reader.read();
    return e ? {
      value: t,
      done: e
    } : (this._loaded += t.byteLength, (n = this.onProgress) == null || n.call(this, {
      loaded: this._loaded
    }), {
      value: JS(t),
      done: !1
    });
  }
  cancel(t) {
    var e;
    (e = this._reader) == null || e.cancel(t), this._abortController.abort();
  }
}
const d6 = 200, f6 = 206;
function qM(i) {
  const t = i.response;
  return typeof t != "string" ? t : mg(t).buffer;
}
class zM {
  constructor({
    url: t,
    httpHeaders: e,
    withCredentials: n
  }) {
    ft(this, "_responseOrigin", null);
    this.url = t, this.isHttp = /^https?:/i.test(t), this.headers = WS(this.isHttp, e), this.withCredentials = n || !1, this.currXhrId = 0, this.pendingRequests = /* @__PURE__ */ Object.create(null);
  }
  request(t) {
    const e = new XMLHttpRequest(), n = this.currXhrId++, s = this.pendingRequests[n] = {
      xhr: e
    };
    e.open("GET", this.url), e.withCredentials = this.withCredentials;
    for (const [r, a] of this.headers)
      e.setRequestHeader(r, a);
    return this.isHttp && "begin" in t && "end" in t ? (e.setRequestHeader("Range", `bytes=${t.begin}-${t.end - 1}`), s.expectedStatus = f6) : s.expectedStatus = d6, e.responseType = "arraybuffer", Vi(t.onError, "Expected `onError` callback to be provided."), e.onerror = () => {
      t.onError(e.status);
    }, e.onreadystatechange = this.onStateChange.bind(this, n), e.onprogress = this.onProgress.bind(this, n), s.onHeadersReceived = t.onHeadersReceived, s.onDone = t.onDone, s.onError = t.onError, s.onProgress = t.onProgress, e.send(null), n;
  }
  onProgress(t, e) {
    var s;
    const n = this.pendingRequests[t];
    n && ((s = n.onProgress) == null || s.call(n, e));
  }
  onStateChange(t, e) {
    const n = this.pendingRequests[t];
    if (!n)
      return;
    const s = n.xhr;
    if (s.readyState >= 2 && n.onHeadersReceived && (n.onHeadersReceived(), delete n.onHeadersReceived), s.readyState !== 4 || !(t in this.pendingRequests))
      return;
    if (delete this.pendingRequests[t], s.status === 0 && this.isHttp) {
      n.onError(s.status);
      return;
    }
    const r = s.status || d6;
    if (!(r === d6 && n.expectedStatus === f6) && r !== n.expectedStatus) {
      n.onError(s.status);
      return;
    }
    const o = qM(s);
    if (r === f6) {
      const l = s.getResponseHeader("Content-Range"), c = /bytes (\d+)-(\d+)\/(\d+)/.exec(l);
      c ? n.onDone({
        begin: parseInt(c[1], 10),
        chunk: o
      }) : (me('Missing or invalid "Content-Range" header.'), n.onError(0));
    } else o ? n.onDone({
      begin: 0,
      chunk: o
    }) : n.onError(s.status);
  }
  getRequestXhr(t) {
    return this.pendingRequests[t].xhr;
  }
  isPendingRequest(t) {
    return t in this.pendingRequests;
  }
  abortRequest(t) {
    const e = this.pendingRequests[t].xhr;
    delete this.pendingRequests[t], e.abort();
  }
}
class UM {
  constructor(t) {
    this._source = t, this._manager = new zM(t), this._rangeChunkSize = t.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
  }
  _onRangeRequestReaderClosed(t) {
    const e = this._rangeRequestReaders.indexOf(t);
    e >= 0 && this._rangeRequestReaders.splice(e, 1);
  }
  getFullReader() {
    return Vi(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new HM(this._manager, this._source), this._fullRequestReader;
  }
  getRangeReader(t, e) {
    const n = new jM(this._manager, t, e);
    return n.onClosed = this._onRangeRequestReaderClosed.bind(this), this._rangeRequestReaders.push(n), n;
  }
  cancelAllRequests(t) {
    var e;
    (e = this._fullRequestReader) == null || e.cancel(t);
    for (const n of this._rangeRequestReaders.slice(0))
      n.cancel(t);
  }
}
class HM {
  constructor(t, e) {
    this._manager = t, this._url = e.url, this._fullRequestId = t.request({
      onHeadersReceived: this._onHeadersReceived.bind(this),
      onDone: this._onDone.bind(this),
      onError: this._onError.bind(this),
      onProgress: this._onProgress.bind(this)
    }), this._headersCapability = Promise.withResolvers(), this._disableRange = e.disableRange || !1, this._contentLength = e.length, this._rangeChunkSize = e.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 t = this._fullRequestId, e = this._manager.getRequestXhr(t);
    this._manager._responseOrigin = C4(e.responseURL);
    const n = e.getAllResponseHeaders(), s = new Headers(n ? n.trimStart().replace(/[^\S ]+$/, "").split(/[\r\n]+/).map((o) => {
      const [l, ...c] = o.split(": ");
      return [l, c.join(": ")];
    }) : []), {
      allowRangeRequests: r,
      suggestedLength: a
    } = XS({
      responseHeaders: s,
      isHttp: this._manager.isHttp,
      rangeChunkSize: this._rangeChunkSize,
      disableRange: this._disableRange
    });
    r && (this._isRangeSupported = !0), this._contentLength = a || this._contentLength, this._filename = YS(s), this._isRangeSupported && this._manager.abortRequest(t), this._headersCapability.resolve();
  }
  _onDone(t) {
    if (t && (this._requests.length > 0 ? this._requests.shift().resolve({
      value: t.chunk,
      done: !1
    }) : this._cachedChunks.push(t.chunk)), this._done = !0, !(this._cachedChunks.length > 0)) {
      for (const e of this._requests)
        e.resolve({
          value: void 0,
          done: !0
        });
      this._requests.length = 0;
    }
  }
  _onError(t) {
    this._storedError = wg(t, this._url), this._headersCapability.reject(this._storedError);
    for (const e of this._requests)
      e.reject(this._storedError);
    this._requests.length = 0, this._cachedChunks.length = 0;
  }
  _onProgress(t) {
    var e;
    (e = this.onProgress) == null || e.call(this, {
      loaded: t.loaded,
      total: t.lengthComputable ? t.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._headersCapability.promise;
  }
  async read() {
    if (await this._headersCapability.promise, 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 t = Promise.withResolvers();
    return this._requests.push(t), t.promise;
  }
  cancel(t) {
    this._done = !0, this._headersCapability.reject(t);
    for (const e of this._requests)
      e.resolve({
        value: void 0,
        done: !0
      });
    this._requests.length = 0, this._manager.isPendingRequest(this._fullRequestId) && this._manager.abortRequest(this._fullRequestId), this._fullRequestReader = null;
  }
}
class jM {
  constructor(t, e, n) {
    this._manager = t, this._url = t.url, this._requestId = t.request({
      begin: e,
      end: n,
      onHeadersReceived: this._onHeadersReceived.bind(this),
      onDone: this._onDone.bind(this),
      onError: this._onError.bind(this),
      onProgress: this._onProgress.bind(this)
    }), this._requests = [], this._queuedChunk = null, this._done = !1, this._storedError = void 0, this.onProgress = null, this.onClosed = null;
  }
  _onHeadersReceived() {
    var e;
    const t = C4((e = this._manager.getRequestXhr(this._requestId)) == null ? void 0 : e.responseURL);
    t !== this._manager._responseOrigin && (this._storedError = new Error(`Expected range response-origin "${t}" to match "${this._manager._responseOrigin}".`), this._onError(0));
  }
  _close() {
    var t;
    (t = this.onClosed) == null || t.call(this, this);
  }
  _onDone(t) {
    const e = t.chunk;
    this._requests.length > 0 ? this._requests.shift().resolve({
      value: e,
      done: !1
    }) : this._queuedChunk = e, this._done = !0;
    for (const n of this._requests)
      n.resolve({
        value: void 0,
        done: !0
      });
    this._requests.length = 0, this._close();
  }
  _onError(t) {
    this._storedError ?? (this._storedError = wg(t, this._url));
    for (const e of this._requests)
      e.reject(this._storedError);
    this._requests.length = 0, this._queuedChunk = null;
  }
  _onProgress(t) {
    var e;
    this.isStreamingSupported || (e = this.onProgress) == null || e.call(this, {
      loaded: t.loaded
    });
  }
  get isStreamingSupported() {
    return !1;
  }
  async read() {
    if (this._storedError)
      throw this._storedError;
    if (this._queuedChunk !== null) {
      const e = this._queuedChunk;
      return this._queuedChunk = null, {
        value: e,
        done: !1
      };
    }
    if (this._done)
      return {
        value: void 0,
        done: !0
      };
    const t = Promise.withResolvers();
    return this._requests.push(t), t.promise;
  }
  cancel(t) {
    this._done = !0;
    for (const e of this._requests)
      e.resolve({
        value: void 0,
        done: !0
      });
    this._requests.length = 0, this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close();
  }
}
const GM = /^[a-z][a-z0-9\-+.]+:/i;
function VM(i) {
  if (GM.test(i))
    return new URL(i);
  const t = process.getBuiltinModule("url");
  return new URL(t.pathToFileURL(i));
}
class WM {
  constructor(t) {
    this.source = t, this.url = VM(t.url), Vi(this.url.protocol === "file:", "PDFNodeStream only supports file:// URLs."), this._fullRequestReader = null, this._rangeRequestReaders = [];
  }
  get _progressiveDataLength() {
    var t;
    return ((t = this._fullRequestReader) == null ? void 0 : t._loaded) ?? 0;
  }
  getFullReader() {
    return Vi(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = new XM(this), this._fullRequestReader;
  }
  getRangeReader(t, e) {
    if (e <= this._progressiveDataLength)
      return null;
    const n = new YM(this, t, e);
    return this._rangeRequestReaders.push(n), n;
  }
  cancelAllRequests(t) {
    var e;
    (e = this._fullRequestReader) == null || e.cancel(t);
    for (const n of this._rangeRequestReaders.slice(0))
      n.cancel(t);
  }
}
class XM {
  constructor(t) {
    this._url = t.url, this._done = !1, this._storedError = null, this.onProgress = null;
    const e = t.source;
    this._contentLength = e.length, this._loaded = 0, this._filename = null, this._disableRange = e.disableRange || !1, this._rangeChunkSize = e.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._isStreamingSupported = !e.disableStream, this._isRangeSupported = !e.disableRange, this._readableStream = null, this._readCapability = Promise.withResolvers(), this._headersCapability = Promise.withResolvers();
    const n = process.getBuiltinModule("fs");
    n.promises.lstat(this._url).then((s) => {
      this._contentLength = s.size, this._setReadableStream(n.createReadStream(this._url)), this._headersCapability.resolve();
    }, (s) => {
      s.code === "ENOENT" && (s = wg(0, this._url.href)), this._storedError = s, this._headersCapability.reject(s);
    });
  }
  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 n;
    if (await this._readCapability.promise, this._done)
      return {
        value: void 0,
        done: !0
      };
    if (this._storedError)
      throw this._storedError;
    const t = this._readableStream.read();
    return t === null ? (this._readCapability = Promise.withResolvers(), this.read()) : (this._loaded += t.length, (n = this.onProgress) == null || n.call(this, {
      loaded: this._loaded,
      total: this._contentLength
    }), {
      value: new Uint8Array(t).buffer,
      done: !1
    });
  }
  cancel(t) {
    if (!this._readableStream) {
      this._error(t);
      return;
    }
    this._readableStream.destroy(t);
  }
  _error(t) {
    this._storedError = t, this._readCapability.resolve();
  }
  _setReadableStream(t) {
    this._readableStream = t, t.on("readable", () => {
      this._readCapability.resolve();
    }), t.on("end", () => {
      t.destroy(), this._done = !0, this._readCapability.resolve();
    }), t.on("error", (e) => {
      this._error(e);
    }), !this._isStreamingSupported && this._isRangeSupported && this._error(new Hl("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
  }
}
class YM {
  constructor(t, e, n) {
    this._url = t.url, this._done = !1, this._storedError = null, this.onProgress = null, this._loaded = 0, this._readableStream = null, this._readCapability = Promise.withResolvers();
    const s = t.source;
    this._isStreamingSupported = !s.disableStream;
    const r = process.getBuiltinModule("fs");
    this._setReadableStream(r.createReadStream(this._url, {
      start: e,
      end: n - 1
    }));
  }
  get isStreamingSupported() {
    return this._isStreamingSupported;
  }
  async read() {
    var n;
    if (await this._readCapability.promise, this._done)
      return {
        value: void 0,
        done: !0
      };
    if (this._storedError)
      throw this._storedError;
    const t = this._readableStream.read();
    return t === null ? (this._readCapability = Promise.withResolvers(), this.read()) : (this._loaded += t.length, (n = this.onProgress) == null || n.call(this, {
      loaded: this._loaded
    }), {
      value: new Uint8Array(t).buffer,
      done: !1
    });
  }
  cancel(t) {
    if (!this._readableStream) {
      this._error(t);
      return;
    }
    this._readableStream.destroy(t);
  }
  _error(t) {
    this._storedError = t, this._readCapability.resolve();
  }
  _setReadableStream(t) {
    this._readableStream = t, t.on("readable", () => {
      this._readCapability.resolve();
    }), t.on("end", () => {
      t.destroy(), this._done = !0, this._readCapability.resolve();
    }), t.on("error", (e) => {
      this._error(e);
    }), this._storedError && this._readableStream.destroy(this._storedError);
  }
}
const Sf = Symbol("INITIAL_DATA");
var js, im, Z7;
class QS {
  constructor() {
    F(this, im);
    F(this, js, /* @__PURE__ */ Object.create(null));
  }
  get(t, e = null) {
    if (e) {
      const s = D(this, im, Z7).call(this, t);
      return s.promise.then(() => e(s.data)), null;
    }
    const n = m(this, js)[t];
    if (!n || n.data === Sf)
      throw new Error(`Requesting object that isn't resolved yet ${t}.`);
    return n.data;
  }
  has(t) {
    const e = m(this, js)[t];
    return !!e && e.data !== Sf;
  }
  delete(t) {
    const e = m(this, js)[t];
    return !e || e.data === Sf ? !1 : (delete m(this, js)[t], !0);
  }
  resolve(t, e = null) {
    const n = D(this, im, Z7).call(this, t);
    n.data = e, n.resolve();
  }
  clear() {
    var t;
    for (const e in m(this, js)) {
      const {
        data: n
      } = m(this, js)[e];
      (t = n == null ? void 0 : n.bitmap) == null || t.close();
    }
    E(this, js, /* @__PURE__ */ Object.create(null));
  }
  *[Symbol.iterator]() {
    for (const t in m(this, js)) {
      const {
        data: e
      } = m(this, js)[t];
      e !== Sf && (yield [t, e]);
    }
  }
}
js = new WeakMap(), im = new WeakSet(), Z7 = function(t) {
  var e;
  return (e = m(this, js))[t] || (e[t] = {
    ...Promise.withResolvers(),
    data: Sf
  });
};
const KM = 1e5, $v = 30;
var XA, Ic, Ss, nm, sm, Ch, ul, rm, am, Eh, id, nd, Mc, sd, om, rd, Dh, lm, cm, ad, Th, hm, Rc, od, Kl, tC, eC, J7, lr, H5, Q7, iC, nC;
const Ji = class Ji {
  constructor({
    textContentSource: t,
    container: e,
    viewport: n
  }) {
    F(this, Kl);
    F(this, Ic, Promise.withResolvers());
    F(this, Ss, null);
    F(this, nm, !1);
    F(this, sm, !!((XA = globalThis.FontInspector) != null && XA.enabled));
    F(this, Ch, null);
    F(this, ul, null);
    F(this, rm, 0);
    F(this, am, 0);
    F(this, Eh, null);
    F(this, id, null);
    F(this, nd, 0);
    F(this, Mc, 0);
    F(this, sd, /* @__PURE__ */ Object.create(null));
    F(this, om, []);
    F(this, rd, null);
    F(this, Dh, []);
    F(this, lm, /* @__PURE__ */ new WeakMap());
    F(this, cm, null);
    var l;
    if (t instanceof ReadableStream)
      E(this, rd, t);
    else if (typeof t == "object")
      E(this, rd, new ReadableStream({
        start(c) {
          c.enqueue(t), c.close();
        }
      }));
    else
      throw new Error('No "textContentSource" parameter specified.');
    E(this, Ss, E(this, id, e)), E(this, Mc, n.scale * Ia.pixelRatio), E(this, nd, n.rotation), E(this, ul, {
      div: null,
      properties: null,
      ctx: null
    });
    const {
      pageWidth: s,
      pageHeight: r,
      pageX: a,
      pageY: o
    } = n.rawDims;
    E(this, cm, [1, 0, 0, -1, -a, o + r]), E(this, am, s), E(this, rm, r), D(l = Ji, lr, iC).call(l), h0(e, n), m(this, Ic).promise.finally(() => {
      m(Ji, od).delete(this), E(this, ul, null), E(this, sd, null);
    }).catch(() => {
    });
  }
  static get fontFamilyMap() {
    const {
      isWindows: t,
      isFirefox: e
    } = gn.platform;
    return Fe(this, "fontFamilyMap", /* @__PURE__ */ new Map([["sans-serif", `${t && e ? "Calibri, " : ""}sans-serif`], ["monospace", `${t && e ? "Lucida Console, " : ""}monospace`]]));
  }
  render() {
    const t = () => {
      m(this, Eh).read().then(({
        value: e,
        done: n
      }) => {
        if (n) {
          m(this, Ic).resolve();
          return;
        }
        m(this, Ch) ?? E(this, Ch, e.lang), Object.assign(m(this, sd), e.styles), D(this, Kl, tC).call(this, e.items), t();
      }, m(this, Ic).reject);
    };
    return E(this, Eh, m(this, rd).getReader()), m(Ji, od).add(this), t(), m(this, Ic).promise;
  }
  update({
    viewport: t,
    onBefore: e = null
  }) {
    var r;
    const n = t.scale * Ia.pixelRatio, s = t.rotation;
    if (s !== m(this, nd) && (e == null || e(), E(this, nd, s), h0(m(this, id), {
      rotation: s
    })), n !== m(this, Mc)) {
      e == null || e(), E(this, Mc, n);
      const a = {
        div: null,
        properties: null,
        ctx: D(r = Ji, lr, H5).call(r, m(this, Ch))
      };
      for (const o of m(this, Dh))
        a.properties = m(this, lm).get(o), a.div = o, D(this, Kl, J7).call(this, a);
    }
  }
  cancel() {
    var e;
    const t = new Hl("TextLayer task cancelled.");
    (e = m(this, Eh)) == null || e.cancel(t).catch(() => {
    }), E(this, Eh, null), m(this, Ic).reject(t);
  }
  get textDivs() {
    return m(this, Dh);
  }
  get textContentItemsStr() {
    return m(this, om);
  }
  static cleanup() {
    if (!(m(this, od).size > 0)) {
      m(this, ad).clear();
      for (const {
        canvas: t
      } of m(this, Th).values())
        t.remove();
      m(this, Th).clear();
    }
  }
};
Ic = new WeakMap(), Ss = new WeakMap(), nm = new WeakMap(), sm = new WeakMap(), Ch = new WeakMap(), ul = new WeakMap(), rm = new WeakMap(), am = new WeakMap(), Eh = new WeakMap(), id = new WeakMap(), nd = new WeakMap(), Mc = new WeakMap(), sd = new WeakMap(), om = new WeakMap(), rd = new WeakMap(), Dh = new WeakMap(), lm = new WeakMap(), cm = new WeakMap(), ad = new WeakMap(), Th = new WeakMap(), hm = new WeakMap(), Rc = new WeakMap(), od = new WeakMap(), Kl = new WeakSet(), tC = function(t) {
  var s, r;
  if (m(this, nm))
    return;
  (r = m(this, ul)).ctx ?? (r.ctx = D(s = Ji, lr, H5).call(s, m(this, Ch)));
  const e = m(this, Dh), n = m(this, om);
  for (const a of t) {
    if (e.length > KM) {
      me("Ignoring additional textDivs for performance reasons."), E(this, nm, !0);
      return;
    }
    if (a.str === void 0) {
      if (a.type === "beginMarkedContentProps" || a.type === "beginMarkedContent") {
        const o = m(this, Ss);
        E(this, Ss, document.createElement("span")), m(this, Ss).classList.add("markedContent"), a.id !== null && m(this, Ss).setAttribute("id", `${a.id}`), o.append(m(this, Ss));
      } else a.type === "endMarkedContent" && E(this, Ss, m(this, Ss).parentNode);
      continue;
    }
    n.push(a.str), D(this, Kl, eC).call(this, a);
  }
}, eC = function(t) {
  var g;
  const e = document.createElement("span"), n = {
    angle: 0,
    canvasWidth: 0,
    hasText: t.str !== "",
    hasEOL: t.hasEOL,
    fontSize: 0
  };
  m(this, Dh).push(e);
  const s = Zt.transform(m(this, cm), t.transform);
  let r = Math.atan2(s[1], s[0]);
  const a = m(this, sd)[t.fontName];
  a.vertical && (r += Math.PI / 2);
  let o = m(this, sm) && a.fontSubstitution || a.fontFamily;
  o = Ji.fontFamilyMap.get(o) || o;
  const l = Math.hypot(s[2], s[3]), c = l * D(g = Ji, lr, nC).call(g, o, a, m(this, Ch));
  let h, u;
  r === 0 ? (h = s[4], u = s[5] - c) : (h = s[4] + c * Math.sin(r), u = s[5] - c * Math.cos(r));
  const f = "calc(var(--total-scale-factor) *", d = e.style;
  m(this, Ss) === m(this, id) ? (d.left = `${(100 * h / m(this, am)).toFixed(2)}%`, d.top = `${(100 * u / m(this, rm)).toFixed(2)}%`) : (d.left = `${f}${h.toFixed(2)}px)`, d.top = `${f}${u.toFixed(2)}px)`), d.fontSize = `${f}${(m(Ji, Rc) * l).toFixed(2)}px)`, d.fontFamily = o, n.fontSize = l, e.setAttribute("role", "presentation"), e.textContent = t.str, e.dir = t.dir, m(this, sm) && (e.dataset.fontName = a.fontSubstitutionLoadedName || t.fontName), r !== 0 && (n.angle = r * (180 / Math.PI));
  let p = !1;
  if (t.str.length > 1)
    p = !0;
  else if (t.str !== " " && t.transform[0] !== t.transform[3]) {
    const b = Math.abs(t.transform[0]), y = Math.abs(t.transform[3]);
    b !== y && Math.max(b, y) / Math.min(b, y) > 1.5 && (p = !0);
  }
  if (p && (n.canvasWidth = a.vertical ? t.height : t.width), m(this, lm).set(e, n), m(this, ul).div = e, m(this, ul).properties = n, D(this, Kl, J7).call(this, m(this, ul)), n.hasText && m(this, Ss).append(e), n.hasEOL) {
    const b = document.createElement("br");
    b.setAttribute("role", "presentation"), m(this, Ss).append(b);
  }
}, J7 = function(t) {
  var o;
  const {
    div: e,
    properties: n,
    ctx: s
  } = t, {
    style: r
  } = e;
  let a = "";
  if (m(Ji, Rc) > 1 && (a = `scale(${1 / m(Ji, Rc)})`), n.canvasWidth !== 0 && n.hasText) {
    const {
      fontFamily: l
    } = r, {
      canvasWidth: c,
      fontSize: h
    } = n;
    D(o = Ji, lr, Q7).call(o, s, h * m(this, Mc), l);
    const {
      width: u
    } = s.measureText(e.textContent);
    u > 0 && (a = `scaleX(${c * m(this, Mc) / u}) ${a}`);
  }
  n.angle !== 0 && (a = `rotate(${n.angle}deg) ${a}`), a.length > 0 && (r.transform = a);
}, lr = new WeakSet(), H5 = function(t = null) {
  let e = m(this, Th).get(t || (t = ""));
  if (!e) {
    const n = document.createElement("canvas");
    n.className = "hiddenCanvasElement", n.lang = t, document.body.append(n), e = n.getContext("2d", {
      alpha: !1,
      willReadFrequently: !0
    }), m(this, Th).set(t, e), m(this, hm).set(e, {
      size: 0,
      family: ""
    });
  }
  return e;
}, Q7 = function(t, e, n) {
  const s = m(this, hm).get(t);
  e === s.size && n === s.family || (t.font = `${e}px ${n}`, s.size = e, s.family = n);
}, iC = function() {
  if (m(this, Rc) !== null)
    return;
  const t = document.createElement("div");
  t.style.opacity = 0, t.style.lineHeight = 1, t.style.fontSize = "1px", t.style.position = "absolute", t.textContent = "X", document.body.append(t), E(this, Rc, t.getBoundingClientRect().height), t.remove();
}, nC = function(t, e, n) {
  const s = m(this, ad).get(t);
  if (s)
    return s;
  const r = D(this, lr, H5).call(this, n);
  r.canvas.width = r.canvas.height = $v, D(this, lr, Q7).call(this, r, $v, t);
  const a = r.measureText(""), o = a.fontBoundingBoxAscent, l = Math.abs(a.fontBoundingBoxDescent);
  r.canvas.width = r.canvas.height = 0;
  let c = 0.8;
  return o ? c = o / (o + l) : (gn.platform.isFirefox && me("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."), e.ascent ? c = e.ascent : e.descent && (c = 1 + e.descent)), m(this, ad).set(t, c), c;
}, F(Ji, lr), F(Ji, ad, /* @__PURE__ */ new Map()), F(Ji, Th, /* @__PURE__ */ new Map()), F(Ji, hm, /* @__PURE__ */ new WeakMap()), F(Ji, Rc, null), F(Ji, od, /* @__PURE__ */ new Set());
let Yd = Ji;
class J2 {
  static textContent(t) {
    const e = [], n = {
      items: e,
      styles: /* @__PURE__ */ Object.create(null)
    };
    function s(r) {
      var l;
      if (!r)
        return;
      let a = null;
      const o = r.name;
      if (o === "#text")
        a = r.value;
      else if (J2.shouldBuildText(o))
        (l = r == null ? void 0 : r.attributes) != null && l.textContent ? a = r.attributes.textContent : r.value && (a = r.value);
      else return;
      if (a !== null && e.push({
        str: a
      }), !!r.children)
        for (const c of r.children)
          s(c);
    }
    return s(t), n;
  }
  static shouldBuildText(t) {
    return !(t === "textarea" || t === "input" || t === "option" || t === "select");
  }
}
const ZM = 100;
function E4(i = {}) {
  typeof i == "string" || i instanceof URL ? i = {
    url: i
  } : (i instanceof ArrayBuffer || ArrayBuffer.isView(i)) && (i = {
    data: i
  });
  const t = new t8(), {
    docId: e
  } = t, n = i.url ? oM(i.url) : null, s = i.data ? lM(i.data) : null, r = i.httpHeaders || null, a = i.withCredentials === !0, o = i.password ?? null, l = i.range instanceof My ? i.range : null, c = Number.isInteger(i.rangeChunkSize) && i.rangeChunkSize > 0 ? i.rangeChunkSize : 2 ** 16;
  let h = i.worker instanceof Kd ? i.worker : null;
  const u = i.verbosity, f = typeof i.docBaseUrl == "string" && !bg(i.docBaseUrl) ? i.docBaseUrl : null, d = zg(i.cMapUrl), p = i.cMapPacked !== !1, g = i.CMapReaderFactory || (os ? mM : Ev), b = zg(i.iccUrl), y = zg(i.standardFontDataUrl), v = i.StandardFontDataFactory || (os ? gM : Dv), w = zg(i.wasmUrl), _ = i.WasmFactory || (os ? bM : Tv), x = i.stopAtErrors !== !0, k = Number.isInteger(i.maxImageSize) && i.maxImageSize > -1 ? i.maxImageSize : -1, S = i.isEvalSupported !== !1, T = typeof i.isOffscreenCanvasSupported == "boolean" ? i.isOffscreenCanvasSupported : !os, I = typeof i.isImageDecoderSupported == "boolean" ? i.isImageDecoderSupported : !os && (gn.platform.isFirefox || !globalThis.chrome), R = Number.isInteger(i.canvasMaxAreaInBytes) ? i.canvasMaxAreaInBytes : -1, B = typeof i.disableFontFace == "boolean" ? i.disableFontFace : os, L = i.fontExtraProperties === !0, it = i.enableXfa === !0, O = i.ownerDocument || globalThis.document, at = i.disableRange === !0, W = i.disableStream === !0, q = i.disableAutoFetch === !0, K = i.pdfBug === !0, z = i.CanvasFactory || (os ? pM : uM), j = i.FilterFactory || (os ? fM : dM), N = i.enableHWA === !0, Q = i.useWasm !== !1, Y = l ? l.length : i.length ?? NaN, et = typeof i.useSystemFonts == "boolean" ? i.useSystemFonts : !os && !B, $ = typeof i.useWorkerFetch == "boolean" ? i.useWorkerFetch : !!(g === Ev && v === Dv && _ === Tv && d && y && w && Kf(d, document.baseURI) && Kf(y, document.baseURI) && Kf(w, document.baseURI)), dt = null;
  HI(u);
  const tt = {
    canvasFactory: new z({
      ownerDocument: O,
      enableHWA: N
    }),
    filterFactory: new j({
      docId: e,
      ownerDocument: O
    }),
    cMapReaderFactory: $ ? null : new g({
      baseUrl: d,
      isCompressed: p
    }),
    standardFontDataFactory: $ ? null : new v({
      baseUrl: y
    }),
    wasmFactory: $ ? null : new _({
      baseUrl: w
    })
  };
  h || (h = Kd.create({
    verbosity: u,
    port: Ir.workerPort
  }), t._worker = h);
  const ut = {
    docId: e,
    apiVersion: "5.3.31",
    data: s,
    password: o,
    disableAutoFetch: q,
    rangeChunkSize: c,
    length: Y,
    docBaseUrl: f,
    enableXfa: it,
    evaluatorOptions: {
      maxImageSize: k,
      disableFontFace: B,
      ignoreErrors: x,
      isEvalSupported: S,
      isOffscreenCanvasSupported: T,
      isImageDecoderSupported: I,
      canvasMaxAreaInBytes: R,
      fontExtraProperties: L,
      useSystemFonts: et,
      useWasm: Q,
      useWorkerFetch: $,
      cMapUrl: d,
      iccUrl: b,
      standardFontDataUrl: y,
      wasmUrl: w
    }
  }, St = {
    ownerDocument: O,
    pdfBug: K,
    styleElement: dt,
    loadingParams: {
      disableAutoFetch: q,
      enableXfa: it
    }
  };
  return h.promise.then(function() {
    if (t.destroyed)
      throw new Error("Loading aborted");
    if (h.destroyed)
      throw new Error("Worker was destroyed");
    const G = h.messageHandler.sendWithPromise("GetDocRequest", ut, s ? [s.buffer] : null);
    let V;
    if (l)
      V = new RM(l, {
        disableRange: at,
        disableStream: W
      });
    else if (!s) {
      if (!n)
        throw new Error("getDocument - no `url` parameter provided.");
      const nt = Kf(n) ? LM : os ? WM : UM;
      V = new nt({
        url: n,
        length: Y,
        httpHeaders: r,
        withCredentials: a,
        rangeChunkSize: c,
        disableRange: at,
        disableStream: W
      });
    }
    return G.then((nt) => {
      if (t.destroyed)
        throw new Error("Loading aborted");
      if (h.destroyed)
        throw new Error("Worker was destroyed");
      const gt = new e2(e, nt, h.port), _t = new tR(gt, t, V, St, tt);
      t._transport = _t, gt.send("Ready", null);
    });
  }).catch(t._capability.reject), t;
}
var J3;
const Q3 = class Q3 {
  constructor() {
    ft(this, "_capability", Promise.withResolvers());
    ft(this, "_transport", null);
    ft(this, "_worker", null);
    ft(this, "docId", `d${Zn(Q3, J3)._++}`);
    ft(this, "destroyed", !1);
    ft(this, "onPassword", null);
    ft(this, "onProgress", null);
  }
  get promise() {
    return this._capability.promise;
  }
  async destroy() {
    var t, e, n, s;
    this.destroyed = !0;
    try {
      (t = this._worker) != null && t.port && (this._worker._pendingDestroy = !0), await ((e = this._transport) == null ? void 0 : e.destroy());
    } catch (r) {
      throw (n = this._worker) != null && n.port && delete this._worker._pendingDestroy, r;
    }
    this._transport = null, (s = this._worker) == null || s.destroy(), this._worker = null;
  }
  async getData() {
    return this._transport.getData();
  }
};
J3 = new WeakMap(), F(Q3, J3, 0);
let t8 = Q3;
var Fh, um, dm, fm, pm;
class My {
  constructor(t, e, n = !1, s = null) {
    F(this, Fh, Promise.withResolvers());
    F(this, um, []);
    F(this, dm, []);
    F(this, fm, []);
    F(this, pm, []);
    this.length = t, this.initialData = e, this.progressiveDone = n, this.contentDispositionFilename = s;
  }
  addRangeListener(t) {
    m(this, pm).push(t);
  }
  addProgressListener(t) {
    m(this, fm).push(t);
  }
  addProgressiveReadListener(t) {
    m(this, dm).push(t);
  }
  addProgressiveDoneListener(t) {
    m(this, um).push(t);
  }
  onDataRange(t, e) {
    for (const n of m(this, pm))
      n(t, e);
  }
  onDataProgress(t, e) {
    m(this, Fh).promise.then(() => {
      for (const n of m(this, fm))
        n(t, e);
    });
  }
  onDataProgressiveRead(t) {
    m(this, Fh).promise.then(() => {
      for (const e of m(this, dm))
        e(t);
    });
  }
  onDataProgressiveDone() {
    m(this, Fh).promise.then(() => {
      for (const t of m(this, um))
        t();
    });
  }
  transportReady() {
    m(this, Fh).resolve();
  }
  requestDataRange(t, e) {
    Ze("Abstract method PDFDataRangeTransport.requestDataRange");
  }
  abort() {
  }
}
Fh = new WeakMap(), um = new WeakMap(), dm = new WeakMap(), fm = new WeakMap(), pm = new WeakMap();
class JM {
  constructor(t, e) {
    this._pdfInfo = t, this._transport = e;
  }
  get annotationStorage() {
    return this._transport.annotationStorage;
  }
  get canvasFactory() {
    return this._transport.canvasFactory;
  }
  get filterFactory() {
    return this._transport.filterFactory;
  }
  get numPages() {
    return this._pdfInfo.numPages;
  }
  get fingerprints() {
    return this._pdfInfo.fingerprints;
  }
  get isPureXfa() {
    return Fe(this, "isPureXfa", !!this._transport._htmlForXfa);
  }
  get allXfaHtml() {
    return this._transport._htmlForXfa;
  }
  getPage(t) {
    return this._transport.getPage(t);
  }
  getPageIndex(t) {
    return this._transport.getPageIndex(t);
  }
  getDestinations() {
    return this._transport.getDestinations();
  }
  getDestination(t) {
    return this._transport.getDestination(t);
  }
  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({
    intent: t = "display"
  } = {}) {
    const {
      renderingIntent: e
    } = this._transport.getRenderingIntent(t);
    return this._transport.getOptionalContentConfig(e);
  }
  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(t = !1) {
    return this._transport.startCleanup(t || this.isPureXfa);
  }
  destroy() {
    return this.loadingTask.destroy();
  }
  cachedPageNumber(t) {
    return this._transport.cachedPageNumber(t);
  }
  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();
  }
}
var dl, Ih, a2;
class QM {
  constructor(t, e, n, s = !1) {
    F(this, Ih);
    F(this, dl, !1);
    this._pageIndex = t, this._pageInfo = e, this._transport = n, this._stats = s ? new Av() : null, this._pdfBug = s, this.commonObjs = n.commonObjs, this.objs = new QS(), 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: t,
    rotation: e = this.rotate,
    offsetX: n = 0,
    offsetY: s = 0,
    dontFlip: r = !1
  } = {}) {
    return new gg({
      viewBox: this.view,
      userUnit: this.userUnit,
      scale: t,
      rotation: e,
      offsetX: n,
      offsetY: s,
      dontFlip: r
    });
  }
  getAnnotations({
    intent: t = "display"
  } = {}) {
    const {
      renderingIntent: e
    } = this._transport.getRenderingIntent(t);
    return this._transport.getAnnotations(this._pageIndex, e);
  }
  getJSActions() {
    return this._transport.getPageJSActions(this._pageIndex);
  }
  get filterFactory() {
    return this._transport.filterFactory;
  }
  get isPureXfa() {
    return Fe(this, "isPureXfa", !!this._transport._htmlForXfa);
  }
  async getXfa() {
    var t;
    return ((t = this._transport._htmlForXfa) == null ? void 0 : t.children[this._pageIndex]) || null;
  }
  render({
    canvasContext: t,
    viewport: e,
    intent: n = "display",
    annotationMode: s = Dl.ENABLE,
    transform: r = null,
    background: a = null,
    optionalContentConfigPromise: o = null,
    annotationCanvasMap: l = null,
    pageColors: c = null,
    printAnnotationStorage: h = null,
    isEditing: u = !1
  }) {
    var _, x;
    (_ = this._stats) == null || _.time("Overall");
    const f = this._transport.getRenderingIntent(n, s, h, u), {
      renderingIntent: d,
      cacheKey: p
    } = f;
    E(this, dl, !1), o || (o = this._transport.getOptionalContentConfig(d));
    let g = this._intentStates.get(p);
    g || (g = /* @__PURE__ */ Object.create(null), this._intentStates.set(p, g)), g.streamReaderCancelTimeout && (clearTimeout(g.streamReaderCancelTimeout), g.streamReaderCancelTimeout = null);
    const b = !!(d & tr.PRINT);
    g.displayReadyCapability || (g.displayReadyCapability = Promise.withResolvers(), g.operatorList = {
      fnArray: [],
      argsArray: [],
      lastChunk: !1,
      separateAnnots: null
    }, (x = this._stats) == null || x.time("Page Request"), this._pumpOperatorList(f));
    const y = (k) => {
      var S;
      g.renderTasks.delete(v), b && E(this, dl, !0), D(this, Ih, a2).call(this), k ? (v.capability.reject(k), this._abortOperatorList({
        intentState: g,
        reason: k instanceof Error ? k : new Error(k)
      })) : v.capability.resolve(), this._stats && (this._stats.timeEnd("Rendering"), this._stats.timeEnd("Overall"), (S = globalThis.Stats) != null && S.enabled && globalThis.Stats.add(this.pageNumber, this._stats));
    }, v = new e8({
      callback: y,
      params: {
        canvasContext: t,
        viewport: e,
        transform: r,
        background: a
      },
      objs: this.objs,
      commonObjs: this.commonObjs,
      annotationCanvasMap: l,
      operatorList: g.operatorList,
      pageIndex: this._pageIndex,
      canvasFactory: this._transport.canvasFactory,
      filterFactory: this._transport.filterFactory,
      useRequestAnimationFrame: !b,
      pdfBug: this._pdfBug,
      pageColors: c
    });
    (g.renderTasks || (g.renderTasks = /* @__PURE__ */ new Set())).add(v);
    const w = v.task;
    return Promise.all([g.displayReadyCapability.promise, o]).then(([k, S]) => {
      var T;
      if (this.destroyed) {
        y();
        return;
      }
      if ((T = this._stats) == null || T.time("Rendering"), !(S.renderingIntent & d))
        throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");
      v.initializeGraphics({
        transparency: k,
        optionalContentConfig: S
      }), v.operatorListChanged();
    }).catch(y), w;
  }
  getOperatorList({
    intent: t = "display",
    annotationMode: e = Dl.ENABLE,
    printAnnotationStorage: n = null,
    isEditing: s = !1
  } = {}) {
    var c;
    function r() {
      o.operatorList.lastChunk && (o.opListReadCapability.resolve(o.operatorList), o.renderTasks.delete(l));
    }
    const a = this._transport.getRenderingIntent(t, e, n, s, !0);
    let o = this._intentStates.get(a.cacheKey);
    o || (o = /* @__PURE__ */ Object.create(null), this._intentStates.set(a.cacheKey, o));
    let l;
    return o.opListReadCapability || (l = /* @__PURE__ */ Object.create(null), l.operatorListChanged = r, o.opListReadCapability = Promise.withResolvers(), (o.renderTasks || (o.renderTasks = /* @__PURE__ */ new Set())).add(l), o.operatorList = {
      fnArray: [],
      argsArray: [],
      lastChunk: !1,
      separateAnnots: null
    }, (c = this._stats) == null || c.time("Page Request"), this._pumpOperatorList(a)), o.opListReadCapability.promise;
  }
  streamTextContent({
    includeMarkedContent: t = !1,
    disableNormalization: e = !1
  } = {}) {
    return this._transport.messageHandler.sendWithStream("GetTextContent", {
      pageIndex: this._pageIndex,
      includeMarkedContent: t === !0,
      disableNormalization: e === !0
    }, {
      highWaterMark: 100,
      size(s) {
        return s.items.length;
      }
    });
  }
  getTextContent(t = {}) {
    if (this._transport._htmlForXfa)
      return this.getXfa().then((n) => J2.textContent(n));
    const e = this.streamTextContent(t);
    return new Promise(function(n, s) {
      function r() {
        a.read().then(function({
          value: l,
          done: c
        }) {
          if (c) {
            n(o);
            return;
          }
          o.lang ?? (o.lang = l.lang), Object.assign(o.styles, l.styles), o.items.push(...l.items), r();
        }, s);
      }
      const a = e.getReader(), o = {
        items: [],
        styles: /* @__PURE__ */ Object.create(null),
        lang: null
      };
      r();
    });
  }
  getStructTree() {
    return this._transport.getStructTree(this._pageIndex);
  }
  _destroy() {
    this.destroyed = !0;
    const t = [];
    for (const e of this._intentStates.values())
      if (this._abortOperatorList({
        intentState: e,
        reason: new Error("Page was destroyed."),
        force: !0
      }), !e.opListReadCapability)
        for (const n of e.renderTasks)
          t.push(n.completed), n.cancel();
    return this.objs.clear(), E(this, dl, !1), Promise.all(t);
  }
  cleanup(t = !1) {
    E(this, dl, !0);
    const e = D(this, Ih, a2).call(this);
    return t && e && this._stats && (this._stats = new Av()), e;
  }
  _startRenderPage(t, e) {
    var s, r;
    const n = this._intentStates.get(e);
    n && ((s = this._stats) == null || s.timeEnd("Page Request"), (r = n.displayReadyCapability) == null || r.resolve(t));
  }
  _renderPageChunk(t, e) {
    for (let n = 0, s = t.length; n < s; n++)
      e.operatorList.fnArray.push(t.fnArray[n]), e.operatorList.argsArray.push(t.argsArray[n]);
    e.operatorList.lastChunk = t.lastChunk, e.operatorList.separateAnnots = t.separateAnnots;
    for (const n of e.renderTasks)
      n.operatorListChanged();
    t.lastChunk && D(this, Ih, a2).call(this);
  }
  _pumpOperatorList({
    renderingIntent: t,
    cacheKey: e,
    annotationStorageSerializable: n,
    modifiedIds: s
  }) {
    const {
      map: r,
      transfer: a
    } = n, l = this._transport.messageHandler.sendWithStream("GetOperatorList", {
      pageIndex: this._pageIndex,
      intent: t,
      cacheKey: e,
      annotationStorage: r,
      modifiedIds: s
    }, a).getReader(), c = this._intentStates.get(e);
    c.streamReader = l;
    const h = () => {
      l.read().then(({
        value: u,
        done: f
      }) => {
        if (f) {
          c.streamReader = null;
          return;
        }
        this._transport.destroyed || (this._renderPageChunk(u, c), h());
      }, (u) => {
        if (c.streamReader = null, !this._transport.destroyed) {
          if (c.operatorList) {
            c.operatorList.lastChunk = !0;
            for (const f of c.renderTasks)
              f.operatorListChanged();
            D(this, Ih, a2).call(this);
          }
          if (c.displayReadyCapability)
            c.displayReadyCapability.reject(u);
          else if (c.opListReadCapability)
            c.opListReadCapability.reject(u);
          else
            throw u;
        }
      });
    };
    h();
  }
  _abortOperatorList({
    intentState: t,
    reason: e,
    force: n = !1
  }) {
    if (t.streamReader) {
      if (t.streamReaderCancelTimeout && (clearTimeout(t.streamReaderCancelTimeout), t.streamReaderCancelTimeout = null), !n) {
        if (t.renderTasks.size > 0)
          return;
        if (e instanceof k4) {
          let s = ZM;
          e.extraDelay > 0 && e.extraDelay < 1e3 && (s += e.extraDelay), t.streamReaderCancelTimeout = setTimeout(() => {
            t.streamReaderCancelTimeout = null, this._abortOperatorList({
              intentState: t,
              reason: e,
              force: !0
            });
          }, s);
          return;
        }
      }
      if (t.streamReader.cancel(new Hl(e.message)).catch(() => {
      }), t.streamReader = null, !this._transport.destroyed) {
        for (const [s, r] of this._intentStates)
          if (r === t) {
            this._intentStates.delete(s);
            break;
          }
        this.cleanup();
      }
    }
  }
  get stats() {
    return this._stats;
  }
}
dl = new WeakMap(), Ih = new WeakSet(), a2 = function() {
  if (!m(this, dl) || this.destroyed)
    return !1;
  for (const {
    renderTasks: t,
    operatorList: e
  } of this._intentStates.values())
    if (t.size > 0 || !e.lastChunk)
      return !1;
  return this._intentStates.clear(), this.objs.clear(), E(this, dl, !1), !0;
};
var Bc, ha, fl, Mh, t4, Rh, Bh, us, j5, sC, rC, o2, ld, G5;
const ci = class ci {
  constructor({
    name: t = null,
    port: e = null,
    verbosity: n = jI()
  } = {}) {
    F(this, us);
    F(this, Bc, Promise.withResolvers());
    F(this, ha, null);
    F(this, fl, null);
    F(this, Mh, null);
    if (this.name = t, this.destroyed = !1, this.verbosity = n, e) {
      if (m(ci, Bh).has(e))
        throw new Error("Cannot use more than one PDFWorker per port.");
      m(ci, Bh).set(e, this), D(this, us, sC).call(this, e);
    } else
      D(this, us, rC).call(this);
  }
  get promise() {
    return m(this, Bc).promise;
  }
  get port() {
    return m(this, fl);
  }
  get messageHandler() {
    return m(this, ha);
  }
  destroy() {
    var t, e;
    this.destroyed = !0, (t = m(this, Mh)) == null || t.terminate(), E(this, Mh, null), m(ci, Bh).delete(m(this, fl)), E(this, fl, null), (e = m(this, ha)) == null || e.destroy(), E(this, ha, null);
  }
  static create(t) {
    const e = m(this, Bh).get(t == null ? void 0 : t.port);
    if (e) {
      if (e._pendingDestroy)
        throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");
      return e;
    }
    return new ci(t);
  }
  static get workerSrc() {
    if (Ir.workerSrc)
      return Ir.workerSrc;
    throw new Error('No "GlobalWorkerOptions.workerSrc" specified.');
  }
  static get _setupFakeWorkerGlobal() {
    return Fe(this, "_setupFakeWorkerGlobal", (async () => m(this, ld, G5) ? m(this, ld, G5) : (await import(
      /*webpackIgnore: true*/
      /*@vite-ignore*/
      this.workerSrc
    )).WorkerMessageHandler)());
  }
};
Bc = new WeakMap(), ha = new WeakMap(), fl = new WeakMap(), Mh = new WeakMap(), t4 = new WeakMap(), Rh = new WeakMap(), Bh = new WeakMap(), us = new WeakSet(), j5 = function() {
  m(this, Bc).resolve(), m(this, ha).send("configure", {
    verbosity: this.verbosity
  });
}, sC = function(t) {
  E(this, fl, t), E(this, ha, new e2("main", "worker", t)), m(this, ha).on("ready", () => {
  }), D(this, us, j5).call(this);
}, rC = function() {
  if (m(ci, Rh) || m(ci, ld, G5)) {
    D(this, us, o2).call(this);
    return;
  }
  let {
    workerSrc: t
  } = ci;
  try {
    ci._isSameOrigin(window.location, t) || (t = ci._createCDNWrapper(new URL(t, window.location).href));
    const e = new Worker(t, {
      type: "module"
    }), n = new e2("main", "worker", e), s = () => {
      r.abort(), n.destroy(), e.terminate(), this.destroyed ? m(this, Bc).reject(new Error("Worker was destroyed")) : D(this, us, o2).call(this);
    }, r = new AbortController();
    e.addEventListener("error", () => {
      m(this, Mh) || s();
    }, {
      signal: r.signal
    }), n.on("test", (o) => {
      if (r.abort(), this.destroyed || !o) {
        s();
        return;
      }
      E(this, ha, n), E(this, fl, e), E(this, Mh, e), D(this, us, j5).call(this);
    }), n.on("ready", (o) => {
      if (r.abort(), this.destroyed) {
        s();
        return;
      }
      try {
        a();
      } catch {
        D(this, us, o2).call(this);
      }
    });
    const a = () => {
      const o = new Uint8Array();
      n.send("test", o, [o.buffer]);
    };
    a();
    return;
  } catch {
    x4("The worker has been disabled.");
  }
  D(this, us, o2).call(this);
}, o2 = function() {
  m(ci, Rh) || (me("Setting up fake worker."), E(ci, Rh, !0)), ci._setupFakeWorkerGlobal.then((t) => {
    if (this.destroyed) {
      m(this, Bc).reject(new Error("Worker was destroyed"));
      return;
    }
    const e = new hM();
    E(this, fl, e);
    const n = `fake${Zn(ci, t4)._++}`, s = new e2(n + "_worker", n, e);
    t.setup(s, e), E(this, ha, new e2(n, n + "_worker", e)), D(this, us, j5).call(this);
  }).catch((t) => {
    m(this, Bc).reject(new Error(`Setting up fake worker failed: "${t.message}".`));
  });
}, ld = new WeakSet(), G5 = function() {
  var t;
  try {
    return ((t = globalThis.pdfjsWorker) == null ? void 0 : t.WorkerMessageHandler) || null;
  } catch {
    return null;
  }
}, F(ci, ld), F(ci, t4, 0), F(ci, Rh, !1), F(ci, Bh, /* @__PURE__ */ new WeakMap()), os && (E(ci, Rh, !0), Ir.workerSrc || (Ir.workerSrc = "./pdf.worker.mjs")), ci._isSameOrigin = (t, e) => {
  const n = URL.parse(t);
  if (!(n != null && n.origin) || n.origin === "null")
    return !1;
  const s = new URL(e, n);
  return n.origin === s.origin;
}, ci._createCDNWrapper = (t) => {
  const e = `await import("${t}");`;
  return URL.createObjectURL(new Blob([e], {
    type: "text/javascript"
  }));
}, ci.fromPort = (t) => {
  if (QI("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."), !(t != null && t.port))
    throw new Error("PDFWorker.fromPort - invalid method signature.");
  return ci.create(t);
};
let Kd = ci;
var pl, eo, cd, hd, ml, Ph, l2;
class tR {
  constructor(t, e, n, s, r) {
    F(this, Ph);
    F(this, pl, /* @__PURE__ */ new Map());
    F(this, eo, /* @__PURE__ */ new Map());
    F(this, cd, /* @__PURE__ */ new Map());
    F(this, hd, /* @__PURE__ */ new Map());
    F(this, ml, null);
    this.messageHandler = t, this.loadingTask = e, this.commonObjs = new QS(), this.fontLoader = new rM({
      ownerDocument: s.ownerDocument,
      styleElement: s.styleElement
    }), this.loadingParams = s.loadingParams, this._params = s, this.canvasFactory = r.canvasFactory, this.filterFactory = r.filterFactory, this.cMapReaderFactory = r.cMapReaderFactory, this.standardFontDataFactory = r.standardFontDataFactory, this.wasmFactory = r.wasmFactory, this.destroyed = !1, this.destroyCapability = null, this._networkStream = n, this._fullReader = null, this._lastProgress = null, this.downloadInfoCapability = Promise.withResolvers(), this.setupMessageHandler();
  }
  get annotationStorage() {
    return Fe(this, "annotationStorage", new Ty());
  }
  getRenderingIntent(t, e = Dl.ENABLE, n = null, s = !1, r = !1) {
    let a = tr.DISPLAY, o = z7;
    switch (t) {
      case "any":
        a = tr.ANY;
        break;
      case "display":
        break;
      case "print":
        a = tr.PRINT;
        break;
      default:
        me(`getRenderingIntent - invalid intent: ${t}`);
    }
    const l = a & tr.PRINT && n instanceof NS ? n : this.annotationStorage;
    switch (e) {
      case Dl.DISABLE:
        a += tr.ANNOTATIONS_DISABLE;
        break;
      case Dl.ENABLE:
        break;
      case Dl.ENABLE_FORMS:
        a += tr.ANNOTATIONS_FORMS;
        break;
      case Dl.ENABLE_STORAGE:
        a += tr.ANNOTATIONS_STORAGE, o = l.serializable;
        break;
      default:
        me(`getRenderingIntent - invalid annotationMode: ${e}`);
    }
    s && (a += tr.IS_EDITING), r && (a += tr.OPLIST);
    const {
      ids: c,
      hash: h
    } = l.modifiedIds, u = [a, o.hash, h];
    return {
      renderingIntent: a,
      cacheKey: u.join("_"),
      annotationStorageSerializable: o,
      modifiedIds: c
    };
  }
  destroy() {
    var n;
    if (this.destroyCapability)
      return this.destroyCapability.promise;
    this.destroyed = !0, this.destroyCapability = Promise.withResolvers(), (n = m(this, ml)) == null || n.reject(new Error("Worker was destroyed during onPassword callback"));
    const t = [];
    for (const s of m(this, eo).values())
      t.push(s._destroy());
    m(this, eo).clear(), m(this, cd).clear(), m(this, hd).clear(), this.hasOwnProperty("annotationStorage") && this.annotationStorage.resetModified();
    const e = this.messageHandler.sendWithPromise("Terminate", null);
    return t.push(e), Promise.all(t).then(() => {
      var s, r;
      this.commonObjs.clear(), this.fontLoader.clear(), m(this, pl).clear(), this.filterFactory.destroy(), Yd.cleanup(), (s = this._networkStream) == null || s.cancelAllRequests(new Hl("Worker was terminated.")), (r = this.messageHandler) == null || r.destroy(), this.messageHandler = null, this.destroyCapability.resolve();
    }, this.destroyCapability.reject), this.destroyCapability.promise;
  }
  setupMessageHandler() {
    const {
      messageHandler: t,
      loadingTask: e
    } = this;
    t.on("GetReader", (n, s) => {
      Vi(this._networkStream, "GetReader - no `IPDFStream` instance available."), this._fullReader = this._networkStream.getFullReader(), this._fullReader.onProgress = (r) => {
        this._lastProgress = {
          loaded: r.loaded,
          total: r.total
        };
      }, s.onPull = () => {
        this._fullReader.read().then(function({
          value: r,
          done: a
        }) {
          if (a) {
            s.close();
            return;
          }
          Vi(r instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."), s.enqueue(new Uint8Array(r), 1, [r]);
        }).catch((r) => {
          s.error(r);
        });
      }, s.onCancel = (r) => {
        this._fullReader.cancel(r), s.ready.catch((a) => {
          if (!this.destroyed)
            throw a;
        });
      };
    }), t.on("ReaderHeadersReady", async (n) => {
      var o;
      await this._fullReader.headersReady;
      const {
        isStreamingSupported: s,
        isRangeSupported: r,
        contentLength: a
      } = this._fullReader;
      return (!s || !r) && (this._lastProgress && ((o = e.onProgress) == null || o.call(e, this._lastProgress)), this._fullReader.onProgress = (l) => {
        var c;
        (c = e.onProgress) == null || c.call(e, {
          loaded: l.loaded,
          total: l.total
        });
      }), {
        isStreamingSupported: s,
        isRangeSupported: r,
        contentLength: a
      };
    }), t.on("GetRangeReader", (n, s) => {
      Vi(this._networkStream, "GetRangeReader - no `IPDFStream` instance available.");
      const r = this._networkStream.getRangeReader(n.begin, n.end);
      if (!r) {
        s.close();
        return;
      }
      s.onPull = () => {
        r.read().then(function({
          value: a,
          done: o
        }) {
          if (o) {
            s.close();
            return;
          }
          Vi(a instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."), s.enqueue(new Uint8Array(a), 1, [a]);
        }).catch((a) => {
          s.error(a);
        });
      }, s.onCancel = (a) => {
        r.cancel(a), s.ready.catch((o) => {
          if (!this.destroyed)
            throw o;
        });
      };
    }), t.on("GetDoc", ({
      pdfInfo: n
    }) => {
      this._numPages = n.numPages, this._htmlForXfa = n.htmlForXfa, delete n.htmlForXfa, e._capability.resolve(new JM(n, this));
    }), t.on("DocException", (n) => {
      e._capability.reject(xs(n));
    }), t.on("PasswordRequest", (n) => {
      E(this, ml, Promise.withResolvers());
      try {
        if (!e.onPassword)
          throw xs(n);
        const s = (r) => {
          r instanceof Error ? m(this, ml).reject(r) : m(this, ml).resolve({
            password: r
          });
        };
        e.onPassword(s, n.code);
      } catch (s) {
        m(this, ml).reject(s);
      }
      return m(this, ml).promise;
    }), t.on("DataLoaded", (n) => {
      var s;
      (s = e.onProgress) == null || s.call(e, {
        loaded: n.length,
        total: n.length
      }), this.downloadInfoCapability.resolve(n);
    }), t.on("StartRenderPage", (n) => {
      if (this.destroyed)
        return;
      m(this, eo).get(n.pageIndex)._startRenderPage(n.transparency, n.cacheKey);
    }), t.on("commonobj", ([n, s, r]) => {
      var a;
      if (this.destroyed || this.commonObjs.has(n))
        return null;
      switch (s) {
        case "Font":
          if ("error" in r) {
            const h = r.error;
            me(`Error during font loading: ${h}`), this.commonObjs.resolve(n, h);
            break;
          }
          const o = this._params.pdfBug && ((a = globalThis.FontInspector) != null && a.enabled) ? (h, u) => globalThis.FontInspector.fontAdded(h, u) : null, l = new aM(r, o);
          this.fontLoader.bind(l).catch(() => t.sendWithPromise("FontFallback", {
            id: n
          })).finally(() => {
            !l.fontExtraProperties && l.data && (l.data = null), this.commonObjs.resolve(n, l);
          });
          break;
        case "CopyLocalImage":
          const {
            imageRef: c
          } = r;
          Vi(c, "The imageRef must be defined.");
          for (const h of m(this, eo).values())
            for (const [, u] of h.objs)
              if ((u == null ? void 0 : u.ref) === c)
                return u.dataLen ? (this.commonObjs.resolve(n, structuredClone(u)), u.dataLen) : null;
          break;
        case "FontPath":
        case "Image":
        case "Pattern":
          this.commonObjs.resolve(n, r);
          break;
        default:
          throw new Error(`Got unknown common object type ${s}`);
      }
      return null;
    }), t.on("obj", ([n, s, r, a]) => {
      var l;
      if (this.destroyed)
        return;
      const o = m(this, eo).get(s);
      if (!o.objs.has(n)) {
        if (o._intentStates.size === 0) {
          (l = a == null ? void 0 : a.bitmap) == null || l.close();
          return;
        }
        switch (r) {
          case "Image":
          case "Pattern":
            o.objs.resolve(n, a);
            break;
          default:
            throw new Error(`Got unknown object type ${r}`);
        }
      }
    }), t.on("DocProgress", (n) => {
      var s;
      this.destroyed || (s = e.onProgress) == null || s.call(e, {
        loaded: n.loaded,
        total: n.total
      });
    }), t.on("FetchBinaryData", async (n) => {
      if (this.destroyed)
        throw new Error("Worker was destroyed.");
      const s = this[n.type];
      if (!s)
        throw new Error(`${n.type} not initialized, see the \`useWorkerFetch\` parameter.`);
      return s.fetch(n);
    });
  }
  getData() {
    return this.messageHandler.sendWithPromise("GetData", null);
  }
  saveDocument() {
    var n;
    this.annotationStorage.size <= 0 && me("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");
    const {
      map: t,
      transfer: e
    } = this.annotationStorage.serializable;
    return this.messageHandler.sendWithPromise("SaveDocument", {
      isPureXfa: !!this._htmlForXfa,
      numPages: this._numPages,
      annotationStorage: t,
      filename: ((n = this._fullReader) == null ? void 0 : n.filename) ?? null
    }, e).finally(() => {
      this.annotationStorage.resetModified();
    });
  }
  getPage(t) {
    if (!Number.isInteger(t) || t <= 0 || t > this._numPages)
      return Promise.reject(new Error("Invalid page request."));
    const e = t - 1, n = m(this, cd).get(e);
    if (n)
      return n;
    const s = this.messageHandler.sendWithPromise("GetPage", {
      pageIndex: e
    }).then((r) => {
      if (this.destroyed)
        throw new Error("Transport destroyed");
      r.refStr && m(this, hd).set(r.refStr, t);
      const a = new QM(e, r, this, this._params.pdfBug);
      return m(this, eo).set(e, a), a;
    });
    return m(this, cd).set(e, s), s;
  }
  getPageIndex(t) {
    return U7(t) ? this.messageHandler.sendWithPromise("GetPageIndex", {
      num: t.num,
      gen: t.gen
    }) : Promise.reject(new Error("Invalid pageIndex request."));
  }
  getAnnotations(t, e) {
    return this.messageHandler.sendWithPromise("GetAnnotations", {
      pageIndex: t,
      intent: e
    });
  }
  getFieldObjects() {
    return D(this, Ph, l2).call(this, "GetFieldObjects");
  }
  hasJSActions() {
    return D(this, Ph, l2).call(this, "HasJSActions");
  }
  getCalculationOrderIds() {
    return this.messageHandler.sendWithPromise("GetCalculationOrderIds", null);
  }
  getDestinations() {
    return this.messageHandler.sendWithPromise("GetDestinations", null);
  }
  getDestination(t) {
    return typeof t != "string" ? Promise.reject(new Error("Invalid destination request.")) : this.messageHandler.sendWithPromise("GetDestination", {
      id: t
    });
  }
  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 D(this, Ph, l2).call(this, "GetDocJSActions");
  }
  getPageJSActions(t) {
    return this.messageHandler.sendWithPromise("GetPageJSActions", {
      pageIndex: t
    });
  }
  getStructTree(t) {
    return this.messageHandler.sendWithPromise("GetStructTree", {
      pageIndex: t
    });
  }
  getOutline() {
    return this.messageHandler.sendWithPromise("GetOutline", null);
  }
  getOptionalContentConfig(t) {
    return D(this, Ph, l2).call(this, "GetOptionalContentConfig").then((e) => new MM(e, t));
  }
  getPermissions() {
    return this.messageHandler.sendWithPromise("GetPermissions", null);
  }
  getMetadata() {
    const t = "GetMetadata", e = m(this, pl).get(t);
    if (e)
      return e;
    const n = this.messageHandler.sendWithPromise(t, null).then((s) => {
      var r, a;
      return {
        info: s[0],
        metadata: s[1] ? new FM(s[1]) : null,
        contentDispositionFilename: ((r = this._fullReader) == null ? void 0 : r.filename) ?? null,
        contentLength: ((a = this._fullReader) == null ? void 0 : a.contentLength) ?? null
      };
    });
    return m(this, pl).set(t, n), n;
  }
  getMarkInfo() {
    return this.messageHandler.sendWithPromise("GetMarkInfo", null);
  }
  async startCleanup(t = !1) {
    if (!this.destroyed) {
      await this.messageHandler.sendWithPromise("Cleanup", null);
      for (const e of m(this, eo).values())
        if (!e.cleanup())
          throw new Error(`startCleanup: Page ${e.pageNumber} is currently rendering.`);
      this.commonObjs.clear(), t || this.fontLoader.clear(), m(this, pl).clear(), this.filterFactory.destroy(!0), Yd.cleanup();
    }
  }
  cachedPageNumber(t) {
    if (!U7(t))
      return null;
    const e = t.gen === 0 ? `${t.num}R` : `${t.num}R${t.gen}`;
    return m(this, hd).get(e) ?? null;
  }
}
pl = new WeakMap(), eo = new WeakMap(), cd = new WeakMap(), hd = new WeakMap(), ml = new WeakMap(), Ph = new WeakSet(), l2 = function(t, e = null) {
  const n = m(this, pl).get(t);
  if (n)
    return n;
  const s = this.messageHandler.sendWithPromise(t, e);
  return m(this, pl).set(t, s), s;
};
var Pc;
class eR {
  constructor(t) {
    F(this, Pc, null);
    ft(this, "onContinue", null);
    ft(this, "onError", null);
    E(this, Pc, t);
  }
  get promise() {
    return m(this, Pc).capability.promise;
  }
  cancel(t = 0) {
    m(this, Pc).cancel(null, t);
  }
  get separateAnnots() {
    const {
      separateAnnots: t
    } = m(this, Pc).operatorList;
    if (!t)
      return !1;
    const {
      annotationCanvasMap: e
    } = m(this, Pc);
    return t.form || t.canvas && (e == null ? void 0 : e.size) > 0;
  }
}
Pc = new WeakMap();
var Nc, Nh;
const J0 = class J0 {
  constructor({
    callback: t,
    params: e,
    objs: n,
    commonObjs: s,
    annotationCanvasMap: r,
    operatorList: a,
    pageIndex: o,
    canvasFactory: l,
    filterFactory: c,
    useRequestAnimationFrame: h = !1,
    pdfBug: u = !1,
    pageColors: f = null
  }) {
    F(this, Nc, null);
    this.callback = t, this.params = e, this.objs = n, this.commonObjs = s, this.annotationCanvasMap = r, this.operatorListIdx = null, this.operatorList = a, this._pageIndex = o, this.canvasFactory = l, this.filterFactory = c, this._pdfBug = u, this.pageColors = f, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = h === !0 && typeof window < "u", this.cancelled = !1, this.capability = Promise.withResolvers(), this.task = new eR(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 = e.canvasContext.canvas;
  }
  get completed() {
    return this.capability.promise.catch(function() {
    });
  }
  initializeGraphics({
    transparency: t = !1,
    optionalContentConfig: e
  }) {
    var o, l;
    if (this.cancelled)
      return;
    if (this._canvas) {
      if (m(J0, Nh).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.");
      m(J0, Nh).add(this._canvas);
    }
    this._pdfBug && ((o = globalThis.StepperManager) != null && o.enabled) && (this.stepper = globalThis.StepperManager.create(this._pageIndex), this.stepper.init(this.operatorList), this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint());
    const {
      canvasContext: n,
      viewport: s,
      transform: r,
      background: a
    } = this.params;
    this.gfx = new Au(n, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
      optionalContentConfig: e
    }, this.annotationCanvasMap, this.pageColors), this.gfx.beginDrawing({
      transform: r,
      viewport: s,
      transparency: t,
      background: a
    }), this.operatorListIdx = 0, this.graphicsReady = !0, (l = this.graphicsReadyCallback) == null || l.call(this);
  }
  cancel(t = null, e = 0) {
    var n, s, r;
    this.running = !1, this.cancelled = !0, (n = this.gfx) == null || n.endDrawing(), m(this, Nc) && (window.cancelAnimationFrame(m(this, Nc)), E(this, Nc, null)), m(J0, Nh).delete(this._canvas), t || (t = new k4(`Rendering cancelled, page ${this._pageIndex + 1}`, e)), this.callback(t), (r = (s = this.task).onError) == null || r.call(s, t);
  }
  operatorListChanged() {
    var t;
    if (!this.graphicsReady) {
      this.graphicsReadyCallback || (this.graphicsReadyCallback = this._continueBound);
      return;
    }
    (t = this.stepper) == null || t.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 ? E(this, Nc, window.requestAnimationFrame(() => {
      E(this, Nc, null), 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(), m(J0, Nh).delete(this._canvas), this.callback())));
  }
};
Nc = new WeakMap(), Nh = new WeakMap(), F(J0, Nh, /* @__PURE__ */ new WeakSet());
let e8 = J0;
const aC = "5.3.31", oC = "47ad820d9";
function qv(i) {
  return Math.floor(Math.max(0, Math.min(1, i)) * 255).toString(16).padStart(2, "0");
}
function Cf(i) {
  return Math.max(0, Math.min(255, 255 * i));
}
class zv {
  static CMYK_G([t, e, n, s]) {
    return ["G", 1 - Math.min(1, 0.3 * t + 0.59 * n + 0.11 * e + s)];
  }
  static G_CMYK([t]) {
    return ["CMYK", 0, 0, 0, 1 - t];
  }
  static G_RGB([t]) {
    return ["RGB", t, t, t];
  }
  static G_rgb([t]) {
    return t = Cf(t), [t, t, t];
  }
  static G_HTML([t]) {
    const e = qv(t);
    return `#${e}${e}${e}`;
  }
  static RGB_G([t, e, n]) {
    return ["G", 0.3 * t + 0.59 * e + 0.11 * n];
  }
  static RGB_rgb(t) {
    return t.map(Cf);
  }
  static RGB_HTML(t) {
    return `#${t.map(qv).join("")}`;
  }
  static T_HTML() {
    return "#00000000";
  }
  static T_rgb() {
    return [null];
  }
  static CMYK_RGB([t, e, n, s]) {
    return ["RGB", 1 - Math.min(1, t + s), 1 - Math.min(1, n + s), 1 - Math.min(1, e + s)];
  }
  static CMYK_rgb([t, e, n, s]) {
    return [Cf(1 - Math.min(1, t + s)), Cf(1 - Math.min(1, n + s)), Cf(1 - Math.min(1, e + s))];
  }
  static CMYK_HTML(t) {
    const e = this.CMYK_RGB(t).slice(1);
    return this.RGB_HTML(e);
  }
  static RGB_CMYK([t, e, n]) {
    const s = 1 - t, r = 1 - e, a = 1 - n, o = Math.min(s, r, a);
    return ["CMYK", s, r, a, o];
  }
}
class iR {
  create(t, e, n = !1) {
    if (t <= 0 || e <= 0)
      throw new Error("Invalid SVG dimensions");
    const s = this._createSVG("svg:svg");
    return s.setAttribute("version", "1.1"), n || (s.setAttribute("width", `${t}px`), s.setAttribute("height", `${e}px`)), s.setAttribute("preserveAspectRatio", "none"), s.setAttribute("viewBox", `0 0 ${t} ${e}`), s;
  }
  createElement(t) {
    if (typeof t != "string")
      throw new Error("Invalid SVG element type");
    return this._createSVG(t);
  }
  _createSVG(t) {
    Ze("Abstract method `_createSVG` called.");
  }
}
class Q2 extends iR {
  _createSVG(t) {
    return document.createElementNS(Uo, t);
  }
}
class Ry {
  static setupStorage(t, e, n, s, r) {
    const a = s.getValue(e, {
      value: null
    });
    switch (n.name) {
      case "textarea":
        if (a.value !== null && (t.textContent = a.value), r === "print")
          break;
        t.addEventListener("input", (o) => {
          s.setValue(e, {
            value: o.target.value
          });
        });
        break;
      case "input":
        if (n.attributes.type === "radio" || n.attributes.type === "checkbox") {
          if (a.value === n.attributes.xfaOn ? t.setAttribute("checked", !0) : a.value === n.attributes.xfaOff && t.removeAttribute("checked"), r === "print")
            break;
          t.addEventListener("change", (o) => {
            s.setValue(e, {
              value: o.target.checked ? o.target.getAttribute("xfaOn") : o.target.getAttribute("xfaOff")
            });
          });
        } else {
          if (a.value !== null && t.setAttribute("value", a.value), r === "print")
            break;
          t.addEventListener("input", (o) => {
            s.setValue(e, {
              value: o.target.value
            });
          });
        }
        break;
      case "select":
        if (a.value !== null) {
          t.setAttribute("value", a.value);
          for (const o of n.children)
            o.attributes.value === a.value ? o.attributes.selected = !0 : o.attributes.hasOwnProperty("selected") && delete o.attributes.selected;
        }
        t.addEventListener("input", (o) => {
          const l = o.target.options, c = l.selectedIndex === -1 ? "" : l[l.selectedIndex].value;
          s.setValue(e, {
            value: c
          });
        });
        break;
    }
  }
  static setAttributes({
    html: t,
    element: e,
    storage: n = null,
    intent: s,
    linkService: r
  }) {
    const {
      attributes: a
    } = e, o = t instanceof HTMLAnchorElement;
    a.type === "radio" && (a.name = `${a.name}-${s}`);
    for (const [l, c] of Object.entries(a))
      if (c != null)
        switch (l) {
          case "class":
            c.length && t.setAttribute(l, c.join(" "));
            break;
          case "dataId":
            break;
          case "id":
            t.setAttribute("data-element-id", c);
            break;
          case "style":
            Object.assign(t.style, c);
            break;
          case "textContent":
            t.textContent = c;
            break;
          default:
            (!o || l !== "href" && l !== "newWindow") && t.setAttribute(l, c);
        }
    o && r.addLinkAttributes(t, a.href, a.newWindow), n && a.dataId && this.setupStorage(t, a.dataId, e, n);
  }
  static render(t) {
    var u, f;
    const e = t.annotationStorage, n = t.linkService, s = t.xfaHtml, r = t.intent || "display", a = document.createElement(s.name);
    s.attributes && this.setAttributes({
      html: a,
      element: s,
      intent: r,
      linkService: n
    });
    const o = r !== "richText", l = t.div;
    if (l.append(a), t.viewport) {
      const d = `matrix(${t.viewport.transform.join(",")})`;
      l.style.transform = d;
    }
    o && l.setAttribute("class", "xfaLayer xfaFont");
    const c = [];
    if (s.children.length === 0) {
      if (s.value) {
        const d = document.createTextNode(s.value);
        a.append(d), o && J2.shouldBuildText(s.name) && c.push(d);
      }
      return {
        textDivs: c
      };
    }
    const h = [[s, -1, a]];
    for (; h.length > 0; ) {
      const [d, p, g] = h.at(-1);
      if (p + 1 === d.children.length) {
        h.pop();
        continue;
      }
      const b = d.children[++h.at(-1)[1]];
      if (b === null)
        continue;
      const {
        name: y
      } = b;
      if (y === "#text") {
        const w = document.createTextNode(b.value);
        c.push(w), g.append(w);
        continue;
      }
      const v = (u = b == null ? void 0 : b.attributes) != null && u.xmlns ? document.createElementNS(b.attributes.xmlns, y) : document.createElement(y);
      if (g.append(v), b.attributes && this.setAttributes({
        html: v,
        element: b,
        storage: e,
        intent: r,
        linkService: n
      }), ((f = b.children) == null ? void 0 : f.length) > 0)
        h.push([b, -1, v]);
      else if (b.value) {
        const w = document.createTextNode(b.value);
        o && J2.shouldBuildText(y) && c.push(w), v.append(w);
      }
    }
    for (const d of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))
      d.setAttribute("readOnly", !0);
    return {
      textDivs: c
    };
  }
  static update(t) {
    const e = `matrix(${t.viewport.transform.join(",")})`;
    t.div.style.transform = e, t.div.hidden = !1;
  }
}
const vg = 1e3, nR = 9, _1 = /* @__PURE__ */ new WeakSet();
class Uv {
  static create(t) {
    switch (t.data.annotationType) {
      case Bi.LINK:
        return new lC(t);
      case Bi.TEXT:
        return new sR(t);
      case Bi.WIDGET:
        switch (t.data.fieldType) {
          case "Tx":
            return new rR(t);
          case "Btn":
            return t.data.radioButton ? new uC(t) : t.data.checkBox ? new oR(t) : new lR(t);
          case "Ch":
            return new cR(t);
          case "Sig":
            return new aR(t);
        }
        return new R1(t);
      case Bi.POPUP:
        return new n8(t);
      case Bi.FREETEXT:
        return new gC(t);
      case Bi.LINE:
        return new uR(t);
      case Bi.SQUARE:
        return new dR(t);
      case Bi.CIRCLE:
        return new fR(t);
      case Bi.POLYLINE:
        return new bC(t);
      case Bi.CARET:
        return new mR(t);
      case Bi.INK:
        return new By(t);
      case Bi.POLYGON:
        return new pR(t);
      case Bi.HIGHLIGHT:
        return new yC(t);
      case Bi.UNDERLINE:
        return new gR(t);
      case Bi.SQUIGGLY:
        return new bR(t);
      case Bi.STRIKEOUT:
        return new yR(t);
      case Bi.STAMP:
        return new wC(t);
      case Bi.FILEATTACHMENT:
        return new wR(t);
      default:
        return new Ui(t);
    }
  }
}
var Lh, ud, dd, mm, i8;
const rv = class rv {
  constructor(t, {
    isRenderable: e = !1,
    ignoreBorder: n = !1,
    createQuadrilaterals: s = !1
  } = {}) {
    F(this, mm);
    F(this, Lh, null);
    F(this, ud, !1);
    F(this, dd, null);
    this.isRenderable = e, this.data = t.data, this.layer = t.layer, this.linkService = t.linkService, this.downloadManager = t.downloadManager, this.imageResourcesPath = t.imageResourcesPath, this.renderForms = t.renderForms, this.svgFactory = t.svgFactory, this.annotationStorage = t.annotationStorage, this.enableScripting = t.enableScripting, this.hasJSActions = t.hasJSActions, this._fieldObjects = t.fieldObjects, this.parent = t.parent, e && (this.container = this._createContainer(n)), s && this._createQuadrilaterals();
  }
  static _hasPopupData({
    titleObj: t,
    contentsObj: e,
    richText: n
  }) {
    return !!(t != null && t.str || e != null && e.str || n != null && n.str);
  }
  get _isEditable() {
    return this.data.isEditable;
  }
  get hasPopupData() {
    return rv._hasPopupData(this.data);
  }
  updateEdited(t) {
    var n;
    if (!this.container)
      return;
    m(this, Lh) || E(this, Lh, {
      rect: this.data.rect.slice(0)
    });
    const {
      rect: e
    } = t;
    e && D(this, mm, i8).call(this, e), (n = m(this, dd)) == null || n.popup.updateEdited(t);
  }
  resetEdited() {
    var t;
    m(this, Lh) && (D(this, mm, i8).call(this, m(this, Lh).rect), (t = m(this, dd)) == null || t.popup.resetEdited(), E(this, Lh, null));
  }
  _createContainer(t) {
    const {
      data: e,
      parent: {
        page: n,
        viewport: s
      }
    } = this, r = document.createElement("section");
    r.setAttribute("data-annotation-id", e.id), this instanceof R1 || (r.tabIndex = vg);
    const {
      style: a
    } = r;
    if (a.zIndex = this.parent.zIndex++, e.alternativeText && (r.title = e.alternativeText), e.noRotate && r.classList.add("norotate"), !e.rect || this instanceof n8) {
      const {
        rotation: g
      } = e;
      return !e.hasOwnCanvas && g !== 0 && this.setRotation(g, r), r;
    }
    const {
      width: o,
      height: l
    } = this;
    if (!t && e.borderStyle.width > 0) {
      a.borderWidth = `${e.borderStyle.width}px`;
      const g = e.borderStyle.horizontalCornerRadius, b = e.borderStyle.verticalCornerRadius;
      if (g > 0 || b > 0) {
        const v = `calc(${g}px * var(--total-scale-factor)) / calc(${b}px * var(--total-scale-factor))`;
        a.borderRadius = v;
      } else if (this instanceof uC) {
        const v = `calc(${o}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;
        a.borderRadius = v;
      }
      switch (e.borderStyle.style) {
        case Z1.SOLID:
          a.borderStyle = "solid";
          break;
        case Z1.DASHED:
          a.borderStyle = "dashed";
          break;
        case Z1.BEVELED:
          me("Unimplemented border style: beveled");
          break;
        case Z1.INSET:
          me("Unimplemented border style: inset");
          break;
        case Z1.UNDERLINE:
          a.borderBottomStyle = "solid";
          break;
      }
      const y = e.borderColor || null;
      y ? (E(this, ud, !0), a.borderColor = Zt.makeHexColor(y[0] | 0, y[1] | 0, y[2] | 0)) : a.borderWidth = 0;
    }
    const c = Zt.normalizeRect([e.rect[0], n.view[3] - e.rect[1] + n.view[1], e.rect[2], n.view[3] - e.rect[3] + n.view[1]]), {
      pageWidth: h,
      pageHeight: u,
      pageX: f,
      pageY: d
    } = s.rawDims;
    a.left = `${100 * (c[0] - f) / h}%`, a.top = `${100 * (c[1] - d) / u}%`;
    const {
      rotation: p
    } = e;
    return e.hasOwnCanvas || p === 0 ? (a.width = `${100 * o / h}%`, a.height = `${100 * l / u}%`) : this.setRotation(p, r), r;
  }
  setRotation(t, e = this.container) {
    if (!this.data.rect)
      return;
    const {
      pageWidth: n,
      pageHeight: s
    } = this.parent.viewport.rawDims;
    let {
      width: r,
      height: a
    } = this;
    t % 180 !== 0 && ([r, a] = [a, r]), e.style.width = `${100 * r / n}%`, e.style.height = `${100 * a / s}%`, e.setAttribute("data-main-rotation", (360 - t) % 360);
  }
  get _commonActions() {
    const t = (e, n, s) => {
      const r = s.detail[e], a = r[0], o = r.slice(1);
      s.target.style[n] = zv[`${a}_HTML`](o), this.annotationStorage.setValue(this.data.id, {
        [n]: zv[`${a}_rgb`](o)
      });
    };
    return Fe(this, "_commonActions", {
      display: (e) => {
        const {
          display: n
        } = e.detail, s = n % 2 === 1;
        this.container.style.visibility = s ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
          noView: s,
          noPrint: n === 1 || n === 2
        });
      },
      print: (e) => {
        this.annotationStorage.setValue(this.data.id, {
          noPrint: !e.detail.print
        });
      },
      hidden: (e) => {
        const {
          hidden: n
        } = e.detail;
        this.container.style.visibility = n ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
          noPrint: n,
          noView: n
        });
      },
      focus: (e) => {
        setTimeout(() => e.target.focus({
          preventScroll: !1
        }), 0);
      },
      userName: (e) => {
        e.target.title = e.detail.userName;
      },
      readonly: (e) => {
        e.target.disabled = e.detail.readonly;
      },
      required: (e) => {
        this._setRequired(e.target, e.detail.required);
      },
      bgColor: (e) => {
        t("bgColor", "backgroundColor", e);
      },
      fillColor: (e) => {
        t("fillColor", "backgroundColor", e);
      },
      fgColor: (e) => {
        t("fgColor", "color", e);
      },
      textColor: (e) => {
        t("textColor", "color", e);
      },
      borderColor: (e) => {
        t("borderColor", "borderColor", e);
      },
      strokeColor: (e) => {
        t("strokeColor", "borderColor", e);
      },
      rotation: (e) => {
        const n = e.detail.rotation;
        this.setRotation(n), this.annotationStorage.setValue(this.data.id, {
          rotation: n
        });
      }
    });
  }
  _dispatchEventFromSandbox(t, e) {
    const n = this._commonActions;
    for (const s of Object.keys(e.detail)) {
      const r = t[s] || n[s];
      r == null || r(e);
    }
  }
  _setDefaultPropertiesFromJS(t) {
    if (!this.enableScripting)
      return;
    const e = this.annotationStorage.getRawValue(this.data.id);
    if (!e)
      return;
    const n = this._commonActions;
    for (const [s, r] of Object.entries(e)) {
      const a = n[s];
      if (a) {
        const o = {
          detail: {
            [s]: r
          },
          target: t
        };
        a(o), delete e[s];
      }
    }
  }
  _createQuadrilaterals() {
    if (!this.container)
      return;
    const {
      quadPoints: t
    } = this.data;
    if (!t)
      return;
    const [e, n, s, r] = this.data.rect.map((g) => Math.fround(g));
    if (t.length === 8) {
      const [g, b, y, v] = t.subarray(2, 6);
      if (s === g && r === b && e === y && n === v)
        return;
    }
    const {
      style: a
    } = this.container;
    let o;
    if (m(this, ud)) {
      const {
        borderColor: g,
        borderWidth: b
      } = a;
      a.borderWidth = 0, o = ["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="${g}" stroke-width="${b}">`], this.container.classList.add("hasBorder");
    }
    const l = s - e, c = r - n, {
      svgFactory: h
    } = this, u = h.createElement("svg");
    u.classList.add("quadrilateralsContainer"), u.setAttribute("width", 0), u.setAttribute("height", 0);
    const f = h.createElement("defs");
    u.append(f);
    const d = h.createElement("clipPath"), p = `clippath_${this.data.id}`;
    d.setAttribute("id", p), d.setAttribute("clipPathUnits", "objectBoundingBox"), f.append(d);
    for (let g = 2, b = t.length; g < b; g += 8) {
      const y = t[g], v = t[g + 1], w = t[g + 2], _ = t[g + 3], x = h.createElement("rect"), k = (w - e) / l, S = (r - v) / c, T = (y - w) / l, I = (v - _) / c;
      x.setAttribute("x", k), x.setAttribute("y", S), x.setAttribute("width", T), x.setAttribute("height", I), d.append(x), o == null || o.push(`<rect vector-effect="non-scaling-stroke" x="${k}" y="${S}" width="${T}" height="${I}"/>`);
    }
    m(this, ud) && (o.push("</g></svg>')"), a.backgroundImage = o.join("")), this.container.append(u), this.container.style.clipPath = `url(#${p})`;
  }
  _createPopup() {
    const {
      data: t
    } = this, e = E(this, dd, new n8({
      data: {
        color: t.color,
        titleObj: t.titleObj,
        modificationDate: t.modificationDate,
        contentsObj: t.contentsObj,
        richText: t.richText,
        parentRect: t.rect,
        borderStyle: 0,
        id: `popup_${t.id}`,
        rotation: t.rotation
      },
      parent: this.parent,
      elements: [this]
    }));
    this.parent.div.append(e.render());
  }
  render() {
    Ze("Abstract method `AnnotationElement.render` called");
  }
  _getElementsByName(t, e = null) {
    const n = [];
    if (this._fieldObjects) {
      const s = this._fieldObjects[t];
      if (s)
        for (const {
          page: r,
          id: a,
          exportValues: o
        } of s) {
          if (r === -1 || a === e)
            continue;
          const l = typeof o == "string" ? o : null, c = document.querySelector(`[data-element-id="${a}"]`);
          if (c && !_1.has(c)) {
            me(`_getElementsByName - element not allowed: ${a}`);
            continue;
          }
          n.push({
            id: a,
            exportValue: l,
            domElement: c
          });
        }
      return n;
    }
    for (const s of document.getElementsByName(t)) {
      const {
        exportValue: r
      } = s, a = s.getAttribute("data-element-id");
      a !== e && _1.has(s) && n.push({
        id: a,
        exportValue: r,
        domElement: s
      });
    }
    return n;
  }
  show() {
    var t;
    this.container && (this.container.hidden = !1), (t = this.popup) == null || t.maybeShow();
  }
  hide() {
    var t;
    this.container && (this.container.hidden = !0), (t = this.popup) == null || t.forceHide();
  }
  getElementsToTriggerPopup() {
    return this.container;
  }
  addHighlightArea() {
    const t = this.getElementsToTriggerPopup();
    if (Array.isArray(t))
      for (const e of t)
        e.classList.add("highlightArea");
    else
      t.classList.add("highlightArea");
  }
  _editOnDoubleClick() {
    if (!this._isEditable)
      return;
    const {
      annotationEditorType: t,
      data: {
        id: e
      }
    } = this;
    this.container.addEventListener("dblclick", () => {
      var n;
      (n = this.linkService.eventBus) == null || n.dispatch("switchannotationeditormode", {
        source: this,
        mode: t,
        editId: e
      });
    });
  }
  get width() {
    return this.data.rect[2] - this.data.rect[0];
  }
  get height() {
    return this.data.rect[3] - this.data.rect[1];
  }
};
Lh = new WeakMap(), ud = new WeakMap(), dd = new WeakMap(), mm = new WeakSet(), i8 = function(t) {
  const {
    container: {
      style: e
    },
    data: {
      rect: n,
      rotation: s
    },
    parent: {
      viewport: {
        rawDims: {
          pageWidth: r,
          pageHeight: a,
          pageX: o,
          pageY: l
        }
      }
    }
  } = this;
  n == null || n.splice(0, 4, ...t), e.left = `${100 * (t[0] - o) / r}%`, e.top = `${100 * (a - t[3] + l) / a}%`, s === 0 ? (e.width = `${100 * (t[2] - t[0]) / r}%`, e.height = `${100 * (t[3] - t[1]) / a}%`) : this.setRotation(s);
};
let Ui = rv;
var rr, B0, cC, hC;
class lC extends Ui {
  constructor(e, n = null) {
    super(e, {
      isRenderable: !0,
      ignoreBorder: !!(n != null && n.ignoreBorder),
      createQuadrilaterals: !0
    });
    F(this, rr);
    this.isTooltipOnly = e.data.isTooltipOnly;
  }
  render() {
    const {
      data: e,
      linkService: n
    } = this, s = document.createElement("a");
    s.setAttribute("data-element-id", e.id);
    let r = !1;
    return e.url ? (n.addLinkAttributes(s, e.url, e.newWindow), r = !0) : e.action ? (this._bindNamedAction(s, e.action), r = !0) : e.attachment ? (D(this, rr, cC).call(this, s, e.attachment, e.attachmentDest), r = !0) : e.setOCGState ? (D(this, rr, hC).call(this, s, e.setOCGState), r = !0) : e.dest ? (this._bindLink(s, e.dest), r = !0) : (e.actions && (e.actions.Action || e.actions["Mouse Up"] || e.actions["Mouse Down"]) && this.enableScripting && this.hasJSActions && (this._bindJSAction(s, e), r = !0), e.resetForm ? (this._bindResetFormAction(s, e.resetForm), r = !0) : this.isTooltipOnly && !r && (this._bindLink(s, ""), r = !0)), this.container.classList.add("linkAnnotation"), r && this.container.append(s), this.container;
  }
  _bindLink(e, n) {
    e.href = this.linkService.getDestinationHash(n), e.onclick = () => (n && this.linkService.goToDestination(n), !1), (n || n === "") && D(this, rr, B0).call(this);
  }
  _bindNamedAction(e, n) {
    e.href = this.linkService.getAnchorUrl(""), e.onclick = () => (this.linkService.executeNamedAction(n), !1), D(this, rr, B0).call(this);
  }
  _bindJSAction(e, n) {
    e.href = this.linkService.getAnchorUrl("");
    const s = /* @__PURE__ */ new Map([["Action", "onclick"], ["Mouse Up", "onmouseup"], ["Mouse Down", "onmousedown"]]);
    for (const r of Object.keys(n.actions)) {
      const a = s.get(r);
      a && (e[a] = () => {
        var o;
        return (o = this.linkService.eventBus) == null || o.dispatch("dispatcheventinsandbox", {
          source: this,
          detail: {
            id: n.id,
            name: r
          }
        }), !1;
      });
    }
    e.onclick || (e.onclick = () => !1), D(this, rr, B0).call(this);
  }
  _bindResetFormAction(e, n) {
    const s = e.onclick;
    if (s || (e.href = this.linkService.getAnchorUrl("")), D(this, rr, B0).call(this), !this._fieldObjects) {
      me('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'), s || (e.onclick = () => !1);
      return;
    }
    e.onclick = () => {
      var u;
      s == null || s();
      const {
        fields: r,
        refs: a,
        include: o
      } = n, l = [];
      if (r.length !== 0 || a.length !== 0) {
        const f = new Set(a);
        for (const d of r) {
          const p = this._fieldObjects[d] || [];
          for (const {
            id: g
          } of p)
            f.add(g);
        }
        for (const d of Object.values(this._fieldObjects))
          for (const p of d)
            f.has(p.id) === o && l.push(p);
      } else
        for (const f of Object.values(this._fieldObjects))
          l.push(...f);
      const c = this.annotationStorage, h = [];
      for (const f of l) {
        const {
          id: d
        } = f;
        switch (h.push(d), f.type) {
          case "text": {
            const g = f.defaultValue || "";
            c.setValue(d, {
              value: g
            });
            break;
          }
          case "checkbox":
          case "radiobutton": {
            const g = f.defaultValue === f.exportValues;
            c.setValue(d, {
              value: g
            });
            break;
          }
          case "combobox":
          case "listbox": {
            const g = f.defaultValue || "";
            c.setValue(d, {
              value: g
            });
            break;
          }
          default:
            continue;
        }
        const p = document.querySelector(`[data-element-id="${d}"]`);
        if (p) {
          if (!_1.has(p)) {
            me(`_bindResetFormAction - element not allowed: ${d}`);
            continue;
          }
        } else continue;
        p.dispatchEvent(new Event("resetform"));
      }
      return this.enableScripting && ((u = this.linkService.eventBus) == null || u.dispatch("dispatcheventinsandbox", {
        source: this,
        detail: {
          id: "app",
          ids: h,
          name: "ResetForm"
        }
      })), !1;
    };
  }
}
rr = new WeakSet(), B0 = function() {
  this.container.setAttribute("data-internal-link", "");
}, cC = function(e, n, s = null) {
  e.href = this.linkService.getAnchorUrl(""), n.description && (e.title = n.description), e.onclick = () => {
    var r;
    return (r = this.downloadManager) == null || r.openOrDownloadData(n.content, n.filename, s), !1;
  }, D(this, rr, B0).call(this);
}, hC = function(e, n) {
  e.href = this.linkService.getAnchorUrl(""), e.onclick = () => (this.linkService.executeSetOCGState(n), !1), D(this, rr, B0).call(this);
};
class sR extends Ui {
  constructor(t) {
    super(t, {
      isRenderable: !0
    });
  }
  render() {
    this.container.classList.add("textAnnotation");
    const t = document.createElement("img");
    return t.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg", t.setAttribute("data-l10n-id", "pdfjs-text-annotation-type"), t.setAttribute("data-l10n-args", JSON.stringify({
      type: this.data.name
    })), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.append(t), this.container;
  }
}
class R1 extends Ui {
  render() {
    return this.container;
  }
  showElementAndHideCanvas(t) {
    var e;
    this.data.hasOwnCanvas && (((e = t.previousSibling) == null ? void 0 : e.nodeName) === "CANVAS" && (t.previousSibling.hidden = !0), t.hidden = !1);
  }
  _getKeyModifier(t) {
    return gn.platform.isMac ? t.metaKey : t.ctrlKey;
  }
  _setEventListener(t, e, n, s, r) {
    n.includes("mouse") ? t.addEventListener(n, (a) => {
      var o;
      (o = this.linkService.eventBus) == null || o.dispatch("dispatcheventinsandbox", {
        source: this,
        detail: {
          id: this.data.id,
          name: s,
          value: r(a),
          shift: a.shiftKey,
          modifier: this._getKeyModifier(a)
        }
      });
    }) : t.addEventListener(n, (a) => {
      var o;
      if (n === "blur") {
        if (!e.focused || !a.relatedTarget)
          return;
        e.focused = !1;
      } else if (n === "focus") {
        if (e.focused)
          return;
        e.focused = !0;
      }
      r && ((o = this.linkService.eventBus) == null || o.dispatch("dispatcheventinsandbox", {
        source: this,
        detail: {
          id: this.data.id,
          name: s,
          value: r(a)
        }
      }));
    });
  }
  _setEventListeners(t, e, n, s) {
    var r, a, o;
    for (const [l, c] of n)
      (c === "Action" || (r = this.data.actions) != null && r[c]) && ((c === "Focus" || c === "Blur") && (e || (e = {
        focused: !1
      })), this._setEventListener(t, e, l, c, s), c === "Focus" && !((a = this.data.actions) != null && a.Blur) ? this._setEventListener(t, e, "blur", "Blur", null) : c === "Blur" && !((o = this.data.actions) != null && o.Focus) && this._setEventListener(t, e, "focus", "Focus", null));
  }
  _setBackgroundColor(t) {
    const e = this.data.backgroundColor || null;
    t.style.backgroundColor = e === null ? "transparent" : Zt.makeHexColor(e[0], e[1], e[2]);
  }
  _setTextStyle(t) {
    const e = ["left", "center", "right"], {
      fontColor: n
    } = this.data.defaultAppearanceData, s = this.data.defaultAppearanceData.fontSize || nR, r = t.style;
    let a;
    const o = 2, l = (c) => Math.round(10 * c) / 10;
    if (this.data.multiLine) {
      const c = Math.abs(this.data.rect[3] - this.data.rect[1] - o), h = Math.round(c / (a6 * s)) || 1, u = c / h;
      a = Math.min(s, l(u / a6));
    } else {
      const c = Math.abs(this.data.rect[3] - this.data.rect[1] - o);
      a = Math.min(s, l(c / a6));
    }
    r.fontSize = `calc(${a}px * var(--total-scale-factor))`, r.color = Zt.makeHexColor(n[0], n[1], n[2]), this.data.textAlignment !== null && (r.textAlign = e[this.data.textAlignment]);
  }
  _setRequired(t, e) {
    e ? t.setAttribute("required", !0) : t.removeAttribute("required"), t.setAttribute("aria-required", e);
  }
}
class rR extends R1 {
  constructor(t) {
    const e = t.renderForms || t.data.hasOwnCanvas || !t.data.hasAppearance && !!t.data.fieldValue;
    super(t, {
      isRenderable: e
    });
  }
  setPropertyOnSiblings(t, e, n, s) {
    const r = this.annotationStorage;
    for (const a of this._getElementsByName(t.name, t.id))
      a.domElement && (a.domElement[e] = n), r.setValue(a.id, {
        [s]: n
      });
  }
  render() {
    var s, r;
    const t = this.annotationStorage, e = this.data.id;
    this.container.classList.add("textWidgetAnnotation");
    let n = null;
    if (this.renderForms) {
      const a = t.getValue(e, {
        value: this.data.fieldValue
      });
      let o = a.value || "";
      const l = t.getValue(e, {
        charLimit: this.data.maxLen
      }).charLimit;
      l && o.length > l && (o = o.slice(0, l));
      let c = a.formattedValue || ((s = this.data.textContent) == null ? void 0 : s.join(`
`)) || null;
      c && this.data.comb && (c = c.replaceAll(/\s+/g, ""));
      const h = {
        userValue: o,
        formattedValue: c,
        lastCommittedValue: null,
        commitKey: 1,
        focused: !1
      };
      this.data.multiLine ? (n = document.createElement("textarea"), n.textContent = c ?? o, this.data.doNotScroll && (n.style.overflowY = "hidden")) : (n = document.createElement("input"), n.type = this.data.password ? "password" : "text", n.setAttribute("value", c ?? o), this.data.doNotScroll && (n.style.overflowX = "hidden")), this.data.hasOwnCanvas && (n.hidden = !0), _1.add(n), n.setAttribute("data-element-id", e), n.disabled = this.data.readOnly, n.name = this.data.fieldName, n.tabIndex = vg, this._setRequired(n, this.data.required), l && (n.maxLength = l), n.addEventListener("input", (f) => {
        t.setValue(e, {
          value: f.target.value
        }), this.setPropertyOnSiblings(n, "value", f.target.value, "value"), h.formattedValue = null;
      }), n.addEventListener("resetform", (f) => {
        const d = this.data.defaultFieldValue ?? "";
        n.value = h.userValue = d, h.formattedValue = null;
      });
      let u = (f) => {
        const {
          formattedValue: d
        } = h;
        d != null && (f.target.value = d), f.target.scrollLeft = 0;
      };
      if (this.enableScripting && this.hasJSActions) {
        n.addEventListener("focus", (d) => {
          var g;
          if (h.focused)
            return;
          const {
            target: p
          } = d;
          h.userValue && (p.value = h.userValue), h.lastCommittedValue = p.value, h.commitKey = 1, (g = this.data.actions) != null && g.Focus || (h.focused = !0);
        }), n.addEventListener("updatefromsandbox", (d) => {
          this.showElementAndHideCanvas(d.target);
          const p = {
            value(g) {
              h.userValue = g.detail.value ?? "", t.setValue(e, {
                value: h.userValue.toString()
              }), g.target.value = h.userValue;
            },
            formattedValue(g) {
              const {
                formattedValue: b
              } = g.detail;
              h.formattedValue = b, b != null && g.target !== document.activeElement && (g.target.value = b), t.setValue(e, {
                formattedValue: b
              });
            },
            selRange(g) {
              g.target.setSelectionRange(...g.detail.selRange);
            },
            charLimit: (g) => {
              var w;
              const {
                charLimit: b
              } = g.detail, {
                target: y
              } = g;
              if (b === 0) {
                y.removeAttribute("maxLength");
                return;
              }
              y.setAttribute("maxLength", b);
              let v = h.userValue;
              !v || v.length <= b || (v = v.slice(0, b), y.value = h.userValue = v, t.setValue(e, {
                value: v
              }), (w = this.linkService.eventBus) == null || w.dispatch("dispatcheventinsandbox", {
                source: this,
                detail: {
                  id: e,
                  name: "Keystroke",
                  value: v,
                  willCommit: !0,
                  commitKey: 1,
                  selStart: y.selectionStart,
                  selEnd: y.selectionEnd
                }
              }));
            }
          };
          this._dispatchEventFromSandbox(p, d);
        }), n.addEventListener("keydown", (d) => {
          var b;
          h.commitKey = 1;
          let p = -1;
          if (d.key === "Escape" ? p = 0 : d.key === "Enter" && !this.data.multiLine ? p = 2 : d.key === "Tab" && (h.commitKey = 3), p === -1)
            return;
          const {
            value: g
          } = d.target;
          h.lastCommittedValue !== g && (h.lastCommittedValue = g, h.userValue = g, (b = this.linkService.eventBus) == null || b.dispatch("dispatcheventinsandbox", {
            source: this,
            detail: {
              id: e,
              name: "Keystroke",
              value: g,
              willCommit: !0,
              commitKey: p,
              selStart: d.target.selectionStart,
              selEnd: d.target.selectionEnd
            }
          }));
        });
        const f = u;
        u = null, n.addEventListener("blur", (d) => {
          var g, b;
          if (!h.focused || !d.relatedTarget)
            return;
          (g = this.data.actions) != null && g.Blur || (h.focused = !1);
          const {
            value: p
          } = d.target;
          h.userValue = p, h.lastCommittedValue !== p && ((b = this.linkService.eventBus) == null || b.dispatch("dispatcheventinsandbox", {
            source: this,
            detail: {
              id: e,
              name: "Keystroke",
              value: p,
              willCommit: !0,
              commitKey: h.commitKey,
              selStart: d.target.selectionStart,
              selEnd: d.target.selectionEnd
            }
          })), f(d);
        }), (r = this.data.actions) != null && r.Keystroke && n.addEventListener("beforeinput", (d) => {
          var x;
          h.lastCommittedValue = null;
          const {
            data: p,
            target: g
          } = d, {
            value: b,
            selectionStart: y,
            selectionEnd: v
          } = g;
          let w = y, _ = v;
          switch (d.inputType) {
            case "deleteWordBackward": {
              const k = b.substring(0, y).match(/\w*[^\w]*$/);
              k && (w -= k[0].length);
              break;
            }
            case "deleteWordForward": {
              const k = b.substring(y).match(/^[^\w]*\w*/);
              k && (_ += k[0].length);
              break;
            }
            case "deleteContentBackward":
              y === v && (w -= 1);
              break;
            case "deleteContentForward":
              y === v && (_ += 1);
              break;
          }
          d.preventDefault(), (x = this.linkService.eventBus) == null || x.dispatch("dispatcheventinsandbox", {
            source: this,
            detail: {
              id: e,
              name: "Keystroke",
              value: b,
              change: p || "",
              willCommit: !1,
              selStart: w,
              selEnd: _
            }
          });
        }), this._setEventListeners(n, h, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (d) => d.target.value);
      }
      if (u && n.addEventListener("blur", u), this.data.comb) {
        const d = (this.data.rect[2] - this.data.rect[0]) / l;
        n.classList.add("comb"), n.style.letterSpacing = `calc(${d}px * var(--total-scale-factor) - 1ch)`;
      }
    } else
      n = document.createElement("div"), n.textContent = this.data.fieldValue, n.style.verticalAlign = "middle", n.style.display = "table-cell", this.data.hasOwnCanvas && (n.hidden = !0);
    return this._setTextStyle(n), this._setBackgroundColor(n), this._setDefaultPropertiesFromJS(n), this.container.append(n), this.container;
  }
}
class aR extends R1 {
  constructor(t) {
    super(t, {
      isRenderable: !!t.data.hasOwnCanvas
    });
  }
}
class oR extends R1 {
  constructor(t) {
    super(t, {
      isRenderable: t.renderForms
    });
  }
  render() {
    const t = this.annotationStorage, e = this.data, n = e.id;
    let s = t.getValue(n, {
      value: e.exportValue === e.fieldValue
    }).value;
    typeof s == "string" && (s = s !== "Off", t.setValue(n, {
      value: s
    })), this.container.classList.add("buttonWidgetAnnotation", "checkBox");
    const r = document.createElement("input");
    return _1.add(r), r.setAttribute("data-element-id", n), r.disabled = e.readOnly, this._setRequired(r, this.data.required), r.type = "checkbox", r.name = e.fieldName, s && r.setAttribute("checked", !0), r.setAttribute("exportValue", e.exportValue), r.tabIndex = vg, r.addEventListener("change", (a) => {
      const {
        name: o,
        checked: l
      } = a.target;
      for (const c of this._getElementsByName(o, n)) {
        const h = l && c.exportValue === e.exportValue;
        c.domElement && (c.domElement.checked = h), t.setValue(c.id, {
          value: h
        });
      }
      t.setValue(n, {
        value: l
      });
    }), r.addEventListener("resetform", (a) => {
      const o = e.defaultFieldValue || "Off";
      a.target.checked = o === e.exportValue;
    }), this.enableScripting && this.hasJSActions && (r.addEventListener("updatefromsandbox", (a) => {
      const o = {
        value(l) {
          l.target.checked = l.detail.value !== "Off", t.setValue(n, {
            value: l.target.checked
          });
        }
      };
      this._dispatchEventFromSandbox(o, a);
    }), this._setEventListeners(r, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (a) => a.target.checked)), this._setBackgroundColor(r), this._setDefaultPropertiesFromJS(r), this.container.append(r), this.container;
  }
}
class uC extends R1 {
  constructor(t) {
    super(t, {
      isRenderable: t.renderForms
    });
  }
  render() {
    this.container.classList.add("buttonWidgetAnnotation", "radioButton");
    const t = this.annotationStorage, e = this.data, n = e.id;
    let s = t.getValue(n, {
      value: e.fieldValue === e.buttonValue
    }).value;
    if (typeof s == "string" && (s = s !== e.buttonValue, t.setValue(n, {
      value: s
    })), s)
      for (const a of this._getElementsByName(e.fieldName, n))
        t.setValue(a.id, {
          value: !1
        });
    const r = document.createElement("input");
    if (_1.add(r), r.setAttribute("data-element-id", n), r.disabled = e.readOnly, this._setRequired(r, this.data.required), r.type = "radio", r.name = e.fieldName, s && r.setAttribute("checked", !0), r.tabIndex = vg, r.addEventListener("change", (a) => {
      const {
        name: o,
        checked: l
      } = a.target;
      for (const c of this._getElementsByName(o, n))
        t.setValue(c.id, {
          value: !1
        });
      t.setValue(n, {
        value: l
      });
    }), r.addEventListener("resetform", (a) => {
      const o = e.defaultFieldValue;
      a.target.checked = o != null && o === e.buttonValue;
    }), this.enableScripting && this.hasJSActions) {
      const a = e.buttonValue;
      r.addEventListener("updatefromsandbox", (o) => {
        const l = {
          value: (c) => {
            const h = a === c.detail.value;
            for (const u of this._getElementsByName(c.target.name)) {
              const f = h && u.id === n;
              u.domElement && (u.domElement.checked = f), t.setValue(u.id, {
                value: f
              });
            }
          }
        };
        this._dispatchEventFromSandbox(l, o);
      }), this._setEventListeners(r, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (o) => o.target.checked);
    }
    return this._setBackgroundColor(r), this._setDefaultPropertiesFromJS(r), this.container.append(r), this.container;
  }
}
class lR extends lC {
  constructor(t) {
    super(t, {
      ignoreBorder: t.data.hasAppearance
    });
  }
  render() {
    const t = super.render();
    t.classList.add("buttonWidgetAnnotation", "pushButton");
    const e = t.lastChild;
    return this.enableScripting && this.hasJSActions && e && (this._setDefaultPropertiesFromJS(e), e.addEventListener("updatefromsandbox", (n) => {
      this._dispatchEventFromSandbox({}, n);
    })), t;
  }
}
class cR extends R1 {
  constructor(t) {
    super(t, {
      isRenderable: t.renderForms
    });
  }
  render() {
    this.container.classList.add("choiceWidgetAnnotation");
    const t = this.annotationStorage, e = this.data.id, n = t.getValue(e, {
      value: this.data.fieldValue
    }), s = document.createElement("select");
    _1.add(s), s.setAttribute("data-element-id", e), s.disabled = this.data.readOnly, this._setRequired(s, this.data.required), s.name = this.data.fieldName, s.tabIndex = vg;
    let r = this.data.combo && this.data.options.length > 0;
    this.data.combo || (s.size = this.data.options.length, this.data.multiSelect && (s.multiple = !0)), s.addEventListener("resetform", (h) => {
      const u = this.data.defaultFieldValue;
      for (const f of s.options)
        f.selected = f.value === u;
    });
    for (const h of this.data.options) {
      const u = document.createElement("option");
      u.textContent = h.displayValue, u.value = h.exportValue, n.value.includes(h.exportValue) && (u.setAttribute("selected", !0), r = !1), s.append(u);
    }
    let a = null;
    if (r) {
      const h = document.createElement("option");
      h.value = " ", h.setAttribute("hidden", !0), h.setAttribute("selected", !0), s.prepend(h), a = () => {
        h.remove(), s.removeEventListener("input", a), a = null;
      }, s.addEventListener("input", a);
    }
    const o = (h) => {
      const u = h ? "value" : "textContent", {
        options: f,
        multiple: d
      } = s;
      return d ? Array.prototype.filter.call(f, (p) => p.selected).map((p) => p[u]) : f.selectedIndex === -1 ? null : f[f.selectedIndex][u];
    };
    let l = o(!1);
    const c = (h) => {
      const u = h.target.options;
      return Array.prototype.map.call(u, (f) => ({
        displayValue: f.textContent,
        exportValue: f.value
      }));
    };
    return this.enableScripting && this.hasJSActions ? (s.addEventListener("updatefromsandbox", (h) => {
      const u = {
        value(f) {
          a == null || a();
          const d = f.detail.value, p = new Set(Array.isArray(d) ? d : [d]);
          for (const g of s.options)
            g.selected = p.has(g.value);
          t.setValue(e, {
            value: o(!0)
          }), l = o(!1);
        },
        multipleSelection(f) {
          s.multiple = !0;
        },
        remove(f) {
          const d = s.options, p = f.detail.remove;
          d[p].selected = !1, s.remove(p), d.length > 0 && Array.prototype.findIndex.call(d, (b) => b.selected) === -1 && (d[0].selected = !0), t.setValue(e, {
            value: o(!0),
            items: c(f)
          }), l = o(!1);
        },
        clear(f) {
          for (; s.length !== 0; )
            s.remove(0);
          t.setValue(e, {
            value: null,
            items: []
          }), l = o(!1);
        },
        insert(f) {
          const {
            index: d,
            displayValue: p,
            exportValue: g
          } = f.detail.insert, b = s.children[d], y = document.createElement("option");
          y.textContent = p, y.value = g, b ? b.before(y) : s.append(y), t.setValue(e, {
            value: o(!0),
            items: c(f)
          }), l = o(!1);
        },
        items(f) {
          const {
            items: d
          } = f.detail;
          for (; s.length !== 0; )
            s.remove(0);
          for (const p of d) {
            const {
              displayValue: g,
              exportValue: b
            } = p, y = document.createElement("option");
            y.textContent = g, y.value = b, s.append(y);
          }
          s.options.length > 0 && (s.options[0].selected = !0), t.setValue(e, {
            value: o(!0),
            items: c(f)
          }), l = o(!1);
        },
        indices(f) {
          const d = new Set(f.detail.indices);
          for (const p of f.target.options)
            p.selected = d.has(p.index);
          t.setValue(e, {
            value: o(!0)
          }), l = o(!1);
        },
        editable(f) {
          f.target.disabled = !f.detail.editable;
        }
      };
      this._dispatchEventFromSandbox(u, h);
    }), s.addEventListener("input", (h) => {
      var d;
      const u = o(!0), f = o(!1);
      t.setValue(e, {
        value: u
      }), h.preventDefault(), (d = this.linkService.eventBus) == null || d.dispatch("dispatcheventinsandbox", {
        source: this,
        detail: {
          id: e,
          name: "Keystroke",
          value: l,
          change: f,
          changeEx: u,
          willCommit: !1,
          commitKey: 1,
          keyDown: !1
        }
      });
    }), this._setEventListeners(s, null, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"], ["input", "Action"], ["input", "Validate"]], (h) => h.target.value)) : s.addEventListener("input", function(h) {
      t.setValue(e, {
        value: o(!0)
      });
    }), this.data.combo && this._setTextStyle(s), this._setBackgroundColor(s), this._setDefaultPropertiesFromJS(s), this.container.append(s), this.container;
  }
}
class n8 extends Ui {
  constructor(t) {
    const {
      data: e,
      elements: n
    } = t;
    super(t, {
      isRenderable: Ui._hasPopupData(e)
    }), this.elements = n, this.popup = null;
  }
  render() {
    this.container.classList.add("popupAnnotation");
    const t = this.popup = new hR({
      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
    }), e = [];
    for (const n of this.elements)
      n.popup = t, n.container.ariaHasPopup = "dialog", e.push(n.data.id), n.addHighlightArea();
    return this.container.setAttribute("aria-controls", e.map((n) => `${Ey}${n}`).join(",")), this.container;
  }
}
var fd, e4, i4, pd, md, Ti, gl, gd, gm, bm, bd, bl, ua, yl, ym, wl, wm, Oh, $h, Je, V5, s8, dC, fC, pC, mC, W5, X5, r8;
class hR {
  constructor({
    container: t,
    color: e,
    elements: n,
    titleObj: s,
    modificationDate: r,
    contentsObj: a,
    richText: o,
    parent: l,
    rect: c,
    parentRect: h,
    open: u
  }) {
    F(this, Je);
    F(this, fd, D(this, Je, pC).bind(this));
    F(this, e4, D(this, Je, r8).bind(this));
    F(this, i4, D(this, Je, X5).bind(this));
    F(this, pd, D(this, Je, W5).bind(this));
    F(this, md, null);
    F(this, Ti, null);
    F(this, gl, null);
    F(this, gd, null);
    F(this, gm, null);
    F(this, bm, null);
    F(this, bd, null);
    F(this, bl, !1);
    F(this, ua, null);
    F(this, yl, null);
    F(this, ym, null);
    F(this, wl, null);
    F(this, wm, null);
    F(this, Oh, null);
    F(this, $h, !1);
    var f;
    E(this, Ti, t), E(this, wm, s), E(this, gl, a), E(this, wl, o), E(this, bm, l), E(this, md, e), E(this, ym, c), E(this, bd, h), E(this, gm, n), E(this, gd, S4.toDateObject(r)), this.trigger = n.flatMap((d) => d.getElementsToTriggerPopup());
    for (const d of this.trigger)
      d.addEventListener("click", m(this, pd)), d.addEventListener("mouseenter", m(this, i4)), d.addEventListener("mouseleave", m(this, e4)), d.classList.add("popupTriggerArea");
    for (const d of n)
      (f = d.container) == null || f.addEventListener("keydown", m(this, fd));
    m(this, Ti).hidden = !0, u && D(this, Je, W5).call(this);
  }
  render() {
    if (m(this, ua))
      return;
    const t = E(this, ua, document.createElement("div"));
    if (t.className = "popup", m(this, md)) {
      const r = t.style.outlineColor = Zt.makeHexColor(...m(this, md));
      t.style.backgroundColor = `color-mix(in srgb, ${r} 30%, white)`;
    }
    const e = document.createElement("span");
    e.className = "header";
    const n = document.createElement("h1");
    if (e.append(n), {
      dir: n.dir,
      str: n.textContent
    } = m(this, wm), t.append(e), m(this, gd)) {
      const r = document.createElement("span");
      r.classList.add("popupDate"), r.setAttribute("data-l10n-id", "pdfjs-annotation-date-time-string"), r.setAttribute("data-l10n-args", JSON.stringify({
        dateObj: m(this, gd).valueOf()
      })), e.append(r);
    }
    const s = m(this, Je, V5);
    if (s)
      Ry.render({
        xfaHtml: s,
        intent: "richText",
        div: t
      }), t.lastChild.classList.add("richText", "popupContent");
    else {
      const r = this._formatContents(m(this, gl));
      t.append(r);
    }
    m(this, Ti).append(t);
  }
  _formatContents({
    str: t,
    dir: e
  }) {
    const n = document.createElement("p");
    n.classList.add("popupContent"), n.dir = e;
    const s = t.split(/(?:\r\n?|\n)/);
    for (let r = 0, a = s.length; r < a; ++r) {
      const o = s[r];
      n.append(document.createTextNode(o)), r < a - 1 && n.append(document.createElement("br"));
    }
    return n;
  }
  updateEdited({
    rect: t,
    popupContent: e
  }) {
    var n;
    m(this, Oh) || E(this, Oh, {
      contentsObj: m(this, gl),
      richText: m(this, wl)
    }), t && E(this, yl, null), e && (E(this, wl, D(this, Je, fC).call(this, e)), E(this, gl, null)), (n = m(this, ua)) == null || n.remove(), E(this, ua, null);
  }
  resetEdited() {
    var t;
    m(this, Oh) && ({
      contentsObj: Zn(this, gl)._,
      richText: Zn(this, wl)._
    } = m(this, Oh), E(this, Oh, null), (t = m(this, ua)) == null || t.remove(), E(this, ua, null), E(this, yl, null));
  }
  forceHide() {
    E(this, $h, this.isVisible), m(this, $h) && (m(this, Ti).hidden = !0);
  }
  maybeShow() {
    m(this, $h) && (m(this, ua) || D(this, Je, X5).call(this), E(this, $h, !1), m(this, Ti).hidden = !1);
  }
  get isVisible() {
    return m(this, Ti).hidden === !1;
  }
}
fd = new WeakMap(), e4 = new WeakMap(), i4 = new WeakMap(), pd = new WeakMap(), md = new WeakMap(), Ti = new WeakMap(), gl = new WeakMap(), gd = new WeakMap(), gm = new WeakMap(), bm = new WeakMap(), bd = new WeakMap(), bl = new WeakMap(), ua = new WeakMap(), yl = new WeakMap(), ym = new WeakMap(), wl = new WeakMap(), wm = new WeakMap(), Oh = new WeakMap(), $h = new WeakMap(), Je = new WeakSet(), V5 = function() {
  const t = m(this, wl), e = m(this, gl);
  return t != null && t.str && (!(e != null && e.str) || e.str === t.str) && m(this, wl).html || null;
}, s8 = function() {
  var t, e, n;
  return ((n = (e = (t = m(this, Je, V5)) == null ? void 0 : t.attributes) == null ? void 0 : e.style) == null ? void 0 : n.fontSize) || 0;
}, dC = function() {
  var t, e, n;
  return ((n = (e = (t = m(this, Je, V5)) == null ? void 0 : t.attributes) == null ? void 0 : e.style) == null ? void 0 : n.color) || null;
}, fC = function(t) {
  const e = [], n = {
    str: t,
    html: {
      name: "div",
      attributes: {
        dir: "auto"
      },
      children: [{
        name: "p",
        children: e
      }]
    }
  }, s = {
    style: {
      color: m(this, Je, dC),
      fontSize: m(this, Je, s8) ? `calc(${m(this, Je, s8)}px * var(--total-scale-factor))` : ""
    }
  };
  for (const r of t.split(`
`))
    e.push({
      name: "span",
      value: r,
      attributes: s
    });
  return n;
}, pC = function(t) {
  t.altKey || t.shiftKey || t.ctrlKey || t.metaKey || (t.key === "Enter" || t.key === "Escape" && m(this, bl)) && D(this, Je, W5).call(this);
}, mC = function() {
  if (m(this, yl) !== null)
    return;
  const {
    page: {
      view: t
    },
    viewport: {
      rawDims: {
        pageWidth: e,
        pageHeight: n,
        pageX: s,
        pageY: r
      }
    }
  } = m(this, bm);
  let a = !!m(this, bd), o = a ? m(this, bd) : m(this, ym);
  for (const p of m(this, gm))
    if (!o || Zt.intersect(p.data.rect, o) !== null) {
      o = p.data.rect, a = !0;
      break;
    }
  const l = Zt.normalizeRect([o[0], t[3] - o[1] + t[1], o[2], t[3] - o[3] + t[1]]), h = a ? o[2] - o[0] + 5 : 0, u = l[0] + h, f = l[1];
  E(this, yl, [100 * (u - s) / e, 100 * (f - r) / n]);
  const {
    style: d
  } = m(this, Ti);
  d.left = `${m(this, yl)[0]}%`, d.top = `${m(this, yl)[1]}%`;
}, W5 = function() {
  E(this, bl, !m(this, bl)), m(this, bl) ? (D(this, Je, X5).call(this), m(this, Ti).addEventListener("click", m(this, pd)), m(this, Ti).addEventListener("keydown", m(this, fd))) : (D(this, Je, r8).call(this), m(this, Ti).removeEventListener("click", m(this, pd)), m(this, Ti).removeEventListener("keydown", m(this, fd)));
}, X5 = function() {
  m(this, ua) || this.render(), this.isVisible ? m(this, bl) && m(this, Ti).classList.add("focused") : (D(this, Je, mC).call(this), m(this, Ti).hidden = !1, m(this, Ti).style.zIndex = parseInt(m(this, Ti).style.zIndex) + 1e3);
}, r8 = function() {
  m(this, Ti).classList.remove("focused"), !(m(this, bl) || !this.isVisible) && (m(this, Ti).hidden = !0, m(this, Ti).style.zIndex = parseInt(m(this, Ti).style.zIndex) - 1e3);
};
class gC extends Ui {
  constructor(t) {
    super(t, {
      isRenderable: !0,
      ignoreBorder: !0
    }), this.textContent = t.data.textContent, this.textPosition = t.data.textPosition, this.annotationEditorType = fe.FREETEXT;
  }
  render() {
    if (this.container.classList.add("freeTextAnnotation"), this.textContent) {
      const t = document.createElement("div");
      t.classList.add("annotationTextContent"), t.setAttribute("role", "comment");
      for (const e of this.textContent) {
        const n = document.createElement("span");
        n.textContent = e, t.append(n);
      }
      this.container.append(t);
    }
    return !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
  }
}
var vm;
class uR extends Ui {
  constructor(e) {
    super(e, {
      isRenderable: !0,
      ignoreBorder: !0
    });
    F(this, vm, null);
  }
  render() {
    this.container.classList.add("lineAnnotation");
    const {
      data: e,
      width: n,
      height: s
    } = this, r = this.svgFactory.create(n, s, !0), a = E(this, vm, this.svgFactory.createElement("svg:line"));
    return a.setAttribute("x1", e.rect[2] - e.lineCoordinates[0]), a.setAttribute("y1", e.rect[3] - e.lineCoordinates[1]), a.setAttribute("x2", e.rect[2] - e.lineCoordinates[2]), a.setAttribute("y2", e.rect[3] - e.lineCoordinates[3]), a.setAttribute("stroke-width", e.borderStyle.width || 1), a.setAttribute("stroke", "transparent"), a.setAttribute("fill", "transparent"), r.append(a), this.container.append(r), !e.popupRef && this.hasPopupData && this._createPopup(), this.container;
  }
  getElementsToTriggerPopup() {
    return m(this, vm);
  }
  addHighlightArea() {
    this.container.classList.add("highlightArea");
  }
}
vm = new WeakMap();
var _m;
class dR extends Ui {
  constructor(e) {
    super(e, {
      isRenderable: !0,
      ignoreBorder: !0
    });
    F(this, _m, null);
  }
  render() {
    this.container.classList.add("squareAnnotation");
    const {
      data: e,
      width: n,
      height: s
    } = this, r = this.svgFactory.create(n, s, !0), a = e.borderStyle.width, o = E(this, _m, this.svgFactory.createElement("svg:rect"));
    return o.setAttribute("x", a / 2), o.setAttribute("y", a / 2), o.setAttribute("width", n - a), o.setAttribute("height", s - a), o.setAttribute("stroke-width", a || 1), o.setAttribute("stroke", "transparent"), o.setAttribute("fill", "transparent"), r.append(o), this.container.append(r), !e.popupRef && this.hasPopupData && this._createPopup(), this.container;
  }
  getElementsToTriggerPopup() {
    return m(this, _m);
  }
  addHighlightArea() {
    this.container.classList.add("highlightArea");
  }
}
_m = new WeakMap();
var xm;
class fR extends Ui {
  constructor(e) {
    super(e, {
      isRenderable: !0,
      ignoreBorder: !0
    });
    F(this, xm, null);
  }
  render() {
    this.container.classList.add("circleAnnotation");
    const {
      data: e,
      width: n,
      height: s
    } = this, r = this.svgFactory.create(n, s, !0), a = e.borderStyle.width, o = E(this, xm, this.svgFactory.createElement("svg:ellipse"));
    return o.setAttribute("cx", n / 2), o.setAttribute("cy", s / 2), o.setAttribute("rx", n / 2 - a / 2), o.setAttribute("ry", s / 2 - a / 2), o.setAttribute("stroke-width", a || 1), o.setAttribute("stroke", "transparent"), o.setAttribute("fill", "transparent"), r.append(o), this.container.append(r), !e.popupRef && this.hasPopupData && this._createPopup(), this.container;
  }
  getElementsToTriggerPopup() {
    return m(this, xm);
  }
  addHighlightArea() {
    this.container.classList.add("highlightArea");
  }
}
xm = new WeakMap();
var km;
class bC extends Ui {
  constructor(e) {
    super(e, {
      isRenderable: !0,
      ignoreBorder: !0
    });
    F(this, km, null);
    this.containerClassName = "polylineAnnotation", this.svgElementName = "svg:polyline";
  }
  render() {
    this.container.classList.add(this.containerClassName);
    const {
      data: {
        rect: e,
        vertices: n,
        borderStyle: s,
        popupRef: r
      },
      width: a,
      height: o
    } = this;
    if (!n)
      return this.container;
    const l = this.svgFactory.create(a, o, !0);
    let c = [];
    for (let u = 0, f = n.length; u < f; u += 2) {
      const d = n[u] - e[0], p = e[3] - n[u + 1];
      c.push(`${d},${p}`);
    }
    c = c.join(" ");
    const h = E(this, km, this.svgFactory.createElement(this.svgElementName));
    return h.setAttribute("points", c), h.setAttribute("stroke-width", s.width || 1), h.setAttribute("stroke", "transparent"), h.setAttribute("fill", "transparent"), l.append(h), this.container.append(l), !r && this.hasPopupData && this._createPopup(), this.container;
  }
  getElementsToTriggerPopup() {
    return m(this, km);
  }
  addHighlightArea() {
    this.container.classList.add("highlightArea");
  }
}
km = new WeakMap();
class pR extends bC {
  constructor(t) {
    super(t), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
  }
}
class mR extends Ui {
  constructor(t) {
    super(t, {
      isRenderable: !0,
      ignoreBorder: !0
    });
  }
  render() {
    return this.container.classList.add("caretAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
  }
}
var Am, qh, Sm, a8;
class By extends Ui {
  constructor(e) {
    super(e, {
      isRenderable: !0,
      ignoreBorder: !0
    });
    F(this, Sm);
    F(this, Am, null);
    F(this, qh, []);
    this.containerClassName = "inkAnnotation", this.svgElementName = "svg:polyline", this.annotationEditorType = this.data.it === "InkHighlight" ? fe.HIGHLIGHT : fe.INK;
  }
  render() {
    this.container.classList.add(this.containerClassName);
    const {
      data: {
        rect: e,
        rotation: n,
        inkLists: s,
        borderStyle: r,
        popupRef: a
      }
    } = this, {
      transform: o,
      width: l,
      height: c
    } = D(this, Sm, a8).call(this, n, e), h = this.svgFactory.create(l, c, !0), u = E(this, Am, this.svgFactory.createElement("svg:g"));
    h.append(u), u.setAttribute("stroke-width", r.width || 1), u.setAttribute("stroke-linecap", "round"), u.setAttribute("stroke-linejoin", "round"), u.setAttribute("stroke-miterlimit", 10), u.setAttribute("stroke", "transparent"), u.setAttribute("fill", "transparent"), u.setAttribute("transform", o);
    for (let f = 0, d = s.length; f < d; f++) {
      const p = this.svgFactory.createElement(this.svgElementName);
      m(this, qh).push(p), p.setAttribute("points", s[f].join(",")), u.append(p);
    }
    return !a && this.hasPopupData && this._createPopup(), this.container.append(h), this._editOnDoubleClick(), this.container;
  }
  updateEdited(e) {
    super.updateEdited(e);
    const {
      thickness: n,
      points: s,
      rect: r
    } = e, a = m(this, Am);
    if (n >= 0 && a.setAttribute("stroke-width", n || 1), s)
      for (let o = 0, l = m(this, qh).length; o < l; o++)
        m(this, qh)[o].setAttribute("points", s[o].join(","));
    if (r) {
      const {
        transform: o,
        width: l,
        height: c
      } = D(this, Sm, a8).call(this, this.data.rotation, r);
      a.parentElement.setAttribute("viewBox", `0 0 ${l} ${c}`), a.setAttribute("transform", o);
    }
  }
  getElementsToTriggerPopup() {
    return m(this, qh);
  }
  addHighlightArea() {
    this.container.classList.add("highlightArea");
  }
}
Am = new WeakMap(), qh = new WeakMap(), Sm = new WeakSet(), a8 = function(e, n) {
  switch (e) {
    case 90:
      return {
        transform: `rotate(90) translate(${-n[0]},${n[1]}) scale(1,-1)`,
        width: n[3] - n[1],
        height: n[2] - n[0]
      };
    case 180:
      return {
        transform: `rotate(180) translate(${-n[2]},${n[1]}) scale(1,-1)`,
        width: n[2] - n[0],
        height: n[3] - n[1]
      };
    case 270:
      return {
        transform: `rotate(270) translate(${-n[2]},${n[3]}) scale(1,-1)`,
        width: n[3] - n[1],
        height: n[2] - n[0]
      };
    default:
      return {
        transform: `translate(${-n[0]},${n[3]}) scale(1,-1)`,
        width: n[2] - n[0],
        height: n[3] - n[1]
      };
  }
};
class yC extends Ui {
  constructor(t) {
    super(t, {
      isRenderable: !0,
      ignoreBorder: !0,
      createQuadrilaterals: !0
    }), this.annotationEditorType = fe.HIGHLIGHT;
  }
  render() {
    return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("highlightAnnotation"), this._editOnDoubleClick(), this.container;
  }
}
class gR extends Ui {
  constructor(t) {
    super(t, {
      isRenderable: !0,
      ignoreBorder: !0,
      createQuadrilaterals: !0
    });
  }
  render() {
    return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("underlineAnnotation"), this.container;
  }
}
class bR extends Ui {
  constructor(t) {
    super(t, {
      isRenderable: !0,
      ignoreBorder: !0,
      createQuadrilaterals: !0
    });
  }
  render() {
    return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("squigglyAnnotation"), this.container;
  }
}
class yR extends Ui {
  constructor(t) {
    super(t, {
      isRenderable: !0,
      ignoreBorder: !0,
      createQuadrilaterals: !0
    });
  }
  render() {
    return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("strikeoutAnnotation"), this.container;
  }
}
class wC extends Ui {
  constructor(t) {
    super(t, {
      isRenderable: !0,
      ignoreBorder: !0
    }), this.annotationEditorType = fe.STAMP;
  }
  render() {
    return this.container.classList.add("stampAnnotation"), this.container.setAttribute("role", "img"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
  }
}
var Cm, Em, o8;
class wR extends Ui {
  constructor(e) {
    var s;
    super(e, {
      isRenderable: !0
    });
    F(this, Em);
    F(this, Cm, null);
    const {
      file: n
    } = this.data;
    this.filename = n.filename, this.content = n.content, (s = this.linkService.eventBus) == null || s.dispatch("fileattachmentannotation", {
      source: this,
      ...n
    });
  }
  render() {
    this.container.classList.add("fileAttachmentAnnotation");
    const {
      container: e,
      data: n
    } = this;
    let s;
    n.hasAppearance || n.fillAlpha === 0 ? s = document.createElement("div") : (s = document.createElement("img"), s.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(n.name) ? "paperclip" : "pushpin"}.svg`, n.fillAlpha && n.fillAlpha < 1 && (s.style = `filter: opacity(${Math.round(n.fillAlpha * 100)}%);`)), s.addEventListener("dblclick", D(this, Em, o8).bind(this)), E(this, Cm, s);
    const {
      isMac: r
    } = gn.platform;
    return e.addEventListener("keydown", (a) => {
      a.key === "Enter" && (r ? a.metaKey : a.ctrlKey) && D(this, Em, o8).call(this);
    }), !n.popupRef && this.hasPopupData ? this._createPopup() : s.classList.add("popupTriggerArea"), e.append(s), e;
  }
  getElementsToTriggerPopup() {
    return m(this, Cm);
  }
  addHighlightArea() {
    this.container.classList.add("highlightArea");
  }
}
Cm = new WeakMap(), Em = new WeakSet(), o8 = function() {
  var e;
  (e = this.downloadManager) == null || e.openOrDownloadData(this.content, this.filename);
};
var Dm, zh, Lc, Tm, w0, l8, c8;
const av = class av {
  constructor({
    div: t,
    accessibilityManager: e,
    annotationCanvasMap: n,
    annotationEditorUIManager: s,
    page: r,
    viewport: a,
    structTreeLayer: o
  }) {
    F(this, w0);
    F(this, Dm, null);
    F(this, zh, null);
    F(this, Lc, /* @__PURE__ */ new Map());
    F(this, Tm, null);
    this.div = t, E(this, Dm, e), E(this, zh, n), E(this, Tm, o || null), this.page = r, this.viewport = a, this.zIndex = 0, this._annotationEditorUIManager = s;
  }
  hasEditableAnnotations() {
    return m(this, Lc).size > 0;
  }
  async render(t) {
    var a;
    const {
      annotations: e
    } = t, n = this.div;
    h0(n, this.viewport);
    const s = /* @__PURE__ */ new Map(), r = {
      data: null,
      layer: n,
      linkService: t.linkService,
      downloadManager: t.downloadManager,
      imageResourcesPath: t.imageResourcesPath || "",
      renderForms: t.renderForms !== !1,
      svgFactory: new Q2(),
      annotationStorage: t.annotationStorage || new Ty(),
      enableScripting: t.enableScripting === !0,
      hasJSActions: t.hasJSActions,
      fieldObjects: t.fieldObjects,
      parent: this,
      elements: null
    };
    for (const o of e) {
      if (o.noHTML)
        continue;
      const l = o.annotationType === Bi.POPUP;
      if (l) {
        const u = s.get(o.id);
        if (!u)
          continue;
        r.elements = u;
      } else if (o.rect[2] === o.rect[0] || o.rect[3] === o.rect[1])
        continue;
      r.data = o;
      const c = Uv.create(r);
      if (!c.isRenderable)
        continue;
      if (!l && o.popupRef) {
        const u = s.get(o.popupRef);
        u ? u.push(c) : s.set(o.popupRef, [c]);
      }
      const h = c.render();
      o.hidden && (h.style.visibility = "hidden"), await D(this, w0, l8).call(this, h, o.id), c._isEditable && (m(this, Lc).set(c.data.id, c), (a = this._annotationEditorUIManager) == null || a.renderAnnotationElement(c));
    }
    D(this, w0, c8).call(this);
  }
  async addLinkAnnotations(t, e) {
    const n = {
      data: null,
      layer: this.div,
      linkService: e,
      svgFactory: new Q2(),
      parent: this
    };
    for (const s of t) {
      s.borderStyle || (s.borderStyle = av._defaultBorderStyle), n.data = s;
      const r = Uv.create(n);
      if (!r.isRenderable)
        continue;
      const a = r.render();
      await D(this, w0, l8).call(this, a, s.id);
    }
  }
  update({
    viewport: t
  }) {
    const e = this.div;
    this.viewport = t, h0(e, {
      rotation: t.rotation
    }), D(this, w0, c8).call(this), e.hidden = !1;
  }
  getEditableAnnotations() {
    return Array.from(m(this, Lc).values());
  }
  getEditableAnnotation(t) {
    return m(this, Lc).get(t);
  }
  static get _defaultBorderStyle() {
    return Fe(this, "_defaultBorderStyle", Object.freeze({
      width: 1,
      rawWidth: 1,
      style: Z1.SOLID,
      dashArray: [3],
      horizontalCornerRadius: 0,
      verticalCornerRadius: 0
    }));
  }
};
Dm = new WeakMap(), zh = new WeakMap(), Lc = new WeakMap(), Tm = new WeakMap(), w0 = new WeakSet(), l8 = async function(t, e) {
  var a, o;
  const n = t.firstChild || t, s = n.id = `${Ey}${e}`, r = await ((a = m(this, Tm)) == null ? void 0 : a.getAriaAttributes(s));
  if (r)
    for (const [l, c] of r)
      n.setAttribute(l, c);
  this.div.append(t), (o = m(this, Dm)) == null || o.moveElementInDOM(this.div, t, n, !1);
}, c8 = function() {
  var e;
  if (!m(this, zh))
    return;
  const t = this.div;
  for (const [n, s] of m(this, zh)) {
    const r = t.querySelector(`[data-annotation-id="${n}"]`);
    if (!r)
      continue;
    s.className = "annotationContent";
    const {
      firstChild: a
    } = r;
    a ? a.nodeName === "CANVAS" ? a.replaceWith(s) : a.classList.contains("annotationContent") ? a.after(s) : a.before(s) : r.append(s);
    const o = m(this, Lc).get(n);
    o && (o._hasNoCanvas ? ((e = this._annotationEditorUIManager) == null || e.setMissingCanvas(n, r.id, s), o._hasNoCanvas = !1) : o.canvas = s);
  }
  m(this, zh).clear();
};
let $9 = av;
const Gg = /\r\n?|\n/g;
var da, Gs, Fm, Uh, Vs, Xi, vC, _C, xC, Y5, zl, K5, Z5, kC, u8, AC;
const ii = class ii extends si {
  constructor(e) {
    super({
      ...e,
      name: "freeTextEditor"
    });
    F(this, Xi);
    F(this, da);
    F(this, Gs, "");
    F(this, Fm, `${this.id}-editor`);
    F(this, Uh, null);
    F(this, Vs);
    E(this, da, e.color || ii._defaultColor || si._defaultLineColor), E(this, Vs, e.fontSize || ii._defaultFontSize);
  }
  static get _keyboardManager() {
    const e = ii.prototype, n = (a) => a.isEmpty(), s = u0.TRANSLATE_SMALL, r = u0.TRANSLATE_BIG;
    return Fe(this, "_keyboardManager", new yg([[["ctrl+s", "mac+meta+s", "ctrl+p", "mac+meta+p"], e.commitOrRemove, {
      bubbles: !0
    }], [["ctrl+Enter", "mac+meta+Enter", "Escape", "mac+Escape"], e.commitOrRemove], [["ArrowLeft", "mac+ArrowLeft"], e._translateEmpty, {
      args: [-s, 0],
      checker: n
    }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], e._translateEmpty, {
      args: [-r, 0],
      checker: n
    }], [["ArrowRight", "mac+ArrowRight"], e._translateEmpty, {
      args: [s, 0],
      checker: n
    }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], e._translateEmpty, {
      args: [r, 0],
      checker: n
    }], [["ArrowUp", "mac+ArrowUp"], e._translateEmpty, {
      args: [0, -s],
      checker: n
    }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], e._translateEmpty, {
      args: [0, -r],
      checker: n
    }], [["ArrowDown", "mac+ArrowDown"], e._translateEmpty, {
      args: [0, s],
      checker: n
    }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], e._translateEmpty, {
      args: [0, r],
      checker: n
    }]]));
  }
  static initialize(e, n) {
    si.initialize(e, n);
    const s = getComputedStyle(document.documentElement);
    this._internalPadding = parseFloat(s.getPropertyValue("--freetext-padding"));
  }
  static updateDefaultParams(e, n) {
    switch (e) {
      case Ie.FREETEXT_SIZE:
        ii._defaultFontSize = n;
        break;
      case Ie.FREETEXT_COLOR:
        ii._defaultColor = n;
        break;
    }
  }
  updateParams(e, n) {
    switch (e) {
      case Ie.FREETEXT_SIZE:
        D(this, Xi, vC).call(this, n);
        break;
      case Ie.FREETEXT_COLOR:
        D(this, Xi, _C).call(this, n);
        break;
    }
  }
  static get defaultPropertiesToUpdate() {
    return [[Ie.FREETEXT_SIZE, ii._defaultFontSize], [Ie.FREETEXT_COLOR, ii._defaultColor || si._defaultLineColor]];
  }
  get propertiesToUpdate() {
    return [[Ie.FREETEXT_SIZE, m(this, Vs)], [Ie.FREETEXT_COLOR, m(this, da)]];
  }
  _translateEmpty(e, n) {
    this._uiManager.translateSelectedEditors(e, n, !0);
  }
  getInitialTranslation() {
    const e = this.parentScale;
    return [-ii._internalPadding * e, -(ii._internalPadding + m(this, Vs)) * e];
  }
  rebuild() {
    this.parent && (super.rebuild(), this.div !== null && (this.isAttachedToDOM || this.parent.add(this)));
  }
  enableEditMode() {
    if (!super.enableEditMode())
      return !1;
    this.overlayDiv.classList.remove("enabled"), this.editorDiv.contentEditable = !0, this._isDraggable = !1, this.div.removeAttribute("aria-activedescendant"), E(this, Uh, new AbortController());
    const e = this._uiManager.combinedSignal(m(this, Uh));
    return this.editorDiv.addEventListener("keydown", this.editorDivKeydown.bind(this), {
      signal: e
    }), this.editorDiv.addEventListener("focus", this.editorDivFocus.bind(this), {
      signal: e
    }), this.editorDiv.addEventListener("blur", this.editorDivBlur.bind(this), {
      signal: e
    }), this.editorDiv.addEventListener("input", this.editorDivInput.bind(this), {
      signal: e
    }), this.editorDiv.addEventListener("paste", this.editorDivPaste.bind(this), {
      signal: e
    }), !0;
  }
  disableEditMode() {
    var e;
    return super.disableEditMode() ? (this.overlayDiv.classList.add("enabled"), this.editorDiv.contentEditable = !1, this.div.setAttribute("aria-activedescendant", m(this, Fm)), this._isDraggable = !0, (e = m(this, Uh)) == null || e.abort(), E(this, Uh, null), this.div.focus({
      preventScroll: !0
    }), this.isEditing = !1, this.parent.div.classList.add("freetextEditing"), !0) : !1;
  }
  focusin(e) {
    this._focusEventsAllowed && (super.focusin(e), e.target !== this.editorDiv && this.editorDiv.focus());
  }
  onceAdded(e) {
    var n;
    this.width || (this.enableEditMode(), e && this.editorDiv.focus(), (n = this._initialOptions) != null && n.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 e = m(this, Gs), n = E(this, Gs, D(this, Xi, xC).call(this).trimEnd());
    if (e === n)
      return;
    const s = (r) => {
      if (E(this, Gs, r), !r) {
        this.remove();
        return;
      }
      D(this, Xi, Z5).call(this), this._uiManager.rebuild(this), D(this, Xi, Y5).call(this);
    };
    this.addCommands({
      cmd: () => {
        s(n);
      },
      undo: () => {
        s(e);
      },
      mustExec: !1
    }), D(this, Xi, Y5).call(this);
  }
  shouldGetKeyboardEvents() {
    return this.isInEditMode();
  }
  enterInEditMode() {
    this.enableEditMode(), this.editorDiv.focus();
  }
  keydown(e) {
    e.target === this.div && e.key === "Enter" && (this.enterInEditMode(), e.preventDefault());
  }
  editorDivKeydown(e) {
    ii._keyboardManager.exec(this, e);
  }
  editorDivFocus(e) {
    this.isEditing = !0;
  }
  editorDivBlur(e) {
    this.isEditing = !1;
  }
  editorDivInput(e) {
    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);
  }
  get canChangeContent() {
    return !0;
  }
  render() {
    if (this.div)
      return this.div;
    let e, n;
    (this._isCopy || this.annotationElementId) && (e = this.x, n = this.y), super.render(), this.editorDiv = document.createElement("div"), this.editorDiv.className = "internal", this.editorDiv.setAttribute("id", m(this, Fm)), this.editorDiv.setAttribute("data-l10n-id", "pdfjs-free-text2"), this.editorDiv.setAttribute("data-l10n-attrs", "default-content"), this.enableEditing(), this.editorDiv.contentEditable = !0;
    const {
      style: s
    } = this.editorDiv;
    if (s.fontSize = `calc(${m(this, Vs)}px * var(--total-scale-factor))`, s.color = m(this, da), this.div.append(this.editorDiv), this.overlayDiv = document.createElement("div"), this.overlayDiv.classList.add("overlay", "enabled"), this.div.append(this.overlayDiv), this._isCopy || this.annotationElementId) {
      const [r, a] = this.parentDimensions;
      if (this.annotationElementId) {
        const {
          position: o
        } = this._initialData;
        let [l, c] = this.getInitialTranslation();
        [l, c] = this.pageTranslationToScreen(l, c);
        const [h, u] = this.pageDimensions, [f, d] = this.pageTranslation;
        let p, g;
        switch (this.rotation) {
          case 0:
            p = e + (o[0] - f) / h, g = n + this.height - (o[1] - d) / u;
            break;
          case 90:
            p = e + (o[0] - f) / h, g = n - (o[1] - d) / u, [l, c] = [c, -l];
            break;
          case 180:
            p = e - this.width + (o[0] - f) / h, g = n - (o[1] - d) / u, [l, c] = [-l, -c];
            break;
          case 270:
            p = e + (o[0] - f - this.height * u) / h, g = n + (o[1] - d - this.width * h) / u, [l, c] = [-c, l];
            break;
        }
        this.setAt(p * r, g * a, l, c);
      } else
        this._moveAfterPaste(e, n);
      D(this, Xi, Z5).call(this), this._isDraggable = !0, this.editorDiv.contentEditable = !1;
    } else
      this._isDraggable = !1, this.editorDiv.contentEditable = !0;
    return this.div;
  }
  editorDivPaste(e) {
    var p, g, b;
    const n = e.clipboardData || window.clipboardData, {
      types: s
    } = n;
    if (s.length === 1 && s[0] === "text/plain")
      return;
    e.preventDefault();
    const r = D(p = ii, zl, u8).call(p, n.getData("text") || "").replaceAll(Gg, `
`);
    if (!r)
      return;
    const a = window.getSelection();
    if (!a.rangeCount)
      return;
    this.editorDiv.normalize(), a.deleteFromDocument();
    const o = a.getRangeAt(0);
    if (!r.includes(`
`)) {
      o.insertNode(document.createTextNode(r)), this.editorDiv.normalize(), a.collapseToStart();
      return;
    }
    const {
      startContainer: l,
      startOffset: c
    } = o, h = [], u = [];
    if (l.nodeType === Node.TEXT_NODE) {
      const y = l.parentElement;
      if (u.push(l.nodeValue.slice(c).replaceAll(Gg, "")), y !== this.editorDiv) {
        let v = h;
        for (const w of this.editorDiv.childNodes) {
          if (w === y) {
            v = u;
            continue;
          }
          v.push(D(g = ii, zl, K5).call(g, w));
        }
      }
      h.push(l.nodeValue.slice(0, c).replaceAll(Gg, ""));
    } else if (l === this.editorDiv) {
      let y = h, v = 0;
      for (const w of this.editorDiv.childNodes)
        v++ === c && (y = u), y.push(D(b = ii, zl, K5).call(b, w));
    }
    E(this, Gs, `${h.join(`
`)}${r}${u.join(`
`)}`), D(this, Xi, Z5).call(this);
    const f = new Range();
    let d = Math.sumPrecise(h.map((y) => y.length));
    for (const {
      firstChild: y
    } of this.editorDiv.childNodes)
      if (y.nodeType === Node.TEXT_NODE) {
        const v = y.nodeValue.length;
        if (d <= v) {
          f.setStart(y, d), f.setEnd(y, d);
          break;
        }
        d -= v;
      }
    a.removeAllRanges(), a.addRange(f);
  }
  get contentDiv() {
    return this.editorDiv;
  }
  static async deserialize(e, n, s) {
    var o;
    let r = null;
    if (e instanceof gC) {
      const {
        data: {
          defaultAppearanceData: {
            fontSize: l,
            fontColor: c
          },
          rect: h,
          rotation: u,
          id: f,
          popupRef: d
        },
        textContent: p,
        textPosition: g,
        parent: {
          page: {
            pageNumber: b
          }
        }
      } = e;
      if (!p || p.length === 0)
        return null;
      r = e = {
        annotationType: fe.FREETEXT,
        color: Array.from(c),
        fontSize: l,
        value: p.join(`
`),
        position: g,
        pageIndex: b - 1,
        rect: h.slice(0),
        rotation: u,
        id: f,
        deleted: !1,
        popupRef: d
      };
    }
    const a = await super.deserialize(e, n, s);
    return E(a, Vs, e.fontSize), E(a, da, Zt.makeHexColor(...e.color)), E(a, Gs, D(o = ii, zl, u8).call(o, e.value)), a.annotationElementId = e.id || null, a._initialData = r, a;
  }
  serialize(e = !1) {
    if (this.isEmpty())
      return null;
    if (this.deleted)
      return this.serializeDeleted();
    const n = ii._internalPadding * this.parentScale, s = this.getRect(n, n), r = si._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : m(this, da)), a = {
      annotationType: fe.FREETEXT,
      color: r,
      fontSize: m(this, Vs),
      value: D(this, Xi, kC).call(this),
      pageIndex: this.pageIndex,
      rect: s,
      rotation: this.rotation,
      structTreeParentId: this._structTreeParentId
    };
    return e ? (a.isCopy = !0, a) : this.annotationElementId && !D(this, Xi, AC).call(this, a) ? null : (a.id = this.annotationElementId, a);
  }
  renderAnnotationElement(e) {
    const n = super.renderAnnotationElement(e);
    if (this.deleted)
      return n;
    const {
      style: s
    } = n;
    s.fontSize = `calc(${m(this, Vs)}px * var(--total-scale-factor))`, s.color = m(this, da), n.replaceChildren();
    for (const a of m(this, Gs).split(`
`)) {
      const o = document.createElement("div");
      o.append(a ? document.createTextNode(a) : document.createElement("br")), n.append(o);
    }
    const r = ii._internalPadding * this.parentScale;
    return e.updateEdited({
      rect: this.getRect(r, r),
      popupContent: m(this, Gs)
    }), n;
  }
  resetAnnotationElement(e) {
    super.resetAnnotationElement(e), e.resetEdited();
  }
};
da = new WeakMap(), Gs = new WeakMap(), Fm = new WeakMap(), Uh = new WeakMap(), Vs = new WeakMap(), Xi = new WeakSet(), vC = function(e) {
  const n = (r) => {
    this.editorDiv.style.fontSize = `calc(${r}px * var(--total-scale-factor))`, this.translate(0, -(r - m(this, Vs)) * this.parentScale), E(this, Vs, r), D(this, Xi, Y5).call(this);
  }, s = m(this, Vs);
  this.addCommands({
    cmd: n.bind(this, e),
    undo: n.bind(this, s),
    post: this._uiManager.updateUI.bind(this._uiManager, this),
    mustExec: !0,
    type: Ie.FREETEXT_SIZE,
    overwriteIfSameType: !0,
    keepUndo: !0
  });
}, _C = function(e) {
  const n = (r) => {
    E(this, da, this.editorDiv.style.color = r);
  }, s = m(this, da);
  this.addCommands({
    cmd: n.bind(this, e),
    undo: n.bind(this, s),
    post: this._uiManager.updateUI.bind(this._uiManager, this),
    mustExec: !0,
    type: Ie.FREETEXT_COLOR,
    overwriteIfSameType: !0,
    keepUndo: !0
  });
}, xC = function() {
  var s;
  const e = [];
  this.editorDiv.normalize();
  let n = null;
  for (const r of this.editorDiv.childNodes)
    (n == null ? void 0 : n.nodeType) === Node.TEXT_NODE && r.nodeName === "BR" || (e.push(D(s = ii, zl, K5).call(s, r)), n = r);
  return e.join(`
`);
}, Y5 = function() {
  const [e, n] = this.parentDimensions;
  let s;
  if (this.isAttachedToDOM)
    s = this.div.getBoundingClientRect();
  else {
    const {
      currentLayer: r,
      div: a
    } = this, o = a.style.display, l = a.classList.contains("hidden");
    a.classList.remove("hidden"), a.style.display = "hidden", r.div.append(this.div), s = a.getBoundingClientRect(), a.remove(), a.style.display = o, a.classList.toggle("hidden", l);
  }
  this.rotation % 180 === this.parentRotation % 180 ? (this.width = s.width / e, this.height = s.height / n) : (this.width = s.height / e, this.height = s.width / n), this.fixAndSetPosition();
}, zl = new WeakSet(), K5 = function(e) {
  return (e.nodeType === Node.TEXT_NODE ? e.nodeValue : e.innerText).replaceAll(Gg, "");
}, Z5 = function() {
  if (this.editorDiv.replaceChildren(), !!m(this, Gs))
    for (const e of m(this, Gs).split(`
`)) {
      const n = document.createElement("div");
      n.append(e ? document.createTextNode(e) : document.createElement("br")), this.editorDiv.append(n);
    }
}, kC = function() {
  return m(this, Gs).replaceAll(" ", " ");
}, u8 = function(e) {
  return e.replaceAll(" ", " ");
}, AC = function(e) {
  const {
    value: n,
    fontSize: s,
    color: r,
    pageIndex: a
  } = this._initialData;
  return this._hasBeenMoved || e.value !== n || e.fontSize !== s || e.color.some((o, l) => o !== r[l]) || e.pageIndex !== a;
}, F(ii, zl), ft(ii, "_freeTextDefaultContent", ""), ft(ii, "_internalPadding", 0), ft(ii, "_defaultColor", null), ft(ii, "_defaultFontSize", 10), ft(ii, "_type", "freetext"), ft(ii, "_editorType", fe.FREETEXT);
let h8 = ii;
class Ht {
  toSVGPath() {
    Ze("Abstract method `toSVGPath` must be implemented.");
  }
  get box() {
    Ze("Abstract getter `box` must be implemented.");
  }
  serialize(t, e) {
    Ze("Abstract method `serialize` must be implemented.");
  }
  static _rescale(t, e, n, s, r, a) {
    a || (a = new Float32Array(t.length));
    for (let o = 0, l = t.length; o < l; o += 2)
      a[o] = e + t[o] * s, a[o + 1] = n + t[o + 1] * r;
    return a;
  }
  static _rescaleAndSwap(t, e, n, s, r, a) {
    a || (a = new Float32Array(t.length));
    for (let o = 0, l = t.length; o < l; o += 2)
      a[o] = e + t[o + 1] * s, a[o + 1] = n + t[o] * r;
    return a;
  }
  static _translate(t, e, n, s) {
    s || (s = new Float32Array(t.length));
    for (let r = 0, a = t.length; r < a; r += 2)
      s[r] = e + t[r], s[r + 1] = n + t[r + 1];
    return s;
  }
  static svgRound(t) {
    return Math.round(t * 1e4);
  }
  static _normalizePoint(t, e, n, s, r) {
    switch (r) {
      case 90:
        return [1 - e / n, t / s];
      case 180:
        return [1 - t / n, 1 - e / s];
      case 270:
        return [e / n, 1 - t / s];
      default:
        return [t / n, e / s];
    }
  }
  static _normalizePagePoint(t, e, n) {
    switch (n) {
      case 90:
        return [1 - e, t];
      case 180:
        return [1 - t, 1 - e];
      case 270:
        return [e, 1 - t];
      default:
        return [t, e];
    }
  }
  static createBezierPoints(t, e, n, s, r, a) {
    return [(t + 5 * n) / 6, (e + 5 * s) / 6, (5 * n + r) / 6, (5 * s + a) / 6, (n + r) / 2, (s + a) / 2];
  }
}
ft(Ht, "PRECISION", 1e-4);
var Ws, fa, yd, wd, io, Ae, Hh, jh, Im, Mm, vd, _d, Oc, Rm, n4, s4, sn, c2, SC, CC, EC, DC, TC, FC;
const Xo = class Xo {
  constructor({
    x: t,
    y: e
  }, n, s, r, a, o = 0) {
    F(this, sn);
    F(this, Ws);
    F(this, fa, []);
    F(this, yd);
    F(this, wd);
    F(this, io, []);
    F(this, Ae, new Float32Array(18));
    F(this, Hh);
    F(this, jh);
    F(this, Im);
    F(this, Mm);
    F(this, vd);
    F(this, _d);
    F(this, Oc, []);
    E(this, Ws, n), E(this, _d, r * s), E(this, wd, a), m(this, Ae).set([NaN, NaN, NaN, NaN, t, e], 6), E(this, yd, o), E(this, Mm, m(Xo, Rm) * s), E(this, Im, m(Xo, s4) * s), E(this, vd, s), m(this, Oc).push(t, e);
  }
  isEmpty() {
    return isNaN(m(this, Ae)[8]);
  }
  add({
    x: t,
    y: e
  }) {
    var I;
    E(this, Hh, t), E(this, jh, e);
    const [n, s, r, a] = m(this, Ws);
    let [o, l, c, h] = m(this, Ae).subarray(8, 12);
    const u = t - c, f = e - h, d = Math.hypot(u, f);
    if (d < m(this, Im))
      return !1;
    const p = d - m(this, Mm), g = p / d, b = g * u, y = g * f;
    let v = o, w = l;
    o = c, l = h, c += b, h += y, (I = m(this, Oc)) == null || I.push(t, e);
    const _ = -y / p, x = b / p, k = _ * m(this, _d), S = x * m(this, _d);
    return m(this, Ae).set(m(this, Ae).subarray(2, 8), 0), m(this, Ae).set([c + k, h + S], 4), m(this, Ae).set(m(this, Ae).subarray(14, 18), 12), m(this, Ae).set([c - k, h - S], 16), isNaN(m(this, Ae)[6]) ? (m(this, io).length === 0 && (m(this, Ae).set([o + k, l + S], 2), m(this, io).push(NaN, NaN, NaN, NaN, (o + k - n) / r, (l + S - s) / a), m(this, Ae).set([o - k, l - S], 14), m(this, fa).push(NaN, NaN, NaN, NaN, (o - k - n) / r, (l - S - s) / a)), m(this, Ae).set([v, w, o, l, c, h], 6), !this.isEmpty()) : (m(this, Ae).set([v, w, o, l, c, h], 6), Math.abs(Math.atan2(w - l, v - o) - Math.atan2(y, b)) < Math.PI / 2 ? ([o, l, c, h] = m(this, Ae).subarray(2, 6), m(this, io).push(NaN, NaN, NaN, NaN, ((o + c) / 2 - n) / r, ((l + h) / 2 - s) / a), [o, l, v, w] = m(this, Ae).subarray(14, 18), m(this, fa).push(NaN, NaN, NaN, NaN, ((v + o) / 2 - n) / r, ((w + l) / 2 - s) / a), !0) : ([v, w, o, l, c, h] = m(this, Ae).subarray(0, 6), m(this, io).push(((v + 5 * o) / 6 - n) / r, ((w + 5 * l) / 6 - s) / a, ((5 * o + c) / 6 - n) / r, ((5 * l + h) / 6 - s) / a, ((o + c) / 2 - n) / r, ((l + h) / 2 - s) / a), [c, h, o, l, v, w] = m(this, Ae).subarray(12, 18), m(this, fa).push(((v + 5 * o) / 6 - n) / r, ((w + 5 * l) / 6 - s) / a, ((5 * o + c) / 6 - n) / r, ((5 * l + h) / 6 - s) / a, ((o + c) / 2 - n) / r, ((l + h) / 2 - s) / a), !0));
  }
  toSVGPath() {
    if (this.isEmpty())
      return "";
    const t = m(this, io), e = m(this, fa);
    if (isNaN(m(this, Ae)[6]) && !this.isEmpty())
      return D(this, sn, SC).call(this);
    const n = [];
    n.push(`M${t[4]} ${t[5]}`);
    for (let s = 6; s < t.length; s += 6)
      isNaN(t[s]) ? n.push(`L${t[s + 4]} ${t[s + 5]}`) : n.push(`C${t[s]} ${t[s + 1]} ${t[s + 2]} ${t[s + 3]} ${t[s + 4]} ${t[s + 5]}`);
    D(this, sn, EC).call(this, n);
    for (let s = e.length - 6; s >= 6; s -= 6)
      isNaN(e[s]) ? n.push(`L${e[s + 4]} ${e[s + 5]}`) : n.push(`C${e[s]} ${e[s + 1]} ${e[s + 2]} ${e[s + 3]} ${e[s + 4]} ${e[s + 5]}`);
    return D(this, sn, CC).call(this, n), n.join(" ");
  }
  newFreeDrawOutline(t, e, n, s, r, a) {
    return new IC(t, e, n, s, r, a);
  }
  getOutlines() {
    var u;
    const t = m(this, io), e = m(this, fa), n = m(this, Ae), [s, r, a, o] = m(this, Ws), l = new Float32Array((((u = m(this, Oc)) == null ? void 0 : u.length) ?? 0) + 2);
    for (let f = 0, d = l.length - 2; f < d; f += 2)
      l[f] = (m(this, Oc)[f] - s) / a, l[f + 1] = (m(this, Oc)[f + 1] - r) / o;
    if (l[l.length - 2] = (m(this, Hh) - s) / a, l[l.length - 1] = (m(this, jh) - r) / o, isNaN(n[6]) && !this.isEmpty())
      return D(this, sn, DC).call(this, l);
    const c = new Float32Array(m(this, io).length + 24 + m(this, fa).length);
    let h = t.length;
    for (let f = 0; f < h; f += 2) {
      if (isNaN(t[f])) {
        c[f] = c[f + 1] = NaN;
        continue;
      }
      c[f] = t[f], c[f + 1] = t[f + 1];
    }
    h = D(this, sn, FC).call(this, c, h);
    for (let f = e.length - 6; f >= 6; f -= 6)
      for (let d = 0; d < 6; d += 2) {
        if (isNaN(e[f + d])) {
          c[h] = c[h + 1] = NaN, h += 2;
          continue;
        }
        c[h] = e[f + d], c[h + 1] = e[f + d + 1], h += 2;
      }
    return D(this, sn, TC).call(this, c, h), this.newFreeDrawOutline(c, l, m(this, Ws), m(this, vd), m(this, yd), m(this, wd));
  }
};
Ws = new WeakMap(), fa = new WeakMap(), yd = new WeakMap(), wd = new WeakMap(), io = new WeakMap(), Ae = new WeakMap(), Hh = new WeakMap(), jh = new WeakMap(), Im = new WeakMap(), Mm = new WeakMap(), vd = new WeakMap(), _d = new WeakMap(), Oc = new WeakMap(), Rm = new WeakMap(), n4 = new WeakMap(), s4 = new WeakMap(), sn = new WeakSet(), c2 = function() {
  const t = m(this, Ae).subarray(4, 6), e = m(this, Ae).subarray(16, 18), [n, s, r, a] = m(this, Ws);
  return [(m(this, Hh) + (t[0] - e[0]) / 2 - n) / r, (m(this, jh) + (t[1] - e[1]) / 2 - s) / a, (m(this, Hh) + (e[0] - t[0]) / 2 - n) / r, (m(this, jh) + (e[1] - t[1]) / 2 - s) / a];
}, SC = function() {
  const [t, e, n, s] = m(this, Ws), [r, a, o, l] = D(this, sn, c2).call(this);
  return `M${(m(this, Ae)[2] - t) / n} ${(m(this, Ae)[3] - e) / s} L${(m(this, Ae)[4] - t) / n} ${(m(this, Ae)[5] - e) / s} L${r} ${a} L${o} ${l} L${(m(this, Ae)[16] - t) / n} ${(m(this, Ae)[17] - e) / s} L${(m(this, Ae)[14] - t) / n} ${(m(this, Ae)[15] - e) / s} Z`;
}, CC = function(t) {
  const e = m(this, fa);
  t.push(`L${e[4]} ${e[5]} Z`);
}, EC = function(t) {
  const [e, n, s, r] = m(this, Ws), a = m(this, Ae).subarray(4, 6), o = m(this, Ae).subarray(16, 18), [l, c, h, u] = D(this, sn, c2).call(this);
  t.push(`L${(a[0] - e) / s} ${(a[1] - n) / r} L${l} ${c} L${h} ${u} L${(o[0] - e) / s} ${(o[1] - n) / r}`);
}, DC = function(t) {
  const e = m(this, Ae), [n, s, r, a] = m(this, Ws), [o, l, c, h] = D(this, sn, c2).call(this), u = new Float32Array(36);
  return u.set([NaN, NaN, NaN, NaN, (e[2] - n) / r, (e[3] - s) / a, NaN, NaN, NaN, NaN, (e[4] - n) / r, (e[5] - s) / a, NaN, NaN, NaN, NaN, o, l, NaN, NaN, NaN, NaN, c, h, NaN, NaN, NaN, NaN, (e[16] - n) / r, (e[17] - s) / a, NaN, NaN, NaN, NaN, (e[14] - n) / r, (e[15] - s) / a], 0), this.newFreeDrawOutline(u, t, m(this, Ws), m(this, vd), m(this, yd), m(this, wd));
}, TC = function(t, e) {
  const n = m(this, fa);
  return t.set([NaN, NaN, NaN, NaN, n[4], n[5]], e), e += 6;
}, FC = function(t, e) {
  const n = m(this, Ae).subarray(4, 6), s = m(this, Ae).subarray(16, 18), [r, a, o, l] = m(this, Ws), [c, h, u, f] = D(this, sn, c2).call(this);
  return t.set([NaN, NaN, NaN, NaN, (n[0] - r) / o, (n[1] - a) / l, NaN, NaN, NaN, NaN, c, h, NaN, NaN, NaN, NaN, u, f, NaN, NaN, NaN, NaN, (s[0] - r) / o, (s[1] - a) / l], e), e += 24;
}, F(Xo, Rm, 8), F(Xo, n4, 2), F(Xo, s4, m(Xo, Rm) + m(Xo, n4));
let q9 = Xo;
var xd, Gh, vl, Bm, Xs, Pm, Ni, r4, MC;
class IC extends Ht {
  constructor(e, n, s, r, a, o) {
    super();
    F(this, r4);
    F(this, xd);
    F(this, Gh, new Float32Array(4));
    F(this, vl);
    F(this, Bm);
    F(this, Xs);
    F(this, Pm);
    F(this, Ni);
    E(this, Ni, e), E(this, Xs, n), E(this, xd, s), E(this, Pm, r), E(this, vl, a), E(this, Bm, o), this.lastPoint = [NaN, NaN], D(this, r4, MC).call(this, o);
    const [l, c, h, u] = m(this, Gh);
    for (let f = 0, d = e.length; f < d; f += 2)
      e[f] = (e[f] - l) / h, e[f + 1] = (e[f + 1] - c) / u;
    for (let f = 0, d = n.length; f < d; f += 2)
      n[f] = (n[f] - l) / h, n[f + 1] = (n[f + 1] - c) / u;
  }
  toSVGPath() {
    const e = [`M${m(this, Ni)[4]} ${m(this, Ni)[5]}`];
    for (let n = 6, s = m(this, Ni).length; n < s; n += 6) {
      if (isNaN(m(this, Ni)[n])) {
        e.push(`L${m(this, Ni)[n + 4]} ${m(this, Ni)[n + 5]}`);
        continue;
      }
      e.push(`C${m(this, Ni)[n]} ${m(this, Ni)[n + 1]} ${m(this, Ni)[n + 2]} ${m(this, Ni)[n + 3]} ${m(this, Ni)[n + 4]} ${m(this, Ni)[n + 5]}`);
    }
    return e.push("Z"), e.join(" ");
  }
  serialize([e, n, s, r], a) {
    const o = s - e, l = r - n;
    let c, h;
    switch (a) {
      case 0:
        c = Ht._rescale(m(this, Ni), e, r, o, -l), h = Ht._rescale(m(this, Xs), e, r, o, -l);
        break;
      case 90:
        c = Ht._rescaleAndSwap(m(this, Ni), e, n, o, l), h = Ht._rescaleAndSwap(m(this, Xs), e, n, o, l);
        break;
      case 180:
        c = Ht._rescale(m(this, Ni), s, n, -o, l), h = Ht._rescale(m(this, Xs), s, n, -o, l);
        break;
      case 270:
        c = Ht._rescaleAndSwap(m(this, Ni), s, r, -o, -l), h = Ht._rescaleAndSwap(m(this, Xs), s, r, -o, -l);
        break;
    }
    return {
      outline: Array.from(c),
      points: [Array.from(h)]
    };
  }
  get box() {
    return m(this, Gh);
  }
  newOutliner(e, n, s, r, a, o = 0) {
    return new q9(e, n, s, r, a, o);
  }
  getNewOutline(e, n) {
    const [s, r, a, o] = m(this, Gh), [l, c, h, u] = m(this, xd), f = a * h, d = o * u, p = s * h + l, g = r * u + c, b = this.newOutliner({
      x: m(this, Xs)[0] * f + p,
      y: m(this, Xs)[1] * d + g
    }, m(this, xd), m(this, Pm), e, m(this, Bm), n ?? m(this, vl));
    for (let y = 2; y < m(this, Xs).length; y += 2)
      b.add({
        x: m(this, Xs)[y] * f + p,
        y: m(this, Xs)[y + 1] * d + g
      });
    return b.getOutlines();
  }
}
xd = new WeakMap(), Gh = new WeakMap(), vl = new WeakMap(), Bm = new WeakMap(), Xs = new WeakMap(), Pm = new WeakMap(), Ni = new WeakMap(), r4 = new WeakSet(), MC = function(e) {
  const n = m(this, Ni);
  let s = n[4], r = n[5];
  const a = [s, r, s, r];
  let o = s, l = r;
  const c = e ? Math.max : Math.min;
  for (let u = 6, f = n.length; u < f; u += 6) {
    const d = n[u + 4], p = n[u + 5];
    if (isNaN(n[u]))
      Zt.pointBoundingBox(d, p, a), l < p ? (o = d, l = p) : l === p && (o = c(o, d));
    else {
      const g = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
      Zt.bezierBoundingBox(s, r, ...n.slice(u, u + 6), g), Zt.rectBoundingBox(...g, a), l < g[3] ? (o = g[2], l = g[3]) : l === g[3] && (o = c(o, g[2]));
    }
    s = d, r = p;
  }
  const h = m(this, Gh);
  h[0] = a[0] - m(this, vl), h[1] = a[1] - m(this, vl), h[2] = a[2] - a[0] + 2 * m(this, vl), h[3] = a[3] - a[1] + 2 * m(this, vl), this.lastPoint = [o, l];
};
var Nm, Lm, $c, pa, ds, RC, J5, BC, PC, f8;
class d8 {
  constructor(t, e = 0, n = 0, s = !0) {
    F(this, ds);
    F(this, Nm);
    F(this, Lm);
    F(this, $c, []);
    F(this, pa, []);
    const r = [1 / 0, 1 / 0, -1 / 0, -1 / 0], a = 10 ** -4;
    for (const {
      x: d,
      y: p,
      width: g,
      height: b
    } of t) {
      const y = Math.floor((d - e) / a) * a, v = Math.ceil((d + g + e) / a) * a, w = Math.floor((p - e) / a) * a, _ = Math.ceil((p + b + e) / a) * a, x = [y, w, _, !0], k = [v, w, _, !1];
      m(this, $c).push(x, k), Zt.rectBoundingBox(y, w, v, _, r);
    }
    const o = r[2] - r[0] + 2 * n, l = r[3] - r[1] + 2 * n, c = r[0] - n, h = r[1] - n, u = m(this, $c).at(s ? -1 : -2), f = [u[0], u[2]];
    for (const d of m(this, $c)) {
      const [p, g, b] = d;
      d[0] = (p - c) / o, d[1] = (g - h) / l, d[2] = (b - h) / l;
    }
    E(this, Nm, new Float32Array([c, h, o, l])), E(this, Lm, f);
  }
  getOutlines() {
    m(this, $c).sort((e, n) => e[0] - n[0] || e[1] - n[1] || e[2] - n[2]);
    const t = [];
    for (const e of m(this, $c))
      e[3] ? (t.push(...D(this, ds, f8).call(this, e)), D(this, ds, BC).call(this, e)) : (D(this, ds, PC).call(this, e), t.push(...D(this, ds, f8).call(this, e)));
    return D(this, ds, RC).call(this, t);
  }
}
Nm = new WeakMap(), Lm = new WeakMap(), $c = new WeakMap(), pa = new WeakMap(), ds = new WeakSet(), RC = function(t) {
  const e = [], n = /* @__PURE__ */ new Set();
  for (const a of t) {
    const [o, l, c] = a;
    e.push([o, l, a], [o, c, a]);
  }
  e.sort((a, o) => a[1] - o[1] || a[0] - o[0]);
  for (let a = 0, o = e.length; a < o; a += 2) {
    const l = e[a][2], c = e[a + 1][2];
    l.push(c), c.push(l), n.add(l), n.add(c);
  }
  const s = [];
  let r;
  for (; n.size > 0; ) {
    const a = n.values().next().value;
    let [o, l, c, h, u] = a;
    n.delete(a);
    let f = o, d = l;
    for (r = [o, c], s.push(r); ; ) {
      let p;
      if (n.has(h))
        p = h;
      else if (n.has(u))
        p = u;
      else
        break;
      n.delete(p), [o, l, c, h, u] = p, f !== o && (r.push(f, d, o, d === l ? l : c), f = o), d = d === l ? c : l;
    }
    r.push(f, d);
  }
  return new vR(s, m(this, Nm), m(this, Lm));
}, J5 = function(t) {
  const e = m(this, pa);
  let n = 0, s = e.length - 1;
  for (; n <= s; ) {
    const r = n + s >> 1, a = e[r][0];
    if (a === t)
      return r;
    a < t ? n = r + 1 : s = r - 1;
  }
  return s + 1;
}, BC = function([, t, e]) {
  const n = D(this, ds, J5).call(this, t);
  m(this, pa).splice(n, 0, [t, e]);
}, PC = function([, t, e]) {
  const n = D(this, ds, J5).call(this, t);
  for (let s = n; s < m(this, pa).length; s++) {
    const [r, a] = m(this, pa)[s];
    if (r !== t)
      break;
    if (r === t && a === e) {
      m(this, pa).splice(s, 1);
      return;
    }
  }
  for (let s = n - 1; s >= 0; s--) {
    const [r, a] = m(this, pa)[s];
    if (r !== t)
      break;
    if (r === t && a === e) {
      m(this, pa).splice(s, 1);
      return;
    }
  }
}, f8 = function(t) {
  const [e, n, s] = t, r = [[e, n, s]], a = D(this, ds, J5).call(this, s);
  for (let o = 0; o < a; o++) {
    const [l, c] = m(this, pa)[o];
    for (let h = 0, u = r.length; h < u; h++) {
      const [, f, d] = r[h];
      if (!(c <= f || d <= l)) {
        if (f >= l) {
          if (d > c)
            r[h][1] = c;
          else {
            if (u === 1)
              return [];
            r.splice(h, 1), h--, u--;
          }
          continue;
        }
        r[h][2] = l, d > c && r.push([e, c, d]);
      }
    }
  }
  return r;
};
var Om, kd;
class vR extends Ht {
  constructor(e, n, s) {
    super();
    F(this, Om);
    F(this, kd);
    E(this, kd, e), E(this, Om, n), this.lastPoint = s;
  }
  toSVGPath() {
    const e = [];
    for (const n of m(this, kd)) {
      let [s, r] = n;
      e.push(`M${s} ${r}`);
      for (let a = 2; a < n.length; a += 2) {
        const o = n[a], l = n[a + 1];
        o === s ? (e.push(`V${l}`), r = l) : l === r && (e.push(`H${o}`), s = o);
      }
      e.push("Z");
    }
    return e.join(" ");
  }
  serialize([e, n, s, r], a) {
    const o = [], l = s - e, c = r - n;
    for (const h of m(this, kd)) {
      const u = new Array(h.length);
      for (let f = 0; f < h.length; f += 2)
        u[f] = e + h[f] * l, u[f + 1] = r - h[f + 1] * c;
      o.push(u);
    }
    return o;
  }
  get box() {
    return m(this, Om);
  }
  get classNamesForOutlining() {
    return ["highlightOutline"];
  }
}
Om = new WeakMap(), kd = new WeakMap();
class p8 extends q9 {
  newFreeDrawOutline(t, e, n, s, r, a) {
    return new _R(t, e, n, s, r, a);
  }
}
class _R extends IC {
  newOutliner(t, e, n, s, r, a = 0) {
    return new p8(t, e, n, s, r, a);
  }
}
var ma, Vh, Ad, en, $m, Sd, qm, zm, qc, ga, Cd, Um, Ye, m8, g8, b8, P0, NC, rc;
const ks = class ks {
  constructor({
    editor: t = null,
    uiManager: e = null
  }) {
    F(this, Ye);
    F(this, ma, null);
    F(this, Vh, null);
    F(this, Ad);
    F(this, en, null);
    F(this, $m, !1);
    F(this, Sd, !1);
    F(this, qm, null);
    F(this, zm);
    F(this, qc, null);
    F(this, ga, null);
    F(this, Cd);
    var n;
    t ? (E(this, Sd, !1), E(this, Cd, Ie.HIGHLIGHT_COLOR), E(this, qm, t)) : (E(this, Sd, !0), E(this, Cd, Ie.HIGHLIGHT_DEFAULT_COLOR)), E(this, ga, (t == null ? void 0 : t._uiManager) || e), E(this, zm, m(this, ga)._eventBus), E(this, Ad, (t == null ? void 0 : t.color) || ((n = m(this, ga)) == null ? void 0 : n.highlightColors.values().next().value) || "#FFFF98"), m(ks, Um) || E(ks, Um, Object.freeze({
      blue: "pdfjs-editor-colorpicker-blue",
      green: "pdfjs-editor-colorpicker-green",
      pink: "pdfjs-editor-colorpicker-pink",
      red: "pdfjs-editor-colorpicker-red",
      yellow: "pdfjs-editor-colorpicker-yellow"
    }));
  }
  static get _keyboardManager() {
    return Fe(this, "_keyboardManager", new yg([[["Escape", "mac+Escape"], ks.prototype._hideDropdownFromKeyboard], [[" ", "mac+ "], ks.prototype._colorSelectFromKeyboard], [["ArrowDown", "ArrowRight", "mac+ArrowDown", "mac+ArrowRight"], ks.prototype._moveToNext], [["ArrowUp", "ArrowLeft", "mac+ArrowUp", "mac+ArrowLeft"], ks.prototype._moveToPrevious], [["Home", "mac+Home"], ks.prototype._moveToBeginning], [["End", "mac+End"], ks.prototype._moveToEnd]]));
  }
  renderButton() {
    const t = E(this, ma, document.createElement("button"));
    t.className = "colorPicker", t.tabIndex = "0", t.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-button"), t.setAttribute("aria-haspopup", !0);
    const e = m(this, ga)._signal;
    t.addEventListener("click", D(this, Ye, P0).bind(this), {
      signal: e
    }), t.addEventListener("keydown", D(this, Ye, b8).bind(this), {
      signal: e
    });
    const n = E(this, Vh, document.createElement("span"));
    return n.className = "swatch", n.setAttribute("aria-hidden", !0), n.style.backgroundColor = m(this, Ad), t.append(n), t;
  }
  renderMainDropdown() {
    const t = E(this, en, D(this, Ye, m8).call(this));
    return t.setAttribute("aria-orientation", "horizontal"), t.setAttribute("aria-labelledby", "highlightColorPickerLabel"), t;
  }
  _colorSelectFromKeyboard(t) {
    if (t.target === m(this, ma)) {
      D(this, Ye, P0).call(this, t);
      return;
    }
    const e = t.target.getAttribute("data-color");
    e && D(this, Ye, g8).call(this, e, t);
  }
  _moveToNext(t) {
    var e, n;
    if (!m(this, Ye, rc)) {
      D(this, Ye, P0).call(this, t);
      return;
    }
    if (t.target === m(this, ma)) {
      (e = m(this, en).firstChild) == null || e.focus();
      return;
    }
    (n = t.target.nextSibling) == null || n.focus();
  }
  _moveToPrevious(t) {
    var e, n;
    if (t.target === ((e = m(this, en)) == null ? void 0 : e.firstChild) || t.target === m(this, ma)) {
      m(this, Ye, rc) && this._hideDropdownFromKeyboard();
      return;
    }
    m(this, Ye, rc) || D(this, Ye, P0).call(this, t), (n = t.target.previousSibling) == null || n.focus();
  }
  _moveToBeginning(t) {
    var e;
    if (!m(this, Ye, rc)) {
      D(this, Ye, P0).call(this, t);
      return;
    }
    (e = m(this, en).firstChild) == null || e.focus();
  }
  _moveToEnd(t) {
    var e;
    if (!m(this, Ye, rc)) {
      D(this, Ye, P0).call(this, t);
      return;
    }
    (e = m(this, en).lastChild) == null || e.focus();
  }
  hideDropdown() {
    var t, e;
    (t = m(this, en)) == null || t.classList.add("hidden"), (e = m(this, qc)) == null || e.abort(), E(this, qc, null);
  }
  _hideDropdownFromKeyboard() {
    var t;
    if (!m(this, Sd)) {
      if (!m(this, Ye, rc)) {
        (t = m(this, qm)) == null || t.unselect();
        return;
      }
      this.hideDropdown(), m(this, ma).focus({
        preventScroll: !0,
        focusVisible: m(this, $m)
      });
    }
  }
  updateColor(t) {
    if (m(this, Vh) && (m(this, Vh).style.backgroundColor = t), !m(this, en))
      return;
    const e = m(this, ga).highlightColors.values();
    for (const n of m(this, en).children)
      n.setAttribute("aria-selected", e.next().value === t);
  }
  destroy() {
    var t, e;
    (t = m(this, ma)) == null || t.remove(), E(this, ma, null), E(this, Vh, null), (e = m(this, en)) == null || e.remove(), E(this, en, null);
  }
};
ma = new WeakMap(), Vh = new WeakMap(), Ad = new WeakMap(), en = new WeakMap(), $m = new WeakMap(), Sd = new WeakMap(), qm = new WeakMap(), zm = new WeakMap(), qc = new WeakMap(), ga = new WeakMap(), Cd = new WeakMap(), Um = new WeakMap(), Ye = new WeakSet(), m8 = function() {
  const t = document.createElement("div"), e = m(this, ga)._signal;
  t.addEventListener("contextmenu", Gr, {
    signal: e
  }), t.className = "dropdown", t.role = "listbox", t.setAttribute("aria-multiselectable", !1), t.setAttribute("aria-orientation", "vertical"), t.setAttribute("data-l10n-id", "pdfjs-editor-colorpicker-dropdown");
  for (const [n, s] of m(this, ga).highlightColors) {
    const r = document.createElement("button");
    r.tabIndex = "0", r.role = "option", r.setAttribute("data-color", s), r.title = n, r.setAttribute("data-l10n-id", m(ks, Um)[n]);
    const a = document.createElement("span");
    r.append(a), a.className = "swatch", a.style.backgroundColor = s, r.setAttribute("aria-selected", s === m(this, Ad)), r.addEventListener("click", D(this, Ye, g8).bind(this, s), {
      signal: e
    }), t.append(r);
  }
  return t.addEventListener("keydown", D(this, Ye, b8).bind(this), {
    signal: e
  }), t;
}, g8 = function(t, e) {
  e.stopPropagation(), m(this, zm).dispatch("switchannotationeditorparams", {
    source: this,
    type: m(this, Cd),
    value: t
  });
}, b8 = function(t) {
  ks._keyboardManager.exec(this, t);
}, P0 = function(t) {
  if (m(this, Ye, rc)) {
    this.hideDropdown();
    return;
  }
  if (E(this, $m, t.detail === 0), m(this, qc) || (E(this, qc, new AbortController()), window.addEventListener("pointerdown", D(this, Ye, NC).bind(this), {
    signal: m(this, ga).combinedSignal(m(this, qc))
  })), m(this, en)) {
    m(this, en).classList.remove("hidden");
    return;
  }
  const e = E(this, en, D(this, Ye, m8).call(this));
  m(this, ma).append(e);
}, NC = function(t) {
  var e;
  (e = m(this, en)) != null && e.contains(t.target) || this.hideDropdown();
}, rc = function() {
  return m(this, en) && !m(this, en).classList.contains("hidden");
}, F(ks, Um, null);
let tp = ks;
var Ed, Hm, _l, Wh, Dd, Cs, jm, Gm, Xh, xr, Ys, vn, Td, xl, Hn, Fd, kr, Vm, we, y8, Q5, LC, OC, $C, w8, N0, $r, iu, qC, t9, h2, zC, UC, HC, jC, GC;
const He = class He extends si {
  constructor(e) {
    super({
      ...e,
      name: "highlightEditor"
    });
    F(this, we);
    F(this, Ed, null);
    F(this, Hm, 0);
    F(this, _l);
    F(this, Wh, null);
    F(this, Dd, null);
    F(this, Cs, null);
    F(this, jm, null);
    F(this, Gm, 0);
    F(this, Xh, null);
    F(this, xr, null);
    F(this, Ys, null);
    F(this, vn, !1);
    F(this, Td, null);
    F(this, xl);
    F(this, Hn, null);
    F(this, Fd, "");
    F(this, kr);
    F(this, Vm, "");
    this.color = e.color || He._defaultColor, E(this, kr, e.thickness || He._defaultThickness), E(this, xl, e.opacity || He._defaultOpacity), E(this, _l, e.boxes || null), E(this, Vm, e.methodOfCreation || ""), E(this, Fd, e.text || ""), this._isDraggable = !1, this.defaultL10nId = "pdfjs-editor-highlight-editor", e.highlightId > -1 ? (E(this, vn, !0), D(this, we, Q5).call(this, e), D(this, we, N0).call(this)) : m(this, _l) && (E(this, Ed, e.anchorNode), E(this, Hm, e.anchorOffset), E(this, jm, e.focusNode), E(this, Gm, e.focusOffset), D(this, we, y8).call(this), D(this, we, N0).call(this), this.rotate(this.rotation));
  }
  static get _keyboardManager() {
    const e = He.prototype;
    return Fe(this, "_keyboardManager", new yg([[["ArrowLeft", "mac+ArrowLeft"], e._moveCaret, {
      args: [0]
    }], [["ArrowRight", "mac+ArrowRight"], e._moveCaret, {
      args: [1]
    }], [["ArrowUp", "mac+ArrowUp"], e._moveCaret, {
      args: [2]
    }], [["ArrowDown", "mac+ArrowDown"], e._moveCaret, {
      args: [3]
    }]]));
  }
  get telemetryInitialData() {
    return {
      action: "added",
      type: m(this, vn) ? "free_highlight" : "highlight",
      color: this._uiManager.highlightColorNames.get(this.color),
      thickness: m(this, kr),
      methodOfCreation: m(this, Vm)
    };
  }
  get telemetryFinalData() {
    return {
      type: "highlight",
      color: this._uiManager.highlightColorNames.get(this.color)
    };
  }
  static computeTelemetryFinalData(e) {
    return {
      numberOfColors: e.get("color").size
    };
  }
  static initialize(e, n) {
    var s;
    si.initialize(e, n), He._defaultColor || (He._defaultColor = ((s = n.highlightColors) == null ? void 0 : s.values().next().value) || "#fff066");
  }
  static updateDefaultParams(e, n) {
    switch (e) {
      case Ie.HIGHLIGHT_DEFAULT_COLOR:
        He._defaultColor = n;
        break;
      case Ie.HIGHLIGHT_THICKNESS:
        He._defaultThickness = n;
        break;
    }
  }
  translateInPage(e, n) {
  }
  get toolbarPosition() {
    return m(this, Td);
  }
  updateParams(e, n) {
    switch (e) {
      case Ie.HIGHLIGHT_COLOR:
        D(this, we, LC).call(this, n);
        break;
      case Ie.HIGHLIGHT_THICKNESS:
        D(this, we, OC).call(this, n);
        break;
    }
  }
  static get defaultPropertiesToUpdate() {
    return [[Ie.HIGHLIGHT_DEFAULT_COLOR, He._defaultColor], [Ie.HIGHLIGHT_THICKNESS, He._defaultThickness]];
  }
  get propertiesToUpdate() {
    return [[Ie.HIGHLIGHT_COLOR, this.color || He._defaultColor], [Ie.HIGHLIGHT_THICKNESS, m(this, kr) || He._defaultThickness], [Ie.HIGHLIGHT_FREE, m(this, vn)]];
  }
  async addEditToolbar() {
    const e = await super.addEditToolbar();
    return e ? (this._uiManager.highlightColors && (E(this, Dd, new tp({
      editor: this
    })), e.addColorPicker(m(this, Dd))), e) : null;
  }
  disableEditing() {
    super.disableEditing(), this.div.classList.toggle("disabled", !0);
  }
  enableEditing() {
    super.enableEditing(), this.div.classList.toggle("disabled", !1);
  }
  fixAndSetPosition() {
    return super.fixAndSetPosition(D(this, we, h2).call(this));
  }
  getBaseTranslation() {
    return [0, 0];
  }
  getRect(e, n) {
    return super.getRect(e, n, D(this, we, h2).call(this));
  }
  onceAdded(e) {
    this.annotationElementId || this.parent.addUndoableEditor(this), e && this.div.focus();
  }
  remove() {
    D(this, we, w8).call(this), this._reportTelemetry({
      action: "deleted"
    }), super.remove();
  }
  rebuild() {
    this.parent && (super.rebuild(), this.div !== null && (D(this, we, N0).call(this), this.isAttachedToDOM || this.parent.add(this)));
  }
  setParent(e) {
    var s;
    let n = !1;
    this.parent && !e ? D(this, we, w8).call(this) : e && (D(this, we, N0).call(this, e), n = !this.parent && ((s = this.div) == null ? void 0 : s.classList.contains("selectedEditor"))), super.setParent(e), this.show(this._isVisible), n && this.select();
  }
  rotate(e) {
    var r, a, o;
    const {
      drawLayer: n
    } = this.parent;
    let s;
    m(this, vn) ? (e = (e - this.rotation + 360) % 360, s = D(r = He, $r, iu).call(r, m(this, xr).box, e)) : s = D(a = He, $r, iu).call(a, [this.x, this.y, this.width, this.height], e), n.updateProperties(m(this, Ys), {
      bbox: s,
      root: {
        "data-main-rotation": e
      }
    }), n.updateProperties(m(this, Hn), {
      bbox: D(o = He, $r, iu).call(o, m(this, Cs).box, e),
      root: {
        "data-main-rotation": e
      }
    });
  }
  render() {
    if (this.div)
      return this.div;
    const e = super.render();
    m(this, Fd) && (e.setAttribute("aria-label", m(this, Fd)), e.setAttribute("role", "mark")), m(this, vn) ? e.classList.add("free") : this.div.addEventListener("keydown", D(this, we, qC).bind(this), {
      signal: this._uiManager._signal
    });
    const n = E(this, Xh, document.createElement("div"));
    e.append(n), n.setAttribute("aria-hidden", "true"), n.className = "internal", n.style.clipPath = m(this, Wh);
    const [s, r] = this.parentDimensions;
    return this.setDims(this.width * s, this.height * r), hS(this, m(this, Xh), ["pointerover", "pointerleave"]), this.enableEditing(), e;
  }
  pointerover() {
    var e;
    this.isSelected || (e = this.parent) == null || e.drawLayer.updateProperties(m(this, Hn), {
      rootClass: {
        hovered: !0
      }
    });
  }
  pointerleave() {
    var e;
    this.isSelected || (e = this.parent) == null || e.drawLayer.updateProperties(m(this, Hn), {
      rootClass: {
        hovered: !1
      }
    });
  }
  _moveCaret(e) {
    switch (this.parent.unselect(this), e) {
      case 0:
      case 2:
        D(this, we, t9).call(this, !0);
        break;
      case 1:
      case 3:
        D(this, we, t9).call(this, !1);
        break;
    }
  }
  select() {
    var e;
    super.select(), m(this, Hn) && ((e = this.parent) == null || e.drawLayer.updateProperties(m(this, Hn), {
      rootClass: {
        hovered: !1,
        selected: !0
      }
    }));
  }
  unselect() {
    var e;
    super.unselect(), m(this, Hn) && ((e = this.parent) == null || e.drawLayer.updateProperties(m(this, Hn), {
      rootClass: {
        selected: !1
      }
    }), m(this, vn) || D(this, we, t9).call(this, !1));
  }
  get _mustFixPosition() {
    return !m(this, vn);
  }
  show(e = this._isVisible) {
    super.show(e), this.parent && (this.parent.drawLayer.updateProperties(m(this, Ys), {
      rootClass: {
        hidden: !e
      }
    }), this.parent.drawLayer.updateProperties(m(this, Hn), {
      rootClass: {
        hidden: !e
      }
    }));
  }
  static startHighlighting(e, n, {
    target: s,
    x: r,
    y: a
  }) {
    const {
      x: o,
      y: l,
      width: c,
      height: h
    } = s.getBoundingClientRect(), u = new AbortController(), f = e.combinedSignal(u), d = (p) => {
      u.abort(), D(this, $r, jC).call(this, e, p);
    };
    window.addEventListener("blur", d, {
      signal: f
    }), window.addEventListener("pointerup", d, {
      signal: f
    }), window.addEventListener("pointerdown", Oi, {
      capture: !0,
      passive: !1,
      signal: f
    }), window.addEventListener("contextmenu", Gr, {
      signal: f
    }), s.addEventListener("pointermove", D(this, $r, HC).bind(this, e), {
      signal: f
    }), this._freeHighlight = new p8({
      x: r,
      y: a
    }, [o, l, c, h], e.scale, this._defaultThickness / 2, n, 1e-3), {
      id: this._freeHighlightId,
      clipPathId: this._freeHighlightClipId
    } = e.drawLayer.draw({
      bbox: [0, 0, 1, 1],
      root: {
        viewBox: "0 0 1 1",
        fill: this._defaultColor,
        "fill-opacity": this._defaultOpacity
      },
      rootClass: {
        highlight: !0,
        free: !0
      },
      path: {
        d: this._freeHighlight.toSVGPath()
      }
    }, !0, !0);
  }
  static async deserialize(e, n, s) {
    var g, b, y, v;
    let r = null;
    if (e instanceof yC) {
      const {
        data: {
          quadPoints: w,
          rect: _,
          rotation: x,
          id: k,
          color: S,
          opacity: T,
          popupRef: I
        },
        parent: {
          page: {
            pageNumber: R
          }
        }
      } = e;
      r = e = {
        annotationType: fe.HIGHLIGHT,
        color: Array.from(S),
        opacity: T,
        quadPoints: w,
        boxes: null,
        pageIndex: R - 1,
        rect: _.slice(0),
        rotation: x,
        id: k,
        deleted: !1,
        popupRef: I
      };
    } else if (e instanceof By) {
      const {
        data: {
          inkLists: w,
          rect: _,
          rotation: x,
          id: k,
          color: S,
          borderStyle: {
            rawWidth: T
          },
          popupRef: I
        },
        parent: {
          page: {
            pageNumber: R
          }
        }
      } = e;
      r = e = {
        annotationType: fe.HIGHLIGHT,
        color: Array.from(S),
        thickness: T,
        inkLists: w,
        boxes: null,
        pageIndex: R - 1,
        rect: _.slice(0),
        rotation: x,
        id: k,
        deleted: !1,
        popupRef: I
      };
    }
    const {
      color: a,
      quadPoints: o,
      inkLists: l,
      opacity: c
    } = e, h = await super.deserialize(e, n, s);
    h.color = Zt.makeHexColor(...a), E(h, xl, c || 1), l && E(h, kr, e.thickness), h.annotationElementId = e.id || null, h._initialData = r;
    const [u, f] = h.pageDimensions, [d, p] = h.pageTranslation;
    if (o) {
      const w = E(h, _l, []);
      for (let _ = 0; _ < o.length; _ += 8)
        w.push({
          x: (o[_] - d) / u,
          y: 1 - (o[_ + 1] - p) / f,
          width: (o[_ + 2] - o[_]) / u,
          height: (o[_ + 1] - o[_ + 5]) / f
        });
      D(g = h, we, y8).call(g), D(b = h, we, N0).call(b), h.rotate(h.rotation);
    } else if (l) {
      E(h, vn, !0);
      const w = l[0], _ = {
        x: w[0] - d,
        y: f - (w[1] - p)
      }, x = new p8(_, [0, 0, u, f], 1, m(h, kr) / 2, !0, 1e-3);
      for (let T = 0, I = w.length; T < I; T += 2)
        _.x = w[T] - d, _.y = f - (w[T + 1] - p), x.add(_);
      const {
        id: k,
        clipPathId: S
      } = n.drawLayer.draw({
        bbox: [0, 0, 1, 1],
        root: {
          viewBox: "0 0 1 1",
          fill: h.color,
          "fill-opacity": h._defaultOpacity
        },
        rootClass: {
          highlight: !0,
          free: !0
        },
        path: {
          d: x.toSVGPath()
        }
      }, !0, !0);
      D(y = h, we, Q5).call(y, {
        highlightOutlines: x.getOutlines(),
        highlightId: k,
        clipPathId: S
      }), D(v = h, we, N0).call(v), h.rotate(h.parentRotation);
    }
    return h;
  }
  serialize(e = !1) {
    if (this.isEmpty() || e)
      return null;
    if (this.deleted)
      return this.serializeDeleted();
    const n = this.getRect(0, 0), s = si._colorManager.convert(this.color), r = {
      annotationType: fe.HIGHLIGHT,
      color: s,
      opacity: m(this, xl),
      thickness: m(this, kr),
      quadPoints: D(this, we, zC).call(this),
      outlines: D(this, we, UC).call(this, n),
      pageIndex: this.pageIndex,
      rect: n,
      rotation: D(this, we, h2).call(this),
      structTreeParentId: this._structTreeParentId
    };
    return this.annotationElementId && !D(this, we, GC).call(this, r) ? null : (r.id = this.annotationElementId, r);
  }
  renderAnnotationElement(e) {
    return e.updateEdited({
      rect: this.getRect(0, 0)
    }), null;
  }
  static canCreateNewEmptyEditor() {
    return !1;
  }
};
Ed = new WeakMap(), Hm = new WeakMap(), _l = new WeakMap(), Wh = new WeakMap(), Dd = new WeakMap(), Cs = new WeakMap(), jm = new WeakMap(), Gm = new WeakMap(), Xh = new WeakMap(), xr = new WeakMap(), Ys = new WeakMap(), vn = new WeakMap(), Td = new WeakMap(), xl = new WeakMap(), Hn = new WeakMap(), Fd = new WeakMap(), kr = new WeakMap(), Vm = new WeakMap(), we = new WeakSet(), y8 = function() {
  const e = new d8(m(this, _l), 1e-3);
  E(this, xr, e.getOutlines()), [this.x, this.y, this.width, this.height] = m(this, xr).box;
  const n = new d8(m(this, _l), 25e-4, 1e-3, this._uiManager.direction === "ltr");
  E(this, Cs, n.getOutlines());
  const {
    lastPoint: s
  } = m(this, Cs);
  E(this, Td, [(s[0] - this.x) / this.width, (s[1] - this.y) / this.height]);
}, Q5 = function({
  highlightOutlines: e,
  highlightId: n,
  clipPathId: s
}) {
  var u, f;
  if (E(this, xr, e), E(this, Cs, e.getNewOutline(m(this, kr) / 2 + 1.5, 25e-4)), n >= 0)
    E(this, Ys, n), E(this, Wh, s), this.parent.drawLayer.finalizeDraw(n, {
      bbox: e.box,
      path: {
        d: e.toSVGPath()
      }
    }), E(this, Hn, this.parent.drawLayer.drawOutline({
      rootClass: {
        highlightOutline: !0,
        free: !0
      },
      bbox: m(this, Cs).box,
      path: {
        d: m(this, Cs).toSVGPath()
      }
    }, !0));
  else if (this.parent) {
    const d = this.parent.viewport.rotation;
    this.parent.drawLayer.updateProperties(m(this, Ys), {
      bbox: D(u = He, $r, iu).call(u, m(this, xr).box, (d - this.rotation + 360) % 360),
      path: {
        d: e.toSVGPath()
      }
    }), this.parent.drawLayer.updateProperties(m(this, Hn), {
      bbox: D(f = He, $r, iu).call(f, m(this, Cs).box, d),
      path: {
        d: m(this, Cs).toSVGPath()
      }
    });
  }
  const [a, o, l, c] = e.box;
  switch (this.rotation) {
    case 0:
      this.x = a, this.y = o, this.width = l, this.height = c;
      break;
    case 90: {
      const [d, p] = this.parentDimensions;
      this.x = o, this.y = 1 - a, this.width = l * p / d, this.height = c * d / p;
      break;
    }
    case 180:
      this.x = 1 - a, this.y = 1 - o, this.width = l, this.height = c;
      break;
    case 270: {
      const [d, p] = this.parentDimensions;
      this.x = 1 - o, this.y = a, this.width = l * p / d, this.height = c * d / p;
      break;
    }
  }
  const {
    lastPoint: h
  } = m(this, Cs);
  E(this, Td, [(h[0] - a) / l, (h[1] - o) / c]);
}, LC = function(e) {
  const n = (a, o) => {
    var l, c;
    this.color = a, E(this, xl, o), (l = this.parent) == null || l.drawLayer.updateProperties(m(this, Ys), {
      root: {
        fill: a,
        "fill-opacity": o
      }
    }), (c = m(this, Dd)) == null || c.updateColor(a);
  }, s = this.color, r = m(this, xl);
  this.addCommands({
    cmd: n.bind(this, e, He._defaultOpacity),
    undo: n.bind(this, s, r),
    post: this._uiManager.updateUI.bind(this._uiManager, this),
    mustExec: !0,
    type: Ie.HIGHLIGHT_COLOR,
    overwriteIfSameType: !0,
    keepUndo: !0
  }), this._reportTelemetry({
    action: "color_changed",
    color: this._uiManager.highlightColorNames.get(e)
  }, !0);
}, OC = function(e) {
  const n = m(this, kr), s = (r) => {
    E(this, kr, r), D(this, we, $C).call(this, r);
  };
  this.addCommands({
    cmd: s.bind(this, e),
    undo: s.bind(this, n),
    post: this._uiManager.updateUI.bind(this._uiManager, this),
    mustExec: !0,
    type: Ie.INK_THICKNESS,
    overwriteIfSameType: !0,
    keepUndo: !0
  }), this._reportTelemetry({
    action: "thickness_changed",
    thickness: e
  }, !0);
}, $C = function(e) {
  if (!m(this, vn))
    return;
  D(this, we, Q5).call(this, {
    highlightOutlines: m(this, xr).getNewOutline(e / 2)
  }), this.fixAndSetPosition();
  const [n, s] = this.parentDimensions;
  this.setDims(this.width * n, this.height * s);
}, w8 = function() {
  m(this, Ys) === null || !this.parent || (this.parent.drawLayer.remove(m(this, Ys)), E(this, Ys, null), this.parent.drawLayer.remove(m(this, Hn)), E(this, Hn, null));
}, N0 = function(e = this.parent) {
  m(this, Ys) === null && ({
    id: Zn(this, Ys)._,
    clipPathId: Zn(this, Wh)._
  } = e.drawLayer.draw({
    bbox: m(this, xr).box,
    root: {
      viewBox: "0 0 1 1",
      fill: this.color,
      "fill-opacity": m(this, xl)
    },
    rootClass: {
      highlight: !0,
      free: m(this, vn)
    },
    path: {
      d: m(this, xr).toSVGPath()
    }
  }, !1, !0), E(this, Hn, e.drawLayer.drawOutline({
    rootClass: {
      highlightOutline: !0,
      free: m(this, vn)
    },
    bbox: m(this, Cs).box,
    path: {
      d: m(this, Cs).toSVGPath()
    }
  }, m(this, vn))), m(this, Xh) && (m(this, Xh).style.clipPath = m(this, Wh)));
}, $r = new WeakSet(), iu = function([e, n, s, r], a) {
  switch (a) {
    case 90:
      return [1 - n - r, e, r, s];
    case 180:
      return [1 - e - s, 1 - n - r, s, r];
    case 270:
      return [n, 1 - e - s, r, s];
  }
  return [e, n, s, r];
}, qC = function(e) {
  He._keyboardManager.exec(this, e);
}, t9 = function(e) {
  if (!m(this, Ed))
    return;
  const n = window.getSelection();
  e ? n.setPosition(m(this, Ed), m(this, Hm)) : n.setPosition(m(this, jm), m(this, Gm));
}, h2 = function() {
  return m(this, vn) ? this.rotation : 0;
}, zC = function() {
  if (m(this, vn))
    return null;
  const [e, n] = this.pageDimensions, [s, r] = this.pageTranslation, a = m(this, _l), o = new Float32Array(a.length * 8);
  let l = 0;
  for (const {
    x: c,
    y: h,
    width: u,
    height: f
  } of a) {
    const d = c * e + s, p = (1 - h) * n + r;
    o[l] = o[l + 4] = d, o[l + 1] = o[l + 3] = p, o[l + 2] = o[l + 6] = d + u * e, o[l + 5] = o[l + 7] = p - f * n, l += 8;
  }
  return o;
}, UC = function(e) {
  return m(this, xr).serialize(e, D(this, we, h2).call(this));
}, HC = function(e, n) {
  this._freeHighlight.add(n) && e.drawLayer.updateProperties(this._freeHighlightId, {
    path: {
      d: this._freeHighlight.toSVGPath()
    }
  });
}, jC = function(e, n) {
  this._freeHighlight.isEmpty() ? e.drawLayer.remove(this._freeHighlightId) : e.createAndAddNewEditor(n, !1, {
    highlightId: this._freeHighlightId,
    highlightOutlines: this._freeHighlight.getOutlines(),
    clipPathId: this._freeHighlightClipId,
    methodOfCreation: "main_toolbar"
  }), this._freeHighlightId = -1, this._freeHighlight = null, this._freeHighlightClipId = "";
}, GC = function(e) {
  const {
    color: n
  } = this._initialData;
  return e.color.some((s, r) => s !== n[r]);
}, F(He, $r), ft(He, "_defaultColor", null), ft(He, "_defaultOpacity", 1), ft(He, "_defaultThickness", 12), ft(He, "_type", "highlight"), ft(He, "_editorType", fe.HIGHLIGHT), ft(He, "_freeHighlightId", -1), ft(He, "_freeHighlight", null), ft(He, "_freeHighlightClipId", "");
let z9 = He;
var Yh;
class VC {
  constructor() {
    F(this, Yh, /* @__PURE__ */ Object.create(null));
  }
  updateProperty(t, e) {
    this[t] = e, this.updateSVGProperty(t, e);
  }
  updateProperties(t) {
    if (t)
      for (const [e, n] of Object.entries(t))
        e.startsWith("_") || this.updateProperty(e, n);
  }
  updateSVGProperty(t, e) {
    m(this, Yh)[t] = e;
  }
  toSVGProperties() {
    const t = m(this, Yh);
    return E(this, Yh, /* @__PURE__ */ Object.create(null)), {
      root: t
    };
  }
  reset() {
    E(this, Yh, /* @__PURE__ */ Object.create(null));
  }
  updateAll(t = this) {
    this.updateProperties(t);
  }
  clone() {
    Ze("Not implemented");
  }
}
Yh = new WeakMap();
var Ks, Id, cn, Kh, Zh, zc, Uc, Hc, Jh, Oe, v8, _8, x8, u2, WC, e9, d2, nu;
const jt = class jt extends si {
  constructor(e) {
    super(e);
    F(this, Oe);
    F(this, Ks, null);
    F(this, Id);
    ft(this, "_drawId", null);
    E(this, Id, e.mustBeCommitted || !1), this._addOutlines(e);
  }
  _addOutlines(e) {
    e.drawOutlines && (D(this, Oe, v8).call(this, e), D(this, Oe, u2).call(this));
  }
  static _mergeSVGProperties(e, n) {
    const s = new Set(Object.keys(e));
    for (const [r, a] of Object.entries(n))
      s.has(r) ? Object.assign(e[r], a) : e[r] = a;
    return e;
  }
  static getDefaultDrawingOptions(e) {
    Ze("Not implemented");
  }
  static get typesMap() {
    Ze("Not implemented");
  }
  static get isDrawer() {
    return !0;
  }
  static get supportMultipleDrawings() {
    return !1;
  }
  static updateDefaultParams(e, n) {
    const s = this.typesMap.get(e);
    s && this._defaultDrawingOptions.updateProperty(s, n), this._currentParent && (m(jt, cn).updateProperty(s, n), this._currentParent.drawLayer.updateProperties(this._currentDrawId, this._defaultDrawingOptions.toSVGProperties()));
  }
  updateParams(e, n) {
    const s = this.constructor.typesMap.get(e);
    s && this._updateProperty(e, s, n);
  }
  static get defaultPropertiesToUpdate() {
    const e = [], n = this._defaultDrawingOptions;
    for (const [s, r] of this.typesMap)
      e.push([s, n[r]]);
    return e;
  }
  get propertiesToUpdate() {
    const e = [], {
      _drawingOptions: n
    } = this;
    for (const [s, r] of this.constructor.typesMap)
      e.push([s, n[r]]);
    return e;
  }
  _updateProperty(e, n, s) {
    const r = this._drawingOptions, a = r[n], o = (l) => {
      var h;
      r.updateProperty(n, l);
      const c = m(this, Ks).updateProperty(n, l);
      c && D(this, Oe, d2).call(this, c), (h = this.parent) == null || h.drawLayer.updateProperties(this._drawId, r.toSVGProperties());
    };
    this.addCommands({
      cmd: o.bind(this, s),
      undo: o.bind(this, a),
      post: this._uiManager.updateUI.bind(this._uiManager, this),
      mustExec: !0,
      type: e,
      overwriteIfSameType: !0,
      keepUndo: !0
    });
  }
  _onResizing() {
    var e;
    (e = this.parent) == null || e.drawLayer.updateProperties(this._drawId, jt._mergeSVGProperties(m(this, Ks).getPathResizingSVGProperties(D(this, Oe, e9).call(this)), {
      bbox: D(this, Oe, nu).call(this)
    }));
  }
  _onResized() {
    var e;
    (e = this.parent) == null || e.drawLayer.updateProperties(this._drawId, jt._mergeSVGProperties(m(this, Ks).getPathResizedSVGProperties(D(this, Oe, e9).call(this)), {
      bbox: D(this, Oe, nu).call(this)
    }));
  }
  _onTranslating(e, n) {
    var s;
    (s = this.parent) == null || s.drawLayer.updateProperties(this._drawId, {
      bbox: D(this, Oe, nu).call(this)
    });
  }
  _onTranslated() {
    var e;
    (e = this.parent) == null || e.drawLayer.updateProperties(this._drawId, jt._mergeSVGProperties(m(this, Ks).getPathTranslatedSVGProperties(D(this, Oe, e9).call(this), this.parentDimensions), {
      bbox: D(this, Oe, nu).call(this)
    }));
  }
  _onStartDragging() {
    var e;
    (e = this.parent) == null || e.drawLayer.updateProperties(this._drawId, {
      rootClass: {
        moving: !0
      }
    });
  }
  _onStopDragging() {
    var e;
    (e = this.parent) == null || e.drawLayer.updateProperties(this._drawId, {
      rootClass: {
        moving: !1
      }
    });
  }
  commit() {
    super.commit(), this.disableEditMode(), this.disableEditing();
  }
  disableEditing() {
    super.disableEditing(), this.div.classList.toggle("disabled", !0);
  }
  enableEditing() {
    super.enableEditing(), this.div.classList.toggle("disabled", !1);
  }
  getBaseTranslation() {
    return [0, 0];
  }
  get isResizable() {
    return !0;
  }
  onceAdded(e) {
    this.annotationElementId || this.parent.addUndoableEditor(this), this._isDraggable = !0, m(this, Id) && (E(this, Id, !1), this.commit(), this.parent.setSelected(this), e && this.isOnScreen && this.div.focus());
  }
  remove() {
    D(this, Oe, x8).call(this), super.remove();
  }
  rebuild() {
    this.parent && (super.rebuild(), this.div !== null && (D(this, Oe, u2).call(this), D(this, Oe, d2).call(this, m(this, Ks).box), this.isAttachedToDOM || this.parent.add(this)));
  }
  setParent(e) {
    var s;
    let n = !1;
    this.parent && !e ? (this._uiManager.removeShouldRescale(this), D(this, Oe, x8).call(this)) : e && (this._uiManager.addShouldRescale(this), D(this, Oe, u2).call(this, e), n = !this.parent && ((s = this.div) == null ? void 0 : s.classList.contains("selectedEditor"))), super.setParent(e), n && this.select();
  }
  rotate() {
    this.parent && this.parent.drawLayer.updateProperties(this._drawId, jt._mergeSVGProperties({
      bbox: D(this, Oe, nu).call(this)
    }, m(this, Ks).updateRotation((this.parentRotation - this.rotation + 360) % 360)));
  }
  onScaleChanging() {
    this.parent && D(this, Oe, d2).call(this, m(this, Ks).updateParentDimensions(this.parentDimensions, this.parent.scale));
  }
  static onScaleChangingWhenDrawing() {
  }
  render() {
    if (this.div)
      return this.div;
    let e, n;
    this._isCopy && (e = this.x, n = this.y);
    const s = super.render();
    s.classList.add("draw");
    const r = document.createElement("div");
    s.append(r), r.setAttribute("aria-hidden", "true"), r.className = "internal";
    const [a, o] = this.parentDimensions;
    return this.setDims(this.width * a, this.height * o), this._uiManager.addShouldRescale(this), this.disableEditing(), this._isCopy && this._moveAfterPaste(e, n), s;
  }
  static createDrawerInstance(e, n, s, r, a) {
    Ze("Not implemented");
  }
  static startDrawing(e, n, s, r) {
    var b;
    const {
      target: a,
      offsetX: o,
      offsetY: l,
      pointerId: c,
      pointerType: h
    } = r;
    if (m(jt, Uc) && m(jt, Uc) !== h)
      return;
    const {
      viewport: {
        rotation: u
      }
    } = e, {
      width: f,
      height: d
    } = a.getBoundingClientRect(), p = E(jt, Kh, new AbortController()), g = e.combinedSignal(p);
    if (m(jt, zc) || E(jt, zc, c), m(jt, Uc) ?? E(jt, Uc, h), window.addEventListener("pointerup", (y) => {
      var v;
      m(jt, zc) === y.pointerId ? this._endDraw(y) : (v = m(jt, Hc)) == null || v.delete(y.pointerId);
    }, {
      signal: g
    }), window.addEventListener("pointercancel", (y) => {
      var v;
      m(jt, zc) === y.pointerId ? this._currentParent.endDrawingSession() : (v = m(jt, Hc)) == null || v.delete(y.pointerId);
    }, {
      signal: g
    }), window.addEventListener("pointerdown", (y) => {
      m(jt, Uc) === y.pointerType && ((m(jt, Hc) || E(jt, Hc, /* @__PURE__ */ new Set())).add(y.pointerId), m(jt, cn).isCancellable() && (m(jt, cn).removeLastElement(), m(jt, cn).isEmpty() ? this._currentParent.endDrawingSession(!0) : this._endDraw(null)));
    }, {
      capture: !0,
      passive: !1,
      signal: g
    }), window.addEventListener("contextmenu", Gr, {
      signal: g
    }), a.addEventListener("pointermove", this._drawMove.bind(this), {
      signal: g
    }), a.addEventListener("touchmove", (y) => {
      y.timeStamp === m(jt, Jh) && Oi(y);
    }, {
      signal: g
    }), e.toggleDrawing(), (b = n._editorUndoBar) == null || b.hide(), m(jt, cn)) {
      e.drawLayer.updateProperties(this._currentDrawId, m(jt, cn).startNew(o, l, f, d, u));
      return;
    }
    n.updateUIForDefaultProperties(this), E(jt, cn, this.createDrawerInstance(o, l, f, d, u)), E(jt, Zh, this.getDefaultDrawingOptions()), this._currentParent = e, {
      id: this._currentDrawId
    } = e.drawLayer.draw(this._mergeSVGProperties(m(jt, Zh).toSVGProperties(), m(jt, cn).defaultSVGProperties), !0, !1);
  }
  static _drawMove(e) {
    var a;
    if (E(jt, Jh, -1), !m(jt, cn))
      return;
    const {
      offsetX: n,
      offsetY: s,
      pointerId: r
    } = e;
    if (m(jt, zc) === r) {
      if (((a = m(jt, Hc)) == null ? void 0 : a.size) >= 1) {
        this._endDraw(e);
        return;
      }
      this._currentParent.drawLayer.updateProperties(this._currentDrawId, m(jt, cn).add(n, s)), E(jt, Jh, e.timeStamp), Oi(e);
    }
  }
  static _cleanup(e) {
    e && (this._currentDrawId = -1, this._currentParent = null, E(jt, cn, null), E(jt, Zh, null), E(jt, Uc, null), E(jt, Jh, NaN)), m(jt, Kh) && (m(jt, Kh).abort(), E(jt, Kh, null), E(jt, zc, NaN), E(jt, Hc, null));
  }
  static _endDraw(e) {
    const n = this._currentParent;
    if (n) {
      if (n.toggleDrawing(!0), this._cleanup(!1), (e == null ? void 0 : e.target) === n.div && n.drawLayer.updateProperties(this._currentDrawId, m(jt, cn).end(e.offsetX, e.offsetY)), this.supportMultipleDrawings) {
        const s = m(jt, cn), r = this._currentDrawId, a = s.getLastElement();
        n.addCommands({
          cmd: () => {
            n.drawLayer.updateProperties(r, s.setLastElement(a));
          },
          undo: () => {
            n.drawLayer.updateProperties(r, s.removeLastElement());
          },
          mustExec: !1,
          type: Ie.DRAW_STEP
        });
        return;
      }
      this.endDrawing(!1);
    }
  }
  static endDrawing(e) {
    const n = this._currentParent;
    if (!n)
      return null;
    if (n.toggleDrawing(!0), n.cleanUndoStack(Ie.DRAW_STEP), !m(jt, cn).isEmpty()) {
      const {
        pageDimensions: [s, r],
        scale: a
      } = n, o = n.createAndAddNewEditor({
        offsetX: 0,
        offsetY: 0
      }, !1, {
        drawId: this._currentDrawId,
        drawOutlines: m(jt, cn).getOutlines(s * a, r * a, a, this._INNER_MARGIN),
        drawingOptions: m(jt, Zh),
        mustBeCommitted: !e
      });
      return this._cleanup(!0), o;
    }
    return n.drawLayer.remove(this._currentDrawId), this._cleanup(!0), null;
  }
  createDrawingOptions(e) {
  }
  static deserializeDraw(e, n, s, r, a, o) {
    Ze("Not implemented");
  }
  static async deserialize(e, n, s) {
    var u, f;
    const {
      rawDims: {
        pageWidth: r,
        pageHeight: a,
        pageX: o,
        pageY: l
      }
    } = n.viewport, c = this.deserializeDraw(o, l, r, a, this._INNER_MARGIN, e), h = await super.deserialize(e, n, s);
    return h.createDrawingOptions(e), D(u = h, Oe, v8).call(u, {
      drawOutlines: c
    }), D(f = h, Oe, u2).call(f), h.onScaleChanging(), h.rotate(), h;
  }
  serializeDraw(e) {
    const [n, s] = this.pageTranslation, [r, a] = this.pageDimensions;
    return m(this, Ks).serialize([n, s, r, a], e);
  }
  renderAnnotationElement(e) {
    return e.updateEdited({
      rect: this.getRect(0, 0)
    }), null;
  }
  static canCreateNewEmptyEditor() {
    return !1;
  }
};
Ks = new WeakMap(), Id = new WeakMap(), cn = new WeakMap(), Kh = new WeakMap(), Zh = new WeakMap(), zc = new WeakMap(), Uc = new WeakMap(), Hc = new WeakMap(), Jh = new WeakMap(), Oe = new WeakSet(), v8 = function({
  drawOutlines: e,
  drawId: n,
  drawingOptions: s
}) {
  E(this, Ks, e), this._drawingOptions || (this._drawingOptions = s), n >= 0 ? (this._drawId = n, this.parent.drawLayer.finalizeDraw(n, e.defaultProperties)) : this._drawId = D(this, Oe, _8).call(this, e, this.parent), D(this, Oe, d2).call(this, e.box);
}, _8 = function(e, n) {
  const {
    id: s
  } = n.drawLayer.draw(jt._mergeSVGProperties(this._drawingOptions.toSVGProperties(), e.defaultSVGProperties), !1, !1);
  return s;
}, x8 = function() {
  this._drawId === null || !this.parent || (this.parent.drawLayer.remove(this._drawId), this._drawId = null, this._drawingOptions.reset());
}, u2 = function(e = this.parent) {
  if (!(this._drawId !== null && this.parent === e)) {
    if (this._drawId !== null) {
      this.parent.drawLayer.updateParent(this._drawId, e.drawLayer);
      return;
    }
    this._drawingOptions.updateAll(), this._drawId = D(this, Oe, _8).call(this, m(this, Ks), e);
  }
}, WC = function([e, n, s, r]) {
  const {
    parentDimensions: [a, o],
    rotation: l
  } = this;
  switch (l) {
    case 90:
      return [n, 1 - e, s * (o / a), r * (a / o)];
    case 180:
      return [1 - e, 1 - n, s, r];
    case 270:
      return [1 - n, e, s * (o / a), r * (a / o)];
    default:
      return [e, n, s, r];
  }
}, e9 = function() {
  const {
    x: e,
    y: n,
    width: s,
    height: r,
    parentDimensions: [a, o],
    rotation: l
  } = this;
  switch (l) {
    case 90:
      return [1 - n, e, s * (a / o), r * (o / a)];
    case 180:
      return [1 - e, 1 - n, s, r];
    case 270:
      return [n, 1 - e, s * (a / o), r * (o / a)];
    default:
      return [e, n, s, r];
  }
}, d2 = function(e) {
  if ([this.x, this.y, this.width, this.height] = D(this, Oe, WC).call(this, e), this.div) {
    this.fixAndSetPosition();
    const [n, s] = this.parentDimensions;
    this.setDims(this.width * n, this.height * s);
  }
  this._onResized();
}, nu = function() {
  const {
    x: e,
    y: n,
    width: s,
    height: r,
    rotation: a,
    parentRotation: o,
    parentDimensions: [l, c]
  } = this;
  switch ((a * 4 + o) / 90) {
    case 1:
      return [1 - n - r, e, r, s];
    case 2:
      return [1 - e - s, 1 - n - r, s, r];
    case 3:
      return [n, 1 - e - s, r, s];
    case 4:
      return [e, n - s * (l / c), r * (c / l), s * (l / c)];
    case 5:
      return [1 - n, e, s * (l / c), r * (c / l)];
    case 6:
      return [1 - e - r * (c / l), 1 - n, r * (c / l), s * (l / c)];
    case 7:
      return [n - s * (l / c), 1 - e - r * (c / l), s * (l / c), r * (c / l)];
    case 8:
      return [e - s, n - r, s, r];
    case 9:
      return [1 - n, e - s, r, s];
    case 10:
      return [1 - e, 1 - n, s, r];
    case 11:
      return [n - r, 1 - e, r, s];
    case 12:
      return [e - r * (c / l), n, r * (c / l), s * (l / c)];
    case 13:
      return [1 - n - s * (l / c), e - r * (c / l), s * (l / c), r * (c / l)];
    case 14:
      return [1 - e, 1 - n - s * (l / c), r * (c / l), s * (l / c)];
    case 15:
      return [n, 1 - e, s * (l / c), r * (c / l)];
    default:
      return [e, n, s, r];
  }
}, ft(jt, "_currentDrawId", -1), ft(jt, "_currentParent", null), F(jt, cn, null), F(jt, Kh, null), F(jt, Zh, null), F(jt, zc, NaN), F(jt, Uc, null), F(jt, Hc, null), F(jt, Jh, NaN), ft(jt, "_INNER_MARGIN", 3);
let U9 = jt;
var no, hn, un, Qh, Md, ss, _n, Ar, t1, e1, i1, Rd, i9;
class xR {
  constructor(t, e, n, s, r, a) {
    F(this, Rd);
    F(this, no, new Float64Array(6));
    F(this, hn);
    F(this, un);
    F(this, Qh);
    F(this, Md);
    F(this, ss);
    F(this, _n, "");
    F(this, Ar, 0);
    F(this, t1, new _g());
    F(this, e1);
    F(this, i1);
    E(this, e1, n), E(this, i1, s), E(this, Qh, r), E(this, Md, a), [t, e] = D(this, Rd, i9).call(this, t, e);
    const o = E(this, hn, [NaN, NaN, NaN, NaN, t, e]);
    E(this, ss, [t, e]), E(this, un, [{
      line: o,
      points: m(this, ss)
    }]), m(this, no).set(o, 0);
  }
  updateProperty(t, e) {
    t === "stroke-width" && E(this, Md, e);
  }
  isEmpty() {
    return !m(this, un) || m(this, un).length === 0;
  }
  isCancellable() {
    return m(this, ss).length <= 10;
  }
  add(t, e) {
    [t, e] = D(this, Rd, i9).call(this, t, e);
    const [n, s, r, a] = m(this, no).subarray(2, 6), o = t - r, l = e - a;
    return Math.hypot(m(this, e1) * o, m(this, i1) * l) <= 2 ? null : (m(this, ss).push(t, e), isNaN(n) ? (m(this, no).set([r, a, t, e], 2), m(this, hn).push(NaN, NaN, NaN, NaN, t, e), {
      path: {
        d: this.toSVGPath()
      }
    }) : (isNaN(m(this, no)[0]) && m(this, hn).splice(6, 6), m(this, no).set([n, s, r, a, t, e], 0), m(this, hn).push(...Ht.createBezierPoints(n, s, r, a, t, e)), {
      path: {
        d: this.toSVGPath()
      }
    }));
  }
  end(t, e) {
    const n = this.add(t, e);
    return n || (m(this, ss).length === 2 ? {
      path: {
        d: this.toSVGPath()
      }
    } : null);
  }
  startNew(t, e, n, s, r) {
    E(this, e1, n), E(this, i1, s), E(this, Qh, r), [t, e] = D(this, Rd, i9).call(this, t, e);
    const a = E(this, hn, [NaN, NaN, NaN, NaN, t, e]);
    E(this, ss, [t, e]);
    const o = m(this, un).at(-1);
    return o && (o.line = new Float32Array(o.line), o.points = new Float32Array(o.points)), m(this, un).push({
      line: a,
      points: m(this, ss)
    }), m(this, no).set(a, 0), E(this, Ar, 0), this.toSVGPath(), null;
  }
  getLastElement() {
    return m(this, un).at(-1);
  }
  setLastElement(t) {
    return m(this, un) ? (m(this, un).push(t), E(this, hn, t.line), E(this, ss, t.points), E(this, Ar, 0), {
      path: {
        d: this.toSVGPath()
      }
    }) : m(this, t1).setLastElement(t);
  }
  removeLastElement() {
    if (!m(this, un))
      return m(this, t1).removeLastElement();
    m(this, un).pop(), E(this, _n, "");
    for (let t = 0, e = m(this, un).length; t < e; t++) {
      const {
        line: n,
        points: s
      } = m(this, un)[t];
      E(this, hn, n), E(this, ss, s), E(this, Ar, 0), this.toSVGPath();
    }
    return {
      path: {
        d: m(this, _n)
      }
    };
  }
  toSVGPath() {
    const t = Ht.svgRound(m(this, hn)[4]), e = Ht.svgRound(m(this, hn)[5]);
    if (m(this, ss).length === 2)
      return E(this, _n, `${m(this, _n)} M ${t} ${e} Z`), m(this, _n);
    if (m(this, ss).length <= 6) {
      const s = m(this, _n).lastIndexOf("M");
      E(this, _n, `${m(this, _n).slice(0, s)} M ${t} ${e}`), E(this, Ar, 6);
    }
    if (m(this, ss).length === 4) {
      const s = Ht.svgRound(m(this, hn)[10]), r = Ht.svgRound(m(this, hn)[11]);
      return E(this, _n, `${m(this, _n)} L ${s} ${r}`), E(this, Ar, 12), m(this, _n);
    }
    const n = [];
    m(this, Ar) === 0 && (n.push(`M ${t} ${e}`), E(this, Ar, 6));
    for (let s = m(this, Ar), r = m(this, hn).length; s < r; s += 6) {
      const [a, o, l, c, h, u] = m(this, hn).slice(s, s + 6).map(Ht.svgRound);
      n.push(`C${a} ${o} ${l} ${c} ${h} ${u}`);
    }
    return E(this, _n, m(this, _n) + n.join(" ")), E(this, Ar, m(this, hn).length), m(this, _n);
  }
  getOutlines(t, e, n, s) {
    const r = m(this, un).at(-1);
    return r.line = new Float32Array(r.line), r.points = new Float32Array(r.points), m(this, t1).build(m(this, un), t, e, n, m(this, Qh), m(this, Md), s), E(this, no, null), E(this, hn, null), E(this, un, null), E(this, _n, null), m(this, t1);
  }
  get defaultSVGProperties() {
    return {
      root: {
        viewBox: "0 0 10000 10000"
      },
      rootClass: {
        draw: !0
      },
      bbox: [0, 0, 1, 1]
    };
  }
}
no = new WeakMap(), hn = new WeakMap(), un = new WeakMap(), Qh = new WeakMap(), Md = new WeakMap(), ss = new WeakMap(), _n = new WeakMap(), Ar = new WeakMap(), t1 = new WeakMap(), e1 = new WeakMap(), i1 = new WeakMap(), Rd = new WeakSet(), i9 = function(t, e) {
  return Ht._normalizePoint(t, e, m(this, e1), m(this, i1), m(this, Qh));
};
var rs, Wm, Xm, Zs, so, ro, Bd, Pd, n1, En, jo, XC, YC, KC;
class _g extends Ht {
  constructor() {
    super(...arguments);
    F(this, En);
    F(this, rs);
    F(this, Wm, 0);
    F(this, Xm);
    F(this, Zs);
    F(this, so);
    F(this, ro);
    F(this, Bd);
    F(this, Pd);
    F(this, n1);
  }
  build(e, n, s, r, a, o, l) {
    E(this, so, n), E(this, ro, s), E(this, Bd, r), E(this, Pd, a), E(this, n1, o), E(this, Xm, l ?? 0), E(this, Zs, e), D(this, En, YC).call(this);
  }
  get thickness() {
    return m(this, n1);
  }
  setLastElement(e) {
    return m(this, Zs).push(e), {
      path: {
        d: this.toSVGPath()
      }
    };
  }
  removeLastElement() {
    return m(this, Zs).pop(), {
      path: {
        d: this.toSVGPath()
      }
    };
  }
  toSVGPath() {
    const e = [];
    for (const {
      line: n
    } of m(this, Zs)) {
      if (e.push(`M${Ht.svgRound(n[4])} ${Ht.svgRound(n[5])}`), n.length === 6) {
        e.push("Z");
        continue;
      }
      if (n.length === 12 && isNaN(n[6])) {
        e.push(`L${Ht.svgRound(n[10])} ${Ht.svgRound(n[11])}`);
        continue;
      }
      for (let s = 6, r = n.length; s < r; s += 6) {
        const [a, o, l, c, h, u] = n.subarray(s, s + 6).map(Ht.svgRound);
        e.push(`C${a} ${o} ${l} ${c} ${h} ${u}`);
      }
    }
    return e.join("");
  }
  serialize([e, n, s, r], a) {
    const o = [], l = [], [c, h, u, f] = D(this, En, XC).call(this);
    let d, p, g, b, y, v, w, _, x;
    switch (m(this, Pd)) {
      case 0:
        x = Ht._rescale, d = e, p = n + r, g = s, b = -r, y = e + c * s, v = n + (1 - h - f) * r, w = e + (c + u) * s, _ = n + (1 - h) * r;
        break;
      case 90:
        x = Ht._rescaleAndSwap, d = e, p = n, g = s, b = r, y = e + h * s, v = n + c * r, w = e + (h + f) * s, _ = n + (c + u) * r;
        break;
      case 180:
        x = Ht._rescale, d = e + s, p = n, g = -s, b = r, y = e + (1 - c - u) * s, v = n + h * r, w = e + (1 - c) * s, _ = n + (h + f) * r;
        break;
      case 270:
        x = Ht._rescaleAndSwap, d = e + s, p = n + r, g = -s, b = -r, y = e + (1 - h - f) * s, v = n + (1 - c - u) * r, w = e + (1 - h) * s, _ = n + (1 - c) * r;
        break;
    }
    for (const {
      line: k,
      points: S
    } of m(this, Zs))
      o.push(x(k, d, p, g, b, a ? new Array(k.length) : null)), l.push(x(S, d, p, g, b, a ? new Array(S.length) : null));
    return {
      lines: o,
      points: l,
      rect: [y, v, w, _]
    };
  }
  static deserialize(e, n, s, r, a, {
    paths: {
      lines: o,
      points: l
    },
    rotation: c,
    thickness: h
  }) {
    const u = [];
    let f, d, p, g, b;
    switch (c) {
      case 0:
        b = Ht._rescale, f = -e / s, d = n / r + 1, p = 1 / s, g = -1 / r;
        break;
      case 90:
        b = Ht._rescaleAndSwap, f = -n / r, d = -e / s, p = 1 / r, g = 1 / s;
        break;
      case 180:
        b = Ht._rescale, f = e / s + 1, d = -n / r, p = -1 / s, g = 1 / r;
        break;
      case 270:
        b = Ht._rescaleAndSwap, f = n / r + 1, d = e / s + 1, p = -1 / r, g = -1 / s;
        break;
    }
    if (!o) {
      o = [];
      for (const v of l) {
        const w = v.length;
        if (w === 2) {
          o.push(new Float32Array([NaN, NaN, NaN, NaN, v[0], v[1]]));
          continue;
        }
        if (w === 4) {
          o.push(new Float32Array([NaN, NaN, NaN, NaN, v[0], v[1], NaN, NaN, NaN, NaN, v[2], v[3]]));
          continue;
        }
        const _ = new Float32Array(3 * (w - 2));
        o.push(_);
        let [x, k, S, T] = v.subarray(0, 4);
        _.set([NaN, NaN, NaN, NaN, x, k], 0);
        for (let I = 4; I < w; I += 2) {
          const R = v[I], B = v[I + 1];
          _.set(Ht.createBezierPoints(x, k, S, T, R, B), (I - 2) * 3), [x, k, S, T] = [S, T, R, B];
        }
      }
    }
    for (let v = 0, w = o.length; v < w; v++)
      u.push({
        line: b(o[v].map((_) => _ ?? NaN), f, d, p, g),
        points: b(l[v].map((_) => _ ?? NaN), f, d, p, g)
      });
    const y = new this.prototype.constructor();
    return y.build(u, s, r, 1, c, h, a), y;
  }
  get box() {
    return m(this, rs);
  }
  updateProperty(e, n) {
    return e === "stroke-width" ? D(this, En, KC).call(this, n) : null;
  }
  updateParentDimensions([e, n], s) {
    const [r, a] = D(this, En, jo).call(this);
    E(this, so, e), E(this, ro, n), E(this, Bd, s);
    const [o, l] = D(this, En, jo).call(this), c = o - r, h = l - a, u = m(this, rs);
    return u[0] -= c, u[1] -= h, u[2] += 2 * c, u[3] += 2 * h, u;
  }
  updateRotation(e) {
    return E(this, Wm, e), {
      path: {
        transform: this.rotationTransform
      }
    };
  }
  get viewBox() {
    return m(this, rs).map(Ht.svgRound).join(" ");
  }
  get defaultProperties() {
    const [e, n] = m(this, rs);
    return {
      root: {
        viewBox: this.viewBox
      },
      path: {
        "transform-origin": `${Ht.svgRound(e)} ${Ht.svgRound(n)}`
      }
    };
  }
  get rotationTransform() {
    const [, , e, n] = m(this, rs);
    let s = 0, r = 0, a = 0, o = 0, l = 0, c = 0;
    switch (m(this, Wm)) {
      case 90:
        r = n / e, a = -e / n, l = e;
        break;
      case 180:
        s = -1, o = -1, l = e, c = n;
        break;
      case 270:
        r = -n / e, a = e / n, c = n;
        break;
      default:
        return "";
    }
    return `matrix(${s} ${r} ${a} ${o} ${Ht.svgRound(l)} ${Ht.svgRound(c)})`;
  }
  getPathResizingSVGProperties([e, n, s, r]) {
    const [a, o] = D(this, En, jo).call(this), [l, c, h, u] = m(this, rs);
    if (Math.abs(h - a) <= Ht.PRECISION || Math.abs(u - o) <= Ht.PRECISION) {
      const b = e + s / 2 - (l + h / 2), y = n + r / 2 - (c + u / 2);
      return {
        path: {
          "transform-origin": `${Ht.svgRound(e)} ${Ht.svgRound(n)}`,
          transform: `${this.rotationTransform} translate(${b} ${y})`
        }
      };
    }
    const f = (s - 2 * a) / (h - 2 * a), d = (r - 2 * o) / (u - 2 * o), p = h / s, g = u / r;
    return {
      path: {
        "transform-origin": `${Ht.svgRound(l)} ${Ht.svgRound(c)}`,
        transform: `${this.rotationTransform} scale(${p} ${g}) translate(${Ht.svgRound(a)} ${Ht.svgRound(o)}) scale(${f} ${d}) translate(${Ht.svgRound(-a)} ${Ht.svgRound(-o)})`
      }
    };
  }
  getPathResizedSVGProperties([e, n, s, r]) {
    const [a, o] = D(this, En, jo).call(this), l = m(this, rs), [c, h, u, f] = l;
    if (l[0] = e, l[1] = n, l[2] = s, l[3] = r, Math.abs(u - a) <= Ht.PRECISION || Math.abs(f - o) <= Ht.PRECISION) {
      const y = e + s / 2 - (c + u / 2), v = n + r / 2 - (h + f / 2);
      for (const {
        line: w,
        points: _
      } of m(this, Zs))
        Ht._translate(w, y, v, w), Ht._translate(_, y, v, _);
      return {
        root: {
          viewBox: this.viewBox
        },
        path: {
          "transform-origin": `${Ht.svgRound(e)} ${Ht.svgRound(n)}`,
          transform: this.rotationTransform || null,
          d: this.toSVGPath()
        }
      };
    }
    const d = (s - 2 * a) / (u - 2 * a), p = (r - 2 * o) / (f - 2 * o), g = -d * (c + a) + e + a, b = -p * (h + o) + n + o;
    if (d !== 1 || p !== 1 || g !== 0 || b !== 0)
      for (const {
        line: y,
        points: v
      } of m(this, Zs))
        Ht._rescale(y, g, b, d, p, y), Ht._rescale(v, g, b, d, p, v);
    return {
      root: {
        viewBox: this.viewBox
      },
      path: {
        "transform-origin": `${Ht.svgRound(e)} ${Ht.svgRound(n)}`,
        transform: this.rotationTransform || null,
        d: this.toSVGPath()
      }
    };
  }
  getPathTranslatedSVGProperties([e, n], s) {
    const [r, a] = s, o = m(this, rs), l = e - o[0], c = n - o[1];
    if (m(this, so) === r && m(this, ro) === a)
      for (const {
        line: h,
        points: u
      } of m(this, Zs))
        Ht._translate(h, l, c, h), Ht._translate(u, l, c, u);
    else {
      const h = m(this, so) / r, u = m(this, ro) / a;
      E(this, so, r), E(this, ro, a);
      for (const {
        line: f,
        points: d
      } of m(this, Zs))
        Ht._rescale(f, l, c, h, u, f), Ht._rescale(d, l, c, h, u, d);
      o[2] *= h, o[3] *= u;
    }
    return o[0] = e, o[1] = n, {
      root: {
        viewBox: this.viewBox
      },
      path: {
        d: this.toSVGPath(),
        "transform-origin": `${Ht.svgRound(e)} ${Ht.svgRound(n)}`
      }
    };
  }
  get defaultSVGProperties() {
    const e = m(this, rs);
    return {
      root: {
        viewBox: this.viewBox
      },
      rootClass: {
        draw: !0
      },
      path: {
        d: this.toSVGPath(),
        "transform-origin": `${Ht.svgRound(e[0])} ${Ht.svgRound(e[1])}`,
        transform: this.rotationTransform || null
      },
      bbox: e
    };
  }
}
rs = new WeakMap(), Wm = new WeakMap(), Xm = new WeakMap(), Zs = new WeakMap(), so = new WeakMap(), ro = new WeakMap(), Bd = new WeakMap(), Pd = new WeakMap(), n1 = new WeakMap(), En = new WeakSet(), jo = function(e = m(this, n1)) {
  const n = m(this, Xm) + e / 2 * m(this, Bd);
  return m(this, Pd) % 180 === 0 ? [n / m(this, so), n / m(this, ro)] : [n / m(this, ro), n / m(this, so)];
}, XC = function() {
  const [e, n, s, r] = m(this, rs), [a, o] = D(this, En, jo).call(this, 0);
  return [e + a, n + o, s - 2 * a, r - 2 * o];
}, YC = function() {
  const e = E(this, rs, new Float32Array([1 / 0, 1 / 0, -1 / 0, -1 / 0]));
  for (const {
    line: r
  } of m(this, Zs)) {
    if (r.length <= 12) {
      for (let l = 4, c = r.length; l < c; l += 6)
        Zt.pointBoundingBox(r[l], r[l + 1], e);
      continue;
    }
    let a = r[4], o = r[5];
    for (let l = 6, c = r.length; l < c; l += 6) {
      const [h, u, f, d, p, g] = r.subarray(l, l + 6);
      Zt.bezierBoundingBox(a, o, h, u, f, d, p, g, e), a = p, o = g;
    }
  }
  const [n, s] = D(this, En, jo).call(this);
  e[0] = Gn(e[0] - n, 0, 1), e[1] = Gn(e[1] - s, 0, 1), e[2] = Gn(e[2] + n, 0, 1), e[3] = Gn(e[3] + s, 0, 1), e[2] -= e[0], e[3] -= e[1];
}, KC = function(e) {
  const [n, s] = D(this, En, jo).call(this);
  E(this, n1, e);
  const [r, a] = D(this, En, jo).call(this), [o, l] = [r - n, a - s], c = m(this, rs);
  return c[0] -= o, c[1] -= l, c[2] += 2 * o, c[3] += 2 * l, c;
};
class D4 extends VC {
  constructor(t) {
    super(), this._viewParameters = t, super.updateProperties({
      fill: "none",
      stroke: si._defaultLineColor,
      "stroke-opacity": 1,
      "stroke-width": 1,
      "stroke-linecap": "round",
      "stroke-linejoin": "round",
      "stroke-miterlimit": 10
    });
  }
  updateSVGProperty(t, e) {
    t === "stroke-width" && (e ?? (e = this["stroke-width"]), e *= this._viewParameters.realScale), super.updateSVGProperty(t, e);
  }
  clone() {
    const t = new D4(this._viewParameters);
    return t.updateAll(this), t;
  }
}
var a4, ZC;
const wu = class wu extends U9 {
  constructor(e) {
    super({
      ...e,
      name: "inkEditor"
    });
    F(this, a4);
    this._willKeepAspectRatio = !0, this.defaultL10nId = "pdfjs-editor-ink-editor";
  }
  static initialize(e, n) {
    si.initialize(e, n), this._defaultDrawingOptions = new D4(n.viewParameters);
  }
  static getDefaultDrawingOptions(e) {
    const n = this._defaultDrawingOptions.clone();
    return n.updateProperties(e), n;
  }
  static get supportMultipleDrawings() {
    return !0;
  }
  static get typesMap() {
    return Fe(this, "typesMap", /* @__PURE__ */ new Map([[Ie.INK_THICKNESS, "stroke-width"], [Ie.INK_COLOR, "stroke"], [Ie.INK_OPACITY, "stroke-opacity"]]));
  }
  static createDrawerInstance(e, n, s, r, a) {
    return new xR(e, n, s, r, a, this._defaultDrawingOptions["stroke-width"]);
  }
  static deserializeDraw(e, n, s, r, a, o) {
    return _g.deserialize(e, n, s, r, a, o);
  }
  static async deserialize(e, n, s) {
    let r = null;
    if (e instanceof By) {
      const {
        data: {
          inkLists: o,
          rect: l,
          rotation: c,
          id: h,
          color: u,
          opacity: f,
          borderStyle: {
            rawWidth: d
          },
          popupRef: p
        },
        parent: {
          page: {
            pageNumber: g
          }
        }
      } = e;
      r = e = {
        annotationType: fe.INK,
        color: Array.from(u),
        thickness: d,
        opacity: f,
        paths: {
          points: o
        },
        boxes: null,
        pageIndex: g - 1,
        rect: l.slice(0),
        rotation: c,
        id: h,
        deleted: !1,
        popupRef: p
      };
    }
    const a = await super.deserialize(e, n, s);
    return a.annotationElementId = e.id || null, a._initialData = r, a;
  }
  onScaleChanging() {
    if (!this.parent)
      return;
    super.onScaleChanging();
    const {
      _drawId: e,
      _drawingOptions: n,
      parent: s
    } = this;
    n.updateSVGProperty("stroke-width"), s.drawLayer.updateProperties(e, n.toSVGProperties());
  }
  static onScaleChangingWhenDrawing() {
    const e = this._currentParent;
    e && (super.onScaleChangingWhenDrawing(), this._defaultDrawingOptions.updateSVGProperty("stroke-width"), e.drawLayer.updateProperties(this._currentDrawId, this._defaultDrawingOptions.toSVGProperties()));
  }
  createDrawingOptions({
    color: e,
    thickness: n,
    opacity: s
  }) {
    this._drawingOptions = wu.getDefaultDrawingOptions({
      stroke: Zt.makeHexColor(...e),
      "stroke-width": n,
      "stroke-opacity": s
    });
  }
  serialize(e = !1) {
    if (this.isEmpty())
      return null;
    if (this.deleted)
      return this.serializeDeleted();
    const {
      lines: n,
      points: s,
      rect: r
    } = this.serializeDraw(e), {
      _drawingOptions: {
        stroke: a,
        "stroke-opacity": o,
        "stroke-width": l
      }
    } = this, c = {
      annotationType: fe.INK,
      color: si._colorManager.convert(a),
      opacity: o,
      thickness: l,
      paths: {
        lines: n,
        points: s
      },
      pageIndex: this.pageIndex,
      rect: r,
      rotation: this.rotation,
      structTreeParentId: this._structTreeParentId
    };
    return e ? (c.isCopy = !0, c) : this.annotationElementId && !D(this, a4, ZC).call(this, c) ? null : (c.id = this.annotationElementId, c);
  }
  renderAnnotationElement(e) {
    const {
      points: n,
      rect: s
    } = this.serializeDraw(!1);
    return e.updateEdited({
      rect: s,
      thickness: this._drawingOptions["stroke-width"],
      points: n
    }), null;
  }
};
a4 = new WeakSet(), ZC = function(e) {
  const {
    color: n,
    thickness: s,
    opacity: r,
    pageIndex: a
  } = this._initialData;
  return this._hasBeenMoved || this._hasBeenResized || e.color.some((o, l) => o !== n[l]) || e.thickness !== s || e.opacity !== r || e.pageIndex !== a;
}, ft(wu, "_type", "ink"), ft(wu, "_editorType", fe.INK), ft(wu, "_defaultDrawingOptions", null);
let k8 = wu;
class A8 extends _g {
  toSVGPath() {
    let t = super.toSVGPath();
    return t.endsWith("Z") || (t += "Z"), t;
  }
}
const Vg = 8, Ef = 3;
var s1, Ge, S8, ba, JC, QC, C8, n9, tE, eE, iE, E8, D8, nE;
class mo {
  static extractContoursFromText(t, {
    fontFamily: e,
    fontStyle: n,
    fontWeight: s
  }, r, a, o, l) {
    let c = new OffscreenCanvas(1, 1), h = c.getContext("2d", {
      alpha: !1
    });
    const u = 200, f = h.font = `${n} ${s} ${u}px ${e}`, {
      actualBoundingBoxLeft: d,
      actualBoundingBoxRight: p,
      actualBoundingBoxAscent: g,
      actualBoundingBoxDescent: b,
      fontBoundingBoxAscent: y,
      fontBoundingBoxDescent: v,
      width: w
    } = h.measureText(t), _ = 1.5, x = Math.ceil(Math.max(Math.abs(d) + Math.abs(p) || 0, w) * _), k = Math.ceil(Math.max(Math.abs(g) + Math.abs(b) || u, Math.abs(y) + Math.abs(v) || u) * _);
    c = new OffscreenCanvas(x, k), h = c.getContext("2d", {
      alpha: !0,
      willReadFrequently: !0
    }), h.font = f, h.filter = "grayscale(1)", h.fillStyle = "white", h.fillRect(0, 0, x, k), h.fillStyle = "black", h.fillText(t, x * (_ - 1) / 2, k * (3 - _) / 2);
    const S = D(this, Ge, E8).call(this, h.getImageData(0, 0, x, k).data), T = D(this, Ge, iE).call(this, S), I = D(this, Ge, D8).call(this, T), R = D(this, Ge, C8).call(this, S, x, k, I);
    return this.processDrawnLines({
      lines: {
        curves: R,
        width: x,
        height: k
      },
      pageWidth: r,
      pageHeight: a,
      rotation: o,
      innerMargin: l,
      mustSmooth: !0,
      areContours: !0
    });
  }
  static process(t, e, n, s, r) {
    const [a, o, l] = D(this, Ge, nE).call(this, t), [c, h] = D(this, Ge, eE).call(this, a, o, l, Math.hypot(o, l) * m(this, s1).sigmaSFactor, m(this, s1).sigmaR, m(this, s1).kernelSize), u = D(this, Ge, D8).call(this, h), f = D(this, Ge, C8).call(this, c, o, l, u);
    return this.processDrawnLines({
      lines: {
        curves: f,
        width: o,
        height: l
      },
      pageWidth: e,
      pageHeight: n,
      rotation: s,
      innerMargin: r,
      mustSmooth: !0,
      areContours: !0
    });
  }
  static processDrawnLines({
    lines: t,
    pageWidth: e,
    pageHeight: n,
    rotation: s,
    innerMargin: r,
    mustSmooth: a,
    areContours: o
  }) {
    s % 180 !== 0 && ([e, n] = [n, e]);
    const {
      curves: l,
      width: c,
      height: h
    } = t, u = t.thickness ?? 0, f = [], d = Math.min(e / c, n / h), p = d / e, g = d / n, b = [];
    for (const {
      points: v
    } of l) {
      const w = a ? D(this, Ge, tE).call(this, v) : v;
      if (!w)
        continue;
      b.push(w);
      const _ = w.length, x = new Float32Array(_), k = new Float32Array(3 * (_ === 2 ? 2 : _ - 2));
      if (f.push({
        line: k,
        points: x
      }), _ === 2) {
        x[0] = w[0] * p, x[1] = w[1] * g, k.set([NaN, NaN, NaN, NaN, x[0], x[1]], 0);
        continue;
      }
      let [S, T, I, R] = w;
      S *= p, T *= g, I *= p, R *= g, x.set([S, T, I, R], 0), k.set([NaN, NaN, NaN, NaN, S, T], 0);
      for (let B = 4; B < _; B += 2) {
        const L = x[B] = w[B] * p, it = x[B + 1] = w[B + 1] * g;
        k.set(Ht.createBezierPoints(S, T, I, R, L, it), (B - 2) * 3), [S, T, I, R] = [I, R, L, it];
      }
    }
    if (f.length === 0)
      return null;
    const y = o ? new A8() : new _g();
    return y.build(f, e, n, 1, s, o ? 0 : u, r), {
      outline: y,
      newCurves: b,
      areContours: o,
      thickness: u,
      width: c,
      height: h
    };
  }
  static async compressSignature({
    outlines: t,
    areContours: e,
    thickness: n,
    width: s,
    height: r
  }) {
    let a = 1 / 0, o = -1 / 0, l = 0;
    for (const w of t) {
      l += w.length;
      for (let _ = 2, x = w.length; _ < x; _++) {
        const k = w[_] - w[_ - 2];
        a = Math.min(a, k), o = Math.max(o, k);
      }
    }
    let c;
    a >= -128 && o <= 127 ? c = Int8Array : a >= -32768 && o <= 32767 ? c = Int16Array : c = Int32Array;
    const h = t.length, u = Vg + Ef * h, f = new Uint32Array(u);
    let d = 0;
    f[d++] = u * Uint32Array.BYTES_PER_ELEMENT + (l - 2 * h) * c.BYTES_PER_ELEMENT, f[d++] = 0, f[d++] = s, f[d++] = r, f[d++] = e ? 0 : 1, f[d++] = Math.max(0, Math.floor(n ?? 0)), f[d++] = h, f[d++] = c.BYTES_PER_ELEMENT;
    for (const w of t)
      f[d++] = w.length - 2, f[d++] = w[0], f[d++] = w[1];
    const p = new CompressionStream("deflate-raw"), g = p.writable.getWriter();
    await g.ready, g.write(f);
    const b = c.prototype.constructor;
    for (const w of t) {
      const _ = new b(w.length - 2);
      for (let x = 2, k = w.length; x < k; x++)
        _[x - 2] = w[x] - w[x - 2];
      g.write(_);
    }
    g.close();
    const y = await new Response(p.readable).arrayBuffer(), v = new Uint8Array(y);
    return QA(v);
  }
  static async decompressSignature(t) {
    try {
      const e = JI(t), {
        readable: n,
        writable: s
      } = new DecompressionStream("deflate-raw"), r = s.getWriter();
      await r.ready, r.write(e).then(async () => {
        await r.ready, await r.close();
      }).catch(() => {
      });
      let a = null, o = 0;
      for await (const w of n)
        a || (a = new Uint8Array(new Uint32Array(w.buffer, 0, 4)[0])), a.set(w, o), o += w.length;
      const l = new Uint32Array(a.buffer, 0, a.length >> 2), c = l[1];
      if (c !== 0)
        throw new Error(`Invalid version: ${c}`);
      const h = l[2], u = l[3], f = l[4] === 0, d = l[5], p = l[6], g = l[7], b = [], y = (Vg + Ef * p) * Uint32Array.BYTES_PER_ELEMENT;
      let v;
      switch (g) {
        case Int8Array.BYTES_PER_ELEMENT:
          v = new Int8Array(a.buffer, y);
          break;
        case Int16Array.BYTES_PER_ELEMENT:
          v = new Int16Array(a.buffer, y);
          break;
        case Int32Array.BYTES_PER_ELEMENT:
          v = new Int32Array(a.buffer, y);
          break;
      }
      o = 0;
      for (let w = 0; w < p; w++) {
        const _ = l[Ef * w + Vg], x = new Float32Array(_ + 2);
        b.push(x);
        for (let k = 0; k < Ef - 1; k++)
          x[k] = l[Ef * w + Vg + k + 1];
        for (let k = 0; k < _; k++)
          x[k + 2] = x[k] + v[o++];
      }
      return {
        areContours: f,
        thickness: d,
        outlines: b,
        width: h,
        height: u
      };
    } catch (e) {
      return me(`decompressSignature: ${e}`), null;
    }
  }
}
s1 = new WeakMap(), Ge = new WeakSet(), S8 = function(t, e, n, s) {
  return n -= t, s -= e, n === 0 ? s > 0 ? 0 : 4 : n === 1 ? s + 6 : 2 - s;
}, ba = new WeakMap(), JC = function(t, e, n, s, r, a, o) {
  const l = D(this, Ge, S8).call(this, n, s, r, a);
  for (let c = 0; c < 8; c++) {
    const h = (-c + l - o + 16) % 8, u = m(this, ba)[2 * h], f = m(this, ba)[2 * h + 1];
    if (t[(n + u) * e + (s + f)] !== 0)
      return h;
  }
  return -1;
}, QC = function(t, e, n, s, r, a, o) {
  const l = D(this, Ge, S8).call(this, n, s, r, a);
  for (let c = 0; c < 8; c++) {
    const h = (c + l + o + 16) % 8, u = m(this, ba)[2 * h], f = m(this, ba)[2 * h + 1];
    if (t[(n + u) * e + (s + f)] !== 0)
      return h;
  }
  return -1;
}, C8 = function(t, e, n, s) {
  const r = t.length, a = new Int32Array(r);
  for (let h = 0; h < r; h++)
    a[h] = t[h] <= s ? 1 : 0;
  for (let h = 1; h < n - 1; h++)
    a[h * e] = a[h * e + e - 1] = 0;
  for (let h = 0; h < e; h++)
    a[h] = a[e * n - 1 - h] = 0;
  let o = 1, l;
  const c = [];
  for (let h = 1; h < n - 1; h++) {
    l = 1;
    for (let u = 1; u < e - 1; u++) {
      const f = h * e + u, d = a[f];
      if (d === 0)
        continue;
      let p = h, g = u;
      if (d === 1 && a[f - 1] === 0)
        o += 1, g -= 1;
      else if (d >= 1 && a[f + 1] === 0)
        o += 1, g += 1, d > 1 && (l = d);
      else {
        d !== 1 && (l = Math.abs(d));
        continue;
      }
      const b = [u, h], y = g === u + 1, v = {
        isHole: y,
        points: b,
        id: o,
        parent: 0
      };
      c.push(v);
      let w;
      for (const B of c)
        if (B.id === l) {
          w = B;
          break;
        }
      w ? w.isHole ? v.parent = y ? w.parent : l : v.parent = y ? l : w.parent : v.parent = y ? l : 0;
      const _ = D(this, Ge, JC).call(this, a, e, h, u, p, g, 0);
      if (_ === -1) {
        a[f] = -o, a[f] !== 1 && (l = Math.abs(a[f]));
        continue;
      }
      let x = m(this, ba)[2 * _], k = m(this, ba)[2 * _ + 1];
      const S = h + x, T = u + k;
      p = S, g = T;
      let I = h, R = u;
      for (; ; ) {
        const B = D(this, Ge, QC).call(this, a, e, I, R, p, g, 1);
        x = m(this, ba)[2 * B], k = m(this, ba)[2 * B + 1];
        const L = I + x, it = R + k;
        b.push(it, L);
        const O = I * e + R;
        if (a[O + 1] === 0 ? a[O] = -o : a[O] === 1 && (a[O] = o), L === h && it === u && I === S && R === T) {
          a[f] !== 1 && (l = Math.abs(a[f]));
          break;
        } else
          p = I, g = R, I = L, R = it;
      }
    }
  }
  return c;
}, n9 = function(t, e, n, s) {
  if (n - e <= 4) {
    for (let S = e; S < n - 2; S += 2)
      s.push(t[S], t[S + 1]);
    return;
  }
  const r = t[e], a = t[e + 1], o = t[n - 4] - r, l = t[n - 3] - a, c = Math.hypot(o, l), h = o / c, u = l / c, f = h * a - u * r, d = l / o, p = 1 / c, g = Math.atan(d), b = Math.cos(g), y = Math.sin(g), v = p * (Math.abs(b) + Math.abs(y)), w = p * (1 - v + v ** 2), _ = Math.max(Math.atan(Math.abs(y + b) * w), Math.atan(Math.abs(y - b) * w));
  let x = 0, k = e;
  for (let S = e + 2; S < n - 2; S += 2) {
    const T = Math.abs(f - h * t[S + 1] + u * t[S]);
    T > x && (k = S, x = T);
  }
  x > (c * _) ** 2 ? (D(this, Ge, n9).call(this, t, e, k + 2, s), D(this, Ge, n9).call(this, t, k, n, s)) : s.push(r, a);
}, tE = function(t) {
  const e = [], n = t.length;
  return D(this, Ge, n9).call(this, t, 0, n, e), e.push(t[n - 2], t[n - 1]), e.length <= 4 ? null : e;
}, eE = function(t, e, n, s, r, a) {
  const o = new Float32Array(a ** 2), l = -2 * s ** 2, c = a >> 1;
  for (let g = 0; g < a; g++) {
    const b = (g - c) ** 2;
    for (let y = 0; y < a; y++)
      o[g * a + y] = Math.exp((b + (y - c) ** 2) / l);
  }
  const h = new Float32Array(256), u = -2 * r ** 2;
  for (let g = 0; g < 256; g++)
    h[g] = Math.exp(g ** 2 / u);
  const f = t.length, d = new Uint8Array(f), p = new Uint32Array(256);
  for (let g = 0; g < n; g++)
    for (let b = 0; b < e; b++) {
      const y = g * e + b, v = t[y];
      let w = 0, _ = 0;
      for (let k = 0; k < a; k++) {
        const S = g + k - c;
        if (!(S < 0 || S >= n))
          for (let T = 0; T < a; T++) {
            const I = b + T - c;
            if (I < 0 || I >= e)
              continue;
            const R = t[S * e + I], B = o[k * a + T] * h[Math.abs(R - v)];
            w += R * B, _ += B;
          }
      }
      const x = d[y] = Math.round(w / _);
      p[x]++;
    }
  return [d, p];
}, iE = function(t) {
  const e = new Uint32Array(256);
  for (const n of t)
    e[n]++;
  return e;
}, E8 = function(t) {
  const e = t.length, n = new Uint8ClampedArray(e >> 2);
  let s = -1 / 0, r = 1 / 0;
  for (let o = 0, l = n.length; o < l; o++) {
    if (t[(o << 2) + 3] === 0) {
      s = n[o] = 255;
      continue;
    }
    const h = n[o] = t[o << 2];
    h > s && (s = h), h < r && (r = h);
  }
  const a = 255 / (s - r);
  for (let o = 0; o < e; o++)
    n[o] = (n[o] - r) * a;
  return n;
}, D8 = function(t) {
  let e, n = -1 / 0, s = -1 / 0;
  const r = t.findIndex((l) => l !== 0);
  let a = r, o = r;
  for (e = r; e < 256; e++) {
    const l = t[e];
    l > n && (e - a > s && (s = e - a, o = e - 1), n = l, a = e);
  }
  for (e = o - 1; e >= 0 && !(t[e] > t[e + 1]); e--)
    ;
  return e;
}, nE = function(t) {
  const e = t, {
    width: n,
    height: s
  } = t, {
    maxDim: r
  } = m(this, s1);
  let a = n, o = s;
  if (n > r || s > r) {
    let f = n, d = s, p = Math.log2(Math.max(n, s) / r);
    const g = Math.floor(p);
    p = p === g ? g - 1 : g;
    for (let y = 0; y < p; y++) {
      a = Math.ceil(f / 2), o = Math.ceil(d / 2);
      const v = new OffscreenCanvas(a, o);
      v.getContext("2d").drawImage(t, 0, 0, f, d, 0, 0, a, o), f = a, d = o, t !== e && t.close(), t = v.transferToImageBitmap();
    }
    const b = Math.min(r / a, r / o);
    a = Math.round(a * b), o = Math.round(o * b);
  }
  const c = new OffscreenCanvas(a, o).getContext("2d", {
    willReadFrequently: !0
  });
  c.filter = "grayscale(1)", c.drawImage(t, 0, 0, t.width, t.height, 0, 0, a, o);
  const h = c.getImageData(0, 0, a, o).data;
  return [D(this, Ge, E8).call(this, h), a, o];
}, F(mo, Ge), F(mo, s1, {
  maxDim: 512,
  sigmaSFactor: 0.02,
  sigmaR: 25,
  kernelSize: 16
}), F(mo, ba, new Int32Array([0, 1, -1, 1, -1, 0, -1, -1, 0, -1, 1, -1, 1, 0, 1, 1]));
class Py extends VC {
  constructor() {
    super(), super.updateProperties({
      fill: si._defaultLineColor,
      "stroke-width": 0
    });
  }
  clone() {
    const t = new Py();
    return t.updateAll(this), t;
  }
}
class Ny extends D4 {
  constructor(t) {
    super(t), super.updateProperties({
      stroke: si._defaultLineColor,
      "stroke-width": 1
    });
  }
  clone() {
    const t = new Ny(this._viewParameters);
    return t.updateAll(this), t;
  }
}
var jc, Js, Gc, Vc;
const qs = class qs extends U9 {
  constructor(e) {
    super({
      ...e,
      mustBeCommitted: !0,
      name: "signatureEditor"
    });
    F(this, jc, !1);
    F(this, Js, null);
    F(this, Gc, null);
    F(this, Vc, null);
    this._willKeepAspectRatio = !0, E(this, Gc, e.signatureData || null), E(this, Js, null), this.defaultL10nId = "pdfjs-editor-signature-editor1";
  }
  static initialize(e, n) {
    si.initialize(e, n), this._defaultDrawingOptions = new Py(), this._defaultDrawnSignatureOptions = new Ny(n.viewParameters);
  }
  static getDefaultDrawingOptions(e) {
    const n = this._defaultDrawingOptions.clone();
    return n.updateProperties(e), n;
  }
  static get supportMultipleDrawings() {
    return !1;
  }
  static get typesMap() {
    return Fe(this, "typesMap", /* @__PURE__ */ new Map());
  }
  static get isDrawer() {
    return !1;
  }
  get telemetryFinalData() {
    return {
      type: "signature",
      hasDescription: !!m(this, Js)
    };
  }
  static computeTelemetryFinalData(e) {
    const n = e.get("hasDescription");
    return {
      hasAltText: n.get(!0) ?? 0,
      hasNoAltText: n.get(!1) ?? 0
    };
  }
  get isResizable() {
    return !0;
  }
  onScaleChanging() {
    this._drawId !== null && super.onScaleChanging();
  }
  render() {
    if (this.div)
      return this.div;
    let e, n;
    const {
      _isCopy: s
    } = this;
    if (s && (this._isCopy = !1, e = this.x, n = this.y), super.render(), this._drawId === null)
      if (m(this, Gc)) {
        const {
          lines: r,
          mustSmooth: a,
          areContours: o,
          description: l,
          uuid: c,
          heightInPage: h
        } = m(this, Gc), {
          rawDims: {
            pageWidth: u,
            pageHeight: f
          },
          rotation: d
        } = this.parent.viewport, p = mo.processDrawnLines({
          lines: r,
          pageWidth: u,
          pageHeight: f,
          rotation: d,
          innerMargin: qs._INNER_MARGIN,
          mustSmooth: a,
          areContours: o
        });
        this.addSignature(p, h, l, c);
      } else
        this.div.setAttribute("data-l10n-args", JSON.stringify({
          description: ""
        })), this.div.hidden = !0, this._uiManager.getSignature(this);
    return s && (this._isCopy = !0, this._moveAfterPaste(e, n)), this.div;
  }
  setUuid(e) {
    E(this, Vc, e), this.addEditToolbar();
  }
  getUuid() {
    return m(this, Vc);
  }
  get description() {
    return m(this, Js);
  }
  set description(e) {
    E(this, Js, e), super.addEditToolbar().then((n) => {
      n == null || n.updateEditSignatureButton(e);
    });
  }
  getSignaturePreview() {
    const {
      newCurves: e,
      areContours: n,
      thickness: s,
      width: r,
      height: a
    } = m(this, Gc), o = Math.max(r, a), l = mo.processDrawnLines({
      lines: {
        curves: e.map((c) => ({
          points: c
        })),
        thickness: s,
        width: r,
        height: a
      },
      pageWidth: o,
      pageHeight: o,
      rotation: 0,
      innerMargin: 0,
      mustSmooth: !1,
      areContours: n
    });
    return {
      areContours: n,
      outline: l.outline
    };
  }
  async addEditToolbar() {
    const e = await super.addEditToolbar();
    return e ? (this._uiManager.signatureManager && m(this, Js) !== null && (await e.addEditSignatureButton(this._uiManager.signatureManager, m(this, Vc), m(this, Js)), e.show()), e) : null;
  }
  addSignature(e, n, s, r) {
    const {
      x: a,
      y: o
    } = this, {
      outline: l
    } = E(this, Gc, e);
    E(this, jc, l instanceof A8), E(this, Js, s), this.div.setAttribute("data-l10n-args", JSON.stringify({
      description: s
    }));
    let c;
    m(this, jc) ? c = qs.getDefaultDrawingOptions() : (c = qs._defaultDrawnSignatureOptions.clone(), c.updateProperties({
      "stroke-width": l.thickness
    })), this._addOutlines({
      drawOutlines: l,
      drawingOptions: c
    });
    const [h, u] = this.parentDimensions, [, f] = this.pageDimensions;
    let d = n / f;
    d = d >= 1 ? 0.5 : d, this.width *= d / this.height, this.width >= 1 && (d *= 0.9 / this.width, this.width = 0.9), this.height = d, this.setDims(h * this.width, u * this.height), this.x = a, this.y = o, this.center(), this._onResized(), this.onScaleChanging(), this.rotate(), this._uiManager.addToAnnotationStorage(this), this.setUuid(r), this._reportTelemetry({
      action: "pdfjs.signature.inserted",
      data: {
        hasBeenSaved: !!r,
        hasDescription: !!s
      }
    }), this.div.hidden = !1;
  }
  getFromImage(e) {
    const {
      rawDims: {
        pageWidth: n,
        pageHeight: s
      },
      rotation: r
    } = this.parent.viewport;
    return mo.process(e, n, s, r, qs._INNER_MARGIN);
  }
  getFromText(e, n) {
    const {
      rawDims: {
        pageWidth: s,
        pageHeight: r
      },
      rotation: a
    } = this.parent.viewport;
    return mo.extractContoursFromText(e, n, s, r, a, qs._INNER_MARGIN);
  }
  getDrawnSignature(e) {
    const {
      rawDims: {
        pageWidth: n,
        pageHeight: s
      },
      rotation: r
    } = this.parent.viewport;
    return mo.processDrawnLines({
      lines: e,
      pageWidth: n,
      pageHeight: s,
      rotation: r,
      innerMargin: qs._INNER_MARGIN,
      mustSmooth: !1,
      areContours: !1
    });
  }
  createDrawingOptions({
    areContours: e,
    thickness: n
  }) {
    e ? this._drawingOptions = qs.getDefaultDrawingOptions() : (this._drawingOptions = qs._defaultDrawnSignatureOptions.clone(), this._drawingOptions.updateProperties({
      "stroke-width": n
    }));
  }
  serialize(e = !1) {
    if (this.isEmpty())
      return null;
    const {
      lines: n,
      points: s,
      rect: r
    } = this.serializeDraw(e), {
      _drawingOptions: {
        "stroke-width": a
      }
    } = this, o = {
      annotationType: fe.SIGNATURE,
      isSignature: !0,
      areContours: m(this, jc),
      color: [0, 0, 0],
      thickness: m(this, jc) ? 0 : a,
      pageIndex: this.pageIndex,
      rect: r,
      rotation: this.rotation,
      structTreeParentId: this._structTreeParentId
    };
    return e ? (o.paths = {
      lines: n,
      points: s
    }, o.uuid = m(this, Vc), o.isCopy = !0) : o.lines = n, m(this, Js) && (o.accessibilityData = {
      type: "Figure",
      alt: m(this, Js)
    }), o;
  }
  static deserializeDraw(e, n, s, r, a, o) {
    return o.areContours ? A8.deserialize(e, n, s, r, a, o) : _g.deserialize(e, n, s, r, a, o);
  }
  static async deserialize(e, n, s) {
    var a;
    const r = await super.deserialize(e, n, s);
    return E(r, jc, e.areContours), E(r, Js, ((a = e.accessibilityData) == null ? void 0 : a.alt) || ""), E(r, Vc, e.uuid), r;
  }
};
jc = new WeakMap(), Js = new WeakMap(), Gc = new WeakMap(), Vc = new WeakMap(), ft(qs, "_type", "signature"), ft(qs, "_editorType", fe.SIGNATURE), ft(qs, "_defaultDrawingOptions", null);
let T8 = qs;
var ui, dn, Wc, kl, Xc, Nd, Al, r1, ao, Qs, Ld, $e, f2, p2, s9, r9, a9, I8, o9, sE;
class F8 extends si {
  constructor(e) {
    super({
      ...e,
      name: "stampEditor"
    });
    F(this, $e);
    F(this, ui, null);
    F(this, dn, null);
    F(this, Wc, null);
    F(this, kl, null);
    F(this, Xc, null);
    F(this, Nd, "");
    F(this, Al, null);
    F(this, r1, !1);
    F(this, ao, null);
    F(this, Qs, !1);
    F(this, Ld, !1);
    E(this, kl, e.bitmapUrl), E(this, Xc, e.bitmapFile), this.defaultL10nId = "pdfjs-editor-stamp-editor";
  }
  static initialize(e, n) {
    si.initialize(e, n);
  }
  static isHandlingMimeForPasting(e) {
    return L9.includes(e);
  }
  static paste(e, n) {
    n.pasteEditor({
      mode: fe.STAMP
    }, {
      bitmapFile: e.getAsFile()
    });
  }
  altTextFinish() {
    this._uiManager.useNewAltTextFlow && (this.div.hidden = !1), super.altTextFinish();
  }
  get telemetryFinalData() {
    var e;
    return {
      type: "stamp",
      hasAltText: !!((e = this.altTextData) != null && e.altText)
    };
  }
  static computeTelemetryFinalData(e) {
    const n = e.get("hasAltText");
    return {
      hasAltText: n.get(!0) ?? 0,
      hasNoAltText: n.get(!1) ?? 0
    };
  }
  async mlGuessAltText(e = null, n = !0) {
    if (this.hasAltTextData())
      return null;
    const {
      mlManager: s
    } = this._uiManager;
    if (!s)
      throw new Error("No ML.");
    if (!await s.isEnabledFor("altText"))
      throw new Error("ML isn't enabled for alt text.");
    const {
      data: r,
      width: a,
      height: o
    } = e || this.copyCanvas(null, null, !0).imageData, l = await s.guess({
      name: "altText",
      request: {
        data: r,
        width: a,
        height: o,
        channels: r.length / (a * o)
      }
    });
    if (!l)
      throw new Error("No response from the AI service.");
    if (l.error)
      throw new Error("Error from the AI service.");
    if (l.cancel)
      return null;
    if (!l.output)
      throw new Error("No valid response from the AI service.");
    const c = l.output;
    return await this.setGuessedAltText(c), n && !this.hasAltTextData() && (this.altTextData = {
      alt: c,
      decorative: !1
    }), c;
  }
  remove() {
    var e;
    m(this, dn) && (E(this, ui, null), this._uiManager.imageManager.deleteId(m(this, dn)), (e = m(this, Al)) == null || e.remove(), E(this, Al, null), m(this, ao) && (clearTimeout(m(this, ao)), E(this, ao, null))), super.remove();
  }
  rebuild() {
    if (!this.parent) {
      m(this, dn) && D(this, $e, s9).call(this);
      return;
    }
    super.rebuild(), this.div !== null && (m(this, dn) && m(this, Al) === null && D(this, $e, s9).call(this), this.isAttachedToDOM || this.parent.add(this));
  }
  onceAdded(e) {
    this._isDraggable = !0, e && this.div.focus();
  }
  isEmpty() {
    return !(m(this, Wc) || m(this, ui) || m(this, kl) || m(this, Xc) || m(this, dn) || m(this, r1));
  }
  get isResizable() {
    return !0;
  }
  render() {
    if (this.div)
      return this.div;
    let e, n;
    return this._isCopy && (e = this.x, n = this.y), super.render(), this.div.hidden = !0, this.addAltTextButton(), m(this, r1) || (m(this, ui) ? D(this, $e, r9).call(this) : D(this, $e, s9).call(this)), this._isCopy && this._moveAfterPaste(e, n), this._uiManager.addShouldRescale(this), this.div;
  }
  setCanvas(e, n) {
    const {
      id: s,
      bitmap: r
    } = this._uiManager.imageManager.getFromCanvas(e, n);
    n.remove(), s && this._uiManager.imageManager.isValidId(s) && (E(this, dn, s), r && E(this, ui, r), E(this, r1, !1), D(this, $e, r9).call(this));
  }
  _onResized() {
    this.onScaleChanging();
  }
  onScaleChanging() {
    if (!this.parent)
      return;
    m(this, ao) !== null && clearTimeout(m(this, ao)), E(this, ao, setTimeout(() => {
      E(this, ao, null), D(this, $e, I8).call(this);
    }, 200));
  }
  copyCanvas(e, n, s = !1) {
    var d;
    e || (e = 224);
    const {
      width: r,
      height: a
    } = m(this, ui), o = new Ia();
    let l = m(this, ui), c = r, h = a, u = null;
    if (n) {
      if (r > n || a > n) {
        const T = Math.min(n / r, n / a);
        c = Math.floor(r * T), h = Math.floor(a * T);
      }
      u = document.createElement("canvas");
      const p = u.width = Math.ceil(c * o.sx), g = u.height = Math.ceil(h * o.sy);
      m(this, Qs) || (l = D(this, $e, a9).call(this, p, g));
      const b = u.getContext("2d");
      b.filter = this._uiManager.hcmFilter;
      let y = "white", v = "#cfcfd8";
      this._uiManager.hcmFilter !== "none" ? v = "black" : (d = window.matchMedia) != null && d.call(window, "(prefers-color-scheme: dark)").matches && (y = "#8f8f9d", v = "#42414d");
      const w = 15, _ = w * o.sx, x = w * o.sy, k = new OffscreenCanvas(_ * 2, x * 2), S = k.getContext("2d");
      S.fillStyle = y, S.fillRect(0, 0, _ * 2, x * 2), S.fillStyle = v, S.fillRect(0, 0, _, x), S.fillRect(_, x, _, x), b.fillStyle = b.createPattern(k, "repeat"), b.fillRect(0, 0, p, g), b.drawImage(l, 0, 0, l.width, l.height, 0, 0, p, g);
    }
    let f = null;
    if (s) {
      let p, g;
      if (o.symmetric && l.width < e && l.height < e)
        p = l.width, g = l.height;
      else if (l = m(this, ui), r > e || a > e) {
        const v = Math.min(e / r, e / a);
        p = Math.floor(r * v), g = Math.floor(a * v), m(this, Qs) || (l = D(this, $e, a9).call(this, p, g));
      }
      const y = new OffscreenCanvas(p, g).getContext("2d", {
        willReadFrequently: !0
      });
      y.drawImage(l, 0, 0, l.width, l.height, 0, 0, p, g), f = {
        width: p,
        height: g,
        data: y.getImageData(0, 0, p, g).data
      };
    }
    return {
      canvas: u,
      width: c,
      height: h,
      imageData: f
    };
  }
  static async deserialize(e, n, s) {
    var b;
    let r = null, a = !1;
    if (e instanceof wC) {
      const {
        data: {
          rect: y,
          rotation: v,
          id: w,
          structParent: _,
          popupRef: x
        },
        container: k,
        parent: {
          page: {
            pageNumber: S
          }
        },
        canvas: T
      } = e;
      let I, R;
      T ? (delete e.canvas, {
        id: I,
        bitmap: R
      } = s.imageManager.getFromCanvas(k.id, T), T.remove()) : (a = !0, e._hasNoCanvas = !0);
      const B = ((b = await n._structTree.getAriaAttributes(`${Ey}${w}`)) == null ? void 0 : b.get("aria-label")) || "";
      r = e = {
        annotationType: fe.STAMP,
        bitmapId: I,
        bitmap: R,
        pageIndex: S - 1,
        rect: y.slice(0),
        rotation: v,
        id: w,
        deleted: !1,
        accessibilityData: {
          decorative: !1,
          altText: B
        },
        isSvg: !1,
        structParent: _,
        popupRef: x
      };
    }
    const o = await super.deserialize(e, n, s), {
      rect: l,
      bitmap: c,
      bitmapUrl: h,
      bitmapId: u,
      isSvg: f,
      accessibilityData: d
    } = e;
    a ? (s.addMissingCanvas(e.id, o), E(o, r1, !0)) : u && s.imageManager.isValidId(u) ? (E(o, dn, u), c && E(o, ui, c)) : E(o, kl, h), E(o, Qs, f);
    const [p, g] = o.pageDimensions;
    return o.width = (l[2] - l[0]) / p, o.height = (l[3] - l[1]) / g, o.annotationElementId = e.id || null, d && (o.altTextData = d), o._initialData = r, E(o, Ld, !!r), o;
  }
  serialize(e = !1, n = null) {
    if (this.isEmpty())
      return null;
    if (this.deleted)
      return this.serializeDeleted();
    const s = {
      annotationType: fe.STAMP,
      bitmapId: m(this, dn),
      pageIndex: this.pageIndex,
      rect: this.getRect(0, 0),
      rotation: this.rotation,
      isSvg: m(this, Qs),
      structTreeParentId: this._structTreeParentId
    };
    if (e)
      return s.bitmapUrl = D(this, $e, o9).call(this, !0), s.accessibilityData = this.serializeAltText(!0), s.isCopy = !0, s;
    const {
      decorative: r,
      altText: a
    } = this.serializeAltText(!1);
    if (!r && a && (s.accessibilityData = {
      type: "Figure",
      alt: a
    }), this.annotationElementId) {
      const l = D(this, $e, sE).call(this, s);
      if (l.isSame)
        return null;
      l.isSameAltText ? delete s.accessibilityData : s.accessibilityData.structParent = this._initialData.structParent ?? -1;
    }
    if (s.id = this.annotationElementId, n === null)
      return s;
    n.stamps || (n.stamps = /* @__PURE__ */ new Map());
    const o = m(this, Qs) ? (s.rect[2] - s.rect[0]) * (s.rect[3] - s.rect[1]) : null;
    if (!n.stamps.has(m(this, dn)))
      n.stamps.set(m(this, dn), {
        area: o,
        serialized: s
      }), s.bitmap = D(this, $e, o9).call(this, !1);
    else if (m(this, Qs)) {
      const l = n.stamps.get(m(this, dn));
      o > l.area && (l.area = o, l.serialized.bitmap.close(), l.serialized.bitmap = D(this, $e, o9).call(this, !1));
    }
    return s;
  }
  renderAnnotationElement(e) {
    return e.updateEdited({
      rect: this.getRect(0, 0)
    }), null;
  }
}
ui = new WeakMap(), dn = new WeakMap(), Wc = new WeakMap(), kl = new WeakMap(), Xc = new WeakMap(), Nd = new WeakMap(), Al = new WeakMap(), r1 = new WeakMap(), ao = new WeakMap(), Qs = new WeakMap(), Ld = new WeakMap(), $e = new WeakSet(), f2 = function(e, n = !1) {
  if (!e) {
    this.remove();
    return;
  }
  E(this, ui, e.bitmap), n || (E(this, dn, e.id), E(this, Qs, e.isSvg)), e.file && E(this, Nd, e.file.name), D(this, $e, r9).call(this);
}, p2 = function() {
  if (E(this, Wc, null), this._uiManager.enableWaiting(!1), !!m(this, Al)) {
    if (this._uiManager.useNewAltTextWhenAddingImage && this._uiManager.useNewAltTextFlow && m(this, ui)) {
      this._editToolbar.hide(), this._uiManager.editAltText(this, !0);
      return;
    }
    if (!this._uiManager.useNewAltTextWhenAddingImage && this._uiManager.useNewAltTextFlow && m(this, ui)) {
      this._reportTelemetry({
        action: "pdfjs.image.image_added",
        data: {
          alt_text_modal: !1,
          alt_text_type: "empty"
        }
      });
      try {
        this.mlGuessAltText();
      } catch {
      }
    }
    this.div.focus();
  }
}, s9 = function() {
  if (m(this, dn)) {
    this._uiManager.enableWaiting(!0), this._uiManager.imageManager.getFromId(m(this, dn)).then((s) => D(this, $e, f2).call(this, s, !0)).finally(() => D(this, $e, p2).call(this));
    return;
  }
  if (m(this, kl)) {
    const s = m(this, kl);
    E(this, kl, null), this._uiManager.enableWaiting(!0), E(this, Wc, this._uiManager.imageManager.getFromUrl(s).then((r) => D(this, $e, f2).call(this, r)).finally(() => D(this, $e, p2).call(this)));
    return;
  }
  if (m(this, Xc)) {
    const s = m(this, Xc);
    E(this, Xc, null), this._uiManager.enableWaiting(!0), E(this, Wc, this._uiManager.imageManager.getFromFile(s).then((r) => D(this, $e, f2).call(this, r)).finally(() => D(this, $e, p2).call(this)));
    return;
  }
  const e = document.createElement("input");
  e.type = "file", e.accept = L9.join(",");
  const n = this._uiManager._signal;
  E(this, Wc, new Promise((s) => {
    e.addEventListener("change", async () => {
      if (!e.files || e.files.length === 0)
        this.remove();
      else {
        this._uiManager.enableWaiting(!0);
        const r = await this._uiManager.imageManager.getFromFile(e.files[0]);
        this._reportTelemetry({
          action: "pdfjs.image.image_selected",
          data: {
            alt_text_modal: this._uiManager.useNewAltTextFlow
          }
        }), D(this, $e, f2).call(this, r);
      }
      s();
    }, {
      signal: n
    }), e.addEventListener("cancel", () => {
      this.remove(), s();
    }, {
      signal: n
    });
  }).finally(() => D(this, $e, p2).call(this))), e.click();
}, r9 = function() {
  var u;
  const {
    div: e
  } = this;
  let {
    width: n,
    height: s
  } = m(this, ui);
  const [r, a] = this.pageDimensions, o = 0.75;
  if (this.width)
    n = this.width * r, s = this.height * a;
  else if (n > o * r || s > o * a) {
    const f = Math.min(o * r / n, o * a / s);
    n *= f, s *= f;
  }
  const [l, c] = this.parentDimensions;
  this.setDims(n * l / r, s * c / a), this._uiManager.enableWaiting(!1);
  const h = E(this, Al, document.createElement("canvas"));
  h.setAttribute("role", "img"), this.addContainer(h), this.width = n / r, this.height = s / a, (u = this._initialOptions) != null && u.isCentered ? this.center() : this.fixAndSetPosition(), this._initialOptions = null, (!this._uiManager.useNewAltTextWhenAddingImage || !this._uiManager.useNewAltTextFlow || this.annotationElementId) && (e.hidden = !1), D(this, $e, I8).call(this), m(this, Ld) || (this.parent.addUndoableEditor(this), E(this, Ld, !0)), this._reportTelemetry({
    action: "inserted_image"
  }), m(this, Nd) && this.div.setAttribute("aria-description", m(this, Nd));
}, a9 = function(e, n) {
  const {
    width: s,
    height: r
  } = m(this, ui);
  let a = s, o = r, l = m(this, ui);
  for (; a > 2 * e || o > 2 * n; ) {
    const c = a, h = o;
    a > 2 * e && (a = a >= 16384 ? Math.floor(a / 2) - 1 : Math.ceil(a / 2)), o > 2 * n && (o = o >= 16384 ? Math.floor(o / 2) - 1 : Math.ceil(o / 2));
    const u = new OffscreenCanvas(a, o);
    u.getContext("2d").drawImage(l, 0, 0, c, h, 0, 0, a, o), l = u.transferToImageBitmap();
  }
  return l;
}, I8 = function() {
  const [e, n] = this.parentDimensions, {
    width: s,
    height: r
  } = this, a = new Ia(), o = Math.ceil(s * e * a.sx), l = Math.ceil(r * n * a.sy), c = m(this, Al);
  if (!c || c.width === o && c.height === l)
    return;
  c.width = o, c.height = l;
  const h = m(this, Qs) ? m(this, ui) : D(this, $e, a9).call(this, o, l), u = c.getContext("2d");
  u.filter = this._uiManager.hcmFilter, u.drawImage(h, 0, 0, h.width, h.height, 0, 0, o, l);
}, o9 = function(e) {
  if (e) {
    if (m(this, Qs)) {
      const r = this._uiManager.imageManager.getSvgUrl(m(this, dn));
      if (r)
        return r;
    }
    const n = document.createElement("canvas");
    return {
      width: n.width,
      height: n.height
    } = m(this, ui), n.getContext("2d").drawImage(m(this, ui), 0, 0), n.toDataURL();
  }
  if (m(this, Qs)) {
    const [n, s] = this.pageDimensions, r = Math.round(this.width * n * jl.PDF_TO_CSS_UNITS), a = Math.round(this.height * s * jl.PDF_TO_CSS_UNITS), o = new OffscreenCanvas(r, a);
    return o.getContext("2d").drawImage(m(this, ui), 0, 0, m(this, ui).width, m(this, ui).height, 0, 0, r, a), o.transferToImageBitmap();
  }
  return structuredClone(m(this, ui));
}, sE = function(e) {
  var o;
  const {
    pageIndex: n,
    accessibilityData: {
      altText: s
    }
  } = this._initialData, r = e.pageIndex === n, a = (((o = e.accessibilityData) == null ? void 0 : o.alt) || "") === s;
  return {
    isSame: !this._hasBeenMoved && !this._hasBeenResized && r && a,
    isSameAltText: a
  };
}, ft(F8, "_type", "stamp"), ft(F8, "_editorType", fe.STAMP);
var a1, Od, oo, Yc, Sl, Sr, Kc, $d, o1, ya, Cl, jn, El, Wt, Zc, fi, rE, Ha, M8, R8, l9;
const sa = class sa {
  constructor({
    uiManager: t,
    pageIndex: e,
    div: n,
    structTreeLayer: s,
    accessibilityManager: r,
    annotationLayer: a,
    drawLayer: o,
    textLayer: l,
    viewport: c,
    l10n: h
  }) {
    F(this, fi);
    F(this, a1);
    F(this, Od, !1);
    F(this, oo, null);
    F(this, Yc, null);
    F(this, Sl, null);
    F(this, Sr, /* @__PURE__ */ new Map());
    F(this, Kc, !1);
    F(this, $d, !1);
    F(this, o1, !1);
    F(this, ya, null);
    F(this, Cl, null);
    F(this, jn, null);
    F(this, El, null);
    F(this, Wt);
    const u = [...m(sa, Zc).values()];
    if (!sa._initialized) {
      sa._initialized = !0;
      for (const f of u)
        f.initialize(h, t);
    }
    t.registerEditorTypes(u), E(this, Wt, t), this.pageIndex = e, this.div = n, E(this, a1, r), E(this, oo, a), this.viewport = c, E(this, jn, l), this.drawLayer = o, this._structTree = s, m(this, Wt).addLayer(this);
  }
  get isEmpty() {
    return m(this, Sr).size === 0;
  }
  get isInvisible() {
    return this.isEmpty && m(this, Wt).getMode() === fe.NONE;
  }
  updateToolbar(t) {
    m(this, Wt).updateToolbar(t);
  }
  updateMode(t = m(this, Wt).getMode()) {
    switch (D(this, fi, l9).call(this), t) {
      case fe.NONE:
        this.disableTextSelection(), this.togglePointerEvents(!1), this.toggleAnnotationLayerPointerEvents(!0), this.disableClick();
        return;
      case fe.INK:
        this.disableTextSelection(), this.togglePointerEvents(!0), this.enableClick();
        break;
      case fe.HIGHLIGHT:
        this.enableTextSelection(), this.togglePointerEvents(!1), this.disableClick();
        break;
      default:
        this.disableTextSelection(), this.togglePointerEvents(!0), this.enableClick();
    }
    this.toggleAnnotationLayerPointerEvents(!1);
    const {
      classList: e
    } = this.div;
    for (const n of m(sa, Zc).values())
      e.toggle(`${n._type}Editing`, t === n._editorType);
    this.div.hidden = !1;
  }
  hasTextLayer(t) {
    var e;
    return t === ((e = m(this, jn)) == null ? void 0 : e.div);
  }
  setEditingState(t) {
    m(this, Wt).setEditingState(t);
  }
  addCommands(t) {
    m(this, Wt).addCommands(t);
  }
  cleanUndoStack(t) {
    m(this, Wt).cleanUndoStack(t);
  }
  toggleDrawing(t = !1) {
    this.div.classList.toggle("drawing", !t);
  }
  togglePointerEvents(t = !1) {
    this.div.classList.toggle("disabled", !t);
  }
  toggleAnnotationLayerPointerEvents(t = !1) {
    var e;
    (e = m(this, oo)) == null || e.div.classList.toggle("disabled", !t);
  }
  async enable() {
    E(this, o1, !0), this.div.tabIndex = 0, this.togglePointerEvents(!0);
    const t = /* @__PURE__ */ new Set();
    for (const n of m(this, Sr).values())
      n.enableEditing(), n.show(!0), n.annotationElementId && (m(this, Wt).removeChangedExistingAnnotation(n), t.add(n.annotationElementId));
    if (!m(this, oo)) {
      E(this, o1, !1);
      return;
    }
    const e = m(this, oo).getEditableAnnotations();
    for (const n of e) {
      if (n.hide(), m(this, Wt).isDeletedAnnotationElement(n.data.id) || t.has(n.data.id))
        continue;
      const s = await this.deserialize(n);
      s && (this.addOrRebuild(s), s.enableEditing());
    }
    E(this, o1, !1);
  }
  disable() {
    var s;
    E(this, $d, !0), this.div.tabIndex = -1, this.togglePointerEvents(!1);
    const t = /* @__PURE__ */ new Map(), e = /* @__PURE__ */ new Map();
    for (const r of m(this, Sr).values())
      if (r.disableEditing(), !!r.annotationElementId) {
        if (r.serialize() !== null) {
          t.set(r.annotationElementId, r);
          continue;
        } else
          e.set(r.annotationElementId, r);
        (s = this.getEditableAnnotation(r.annotationElementId)) == null || s.show(), r.remove();
      }
    if (m(this, oo)) {
      const r = m(this, oo).getEditableAnnotations();
      for (const a of r) {
        const {
          id: o
        } = a.data;
        if (m(this, Wt).isDeletedAnnotationElement(o))
          continue;
        let l = e.get(o);
        if (l) {
          l.resetAnnotationElement(a), l.show(!1), a.show();
          continue;
        }
        l = t.get(o), l && (m(this, Wt).addChangedExistingAnnotation(l), l.renderAnnotationElement(a) && l.show(!1)), a.show();
      }
    }
    D(this, fi, l9).call(this), this.isEmpty && (this.div.hidden = !0);
    const {
      classList: n
    } = this.div;
    for (const r of m(sa, Zc).values())
      n.remove(`${r._type}Editing`);
    this.disableTextSelection(), this.toggleAnnotationLayerPointerEvents(!0), E(this, $d, !1);
  }
  getEditableAnnotation(t) {
    var e;
    return ((e = m(this, oo)) == null ? void 0 : e.getEditableAnnotation(t)) || null;
  }
  setActiveEditor(t) {
    m(this, Wt).getActive() !== t && m(this, Wt).setActiveEditor(t);
  }
  enableTextSelection() {
    var t;
    if (this.div.tabIndex = -1, (t = m(this, jn)) != null && t.div && !m(this, El)) {
      E(this, El, new AbortController());
      const e = m(this, Wt).combinedSignal(m(this, El));
      m(this, jn).div.addEventListener("pointerdown", D(this, fi, rE).bind(this), {
        signal: e
      }), m(this, jn).div.classList.add("highlighting");
    }
  }
  disableTextSelection() {
    var t;
    this.div.tabIndex = 0, (t = m(this, jn)) != null && t.div && m(this, El) && (m(this, El).abort(), E(this, El, null), m(this, jn).div.classList.remove("highlighting"));
  }
  enableClick() {
    if (m(this, Yc))
      return;
    E(this, Yc, new AbortController());
    const t = m(this, Wt).combinedSignal(m(this, Yc));
    this.div.addEventListener("pointerdown", this.pointerdown.bind(this), {
      signal: t
    });
    const e = this.pointerup.bind(this);
    this.div.addEventListener("pointerup", e, {
      signal: t
    }), this.div.addEventListener("pointercancel", e, {
      signal: t
    });
  }
  disableClick() {
    var t;
    (t = m(this, Yc)) == null || t.abort(), E(this, Yc, null);
  }
  attach(t) {
    m(this, Sr).set(t.id, t);
    const {
      annotationElementId: e
    } = t;
    e && m(this, Wt).isDeletedAnnotationElement(e) && m(this, Wt).removeDeletedAnnotationElement(t);
  }
  detach(t) {
    var e;
    m(this, Sr).delete(t.id), (e = m(this, a1)) == null || e.removePointerInTextLayer(t.contentDiv), !m(this, $d) && t.annotationElementId && m(this, Wt).addDeletedAnnotationElement(t);
  }
  remove(t) {
    this.detach(t), m(this, Wt).removeEditor(t), t.div.remove(), t.isAttachedToDOM = !1;
  }
  changeParent(t) {
    var e;
    t.parent !== this && (t.parent && t.annotationElementId && (m(this, Wt).addDeletedAnnotationElement(t.annotationElementId), si.deleteAnnotationElement(t), t.annotationElementId = null), this.attach(t), (e = t.parent) == null || e.detach(t), t.setParent(this), t.div && t.isAttachedToDOM && (t.div.remove(), this.div.append(t.div)));
  }
  add(t) {
    if (!(t.parent === this && t.isAttachedToDOM)) {
      if (this.changeParent(t), m(this, Wt).addEditor(t), this.attach(t), !t.isAttachedToDOM) {
        const e = t.render();
        this.div.append(e), t.isAttachedToDOM = !0;
      }
      t.fixAndSetPosition(), t.onceAdded(!m(this, o1)), m(this, Wt).addToAnnotationStorage(t), t._reportTelemetry(t.telemetryInitialData);
    }
  }
  moveEditorInDOM(t) {
    var n;
    if (!t.isAttachedToDOM)
      return;
    const {
      activeElement: e
    } = document;
    t.div.contains(e) && !m(this, Sl) && (t._focusEventsAllowed = !1, E(this, Sl, setTimeout(() => {
      E(this, Sl, null), t.div.contains(document.activeElement) ? t._focusEventsAllowed = !0 : (t.div.addEventListener("focusin", () => {
        t._focusEventsAllowed = !0;
      }, {
        once: !0,
        signal: m(this, Wt)._signal
      }), e.focus());
    }, 0))), t._structTreeParentId = (n = m(this, a1)) == null ? void 0 : n.moveElementInDOM(this.div, t.div, t.contentDiv, !0);
  }
  addOrRebuild(t) {
    t.needsToBeRebuilt() ? (t.parent || (t.parent = this), t.rebuild(), t.show()) : this.add(t);
  }
  addUndoableEditor(t) {
    const e = () => t._uiManager.rebuild(t), n = () => {
      t.remove();
    };
    this.addCommands({
      cmd: e,
      undo: n,
      mustExec: !1
    });
  }
  getNextId() {
    return m(this, Wt).getId();
  }
  combinedSignal(t) {
    return m(this, Wt).combinedSignal(t);
  }
  canCreateNewEmptyEditor() {
    var t;
    return (t = m(this, fi, Ha)) == null ? void 0 : t.canCreateNewEmptyEditor();
  }
  async pasteEditor(t, e) {
    this.updateToolbar(t), await m(this, Wt).updateMode(t.mode);
    const {
      offsetX: n,
      offsetY: s
    } = D(this, fi, R8).call(this), r = this.getNextId(), a = D(this, fi, M8).call(this, {
      parent: this,
      id: r,
      x: n,
      y: s,
      uiManager: m(this, Wt),
      isCentered: !0,
      ...e
    });
    a && this.add(a);
  }
  async deserialize(t) {
    var e;
    return await ((e = m(sa, Zc).get(t.annotationType ?? t.annotationEditorType)) == null ? void 0 : e.deserialize(t, this, m(this, Wt))) || null;
  }
  createAndAddNewEditor(t, e, n = {}) {
    const s = this.getNextId(), r = D(this, fi, M8).call(this, {
      parent: this,
      id: s,
      x: t.offsetX,
      y: t.offsetY,
      uiManager: m(this, Wt),
      isCentered: e,
      ...n
    });
    return r && this.add(r), r;
  }
  addNewEditor(t = {}) {
    this.createAndAddNewEditor(D(this, fi, R8).call(this), !0, t);
  }
  setSelected(t) {
    m(this, Wt).setSelected(t);
  }
  toggleSelected(t) {
    m(this, Wt).toggleSelected(t);
  }
  unselect(t) {
    m(this, Wt).unselect(t);
  }
  pointerup(t) {
    var s;
    const {
      isMac: e
    } = gn.platform;
    if (t.button !== 0 || t.ctrlKey && e || t.target !== this.div || !m(this, Kc) || (E(this, Kc, !1), (s = m(this, fi, Ha)) != null && s.isDrawer && m(this, fi, Ha).supportMultipleDrawings))
      return;
    if (!m(this, Od)) {
      E(this, Od, !0);
      return;
    }
    const n = m(this, Wt).getMode();
    if (n === fe.STAMP || n === fe.SIGNATURE) {
      m(this, Wt).unselectAll();
      return;
    }
    this.createAndAddNewEditor(t, !1);
  }
  pointerdown(t) {
    var s;
    if (m(this, Wt).getMode() === fe.HIGHLIGHT && this.enableTextSelection(), m(this, Kc)) {
      E(this, Kc, !1);
      return;
    }
    const {
      isMac: e
    } = gn.platform;
    if (t.button !== 0 || t.ctrlKey && e || t.target !== this.div)
      return;
    if (E(this, Kc, !0), (s = m(this, fi, Ha)) != null && s.isDrawer) {
      this.startDrawingSession(t);
      return;
    }
    const n = m(this, Wt).getActive();
    E(this, Od, !n || n.isEmpty());
  }
  startDrawingSession(t) {
    if (this.div.focus({
      preventScroll: !0
    }), m(this, ya)) {
      m(this, fi, Ha).startDrawing(this, m(this, Wt), !1, t);
      return;
    }
    m(this, Wt).setCurrentDrawingSession(this), E(this, ya, new AbortController());
    const e = m(this, Wt).combinedSignal(m(this, ya));
    this.div.addEventListener("blur", ({
      relatedTarget: n
    }) => {
      n && !this.div.contains(n) && (E(this, Cl, null), this.commitOrRemove());
    }, {
      signal: e
    }), m(this, fi, Ha).startDrawing(this, m(this, Wt), !1, t);
  }
  pause(t) {
    if (t) {
      const {
        activeElement: e
      } = document;
      this.div.contains(e) && E(this, Cl, e);
      return;
    }
    m(this, Cl) && setTimeout(() => {
      var e;
      (e = m(this, Cl)) == null || e.focus(), E(this, Cl, null);
    }, 0);
  }
  endDrawingSession(t = !1) {
    return m(this, ya) ? (m(this, Wt).setCurrentDrawingSession(null), m(this, ya).abort(), E(this, ya, null), E(this, Cl, null), m(this, fi, Ha).endDrawing(t)) : null;
  }
  findNewParent(t, e, n) {
    const s = m(this, Wt).findParent(e, n);
    return s === null || s === this ? !1 : (s.changeParent(t), !0);
  }
  commitOrRemove() {
    return m(this, ya) ? (this.endDrawingSession(), !0) : !1;
  }
  onScaleChanging() {
    m(this, ya) && m(this, fi, Ha).onScaleChangingWhenDrawing(this);
  }
  destroy() {
    var t, e;
    this.commitOrRemove(), ((t = m(this, Wt).getActive()) == null ? void 0 : t.parent) === this && (m(this, Wt).commitOrRemove(), m(this, Wt).setActiveEditor(null)), m(this, Sl) && (clearTimeout(m(this, Sl)), E(this, Sl, null));
    for (const n of m(this, Sr).values())
      (e = m(this, a1)) == null || e.removePointerInTextLayer(n.contentDiv), n.setParent(null), n.isAttachedToDOM = !1, n.div.remove();
    this.div = null, m(this, Sr).clear(), m(this, Wt).removeLayer(this);
  }
  render({
    viewport: t
  }) {
    this.viewport = t, h0(this.div, t);
    for (const e of m(this, Wt).getEditors(this.pageIndex))
      this.add(e), e.rebuild();
    this.updateMode();
  }
  update({
    viewport: t
  }) {
    m(this, Wt).commitOrRemove(), D(this, fi, l9).call(this);
    const e = this.viewport.rotation, n = t.rotation;
    if (this.viewport = t, h0(this.div, {
      rotation: n
    }), e !== n)
      for (const s of m(this, Sr).values())
        s.rotate(n);
  }
  get pageDimensions() {
    const {
      pageWidth: t,
      pageHeight: e
    } = this.viewport.rawDims;
    return [t, e];
  }
  get scale() {
    return m(this, Wt).viewParameters.realScale;
  }
};
a1 = new WeakMap(), Od = new WeakMap(), oo = new WeakMap(), Yc = new WeakMap(), Sl = new WeakMap(), Sr = new WeakMap(), Kc = new WeakMap(), $d = new WeakMap(), o1 = new WeakMap(), ya = new WeakMap(), Cl = new WeakMap(), jn = new WeakMap(), El = new WeakMap(), Wt = new WeakMap(), Zc = new WeakMap(), fi = new WeakSet(), rE = function(t) {
  m(this, Wt).unselectAll();
  const {
    target: e
  } = t;
  if (e === m(this, jn).div || (e.getAttribute("role") === "img" || e.classList.contains("endOfContent")) && m(this, jn).div.contains(e)) {
    const {
      isMac: n
    } = gn.platform;
    if (t.button !== 0 || t.ctrlKey && n)
      return;
    m(this, Wt).showAllEditors("highlight", !0, !0), m(this, jn).div.classList.add("free"), this.toggleDrawing(), z9.startHighlighting(this, m(this, Wt).direction === "ltr", {
      target: m(this, jn).div,
      x: t.x,
      y: t.y
    }), m(this, jn).div.addEventListener("pointerup", () => {
      m(this, jn).div.classList.remove("free"), this.toggleDrawing(!0);
    }, {
      once: !0,
      signal: m(this, Wt)._signal
    }), t.preventDefault();
  }
}, Ha = function() {
  return m(sa, Zc).get(m(this, Wt).getMode());
}, M8 = function(t) {
  const e = m(this, fi, Ha);
  return e ? new e.prototype.constructor(t) : null;
}, R8 = function() {
  const {
    x: t,
    y: e,
    width: n,
    height: s
  } = this.div.getBoundingClientRect(), r = Math.max(0, t), a = Math.max(0, e), o = Math.min(window.innerWidth, t + n), l = Math.min(window.innerHeight, e + s), c = (r + o) / 2 - t, h = (a + l) / 2 - e, [u, f] = this.viewport.rotation % 180 === 0 ? [c, h] : [h, c];
  return {
    offsetX: u,
    offsetY: f
  };
}, l9 = function() {
  for (const t of m(this, Sr).values())
    t.isEmpty() && t.remove();
}, ft(sa, "_initialized", !1), F(sa, Zc, new Map([h8, k8, F8, z9, T8].map((t) => [t._editorType, t])));
let H9 = sa;
var wa, as, l1, Ym, o4, aE, Mo, B8, oE, P8;
const Qi = class Qi {
  constructor({
    pageIndex: t
  }) {
    F(this, Mo);
    F(this, wa, null);
    F(this, as, /* @__PURE__ */ new Map());
    F(this, l1, /* @__PURE__ */ new Map());
    this.pageIndex = t;
  }
  setParent(t) {
    if (!m(this, wa)) {
      E(this, wa, t);
      return;
    }
    if (m(this, wa) !== t) {
      if (m(this, as).size > 0)
        for (const e of m(this, as).values())
          e.remove(), t.append(e);
      E(this, wa, t);
    }
  }
  static get _svgFactory() {
    return Fe(this, "_svgFactory", new Q2());
  }
  draw(t, e = !1, n = !1) {
    const s = Zn(Qi, Ym)._++, r = D(this, Mo, B8).call(this), a = Qi._svgFactory.createElement("defs");
    r.append(a);
    const o = Qi._svgFactory.createElement("path");
    a.append(o);
    const l = `path_p${this.pageIndex}_${s}`;
    o.setAttribute("id", l), o.setAttribute("vector-effect", "non-scaling-stroke"), e && m(this, l1).set(s, o);
    const c = n ? D(this, Mo, oE).call(this, a, l) : null, h = Qi._svgFactory.createElement("use");
    return r.append(h), h.setAttribute("href", `#${l}`), this.updateProperties(r, t), m(this, as).set(s, r), {
      id: s,
      clipPathId: `url(#${c})`
    };
  }
  drawOutline(t, e) {
    const n = Zn(Qi, Ym)._++, s = D(this, Mo, B8).call(this), r = Qi._svgFactory.createElement("defs");
    s.append(r);
    const a = Qi._svgFactory.createElement("path");
    r.append(a);
    const o = `path_p${this.pageIndex}_${n}`;
    a.setAttribute("id", o), a.setAttribute("vector-effect", "non-scaling-stroke");
    let l;
    if (e) {
      const u = Qi._svgFactory.createElement("mask");
      r.append(u), l = `mask_p${this.pageIndex}_${n}`, u.setAttribute("id", l), u.setAttribute("maskUnits", "objectBoundingBox");
      const f = Qi._svgFactory.createElement("rect");
      u.append(f), f.setAttribute("width", "1"), f.setAttribute("height", "1"), f.setAttribute("fill", "white");
      const d = Qi._svgFactory.createElement("use");
      u.append(d), d.setAttribute("href", `#${o}`), d.setAttribute("stroke", "none"), d.setAttribute("fill", "black"), d.setAttribute("fill-rule", "nonzero"), d.classList.add("mask");
    }
    const c = Qi._svgFactory.createElement("use");
    s.append(c), c.setAttribute("href", `#${o}`), l && c.setAttribute("mask", `url(#${l})`);
    const h = c.cloneNode();
    return s.append(h), c.classList.add("mainOutline"), h.classList.add("secondaryOutline"), this.updateProperties(s, t), m(this, as).set(n, s), n;
  }
  finalizeDraw(t, e) {
    m(this, l1).delete(t), this.updateProperties(t, e);
  }
  updateProperties(t, e) {
    var l;
    if (!e)
      return;
    const {
      root: n,
      bbox: s,
      rootClass: r,
      path: a
    } = e, o = typeof t == "number" ? m(this, as).get(t) : t;
    if (o) {
      if (n && D(this, Mo, P8).call(this, o, n), s && D(l = Qi, o4, aE).call(l, o, s), r) {
        const {
          classList: c
        } = o;
        for (const [h, u] of Object.entries(r))
          c.toggle(h, u);
      }
      if (a) {
        const h = o.firstChild.firstChild;
        D(this, Mo, P8).call(this, h, a);
      }
    }
  }
  updateParent(t, e) {
    if (e === this)
      return;
    const n = m(this, as).get(t);
    n && (m(e, wa).append(n), m(this, as).delete(t), m(e, as).set(t, n));
  }
  remove(t) {
    m(this, l1).delete(t), m(this, wa) !== null && (m(this, as).get(t).remove(), m(this, as).delete(t));
  }
  destroy() {
    E(this, wa, null);
    for (const t of m(this, as).values())
      t.remove();
    m(this, as).clear(), m(this, l1).clear();
  }
};
wa = new WeakMap(), as = new WeakMap(), l1 = new WeakMap(), Ym = new WeakMap(), o4 = new WeakSet(), aE = function(t, [e, n, s, r]) {
  const {
    style: a
  } = t;
  a.top = `${100 * n}%`, a.left = `${100 * e}%`, a.width = `${100 * s}%`, a.height = `${100 * r}%`;
}, Mo = new WeakSet(), B8 = function() {
  const t = Qi._svgFactory.create(1, 1, !0);
  return m(this, wa).append(t), t.setAttribute("aria-hidden", !0), t;
}, oE = function(t, e) {
  const n = Qi._svgFactory.createElement("clipPath");
  t.append(n);
  const s = `clip_${e}`;
  n.setAttribute("id", s), n.setAttribute("clipPathUnits", "objectBoundingBox");
  const r = Qi._svgFactory.createElement("use");
  return n.append(r), r.setAttribute("href", `#${e}`), r.classList.add("clip"), s;
}, P8 = function(t, e) {
  for (const [n, s] of Object.entries(e))
    s === null ? t.removeAttribute(n) : t.setAttribute(n, s);
}, F(Qi, o4), F(Qi, Ym, 0);
let j9 = Qi;
globalThis._pdfjsTestingUtils = {
  HighlightOutliner: d8
};
globalThis.pdfjsLib = {
  AbortException: Hl,
  AnnotationEditorLayer: H9,
  AnnotationEditorParamsType: Ie,
  AnnotationEditorType: fe,
  AnnotationEditorUIManager: u0,
  AnnotationLayer: $9,
  AnnotationMode: Dl,
  AnnotationType: Bi,
  build: oC,
  ColorPicker: tp,
  createValidAbsoluteUrl: Ay,
  DOMSVGFactory: Q2,
  DrawLayer: j9,
  FeatureTest: gn,
  fetchData: ff,
  getDocument: E4,
  getFilenameFromUrl: tS,
  getPdfFilenameFromUrl: eS,
  getUuid: Cy,
  getXfaPageViewport: iS,
  GlobalWorkerOptions: Ir,
  ImageKind: C2,
  InvalidPDFException: N9,
  isDataScheme: bg,
  isPdfFile: A4,
  isValidExplicitDest: LS,
  MathClamp: Gn,
  noContextMenu: Gr,
  normalizeUnicode: JA,
  OPS: Y2,
  OutputScale: Ia,
  PasswordResponses: KA,
  PDFDataRangeTransport: My,
  PDFDateString: S4,
  PDFWorker: Kd,
  PermissionFlag: YA,
  PixelsPerInch: jl,
  RenderingCancelledException: k4,
  ResponseException: K2,
  setLayerDimensions: h0,
  shadow: Fe,
  SignatureExtractor: mo,
  stopEvent: Oi,
  SupportedImageMimeTypes: L9,
  TextLayer: Yd,
  TouchManager: Z2,
  updateUrlHash: Sy,
  Util: Zt,
  VerbosityLevel: pg,
  version: aC,
  XfaLayer: Ry
};
const lE = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  AbortException: Hl,
  AnnotationEditorLayer: H9,
  AnnotationEditorParamsType: Ie,
  AnnotationEditorType: fe,
  AnnotationEditorUIManager: u0,
  AnnotationLayer: $9,
  AnnotationMode: Dl,
  AnnotationType: Bi,
  ColorPicker: tp,
  DOMSVGFactory: Q2,
  DrawLayer: j9,
  FeatureTest: gn,
  GlobalWorkerOptions: Ir,
  ImageKind: C2,
  InvalidPDFException: N9,
  MathClamp: Gn,
  OPS: Y2,
  OutputScale: Ia,
  PDFDataRangeTransport: My,
  PDFDateString: S4,
  PDFWorker: Kd,
  PasswordResponses: KA,
  PermissionFlag: YA,
  PixelsPerInch: jl,
  RenderingCancelledException: k4,
  ResponseException: K2,
  SignatureExtractor: mo,
  SupportedImageMimeTypes: L9,
  TextLayer: Yd,
  TouchManager: Z2,
  Util: Zt,
  VerbosityLevel: pg,
  XfaLayer: Ry,
  build: oC,
  createValidAbsoluteUrl: Ay,
  fetchData: ff,
  getDocument: E4,
  getFilenameFromUrl: tS,
  getPdfFilenameFromUrl: eS,
  getUuid: Cy,
  getXfaPageViewport: iS,
  isDataScheme: bg,
  isPdfFile: A4,
  isValidExplicitDest: LS,
  noContextMenu: Gr,
  normalizeUnicode: JA,
  setLayerDimensions: h0,
  shadow: Fe,
  stopEvent: Oi,
  updateUrlHash: Sy,
  version: aC
}, Symbol.toStringTag, { value: "Module" })), kR = !(typeof process != "object" || process + "" != "[object process]" || process.versions.nw || process.versions.electron && process.type && process.type !== "browser"), f1 = [1e-3, 0, 0, 1e-3, 0, 0], p1 = 1.35, Hv = 0.35, jv = 0.25925925925925924, Gv = 1, G9 = 2, Vv = 4, Wv = 8, cE = 16, AR = 64, SR = 128, CR = 256, hE = "pdfjs_internal_editor_", Xv = 3, Yv = 9, Kv = 13, Zv = 15, Jv = 101, Qv = { PRINT: 4, MODIFY_CONTENTS: 8, COPY: 16, MODIFY_ANNOTATIONS: 32, FILL_INTERACTIVE_FORMS: 256, COPY_FOR_ACCESSIBILITY: 512, ASSEMBLE: 1024, PRINT_HIGH_QUALITY: 2048 }, ER = 0, DR = 4, V9 = 1, E2 = 2, Zo = 3, TR = 1, FR = 2, IR = 3, MR = 4, RR = 5, BR = 6, PR = 7, NR = 8, LR = 9, OR = 10, $R = 11, qR = 12, zR = 13, UR = 14, HR = 15, jR = 16, GR = 17, VR = 20, uE = "Group", WR = "R", Wg = 1, V0 = 2, q1 = 4, XR = 16, D2 = 32, YR = 128, KR = 512, ZR = 1, JR = 2, QR = 4096, tB = 8192, eB = 32768, iB = 65536, nB = 131072, sB = 1048576, rB = 2097152, aB = 8388608, oB = 16777216, t_ = 1, lB = 2, cB = 3, hB = 4, uB = 5, dE = { 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" }, dB = { WC: "WillClose", WS: "WillSave", DS: "DidSave", WP: "WillPrint", DP: "DidPrint" }, fB = { O: "PageOpen", C: "PageClose" }, fE = 1, N8 = 5, pB = 1, pE = 2, mB = 3, gB = 4, bB = 5, yB = 6, mE = 7, wB = 8, eh = 9, Ma = 10, Ms = 11, Gl = 12, W9 = 13, L8 = 14, O8 = 15, $8 = 16, q8 = 17, z8 = 18, U8 = 19, Ly = 20, X9 = 21, H8 = 22, gE = 23, Oy = 24, $y = 25, Y9 = 26, K9 = 27, j8 = 28, vB = 29, _B = 30, Z9 = 31, J9 = 32, G8 = 33, V8 = 34, bE = 35, yE = 36, o0 = 37, wE = 38, vE = 39, _E = 40, xE = 41, x1 = 42, c9 = 43, Tl = 44, Q9 = 45, t3 = 46, e3 = 47, kE = 48, W8 = 49, qy = 50, T4 = 51, zy = 52, i3 = 53, F4 = 54, n3 = 55, Uy = 56, xg = 57, oc = 58, co = 59, Hy = 60, kg = 61, s3 = 62, xB = 63, kB = 64, AE = 65, X8 = 66, SE = 67, CE = 68, EE = 69, ho = 70, Zd = 71, DE = 72, TE = 73, FE = 74, AB = 75, SB = 76, CB = 77, IE = 80, ME = 81, Jd = 83, EB = 84, Y8 = 85, r3 = 86, RE = 87, DB = 88, TB = 89, FB = 90, m1 = 91, IB = 92, MB = 93, RB = 94, m2 = 0, L0 = 1, h9 = 2, Xg = 3, BB = 1, PB = 2;
let I4 = fE;
function NB() {
  return I4;
}
function ue(i) {
  I4 >= N8 && console.log(`Info: ${i}`);
}
function H(i) {
  I4 >= fE && console.log(`Warning: ${i}`);
}
function ye(i) {
  throw new Error(i);
}
function pn(i, t) {
  i || ye(t);
}
function a3(i, t = null, e = null) {
  if (!i) return null;
  if (e && typeof i == "string") {
    if (e.addDefaultProtocol && i.startsWith("www.")) {
      const s = i.match(/\./g);
      (s == null ? void 0 : s.length) >= 2 && (i = `http://${i}`);
    }
    if (e.tryConvertEncoding) try {
      i = np(i);
    } catch {
    }
  }
  const n = t ? URL.parse(i, t) : URL.parse(i);
  return function(r) {
    switch (r == null ? void 0 : r.protocol) {
      case "http:":
      case "https:":
      case "ftp:":
      case "mailto:":
      case "tel:":
        return !0;
      default:
        return !1;
    }
  }(n) ? n : null;
}
function At(i, t, e, n = !1) {
  return Object.defineProperty(i, t, { value: e, enumerable: !n, configurable: !0, writable: !1 }), e;
}
const bs = function() {
  function t(e, n) {
    this.message = e, this.name = n;
  }
  return t.prototype = new Error(), t.constructor = t, t;
}();
class ep extends bs {
  constructor(t, e) {
    super(t, "PasswordException"), this.code = e;
  }
}
class p6 extends bs {
  constructor(t, e) {
    super(t, "UnknownErrorException"), this.details = e;
  }
}
class ip extends bs {
  constructor(t) {
    super(t, "InvalidPDFException");
  }
}
class e_ extends bs {
  constructor(t, e, n) {
    super(t, "ResponseException"), this.status = e, this.missing = n;
  }
}
class ht extends bs {
  constructor(t) {
    super(t, "FormatError");
  }
}
class xn extends bs {
  constructor(t) {
    super(t, "AbortException");
  }
}
function Is(i) {
  typeof i == "object" && (i == null ? void 0 : i.length) !== void 0 || ye("Invalid argument for bytesToString");
  const t = i.length, e = 8192;
  if (t < e) return String.fromCharCode.apply(null, i);
  const n = [];
  for (let s = 0; s < t; s += e) {
    const r = Math.min(s + e, t), a = i.subarray(s, r);
    n.push(String.fromCharCode.apply(null, a));
  }
  return n.join("");
}
function Dn(i) {
  typeof i != "string" && ye("Invalid argument for stringToBytes");
  const t = i.length, e = new Uint8Array(t);
  for (let n = 0; n < t; ++n) e[n] = 255 & i.charCodeAt(n);
  return e;
}
function An(i) {
  return String.fromCharCode(i >> 24 & 255, i >> 16 & 255, i >> 8 & 255, 255 & i);
}
function jy(i) {
  return Object.keys(i).length;
}
class Rs {
  static get isLittleEndian() {
    return At(this, "isLittleEndian", function() {
      const e = new Uint8Array(4);
      return e[0] = 1, new Uint32Array(e.buffer, 0, 1)[0] === 1;
    }());
  }
  static get isEvalSupported() {
    return At(this, "isEvalSupported", function() {
      try {
        return new Function(""), !0;
      } catch {
        return !1;
      }
    }());
  }
  static get isOffscreenCanvasSupported() {
    return At(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
  }
  static get isImageDecoderSupported() {
    return At(this, "isImageDecoderSupported", typeof ImageDecoder < "u");
  }
  static get platform() {
    const { platform: t, userAgent: e } = navigator;
    return At(this, "platform", { isAndroid: e.includes("Android"), isLinux: t.includes("Linux"), isMac: t.includes("Mac"), isWindows: t.includes("Win"), isFirefox: e.includes("Firefox") });
  }
  static get isCSSRoundSupported() {
    var t, e;
    return At(this, "isCSSRoundSupported", (e = (t = globalThis.CSS) == null ? void 0 : t.supports) == null ? void 0 : e.call(t, "width: round(1.5px, 1px)"));
  }
}
const Su = Array.from(Array(256).keys(), (i) => i.toString(16).padStart(2, "0"));
var Ul, u9, K8;
class Ee {
  static makeHexColor(t, e, n) {
    return `#${Su[t]}${Su[e]}${Su[n]}`;
  }
  static scaleMinMax(t, e) {
    let n;
    t[0] ? (t[0] < 0 && (n = e[0], e[0] = e[2], e[2] = n), e[0] *= t[0], e[2] *= t[0], t[3] < 0 && (n = e[1], e[1] = e[3], e[3] = n), e[1] *= t[3], e[3] *= t[3]) : (n = e[0], e[0] = e[1], e[1] = n, n = e[2], e[2] = e[3], e[3] = n, t[1] < 0 && (n = e[1], e[1] = e[3], e[3] = n), e[1] *= t[1], e[3] *= t[1], t[2] < 0 && (n = e[0], e[0] = e[2], e[2] = n), e[0] *= t[2], e[2] *= t[2]), e[0] += t[4], e[1] += t[5], e[2] += t[4], e[3] += t[5];
  }
  static transform(t, e) {
    return [t[0] * e[0] + t[2] * e[1], t[1] * e[0] + t[3] * e[1], t[0] * e[2] + t[2] * e[3], t[1] * e[2] + t[3] * e[3], t[0] * e[4] + t[2] * e[5] + t[4], t[1] * e[4] + t[3] * e[5] + t[5]];
  }
  static applyTransform(t, e, n = 0) {
    const s = t[n], r = t[n + 1];
    t[n] = s * e[0] + r * e[2] + e[4], t[n + 1] = s * e[1] + r * e[3] + e[5];
  }
  static applyTransformToBezier(t, e, n = 0) {
    const s = e[0], r = e[1], a = e[2], o = e[3], l = e[4], c = e[5];
    for (let h = 0; h < 6; h += 2) {
      const u = t[n + h], f = t[n + h + 1];
      t[n + h] = u * s + f * a + l, t[n + h + 1] = u * r + f * o + c;
    }
  }
  static applyInverseTransform(t, e) {
    const n = t[0], s = t[1], r = e[0] * e[3] - e[1] * e[2];
    t[0] = (n * e[3] - s * e[2] + e[2] * e[5] - e[4] * e[3]) / r, t[1] = (-n * e[1] + s * e[0] + e[4] * e[1] - e[5] * e[0]) / r;
  }
  static axialAlignedBoundingBox(t, e, n) {
    const s = e[0], r = e[1], a = e[2], o = e[3], l = e[4], c = e[5], h = t[0], u = t[1], f = t[2], d = t[3];
    let p = s * h + l, g = p, b = s * f + l, y = b, v = o * u + c, w = v, _ = o * d + c, x = _;
    if (r !== 0 || a !== 0) {
      const k = r * h, S = r * f, T = a * u, I = a * d;
      p += T, y += T, b += I, g += I, v += k, x += k, _ += S, w += S;
    }
    n[0] = Math.min(n[0], p, b, g, y), n[1] = Math.min(n[1], v, _, w, x), n[2] = Math.max(n[2], p, b, g, y), n[3] = Math.max(n[3], v, _, w, x);
  }
  static inverseTransform(t) {
    const e = t[0] * t[3] - t[1] * t[2];
    return [t[3] / e, -t[1] / e, -t[2] / e, t[0] / e, (t[2] * t[5] - t[4] * t[3]) / e, (t[4] * t[1] - t[5] * t[0]) / e];
  }
  static singularValueDecompose2dScale(t, e) {
    const n = t[0], s = t[1], r = t[2], a = t[3], o = n ** 2 + s ** 2, l = n * r + s * a, c = r ** 2 + a ** 2, h = (o + c) / 2, u = Math.sqrt(h ** 2 - (o * c - l ** 2));
    e[0] = Math.sqrt(h + u || 1), e[1] = Math.sqrt(h - u || 1);
  }
  static normalizeRect(t) {
    const e = t.slice(0);
    return t[0] > t[2] && (e[0] = t[2], e[2] = t[0]), t[1] > t[3] && (e[1] = t[3], e[3] = t[1]), e;
  }
  static intersect(t, e) {
    const n = Math.max(Math.min(t[0], t[2]), Math.min(e[0], e[2])), s = Math.min(Math.max(t[0], t[2]), Math.max(e[0], e[2]));
    if (n > s) return null;
    const r = Math.max(Math.min(t[1], t[3]), Math.min(e[1], e[3])), a = Math.min(Math.max(t[1], t[3]), Math.max(e[1], e[3]));
    return r > a ? null : [n, r, s, a];
  }
  static pointBoundingBox(t, e, n) {
    n[0] = Math.min(n[0], t), n[1] = Math.min(n[1], e), n[2] = Math.max(n[2], t), n[3] = Math.max(n[3], e);
  }
  static rectBoundingBox(t, e, n, s, r) {
    r[0] = Math.min(r[0], t, n), r[1] = Math.min(r[1], e, s), r[2] = Math.max(r[2], t, n), r[3] = Math.max(r[3], e, s);
  }
  static bezierBoundingBox(t, e, n, s, r, a, o, l, c) {
    c[0] = Math.min(c[0], t, o), c[1] = Math.min(c[1], e, l), c[2] = Math.max(c[2], t, o), c[3] = Math.max(c[3], e, l), D(this, Ul, K8).call(this, t, n, r, o, e, s, a, l, 3 * (3 * (n - r) - t + o), 6 * (t - 2 * n + r), 3 * (n - t), c), D(this, Ul, K8).call(this, t, n, r, o, e, s, a, l, 3 * (3 * (s - a) - e + l), 6 * (e - 2 * s + a), 3 * (s - e), c);
  }
}
Ul = new WeakSet(), u9 = function(t, e, n, s, r, a, o, l, c, h) {
  if (c <= 0 || c >= 1) return;
  const u = 1 - c, f = c * c, d = f * c, p = u * (u * (u * t + 3 * c * e) + 3 * f * n) + d * s, g = u * (u * (u * r + 3 * c * a) + 3 * f * o) + d * l;
  h[0] = Math.min(h[0], p), h[1] = Math.min(h[1], g), h[2] = Math.max(h[2], p), h[3] = Math.max(h[3], g);
}, K8 = function(t, e, n, s, r, a, o, l, c, h, u, f) {
  if (Math.abs(c) < 1e-12) {
    Math.abs(h) >= 1e-12 && D(this, Ul, u9).call(this, t, e, n, s, r, a, o, l, -u / h, f);
    return;
  }
  const d = h ** 2 - 4 * u * c;
  if (d < 0) return;
  const p = Math.sqrt(d), g = 2 * c;
  D(this, Ul, u9).call(this, t, e, n, s, r, a, o, l, (-h + p) / g, f), D(this, Ul, u9).call(this, t, e, n, s, r, a, o, l, (-h - p) / g, f);
}, F(Ee, Ul);
const LB = [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 xe(i, t = !1) {
  if (i[0] >= "ï") {
    let n;
    if (i[0] === "þ" && i[1] === "ÿ" ? (n = "utf-16be", i.length % 2 == 1 && (i = i.slice(0, -1))) : i[0] === "ÿ" && i[1] === "þ" ? (n = "utf-16le", i.length % 2 == 1 && (i = i.slice(0, -1))) : i[0] === "ï" && i[1] === "»" && i[2] === "¿" && (n = "utf-8"), n) try {
      const s = new TextDecoder(n, { fatal: !0 }), r = Dn(i), a = s.decode(r);
      return t || !a.includes("\x1B") ? a : a.replaceAll(/\x1b[^\x1b]*(?:\x1b|$)/g, "");
    } catch (s) {
      H(`stringToPDFString: "${s}".`);
    }
  }
  const e = [];
  for (let n = 0, s = i.length; n < s; n++) {
    const r = i.charCodeAt(n);
    if (!t && r === 27) {
      for (; ++n < s && i.charCodeAt(n) !== 27; ) ;
      continue;
    }
    const a = LB[r];
    e.push(a ? String.fromCharCode(a) : i.charAt(n));
  }
  return e.join("");
}
function np(i) {
  return decodeURIComponent(escape(i));
}
function Z8(i) {
  return unescape(encodeURIComponent(i));
}
function sp(i, t) {
  if (i.length !== t.length) return !1;
  for (let e = 0, n = i.length; e < n; e++) if (i[e] !== t[e]) return !1;
  return !0;
}
function Vl(i = /* @__PURE__ */ new Date()) {
  return [i.getUTCFullYear().toString(), (i.getUTCMonth() + 1).toString().padStart(2, "0"), i.getUTCDate().toString().padStart(2, "0"), i.getUTCHours().toString().padStart(2, "0"), i.getUTCMinutes().toString().padStart(2, "0"), i.getUTCSeconds().toString().padStart(2, "0")].join("");
}
let m6 = null, i_ = null;
function Tn(i, t, e) {
  return Math.min(Math.max(i, t), e);
}
function n_(i) {
  return Uint8Array.prototype.toHex ? i.toHex() : Array.from(i, (t) => Su[t]).join("");
}
typeof Promise.try != "function" && (Promise.try = function(i, ...t) {
  return new Promise((e) => {
    e(i(...t));
  });
});
typeof Math.sumPrecise != "function" && (Math.sumPrecise = function(i) {
  return i.reduce((t, e) => t + e, 0);
});
const OB = Symbol("CIRCULAR_REF"), fn = Symbol("EOF");
let d9 = /* @__PURE__ */ Object.create(null), f9 = /* @__PURE__ */ Object.create(null), su = /* @__PURE__ */ Object.create(null);
class lt {
  constructor(t) {
    this.name = t;
  }
  static get(t) {
    return f9[t] || (f9[t] = new lt(t));
  }
}
class Li {
  constructor(t) {
    this.cmd = t;
  }
  static get(t) {
    return d9[t] || (d9[t] = new Li(t));
  }
}
const BE = function() {
  return BE;
};
class Z {
  constructor(t = null) {
    this._map = /* @__PURE__ */ new Map(), this.xref = t, this.objId = null, this.suppressEncryption = !1, this.__nonSerializable__ = BE;
  }
  assignXref(t) {
    this.xref = t;
  }
  get size() {
    return this._map.size;
  }
  get(t, e, n) {
    let s = this._map.get(t);
    return s === void 0 && e !== void 0 && (s = this._map.get(e), s === void 0 && n !== void 0 && (s = this._map.get(n))), s instanceof Dt && this.xref ? this.xref.fetch(s, this.suppressEncryption) : s;
  }
  async getAsync(t, e, n) {
    let s = this._map.get(t);
    return s === void 0 && e !== void 0 && (s = this._map.get(e), s === void 0 && n !== void 0 && (s = this._map.get(n))), s instanceof Dt && this.xref ? this.xref.fetchAsync(s, this.suppressEncryption) : s;
  }
  getArray(t, e, n) {
    let s = this._map.get(t);
    if (s === void 0 && e !== void 0 && (s = this._map.get(e), s === void 0 && n !== void 0 && (s = this._map.get(n))), s instanceof Dt && this.xref && (s = this.xref.fetch(s, this.suppressEncryption)), Array.isArray(s)) {
      s = s.slice();
      for (let r = 0, a = s.length; r < a; r++) s[r] instanceof Dt && this.xref && (s[r] = this.xref.fetch(s[r], this.suppressEncryption));
    }
    return s;
  }
  getRaw(t) {
    return this._map.get(t);
  }
  getKeys() {
    return [...this._map.keys()];
  }
  getRawValues() {
    return [...this._map.values()];
  }
  set(t, e) {
    this._map.set(t, e);
  }
  has(t) {
    return this._map.has(t);
  }
  *[Symbol.iterator]() {
    for (const [t, e] of this._map) yield [t, e instanceof Dt && this.xref ? this.xref.fetch(e, this.suppressEncryption) : e];
  }
  static get empty() {
    const t = new Z(null);
    return t.set = (e, n) => {
      ye("Should not call `set` on the empty dictionary.");
    }, At(this, "empty", t);
  }
  static merge({ xref: t, dictArray: e, mergeSubDicts: n = !1 }) {
    const s = new Z(t), r = /* @__PURE__ */ new Map();
    for (const a of e) if (a instanceof Z) for (const [o, l] of a._map) {
      let c = r.get(o);
      if (c === void 0)
        c = [], r.set(o, c);
      else if (!(n && l instanceof Z)) continue;
      c.push(l);
    }
    for (const [a, o] of r) {
      if (o.length === 1 || !(o[0] instanceof Z)) {
        s._map.set(a, o[0]);
        continue;
      }
      const l = new Z(t);
      for (const c of o) for (const [h, u] of c._map) l._map.has(h) || l._map.set(h, u);
      l.size > 0 && s._map.set(a, l);
    }
    return r.clear(), s.size > 0 ? s : Z.empty;
  }
  clone() {
    const t = new Z(this.xref);
    for (const e of this.getKeys()) t.set(e, this.getRaw(e));
    return t;
  }
  delete(t) {
    delete this._map[t];
  }
}
class Dt {
  constructor(t, e) {
    this.num = t, this.gen = e;
  }
  toString() {
    return this.gen === 0 ? `${this.num}R` : `${this.num}R${this.gen}`;
  }
  static fromString(t) {
    const e = su[t];
    if (e) return e;
    const n = /^(\d+)R(\d*)$/.exec(t);
    return n && n[1] !== "0" ? su[t] = new Dt(parseInt(n[1]), n[2] ? parseInt(n[2]) : 0) : null;
  }
  static get(t, e) {
    const n = e === 0 ? `${t}R` : `${t}R${e}`;
    return su[n] || (su[n] = new Dt(t, e));
  }
}
class $i {
  constructor(t = null) {
    this._set = new Set(t == null ? void 0 : t._set);
  }
  has(t) {
    return this._set.has(t.toString());
  }
  put(t) {
    this._set.add(t.toString());
  }
  remove(t) {
    this._set.delete(t.toString());
  }
  [Symbol.iterator]() {
    return this._set.values();
  }
  clear() {
    this._set.clear();
  }
}
class Ts {
  constructor() {
    this._map = /* @__PURE__ */ new Map();
  }
  get size() {
    return this._map.size;
  }
  get(t) {
    return this._map.get(t.toString());
  }
  has(t) {
    return this._map.has(t.toString());
  }
  put(t, e) {
    this._map.set(t.toString(), e);
  }
  putAlias(t, e) {
    this._map.set(t.toString(), this.get(e));
  }
  [Symbol.iterator]() {
    return this._map.values();
  }
  clear() {
    this._map.clear();
  }
  *values() {
    yield* this._map.values();
  }
  *items() {
    for (const [t, e] of this._map) yield [Dt.fromString(t), e];
  }
}
function ki(i, t) {
  return i instanceof lt && (t === void 0 || i.name === t);
}
function nn(i, t) {
  return i instanceof Li && (t === void 0 || i.cmd === t);
}
function PE(i, t) {
  return i instanceof Z && (t === void 0 || ki(i.get("Type"), t));
}
function o3(i, t) {
  return i.num === t.num && i.gen === t.gen;
}
class oe {
  get length() {
    ye("Abstract getter `length` accessed");
  }
  get isEmpty() {
    ye("Abstract getter `isEmpty` accessed");
  }
  get isDataLoaded() {
    return At(this, "isDataLoaded", !0);
  }
  getByte() {
    ye("Abstract method `getByte` called");
  }
  getBytes(t) {
    ye("Abstract method `getBytes` called");
  }
  async getImageData(t, e) {
    return this.getBytes(t, e);
  }
  async asyncGetBytes() {
    ye("Abstract method `asyncGetBytes` called");
  }
  get isAsync() {
    return !1;
  }
  get isAsyncDecoder() {
    return !1;
  }
  get canAsyncDecodeImageFromBuffer() {
    return !1;
  }
  async getTransferableImage() {
    return null;
  }
  peekByte() {
    const t = this.getByte();
    return t !== -1 && this.pos--, t;
  }
  peekBytes(t) {
    const e = this.getBytes(t);
    return this.pos -= e.length, e;
  }
  getUint16() {
    const t = this.getByte(), e = this.getByte();
    return t === -1 || e === -1 ? -1 : (t << 8) + e;
  }
  getInt32() {
    return (this.getByte() << 24) + (this.getByte() << 16) + (this.getByte() << 8) + this.getByte();
  }
  getByteRange(t, e) {
    ye("Abstract method `getByteRange` called");
  }
  getString(t) {
    return Is(this.getBytes(t));
  }
  skip(t) {
    this.pos += t || 1;
  }
  reset() {
    ye("Abstract method `reset` called");
  }
  moveStart() {
    ye("Abstract method `moveStart` called");
  }
  makeSubStream(t, e, n = null) {
    ye("Abstract method `makeSubStream` called");
  }
  getBaseStreams() {
    return null;
  }
}
const NE = /^[1-9]\.\d$/, J8 = 2 ** 31 - 1, Fa = [1, 0, 0, 1, 0, 0], Q8 = ["ColorSpace", "ExtGState", "Font", "Pattern", "Properties", "Shading", "XObject"], tb = ["ExtGState", "Font", "Properties", "XObject"];
function oi(i) {
  let t;
  return function() {
    return i && (t = /* @__PURE__ */ Object.create(null), i(t), i = null), t;
  };
}
class ti extends bs {
  constructor(t, e) {
    super(`Missing data [${t}, ${e})`, "MissingDataException"), this.begin = t, this.end = e;
  }
}
class eb extends bs {
  constructor(t) {
    super(t, "ParserEOFException");
  }
}
class e0 extends bs {
  constructor(t) {
    super(t, "XRefEntryException");
  }
}
class Cu extends bs {
  constructor(t) {
    super(t, "XRefParseException");
  }
}
function LE(i) {
  const t = i.length;
  if (t === 0) return new Uint8Array(0);
  if (t === 1) return new Uint8Array(i[0]);
  let e = 0;
  for (let r = 0; r < t; r++) e += i[r].byteLength;
  const n = new Uint8Array(e);
  let s = 0;
  for (let r = 0; r < t; r++) {
    const a = new Uint8Array(i[r]);
    n.set(a, s), s += a.byteLength;
  }
  return n;
}
async function ib(i) {
  const t = await fetch(i);
  if (!t.ok) throw new Error(`Failed to fetch file "${i}" with "${t.statusText}".`);
  return new Uint8Array(await t.arrayBuffer());
}
function Mr({ dict: i, key: t, getArray: e = !1, stopWhenFound: n = !0 }) {
  let s;
  const r = new $i();
  for (; i instanceof Z && (!i.objId || !r.has(i.objId)); ) {
    i.objId && r.put(i.objId);
    const a = e ? i.getArray(t) : i.get(t);
    if (a !== void 0) {
      if (n) return a;
      (s || (s = [])).push(a);
    }
    i = i.get("Parent");
  }
  return s;
}
const g6 = ["", "C", "CC", "CCC", "CD", "D", "DC", "DCC", "DCCC", "CM", "", "X", "XX", "XXX", "XL", "L", "LX", "LXX", "LXXX", "XC", "", "I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX"];
function $B(i, t = !1) {
  pn(Number.isInteger(i) && i > 0, "The number should be a positive integer.");
  const e = "M".repeat(i / 1e3 | 0) + g6[i % 1e3 / 100 | 0] + g6[10 + (i % 100 / 10 | 0)] + g6[20 + i % 10];
  return t ? e.toLowerCase() : e;
}
function b6(i) {
  return i > 0 ? Math.ceil(Math.log2(i)) : 0;
}
function ja(i, t) {
  return i[t] << 24 >> 24;
}
function Fl(i, t) {
  return (i[t] << 24 | i[t + 1] << 16) >> 16;
}
function pe(i, t) {
  return i[t] << 8 | i[t + 1];
}
function Ne(i, t) {
  return (i[t] << 24 | i[t + 1] << 16 | i[t + 2] << 8 | i[t + 3]) >>> 0;
}
function or(i) {
  return i === 32 || i === 9 || i === 13 || i === 10;
}
function cs(i, t) {
  return Array.isArray(i) ? (t === null || i.length === t) && i.every((e) => typeof e == "number") : ArrayBuffer.isView(i) && !(i instanceof BigInt64Array || i instanceof BigUint64Array) && (t === null || i.length === t);
}
function i0(i, t) {
  return cs(i, 6) ? i : t;
}
function nb(i, t) {
  return cs(i, 4) ? i : t;
}
function Wl(i, t) {
  return cs(i, 4) ? Ee.normalizeRect(i) : t;
}
function OE(i) {
  const t = /(.+)\[(\d+)\]$/;
  return i.split(".").map((e) => {
    const n = e.match(t);
    return n ? { name: n[1], pos: parseInt(n[2], 10) } : { name: e, pos: 0 };
  });
}
function Gy(i) {
  const t = [];
  let e = 0;
  for (let n = 0, s = i.length; n < s; n++) {
    const r = i.charCodeAt(n);
    (r < 33 || r > 126 || r === 35 || r === 40 || r === 41 || r === 60 || r === 62 || r === 91 || r === 93 || r === 123 || r === 125 || r === 47 || r === 37) && (e < n && t.push(i.substring(e, n)), t.push(`#${r.toString(16)}`), e = n + 1);
  }
  return t.length === 0 ? i : (e < i.length && t.push(i.substring(e, i.length)), t.join(""));
}
function Qd(i) {
  return i.replaceAll(/([()\\\n\r])/g, (t) => t === `
` ? "\\n" : t === "\r" ? "\\r" : `\\${t}`);
}
function l3(i, t, e, n) {
  if (!i) return;
  let s = null;
  if (i instanceof Dt) {
    if (n.has(i)) return;
    s = i, n.put(s), i = t.fetch(i);
  }
  if (Array.isArray(i)) for (const r of i) l3(r, t, e, n);
  else if (i instanceof Z) {
    if (ki(i.get("S"), "JavaScript")) {
      const r = i.get("JS");
      let a;
      r instanceof oe ? a = r.getString() : typeof r == "string" && (a = r), a && (a = xe(a, !0).replaceAll("\0", "")), a && e.push(a);
    }
    l3(i.getRaw("Next"), t, e, n);
  }
  s && n.remove(s);
}
function M4(i, t, e) {
  const n = /* @__PURE__ */ Object.create(null), s = Mr({ dict: t, key: "AA", stopWhenFound: !1 });
  if (s) for (let r = s.length - 1; r >= 0; r--) {
    const a = s[r];
    if (a instanceof Z) for (const o of a.getKeys()) {
      const l = e[o];
      if (!l) continue;
      const c = [];
      l3(a.getRaw(o), i, c, new $i()), c.length > 0 && (n[l] = c);
    }
  }
  if (t.has("A")) {
    const r = [];
    l3(t.get("A"), i, r, new $i()), r.length > 0 && (n.Action = r);
  }
  return jy(n) > 0 ? n : null;
}
const qB = { 60: "&lt;", 62: "&gt;", 38: "&amp;", 34: "&quot;", 39: "&apos;" };
function* zB(i) {
  for (let t = 0, e = i.length; t < e; t++) {
    const n = i.codePointAt(t);
    n > 55295 && (n < 57344 || n > 65533) && t++, yield n;
  }
}
function Eu(i) {
  const t = [];
  let e = 0;
  for (let n = 0, s = i.length; n < s; n++) {
    const r = i.codePointAt(n);
    if (32 <= r && r <= 126) {
      const a = qB[r];
      a && (e < n && t.push(i.substring(e, n)), t.push(a), e = n + 1);
    } else
      e < n && t.push(i.substring(e, n)), t.push(`&#x${r.toString(16).toUpperCase()};`), r > 55295 && (r < 57344 || r > 65533) && n++, e = n + 1;
  }
  return t.length === 0 ? i : (e < i.length && t.push(i.substring(e, i.length)), t.join(""));
}
function sb(i, t = !1) {
  const e = /^("|').*("|')$/.exec(i);
  if (e && e[1] === e[2]) {
    if (new RegExp(`[^\\\\]${e[1]}`).test(i.slice(1, -1)))
      return t && H(`FontFamily contains unescaped ${e[1]}: ${i}.`), !1;
  } else for (const n of i.split(/[ \t]+/)) if (/^(\d|(-(\d|-)))/.test(n) || !/^[\w-\\]+$/.test(n))
    return t && H(`FontFamily contains invalid <custom-ident>: ${i}.`), !1;
  return !0;
}
function UB(i) {
  const t = /* @__PURE__ */ new Set(["100", "200", "300", "400", "500", "600", "700", "800", "900", "1000", "normal", "bold", "bolder", "lighter"]), { fontFamily: e, fontWeight: n, italicAngle: s } = i;
  if (!sb(e, !0)) return !1;
  const r = n ? n.toString() : "";
  i.fontWeight = t.has(r) ? r : "400";
  const a = parseFloat(s);
  return i.italicAngle = isNaN(a) || a < -90 || a > 90 ? "14" : s.toString(), !0;
}
function $E(i) {
  const t = new RegExp("^\\s*(" + ["app.launchURL", "window.open", "xfa.host.gotoURL"].join("|").replaceAll(".", "\\.") + `)\\((?:'|")([^'"]*)(?:'|")(?:,\\s*(\\w+)\\)|\\))`, "i").exec(i);
  return t != null && t[2] ? { url: t[2], newWindow: t[1] === "app.launchURL" && t[3] === "true" } : null;
}
function be(i) {
  if (Number.isInteger(i)) return i.toString();
  const t = Math.round(100 * i);
  return t % 100 == 0 ? (t / 100).toString() : t % 10 == 0 ? i.toFixed(1) : i.toFixed(2);
}
function qE(i) {
  if (!i) return null;
  const t = /* @__PURE__ */ new Map();
  for (const [e, n] of i) {
    if (!e.startsWith(hE)) continue;
    let s = t.get(n.pageIndex);
    s || (s = [], t.set(n.pageIndex, s)), s.push(n);
  }
  return t.size > 0 ? t : null;
}
function Rr(i) {
  return function(e) {
    return /^[\x00-\x7F]*$/.test(e);
  }(i) ? i : zE(i, !0);
}
function HB(i) {
  const t = [];
  for (let e = 0, n = i.length; e < n; e++) {
    const s = i.charCodeAt(e);
    t.push(Su[s >> 8 & 255], Su[255 & s]);
  }
  return t.join("");
}
function zE(i, t = !1) {
  const e = [];
  t && e.push("þÿ");
  for (let n = 0, s = i.length; n < s; n++) {
    const r = i.charCodeAt(n);
    e.push(String.fromCharCode(r >> 8 & 255), String.fromCharCode(255 & r));
  }
  return e.join("");
}
function c3(i, t, e) {
  switch (i) {
    case 90:
      return [0, 1, -1, 0, t, 0];
    case 180:
      return [-1, 0, 0, -1, t, e];
    case 270:
      return [0, -1, 1, 0, 0, e];
    default:
      throw new Error("Invalid rotation");
  }
}
function s_(i) {
  return Math.ceil(Math.ceil(Math.log2(1 + i)) / 8);
}
var Km;
class ni {
  static get _memoryArray() {
    const t = m(this, Km);
    return t != null && t.byteLength ? t : E(this, Km, new Uint8Array(this._memory.buffer));
  }
}
Km = new WeakMap(), F(ni, Km, null), ft(ni, "_memory", null), ft(ni, "_mustAddAlpha", !1), ft(ni, "_destBuffer", null), ft(ni, "_destOffset", 0), ft(ni, "_destLength", 0), ft(ni, "_cssColor", ""), ft(ni, "_makeHexColor", null);
let ls;
const UE = typeof TextDecoder < "u" ? new TextDecoder("utf-8", { ignoreBOM: !0, fatal: !0 }) : { decode: () => {
  throw Error("TextDecoder not available");
} };
typeof TextDecoder < "u" && UE.decode();
let g2 = null;
function HE() {
  return g2 !== null && g2.byteLength !== 0 || (g2 = new Uint8Array(ls.memory.buffer)), g2;
}
let rb = 0;
function r_(i, t) {
  const e = t(1 * i.length, 1) >>> 0;
  return HE().set(i, e / 1), rb = i.length, e;
}
const y6 = Object.freeze({ RGB8: 0, 0: "RGB8", RGBA8: 1, 1: "RGBA8", BGRA8: 2, 2: "BGRA8", Gray8: 3, 3: "Gray8", GrayA8: 4, 4: "GrayA8", CMYK: 5, 5: "CMYK" }), jB = Object.freeze({ Perceptual: 0, 0: "Perceptual", RelativeColorimetric: 1, 1: "RelativeColorimetric", Saturation: 2, 2: "Saturation", AbsoluteColorimetric: 3, 3: "AbsoluteColorimetric" });
function GB() {
  const i = { wbg: {} };
  return i.wbg.__wbg_copyresult_b08ee7d273f295dd = function(t, e) {
    (function(s, r) {
      const { _mustAddAlpha: a, _destBuffer: o, _destOffset: l, _destLength: c, _memoryArray: h } = ni;
      if (r !== c) if (a) for (let u = s, f = s + r, d = l; u < f; u += 3, d += 4)
        o[d] = h[u], o[d + 1] = h[u + 1], o[d + 2] = h[u + 2], o[d + 3] = 255;
      else for (let u = s, f = s + r, d = l; u < f; u += 3, d += 4)
        o[d] = h[u], o[d + 1] = h[u + 1], o[d + 2] = h[u + 2];
      else o.set(h.subarray(s, s + r), l);
    })(t >>> 0, e >>> 0);
  }, i.wbg.__wbg_copyrgb_d60ce17bb05d9b67 = function(t) {
    (function(n) {
      const { _destBuffer: s, _destOffset: r, _memoryArray: a } = ni;
      s[r] = a[n], s[r + 1] = a[n + 1], s[r + 2] = a[n + 2];
    })(t >>> 0);
  }, i.wbg.__wbg_makecssRGB_893bf0cd9fdb302d = function(t) {
    (function(n) {
      const { _memoryArray: s } = ni;
      ni._cssColor = ni._makeHexColor(s[n], s[n + 1], s[n + 2]);
    })(t >>> 0);
  }, i.wbg.__wbindgen_init_externref_table = function() {
    const t = ls.__wbindgen_export_0, e = t.grow(4);
    t.set(0, void 0), t.set(e + 0, void 0), t.set(e + 1, null), t.set(e + 2, !0), t.set(e + 3, !1);
  }, i.wbg.__wbindgen_throw = function(t, e) {
    throw new Error(function(s, r) {
      return s >>>= 0, UE.decode(HE().subarray(s, s + r));
    }(t, e));
  }, i;
}
function VB(i, t) {
  return ls = i.exports, g2 = null, ls.__wbindgen_start(), ls;
}
var l4;
const W2 = class W2 {
  constructor(t, e) {
    this.name = t, this.numComps = e;
  }
  getRgb(t, e, n = new Uint8ClampedArray(3)) {
    return this.getRgbItem(t, e, n, 0), n;
  }
  getRgbHex(t, e) {
    const n = this.getRgb(t, e, m(W2, l4));
    return Ee.makeHexColor(n[0], n[1], n[2]);
  }
  getRgbItem(t, e, n, s) {
    ye("Should not call ColorSpace.getRgbItem");
  }
  getRgbBuffer(t, e, n, s, r, a, o) {
    ye("Should not call ColorSpace.getRgbBuffer");
  }
  getOutputLength(t, e) {
    ye("Should not call ColorSpace.getOutputLength");
  }
  isPassthrough(t) {
    return !1;
  }
  isDefaultDecode(t, e) {
    return W2.isDefaultDecode(t, this.numComps);
  }
  fillRgb(t, e, n, s, r, a, o, l, c) {
    const h = e * n;
    let u = null;
    const f = 1 << o, d = n !== r || e !== s;
    if (this.isPassthrough(o)) u = l;
    else if (this.numComps === 1 && h > f && this.name !== "DeviceGray" && this.name !== "DeviceRGB") {
      const p = o <= 8 ? new Uint8Array(f) : new Uint16Array(f);
      for (let b = 0; b < f; b++) p[b] = b;
      const g = new Uint8ClampedArray(3 * f);
      if (this.getRgbBuffer(p, 0, f, g, 0, o, 0), d) {
        u = new Uint8Array(3 * h);
        let b = 0;
        for (let y = 0; y < h; ++y) {
          const v = 3 * l[y];
          u[b++] = g[v], u[b++] = g[v + 1], u[b++] = g[v + 2];
        }
      } else {
        let b = 0;
        for (let y = 0; y < h; ++y) {
          const v = 3 * l[y];
          t[b++] = g[v], t[b++] = g[v + 1], t[b++] = g[v + 2], b += c;
        }
      }
    } else d ? (u = new Uint8ClampedArray(3 * h), this.getRgbBuffer(l, 0, h, u, 0, o, 0)) : this.getRgbBuffer(l, 0, s * a, t, 0, o, c);
    if (u) if (d) (function(g, b, y, v, w, _, x) {
      x = x !== 1 ? 0 : x;
      const k = y / w, S = v / _;
      let T, I = 0;
      const R = new Uint16Array(w), B = 3 * y;
      for (let L = 0; L < w; L++) R[L] = 3 * Math.floor(L * k);
      for (let L = 0; L < _; L++) {
        const it = Math.floor(L * S) * B;
        for (let O = 0; O < w; O++)
          T = it + R[O], b[I++] = g[T++], b[I++] = g[T++], b[I++] = g[T++], I += x;
      }
    })(u, t, e, n, s, r, c);
    else {
      let p = 0, g = 0;
      for (let b = 0, y = s * a; b < y; b++)
        t[p++] = u[g++], t[p++] = u[g++], t[p++] = u[g++], p += c;
    }
  }
  get usesZeroToOneRange() {
    return At(this, "usesZeroToOneRange", !0);
  }
  static isDefaultDecode(t, e) {
    if (!Array.isArray(t)) return !0;
    if (2 * e !== t.length)
      return H("The decode map is not the correct length"), !0;
    for (let n = 0, s = t.length; n < s; n += 2) if (t[n] !== 0 || t[n + 1] !== 1) return !1;
    return !0;
  }
};
l4 = new WeakMap(), F(W2, l4, new Uint8ClampedArray(3));
let Mn = W2;
class WB extends Mn {
  constructor(t, e, n) {
    super("Alternate", t), this.base = e, this.tintFn = n, this.tmpBuf = new Float32Array(e.numComps);
  }
  getRgbItem(t, e, n, s) {
    const r = this.tmpBuf;
    this.tintFn(t, e, r, 0), this.base.getRgbItem(r, 0, n, s);
  }
  getRgbBuffer(t, e, n, s, r, a, o) {
    const l = this.tintFn, c = this.base, h = 1 / ((1 << a) - 1), u = c.numComps, f = c.usesZeroToOneRange, d = (c.isPassthrough(8) || !f) && o === 0;
    let p = d ? r : 0;
    const g = d ? s : new Uint8ClampedArray(u * n), b = this.numComps, y = new Float32Array(b), v = new Float32Array(u);
    let w, _;
    for (w = 0; w < n; w++) {
      for (_ = 0; _ < b; _++) y[_] = t[e++] * h;
      if (l(y, 0, v, 0), f) for (_ = 0; _ < u; _++) g[p++] = 255 * v[_];
      else
        c.getRgbItem(v, 0, g, p), p += u;
    }
    d || c.getRgbBuffer(g, 0, n, s, r, 8, o);
  }
  getOutputLength(t, e) {
    return this.base.getOutputLength(t * this.base.numComps / this.numComps, e);
  }
}
class a_ extends Mn {
  constructor(t) {
    super("Pattern", null), this.base = t;
  }
  isDefaultDecode(t, e) {
    ye("Should not call PatternCS.isDefaultDecode");
  }
}
class XB extends Mn {
  constructor(t, e, n) {
    super("Indexed", 1), this.base = t, this.highVal = e;
    const s = t.numComps * (e + 1);
    if (this.lookup = new Uint8Array(s), n instanceof oe) {
      const r = n.getBytes(s);
      this.lookup.set(r);
    } else {
      if (typeof n != "string") throw new ht(`IndexedCS - unrecognized lookup table: ${n}`);
      for (let r = 0; r < s; ++r) this.lookup[r] = 255 & n.charCodeAt(r);
    }
  }
  getRgbItem(t, e, n, s) {
    const { base: r, highVal: a, lookup: o } = this, l = Tn(Math.round(t[e]), 0, a) * r.numComps;
    r.getRgbBuffer(o, l, 1, n, s, 8, 0);
  }
  getRgbBuffer(t, e, n, s, r, a, o) {
    const { base: l, highVal: c, lookup: h } = this, { numComps: u } = l, f = l.getOutputLength(u, o);
    for (let d = 0; d < n; ++d) {
      const p = Tn(Math.round(t[e++]), 0, c) * u;
      l.getRgbBuffer(h, p, 1, s, r, 8, o), r += f;
    }
  }
  getOutputLength(t, e) {
    return this.base.getOutputLength(t * this.base.numComps, e);
  }
  isDefaultDecode(t, e) {
    return Array.isArray(t) ? t.length !== 2 ? (H("Decode map length is not correct"), !0) : !Number.isInteger(e) || e < 1 ? (H("Bits per component is not correct"), !0) : t[0] === 0 && t[1] === (1 << e) - 1 : !0;
  }
}
class YB extends Mn {
  constructor() {
    super("DeviceGray", 1);
  }
  getRgbItem(t, e, n, s) {
    const r = 255 * t[e];
    n[s] = n[s + 1] = n[s + 2] = r;
  }
  getRgbBuffer(t, e, n, s, r, a, o) {
    const l = 255 / ((1 << a) - 1);
    let c = e, h = r;
    for (let u = 0; u < n; ++u) {
      const f = l * t[c++];
      s[h++] = f, s[h++] = f, s[h++] = f, h += o;
    }
  }
  getOutputLength(t, e) {
    return t * (3 + e);
  }
}
class KB extends Mn {
  constructor() {
    super("DeviceRGB", 3);
  }
  getRgbItem(t, e, n, s) {
    n[s] = 255 * t[e], n[s + 1] = 255 * t[e + 1], n[s + 2] = 255 * t[e + 2];
  }
  getRgbBuffer(t, e, n, s, r, a, o) {
    if (a === 8 && o === 0) {
      s.set(t.subarray(e, e + 3 * n), r);
      return;
    }
    const l = 255 / ((1 << a) - 1);
    let c = e, h = r;
    for (let u = 0; u < n; ++u)
      s[h++] = l * t[c++], s[h++] = l * t[c++], s[h++] = l * t[c++], h += o;
  }
  getOutputLength(t, e) {
    return t * (3 + e) / 3 | 0;
  }
  isPassthrough(t) {
    return t === 8;
  }
}
class ZB extends Mn {
  constructor() {
    super("DeviceRGBA", 4);
  }
  getOutputLength(t, e) {
    return 4 * t;
  }
  isPassthrough(t) {
    return t === 8;
  }
  fillRgb(t, e, n, s, r, a, o, l, c) {
    n !== r || e !== s ? function(u, f, d, p, g, b, y) {
      const v = d / g, w = p / b;
      let _ = 0;
      const x = new Uint16Array(g);
      if (y === 1) {
        for (let I = 0; I < g; I++) x[I] = Math.floor(I * v);
        const k = new Uint32Array(u.buffer), S = new Uint32Array(f.buffer), T = Rs.isLittleEndian ? 16777215 : 4294967040;
        for (let I = 0; I < b; I++) {
          const R = k.subarray(Math.floor(I * w) * d);
          for (let B = 0; B < g; B++) S[_++] |= R[x[B]] & T;
        }
      } else {
        const S = d * 4;
        for (let T = 0; T < g; T++) x[T] = Math.floor(T * v) * 4;
        for (let T = 0; T < b; T++) {
          const I = u.subarray(Math.floor(T * w) * S);
          for (let R = 0; R < g; R++) {
            const B = x[R];
            f[_++] = I[B], f[_++] = I[B + 1], f[_++] = I[B + 2];
          }
        }
      }
    }(l, t, e, n, s, r, c) : function(u, f, d) {
      if (d === 1) {
        const p = new Uint32Array(u.buffer), g = new Uint32Array(f.buffer), b = Rs.isLittleEndian ? 16777215 : 4294967040;
        for (let y = 0, v = p.length; y < v; y++) g[y] |= p[y] & b;
      } else {
        let p = 0;
        for (let g = 0, b = u.length; g < b; g += 4)
          f[p++] = u[g], f[p++] = u[g + 1], f[p++] = u[g + 2];
      }
    }(l, t, c);
  }
}
var Zm, ab;
class jE extends Mn {
  constructor() {
    super("DeviceCMYK", 4);
    F(this, Zm);
  }
  getRgbItem(e, n, s, r) {
    D(this, Zm, ab).call(this, e, n, 1, s, r);
  }
  getRgbBuffer(e, n, s, r, a, o, l) {
    const c = 1 / ((1 << o) - 1);
    for (let h = 0; h < s; h++)
      D(this, Zm, ab).call(this, e, n, c, r, a), n += 4, a += 3 + l;
  }
  getOutputLength(e, n) {
    return e / 4 * (3 + n) | 0;
  }
}
Zm = new WeakSet(), ab = function(e, n, s, r, a) {
  const o = e[n] * s, l = e[n + 1] * s, c = e[n + 2] * s, h = e[n + 3] * s;
  r[a] = 255 + o * (-4.387332384609988 * o + 54.48615194189176 * l + 18.82290502165302 * c + 212.25662451639585 * h - 285.2331026137004) + l * (1.7149763477362134 * l - 5.6096736904047315 * c + -17.873870861415444 * h - 5.497006427196366) + c * (-2.5217340131683033 * c - 21.248923337353073 * h + 17.5119270841813) + h * (-21.86122147463605 * h - 189.48180835922747), r[a + 1] = 255 + o * (8.841041422036149 * o + 60.118027045597366 * l + 6.871425592049007 * c + 31.159100130055922 * h - 79.2970844816548) + l * (-15.310361306967817 * l + 17.575251261109482 * c + 131.35250912493976 * h - 190.9453302588951) + c * (4.444339102852739 * c + 9.8632861493405 * h - 24.86741582555878) + h * (-20.737325471181034 * h - 187.80453709719578), r[a + 2] = 255 + o * (0.8842522430003296 * o + 8.078677503112928 * l + 30.89978309703729 * c - 0.23883238689178934 * h - 14.183576799673286) + l * (10.49593273432072 * l + 63.02378494754052 * c + 50.606957656360734 * h - 112.23884253719248) + c * (0.03296041114873217 * c + 115.60384449646641 * h - 193.58209356861505) + h * (-22.33816807309886 * h - 180.12613974708367);
};
var Jm, ob;
class JB extends Mn {
  constructor(e, n, s) {
    super("CalGray", 1);
    F(this, Jm);
    if (!e) throw new ht("WhitePoint missing - required for color space CalGray");
    if ([this.XW, this.YW, this.ZW] = e, [this.XB, this.YB, this.ZB] = n || [0, 0, 0], this.G = s || 1, this.XW < 0 || this.ZW < 0 || this.YW !== 1) throw new ht(`Invalid WhitePoint components for ${this.name}, no fallback available`);
    (this.XB < 0 || this.YB < 0 || this.ZB < 0) && (ue(`Invalid BlackPoint for ${this.name}, falling back to default.`), this.XB = this.YB = this.ZB = 0), this.XB === 0 && this.YB === 0 && this.ZB === 0 || H(`${this.name}, BlackPoint: XB: ${this.XB}, YB: ${this.YB}, ZB: ${this.ZB}, only default values are supported.`), this.G < 1 && (ue(`Invalid Gamma: ${this.G} for ${this.name}, falling back to default.`), this.G = 1);
  }
  getRgbItem(e, n, s, r) {
    D(this, Jm, ob).call(this, e, n, s, r, 1);
  }
  getRgbBuffer(e, n, s, r, a, o, l) {
    const c = 1 / ((1 << o) - 1);
    for (let h = 0; h < s; ++h)
      D(this, Jm, ob).call(this, e, n, r, a, c), n += 1, a += 3 + l;
  }
  getOutputLength(e, n) {
    return e * (3 + n);
  }
}
Jm = new WeakSet(), ob = function(e, n, s, r, a) {
  const o = (e[n] * a) ** this.G, l = this.YW * o, c = Math.max(295.8 * l ** 0.3333333333333333 - 40.8, 0);
  s[r] = c, s[r + 1] = c, s[r + 2] = c;
};
var Qm, tg, c4, h4, eg, qd, ig, u4, je, ru, GE, VE, p9, au, WE, XE, YE, cb;
const hi = class hi extends Mn {
  constructor(e, n, s, r) {
    super("CalRGB", 3);
    F(this, je);
    if (!e) throw new ht("WhitePoint missing - required for color space CalRGB");
    const [a, o, l] = this.whitePoint = e, [c, h, u] = this.blackPoint = n || new Float32Array(3);
    if ([this.GR, this.GG, this.GB] = s || new Float32Array([1, 1, 1]), [this.MXA, this.MYA, this.MZA, this.MXB, this.MYB, this.MZB, this.MXC, this.MYC, this.MZC] = r || new Float32Array([1, 0, 0, 0, 1, 0, 0, 0, 1]), a < 0 || l < 0 || o !== 1) throw new ht(`Invalid WhitePoint components for ${this.name}, no fallback available`);
    (c < 0 || h < 0 || u < 0) && (ue(`Invalid BlackPoint for ${this.name} [${c}, ${h}, ${u}], falling back to default.`), this.blackPoint = new Float32Array(3)), (this.GR < 0 || this.GG < 0 || this.GB < 0) && (ue(`Invalid Gamma [${this.GR}, ${this.GG}, ${this.GB}] for ${this.name}, falling back to default.`), this.GR = this.GG = this.GB = 1);
  }
  getRgbItem(e, n, s, r) {
    D(this, je, cb).call(this, e, n, s, r, 1);
  }
  getRgbBuffer(e, n, s, r, a, o, l) {
    const c = 1 / ((1 << o) - 1);
    for (let h = 0; h < s; ++h)
      D(this, je, cb).call(this, e, n, r, a, c), n += 3, a += 3 + l;
  }
  getOutputLength(e, n) {
    return e * (3 + n) / 3 | 0;
  }
};
Qm = new WeakMap(), tg = new WeakMap(), c4 = new WeakMap(), h4 = new WeakMap(), eg = new WeakMap(), qd = new WeakMap(), ig = new WeakMap(), u4 = new WeakMap(), je = new WeakSet(), ru = function(e, n, s) {
  s[0] = e[0] * n[0] + e[1] * n[1] + e[2] * n[2], s[1] = e[3] * n[0] + e[4] * n[1] + e[5] * n[2], s[2] = e[6] * n[0] + e[7] * n[1] + e[8] * n[2];
}, GE = function(e, n, s) {
  s[0] = 1 * n[0] / e[0], s[1] = 1 * n[1] / e[1], s[2] = 1 * n[2] / e[2];
}, VE = function(e, n, s) {
  s[0] = 0.95047 * n[0] / e[0], s[1] = 1 * n[1] / e[1], s[2] = 1.08883 * n[2] / e[2];
}, p9 = function(e) {
  return e <= 31308e-7 ? Tn(12.92 * e, 0, 1) : e >= 0.99554525 ? 1 : Tn(1.055 * e ** (1 / 2.4) - 0.055, 0, 1);
}, au = function(e) {
  return e < 0 ? -D(this, je, au).call(this, -e) : e > 8 ? ((e + 16) / 116) ** 3 : e * m(hi, u4);
}, WE = function(e, n, s) {
  if (e[0] === 0 && e[1] === 0 && e[2] === 0) {
    s[0] = n[0], s[1] = n[1], s[2] = n[2];
    return;
  }
  const r = D(this, je, au).call(this, 0), a = (1 - r) / (1 - D(this, je, au).call(this, e[0])), o = 1 - a, l = (1 - r) / (1 - D(this, je, au).call(this, e[1])), c = 1 - l, h = (1 - r) / (1 - D(this, je, au).call(this, e[2])), u = 1 - h;
  s[0] = n[0] * a + o, s[1] = n[1] * l + c, s[2] = n[2] * h + u;
}, XE = function(e, n, s) {
  if (e[0] === 1 && e[2] === 1) {
    s[0] = n[0], s[1] = n[1], s[2] = n[2];
    return;
  }
  const r = s;
  D(this, je, ru).call(this, m(hi, Qm), n, r);
  const a = m(hi, eg);
  D(this, je, GE).call(this, e, r, a), D(this, je, ru).call(this, m(hi, tg), a, s);
}, YE = function(e, n, s) {
  const r = s;
  D(this, je, ru).call(this, m(hi, Qm), n, r);
  const a = m(hi, eg);
  D(this, je, VE).call(this, e, r, a), D(this, je, ru).call(this, m(hi, tg), a, s);
}, cb = function(e, n, s, r, a) {
  const o = Tn(e[n] * a, 0, 1), l = Tn(e[n + 1] * a, 0, 1), c = Tn(e[n + 2] * a, 0, 1), h = o === 1 ? 1 : o ** this.GR, u = l === 1 ? 1 : l ** this.GG, f = c === 1 ? 1 : c ** this.GB, d = this.MXA * h + this.MXB * u + this.MXC * f, p = this.MYA * h + this.MYB * u + this.MYC * f, g = this.MZA * h + this.MZB * u + this.MZC * f, b = m(hi, qd);
  b[0] = d, b[1] = p, b[2] = g;
  const y = m(hi, ig);
  D(this, je, XE).call(this, this.whitePoint, b, y);
  const v = m(hi, qd);
  D(this, je, WE).call(this, this.blackPoint, y, v);
  const w = m(hi, ig);
  D(this, je, YE).call(this, m(hi, h4), v, w);
  const _ = m(hi, qd);
  D(this, je, ru).call(this, m(hi, c4), w, _), s[r] = 255 * D(this, je, p9).call(this, _[0]), s[r + 1] = 255 * D(this, je, p9).call(this, _[1]), s[r + 2] = 255 * D(this, je, p9).call(this, _[2]);
}, F(hi, Qm, new Float32Array([0.8951, 0.2664, -0.1614, -0.7502, 1.7135, 0.0367, 0.0389, -0.0685, 1.0296])), F(hi, tg, new Float32Array([0.9869929, -0.1470543, 0.1599627, 0.4323053, 0.5183603, 0.0492912, -85287e-7, 0.0400428, 0.9684867])), F(hi, c4, new Float32Array([3.2404542, -1.5371385, -0.4985314, -0.969266, 1.8760108, 0.041556, 0.0556434, -0.2040259, 1.0572252])), F(hi, h4, new Float32Array([1, 1, 1])), F(hi, eg, new Float32Array(3)), F(hi, qd, new Float32Array(3)), F(hi, ig, new Float32Array(3)), F(hi, u4, (24 / 116) ** 3 / 8);
let lb = hi;
var cr, m9, g9, hb;
class QB extends Mn {
  constructor(e, n, s) {
    super("Lab", 3);
    F(this, cr);
    if (!e) throw new ht("WhitePoint missing - required for color space Lab");
    if ([this.XW, this.YW, this.ZW] = e, [this.amin, this.amax, this.bmin, this.bmax] = s || [-100, 100, -100, 100], [this.XB, this.YB, this.ZB] = n || [0, 0, 0], this.XW < 0 || this.ZW < 0 || this.YW !== 1) throw new ht("Invalid WhitePoint components, no fallback available");
    (this.XB < 0 || this.YB < 0 || this.ZB < 0) && (ue("Invalid BlackPoint, falling back to default"), this.XB = this.YB = this.ZB = 0), (this.amin > this.amax || this.bmin > this.bmax) && (ue("Invalid Range, falling back to defaults"), this.amin = -100, this.amax = 100, this.bmin = -100, this.bmax = 100);
  }
  getRgbItem(e, n, s, r) {
    D(this, cr, hb).call(this, e, n, !1, s, r);
  }
  getRgbBuffer(e, n, s, r, a, o, l) {
    const c = (1 << o) - 1;
    for (let h = 0; h < s; h++)
      D(this, cr, hb).call(this, e, n, c, r, a), n += 3, a += 3 + l;
  }
  getOutputLength(e, n) {
    return e * (3 + n) / 3 | 0;
  }
  isDefaultDecode(e, n) {
    return !0;
  }
  get usesZeroToOneRange() {
    return At(this, "usesZeroToOneRange", !1);
  }
}
cr = new WeakSet(), m9 = function(e) {
  return e >= 6 / 29 ? e ** 3 : 108 / 841 * (e - 4 / 29);
}, g9 = function(e, n, s, r) {
  return s + e * (r - s) / n;
}, hb = function(e, n, s, r, a) {
  let o = e[n], l = e[n + 1], c = e[n + 2];
  s !== !1 && (o = D(this, cr, g9).call(this, o, s, 0, 100), l = D(this, cr, g9).call(this, l, s, this.amin, this.amax), c = D(this, cr, g9).call(this, c, s, this.bmin, this.bmax)), l > this.amax ? l = this.amax : l < this.amin && (l = this.amin), c > this.bmax ? c = this.bmax : c < this.bmin && (c = this.bmin);
  const h = (o + 16) / 116, u = h + l / 500, f = h - c / 200, d = this.XW * D(this, cr, m9).call(this, u), p = this.YW * D(this, cr, m9).call(this, h), g = this.ZW * D(this, cr, m9).call(this, f);
  let b, y, v;
  this.ZW < 1 ? (b = 3.1339 * d + -1.617 * p + -0.4906 * g, y = -0.9785 * d + 1.916 * p + 0.0333 * g, v = 0.072 * d + -0.229 * p + 1.4057 * g) : (b = 3.2406 * d + -1.5372 * p + -0.4986 * g, y = -0.9689 * d + 1.8758 * p + 0.0415 * g, v = 0.0557 * d + -0.204 * p + 1.057 * g), r[a] = 255 * Math.sqrt(b), r[a + 1] = 255 * Math.sqrt(y), r[a + 2] = 255 * Math.sqrt(v);
};
function KE(i) {
  const t = new XMLHttpRequest();
  return t.open("GET", i, !1), t.responseType = "arraybuffer", t.send(null), t.response;
}
var lo, Jc, zd, Ud, d4;
const Q0 = class Q0 extends Mn {
  constructor(e, n, s) {
    if (!Q0.isUsable) throw new Error("No ICC color space support");
    super(n, s);
    F(this, lo);
    F(this, Jc);
    let r;
    switch (s) {
      case 1:
        r = y6.Gray8, E(this, Jc, (a, o, l) => function(h, u, f) {
          ls.qcms_convert_one(h, u, f);
        }(m(this, lo), 255 * a[o], l));
        break;
      case 3:
        r = y6.RGB8, E(this, Jc, (a, o, l) => function(h, u, f, d, p) {
          ls.qcms_convert_three(h, u, f, d, p);
        }(m(this, lo), 255 * a[o], 255 * a[o + 1], 255 * a[o + 2], l));
        break;
      case 4:
        r = y6.CMYK, E(this, Jc, (a, o, l) => function(h, u, f, d, p, g) {
          ls.qcms_convert_four(h, u, f, d, p, g);
        }(m(this, lo), 255 * a[o], 255 * a[o + 1], 255 * a[o + 2], 255 * a[o + 3], l));
        break;
      default:
        throw new Error(`Unsupported number of components: ${s}`);
    }
    if (E(this, lo, function(o, l, c) {
      const h = r_(o, ls.__wbindgen_malloc), u = rb;
      return ls.qcms_transformer_from_memory(h, u, l, c) >>> 0;
    }(e, r, jB.Perceptual)), !m(this, lo)) throw new Error("Failed to create ICC color space");
    m(Q0, d4).register(this, m(this, lo));
  }
  getRgbHex(e, n) {
    return m(this, Jc).call(this, e, n, !0), ni._cssColor;
  }
  getRgbItem(e, n, s, r) {
    ni._destBuffer = s, ni._destOffset = r, ni._destLength = 3, m(this, Jc).call(this, e, n, !1), ni._destBuffer = null;
  }
  getRgbBuffer(e, n, s, r, a, o, l) {
    if (e = e.subarray(n, n + s * this.numComps), o !== 8) {
      const c = 255 / ((1 << o) - 1);
      for (let h = 0, u = e.length; h < u; h++) e[h] *= c;
    }
    ni._mustAddAlpha = l && r.buffer === e.buffer, ni._destBuffer = r, ni._destOffset = a, ni._destLength = s * (3 + l), function(h, u) {
      const f = r_(u, ls.__wbindgen_malloc), d = rb;
      ls.qcms_convert_array(h, f, d);
    }(m(this, lo), e), ni._mustAddAlpha = !1, ni._destBuffer = null;
  }
  getOutputLength(e, n) {
    return e / this.numComps * (3 + n) | 0;
  }
  static setOptions({ useWasm: e, useWorkerFetch: n, wasmUrl: s }) {
    n ? (E(this, zd, e), E(this, Ud, s)) : E(this, zd, !1);
  }
  static get isUsable() {
    let e = !1;
    if (m(this, zd)) if (m(this, Ud)) try {
      this._module = function(s) {
        if (ls !== void 0) return ls;
        s !== void 0 && (Object.getPrototypeOf(s) === Object.prototype ? { module: s } = s : console.warn("using deprecated parameters for `initSync()`; pass a single object instead"));
        const r = GB();
        return s instanceof WebAssembly.Module || (s = new WebAssembly.Module(s)), VB(new WebAssembly.Instance(s, r), s);
      }({ module: KE(`${m(this, Ud)}qcms_bg.wasm`) }), e = !!this._module, ni._memory = this._module.memory, ni._makeHexColor = Ee.makeHexColor;
    } catch (n) {
      H(`ICCBased color space: "${n}".`);
    }
    else H("No ICC color space support due to missing `wasmUrl` API option");
    return At(this, "isUsable", e);
  }
};
lo = new WeakMap(), Jc = new WeakMap(), zd = new WeakMap(), Ud = new WeakMap(), d4 = new WeakMap(), F(Q0, zd, !0), F(Q0, Ud, null), F(Q0, d4, new FinalizationRegistry((e) => {
  (function(s) {
    ls.qcms_drop_transformer(s);
  })(e);
}));
let k1 = Q0;
var Hd;
const f4 = class f4 extends k1 {
  constructor() {
    super(new Uint8Array(KE(`${m(f4, Hd)}CGATS001Compat-v2-micro.icc`)), "DeviceCMYK", 4);
  }
  static setOptions({ iccUrl: t }) {
    E(this, Hd, t);
  }
  static get isUsable() {
    let t = !1;
    return k1.isUsable && (m(this, Hd) ? t = !0 : H("No CMYK ICC profile support due to missing `iccUrl` API option")), At(this, "isUsable", t);
  }
};
Hd = new WeakMap(), F(f4, Hd);
let rp = f4;
class gi extends oe {
  constructor(t, e, n, s) {
    super(), this.bytes = t instanceof Uint8Array ? t : new Uint8Array(t), this.start = e || 0, this.pos = this.start, this.end = e + n || this.bytes.length, this.dict = s;
  }
  get length() {
    return this.end - this.start;
  }
  get isEmpty() {
    return this.length === 0;
  }
  getByte() {
    return this.pos >= this.end ? -1 : this.bytes[this.pos++];
  }
  getBytes(t) {
    const e = this.bytes, n = this.pos, s = this.end;
    if (!t) return e.subarray(n, s);
    let r = n + t;
    return r > s && (r = s), this.pos = r, e.subarray(n, r);
  }
  getByteRange(t, e) {
    return t < 0 && (t = 0), e > this.end && (e = this.end), this.bytes.subarray(t, e);
  }
  reset() {
    this.pos = this.start;
  }
  moveStart() {
    this.start = this.pos;
  }
  makeSubStream(t, e, n = null) {
    return new gi(this.bytes.buffer, t, e, n);
  }
}
class fs extends gi {
  constructor(t) {
    super(Dn(t));
  }
}
class ub extends gi {
  constructor() {
    super(new Uint8Array(0));
  }
}
class tP extends gi {
  constructor(t, e, n) {
    super(new Uint8Array(t), 0, t, null), this.chunkSize = e, this._loadedChunks = /* @__PURE__ */ new Set(), this.numChunks = Math.ceil(t / e), this.manager = n, this.progressiveDataLength = 0, this.lastSuccessfulEnsureByteChunk = -1;
  }
  getMissingChunks() {
    const t = [];
    for (let e = 0, n = this.numChunks; e < n; ++e) this._loadedChunks.has(e) || t.push(e);
    return t;
  }
  get numChunksLoaded() {
    return this._loadedChunks.size;
  }
  get isDataLoaded() {
    return this.numChunksLoaded === this.numChunks;
  }
  onReceiveData(t, e) {
    const n = this.chunkSize;
    if (t % n != 0) throw new Error(`Bad begin offset: ${t}`);
    const s = t + e.byteLength;
    if (s % n != 0 && s !== this.bytes.length) throw new Error(`Bad end offset: ${s}`);
    this.bytes.set(new Uint8Array(e), t);
    const r = Math.floor(t / n), a = Math.floor((s - 1) / n) + 1;
    for (let o = r; o < a; ++o) this._loadedChunks.add(o);
  }
  onReceiveProgressiveData(t) {
    let e = this.progressiveDataLength;
    const n = Math.floor(e / this.chunkSize);
    this.bytes.set(new Uint8Array(t), e), e += t.byteLength, this.progressiveDataLength = e;
    const s = e >= this.end ? this.numChunks : Math.floor(e / this.chunkSize);
    for (let r = n; r < s; ++r) this._loadedChunks.add(r);
  }
  ensureByte(t) {
    if (t < this.progressiveDataLength) return;
    const e = Math.floor(t / this.chunkSize);
    if (!(e > this.numChunks) && e !== this.lastSuccessfulEnsureByteChunk) {
      if (!this._loadedChunks.has(e)) throw new ti(t, t + 1);
      this.lastSuccessfulEnsureByteChunk = e;
    }
  }
  ensureRange(t, e) {
    if (t >= e || e <= this.progressiveDataLength) return;
    const n = Math.floor(t / this.chunkSize);
    if (n > this.numChunks) return;
    const s = Math.min(Math.floor((e - 1) / this.chunkSize) + 1, this.numChunks);
    for (let r = n; r < s; ++r) if (!this._loadedChunks.has(r)) throw new ti(t, e);
  }
  nextEmptyChunk(t) {
    const e = this.numChunks;
    for (let n = 0; n < e; ++n) {
      const s = (t + n) % e;
      if (!this._loadedChunks.has(s)) return s;
    }
    return null;
  }
  hasChunk(t) {
    return this._loadedChunks.has(t);
  }
  getByte() {
    const t = this.pos;
    return t >= this.end ? -1 : (t >= this.progressiveDataLength && this.ensureByte(t), this.bytes[this.pos++]);
  }
  getBytes(t) {
    const e = this.bytes, n = this.pos, s = this.end;
    if (!t)
      return s > this.progressiveDataLength && this.ensureRange(n, s), e.subarray(n, s);
    let r = n + t;
    return r > s && (r = s), r > this.progressiveDataLength && this.ensureRange(n, r), this.pos = r, e.subarray(n, r);
  }
  getByteRange(t, e) {
    return t < 0 && (t = 0), e > this.end && (e = this.end), e > this.progressiveDataLength && this.ensureRange(t, e), this.bytes.subarray(t, e);
  }
  makeSubStream(t, e, n = null) {
    e ? t + e > this.progressiveDataLength && this.ensureRange(t, t + e) : t >= this.progressiveDataLength && this.ensureByte(t);
    function s() {
    }
    s.prototype = Object.create(this), s.prototype.getMissingChunks = function() {
      const a = this.chunkSize, o = Math.floor(this.start / a), l = Math.floor((this.end - 1) / a) + 1, c = [];
      for (let h = o; h < l; ++h) this._loadedChunks.has(h) || c.push(h);
      return c;
    }, Object.defineProperty(s.prototype, "isDataLoaded", { get() {
      return this.numChunksLoaded === this.numChunks || this.getMissingChunks().length === 0;
    }, configurable: !0 });
    const r = new s();
    return r.pos = r.start = t, r.end = t + e || this.end, r.dict = n, r;
  }
  getBaseStreams() {
    return [this];
  }
}
class eP {
  constructor(t, e) {
    this.length = e.length, this.chunkSize = e.rangeChunkSize, this.stream = new tP(this.length, this.chunkSize, this), this.pdfNetworkStream = t, this.disableAutoFetch = e.disableAutoFetch, this.msgHandler = e.msgHandler, this.currRequestId = 0, this._chunksNeededByRequest = /* @__PURE__ */ new Map(), this._requestsByChunk = /* @__PURE__ */ new Map(), this._promisesByRequest = /* @__PURE__ */ new Map(), this.progressiveDataLength = 0, this.aborted = !1, this._loadedStreamCapability = Promise.withResolvers();
  }
  sendRequest(t, e) {
    const n = this.pdfNetworkStream.getRangeReader(t, e);
    n.isStreamingSupported || (n.onProgress = this.onProgress.bind(this));
    let s = [], r = 0;
    return new Promise((a, o) => {
      const l = ({ value: c, done: h }) => {
        try {
          if (h) {
            const u = LE(s);
            s = null, a(u);
            return;
          }
          r += c.byteLength, n.isStreamingSupported && this.onProgress({ loaded: r }), s.push(c), n.read().then(l, o);
        } catch (u) {
          o(u);
        }
      };
      n.read().then(l, o);
    }).then((a) => {
      this.aborted || this.onReceiveData({ chunk: a, begin: t });
    });
  }
  requestAllChunks(t = !1) {
    if (!t) {
      const e = this.stream.getMissingChunks();
      this._requestChunks(e);
    }
    return this._loadedStreamCapability.promise;
  }
  _requestChunks(t) {
    const e = this.currRequestId++, n = /* @__PURE__ */ new Set();
    this._chunksNeededByRequest.set(e, n);
    for (const a of t) this.stream.hasChunk(a) || n.add(a);
    if (n.size === 0) return Promise.resolve();
    const s = Promise.withResolvers();
    this._promisesByRequest.set(e, s);
    const r = [];
    for (const a of n) {
      let o = this._requestsByChunk.get(a);
      o || (o = [], this._requestsByChunk.set(a, o), r.push(a)), o.push(e);
    }
    if (r.length > 0) {
      const a = this.groupChunks(r);
      for (const o of a) {
        const l = o.beginChunk * this.chunkSize, c = Math.min(o.endChunk * this.chunkSize, this.length);
        this.sendRequest(l, c).catch(s.reject);
      }
    }
    return s.promise.catch((a) => {
      if (!this.aborted) throw a;
    });
  }
  getStream() {
    return this.stream;
  }
  requestRange(t, e) {
    e = Math.min(e, this.length);
    const n = this.getBeginChunk(t), s = this.getEndChunk(e), r = [];
    for (let a = n; a < s; ++a) r.push(a);
    return this._requestChunks(r);
  }
  requestRanges(t = []) {
    const e = [];
    for (const n of t) {
      const s = this.getBeginChunk(n.begin), r = this.getEndChunk(n.end);
      for (let a = s; a < r; ++a) e.includes(a) || e.push(a);
    }
    return e.sort((n, s) => n - s), this._requestChunks(e);
  }
  groupChunks(t) {
    const e = [];
    let n = -1, s = -1;
    for (let r = 0, a = t.length; r < a; ++r) {
      const o = t[r];
      n < 0 && (n = o), s >= 0 && s + 1 !== o && (e.push({ beginChunk: n, endChunk: s + 1 }), n = o), r + 1 === t.length && e.push({ beginChunk: n, endChunk: o + 1 }), s = o;
    }
    return e;
  }
  onProgress(t) {
    this.msgHandler.send("DocProgress", { loaded: this.stream.numChunksLoaded * this.chunkSize + t.loaded, total: this.length });
  }
  onReceiveData(t) {
    const e = t.chunk, n = t.begin === void 0, s = n ? this.progressiveDataLength : t.begin, r = s + e.byteLength, a = Math.floor(s / this.chunkSize), o = r < this.length ? Math.floor(r / this.chunkSize) : Math.ceil(r / this.chunkSize);
    n ? (this.stream.onReceiveProgressiveData(e), this.progressiveDataLength = r) : this.stream.onReceiveData(s, e), this.stream.isDataLoaded && this._loadedStreamCapability.resolve(this.stream);
    const l = [];
    for (let c = a; c < o; ++c) {
      const h = this._requestsByChunk.get(c);
      if (h) {
        this._requestsByChunk.delete(c);
        for (const u of h) {
          const f = this._chunksNeededByRequest.get(u);
          f.has(c) && f.delete(c), f.size > 0 || l.push(u);
        }
      }
    }
    if (!this.disableAutoFetch && this._requestsByChunk.size === 0) {
      let c;
      if (this.stream.numChunksLoaded === 1) {
        const h = this.stream.numChunks - 1;
        this.stream.hasChunk(h) || (c = h);
      } else c = this.stream.nextEmptyChunk(o);
      Number.isInteger(c) && this._requestChunks([c]);
    }
    for (const c of l) {
      const h = this._promisesByRequest.get(c);
      this._promisesByRequest.delete(c), h.resolve();
    }
    this.msgHandler.send("DocProgress", { loaded: this.stream.numChunksLoaded * this.chunkSize, total: this.length });
  }
  onError(t) {
    this._loadedStreamCapability.reject(t);
  }
  getBeginChunk(t) {
    return Math.floor(t / this.chunkSize);
  }
  getEndChunk(t) {
    return Math.floor((t - 1) / this.chunkSize) + 1;
  }
  abort(t) {
    var e;
    this.aborted = !0, (e = this.pdfNetworkStream) == null || e.cancelAllRequests(t);
    for (const n of this._promisesByRequest.values()) n.reject(t);
  }
}
function ZE(i) {
  switch (i.kind) {
    case V9:
      return db(i);
    case E2:
      return function({ src: e, srcPos: n = 0, dest: s, destPos: r = 0, width: a, height: o }) {
        let l = 0;
        const c = a * o * 3, h = c >> 2, u = new Uint32Array(e.buffer, n, h);
        if (Rs.isLittleEndian) {
          for (; l < h - 2; l += 3, r += 4) {
            const f = u[l], d = u[l + 1], p = u[l + 2];
            s[r] = 4278190080 | f, s[r + 1] = f >>> 24 | d << 8 | 4278190080, s[r + 2] = d >>> 16 | p << 16 | 4278190080, s[r + 3] = p >>> 8 | 4278190080;
          }
          for (let f = 4 * l, d = n + c; f < d; f += 3) s[r++] = e[f] | e[f + 1] << 8 | e[f + 2] << 16 | 4278190080;
        } else {
          for (; l < h - 2; l += 3, r += 4) {
            const f = u[l], d = u[l + 1], p = u[l + 2];
            s[r] = 255 | f, s[r + 1] = f << 24 | d >>> 8 | 255, s[r + 2] = d << 16 | p >>> 16 | 255, s[r + 3] = p << 8 | 255;
          }
          for (let f = 4 * l, d = n + c; f < d; f += 3) s[r++] = e[f] << 24 | e[f + 1] << 16 | e[f + 2] << 8 | 255;
        }
        return { srcPos: n + c, destPos: r };
      }(i);
  }
  return null;
}
function db({ src: i, srcPos: t = 0, dest: e, width: n, height: s, nonBlackColor: r = 4294967295, inverseDecode: a = !1 }) {
  const o = Rs.isLittleEndian ? 4278190080 : 255, [l, c] = a ? [r, o] : [o, r], h = n >> 3, u = 7 & n, f = i.length;
  e = new Uint32Array(e.buffer);
  let d = 0;
  for (let p = 0; p < s; p++) {
    for (const b = t + h; t < b; t++) {
      const y = t < f ? i[t] : 255;
      e[d++] = 128 & y ? c : l, e[d++] = 64 & y ? c : l, e[d++] = 32 & y ? c : l, e[d++] = 16 & y ? c : l, e[d++] = 8 & y ? c : l, e[d++] = 4 & y ? c : l, e[d++] = 2 & y ? c : l, e[d++] = 1 & y ? c : l;
    }
    if (u === 0) continue;
    const g = t < f ? i[t++] : 255;
    for (let b = 0; b < u; b++) e[d++] = g & 1 << 7 - b ? c : l;
  }
  return { srcPos: t, destPos: d };
}
var Cr, ng, p4, JE;
const dc = class dc {
  constructor(t, e) {
    F(this, p4);
    this._imgData = t, this._isMask = e;
  }
  static get canUseImageDecoder() {
    return At(this, "canUseImageDecoder", m(this, ng) ? ImageDecoder.isTypeSupported("image/bmp") : Promise.resolve(!1));
  }
  static needsToBeResized(t, e) {
    if (t <= m(this, Cr) && e <= m(this, Cr)) return !1;
    const { MAX_DIM: n } = this;
    if (t > n || e > n) return !0;
    const s = t * e;
    return this._hasMaxArea ? s > this.MAX_AREA : s < m(this, Cr) ** 2 ? !1 : this._areGoodDims(t, e) ? (E(this, Cr, Math.max(m(this, Cr), Math.floor(Math.sqrt(t * e)))), !1) : (E(this, Cr, this._guessMax(m(this, Cr), n, 128, 0)), s > (this.MAX_AREA = m(this, Cr) ** 2));
  }
  static getReducePowerForJPX(t, e, n) {
    const s = t * e, r = 2 ** 30 / (4 * n);
    if (!this.needsToBeResized(t, e)) return s > r ? Math.ceil(Math.log2(s / r)) : 0;
    const { MAX_DIM: a, MAX_AREA: o } = this, l = Math.max(t / a, e / a, Math.sqrt(s / Math.min(r, o)));
    return Math.ceil(Math.log2(l));
  }
  static get MAX_DIM() {
    return At(this, "MAX_DIM", this._guessMax(2048, 65537, 0, 1));
  }
  static get MAX_AREA() {
    return this._hasMaxArea = !0, At(this, "MAX_AREA", this._guessMax(m(this, Cr), this.MAX_DIM, 128, 0) ** 2);
  }
  static set MAX_AREA(t) {
    t >= 0 && (this._hasMaxArea = !0, At(this, "MAX_AREA", t));
  }
  static setOptions({ canvasMaxAreaInBytes: t = -1, isImageDecoderSupported: e = !1 }) {
    this._hasMaxArea || (this.MAX_AREA = t >> 2), E(this, ng, e);
  }
  static _areGoodDims(t, e) {
    try {
      const n = new OffscreenCanvas(t, e), s = n.getContext("2d");
      s.fillRect(0, 0, 1, 1);
      const r = s.getImageData(0, 0, 1, 1).data[3];
      return n.width = n.height = 1, r !== 0;
    } catch {
      return !1;
    }
  }
  static _guessMax(t, e, n, s) {
    for (; t + n + 1 < e; ) {
      const r = Math.floor((t + e) / 2), a = s || r;
      this._areGoodDims(r, a) ? t = r : e = r;
    }
    return t;
  }
  static async createImage(t, e = !1) {
    return new dc(t, e)._createImage();
  }
  async _createImage() {
    const { _imgData: t } = this, { width: e, height: n } = t;
    if (e * n * 4 > J8) {
      const v = D(this, p4, JE).call(this);
      if (v) return v;
    }
    const s = this._encodeBMP();
    let r, a;
    await dc.canUseImageDecoder ? (r = new ImageDecoder({ data: s, type: "image/bmp", preferAnimation: !1, transfer: [s.buffer] }), a = r.decode().catch((v) => (H(`BMP image decoding failed: ${v}`), createImageBitmap(new Blob([this._encodeBMP().buffer], { type: "image/bmp" })))).finally(() => {
      r.close();
    })) : a = createImageBitmap(new Blob([s.buffer], { type: "image/bmp" }));
    const { MAX_AREA: o, MAX_DIM: l } = dc, c = Math.max(e / l, n / l, Math.sqrt(e * n / o)), h = Math.max(c, 2), u = Math.round(10 * (c + 1.25)) / 10 / h, f = Math.floor(Math.log2(u)), d = new Array(f + 2).fill(2);
    d[0] = h, d.splice(-1, 1, u / (1 << f));
    let p = e, g = n;
    const b = await a;
    let y = b.image || b;
    for (const v of d) {
      const w = p, _ = g;
      p = Math.floor(p / v) - 1, g = Math.floor(g / v) - 1;
      const x = new OffscreenCanvas(p, g);
      x.getContext("2d").drawImage(y, 0, 0, w, _, 0, 0, p, g), y.close(), y = x.transferToImageBitmap();
    }
    return t.data = null, t.bitmap = y, t.width = p, t.height = g, t;
  }
  _encodeBMP() {
    const { width: t, height: e, kind: n } = this._imgData;
    let s, r = this._imgData.data, a = new Uint8Array(0), o = a, l = 0;
    switch (n) {
      case V9: {
        s = 1, a = new Uint8Array(this._isMask ? [255, 255, 255, 255, 0, 0, 0, 0] : [0, 0, 0, 0, 255, 255, 255, 255]);
        const g = t + 7 >> 3, b = g + 3 & -4;
        if (g !== b) {
          const y = new Uint8Array(b * e);
          let v = 0;
          for (let w = 0, _ = e * g; w < _; w += g, v += b) y.set(r.subarray(w, w + g), v);
          r = y;
        }
        break;
      }
      case E2:
        if (s = 24, 3 & t) {
          const g = 3 * t, b = g + 3 & -4, y = b - g, v = new Uint8Array(b * e);
          let w = 0;
          for (let _ = 0, x = e * g; _ < x; _ += g) {
            const k = r.subarray(_, _ + g);
            for (let S = 0; S < g; S += 3)
              v[w++] = k[S + 2], v[w++] = k[S + 1], v[w++] = k[S];
            w += y;
          }
          r = v;
        } else for (let g = 0, b = r.length; g < b; g += 3) {
          const y = r[g];
          r[g] = r[g + 2], r[g + 2] = y;
        }
        break;
      case Zo:
        s = 32, l = 3, o = new Uint8Array(68);
        const p = new DataView(o.buffer);
        Rs.isLittleEndian ? (p.setUint32(0, 255, !0), p.setUint32(4, 65280, !0), p.setUint32(8, 16711680, !0), p.setUint32(12, 4278190080, !0)) : (p.setUint32(0, 4278190080, !0), p.setUint32(4, 16711680, !0), p.setUint32(8, 65280, !0), p.setUint32(12, 255, !0));
        break;
      default:
        throw new Error("invalid format");
    }
    let c = 0;
    const h = 40 + o.length, u = 14 + h + a.length + r.length, f = new Uint8Array(u), d = new DataView(f.buffer);
    return d.setUint16(c, 19778, !0), c += 2, d.setUint32(c, u, !0), c += 4, d.setUint32(c, 0, !0), c += 4, d.setUint32(c, 14 + h + a.length, !0), c += 4, d.setUint32(c, h, !0), c += 4, d.setInt32(c, t, !0), c += 4, d.setInt32(c, -e, !0), c += 4, d.setUint16(c, 1, !0), c += 2, d.setUint16(c, s, !0), c += 2, d.setUint32(c, l, !0), c += 4, d.setUint32(c, 0, !0), c += 4, d.setInt32(c, 0, !0), c += 4, d.setInt32(c, 0, !0), c += 4, d.setUint32(c, a.length / 4, !0), c += 4, d.setUint32(c, 0, !0), c += 4, f.set(o, c), c += o.length, f.set(a, c), c += a.length, f.set(r, c), f;
  }
};
Cr = new WeakMap(), ng = new WeakMap(), p4 = new WeakSet(), JE = function() {
  const { _imgData: t } = this, { data: e, width: n, height: s, kind: r } = t, a = n * s * 4, o = Math.ceil(Math.log2(a / J8)), l = n >> o, c = s >> o;
  let h, u = s;
  try {
    h = new Uint8Array(a);
  } catch {
    let w = Math.floor(Math.log2(a + 1));
    for (; ; ) try {
      h = new Uint8Array(2 ** w - 1);
      break;
    } catch {
      w -= 1;
    }
    u = Math.floor((2 ** w - 1) / (4 * n));
    const _ = n * u * 4;
    _ < h.length && (h = new Uint8Array(_));
  }
  const f = new Uint32Array(h.buffer), d = new Uint32Array(l * c);
  let p = 0, g = 0;
  const b = Math.ceil(s / u), y = s % u == 0 ? s : s % u;
  for (let w = 0; w < b; w++) {
    const _ = w < b - 1 ? u : y;
    ({ srcPos: p } = ZE({ kind: r, src: e, dest: f, width: n, height: _, inverseDecode: this._isMask, srcPos: p }));
    for (let x = 0, k = _ >> o; x < k; x++) {
      const S = f.subarray((x << o) * n);
      for (let T = 0; T < l; T++) d[g++] = S[T << o];
    }
  }
  if (dc.needsToBeResized(l, c))
    return t.data = d, t.width = l, t.height = c, t.kind = Zo, null;
  const v = new OffscreenCanvas(l, c);
  return v.getContext("2d", { willReadFrequently: !0 }).putImageData(new ImageData(new Uint8ClampedArray(d.buffer), l, c), 0, 0), t.data = null, t.bitmap = v.transferToImageBitmap(), t.width = l, t.height = c, t;
}, F(dc, Cr, 2048), F(dc, ng, Rs.isImageDecoderSupported);
let aa = dc;
const iP = new Uint8Array(0);
class ps extends oe {
  constructor(t) {
    if (super(), this._rawMinBufferLength = t || 0, this.pos = 0, this.bufferLength = 0, this.eof = !1, this.buffer = iP, this.minBufferLength = 512, t) for (; this.minBufferLength < t; ) this.minBufferLength *= 2;
  }
  get isEmpty() {
    for (; !this.eof && this.bufferLength === 0; ) this.readBlock();
    return this.bufferLength === 0;
  }
  ensureBuffer(t) {
    const e = this.buffer;
    if (t <= e.byteLength) return e;
    let n = this.minBufferLength;
    for (; n < t; ) n *= 2;
    const s = new Uint8Array(n);
    return s.set(e), this.buffer = s;
  }
  getByte() {
    const t = this.pos;
    for (; this.bufferLength <= t; ) {
      if (this.eof) return -1;
      this.readBlock();
    }
    return this.buffer[this.pos++];
  }
  getBytes(t, e = null) {
    const n = this.pos;
    let s;
    if (t) {
      for (this.ensureBuffer(n + t), s = n + t; !this.eof && this.bufferLength < s; ) this.readBlock(e);
      const r = this.bufferLength;
      s > r && (s = r);
    } else {
      for (; !this.eof; ) this.readBlock(e);
      s = this.bufferLength;
    }
    return this.pos = s, this.buffer.subarray(n, s);
  }
  async getImageData(t, e) {
    if (!this.canAsyncDecodeImageFromBuffer) return this.isAsyncDecoder ? this.decodeImage(null, e) : this.getBytes(t, e);
    const n = await this.stream.asyncGetBytes();
    return this.decodeImage(n, e);
  }
  reset() {
    this.pos = 0;
  }
  makeSubStream(t, e, n = null) {
    if (e === void 0) for (; !this.eof; ) this.readBlock();
    else {
      const s = t + e;
      for (; this.bufferLength <= s && !this.eof; ) this.readBlock();
    }
    return new gi(this.buffer, t, e, n);
  }
  getBaseStreams() {
    return this.str ? this.str.getBaseStreams() : null;
  }
}
class nP extends ps {
  constructor(t, e = null) {
    t = t.filter((s) => s instanceof oe);
    let n = 0;
    for (const s of t) n += s instanceof ps ? s._rawMinBufferLength : s.length;
    super(n), this.streams = t, this._onError = e;
  }
  readBlock() {
    var a;
    const t = this.streams;
    if (t.length === 0) {
      this.eof = !0;
      return;
    }
    const e = t.shift();
    let n;
    try {
      n = e.getBytes();
    } catch (o) {
      if (this._onError) {
        this._onError(o, (a = e.dict) == null ? void 0 : a.objId);
        return;
      }
      throw o;
    }
    const s = this.bufferLength, r = s + n.length;
    this.ensureBuffer(r).set(n, s), this.bufferLength = r;
  }
  getBaseStreams() {
    const t = [];
    for (const e of this.streams) {
      const n = e.getBaseStreams();
      n && t.push(...n);
    }
    return t.length > 0 ? t : null;
  }
}
var Ta, b2, b9;
class Se {
  static parse({ cs: t, xref: e, resources: n = null, pdfFunctionFactory: s, globalColorSpaceCache: r, localColorSpaceCache: a, asyncIfNotCached: o = !1 }) {
    const l = { xref: e, resources: n, pdfFunctionFactory: s, globalColorSpaceCache: r, localColorSpaceCache: a };
    let c, h, u;
    if (t instanceof Dt) {
      h = t;
      const f = r.getByRef(h) || a.getByRef(h);
      if (f) return f;
      t = e.fetch(t);
    }
    if (t instanceof lt) {
      c = t.name;
      const f = a.getByName(c);
      if (f) return f;
    }
    try {
      u = D(this, Ta, b9).call(this, t, l);
    } catch (f) {
      if (o && !(f instanceof ti)) return Promise.reject(f);
      throw f;
    }
    return (c || h) && (a.set(c, h, u), h && r.set(null, h, u)), o ? Promise.resolve(u) : u;
  }
  static get gray() {
    return At(this, "gray", new YB());
  }
  static get rgb() {
    return At(this, "rgb", new KB());
  }
  static get rgba() {
    return At(this, "rgba", new ZB());
  }
  static get cmyk() {
    if (rp.isUsable) try {
      return At(this, "cmyk", new rp());
    } catch {
      H("CMYK fallback: DeviceCMYK");
    }
    return At(this, "cmyk", new jE());
  }
}
Ta = new WeakSet(), b2 = function(t, e) {
  const { globalColorSpaceCache: n } = e;
  let s;
  if (t instanceof Dt) {
    s = t;
    const a = n.getByRef(s);
    if (a) return a;
  }
  const r = D(this, Ta, b9).call(this, t, e);
  return s && n.set(null, s, r), r;
}, b9 = function(t, e) {
  const { xref: n, resources: s, pdfFunctionFactory: r, globalColorSpaceCache: a } = e;
  if ((t = n.fetchIfRef(t)) instanceof lt) switch (t.name) {
    case "G":
    case "DeviceGray":
      return this.gray;
    case "RGB":
    case "DeviceRGB":
      return this.rgb;
    case "DeviceRGBA":
      return this.rgba;
    case "CMYK":
    case "DeviceCMYK":
      return this.cmyk;
    case "Pattern":
      return new a_(null);
    default:
      if (s instanceof Z) {
        const o = s.get("ColorSpace");
        if (o instanceof Z) {
          const l = o.get(t.name);
          if (l) {
            if (l instanceof lt) return D(this, Ta, b9).call(this, l, e);
            t = l;
            break;
          }
        }
      }
      return H(`Unrecognized ColorSpace: ${t.name}`), this.gray;
  }
  if (Array.isArray(t)) {
    const o = n.fetchIfRef(t[0]).name;
    let l, c, h, u, f, d;
    switch (o) {
      case "G":
      case "DeviceGray":
        return this.gray;
      case "RGB":
      case "DeviceRGB":
        return this.rgb;
      case "CMYK":
      case "DeviceCMYK":
        return this.cmyk;
      case "CalGray":
        return l = n.fetchIfRef(t[1]), u = l.getArray("WhitePoint"), f = l.getArray("BlackPoint"), d = l.get("Gamma"), new JB(u, f, d);
      case "CalRGB":
        l = n.fetchIfRef(t[1]), u = l.getArray("WhitePoint"), f = l.getArray("BlackPoint"), d = l.getArray("Gamma");
        const p = l.getArray("Matrix");
        return new lb(u, f, d, p);
      case "ICCBased":
        const g = t[1] instanceof Dt;
        if (g) {
          const T = a.getByRef(t[1]);
          if (T) return T;
        }
        const b = n.fetchIfRef(t[1]), y = b.dict;
        if (c = y.get("N"), k1.isUsable) try {
          const T = new k1(b.getBytes(), "ICCBased", c);
          return g && a.set(null, t[1], T), T;
        } catch (T) {
          if (T instanceof ti) throw T;
          H(`ICCBased color space (${t[1]}): "${T}".`);
        }
        const v = y.getRaw("Alternate");
        if (v) {
          const T = D(this, Ta, b2).call(this, v, e);
          if (T.numComps === c) return T;
          H("ICCBased color space: Ignoring incorrect /Alternate entry.");
        }
        if (c === 1) return this.gray;
        if (c === 3) return this.rgb;
        if (c === 4) return this.cmyk;
        break;
      case "Pattern":
        return h = t[1] || null, h && (h = D(this, Ta, b2).call(this, h, e)), new a_(h);
      case "I":
      case "Indexed":
        h = D(this, Ta, b2).call(this, t[1], e);
        const w = Tn(n.fetchIfRef(t[2]), 0, 255), _ = n.fetchIfRef(t[3]);
        return new XB(h, w, _);
      case "Separation":
      case "DeviceN":
        const x = n.fetchIfRef(t[1]);
        c = Array.isArray(x) ? x.length : 1, h = D(this, Ta, b2).call(this, t[2], e);
        const k = r.create(t[3]);
        return new WB(c, h, k);
      case "Lab":
        l = n.fetchIfRef(t[1]), u = l.getArray("WhitePoint"), f = l.getArray("BlackPoint");
        const S = l.getArray("Range");
        return new QB(u, f, S);
      default:
        return H(`Unimplemented ColorSpace object: ${o}`), this.gray;
    }
  }
  return H(`Unrecognized ColorSpace object: ${t}`), this.gray;
}, F(Se, Ta);
class Er extends bs {
  constructor(t) {
    super(t, "JpegError");
  }
}
class fb extends bs {
  constructor(t, e) {
    super(t, "DNLMarkerError"), this.scanLines = e;
  }
}
class QE extends bs {
  constructor(t) {
    super(t, "EOIMarkerError");
  }
}
const T2 = new Uint8Array([0, 1, 8, 16, 9, 2, 3, 10, 17, 24, 32, 25, 18, 11, 4, 5, 12, 19, 26, 33, 40, 48, 41, 34, 27, 20, 13, 6, 7, 14, 21, 28, 35, 42, 49, 56, 57, 50, 43, 36, 29, 22, 15, 23, 30, 37, 44, 51, 58, 59, 52, 45, 38, 31, 39, 46, 53, 60, 61, 54, 47, 55, 62, 63]), Yg = 4017, Kg = 799, Zg = 3406, Jg = 2276, Qg = 1567, t5 = 3784, z1 = 5793, e5 = 2896;
function sP(i, t) {
  let e, n, s = 0, r = 16;
  for (; r > 0 && !i[r - 1]; ) r--;
  const a = [{ children: [], index: 0 }];
  let o, l = a[0];
  for (e = 0; e < r; e++) {
    for (n = 0; n < i[e]; n++) {
      for (l = a.pop(), l.children[l.index] = t[s]; l.index > 0; ) l = a.pop();
      for (l.index++, a.push(l); a.length <= e; )
        a.push(o = { children: [], index: 0 }), l.children[l.index] = o.children, l = o;
      s++;
    }
    e + 1 < r && (a.push(o = { children: [], index: 0 }), l.children[l.index] = o.children, l = o);
  }
  return a[0].children;
}
function pb(i, t, e) {
  return 64 * ((i.blocksPerLine + 1) * t + e);
}
function rP(i, t, e, n, s, r, a, o, l, c = !1) {
  const h = e.mcusPerLine, u = e.progressive, f = t;
  let d = 0, p = 0;
  function g() {
    if (p > 0)
      return p--, d >> p & 1;
    if (d = i[t++], d === 255) {
      const N = i[t++];
      if (N) {
        if (N === 220 && c) {
          const Q = pe(i, t += 2);
          if (t += 2, Q > 0 && Q !== e.scanLines) throw new fb("Found DNL marker (0xFFDC) while parsing scan data", Q);
        } else if (N === 217) {
          if (c) {
            const Q = k * (e.precision === 8 ? 8 : 0);
            if (Q > 0 && Math.round(e.scanLines / Q) >= 5) throw new fb("Found EOI marker (0xFFD9) while parsing scan data, possibly caused by incorrect `scanLines` parameter", Q);
          }
          throw new QE("Found EOI marker (0xFFD9) while parsing scan data");
        }
        throw new Er(`unexpected marker ${(d << 8 | N).toString(16)}`);
      }
    }
    return p = 7, d >>> 7;
  }
  function b(N) {
    let Q = N;
    for (; ; ) {
      switch (Q = Q[g()], typeof Q) {
        case "number":
          return Q;
        case "object":
          continue;
      }
      throw new Er("invalid huffman sequence");
    }
  }
  function y(N) {
    let Q = 0;
    for (; N > 0; )
      Q = Q << 1 | g(), N--;
    return Q;
  }
  function v(N) {
    if (N === 1) return g() === 1 ? 1 : -1;
    const Q = y(N);
    return Q >= 1 << N - 1 ? Q : Q + (-1 << N) + 1;
  }
  let w = 0, _, x = 0, k = 0;
  function S(N, Q, Y, et, $) {
    const dt = Y % h;
    k = (Y / h | 0) * N.v + et;
    const tt = dt * N.h + $;
    Q(N, pb(N, k, tt));
  }
  function T(N, Q, Y) {
    k = Y / N.blocksPerLine | 0;
    const et = Y % N.blocksPerLine;
    Q(N, pb(N, k, et));
  }
  const I = n.length;
  let R, B, L, it, O, at;
  at = u ? r === 0 ? o === 0 ? function(Q, Y) {
    const et = b(Q.huffmanTableDC), $ = et === 0 ? 0 : v(et) << l;
    Q.blockData[Y] = Q.pred += $;
  } : function(Q, Y) {
    Q.blockData[Y] |= g() << l;
  } : o === 0 ? function(Q, Y) {
    if (w > 0) {
      w--;
      return;
    }
    let et = r;
    const $ = a;
    for (; et <= $; ) {
      const dt = b(Q.huffmanTableAC), tt = 15 & dt, ut = dt >> 4;
      if (tt === 0) {
        if (ut < 15) {
          w = y(ut) + (1 << ut) - 1;
          break;
        }
        et += 16;
        continue;
      }
      et += ut;
      const St = T2[et];
      Q.blockData[Y + St] = v(tt) * (1 << l), et++;
    }
  } : function(Q, Y) {
    let et = r;
    const $ = a;
    let dt, tt, ut = 0;
    for (; et <= $; ) {
      const St = Y + T2[et], G = Q.blockData[St] < 0 ? -1 : 1;
      switch (x) {
        case 0:
          if (tt = b(Q.huffmanTableAC), dt = 15 & tt, ut = tt >> 4, dt === 0) ut < 15 ? (w = y(ut) + (1 << ut), x = 4) : (ut = 16, x = 1);
          else {
            if (dt !== 1) throw new Er("invalid ACn encoding");
            _ = v(dt), x = ut ? 2 : 3;
          }
          continue;
        case 1:
        case 2:
          Q.blockData[St] ? Q.blockData[St] += G * (g() << l) : (ut--, ut === 0 && (x = x === 2 ? 3 : 0));
          break;
        case 3:
          Q.blockData[St] ? Q.blockData[St] += G * (g() << l) : (Q.blockData[St] = _ << l, x = 0);
          break;
        case 4:
          Q.blockData[St] && (Q.blockData[St] += G * (g() << l));
      }
      et++;
    }
    x === 4 && (w--, w === 0 && (x = 0));
  } : function(Q, Y) {
    const et = b(Q.huffmanTableDC), $ = et === 0 ? 0 : v(et);
    Q.blockData[Y] = Q.pred += $;
    let dt = 1;
    for (; dt < 64; ) {
      const tt = b(Q.huffmanTableAC), ut = 15 & tt, St = tt >> 4;
      if (ut === 0) {
        if (St < 15) break;
        dt += 16;
        continue;
      }
      dt += St;
      const G = T2[dt];
      Q.blockData[Y + G] = v(ut), dt++;
    }
  };
  let W, q = 0;
  const K = I === 1 ? n[0].blocksPerLine * n[0].blocksPerColumn : h * e.mcusPerColumn;
  let z, j;
  for (; q <= K; ) {
    const N = s ? Math.min(K - q, s) : K;
    if (N > 0) {
      for (B = 0; B < I; B++) n[B].pred = 0;
      if (w = 0, I === 1)
        for (R = n[0], O = 0; O < N; O++)
          T(R, at, q), q++;
      else for (O = 0; O < N; O++) {
        for (B = 0; B < I; B++)
          for (R = n[B], z = R.h, j = R.v, L = 0; L < j; L++) for (it = 0; it < z; it++) S(R, at, q, L, it);
        q++;
      }
    }
    if (p = 0, W = R4(i, t), !W || (W.invalid && (H(`decodeScan - ${N > 0 ? "unexpected" : "excessive"} MCU data, current marker is: ${W.invalid}`), t = W.offset), !(W.marker >= 65488 && W.marker <= 65495))) break;
    t += 2;
  }
  return t - f;
}
function aP(i, t, e) {
  const n = i.quantizationTable, s = i.blockData;
  let r, a, o, l, c, h, u, f, d, p, g, b, y, v, w, _, x;
  if (!n) throw new Er("missing required Quantization Table.");
  for (let k = 0; k < 64; k += 8)
    d = s[t + k], p = s[t + k + 1], g = s[t + k + 2], b = s[t + k + 3], y = s[t + k + 4], v = s[t + k + 5], w = s[t + k + 6], _ = s[t + k + 7], d *= n[k], p | g | b | y | v | w | _ ? (p *= n[k + 1], g *= n[k + 2], b *= n[k + 3], y *= n[k + 4], v *= n[k + 5], w *= n[k + 6], _ *= n[k + 7], r = z1 * d + 128 >> 8, a = z1 * y + 128 >> 8, o = g, l = w, c = e5 * (p - _) + 128 >> 8, f = e5 * (p + _) + 128 >> 8, h = b << 4, u = v << 4, r = r + a + 1 >> 1, a = r - a, x = o * t5 + l * Qg + 128 >> 8, o = o * Qg - l * t5 + 128 >> 8, l = x, c = c + u + 1 >> 1, u = c - u, f = f + h + 1 >> 1, h = f - h, r = r + l + 1 >> 1, l = r - l, a = a + o + 1 >> 1, o = a - o, x = c * Jg + f * Zg + 2048 >> 12, c = c * Zg - f * Jg + 2048 >> 12, f = x, x = h * Kg + u * Yg + 2048 >> 12, h = h * Yg - u * Kg + 2048 >> 12, u = x, e[k] = r + f, e[k + 7] = r - f, e[k + 1] = a + u, e[k + 6] = a - u, e[k + 2] = o + h, e[k + 5] = o - h, e[k + 3] = l + c, e[k + 4] = l - c) : (x = z1 * d + 512 >> 10, e[k] = x, e[k + 1] = x, e[k + 2] = x, e[k + 3] = x, e[k + 4] = x, e[k + 5] = x, e[k + 6] = x, e[k + 7] = x);
  for (let k = 0; k < 8; ++k)
    d = e[k], p = e[k + 8], g = e[k + 16], b = e[k + 24], y = e[k + 32], v = e[k + 40], w = e[k + 48], _ = e[k + 56], p | g | b | y | v | w | _ ? (r = z1 * d + 2048 >> 12, a = z1 * y + 2048 >> 12, o = g, l = w, c = e5 * (p - _) + 2048 >> 12, f = e5 * (p + _) + 2048 >> 12, h = b, u = v, r = 4112 + (r + a + 1 >> 1), a = r - a, x = o * t5 + l * Qg + 2048 >> 12, o = o * Qg - l * t5 + 2048 >> 12, l = x, c = c + u + 1 >> 1, u = c - u, f = f + h + 1 >> 1, h = f - h, r = r + l + 1 >> 1, l = r - l, a = a + o + 1 >> 1, o = a - o, x = c * Jg + f * Zg + 2048 >> 12, c = c * Zg - f * Jg + 2048 >> 12, f = x, x = h * Kg + u * Yg + 2048 >> 12, h = h * Yg - u * Kg + 2048 >> 12, u = x, d = r + f, _ = r - f, p = a + u, w = a - u, g = o + h, v = o - h, b = l + c, y = l - c, d < 16 ? d = 0 : d >= 4080 ? d = 255 : d >>= 4, p < 16 ? p = 0 : p >= 4080 ? p = 255 : p >>= 4, g < 16 ? g = 0 : g >= 4080 ? g = 255 : g >>= 4, b < 16 ? b = 0 : b >= 4080 ? b = 255 : b >>= 4, y < 16 ? y = 0 : y >= 4080 ? y = 255 : y >>= 4, v < 16 ? v = 0 : v >= 4080 ? v = 255 : v >>= 4, w < 16 ? w = 0 : w >= 4080 ? w = 255 : w >>= 4, _ < 16 ? _ = 0 : _ >= 4080 ? _ = 255 : _ >>= 4, s[t + k] = d, s[t + k + 8] = p, s[t + k + 16] = g, s[t + k + 24] = b, s[t + k + 32] = y, s[t + k + 40] = v, s[t + k + 48] = w, s[t + k + 56] = _) : (x = z1 * d + 8192 >> 14, x = x < -2040 ? 0 : x >= 2024 ? 255 : x + 2056 >> 4, s[t + k] = x, s[t + k + 8] = x, s[t + k + 16] = x, s[t + k + 24] = x, s[t + k + 32] = x, s[t + k + 40] = x, s[t + k + 48] = x, s[t + k + 56] = x);
}
function oP(i, t) {
  const e = t.blocksPerLine, n = t.blocksPerColumn, s = new Int16Array(64);
  for (let r = 0; r < n; r++) for (let a = 0; a < e; a++)
    aP(t, pb(t, r, a), s);
  return t.blockData;
}
function R4(i, t, e = t) {
  const n = i.length - 1;
  let s = e < t ? e : t;
  if (t >= n) return null;
  const r = pe(i, t);
  if (r >= 65472 && r <= 65534) return { invalid: null, marker: r, offset: t };
  let a = pe(i, s);
  for (; !(a >= 65472 && a <= 65534); ) {
    if (++s >= n) return null;
    a = pe(i, s);
  }
  return { invalid: r.toString(16), marker: a, offset: s };
}
function lP(i) {
  const t = Math.ceil(i.samplesPerLine / 8 / i.maxH), e = Math.ceil(i.scanLines / 8 / i.maxV);
  for (const n of i.components) {
    const s = Math.ceil(Math.ceil(i.samplesPerLine / 8) * n.h / i.maxH), r = Math.ceil(Math.ceil(i.scanLines / 8) * n.v / i.maxV), a = t * n.h, o = 64 * (e * n.v) * (a + 1);
    n.blockData = new Int16Array(o), n.blocksPerLine = s, n.blocksPerColumn = r;
  }
  i.mcusPerLine = t, i.mcusPerColumn = e;
}
function o_(i, t) {
  const e = pe(i, t);
  let n = (t += 2) + e - 2;
  const s = R4(i, n, t);
  s != null && s.invalid && (H("readDataBlock - incorrect length, current marker is: " + s.invalid), n = s.offset);
  const r = i.subarray(t, n);
  return { appData: r, oldOffset: t, newOffset: t + r.length };
}
function cP(i, t) {
  const e = pe(i, t), n = (t += 2) + e - 2, s = R4(i, n, t);
  return s != null && s.invalid ? s.offset : n;
}
class l_ {
  constructor({ decodeTransform: t = null, colorTransform: e = -1 } = {}) {
    this._decodeTransform = t, this._colorTransform = e;
  }
  static canUseImageDecoder(t, e = -1) {
    let n = null, s = 0, r = null, a = pe(t, s);
    if (s += 2, a !== 65496) throw new Er("SOI not found");
    a = pe(t, s), s += 2;
    t: for (; a !== 65497; ) {
      switch (a) {
        case 65505:
          const { appData: o, oldOffset: l, newOffset: c } = o_(t, s);
          if (s = c, o[0] === 69 && o[1] === 120 && o[2] === 105 && o[3] === 102 && o[4] === 0 && o[5] === 0) {
            if (n) throw new Er("Duplicate EXIF-blocks found.");
            n = { exifStart: l + 6, exifEnd: c };
          }
          a = pe(t, s), s += 2;
          continue;
        case 65472:
        case 65473:
        case 65474:
          r = t[s + 7];
          break t;
        case 65535:
          t[s] !== 255 && s--;
      }
      s = cP(t, s), a = pe(t, s), s += 2;
    }
    return r === 4 || r === 3 && e === 0 ? null : n || {};
  }
  parse(t, { dnlScanLines: e = null } = {}) {
    let n, s, r = 0, a = null, o = null, l = 0;
    const c = [], h = [], u = [];
    let f = pe(t, r);
    if (r += 2, f !== 65496) throw new Er("SOI not found");
    f = pe(t, r), r += 2;
    t: for (; f !== 65497; ) {
      let d, p, g;
      switch (f) {
        case 65504:
        case 65505:
        case 65506:
        case 65507:
        case 65508:
        case 65509:
        case 65510:
        case 65511:
        case 65512:
        case 65513:
        case 65514:
        case 65515:
        case 65516:
        case 65517:
        case 65518:
        case 65519:
        case 65534:
          const { appData: b, newOffset: y } = o_(t, r);
          r = y, f === 65504 && b[0] === 74 && b[1] === 70 && b[2] === 73 && b[3] === 70 && b[4] === 0 && (a = { version: { major: b[5], minor: b[6] }, densityUnits: b[7], xDensity: b[8] << 8 | b[9], yDensity: b[10] << 8 | b[11], thumbWidth: b[12], thumbHeight: b[13], thumbData: b.subarray(14, 14 + 3 * b[12] * b[13]) }), f === 65518 && b[0] === 65 && b[1] === 100 && b[2] === 111 && b[3] === 98 && b[4] === 101 && (o = { version: b[5] << 8 | b[6], flags0: b[7] << 8 | b[8], flags1: b[9] << 8 | b[10], transformCode: b[11] });
          break;
        case 65499:
          const v = pe(t, r);
          r += 2;
          const w = v + r - 2;
          let _;
          for (; r < w; ) {
            const q = t[r++], K = new Uint16Array(64);
            if (q >> 4) {
              if (q >> 4 != 1) throw new Er("DQT - invalid table spec");
              for (p = 0; p < 64; p++)
                _ = T2[p], K[_] = pe(t, r), r += 2;
            } else for (p = 0; p < 64; p++)
              _ = T2[p], K[_] = t[r++];
            c[15 & q] = K;
          }
          break;
        case 65472:
        case 65473:
        case 65474:
          if (n) throw new Er("Only single frame JPEGs supported");
          r += 2, n = {}, n.extended = f === 65473, n.progressive = f === 65474, n.precision = t[r++];
          const x = pe(t, r);
          r += 2, n.scanLines = e || x, n.samplesPerLine = pe(t, r), r += 2, n.components = [], n.componentIds = {};
          const k = t[r++];
          let S = 0, T = 0;
          for (d = 0; d < k; d++) {
            const q = t[r], K = t[r + 1] >> 4, z = 15 & t[r + 1];
            S < K && (S = K), T < z && (T = z);
            const j = t[r + 2];
            g = n.components.push({ h: K, v: z, quantizationId: j, quantizationTable: null }), n.componentIds[q] = g - 1, r += 3;
          }
          n.maxH = S, n.maxV = T, lP(n);
          break;
        case 65476:
          const I = pe(t, r);
          for (r += 2, d = 2; d < I; ) {
            const q = t[r++], K = new Uint8Array(16);
            let z = 0;
            for (p = 0; p < 16; p++, r++) z += K[p] = t[r];
            const j = new Uint8Array(z);
            for (p = 0; p < z; p++, r++) j[p] = t[r];
            d += 17 + z, (q >> 4 ? h : u)[15 & q] = sP(K, j);
          }
          break;
        case 65501:
          r += 2, s = pe(t, r), r += 2;
          break;
        case 65498:
          const R = ++l == 1 && !e;
          r += 2;
          const B = t[r++], L = [];
          for (d = 0; d < B; d++) {
            const q = t[r++], K = n.componentIds[q], z = n.components[K];
            z.index = q;
            const j = t[r++];
            z.huffmanTableDC = u[j >> 4], z.huffmanTableAC = h[15 & j], L.push(z);
          }
          const it = t[r++], O = t[r++], at = t[r++];
          try {
            r += rP(t, r, n, L, s, it, O, at >> 4, 15 & at, R);
          } catch (q) {
            if (q instanceof fb)
              return H(`${q.message} -- attempting to re-parse the JPEG image.`), this.parse(t, { dnlScanLines: q.scanLines });
            if (q instanceof QE) {
              H(`${q.message} -- ignoring the rest of the image data.`);
              break t;
            }
            throw q;
          }
          break;
        case 65500:
          r += 4;
          break;
        case 65535:
          t[r] !== 255 && r--;
          break;
        default:
          const W = R4(t, r - 2, r - 3);
          if (W != null && W.invalid) {
            H("JpegImage.parse - unexpected data, current marker is: " + W.invalid), r = W.offset;
            break;
          }
          if (!W || r >= t.length - 1) {
            H("JpegImage.parse - reached the end of the image data without finding an EOI marker (0xFFD9).");
            break t;
          }
          throw new Er("JpegImage.parse - unknown marker: " + f.toString(16));
      }
      f = pe(t, r), r += 2;
    }
    if (!n) throw new Er("JpegImage.parse - no frame data found.");
    this.width = n.samplesPerLine, this.height = n.scanLines, this.jfif = a, this.adobe = o, this.components = [];
    for (const d of n.components) {
      const p = c[d.quantizationId];
      p && (d.quantizationTable = p), this.components.push({ index: d.index, output: oP(0, d), scaleX: d.h / n.maxH, scaleY: d.v / n.maxV, blocksPerLine: d.blocksPerLine, blocksPerColumn: d.blocksPerColumn });
    }
    this.numComponents = this.components.length;
  }
  _getLinearizedBlockData(t, e, n = !1) {
    const s = this.width / t, r = this.height / e;
    let a, o, l, c, h, u, f, d, p, g, b, y = 0;
    const v = this.components.length, w = t * e * v, _ = new Uint8ClampedArray(w), x = new Uint32Array(t), k = 4294967288;
    let S;
    for (f = 0; f < v; f++) {
      if (a = this.components[f], o = a.scaleX * s, l = a.scaleY * r, y = f, b = a.output, c = a.blocksPerLine + 1 << 3, o !== S) {
        for (h = 0; h < t; h++)
          d = 0 | h * o, x[h] = (d & k) << 3 | 7 & d;
        S = o;
      }
      for (u = 0; u < e; u++)
        for (d = 0 | u * l, g = c * (d & k) | (7 & d) << 3, h = 0; h < t; h++)
          _[y] = b[g + x[h]], y += v;
    }
    let T = this._decodeTransform;
    if (n || v !== 4 || T || (T = new Int32Array([-256, 255, -256, 255, -256, 255, -256, 255])), T) for (f = 0; f < w; ) for (d = 0, p = 0; d < v; d++, f++, p += 2) _[f] = (_[f] * T[p] >> 8) + T[p + 1];
    return _;
  }
  get _isColorConversionNeeded() {
    return this.adobe ? !!this.adobe.transformCode : this.numComponents === 3 ? this._colorTransform !== 0 && (this.components[0].index !== 82 || this.components[1].index !== 71 || this.components[2].index !== 66) : this._colorTransform === 1;
  }
  _convertYccToRgb(t) {
    let e, n, s;
    for (let r = 0, a = t.length; r < a; r += 3)
      e = t[r], n = t[r + 1], s = t[r + 2], t[r] = e - 179.456 + 1.402 * s, t[r + 1] = e + 135.459 - 0.344 * n - 0.714 * s, t[r + 2] = e - 226.816 + 1.772 * n;
    return t;
  }
  _convertYccToRgba(t, e) {
    for (let n = 0, s = 0, r = t.length; n < r; n += 3, s += 4) {
      const a = t[n], o = t[n + 1], l = t[n + 2];
      e[s] = a - 179.456 + 1.402 * l, e[s + 1] = a + 135.459 - 0.344 * o - 0.714 * l, e[s + 2] = a - 226.816 + 1.772 * o, e[s + 3] = 255;
    }
    return e;
  }
  _convertYcckToRgb(t) {
    return this._convertYcckToCmyk(t), this._convertCmykToRgb(t);
  }
  _convertYcckToRgba(t) {
    return this._convertYcckToCmyk(t), this._convertCmykToRgba(t);
  }
  _convertYcckToCmyk(t) {
    let e, n, s;
    for (let r = 0, a = t.length; r < a; r += 4)
      e = t[r], n = t[r + 1], s = t[r + 2], t[r] = 434.456 - e - 1.402 * s, t[r + 1] = 119.541 - e + 0.344 * n + 0.714 * s, t[r + 2] = 481.816 - e - 1.772 * n;
    return t;
  }
  _convertCmykToRgb(t) {
    const e = t.length / 4;
    return Se.cmyk.getRgbBuffer(t, 0, e, t, 0, 8, 0), t.subarray(0, 3 * e);
  }
  _convertCmykToRgba(t) {
    if (Se.cmyk.getRgbBuffer(t, 0, t.length / 4, t, 0, 8, 1), Se.cmyk instanceof jE) for (let e = 3, n = t.length; e < n; e += 4) t[e] = 255;
    return t;
  }
  getData({ width: t, height: e, forceRGBA: n = !1, forceRGB: s = !1, isSourcePDF: r = !1 }) {
    if (this.numComponents > 4) throw new Er("Unsupported color mode");
    const a = this._getLinearizedBlockData(t, e, r);
    if (this.numComponents === 1 && (n || s)) {
      const o = a.length * (n ? 4 : 3), l = new Uint8ClampedArray(o);
      let c = 0;
      if (n) (function(u, f) {
        if (Rs.isLittleEndian) for (let d = 0, p = u.length; d < p; d++) f[d] = 65793 * u[d] | 4278190080;
        else for (let d = 0, p = u.length; d < p; d++) f[d] = 16843008 * u[d] | 255;
      })(a, new Uint32Array(l.buffer));
      else for (const h of a)
        l[c++] = h, l[c++] = h, l[c++] = h;
      return l;
    }
    if (this.numComponents === 3 && this._isColorConversionNeeded) {
      if (n) {
        const o = new Uint8ClampedArray(a.length / 3 * 4);
        return this._convertYccToRgba(a, o);
      }
      return this._convertYccToRgb(a);
    }
    if (this.numComponents === 4) {
      if (this._isColorConversionNeeded) return n ? this._convertYcckToRgba(a) : s ? this._convertYcckToRgb(a) : this._convertYcckToCmyk(a);
      if (n) return this._convertCmykToRgba(a);
      if (s) return this._convertCmykToRgb(a);
    }
    return a;
  }
}
var sg, rg, mb;
const m4 = class m4 extends ps {
  constructor(e, n, s) {
    super(n);
    F(this, rg);
    this.stream = e, this.dict = e.dict, this.maybeLength = n, this.params = s;
  }
  static get canUseImageDecoder() {
    return At(this, "canUseImageDecoder", m(this, sg) ? ImageDecoder.isTypeSupported("image/jpeg") : Promise.resolve(!1));
  }
  static setOptions({ isImageDecoderSupported: e = !1 }) {
    E(this, sg, e);
  }
  get bytes() {
    return At(this, "bytes", this.stream.getBytes(this.maybeLength));
  }
  ensureBuffer(e) {
  }
  readBlock() {
    this.decodeImage();
  }
  get jpegOptions() {
    const e = { decodeTransform: void 0, colorTransform: void 0 }, n = this.dict.getArray("D", "Decode");
    if ((this.forceRGBA || this.forceRGB) && Array.isArray(n)) {
      const s = this.dict.get("BPC", "BitsPerComponent") || 8, r = n.length, a = new Int32Array(r);
      let o = !1;
      const l = (1 << s) - 1;
      for (let c = 0; c < r; c += 2)
        a[c] = 256 * (n[c + 1] - n[c]) | 0, a[c + 1] = n[c] * l | 0, a[c] === 256 && a[c + 1] === 0 || (o = !0);
      o && (e.decodeTransform = a);
    }
    if (this.params instanceof Z) {
      const s = this.params.get("ColorTransform");
      Number.isInteger(s) && (e.colorTransform = s);
    }
    return At(this, "jpegOptions", e);
  }
  decodeImage(e) {
    if (this.eof) return this.buffer;
    e = D(this, rg, mb).call(this, e || this.bytes);
    const n = new l_(this.jpegOptions);
    n.parse(e);
    const s = n.getData({ width: this.drawWidth, height: this.drawHeight, forceRGBA: this.forceRGBA, forceRGB: this.forceRGB, isSourcePDF: !0 });
    return this.buffer = s, this.bufferLength = s.length, this.eof = !0, this.buffer;
  }
  get canAsyncDecodeImageFromBuffer() {
    return this.stream.isAsync;
  }
  async getTransferableImage() {
    if (!await m4.canUseImageDecoder) return null;
    const e = this.jpegOptions;
    if (e.decodeTransform) return null;
    let n;
    try {
      const s = this.canAsyncDecodeImageFromBuffer && await this.stream.asyncGetBytes() || this.bytes;
      if (!s) return null;
      let r = D(this, rg, mb).call(this, s);
      const a = l_.canUseImageDecoder(r, e.colorTransform);
      return a ? (a.exifStart && (r = r.slice(), r.fill(0, a.exifStart, a.exifEnd)), n = new ImageDecoder({ data: r, type: "image/jpeg", preferAnimation: !1 }), (await n.decode()).image) : null;
    } catch (s) {
      return H(`getTransferableImage - failed: "${s}".`), null;
    } finally {
      n == null || n.close();
    }
  }
};
sg = new WeakMap(), rg = new WeakSet(), mb = function(e) {
  for (let n = 0, s = e.length - 1; n < s; n++) if (e[n] === 255 && e[n + 1] === 216) {
    n > 0 && (e = e.subarray(n));
    break;
  }
  return e;
}, F(m4, sg, Rs.isImageDecoderSupported);
let tf = m4;
var hP = async function(i = {}) {
  var t, e, n = i, s = new Promise((G, V) => {
    t = G, e = V;
  }), r = "./this.program", a = (G, V) => {
    throw V;
  }, o = import.meta.url;
  try {
    new URL(".", o).href;
  } catch {
  }
  var l, c, h, u, f, d, p = console.log.bind(console), g = console.error.bind(console), b = !1;
  function y() {
    var G = l.buffer;
    h = new Int8Array(G), u = new Uint8Array(G), f = new Int32Array(G), d = new Uint32Array(G), new BigInt64Array(G), new BigUint64Array(G);
  }
  var v = 0, w = null;
  class _ {
    constructor(V) {
      ft(this, "name", "ExitStatus");
      this.message = `Program terminated with exit(${V})`, this.status = V;
    }
  }
  var x = (G) => {
    for (; G.length > 0; ) G.shift()(n);
  }, k = [], S = (G) => k.push(G), T = [], I = (G) => T.push(G), R = !0, B = 0, L = {}, it = (G) => {
    if (G instanceof _ || G == "unwind") return c;
    a(0, G);
  }, O = () => R || B > 0, at = (G) => {
    var V;
    c = G, O() || ((V = n.onExit) == null || V.call(n, G), b = !0), a(0, new _(G));
  }, W = (G, V) => {
    c = G, at(G);
  }, q = (G) => {
    if (!b) try {
      G(), (() => {
        if (!O()) try {
          W(c);
        } catch (V) {
          it(V);
        }
      })();
    } catch (V) {
      it(V);
    }
  }, K = (G) => {
    var V = (G - l.buffer.byteLength + 65535) / 65536 | 0;
    try {
      return l.grow(V), y(), 1;
    } catch {
    }
  }, z = {}, j = () => {
    if (!j.strings) {
      var G = { USER: "web_user", LOGNAME: "web_user", PATH: "/", PWD: "/", HOME: "/home/web_user", LANG: (typeof navigator == "object" && navigator.languages && navigator.languages[0] || "C").replace("-", "_") + ".UTF-8", _: r || "./this.program" };
      for (var V in z) z[V] === void 0 ? delete G[V] : G[V] = z[V];
      var nt = [];
      for (var V in G) nt.push(`${V}=${G[V]}`);
      j.strings = nt;
    }
    return j.strings;
  }, N = (G) => {
    for (var V = 0, nt = 0; nt < G.length; ++nt) {
      var gt = G.charCodeAt(nt);
      gt <= 127 ? V++ : gt <= 2047 ? V += 2 : gt >= 55296 && gt <= 57343 ? (V += 4, ++nt) : V += 3;
    }
    return V;
  }, Q = [null, [], []], Y = typeof TextDecoder < "u" ? new TextDecoder() : void 0, et = (G, V = 0, nt = NaN) => {
    for (var gt = V + nt, _t = V; G[_t] && !(_t >= gt); ) ++_t;
    if (_t - V > 16 && G.buffer && Y) return Y.decode(G.subarray(V, _t));
    for (var kt = ""; V < _t; ) {
      var xt = G[V++];
      if (128 & xt) {
        var wt = 63 & G[V++];
        if ((224 & xt) != 192) {
          var yt = 63 & G[V++];
          if ((xt = (240 & xt) == 224 ? (15 & xt) << 12 | wt << 6 | yt : (7 & xt) << 18 | wt << 12 | yt << 6 | 63 & G[V++]) < 65536) kt += String.fromCharCode(xt);
          else {
            var Ot = xt - 65536;
            kt += String.fromCharCode(55296 | Ot >> 10, 56320 | 1023 & Ot);
          }
        } else kt += String.fromCharCode((31 & xt) << 6 | wt);
      } else kt += String.fromCharCode(xt);
    }
    return kt;
  }, $ = (G, V) => {
    var nt = Q[G];
    V === 0 || V === 10 ? ((G === 1 ? p : g)(et(nt)), nt.length = 0) : nt.push(V);
  }, dt = (G, V) => G ? et(u, G, V) : "";
  n.noExitRuntime && (R = n.noExitRuntime), n.print && (p = n.print), n.printErr && (g = n.printErr), n.wasmBinary && n.wasmBinary, n.arguments && n.arguments, n.thisProgram && (r = n.thisProgram), n.writeArrayToMemory = (G, V) => {
    h.set(G, V);
  };
  var tt = { l: () => function(V) {
    var gt;
    (gt = n.onAbort) == null || gt.call(n, V), g(V = "Aborted(" + V + ")"), b = !0, V += ". Build with -sASSERTIONS for more info.";
    var nt = new WebAssembly.RuntimeError(V);
    throw e(nt), nt;
  }(""), k: () => {
    R = !1, B = 0;
  }, m: (G, V) => {
    if (L[G] && (clearTimeout(L[G].id), delete L[G]), !V) return 0;
    var nt = setTimeout(() => {
      delete L[G], q(() => St(G, performance.now()));
    }, V);
    return L[G] = { id: nt, timeout_ms: V }, 0;
  }, g: function(V, nt) {
    V >>= 2;
    const gt = n.imageData = new Uint8ClampedArray(nt), _t = f.subarray(V, V + nt);
    gt.set(_t);
  }, f: function(V, nt, gt, _t) {
    V >>= 2, nt >>= 2, gt >>= 2;
    const kt = n.imageData = new Uint8ClampedArray(3 * _t), xt = f.subarray(V, V + _t), wt = f.subarray(nt, nt + _t), yt = f.subarray(gt, gt + _t);
    for (let Ot = 0; Ot < _t; Ot++)
      kt[3 * Ot] = xt[Ot], kt[3 * Ot + 1] = wt[Ot], kt[3 * Ot + 2] = yt[Ot];
  }, e: function(V, nt, gt, _t, kt) {
    V >>= 2, nt >>= 2, gt >>= 2, _t >>= 2;
    const xt = n.imageData = new Uint8ClampedArray(4 * kt), wt = f.subarray(V, V + kt), yt = f.subarray(nt, nt + kt), Ot = f.subarray(gt, gt + kt), Kt = f.subarray(_t, _t + kt);
    for (let Ft = 0; Ft < kt; Ft++)
      xt[4 * Ft] = wt[Ft], xt[4 * Ft + 1] = yt[Ft], xt[4 * Ft + 2] = Ot[Ft], xt[4 * Ft + 3] = Kt[Ft];
  }, n: (G) => {
    var V, nt, gt = u.length, _t = 2147483648;
    if ((G >>>= 0) > _t) return !1;
    for (var kt = 1; kt <= 4; kt *= 2) {
      var xt = gt * (1 + 0.2 / kt);
      xt = Math.min(xt, G + 100663296);
      var wt = Math.min(_t, (V = Math.max(G, xt), nt = 65536, Math.ceil(V / nt) * nt));
      if (K(wt)) return !0;
    }
    return !1;
  }, p: (G, V) => {
    var nt = 0, gt = 0;
    for (var _t of j()) {
      var kt = V + nt;
      d[G + gt >> 2] = kt, nt += ((xt, wt, yt, Ot) => {
        for (var Kt = yt, Ft = yt + Ot - 1, It = 0; It < xt.length; ++It) {
          var Pt = xt.charCodeAt(It);
          if (Pt >= 55296 && Pt <= 57343 && (Pt = 65536 + ((1023 & Pt) << 10) | 1023 & xt.charCodeAt(++It)), Pt <= 127) {
            if (yt >= Ft) break;
            wt[yt++] = Pt;
          } else if (Pt <= 2047) {
            if (yt + 1 >= Ft) break;
            wt[yt++] = 192 | Pt >> 6, wt[yt++] = 128 | 63 & Pt;
          } else if (Pt <= 65535) {
            if (yt + 2 >= Ft) break;
            wt[yt++] = 224 | Pt >> 12, wt[yt++] = 128 | Pt >> 6 & 63, wt[yt++] = 128 | 63 & Pt;
          } else {
            if (yt + 3 >= Ft) break;
            wt[yt++] = 240 | Pt >> 18, wt[yt++] = 128 | Pt >> 12 & 63, wt[yt++] = 128 | Pt >> 6 & 63, wt[yt++] = 128 | 63 & Pt;
          }
        }
        return wt[yt] = 0, yt - Kt;
      })(_t, u, kt, 1 / 0) + 1, gt += 4;
    }
    return 0;
  }, q: (G, V) => {
    var nt = j();
    d[G >> 2] = nt.length;
    var gt = 0;
    for (var _t of nt) gt += N(_t) + 1;
    return d[V >> 2] = gt, 0;
  }, b: (G) => 52, o: function(V, nt, gt, _t) {
    return 70;
  }, c: (G, V, nt, gt) => {
    for (var _t = 0, kt = 0; kt < nt; kt++) {
      var xt = d[V >> 2], wt = d[V + 4 >> 2];
      V += 8;
      for (var yt = 0; yt < wt; yt++) $(G, u[xt + yt]);
      _t += wt;
    }
    return d[gt >> 2] = _t, 0;
  }, r: function(V, nt) {
    V >>= 2;
    const gt = n.imageData = new Uint8ClampedArray(4 * nt), _t = f.subarray(V, V + nt);
    for (let kt = 0; kt < nt; kt++)
      gt[4 * kt] = gt[4 * kt + 1] = gt[4 * kt + 2] = _t[kt], gt[4 * kt + 3] = 255;
  }, i: function(V, nt, gt) {
    V >>= 2, nt >>= 2;
    const _t = n.imageData = new Uint8ClampedArray(4 * gt), kt = f.subarray(V, V + gt), xt = f.subarray(nt, nt + gt);
    for (let wt = 0; wt < gt; wt++)
      _t[4 * wt] = _t[4 * wt + 1] = _t[4 * wt + 2] = kt[wt], _t[4 * wt + 3] = xt[wt];
  }, d: function(V) {
    const nt = dt(V);
    (n.warn || console.warn)(`OpenJPEG: ${nt}`);
  }, j: at, h: function(V, nt, gt, _t) {
    V >>= 2, nt >>= 2, gt >>= 2;
    const kt = n.imageData = new Uint8ClampedArray(4 * _t), xt = f.subarray(V, V + _t), wt = f.subarray(nt, nt + _t), yt = f.subarray(gt, gt + _t);
    for (let Ot = 0; Ot < _t; Ot++)
      kt[4 * Ot] = xt[Ot], kt[4 * Ot + 1] = wt[Ot], kt[4 * Ot + 2] = yt[Ot], kt[4 * Ot + 3] = 255;
  }, a: function(V) {
    const nt = dt(V);
    n.errorMessages ? n.errorMessages += `
` + nt : n.errorMessages = nt;
  } }, ut = await async function() {
    function V(gt, _t) {
      return ut = gt.exports, l = ut.s, y(), function(xt) {
        var yt;
        if (v--, (yt = n.monitorRunDependencies) == null || yt.call(n, v), v == 0 && w) {
          var wt = w;
          w = null, wt();
        }
      }(), ut;
    }
    (function(_t) {
      var kt;
      v++, (kt = n.monitorRunDependencies) == null || kt.call(n, v);
    })();
    var nt = /* @__PURE__ */ function() {
      return { a: tt };
    }();
    return new Promise((gt, _t) => {
      n.instantiateWasm(nt, (kt, xt) => {
        gt(V(kt));
      });
    });
  }(), St = (ut.t, n._malloc = ut.u, n._free = ut.v, n._jp2_decode = ut.w, ut.x);
  return function() {
    if (n.preInit)
      for (typeof n.preInit == "function" && (n.preInit = [n.preInit]); n.preInit.length > 0; ) n.preInit.shift()();
  }(), function G() {
    v > 0 ? w = G : (function() {
      if (n.preRun)
        for (typeof n.preRun == "function" && (n.preRun = [n.preRun]); n.preRun.length; ) I(n.preRun.shift());
      x(T);
    }(), v > 0 ? w = G : n.setStatus ? (n.setStatus("Running..."), setTimeout(() => {
      setTimeout(() => n.setStatus(""), 1), V();
    }, 1)) : V());
    function V() {
      var nt;
      n.calledRun = !0, b || (function() {
        ut.t();
      }(), t(n), (nt = n.onRuntimeInitialized) == null || nt.call(n), function() {
        if (n.postRun)
          for (typeof n.postRun == "function" && (n.postRun = [n.postRun]); n.postRun.length; ) S(n.postRun.shift());
        x(k);
      }());
    }
  }(), s;
};
const uP = hP;
class i5 extends bs {
  constructor(t) {
    super(t, "JpxError");
  }
}
var c1, jd, h1, ag, og, Gd, T1, gb, tD;
class va {
  static setOptions({ handler: t, useWasm: e, useWorkerFetch: n, wasmUrl: s }) {
    E(this, ag, e), E(this, og, n), E(this, Gd, s), n || E(this, jd, t);
  }
  static async decode(t, { numComponents: e = 4, isIndexedColormap: n = !1, smaskInData: s = !1, reducePower: r = 0 } = {}) {
    if (!m(this, h1)) {
      const { promise: l, resolve: c } = Promise.withResolvers(), h = [l];
      m(this, ag) ? h.push(uP({ warn: H, instantiateWasm: D(this, T1, tD).bind(this, c) })) : D(this, T1, gb).call(this, c), E(this, h1, Promise.race(h));
    }
    const a = await m(this, h1);
    if (!a) throw new i5("OpenJPEG failed to initialize");
    let o;
    try {
      const l = t.length;
      if (o = a._malloc(l), a.writeArrayToMemory(t, o), a._jp2_decode(o, l, e > 0 ? e : 0, !!n, !!s, r)) {
        const { errorMessages: h } = a;
        throw h ? (delete a.errorMessages, new i5(h)) : new i5("Unknown error");
      }
      const { imageData: c } = a;
      return a.imageData = null, c;
    } finally {
      o && a._free(o);
    }
  }
  static cleanup() {
    E(this, h1, null);
  }
  static parseImageProperties(t) {
    let e = t.getByte();
    for (; e >= 0; ) {
      const n = e;
      if (e = t.getByte(), (n << 8 | e) === 65361) {
        t.skip(4);
        const s = t.getInt32() >>> 0, r = t.getInt32() >>> 0, a = t.getInt32() >>> 0, o = t.getInt32() >>> 0;
        return t.skip(16), { width: s - a, height: r - o, bitsPerComponent: 8, componentsCount: t.getUint16() };
      }
    }
    throw new i5("No size marker found in JPX stream");
  }
}
c1 = new WeakMap(), jd = new WeakMap(), h1 = new WeakMap(), ag = new WeakMap(), og = new WeakMap(), Gd = new WeakMap(), T1 = new WeakSet(), gb = async function(t) {
  const e = `${m(this, Gd)}openjpeg_nowasm_fallback.js`;
  let n = null;
  try {
    n = (await import(
      /*webpackIgnore: true*/
      /*@vite-ignore*/
      e
    )).default();
  } catch (s) {
    H(`JpxImage#getJsModule: ${s}`);
  }
  t(n);
}, tD = async function(t, e, n) {
  const s = "openjpeg.wasm";
  try {
    return m(this, c1) || (m(this, og) ? E(this, c1, await ib(`${m(this, Gd)}${s}`)) : E(this, c1, await m(this, jd).sendWithPromise("FetchBinaryData", { type: "wasmFactory", filename: s }))), n((await WebAssembly.instantiate(m(this, c1), e)).instance);
  } catch (r) {
    return H(`JpxImage#instantiateWasm: ${r}`), D(this, T1, gb).call(this, t), null;
  } finally {
    E(this, jd, null);
  }
}, F(va, T1), F(va, c1, null), F(va, jd, null), F(va, h1, null), F(va, ag, !0), F(va, og, !0), F(va, Gd, null);
function Ag(i, t, e, n, s) {
  let r = i;
  for (let a = 0, o = t.length - 1; a < o; a++) {
    const l = t[a];
    r = r[l] || (r[l] = []);
  }
  r[t.at(-1)] = { checkFn: e, iterateFn: n, processFn: s };
}
const A1 = [];
Ag(A1, [Ma, Gl, r3, Ms], null, function(t, e) {
  const n = t.fnArray, s = (e - (t.iCurr - 3)) % 4;
  switch (s) {
    case 0:
      return n[e] === Ma;
    case 1:
      return n[e] === Gl;
    case 2:
      return n[e] === r3;
    case 3:
      return n[e] === Ms;
  }
  throw new Error(`iterateInlineImageGroup - invalid pos: ${s}`);
}, function(t, e) {
  const n = t.fnArray, s = t.argsArray, r = t.iCurr, a = r - 3, o = r - 2, l = r - 1, c = Math.min(Math.floor((e - a) / 4), 200);
  if (c < 10) return e - (e - a) % 4;
  let h = 0;
  const u = [];
  let f = 0, d = 1, p = 1;
  for (let _ = 0; _ < c; _++) {
    const x = s[o + (_ << 2)], k = s[l + (_ << 2)][0];
    d + k.width > 1e3 && (h = Math.max(h, d), p += f + 2, d = 0, f = 0), u.push({ transform: x, x: d, y: p, w: k.width, h: k.height }), d += k.width + 2, f = Math.max(f, k.height);
  }
  const g = Math.max(h, d) + 1, b = p + f + 1, y = new Uint8Array(g * b * 4), v = g << 2;
  for (let _ = 0; _ < c; _++) {
    const x = s[l + (_ << 2)][0].data, k = u[_].w << 2;
    let S = 0, T = u[_].x + u[_].y * g << 2;
    y.set(x.subarray(0, k), T - v);
    for (let I = 0, R = u[_].h; I < R; I++)
      y.set(x.subarray(S, S + k), T), S += k, T += v;
    for (y.set(x.subarray(S - k, S), T); T >= 0; )
      x[T - 4] = x[T], x[T - 3] = x[T + 1], x[T - 2] = x[T + 2], x[T - 1] = x[T + 3], x[T + k] = x[T + k - 4], x[T + k + 1] = x[T + k - 3], x[T + k + 2] = x[T + k - 2], x[T + k + 3] = x[T + k - 1], T -= v;
  }
  const w = { width: g, height: b };
  if (t.isOffscreenCanvasSupported) {
    const _ = new OffscreenCanvas(g, b);
    _.getContext("2d").putImageData(new ImageData(new Uint8ClampedArray(y.buffer), g, b), 0, 0), w.bitmap = _.transferToImageBitmap(), w.data = null;
  } else
    w.kind = Zo, w.data = y;
  return n.splice(a, 4 * c, RE), s.splice(a, 4 * c, [w, u]), a + 1;
});
Ag(A1, [Ma, Gl, Jd, Ms], null, function(t, e) {
  const n = t.fnArray, s = (e - (t.iCurr - 3)) % 4;
  switch (s) {
    case 0:
      return n[e] === Ma;
    case 1:
      return n[e] === Gl;
    case 2:
      return n[e] === Jd;
    case 3:
      return n[e] === Ms;
  }
  throw new Error(`iterateImageMaskGroup - invalid pos: ${s}`);
}, function(t, e) {
  const n = t.fnArray, s = t.argsArray, r = t.iCurr, a = r - 3, o = r - 2, l = r - 1;
  let c = Math.floor((e - a) / 4);
  if (c < 10) return e - (e - a) % 4;
  let h, u, f = !1;
  const d = s[l][0], p = s[o][0], g = s[o][1], b = s[o][2], y = s[o][3];
  if (g === b) {
    f = !0, h = o + 4;
    let v = l + 4;
    for (let w = 1; w < c; w++, h += 4, v += 4)
      if (u = s[h], s[v][0] !== d || u[0] !== p || u[1] !== g || u[2] !== b || u[3] !== y) {
        w < 10 ? f = !1 : c = w;
        break;
      }
  }
  if (f) {
    c = Math.min(c, 1e3);
    const v = new Float32Array(2 * c);
    h = o;
    for (let w = 0; w < c; w++, h += 4)
      u = s[h], v[w << 1] = u[4], v[1 + (w << 1)] = u[5];
    n.splice(a, 4 * c, TB), s.splice(a, 4 * c, [d, p, g, b, y, v]);
  } else {
    c = Math.min(c, 100);
    const v = [];
    for (let w = 0; w < c; w++) {
      u = s[o + (w << 2)];
      const _ = s[l + (w << 2)][0];
      v.push({ data: _.data, width: _.width, height: _.height, interpolate: _.interpolate, count: _.count, transform: u });
    }
    n.splice(a, 4 * c, EB), s.splice(a, 4 * c, [v]);
  }
  return a + 1;
});
Ag(A1, [Ma, Gl, Y8, Ms], function(i) {
  const t = i.argsArray, e = i.iCurr - 2;
  return t[e][1] === 0 && t[e][2] === 0;
}, function(t, e) {
  const n = t.fnArray, s = t.argsArray, r = (e - (t.iCurr - 3)) % 4;
  switch (r) {
    case 0:
      return n[e] === Ma;
    case 1:
      if (n[e] !== Gl) return !1;
      const a = t.iCurr - 2, o = s[a][0], l = s[a][3];
      return s[e][0] === o && s[e][1] === 0 && s[e][2] === 0 && s[e][3] === l;
    case 2:
      if (n[e] !== Y8) return !1;
      const c = s[t.iCurr - 1][0];
      return s[e][0] === c;
    case 3:
      return n[e] === Ms;
  }
  throw new Error(`iterateImageGroup - invalid pos: ${r}`);
}, function(i, t) {
  const e = i.fnArray, n = i.argsArray, s = i.iCurr, r = s - 3, a = s - 2, o = n[s - 1][0], l = n[a][0], c = n[a][3], h = Math.min(Math.floor((t - r) / 4), 1e3);
  if (h < 3) return t - (t - r) % 4;
  const u = new Float32Array(2 * h);
  let f = a;
  for (let p = 0; p < h; p++, f += 4) {
    const g = n[f];
    u[p << 1] = g[4], u[1 + (p << 1)] = g[5];
  }
  const d = [o, l, c, u];
  return e.splice(r, 4 * h, DB), n.splice(r, 4 * h, d), r + 1;
});
Ag(A1, [Z9, o0, x1, Tl, J9], null, function(t, e) {
  const n = t.fnArray, s = t.argsArray, r = (e - (t.iCurr - 4)) % 5;
  switch (r) {
    case 0:
      return n[e] === Z9;
    case 1:
      return n[e] === o0;
    case 2:
      return n[e] === x1;
    case 3:
      if (n[e] !== Tl) return !1;
      const a = t.iCurr - 3, o = s[a][0], l = s[a][1];
      return s[e][0] === o && s[e][1] === l;
    case 4:
      return n[e] === J9;
  }
  throw new Error(`iterateShowTextGroup - invalid pos: ${r}`);
}, function(i, t) {
  const e = i.fnArray, n = i.argsArray, s = i.iCurr, r = s - 4, a = s - 3, o = s - 2, l = s - 1, c = s, h = n[a][0], u = n[a][1];
  let f = Math.min(Math.floor((t - r) / 5), 1e3);
  if (f < 3) return t - (t - r) % 5;
  let d = r;
  r >= 4 && e[r - 4] === e[a] && e[r - 3] === e[o] && e[r - 2] === e[l] && e[r - 1] === e[c] && n[r - 4][0] === h && n[r - 4][1] === u && (f++, d -= 5);
  let p = d + 4;
  for (let g = 1; g < f; g++)
    e.splice(p, 3), n.splice(p, 3), p += 2;
  return p + 1;
});
Ag(A1, [Ma, Gl, m1, Ms], (i) => {
  const t = i.argsArray, e = t[i.iCurr - 1][0];
  if (e !== Ly && e !== X9 && e !== Oy && e !== $y && e !== Y9 && e !== K9) return !0;
  const n = t[i.iCurr - 2];
  return n[0] === 1 && n[1] === 0 && n[2] === 0 && n[3] === 1;
}, () => !1, (i, t) => {
  const { fnArray: e, argsArray: n } = i, s = i.iCurr, r = s - 3, a = s - 2, o = n[s - 1], l = n[a], [, [c], h] = o;
  if (h) {
    Ee.scaleMinMax(l, h);
    for (let u = 0, f = c.length; u < f; ) switch (c[u++]) {
      case m2:
      case L0:
        Ee.applyTransform(c, l, u), u += 2;
        break;
      case h9:
        Ee.applyTransformToBezier(c, l, u), u += 6;
    }
  }
  return e.splice(r, 4, m1), n.splice(r, 4, o), r + 1;
});
class eD {
  constructor(t) {
    this.queue = t;
  }
  _optimize() {
  }
  push(t, e) {
    this.queue.fnArray.push(t), this.queue.argsArray.push(e), this._optimize();
  }
  flush() {
  }
  reset() {
  }
}
class dP extends eD {
  constructor(t) {
    super(t), this.state = null, this.context = { iCurr: 0, fnArray: t.fnArray, argsArray: t.argsArray, isOffscreenCanvasSupported: Xn.isOffscreenCanvasSupported }, this.match = null, this.lastProcessed = 0;
  }
  _optimize() {
    const t = this.queue.fnArray;
    let e = this.lastProcessed, n = t.length, s = this.state, r = this.match;
    if (!s && !r && e + 1 === n && !A1[t[e]]) {
      this.lastProcessed = n;
      return;
    }
    const a = this.context;
    for (; e < n; ) {
      if (r) {
        if ((0, r.iterateFn)(a, e)) {
          e++;
          continue;
        }
        if (e = (0, r.processFn)(a, e + 1), n = t.length, r = null, s = null, e >= n) break;
      }
      s = (s || A1)[t[e]], s && !Array.isArray(s) ? (a.iCurr = e, e++, (!s.checkFn || (0, s.checkFn)(a)) && (r = s), s = null) : e++;
    }
    this.state = s, this.match = r, this.lastProcessed = e;
  }
  flush() {
    for (; this.match; ) {
      const t = this.queue.fnArray.length;
      this.lastProcessed = (0, this.match.processFn)(this.context, t), this.match = null, this.state = null, this._optimize();
    }
  }
  reset() {
    this.state = null, this.match = null, this.lastProcessed = 0;
  }
}
const Yo = class Yo {
  constructor(t = 0, e) {
    this._streamSink = e, this.fnArray = [], this.argsArray = [], this.optimizer = !e || t & CR ? new eD(this) : new dP(this), this.dependencies = /* @__PURE__ */ new Set(), this._totalLength = 0, this.weight = 0, this._resolved = e ? null : Promise.resolve();
  }
  static setOptions({ isOffscreenCanvasSupported: t }) {
    this.isOffscreenCanvasSupported = t;
  }
  get length() {
    return this.argsArray.length;
  }
  get ready() {
    return this._resolved || this._streamSink.ready;
  }
  get totalLength() {
    return this._totalLength + this.length;
  }
  addOp(t, e) {
    this.optimizer.push(t, e), this.weight++, this._streamSink && (this.weight >= Yo.CHUNK_SIZE || this.weight >= Yo.CHUNK_SIZE_ABOUT && (t === Ms || t === J9)) && this.flush();
  }
  addImageOps(t, e, n, s = !1) {
    s && (this.addOp(Ma), this.addOp(eh, [[["SMask", !1]]])), n !== void 0 && this.addOp(ho, ["OC", n]), this.addOp(t, e), n !== void 0 && this.addOp(Zd, []), s && this.addOp(Ms);
  }
  addDependency(t) {
    this.dependencies.has(t) || (this.dependencies.add(t), this.addOp(pB, [t]));
  }
  addDependencies(t) {
    for (const e of t) this.addDependency(e);
  }
  addOpList(t) {
    if (t instanceof Yo) {
      for (const e of t.dependencies) this.dependencies.add(e);
      for (let e = 0, n = t.length; e < n; e++) this.addOp(t.fnArray[e], t.argsArray[e]);
    } else H('addOpList - ignoring invalid "opList" parameter.');
  }
  getIR() {
    return { fnArray: this.fnArray, argsArray: this.argsArray, length: this.length };
  }
  get _transfers() {
    const t = [], { fnArray: e, argsArray: n, length: s } = this;
    for (let r = 0; r < s; r++) switch (e[r]) {
      case r3:
      case RE:
      case Jd: {
        const { bitmap: l, data: c } = n[r][0];
        (l || c != null && c.buffer) && t.push(l || c.buffer);
        break;
      }
      case m1: {
        const [, [l], c] = n[r];
        l && t.push(l.buffer, c.buffer);
        break;
      }
      case FE:
        const [a, o] = n[r];
        a && t.push(a.buffer), o && t.push(o.buffer);
        break;
      case x1:
        t.push(n[r][0].buffer);
    }
    return t;
  }
  flush(t = !1, e = null) {
    this.optimizer.flush();
    const n = this.length;
    this._totalLength += n, this._streamSink.enqueue({ fnArray: this.fnArray, argsArray: this.argsArray, lastChunk: t, separateAnnots: e, length: n }, 1, this._transfers), this.dependencies.clear(), this.fnArray.length = 0, this.argsArray.length = 0, this.weight = 0, this.optimizer.reset();
  }
};
ft(Yo, "CHUNK_SIZE", 1e3), ft(Yo, "CHUNK_SIZE_ABOUT", Yo.CHUNK_SIZE - 5), ft(Yo, "isOffscreenCanvasSupported", !1);
let Xn = Yo;
function Nn(i, t) {
  let e = 0;
  for (let n = 0; n <= t; n++) e = e << 8 | i[n];
  return e >>> 0;
}
function n5(i, t) {
  return t === 1 ? String.fromCharCode(i[0], i[1]) : t === 3 ? String.fromCharCode(i[0], i[1], i[2], i[3]) : String.fromCharCode(...i.subarray(0, t + 1));
}
function Jn(i, t, e) {
  let n = 0;
  for (let s = e; s >= 0; s--)
    n += i[s] + t[s], i[s] = 255 & n, n >>= 8;
}
function A0(i, t) {
  let e = 1;
  for (let n = t; n >= 0 && e > 0; n--)
    e += i[n], i[n] = 255 & e, e >>= 8;
}
const U1 = 16;
class fP {
  constructor(t) {
    this.buffer = t, this.pos = 0, this.end = t.length, this.tmpBuf = new Uint8Array(19);
  }
  readByte() {
    return this.pos >= this.end ? -1 : this.buffer[this.pos++];
  }
  readNumber() {
    let t, e = 0;
    do {
      const n = this.readByte();
      if (n < 0) throw new ht("unexpected EOF in bcmap");
      t = !(128 & n), e = e << 7 | 127 & n;
    } while (!t);
    return e;
  }
  readSigned() {
    const t = this.readNumber();
    return 1 & t ? ~(t >>> 1) : t >>> 1;
  }
  readHex(t, e) {
    t.set(this.buffer.subarray(this.pos, this.pos + e + 1)), this.pos += e + 1;
  }
  readHexNumber(t, e) {
    let n;
    const s = this.tmpBuf;
    let r = 0;
    do {
      const c = this.readByte();
      if (c < 0) throw new ht("unexpected EOF in bcmap");
      n = !(128 & c), s[r++] = 127 & c;
    } while (!n);
    let a = e, o = 0, l = 0;
    for (; a >= 0; ) {
      for (; l < 8 && s.length > 0; )
        o |= s[--r] << l, l += 7;
      t[a] = 255 & o, a--, o >>= 8, l -= 8;
    }
  }
  readHexSigned(t, e) {
    this.readHexNumber(t, e);
    const n = 1 & t[e] ? 255 : 0;
    let s = 0;
    for (let r = 0; r <= e; r++)
      s = (1 & s) << 8 | t[r], t[r] = s >> 1 ^ n;
  }
  readString() {
    const t = this.readNumber(), e = new Array(t);
    for (let n = 0; n < t; n++) e[n] = this.readNumber();
    return String.fromCharCode(...e);
  }
}
class pP {
  async process(t, e, n) {
    const s = new fP(t), r = s.readByte();
    e.vertical = !!(1 & r);
    let a = null;
    const o = new Uint8Array(U1), l = new Uint8Array(U1), c = new Uint8Array(U1), h = new Uint8Array(U1), u = new Uint8Array(U1);
    let f, d;
    for (; (d = s.readByte()) >= 0; ) {
      const p = d >> 5;
      if (p === 7) {
        switch (31 & d) {
          case 0:
            s.readString();
            break;
          case 1:
            a = s.readString();
        }
        continue;
      }
      const g = !!(16 & d), b = 15 & d;
      if (b + 1 > U1) throw new Error("BinaryCMapReader.process: Invalid dataSize.");
      const y = 1, v = s.readNumber();
      switch (p) {
        case 0:
          s.readHex(o, b), s.readHexNumber(l, b), Jn(l, o, b), e.addCodespaceRange(b + 1, Nn(o, b), Nn(l, b));
          for (let w = 1; w < v; w++)
            A0(l, b), s.readHexNumber(o, b), Jn(o, l, b), s.readHexNumber(l, b), Jn(l, o, b), e.addCodespaceRange(b + 1, Nn(o, b), Nn(l, b));
          break;
        case 1:
          s.readHex(o, b), s.readHexNumber(l, b), Jn(l, o, b), s.readNumber();
          for (let w = 1; w < v; w++)
            A0(l, b), s.readHexNumber(o, b), Jn(o, l, b), s.readHexNumber(l, b), Jn(l, o, b), s.readNumber();
          break;
        case 2:
          s.readHex(c, b), f = s.readNumber(), e.mapOne(Nn(c, b), f);
          for (let w = 1; w < v; w++)
            A0(c, b), g || (s.readHexNumber(u, b), Jn(c, u, b)), f = s.readSigned() + (f + 1), e.mapOne(Nn(c, b), f);
          break;
        case 3:
          s.readHex(o, b), s.readHexNumber(l, b), Jn(l, o, b), f = s.readNumber(), e.mapCidRange(Nn(o, b), Nn(l, b), f);
          for (let w = 1; w < v; w++)
            A0(l, b), g ? o.set(l) : (s.readHexNumber(o, b), Jn(o, l, b)), s.readHexNumber(l, b), Jn(l, o, b), f = s.readNumber(), e.mapCidRange(Nn(o, b), Nn(l, b), f);
          break;
        case 4:
          s.readHex(c, y), s.readHex(h, b), e.mapOne(Nn(c, y), n5(h, b));
          for (let w = 1; w < v; w++)
            A0(c, y), g || (s.readHexNumber(u, y), Jn(c, u, y)), A0(h, b), s.readHexSigned(u, b), Jn(h, u, b), e.mapOne(Nn(c, y), n5(h, b));
          break;
        case 5:
          s.readHex(o, y), s.readHexNumber(l, y), Jn(l, o, y), s.readHex(h, b), e.mapBfRange(Nn(o, y), Nn(l, y), n5(h, b));
          for (let w = 1; w < v; w++)
            A0(l, y), g ? o.set(l) : (s.readHexNumber(o, y), Jn(o, l, y)), s.readHexNumber(l, y), Jn(l, o, y), s.readHex(h, b), e.mapBfRange(Nn(o, y), Nn(l, y), n5(h, b));
          break;
        default:
          throw new Error(`BinaryCMapReader.process - unknown type: ${p}`);
      }
    }
    return a ? n(a) : e;
  }
}
class mP extends ps {
  constructor(t, e) {
    e && (e *= 0.8), super(e), this.str = t, this.dict = t.dict, this.input = new Uint8Array(5);
  }
  readBlock() {
    const t = this.str;
    let e = t.getByte();
    for (; or(e); ) e = t.getByte();
    if (e === -1 || e === 126) {
      this.eof = !0;
      return;
    }
    const n = this.bufferLength;
    let s, r;
    if (e === 122) {
      for (s = this.ensureBuffer(n + 4), r = 0; r < 4; ++r) s[n + r] = 0;
      this.bufferLength += 4;
    } else {
      const a = this.input;
      for (a[0] = e, r = 1; r < 5; ++r) {
        for (e = t.getByte(); or(e); ) e = t.getByte();
        if (a[r] = e, e === -1 || e === 126) break;
      }
      if (s = this.ensureBuffer(n + r - 1), this.bufferLength += r - 1, r < 5) {
        for (; r < 5; ++r) a[r] = 117;
        this.eof = !0;
      }
      let o = 0;
      for (r = 0; r < 5; ++r) o = 85 * o + (a[r] - 33);
      for (r = 3; r >= 0; --r)
        s[n + r] = 255 & o, o >>= 8;
    }
  }
}
class gP extends ps {
  constructor(t, e) {
    e && (e *= 0.5), super(e), this.str = t, this.dict = t.dict, this.firstDigit = -1;
  }
  readBlock() {
    const t = this.str.getBytes(8e3);
    if (!t.length) {
      this.eof = !0;
      return;
    }
    const e = t.length + 1 >> 1, n = this.ensureBuffer(this.bufferLength + e);
    let s = this.bufferLength, r = this.firstDigit;
    for (const a of t) {
      let o;
      if (a >= 48 && a <= 57) o = 15 & a;
      else {
        if (!(a >= 65 && a <= 70 || a >= 97 && a <= 102)) {
          if (a === 62) {
            this.eof = !0;
            break;
          }
          continue;
        }
        o = 9 + (15 & a);
      }
      r < 0 ? r = o : (n[s++] = r << 4 | o, r = -1);
    }
    r >= 0 && this.eof && (n[s++] = r << 4, r = -1), this.firstDigit = r, this.bufferLength = s;
  }
}
const $o = -1, c_ = [[-1, -1], [-1, -1], [7, 8], [7, 7], [6, 6], [6, 6], [6, 5], [6, 5], [4, 0], [4, 0], [4, 0], [4, 0], [4, 0], [4, 0], [4, 0], [4, 0], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [3, 3], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2], [1, 2]], h_ = [[-1, -1], [12, -2], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [12, 1984], [12, 2048], [12, 2112], [12, 2176], [12, 2240], [12, 2304], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [12, 2368], [12, 2432], [12, 2496], [12, 2560]], u_ = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [8, 29], [8, 29], [8, 30], [8, 30], [8, 45], [8, 45], [8, 46], [8, 46], [7, 22], [7, 22], [7, 22], [7, 22], [7, 23], [7, 23], [7, 23], [7, 23], [8, 47], [8, 47], [8, 48], [8, 48], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [6, 13], [7, 20], [7, 20], [7, 20], [7, 20], [8, 33], [8, 33], [8, 34], [8, 34], [8, 35], [8, 35], [8, 36], [8, 36], [8, 37], [8, 37], [8, 38], [8, 38], [7, 19], [7, 19], [7, 19], [7, 19], [8, 31], [8, 31], [8, 32], [8, 32], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 1], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [6, 12], [8, 53], [8, 53], [8, 54], [8, 54], [7, 26], [7, 26], [7, 26], [7, 26], [8, 39], [8, 39], [8, 40], [8, 40], [8, 41], [8, 41], [8, 42], [8, 42], [8, 43], [8, 43], [8, 44], [8, 44], [7, 21], [7, 21], [7, 21], [7, 21], [7, 28], [7, 28], [7, 28], [7, 28], [8, 61], [8, 61], [8, 62], [8, 62], [8, 63], [8, 63], [8, 0], [8, 0], [8, 320], [8, 320], [8, 384], [8, 384], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 10], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [5, 11], [7, 27], [7, 27], [7, 27], [7, 27], [8, 59], [8, 59], [8, 60], [8, 60], [9, 1472], [9, 1536], [9, 1600], [9, 1728], [7, 18], [7, 18], [7, 18], [7, 18], [7, 24], [7, 24], [7, 24], [7, 24], [8, 49], [8, 49], [8, 50], [8, 50], [8, 51], [8, 51], [8, 52], [8, 52], [7, 25], [7, 25], [7, 25], [7, 25], [8, 55], [8, 55], [8, 56], [8, 56], [8, 57], [8, 57], [8, 58], [8, 58], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 192], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [6, 1664], [8, 448], [8, 448], [8, 512], [8, 512], [9, 704], [9, 768], [8, 640], [8, 640], [8, 576], [8, 576], [9, 832], [9, 896], [9, 960], [9, 1024], [9, 1088], [9, 1152], [9, 1216], [9, 1280], [9, 1344], [9, 1408], [7, 256], [7, 256], [7, 256], [7, 256], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 2], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [4, 3], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 128], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 8], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [5, 9], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 16], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [6, 17], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 4], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [4, 5], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 14], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [6, 15], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [5, 64], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 6], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7], [4, 7]], d_ = [[-1, -1], [-1, -1], [12, -2], [12, -2], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [-1, -1], [11, 1792], [11, 1792], [11, 1792], [11, 1792], [12, 1984], [12, 1984], [12, 2048], [12, 2048], [12, 2112], [12, 2112], [12, 2176], [12, 2176], [12, 2240], [12, 2240], [12, 2304], [12, 2304], [11, 1856], [11, 1856], [11, 1856], [11, 1856], [11, 1920], [11, 1920], [11, 1920], [11, 1920], [12, 2368], [12, 2368], [12, 2432], [12, 2432], [12, 2496], [12, 2496], [12, 2560], [12, 2560], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [10, 18], [12, 52], [12, 52], [13, 640], [13, 704], [13, 768], [13, 832], [12, 55], [12, 55], [12, 56], [12, 56], [13, 1280], [13, 1344], [13, 1408], [13, 1472], [12, 59], [12, 59], [12, 60], [12, 60], [13, 1536], [13, 1600], [11, 24], [11, 24], [11, 24], [11, 24], [11, 25], [11, 25], [11, 25], [11, 25], [13, 1664], [13, 1728], [12, 320], [12, 320], [12, 384], [12, 384], [12, 448], [12, 448], [13, 512], [13, 576], [12, 53], [12, 53], [12, 54], [12, 54], [13, 896], [13, 960], [13, 1024], [13, 1088], [13, 1152], [13, 1216], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64], [10, 64]], f_ = [[8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [8, 13], [11, 23], [11, 23], [12, 50], [12, 51], [12, 44], [12, 45], [12, 46], [12, 47], [12, 57], [12, 58], [12, 61], [12, 256], [10, 16], [10, 16], [10, 16], [10, 16], [10, 17], [10, 17], [10, 17], [10, 17], [12, 48], [12, 49], [12, 62], [12, 63], [12, 30], [12, 31], [12, 32], [12, 33], [12, 40], [12, 41], [11, 22], [11, 22], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [8, 14], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 10], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [7, 11], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [9, 15], [12, 128], [12, 192], [12, 26], [12, 27], [12, 28], [12, 29], [11, 19], [11, 19], [11, 20], [11, 20], [12, 34], [12, 35], [12, 36], [12, 37], [12, 38], [12, 39], [11, 21], [11, 21], [12, 42], [12, 43], [10, 0], [10, 0], [10, 0], [10, 0], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12], [7, 12]], p_ = [[-1, -1], [-1, -1], [-1, -1], [-1, -1], [6, 9], [6, 8], [5, 7], [5, 7], [4, 6], [4, 6], [4, 6], [4, 6], [4, 5], [4, 5], [4, 5], [4, 5], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 1], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [3, 4], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 3], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2], [2, 2]];
class iD {
  constructor(t, e = {}) {
    if (typeof (t == null ? void 0 : t.next) != "function") throw new Error('CCITTFaxDecoder - invalid "source" parameter.');
    this.source = t, this.eof = !1, this.encoding = e.K || 0, this.eoline = e.EndOfLine || !1, this.byteAlign = e.EncodedByteAlign || !1, this.columns = e.Columns || 1728, this.rows = e.Rows || 0, this.eoblock = e.EndOfBlock ?? !0, this.black = e.BlackIs1 || !1, this.codingLine = new Uint32Array(this.columns + 1), this.refLine = new Uint32Array(this.columns + 2), this.codingLine[0] = this.columns, this.codingPos = 0, this.row = 0, this.nextLine2D = this.encoding < 0, this.inputBits = 0, this.inputBuf = 0, this.outputBits = 0, this.rowsDone = !1;
    let n;
    for (; (n = this._lookBits(12)) === 0; ) this._eatBits(1);
    n === 1 && this._eatBits(12), this.encoding > 0 && (this.nextLine2D = !this._lookBits(1), this._eatBits(1));
  }
  readNextChar() {
    if (this.eof) return -1;
    const t = this.refLine, e = this.codingLine, n = this.columns;
    let s, r, a, o, l;
    if (this.outputBits === 0) {
      if (this.rowsDone && (this.eof = !0), this.eof) return -1;
      this.err = !1;
      let c, h, u;
      if (this.nextLine2D) {
        for (o = 0; e[o] < n; ++o) t[o] = e[o];
        for (t[o++] = n, t[o] = n, e[0] = 0, this.codingPos = 0, s = 0, r = 0; e[this.codingPos] < n; )
          switch (c = this._getTwoDimCode(), c) {
            case 0:
              this._addPixels(t[s + 1], r), t[s + 1] < n && (s += 2);
              break;
            case 1:
              if (c = h = 0, r) {
                do
                  c += u = this._getBlackCode();
                while (u >= 64);
                do
                  h += u = this._getWhiteCode();
                while (u >= 64);
              } else {
                do
                  c += u = this._getWhiteCode();
                while (u >= 64);
                do
                  h += u = this._getBlackCode();
                while (u >= 64);
              }
              for (this._addPixels(e[this.codingPos] + c, r), e[this.codingPos] < n && this._addPixels(e[this.codingPos] + h, 1 ^ r); t[s] <= e[this.codingPos] && t[s] < n; ) s += 2;
              break;
            case 7:
              if (this._addPixels(t[s] + 3, r), r ^= 1, e[this.codingPos] < n)
                for (++s; t[s] <= e[this.codingPos] && t[s] < n; ) s += 2;
              break;
            case 5:
              if (this._addPixels(t[s] + 2, r), r ^= 1, e[this.codingPos] < n)
                for (++s; t[s] <= e[this.codingPos] && t[s] < n; ) s += 2;
              break;
            case 3:
              if (this._addPixels(t[s] + 1, r), r ^= 1, e[this.codingPos] < n)
                for (++s; t[s] <= e[this.codingPos] && t[s] < n; ) s += 2;
              break;
            case 2:
              if (this._addPixels(t[s], r), r ^= 1, e[this.codingPos] < n)
                for (++s; t[s] <= e[this.codingPos] && t[s] < n; ) s += 2;
              break;
            case 8:
              if (this._addPixelsNeg(t[s] - 3, r), r ^= 1, e[this.codingPos] < n)
                for (s > 0 ? --s : ++s; t[s] <= e[this.codingPos] && t[s] < n; ) s += 2;
              break;
            case 6:
              if (this._addPixelsNeg(t[s] - 2, r), r ^= 1, e[this.codingPos] < n)
                for (s > 0 ? --s : ++s; t[s] <= e[this.codingPos] && t[s] < n; ) s += 2;
              break;
            case 4:
              if (this._addPixelsNeg(t[s] - 1, r), r ^= 1, e[this.codingPos] < n)
                for (s > 0 ? --s : ++s; t[s] <= e[this.codingPos] && t[s] < n; ) s += 2;
              break;
            case $o:
              this._addPixels(n, 0), this.eof = !0;
              break;
            default:
              ue("bad 2d code"), this._addPixels(n, 0), this.err = !0;
          }
      } else
        for (e[0] = 0, this.codingPos = 0, r = 0; e[this.codingPos] < n; ) {
          if (c = 0, r) do
            c += u = this._getBlackCode();
          while (u >= 64);
          else do
            c += u = this._getWhiteCode();
          while (u >= 64);
          this._addPixels(e[this.codingPos] + c, r), r ^= 1;
        }
      let f = !1;
      if (this.byteAlign && (this.inputBits &= -8), this.eoblock || this.row !== this.rows - 1) {
        if (c = this._lookBits(12), this.eoline) for (; c !== $o && c !== 1; )
          this._eatBits(1), c = this._lookBits(12);
        else for (; c === 0; )
          this._eatBits(1), c = this._lookBits(12);
        c === 1 ? (this._eatBits(12), f = !0) : c === $o && (this.eof = !0);
      } else this.rowsDone = !0;
      if (!this.eof && this.encoding > 0 && !this.rowsDone && (this.nextLine2D = !this._lookBits(1), this._eatBits(1)), this.eoblock && f && this.byteAlign) {
        if (c = this._lookBits(12), c === 1) {
          if (this._eatBits(12), this.encoding > 0 && (this._lookBits(1), this._eatBits(1)), this.encoding >= 0) for (o = 0; o < 4; ++o)
            c = this._lookBits(12), c !== 1 && ue("bad rtc code: " + c), this._eatBits(12), this.encoding > 0 && (this._lookBits(1), this._eatBits(1));
          this.eof = !0;
        }
      } else if (this.err && this.eoline) {
        for (; ; ) {
          if (c = this._lookBits(13), c === $o)
            return this.eof = !0, -1;
          if (c >> 1 == 1) break;
          this._eatBits(1);
        }
        this._eatBits(12), this.encoding > 0 && (this._eatBits(1), this.nextLine2D = !(1 & c));
      }
      this.outputBits = e[0] > 0 ? e[this.codingPos = 0] : e[this.codingPos = 1], this.row++;
    }
    if (this.outputBits >= 8)
      l = 1 & this.codingPos ? 0 : 255, this.outputBits -= 8, this.outputBits === 0 && e[this.codingPos] < n && (this.codingPos++, this.outputBits = e[this.codingPos] - e[this.codingPos - 1]);
    else {
      a = 8, l = 0;
      do {
        if (typeof this.outputBits != "number") throw new ht('Invalid /CCITTFaxDecode data, "outputBits" must be a number.');
        this.outputBits > a ? (l <<= a, 1 & this.codingPos || (l |= 255 >> 8 - a), this.outputBits -= a, a = 0) : (l <<= this.outputBits, 1 & this.codingPos || (l |= 255 >> 8 - this.outputBits), a -= this.outputBits, this.outputBits = 0, e[this.codingPos] < n ? (this.codingPos++, this.outputBits = e[this.codingPos] - e[this.codingPos - 1]) : a > 0 && (l <<= a, a = 0));
      } while (a);
    }
    return this.black && (l ^= 255), l;
  }
  _addPixels(t, e) {
    const n = this.codingLine;
    let s = this.codingPos;
    t > n[s] && (t > this.columns && (ue("row is wrong length"), this.err = !0, t = this.columns), 1 & s ^ e && ++s, n[s] = t), this.codingPos = s;
  }
  _addPixelsNeg(t, e) {
    const n = this.codingLine;
    let s = this.codingPos;
    if (t > n[s])
      t > this.columns && (ue("row is wrong length"), this.err = !0, t = this.columns), 1 & s ^ e && ++s, n[s] = t;
    else if (t < n[s]) {
      for (t < 0 && (ue("invalid code"), this.err = !0, t = 0); s > 0 && t < n[s - 1]; ) --s;
      n[s] = t;
    }
    this.codingPos = s;
  }
  _findTableCode(t, e, n, s) {
    const r = s || 0;
    for (let a = t; a <= e; ++a) {
      let o = this._lookBits(a);
      if (o === $o) return [!0, 1, !1];
      if (a < e && (o <<= e - a), !r || o >= r) {
        const l = n[o - r];
        if (l[0] === a)
          return this._eatBits(a), [!0, l[1], !0];
      }
    }
    return [!1, 0, !1];
  }
  _getTwoDimCode() {
    let t, e = 0;
    if (this.eoblock) {
      if (e = this._lookBits(7), t = c_[e], (t == null ? void 0 : t[0]) > 0)
        return this._eatBits(t[0]), t[1];
    } else {
      const n = this._findTableCode(1, 7, c_);
      if (n[0] && n[2]) return n[1];
    }
    return ue("Bad two dim code"), $o;
  }
  _getWhiteCode() {
    let t, e = 0;
    if (this.eoblock) {
      if (e = this._lookBits(12), e === $o) return 1;
      if (t = e >> 5 ? u_[e >> 3] : h_[e], t[0] > 0)
        return this._eatBits(t[0]), t[1];
    } else {
      let n = this._findTableCode(1, 9, u_);
      if (n[0] || (n = this._findTableCode(11, 12, h_), n[0])) return n[1];
    }
    return ue("bad white code"), this._eatBits(1), 1;
  }
  _getBlackCode() {
    let t, e;
    if (this.eoblock) {
      if (t = this._lookBits(13), t === $o) return 1;
      if (e = t >> 7 ? !(t >> 9) && t >> 7 ? f_[(t >> 1) - 64] : p_[t >> 7] : d_[t], e[0] > 0)
        return this._eatBits(e[0]), e[1];
    } else {
      let n = this._findTableCode(2, 6, p_);
      if (n[0] || (n = this._findTableCode(7, 12, f_, 64), n[0]) || (n = this._findTableCode(10, 13, d_), n[0])) return n[1];
    }
    return ue("bad black code"), this._eatBits(1), 1;
  }
  _lookBits(t) {
    let e;
    for (; this.inputBits < t; ) {
      if ((e = this.source.next()) === -1) return this.inputBits === 0 ? $o : this.inputBuf << t - this.inputBits & 65535 >> 16 - t;
      this.inputBuf = this.inputBuf << 8 | e, this.inputBits += 8;
    }
    return this.inputBuf >> this.inputBits - t & 65535 >> 16 - t;
  }
  _eatBits(t) {
    (this.inputBits -= t) < 0 && (this.inputBits = 0);
  }
}
class bP extends ps {
  constructor(t, e, n) {
    super(e), this.str = t, this.dict = t.dict, n instanceof Z || (n = Z.empty);
    const s = { next: () => t.getByte() };
    this.ccittFaxDecoder = new iD(s, { K: n.get("K"), EndOfLine: n.get("EndOfLine"), EncodedByteAlign: n.get("EncodedByteAlign"), Columns: n.get("Columns"), Rows: n.get("Rows"), EndOfBlock: n.get("EndOfBlock"), BlackIs1: n.get("BlackIs1") });
  }
  readBlock() {
    for (; !this.eof; ) {
      const t = this.ccittFaxDecoder.readNextChar();
      if (t === -1) {
        this.eof = !0;
        return;
      }
      this.ensureBuffer(this.bufferLength + 1), this.buffer[this.bufferLength++] = t;
    }
  }
}
const m_ = new Int32Array([16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15]), yP = new Int32Array([3, 4, 5, 6, 7, 8, 9, 10, 65547, 65549, 65551, 65553, 131091, 131095, 131099, 131103, 196643, 196651, 196659, 196667, 262211, 262227, 262243, 262259, 327811, 327843, 327875, 327907, 258, 258, 258]), wP = new Int32Array([1, 2, 3, 4, 65541, 65543, 131081, 131085, 196625, 196633, 262177, 262193, 327745, 327777, 393345, 393409, 459009, 459137, 524801, 525057, 590849, 591361, 657409, 658433, 724993, 727041, 794625, 798721, 868353, 876545]), vP = [new Int32Array([459008, 524368, 524304, 524568, 459024, 524400, 524336, 590016, 459016, 524384, 524320, 589984, 524288, 524416, 524352, 590048, 459012, 524376, 524312, 589968, 459028, 524408, 524344, 590032, 459020, 524392, 524328, 59e4, 524296, 524424, 524360, 590064, 459010, 524372, 524308, 524572, 459026, 524404, 524340, 590024, 459018, 524388, 524324, 589992, 524292, 524420, 524356, 590056, 459014, 524380, 524316, 589976, 459030, 524412, 524348, 590040, 459022, 524396, 524332, 590008, 524300, 524428, 524364, 590072, 459009, 524370, 524306, 524570, 459025, 524402, 524338, 590020, 459017, 524386, 524322, 589988, 524290, 524418, 524354, 590052, 459013, 524378, 524314, 589972, 459029, 524410, 524346, 590036, 459021, 524394, 524330, 590004, 524298, 524426, 524362, 590068, 459011, 524374, 524310, 524574, 459027, 524406, 524342, 590028, 459019, 524390, 524326, 589996, 524294, 524422, 524358, 590060, 459015, 524382, 524318, 589980, 459031, 524414, 524350, 590044, 459023, 524398, 524334, 590012, 524302, 524430, 524366, 590076, 459008, 524369, 524305, 524569, 459024, 524401, 524337, 590018, 459016, 524385, 524321, 589986, 524289, 524417, 524353, 590050, 459012, 524377, 524313, 589970, 459028, 524409, 524345, 590034, 459020, 524393, 524329, 590002, 524297, 524425, 524361, 590066, 459010, 524373, 524309, 524573, 459026, 524405, 524341, 590026, 459018, 524389, 524325, 589994, 524293, 524421, 524357, 590058, 459014, 524381, 524317, 589978, 459030, 524413, 524349, 590042, 459022, 524397, 524333, 590010, 524301, 524429, 524365, 590074, 459009, 524371, 524307, 524571, 459025, 524403, 524339, 590022, 459017, 524387, 524323, 589990, 524291, 524419, 524355, 590054, 459013, 524379, 524315, 589974, 459029, 524411, 524347, 590038, 459021, 524395, 524331, 590006, 524299, 524427, 524363, 590070, 459011, 524375, 524311, 524575, 459027, 524407, 524343, 590030, 459019, 524391, 524327, 589998, 524295, 524423, 524359, 590062, 459015, 524383, 524319, 589982, 459031, 524415, 524351, 590046, 459023, 524399, 524335, 590014, 524303, 524431, 524367, 590078, 459008, 524368, 524304, 524568, 459024, 524400, 524336, 590017, 459016, 524384, 524320, 589985, 524288, 524416, 524352, 590049, 459012, 524376, 524312, 589969, 459028, 524408, 524344, 590033, 459020, 524392, 524328, 590001, 524296, 524424, 524360, 590065, 459010, 524372, 524308, 524572, 459026, 524404, 524340, 590025, 459018, 524388, 524324, 589993, 524292, 524420, 524356, 590057, 459014, 524380, 524316, 589977, 459030, 524412, 524348, 590041, 459022, 524396, 524332, 590009, 524300, 524428, 524364, 590073, 459009, 524370, 524306, 524570, 459025, 524402, 524338, 590021, 459017, 524386, 524322, 589989, 524290, 524418, 524354, 590053, 459013, 524378, 524314, 589973, 459029, 524410, 524346, 590037, 459021, 524394, 524330, 590005, 524298, 524426, 524362, 590069, 459011, 524374, 524310, 524574, 459027, 524406, 524342, 590029, 459019, 524390, 524326, 589997, 524294, 524422, 524358, 590061, 459015, 524382, 524318, 589981, 459031, 524414, 524350, 590045, 459023, 524398, 524334, 590013, 524302, 524430, 524366, 590077, 459008, 524369, 524305, 524569, 459024, 524401, 524337, 590019, 459016, 524385, 524321, 589987, 524289, 524417, 524353, 590051, 459012, 524377, 524313, 589971, 459028, 524409, 524345, 590035, 459020, 524393, 524329, 590003, 524297, 524425, 524361, 590067, 459010, 524373, 524309, 524573, 459026, 524405, 524341, 590027, 459018, 524389, 524325, 589995, 524293, 524421, 524357, 590059, 459014, 524381, 524317, 589979, 459030, 524413, 524349, 590043, 459022, 524397, 524333, 590011, 524301, 524429, 524365, 590075, 459009, 524371, 524307, 524571, 459025, 524403, 524339, 590023, 459017, 524387, 524323, 589991, 524291, 524419, 524355, 590055, 459013, 524379, 524315, 589975, 459029, 524411, 524347, 590039, 459021, 524395, 524331, 590007, 524299, 524427, 524363, 590071, 459011, 524375, 524311, 524575, 459027, 524407, 524343, 590031, 459019, 524391, 524327, 589999, 524295, 524423, 524359, 590063, 459015, 524383, 524319, 589983, 459031, 524415, 524351, 590047, 459023, 524399, 524335, 590015, 524303, 524431, 524367, 590079]), 9], _P = [new Int32Array([327680, 327696, 327688, 327704, 327684, 327700, 327692, 327708, 327682, 327698, 327690, 327706, 327686, 327702, 327694, 0, 327681, 327697, 327689, 327705, 327685, 327701, 327693, 327709, 327683, 327699, 327691, 327707, 327687, 327703, 327695, 0]), 5];
var Qc, ou;
class g_ extends ps {
  constructor(e, n) {
    super(n);
    F(this, Qc);
    this.str = e, this.dict = e.dict;
    const s = e.getByte(), r = e.getByte();
    if (s === -1 || r === -1) throw new ht(`Invalid header in flate stream: ${s}, ${r}`);
    if ((15 & s) != 8) throw new ht(`Unknown compression method in flate stream: ${s}, ${r}`);
    if (((s << 8) + r) % 31 != 0) throw new ht(`Bad FCHECK in flate stream: ${s}, ${r}`);
    if (32 & r) throw new ht(`FDICT bit set in flate stream: ${s}, ${r}`);
    this.codeSize = 0, this.codeBuf = 0;
  }
  async getImageData(e, n) {
    const s = await this.asyncGetBytes();
    return s ? s.length <= e ? s : s.subarray(0, e) : this.getBytes(e);
  }
  async asyncGetBytes() {
    this.str.reset();
    const e = this.str.getBytes();
    try {
      const { readable: n, writable: s } = new DecompressionStream("deflate"), r = s.getWriter();
      await r.ready, r.write(e).then(async () => {
        await r.ready, await r.close();
      }).catch(() => {
      });
      const a = [];
      let o = 0;
      for await (const h of n)
        a.push(h), o += h.byteLength;
      const l = new Uint8Array(o);
      let c = 0;
      for (const h of a)
        l.set(h, c), c += h.byteLength;
      return l;
    } catch {
      return this.str = new gi(e, 2, e.length, this.str.dict), this.reset(), null;
    }
  }
  get isAsync() {
    return !0;
  }
  getBits(e) {
    const n = this.str;
    let s, r = this.codeSize, a = this.codeBuf;
    for (; r < e; ) {
      if ((s = n.getByte()) === -1) throw new ht("Bad encoding in flate stream");
      a |= s << r, r += 8;
    }
    return s = a & (1 << e) - 1, this.codeBuf = a >> e, this.codeSize = r -= e, s;
  }
  getCode(e) {
    const n = this.str, s = e[0], r = e[1];
    let a, o = this.codeSize, l = this.codeBuf;
    for (; o < r && (a = n.getByte()) !== -1; )
      l |= a << o, o += 8;
    const c = s[l & (1 << r) - 1], h = c >> 16, u = 65535 & c;
    if (h < 1 || o < h) throw new ht("Bad encoding in flate stream");
    return this.codeBuf = l >> h, this.codeSize = o - h, u;
  }
  generateHuffmanTable(e) {
    const n = e.length;
    let s, r = 0;
    for (s = 0; s < n; ++s) e[s] > r && (r = e[s]);
    const a = 1 << r, o = new Int32Array(a);
    for (let l = 1, c = 0, h = 2; l <= r; ++l, c <<= 1, h <<= 1) for (let u = 0; u < n; ++u) if (e[u] === l) {
      let f = 0, d = c;
      for (s = 0; s < l; ++s)
        f = f << 1 | 1 & d, d >>= 1;
      for (s = f; s < a; s += h) o[s] = l << 16 | u;
      ++c;
    }
    return [o, r];
  }
  readBlock() {
    let e, n, s;
    const r = this.str;
    try {
      n = this.getBits(3);
    } catch (h) {
      D(this, Qc, ou).call(this, h.message);
      return;
    }
    if (1 & n && (this.eof = !0), n >>= 1, n === 0) {
      let h;
      if ((h = r.getByte()) === -1) {
        D(this, Qc, ou).call(this, "Bad block header in flate stream");
        return;
      }
      let u = h;
      if ((h = r.getByte()) === -1) {
        D(this, Qc, ou).call(this, "Bad block header in flate stream");
        return;
      }
      if (u |= h << 8, (h = r.getByte()) === -1) {
        D(this, Qc, ou).call(this, "Bad block header in flate stream");
        return;
      }
      let f = h;
      if ((h = r.getByte()) === -1) {
        D(this, Qc, ou).call(this, "Bad block header in flate stream");
        return;
      }
      if (f |= h << 8, f !== (65535 & ~u) && (u !== 0 || f !== 0)) throw new ht("Bad uncompressed block length in flate stream");
      this.codeBuf = 0, this.codeSize = 0;
      const d = this.bufferLength, p = d + u;
      if (e = this.ensureBuffer(p), this.bufferLength = p, u === 0) r.peekByte() === -1 && (this.eof = !0);
      else {
        const g = r.getBytes(u);
        e.set(g, d), g.length < u && (this.eof = !0);
      }
      return;
    }
    let a, o;
    if (n === 1)
      a = vP, o = _P;
    else {
      if (n !== 2) throw new ht("Unknown block type in flate stream");
      {
        const h = this.getBits(5) + 257, u = this.getBits(5) + 1, f = this.getBits(4) + 4, d = new Uint8Array(m_.length);
        let p;
        for (p = 0; p < f; ++p) d[m_[p]] = this.getBits(3);
        const g = this.generateHuffmanTable(d);
        s = 0, p = 0;
        const b = h + u, y = new Uint8Array(b);
        let v, w, _;
        for (; p < b; ) {
          const x = this.getCode(g);
          if (x === 16)
            v = 2, w = 3, _ = s;
          else if (x === 17)
            v = 3, w = 3, _ = s = 0;
          else {
            if (x !== 18) {
              y[p++] = s = x;
              continue;
            }
            v = 7, w = 11, _ = s = 0;
          }
          let k = this.getBits(v) + w;
          for (; k-- > 0; ) y[p++] = _;
        }
        a = this.generateHuffmanTable(y.subarray(0, h)), o = this.generateHuffmanTable(y.subarray(h, b));
      }
    }
    e = this.buffer;
    let l = e ? e.length : 0, c = this.bufferLength;
    for (; ; ) {
      let h = this.getCode(a);
      if (h < 256) {
        c + 1 >= l && (e = this.ensureBuffer(c + 1), l = e.length), e[c++] = h;
        continue;
      }
      if (h === 256) {
        this.bufferLength = c;
        return;
      }
      h -= 257, h = yP[h];
      let u = h >> 16;
      u > 0 && (u = this.getBits(u)), s = (65535 & h) + u, h = this.getCode(o), h = wP[h], u = h >> 16, u > 0 && (u = this.getBits(u));
      const f = (65535 & h) + u;
      c + s >= l && (e = this.ensureBuffer(c + s), l = e.length);
      for (let d = 0; d < s; ++d, ++c) e[c] = e[c - f];
    }
  }
}
Qc = new WeakSet(), ou = function(e) {
  ue(e), this.eof = !0;
};
const xP = [{ qe: 22017, nmps: 1, nlps: 1, switchFlag: 1 }, { qe: 13313, nmps: 2, nlps: 6, switchFlag: 0 }, { qe: 6145, nmps: 3, nlps: 9, switchFlag: 0 }, { qe: 2753, nmps: 4, nlps: 12, switchFlag: 0 }, { qe: 1313, nmps: 5, nlps: 29, switchFlag: 0 }, { qe: 545, nmps: 38, nlps: 33, switchFlag: 0 }, { qe: 22017, nmps: 7, nlps: 6, switchFlag: 1 }, { qe: 21505, nmps: 8, nlps: 14, switchFlag: 0 }, { qe: 18433, nmps: 9, nlps: 14, switchFlag: 0 }, { qe: 14337, nmps: 10, nlps: 14, switchFlag: 0 }, { qe: 12289, nmps: 11, nlps: 17, switchFlag: 0 }, { qe: 9217, nmps: 12, nlps: 18, switchFlag: 0 }, { qe: 7169, nmps: 13, nlps: 20, switchFlag: 0 }, { qe: 5633, nmps: 29, nlps: 21, switchFlag: 0 }, { qe: 22017, nmps: 15, nlps: 14, switchFlag: 1 }, { qe: 21505, nmps: 16, nlps: 14, switchFlag: 0 }, { qe: 20737, nmps: 17, nlps: 15, switchFlag: 0 }, { qe: 18433, nmps: 18, nlps: 16, switchFlag: 0 }, { qe: 14337, nmps: 19, nlps: 17, switchFlag: 0 }, { qe: 13313, nmps: 20, nlps: 18, switchFlag: 0 }, { qe: 12289, nmps: 21, nlps: 19, switchFlag: 0 }, { qe: 10241, nmps: 22, nlps: 19, switchFlag: 0 }, { qe: 9217, nmps: 23, nlps: 20, switchFlag: 0 }, { qe: 8705, nmps: 24, nlps: 21, switchFlag: 0 }, { qe: 7169, nmps: 25, nlps: 22, switchFlag: 0 }, { qe: 6145, nmps: 26, nlps: 23, switchFlag: 0 }, { qe: 5633, nmps: 27, nlps: 24, switchFlag: 0 }, { qe: 5121, nmps: 28, nlps: 25, switchFlag: 0 }, { qe: 4609, nmps: 29, nlps: 26, switchFlag: 0 }, { qe: 4353, nmps: 30, nlps: 27, switchFlag: 0 }, { qe: 2753, nmps: 31, nlps: 28, switchFlag: 0 }, { qe: 2497, nmps: 32, nlps: 29, switchFlag: 0 }, { qe: 2209, nmps: 33, nlps: 30, switchFlag: 0 }, { qe: 1313, nmps: 34, nlps: 31, switchFlag: 0 }, { qe: 1089, nmps: 35, nlps: 32, switchFlag: 0 }, { qe: 673, nmps: 36, nlps: 33, switchFlag: 0 }, { qe: 545, nmps: 37, nlps: 34, switchFlag: 0 }, { qe: 321, nmps: 38, nlps: 35, switchFlag: 0 }, { qe: 273, nmps: 39, nlps: 36, switchFlag: 0 }, { qe: 133, nmps: 40, nlps: 37, switchFlag: 0 }, { qe: 73, nmps: 41, nlps: 38, switchFlag: 0 }, { qe: 37, nmps: 42, nlps: 39, switchFlag: 0 }, { qe: 21, nmps: 43, nlps: 40, switchFlag: 0 }, { qe: 9, nmps: 44, nlps: 41, switchFlag: 0 }, { qe: 5, nmps: 45, nlps: 42, switchFlag: 0 }, { qe: 1, nmps: 45, nlps: 43, switchFlag: 0 }, { qe: 22017, nmps: 46, nlps: 46, switchFlag: 0 }];
class kP {
  constructor(t, e, n) {
    this.data = t, this.bp = e, this.dataEnd = n, this.chigh = t[e], this.clow = 0, this.byteIn(), this.chigh = this.chigh << 7 & 65535 | this.clow >> 9 & 127, this.clow = this.clow << 7 & 65535, this.ct -= 7, this.a = 32768;
  }
  byteIn() {
    const t = this.data;
    let e = this.bp;
    t[e] === 255 ? t[e + 1] > 143 ? (this.clow += 65280, this.ct = 8) : (e++, this.clow += t[e] << 9, this.ct = 7, this.bp = e) : (e++, this.clow += e < this.dataEnd ? t[e] << 8 : 65280, this.ct = 8, this.bp = e), this.clow > 65535 && (this.chigh += this.clow >> 16, this.clow &= 65535);
  }
  readBit(t, e) {
    let n = t[e] >> 1, s = 1 & t[e];
    const r = xP[n], a = r.qe;
    let o, l = this.a - a;
    if (this.chigh < a) l < a ? (l = a, o = s, n = r.nmps) : (l = a, o = 1 ^ s, r.switchFlag === 1 && (s = o), n = r.nlps);
    else {
      if (this.chigh -= a, 32768 & l)
        return this.a = l, s;
      l < a ? (o = 1 ^ s, r.switchFlag === 1 && (s = o), n = r.nlps) : (o = s, n = r.nmps);
    }
    do
      this.ct === 0 && this.byteIn(), l <<= 1, this.chigh = this.chigh << 1 & 65535 | this.clow >> 15 & 1, this.clow = this.clow << 1 & 65535, this.ct--;
    while (!(32768 & l));
    return this.a = l, t[e] = n << 1 | s, o;
  }
}
class di extends bs {
  constructor(t) {
    super(t, "Jbig2Error");
  }
}
class AP {
  getContexts(t) {
    return t in this ? this[t] : this[t] = new Int8Array(65536);
  }
}
class Df {
  constructor(t, e, n) {
    this.data = t, this.start = e, this.end = n;
  }
  get decoder() {
    return At(this, "decoder", new kP(this.data, this.start, this.end));
  }
  get contextCache() {
    return At(this, "contextCache", new AP());
  }
}
function Vn(i, t, e) {
  const n = i.getContexts(t);
  let s = 1;
  function r(c) {
    let h = 0;
    for (let u = 0; u < c; u++) {
      const f = e.readBit(n, s);
      s = s < 256 ? s << 1 | f : 511 & (s << 1 | f) | 256, h = h << 1 | f;
    }
    return h >>> 0;
  }
  const a = r(1), o = r(1) ? r(1) ? r(1) ? r(1) ? r(1) ? r(32) + 4436 : r(12) + 340 : r(8) + 84 : r(6) + 20 : r(4) + 4 : r(2);
  let l;
  return a === 0 ? l = o : o > 0 && (l = -o), l >= -2147483648 && l <= J8 ? l : null;
}
function nD(i, t, e) {
  const n = i.getContexts("IAID");
  let s = 1;
  for (let r = 0; r < e; r++)
    s = s << 1 | t.readBit(n, s);
  return e < 31 ? s & (1 << e) - 1 : 2147483647 & s;
}
const b_ = ["SymbolDictionary", null, null, null, "IntermediateTextRegion", null, "ImmediateTextRegion", "ImmediateLosslessTextRegion", null, null, null, null, null, null, null, null, "PatternDictionary", null, null, null, "IntermediateHalftoneRegion", null, "ImmediateHalftoneRegion", "ImmediateLosslessHalftoneRegion", null, null, null, null, null, null, null, null, null, null, null, null, "IntermediateGenericRegion", null, "ImmediateGenericRegion", "ImmediateLosslessGenericRegion", "IntermediateGenericRefinementRegion", null, "ImmediateGenericRefinementRegion", "ImmediateLosslessGenericRefinementRegion", null, null, null, null, "PageInformation", "EndOfPage", "EndOfStripe", "EndOfFile", "Profiles", "Tables", null, null, null, null, null, null, null, null, "Extension"], SP = [[{ x: -1, y: -2 }, { x: 0, y: -2 }, { x: 1, y: -2 }, { x: -2, y: -1 }, { x: -1, y: -1 }, { x: 0, y: -1 }, { x: 1, y: -1 }, { x: 2, y: -1 }, { x: -4, y: 0 }, { x: -3, y: 0 }, { x: -2, y: 0 }, { x: -1, y: 0 }], [{ x: -1, y: -2 }, { x: 0, y: -2 }, { x: 1, y: -2 }, { x: 2, y: -2 }, { x: -2, y: -1 }, { x: -1, y: -1 }, { x: 0, y: -1 }, { x: 1, y: -1 }, { x: 2, y: -1 }, { x: -3, y: 0 }, { x: -2, y: 0 }, { x: -1, y: 0 }], [{ x: -1, y: -2 }, { x: 0, y: -2 }, { x: 1, y: -2 }, { x: -2, y: -1 }, { x: -1, y: -1 }, { x: 0, y: -1 }, { x: 1, y: -1 }, { x: -2, y: 0 }, { x: -1, y: 0 }], [{ x: -3, y: -1 }, { x: -2, y: -1 }, { x: -1, y: -1 }, { x: 0, y: -1 }, { x: 1, y: -1 }, { x: -4, y: 0 }, { x: -3, y: 0 }, { x: -2, y: 0 }, { x: -1, y: 0 }]], y_ = [{ coding: [{ x: 0, y: -1 }, { x: 1, y: -1 }, { x: -1, y: 0 }], reference: [{ x: 0, y: -1 }, { x: 1, y: -1 }, { x: -1, y: 0 }, { x: 0, y: 0 }, { x: 1, y: 0 }, { x: -1, y: 1 }, { x: 0, y: 1 }, { x: 1, y: 1 }] }, { coding: [{ x: -1, y: -1 }, { x: 0, y: -1 }, { x: 1, y: -1 }, { x: -1, y: 0 }], reference: [{ x: 0, y: -1 }, { x: -1, y: 0 }, { x: 0, y: 0 }, { x: 1, y: 0 }, { x: 0, y: 1 }, { x: 1, y: 1 }] }], CP = [39717, 1941, 229, 405];
function s5(i, t, e, n, s, r, a, o) {
  if (i)
    return bb(new y2(o.data, o.start, o.end), t, e, !1);
  if (n === 0 && !s && a.length === 4 && a[0].x === 3 && a[0].y === -1 && a[1].x === -3 && a[1].y === -1 && a[2].x === 2 && a[2].y === -2 && a[3].x === -2 && a[3].y === -2) return function(Y, et, $) {
    const dt = $.decoder, tt = $.contextCache.getContexts("GB"), ut = [];
    let St, G, V, nt, gt, _t, kt;
    for (G = 0; G < et; G++)
      for (gt = ut[G] = new Uint8Array(Y), _t = G < 1 ? gt : ut[G - 1], kt = G < 2 ? gt : ut[G - 2], St = kt[0] << 13 | kt[1] << 12 | kt[2] << 11 | _t[0] << 7 | _t[1] << 6 | _t[2] << 5 | _t[3] << 4, V = 0; V < Y; V++)
        gt[V] = nt = dt.readBit(tt, St), St = (31735 & St) << 1 | (V + 3 < Y ? kt[V + 3] << 11 : 0) | (V + 4 < Y ? _t[V + 4] << 4 : 0) | nt;
    return ut;
  }(t, e, o);
  const l = SP[n].concat(a);
  l.sort((Q, Y) => Q.y - Y.y || Q.x - Y.x);
  const c = l.length, h = new Int8Array(c), u = new Int8Array(c), f = [];
  let d, p, g = 0, b = 0, y = 0, v = 0;
  for (p = 0; p < c; p++)
    h[p] = l[p].x, u[p] = l[p].y, b = Math.min(b, l[p].x), y = Math.max(y, l[p].x), v = Math.min(v, l[p].y), p < c - 1 && l[p].y === l[p + 1].y && l[p].x === l[p + 1].x - 1 ? g |= 1 << c - 1 - p : f.push(p);
  const w = f.length, _ = new Int8Array(w), x = new Int8Array(w), k = new Uint16Array(w);
  for (d = 0; d < w; d++)
    p = f[d], _[d] = l[p].x, x[d] = l[p].y, k[d] = 1 << c - 1 - p;
  const S = -b, T = -v, I = t - y, R = CP[n];
  let B = new Uint8Array(t);
  const L = [], it = o.decoder, O = o.contextCache.getContexts("GB");
  let at, W, q, K, z, j = 0, N = 0;
  for (let Q = 0; Q < e; Q++) {
    if (s && (j ^= it.readBit(O, R), j)) {
      L.push(B);
      continue;
    }
    for (B = new Uint8Array(B), L.push(B), at = 0; at < t; at++) {
      if (at >= S && at < I && Q >= T)
        for (N = N << 1 & g, p = 0; p < w; p++)
          W = Q + x[p], q = at + _[p], K = L[W][q], K && (K = k[p], N |= K);
      else
        for (N = 0, z = c - 1, p = 0; p < c; p++, z--)
          q = at + h[p], q >= 0 && q < t && (W = Q + u[p], W >= 0 && (K = L[W][q], K && (N |= K << z)));
      const Y = it.readBit(O, N);
      B[at] = Y;
    }
  }
  return L;
}
function sD(i, t, e, n, s, r, a, o, l) {
  let c = y_[e].coding;
  e === 0 && (c = c.concat([o[0]]));
  const h = c.length, u = new Int32Array(h), f = new Int32Array(h);
  let d;
  for (d = 0; d < h; d++)
    u[d] = c[d].x, f[d] = c[d].y;
  let p = y_[e].reference;
  e === 0 && (p = p.concat([o[1]]));
  const g = p.length, b = new Int32Array(g), y = new Int32Array(g);
  for (d = 0; d < g; d++)
    b[d] = p[d].x, y[d] = p[d].y;
  const v = n[0].length, w = n.length, _ = [], x = l.decoder, k = l.contextCache.getContexts("GR");
  for (let S = 0; S < t; S++) {
    const T = new Uint8Array(i);
    _.push(T);
    for (let I = 0; I < i; I++) {
      let R, B, L = 0;
      for (d = 0; d < h; d++)
        R = S + f[d], B = I + u[d], R < 0 || B < 0 || B >= i ? L <<= 1 : L = L << 1 | _[R][B];
      for (d = 0; d < g; d++)
        R = S + y[d] - r, B = I + b[d] - s, R < 0 || R >= w || B < 0 || B >= v ? L <<= 1 : L = L << 1 | n[R][B];
      const it = x.readBit(k, L);
      T[I] = it;
    }
  }
  return _;
}
function w_(i, t, e, n, s, r, a, o, l, c, h, u, f, d, p, g, b, y, v) {
  if (i && t) throw new di("refinement with Huffman is not supported");
  const w = [];
  let _, x;
  for (_ = 0; _ < n; _++)
    x = new Uint8Array(e), s && x.fill(s), w.push(x);
  const k = b.decoder, S = b.contextCache;
  let T = i ? -d.tableDeltaT.decode(v) : -Vn(S, "IADT", k), I = 0;
  for (_ = 0; _ < r; ) {
    T += i ? d.tableDeltaT.decode(v) : Vn(S, "IADT", k), I += i ? d.tableFirstS.decode(v) : Vn(S, "IAFS", k);
    let R = I;
    for (; ; ) {
      let B = 0;
      a > 1 && (B = i ? v.readBits(y) : Vn(S, "IAIT", k));
      const L = a * T + B, it = i ? d.symbolIDTable.decode(v) : nD(S, k, l), O = t && (i ? v.readBit() : Vn(S, "IARI", k));
      let at = o[it], W = at[0].length, q = at.length;
      if (O) {
        const $ = Vn(S, "IARDW", k), dt = Vn(S, "IARDH", k);
        W += $, q += dt, at = sD(W, q, p, at, ($ >> 1) + Vn(S, "IARDX", k), (dt >> 1) + Vn(S, "IARDY", k), !1, g, b);
      }
      let K = 0;
      c ? 1 & u ? K = q - 1 : R += q - 1 : u > 1 ? R += W - 1 : K = W - 1;
      const z = L - (1 & u ? 0 : q - 1), j = R - (2 & u ? W - 1 : 0);
      let N, Q, Y;
      if (c) for (N = 0; N < q; N++) {
        if (x = w[j + N], !x) continue;
        Y = at[N];
        const $ = Math.min(e - z, W);
        switch (f) {
          case 0:
            for (Q = 0; Q < $; Q++) x[z + Q] |= Y[Q];
            break;
          case 2:
            for (Q = 0; Q < $; Q++) x[z + Q] ^= Y[Q];
            break;
          default:
            throw new di(`operator ${f} is not supported`);
        }
      }
      else for (Q = 0; Q < q; Q++)
        if (x = w[z + Q], x)
          switch (Y = at[Q], f) {
            case 0:
              for (N = 0; N < W; N++) x[j + N] |= Y[N];
              break;
            case 2:
              for (N = 0; N < W; N++) x[j + N] ^= Y[N];
              break;
            default:
              throw new di(`operator ${f} is not supported`);
          }
      _++;
      const et = i ? d.tableDeltaS.decode(v) : Vn(S, "IADS", k);
      if (et === null) break;
      R += K + et + h;
    }
  }
  return w;
}
function EP(i, t) {
  const e = {};
  e.number = Ne(i, t);
  const n = i[t + 4], s = 63 & n;
  if (!b_[s]) throw new di("invalid segment type: " + s);
  e.type = s, e.typeName = b_[s], e.deferredNonRetain = !!(128 & n);
  const r = !!(64 & n), a = i[t + 5];
  let o = a >> 5 & 7;
  const l = [31 & a];
  let c = t + 6;
  if (a === 7) {
    o = 536870911 & Ne(i, c - 1), c += 3;
    let p = o + 7 >> 3;
    for (l[0] = i[c++]; --p > 0; ) l.push(i[c++]);
  } else if (a === 5 || a === 6) throw new di("invalid referred-to flags");
  e.retainBits = l;
  let h = 4;
  e.number <= 256 ? h = 1 : e.number <= 65536 && (h = 2);
  const u = [];
  let f, d;
  for (f = 0; f < o; f++) {
    let p;
    p = h === 1 ? i[c] : h === 2 ? pe(i, c) : Ne(i, c), u.push(p), c += h;
  }
  if (e.referredTo = u, r ? (e.pageAssociation = Ne(i, c), c += 4) : e.pageAssociation = i[c++], e.length = Ne(i, c), c += 4, e.length === 4294967295) {
    if (s !== 38) throw new di("invalid unknown segment length");
    {
      const p = y9(i, c), g = !!(1 & i[c + w9]), b = 6, y = new Uint8Array(b);
      for (g || (y[0] = 255, y[1] = 172), y[2] = p.height >>> 24 & 255, y[3] = p.height >> 16 & 255, y[4] = p.height >> 8 & 255, y[5] = 255 & p.height, f = c, d = i.length; f < d; f++) {
        let v = 0;
        for (; v < b && y[v] === i[f + v]; ) v++;
        if (v === b) {
          e.length = f + b;
          break;
        }
      }
      if (e.length === 4294967295) throw new di("segment end was not found");
    }
  }
  return e.headerEnd = c, e;
}
function DP(i, t, e, n) {
  const s = [];
  let r = e;
  for (; r < n; ) {
    const a = EP(t, r);
    r = a.headerEnd;
    const o = { header: a, data: t };
    if (i.randomAccess || (o.start = r, r += a.length, o.end = r), s.push(o), a.type === 51) break;
  }
  if (i.randomAccess) for (let a = 0, o = s.length; a < o; a++)
    s[a].start = r, r += s[a].header.length, s[a].end = r;
  return s;
}
function y9(i, t) {
  return { width: Ne(i, t), height: Ne(i, t + 4), x: Ne(i, t + 8), y: Ne(i, t + 12), combinationOperator: 7 & i[t + 16] };
}
const w9 = 17;
function TP(i, t) {
  const e = i.header, n = i.data, s = i.end;
  let r, a, o, l, c = i.start;
  switch (e.type) {
    case 0:
      const u = {}, f = pe(n, c);
      if (u.huffman = !!(1 & f), u.refinement = !!(2 & f), u.huffmanDHSelector = f >> 2 & 3, u.huffmanDWSelector = f >> 4 & 3, u.bitmapSizeSelector = f >> 6 & 1, u.aggregationInstancesSelector = f >> 7 & 1, u.bitmapCodingContextUsed = !!(256 & f), u.bitmapCodingContextRetained = !!(512 & f), u.template = f >> 10 & 3, u.refinementTemplate = f >> 12 & 1, c += 2, !u.huffman) {
        for (l = u.template === 0 ? 4 : 1, a = [], o = 0; o < l; o++)
          a.push({ x: ja(n, c), y: ja(n, c + 1) }), c += 2;
        u.at = a;
      }
      if (u.refinement && !u.refinementTemplate) {
        for (a = [], o = 0; o < 2; o++)
          a.push({ x: ja(n, c), y: ja(n, c + 1) }), c += 2;
        u.refinementAt = a;
      }
      u.numberOfExportedSymbols = Ne(n, c), c += 4, u.numberOfNewSymbols = Ne(n, c), c += 4, r = [u, e.number, e.referredTo, n, c, s];
      break;
    case 6:
    case 7:
      const d = {};
      d.info = y9(n, c), c += w9;
      const p = pe(n, c);
      if (c += 2, d.huffman = !!(1 & p), d.refinement = !!(2 & p), d.logStripSize = p >> 2 & 3, d.stripSize = 1 << d.logStripSize, d.referenceCorner = p >> 4 & 3, d.transposed = !!(64 & p), d.combinationOperator = p >> 7 & 3, d.defaultPixelValue = p >> 9 & 1, d.dsOffset = p << 17 >> 27, d.refinementTemplate = p >> 15 & 1, d.huffman) {
        const S = pe(n, c);
        c += 2, d.huffmanFS = 3 & S, d.huffmanDS = S >> 2 & 3, d.huffmanDT = S >> 4 & 3, d.huffmanRefinementDW = S >> 6 & 3, d.huffmanRefinementDH = S >> 8 & 3, d.huffmanRefinementDX = S >> 10 & 3, d.huffmanRefinementDY = S >> 12 & 3, d.huffmanRefinementSizeSelector = !!(16384 & S);
      }
      if (d.refinement && !d.refinementTemplate) {
        for (a = [], o = 0; o < 2; o++)
          a.push({ x: ja(n, c), y: ja(n, c + 1) }), c += 2;
        d.refinementAt = a;
      }
      d.numberOfSymbolInstances = Ne(n, c), c += 4, r = [d, e.referredTo, n, c, s];
      break;
    case 16:
      const g = {}, b = n[c++];
      g.mmr = !!(1 & b), g.template = b >> 1 & 3, g.patternWidth = n[c++], g.patternHeight = n[c++], g.maxPatternIndex = Ne(n, c), c += 4, r = [g, e.number, n, c, s];
      break;
    case 22:
    case 23:
      const y = {};
      y.info = y9(n, c), c += w9;
      const v = n[c++];
      y.mmr = !!(1 & v), y.template = v >> 1 & 3, y.enableSkip = !!(8 & v), y.combinationOperator = v >> 4 & 7, y.defaultPixelValue = v >> 7 & 1, y.gridWidth = Ne(n, c), c += 4, y.gridHeight = Ne(n, c), c += 4, y.gridOffsetX = 4294967295 & Ne(n, c), c += 4, y.gridOffsetY = 4294967295 & Ne(n, c), c += 4, y.gridVectorX = pe(n, c), c += 2, y.gridVectorY = pe(n, c), c += 2, r = [y, e.referredTo, n, c, s];
      break;
    case 38:
    case 39:
      const w = {};
      w.info = y9(n, c), c += w9;
      const _ = n[c++];
      if (w.mmr = !!(1 & _), w.template = _ >> 1 & 3, w.prediction = !!(8 & _), !w.mmr) {
        for (l = w.template === 0 ? 4 : 1, a = [], o = 0; o < l; o++)
          a.push({ x: ja(n, c), y: ja(n, c + 1) }), c += 2;
        w.at = a;
      }
      r = [w, n, c, s];
      break;
    case 48:
      const x = { width: Ne(n, c), height: Ne(n, c + 4), resolutionX: Ne(n, c + 8), resolutionY: Ne(n, c + 12) };
      x.height === 4294967295 && delete x.height;
      const k = n[c + 16];
      pe(n, c + 17), x.lossless = !!(1 & k), x.refinement = !!(2 & k), x.defaultPixelValue = k >> 2 & 1, x.combinationOperator = k >> 3 & 3, x.requiresBuffer = !!(32 & k), x.combinationOperatorOverride = !!(64 & k), r = [x];
      break;
    case 49:
    case 50:
    case 51:
    case 62:
      break;
    case 53:
      r = [e.number, n, c, s];
      break;
    default:
      throw new di(`segment type ${e.typeName}(${e.type}) is not implemented`);
  }
  const h = "on" + e.typeName;
  h in t && t[h].apply(t, r);
}
function FP(i, t) {
  for (let e = 0, n = i.length; e < n; e++) TP(i[e], t);
}
class IP {
  onPageInformation(t) {
    this.currentPageInfo = t;
    const e = t.width + 7 >> 3, n = new Uint8ClampedArray(e * t.height);
    t.defaultPixelValue && n.fill(255), this.buffer = n;
  }
  drawBitmap(t, e) {
    const n = this.currentPageInfo, s = t.width, r = t.height, a = n.width + 7 >> 3, o = n.combinationOperatorOverride ? t.combinationOperator : n.combinationOperator, l = this.buffer, c = 128 >> (7 & t.x);
    let h, u, f, d, p = t.y * a + (t.x >> 3);
    switch (o) {
      case 0:
        for (h = 0; h < r; h++) {
          for (f = c, d = p, u = 0; u < s; u++)
            e[h][u] && (l[d] |= f), f >>= 1, f || (f = 128, d++);
          p += a;
        }
        break;
      case 2:
        for (h = 0; h < r; h++) {
          for (f = c, d = p, u = 0; u < s; u++)
            e[h][u] && (l[d] ^= f), f >>= 1, f || (f = 128, d++);
          p += a;
        }
        break;
      default:
        throw new di(`operator ${o} is not supported`);
    }
  }
  onImmediateGenericRegion(t, e, n, s) {
    const r = t.info, a = new Df(e, n, s), o = s5(t.mmr, r.width, r.height, t.template, t.prediction, null, t.at, a);
    this.drawBitmap(r, o);
  }
  onImmediateLosslessGenericRegion() {
    this.onImmediateGenericRegion(...arguments);
  }
  onSymbolDictionary(t, e, n, s, r, a) {
    let o, l;
    t.huffman && (o = function(d, p, g) {
      let b, y, v, w, _ = 0;
      switch (d.huffmanDHSelector) {
        case 0:
        case 1:
          b = Ql(d.huffmanDHSelector + 4);
          break;
        case 3:
          b = S0(_, p, g), _++;
          break;
        default:
          throw new di("invalid Huffman DH selector");
      }
      switch (d.huffmanDWSelector) {
        case 0:
        case 1:
          y = Ql(d.huffmanDWSelector + 2);
          break;
        case 3:
          y = S0(_, p, g), _++;
          break;
        default:
          throw new di("invalid Huffman DW selector");
      }
      return d.bitmapSizeSelector ? (v = S0(_, p, g), _++) : v = Ql(1), w = d.aggregationInstancesSelector ? S0(_, p, g) : Ql(1), { tableDeltaHeight: b, tableDeltaWidth: y, tableBitmapSize: v, tableAggregateInstances: w };
    }(t, n, this.customTables), l = new y2(s, r, a));
    let c = this.symbols;
    c || (this.symbols = c = {});
    const h = [];
    for (const f of n) {
      const d = c[f];
      d && h.push(...d);
    }
    const u = new Df(s, r, a);
    c[e] = function(d, p, g, b, y, v, w, _, x, k, S, T) {
      if (d && p) throw new di("symbol refinement with Huffman is not supported");
      const I = [];
      let R = 0, B = b6(g.length + b);
      const L = S.decoder, it = S.contextCache;
      let O, at;
      for (d && (O = Ql(1), at = [], B = Math.max(B, 1)); I.length < b; ) {
        R += d ? v.tableDeltaHeight.decode(T) : Vn(it, "IADH", L);
        let Q = 0, Y = 0;
        const et = d ? at.length : 0;
        for (; ; ) {
          const $ = d ? v.tableDeltaWidth.decode(T) : Vn(it, "IADW", L);
          if ($ === null) break;
          Q += $, Y += Q;
          let dt;
          if (p) {
            const tt = Vn(it, "IAAI", L);
            if (tt > 1) dt = w_(d, p, Q, R, 0, tt, 1, g.concat(I), B, 0, 0, 1, 0, v, x, k, S, 0, T);
            else {
              const ut = nD(it, L, B), St = Vn(it, "IARDX", L), G = Vn(it, "IARDY", L);
              dt = sD(Q, R, x, ut < g.length ? g[ut] : I[ut - g.length], St, G, !1, k, S);
            }
            I.push(dt);
          } else d ? at.push(Q) : (dt = s5(!1, Q, R, w, !1, null, _, S), I.push(dt));
        }
        if (d && !p) {
          const $ = v.tableBitmapSize.decode(T);
          T.byteAlign();
          let dt;
          if ($ === 0) dt = MP(T, Y, R);
          else {
            const ut = T.end, St = T.position + $;
            T.end = St, dt = bb(T, Y, R, !1), T.end = ut, T.position = St;
          }
          const tt = at.length;
          if (et === tt - 1) I.push(dt);
          else {
            let ut, St, G, V, nt, gt = 0;
            for (ut = et; ut < tt; ut++) {
              for (V = at[ut], G = gt + V, nt = [], St = 0; St < R; St++) nt.push(dt[St].subarray(gt, G));
              I.push(nt), gt = G;
            }
          }
        }
      }
      const W = [], q = [];
      let K, z, j = !1;
      const N = g.length + b;
      for (; q.length < N; ) {
        let Q = d ? O.decode(T) : Vn(it, "IAEX", L);
        for (; Q--; ) q.push(j);
        j = !j;
      }
      for (K = 0, z = g.length; K < z; K++) q[K] && W.push(g[K]);
      for (let Q = 0; Q < b; K++, Q++) q[K] && W.push(I[Q]);
      return W;
    }(t.huffman, t.refinement, h, t.numberOfNewSymbols, t.numberOfExportedSymbols, o, t.template, t.at, t.refinementTemplate, t.refinementAt, u, l);
  }
  onImmediateTextRegion(t, e, n, s, r) {
    const a = t.info;
    let o, l;
    const c = this.symbols, h = [];
    for (const p of e) {
      const g = c[p];
      g && h.push(...g);
    }
    const u = b6(h.length);
    t.huffman && (l = new y2(n, s, r), o = function(g, b, y, v, w) {
      const _ = [];
      for (let B = 0; B <= 34; B++) {
        const L = w.readBits(4);
        _.push(new ac([B, L, 0, 0]));
      }
      const x = new v9(_, !1);
      _.length = 0;
      for (let B = 0; B < v; ) {
        const L = x.decode(w);
        if (L >= 32) {
          let it, O, at;
          switch (L) {
            case 32:
              if (B === 0) throw new di("no previous value in symbol ID table");
              O = w.readBits(2) + 3, it = _[B - 1].prefixLength;
              break;
            case 33:
              O = w.readBits(3) + 3, it = 0;
              break;
            case 34:
              O = w.readBits(7) + 11, it = 0;
              break;
            default:
              throw new di("invalid code length in symbol ID table");
          }
          for (at = 0; at < O; at++)
            _.push(new ac([B, it, 0, 0])), B++;
        } else
          _.push(new ac([B, L, 0, 0])), B++;
      }
      w.byteAlign();
      const k = new v9(_, !1);
      let S, T, I, R = 0;
      switch (g.huffmanFS) {
        case 0:
        case 1:
          S = Ql(g.huffmanFS + 6);
          break;
        case 3:
          S = S0(R, b, y), R++;
          break;
        default:
          throw new di("invalid Huffman FS selector");
      }
      switch (g.huffmanDS) {
        case 0:
        case 1:
        case 2:
          T = Ql(g.huffmanDS + 8);
          break;
        case 3:
          T = S0(R, b, y), R++;
          break;
        default:
          throw new di("invalid Huffman DS selector");
      }
      switch (g.huffmanDT) {
        case 0:
        case 1:
        case 2:
          I = Ql(g.huffmanDT + 11);
          break;
        case 3:
          I = S0(R, b, y), R++;
          break;
        default:
          throw new di("invalid Huffman DT selector");
      }
      if (g.refinement) throw new di("refinement with Huffman is not supported");
      return { symbolIDTable: k, tableFirstS: S, tableDeltaS: T, tableDeltaT: I };
    }(t, e, this.customTables, h.length, l));
    const f = new Df(n, s, r), d = w_(t.huffman, t.refinement, a.width, a.height, t.defaultPixelValue, t.numberOfSymbolInstances, t.stripSize, h, u, t.transposed, t.dsOffset, t.referenceCorner, t.combinationOperator, o, t.refinementTemplate, t.refinementAt, f, t.logStripSize, l);
    this.drawBitmap(a, d);
  }
  onImmediateLosslessTextRegion() {
    this.onImmediateTextRegion(...arguments);
  }
  onPatternDictionary(t, e, n, s, r) {
    let a = this.patterns;
    a || (this.patterns = a = {});
    const o = new Df(n, s, r);
    a[e] = function(c, h, u, f, d, p) {
      const g = [];
      c || (g.push({ x: -h, y: 0 }), d === 0 && g.push({ x: -3, y: -1 }, { x: 2, y: -2 }, { x: -2, y: -2 }));
      const b = s5(c, (f + 1) * h, u, d, !1, null, g, p), y = [];
      for (let v = 0; v <= f; v++) {
        const w = [], _ = h * v, x = _ + h;
        for (let k = 0; k < u; k++) w.push(b[k].subarray(_, x));
        y.push(w);
      }
      return y;
    }(t.mmr, t.patternWidth, t.patternHeight, t.maxPatternIndex, t.template, o);
  }
  onImmediateHalftoneRegion(t, e, n, s, r) {
    const a = this.patterns[e[0]], o = t.info, l = new Df(n, s, r), c = function(u, f, d, p, g, b, y, v, w, _, x, k, S, T, I) {
      if (y) throw new di("skip is not supported");
      if (v !== 0) throw new di(`operator "${v}" is not supported in halftone region`);
      const R = [];
      let B, L, it;
      for (B = 0; B < g; B++)
        it = new Uint8Array(p), b && it.fill(b), R.push(it);
      const O = f.length, at = f[0], W = at[0].length, q = at.length, K = b6(O), z = [];
      u || (z.push({ x: d <= 1 ? 3 : 2, y: -1 }), d === 0 && z.push({ x: -3, y: -1 }, { x: 2, y: -2 }, { x: -2, y: -2 }));
      const j = [];
      let N, Q, Y, et, $, dt, tt, ut, St, G, V;
      for (u && (N = new y2(I.data, I.start, I.end)), B = K - 1; B >= 0; B--)
        Q = u ? bb(N, w, _, !0) : s5(!1, w, _, d, !1, null, z, I), j[B] = Q;
      for (Y = 0; Y < _; Y++) for (et = 0; et < w; et++) {
        for ($ = 0, dt = 0, L = K - 1; L >= 0; L--)
          $ ^= j[L][Y][et], dt |= $ << L;
        if (tt = f[dt], ut = x + Y * T + et * S >> 8, St = k + Y * S - et * T >> 8, ut >= 0 && ut + W <= p && St >= 0 && St + q <= g) for (B = 0; B < q; B++)
          for (V = R[St + B], G = tt[B], L = 0; L < W; L++) V[ut + L] |= G[L];
        else {
          let nt, gt;
          for (B = 0; B < q; B++)
            if (gt = St + B, !(gt < 0 || gt >= g))
              for (V = R[gt], G = tt[B], L = 0; L < W; L++)
                nt = ut + L, nt >= 0 && nt < p && (V[nt] |= G[L]);
        }
      }
      return R;
    }(t.mmr, a, t.template, o.width, o.height, t.defaultPixelValue, t.enableSkip, t.combinationOperator, t.gridWidth, t.gridHeight, t.gridOffsetX, t.gridOffsetY, t.gridVectorX, t.gridVectorY, l);
    this.drawBitmap(o, c);
  }
  onImmediateLosslessHalftoneRegion() {
    this.onImmediateHalftoneRegion(...arguments);
  }
  onTables(t, e, n, s) {
    let r = this.customTables;
    r || (this.customTables = r = {}), r[t] = function(o, l, c) {
      const h = o[l], u = 4294967295 & Ne(o, l + 1), f = 4294967295 & Ne(o, l + 5), d = new y2(o, l + 9, c), p = 1 + (h >> 1 & 7), g = 1 + (h >> 4 & 7), b = [];
      let y, v, w = u;
      do
        y = d.readBits(p), v = d.readBits(g), b.push(new ac([w, y, v, 0])), w += 1 << v;
      while (w < f);
      return y = d.readBits(p), b.push(new ac([u - 1, y, 32, 0, "lower"])), y = d.readBits(p), b.push(new ac([f, y, 32, 0])), 1 & h && (y = d.readBits(p), b.push(new ac([y, 0]))), new v9(b, !1);
    }(e, n, s);
  }
}
class ac {
  constructor(t) {
    t.length === 2 ? (this.isOOB = !0, this.rangeLow = 0, this.prefixLength = t[0], this.rangeLength = 0, this.prefixCode = t[1], this.isLowerRange = !1) : (this.isOOB = !1, this.rangeLow = t[0], this.prefixLength = t[1], this.rangeLength = t[2], this.prefixCode = t[3], this.isLowerRange = t[4] === "lower");
  }
}
class h3 {
  constructor(t) {
    this.children = [], t ? (this.isLeaf = !0, this.rangeLength = t.rangeLength, this.rangeLow = t.rangeLow, this.isLowerRange = t.isLowerRange, this.isOOB = t.isOOB) : this.isLeaf = !1;
  }
  buildTree(t, e) {
    const n = t.prefixCode >> e & 1;
    if (e <= 0) this.children[n] = new h3(t);
    else {
      let s = this.children[n];
      s || (this.children[n] = s = new h3(null)), s.buildTree(t, e - 1);
    }
  }
  decodeNode(t) {
    if (this.isLeaf) {
      if (this.isOOB) return null;
      const n = t.readBits(this.rangeLength);
      return this.rangeLow + (this.isLowerRange ? -n : n);
    }
    const e = this.children[t.readBit()];
    if (!e) throw new di("invalid Huffman data");
    return e.decodeNode(t);
  }
}
class v9 {
  constructor(t, e) {
    e || this.assignPrefixCodes(t), this.rootNode = new h3(null);
    for (let n = 0, s = t.length; n < s; n++) {
      const r = t[n];
      r.prefixLength > 0 && this.rootNode.buildTree(r, r.prefixLength - 1);
    }
  }
  decode(t) {
    return this.rootNode.decodeNode(t);
  }
  assignPrefixCodes(t) {
    const e = t.length;
    let n = 0;
    for (let h = 0; h < e; h++) n = Math.max(n, t[h].prefixLength);
    const s = new Uint32Array(n + 1);
    for (let h = 0; h < e; h++) s[t[h].prefixLength]++;
    let r, a, o, l = 1, c = 0;
    for (s[0] = 0; l <= n; ) {
      for (c = c + s[l - 1] << 1, r = c, a = 0; a < e; )
        o = t[a], o.prefixLength === l && (o.prefixCode = r, r++), a++;
      l++;
    }
  }
}
const v_ = {};
function Ql(i) {
  let t, e = v_[i];
  if (e) return e;
  switch (i) {
    case 1:
      t = [[0, 1, 4, 0], [16, 2, 8, 2], [272, 3, 16, 6], [65808, 3, 32, 7]];
      break;
    case 2:
      t = [[0, 1, 0, 0], [1, 2, 0, 2], [2, 3, 0, 6], [3, 4, 3, 14], [11, 5, 6, 30], [75, 6, 32, 62], [6, 63]];
      break;
    case 3:
      t = [[-256, 8, 8, 254], [0, 1, 0, 0], [1, 2, 0, 2], [2, 3, 0, 6], [3, 4, 3, 14], [11, 5, 6, 30], [-257, 8, 32, 255, "lower"], [75, 7, 32, 126], [6, 62]];
      break;
    case 4:
      t = [[1, 1, 0, 0], [2, 2, 0, 2], [3, 3, 0, 6], [4, 4, 3, 14], [12, 5, 6, 30], [76, 5, 32, 31]];
      break;
    case 5:
      t = [[-255, 7, 8, 126], [1, 1, 0, 0], [2, 2, 0, 2], [3, 3, 0, 6], [4, 4, 3, 14], [12, 5, 6, 30], [-256, 7, 32, 127, "lower"], [76, 6, 32, 62]];
      break;
    case 6:
      t = [[-2048, 5, 10, 28], [-1024, 4, 9, 8], [-512, 4, 8, 9], [-256, 4, 7, 10], [-128, 5, 6, 29], [-64, 5, 5, 30], [-32, 4, 5, 11], [0, 2, 7, 0], [128, 3, 7, 2], [256, 3, 8, 3], [512, 4, 9, 12], [1024, 4, 10, 13], [-2049, 6, 32, 62, "lower"], [2048, 6, 32, 63]];
      break;
    case 7:
      t = [[-1024, 4, 9, 8], [-512, 3, 8, 0], [-256, 4, 7, 9], [-128, 5, 6, 26], [-64, 5, 5, 27], [-32, 4, 5, 10], [0, 4, 5, 11], [32, 5, 5, 28], [64, 5, 6, 29], [128, 4, 7, 12], [256, 3, 8, 1], [512, 3, 9, 2], [1024, 3, 10, 3], [-1025, 5, 32, 30, "lower"], [2048, 5, 32, 31]];
      break;
    case 8:
      t = [[-15, 8, 3, 252], [-7, 9, 1, 508], [-5, 8, 1, 253], [-3, 9, 0, 509], [-2, 7, 0, 124], [-1, 4, 0, 10], [0, 2, 1, 0], [2, 5, 0, 26], [3, 6, 0, 58], [4, 3, 4, 4], [20, 6, 1, 59], [22, 4, 4, 11], [38, 4, 5, 12], [70, 5, 6, 27], [134, 5, 7, 28], [262, 6, 7, 60], [390, 7, 8, 125], [646, 6, 10, 61], [-16, 9, 32, 510, "lower"], [1670, 9, 32, 511], [2, 1]];
      break;
    case 9:
      t = [[-31, 8, 4, 252], [-15, 9, 2, 508], [-11, 8, 2, 253], [-7, 9, 1, 509], [-5, 7, 1, 124], [-3, 4, 1, 10], [-1, 3, 1, 2], [1, 3, 1, 3], [3, 5, 1, 26], [5, 6, 1, 58], [7, 3, 5, 4], [39, 6, 2, 59], [43, 4, 5, 11], [75, 4, 6, 12], [139, 5, 7, 27], [267, 5, 8, 28], [523, 6, 8, 60], [779, 7, 9, 125], [1291, 6, 11, 61], [-32, 9, 32, 510, "lower"], [3339, 9, 32, 511], [2, 0]];
      break;
    case 10:
      t = [[-21, 7, 4, 122], [-5, 8, 0, 252], [-4, 7, 0, 123], [-3, 5, 0, 24], [-2, 2, 2, 0], [2, 5, 0, 25], [3, 6, 0, 54], [4, 7, 0, 124], [5, 8, 0, 253], [6, 2, 6, 1], [70, 5, 5, 26], [102, 6, 5, 55], [134, 6, 6, 56], [198, 6, 7, 57], [326, 6, 8, 58], [582, 6, 9, 59], [1094, 6, 10, 60], [2118, 7, 11, 125], [-22, 8, 32, 254, "lower"], [4166, 8, 32, 255], [2, 2]];
      break;
    case 11:
      t = [[1, 1, 0, 0], [2, 2, 1, 2], [4, 4, 0, 12], [5, 4, 1, 13], [7, 5, 1, 28], [9, 5, 2, 29], [13, 6, 2, 60], [17, 7, 2, 122], [21, 7, 3, 123], [29, 7, 4, 124], [45, 7, 5, 125], [77, 7, 6, 126], [141, 7, 32, 127]];
      break;
    case 12:
      t = [[1, 1, 0, 0], [2, 2, 0, 2], [3, 3, 1, 6], [5, 5, 0, 28], [6, 5, 1, 29], [8, 6, 1, 60], [10, 7, 0, 122], [11, 7, 1, 123], [13, 7, 2, 124], [17, 7, 3, 125], [25, 7, 4, 126], [41, 8, 5, 254], [73, 8, 32, 255]];
      break;
    case 13:
      t = [[1, 1, 0, 0], [2, 3, 0, 4], [3, 4, 0, 12], [4, 5, 0, 28], [5, 4, 1, 13], [7, 3, 3, 5], [15, 6, 1, 58], [17, 6, 2, 59], [21, 6, 3, 60], [29, 6, 4, 61], [45, 6, 5, 62], [77, 7, 6, 126], [141, 7, 32, 127]];
      break;
    case 14:
      t = [[-2, 3, 0, 4], [-1, 3, 0, 5], [0, 1, 0, 0], [1, 3, 0, 6], [2, 3, 0, 7]];
      break;
    case 15:
      t = [[-24, 7, 4, 124], [-8, 6, 2, 60], [-4, 5, 1, 28], [-2, 4, 0, 12], [-1, 3, 0, 4], [0, 1, 0, 0], [1, 3, 0, 5], [2, 4, 0, 13], [3, 5, 1, 29], [5, 6, 2, 61], [9, 7, 4, 125], [-25, 7, 32, 126, "lower"], [25, 7, 32, 127]];
      break;
    default:
      throw new di(`standard table B.${i} does not exist`);
  }
  for (let n = 0, s = t.length; n < s; n++) t[n] = new ac(t[n]);
  return e = new v9(t, !0), v_[i] = e, e;
}
class y2 {
  constructor(t, e, n) {
    this.data = t, this.start = e, this.end = n, this.position = e, this.shift = -1, this.currentByte = 0;
  }
  readBit() {
    if (this.shift < 0) {
      if (this.position >= this.end) throw new di("end of data while reading bit");
      this.currentByte = this.data[this.position++], this.shift = 7;
    }
    const t = this.currentByte >> this.shift & 1;
    return this.shift--, t;
  }
  readBits(t) {
    let e, n = 0;
    for (e = t - 1; e >= 0; e--) n |= this.readBit() << e;
    return n;
  }
  byteAlign() {
    this.shift = -1;
  }
  next() {
    return this.position >= this.end ? -1 : this.data[this.position++];
  }
}
function S0(i, t, e) {
  let n = 0;
  for (let s = 0, r = t.length; s < r; s++) {
    const a = e[t[s]];
    if (a) {
      if (i === n) return a;
      n++;
    }
  }
  throw new di("can't find custom Huffman table");
}
function MP(i, t, e) {
  const n = [];
  for (let s = 0; s < e; s++) {
    const r = new Uint8Array(t);
    n.push(r);
    for (let a = 0; a < t; a++) r[a] = i.readBit();
    i.byteAlign();
  }
  return n;
}
function bb(i, t, e, n) {
  const s = new iD(i, { K: -1, Columns: t, Rows: e, BlackIs1: !0, EndOfBlock: n }), r = [];
  let a, o = !1;
  for (let l = 0; l < e; l++) {
    const c = new Uint8Array(t);
    r.push(c);
    let h = -1;
    for (let u = 0; u < t; u++)
      h < 0 && (a = s.readNextChar(), a === -1 && (a = 0, o = !0), h = 7), c[u] = a >> h & 1, h--;
  }
  if (n && !o)
    for (let c = 0; c < 5 && s.readNextChar() !== -1; c++) ;
  return r;
}
class RP {
  parseChunks(t) {
    return function(n) {
      const s = new IP();
      for (let r = 0, a = n.length; r < a; r++) {
        const o = n[r];
        FP(DP({}, o.data, o.start, o.end), s);
      }
      return s.buffer;
    }(t);
  }
  parse(t) {
    throw new Error("Not implemented: Jbig2Image.parse");
  }
}
class BP extends ps {
  constructor(t, e, n) {
    super(e), this.stream = t, this.dict = t.dict, this.maybeLength = e, this.params = n;
  }
  get bytes() {
    return At(this, "bytes", this.stream.getBytes(this.maybeLength));
  }
  ensureBuffer(t) {
  }
  readBlock() {
    this.decodeImage();
  }
  decodeImage(t) {
    if (this.eof) return this.buffer;
    t || (t = this.bytes);
    const e = new RP(), n = [];
    if (this.params instanceof Z) {
      const a = this.params.get("JBIG2Globals");
      if (a instanceof oe) {
        const o = a.getBytes();
        n.push({ data: o, start: 0, end: o.length });
      }
    }
    n.push({ data: t, start: 0, end: t.length });
    const s = e.parseChunks(n), r = s.length;
    for (let a = 0; a < r; a++) s[a] ^= 255;
    return this.buffer = s, this.bufferLength = r, this.eof = !0, this.buffer;
  }
  get canAsyncDecodeImageFromBuffer() {
    return this.stream.isAsync;
  }
}
class PP extends ps {
  constructor(t, e, n) {
    super(e), this.stream = t, this.dict = t.dict, this.maybeLength = e, this.params = n;
  }
  get bytes() {
    return At(this, "bytes", this.stream.getBytes(this.maybeLength));
  }
  ensureBuffer(t) {
  }
  readBlock(t) {
    ye("JpxStream.readBlock");
  }
  get isAsyncDecoder() {
    return !0;
  }
  async decodeImage(t, e) {
    return this.eof ? this.buffer : (t || (t = this.bytes), this.buffer = await va.decode(t, e), this.bufferLength = this.buffer.length, this.eof = !0, this.buffer);
  }
  get canAsyncDecodeImageFromBuffer() {
    return this.stream.isAsync;
  }
}
class __ extends ps {
  constructor(t, e, n) {
    super(e), this.str = t, this.dict = t.dict, this.cachedData = 0, this.bitsCached = 0;
    const s = 4096, r = { earlyChange: n, codeLength: 9, nextCode: 258, dictionaryValues: new Uint8Array(s), dictionaryLengths: new Uint16Array(s), dictionaryPrevCodes: new Uint16Array(s), currentSequence: new Uint8Array(s), currentSequenceLength: 0 };
    for (let a = 0; a < 256; ++a)
      r.dictionaryValues[a] = a, r.dictionaryLengths[a] = 1;
    this.lzwState = r;
  }
  readBits(t) {
    let e = this.bitsCached, n = this.cachedData;
    for (; e < t; ) {
      const s = this.str.getByte();
      if (s === -1)
        return this.eof = !0, null;
      n = n << 8 | s, e += 8;
    }
    return this.bitsCached = e -= t, this.cachedData = n, this.lastCode = null, n >>> e & (1 << t) - 1;
  }
  readBlock() {
    let t, e, n, s = 1024;
    const r = this.lzwState;
    if (!r) return;
    const a = r.earlyChange;
    let o = r.nextCode;
    const l = r.dictionaryValues, c = r.dictionaryLengths, h = r.dictionaryPrevCodes;
    let u = r.codeLength, f = r.prevCode;
    const d = r.currentSequence;
    let p = r.currentSequenceLength, g = 0, b = this.bufferLength, y = this.ensureBuffer(this.bufferLength + s);
    for (t = 0; t < 512; t++) {
      const v = this.readBits(u), w = p > 0;
      if (v < 256)
        d[0] = v, p = 1;
      else {
        if (!(v >= 258)) {
          if (v === 256) {
            u = 9, o = 258, p = 0;
            continue;
          }
          this.eof = !0, delete this.lzwState;
          break;
        }
        if (v < o)
          for (p = c[v], e = p - 1, n = v; e >= 0; e--)
            d[e] = l[n], n = h[n];
        else d[p++] = d[0];
      }
      if (w && (h[o] = f, c[o] = c[f] + 1, l[o] = d[0], o++, u = o + a & o + a - 1 ? u : 0 | Math.min(Math.log(o + a) / 0.6931471805599453 + 1, 12)), f = v, g += p, s < g) {
        do
          s += 512;
        while (s < g);
        y = this.ensureBuffer(this.bufferLength + s);
      }
      for (e = 0; e < p; e++) y[b++] = d[e];
    }
    r.nextCode = o, r.codeLength = u, r.prevCode = f, r.currentSequenceLength = p, this.bufferLength = b;
  }
}
class x_ extends ps {
  constructor(t, e, n) {
    if (super(e), !(n instanceof Z)) return t;
    const s = this.predictor = n.get("Predictor") || 1;
    if (s <= 1) return t;
    if (s !== 2 && (s < 10 || s > 15)) throw new ht(`Unsupported predictor: ${s}`);
    this.readBlock = s === 2 ? this.readBlockTiff : this.readBlockPng, this.str = t, this.dict = t.dict;
    const r = this.colors = n.get("Colors") || 1, a = this.bits = n.get("BPC", "BitsPerComponent") || 8, o = this.columns = n.get("Columns") || 1;
    return this.pixBytes = r * a + 7 >> 3, this.rowBytes = o * r * a + 7 >> 3, this;
  }
  readBlockTiff() {
    const t = this.rowBytes, e = this.bufferLength, n = this.ensureBuffer(e + t), s = this.bits, r = this.colors, a = this.str.getBytes(t);
    if (this.eof = !a.length, this.eof) return;
    let o, l = 0, c = 0, h = 0, u = 0, f = e;
    if (s === 1 && r === 1) for (o = 0; o < t; ++o) {
      let d = a[o] ^ l;
      d ^= d >> 1, d ^= d >> 2, d ^= d >> 4, l = (1 & d) << 7, n[f++] = d;
    }
    else if (s === 8) {
      for (o = 0; o < r; ++o) n[f++] = a[o];
      for (; o < t; ++o)
        n[f] = n[f - r] + a[o], f++;
    } else if (s === 16) {
      const d = 2 * r;
      for (o = 0; o < d; ++o) n[f++] = a[o];
      for (; o < t; o += 2) {
        const p = ((255 & a[o]) << 8) + (255 & a[o + 1]) + ((255 & n[f - d]) << 8) + (255 & n[f - d + 1]);
        n[f++] = p >> 8 & 255, n[f++] = 255 & p;
      }
    } else {
      const d = new Uint8Array(r + 1), p = (1 << s) - 1;
      let g = 0, b = e;
      const y = this.columns;
      for (o = 0; o < y; ++o) for (let v = 0; v < r; ++v)
        h < s && (l = l << 8 | 255 & a[g++], h += 8), d[v] = d[v] + (l >> h - s) & p, h -= s, c = c << s | d[v], u += s, u >= 8 && (n[b++] = c >> u - 8 & 255, u -= 8);
      u > 0 && (n[b++] = (c << 8 - u) + (l & (1 << 8 - u) - 1));
    }
    this.bufferLength += t;
  }
  readBlockPng() {
    const t = this.rowBytes, e = this.pixBytes, n = this.str.getByte(), s = this.str.getBytes(t);
    if (this.eof = !s.length, this.eof) return;
    const r = this.bufferLength, a = this.ensureBuffer(r + t);
    let o = a.subarray(r - t, r);
    o.length === 0 && (o = new Uint8Array(t));
    let l, c, h, u = r;
    switch (n) {
      case 0:
        for (l = 0; l < t; ++l) a[u++] = s[l];
        break;
      case 1:
        for (l = 0; l < e; ++l) a[u++] = s[l];
        for (; l < t; ++l)
          a[u] = a[u - e] + s[l] & 255, u++;
        break;
      case 2:
        for (l = 0; l < t; ++l) a[u++] = o[l] + s[l] & 255;
        break;
      case 3:
        for (l = 0; l < e; ++l) a[u++] = (o[l] >> 1) + s[l];
        for (; l < t; ++l)
          a[u] = (o[l] + a[u - e] >> 1) + s[l] & 255, u++;
        break;
      case 4:
        for (l = 0; l < e; ++l)
          c = o[l], h = s[l], a[u++] = c + h;
        for (; l < t; ++l) {
          c = o[l];
          const f = o[l - e], d = a[u - e], p = d + c - f;
          let g = p - d;
          g < 0 && (g = -g);
          let b = p - c;
          b < 0 && (b = -b);
          let y = p - f;
          y < 0 && (y = -y), h = s[l], a[u++] = g <= b && g <= y ? d + h : b <= y ? c + h : f + h;
        }
        break;
      default:
        throw new ht(`Unsupported predictor: ${n}`);
    }
    this.bufferLength += t;
  }
}
class NP extends ps {
  constructor(t, e) {
    super(e), this.str = t, this.dict = t.dict;
  }
  readBlock() {
    const t = this.str.getBytes(2);
    if (!t || t.length < 2 || t[0] === 128) {
      this.eof = !0;
      return;
    }
    let e, n = this.bufferLength, s = t[0];
    if (s < 128) {
      if (e = this.ensureBuffer(n + s + 1), e[n++] = t[1], s > 0) {
        const r = this.str.getBytes(s);
        e.set(r, n), n += s;
      }
    } else
      s = 257 - s, e = this.ensureBuffer(n + s + 1), e.fill(t[1], n, n + s), n += s;
    this.bufferLength = n;
  }
}
var g4, rD;
class lc {
  constructor({ lexer: t, xref: e, allowStreams: n = !1, recoveryMode: s = !1 }) {
    F(this, g4);
    this.lexer = t, this.xref = e, this.allowStreams = n, this.recoveryMode = s, this.imageCache = /* @__PURE__ */ Object.create(null), this._imageId = 0, this.refill();
  }
  refill() {
    this.buf1 = this.lexer.getObj(), this.buf2 = this.lexer.getObj();
  }
  shift() {
    this.buf2 instanceof Li && this.buf2.cmd === "ID" ? (this.buf1 = this.buf2, this.buf2 = null) : (this.buf1 = this.buf2, this.buf2 = this.lexer.getObj());
  }
  tryShift() {
    try {
      return this.shift(), !0;
    } catch (t) {
      if (t instanceof ti) throw t;
      return !1;
    }
  }
  getObj(t = null) {
    const e = this.buf1;
    if (this.shift(), e instanceof Li) switch (e.cmd) {
      case "BI":
        return this.makeInlineImage(t);
      case "[":
        const n = [];
        for (; !nn(this.buf1, "]") && this.buf1 !== fn; ) n.push(this.getObj(t));
        if (this.buf1 === fn) {
          if (this.recoveryMode) return n;
          throw new eb("End of file inside array.");
        }
        return this.shift(), n;
      case "<<":
        const s = new Z(this.xref);
        for (; !nn(this.buf1, ">>") && this.buf1 !== fn; ) {
          if (!(this.buf1 instanceof lt)) {
            ue("Malformed dictionary: key must be a name object"), this.shift();
            continue;
          }
          const r = this.buf1.name;
          if (this.shift(), this.buf1 === fn) break;
          s.set(r, this.getObj(t));
        }
        if (this.buf1 === fn) {
          if (this.recoveryMode) return s;
          throw new eb("End of file inside dictionary.");
        }
        return nn(this.buf2, "stream") ? this.allowStreams ? this.makeStream(s, t) : s : (this.shift(), s);
      default:
        return e;
    }
    if (Number.isInteger(e)) {
      if (Number.isInteger(this.buf1) && nn(this.buf2, "R")) {
        const n = Dt.get(e, this.buf1);
        return this.shift(), this.shift(), n;
      }
      return e;
    }
    return typeof e == "string" && t ? t.decryptString(e) : e;
  }
  findDefaultInlineStreamEnd(t) {
    const { knownCommands: e } = this.lexer, n = t.pos;
    let s, r, a = 0;
    for (; (s = t.getByte()) !== -1; ) if (a === 0) a = s === 69 ? 1 : 0;
    else if (a === 1) a = s === 73 ? 2 : 0;
    else if (s === 32 || s === 10 || s === 13) {
      r = t.pos;
      const l = t.peekBytes(15), c = l.length;
      if (c === 0) break;
      for (let f = 0; f < c; f++)
        if (s = l[f], (s !== 0 || l[f + 1] === 0) && s !== 10 && s !== 13 && (s < 32 || s > 127)) {
          a = 0;
          break;
        }
      if (a !== 2) continue;
      if (!e) {
        H("findDefaultInlineStreamEnd - `lexer.knownCommands` is undefined.");
        continue;
      }
      const h = new ka(new gi(t.peekBytes(75)), e);
      h._hexStringWarn = () => {
      };
      let u = 0;
      for (; ; ) {
        const f = h.getObj();
        if (f === fn) {
          a = 0;
          break;
        }
        if (f instanceof Li) {
          const d = e[f.cmd];
          if (!d) {
            a = 0;
            break;
          }
          if (d.variableArgs ? u <= d.numArgs : u === d.numArgs) break;
          u = 0;
        } else u++;
      }
      if (a === 2) break;
    } else a = 0;
    s === -1 && (H("findDefaultInlineStreamEnd: Reached the end of the stream without finding a valid EI marker"), r && (H('... trying to recover by using the last "EI" occurrence.'), t.skip(-(t.pos - r))));
    let o = 4;
    return t.skip(-o), s = t.peekByte(), t.skip(o), or(s) || o--, t.pos - o - n;
  }
  findDCTDecodeInlineStreamEnd(t) {
    const e = t.pos;
    let n, s, r = !1;
    for (; (n = t.getByte()) !== -1; ) if (n === 255) {
      switch (t.getByte()) {
        case 0:
          break;
        case 255:
          t.skip(-1);
          break;
        case 217:
          r = !0;
          break;
        case 192:
        case 193:
        case 194:
        case 195:
        case 197:
        case 198:
        case 199:
        case 201:
        case 202:
        case 203:
        case 205:
        case 206:
        case 207:
        case 196:
        case 204:
        case 218:
        case 219:
        case 220:
        case 221:
        case 222:
        case 223:
        case 224:
        case 225:
        case 226:
        case 227:
        case 228:
        case 229:
        case 230:
        case 231:
        case 232:
        case 233:
        case 234:
        case 235:
        case 236:
        case 237:
        case 238:
        case 239:
        case 254:
          s = t.getUint16(), s > 2 ? t.skip(s - 2) : t.skip(-2);
      }
      if (r) break;
    }
    const a = t.pos - e;
    return n === -1 ? (H("Inline DCTDecode image stream: EOI marker not found, searching for /EI/ instead."), t.skip(-a), this.findDefaultInlineStreamEnd(t)) : (this.inlineStreamSkipEI(t), a);
  }
  findASCII85DecodeInlineStreamEnd(t) {
    const e = t.pos;
    let n;
    for (; (n = t.getByte()) !== -1; ) if (n === 126) {
      const r = t.pos;
      for (n = t.peekByte(); or(n); )
        t.skip(), n = t.peekByte();
      if (n === 62) {
        t.skip();
        break;
      }
      if (t.pos > r) {
        const a = t.peekBytes(2);
        if (a[0] === 69 && a[1] === 73) break;
      }
    }
    const s = t.pos - e;
    return n === -1 ? (H("Inline ASCII85Decode image stream: EOD marker not found, searching for /EI/ instead."), t.skip(-s), this.findDefaultInlineStreamEnd(t)) : (this.inlineStreamSkipEI(t), s);
  }
  findASCIIHexDecodeInlineStreamEnd(t) {
    const e = t.pos;
    let n;
    for (; (n = t.getByte()) !== -1 && n !== 62; ) ;
    const s = t.pos - e;
    return n === -1 ? (H("Inline ASCIIHexDecode image stream: EOD marker not found, searching for /EI/ instead."), t.skip(-s), this.findDefaultInlineStreamEnd(t)) : (this.inlineStreamSkipEI(t), s);
  }
  inlineStreamSkipEI(t) {
    let e, n = 0;
    for (; (e = t.getByte()) !== -1; ) if (n === 0) n = e === 69 ? 1 : 0;
    else if (n === 1) n = e === 73 ? 2 : 0;
    else if (n === 2) break;
  }
  makeInlineImage(t) {
    const e = this.lexer, n = e.stream, s = /* @__PURE__ */ Object.create(null);
    let r;
    for (; !nn(this.buf1, "ID") && this.buf1 !== fn; ) {
      if (!(this.buf1 instanceof lt)) throw new ht("Dictionary key must be a name object");
      const d = this.buf1.name;
      if (this.shift(), this.buf1 === fn) break;
      s[d] = this.getObj(t);
    }
    e.beginInlineImagePos !== -1 && (r = n.pos - e.beginInlineImagePos);
    const a = this.xref.fetchIfRef(s.F || s.Filter);
    let o;
    if (a instanceof lt) o = a.name;
    else if (Array.isArray(a)) {
      const d = this.xref.fetchIfRef(a[0]);
      d instanceof lt && (o = d.name);
    }
    const l = n.pos;
    let c, h;
    switch (o) {
      case "DCT":
      case "DCTDecode":
        c = this.findDCTDecodeInlineStreamEnd(n);
        break;
      case "A85":
      case "ASCII85Decode":
        c = this.findASCII85DecodeInlineStreamEnd(n);
        break;
      case "AHx":
      case "ASCIIHexDecode":
        c = this.findASCIIHexDecodeInlineStreamEnd(n);
        break;
      default:
        c = this.findDefaultInlineStreamEnd(n);
    }
    if (c < 1e3 && r > 0) {
      const d = n.pos;
      n.pos = e.beginInlineImagePos, h = function(b) {
        const y = [], v = b.length;
        let w = 0;
        for (; w < v - 1; ) y.push(b[w++] << 8 | b[w++]);
        return w < v && y.push(b[w]), v + "_" + String.fromCharCode.apply(null, y);
      }(n.getBytes(r + c)), n.pos = d;
      const p = this.imageCache[h];
      if (p !== void 0)
        return this.buf2 = Li.get("EI"), this.shift(), p.reset(), p;
    }
    const u = new Z(this.xref);
    for (const d in s) u.set(d, s[d]);
    let f = n.makeSubStream(l, c, u);
    return t && (f = t.createStream(f, c)), f = this.filter(f, u, c), f.dict = u, h !== void 0 && (f.cacheKey = "inline_img_" + ++this._imageId, this.imageCache[h] = f), this.buf2 = Li.get("EI"), this.shift(), f;
  }
  makeStream(t, e) {
    const n = this.lexer;
    let s = n.stream;
    n.skipToNextLine();
    const r = s.pos - 1;
    let a = t.get("Length");
    if (Number.isInteger(a) || (ue(`Bad length "${a && a.toString()}" in stream.`), a = 0), s.pos = r + a, n.nextChar(), this.tryShift() && nn(this.buf2, "endstream")) this.shift();
    else {
      if (a = D(this, g4, rD).call(this, r), a < 0) throw new ht("Missing endstream command.");
      n.nextChar(), this.shift(), this.shift();
    }
    return this.shift(), s = s.makeSubStream(r, a, t), e && (s = e.createStream(s, a)), s = this.filter(s, t, a), s.dict = t, s;
  }
  filter(t, e, n) {
    let s = e.get("F", "Filter"), r = e.get("DP", "DecodeParms");
    if (s instanceof lt)
      return Array.isArray(r) && H("/DecodeParms should not be an Array, when /Filter is a Name."), this.makeFilter(t, s.name, n, r);
    let a = n;
    if (Array.isArray(s)) {
      const o = s, l = r;
      for (let c = 0, h = o.length; c < h; ++c) {
        if (s = this.xref.fetchIfRef(o[c]), !(s instanceof lt)) throw new ht(`Bad filter name "${s}"`);
        r = null, Array.isArray(l) && c in l && (r = this.xref.fetchIfRef(l[c])), t = this.makeFilter(t, s.name, a, r), a = null;
      }
    }
    return t;
  }
  makeFilter(t, e, n, s) {
    if (n === 0)
      return H(`Empty "${e}" stream.`), new ub();
    try {
      switch (e) {
        case "Fl":
        case "FlateDecode":
          return s ? new x_(new g_(t, n), n, s) : new g_(t, n);
        case "LZW":
        case "LZWDecode":
          let r = 1;
          return s ? (s.has("EarlyChange") && (r = s.get("EarlyChange")), new x_(new __(t, n, r), n, s)) : new __(t, n, r);
        case "DCT":
        case "DCTDecode":
          return new tf(t, n, s);
        case "JPX":
        case "JPXDecode":
          return new PP(t, n, s);
        case "A85":
        case "ASCII85Decode":
          return new mP(t, n);
        case "AHx":
        case "ASCIIHexDecode":
          return new gP(t, n);
        case "CCF":
        case "CCITTFaxDecode":
          return new bP(t, n, s);
        case "RL":
        case "RunLengthDecode":
          return new NP(t, n);
        case "JBIG2Decode":
          return new BP(t, n, s);
      }
      return H(`Filter "${e}" is not supported.`), t;
    } catch (r) {
      if (r instanceof ti) throw r;
      return H(`Invalid stream: "${r}"`), new ub();
    }
  }
}
g4 = new WeakSet(), rD = function(t) {
  const { stream: e } = this.lexer;
  e.pos = t;
  const n = new Uint8Array([101, 110, 100]), s = n.length, r = [new Uint8Array([115, 116, 114, 101, 97, 109]), new Uint8Array([115, 116, 101, 97, 109]), new Uint8Array([115, 116, 114, 101, 97])], a = 9 - s;
  for (; e.pos < e.end; ) {
    const o = e.peekBytes(2048), l = o.length - 9;
    if (l <= 0) break;
    let c = 0;
    for (; c < l; ) {
      let h = 0;
      for (; h < s && o[c + h] === n[h]; ) h++;
      if (h >= s) {
        let u = !1;
        for (const f of r) {
          const d = f.length;
          let p = 0;
          for (; p < d && o[c + h + p] === f[p]; ) p++;
          if (p >= a) {
            u = !0;
            break;
          }
          if (p >= d) {
            or(o[c + h + p]) && (ue(`Found "${Is([...n, ...f])}" when searching for endstream command.`), u = !0);
            break;
          }
        }
        if (u)
          return e.pos += c, e.pos - t;
      }
      c++;
    }
    e.pos += l;
  }
  return -1;
};
const H1 = [1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 2, 2, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 2, 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, 2, 0, 2, 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, 2, 0, 2, 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, 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];
function w6(i) {
  return i >= 48 && i <= 57 ? 15 & i : i >= 65 && i <= 70 || i >= 97 && i <= 102 ? 9 + (15 & i) : -1;
}
class ka {
  constructor(t, e = null) {
    this.stream = t, this.nextChar(), this.strBuf = [], this.knownCommands = e, this._hexStringNumWarn = 0, this.beginInlineImagePos = -1;
  }
  nextChar() {
    return this.currentChar = this.stream.getByte();
  }
  peekChar() {
    return this.stream.peekByte();
  }
  getNumber() {
    let t = this.currentChar, e = !1, n = 0, s = 1;
    if (t === 45 ? (s = -1, t = this.nextChar(), t === 45 && (t = this.nextChar())) : t === 43 && (t = this.nextChar()), t === 10 || t === 13) do
      t = this.nextChar();
    while (t === 10 || t === 13);
    if (t === 46 && (n = 10, t = this.nextChar()), t < 48 || t > 57) {
      const l = `Invalid number: ${String.fromCharCode(t)} (charCode ${t})`;
      if (or(t) || t === 40 || t === 60 || t === -1)
        return ue(`Lexer.getNumber - "${l}".`), 0;
      throw new ht(l);
    }
    let r = t - 48, a = 0, o = 1;
    for (; (t = this.nextChar()) >= 0; ) if (t >= 48 && t <= 57) {
      const l = t - 48;
      e ? a = 10 * a + l : (n !== 0 && (n *= 10), r = 10 * r + l);
    } else if (t === 46) {
      if (n !== 0) break;
      n = 1;
    } else if (t === 45) H("Badly formatted number: minus sign in the middle");
    else {
      if (t !== 69 && t !== 101) break;
      if (t = this.peekChar(), t === 43 || t === 45)
        o = t === 45 ? -1 : 1, this.nextChar();
      else if (t < 48 || t > 57) break;
      e = !0;
    }
    return n !== 0 && (r /= n), e && (r *= 10 ** (o * a)), s * r;
  }
  getString() {
    let t = 1, e = !1;
    const n = this.strBuf;
    n.length = 0;
    let s = this.nextChar();
    for (; ; ) {
      let r = !1;
      switch (0 | s) {
        case -1:
          H("Unterminated string"), e = !0;
          break;
        case 40:
          ++t, n.push("(");
          break;
        case 41:
          --t == 0 ? (this.nextChar(), e = !0) : n.push(")");
          break;
        case 92:
          switch (s = this.nextChar(), s) {
            case -1:
              H("Unterminated string"), e = !0;
              break;
            case 110:
              n.push(`
`);
              break;
            case 114:
              n.push("\r");
              break;
            case 116:
              n.push("	");
              break;
            case 98:
              n.push("\b");
              break;
            case 102:
              n.push("\f");
              break;
            case 92:
            case 40:
            case 41:
              n.push(String.fromCharCode(s));
              break;
            case 48:
            case 49:
            case 50:
            case 51:
            case 52:
            case 53:
            case 54:
            case 55:
              let a = 15 & s;
              s = this.nextChar(), r = !0, s >= 48 && s <= 55 && (a = (a << 3) + (15 & s), s = this.nextChar(), s >= 48 && s <= 55 && (r = !1, a = (a << 3) + (15 & s))), n.push(String.fromCharCode(a));
              break;
            case 13:
              this.peekChar() === 10 && this.nextChar();
              break;
            case 10:
              break;
            default:
              n.push(String.fromCharCode(s));
          }
          break;
        default:
          n.push(String.fromCharCode(s));
      }
      if (e) break;
      r || (s = this.nextChar());
    }
    return n.join("");
  }
  getName() {
    let t, e;
    const n = this.strBuf;
    for (n.length = 0; (t = this.nextChar()) >= 0 && !H1[t]; ) if (t === 35) {
      if (t = this.nextChar(), H1[t]) {
        H("Lexer_getName: NUMBER SIGN (#) should be followed by a hexadecimal number."), n.push("#");
        break;
      }
      const s = w6(t);
      if (s !== -1) {
        e = t, t = this.nextChar();
        const r = w6(t);
        if (r === -1) {
          if (H(`Lexer_getName: Illegal digit (${String.fromCharCode(t)}) in hexadecimal number.`), n.push("#", String.fromCharCode(e)), H1[t]) break;
          n.push(String.fromCharCode(t));
          continue;
        }
        n.push(String.fromCharCode(s << 4 | r));
      } else n.push("#", String.fromCharCode(t));
    } else n.push(String.fromCharCode(t));
    return n.length > 127 && H(`Name token is longer than allowed by the spec: ${n.length}`), lt.get(n.join(""));
  }
  _hexStringWarn(t) {
    this._hexStringNumWarn++ != 5 ? this._hexStringNumWarn > 5 || H(`getHexString - ignoring invalid character: ${t}`) : H("getHexString - ignoring additional invalid characters.");
  }
  getHexString() {
    const t = this.strBuf;
    t.length = 0;
    let e = this.currentChar, n = -1, s = -1;
    for (this._hexStringNumWarn = 0; ; ) {
      if (e < 0) {
        H("Unterminated hex string");
        break;
      }
      if (e === 62) {
        this.nextChar();
        break;
      }
      H1[e] !== 1 ? (s = w6(e), s === -1 ? this._hexStringWarn(e) : n === -1 ? n = s : (t.push(String.fromCharCode(n << 4 | s)), n = -1), e = this.nextChar()) : e = this.nextChar();
    }
    return n !== -1 && t.push(String.fromCharCode(n << 4)), t.join("");
  }
  getObj() {
    let t = !1, e = this.currentChar;
    for (; ; ) {
      if (e < 0) return fn;
      if (t) e !== 10 && e !== 13 || (t = !1);
      else if (e === 37) t = !0;
      else if (H1[e] !== 1) break;
      e = this.nextChar();
    }
    switch (0 | e) {
      case 48:
      case 49:
      case 50:
      case 51:
      case 52:
      case 53:
      case 54:
      case 55:
      case 56:
      case 57:
      case 43:
      case 45:
      case 46:
        return this.getNumber();
      case 40:
        return this.getString();
      case 47:
        return this.getName();
      case 91:
        return this.nextChar(), Li.get("[");
      case 93:
        return this.nextChar(), Li.get("]");
      case 60:
        return e = this.nextChar(), e === 60 ? (this.nextChar(), Li.get("<<")) : this.getHexString();
      case 62:
        return e = this.nextChar(), e === 62 ? (this.nextChar(), Li.get(">>")) : Li.get(">");
      case 123:
        return this.nextChar(), Li.get("{");
      case 125:
        return this.nextChar(), Li.get("}");
      case 41:
        throw this.nextChar(), new ht(`Illegal character: ${e}`);
    }
    let n = String.fromCharCode(e);
    if (e < 32 || e > 127) {
      const a = this.peekChar();
      if (a >= 32 && a <= 127)
        return this.nextChar(), Li.get(n);
    }
    const s = this.knownCommands;
    let r = (s == null ? void 0 : s[n]) !== void 0;
    for (; (e = this.nextChar()) >= 0 && !H1[e]; ) {
      const a = n + String.fromCharCode(e);
      if (r && s[a] === void 0) break;
      if (n.length === 128) throw new ht(`Command token too long: ${n.length}`);
      n = a, r = (s == null ? void 0 : s[n]) !== void 0;
    }
    return n === "true" ? !0 : n === "false" ? !1 : n === "null" ? null : (n === "BI" && (this.beginInlineImagePos = this.stream.pos), Li.get(n));
  }
  skipToNextLine() {
    let t = this.currentChar;
    for (; t >= 0; ) {
      if (t === 13) {
        t = this.nextChar(), t === 10 && this.nextChar();
        break;
      }
      if (t === 10) {
        this.nextChar();
        break;
      }
      t = this.nextChar();
    }
  }
}
class LP {
  static create(t) {
    function e(h, u, f = !1) {
      const d = h.get(u);
      if (Number.isInteger(d) && (f ? d >= 0 : d > 0)) return d;
      throw new Error(`The "${u}" parameter in the linearization dictionary is invalid.`);
    }
    const n = new lc({ lexer: new ka(t), xref: null }), s = n.getObj(), r = n.getObj(), a = n.getObj(), o = n.getObj();
    let l, c;
    if (!(Number.isInteger(s) && Number.isInteger(r) && nn(a, "obj") && o instanceof Z && typeof (l = o.get("Linearized")) == "number" && l > 0)) return null;
    if ((c = e(o, "L")) !== t.length) throw new Error('The "L" parameter in the linearization dictionary does not equal the stream length.');
    return { length: c, hints: function(u) {
      const f = u.get("H");
      let d;
      if (Array.isArray(f) && ((d = f.length) === 2 || d === 4)) {
        for (let p = 0; p < d; p++) {
          const g = f[p];
          if (!(Number.isInteger(g) && g > 0)) throw new Error(`Hint (${p}) in the linearization dictionary is invalid.`);
        }
        return f;
      }
      throw new Error("Hint array in the linearization dictionary is invalid.");
    }(o), objectNumberFirst: e(o, "O"), endFirst: e(o, "E"), numPages: e(o, "N"), mainXRefEntriesOffset: e(o, "T"), pageFirst: o.has("P") ? e(o, "P", !0) : 0 };
  }
}
const OP = ["Adobe-GB1-UCS2", "Adobe-CNS1-UCS2", "Adobe-Japan1-UCS2", "Adobe-Korea1-UCS2", "78-EUC-H", "78-EUC-V", "78-H", "78-RKSJ-H", "78-RKSJ-V", "78-V", "78ms-RKSJ-H", "78ms-RKSJ-V", "83pv-RKSJ-H", "90ms-RKSJ-H", "90ms-RKSJ-V", "90msp-RKSJ-H", "90msp-RKSJ-V", "90pv-RKSJ-H", "90pv-RKSJ-V", "Add-H", "Add-RKSJ-H", "Add-RKSJ-V", "Add-V", "Adobe-CNS1-0", "Adobe-CNS1-1", "Adobe-CNS1-2", "Adobe-CNS1-3", "Adobe-CNS1-4", "Adobe-CNS1-5", "Adobe-CNS1-6", "Adobe-GB1-0", "Adobe-GB1-1", "Adobe-GB1-2", "Adobe-GB1-3", "Adobe-GB1-4", "Adobe-GB1-5", "Adobe-Japan1-0", "Adobe-Japan1-1", "Adobe-Japan1-2", "Adobe-Japan1-3", "Adobe-Japan1-4", "Adobe-Japan1-5", "Adobe-Japan1-6", "Adobe-Korea1-0", "Adobe-Korea1-1", "Adobe-Korea1-2", "B5-H", "B5-V", "B5pc-H", "B5pc-V", "CNS-EUC-H", "CNS-EUC-V", "CNS1-H", "CNS1-V", "CNS2-H", "CNS2-V", "ETHK-B5-H", "ETHK-B5-V", "ETen-B5-H", "ETen-B5-V", "ETenms-B5-H", "ETenms-B5-V", "EUC-H", "EUC-V", "Ext-H", "Ext-RKSJ-H", "Ext-RKSJ-V", "Ext-V", "GB-EUC-H", "GB-EUC-V", "GB-H", "GB-V", "GBK-EUC-H", "GBK-EUC-V", "GBK2K-H", "GBK2K-V", "GBKp-EUC-H", "GBKp-EUC-V", "GBT-EUC-H", "GBT-EUC-V", "GBT-H", "GBT-V", "GBTpc-EUC-H", "GBTpc-EUC-V", "GBpc-EUC-H", "GBpc-EUC-V", "H", "HKdla-B5-H", "HKdla-B5-V", "HKdlb-B5-H", "HKdlb-B5-V", "HKgccs-B5-H", "HKgccs-B5-V", "HKm314-B5-H", "HKm314-B5-V", "HKm471-B5-H", "HKm471-B5-V", "HKscs-B5-H", "HKscs-B5-V", "Hankaku", "Hiragana", "KSC-EUC-H", "KSC-EUC-V", "KSC-H", "KSC-Johab-H", "KSC-Johab-V", "KSC-V", "KSCms-UHC-H", "KSCms-UHC-HW-H", "KSCms-UHC-HW-V", "KSCms-UHC-V", "KSCpc-EUC-H", "KSCpc-EUC-V", "Katakana", "NWP-H", "NWP-V", "RKSJ-H", "RKSJ-V", "Roman", "UniCNS-UCS2-H", "UniCNS-UCS2-V", "UniCNS-UTF16-H", "UniCNS-UTF16-V", "UniCNS-UTF32-H", "UniCNS-UTF32-V", "UniCNS-UTF8-H", "UniCNS-UTF8-V", "UniGB-UCS2-H", "UniGB-UCS2-V", "UniGB-UTF16-H", "UniGB-UTF16-V", "UniGB-UTF32-H", "UniGB-UTF32-V", "UniGB-UTF8-H", "UniGB-UTF8-V", "UniJIS-UCS2-H", "UniJIS-UCS2-HW-H", "UniJIS-UCS2-HW-V", "UniJIS-UCS2-V", "UniJIS-UTF16-H", "UniJIS-UTF16-V", "UniJIS-UTF32-H", "UniJIS-UTF32-V", "UniJIS-UTF8-H", "UniJIS-UTF8-V", "UniJIS2004-UTF16-H", "UniJIS2004-UTF16-V", "UniJIS2004-UTF32-H", "UniJIS2004-UTF32-V", "UniJIS2004-UTF8-H", "UniJIS2004-UTF8-V", "UniJISPro-UCS2-HW-V", "UniJISPro-UCS2-V", "UniJISPro-UTF8-V", "UniJISX0213-UTF32-H", "UniJISX0213-UTF32-V", "UniJISX02132004-UTF32-H", "UniJISX02132004-UTF32-V", "UniKS-UCS2-H", "UniKS-UCS2-V", "UniKS-UTF16-H", "UniKS-UTF16-V", "UniKS-UTF32-H", "UniKS-UTF32-V", "UniKS-UTF8-H", "UniKS-UTF8-V", "V", "WP-Symbol"], v6 = 2 ** 24 - 1;
class Vy {
  constructor(t = !1) {
    this.codespaceRanges = [[], [], [], []], this.numCodespaceRanges = 0, this._map = [], this.name = "", this.vertical = !1, this.useCMap = null, this.builtInCMap = t;
  }
  addCodespaceRange(t, e, n) {
    this.codespaceRanges[t - 1].push(e, n), this.numCodespaceRanges++;
  }
  mapCidRange(t, e, n) {
    if (e - t > v6) throw new Error("mapCidRange - ignoring data above MAX_MAP_RANGE.");
    for (; t <= e; ) this._map[t++] = n++;
  }
  mapBfRange(t, e, n) {
    if (e - t > v6) throw new Error("mapBfRange - ignoring data above MAX_MAP_RANGE.");
    const s = n.length - 1;
    for (; t <= e; ) {
      this._map[t++] = n;
      const r = n.charCodeAt(s) + 1;
      r > 255 ? n = n.substring(0, s - 1) + String.fromCharCode(n.charCodeAt(s - 1) + 1) + "\0" : n = n.substring(0, s) + String.fromCharCode(r);
    }
  }
  mapBfRangeToArray(t, e, n) {
    if (e - t > v6) throw new Error("mapBfRangeToArray - ignoring data above MAX_MAP_RANGE.");
    const s = n.length;
    let r = 0;
    for (; t <= e && r < s; )
      this._map[t] = n[r++], ++t;
  }
  mapOne(t, e) {
    this._map[t] = e;
  }
  lookup(t) {
    return this._map[t];
  }
  contains(t) {
    return this._map[t] !== void 0;
  }
  forEach(t) {
    const e = this._map, n = e.length;
    if (n <= 65536) for (let s = 0; s < n; s++) e[s] !== void 0 && t(s, e[s]);
    else for (const s in e) t(s, e[s]);
  }
  charCodeOf(t) {
    const e = this._map;
    if (e.length <= 65536) return e.indexOf(t);
    for (const n in e) if (e[n] === t) return 0 | n;
    return -1;
  }
  getMap() {
    return this._map;
  }
  readCharCode(t, e, n) {
    let s = 0;
    const r = this.codespaceRanges;
    for (let a = 0, o = r.length; a < o; a++) {
      s = (s << 8 | t.charCodeAt(e + a)) >>> 0;
      const l = r[a];
      for (let c = 0, h = l.length; c < h; ) {
        const u = l[c++], f = l[c++];
        if (s >= u && s <= f) {
          n.charcode = s, n.length = a + 1;
          return;
        }
      }
    }
    n.charcode = 0, n.length = 1;
  }
  getCharCodeLength(t) {
    const e = this.codespaceRanges;
    for (let n = 0, s = e.length; n < s; n++) {
      const r = e[n];
      for (let a = 0, o = r.length; a < o; ) {
        const l = r[a++], c = r[a++];
        if (t >= l && t <= c) return n + 1;
      }
    }
    return 1;
  }
  get length() {
    return this._map.length;
  }
  get isIdentityCMap() {
    if (this.name !== "Identity-H" && this.name !== "Identity-V" || this._map.length !== 65536) return !1;
    for (let t = 0; t < 65536; t++) if (this._map[t] !== t) return !1;
    return !0;
  }
}
class Du extends Vy {
  constructor(t, e) {
    super(), this.vertical = t, this.addCodespaceRange(e, 0, 65535);
  }
  mapCidRange(t, e, n) {
    ye("should not call mapCidRange");
  }
  mapBfRange(t, e, n) {
    ye("should not call mapBfRange");
  }
  mapBfRangeToArray(t, e, n) {
    ye("should not call mapBfRangeToArray");
  }
  mapOne(t, e) {
    ye("should not call mapCidOne");
  }
  lookup(t) {
    return Number.isInteger(t) && t <= 65535 ? t : void 0;
  }
  contains(t) {
    return Number.isInteger(t) && t <= 65535;
  }
  forEach(t) {
    for (let e = 0; e <= 65535; e++) t(e, e);
  }
  charCodeOf(t) {
    return Number.isInteger(t) && t <= 65535 ? t : -1;
  }
  getMap() {
    const t = new Array(65536);
    for (let e = 0; e <= 65535; e++) t[e] = e;
    return t;
  }
  get length() {
    return 65536;
  }
  get isIdentityCMap() {
    ye("should not access .isIdentityCMap");
  }
}
function d0(i) {
  let t = 0;
  for (let e = 0; e < i.length; e++) t = t << 8 | i.charCodeAt(e);
  return t >>> 0;
}
function S1(i) {
  if (typeof i != "string") throw new ht("Malformed CMap: expected string.");
}
function aD(i) {
  if (!Number.isInteger(i)) throw new ht("Malformed CMap: expected int.");
}
function $P(i, t) {
  for (; ; ) {
    let e = t.getObj();
    if (e === fn) break;
    if (nn(e, "endbfchar")) return;
    S1(e);
    const n = d0(e);
    e = t.getObj(), S1(e);
    const s = e;
    i.mapOne(n, s);
  }
}
function qP(i, t) {
  for (; ; ) {
    let e = t.getObj();
    if (e === fn) break;
    if (nn(e, "endbfrange")) return;
    S1(e);
    const n = d0(e);
    e = t.getObj(), S1(e);
    const s = d0(e);
    if (e = t.getObj(), Number.isInteger(e) || typeof e == "string") {
      const r = Number.isInteger(e) ? String.fromCharCode(e) : e;
      i.mapBfRange(n, s, r);
    } else {
      if (!nn(e, "[")) break;
      {
        e = t.getObj();
        const r = [];
        for (; !nn(e, "]") && e !== fn; )
          r.push(e), e = t.getObj();
        i.mapBfRangeToArray(n, s, r);
      }
    }
  }
  throw new ht("Invalid bf range.");
}
function zP(i, t) {
  for (; ; ) {
    let e = t.getObj();
    if (e === fn) break;
    if (nn(e, "endcidchar")) return;
    S1(e);
    const n = d0(e);
    e = t.getObj(), aD(e);
    const s = e;
    i.mapOne(n, s);
  }
}
function UP(i, t) {
  for (; ; ) {
    let e = t.getObj();
    if (e === fn) break;
    if (nn(e, "endcidrange")) return;
    S1(e);
    const n = d0(e);
    e = t.getObj(), S1(e);
    const s = d0(e);
    e = t.getObj(), aD(e);
    const r = e;
    i.mapCidRange(n, s, r);
  }
}
function HP(i, t) {
  for (; ; ) {
    let e = t.getObj();
    if (e === fn) break;
    if (nn(e, "endcodespacerange")) return;
    if (typeof e != "string") break;
    const n = d0(e);
    if (e = t.getObj(), typeof e != "string") break;
    const s = d0(e);
    i.addCodespaceRange(e.length, n, s);
  }
  throw new ht("Invalid codespace range.");
}
function jP(i, t) {
  const e = t.getObj();
  Number.isInteger(e) && (i.vertical = !!e);
}
function GP(i, t) {
  const e = t.getObj();
  e instanceof lt && (i.name = e.name);
}
async function oD(i, t, e, n) {
  let s, r;
  t: for (; ; ) try {
    const a = t.getObj();
    if (a === fn) break;
    if (a instanceof lt)
      a.name === "WMode" ? jP(i, t) : a.name === "CMapName" && GP(i, t), s = a;
    else if (a instanceof Li) switch (a.cmd) {
      case "endcmap":
        break t;
      case "usecmap":
        s instanceof lt && (r = s.name);
        break;
      case "begincodespacerange":
        HP(i, t);
        break;
      case "beginbfchar":
        $P(i, t);
        break;
      case "begincidchar":
        zP(i, t);
        break;
      case "beginbfrange":
        qP(i, t);
        break;
      case "begincidrange":
        UP(i, t);
    }
  } catch (a) {
    if (a instanceof ti) throw a;
    H("Invalid cMap data: " + a);
    continue;
  }
  return !n && r && (n = r), n ? lD(i, e, n) : i;
}
async function lD(i, t, e) {
  if (i.useCMap = await yb(e, t), i.numCodespaceRanges === 0) {
    const n = i.useCMap.codespaceRanges;
    for (let s = 0; s < n.length; s++) i.codespaceRanges[s] = n[s].slice();
    i.numCodespaceRanges = i.useCMap.numCodespaceRanges;
  }
  return i.useCMap.forEach(function(n, s) {
    i.contains(n) || i.mapOne(n, s);
  }), i;
}
async function yb(i, t) {
  if (i === "Identity-H") return new Du(!1, 2);
  if (i === "Identity-V") return new Du(!0, 2);
  if (!OP.includes(i)) throw new Error("Unknown CMap name: " + i);
  if (!t) throw new Error("Built-in CMap parameters are not provided.");
  const { cMapData: e, isCompressed: n } = await t(i), s = new Vy(!0);
  if (n) return new pP().process(e, s, (a) => lD(s, t, a));
  const r = new ka(new gi(e));
  return oD(s, r, t, null);
}
class r5 {
  static async create({ encoding: t, fetchBuiltInCMap: e, useCMap: n }) {
    if (t instanceof lt) return yb(t.name, e);
    if (t instanceof oe) {
      const s = await oD(new Vy(), new ka(t), e, n);
      return s.isIdentityCMap ? yb(s.name, e) : s;
    }
    throw new Error("Encoding required.");
  }
}
const cD = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclamsmall", "Hungarumlautsmall", "", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "", "", "", "isuperior", "", "", "lsuperior", "msuperior", "nsuperior", "osuperior", "", "", "rsuperior", "ssuperior", "tsuperior", "", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdownsmall", "centoldstyle", "Lslashsmall", "", "", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "", "Dotaccentsmall", "", "", "Macronsmall", "", "", "figuredash", "hypheninferior", "", "", "Ogoneksmall", "Ringsmall", "Cedillasmall", "", "", "", "onequarter", "onehalf", "threequarters", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "", "", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall"], VP = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclamsmall", "Hungarumlautsmall", "centoldstyle", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "", "threequartersemdash", "", "questionsmall", "", "", "", "", "Ethsmall", "", "", "onequarter", "onehalf", "threequarters", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "", "", "", "", "", "", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "", "parenrightinferior", "Circumflexsmall", "hypheninferior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "", "", "asuperior", "centsuperior", "", "", "", "", "Aacutesmall", "Agravesmall", "Acircumflexsmall", "Adieresissmall", "Atildesmall", "Aringsmall", "Ccedillasmall", "Eacutesmall", "Egravesmall", "Ecircumflexsmall", "Edieresissmall", "Iacutesmall", "Igravesmall", "Icircumflexsmall", "Idieresissmall", "Ntildesmall", "Oacutesmall", "Ogravesmall", "Ocircumflexsmall", "Odieresissmall", "Otildesmall", "Uacutesmall", "Ugravesmall", "Ucircumflexsmall", "Udieresissmall", "", "eightsuperior", "fourinferior", "threeinferior", "sixinferior", "eightinferior", "seveninferior", "Scaronsmall", "", "centinferior", "twoinferior", "", "Dieresissmall", "", "Caronsmall", "osuperior", "fiveinferior", "", "commainferior", "periodinferior", "Yacutesmall", "", "dollarinferior", "", "", "Thornsmall", "", "nineinferior", "zeroinferior", "Zcaronsmall", "AEsmall", "Oslashsmall", "questiondownsmall", "oneinferior", "Lslashsmall", "", "", "", "", "", "", "Cedillasmall", "", "", "", "", "", "OEsmall", "figuredash", "hyphensuperior", "", "", "", "", "exclamdownsmall", "", "Ydieresissmall", "", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "ninesuperior", "zerosuperior", "", "esuperior", "rsuperior", "tsuperior", "", "", "isuperior", "ssuperior", "dsuperior", "", "", "", "", "", "lsuperior", "Ogoneksmall", "Brevesmall", "Macronsmall", "bsuperior", "nsuperior", "msuperior", "commasuperior", "periodsuperior", "Dotaccentsmall", "Ringsmall", "", "", "", ""], Wy = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "", "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls", "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", "guillemotright", "ellipsis", "space", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron"], Pl = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "", "endash", "dagger", "daggerdbl", "periodcentered", "", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "", "questiondown", "", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "", "ring", "cedilla", "", "hungarumlaut", "ogonek", "caron", "emdash", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "AE", "", "ordfeminine", "", "", "", "", "Lslash", "Oslash", "OE", "ordmasculine", "", "", "", "", "", "ae", "", "", "", "dotlessi", "", "", "lslash", "oslash", "oe", "germandbls", "", "", "", ""], ap = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "bullet", "Euro", "bullet", "quotesinglbase", "florin", "quotedblbase", "ellipsis", "dagger", "daggerdbl", "circumflex", "perthousand", "Scaron", "guilsinglleft", "OE", "bullet", "Zcaron", "bullet", "bullet", "quoteleft", "quoteright", "quotedblleft", "quotedblright", "bullet", "endash", "emdash", "tilde", "trademark", "scaron", "guilsinglright", "oe", "bullet", "zcaron", "Ydieresis", "space", "exclamdown", "cent", "sterling", "currency", "yen", "brokenbar", "section", "dieresis", "copyright", "ordfeminine", "guillemotleft", "logicalnot", "hyphen", "registered", "macron", "degree", "plusminus", "twosuperior", "threesuperior", "acute", "mu", "paragraph", "periodcentered", "cedilla", "onesuperior", "ordmasculine", "guillemotright", "onequarter", "onehalf", "threequarters", "questiondown", "Agrave", "Aacute", "Acircumflex", "Atilde", "Adieresis", "Aring", "AE", "Ccedilla", "Egrave", "Eacute", "Ecircumflex", "Edieresis", "Igrave", "Iacute", "Icircumflex", "Idieresis", "Eth", "Ntilde", "Ograve", "Oacute", "Ocircumflex", "Otilde", "Odieresis", "multiply", "Oslash", "Ugrave", "Uacute", "Ucircumflex", "Udieresis", "Yacute", "Thorn", "germandbls", "agrave", "aacute", "acircumflex", "atilde", "adieresis", "aring", "ae", "ccedilla", "egrave", "eacute", "ecircumflex", "edieresis", "igrave", "iacute", "icircumflex", "idieresis", "eth", "ntilde", "ograve", "oacute", "ocircumflex", "otilde", "odieresis", "divide", "oslash", "ugrave", "uacute", "ucircumflex", "udieresis", "yacute", "thorn", "ydieresis"], Xy = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "exclam", "universal", "numbersign", "existential", "percent", "ampersand", "suchthat", "parenleft", "parenright", "asteriskmath", "plus", "comma", "minus", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "congruent", "Alpha", "Beta", "Chi", "Delta", "Epsilon", "Phi", "Gamma", "Eta", "Iota", "theta1", "Kappa", "Lambda", "Mu", "Nu", "Omicron", "Pi", "Theta", "Rho", "Sigma", "Tau", "Upsilon", "sigma1", "Omega", "Xi", "Psi", "Zeta", "bracketleft", "therefore", "bracketright", "perpendicular", "underscore", "radicalex", "alpha", "beta", "chi", "delta", "epsilon", "phi", "gamma", "eta", "iota", "phi1", "kappa", "lambda", "mu", "nu", "omicron", "pi", "theta", "rho", "sigma", "tau", "upsilon", "omega1", "omega", "xi", "psi", "zeta", "braceleft", "bar", "braceright", "similar", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "Euro", "Upsilon1", "minute", "lessequal", "fraction", "infinity", "florin", "club", "diamond", "heart", "spade", "arrowboth", "arrowleft", "arrowup", "arrowright", "arrowdown", "degree", "plusminus", "second", "greaterequal", "multiply", "proportional", "partialdiff", "bullet", "divide", "notequal", "equivalence", "approxequal", "ellipsis", "arrowvertex", "arrowhorizex", "carriagereturn", "aleph", "Ifraktur", "Rfraktur", "weierstrass", "circlemultiply", "circleplus", "emptyset", "intersection", "union", "propersuperset", "reflexsuperset", "notsubset", "propersubset", "reflexsubset", "element", "notelement", "angle", "gradient", "registerserif", "copyrightserif", "trademarkserif", "product", "radical", "dotmath", "logicalnot", "logicaland", "logicalor", "arrowdblboth", "arrowdblleft", "arrowdblup", "arrowdblright", "arrowdbldown", "lozenge", "angleleft", "registersans", "copyrightsans", "trademarksans", "summation", "parenlefttp", "parenleftex", "parenleftbt", "bracketlefttp", "bracketleftex", "bracketleftbt", "bracelefttp", "braceleftmid", "braceleftbt", "braceex", "", "angleright", "integral", "integraltp", "integralex", "integralbt", "parenrighttp", "parenrightex", "parenrightbt", "bracketrighttp", "bracketrightex", "bracketrightbt", "bracerighttp", "bracerightmid", "bracerightbt", ""], Yy = ["", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "space", "a1", "a2", "a202", "a3", "a4", "a5", "a119", "a118", "a117", "a11", "a12", "a13", "a14", "a15", "a16", "a105", "a17", "a18", "a19", "a20", "a21", "a22", "a23", "a24", "a25", "a26", "a27", "a28", "a6", "a7", "a8", "a9", "a10", "a29", "a30", "a31", "a32", "a33", "a34", "a35", "a36", "a37", "a38", "a39", "a40", "a41", "a42", "a43", "a44", "a45", "a46", "a47", "a48", "a49", "a50", "a51", "a52", "a53", "a54", "a55", "a56", "a57", "a58", "a59", "a60", "a61", "a62", "a63", "a64", "a65", "a66", "a67", "a68", "a69", "a70", "a71", "a72", "a73", "a74", "a203", "a75", "a204", "a76", "a77", "a78", "a79", "a81", "a82", "a83", "a84", "a97", "a98", "a99", "a100", "", "a89", "a90", "a93", "a94", "a91", "a92", "a205", "a85", "a206", "a86", "a87", "a88", "a95", "a96", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "a101", "a102", "a103", "a104", "a106", "a107", "a108", "a112", "a111", "a110", "a109", "a120", "a121", "a122", "a123", "a124", "a125", "a126", "a127", "a128", "a129", "a130", "a131", "a132", "a133", "a134", "a135", "a136", "a137", "a138", "a139", "a140", "a141", "a142", "a143", "a144", "a145", "a146", "a147", "a148", "a149", "a150", "a151", "a152", "a153", "a154", "a155", "a156", "a157", "a158", "a159", "a160", "a161", "a163", "a164", "a196", "a165", "a192", "a166", "a167", "a168", "a169", "a170", "a171", "a172", "a173", "a162", "a174", "a175", "a176", "a177", "a178", "a179", "a193", "a180", "a199", "a181", "a200", "a182", "", "a201", "a183", "a184", "a197", "a185", "a194", "a198", "a186", "a195", "a187", "a188", "a189", "a190", "a191", ""];
function op(i) {
  switch (i) {
    case "WinAnsiEncoding":
      return ap;
    case "StandardEncoding":
      return Pl;
    case "MacRomanEncoding":
      return Wy;
    case "SymbolSetEncoding":
      return Xy;
    case "ZapfDingbatsEncoding":
      return Yy;
    case "ExpertEncoding":
      return cD;
    case "MacExpertEncoding":
      return VP;
    default:
      return null;
  }
}
const Ga = oi(function(i) {
  i.A = 65, i.AE = 198, i.AEacute = 508, i.AEmacron = 482, i.AEsmall = 63462, i.Aacute = 193, i.Aacutesmall = 63457, i.Abreve = 258, i.Abreveacute = 7854, i.Abrevecyrillic = 1232, i.Abrevedotbelow = 7862, i.Abrevegrave = 7856, i.Abrevehookabove = 7858, i.Abrevetilde = 7860, i.Acaron = 461, i.Acircle = 9398, i.Acircumflex = 194, i.Acircumflexacute = 7844, i.Acircumflexdotbelow = 7852, i.Acircumflexgrave = 7846, i.Acircumflexhookabove = 7848, i.Acircumflexsmall = 63458, i.Acircumflextilde = 7850, i.Acute = 63177, i.Acutesmall = 63412, i.Acyrillic = 1040, i.Adblgrave = 512, i.Adieresis = 196, i.Adieresiscyrillic = 1234, i.Adieresismacron = 478, i.Adieresissmall = 63460, i.Adotbelow = 7840, i.Adotmacron = 480, i.Agrave = 192, i.Agravesmall = 63456, i.Ahookabove = 7842, i.Aiecyrillic = 1236, i.Ainvertedbreve = 514, i.Alpha = 913, i.Alphatonos = 902, i.Amacron = 256, i.Amonospace = 65313, i.Aogonek = 260, i.Aring = 197, i.Aringacute = 506, i.Aringbelow = 7680, i.Aringsmall = 63461, i.Asmall = 63329, i.Atilde = 195, i.Atildesmall = 63459, i.Aybarmenian = 1329, i.B = 66, i.Bcircle = 9399, i.Bdotaccent = 7682, i.Bdotbelow = 7684, i.Becyrillic = 1041, i.Benarmenian = 1330, i.Beta = 914, i.Bhook = 385, i.Blinebelow = 7686, i.Bmonospace = 65314, i.Brevesmall = 63220, i.Bsmall = 63330, i.Btopbar = 386, i.C = 67, i.Caarmenian = 1342, i.Cacute = 262, i.Caron = 63178, i.Caronsmall = 63221, i.Ccaron = 268, i.Ccedilla = 199, i.Ccedillaacute = 7688, i.Ccedillasmall = 63463, i.Ccircle = 9400, i.Ccircumflex = 264, i.Cdot = 266, i.Cdotaccent = 266, i.Cedillasmall = 63416, i.Chaarmenian = 1353, i.Cheabkhasiancyrillic = 1212, i.Checyrillic = 1063, i.Chedescenderabkhasiancyrillic = 1214, i.Chedescendercyrillic = 1206, i.Chedieresiscyrillic = 1268, i.Cheharmenian = 1347, i.Chekhakassiancyrillic = 1227, i.Cheverticalstrokecyrillic = 1208, i.Chi = 935, i.Chook = 391, i.Circumflexsmall = 63222, i.Cmonospace = 65315, i.Coarmenian = 1361, i.Csmall = 63331, i.D = 68, i.DZ = 497, i.DZcaron = 452, i.Daarmenian = 1332, i.Dafrican = 393, i.Dcaron = 270, i.Dcedilla = 7696, i.Dcircle = 9401, i.Dcircumflexbelow = 7698, i.Dcroat = 272, i.Ddotaccent = 7690, i.Ddotbelow = 7692, i.Decyrillic = 1044, i.Deicoptic = 1006, i.Delta = 8710, i.Deltagreek = 916, i.Dhook = 394, i.Dieresis = 63179, i.DieresisAcute = 63180, i.DieresisGrave = 63181, i.Dieresissmall = 63400, i.Digammagreek = 988, i.Djecyrillic = 1026, i.Dlinebelow = 7694, i.Dmonospace = 65316, i.Dotaccentsmall = 63223, i.Dslash = 272, i.Dsmall = 63332, i.Dtopbar = 395, i.Dz = 498, i.Dzcaron = 453, i.Dzeabkhasiancyrillic = 1248, i.Dzecyrillic = 1029, i.Dzhecyrillic = 1039, i.E = 69, i.Eacute = 201, i.Eacutesmall = 63465, i.Ebreve = 276, i.Ecaron = 282, i.Ecedillabreve = 7708, i.Echarmenian = 1333, i.Ecircle = 9402, i.Ecircumflex = 202, i.Ecircumflexacute = 7870, i.Ecircumflexbelow = 7704, i.Ecircumflexdotbelow = 7878, i.Ecircumflexgrave = 7872, i.Ecircumflexhookabove = 7874, i.Ecircumflexsmall = 63466, i.Ecircumflextilde = 7876, i.Ecyrillic = 1028, i.Edblgrave = 516, i.Edieresis = 203, i.Edieresissmall = 63467, i.Edot = 278, i.Edotaccent = 278, i.Edotbelow = 7864, i.Efcyrillic = 1060, i.Egrave = 200, i.Egravesmall = 63464, i.Eharmenian = 1335, i.Ehookabove = 7866, i.Eightroman = 8551, i.Einvertedbreve = 518, i.Eiotifiedcyrillic = 1124, i.Elcyrillic = 1051, i.Elevenroman = 8554, i.Emacron = 274, i.Emacronacute = 7702, i.Emacrongrave = 7700, i.Emcyrillic = 1052, i.Emonospace = 65317, i.Encyrillic = 1053, i.Endescendercyrillic = 1186, i.Eng = 330, i.Enghecyrillic = 1188, i.Enhookcyrillic = 1223, i.Eogonek = 280, i.Eopen = 400, i.Epsilon = 917, i.Epsilontonos = 904, i.Ercyrillic = 1056, i.Ereversed = 398, i.Ereversedcyrillic = 1069, i.Escyrillic = 1057, i.Esdescendercyrillic = 1194, i.Esh = 425, i.Esmall = 63333, i.Eta = 919, i.Etarmenian = 1336, i.Etatonos = 905, i.Eth = 208, i.Ethsmall = 63472, i.Etilde = 7868, i.Etildebelow = 7706, i.Euro = 8364, i.Ezh = 439, i.Ezhcaron = 494, i.Ezhreversed = 440, i.F = 70, i.Fcircle = 9403, i.Fdotaccent = 7710, i.Feharmenian = 1366, i.Feicoptic = 996, i.Fhook = 401, i.Fitacyrillic = 1138, i.Fiveroman = 8548, i.Fmonospace = 65318, i.Fourroman = 8547, i.Fsmall = 63334, i.G = 71, i.GBsquare = 13191, i.Gacute = 500, i.Gamma = 915, i.Gammaafrican = 404, i.Gangiacoptic = 1002, i.Gbreve = 286, i.Gcaron = 486, i.Gcedilla = 290, i.Gcircle = 9404, i.Gcircumflex = 284, i.Gcommaaccent = 290, i.Gdot = 288, i.Gdotaccent = 288, i.Gecyrillic = 1043, i.Ghadarmenian = 1346, i.Ghemiddlehookcyrillic = 1172, i.Ghestrokecyrillic = 1170, i.Gheupturncyrillic = 1168, i.Ghook = 403, i.Gimarmenian = 1331, i.Gjecyrillic = 1027, i.Gmacron = 7712, i.Gmonospace = 65319, i.Grave = 63182, i.Gravesmall = 63328, i.Gsmall = 63335, i.Gsmallhook = 667, i.Gstroke = 484, i.H = 72, i.H18533 = 9679, i.H18543 = 9642, i.H18551 = 9643, i.H22073 = 9633, i.HPsquare = 13259, i.Haabkhasiancyrillic = 1192, i.Hadescendercyrillic = 1202, i.Hardsigncyrillic = 1066, i.Hbar = 294, i.Hbrevebelow = 7722, i.Hcedilla = 7720, i.Hcircle = 9405, i.Hcircumflex = 292, i.Hdieresis = 7718, i.Hdotaccent = 7714, i.Hdotbelow = 7716, i.Hmonospace = 65320, i.Hoarmenian = 1344, i.Horicoptic = 1e3, i.Hsmall = 63336, i.Hungarumlaut = 63183, i.Hungarumlautsmall = 63224, i.Hzsquare = 13200, i.I = 73, i.IAcyrillic = 1071, i.IJ = 306, i.IUcyrillic = 1070, i.Iacute = 205, i.Iacutesmall = 63469, i.Ibreve = 300, i.Icaron = 463, i.Icircle = 9406, i.Icircumflex = 206, i.Icircumflexsmall = 63470, i.Icyrillic = 1030, i.Idblgrave = 520, i.Idieresis = 207, i.Idieresisacute = 7726, i.Idieresiscyrillic = 1252, i.Idieresissmall = 63471, i.Idot = 304, i.Idotaccent = 304, i.Idotbelow = 7882, i.Iebrevecyrillic = 1238, i.Iecyrillic = 1045, i.Ifraktur = 8465, i.Igrave = 204, i.Igravesmall = 63468, i.Ihookabove = 7880, i.Iicyrillic = 1048, i.Iinvertedbreve = 522, i.Iishortcyrillic = 1049, i.Imacron = 298, i.Imacroncyrillic = 1250, i.Imonospace = 65321, i.Iniarmenian = 1339, i.Iocyrillic = 1025, i.Iogonek = 302, i.Iota = 921, i.Iotaafrican = 406, i.Iotadieresis = 938, i.Iotatonos = 906, i.Ismall = 63337, i.Istroke = 407, i.Itilde = 296, i.Itildebelow = 7724, i.Izhitsacyrillic = 1140, i.Izhitsadblgravecyrillic = 1142, i.J = 74, i.Jaarmenian = 1345, i.Jcircle = 9407, i.Jcircumflex = 308, i.Jecyrillic = 1032, i.Jheharmenian = 1355, i.Jmonospace = 65322, i.Jsmall = 63338, i.K = 75, i.KBsquare = 13189, i.KKsquare = 13261, i.Kabashkircyrillic = 1184, i.Kacute = 7728, i.Kacyrillic = 1050, i.Kadescendercyrillic = 1178, i.Kahookcyrillic = 1219, i.Kappa = 922, i.Kastrokecyrillic = 1182, i.Kaverticalstrokecyrillic = 1180, i.Kcaron = 488, i.Kcedilla = 310, i.Kcircle = 9408, i.Kcommaaccent = 310, i.Kdotbelow = 7730, i.Keharmenian = 1364, i.Kenarmenian = 1343, i.Khacyrillic = 1061, i.Kheicoptic = 998, i.Khook = 408, i.Kjecyrillic = 1036, i.Klinebelow = 7732, i.Kmonospace = 65323, i.Koppacyrillic = 1152, i.Koppagreek = 990, i.Ksicyrillic = 1134, i.Ksmall = 63339, i.L = 76, i.LJ = 455, i.LL = 63167, i.Lacute = 313, i.Lambda = 923, i.Lcaron = 317, i.Lcedilla = 315, i.Lcircle = 9409, i.Lcircumflexbelow = 7740, i.Lcommaaccent = 315, i.Ldot = 319, i.Ldotaccent = 319, i.Ldotbelow = 7734, i.Ldotbelowmacron = 7736, i.Liwnarmenian = 1340, i.Lj = 456, i.Ljecyrillic = 1033, i.Llinebelow = 7738, i.Lmonospace = 65324, i.Lslash = 321, i.Lslashsmall = 63225, i.Lsmall = 63340, i.M = 77, i.MBsquare = 13190, i.Macron = 63184, i.Macronsmall = 63407, i.Macute = 7742, i.Mcircle = 9410, i.Mdotaccent = 7744, i.Mdotbelow = 7746, i.Menarmenian = 1348, i.Mmonospace = 65325, i.Msmall = 63341, i.Mturned = 412, i.Mu = 924, i.N = 78, i.NJ = 458, i.Nacute = 323, i.Ncaron = 327, i.Ncedilla = 325, i.Ncircle = 9411, i.Ncircumflexbelow = 7754, i.Ncommaaccent = 325, i.Ndotaccent = 7748, i.Ndotbelow = 7750, i.Nhookleft = 413, i.Nineroman = 8552, i.Nj = 459, i.Njecyrillic = 1034, i.Nlinebelow = 7752, i.Nmonospace = 65326, i.Nowarmenian = 1350, i.Nsmall = 63342, i.Ntilde = 209, i.Ntildesmall = 63473, i.Nu = 925, i.O = 79, i.OE = 338, i.OEsmall = 63226, i.Oacute = 211, i.Oacutesmall = 63475, i.Obarredcyrillic = 1256, i.Obarreddieresiscyrillic = 1258, i.Obreve = 334, i.Ocaron = 465, i.Ocenteredtilde = 415, i.Ocircle = 9412, i.Ocircumflex = 212, i.Ocircumflexacute = 7888, i.Ocircumflexdotbelow = 7896, i.Ocircumflexgrave = 7890, i.Ocircumflexhookabove = 7892, i.Ocircumflexsmall = 63476, i.Ocircumflextilde = 7894, i.Ocyrillic = 1054, i.Odblacute = 336, i.Odblgrave = 524, i.Odieresis = 214, i.Odieresiscyrillic = 1254, i.Odieresissmall = 63478, i.Odotbelow = 7884, i.Ogoneksmall = 63227, i.Ograve = 210, i.Ogravesmall = 63474, i.Oharmenian = 1365, i.Ohm = 8486, i.Ohookabove = 7886, i.Ohorn = 416, i.Ohornacute = 7898, i.Ohorndotbelow = 7906, i.Ohorngrave = 7900, i.Ohornhookabove = 7902, i.Ohorntilde = 7904, i.Ohungarumlaut = 336, i.Oi = 418, i.Oinvertedbreve = 526, i.Omacron = 332, i.Omacronacute = 7762, i.Omacrongrave = 7760, i.Omega = 8486, i.Omegacyrillic = 1120, i.Omegagreek = 937, i.Omegaroundcyrillic = 1146, i.Omegatitlocyrillic = 1148, i.Omegatonos = 911, i.Omicron = 927, i.Omicrontonos = 908, i.Omonospace = 65327, i.Oneroman = 8544, i.Oogonek = 490, i.Oogonekmacron = 492, i.Oopen = 390, i.Oslash = 216, i.Oslashacute = 510, i.Oslashsmall = 63480, i.Osmall = 63343, i.Ostrokeacute = 510, i.Otcyrillic = 1150, i.Otilde = 213, i.Otildeacute = 7756, i.Otildedieresis = 7758, i.Otildesmall = 63477, i.P = 80, i.Pacute = 7764, i.Pcircle = 9413, i.Pdotaccent = 7766, i.Pecyrillic = 1055, i.Peharmenian = 1354, i.Pemiddlehookcyrillic = 1190, i.Phi = 934, i.Phook = 420, i.Pi = 928, i.Piwrarmenian = 1363, i.Pmonospace = 65328, i.Psi = 936, i.Psicyrillic = 1136, i.Psmall = 63344, i.Q = 81, i.Qcircle = 9414, i.Qmonospace = 65329, i.Qsmall = 63345, i.R = 82, i.Raarmenian = 1356, i.Racute = 340, i.Rcaron = 344, i.Rcedilla = 342, i.Rcircle = 9415, i.Rcommaaccent = 342, i.Rdblgrave = 528, i.Rdotaccent = 7768, i.Rdotbelow = 7770, i.Rdotbelowmacron = 7772, i.Reharmenian = 1360, i.Rfraktur = 8476, i.Rho = 929, i.Ringsmall = 63228, i.Rinvertedbreve = 530, i.Rlinebelow = 7774, i.Rmonospace = 65330, i.Rsmall = 63346, i.Rsmallinverted = 641, i.Rsmallinvertedsuperior = 694, i.S = 83, i.SF010000 = 9484, i.SF020000 = 9492, i.SF030000 = 9488, i.SF040000 = 9496, i.SF050000 = 9532, i.SF060000 = 9516, i.SF070000 = 9524, i.SF080000 = 9500, i.SF090000 = 9508, i.SF100000 = 9472, i.SF110000 = 9474, i.SF190000 = 9569, i.SF200000 = 9570, i.SF210000 = 9558, i.SF220000 = 9557, i.SF230000 = 9571, i.SF240000 = 9553, i.SF250000 = 9559, i.SF260000 = 9565, i.SF270000 = 9564, i.SF280000 = 9563, i.SF360000 = 9566, i.SF370000 = 9567, i.SF380000 = 9562, i.SF390000 = 9556, i.SF400000 = 9577, i.SF410000 = 9574, i.SF420000 = 9568, i.SF430000 = 9552, i.SF440000 = 9580, i.SF450000 = 9575, i.SF460000 = 9576, i.SF470000 = 9572, i.SF480000 = 9573, i.SF490000 = 9561, i.SF500000 = 9560, i.SF510000 = 9554, i.SF520000 = 9555, i.SF530000 = 9579, i.SF540000 = 9578, i.Sacute = 346, i.Sacutedotaccent = 7780, i.Sampigreek = 992, i.Scaron = 352, i.Scarondotaccent = 7782, i.Scaronsmall = 63229, i.Scedilla = 350, i.Schwa = 399, i.Schwacyrillic = 1240, i.Schwadieresiscyrillic = 1242, i.Scircle = 9416, i.Scircumflex = 348, i.Scommaaccent = 536, i.Sdotaccent = 7776, i.Sdotbelow = 7778, i.Sdotbelowdotaccent = 7784, i.Seharmenian = 1357, i.Sevenroman = 8550, i.Shaarmenian = 1351, i.Shacyrillic = 1064, i.Shchacyrillic = 1065, i.Sheicoptic = 994, i.Shhacyrillic = 1210, i.Shimacoptic = 1004, i.Sigma = 931, i.Sixroman = 8549, i.Smonospace = 65331, i.Softsigncyrillic = 1068, i.Ssmall = 63347, i.Stigmagreek = 986, i.T = 84, i.Tau = 932, i.Tbar = 358, i.Tcaron = 356, i.Tcedilla = 354, i.Tcircle = 9417, i.Tcircumflexbelow = 7792, i.Tcommaaccent = 354, i.Tdotaccent = 7786, i.Tdotbelow = 7788, i.Tecyrillic = 1058, i.Tedescendercyrillic = 1196, i.Tenroman = 8553, i.Tetsecyrillic = 1204, i.Theta = 920, i.Thook = 428, i.Thorn = 222, i.Thornsmall = 63486, i.Threeroman = 8546, i.Tildesmall = 63230, i.Tiwnarmenian = 1359, i.Tlinebelow = 7790, i.Tmonospace = 65332, i.Toarmenian = 1337, i.Tonefive = 444, i.Tonesix = 388, i.Tonetwo = 423, i.Tretroflexhook = 430, i.Tsecyrillic = 1062, i.Tshecyrillic = 1035, i.Tsmall = 63348, i.Twelveroman = 8555, i.Tworoman = 8545, i.U = 85, i.Uacute = 218, i.Uacutesmall = 63482, i.Ubreve = 364, i.Ucaron = 467, i.Ucircle = 9418, i.Ucircumflex = 219, i.Ucircumflexbelow = 7798, i.Ucircumflexsmall = 63483, i.Ucyrillic = 1059, i.Udblacute = 368, i.Udblgrave = 532, i.Udieresis = 220, i.Udieresisacute = 471, i.Udieresisbelow = 7794, i.Udieresiscaron = 473, i.Udieresiscyrillic = 1264, i.Udieresisgrave = 475, i.Udieresismacron = 469, i.Udieresissmall = 63484, i.Udotbelow = 7908, i.Ugrave = 217, i.Ugravesmall = 63481, i.Uhookabove = 7910, i.Uhorn = 431, i.Uhornacute = 7912, i.Uhorndotbelow = 7920, i.Uhorngrave = 7914, i.Uhornhookabove = 7916, i.Uhorntilde = 7918, i.Uhungarumlaut = 368, i.Uhungarumlautcyrillic = 1266, i.Uinvertedbreve = 534, i.Ukcyrillic = 1144, i.Umacron = 362, i.Umacroncyrillic = 1262, i.Umacrondieresis = 7802, i.Umonospace = 65333, i.Uogonek = 370, i.Upsilon = 933, i.Upsilon1 = 978, i.Upsilonacutehooksymbolgreek = 979, i.Upsilonafrican = 433, i.Upsilondieresis = 939, i.Upsilondieresishooksymbolgreek = 980, i.Upsilonhooksymbol = 978, i.Upsilontonos = 910, i.Uring = 366, i.Ushortcyrillic = 1038, i.Usmall = 63349, i.Ustraightcyrillic = 1198, i.Ustraightstrokecyrillic = 1200, i.Utilde = 360, i.Utildeacute = 7800, i.Utildebelow = 7796, i.V = 86, i.Vcircle = 9419, i.Vdotbelow = 7806, i.Vecyrillic = 1042, i.Vewarmenian = 1358, i.Vhook = 434, i.Vmonospace = 65334, i.Voarmenian = 1352, i.Vsmall = 63350, i.Vtilde = 7804, i.W = 87, i.Wacute = 7810, i.Wcircle = 9420, i.Wcircumflex = 372, i.Wdieresis = 7812, i.Wdotaccent = 7814, i.Wdotbelow = 7816, i.Wgrave = 7808, i.Wmonospace = 65335, i.Wsmall = 63351, i.X = 88, i.Xcircle = 9421, i.Xdieresis = 7820, i.Xdotaccent = 7818, i.Xeharmenian = 1341, i.Xi = 926, i.Xmonospace = 65336, i.Xsmall = 63352, i.Y = 89, i.Yacute = 221, i.Yacutesmall = 63485, i.Yatcyrillic = 1122, i.Ycircle = 9422, i.Ycircumflex = 374, i.Ydieresis = 376, i.Ydieresissmall = 63487, i.Ydotaccent = 7822, i.Ydotbelow = 7924, i.Yericyrillic = 1067, i.Yerudieresiscyrillic = 1272, i.Ygrave = 7922, i.Yhook = 435, i.Yhookabove = 7926, i.Yiarmenian = 1349, i.Yicyrillic = 1031, i.Yiwnarmenian = 1362, i.Ymonospace = 65337, i.Ysmall = 63353, i.Ytilde = 7928, i.Yusbigcyrillic = 1130, i.Yusbigiotifiedcyrillic = 1132, i.Yuslittlecyrillic = 1126, i.Yuslittleiotifiedcyrillic = 1128, i.Z = 90, i.Zaarmenian = 1334, i.Zacute = 377, i.Zcaron = 381, i.Zcaronsmall = 63231, i.Zcircle = 9423, i.Zcircumflex = 7824, i.Zdot = 379, i.Zdotaccent = 379, i.Zdotbelow = 7826, i.Zecyrillic = 1047, i.Zedescendercyrillic = 1176, i.Zedieresiscyrillic = 1246, i.Zeta = 918, i.Zhearmenian = 1338, i.Zhebrevecyrillic = 1217, i.Zhecyrillic = 1046, i.Zhedescendercyrillic = 1174, i.Zhedieresiscyrillic = 1244, i.Zlinebelow = 7828, i.Zmonospace = 65338, i.Zsmall = 63354, i.Zstroke = 437, i.a = 97, i.aabengali = 2438, i.aacute = 225, i.aadeva = 2310, i.aagujarati = 2694, i.aagurmukhi = 2566, i.aamatragurmukhi = 2622, i.aarusquare = 13059, i.aavowelsignbengali = 2494, i.aavowelsigndeva = 2366, i.aavowelsigngujarati = 2750, i.abbreviationmarkarmenian = 1375, i.abbreviationsigndeva = 2416, i.abengali = 2437, i.abopomofo = 12570, i.abreve = 259, i.abreveacute = 7855, i.abrevecyrillic = 1233, i.abrevedotbelow = 7863, i.abrevegrave = 7857, i.abrevehookabove = 7859, i.abrevetilde = 7861, i.acaron = 462, i.acircle = 9424, i.acircumflex = 226, i.acircumflexacute = 7845, i.acircumflexdotbelow = 7853, i.acircumflexgrave = 7847, i.acircumflexhookabove = 7849, i.acircumflextilde = 7851, i.acute = 180, i.acutebelowcmb = 791, i.acutecmb = 769, i.acutecomb = 769, i.acutedeva = 2388, i.acutelowmod = 719, i.acutetonecmb = 833, i.acyrillic = 1072, i.adblgrave = 513, i.addakgurmukhi = 2673, i.adeva = 2309, i.adieresis = 228, i.adieresiscyrillic = 1235, i.adieresismacron = 479, i.adotbelow = 7841, i.adotmacron = 481, i.ae = 230, i.aeacute = 509, i.aekorean = 12624, i.aemacron = 483, i.afii00208 = 8213, i.afii08941 = 8356, i.afii10017 = 1040, i.afii10018 = 1041, i.afii10019 = 1042, i.afii10020 = 1043, i.afii10021 = 1044, i.afii10022 = 1045, i.afii10023 = 1025, i.afii10024 = 1046, i.afii10025 = 1047, i.afii10026 = 1048, i.afii10027 = 1049, i.afii10028 = 1050, i.afii10029 = 1051, i.afii10030 = 1052, i.afii10031 = 1053, i.afii10032 = 1054, i.afii10033 = 1055, i.afii10034 = 1056, i.afii10035 = 1057, i.afii10036 = 1058, i.afii10037 = 1059, i.afii10038 = 1060, i.afii10039 = 1061, i.afii10040 = 1062, i.afii10041 = 1063, i.afii10042 = 1064, i.afii10043 = 1065, i.afii10044 = 1066, i.afii10045 = 1067, i.afii10046 = 1068, i.afii10047 = 1069, i.afii10048 = 1070, i.afii10049 = 1071, i.afii10050 = 1168, i.afii10051 = 1026, i.afii10052 = 1027, i.afii10053 = 1028, i.afii10054 = 1029, i.afii10055 = 1030, i.afii10056 = 1031, i.afii10057 = 1032, i.afii10058 = 1033, i.afii10059 = 1034, i.afii10060 = 1035, i.afii10061 = 1036, i.afii10062 = 1038, i.afii10063 = 63172, i.afii10064 = 63173, i.afii10065 = 1072, i.afii10066 = 1073, i.afii10067 = 1074, i.afii10068 = 1075, i.afii10069 = 1076, i.afii10070 = 1077, i.afii10071 = 1105, i.afii10072 = 1078, i.afii10073 = 1079, i.afii10074 = 1080, i.afii10075 = 1081, i.afii10076 = 1082, i.afii10077 = 1083, i.afii10078 = 1084, i.afii10079 = 1085, i.afii10080 = 1086, i.afii10081 = 1087, i.afii10082 = 1088, i.afii10083 = 1089, i.afii10084 = 1090, i.afii10085 = 1091, i.afii10086 = 1092, i.afii10087 = 1093, i.afii10088 = 1094, i.afii10089 = 1095, i.afii10090 = 1096, i.afii10091 = 1097, i.afii10092 = 1098, i.afii10093 = 1099, i.afii10094 = 1100, i.afii10095 = 1101, i.afii10096 = 1102, i.afii10097 = 1103, i.afii10098 = 1169, i.afii10099 = 1106, i.afii10100 = 1107, i.afii10101 = 1108, i.afii10102 = 1109, i.afii10103 = 1110, i.afii10104 = 1111, i.afii10105 = 1112, i.afii10106 = 1113, i.afii10107 = 1114, i.afii10108 = 1115, i.afii10109 = 1116, i.afii10110 = 1118, i.afii10145 = 1039, i.afii10146 = 1122, i.afii10147 = 1138, i.afii10148 = 1140, i.afii10192 = 63174, i.afii10193 = 1119, i.afii10194 = 1123, i.afii10195 = 1139, i.afii10196 = 1141, i.afii10831 = 63175, i.afii10832 = 63176, i.afii10846 = 1241, i.afii299 = 8206, i.afii300 = 8207, i.afii301 = 8205, i.afii57381 = 1642, i.afii57388 = 1548, i.afii57392 = 1632, i.afii57393 = 1633, i.afii57394 = 1634, i.afii57395 = 1635, i.afii57396 = 1636, i.afii57397 = 1637, i.afii57398 = 1638, i.afii57399 = 1639, i.afii57400 = 1640, i.afii57401 = 1641, i.afii57403 = 1563, i.afii57407 = 1567, i.afii57409 = 1569, i.afii57410 = 1570, i.afii57411 = 1571, i.afii57412 = 1572, i.afii57413 = 1573, i.afii57414 = 1574, i.afii57415 = 1575, i.afii57416 = 1576, i.afii57417 = 1577, i.afii57418 = 1578, i.afii57419 = 1579, i.afii57420 = 1580, i.afii57421 = 1581, i.afii57422 = 1582, i.afii57423 = 1583, i.afii57424 = 1584, i.afii57425 = 1585, i.afii57426 = 1586, i.afii57427 = 1587, i.afii57428 = 1588, i.afii57429 = 1589, i.afii57430 = 1590, i.afii57431 = 1591, i.afii57432 = 1592, i.afii57433 = 1593, i.afii57434 = 1594, i.afii57440 = 1600, i.afii57441 = 1601, i.afii57442 = 1602, i.afii57443 = 1603, i.afii57444 = 1604, i.afii57445 = 1605, i.afii57446 = 1606, i.afii57448 = 1608, i.afii57449 = 1609, i.afii57450 = 1610, i.afii57451 = 1611, i.afii57452 = 1612, i.afii57453 = 1613, i.afii57454 = 1614, i.afii57455 = 1615, i.afii57456 = 1616, i.afii57457 = 1617, i.afii57458 = 1618, i.afii57470 = 1607, i.afii57505 = 1700, i.afii57506 = 1662, i.afii57507 = 1670, i.afii57508 = 1688, i.afii57509 = 1711, i.afii57511 = 1657, i.afii57512 = 1672, i.afii57513 = 1681, i.afii57514 = 1722, i.afii57519 = 1746, i.afii57534 = 1749, i.afii57636 = 8362, i.afii57645 = 1470, i.afii57658 = 1475, i.afii57664 = 1488, i.afii57665 = 1489, i.afii57666 = 1490, i.afii57667 = 1491, i.afii57668 = 1492, i.afii57669 = 1493, i.afii57670 = 1494, i.afii57671 = 1495, i.afii57672 = 1496, i.afii57673 = 1497, i.afii57674 = 1498, i.afii57675 = 1499, i.afii57676 = 1500, i.afii57677 = 1501, i.afii57678 = 1502, i.afii57679 = 1503, i.afii57680 = 1504, i.afii57681 = 1505, i.afii57682 = 1506, i.afii57683 = 1507, i.afii57684 = 1508, i.afii57685 = 1509, i.afii57686 = 1510, i.afii57687 = 1511, i.afii57688 = 1512, i.afii57689 = 1513, i.afii57690 = 1514, i.afii57694 = 64298, i.afii57695 = 64299, i.afii57700 = 64331, i.afii57705 = 64287, i.afii57716 = 1520, i.afii57717 = 1521, i.afii57718 = 1522, i.afii57723 = 64309, i.afii57793 = 1460, i.afii57794 = 1461, i.afii57795 = 1462, i.afii57796 = 1467, i.afii57797 = 1464, i.afii57798 = 1463, i.afii57799 = 1456, i.afii57800 = 1458, i.afii57801 = 1457, i.afii57802 = 1459, i.afii57803 = 1474, i.afii57804 = 1473, i.afii57806 = 1465, i.afii57807 = 1468, i.afii57839 = 1469, i.afii57841 = 1471, i.afii57842 = 1472, i.afii57929 = 700, i.afii61248 = 8453, i.afii61289 = 8467, i.afii61352 = 8470, i.afii61573 = 8236, i.afii61574 = 8237, i.afii61575 = 8238, i.afii61664 = 8204, i.afii63167 = 1645, i.afii64937 = 701, i.agrave = 224, i.agujarati = 2693, i.agurmukhi = 2565, i.ahiragana = 12354, i.ahookabove = 7843, i.aibengali = 2448, i.aibopomofo = 12574, i.aideva = 2320, i.aiecyrillic = 1237, i.aigujarati = 2704, i.aigurmukhi = 2576, i.aimatragurmukhi = 2632, i.ainarabic = 1593, i.ainfinalarabic = 65226, i.aininitialarabic = 65227, i.ainmedialarabic = 65228, i.ainvertedbreve = 515, i.aivowelsignbengali = 2504, i.aivowelsigndeva = 2376, i.aivowelsigngujarati = 2760, i.akatakana = 12450, i.akatakanahalfwidth = 65393, i.akorean = 12623, i.alef = 1488, i.alefarabic = 1575, i.alefdageshhebrew = 64304, i.aleffinalarabic = 65166, i.alefhamzaabovearabic = 1571, i.alefhamzaabovefinalarabic = 65156, i.alefhamzabelowarabic = 1573, i.alefhamzabelowfinalarabic = 65160, i.alefhebrew = 1488, i.aleflamedhebrew = 64335, i.alefmaddaabovearabic = 1570, i.alefmaddaabovefinalarabic = 65154, i.alefmaksuraarabic = 1609, i.alefmaksurafinalarabic = 65264, i.alefmaksurainitialarabic = 65267, i.alefmaksuramedialarabic = 65268, i.alefpatahhebrew = 64302, i.alefqamatshebrew = 64303, i.aleph = 8501, i.allequal = 8780, i.alpha = 945, i.alphatonos = 940, i.amacron = 257, i.amonospace = 65345, i.ampersand = 38, i.ampersandmonospace = 65286, i.ampersandsmall = 63270, i.amsquare = 13250, i.anbopomofo = 12578, i.angbopomofo = 12580, i.angbracketleft = 12296, i.angbracketright = 12297, i.angkhankhuthai = 3674, i.angle = 8736, i.anglebracketleft = 12296, i.anglebracketleftvertical = 65087, i.anglebracketright = 12297, i.anglebracketrightvertical = 65088, i.angleleft = 9001, i.angleright = 9002, i.angstrom = 8491, i.anoteleia = 903, i.anudattadeva = 2386, i.anusvarabengali = 2434, i.anusvaradeva = 2306, i.anusvaragujarati = 2690, i.aogonek = 261, i.apaatosquare = 13056, i.aparen = 9372, i.apostrophearmenian = 1370, i.apostrophemod = 700, i.apple = 63743, i.approaches = 8784, i.approxequal = 8776, i.approxequalorimage = 8786, i.approximatelyequal = 8773, i.araeaekorean = 12686, i.araeakorean = 12685, i.arc = 8978, i.arighthalfring = 7834, i.aring = 229, i.aringacute = 507, i.aringbelow = 7681, i.arrowboth = 8596, i.arrowdashdown = 8675, i.arrowdashleft = 8672, i.arrowdashright = 8674, i.arrowdashup = 8673, i.arrowdblboth = 8660, i.arrowdbldown = 8659, i.arrowdblleft = 8656, i.arrowdblright = 8658, i.arrowdblup = 8657, i.arrowdown = 8595, i.arrowdownleft = 8601, i.arrowdownright = 8600, i.arrowdownwhite = 8681, i.arrowheaddownmod = 709, i.arrowheadleftmod = 706, i.arrowheadrightmod = 707, i.arrowheadupmod = 708, i.arrowhorizex = 63719, i.arrowleft = 8592, i.arrowleftdbl = 8656, i.arrowleftdblstroke = 8653, i.arrowleftoverright = 8646, i.arrowleftwhite = 8678, i.arrowright = 8594, i.arrowrightdblstroke = 8655, i.arrowrightheavy = 10142, i.arrowrightoverleft = 8644, i.arrowrightwhite = 8680, i.arrowtableft = 8676, i.arrowtabright = 8677, i.arrowup = 8593, i.arrowupdn = 8597, i.arrowupdnbse = 8616, i.arrowupdownbase = 8616, i.arrowupleft = 8598, i.arrowupleftofdown = 8645, i.arrowupright = 8599, i.arrowupwhite = 8679, i.arrowvertex = 63718, i.asciicircum = 94, i.asciicircummonospace = 65342, i.asciitilde = 126, i.asciitildemonospace = 65374, i.ascript = 593, i.ascriptturned = 594, i.asmallhiragana = 12353, i.asmallkatakana = 12449, i.asmallkatakanahalfwidth = 65383, i.asterisk = 42, i.asteriskaltonearabic = 1645, i.asteriskarabic = 1645, i.asteriskmath = 8727, i.asteriskmonospace = 65290, i.asterisksmall = 65121, i.asterism = 8258, i.asuperior = 63209, i.asymptoticallyequal = 8771, i.at = 64, i.atilde = 227, i.atmonospace = 65312, i.atsmall = 65131, i.aturned = 592, i.aubengali = 2452, i.aubopomofo = 12576, i.audeva = 2324, i.augujarati = 2708, i.augurmukhi = 2580, i.aulengthmarkbengali = 2519, i.aumatragurmukhi = 2636, i.auvowelsignbengali = 2508, i.auvowelsigndeva = 2380, i.auvowelsigngujarati = 2764, i.avagrahadeva = 2365, i.aybarmenian = 1377, i.ayin = 1506, i.ayinaltonehebrew = 64288, i.ayinhebrew = 1506, i.b = 98, i.babengali = 2476, i.backslash = 92, i.backslashmonospace = 65340, i.badeva = 2348, i.bagujarati = 2732, i.bagurmukhi = 2604, i.bahiragana = 12400, i.bahtthai = 3647, i.bakatakana = 12496, i.bar = 124, i.barmonospace = 65372, i.bbopomofo = 12549, i.bcircle = 9425, i.bdotaccent = 7683, i.bdotbelow = 7685, i.beamedsixteenthnotes = 9836, i.because = 8757, i.becyrillic = 1073, i.beharabic = 1576, i.behfinalarabic = 65168, i.behinitialarabic = 65169, i.behiragana = 12409, i.behmedialarabic = 65170, i.behmeeminitialarabic = 64671, i.behmeemisolatedarabic = 64520, i.behnoonfinalarabic = 64621, i.bekatakana = 12505, i.benarmenian = 1378, i.bet = 1489, i.beta = 946, i.betasymbolgreek = 976, i.betdagesh = 64305, i.betdageshhebrew = 64305, i.bethebrew = 1489, i.betrafehebrew = 64332, i.bhabengali = 2477, i.bhadeva = 2349, i.bhagujarati = 2733, i.bhagurmukhi = 2605, i.bhook = 595, i.bihiragana = 12403, i.bikatakana = 12499, i.bilabialclick = 664, i.bindigurmukhi = 2562, i.birusquare = 13105, i.blackcircle = 9679, i.blackdiamond = 9670, i.blackdownpointingtriangle = 9660, i.blackleftpointingpointer = 9668, i.blackleftpointingtriangle = 9664, i.blacklenticularbracketleft = 12304, i.blacklenticularbracketleftvertical = 65083, i.blacklenticularbracketright = 12305, i.blacklenticularbracketrightvertical = 65084, i.blacklowerlefttriangle = 9699, i.blacklowerrighttriangle = 9698, i.blackrectangle = 9644, i.blackrightpointingpointer = 9658, i.blackrightpointingtriangle = 9654, i.blacksmallsquare = 9642, i.blacksmilingface = 9787, i.blacksquare = 9632, i.blackstar = 9733, i.blackupperlefttriangle = 9700, i.blackupperrighttriangle = 9701, i.blackuppointingsmalltriangle = 9652, i.blackuppointingtriangle = 9650, i.blank = 9251, i.blinebelow = 7687, i.block = 9608, i.bmonospace = 65346, i.bobaimaithai = 3610, i.bohiragana = 12412, i.bokatakana = 12508, i.bparen = 9373, i.bqsquare = 13251, i.braceex = 63732, i.braceleft = 123, i.braceleftbt = 63731, i.braceleftmid = 63730, i.braceleftmonospace = 65371, i.braceleftsmall = 65115, i.bracelefttp = 63729, i.braceleftvertical = 65079, i.braceright = 125, i.bracerightbt = 63742, i.bracerightmid = 63741, i.bracerightmonospace = 65373, i.bracerightsmall = 65116, i.bracerighttp = 63740, i.bracerightvertical = 65080, i.bracketleft = 91, i.bracketleftbt = 63728, i.bracketleftex = 63727, i.bracketleftmonospace = 65339, i.bracketlefttp = 63726, i.bracketright = 93, i.bracketrightbt = 63739, i.bracketrightex = 63738, i.bracketrightmonospace = 65341, i.bracketrighttp = 63737, i.breve = 728, i.brevebelowcmb = 814, i.brevecmb = 774, i.breveinvertedbelowcmb = 815, i.breveinvertedcmb = 785, i.breveinverteddoublecmb = 865, i.bridgebelowcmb = 810, i.bridgeinvertedbelowcmb = 826, i.brokenbar = 166, i.bstroke = 384, i.bsuperior = 63210, i.btopbar = 387, i.buhiragana = 12406, i.bukatakana = 12502, i.bullet = 8226, i.bulletinverse = 9688, i.bulletoperator = 8729, i.bullseye = 9678, i.c = 99, i.caarmenian = 1390, i.cabengali = 2458, i.cacute = 263, i.cadeva = 2330, i.cagujarati = 2714, i.cagurmukhi = 2586, i.calsquare = 13192, i.candrabindubengali = 2433, i.candrabinducmb = 784, i.candrabindudeva = 2305, i.candrabindugujarati = 2689, i.capslock = 8682, i.careof = 8453, i.caron = 711, i.caronbelowcmb = 812, i.caroncmb = 780, i.carriagereturn = 8629, i.cbopomofo = 12568, i.ccaron = 269, i.ccedilla = 231, i.ccedillaacute = 7689, i.ccircle = 9426, i.ccircumflex = 265, i.ccurl = 597, i.cdot = 267, i.cdotaccent = 267, i.cdsquare = 13253, i.cedilla = 184, i.cedillacmb = 807, i.cent = 162, i.centigrade = 8451, i.centinferior = 63199, i.centmonospace = 65504, i.centoldstyle = 63394, i.centsuperior = 63200, i.chaarmenian = 1401, i.chabengali = 2459, i.chadeva = 2331, i.chagujarati = 2715, i.chagurmukhi = 2587, i.chbopomofo = 12564, i.cheabkhasiancyrillic = 1213, i.checkmark = 10003, i.checyrillic = 1095, i.chedescenderabkhasiancyrillic = 1215, i.chedescendercyrillic = 1207, i.chedieresiscyrillic = 1269, i.cheharmenian = 1395, i.chekhakassiancyrillic = 1228, i.cheverticalstrokecyrillic = 1209, i.chi = 967, i.chieuchacirclekorean = 12919, i.chieuchaparenkorean = 12823, i.chieuchcirclekorean = 12905, i.chieuchkorean = 12618, i.chieuchparenkorean = 12809, i.chochangthai = 3594, i.chochanthai = 3592, i.chochingthai = 3593, i.chochoethai = 3596, i.chook = 392, i.cieucacirclekorean = 12918, i.cieucaparenkorean = 12822, i.cieuccirclekorean = 12904, i.cieuckorean = 12616, i.cieucparenkorean = 12808, i.cieucuparenkorean = 12828, i.circle = 9675, i.circlecopyrt = 169, i.circlemultiply = 8855, i.circleot = 8857, i.circleplus = 8853, i.circlepostalmark = 12342, i.circlewithlefthalfblack = 9680, i.circlewithrighthalfblack = 9681, i.circumflex = 710, i.circumflexbelowcmb = 813, i.circumflexcmb = 770, i.clear = 8999, i.clickalveolar = 450, i.clickdental = 448, i.clicklateral = 449, i.clickretroflex = 451, i.club = 9827, i.clubsuitblack = 9827, i.clubsuitwhite = 9831, i.cmcubedsquare = 13220, i.cmonospace = 65347, i.cmsquaredsquare = 13216, i.coarmenian = 1409, i.colon = 58, i.colonmonetary = 8353, i.colonmonospace = 65306, i.colonsign = 8353, i.colonsmall = 65109, i.colontriangularhalfmod = 721, i.colontriangularmod = 720, i.comma = 44, i.commaabovecmb = 787, i.commaaboverightcmb = 789, i.commaaccent = 63171, i.commaarabic = 1548, i.commaarmenian = 1373, i.commainferior = 63201, i.commamonospace = 65292, i.commareversedabovecmb = 788, i.commareversedmod = 701, i.commasmall = 65104, i.commasuperior = 63202, i.commaturnedabovecmb = 786, i.commaturnedmod = 699, i.compass = 9788, i.congruent = 8773, i.contourintegral = 8750, i.control = 8963, i.controlACK = 6, i.controlBEL = 7, i.controlBS = 8, i.controlCAN = 24, i.controlCR = 13, i.controlDC1 = 17, i.controlDC2 = 18, i.controlDC3 = 19, i.controlDC4 = 20, i.controlDEL = 127, i.controlDLE = 16, i.controlEM = 25, i.controlENQ = 5, i.controlEOT = 4, i.controlESC = 27, i.controlETB = 23, i.controlETX = 3, i.controlFF = 12, i.controlFS = 28, i.controlGS = 29, i.controlHT = 9, i.controlLF = 10, i.controlNAK = 21, i.controlNULL = 0, i.controlRS = 30, i.controlSI = 15, i.controlSO = 14, i.controlSOT = 2, i.controlSTX = 1, i.controlSUB = 26, i.controlSYN = 22, i.controlUS = 31, i.controlVT = 11, i.copyright = 169, i.copyrightsans = 63721, i.copyrightserif = 63193, i.cornerbracketleft = 12300, i.cornerbracketlefthalfwidth = 65378, i.cornerbracketleftvertical = 65089, i.cornerbracketright = 12301, i.cornerbracketrighthalfwidth = 65379, i.cornerbracketrightvertical = 65090, i.corporationsquare = 13183, i.cosquare = 13255, i.coverkgsquare = 13254, i.cparen = 9374, i.cruzeiro = 8354, i.cstretched = 663, i.curlyand = 8911, i.curlyor = 8910, i.currency = 164, i.cyrBreve = 63185, i.cyrFlex = 63186, i.cyrbreve = 63188, i.cyrflex = 63189, i.d = 100, i.daarmenian = 1380, i.dabengali = 2470, i.dadarabic = 1590, i.dadeva = 2342, i.dadfinalarabic = 65214, i.dadinitialarabic = 65215, i.dadmedialarabic = 65216, i.dagesh = 1468, i.dageshhebrew = 1468, i.dagger = 8224, i.daggerdbl = 8225, i.dagujarati = 2726, i.dagurmukhi = 2598, i.dahiragana = 12384, i.dakatakana = 12480, i.dalarabic = 1583, i.dalet = 1491, i.daletdagesh = 64307, i.daletdageshhebrew = 64307, i.dalethebrew = 1491, i.dalfinalarabic = 65194, i.dammaarabic = 1615, i.dammalowarabic = 1615, i.dammatanaltonearabic = 1612, i.dammatanarabic = 1612, i.danda = 2404, i.dargahebrew = 1447, i.dargalefthebrew = 1447, i.dasiapneumatacyrilliccmb = 1157, i.dblGrave = 63187, i.dblanglebracketleft = 12298, i.dblanglebracketleftvertical = 65085, i.dblanglebracketright = 12299, i.dblanglebracketrightvertical = 65086, i.dblarchinvertedbelowcmb = 811, i.dblarrowleft = 8660, i.dblarrowright = 8658, i.dbldanda = 2405, i.dblgrave = 63190, i.dblgravecmb = 783, i.dblintegral = 8748, i.dbllowline = 8215, i.dbllowlinecmb = 819, i.dbloverlinecmb = 831, i.dblprimemod = 698, i.dblverticalbar = 8214, i.dblverticallineabovecmb = 782, i.dbopomofo = 12553, i.dbsquare = 13256, i.dcaron = 271, i.dcedilla = 7697, i.dcircle = 9427, i.dcircumflexbelow = 7699, i.dcroat = 273, i.ddabengali = 2465, i.ddadeva = 2337, i.ddagujarati = 2721, i.ddagurmukhi = 2593, i.ddalarabic = 1672, i.ddalfinalarabic = 64393, i.dddhadeva = 2396, i.ddhabengali = 2466, i.ddhadeva = 2338, i.ddhagujarati = 2722, i.ddhagurmukhi = 2594, i.ddotaccent = 7691, i.ddotbelow = 7693, i.decimalseparatorarabic = 1643, i.decimalseparatorpersian = 1643, i.decyrillic = 1076, i.degree = 176, i.dehihebrew = 1453, i.dehiragana = 12391, i.deicoptic = 1007, i.dekatakana = 12487, i.deleteleft = 9003, i.deleteright = 8998, i.delta = 948, i.deltaturned = 397, i.denominatorminusonenumeratorbengali = 2552, i.dezh = 676, i.dhabengali = 2471, i.dhadeva = 2343, i.dhagujarati = 2727, i.dhagurmukhi = 2599, i.dhook = 599, i.dialytikatonos = 901, i.dialytikatonoscmb = 836, i.diamond = 9830, i.diamondsuitwhite = 9826, i.dieresis = 168, i.dieresisacute = 63191, i.dieresisbelowcmb = 804, i.dieresiscmb = 776, i.dieresisgrave = 63192, i.dieresistonos = 901, i.dihiragana = 12386, i.dikatakana = 12482, i.dittomark = 12291, i.divide = 247, i.divides = 8739, i.divisionslash = 8725, i.djecyrillic = 1106, i.dkshade = 9619, i.dlinebelow = 7695, i.dlsquare = 13207, i.dmacron = 273, i.dmonospace = 65348, i.dnblock = 9604, i.dochadathai = 3598, i.dodekthai = 3604, i.dohiragana = 12393, i.dokatakana = 12489, i.dollar = 36, i.dollarinferior = 63203, i.dollarmonospace = 65284, i.dollaroldstyle = 63268, i.dollarsmall = 65129, i.dollarsuperior = 63204, i.dong = 8363, i.dorusquare = 13094, i.dotaccent = 729, i.dotaccentcmb = 775, i.dotbelowcmb = 803, i.dotbelowcomb = 803, i.dotkatakana = 12539, i.dotlessi = 305, i.dotlessj = 63166, i.dotlessjstrokehook = 644, i.dotmath = 8901, i.dottedcircle = 9676, i.doubleyodpatah = 64287, i.doubleyodpatahhebrew = 64287, i.downtackbelowcmb = 798, i.downtackmod = 725, i.dparen = 9375, i.dsuperior = 63211, i.dtail = 598, i.dtopbar = 396, i.duhiragana = 12389, i.dukatakana = 12485, i.dz = 499, i.dzaltone = 675, i.dzcaron = 454, i.dzcurl = 677, i.dzeabkhasiancyrillic = 1249, i.dzecyrillic = 1109, i.dzhecyrillic = 1119, i.e = 101, i.eacute = 233, i.earth = 9793, i.ebengali = 2447, i.ebopomofo = 12572, i.ebreve = 277, i.ecandradeva = 2317, i.ecandragujarati = 2701, i.ecandravowelsigndeva = 2373, i.ecandravowelsigngujarati = 2757, i.ecaron = 283, i.ecedillabreve = 7709, i.echarmenian = 1381, i.echyiwnarmenian = 1415, i.ecircle = 9428, i.ecircumflex = 234, i.ecircumflexacute = 7871, i.ecircumflexbelow = 7705, i.ecircumflexdotbelow = 7879, i.ecircumflexgrave = 7873, i.ecircumflexhookabove = 7875, i.ecircumflextilde = 7877, i.ecyrillic = 1108, i.edblgrave = 517, i.edeva = 2319, i.edieresis = 235, i.edot = 279, i.edotaccent = 279, i.edotbelow = 7865, i.eegurmukhi = 2575, i.eematragurmukhi = 2631, i.efcyrillic = 1092, i.egrave = 232, i.egujarati = 2703, i.eharmenian = 1383, i.ehbopomofo = 12573, i.ehiragana = 12360, i.ehookabove = 7867, i.eibopomofo = 12575, i.eight = 56, i.eightarabic = 1640, i.eightbengali = 2542, i.eightcircle = 9319, i.eightcircleinversesansserif = 10129, i.eightdeva = 2414, i.eighteencircle = 9329, i.eighteenparen = 9349, i.eighteenperiod = 9369, i.eightgujarati = 2798, i.eightgurmukhi = 2670, i.eighthackarabic = 1640, i.eighthangzhou = 12328, i.eighthnotebeamed = 9835, i.eightideographicparen = 12839, i.eightinferior = 8328, i.eightmonospace = 65304, i.eightoldstyle = 63288, i.eightparen = 9339, i.eightperiod = 9359, i.eightpersian = 1784, i.eightroman = 8567, i.eightsuperior = 8312, i.eightthai = 3672, i.einvertedbreve = 519, i.eiotifiedcyrillic = 1125, i.ekatakana = 12456, i.ekatakanahalfwidth = 65396, i.ekonkargurmukhi = 2676, i.ekorean = 12628, i.elcyrillic = 1083, i.element = 8712, i.elevencircle = 9322, i.elevenparen = 9342, i.elevenperiod = 9362, i.elevenroman = 8570, i.ellipsis = 8230, i.ellipsisvertical = 8942, i.emacron = 275, i.emacronacute = 7703, i.emacrongrave = 7701, i.emcyrillic = 1084, i.emdash = 8212, i.emdashvertical = 65073, i.emonospace = 65349, i.emphasismarkarmenian = 1371, i.emptyset = 8709, i.enbopomofo = 12579, i.encyrillic = 1085, i.endash = 8211, i.endashvertical = 65074, i.endescendercyrillic = 1187, i.eng = 331, i.engbopomofo = 12581, i.enghecyrillic = 1189, i.enhookcyrillic = 1224, i.enspace = 8194, i.eogonek = 281, i.eokorean = 12627, i.eopen = 603, i.eopenclosed = 666, i.eopenreversed = 604, i.eopenreversedclosed = 606, i.eopenreversedhook = 605, i.eparen = 9376, i.epsilon = 949, i.epsilontonos = 941, i.equal = 61, i.equalmonospace = 65309, i.equalsmall = 65126, i.equalsuperior = 8316, i.equivalence = 8801, i.erbopomofo = 12582, i.ercyrillic = 1088, i.ereversed = 600, i.ereversedcyrillic = 1101, i.escyrillic = 1089, i.esdescendercyrillic = 1195, i.esh = 643, i.eshcurl = 646, i.eshortdeva = 2318, i.eshortvowelsigndeva = 2374, i.eshreversedloop = 426, i.eshsquatreversed = 645, i.esmallhiragana = 12359, i.esmallkatakana = 12455, i.esmallkatakanahalfwidth = 65386, i.estimated = 8494, i.esuperior = 63212, i.eta = 951, i.etarmenian = 1384, i.etatonos = 942, i.eth = 240, i.etilde = 7869, i.etildebelow = 7707, i.etnahtafoukhhebrew = 1425, i.etnahtafoukhlefthebrew = 1425, i.etnahtahebrew = 1425, i.etnahtalefthebrew = 1425, i.eturned = 477, i.eukorean = 12641, i.euro = 8364, i.evowelsignbengali = 2503, i.evowelsigndeva = 2375, i.evowelsigngujarati = 2759, i.exclam = 33, i.exclamarmenian = 1372, i.exclamdbl = 8252, i.exclamdown = 161, i.exclamdownsmall = 63393, i.exclammonospace = 65281, i.exclamsmall = 63265, i.existential = 8707, i.ezh = 658, i.ezhcaron = 495, i.ezhcurl = 659, i.ezhreversed = 441, i.ezhtail = 442, i.f = 102, i.fadeva = 2398, i.fagurmukhi = 2654, i.fahrenheit = 8457, i.fathaarabic = 1614, i.fathalowarabic = 1614, i.fathatanarabic = 1611, i.fbopomofo = 12552, i.fcircle = 9429, i.fdotaccent = 7711, i.feharabic = 1601, i.feharmenian = 1414, i.fehfinalarabic = 65234, i.fehinitialarabic = 65235, i.fehmedialarabic = 65236, i.feicoptic = 997, i.female = 9792, i.ff = 64256, i.f_f = 64256, i.ffi = 64259, i.f_f_i = 64259, i.ffl = 64260, i.f_f_l = 64260, i.fi = 64257, i.f_i = 64257, i.fifteencircle = 9326, i.fifteenparen = 9346, i.fifteenperiod = 9366, i.figuredash = 8210, i.filledbox = 9632, i.filledrect = 9644, i.finalkaf = 1498, i.finalkafdagesh = 64314, i.finalkafdageshhebrew = 64314, i.finalkafhebrew = 1498, i.finalmem = 1501, i.finalmemhebrew = 1501, i.finalnun = 1503, i.finalnunhebrew = 1503, i.finalpe = 1507, i.finalpehebrew = 1507, i.finaltsadi = 1509, i.finaltsadihebrew = 1509, i.firsttonechinese = 713, i.fisheye = 9673, i.fitacyrillic = 1139, i.five = 53, i.fivearabic = 1637, i.fivebengali = 2539, i.fivecircle = 9316, i.fivecircleinversesansserif = 10126, i.fivedeva = 2411, i.fiveeighths = 8541, i.fivegujarati = 2795, i.fivegurmukhi = 2667, i.fivehackarabic = 1637, i.fivehangzhou = 12325, i.fiveideographicparen = 12836, i.fiveinferior = 8325, i.fivemonospace = 65301, i.fiveoldstyle = 63285, i.fiveparen = 9336, i.fiveperiod = 9356, i.fivepersian = 1781, i.fiveroman = 8564, i.fivesuperior = 8309, i.fivethai = 3669, i.fl = 64258, i.f_l = 64258, i.florin = 402, i.fmonospace = 65350, i.fmsquare = 13209, i.fofanthai = 3615, i.fofathai = 3613, i.fongmanthai = 3663, i.forall = 8704, i.four = 52, i.fourarabic = 1636, i.fourbengali = 2538, i.fourcircle = 9315, i.fourcircleinversesansserif = 10125, i.fourdeva = 2410, i.fourgujarati = 2794, i.fourgurmukhi = 2666, i.fourhackarabic = 1636, i.fourhangzhou = 12324, i.fourideographicparen = 12835, i.fourinferior = 8324, i.fourmonospace = 65300, i.fournumeratorbengali = 2551, i.fouroldstyle = 63284, i.fourparen = 9335, i.fourperiod = 9355, i.fourpersian = 1780, i.fourroman = 8563, i.foursuperior = 8308, i.fourteencircle = 9325, i.fourteenparen = 9345, i.fourteenperiod = 9365, i.fourthai = 3668, i.fourthtonechinese = 715, i.fparen = 9377, i.fraction = 8260, i.franc = 8355, i.g = 103, i.gabengali = 2455, i.gacute = 501, i.gadeva = 2327, i.gafarabic = 1711, i.gaffinalarabic = 64403, i.gafinitialarabic = 64404, i.gafmedialarabic = 64405, i.gagujarati = 2711, i.gagurmukhi = 2583, i.gahiragana = 12364, i.gakatakana = 12460, i.gamma = 947, i.gammalatinsmall = 611, i.gammasuperior = 736, i.gangiacoptic = 1003, i.gbopomofo = 12557, i.gbreve = 287, i.gcaron = 487, i.gcedilla = 291, i.gcircle = 9430, i.gcircumflex = 285, i.gcommaaccent = 291, i.gdot = 289, i.gdotaccent = 289, i.gecyrillic = 1075, i.gehiragana = 12370, i.gekatakana = 12466, i.geometricallyequal = 8785, i.gereshaccenthebrew = 1436, i.gereshhebrew = 1523, i.gereshmuqdamhebrew = 1437, i.germandbls = 223, i.gershayimaccenthebrew = 1438, i.gershayimhebrew = 1524, i.getamark = 12307, i.ghabengali = 2456, i.ghadarmenian = 1394, i.ghadeva = 2328, i.ghagujarati = 2712, i.ghagurmukhi = 2584, i.ghainarabic = 1594, i.ghainfinalarabic = 65230, i.ghaininitialarabic = 65231, i.ghainmedialarabic = 65232, i.ghemiddlehookcyrillic = 1173, i.ghestrokecyrillic = 1171, i.gheupturncyrillic = 1169, i.ghhadeva = 2394, i.ghhagurmukhi = 2650, i.ghook = 608, i.ghzsquare = 13203, i.gihiragana = 12366, i.gikatakana = 12462, i.gimarmenian = 1379, i.gimel = 1490, i.gimeldagesh = 64306, i.gimeldageshhebrew = 64306, i.gimelhebrew = 1490, i.gjecyrillic = 1107, i.glottalinvertedstroke = 446, i.glottalstop = 660, i.glottalstopinverted = 662, i.glottalstopmod = 704, i.glottalstopreversed = 661, i.glottalstopreversedmod = 705, i.glottalstopreversedsuperior = 740, i.glottalstopstroke = 673, i.glottalstopstrokereversed = 674, i.gmacron = 7713, i.gmonospace = 65351, i.gohiragana = 12372, i.gokatakana = 12468, i.gparen = 9378, i.gpasquare = 13228, i.gradient = 8711, i.grave = 96, i.gravebelowcmb = 790, i.gravecmb = 768, i.gravecomb = 768, i.gravedeva = 2387, i.gravelowmod = 718, i.gravemonospace = 65344, i.gravetonecmb = 832, i.greater = 62, i.greaterequal = 8805, i.greaterequalorless = 8923, i.greatermonospace = 65310, i.greaterorequivalent = 8819, i.greaterorless = 8823, i.greateroverequal = 8807, i.greatersmall = 65125, i.gscript = 609, i.gstroke = 485, i.guhiragana = 12368, i.guillemotleft = 171, i.guillemotright = 187, i.guilsinglleft = 8249, i.guilsinglright = 8250, i.gukatakana = 12464, i.guramusquare = 13080, i.gysquare = 13257, i.h = 104, i.haabkhasiancyrillic = 1193, i.haaltonearabic = 1729, i.habengali = 2489, i.hadescendercyrillic = 1203, i.hadeva = 2361, i.hagujarati = 2745, i.hagurmukhi = 2617, i.haharabic = 1581, i.hahfinalarabic = 65186, i.hahinitialarabic = 65187, i.hahiragana = 12399, i.hahmedialarabic = 65188, i.haitusquare = 13098, i.hakatakana = 12495, i.hakatakanahalfwidth = 65418, i.halantgurmukhi = 2637, i.hamzaarabic = 1569, i.hamzalowarabic = 1569, i.hangulfiller = 12644, i.hardsigncyrillic = 1098, i.harpoonleftbarbup = 8636, i.harpoonrightbarbup = 8640, i.hasquare = 13258, i.hatafpatah = 1458, i.hatafpatah16 = 1458, i.hatafpatah23 = 1458, i.hatafpatah2f = 1458, i.hatafpatahhebrew = 1458, i.hatafpatahnarrowhebrew = 1458, i.hatafpatahquarterhebrew = 1458, i.hatafpatahwidehebrew = 1458, i.hatafqamats = 1459, i.hatafqamats1b = 1459, i.hatafqamats28 = 1459, i.hatafqamats34 = 1459, i.hatafqamatshebrew = 1459, i.hatafqamatsnarrowhebrew = 1459, i.hatafqamatsquarterhebrew = 1459, i.hatafqamatswidehebrew = 1459, i.hatafsegol = 1457, i.hatafsegol17 = 1457, i.hatafsegol24 = 1457, i.hatafsegol30 = 1457, i.hatafsegolhebrew = 1457, i.hatafsegolnarrowhebrew = 1457, i.hatafsegolquarterhebrew = 1457, i.hatafsegolwidehebrew = 1457, i.hbar = 295, i.hbopomofo = 12559, i.hbrevebelow = 7723, i.hcedilla = 7721, i.hcircle = 9431, i.hcircumflex = 293, i.hdieresis = 7719, i.hdotaccent = 7715, i.hdotbelow = 7717, i.he = 1492, i.heart = 9829, i.heartsuitblack = 9829, i.heartsuitwhite = 9825, i.hedagesh = 64308, i.hedageshhebrew = 64308, i.hehaltonearabic = 1729, i.heharabic = 1607, i.hehebrew = 1492, i.hehfinalaltonearabic = 64423, i.hehfinalalttwoarabic = 65258, i.hehfinalarabic = 65258, i.hehhamzaabovefinalarabic = 64421, i.hehhamzaaboveisolatedarabic = 64420, i.hehinitialaltonearabic = 64424, i.hehinitialarabic = 65259, i.hehiragana = 12408, i.hehmedialaltonearabic = 64425, i.hehmedialarabic = 65260, i.heiseierasquare = 13179, i.hekatakana = 12504, i.hekatakanahalfwidth = 65421, i.hekutaarusquare = 13110, i.henghook = 615, i.herutusquare = 13113, i.het = 1495, i.hethebrew = 1495, i.hhook = 614, i.hhooksuperior = 689, i.hieuhacirclekorean = 12923, i.hieuhaparenkorean = 12827, i.hieuhcirclekorean = 12909, i.hieuhkorean = 12622, i.hieuhparenkorean = 12813, i.hihiragana = 12402, i.hikatakana = 12498, i.hikatakanahalfwidth = 65419, i.hiriq = 1460, i.hiriq14 = 1460, i.hiriq21 = 1460, i.hiriq2d = 1460, i.hiriqhebrew = 1460, i.hiriqnarrowhebrew = 1460, i.hiriqquarterhebrew = 1460, i.hiriqwidehebrew = 1460, i.hlinebelow = 7830, i.hmonospace = 65352, i.hoarmenian = 1392, i.hohipthai = 3627, i.hohiragana = 12411, i.hokatakana = 12507, i.hokatakanahalfwidth = 65422, i.holam = 1465, i.holam19 = 1465, i.holam26 = 1465, i.holam32 = 1465, i.holamhebrew = 1465, i.holamnarrowhebrew = 1465, i.holamquarterhebrew = 1465, i.holamwidehebrew = 1465, i.honokhukthai = 3630, i.hookabovecomb = 777, i.hookcmb = 777, i.hookpalatalizedbelowcmb = 801, i.hookretroflexbelowcmb = 802, i.hoonsquare = 13122, i.horicoptic = 1001, i.horizontalbar = 8213, i.horncmb = 795, i.hotsprings = 9832, i.house = 8962, i.hparen = 9379, i.hsuperior = 688, i.hturned = 613, i.huhiragana = 12405, i.huiitosquare = 13107, i.hukatakana = 12501, i.hukatakanahalfwidth = 65420, i.hungarumlaut = 733, i.hungarumlautcmb = 779, i.hv = 405, i.hyphen = 45, i.hypheninferior = 63205, i.hyphenmonospace = 65293, i.hyphensmall = 65123, i.hyphensuperior = 63206, i.hyphentwo = 8208, i.i = 105, i.iacute = 237, i.iacyrillic = 1103, i.ibengali = 2439, i.ibopomofo = 12583, i.ibreve = 301, i.icaron = 464, i.icircle = 9432, i.icircumflex = 238, i.icyrillic = 1110, i.idblgrave = 521, i.ideographearthcircle = 12943, i.ideographfirecircle = 12939, i.ideographicallianceparen = 12863, i.ideographiccallparen = 12858, i.ideographiccentrecircle = 12965, i.ideographicclose = 12294, i.ideographiccomma = 12289, i.ideographiccommaleft = 65380, i.ideographiccongratulationparen = 12855, i.ideographiccorrectcircle = 12963, i.ideographicearthparen = 12847, i.ideographicenterpriseparen = 12861, i.ideographicexcellentcircle = 12957, i.ideographicfestivalparen = 12864, i.ideographicfinancialcircle = 12950, i.ideographicfinancialparen = 12854, i.ideographicfireparen = 12843, i.ideographichaveparen = 12850, i.ideographichighcircle = 12964, i.ideographiciterationmark = 12293, i.ideographiclaborcircle = 12952, i.ideographiclaborparen = 12856, i.ideographicleftcircle = 12967, i.ideographiclowcircle = 12966, i.ideographicmedicinecircle = 12969, i.ideographicmetalparen = 12846, i.ideographicmoonparen = 12842, i.ideographicnameparen = 12852, i.ideographicperiod = 12290, i.ideographicprintcircle = 12958, i.ideographicreachparen = 12867, i.ideographicrepresentparen = 12857, i.ideographicresourceparen = 12862, i.ideographicrightcircle = 12968, i.ideographicsecretcircle = 12953, i.ideographicselfparen = 12866, i.ideographicsocietyparen = 12851, i.ideographicspace = 12288, i.ideographicspecialparen = 12853, i.ideographicstockparen = 12849, i.ideographicstudyparen = 12859, i.ideographicsunparen = 12848, i.ideographicsuperviseparen = 12860, i.ideographicwaterparen = 12844, i.ideographicwoodparen = 12845, i.ideographiczero = 12295, i.ideographmetalcircle = 12942, i.ideographmooncircle = 12938, i.ideographnamecircle = 12948, i.ideographsuncircle = 12944, i.ideographwatercircle = 12940, i.ideographwoodcircle = 12941, i.ideva = 2311, i.idieresis = 239, i.idieresisacute = 7727, i.idieresiscyrillic = 1253, i.idotbelow = 7883, i.iebrevecyrillic = 1239, i.iecyrillic = 1077, i.ieungacirclekorean = 12917, i.ieungaparenkorean = 12821, i.ieungcirclekorean = 12903, i.ieungkorean = 12615, i.ieungparenkorean = 12807, i.igrave = 236, i.igujarati = 2695, i.igurmukhi = 2567, i.ihiragana = 12356, i.ihookabove = 7881, i.iibengali = 2440, i.iicyrillic = 1080, i.iideva = 2312, i.iigujarati = 2696, i.iigurmukhi = 2568, i.iimatragurmukhi = 2624, i.iinvertedbreve = 523, i.iishortcyrillic = 1081, i.iivowelsignbengali = 2496, i.iivowelsigndeva = 2368, i.iivowelsigngujarati = 2752, i.ij = 307, i.ikatakana = 12452, i.ikatakanahalfwidth = 65394, i.ikorean = 12643, i.ilde = 732, i.iluyhebrew = 1452, i.imacron = 299, i.imacroncyrillic = 1251, i.imageorapproximatelyequal = 8787, i.imatragurmukhi = 2623, i.imonospace = 65353, i.increment = 8710, i.infinity = 8734, i.iniarmenian = 1387, i.integral = 8747, i.integralbottom = 8993, i.integralbt = 8993, i.integralex = 63733, i.integraltop = 8992, i.integraltp = 8992, i.intersection = 8745, i.intisquare = 13061, i.invbullet = 9688, i.invcircle = 9689, i.invsmileface = 9787, i.iocyrillic = 1105, i.iogonek = 303, i.iota = 953, i.iotadieresis = 970, i.iotadieresistonos = 912, i.iotalatin = 617, i.iotatonos = 943, i.iparen = 9380, i.irigurmukhi = 2674, i.ismallhiragana = 12355, i.ismallkatakana = 12451, i.ismallkatakanahalfwidth = 65384, i.issharbengali = 2554, i.istroke = 616, i.isuperior = 63213, i.iterationhiragana = 12445, i.iterationkatakana = 12541, i.itilde = 297, i.itildebelow = 7725, i.iubopomofo = 12585, i.iucyrillic = 1102, i.ivowelsignbengali = 2495, i.ivowelsigndeva = 2367, i.ivowelsigngujarati = 2751, i.izhitsacyrillic = 1141, i.izhitsadblgravecyrillic = 1143, i.j = 106, i.jaarmenian = 1393, i.jabengali = 2460, i.jadeva = 2332, i.jagujarati = 2716, i.jagurmukhi = 2588, i.jbopomofo = 12560, i.jcaron = 496, i.jcircle = 9433, i.jcircumflex = 309, i.jcrossedtail = 669, i.jdotlessstroke = 607, i.jecyrillic = 1112, i.jeemarabic = 1580, i.jeemfinalarabic = 65182, i.jeeminitialarabic = 65183, i.jeemmedialarabic = 65184, i.jeharabic = 1688, i.jehfinalarabic = 64395, i.jhabengali = 2461, i.jhadeva = 2333, i.jhagujarati = 2717, i.jhagurmukhi = 2589, i.jheharmenian = 1403, i.jis = 12292, i.jmonospace = 65354, i.jparen = 9381, i.jsuperior = 690, i.k = 107, i.kabashkircyrillic = 1185, i.kabengali = 2453, i.kacute = 7729, i.kacyrillic = 1082, i.kadescendercyrillic = 1179, i.kadeva = 2325, i.kaf = 1499, i.kafarabic = 1603, i.kafdagesh = 64315, i.kafdageshhebrew = 64315, i.kaffinalarabic = 65242, i.kafhebrew = 1499, i.kafinitialarabic = 65243, i.kafmedialarabic = 65244, i.kafrafehebrew = 64333, i.kagujarati = 2709, i.kagurmukhi = 2581, i.kahiragana = 12363, i.kahookcyrillic = 1220, i.kakatakana = 12459, i.kakatakanahalfwidth = 65398, i.kappa = 954, i.kappasymbolgreek = 1008, i.kapyeounmieumkorean = 12657, i.kapyeounphieuphkorean = 12676, i.kapyeounpieupkorean = 12664, i.kapyeounssangpieupkorean = 12665, i.karoriisquare = 13069, i.kashidaautoarabic = 1600, i.kashidaautonosidebearingarabic = 1600, i.kasmallkatakana = 12533, i.kasquare = 13188, i.kasraarabic = 1616, i.kasratanarabic = 1613, i.kastrokecyrillic = 1183, i.katahiraprolongmarkhalfwidth = 65392, i.kaverticalstrokecyrillic = 1181, i.kbopomofo = 12558, i.kcalsquare = 13193, i.kcaron = 489, i.kcedilla = 311, i.kcircle = 9434, i.kcommaaccent = 311, i.kdotbelow = 7731, i.keharmenian = 1412, i.kehiragana = 12369, i.kekatakana = 12465, i.kekatakanahalfwidth = 65401, i.kenarmenian = 1391, i.kesmallkatakana = 12534, i.kgreenlandic = 312, i.khabengali = 2454, i.khacyrillic = 1093, i.khadeva = 2326, i.khagujarati = 2710, i.khagurmukhi = 2582, i.khaharabic = 1582, i.khahfinalarabic = 65190, i.khahinitialarabic = 65191, i.khahmedialarabic = 65192, i.kheicoptic = 999, i.khhadeva = 2393, i.khhagurmukhi = 2649, i.khieukhacirclekorean = 12920, i.khieukhaparenkorean = 12824, i.khieukhcirclekorean = 12906, i.khieukhkorean = 12619, i.khieukhparenkorean = 12810, i.khokhaithai = 3586, i.khokhonthai = 3589, i.khokhuatthai = 3587, i.khokhwaithai = 3588, i.khomutthai = 3675, i.khook = 409, i.khorakhangthai = 3590, i.khzsquare = 13201, i.kihiragana = 12365, i.kikatakana = 12461, i.kikatakanahalfwidth = 65399, i.kiroguramusquare = 13077, i.kiromeetorusquare = 13078, i.kirosquare = 13076, i.kiyeokacirclekorean = 12910, i.kiyeokaparenkorean = 12814, i.kiyeokcirclekorean = 12896, i.kiyeokkorean = 12593, i.kiyeokparenkorean = 12800, i.kiyeoksioskorean = 12595, i.kjecyrillic = 1116, i.klinebelow = 7733, i.klsquare = 13208, i.kmcubedsquare = 13222, i.kmonospace = 65355, i.kmsquaredsquare = 13218, i.kohiragana = 12371, i.kohmsquare = 13248, i.kokaithai = 3585, i.kokatakana = 12467, i.kokatakanahalfwidth = 65402, i.kooposquare = 13086, i.koppacyrillic = 1153, i.koreanstandardsymbol = 12927, i.koroniscmb = 835, i.kparen = 9382, i.kpasquare = 13226, i.ksicyrillic = 1135, i.ktsquare = 13263, i.kturned = 670, i.kuhiragana = 12367, i.kukatakana = 12463, i.kukatakanahalfwidth = 65400, i.kvsquare = 13240, i.kwsquare = 13246, i.l = 108, i.labengali = 2482, i.lacute = 314, i.ladeva = 2354, i.lagujarati = 2738, i.lagurmukhi = 2610, i.lakkhangyaothai = 3653, i.lamaleffinalarabic = 65276, i.lamalefhamzaabovefinalarabic = 65272, i.lamalefhamzaaboveisolatedarabic = 65271, i.lamalefhamzabelowfinalarabic = 65274, i.lamalefhamzabelowisolatedarabic = 65273, i.lamalefisolatedarabic = 65275, i.lamalefmaddaabovefinalarabic = 65270, i.lamalefmaddaaboveisolatedarabic = 65269, i.lamarabic = 1604, i.lambda = 955, i.lambdastroke = 411, i.lamed = 1500, i.lameddagesh = 64316, i.lameddageshhebrew = 64316, i.lamedhebrew = 1500, i.lamfinalarabic = 65246, i.lamhahinitialarabic = 64714, i.laminitialarabic = 65247, i.lamjeeminitialarabic = 64713, i.lamkhahinitialarabic = 64715, i.lamlamhehisolatedarabic = 65010, i.lammedialarabic = 65248, i.lammeemhahinitialarabic = 64904, i.lammeeminitialarabic = 64716, i.largecircle = 9711, i.lbar = 410, i.lbelt = 620, i.lbopomofo = 12556, i.lcaron = 318, i.lcedilla = 316, i.lcircle = 9435, i.lcircumflexbelow = 7741, i.lcommaaccent = 316, i.ldot = 320, i.ldotaccent = 320, i.ldotbelow = 7735, i.ldotbelowmacron = 7737, i.leftangleabovecmb = 794, i.lefttackbelowcmb = 792, i.less = 60, i.lessequal = 8804, i.lessequalorgreater = 8922, i.lessmonospace = 65308, i.lessorequivalent = 8818, i.lessorgreater = 8822, i.lessoverequal = 8806, i.lesssmall = 65124, i.lezh = 622, i.lfblock = 9612, i.lhookretroflex = 621, i.lira = 8356, i.liwnarmenian = 1388, i.lj = 457, i.ljecyrillic = 1113, i.ll = 63168, i.lladeva = 2355, i.llagujarati = 2739, i.llinebelow = 7739, i.llladeva = 2356, i.llvocalicbengali = 2529, i.llvocalicdeva = 2401, i.llvocalicvowelsignbengali = 2531, i.llvocalicvowelsigndeva = 2403, i.lmiddletilde = 619, i.lmonospace = 65356, i.lmsquare = 13264, i.lochulathai = 3628, i.logicaland = 8743, i.logicalnot = 172, i.logicalnotreversed = 8976, i.logicalor = 8744, i.lolingthai = 3621, i.longs = 383, i.lowlinecenterline = 65102, i.lowlinecmb = 818, i.lowlinedashed = 65101, i.lozenge = 9674, i.lparen = 9383, i.lslash = 322, i.lsquare = 8467, i.lsuperior = 63214, i.ltshade = 9617, i.luthai = 3622, i.lvocalicbengali = 2444, i.lvocalicdeva = 2316, i.lvocalicvowelsignbengali = 2530, i.lvocalicvowelsigndeva = 2402, i.lxsquare = 13267, i.m = 109, i.mabengali = 2478, i.macron = 175, i.macronbelowcmb = 817, i.macroncmb = 772, i.macronlowmod = 717, i.macronmonospace = 65507, i.macute = 7743, i.madeva = 2350, i.magujarati = 2734, i.magurmukhi = 2606, i.mahapakhhebrew = 1444, i.mahapakhlefthebrew = 1444, i.mahiragana = 12414, i.maichattawalowleftthai = 63637, i.maichattawalowrightthai = 63636, i.maichattawathai = 3659, i.maichattawaupperleftthai = 63635, i.maieklowleftthai = 63628, i.maieklowrightthai = 63627, i.maiekthai = 3656, i.maiekupperleftthai = 63626, i.maihanakatleftthai = 63620, i.maihanakatthai = 3633, i.maitaikhuleftthai = 63625, i.maitaikhuthai = 3655, i.maitholowleftthai = 63631, i.maitholowrightthai = 63630, i.maithothai = 3657, i.maithoupperleftthai = 63629, i.maitrilowleftthai = 63634, i.maitrilowrightthai = 63633, i.maitrithai = 3658, i.maitriupperleftthai = 63632, i.maiyamokthai = 3654, i.makatakana = 12510, i.makatakanahalfwidth = 65423, i.male = 9794, i.mansyonsquare = 13127, i.maqafhebrew = 1470, i.mars = 9794, i.masoracirclehebrew = 1455, i.masquare = 13187, i.mbopomofo = 12551, i.mbsquare = 13268, i.mcircle = 9436, i.mcubedsquare = 13221, i.mdotaccent = 7745, i.mdotbelow = 7747, i.meemarabic = 1605, i.meemfinalarabic = 65250, i.meeminitialarabic = 65251, i.meemmedialarabic = 65252, i.meemmeeminitialarabic = 64721, i.meemmeemisolatedarabic = 64584, i.meetorusquare = 13133, i.mehiragana = 12417, i.meizierasquare = 13182, i.mekatakana = 12513, i.mekatakanahalfwidth = 65426, i.mem = 1502, i.memdagesh = 64318, i.memdageshhebrew = 64318, i.memhebrew = 1502, i.menarmenian = 1396, i.merkhahebrew = 1445, i.merkhakefulahebrew = 1446, i.merkhakefulalefthebrew = 1446, i.merkhalefthebrew = 1445, i.mhook = 625, i.mhzsquare = 13202, i.middledotkatakanahalfwidth = 65381, i.middot = 183, i.mieumacirclekorean = 12914, i.mieumaparenkorean = 12818, i.mieumcirclekorean = 12900, i.mieumkorean = 12609, i.mieumpansioskorean = 12656, i.mieumparenkorean = 12804, i.mieumpieupkorean = 12654, i.mieumsioskorean = 12655, i.mihiragana = 12415, i.mikatakana = 12511, i.mikatakanahalfwidth = 65424, i.minus = 8722, i.minusbelowcmb = 800, i.minuscircle = 8854, i.minusmod = 727, i.minusplus = 8723, i.minute = 8242, i.miribaarusquare = 13130, i.mirisquare = 13129, i.mlonglegturned = 624, i.mlsquare = 13206, i.mmcubedsquare = 13219, i.mmonospace = 65357, i.mmsquaredsquare = 13215, i.mohiragana = 12418, i.mohmsquare = 13249, i.mokatakana = 12514, i.mokatakanahalfwidth = 65427, i.molsquare = 13270, i.momathai = 3617, i.moverssquare = 13223, i.moverssquaredsquare = 13224, i.mparen = 9384, i.mpasquare = 13227, i.mssquare = 13235, i.msuperior = 63215, i.mturned = 623, i.mu = 181, i.mu1 = 181, i.muasquare = 13186, i.muchgreater = 8811, i.muchless = 8810, i.mufsquare = 13196, i.mugreek = 956, i.mugsquare = 13197, i.muhiragana = 12416, i.mukatakana = 12512, i.mukatakanahalfwidth = 65425, i.mulsquare = 13205, i.multiply = 215, i.mumsquare = 13211, i.munahhebrew = 1443, i.munahlefthebrew = 1443, i.musicalnote = 9834, i.musicalnotedbl = 9835, i.musicflatsign = 9837, i.musicsharpsign = 9839, i.mussquare = 13234, i.muvsquare = 13238, i.muwsquare = 13244, i.mvmegasquare = 13241, i.mvsquare = 13239, i.mwmegasquare = 13247, i.mwsquare = 13245, i.n = 110, i.nabengali = 2472, i.nabla = 8711, i.nacute = 324, i.nadeva = 2344, i.nagujarati = 2728, i.nagurmukhi = 2600, i.nahiragana = 12394, i.nakatakana = 12490, i.nakatakanahalfwidth = 65413, i.napostrophe = 329, i.nasquare = 13185, i.nbopomofo = 12555, i.nbspace = 160, i.ncaron = 328, i.ncedilla = 326, i.ncircle = 9437, i.ncircumflexbelow = 7755, i.ncommaaccent = 326, i.ndotaccent = 7749, i.ndotbelow = 7751, i.nehiragana = 12397, i.nekatakana = 12493, i.nekatakanahalfwidth = 65416, i.newsheqelsign = 8362, i.nfsquare = 13195, i.ngabengali = 2457, i.ngadeva = 2329, i.ngagujarati = 2713, i.ngagurmukhi = 2585, i.ngonguthai = 3591, i.nhiragana = 12435, i.nhookleft = 626, i.nhookretroflex = 627, i.nieunacirclekorean = 12911, i.nieunaparenkorean = 12815, i.nieuncieuckorean = 12597, i.nieuncirclekorean = 12897, i.nieunhieuhkorean = 12598, i.nieunkorean = 12596, i.nieunpansioskorean = 12648, i.nieunparenkorean = 12801, i.nieunsioskorean = 12647, i.nieuntikeutkorean = 12646, i.nihiragana = 12395, i.nikatakana = 12491, i.nikatakanahalfwidth = 65414, i.nikhahitleftthai = 63641, i.nikhahitthai = 3661, i.nine = 57, i.ninearabic = 1641, i.ninebengali = 2543, i.ninecircle = 9320, i.ninecircleinversesansserif = 10130, i.ninedeva = 2415, i.ninegujarati = 2799, i.ninegurmukhi = 2671, i.ninehackarabic = 1641, i.ninehangzhou = 12329, i.nineideographicparen = 12840, i.nineinferior = 8329, i.ninemonospace = 65305, i.nineoldstyle = 63289, i.nineparen = 9340, i.nineperiod = 9360, i.ninepersian = 1785, i.nineroman = 8568, i.ninesuperior = 8313, i.nineteencircle = 9330, i.nineteenparen = 9350, i.nineteenperiod = 9370, i.ninethai = 3673, i.nj = 460, i.njecyrillic = 1114, i.nkatakana = 12531, i.nkatakanahalfwidth = 65437, i.nlegrightlong = 414, i.nlinebelow = 7753, i.nmonospace = 65358, i.nmsquare = 13210, i.nnabengali = 2467, i.nnadeva = 2339, i.nnagujarati = 2723, i.nnagurmukhi = 2595, i.nnnadeva = 2345, i.nohiragana = 12398, i.nokatakana = 12494, i.nokatakanahalfwidth = 65417, i.nonbreakingspace = 160, i.nonenthai = 3603, i.nonuthai = 3609, i.noonarabic = 1606, i.noonfinalarabic = 65254, i.noonghunnaarabic = 1722, i.noonghunnafinalarabic = 64415, i.nooninitialarabic = 65255, i.noonjeeminitialarabic = 64722, i.noonjeemisolatedarabic = 64587, i.noonmedialarabic = 65256, i.noonmeeminitialarabic = 64725, i.noonmeemisolatedarabic = 64590, i.noonnoonfinalarabic = 64653, i.notcontains = 8716, i.notelement = 8713, i.notelementof = 8713, i.notequal = 8800, i.notgreater = 8815, i.notgreaternorequal = 8817, i.notgreaternorless = 8825, i.notidentical = 8802, i.notless = 8814, i.notlessnorequal = 8816, i.notparallel = 8742, i.notprecedes = 8832, i.notsubset = 8836, i.notsucceeds = 8833, i.notsuperset = 8837, i.nowarmenian = 1398, i.nparen = 9385, i.nssquare = 13233, i.nsuperior = 8319, i.ntilde = 241, i.nu = 957, i.nuhiragana = 12396, i.nukatakana = 12492, i.nukatakanahalfwidth = 65415, i.nuktabengali = 2492, i.nuktadeva = 2364, i.nuktagujarati = 2748, i.nuktagurmukhi = 2620, i.numbersign = 35, i.numbersignmonospace = 65283, i.numbersignsmall = 65119, i.numeralsigngreek = 884, i.numeralsignlowergreek = 885, i.numero = 8470, i.nun = 1504, i.nundagesh = 64320, i.nundageshhebrew = 64320, i.nunhebrew = 1504, i.nvsquare = 13237, i.nwsquare = 13243, i.nyabengali = 2462, i.nyadeva = 2334, i.nyagujarati = 2718, i.nyagurmukhi = 2590, i.o = 111, i.oacute = 243, i.oangthai = 3629, i.obarred = 629, i.obarredcyrillic = 1257, i.obarreddieresiscyrillic = 1259, i.obengali = 2451, i.obopomofo = 12571, i.obreve = 335, i.ocandradeva = 2321, i.ocandragujarati = 2705, i.ocandravowelsigndeva = 2377, i.ocandravowelsigngujarati = 2761, i.ocaron = 466, i.ocircle = 9438, i.ocircumflex = 244, i.ocircumflexacute = 7889, i.ocircumflexdotbelow = 7897, i.ocircumflexgrave = 7891, i.ocircumflexhookabove = 7893, i.ocircumflextilde = 7895, i.ocyrillic = 1086, i.odblacute = 337, i.odblgrave = 525, i.odeva = 2323, i.odieresis = 246, i.odieresiscyrillic = 1255, i.odotbelow = 7885, i.oe = 339, i.oekorean = 12634, i.ogonek = 731, i.ogonekcmb = 808, i.ograve = 242, i.ogujarati = 2707, i.oharmenian = 1413, i.ohiragana = 12362, i.ohookabove = 7887, i.ohorn = 417, i.ohornacute = 7899, i.ohorndotbelow = 7907, i.ohorngrave = 7901, i.ohornhookabove = 7903, i.ohorntilde = 7905, i.ohungarumlaut = 337, i.oi = 419, i.oinvertedbreve = 527, i.okatakana = 12458, i.okatakanahalfwidth = 65397, i.okorean = 12631, i.olehebrew = 1451, i.omacron = 333, i.omacronacute = 7763, i.omacrongrave = 7761, i.omdeva = 2384, i.omega = 969, i.omega1 = 982, i.omegacyrillic = 1121, i.omegalatinclosed = 631, i.omegaroundcyrillic = 1147, i.omegatitlocyrillic = 1149, i.omegatonos = 974, i.omgujarati = 2768, i.omicron = 959, i.omicrontonos = 972, i.omonospace = 65359, i.one = 49, i.onearabic = 1633, i.onebengali = 2535, i.onecircle = 9312, i.onecircleinversesansserif = 10122, i.onedeva = 2407, i.onedotenleader = 8228, i.oneeighth = 8539, i.onefitted = 63196, i.onegujarati = 2791, i.onegurmukhi = 2663, i.onehackarabic = 1633, i.onehalf = 189, i.onehangzhou = 12321, i.oneideographicparen = 12832, i.oneinferior = 8321, i.onemonospace = 65297, i.onenumeratorbengali = 2548, i.oneoldstyle = 63281, i.oneparen = 9332, i.oneperiod = 9352, i.onepersian = 1777, i.onequarter = 188, i.oneroman = 8560, i.onesuperior = 185, i.onethai = 3665, i.onethird = 8531, i.oogonek = 491, i.oogonekmacron = 493, i.oogurmukhi = 2579, i.oomatragurmukhi = 2635, i.oopen = 596, i.oparen = 9386, i.openbullet = 9702, i.option = 8997, i.ordfeminine = 170, i.ordmasculine = 186, i.orthogonal = 8735, i.oshortdeva = 2322, i.oshortvowelsigndeva = 2378, i.oslash = 248, i.oslashacute = 511, i.osmallhiragana = 12361, i.osmallkatakana = 12457, i.osmallkatakanahalfwidth = 65387, i.ostrokeacute = 511, i.osuperior = 63216, i.otcyrillic = 1151, i.otilde = 245, i.otildeacute = 7757, i.otildedieresis = 7759, i.oubopomofo = 12577, i.overline = 8254, i.overlinecenterline = 65098, i.overlinecmb = 773, i.overlinedashed = 65097, i.overlinedblwavy = 65100, i.overlinewavy = 65099, i.overscore = 175, i.ovowelsignbengali = 2507, i.ovowelsigndeva = 2379, i.ovowelsigngujarati = 2763, i.p = 112, i.paampssquare = 13184, i.paasentosquare = 13099, i.pabengali = 2474, i.pacute = 7765, i.padeva = 2346, i.pagedown = 8671, i.pageup = 8670, i.pagujarati = 2730, i.pagurmukhi = 2602, i.pahiragana = 12401, i.paiyannoithai = 3631, i.pakatakana = 12497, i.palatalizationcyrilliccmb = 1156, i.palochkacyrillic = 1216, i.pansioskorean = 12671, i.paragraph = 182, i.parallel = 8741, i.parenleft = 40, i.parenleftaltonearabic = 64830, i.parenleftbt = 63725, i.parenleftex = 63724, i.parenleftinferior = 8333, i.parenleftmonospace = 65288, i.parenleftsmall = 65113, i.parenleftsuperior = 8317, i.parenlefttp = 63723, i.parenleftvertical = 65077, i.parenright = 41, i.parenrightaltonearabic = 64831, i.parenrightbt = 63736, i.parenrightex = 63735, i.parenrightinferior = 8334, i.parenrightmonospace = 65289, i.parenrightsmall = 65114, i.parenrightsuperior = 8318, i.parenrighttp = 63734, i.parenrightvertical = 65078, i.partialdiff = 8706, i.paseqhebrew = 1472, i.pashtahebrew = 1433, i.pasquare = 13225, i.patah = 1463, i.patah11 = 1463, i.patah1d = 1463, i.patah2a = 1463, i.patahhebrew = 1463, i.patahnarrowhebrew = 1463, i.patahquarterhebrew = 1463, i.patahwidehebrew = 1463, i.pazerhebrew = 1441, i.pbopomofo = 12550, i.pcircle = 9439, i.pdotaccent = 7767, i.pe = 1508, i.pecyrillic = 1087, i.pedagesh = 64324, i.pedageshhebrew = 64324, i.peezisquare = 13115, i.pefinaldageshhebrew = 64323, i.peharabic = 1662, i.peharmenian = 1402, i.pehebrew = 1508, i.pehfinalarabic = 64343, i.pehinitialarabic = 64344, i.pehiragana = 12410, i.pehmedialarabic = 64345, i.pekatakana = 12506, i.pemiddlehookcyrillic = 1191, i.perafehebrew = 64334, i.percent = 37, i.percentarabic = 1642, i.percentmonospace = 65285, i.percentsmall = 65130, i.period = 46, i.periodarmenian = 1417, i.periodcentered = 183, i.periodhalfwidth = 65377, i.periodinferior = 63207, i.periodmonospace = 65294, i.periodsmall = 65106, i.periodsuperior = 63208, i.perispomenigreekcmb = 834, i.perpendicular = 8869, i.perthousand = 8240, i.peseta = 8359, i.pfsquare = 13194, i.phabengali = 2475, i.phadeva = 2347, i.phagujarati = 2731, i.phagurmukhi = 2603, i.phi = 966, i.phi1 = 981, i.phieuphacirclekorean = 12922, i.phieuphaparenkorean = 12826, i.phieuphcirclekorean = 12908, i.phieuphkorean = 12621, i.phieuphparenkorean = 12812, i.philatin = 632, i.phinthuthai = 3642, i.phisymbolgreek = 981, i.phook = 421, i.phophanthai = 3614, i.phophungthai = 3612, i.phosamphaothai = 3616, i.pi = 960, i.pieupacirclekorean = 12915, i.pieupaparenkorean = 12819, i.pieupcieuckorean = 12662, i.pieupcirclekorean = 12901, i.pieupkiyeokkorean = 12658, i.pieupkorean = 12610, i.pieupparenkorean = 12805, i.pieupsioskiyeokkorean = 12660, i.pieupsioskorean = 12612, i.pieupsiostikeutkorean = 12661, i.pieupthieuthkorean = 12663, i.pieuptikeutkorean = 12659, i.pihiragana = 12404, i.pikatakana = 12500, i.pisymbolgreek = 982, i.piwrarmenian = 1411, i.planckover2pi = 8463, i.planckover2pi1 = 8463, i.plus = 43, i.plusbelowcmb = 799, i.pluscircle = 8853, i.plusminus = 177, i.plusmod = 726, i.plusmonospace = 65291, i.plussmall = 65122, i.plussuperior = 8314, i.pmonospace = 65360, i.pmsquare = 13272, i.pohiragana = 12413, i.pointingindexdownwhite = 9759, i.pointingindexleftwhite = 9756, i.pointingindexrightwhite = 9758, i.pointingindexupwhite = 9757, i.pokatakana = 12509, i.poplathai = 3611, i.postalmark = 12306, i.postalmarkface = 12320, i.pparen = 9387, i.precedes = 8826, i.prescription = 8478, i.primemod = 697, i.primereversed = 8245, i.product = 8719, i.projective = 8965, i.prolongedkana = 12540, i.propellor = 8984, i.propersubset = 8834, i.propersuperset = 8835, i.proportion = 8759, i.proportional = 8733, i.psi = 968, i.psicyrillic = 1137, i.psilipneumatacyrilliccmb = 1158, i.pssquare = 13232, i.puhiragana = 12407, i.pukatakana = 12503, i.pvsquare = 13236, i.pwsquare = 13242, i.q = 113, i.qadeva = 2392, i.qadmahebrew = 1448, i.qafarabic = 1602, i.qaffinalarabic = 65238, i.qafinitialarabic = 65239, i.qafmedialarabic = 65240, i.qamats = 1464, i.qamats10 = 1464, i.qamats1a = 1464, i.qamats1c = 1464, i.qamats27 = 1464, i.qamats29 = 1464, i.qamats33 = 1464, i.qamatsde = 1464, i.qamatshebrew = 1464, i.qamatsnarrowhebrew = 1464, i.qamatsqatanhebrew = 1464, i.qamatsqatannarrowhebrew = 1464, i.qamatsqatanquarterhebrew = 1464, i.qamatsqatanwidehebrew = 1464, i.qamatsquarterhebrew = 1464, i.qamatswidehebrew = 1464, i.qarneyparahebrew = 1439, i.qbopomofo = 12561, i.qcircle = 9440, i.qhook = 672, i.qmonospace = 65361, i.qof = 1511, i.qofdagesh = 64327, i.qofdageshhebrew = 64327, i.qofhebrew = 1511, i.qparen = 9388, i.quarternote = 9833, i.qubuts = 1467, i.qubuts18 = 1467, i.qubuts25 = 1467, i.qubuts31 = 1467, i.qubutshebrew = 1467, i.qubutsnarrowhebrew = 1467, i.qubutsquarterhebrew = 1467, i.qubutswidehebrew = 1467, i.question = 63, i.questionarabic = 1567, i.questionarmenian = 1374, i.questiondown = 191, i.questiondownsmall = 63423, i.questiongreek = 894, i.questionmonospace = 65311, i.questionsmall = 63295, i.quotedbl = 34, i.quotedblbase = 8222, i.quotedblleft = 8220, i.quotedblmonospace = 65282, i.quotedblprime = 12318, i.quotedblprimereversed = 12317, i.quotedblright = 8221, i.quoteleft = 8216, i.quoteleftreversed = 8219, i.quotereversed = 8219, i.quoteright = 8217, i.quoterightn = 329, i.quotesinglbase = 8218, i.quotesingle = 39, i.quotesinglemonospace = 65287, i.r = 114, i.raarmenian = 1404, i.rabengali = 2480, i.racute = 341, i.radeva = 2352, i.radical = 8730, i.radicalex = 63717, i.radoverssquare = 13230, i.radoverssquaredsquare = 13231, i.radsquare = 13229, i.rafe = 1471, i.rafehebrew = 1471, i.ragujarati = 2736, i.ragurmukhi = 2608, i.rahiragana = 12425, i.rakatakana = 12521, i.rakatakanahalfwidth = 65431, i.ralowerdiagonalbengali = 2545, i.ramiddlediagonalbengali = 2544, i.ramshorn = 612, i.ratio = 8758, i.rbopomofo = 12566, i.rcaron = 345, i.rcedilla = 343, i.rcircle = 9441, i.rcommaaccent = 343, i.rdblgrave = 529, i.rdotaccent = 7769, i.rdotbelow = 7771, i.rdotbelowmacron = 7773, i.referencemark = 8251, i.reflexsubset = 8838, i.reflexsuperset = 8839, i.registered = 174, i.registersans = 63720, i.registerserif = 63194, i.reharabic = 1585, i.reharmenian = 1408, i.rehfinalarabic = 65198, i.rehiragana = 12428, i.rekatakana = 12524, i.rekatakanahalfwidth = 65434, i.resh = 1512, i.reshdageshhebrew = 64328, i.reshhebrew = 1512, i.reversedtilde = 8765, i.reviahebrew = 1431, i.reviamugrashhebrew = 1431, i.revlogicalnot = 8976, i.rfishhook = 638, i.rfishhookreversed = 639, i.rhabengali = 2525, i.rhadeva = 2397, i.rho = 961, i.rhook = 637, i.rhookturned = 635, i.rhookturnedsuperior = 693, i.rhosymbolgreek = 1009, i.rhotichookmod = 734, i.rieulacirclekorean = 12913, i.rieulaparenkorean = 12817, i.rieulcirclekorean = 12899, i.rieulhieuhkorean = 12608, i.rieulkiyeokkorean = 12602, i.rieulkiyeoksioskorean = 12649, i.rieulkorean = 12601, i.rieulmieumkorean = 12603, i.rieulpansioskorean = 12652, i.rieulparenkorean = 12803, i.rieulphieuphkorean = 12607, i.rieulpieupkorean = 12604, i.rieulpieupsioskorean = 12651, i.rieulsioskorean = 12605, i.rieulthieuthkorean = 12606, i.rieultikeutkorean = 12650, i.rieulyeorinhieuhkorean = 12653, i.rightangle = 8735, i.righttackbelowcmb = 793, i.righttriangle = 8895, i.rihiragana = 12426, i.rikatakana = 12522, i.rikatakanahalfwidth = 65432, i.ring = 730, i.ringbelowcmb = 805, i.ringcmb = 778, i.ringhalfleft = 703, i.ringhalfleftarmenian = 1369, i.ringhalfleftbelowcmb = 796, i.ringhalfleftcentered = 723, i.ringhalfright = 702, i.ringhalfrightbelowcmb = 825, i.ringhalfrightcentered = 722, i.rinvertedbreve = 531, i.rittorusquare = 13137, i.rlinebelow = 7775, i.rlongleg = 636, i.rlonglegturned = 634, i.rmonospace = 65362, i.rohiragana = 12429, i.rokatakana = 12525, i.rokatakanahalfwidth = 65435, i.roruathai = 3619, i.rparen = 9389, i.rrabengali = 2524, i.rradeva = 2353, i.rragurmukhi = 2652, i.rreharabic = 1681, i.rrehfinalarabic = 64397, i.rrvocalicbengali = 2528, i.rrvocalicdeva = 2400, i.rrvocalicgujarati = 2784, i.rrvocalicvowelsignbengali = 2500, i.rrvocalicvowelsigndeva = 2372, i.rrvocalicvowelsigngujarati = 2756, i.rsuperior = 63217, i.rtblock = 9616, i.rturned = 633, i.rturnedsuperior = 692, i.ruhiragana = 12427, i.rukatakana = 12523, i.rukatakanahalfwidth = 65433, i.rupeemarkbengali = 2546, i.rupeesignbengali = 2547, i.rupiah = 63197, i.ruthai = 3620, i.rvocalicbengali = 2443, i.rvocalicdeva = 2315, i.rvocalicgujarati = 2699, i.rvocalicvowelsignbengali = 2499, i.rvocalicvowelsigndeva = 2371, i.rvocalicvowelsigngujarati = 2755, i.s = 115, i.sabengali = 2488, i.sacute = 347, i.sacutedotaccent = 7781, i.sadarabic = 1589, i.sadeva = 2360, i.sadfinalarabic = 65210, i.sadinitialarabic = 65211, i.sadmedialarabic = 65212, i.sagujarati = 2744, i.sagurmukhi = 2616, i.sahiragana = 12373, i.sakatakana = 12469, i.sakatakanahalfwidth = 65403, i.sallallahoualayhewasallamarabic = 65018, i.samekh = 1505, i.samekhdagesh = 64321, i.samekhdageshhebrew = 64321, i.samekhhebrew = 1505, i.saraaathai = 3634, i.saraaethai = 3649, i.saraaimaimalaithai = 3652, i.saraaimaimuanthai = 3651, i.saraamthai = 3635, i.saraathai = 3632, i.saraethai = 3648, i.saraiileftthai = 63622, i.saraiithai = 3637, i.saraileftthai = 63621, i.saraithai = 3636, i.saraothai = 3650, i.saraueeleftthai = 63624, i.saraueethai = 3639, i.saraueleftthai = 63623, i.sarauethai = 3638, i.sarauthai = 3640, i.sarauuthai = 3641, i.sbopomofo = 12569, i.scaron = 353, i.scarondotaccent = 7783, i.scedilla = 351, i.schwa = 601, i.schwacyrillic = 1241, i.schwadieresiscyrillic = 1243, i.schwahook = 602, i.scircle = 9442, i.scircumflex = 349, i.scommaaccent = 537, i.sdotaccent = 7777, i.sdotbelow = 7779, i.sdotbelowdotaccent = 7785, i.seagullbelowcmb = 828, i.second = 8243, i.secondtonechinese = 714, i.section = 167, i.seenarabic = 1587, i.seenfinalarabic = 65202, i.seeninitialarabic = 65203, i.seenmedialarabic = 65204, i.segol = 1462, i.segol13 = 1462, i.segol1f = 1462, i.segol2c = 1462, i.segolhebrew = 1462, i.segolnarrowhebrew = 1462, i.segolquarterhebrew = 1462, i.segoltahebrew = 1426, i.segolwidehebrew = 1462, i.seharmenian = 1405, i.sehiragana = 12379, i.sekatakana = 12475, i.sekatakanahalfwidth = 65406, i.semicolon = 59, i.semicolonarabic = 1563, i.semicolonmonospace = 65307, i.semicolonsmall = 65108, i.semivoicedmarkkana = 12444, i.semivoicedmarkkanahalfwidth = 65439, i.sentisquare = 13090, i.sentosquare = 13091, i.seven = 55, i.sevenarabic = 1639, i.sevenbengali = 2541, i.sevencircle = 9318, i.sevencircleinversesansserif = 10128, i.sevendeva = 2413, i.seveneighths = 8542, i.sevengujarati = 2797, i.sevengurmukhi = 2669, i.sevenhackarabic = 1639, i.sevenhangzhou = 12327, i.sevenideographicparen = 12838, i.seveninferior = 8327, i.sevenmonospace = 65303, i.sevenoldstyle = 63287, i.sevenparen = 9338, i.sevenperiod = 9358, i.sevenpersian = 1783, i.sevenroman = 8566, i.sevensuperior = 8311, i.seventeencircle = 9328, i.seventeenparen = 9348, i.seventeenperiod = 9368, i.seventhai = 3671, i.sfthyphen = 173, i.shaarmenian = 1399, i.shabengali = 2486, i.shacyrillic = 1096, i.shaddaarabic = 1617, i.shaddadammaarabic = 64609, i.shaddadammatanarabic = 64606, i.shaddafathaarabic = 64608, i.shaddakasraarabic = 64610, i.shaddakasratanarabic = 64607, i.shade = 9618, i.shadedark = 9619, i.shadelight = 9617, i.shademedium = 9618, i.shadeva = 2358, i.shagujarati = 2742, i.shagurmukhi = 2614, i.shalshelethebrew = 1427, i.shbopomofo = 12565, i.shchacyrillic = 1097, i.sheenarabic = 1588, i.sheenfinalarabic = 65206, i.sheeninitialarabic = 65207, i.sheenmedialarabic = 65208, i.sheicoptic = 995, i.sheqel = 8362, i.sheqelhebrew = 8362, i.sheva = 1456, i.sheva115 = 1456, i.sheva15 = 1456, i.sheva22 = 1456, i.sheva2e = 1456, i.shevahebrew = 1456, i.shevanarrowhebrew = 1456, i.shevaquarterhebrew = 1456, i.shevawidehebrew = 1456, i.shhacyrillic = 1211, i.shimacoptic = 1005, i.shin = 1513, i.shindagesh = 64329, i.shindageshhebrew = 64329, i.shindageshshindot = 64300, i.shindageshshindothebrew = 64300, i.shindageshsindot = 64301, i.shindageshsindothebrew = 64301, i.shindothebrew = 1473, i.shinhebrew = 1513, i.shinshindot = 64298, i.shinshindothebrew = 64298, i.shinsindot = 64299, i.shinsindothebrew = 64299, i.shook = 642, i.sigma = 963, i.sigma1 = 962, i.sigmafinal = 962, i.sigmalunatesymbolgreek = 1010, i.sihiragana = 12375, i.sikatakana = 12471, i.sikatakanahalfwidth = 65404, i.siluqhebrew = 1469, i.siluqlefthebrew = 1469, i.similar = 8764, i.sindothebrew = 1474, i.siosacirclekorean = 12916, i.siosaparenkorean = 12820, i.sioscieuckorean = 12670, i.sioscirclekorean = 12902, i.sioskiyeokkorean = 12666, i.sioskorean = 12613, i.siosnieunkorean = 12667, i.siosparenkorean = 12806, i.siospieupkorean = 12669, i.siostikeutkorean = 12668, i.six = 54, i.sixarabic = 1638, i.sixbengali = 2540, i.sixcircle = 9317, i.sixcircleinversesansserif = 10127, i.sixdeva = 2412, i.sixgujarati = 2796, i.sixgurmukhi = 2668, i.sixhackarabic = 1638, i.sixhangzhou = 12326, i.sixideographicparen = 12837, i.sixinferior = 8326, i.sixmonospace = 65302, i.sixoldstyle = 63286, i.sixparen = 9337, i.sixperiod = 9357, i.sixpersian = 1782, i.sixroman = 8565, i.sixsuperior = 8310, i.sixteencircle = 9327, i.sixteencurrencydenominatorbengali = 2553, i.sixteenparen = 9347, i.sixteenperiod = 9367, i.sixthai = 3670, i.slash = 47, i.slashmonospace = 65295, i.slong = 383, i.slongdotaccent = 7835, i.smileface = 9786, i.smonospace = 65363, i.sofpasuqhebrew = 1475, i.softhyphen = 173, i.softsigncyrillic = 1100, i.sohiragana = 12381, i.sokatakana = 12477, i.sokatakanahalfwidth = 65407, i.soliduslongoverlaycmb = 824, i.solidusshortoverlaycmb = 823, i.sorusithai = 3625, i.sosalathai = 3624, i.sosothai = 3595, i.sosuathai = 3626, i.space = 32, i.spacehackarabic = 32, i.spade = 9824, i.spadesuitblack = 9824, i.spadesuitwhite = 9828, i.sparen = 9390, i.squarebelowcmb = 827, i.squarecc = 13252, i.squarecm = 13213, i.squarediagonalcrosshatchfill = 9641, i.squarehorizontalfill = 9636, i.squarekg = 13199, i.squarekm = 13214, i.squarekmcapital = 13262, i.squareln = 13265, i.squarelog = 13266, i.squaremg = 13198, i.squaremil = 13269, i.squaremm = 13212, i.squaremsquared = 13217, i.squareorthogonalcrosshatchfill = 9638, i.squareupperlefttolowerrightfill = 9639, i.squareupperrighttolowerleftfill = 9640, i.squareverticalfill = 9637, i.squarewhitewithsmallblack = 9635, i.srsquare = 13275, i.ssabengali = 2487, i.ssadeva = 2359, i.ssagujarati = 2743, i.ssangcieuckorean = 12617, i.ssanghieuhkorean = 12677, i.ssangieungkorean = 12672, i.ssangkiyeokkorean = 12594, i.ssangnieunkorean = 12645, i.ssangpieupkorean = 12611, i.ssangsioskorean = 12614, i.ssangtikeutkorean = 12600, i.ssuperior = 63218, i.sterling = 163, i.sterlingmonospace = 65505, i.strokelongoverlaycmb = 822, i.strokeshortoverlaycmb = 821, i.subset = 8834, i.subsetnotequal = 8842, i.subsetorequal = 8838, i.succeeds = 8827, i.suchthat = 8715, i.suhiragana = 12377, i.sukatakana = 12473, i.sukatakanahalfwidth = 65405, i.sukunarabic = 1618, i.summation = 8721, i.sun = 9788, i.superset = 8835, i.supersetnotequal = 8843, i.supersetorequal = 8839, i.svsquare = 13276, i.syouwaerasquare = 13180, i.t = 116, i.tabengali = 2468, i.tackdown = 8868, i.tackleft = 8867, i.tadeva = 2340, i.tagujarati = 2724, i.tagurmukhi = 2596, i.taharabic = 1591, i.tahfinalarabic = 65218, i.tahinitialarabic = 65219, i.tahiragana = 12383, i.tahmedialarabic = 65220, i.taisyouerasquare = 13181, i.takatakana = 12479, i.takatakanahalfwidth = 65408, i.tatweelarabic = 1600, i.tau = 964, i.tav = 1514, i.tavdages = 64330, i.tavdagesh = 64330, i.tavdageshhebrew = 64330, i.tavhebrew = 1514, i.tbar = 359, i.tbopomofo = 12554, i.tcaron = 357, i.tccurl = 680, i.tcedilla = 355, i.tcheharabic = 1670, i.tchehfinalarabic = 64379, i.tchehinitialarabic = 64380, i.tchehmedialarabic = 64381, i.tcircle = 9443, i.tcircumflexbelow = 7793, i.tcommaaccent = 355, i.tdieresis = 7831, i.tdotaccent = 7787, i.tdotbelow = 7789, i.tecyrillic = 1090, i.tedescendercyrillic = 1197, i.teharabic = 1578, i.tehfinalarabic = 65174, i.tehhahinitialarabic = 64674, i.tehhahisolatedarabic = 64524, i.tehinitialarabic = 65175, i.tehiragana = 12390, i.tehjeeminitialarabic = 64673, i.tehjeemisolatedarabic = 64523, i.tehmarbutaarabic = 1577, i.tehmarbutafinalarabic = 65172, i.tehmedialarabic = 65176, i.tehmeeminitialarabic = 64676, i.tehmeemisolatedarabic = 64526, i.tehnoonfinalarabic = 64627, i.tekatakana = 12486, i.tekatakanahalfwidth = 65411, i.telephone = 8481, i.telephoneblack = 9742, i.telishagedolahebrew = 1440, i.telishaqetanahebrew = 1449, i.tencircle = 9321, i.tenideographicparen = 12841, i.tenparen = 9341, i.tenperiod = 9361, i.tenroman = 8569, i.tesh = 679, i.tet = 1496, i.tetdagesh = 64312, i.tetdageshhebrew = 64312, i.tethebrew = 1496, i.tetsecyrillic = 1205, i.tevirhebrew = 1435, i.tevirlefthebrew = 1435, i.thabengali = 2469, i.thadeva = 2341, i.thagujarati = 2725, i.thagurmukhi = 2597, i.thalarabic = 1584, i.thalfinalarabic = 65196, i.thanthakhatlowleftthai = 63640, i.thanthakhatlowrightthai = 63639, i.thanthakhatthai = 3660, i.thanthakhatupperleftthai = 63638, i.theharabic = 1579, i.thehfinalarabic = 65178, i.thehinitialarabic = 65179, i.thehmedialarabic = 65180, i.thereexists = 8707, i.therefore = 8756, i.theta = 952, i.theta1 = 977, i.thetasymbolgreek = 977, i.thieuthacirclekorean = 12921, i.thieuthaparenkorean = 12825, i.thieuthcirclekorean = 12907, i.thieuthkorean = 12620, i.thieuthparenkorean = 12811, i.thirteencircle = 9324, i.thirteenparen = 9344, i.thirteenperiod = 9364, i.thonangmonthothai = 3601, i.thook = 429, i.thophuthaothai = 3602, i.thorn = 254, i.thothahanthai = 3607, i.thothanthai = 3600, i.thothongthai = 3608, i.thothungthai = 3606, i.thousandcyrillic = 1154, i.thousandsseparatorarabic = 1644, i.thousandsseparatorpersian = 1644, i.three = 51, i.threearabic = 1635, i.threebengali = 2537, i.threecircle = 9314, i.threecircleinversesansserif = 10124, i.threedeva = 2409, i.threeeighths = 8540, i.threegujarati = 2793, i.threegurmukhi = 2665, i.threehackarabic = 1635, i.threehangzhou = 12323, i.threeideographicparen = 12834, i.threeinferior = 8323, i.threemonospace = 65299, i.threenumeratorbengali = 2550, i.threeoldstyle = 63283, i.threeparen = 9334, i.threeperiod = 9354, i.threepersian = 1779, i.threequarters = 190, i.threequartersemdash = 63198, i.threeroman = 8562, i.threesuperior = 179, i.threethai = 3667, i.thzsquare = 13204, i.tihiragana = 12385, i.tikatakana = 12481, i.tikatakanahalfwidth = 65409, i.tikeutacirclekorean = 12912, i.tikeutaparenkorean = 12816, i.tikeutcirclekorean = 12898, i.tikeutkorean = 12599, i.tikeutparenkorean = 12802, i.tilde = 732, i.tildebelowcmb = 816, i.tildecmb = 771, i.tildecomb = 771, i.tildedoublecmb = 864, i.tildeoperator = 8764, i.tildeoverlaycmb = 820, i.tildeverticalcmb = 830, i.timescircle = 8855, i.tipehahebrew = 1430, i.tipehalefthebrew = 1430, i.tippigurmukhi = 2672, i.titlocyrilliccmb = 1155, i.tiwnarmenian = 1407, i.tlinebelow = 7791, i.tmonospace = 65364, i.toarmenian = 1385, i.tohiragana = 12392, i.tokatakana = 12488, i.tokatakanahalfwidth = 65412, i.tonebarextrahighmod = 741, i.tonebarextralowmod = 745, i.tonebarhighmod = 742, i.tonebarlowmod = 744, i.tonebarmidmod = 743, i.tonefive = 445, i.tonesix = 389, i.tonetwo = 424, i.tonos = 900, i.tonsquare = 13095, i.topatakthai = 3599, i.tortoiseshellbracketleft = 12308, i.tortoiseshellbracketleftsmall = 65117, i.tortoiseshellbracketleftvertical = 65081, i.tortoiseshellbracketright = 12309, i.tortoiseshellbracketrightsmall = 65118, i.tortoiseshellbracketrightvertical = 65082, i.totaothai = 3605, i.tpalatalhook = 427, i.tparen = 9391, i.trademark = 8482, i.trademarksans = 63722, i.trademarkserif = 63195, i.tretroflexhook = 648, i.triagdn = 9660, i.triaglf = 9668, i.triagrt = 9658, i.triagup = 9650, i.ts = 678, i.tsadi = 1510, i.tsadidagesh = 64326, i.tsadidageshhebrew = 64326, i.tsadihebrew = 1510, i.tsecyrillic = 1094, i.tsere = 1461, i.tsere12 = 1461, i.tsere1e = 1461, i.tsere2b = 1461, i.tserehebrew = 1461, i.tserenarrowhebrew = 1461, i.tserequarterhebrew = 1461, i.tserewidehebrew = 1461, i.tshecyrillic = 1115, i.tsuperior = 63219, i.ttabengali = 2463, i.ttadeva = 2335, i.ttagujarati = 2719, i.ttagurmukhi = 2591, i.tteharabic = 1657, i.ttehfinalarabic = 64359, i.ttehinitialarabic = 64360, i.ttehmedialarabic = 64361, i.tthabengali = 2464, i.tthadeva = 2336, i.tthagujarati = 2720, i.tthagurmukhi = 2592, i.tturned = 647, i.tuhiragana = 12388, i.tukatakana = 12484, i.tukatakanahalfwidth = 65410, i.tusmallhiragana = 12387, i.tusmallkatakana = 12483, i.tusmallkatakanahalfwidth = 65391, i.twelvecircle = 9323, i.twelveparen = 9343, i.twelveperiod = 9363, i.twelveroman = 8571, i.twentycircle = 9331, i.twentyhangzhou = 21316, i.twentyparen = 9351, i.twentyperiod = 9371, i.two = 50, i.twoarabic = 1634, i.twobengali = 2536, i.twocircle = 9313, i.twocircleinversesansserif = 10123, i.twodeva = 2408, i.twodotenleader = 8229, i.twodotleader = 8229, i.twodotleadervertical = 65072, i.twogujarati = 2792, i.twogurmukhi = 2664, i.twohackarabic = 1634, i.twohangzhou = 12322, i.twoideographicparen = 12833, i.twoinferior = 8322, i.twomonospace = 65298, i.twonumeratorbengali = 2549, i.twooldstyle = 63282, i.twoparen = 9333, i.twoperiod = 9353, i.twopersian = 1778, i.tworoman = 8561, i.twostroke = 443, i.twosuperior = 178, i.twothai = 3666, i.twothirds = 8532, i.u = 117, i.uacute = 250, i.ubar = 649, i.ubengali = 2441, i.ubopomofo = 12584, i.ubreve = 365, i.ucaron = 468, i.ucircle = 9444, i.ucircumflex = 251, i.ucircumflexbelow = 7799, i.ucyrillic = 1091, i.udattadeva = 2385, i.udblacute = 369, i.udblgrave = 533, i.udeva = 2313, i.udieresis = 252, i.udieresisacute = 472, i.udieresisbelow = 7795, i.udieresiscaron = 474, i.udieresiscyrillic = 1265, i.udieresisgrave = 476, i.udieresismacron = 470, i.udotbelow = 7909, i.ugrave = 249, i.ugujarati = 2697, i.ugurmukhi = 2569, i.uhiragana = 12358, i.uhookabove = 7911, i.uhorn = 432, i.uhornacute = 7913, i.uhorndotbelow = 7921, i.uhorngrave = 7915, i.uhornhookabove = 7917, i.uhorntilde = 7919, i.uhungarumlaut = 369, i.uhungarumlautcyrillic = 1267, i.uinvertedbreve = 535, i.ukatakana = 12454, i.ukatakanahalfwidth = 65395, i.ukcyrillic = 1145, i.ukorean = 12636, i.umacron = 363, i.umacroncyrillic = 1263, i.umacrondieresis = 7803, i.umatragurmukhi = 2625, i.umonospace = 65365, i.underscore = 95, i.underscoredbl = 8215, i.underscoremonospace = 65343, i.underscorevertical = 65075, i.underscorewavy = 65103, i.union = 8746, i.universal = 8704, i.uogonek = 371, i.uparen = 9392, i.upblock = 9600, i.upperdothebrew = 1476, i.upsilon = 965, i.upsilondieresis = 971, i.upsilondieresistonos = 944, i.upsilonlatin = 650, i.upsilontonos = 973, i.uptackbelowcmb = 797, i.uptackmod = 724, i.uragurmukhi = 2675, i.uring = 367, i.ushortcyrillic = 1118, i.usmallhiragana = 12357, i.usmallkatakana = 12453, i.usmallkatakanahalfwidth = 65385, i.ustraightcyrillic = 1199, i.ustraightstrokecyrillic = 1201, i.utilde = 361, i.utildeacute = 7801, i.utildebelow = 7797, i.uubengali = 2442, i.uudeva = 2314, i.uugujarati = 2698, i.uugurmukhi = 2570, i.uumatragurmukhi = 2626, i.uuvowelsignbengali = 2498, i.uuvowelsigndeva = 2370, i.uuvowelsigngujarati = 2754, i.uvowelsignbengali = 2497, i.uvowelsigndeva = 2369, i.uvowelsigngujarati = 2753, i.v = 118, i.vadeva = 2357, i.vagujarati = 2741, i.vagurmukhi = 2613, i.vakatakana = 12535, i.vav = 1493, i.vavdagesh = 64309, i.vavdagesh65 = 64309, i.vavdageshhebrew = 64309, i.vavhebrew = 1493, i.vavholam = 64331, i.vavholamhebrew = 64331, i.vavvavhebrew = 1520, i.vavyodhebrew = 1521, i.vcircle = 9445, i.vdotbelow = 7807, i.vecyrillic = 1074, i.veharabic = 1700, i.vehfinalarabic = 64363, i.vehinitialarabic = 64364, i.vehmedialarabic = 64365, i.vekatakana = 12537, i.venus = 9792, i.verticalbar = 124, i.verticallineabovecmb = 781, i.verticallinebelowcmb = 809, i.verticallinelowmod = 716, i.verticallinemod = 712, i.vewarmenian = 1406, i.vhook = 651, i.vikatakana = 12536, i.viramabengali = 2509, i.viramadeva = 2381, i.viramagujarati = 2765, i.visargabengali = 2435, i.visargadeva = 2307, i.visargagujarati = 2691, i.vmonospace = 65366, i.voarmenian = 1400, i.voicediterationhiragana = 12446, i.voicediterationkatakana = 12542, i.voicedmarkkana = 12443, i.voicedmarkkanahalfwidth = 65438, i.vokatakana = 12538, i.vparen = 9393, i.vtilde = 7805, i.vturned = 652, i.vuhiragana = 12436, i.vukatakana = 12532, i.w = 119, i.wacute = 7811, i.waekorean = 12633, i.wahiragana = 12431, i.wakatakana = 12527, i.wakatakanahalfwidth = 65436, i.wakorean = 12632, i.wasmallhiragana = 12430, i.wasmallkatakana = 12526, i.wattosquare = 13143, i.wavedash = 12316, i.wavyunderscorevertical = 65076, i.wawarabic = 1608, i.wawfinalarabic = 65262, i.wawhamzaabovearabic = 1572, i.wawhamzaabovefinalarabic = 65158, i.wbsquare = 13277, i.wcircle = 9446, i.wcircumflex = 373, i.wdieresis = 7813, i.wdotaccent = 7815, i.wdotbelow = 7817, i.wehiragana = 12433, i.weierstrass = 8472, i.wekatakana = 12529, i.wekorean = 12638, i.weokorean = 12637, i.wgrave = 7809, i.whitebullet = 9702, i.whitecircle = 9675, i.whitecircleinverse = 9689, i.whitecornerbracketleft = 12302, i.whitecornerbracketleftvertical = 65091, i.whitecornerbracketright = 12303, i.whitecornerbracketrightvertical = 65092, i.whitediamond = 9671, i.whitediamondcontainingblacksmalldiamond = 9672, i.whitedownpointingsmalltriangle = 9663, i.whitedownpointingtriangle = 9661, i.whiteleftpointingsmalltriangle = 9667, i.whiteleftpointingtriangle = 9665, i.whitelenticularbracketleft = 12310, i.whitelenticularbracketright = 12311, i.whiterightpointingsmalltriangle = 9657, i.whiterightpointingtriangle = 9655, i.whitesmallsquare = 9643, i.whitesmilingface = 9786, i.whitesquare = 9633, i.whitestar = 9734, i.whitetelephone = 9743, i.whitetortoiseshellbracketleft = 12312, i.whitetortoiseshellbracketright = 12313, i.whiteuppointingsmalltriangle = 9653, i.whiteuppointingtriangle = 9651, i.wihiragana = 12432, i.wikatakana = 12528, i.wikorean = 12639, i.wmonospace = 65367, i.wohiragana = 12434, i.wokatakana = 12530, i.wokatakanahalfwidth = 65382, i.won = 8361, i.wonmonospace = 65510, i.wowaenthai = 3623, i.wparen = 9394, i.wring = 7832, i.wsuperior = 695, i.wturned = 653, i.wynn = 447, i.x = 120, i.xabovecmb = 829, i.xbopomofo = 12562, i.xcircle = 9447, i.xdieresis = 7821, i.xdotaccent = 7819, i.xeharmenian = 1389, i.xi = 958, i.xmonospace = 65368, i.xparen = 9395, i.xsuperior = 739, i.y = 121, i.yaadosquare = 13134, i.yabengali = 2479, i.yacute = 253, i.yadeva = 2351, i.yaekorean = 12626, i.yagujarati = 2735, i.yagurmukhi = 2607, i.yahiragana = 12420, i.yakatakana = 12516, i.yakatakanahalfwidth = 65428, i.yakorean = 12625, i.yamakkanthai = 3662, i.yasmallhiragana = 12419, i.yasmallkatakana = 12515, i.yasmallkatakanahalfwidth = 65388, i.yatcyrillic = 1123, i.ycircle = 9448, i.ycircumflex = 375, i.ydieresis = 255, i.ydotaccent = 7823, i.ydotbelow = 7925, i.yeharabic = 1610, i.yehbarreearabic = 1746, i.yehbarreefinalarabic = 64431, i.yehfinalarabic = 65266, i.yehhamzaabovearabic = 1574, i.yehhamzaabovefinalarabic = 65162, i.yehhamzaaboveinitialarabic = 65163, i.yehhamzaabovemedialarabic = 65164, i.yehinitialarabic = 65267, i.yehmedialarabic = 65268, i.yehmeeminitialarabic = 64733, i.yehmeemisolatedarabic = 64600, i.yehnoonfinalarabic = 64660, i.yehthreedotsbelowarabic = 1745, i.yekorean = 12630, i.yen = 165, i.yenmonospace = 65509, i.yeokorean = 12629, i.yeorinhieuhkorean = 12678, i.yerahbenyomohebrew = 1450, i.yerahbenyomolefthebrew = 1450, i.yericyrillic = 1099, i.yerudieresiscyrillic = 1273, i.yesieungkorean = 12673, i.yesieungpansioskorean = 12675, i.yesieungsioskorean = 12674, i.yetivhebrew = 1434, i.ygrave = 7923, i.yhook = 436, i.yhookabove = 7927, i.yiarmenian = 1397, i.yicyrillic = 1111, i.yikorean = 12642, i.yinyang = 9775, i.yiwnarmenian = 1410, i.ymonospace = 65369, i.yod = 1497, i.yoddagesh = 64313, i.yoddageshhebrew = 64313, i.yodhebrew = 1497, i.yodyodhebrew = 1522, i.yodyodpatahhebrew = 64287, i.yohiragana = 12424, i.yoikorean = 12681, i.yokatakana = 12520, i.yokatakanahalfwidth = 65430, i.yokorean = 12635, i.yosmallhiragana = 12423, i.yosmallkatakana = 12519, i.yosmallkatakanahalfwidth = 65390, i.yotgreek = 1011, i.yoyaekorean = 12680, i.yoyakorean = 12679, i.yoyakthai = 3618, i.yoyingthai = 3597, i.yparen = 9396, i.ypogegrammeni = 890, i.ypogegrammenigreekcmb = 837, i.yr = 422, i.yring = 7833, i.ysuperior = 696, i.ytilde = 7929, i.yturned = 654, i.yuhiragana = 12422, i.yuikorean = 12684, i.yukatakana = 12518, i.yukatakanahalfwidth = 65429, i.yukorean = 12640, i.yusbigcyrillic = 1131, i.yusbigiotifiedcyrillic = 1133, i.yuslittlecyrillic = 1127, i.yuslittleiotifiedcyrillic = 1129, i.yusmallhiragana = 12421, i.yusmallkatakana = 12517, i.yusmallkatakanahalfwidth = 65389, i.yuyekorean = 12683, i.yuyeokorean = 12682, i.yyabengali = 2527, i.yyadeva = 2399, i.z = 122, i.zaarmenian = 1382, i.zacute = 378, i.zadeva = 2395, i.zagurmukhi = 2651, i.zaharabic = 1592, i.zahfinalarabic = 65222, i.zahinitialarabic = 65223, i.zahiragana = 12374, i.zahmedialarabic = 65224, i.zainarabic = 1586, i.zainfinalarabic = 65200, i.zakatakana = 12470, i.zaqefgadolhebrew = 1429, i.zaqefqatanhebrew = 1428, i.zarqahebrew = 1432, i.zayin = 1494, i.zayindagesh = 64310, i.zayindageshhebrew = 64310, i.zayinhebrew = 1494, i.zbopomofo = 12567, i.zcaron = 382, i.zcircle = 9449, i.zcircumflex = 7825, i.zcurl = 657, i.zdot = 380, i.zdotaccent = 380, i.zdotbelow = 7827, i.zecyrillic = 1079, i.zedescendercyrillic = 1177, i.zedieresiscyrillic = 1247, i.zehiragana = 12380, i.zekatakana = 12476, i.zero = 48, i.zeroarabic = 1632, i.zerobengali = 2534, i.zerodeva = 2406, i.zerogujarati = 2790, i.zerogurmukhi = 2662, i.zerohackarabic = 1632, i.zeroinferior = 8320, i.zeromonospace = 65296, i.zerooldstyle = 63280, i.zeropersian = 1776, i.zerosuperior = 8304, i.zerothai = 3664, i.zerowidthjoiner = 65279, i.zerowidthnonjoiner = 8204, i.zerowidthspace = 8203, i.zeta = 950, i.zhbopomofo = 12563, i.zhearmenian = 1386, i.zhebrevecyrillic = 1218, i.zhecyrillic = 1078, i.zhedescendercyrillic = 1175, i.zhedieresiscyrillic = 1245, i.zihiragana = 12376, i.zikatakana = 12472, i.zinorhebrew = 1454, i.zlinebelow = 7829, i.zmonospace = 65370, i.zohiragana = 12382, i.zokatakana = 12478, i.zparen = 9397, i.zretroflexhook = 656, i.zstroke = 438, i.zuhiragana = 12378, i.zukatakana = 12474, i[".notdef"] = 0, i.angbracketleftbig = 9001, i.angbracketleftBig = 9001, i.angbracketleftbigg = 9001, i.angbracketleftBigg = 9001, i.angbracketrightBig = 9002, i.angbracketrightbig = 9002, i.angbracketrightBigg = 9002, i.angbracketrightbigg = 9002, i.arrowhookleft = 8618, i.arrowhookright = 8617, i.arrowlefttophalf = 8636, i.arrowleftbothalf = 8637, i.arrownortheast = 8599, i.arrownorthwest = 8598, i.arrowrighttophalf = 8640, i.arrowrightbothalf = 8641, i.arrowsoutheast = 8600, i.arrowsouthwest = 8601, i.backslashbig = 8726, i.backslashBig = 8726, i.backslashBigg = 8726, i.backslashbigg = 8726, i.bardbl = 8214, i.bracehtipdownleft = 65079, i.bracehtipdownright = 65079, i.bracehtipupleft = 65080, i.bracehtipupright = 65080, i.braceleftBig = 123, i.braceleftbig = 123, i.braceleftbigg = 123, i.braceleftBigg = 123, i.bracerightBig = 125, i.bracerightbig = 125, i.bracerightbigg = 125, i.bracerightBigg = 125, i.bracketleftbig = 91, i.bracketleftBig = 91, i.bracketleftbigg = 91, i.bracketleftBigg = 91, i.bracketrightBig = 93, i.bracketrightbig = 93, i.bracketrightbigg = 93, i.bracketrightBigg = 93, i.ceilingleftbig = 8968, i.ceilingleftBig = 8968, i.ceilingleftBigg = 8968, i.ceilingleftbigg = 8968, i.ceilingrightbig = 8969, i.ceilingrightBig = 8969, i.ceilingrightbigg = 8969, i.ceilingrightBigg = 8969, i.circledotdisplay = 8857, i.circledottext = 8857, i.circlemultiplydisplay = 8855, i.circlemultiplytext = 8855, i.circleplusdisplay = 8853, i.circleplustext = 8853, i.contintegraldisplay = 8750, i.contintegraltext = 8750, i.coproductdisplay = 8720, i.coproducttext = 8720, i.floorleftBig = 8970, i.floorleftbig = 8970, i.floorleftbigg = 8970, i.floorleftBigg = 8970, i.floorrightbig = 8971, i.floorrightBig = 8971, i.floorrightBigg = 8971, i.floorrightbigg = 8971, i.hatwide = 770, i.hatwider = 770, i.hatwidest = 770, i.intercal = 7488, i.integraldisplay = 8747, i.integraltext = 8747, i.intersectiondisplay = 8898, i.intersectiontext = 8898, i.logicalanddisplay = 8743, i.logicalandtext = 8743, i.logicalordisplay = 8744, i.logicalortext = 8744, i.parenleftBig = 40, i.parenleftbig = 40, i.parenleftBigg = 40, i.parenleftbigg = 40, i.parenrightBig = 41, i.parenrightbig = 41, i.parenrightBigg = 41, i.parenrightbigg = 41, i.prime = 8242, i.productdisplay = 8719, i.producttext = 8719, i.radicalbig = 8730, i.radicalBig = 8730, i.radicalBigg = 8730, i.radicalbigg = 8730, i.radicalbt = 8730, i.radicaltp = 8730, i.radicalvertex = 8730, i.slashbig = 47, i.slashBig = 47, i.slashBigg = 47, i.slashbigg = 47, i.summationdisplay = 8721, i.summationtext = 8721, i.tildewide = 732, i.tildewider = 732, i.tildewidest = 732, i.uniondisplay = 8899, i.unionmultidisplay = 8846, i.unionmultitext = 8846, i.unionsqdisplay = 8852, i.unionsqtext = 8852, i.uniontext = 8899, i.vextenddouble = 8741, i.vextendsingle = 8739;
}), WP = oi(function(i) {
  i.space = 32, i.a1 = 9985, i.a2 = 9986, i.a202 = 9987, i.a3 = 9988, i.a4 = 9742, i.a5 = 9990, i.a119 = 9991, i.a118 = 9992, i.a117 = 9993, i.a11 = 9755, i.a12 = 9758, i.a13 = 9996, i.a14 = 9997, i.a15 = 9998, i.a16 = 9999, i.a105 = 1e4, i.a17 = 10001, i.a18 = 10002, i.a19 = 10003, i.a20 = 10004, i.a21 = 10005, i.a22 = 10006, i.a23 = 10007, i.a24 = 10008, i.a25 = 10009, i.a26 = 10010, i.a27 = 10011, i.a28 = 10012, i.a6 = 10013, i.a7 = 10014, i.a8 = 10015, i.a9 = 10016, i.a10 = 10017, i.a29 = 10018, i.a30 = 10019, i.a31 = 10020, i.a32 = 10021, i.a33 = 10022, i.a34 = 10023, i.a35 = 9733, i.a36 = 10025, i.a37 = 10026, i.a38 = 10027, i.a39 = 10028, i.a40 = 10029, i.a41 = 10030, i.a42 = 10031, i.a43 = 10032, i.a44 = 10033, i.a45 = 10034, i.a46 = 10035, i.a47 = 10036, i.a48 = 10037, i.a49 = 10038, i.a50 = 10039, i.a51 = 10040, i.a52 = 10041, i.a53 = 10042, i.a54 = 10043, i.a55 = 10044, i.a56 = 10045, i.a57 = 10046, i.a58 = 10047, i.a59 = 10048, i.a60 = 10049, i.a61 = 10050, i.a62 = 10051, i.a63 = 10052, i.a64 = 10053, i.a65 = 10054, i.a66 = 10055, i.a67 = 10056, i.a68 = 10057, i.a69 = 10058, i.a70 = 10059, i.a71 = 9679, i.a72 = 10061, i.a73 = 9632, i.a74 = 10063, i.a203 = 10064, i.a75 = 10065, i.a204 = 10066, i.a76 = 9650, i.a77 = 9660, i.a78 = 9670, i.a79 = 10070, i.a81 = 9687, i.a82 = 10072, i.a83 = 10073, i.a84 = 10074, i.a97 = 10075, i.a98 = 10076, i.a99 = 10077, i.a100 = 10078, i.a101 = 10081, i.a102 = 10082, i.a103 = 10083, i.a104 = 10084, i.a106 = 10085, i.a107 = 10086, i.a108 = 10087, i.a112 = 9827, i.a111 = 9830, i.a110 = 9829, i.a109 = 9824, i.a120 = 9312, i.a121 = 9313, i.a122 = 9314, i.a123 = 9315, i.a124 = 9316, i.a125 = 9317, i.a126 = 9318, i.a127 = 9319, i.a128 = 9320, i.a129 = 9321, i.a130 = 10102, i.a131 = 10103, i.a132 = 10104, i.a133 = 10105, i.a134 = 10106, i.a135 = 10107, i.a136 = 10108, i.a137 = 10109, i.a138 = 10110, i.a139 = 10111, i.a140 = 10112, i.a141 = 10113, i.a142 = 10114, i.a143 = 10115, i.a144 = 10116, i.a145 = 10117, i.a146 = 10118, i.a147 = 10119, i.a148 = 10120, i.a149 = 10121, i.a150 = 10122, i.a151 = 10123, i.a152 = 10124, i.a153 = 10125, i.a154 = 10126, i.a155 = 10127, i.a156 = 10128, i.a157 = 10129, i.a158 = 10130, i.a159 = 10131, i.a160 = 10132, i.a161 = 8594, i.a163 = 8596, i.a164 = 8597, i.a196 = 10136, i.a165 = 10137, i.a192 = 10138, i.a166 = 10139, i.a167 = 10140, i.a168 = 10141, i.a169 = 10142, i.a170 = 10143, i.a171 = 10144, i.a172 = 10145, i.a173 = 10146, i.a162 = 10147, i.a174 = 10148, i.a175 = 10149, i.a176 = 10150, i.a177 = 10151, i.a178 = 10152, i.a179 = 10153, i.a193 = 10154, i.a180 = 10155, i.a199 = 10156, i.a181 = 10157, i.a200 = 10158, i.a182 = 10159, i.a201 = 10161, i.a183 = 10162, i.a184 = 10163, i.a197 = 10164, i.a185 = 10165, i.a194 = 10166, i.a198 = 10167, i.a186 = 10168, i.a195 = 10169, i.a187 = 10170, i.a188 = 10171, i.a189 = 10172, i.a190 = 10173, i.a191 = 10174, i.a89 = 10088, i.a90 = 10089, i.a93 = 10090, i.a94 = 10091, i.a91 = 10092, i.a92 = 10093, i.a205 = 10094, i.a85 = 10095, i.a206 = 10096, i.a86 = 10097, i.a87 = 10098, i.a88 = 10099, i.a95 = 10100, i.a96 = 10101, i[".notdef"] = 0;
}), XP = oi(function(i) {
  i[63721] = 169, i[63193] = 169, i[63720] = 174, i[63194] = 174, i[63722] = 8482, i[63195] = 8482, i[63729] = 9127, i[63730] = 9128, i[63731] = 9129, i[63740] = 9131, i[63741] = 9132, i[63742] = 9133, i[63726] = 9121, i[63727] = 9122, i[63728] = 9123, i[63737] = 9124, i[63738] = 9125, i[63739] = 9126, i[63723] = 9115, i[63724] = 9116, i[63725] = 9117, i[63734] = 9118, i[63735] = 9119, i[63736] = 9120;
});
function ef(i, t) {
  let e = t[i];
  if (e !== void 0) return e;
  if (!i) return -1;
  if (i[0] === "u") {
    const n = i.length;
    let s;
    if (n === 7 && i[1] === "n" && i[2] === "i") s = i.substring(3);
    else {
      if (!(n >= 5 && n <= 7)) return -1;
      s = i.substring(1);
    }
    if (s === s.toUpperCase() && (e = parseInt(s, 16), e >= 0))
      return e;
  }
  return -1;
}
const _6 = [[0, 127], [128, 255], [256, 383], [384, 591], [592, 687, 7424, 7551, 7552, 7615], [688, 767, 42752, 42783], [768, 879, 7616, 7679], [880, 1023], [11392, 11519], [1024, 1279, 1280, 1327, 11744, 11775, 42560, 42655], [1328, 1423], [1424, 1535], [42240, 42559], [1536, 1791, 1872, 1919], [1984, 2047], [2304, 2431], [2432, 2559], [2560, 2687], [2688, 2815], [2816, 2943], [2944, 3071], [3072, 3199], [3200, 3327], [3328, 3455], [3584, 3711], [3712, 3839], [4256, 4351, 11520, 11567], [6912, 7039], [4352, 4607], [7680, 7935, 11360, 11391, 42784, 43007], [7936, 8191], [8192, 8303, 11776, 11903], [8304, 8351], [8352, 8399], [8400, 8447], [8448, 8527], [8528, 8591], [8592, 8703, 10224, 10239, 10496, 10623, 11008, 11263], [8704, 8959, 10752, 11007, 10176, 10223, 10624, 10751], [8960, 9215], [9216, 9279], [9280, 9311], [9312, 9471], [9472, 9599], [9600, 9631], [9632, 9727], [9728, 9983], [9984, 10175], [12288, 12351], [12352, 12447], [12448, 12543, 12784, 12799], [12544, 12591, 12704, 12735], [12592, 12687], [43072, 43135], [12800, 13055], [13056, 13311], [44032, 55215], [55296, 57343], [67840, 67871], [19968, 40959, 11904, 12031, 12032, 12255, 12272, 12287, 13312, 19903, 131072, 173791, 12688, 12703], [57344, 63743], [12736, 12783, 63744, 64255, 194560, 195103], [64256, 64335], [64336, 65023], [65056, 65071], [65040, 65055], [65104, 65135], [65136, 65279], [65280, 65519], [65520, 65535], [3840, 4095], [1792, 1871], [1920, 1983], [3456, 3583], [4096, 4255], [4608, 4991, 4992, 5023, 11648, 11743], [5024, 5119], [5120, 5759], [5760, 5791], [5792, 5887], [6016, 6143], [6144, 6319], [10240, 10495], [40960, 42127], [5888, 5919, 5920, 5951, 5952, 5983, 5984, 6015], [66304, 66351], [66352, 66383], [66560, 66639], [118784, 119039, 119040, 119295, 119296, 119375], [119808, 120831], [1044480, 1048573], [65024, 65039, 917760, 917999], [917504, 917631], [6400, 6479], [6480, 6527], [6528, 6623], [6656, 6687], [11264, 11359], [11568, 11647], [19904, 19967], [43008, 43055], [65536, 65663, 65664, 65791, 65792, 65855], [65856, 65935], [66432, 66463], [66464, 66527], [66640, 66687], [66688, 66735], [67584, 67647], [68096, 68191], [119552, 119647], [73728, 74751, 74752, 74879], [119648, 119679], [7040, 7103], [7168, 7247], [7248, 7295], [43136, 43231], [43264, 43311], [43312, 43359], [43520, 43615], [65936, 65999], [66e3, 66047], [66208, 66271, 66176, 66207, 67872, 67903], [127024, 127135, 126976, 127023]];
function YP(i, t = -1) {
  if (t !== -1) {
    const e = _6[t];
    for (let n = 0, s = e.length; n < s; n += 2) if (i >= e[n] && i <= e[n + 1]) return t;
  }
  for (let e = 0, n = _6.length; e < n; e++) {
    const s = _6[e];
    for (let r = 0, a = s.length; r < a; r += 2) if (i >= s[r] && i <= s[r + 1]) return e;
  }
  return -1;
}
const KP = new RegExp("^(\\s)|(\\p{Mn})|(\\p{Cf})$", "u"), wb = /* @__PURE__ */ new Map(), lp = !0, _9 = 1, hD = 2, u3 = 4, k_ = 32, A_ = [".notdef", ".null", "nonmarkingreturn", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quotesingle", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "grave", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "Adieresis", "Aring", "Ccedilla", "Eacute", "Ntilde", "Odieresis", "Udieresis", "aacute", "agrave", "acircumflex", "adieresis", "atilde", "aring", "ccedilla", "eacute", "egrave", "ecircumflex", "edieresis", "iacute", "igrave", "icircumflex", "idieresis", "ntilde", "oacute", "ograve", "ocircumflex", "odieresis", "otilde", "uacute", "ugrave", "ucircumflex", "udieresis", "dagger", "degree", "cent", "sterling", "section", "bullet", "paragraph", "germandbls", "registered", "copyright", "trademark", "acute", "dieresis", "notequal", "AE", "Oslash", "infinity", "plusminus", "lessequal", "greaterequal", "yen", "mu", "partialdiff", "summation", "product", "pi", "integral", "ordfeminine", "ordmasculine", "Omega", "ae", "oslash", "questiondown", "exclamdown", "logicalnot", "radical", "florin", "approxequal", "Delta", "guillemotleft", "guillemotright", "ellipsis", "nonbreakingspace", "Agrave", "Atilde", "Otilde", "OE", "oe", "endash", "emdash", "quotedblleft", "quotedblright", "quoteleft", "quoteright", "divide", "lozenge", "ydieresis", "Ydieresis", "fraction", "currency", "guilsinglleft", "guilsinglright", "fi", "fl", "daggerdbl", "periodcentered", "quotesinglbase", "quotedblbase", "perthousand", "Acircumflex", "Ecircumflex", "Aacute", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Oacute", "Ocircumflex", "apple", "Ograve", "Uacute", "Ucircumflex", "Ugrave", "dotlessi", "circumflex", "tilde", "macron", "breve", "dotaccent", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "Lslash", "lslash", "Scaron", "scaron", "Zcaron", "zcaron", "brokenbar", "Eth", "eth", "Yacute", "yacute", "Thorn", "thorn", "minus", "multiply", "onesuperior", "twosuperior", "threesuperior", "onehalf", "onequarter", "threequarters", "franc", "Gbreve", "gbreve", "Idotaccent", "Scedilla", "scedilla", "Cacute", "cacute", "Ccaron", "ccaron", "dcroat"];
function uD(i, t) {
  if (t[i] !== void 0) return i;
  const e = ef(i, t);
  if (e !== -1) {
    for (const n in t) if (t[n] === e) return n;
  }
  return ue("Unable to recover a standard glyph name for: " + i), i;
}
function dD(i, t, e) {
  const n = /* @__PURE__ */ Object.create(null);
  let s, r, a;
  const o = !!(i.flags & u3);
  if (i.isInternalFont)
    for (a = t, r = 0; r < a.length; r++)
      s = e.indexOf(a[r]), n[r] = s >= 0 ? s : 0;
  else if (i.baseEncodingName)
    for (a = op(i.baseEncodingName), r = 0; r < a.length; r++)
      s = e.indexOf(a[r]), n[r] = s >= 0 ? s : 0;
  else if (o) for (r in t) n[r] = t[r];
  else
    for (a = Pl, r = 0; r < a.length; r++)
      s = e.indexOf(a[r]), n[r] = s >= 0 ? s : 0;
  const l = i.differences;
  let c;
  if (l) for (r in l) {
    const h = l[r];
    if (s = e.indexOf(h), s === -1) {
      c || (c = Ga());
      const u = uD(h, c);
      u !== h && (s = e.indexOf(u));
    }
    n[r] = s >= 0 ? s : 0;
  }
  return n;
}
function Sg(i) {
  return i.replaceAll(/[,_]/g, "-").replaceAll(/\s/g, "");
}
const ZP = oi((i) => {
  i[8211] = 65074, i[8212] = 65073, i[8229] = 65072, i[8230] = 65049, i[12289] = 65041, i[12290] = 65042, i[12296] = 65087, i[12297] = 65088, i[12298] = 65085, i[12299] = 65086, i[12300] = 65089, i[12301] = 65090, i[12302] = 65091, i[12303] = 65092, i[12304] = 65083, i[12305] = 65084, i[12308] = 65081, i[12309] = 65082, i[12310] = 65047, i[12311] = 65048, i[65103] = 65076, i[65281] = 65045, i[65288] = 65077, i[65289] = 65078, i[65292] = 65040, i[65306] = 65043, i[65307] = 65044, i[65311] = 65046, i[65339] = 65095, i[65341] = 65096, i[65343] = 65075, i[65371] = 65079, i[65373] = 65080;
}), JP = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron"], QP = [".notdef", "space", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "onequarter", "onehalf", "threequarters", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall"], tN = [".notdef", "space", "dollaroldstyle", "dollarsuperior", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "comma", "hyphen", "period", "fraction", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "colon", "semicolon", "commasuperior", "threequartersemdash", "periodsuperior", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "fi", "fl", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "hyphensuperior", "colonmonetary", "onefitted", "rupiah", "centoldstyle", "figuredash", "hypheninferior", "onequarter", "onehalf", "threequarters", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "onesuperior", "twosuperior", "threesuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior"], x9 = [".notdef", "space", "exclam", "quotedbl", "numbersign", "dollar", "percent", "ampersand", "quoteright", "parenleft", "parenright", "asterisk", "plus", "comma", "hyphen", "period", "slash", "zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "colon", "semicolon", "less", "equal", "greater", "question", "at", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z", "bracketleft", "backslash", "bracketright", "asciicircum", "underscore", "quoteleft", "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z", "braceleft", "bar", "braceright", "asciitilde", "exclamdown", "cent", "sterling", "fraction", "yen", "florin", "section", "currency", "quotesingle", "quotedblleft", "guillemotleft", "guilsinglleft", "guilsinglright", "fi", "fl", "endash", "dagger", "daggerdbl", "periodcentered", "paragraph", "bullet", "quotesinglbase", "quotedblbase", "quotedblright", "guillemotright", "ellipsis", "perthousand", "questiondown", "grave", "acute", "circumflex", "tilde", "macron", "breve", "dotaccent", "dieresis", "ring", "cedilla", "hungarumlaut", "ogonek", "caron", "emdash", "AE", "ordfeminine", "Lslash", "Oslash", "OE", "ordmasculine", "ae", "dotlessi", "lslash", "oslash", "oe", "germandbls", "onesuperior", "logicalnot", "mu", "trademark", "Eth", "onehalf", "plusminus", "Thorn", "onequarter", "divide", "brokenbar", "degree", "thorn", "threequarters", "twosuperior", "registered", "minus", "eth", "multiply", "threesuperior", "copyright", "Aacute", "Acircumflex", "Adieresis", "Agrave", "Aring", "Atilde", "Ccedilla", "Eacute", "Ecircumflex", "Edieresis", "Egrave", "Iacute", "Icircumflex", "Idieresis", "Igrave", "Ntilde", "Oacute", "Ocircumflex", "Odieresis", "Ograve", "Otilde", "Scaron", "Uacute", "Ucircumflex", "Udieresis", "Ugrave", "Yacute", "Ydieresis", "Zcaron", "aacute", "acircumflex", "adieresis", "agrave", "aring", "atilde", "ccedilla", "eacute", "ecircumflex", "edieresis", "egrave", "iacute", "icircumflex", "idieresis", "igrave", "ntilde", "oacute", "ocircumflex", "odieresis", "ograve", "otilde", "scaron", "uacute", "ucircumflex", "udieresis", "ugrave", "yacute", "ydieresis", "zcaron", "exclamsmall", "Hungarumlautsmall", "dollaroldstyle", "dollarsuperior", "ampersandsmall", "Acutesmall", "parenleftsuperior", "parenrightsuperior", "twodotenleader", "onedotenleader", "zerooldstyle", "oneoldstyle", "twooldstyle", "threeoldstyle", "fouroldstyle", "fiveoldstyle", "sixoldstyle", "sevenoldstyle", "eightoldstyle", "nineoldstyle", "commasuperior", "threequartersemdash", "periodsuperior", "questionsmall", "asuperior", "bsuperior", "centsuperior", "dsuperior", "esuperior", "isuperior", "lsuperior", "msuperior", "nsuperior", "osuperior", "rsuperior", "ssuperior", "tsuperior", "ff", "ffi", "ffl", "parenleftinferior", "parenrightinferior", "Circumflexsmall", "hyphensuperior", "Gravesmall", "Asmall", "Bsmall", "Csmall", "Dsmall", "Esmall", "Fsmall", "Gsmall", "Hsmall", "Ismall", "Jsmall", "Ksmall", "Lsmall", "Msmall", "Nsmall", "Osmall", "Psmall", "Qsmall", "Rsmall", "Ssmall", "Tsmall", "Usmall", "Vsmall", "Wsmall", "Xsmall", "Ysmall", "Zsmall", "colonmonetary", "onefitted", "rupiah", "Tildesmall", "exclamdownsmall", "centoldstyle", "Lslashsmall", "Scaronsmall", "Zcaronsmall", "Dieresissmall", "Brevesmall", "Caronsmall", "Dotaccentsmall", "Macronsmall", "figuredash", "hypheninferior", "Ogoneksmall", "Ringsmall", "Cedillasmall", "questiondownsmall", "oneeighth", "threeeighths", "fiveeighths", "seveneighths", "onethird", "twothirds", "zerosuperior", "foursuperior", "fivesuperior", "sixsuperior", "sevensuperior", "eightsuperior", "ninesuperior", "zeroinferior", "oneinferior", "twoinferior", "threeinferior", "fourinferior", "fiveinferior", "sixinferior", "seveninferior", "eightinferior", "nineinferior", "centinferior", "dollarinferior", "periodinferior", "commainferior", "Agravesmall", "Aacutesmall", "Acircumflexsmall", "Atildesmall", "Adieresissmall", "Aringsmall", "AEsmall", "Ccedillasmall", "Egravesmall", "Eacutesmall", "Ecircumflexsmall", "Edieresissmall", "Igravesmall", "Iacutesmall", "Icircumflexsmall", "Idieresissmall", "Ethsmall", "Ntildesmall", "Ogravesmall", "Oacutesmall", "Ocircumflexsmall", "Otildesmall", "Odieresissmall", "OEsmall", "Oslashsmall", "Ugravesmall", "Uacutesmall", "Ucircumflexsmall", "Udieresissmall", "Yacutesmall", "Thornsmall", "Ydieresissmall", "001.000", "001.001", "001.002", "001.003", "Black", "Bold", "Book", "Light", "Medium", "Regular", "Roman", "Semibold"], x6 = 391, j1 = [null, { id: "hstem", min: 2, stackClearing: !0, stem: !0 }, null, { id: "vstem", min: 2, stackClearing: !0, stem: !0 }, { id: "vmoveto", min: 1, stackClearing: !0 }, { id: "rlineto", min: 2, resetStack: !0 }, { id: "hlineto", min: 1, resetStack: !0 }, { id: "vlineto", min: 1, resetStack: !0 }, { id: "rrcurveto", min: 6, resetStack: !0 }, null, { id: "callsubr", min: 1, undefStack: !0 }, { id: "return", min: 0, undefStack: !0 }, null, null, { id: "endchar", min: 0, stackClearing: !0 }, null, null, null, { id: "hstemhm", min: 2, stackClearing: !0, stem: !0 }, { id: "hintmask", min: 0, stackClearing: !0 }, { id: "cntrmask", min: 0, stackClearing: !0 }, { id: "rmoveto", min: 2, stackClearing: !0 }, { id: "hmoveto", min: 1, stackClearing: !0 }, { id: "vstemhm", min: 2, stackClearing: !0, stem: !0 }, { id: "rcurveline", min: 8, resetStack: !0 }, { id: "rlinecurve", min: 8, resetStack: !0 }, { id: "vvcurveto", min: 4, resetStack: !0 }, { id: "hhcurveto", min: 4, resetStack: !0 }, null, { id: "callgsubr", min: 1, undefStack: !0 }, { id: "vhcurveto", min: 4, resetStack: !0 }, { id: "hvcurveto", min: 4, resetStack: !0 }], eN = [null, null, null, { id: "and", min: 2, stackDelta: -1 }, { id: "or", min: 2, stackDelta: -1 }, { id: "not", min: 1, stackDelta: 0 }, null, null, null, { id: "abs", min: 1, stackDelta: 0 }, { id: "add", min: 2, stackDelta: -1, stackFn(i, t) {
  i[t - 2] = i[t - 2] + i[t - 1];
} }, { id: "sub", min: 2, stackDelta: -1, stackFn(i, t) {
  i[t - 2] = i[t - 2] - i[t - 1];
} }, { id: "div", min: 2, stackDelta: -1, stackFn(i, t) {
  i[t - 2] = i[t - 2] / i[t - 1];
} }, null, { id: "neg", min: 1, stackDelta: 0, stackFn(i, t) {
  i[t - 1] = -i[t - 1];
} }, { id: "eq", min: 2, stackDelta: -1 }, null, null, { id: "drop", min: 1, stackDelta: -1 }, null, { id: "put", min: 2, stackDelta: -2 }, { id: "get", min: 1, stackDelta: 0 }, { id: "ifelse", min: 4, stackDelta: -3 }, { id: "random", min: 0, stackDelta: 1 }, { id: "mul", min: 2, stackDelta: -1, stackFn(i, t) {
  i[t - 2] = i[t - 2] * i[t - 1];
} }, null, { id: "sqrt", min: 1, stackDelta: 0 }, { id: "dup", min: 1, stackDelta: 1 }, { id: "exch", min: 2, stackDelta: 0 }, { id: "index", min: 2, stackDelta: 0 }, { id: "roll", min: 3, stackDelta: -2 }, null, null, null, { id: "hflex", min: 7, resetStack: !0 }, { id: "flex", min: 13, resetStack: !0 }, { id: "hflex1", min: 9, resetStack: !0 }, { id: "flex1", min: 11, resetStack: !0 }];
class Ky {
  constructor(t, e, n) {
    this.bytes = t.getBytes(), this.properties = e, this.seacAnalysisEnabled = !!n;
  }
  parse() {
    const t = this.properties, e = new fD();
    this.cff = e;
    const n = this.parseHeader(), s = this.parseIndex(n.endPos), r = this.parseIndex(s.endPos), a = this.parseIndex(r.endPos), o = this.parseIndex(a.endPos), l = this.parseDict(r.obj.get(0)), c = this.createDict(cp, l, e.strings);
    e.header = n.obj, e.names = this.parseNameIndex(s.obj), e.strings = this.parseStringIndex(a.obj), e.topDict = c, e.globalSubrIndex = o.obj, this.parsePrivateDict(e.topDict), e.isCIDFont = c.hasName("ROS");
    const h = c.getByName("CharStrings"), u = this.parseIndex(h).obj, f = c.getByName("FontMatrix");
    f && (t.fontMatrix = f);
    const d = c.getByName("FontBBox");
    d && (t.ascent = Math.max(d[3], d[1]), t.descent = Math.min(d[1], d[3]), t.ascentScaled = !0);
    let p, g;
    if (e.isCIDFont) {
      const y = this.parseIndex(c.getByName("FDArray")).obj;
      for (let v = 0, w = y.count; v < w; ++v) {
        const _ = y.get(v), x = this.createDict(cp, this.parseDict(_), e.strings);
        this.parsePrivateDict(x), e.fdArray.push(x);
      }
      g = null, p = this.parseCharsets(c.getByName("charset"), u.count, e.strings, !0), e.fdSelect = this.parseFDSelect(c.getByName("FDSelect"), u.count);
    } else
      p = this.parseCharsets(c.getByName("charset"), u.count, e.strings, !1), g = this.parseEncoding(c.getByName("Encoding"), t, e.strings, p.charset);
    e.charset = p, e.encoding = g;
    const b = this.parseCharStrings({ charStrings: u, localSubrIndex: c.privateDict.subrsIndex, globalSubrIndex: o.obj, fdSelect: e.fdSelect, fdArray: e.fdArray, privateDict: c.privateDict });
    return e.charStrings = b.charStrings, e.seacs = b.seacs, e.widths = b.widths, e;
  }
  parseHeader() {
    let t = this.bytes;
    const e = t.length;
    let n = 0;
    for (; n < e && t[n] !== 1; ) ++n;
    if (n >= e) throw new ht("Invalid CFF header");
    n !== 0 && (ue("cff data is shifted"), t = t.subarray(n), this.bytes = t);
    const s = t[0], r = t[1], a = t[2], o = t[3];
    return { obj: new pD(s, r, a, o), endPos: a };
  }
  parseDict(t) {
    let e = 0;
    function n() {
      let o = t[e++];
      return o === 30 ? function() {
        let c = "";
        const u = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9", ".", "E", "E-", null, "-"], f = t.length;
        for (; e < f; ) {
          const d = t[e++], p = d >> 4, g = 15 & d;
          if (p === 15 || (c += u[p], g === 15)) break;
          c += u[g];
        }
        return parseFloat(c);
      }() : o === 28 ? (o = Fl(t, e), e += 2, o) : o === 29 ? (o = t[e++], o = o << 8 | t[e++], o = o << 8 | t[e++], o = o << 8 | t[e++], o) : o >= 32 && o <= 246 ? o - 139 : o >= 247 && o <= 250 ? 256 * (o - 247) + t[e++] + 108 : o >= 251 && o <= 254 ? -256 * (o - 251) - t[e++] - 108 : (H('CFFParser_parseDict: "' + o + '" is a reserved command.'), NaN);
    }
    let s = [];
    const r = [];
    e = 0;
    const a = t.length;
    for (; e < a; ) {
      let o = t[e];
      o <= 21 ? (o === 12 && (o = o << 8 | t[++e]), r.push([o, s]), s = [], ++e) : s.push(n());
    }
    return r;
  }
  parseIndex(t) {
    const e = new n0(), n = this.bytes, s = n[t++] << 8 | n[t++], r = [];
    let a, o, l = t;
    if (s !== 0) {
      const c = n[t++], h = t + (s + 1) * c - 1;
      for (a = 0, o = s + 1; a < o; ++a) {
        let u = 0;
        for (let f = 0; f < c; ++f)
          u <<= 8, u += n[t++];
        r.push(h + u);
      }
      l = r[s];
    }
    for (a = 0, o = r.length - 1; a < o; ++a) {
      const c = r[a], h = r[a + 1];
      e.add(n.subarray(c, h));
    }
    return { obj: e, endPos: l };
  }
  parseNameIndex(t) {
    const e = [];
    for (let n = 0, s = t.count; n < s; ++n) {
      const r = t.get(n);
      e.push(Is(r));
    }
    return e;
  }
  parseStringIndex(t) {
    const e = new Zy();
    for (let n = 0, s = t.count; n < s; ++n) {
      const r = t.get(n);
      e.add(Is(r));
    }
    return e;
  }
  createDict(t, e, n) {
    const s = new t(n);
    for (const [r, a] of e) s.setByKey(r, a);
    return s;
  }
  parseCharString(t, e, n, s) {
    if (!e || t.callDepth > 10) return !1;
    let r = t.stackSize;
    const a = t.stack;
    let o = e.length;
    for (let l = 0; l < o; ) {
      const c = e[l++];
      let h = null;
      if (c === 12) {
        const u = e[l++];
        u === 0 ? (e[l - 2] = 139, e[l - 1] = 22, r = 0) : h = eN[u];
      } else if (c === 28)
        a[r] = Fl(e, l), l += 2, r++;
      else if (c === 14) {
        if (r >= 4 && (r -= 4, this.seacAnalysisEnabled))
          return t.seac = a.slice(r, r + 4), !1;
        h = j1[c];
      } else if (c >= 32 && c <= 246)
        a[r] = c - 139, r++;
      else if (c >= 247 && c <= 254)
        a[r] = c < 251 ? (c - 247 << 8) + e[l] + 108 : -(c - 251 << 8) - e[l] - 108, l++, r++;
      else if (c === 255)
        a[r] = (e[l] << 24 | e[l + 1] << 16 | e[l + 2] << 8 | e[l + 3]) / 65536, l += 4, r++;
      else if (c === 19 || c === 20) {
        if (t.hints += r >> 1, t.hints === 0) {
          e.copyWithin(l - 1, l, -1), l -= 1, o -= 1;
          continue;
        }
        l += t.hints + 7 >> 3, r %= 2, h = j1[c];
      } else {
        if (c === 10 || c === 29) {
          const u = c === 10 ? n : s;
          if (!u)
            return h = j1[c], H("Missing subrsIndex for " + h.id), !1;
          let f = 32768;
          u.count < 1240 ? f = 107 : u.count < 33900 && (f = 1131);
          const d = a[--r] + f;
          if (d < 0 || d >= u.count || isNaN(d))
            return h = j1[c], H("Out of bounds subrIndex for " + h.id), !1;
          if (t.stackSize = r, t.callDepth++, !this.parseCharString(t, u.get(d), n, s)) return !1;
          t.callDepth--, r = t.stackSize;
          continue;
        }
        if (c === 11)
          return t.stackSize = r, !0;
        if (c === 0 && l === e.length)
          e[l - 1] = 14, h = j1[14];
        else {
          if (c === 9) {
            e.copyWithin(l - 1, l, -1), l -= 1, o -= 1;
            continue;
          }
          h = j1[c];
        }
      }
      if (h) {
        if (h.stem && (t.hints += r >> 1, c === 3 || c === 23 ? t.hasVStems = !0 : t.hasVStems && (c === 1 || c === 18) && (H("CFF stem hints are in wrong order"), e[l - 1] = c === 1 ? 3 : 23)), "min" in h && !t.undefStack && r < h.min)
          return H("Not enough parameters for " + h.id + "; actual: " + r + ", expected: " + h.min), r === 0 ? (e[l - 1] = 14, !0) : !1;
        t.firstStackClearing && h.stackClearing && (t.firstStackClearing = !1, r -= h.min, r >= 2 && h.stem ? r %= 2 : r > 1 && H("Found too many parameters for stack-clearing command"), r > 0 && (t.width = a[r - 1])), "stackDelta" in h ? ("stackFn" in h && h.stackFn(a, r), r += h.stackDelta) : h.stackClearing ? r = 0 : h.resetStack ? (r = 0, t.undefStack = !1) : h.undefStack && (r = 0, t.undefStack = !0, t.firstStackClearing = !1);
      }
    }
    return o < e.length && e.fill(14, o), t.stackSize = r, !0;
  }
  parseCharStrings({ charStrings: t, localSubrIndex: e, globalSubrIndex: n, fdSelect: s, fdArray: r, privateDict: a }) {
    const o = [], l = [], c = t.count;
    for (let h = 0; h < c; h++) {
      const u = t.get(h), f = { callDepth: 0, stackSize: 0, stack: [], undefStack: !0, hints: 0, firstStackClearing: !0, seac: null, width: null, hasVStems: !1 };
      let d = !0, p = null, g = a;
      if (s && r.length) {
        const b = s.getFDIndex(h);
        b === -1 && (H("Glyph index is not in fd select."), d = !1), b >= r.length && (H("Invalid fd index for glyph index."), d = !1), d && (g = r[b].privateDict, p = g.subrsIndex);
      } else e && (p = e);
      if (d && (d = this.parseCharString(f, u, p, n)), f.width !== null) {
        const b = g.getByName("nominalWidthX");
        l[h] = b + f.width;
      } else {
        const b = g.getByName("defaultWidthX");
        l[h] = b;
      }
      f.seac !== null && (o[h] = f.seac), d || t.set(h, new Uint8Array([14]));
    }
    return { charStrings: t, seacs: o, widths: l };
  }
  emptyPrivateDictionary(t) {
    const e = this.createDict(hp, [], t.strings);
    t.setByKey(18, [0, 0]), t.privateDict = e;
  }
  parsePrivateDict(t) {
    if (!t.hasName("Private")) {
      this.emptyPrivateDictionary(t);
      return;
    }
    const e = t.getByName("Private");
    if (!Array.isArray(e) || e.length !== 2) {
      t.removeByName("Private");
      return;
    }
    const n = e[0], s = e[1];
    if (n === 0 || s >= this.bytes.length) {
      this.emptyPrivateDictionary(t);
      return;
    }
    const r = s + n, a = this.bytes.subarray(s, r), o = this.parseDict(a), l = this.createDict(hp, o, t.strings);
    if (t.privateDict = l, l.getByName("ExpansionFactor") === 0 && l.setByName("ExpansionFactor", 0.06), !l.getByName("Subrs")) return;
    const c = l.getByName("Subrs"), h = s + c;
    if (c === 0 || h >= this.bytes.length) {
      this.emptyPrivateDictionary(t);
      return;
    }
    const u = this.parseIndex(h);
    l.subrsIndex = u.obj;
  }
  parseCharsets(t, e, n, s) {
    if (t === 0) return new w2(!0, k6.ISO_ADOBE, JP);
    if (t === 1) return new w2(!0, k6.EXPERT, QP);
    if (t === 2) return new w2(!0, k6.EXPERT_SUBSET, tN);
    const r = this.bytes, a = t, o = r[t++], l = [s ? 0 : ".notdef"];
    let c, h, u;
    switch (e -= 1, o) {
      case 0:
        for (u = 0; u < e; u++)
          c = r[t++] << 8 | r[t++], l.push(s ? c : n.get(c));
        break;
      case 1:
        for (; l.length <= e; )
          for (c = r[t++] << 8 | r[t++], h = r[t++], u = 0; u <= h; u++) l.push(s ? c++ : n.get(c++));
        break;
      case 2:
        for (; l.length <= e; )
          for (c = r[t++] << 8 | r[t++], h = r[t++] << 8 | r[t++], u = 0; u <= h; u++) l.push(s ? c++ : n.get(c++));
        break;
      default:
        throw new ht("Unknown charset format");
    }
    const f = t, d = r.subarray(a, f);
    return new w2(!1, o, l, d);
  }
  parseEncoding(t, e, n, s) {
    const r = /* @__PURE__ */ Object.create(null), a = this.bytes;
    let o, l, c, h = !1, u = null;
    if (t === 0 || t === 1) {
      h = !0, o = t;
      const f = t ? cD : Pl;
      for (l = 0, c = s.length; l < c; l++) {
        const d = f.indexOf(s[l]);
        d !== -1 && (r[d] = l);
      }
    } else {
      const f = t;
      switch (o = a[t++], 127 & o) {
        case 0:
          const p = a[t++];
          for (l = 1; l <= p; l++) r[a[t++]] = l;
          break;
        case 1:
          const g = a[t++];
          let b = 1;
          for (l = 0; l < g; l++) {
            const y = a[t++], v = a[t++];
            for (let w = y; w <= y + v; w++) r[w] = b++;
          }
          break;
        default:
          throw new ht(`Unknown encoding format: ${o} in CFF`);
      }
      const d = t;
      128 & o && (a[f] &= 127, function() {
        const g = a[t++];
        for (l = 0; l < g; l++) {
          const b = a[t++], y = (a[t++] << 8) + (255 & a[t++]);
          r[b] = s.indexOf(n.get(y));
        }
      }()), u = a.subarray(f, d);
    }
    return o &= 127, new sN(h, o, r, u);
  }
  parseFDSelect(t, e) {
    const n = this.bytes, s = n[t++], r = [];
    let a;
    switch (s) {
      case 0:
        for (a = 0; a < e; ++a) {
          const l = n[t++];
          r.push(l);
        }
        break;
      case 3:
        const o = n[t++] << 8 | n[t++];
        for (a = 0; a < o; ++a) {
          let l = n[t++] << 8 | n[t++];
          a === 0 && l !== 0 && (H("parseFDSelect: The first range must have a first GID of 0 -- trying to recover."), l = 0);
          const c = n[t++], h = n[t] << 8 | n[t + 1];
          for (let u = l; u < h; ++u) r.push(c);
        }
        t += 2;
        break;
      default:
        throw new ht(`parseFDSelect: Unknown format "${s}".`);
    }
    if (r.length !== e) throw new ht("parseFDSelect: Invalid font data.");
    return new rN(s, r);
  }
}
class fD {
  constructor() {
    this.header = null, this.names = [], this.topDict = null, this.strings = new Zy(), this.globalSubrIndex = null, this.encoding = null, this.charset = null, this.charStrings = null, this.fdArray = [], this.fdSelect = null, this.isCIDFont = !1;
  }
  duplicateFirstGlyph() {
    if (this.charStrings.count >= 65535) {
      H("Not enough space in charstrings to duplicate first glyph.");
      return;
    }
    const t = this.charStrings.get(0);
    this.charStrings.add(t), this.isCIDFont && this.fdSelect.fdSelect.push(this.fdSelect.fdSelect[0]);
  }
  hasGlyphId(t) {
    return t < 0 || t >= this.charStrings.count ? !1 : this.charStrings.get(t).length > 0;
  }
}
class pD {
  constructor(t, e, n, s) {
    this.major = t, this.minor = e, this.hdrSize = n, this.offSize = s;
  }
}
class Zy {
  constructor() {
    this.strings = [];
  }
  get(t) {
    return t >= 0 && t <= 390 ? x9[t] : t - x6 <= this.strings.length ? this.strings[t - x6] : x9[0];
  }
  getSID(t) {
    let e = x9.indexOf(t);
    return e !== -1 ? e : (e = this.strings.indexOf(t), e !== -1 ? e + x6 : -1);
  }
  add(t) {
    this.strings.push(t);
  }
  get count() {
    return this.strings.length;
  }
}
class n0 {
  constructor() {
    this.objects = [], this.length = 0;
  }
  add(t) {
    this.length += t.length, this.objects.push(t);
  }
  set(t, e) {
    this.length += e.length - this.objects[t].length, this.objects[t] = e;
  }
  get(t) {
    return this.objects[t];
  }
  get count() {
    return this.objects.length;
  }
}
class mD {
  constructor(t, e) {
    this.keyToNameMap = t.keyToNameMap, this.nameToKeyMap = t.nameToKeyMap, this.defaults = t.defaults, this.types = t.types, this.opcodes = t.opcodes, this.order = t.order, this.strings = e, this.values = /* @__PURE__ */ Object.create(null);
  }
  setByKey(t, e) {
    if (!(t in this.keyToNameMap)) return !1;
    if (e.length === 0) return !0;
    for (const s of e) if (isNaN(s))
      return H(`Invalid CFFDict value: "${e}" for key "${t}".`), !0;
    const n = this.types[t];
    return n !== "num" && n !== "sid" && n !== "offset" || (e = e[0]), this.values[t] = e, !0;
  }
  setByName(t, e) {
    if (!(t in this.nameToKeyMap)) throw new ht(`Invalid dictionary name "${t}"`);
    this.values[this.nameToKeyMap[t]] = e;
  }
  hasName(t) {
    return this.nameToKeyMap[t] in this.values;
  }
  getByName(t) {
    if (!(t in this.nameToKeyMap)) throw new ht(`Invalid dictionary name ${t}"`);
    const e = this.nameToKeyMap[t];
    return e in this.values ? this.values[e] : this.defaults[e];
  }
  removeByName(t) {
    delete this.values[this.nameToKeyMap[t]];
  }
  static createTables(t) {
    const e = { keyToNameMap: {}, nameToKeyMap: {}, defaults: {}, types: {}, opcodes: {}, order: [] };
    for (const n of t) {
      const s = Array.isArray(n[0]) ? (n[0][0] << 8) + n[0][1] : n[0];
      e.keyToNameMap[s] = n[1], e.nameToKeyMap[n[1]] = s, e.types[s] = n[2], e.defaults[s] = n[3], e.opcodes[s] = Array.isArray(n[0]) ? n[0] : [n[0]], e.order.push(s);
    }
    return e;
  }
}
const iN = [[[12, 30], "ROS", ["sid", "sid", "num"], null], [[12, 20], "SyntheticBase", "num", null], [0, "version", "sid", null], [1, "Notice", "sid", null], [[12, 0], "Copyright", "sid", null], [2, "FullName", "sid", null], [3, "FamilyName", "sid", null], [4, "Weight", "sid", null], [[12, 1], "isFixedPitch", "num", 0], [[12, 2], "ItalicAngle", "num", 0], [[12, 3], "UnderlinePosition", "num", -100], [[12, 4], "UnderlineThickness", "num", 50], [[12, 5], "PaintType", "num", 0], [[12, 6], "CharstringType", "num", 2], [[12, 7], "FontMatrix", ["num", "num", "num", "num", "num", "num"], [1e-3, 0, 0, 1e-3, 0, 0]], [13, "UniqueID", "num", null], [5, "FontBBox", ["num", "num", "num", "num"], [0, 0, 0, 0]], [[12, 8], "StrokeWidth", "num", 0], [14, "XUID", "array", null], [15, "charset", "offset", 0], [16, "Encoding", "offset", 0], [17, "CharStrings", "offset", 0], [18, "Private", ["offset", "offset"], null], [[12, 21], "PostScript", "sid", null], [[12, 22], "BaseFontName", "sid", null], [[12, 23], "BaseFontBlend", "delta", null], [[12, 31], "CIDFontVersion", "num", 0], [[12, 32], "CIDFontRevision", "num", 0], [[12, 33], "CIDFontType", "num", 0], [[12, 34], "CIDCount", "num", 8720], [[12, 35], "UIDBase", "num", null], [[12, 37], "FDSelect", "offset", null], [[12, 36], "FDArray", "offset", null], [[12, 38], "FontName", "sid", null]];
class cp extends mD {
  static get tables() {
    return At(this, "tables", this.createTables(iN));
  }
  constructor(t) {
    super(cp.tables, t), this.privateDict = null;
  }
}
const nN = [[6, "BlueValues", "delta", null], [7, "OtherBlues", "delta", null], [8, "FamilyBlues", "delta", null], [9, "FamilyOtherBlues", "delta", null], [[12, 9], "BlueScale", "num", 0.039625], [[12, 10], "BlueShift", "num", 7], [[12, 11], "BlueFuzz", "num", 1], [10, "StdHW", "num", null], [11, "StdVW", "num", null], [[12, 12], "StemSnapH", "delta", null], [[12, 13], "StemSnapV", "delta", null], [[12, 14], "ForceBold", "num", 0], [[12, 17], "LanguageGroup", "num", 0], [[12, 18], "ExpansionFactor", "num", 0.06], [[12, 19], "initialRandomSeed", "num", 0], [20, "defaultWidthX", "num", 0], [21, "nominalWidthX", "num", 0], [19, "Subrs", "offset", null]];
class hp extends mD {
  static get tables() {
    return At(this, "tables", this.createTables(nN));
  }
  constructor(t) {
    super(hp.tables, t), this.subrsIndex = null;
  }
}
const k6 = { ISO_ADOBE: 0, EXPERT: 1, EXPERT_SUBSET: 2 };
class w2 {
  constructor(t, e, n, s) {
    this.predefined = t, this.format = e, this.charset = n, this.raw = s;
  }
}
class sN {
  constructor(t, e, n, s) {
    this.predefined = t, this.format = e, this.encoding = n, this.raw = s;
  }
}
class rN {
  constructor(t, e) {
    this.format = t, this.fdSelect = e;
  }
  getFDIndex(t) {
    return t < 0 || t >= this.fdSelect.length ? -1 : this.fdSelect[t];
  }
}
class S_ {
  constructor() {
    this.offsets = /* @__PURE__ */ Object.create(null);
  }
  isTracking(t) {
    return t in this.offsets;
  }
  track(t, e) {
    if (t in this.offsets) throw new ht(`Already tracking location of ${t}`);
    this.offsets[t] = e;
  }
  offset(t) {
    for (const e in this.offsets) this.offsets[e] += t;
  }
  setEntryLocation(t, e, n) {
    if (!(t in this.offsets)) throw new ht(`Not tracking location of ${t}`);
    const s = n.data, r = this.offsets[t];
    for (let a = 0, o = e.length; a < o; ++a) {
      const l = 5 * a + r, c = l + 1, h = l + 2, u = l + 3, f = l + 4;
      if (s[l] !== 29 || s[c] !== 0 || s[h] !== 0 || s[u] !== 0 || s[f] !== 0) throw new ht("writing to an offset that is not empty");
      const d = e[a];
      s[l] = 29, s[c] = d >> 24 & 255, s[h] = d >> 16 & 255, s[u] = d >> 8 & 255, s[f] = 255 & d;
    }
  }
}
class Cg {
  constructor(t) {
    this.cff = t;
  }
  compile() {
    const t = this.cff, e = { data: [], length: 0, add(f) {
      try {
        this.data.push(...f);
      } catch {
        this.data = this.data.concat(f);
      }
      this.length = this.data.length;
    } }, n = this.compileHeader(t.header);
    e.add(n);
    const s = this.compileNameIndex(t.names);
    if (e.add(s), t.isCIDFont && t.topDict.hasName("FontMatrix")) {
      const f = t.topDict.getByName("FontMatrix");
      t.topDict.removeByName("FontMatrix");
      for (const d of t.fdArray) {
        let p = f.slice(0);
        d.hasName("FontMatrix") && (p = Ee.transform(p, d.getByName("FontMatrix"))), d.setByName("FontMatrix", p);
      }
    }
    const r = t.topDict.getByName("XUID");
    (r == null ? void 0 : r.length) > 16 && t.topDict.removeByName("XUID"), t.topDict.setByName("charset", 0);
    let a = this.compileTopDicts([t.topDict], e.length, t.isCIDFont);
    e.add(a.output);
    const o = a.trackers[0], l = this.compileStringIndex(t.strings.strings);
    e.add(l);
    const c = this.compileIndex(t.globalSubrIndex);
    if (e.add(c), t.encoding && t.topDict.hasName("Encoding")) if (t.encoding.predefined) o.setEntryLocation("Encoding", [t.encoding.format], e);
    else {
      const f = this.compileEncoding(t.encoding);
      o.setEntryLocation("Encoding", [e.length], e), e.add(f);
    }
    const h = this.compileCharset(t.charset, t.charStrings.count, t.strings, t.isCIDFont);
    o.setEntryLocation("charset", [e.length], e), e.add(h);
    const u = this.compileCharStrings(t.charStrings);
    if (o.setEntryLocation("CharStrings", [e.length], e), e.add(u), t.isCIDFont) {
      o.setEntryLocation("FDSelect", [e.length], e);
      const f = this.compileFDSelect(t.fdSelect);
      e.add(f), a = this.compileTopDicts(t.fdArray, e.length, !0), o.setEntryLocation("FDArray", [e.length], e), e.add(a.output);
      const d = a.trackers;
      this.compilePrivateDicts(t.fdArray, d, e);
    }
    return this.compilePrivateDicts([t.topDict], [o], e), e.add([0]), e.data;
  }
  encodeNumber(t) {
    return Number.isInteger(t) ? this.encodeInteger(t) : this.encodeFloat(t);
  }
  static get EncodeFloatRegExp() {
    return At(this, "EncodeFloatRegExp", /\.(\d*?)(?:9{5,20}|0{5,20})\d{0,2}(?:e(.+)|$)/);
  }
  encodeFloat(t) {
    let e = t.toString();
    const n = Cg.EncodeFloatRegExp.exec(e);
    if (n) {
      const l = parseFloat("1e" + ((n[2] ? +n[2] : 0) + n[1].length));
      e = (Math.round(t * l) / l).toString();
    }
    let s, r, a = "";
    for (s = 0, r = e.length; s < r; ++s) {
      const l = e[s];
      a += l === "e" ? e[++s] === "-" ? "c" : "b" : l === "." ? "a" : l === "-" ? "e" : l;
    }
    a += 1 & a.length ? "f" : "ff";
    const o = [30];
    for (s = 0, r = a.length; s < r; s += 2) o.push(parseInt(a.substring(s, s + 2), 16));
    return o;
  }
  encodeInteger(t) {
    let e;
    return e = t >= -107 && t <= 107 ? [t + 139] : t >= 108 && t <= 1131 ? [247 + ((t -= 108) >> 8), 255 & t] : t >= -1131 && t <= -108 ? [251 + ((t = -t - 108) >> 8), 255 & t] : t >= -32768 && t <= 32767 ? [28, t >> 8 & 255, 255 & t] : [29, t >> 24 & 255, t >> 16 & 255, t >> 8 & 255, 255 & t], e;
  }
  compileHeader(t) {
    return [t.major, t.minor, 4, t.offSize];
  }
  compileNameIndex(t) {
    const e = new n0();
    for (const n of t) {
      const s = Math.min(n.length, 127);
      let r = new Array(s);
      for (let a = 0; a < s; a++) {
        let o = n[a];
        (o < "!" || o > "~" || o === "[" || o === "]" || o === "(" || o === ")" || o === "{" || o === "}" || o === "<" || o === ">" || o === "/" || o === "%") && (o = "_"), r[a] = o;
      }
      r = r.join(""), r === "" && (r = "Bad_Font_Name"), e.add(Dn(r));
    }
    return this.compileIndex(e);
  }
  compileTopDicts(t, e, n) {
    const s = [];
    let r = new n0();
    for (const a of t) {
      n && (a.removeByName("CIDFontVersion"), a.removeByName("CIDFontRevision"), a.removeByName("CIDFontType"), a.removeByName("CIDCount"), a.removeByName("UIDBase"));
      const o = new S_(), l = this.compileDict(a, o);
      s.push(o), r.add(l), o.offset(e);
    }
    return r = this.compileIndex(r, s), { trackers: s, output: r };
  }
  compilePrivateDicts(t, e, n) {
    for (let s = 0, r = t.length; s < r; ++s) {
      const a = t[s], o = a.privateDict;
      if (!o || !a.hasName("Private")) throw new ht("There must be a private dictionary.");
      const l = new S_(), c = this.compileDict(o, l);
      let h = n.length;
      if (l.offset(h), c.length || (h = 0), e[s].setEntryLocation("Private", [c.length, h], n), n.add(c), o.subrsIndex && o.hasName("Subrs")) {
        const u = this.compileIndex(o.subrsIndex);
        l.setEntryLocation("Subrs", [c.length], n), n.add(u);
      }
    }
  }
  compileDict(t, e) {
    const n = [];
    for (const s of t.order) {
      if (!(s in t.values)) continue;
      let r = t.values[s], a = t.types[s];
      if (Array.isArray(a) || (a = [a]), Array.isArray(r) || (r = [r]), r.length !== 0) {
        for (let o = 0, l = a.length; o < l; ++o) {
          const c = a[o], h = r[o];
          switch (c) {
            case "num":
            case "sid":
              n.push(...this.encodeNumber(h));
              break;
            case "offset":
              const u = t.keyToNameMap[s];
              e.isTracking(u) || e.track(u, n.length), n.push(29, 0, 0, 0, 0);
              break;
            case "array":
            case "delta":
              n.push(...this.encodeNumber(h));
              for (let f = 1, d = r.length; f < d; ++f) n.push(...this.encodeNumber(r[f]));
              break;
            default:
              throw new ht(`Unknown data type of ${c}`);
          }
        }
        n.push(...t.opcodes[s]);
      }
    }
    return n;
  }
  compileStringIndex(t) {
    const e = new n0();
    for (const n of t) e.add(Dn(n));
    return this.compileIndex(e);
  }
  compileCharStrings(t) {
    const e = new n0();
    for (let n = 0; n < t.count; n++) {
      const s = t.get(n);
      s.length !== 0 ? e.add(s) : e.add(new Uint8Array([139, 14]));
    }
    return this.compileIndex(e);
  }
  compileCharset(t, e, n, s) {
    let r;
    const a = e - 1;
    if (s) {
      const o = a - 1;
      r = new Uint8Array([2, 0, 0, o >> 8 & 255, 255 & o]);
    } else {
      r = new Uint8Array(1 + 2 * a), r[0] = 0;
      let o = 0;
      const l = t.charset.length;
      let c = !1;
      for (let h = 1; h < r.length; h += 2) {
        let u = 0;
        if (o < l) {
          const f = t.charset[o++];
          u = n.getSID(f), u === -1 && (u = 0, c || (c = !0, H(`Couldn't find ${f} in CFF strings`)));
        }
        r[h] = u >> 8 & 255, r[h + 1] = 255 & u;
      }
    }
    return this.compileTypedArray(r);
  }
  compileEncoding(t) {
    return this.compileTypedArray(t.raw);
  }
  compileFDSelect(t) {
    const e = t.format;
    let n, s;
    switch (e) {
      case 0:
        for (n = new Uint8Array(1 + t.fdSelect.length), n[0] = e, s = 0; s < t.fdSelect.length; s++) n[s + 1] = t.fdSelect[s];
        break;
      case 3:
        const r = 0;
        let a = t.fdSelect[0];
        const o = [e, 0, 0, r >> 8 & 255, 255 & r, a];
        for (s = 1; s < t.fdSelect.length; s++) {
          const c = t.fdSelect[s];
          c !== a && (o.push(s >> 8 & 255, 255 & s, c), a = c);
        }
        const l = (o.length - 3) / 3;
        o[1] = l >> 8 & 255, o[2] = 255 & l, o.push(s >> 8 & 255, 255 & s), n = new Uint8Array(o);
    }
    return this.compileTypedArray(n);
  }
  compileTypedArray(t) {
    return Array.from(t);
  }
  compileIndex(t, e = []) {
    const n = t.objects, s = n.length;
    if (s === 0) return [0, 0];
    const r = [s >> 8 & 255, 255 & s];
    let a, o, l = 1;
    for (a = 0; a < s; ++a) l += n[a].length;
    o = l < 256 ? 1 : l < 65536 ? 2 : l < 16777216 ? 3 : 4, r.push(o);
    let c = 1;
    for (a = 0; a < s + 1; a++)
      o === 1 ? r.push(255 & c) : o === 2 ? r.push(c >> 8 & 255, 255 & c) : o === 3 ? r.push(c >> 16 & 255, c >> 8 & 255, 255 & c) : r.push(c >>> 24 & 255, c >> 16 & 255, c >> 8 & 255, 255 & c), n[a] && (c += n[a].length);
    for (a = 0; a < s; a++)
      e[a] && e[a].offset(r.length), r.push(...n[a]);
    return r;
  }
}
const B4 = oi(function(i) {
  i["Times-Roman"] = "Times-Roman", i.Helvetica = "Helvetica", i.Courier = "Courier", i.Symbol = "Symbol", i["Times-Bold"] = "Times-Bold", i["Helvetica-Bold"] = "Helvetica-Bold", i["Courier-Bold"] = "Courier-Bold", i.ZapfDingbats = "ZapfDingbats", i["Times-Italic"] = "Times-Italic", i["Helvetica-Oblique"] = "Helvetica-Oblique", i["Courier-Oblique"] = "Courier-Oblique", i["Times-BoldItalic"] = "Times-BoldItalic", i["Helvetica-BoldOblique"] = "Helvetica-BoldOblique", i["Courier-BoldOblique"] = "Courier-BoldOblique", i.ArialNarrow = "Helvetica", i["ArialNarrow-Bold"] = "Helvetica-Bold", i["ArialNarrow-BoldItalic"] = "Helvetica-BoldOblique", i["ArialNarrow-Italic"] = "Helvetica-Oblique", i.ArialBlack = "Helvetica", i["ArialBlack-Bold"] = "Helvetica-Bold", i["ArialBlack-BoldItalic"] = "Helvetica-BoldOblique", i["ArialBlack-Italic"] = "Helvetica-Oblique", i["Arial-Black"] = "Helvetica", i["Arial-Black-Bold"] = "Helvetica-Bold", i["Arial-Black-BoldItalic"] = "Helvetica-BoldOblique", i["Arial-Black-Italic"] = "Helvetica-Oblique", i.Arial = "Helvetica", i["Arial-Bold"] = "Helvetica-Bold", i["Arial-BoldItalic"] = "Helvetica-BoldOblique", i["Arial-Italic"] = "Helvetica-Oblique", i.ArialMT = "Helvetica", i["Arial-BoldItalicMT"] = "Helvetica-BoldOblique", i["Arial-BoldMT"] = "Helvetica-Bold", i["Arial-ItalicMT"] = "Helvetica-Oblique", i["Arial-BoldItalicMT-BoldItalic"] = "Helvetica-BoldOblique", i["Arial-BoldMT-Bold"] = "Helvetica-Bold", i["Arial-ItalicMT-Italic"] = "Helvetica-Oblique", i.ArialUnicodeMS = "Helvetica", i["ArialUnicodeMS-Bold"] = "Helvetica-Bold", i["ArialUnicodeMS-BoldItalic"] = "Helvetica-BoldOblique", i["ArialUnicodeMS-Italic"] = "Helvetica-Oblique", i["Courier-BoldItalic"] = "Courier-BoldOblique", i["Courier-Italic"] = "Courier-Oblique", i.CourierNew = "Courier", i["CourierNew-Bold"] = "Courier-Bold", i["CourierNew-BoldItalic"] = "Courier-BoldOblique", i["CourierNew-Italic"] = "Courier-Oblique", i["CourierNewPS-BoldItalicMT"] = "Courier-BoldOblique", i["CourierNewPS-BoldMT"] = "Courier-Bold", i["CourierNewPS-ItalicMT"] = "Courier-Oblique", i.CourierNewPSMT = "Courier", i["Helvetica-BoldItalic"] = "Helvetica-BoldOblique", i["Helvetica-Italic"] = "Helvetica-Oblique", i["HelveticaLTStd-Bold"] = "Helvetica-Bold", i["Symbol-Bold"] = "Symbol", i["Symbol-BoldItalic"] = "Symbol", i["Symbol-Italic"] = "Symbol", i.TimesNewRoman = "Times-Roman", i["TimesNewRoman-Bold"] = "Times-Bold", i["TimesNewRoman-BoldItalic"] = "Times-BoldItalic", i["TimesNewRoman-Italic"] = "Times-Italic", i.TimesNewRomanPS = "Times-Roman", i["TimesNewRomanPS-Bold"] = "Times-Bold", i["TimesNewRomanPS-BoldItalic"] = "Times-BoldItalic", i["TimesNewRomanPS-BoldItalicMT"] = "Times-BoldItalic", i["TimesNewRomanPS-BoldMT"] = "Times-Bold", i["TimesNewRomanPS-Italic"] = "Times-Italic", i["TimesNewRomanPS-ItalicMT"] = "Times-Italic", i.TimesNewRomanPSMT = "Times-Roman", i["TimesNewRomanPSMT-Bold"] = "Times-Bold", i["TimesNewRomanPSMT-BoldItalic"] = "Times-BoldItalic", i["TimesNewRomanPSMT-Italic"] = "Times-Italic";
}), aN = oi(function(i) {
  i.Courier = "FoxitFixed.pfb", i["Courier-Bold"] = "FoxitFixedBold.pfb", i["Courier-BoldOblique"] = "FoxitFixedBoldItalic.pfb", i["Courier-Oblique"] = "FoxitFixedItalic.pfb", i.Helvetica = "LiberationSans-Regular.ttf", i["Helvetica-Bold"] = "LiberationSans-Bold.ttf", i["Helvetica-BoldOblique"] = "LiberationSans-BoldItalic.ttf", i["Helvetica-Oblique"] = "LiberationSans-Italic.ttf", i["Times-Roman"] = "FoxitSerif.pfb", i["Times-Bold"] = "FoxitSerifBold.pfb", i["Times-BoldItalic"] = "FoxitSerifBoldItalic.pfb", i["Times-Italic"] = "FoxitSerifItalic.pfb", i.Symbol = "FoxitSymbol.pfb", i.ZapfDingbats = "FoxitDingbats.pfb", i["LiberationSans-Regular"] = "LiberationSans-Regular.ttf", i["LiberationSans-Bold"] = "LiberationSans-Bold.ttf", i["LiberationSans-Italic"] = "LiberationSans-Italic.ttf", i["LiberationSans-BoldItalic"] = "LiberationSans-BoldItalic.ttf";
}), gD = oi(function(i) {
  i.Calibri = "Helvetica", i["Calibri-Bold"] = "Helvetica-Bold", i["Calibri-BoldItalic"] = "Helvetica-BoldOblique", i["Calibri-Italic"] = "Helvetica-Oblique", i.CenturyGothic = "Helvetica", i["CenturyGothic-Bold"] = "Helvetica-Bold", i["CenturyGothic-BoldItalic"] = "Helvetica-BoldOblique", i["CenturyGothic-Italic"] = "Helvetica-Oblique", i.ComicSansMS = "Comic Sans MS", i["ComicSansMS-Bold"] = "Comic Sans MS-Bold", i["ComicSansMS-BoldItalic"] = "Comic Sans MS-BoldItalic", i["ComicSansMS-Italic"] = "Comic Sans MS-Italic", i.GillSansMT = "Helvetica", i["GillSansMT-Bold"] = "Helvetica-Bold", i["GillSansMT-BoldItalic"] = "Helvetica-BoldOblique", i["GillSansMT-Italic"] = "Helvetica-Oblique", i.Impact = "Helvetica", i["ItcSymbol-Bold"] = "Helvetica-Bold", i["ItcSymbol-BoldItalic"] = "Helvetica-BoldOblique", i["ItcSymbol-Book"] = "Helvetica", i["ItcSymbol-BookItalic"] = "Helvetica-Oblique", i["ItcSymbol-Medium"] = "Helvetica", i["ItcSymbol-MediumItalic"] = "Helvetica-Oblique", i.LucidaConsole = "Courier", i["LucidaConsole-Bold"] = "Courier-Bold", i["LucidaConsole-BoldItalic"] = "Courier-BoldOblique", i["LucidaConsole-Italic"] = "Courier-Oblique", i["LucidaSans-Demi"] = "Helvetica-Bold", i["MS-Gothic"] = "MS Gothic", i["MS-Gothic-Bold"] = "MS Gothic-Bold", i["MS-Gothic-BoldItalic"] = "MS Gothic-BoldItalic", i["MS-Gothic-Italic"] = "MS Gothic-Italic", i["MS-Mincho"] = "MS Mincho", i["MS-Mincho-Bold"] = "MS Mincho-Bold", i["MS-Mincho-BoldItalic"] = "MS Mincho-BoldItalic", i["MS-Mincho-Italic"] = "MS Mincho-Italic", i["MS-PGothic"] = "MS PGothic", i["MS-PGothic-Bold"] = "MS PGothic-Bold", i["MS-PGothic-BoldItalic"] = "MS PGothic-BoldItalic", i["MS-PGothic-Italic"] = "MS PGothic-Italic", i["MS-PMincho"] = "MS PMincho", i["MS-PMincho-Bold"] = "MS PMincho-Bold", i["MS-PMincho-BoldItalic"] = "MS PMincho-BoldItalic", i["MS-PMincho-Italic"] = "MS PMincho-Italic", i.NuptialScript = "Times-Italic", i.SegoeUISymbol = "Helvetica";
}), Jy = oi(function(i) {
  i["Adobe Jenson"] = !0, i["Adobe Text"] = !0, i.Albertus = !0, i.Aldus = !0, i.Alexandria = !0, i.Algerian = !0, i["American Typewriter"] = !0, i.Antiqua = !0, i.Apex = !0, i.Arno = !0, i.Aster = !0, i.Aurora = !0, i.Baskerville = !0, i.Bell = !0, i.Bembo = !0, i["Bembo Schoolbook"] = !0, i.Benguiat = !0, i["Berkeley Old Style"] = !0, i["Bernhard Modern"] = !0, i["Berthold City"] = !0, i.Bodoni = !0, i["Bauer Bodoni"] = !0, i["Book Antiqua"] = !0, i.Bookman = !0, i["Bordeaux Roman"] = !0, i["Californian FB"] = !0, i.Calisto = !0, i.Calvert = !0, i.Capitals = !0, i.Cambria = !0, i.Cartier = !0, i.Caslon = !0, i.Catull = !0, i.Centaur = !0, i["Century Old Style"] = !0, i["Century Schoolbook"] = !0, i.Chaparral = !0, i["Charis SIL"] = !0, i.Cheltenham = !0, i["Cholla Slab"] = !0, i.Clarendon = !0, i.Clearface = !0, i.Cochin = !0, i.Colonna = !0, i["Computer Modern"] = !0, i["Concrete Roman"] = !0, i.Constantia = !0, i["Cooper Black"] = !0, i.Corona = !0, i.Ecotype = !0, i.Egyptienne = !0, i.Elephant = !0, i.Excelsior = !0, i.Fairfield = !0, i["FF Scala"] = !0, i.Folkard = !0, i.Footlight = !0, i.FreeSerif = !0, i["Friz Quadrata"] = !0, i.Garamond = !0, i.Gentium = !0, i.Georgia = !0, i.Gloucester = !0, i["Goudy Old Style"] = !0, i["Goudy Schoolbook"] = !0, i["Goudy Pro Font"] = !0, i.Granjon = !0, i["Guardian Egyptian"] = !0, i.Heather = !0, i.Hercules = !0, i["High Tower Text"] = !0, i.Hiroshige = !0, i["Hoefler Text"] = !0, i["Humana Serif"] = !0, i.Imprint = !0, i["Ionic No. 5"] = !0, i.Janson = !0, i.Joanna = !0, i.Korinna = !0, i.Lexicon = !0, i.LiberationSerif = !0, i["Liberation Serif"] = !0, i["Linux Libertine"] = !0, i.Literaturnaya = !0, i.Lucida = !0, i["Lucida Bright"] = !0, i.Melior = !0, i.Memphis = !0, i.Miller = !0, i.Minion = !0, i.Modern = !0, i["Mona Lisa"] = !0, i["Mrs Eaves"] = !0, i["MS Serif"] = !0, i["Museo Slab"] = !0, i["New York"] = !0, i["Nimbus Roman"] = !0, i["NPS Rawlinson Roadway"] = !0, i.NuptialScript = !0, i.Palatino = !0, i.Perpetua = !0, i.Plantin = !0, i["Plantin Schoolbook"] = !0, i.Playbill = !0, i["Poor Richard"] = !0, i["Rawlinson Roadway"] = !0, i.Renault = !0, i.Requiem = !0, i.Rockwell = !0, i.Roman = !0, i["Rotis Serif"] = !0, i.Sabon = !0, i.Scala = !0, i.Seagull = !0, i.Sistina = !0, i.Souvenir = !0, i.STIX = !0, i["Stone Informal"] = !0, i["Stone Serif"] = !0, i.Sylfaen = !0, i.Times = !0, i.Trajan = !0, i.Trinité = !0, i["Trump Mediaeval"] = !0, i.Utopia = !0, i["Vale Type"] = !0, i["Bitstream Vera"] = !0, i["Vera Serif"] = !0, i.Versailles = !0, i.Wanted = !0, i.Weiss = !0, i["Wide Latin"] = !0, i.Windsor = !0, i.XITS = !0;
}), vb = oi(function(i) {
  i.Dingbats = !0, i.Symbol = !0, i.ZapfDingbats = !0, i.Wingdings = !0, i["Wingdings-Bold"] = !0, i["Wingdings-Regular"] = !0;
}), C_ = oi(function(i) {
  i[2] = 10, i[3] = 32, i[4] = 33, i[5] = 34, i[6] = 35, i[7] = 36, i[8] = 37, i[9] = 38, i[10] = 39, i[11] = 40, i[12] = 41, i[13] = 42, i[14] = 43, i[15] = 44, i[16] = 45, i[17] = 46, i[18] = 47, i[19] = 48, i[20] = 49, i[21] = 50, i[22] = 51, i[23] = 52, i[24] = 53, i[25] = 54, i[26] = 55, i[27] = 56, i[28] = 57, i[29] = 58, i[30] = 894, i[31] = 60, i[32] = 61, i[33] = 62, i[34] = 63, i[35] = 64, i[36] = 65, i[37] = 66, i[38] = 67, i[39] = 68, i[40] = 69, i[41] = 70, i[42] = 71, i[43] = 72, i[44] = 73, i[45] = 74, i[46] = 75, i[47] = 76, i[48] = 77, i[49] = 78, i[50] = 79, i[51] = 80, i[52] = 81, i[53] = 82, i[54] = 83, i[55] = 84, i[56] = 85, i[57] = 86, i[58] = 87, i[59] = 88, i[60] = 89, i[61] = 90, i[62] = 91, i[63] = 92, i[64] = 93, i[65] = 94, i[66] = 95, i[67] = 96, i[68] = 97, i[69] = 98, i[70] = 99, i[71] = 100, i[72] = 101, i[73] = 102, i[74] = 103, i[75] = 104, i[76] = 105, i[77] = 106, i[78] = 107, i[79] = 108, i[80] = 109, i[81] = 110, i[82] = 111, i[83] = 112, i[84] = 113, i[85] = 114, i[86] = 115, i[87] = 116, i[88] = 117, i[89] = 118, i[90] = 119, i[91] = 120, i[92] = 121, i[93] = 122, i[94] = 123, i[95] = 124, i[96] = 125, i[97] = 126, i[98] = 196, i[99] = 197, i[100] = 199, i[101] = 201, i[102] = 209, i[103] = 214, i[104] = 220, i[105] = 225, i[106] = 224, i[107] = 226, i[108] = 228, i[109] = 227, i[110] = 229, i[111] = 231, i[112] = 233, i[113] = 232, i[114] = 234, i[115] = 235, i[116] = 237, i[117] = 236, i[118] = 238, i[119] = 239, i[120] = 241, i[121] = 243, i[122] = 242, i[123] = 244, i[124] = 246, i[125] = 245, i[126] = 250, i[127] = 249, i[128] = 251, i[129] = 252, i[130] = 8224, i[131] = 176, i[132] = 162, i[133] = 163, i[134] = 167, i[135] = 8226, i[136] = 182, i[137] = 223, i[138] = 174, i[139] = 169, i[140] = 8482, i[141] = 180, i[142] = 168, i[143] = 8800, i[144] = 198, i[145] = 216, i[146] = 8734, i[147] = 177, i[148] = 8804, i[149] = 8805, i[150] = 165, i[151] = 181, i[152] = 8706, i[153] = 8721, i[154] = 8719, i[156] = 8747, i[157] = 170, i[158] = 186, i[159] = 8486, i[160] = 230, i[161] = 248, i[162] = 191, i[163] = 161, i[164] = 172, i[165] = 8730, i[166] = 402, i[167] = 8776, i[168] = 8710, i[169] = 171, i[170] = 187, i[171] = 8230, i[179] = 8220, i[180] = 8221, i[181] = 8216, i[182] = 8217, i[200] = 193, i[203] = 205, i[207] = 211, i[210] = 218, i[223] = 711, i[224] = 321, i[225] = 322, i[226] = 352, i[227] = 353, i[228] = 381, i[229] = 382, i[233] = 221, i[234] = 253, i[252] = 263, i[253] = 268, i[254] = 269, i[258] = 258, i[260] = 260, i[261] = 261, i[265] = 280, i[266] = 281, i[267] = 282, i[268] = 283, i[269] = 313, i[275] = 323, i[276] = 324, i[278] = 328, i[283] = 344, i[284] = 345, i[285] = 346, i[286] = 347, i[292] = 367, i[295] = 377, i[296] = 378, i[298] = 380, i[305] = 963, i[306] = 964, i[307] = 966, i[308] = 8215, i[309] = 8252, i[310] = 8319, i[311] = 8359, i[312] = 8592, i[313] = 8593, i[337] = 9552, i[493] = 1039, i[494] = 1040, i[570] = 1040, i[571] = 1041, i[572] = 1042, i[573] = 1043, i[574] = 1044, i[575] = 1045, i[576] = 1046, i[577] = 1047, i[578] = 1048, i[579] = 1049, i[580] = 1050, i[581] = 1051, i[582] = 1052, i[583] = 1053, i[584] = 1054, i[585] = 1055, i[586] = 1056, i[587] = 1057, i[588] = 1058, i[589] = 1059, i[590] = 1060, i[591] = 1061, i[592] = 1062, i[593] = 1063, i[594] = 1064, i[595] = 1065, i[596] = 1066, i[597] = 1067, i[598] = 1068, i[599] = 1069, i[600] = 1070, i[672] = 1488, i[673] = 1489, i[674] = 1490, i[675] = 1491, i[676] = 1492, i[677] = 1493, i[678] = 1494, i[679] = 1495, i[680] = 1496, i[681] = 1497, i[682] = 1498, i[683] = 1499, i[684] = 1500, i[685] = 1501, i[686] = 1502, i[687] = 1503, i[688] = 1504, i[689] = 1505, i[690] = 1506, i[691] = 1507, i[692] = 1508, i[693] = 1509, i[694] = 1510, i[695] = 1511, i[696] = 1512, i[697] = 1513, i[698] = 1514, i[705] = 1524, i[706] = 8362, i[710] = 64288, i[711] = 64298, i[759] = 1617, i[761] = 1776, i[763] = 1778, i[775] = 1652, i[777] = 1764, i[778] = 1780, i[779] = 1781, i[780] = 1782, i[782] = 771, i[783] = 64726, i[786] = 8363, i[788] = 8532, i[790] = 768, i[791] = 769, i[792] = 768, i[795] = 803, i[797] = 64336, i[798] = 64337, i[799] = 64342, i[800] = 64343, i[801] = 64344, i[802] = 64345, i[803] = 64362, i[804] = 64363, i[805] = 64364, i[2424] = 7821, i[2425] = 7822, i[2426] = 7823, i[2427] = 7824, i[2428] = 7825, i[2429] = 7826, i[2430] = 7827, i[2433] = 7682, i[2678] = 8045, i[2679] = 8046, i[2830] = 1552, i[2838] = 686, i[2840] = 751, i[2842] = 753, i[2843] = 754, i[2844] = 755, i[2846] = 757, i[2856] = 767, i[2857] = 848, i[2858] = 849, i[2862] = 853, i[2863] = 854, i[2864] = 855, i[2865] = 861, i[2866] = 862, i[2906] = 7460, i[2908] = 7462, i[2909] = 7463, i[2910] = 7464, i[2912] = 7466, i[2913] = 7467, i[2914] = 7468, i[2916] = 7470, i[2917] = 7471, i[2918] = 7472, i[2920] = 7474, i[2921] = 7475, i[2922] = 7476, i[2924] = 7478, i[2925] = 7479, i[2926] = 7480, i[2928] = 7482, i[2929] = 7483, i[2930] = 7484, i[2932] = 7486, i[2933] = 7487, i[2934] = 7488, i[2936] = 7490, i[2937] = 7491, i[2938] = 7492, i[2940] = 7494, i[2941] = 7495, i[2942] = 7496, i[2944] = 7498, i[2946] = 7500, i[2948] = 7502, i[2950] = 7504, i[2951] = 7505, i[2952] = 7506, i[2954] = 7508, i[2955] = 7509, i[2956] = 7510, i[2958] = 7512, i[2959] = 7513, i[2960] = 7514, i[2962] = 7516, i[2963] = 7517, i[2964] = 7518, i[2966] = 7520, i[2967] = 7521, i[2968] = 7522, i[2970] = 7524, i[2971] = 7525, i[2972] = 7526, i[2974] = 7528, i[2975] = 7529, i[2976] = 7530, i[2978] = 1537, i[2979] = 1538, i[2980] = 1539, i[2982] = 1549, i[2983] = 1551, i[2984] = 1552, i[2986] = 1554, i[2987] = 1555, i[2988] = 1556, i[2990] = 1623, i[2991] = 1624, i[2995] = 1775, i[2999] = 1791, i[3002] = 64290, i[3003] = 64291, i[3004] = 64292, i[3006] = 64294, i[3007] = 64295, i[3008] = 64296, i[3011] = 1900, i[3014] = 8223, i[3015] = 8244, i[3017] = 7532, i[3018] = 7533, i[3019] = 7534, i[3075] = 7590, i[3076] = 7591, i[3079] = 7594, i[3080] = 7595, i[3083] = 7598, i[3084] = 7599, i[3087] = 7602, i[3088] = 7603, i[3091] = 7606, i[3092] = 7607, i[3095] = 7610, i[3096] = 7611, i[3099] = 7614, i[3100] = 7615, i[3103] = 7618, i[3104] = 7619, i[3107] = 8337, i[3108] = 8338, i[3116] = 1884, i[3119] = 1885, i[3120] = 1885, i[3123] = 1886, i[3124] = 1886, i[3127] = 1887, i[3128] = 1887, i[3131] = 1888, i[3132] = 1888, i[3135] = 1889, i[3136] = 1889, i[3139] = 1890, i[3140] = 1890, i[3143] = 1891, i[3144] = 1891, i[3147] = 1892, i[3148] = 1892, i[3153] = 580, i[3154] = 581, i[3157] = 584, i[3158] = 585, i[3161] = 588, i[3162] = 589, i[3165] = 891, i[3166] = 892, i[3169] = 1274, i[3170] = 1275, i[3173] = 1278, i[3174] = 1279, i[3181] = 7622, i[3182] = 7623, i[3282] = 11799, i[3316] = 578, i[3379] = 42785, i[3393] = 1159, i[3416] = 8377;
}), oN = oi(function(i) {
  i[227] = 322, i[264] = 261, i[291] = 346;
}), lN = oi(function(i) {
  i[1] = 32, i[4] = 65, i[5] = 192, i[6] = 193, i[9] = 196, i[17] = 66, i[18] = 67, i[21] = 268, i[24] = 68, i[28] = 69, i[29] = 200, i[30] = 201, i[32] = 282, i[38] = 70, i[39] = 71, i[44] = 72, i[47] = 73, i[48] = 204, i[49] = 205, i[58] = 74, i[60] = 75, i[62] = 76, i[68] = 77, i[69] = 78, i[75] = 79, i[76] = 210, i[80] = 214, i[87] = 80, i[89] = 81, i[90] = 82, i[92] = 344, i[94] = 83, i[97] = 352, i[100] = 84, i[104] = 85, i[109] = 220, i[115] = 86, i[116] = 87, i[121] = 88, i[122] = 89, i[124] = 221, i[127] = 90, i[129] = 381, i[258] = 97, i[259] = 224, i[260] = 225, i[263] = 228, i[268] = 261, i[271] = 98, i[272] = 99, i[273] = 263, i[275] = 269, i[282] = 100, i[286] = 101, i[287] = 232, i[288] = 233, i[290] = 283, i[295] = 281, i[296] = 102, i[336] = 103, i[346] = 104, i[349] = 105, i[350] = 236, i[351] = 237, i[361] = 106, i[364] = 107, i[367] = 108, i[371] = 322, i[373] = 109, i[374] = 110, i[381] = 111, i[382] = 242, i[383] = 243, i[386] = 246, i[393] = 112, i[395] = 113, i[396] = 114, i[398] = 345, i[400] = 115, i[401] = 347, i[403] = 353, i[410] = 116, i[437] = 117, i[442] = 252, i[448] = 118, i[449] = 119, i[454] = 120, i[455] = 121, i[457] = 253, i[460] = 122, i[462] = 382, i[463] = 380, i[853] = 44, i[855] = 58, i[856] = 46, i[876] = 47, i[878] = 45, i[882] = 45, i[894] = 40, i[895] = 41, i[896] = 91, i[897] = 93, i[923] = 64, i[940] = 163, i[1004] = 48, i[1005] = 49, i[1006] = 50, i[1007] = 51, i[1008] = 52, i[1009] = 53, i[1010] = 54, i[1011] = 55, i[1012] = 56, i[1013] = 57, i[1081] = 37, i[1085] = 43, i[1086] = 45;
});
function E_(i) {
  const t = Sg(i);
  return B4()[t];
}
function D_(i) {
  const t = Sg(i);
  return !!(B4()[t] || gD()[t] || Jy()[t] || vb()[t]);
}
class v2 {
  constructor(t = []) {
    this._map = t;
  }
  get length() {
    return this._map.length;
  }
  forEach(t) {
    for (const e in this._map) t(e, this._map[e].codePointAt(0));
  }
  has(t) {
    return this._map[t] !== void 0;
  }
  get(t) {
    return this._map[t];
  }
  charCodeOf(t) {
    const e = this._map;
    if (e.length <= 65536) return e.indexOf(t);
    for (const n in e) if (e[n] === t) return 0 | n;
    return -1;
  }
  amend(t) {
    for (const e in t) this._map[e] = t[e];
  }
}
class Dr {
  constructor(t, e) {
    this.firstChar = t, this.lastChar = e;
  }
  get length() {
    return this.lastChar + 1 - this.firstChar;
  }
  forEach(t) {
    for (let e = this.firstChar, n = this.lastChar; e <= n; e++) t(e, e);
  }
  has(t) {
    return this.firstChar <= t && t <= this.lastChar;
  }
  get(t) {
    if (this.firstChar <= t && t <= this.lastChar) return String.fromCharCode(t);
  }
  charCodeOf(t) {
    return Number.isInteger(t) && t >= this.firstChar && t <= this.lastChar ? t : -1;
  }
  amend(t) {
    ye("Should not call amend()");
  }
}
class A6 {
  constructor(t, e) {
    this.properties = e;
    const n = new Ky(t, e, lp);
    this.cff = n.parse(), this.cff.duplicateFirstGlyph();
    const s = new Cg(this.cff);
    this.seacs = this.cff.seacs;
    try {
      this.data = s.compile();
    } catch {
      H("Failed to compile font " + e.loadedName), this.data = t;
    }
    this._createBuiltInEncoding();
  }
  get numGlyphs() {
    return this.cff.charStrings.count;
  }
  getCharset() {
    return this.cff.charset.charset;
  }
  getGlyphMapping() {
    const t = this.cff, e = this.properties, { cidToGidMap: n, cMap: s } = e, r = t.charset.charset;
    let a, o;
    if (e.composite) {
      let c, h;
      if ((n == null ? void 0 : n.length) > 0) {
        c = /* @__PURE__ */ Object.create(null);
        for (let u = 0, f = n.length; u < f; u++) {
          const d = n[u];
          d !== void 0 && (c[d] = u);
        }
      }
      if (a = /* @__PURE__ */ Object.create(null), t.isCIDFont) for (o = 0; o < r.length; o++) {
        const u = r[o];
        h = s.charCodeOf(u), (c == null ? void 0 : c[h]) !== void 0 && (h = c[h]), a[h] = o;
      }
      else for (o = 0; o < t.charStrings.count; o++)
        h = s.charCodeOf(o), a[h] = o;
      return a;
    }
    let l = t.encoding ? t.encoding.encoding : null;
    return e.isInternalFont && (l = e.defaultEncoding), a = dD(e, l, r), a;
  }
  hasGlyphId(t) {
    return this.cff.hasGlyphId(t);
  }
  _createBuiltInEncoding() {
    const { charset: t, encoding: e } = this.cff;
    if (!t || !e) return;
    const n = t.charset, s = e.encoding, r = [];
    for (const a in s) {
      const o = s[a];
      if (o >= 0) {
        const l = n[o];
        l && (r[a] = l);
      }
    }
    r.length > 0 && (this.properties.builtInEncoding = r);
  }
}
function C0(i, t) {
  return Fl(i, t) / 16384;
}
function _b(i) {
  const t = i.length;
  let e = 32768;
  return t < 1240 ? e = 107 : t < 33900 && (e = 1131), e;
}
function cN(i, t, e) {
  const n = pe(i, t + 2) === 1 ? Ne(i, t + 8) : Ne(i, t + 16), s = pe(i, t + n);
  let r, a, o;
  if (s === 4) {
    pe(i, t + n + 2);
    const l = pe(i, t + n + 6) >> 1;
    for (a = t + n + 14, r = [], o = 0; o < l; o++, a += 2) r[o] = { end: pe(i, a) };
    for (a += 2, o = 0; o < l; o++, a += 2) r[o].start = pe(i, a);
    for (o = 0; o < l; o++, a += 2) r[o].idDelta = pe(i, a);
    for (o = 0; o < l; o++, a += 2) {
      let c = pe(i, a);
      if (c !== 0) {
        r[o].ids = [];
        for (let h = 0, u = r[o].end - r[o].start + 1; h < u; h++)
          r[o].ids[h] = pe(i, a + c), c += 2;
      }
    }
    return r;
  }
  if (s === 12) {
    const l = Ne(i, t + n + 12);
    for (a = t + n + 16, r = [], o = 0; o < l; o++)
      t = Ne(i, a), r.push({ start: t, end: Ne(i, a + 4), idDelta: Ne(i, a + 8) - t }), a += 12;
    return r;
  }
  throw new ht(`unsupported cmap: ${s}`);
}
function hN(i, t, e, n) {
  var r, a, o;
  const s = new Ky(new gi(i, t, e - t), {}, n).parse();
  return { glyphs: s.charStrings.objects, subrs: (a = (r = s.topDict.privateDict) == null ? void 0 : r.subrsIndex) == null ? void 0 : a.objects, gsubrs: (o = s.globalSubrIndex) == null ? void 0 : o.objects, isCFFCIDFont: s.isCIDFont, fdSelect: s.fdSelect, fdArray: s.fdArray };
}
function d3(i, t) {
  const e = t.codePointAt(0);
  let n = 0, s = 0, r = i.length - 1;
  for (; s < r; ) {
    const a = s + r + 1 >> 1;
    e < i[a].start ? r = a - 1 : s = a;
  }
  return i[s].start <= e && e <= i[s].end && (n = i[s].idDelta + (i[s].ids ? i[s].ids[e - i[s].start] : e) & 65535), { charCode: e, glyphId: n };
}
function bD(i, t, e) {
  function n(f, d) {
    c && t.add("L", c), c = [f, d], t.add("M", [f, d]);
  }
  function s(f, d) {
    t.add("L", [f, d]);
  }
  function r(f, d, p, g) {
    t.add("Q", [f, d, p, g]);
  }
  let a = 0;
  const o = Fl(i, a);
  let l, c = null, h = 0, u = 0;
  if (a += 10, o < 0) do {
    l = pe(i, a);
    const f = pe(i, a + 2);
    a += 4;
    let d, p;
    1 & l ? (2 & l ? (d = Fl(i, a), p = Fl(i, a + 2)) : (d = pe(i, a), p = pe(i, a + 2)), a += 4) : 2 & l ? (d = ja(i, a++), p = ja(i, a++)) : (d = i[a++], p = i[a++]), 2 & l ? (h = d, u = p) : (h = 0, u = 0);
    let g = 1, b = 1, y = 0, v = 0;
    8 & l ? (g = b = C0(i, a), a += 2) : 64 & l ? (g = C0(i, a), b = C0(i, a + 2), a += 4) : 128 & l && (g = C0(i, a), y = C0(i, a + 2), v = C0(i, a + 4), b = C0(i, a + 6), a += 8);
    const w = e.glyphs[f];
    w && (t.save(), t.transform([g, y, v, b, h, u]), bD(w, t, e), t.restore());
  } while (32 & l);
  else {
    const f = [];
    let d, p;
    for (d = 0; d < o; d++)
      f.push(pe(i, a)), a += 2;
    a += 2 + pe(i, a);
    const g = f.at(-1) + 1, b = [];
    for (; b.length < g; ) {
      l = i[a++];
      let v = 1;
      for (8 & l && (v += i[a++]); v-- > 0; ) b.push({ flags: l });
    }
    for (d = 0; d < g; d++) {
      switch (18 & b[d].flags) {
        case 0:
          h += Fl(i, a), a += 2;
          break;
        case 2:
          h -= i[a++];
          break;
        case 18:
          h += i[a++];
      }
      b[d].x = h;
    }
    for (d = 0; d < g; d++) {
      switch (36 & b[d].flags) {
        case 0:
          u += Fl(i, a), a += 2;
          break;
        case 4:
          u -= i[a++];
          break;
        case 36:
          u += i[a++];
      }
      b[d].y = u;
    }
    let y = 0;
    for (a = 0; a < o; a++) {
      const v = f[a], w = b.slice(y, v + 1);
      if (1 & w[0].flags) w.push(w[0]);
      else if (1 & w.at(-1).flags) w.unshift(w.at(-1));
      else {
        const _ = { flags: 1, x: (w[0].x + w.at(-1).x) / 2, y: (w[0].y + w.at(-1).y) / 2 };
        w.unshift(_), w.push(_);
      }
      for (n(w[0].x, w[0].y), d = 1, p = w.length; d < p; d++) 1 & w[d].flags ? s(w[d].x, w[d].y) : 1 & w[d + 1].flags ? (r(w[d].x, w[d].y, w[d + 1].x, w[d + 1].y), d++) : r(w[d].x, w[d].y, (w[d].x + w[d + 1].x) / 2, (w[d].y + w[d + 1].y) / 2);
      y = v + 1;
    }
  }
}
function xb(i, t, e, n) {
  function s(f, d) {
    u && t.add("L", u), u = [f, d], t.add("M", [f, d]);
  }
  function r(f, d) {
    t.add("L", [f, d]);
  }
  function a(f, d, p, g, b, y) {
    t.add("C", [f, d, p, g, b, y]);
  }
  const o = [];
  let l = 0, c = 0, h = 0, u = null;
  (function f(d) {
    var g;
    let p = 0;
    for (; p < d.length; ) {
      let b, y, v, w, _, x, k, S, T, I = !1, R = d[p++];
      switch (R) {
        case 1:
        case 3:
        case 18:
        case 23:
          h += o.length >> 1, I = !0;
          break;
        case 4:
          c += o.pop(), s(l, c), I = !0;
          break;
        case 5:
          for (; o.length > 0; )
            l += o.shift(), c += o.shift(), r(l, c);
          break;
        case 6:
          for (; o.length > 0 && (l += o.shift(), r(l, c), o.length !== 0); )
            c += o.shift(), r(l, c);
          break;
        case 7:
          for (; o.length > 0 && (c += o.shift(), r(l, c), o.length !== 0); )
            l += o.shift(), r(l, c);
          break;
        case 8:
          for (; o.length > 0; )
            b = l + o.shift(), v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + o.shift(), a(b, v, y, w, l, c);
          break;
        case 10:
          if (S = o.pop(), T = null, e.isCFFCIDFont) {
            const B = e.fdSelect.getFDIndex(n);
            if (B >= 0 && B < e.fdArray.length) {
              const L = e.fdArray[B];
              let it;
              (g = L.privateDict) != null && g.subrsIndex && (it = L.privateDict.subrsIndex.objects), it && (S += _b(it), T = it[S]);
            } else H("Invalid fd index for glyph index.");
          } else T = e.subrs[S + e.subrsBias];
          T && f(T);
          break;
        case 11:
          return;
        case 12:
          switch (R = d[p++], R) {
            case 34:
              b = l + o.shift(), y = b + o.shift(), _ = c + o.shift(), l = y + o.shift(), a(b, c, y, _, l, _), b = l + o.shift(), y = b + o.shift(), l = y + o.shift(), a(b, _, y, c, l, c);
              break;
            case 35:
              b = l + o.shift(), v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + o.shift(), a(b, v, y, w, l, c), b = l + o.shift(), v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + o.shift(), a(b, v, y, w, l, c), o.pop();
              break;
            case 36:
              b = l + o.shift(), _ = c + o.shift(), y = b + o.shift(), x = _ + o.shift(), l = y + o.shift(), a(b, _, y, x, l, x), b = l + o.shift(), y = b + o.shift(), k = x + o.shift(), l = y + o.shift(), a(b, x, y, k, l, c);
              break;
            case 37:
              const B = l, L = c;
              b = l + o.shift(), v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + o.shift(), a(b, v, y, w, l, c), b = l + o.shift(), v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y, c = w, Math.abs(l - B) > Math.abs(c - L) ? l += o.shift() : c += o.shift(), a(b, v, y, w, l, c);
              break;
            default:
              throw new ht(`unknown operator: 12 ${R}`);
          }
          break;
        case 14:
          if (o.length >= 4) {
            const B = o.pop(), L = o.pop();
            c = o.pop(), l = o.pop(), t.save(), t.translate(l, c);
            let it = d3(e.cmap, String.fromCharCode(e.glyphNameMap[Pl[B]]));
            xb(e.glyphs[it.glyphId], t, e, it.glyphId), t.restore(), it = d3(e.cmap, String.fromCharCode(e.glyphNameMap[Pl[L]])), xb(e.glyphs[it.glyphId], t, e, it.glyphId);
          }
          return;
        case 19:
        case 20:
          h += o.length >> 1, p += h + 7 >> 3, I = !0;
          break;
        case 21:
          c += o.pop(), l += o.pop(), s(l, c), I = !0;
          break;
        case 22:
          l += o.pop(), s(l, c), I = !0;
          break;
        case 24:
          for (; o.length > 2; )
            b = l + o.shift(), v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + o.shift(), a(b, v, y, w, l, c);
          l += o.shift(), c += o.shift(), r(l, c);
          break;
        case 25:
          for (; o.length > 6; )
            l += o.shift(), c += o.shift(), r(l, c);
          b = l + o.shift(), v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + o.shift(), a(b, v, y, w, l, c);
          break;
        case 26:
          for (o.length % 2 && (l += o.shift()); o.length > 0; )
            b = l, v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y, c = w + o.shift(), a(b, v, y, w, l, c);
          break;
        case 27:
          for (o.length % 2 && (c += o.shift()); o.length > 0; )
            b = l + o.shift(), v = c, y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w, a(b, v, y, w, l, c);
          break;
        case 28:
          o.push(Fl(d, p)), p += 2;
          break;
        case 29:
          S = o.pop() + e.gsubrsBias, T = e.gsubrs[S], T && f(T);
          break;
        case 30:
          for (; o.length > 0 && (b = l, v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + (o.length === 1 ? o.shift() : 0), a(b, v, y, w, l, c), o.length !== 0); )
            b = l + o.shift(), v = c, y = b + o.shift(), w = v + o.shift(), c = w + o.shift(), l = y + (o.length === 1 ? o.shift() : 0), a(b, v, y, w, l, c);
          break;
        case 31:
          for (; o.length > 0 && (b = l + o.shift(), v = c, y = b + o.shift(), w = v + o.shift(), c = w + o.shift(), l = y + (o.length === 1 ? o.shift() : 0), a(b, v, y, w, l, c), o.length !== 0); )
            b = l, v = c + o.shift(), y = b + o.shift(), w = v + o.shift(), l = y + o.shift(), c = w + (o.length === 1 ? o.shift() : 0), a(b, v, y, w, l, c);
          break;
        default:
          if (R < 32) throw new ht(`unknown operator: ${R}`);
          R < 247 ? o.push(R - 139) : R < 251 ? o.push(256 * (R - 247) + d[p++] + 108) : R < 255 ? o.push(256 * -(R - 251) - d[p++] - 108) : (o.push((d[p] << 24 | d[p + 1] << 16 | d[p + 2] << 8 | d[p + 3]) / 65536), p += 4);
      }
      I && (o.length = 0);
    }
  })(i);
}
class uN {
  constructor() {
    ft(this, "cmds", []);
    ft(this, "transformStack", []);
    ft(this, "currentTransform", [1, 0, 0, 1, 0, 0]);
  }
  add(t, e) {
    if (e) {
      const { currentTransform: n } = this;
      for (let s = 0, r = e.length; s < r; s += 2) Ee.applyTransform(e, n, s);
      this.cmds.push(`${t}${e.join(" ")}`);
    } else this.cmds.push(t);
  }
  transform(t) {
    this.currentTransform = Ee.transform(this.currentTransform, t);
  }
  translate(t, e) {
    this.transform([1, 0, 0, 1, t, e]);
  }
  save() {
    this.transformStack.push(this.currentTransform.slice());
  }
  restore() {
    this.currentTransform = this.transformStack.pop() || [1, 0, 0, 1, 0, 0];
  }
  getSVG() {
    return this.cmds.join("");
  }
}
class yD {
  constructor(t) {
    this.fontMatrix = t, this.compiledGlyphs = /* @__PURE__ */ Object.create(null), this.compiledCharCodeToGlyphId = /* @__PURE__ */ Object.create(null);
  }
  getPathJs(t) {
    var a;
    const { charCode: e, glyphId: n } = d3(this.cmap, t);
    let s, r = this.compiledGlyphs[n];
    if (r === void 0) {
      try {
        r = this.compileGlyph(this.glyphs[n], n);
      } catch (o) {
        r = "", s = o;
      }
      this.compiledGlyphs[n] = r;
    }
    if ((a = this.compiledCharCodeToGlyphId)[e] ?? (a[e] = n), s) throw s;
    return r;
  }
  compileGlyph(t, e) {
    if (!(t != null && t.length) || t[0] === 14) return "";
    let n = this.fontMatrix;
    if (this.isCFFCIDFont) {
      const r = this.fdSelect.getFDIndex(e);
      r >= 0 && r < this.fdArray.length ? n = this.fdArray[r].getByName("FontMatrix") || f1 : H("Invalid fd index for glyph index.");
    }
    pn(cs(n, 6), "Expected a valid fontMatrix.");
    const s = new uN();
    return s.transform(n.slice()), this.compileGlyphImpl(t, s, e), s.add("Z"), s.getSVG();
  }
  compileGlyphImpl() {
    ye("Children classes should implement this.");
  }
  hasBuiltPath(t) {
    const { charCode: e, glyphId: n } = d3(this.cmap, t);
    return this.compiledGlyphs[n] !== void 0 && this.compiledCharCodeToGlyphId[e] !== void 0;
  }
}
class dN extends yD {
  constructor(t, e, n) {
    super(n || [488e-6, 0, 0, 488e-6, 0, 0]), this.glyphs = t, this.cmap = e;
  }
  compileGlyphImpl(t, e) {
    bD(t, e, this);
  }
}
class fN extends yD {
  constructor(t, e, n) {
    super(n || [1e-3, 0, 0, 1e-3, 0, 0]), this.glyphs = t.glyphs, this.gsubrs = t.gsubrs || [], this.subrs = t.subrs || [], this.cmap = e, this.glyphNameMap = Ga(), this.gsubrsBias = _b(this.gsubrs), this.subrsBias = _b(this.subrs), this.isCFFCIDFont = t.isCFFCIDFont, this.fdSelect = t.fdSelect, this.fdArray = t.fdArray;
  }
  compileGlyphImpl(t, e, n) {
    xb(t, e, this, n);
  }
}
class pN {
  static create(t, e) {
    const n = new Uint8Array(t.data);
    let s, r, a, o, l, c;
    const h = pe(n, 4);
    for (let u = 0, f = 12; u < h; u++, f += 16) {
      const d = Is(n.subarray(f, f + 4)), p = Ne(n, f + 8), g = Ne(n, f + 12);
      switch (d) {
        case "cmap":
          s = cN(n, p);
          break;
        case "glyf":
          r = n.subarray(p, p + g);
          break;
        case "loca":
          a = n.subarray(p, p + g);
          break;
        case "head":
          c = pe(n, p + 18), l = pe(n, p + 50);
          break;
        case "CFF ":
          o = hN(n, p, p + g, e);
      }
    }
    if (r) {
      const u = c ? [1 / c, 0, 0, 1 / c, 0, 0] : t.fontMatrix;
      return new dN(function(d, p, g) {
        let b, y;
        g ? (b = 4, y = Ne) : (b = 2, y = (_, x) => 2 * pe(_, x));
        const v = [];
        let w = y(p, 0);
        for (let _ = b; _ < p.length; _ += b) {
          const x = y(p, _);
          v.push(d.subarray(w, x)), w = x;
        }
        return v;
      }(r, a, l), s, u);
    }
    return new fN(o, s, t.fontMatrix);
  }
}
const mN = oi(function(i) {
  i.Courier = 600, i["Courier-Bold"] = 600, i["Courier-BoldOblique"] = 600, i["Courier-Oblique"] = 600, i.Helvetica = oi(function(t) {
    t.space = 278, t.exclam = 278, t.quotedbl = 355, t.numbersign = 556, t.dollar = 556, t.percent = 889, t.ampersand = 667, t.quoteright = 222, t.parenleft = 333, t.parenright = 333, t.asterisk = 389, t.plus = 584, t.comma = 278, t.hyphen = 333, t.period = 278, t.slash = 278, t.zero = 556, t.one = 556, t.two = 556, t.three = 556, t.four = 556, t.five = 556, t.six = 556, t.seven = 556, t.eight = 556, t.nine = 556, t.colon = 278, t.semicolon = 278, t.less = 584, t.equal = 584, t.greater = 584, t.question = 556, t.at = 1015, t.A = 667, t.B = 667, t.C = 722, t.D = 722, t.E = 667, t.F = 611, t.G = 778, t.H = 722, t.I = 278, t.J = 500, t.K = 667, t.L = 556, t.M = 833, t.N = 722, t.O = 778, t.P = 667, t.Q = 778, t.R = 722, t.S = 667, t.T = 611, t.U = 722, t.V = 667, t.W = 944, t.X = 667, t.Y = 667, t.Z = 611, t.bracketleft = 278, t.backslash = 278, t.bracketright = 278, t.asciicircum = 469, t.underscore = 556, t.quoteleft = 222, t.a = 556, t.b = 556, t.c = 500, t.d = 556, t.e = 556, t.f = 278, t.g = 556, t.h = 556, t.i = 222, t.j = 222, t.k = 500, t.l = 222, t.m = 833, t.n = 556, t.o = 556, t.p = 556, t.q = 556, t.r = 333, t.s = 500, t.t = 278, t.u = 556, t.v = 500, t.w = 722, t.x = 500, t.y = 500, t.z = 500, t.braceleft = 334, t.bar = 260, t.braceright = 334, t.asciitilde = 584, t.exclamdown = 333, t.cent = 556, t.sterling = 556, t.fraction = 167, t.yen = 556, t.florin = 556, t.section = 556, t.currency = 556, t.quotesingle = 191, t.quotedblleft = 333, t.guillemotleft = 556, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 500, t.fl = 500, t.endash = 556, t.dagger = 556, t.daggerdbl = 556, t.periodcentered = 278, t.paragraph = 537, t.bullet = 350, t.quotesinglbase = 222, t.quotedblbase = 333, t.quotedblright = 333, t.guillemotright = 556, t.ellipsis = 1e3, t.perthousand = 1e3, t.questiondown = 611, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 1e3, t.AE = 1e3, t.ordfeminine = 370, t.Lslash = 556, t.Oslash = 778, t.OE = 1e3, t.ordmasculine = 365, t.ae = 889, t.dotlessi = 278, t.lslash = 222, t.oslash = 611, t.oe = 944, t.germandbls = 611, t.Idieresis = 278, t.eacute = 556, t.abreve = 556, t.uhungarumlaut = 556, t.ecaron = 556, t.Ydieresis = 667, t.divide = 584, t.Yacute = 667, t.Acircumflex = 667, t.aacute = 556, t.Ucircumflex = 722, t.yacute = 500, t.scommaaccent = 500, t.ecircumflex = 556, t.Uring = 722, t.Udieresis = 722, t.aogonek = 556, t.Uacute = 722, t.uogonek = 556, t.Edieresis = 667, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 737, t.Emacron = 667, t.ccaron = 500, t.aring = 556, t.Ncommaaccent = 722, t.lacute = 222, t.agrave = 556, t.Tcommaaccent = 611, t.Cacute = 722, t.atilde = 556, t.Edotaccent = 667, t.scaron = 500, t.scedilla = 500, t.iacute = 278, t.lozenge = 471, t.Rcaron = 722, t.Gcommaaccent = 778, t.ucircumflex = 556, t.acircumflex = 556, t.Amacron = 667, t.rcaron = 333, t.ccedilla = 500, t.Zdotaccent = 611, t.Thorn = 667, t.Omacron = 778, t.Racute = 722, t.Sacute = 667, t.dcaron = 643, t.Umacron = 722, t.uring = 556, t.threesuperior = 333, t.Ograve = 778, t.Agrave = 667, t.Abreve = 667, t.multiply = 584, t.uacute = 556, t.Tcaron = 611, t.partialdiff = 476, t.ydieresis = 500, t.Nacute = 722, t.icircumflex = 278, t.Ecircumflex = 667, t.adieresis = 556, t.edieresis = 556, t.cacute = 500, t.nacute = 556, t.umacron = 556, t.Ncaron = 722, t.Iacute = 278, t.plusminus = 584, t.brokenbar = 260, t.registered = 737, t.Gbreve = 778, t.Idotaccent = 278, t.summation = 600, t.Egrave = 667, t.racute = 333, t.omacron = 556, t.Zacute = 611, t.Zcaron = 611, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 722, t.lcommaaccent = 222, t.tcaron = 317, t.eogonek = 556, t.Uogonek = 722, t.Aacute = 667, t.Adieresis = 667, t.egrave = 556, t.zacute = 500, t.iogonek = 222, t.Oacute = 778, t.oacute = 556, t.amacron = 556, t.sacute = 500, t.idieresis = 278, t.Ocircumflex = 778, t.Ugrave = 722, t.Delta = 612, t.thorn = 556, t.twosuperior = 333, t.Odieresis = 778, t.mu = 556, t.igrave = 278, t.ohungarumlaut = 556, t.Eogonek = 667, t.dcroat = 556, t.threequarters = 834, t.Scedilla = 667, t.lcaron = 299, t.Kcommaaccent = 667, t.Lacute = 556, t.trademark = 1e3, t.edotaccent = 556, t.Igrave = 278, t.Imacron = 278, t.Lcaron = 556, t.onehalf = 834, t.lessequal = 549, t.ocircumflex = 556, t.ntilde = 556, t.Uhungarumlaut = 722, t.Eacute = 667, t.emacron = 556, t.gbreve = 556, t.onequarter = 834, t.Scaron = 667, t.Scommaaccent = 667, t.Ohungarumlaut = 778, t.degree = 400, t.ograve = 556, t.Ccaron = 722, t.ugrave = 556, t.radical = 453, t.Dcaron = 722, t.rcommaaccent = 333, t.Ntilde = 722, t.otilde = 556, t.Rcommaaccent = 722, t.Lcommaaccent = 556, t.Atilde = 667, t.Aogonek = 667, t.Aring = 667, t.Otilde = 778, t.zdotaccent = 500, t.Ecaron = 667, t.Iogonek = 278, t.kcommaaccent = 500, t.minus = 584, t.Icircumflex = 278, t.ncaron = 556, t.tcommaaccent = 278, t.logicalnot = 584, t.odieresis = 556, t.udieresis = 556, t.notequal = 549, t.gcommaaccent = 556, t.eth = 556, t.zcaron = 500, t.ncommaaccent = 556, t.onesuperior = 333, t.imacron = 278, t.Euro = 556;
  }), i["Helvetica-Bold"] = oi(function(t) {
    t.space = 278, t.exclam = 333, t.quotedbl = 474, t.numbersign = 556, t.dollar = 556, t.percent = 889, t.ampersand = 722, t.quoteright = 278, t.parenleft = 333, t.parenright = 333, t.asterisk = 389, t.plus = 584, t.comma = 278, t.hyphen = 333, t.period = 278, t.slash = 278, t.zero = 556, t.one = 556, t.two = 556, t.three = 556, t.four = 556, t.five = 556, t.six = 556, t.seven = 556, t.eight = 556, t.nine = 556, t.colon = 333, t.semicolon = 333, t.less = 584, t.equal = 584, t.greater = 584, t.question = 611, t.at = 975, t.A = 722, t.B = 722, t.C = 722, t.D = 722, t.E = 667, t.F = 611, t.G = 778, t.H = 722, t.I = 278, t.J = 556, t.K = 722, t.L = 611, t.M = 833, t.N = 722, t.O = 778, t.P = 667, t.Q = 778, t.R = 722, t.S = 667, t.T = 611, t.U = 722, t.V = 667, t.W = 944, t.X = 667, t.Y = 667, t.Z = 611, t.bracketleft = 333, t.backslash = 278, t.bracketright = 333, t.asciicircum = 584, t.underscore = 556, t.quoteleft = 278, t.a = 556, t.b = 611, t.c = 556, t.d = 611, t.e = 556, t.f = 333, t.g = 611, t.h = 611, t.i = 278, t.j = 278, t.k = 556, t.l = 278, t.m = 889, t.n = 611, t.o = 611, t.p = 611, t.q = 611, t.r = 389, t.s = 556, t.t = 333, t.u = 611, t.v = 556, t.w = 778, t.x = 556, t.y = 556, t.z = 500, t.braceleft = 389, t.bar = 280, t.braceright = 389, t.asciitilde = 584, t.exclamdown = 333, t.cent = 556, t.sterling = 556, t.fraction = 167, t.yen = 556, t.florin = 556, t.section = 556, t.currency = 556, t.quotesingle = 238, t.quotedblleft = 500, t.guillemotleft = 556, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 611, t.fl = 611, t.endash = 556, t.dagger = 556, t.daggerdbl = 556, t.periodcentered = 278, t.paragraph = 556, t.bullet = 350, t.quotesinglbase = 278, t.quotedblbase = 500, t.quotedblright = 500, t.guillemotright = 556, t.ellipsis = 1e3, t.perthousand = 1e3, t.questiondown = 611, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 1e3, t.AE = 1e3, t.ordfeminine = 370, t.Lslash = 611, t.Oslash = 778, t.OE = 1e3, t.ordmasculine = 365, t.ae = 889, t.dotlessi = 278, t.lslash = 278, t.oslash = 611, t.oe = 944, t.germandbls = 611, t.Idieresis = 278, t.eacute = 556, t.abreve = 556, t.uhungarumlaut = 611, t.ecaron = 556, t.Ydieresis = 667, t.divide = 584, t.Yacute = 667, t.Acircumflex = 722, t.aacute = 556, t.Ucircumflex = 722, t.yacute = 556, t.scommaaccent = 556, t.ecircumflex = 556, t.Uring = 722, t.Udieresis = 722, t.aogonek = 556, t.Uacute = 722, t.uogonek = 611, t.Edieresis = 667, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 737, t.Emacron = 667, t.ccaron = 556, t.aring = 556, t.Ncommaaccent = 722, t.lacute = 278, t.agrave = 556, t.Tcommaaccent = 611, t.Cacute = 722, t.atilde = 556, t.Edotaccent = 667, t.scaron = 556, t.scedilla = 556, t.iacute = 278, t.lozenge = 494, t.Rcaron = 722, t.Gcommaaccent = 778, t.ucircumflex = 611, t.acircumflex = 556, t.Amacron = 722, t.rcaron = 389, t.ccedilla = 556, t.Zdotaccent = 611, t.Thorn = 667, t.Omacron = 778, t.Racute = 722, t.Sacute = 667, t.dcaron = 743, t.Umacron = 722, t.uring = 611, t.threesuperior = 333, t.Ograve = 778, t.Agrave = 722, t.Abreve = 722, t.multiply = 584, t.uacute = 611, t.Tcaron = 611, t.partialdiff = 494, t.ydieresis = 556, t.Nacute = 722, t.icircumflex = 278, t.Ecircumflex = 667, t.adieresis = 556, t.edieresis = 556, t.cacute = 556, t.nacute = 611, t.umacron = 611, t.Ncaron = 722, t.Iacute = 278, t.plusminus = 584, t.brokenbar = 280, t.registered = 737, t.Gbreve = 778, t.Idotaccent = 278, t.summation = 600, t.Egrave = 667, t.racute = 389, t.omacron = 611, t.Zacute = 611, t.Zcaron = 611, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 722, t.lcommaaccent = 278, t.tcaron = 389, t.eogonek = 556, t.Uogonek = 722, t.Aacute = 722, t.Adieresis = 722, t.egrave = 556, t.zacute = 500, t.iogonek = 278, t.Oacute = 778, t.oacute = 611, t.amacron = 556, t.sacute = 556, t.idieresis = 278, t.Ocircumflex = 778, t.Ugrave = 722, t.Delta = 612, t.thorn = 611, t.twosuperior = 333, t.Odieresis = 778, t.mu = 611, t.igrave = 278, t.ohungarumlaut = 611, t.Eogonek = 667, t.dcroat = 611, t.threequarters = 834, t.Scedilla = 667, t.lcaron = 400, t.Kcommaaccent = 722, t.Lacute = 611, t.trademark = 1e3, t.edotaccent = 556, t.Igrave = 278, t.Imacron = 278, t.Lcaron = 611, t.onehalf = 834, t.lessequal = 549, t.ocircumflex = 611, t.ntilde = 611, t.Uhungarumlaut = 722, t.Eacute = 667, t.emacron = 556, t.gbreve = 611, t.onequarter = 834, t.Scaron = 667, t.Scommaaccent = 667, t.Ohungarumlaut = 778, t.degree = 400, t.ograve = 611, t.Ccaron = 722, t.ugrave = 611, t.radical = 549, t.Dcaron = 722, t.rcommaaccent = 389, t.Ntilde = 722, t.otilde = 611, t.Rcommaaccent = 722, t.Lcommaaccent = 611, t.Atilde = 722, t.Aogonek = 722, t.Aring = 722, t.Otilde = 778, t.zdotaccent = 500, t.Ecaron = 667, t.Iogonek = 278, t.kcommaaccent = 556, t.minus = 584, t.Icircumflex = 278, t.ncaron = 611, t.tcommaaccent = 333, t.logicalnot = 584, t.odieresis = 611, t.udieresis = 611, t.notequal = 549, t.gcommaaccent = 611, t.eth = 611, t.zcaron = 500, t.ncommaaccent = 611, t.onesuperior = 333, t.imacron = 278, t.Euro = 556;
  }), i["Helvetica-BoldOblique"] = oi(function(t) {
    t.space = 278, t.exclam = 333, t.quotedbl = 474, t.numbersign = 556, t.dollar = 556, t.percent = 889, t.ampersand = 722, t.quoteright = 278, t.parenleft = 333, t.parenright = 333, t.asterisk = 389, t.plus = 584, t.comma = 278, t.hyphen = 333, t.period = 278, t.slash = 278, t.zero = 556, t.one = 556, t.two = 556, t.three = 556, t.four = 556, t.five = 556, t.six = 556, t.seven = 556, t.eight = 556, t.nine = 556, t.colon = 333, t.semicolon = 333, t.less = 584, t.equal = 584, t.greater = 584, t.question = 611, t.at = 975, t.A = 722, t.B = 722, t.C = 722, t.D = 722, t.E = 667, t.F = 611, t.G = 778, t.H = 722, t.I = 278, t.J = 556, t.K = 722, t.L = 611, t.M = 833, t.N = 722, t.O = 778, t.P = 667, t.Q = 778, t.R = 722, t.S = 667, t.T = 611, t.U = 722, t.V = 667, t.W = 944, t.X = 667, t.Y = 667, t.Z = 611, t.bracketleft = 333, t.backslash = 278, t.bracketright = 333, t.asciicircum = 584, t.underscore = 556, t.quoteleft = 278, t.a = 556, t.b = 611, t.c = 556, t.d = 611, t.e = 556, t.f = 333, t.g = 611, t.h = 611, t.i = 278, t.j = 278, t.k = 556, t.l = 278, t.m = 889, t.n = 611, t.o = 611, t.p = 611, t.q = 611, t.r = 389, t.s = 556, t.t = 333, t.u = 611, t.v = 556, t.w = 778, t.x = 556, t.y = 556, t.z = 500, t.braceleft = 389, t.bar = 280, t.braceright = 389, t.asciitilde = 584, t.exclamdown = 333, t.cent = 556, t.sterling = 556, t.fraction = 167, t.yen = 556, t.florin = 556, t.section = 556, t.currency = 556, t.quotesingle = 238, t.quotedblleft = 500, t.guillemotleft = 556, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 611, t.fl = 611, t.endash = 556, t.dagger = 556, t.daggerdbl = 556, t.periodcentered = 278, t.paragraph = 556, t.bullet = 350, t.quotesinglbase = 278, t.quotedblbase = 500, t.quotedblright = 500, t.guillemotright = 556, t.ellipsis = 1e3, t.perthousand = 1e3, t.questiondown = 611, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 1e3, t.AE = 1e3, t.ordfeminine = 370, t.Lslash = 611, t.Oslash = 778, t.OE = 1e3, t.ordmasculine = 365, t.ae = 889, t.dotlessi = 278, t.lslash = 278, t.oslash = 611, t.oe = 944, t.germandbls = 611, t.Idieresis = 278, t.eacute = 556, t.abreve = 556, t.uhungarumlaut = 611, t.ecaron = 556, t.Ydieresis = 667, t.divide = 584, t.Yacute = 667, t.Acircumflex = 722, t.aacute = 556, t.Ucircumflex = 722, t.yacute = 556, t.scommaaccent = 556, t.ecircumflex = 556, t.Uring = 722, t.Udieresis = 722, t.aogonek = 556, t.Uacute = 722, t.uogonek = 611, t.Edieresis = 667, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 737, t.Emacron = 667, t.ccaron = 556, t.aring = 556, t.Ncommaaccent = 722, t.lacute = 278, t.agrave = 556, t.Tcommaaccent = 611, t.Cacute = 722, t.atilde = 556, t.Edotaccent = 667, t.scaron = 556, t.scedilla = 556, t.iacute = 278, t.lozenge = 494, t.Rcaron = 722, t.Gcommaaccent = 778, t.ucircumflex = 611, t.acircumflex = 556, t.Amacron = 722, t.rcaron = 389, t.ccedilla = 556, t.Zdotaccent = 611, t.Thorn = 667, t.Omacron = 778, t.Racute = 722, t.Sacute = 667, t.dcaron = 743, t.Umacron = 722, t.uring = 611, t.threesuperior = 333, t.Ograve = 778, t.Agrave = 722, t.Abreve = 722, t.multiply = 584, t.uacute = 611, t.Tcaron = 611, t.partialdiff = 494, t.ydieresis = 556, t.Nacute = 722, t.icircumflex = 278, t.Ecircumflex = 667, t.adieresis = 556, t.edieresis = 556, t.cacute = 556, t.nacute = 611, t.umacron = 611, t.Ncaron = 722, t.Iacute = 278, t.plusminus = 584, t.brokenbar = 280, t.registered = 737, t.Gbreve = 778, t.Idotaccent = 278, t.summation = 600, t.Egrave = 667, t.racute = 389, t.omacron = 611, t.Zacute = 611, t.Zcaron = 611, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 722, t.lcommaaccent = 278, t.tcaron = 389, t.eogonek = 556, t.Uogonek = 722, t.Aacute = 722, t.Adieresis = 722, t.egrave = 556, t.zacute = 500, t.iogonek = 278, t.Oacute = 778, t.oacute = 611, t.amacron = 556, t.sacute = 556, t.idieresis = 278, t.Ocircumflex = 778, t.Ugrave = 722, t.Delta = 612, t.thorn = 611, t.twosuperior = 333, t.Odieresis = 778, t.mu = 611, t.igrave = 278, t.ohungarumlaut = 611, t.Eogonek = 667, t.dcroat = 611, t.threequarters = 834, t.Scedilla = 667, t.lcaron = 400, t.Kcommaaccent = 722, t.Lacute = 611, t.trademark = 1e3, t.edotaccent = 556, t.Igrave = 278, t.Imacron = 278, t.Lcaron = 611, t.onehalf = 834, t.lessequal = 549, t.ocircumflex = 611, t.ntilde = 611, t.Uhungarumlaut = 722, t.Eacute = 667, t.emacron = 556, t.gbreve = 611, t.onequarter = 834, t.Scaron = 667, t.Scommaaccent = 667, t.Ohungarumlaut = 778, t.degree = 400, t.ograve = 611, t.Ccaron = 722, t.ugrave = 611, t.radical = 549, t.Dcaron = 722, t.rcommaaccent = 389, t.Ntilde = 722, t.otilde = 611, t.Rcommaaccent = 722, t.Lcommaaccent = 611, t.Atilde = 722, t.Aogonek = 722, t.Aring = 722, t.Otilde = 778, t.zdotaccent = 500, t.Ecaron = 667, t.Iogonek = 278, t.kcommaaccent = 556, t.minus = 584, t.Icircumflex = 278, t.ncaron = 611, t.tcommaaccent = 333, t.logicalnot = 584, t.odieresis = 611, t.udieresis = 611, t.notequal = 549, t.gcommaaccent = 611, t.eth = 611, t.zcaron = 500, t.ncommaaccent = 611, t.onesuperior = 333, t.imacron = 278, t.Euro = 556;
  }), i["Helvetica-Oblique"] = oi(function(t) {
    t.space = 278, t.exclam = 278, t.quotedbl = 355, t.numbersign = 556, t.dollar = 556, t.percent = 889, t.ampersand = 667, t.quoteright = 222, t.parenleft = 333, t.parenright = 333, t.asterisk = 389, t.plus = 584, t.comma = 278, t.hyphen = 333, t.period = 278, t.slash = 278, t.zero = 556, t.one = 556, t.two = 556, t.three = 556, t.four = 556, t.five = 556, t.six = 556, t.seven = 556, t.eight = 556, t.nine = 556, t.colon = 278, t.semicolon = 278, t.less = 584, t.equal = 584, t.greater = 584, t.question = 556, t.at = 1015, t.A = 667, t.B = 667, t.C = 722, t.D = 722, t.E = 667, t.F = 611, t.G = 778, t.H = 722, t.I = 278, t.J = 500, t.K = 667, t.L = 556, t.M = 833, t.N = 722, t.O = 778, t.P = 667, t.Q = 778, t.R = 722, t.S = 667, t.T = 611, t.U = 722, t.V = 667, t.W = 944, t.X = 667, t.Y = 667, t.Z = 611, t.bracketleft = 278, t.backslash = 278, t.bracketright = 278, t.asciicircum = 469, t.underscore = 556, t.quoteleft = 222, t.a = 556, t.b = 556, t.c = 500, t.d = 556, t.e = 556, t.f = 278, t.g = 556, t.h = 556, t.i = 222, t.j = 222, t.k = 500, t.l = 222, t.m = 833, t.n = 556, t.o = 556, t.p = 556, t.q = 556, t.r = 333, t.s = 500, t.t = 278, t.u = 556, t.v = 500, t.w = 722, t.x = 500, t.y = 500, t.z = 500, t.braceleft = 334, t.bar = 260, t.braceright = 334, t.asciitilde = 584, t.exclamdown = 333, t.cent = 556, t.sterling = 556, t.fraction = 167, t.yen = 556, t.florin = 556, t.section = 556, t.currency = 556, t.quotesingle = 191, t.quotedblleft = 333, t.guillemotleft = 556, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 500, t.fl = 500, t.endash = 556, t.dagger = 556, t.daggerdbl = 556, t.periodcentered = 278, t.paragraph = 537, t.bullet = 350, t.quotesinglbase = 222, t.quotedblbase = 333, t.quotedblright = 333, t.guillemotright = 556, t.ellipsis = 1e3, t.perthousand = 1e3, t.questiondown = 611, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 1e3, t.AE = 1e3, t.ordfeminine = 370, t.Lslash = 556, t.Oslash = 778, t.OE = 1e3, t.ordmasculine = 365, t.ae = 889, t.dotlessi = 278, t.lslash = 222, t.oslash = 611, t.oe = 944, t.germandbls = 611, t.Idieresis = 278, t.eacute = 556, t.abreve = 556, t.uhungarumlaut = 556, t.ecaron = 556, t.Ydieresis = 667, t.divide = 584, t.Yacute = 667, t.Acircumflex = 667, t.aacute = 556, t.Ucircumflex = 722, t.yacute = 500, t.scommaaccent = 500, t.ecircumflex = 556, t.Uring = 722, t.Udieresis = 722, t.aogonek = 556, t.Uacute = 722, t.uogonek = 556, t.Edieresis = 667, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 737, t.Emacron = 667, t.ccaron = 500, t.aring = 556, t.Ncommaaccent = 722, t.lacute = 222, t.agrave = 556, t.Tcommaaccent = 611, t.Cacute = 722, t.atilde = 556, t.Edotaccent = 667, t.scaron = 500, t.scedilla = 500, t.iacute = 278, t.lozenge = 471, t.Rcaron = 722, t.Gcommaaccent = 778, t.ucircumflex = 556, t.acircumflex = 556, t.Amacron = 667, t.rcaron = 333, t.ccedilla = 500, t.Zdotaccent = 611, t.Thorn = 667, t.Omacron = 778, t.Racute = 722, t.Sacute = 667, t.dcaron = 643, t.Umacron = 722, t.uring = 556, t.threesuperior = 333, t.Ograve = 778, t.Agrave = 667, t.Abreve = 667, t.multiply = 584, t.uacute = 556, t.Tcaron = 611, t.partialdiff = 476, t.ydieresis = 500, t.Nacute = 722, t.icircumflex = 278, t.Ecircumflex = 667, t.adieresis = 556, t.edieresis = 556, t.cacute = 500, t.nacute = 556, t.umacron = 556, t.Ncaron = 722, t.Iacute = 278, t.plusminus = 584, t.brokenbar = 260, t.registered = 737, t.Gbreve = 778, t.Idotaccent = 278, t.summation = 600, t.Egrave = 667, t.racute = 333, t.omacron = 556, t.Zacute = 611, t.Zcaron = 611, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 722, t.lcommaaccent = 222, t.tcaron = 317, t.eogonek = 556, t.Uogonek = 722, t.Aacute = 667, t.Adieresis = 667, t.egrave = 556, t.zacute = 500, t.iogonek = 222, t.Oacute = 778, t.oacute = 556, t.amacron = 556, t.sacute = 500, t.idieresis = 278, t.Ocircumflex = 778, t.Ugrave = 722, t.Delta = 612, t.thorn = 556, t.twosuperior = 333, t.Odieresis = 778, t.mu = 556, t.igrave = 278, t.ohungarumlaut = 556, t.Eogonek = 667, t.dcroat = 556, t.threequarters = 834, t.Scedilla = 667, t.lcaron = 299, t.Kcommaaccent = 667, t.Lacute = 556, t.trademark = 1e3, t.edotaccent = 556, t.Igrave = 278, t.Imacron = 278, t.Lcaron = 556, t.onehalf = 834, t.lessequal = 549, t.ocircumflex = 556, t.ntilde = 556, t.Uhungarumlaut = 722, t.Eacute = 667, t.emacron = 556, t.gbreve = 556, t.onequarter = 834, t.Scaron = 667, t.Scommaaccent = 667, t.Ohungarumlaut = 778, t.degree = 400, t.ograve = 556, t.Ccaron = 722, t.ugrave = 556, t.radical = 453, t.Dcaron = 722, t.rcommaaccent = 333, t.Ntilde = 722, t.otilde = 556, t.Rcommaaccent = 722, t.Lcommaaccent = 556, t.Atilde = 667, t.Aogonek = 667, t.Aring = 667, t.Otilde = 778, t.zdotaccent = 500, t.Ecaron = 667, t.Iogonek = 278, t.kcommaaccent = 500, t.minus = 584, t.Icircumflex = 278, t.ncaron = 556, t.tcommaaccent = 278, t.logicalnot = 584, t.odieresis = 556, t.udieresis = 556, t.notequal = 549, t.gcommaaccent = 556, t.eth = 556, t.zcaron = 500, t.ncommaaccent = 556, t.onesuperior = 333, t.imacron = 278, t.Euro = 556;
  }), i.Symbol = oi(function(t) {
    t.space = 250, t.exclam = 333, t.universal = 713, t.numbersign = 500, t.existential = 549, t.percent = 833, t.ampersand = 778, t.suchthat = 439, t.parenleft = 333, t.parenright = 333, t.asteriskmath = 500, t.plus = 549, t.comma = 250, t.minus = 549, t.period = 250, t.slash = 278, t.zero = 500, t.one = 500, t.two = 500, t.three = 500, t.four = 500, t.five = 500, t.six = 500, t.seven = 500, t.eight = 500, t.nine = 500, t.colon = 278, t.semicolon = 278, t.less = 549, t.equal = 549, t.greater = 549, t.question = 444, t.congruent = 549, t.Alpha = 722, t.Beta = 667, t.Chi = 722, t.Delta = 612, t.Epsilon = 611, t.Phi = 763, t.Gamma = 603, t.Eta = 722, t.Iota = 333, t.theta1 = 631, t.Kappa = 722, t.Lambda = 686, t.Mu = 889, t.Nu = 722, t.Omicron = 722, t.Pi = 768, t.Theta = 741, t.Rho = 556, t.Sigma = 592, t.Tau = 611, t.Upsilon = 690, t.sigma1 = 439, t.Omega = 768, t.Xi = 645, t.Psi = 795, t.Zeta = 611, t.bracketleft = 333, t.therefore = 863, t.bracketright = 333, t.perpendicular = 658, t.underscore = 500, t.radicalex = 500, t.alpha = 631, t.beta = 549, t.chi = 549, t.delta = 494, t.epsilon = 439, t.phi = 521, t.gamma = 411, t.eta = 603, t.iota = 329, t.phi1 = 603, t.kappa = 549, t.lambda = 549, t.mu = 576, t.nu = 521, t.omicron = 549, t.pi = 549, t.theta = 521, t.rho = 549, t.sigma = 603, t.tau = 439, t.upsilon = 576, t.omega1 = 713, t.omega = 686, t.xi = 493, t.psi = 686, t.zeta = 494, t.braceleft = 480, t.bar = 200, t.braceright = 480, t.similar = 549, t.Euro = 750, t.Upsilon1 = 620, t.minute = 247, t.lessequal = 549, t.fraction = 167, t.infinity = 713, t.florin = 500, t.club = 753, t.diamond = 753, t.heart = 753, t.spade = 753, t.arrowboth = 1042, t.arrowleft = 987, t.arrowup = 603, t.arrowright = 987, t.arrowdown = 603, t.degree = 400, t.plusminus = 549, t.second = 411, t.greaterequal = 549, t.multiply = 549, t.proportional = 713, t.partialdiff = 494, t.bullet = 460, t.divide = 549, t.notequal = 549, t.equivalence = 549, t.approxequal = 549, t.ellipsis = 1e3, t.arrowvertex = 603, t.arrowhorizex = 1e3, t.carriagereturn = 658, t.aleph = 823, t.Ifraktur = 686, t.Rfraktur = 795, t.weierstrass = 987, t.circlemultiply = 768, t.circleplus = 768, t.emptyset = 823, t.intersection = 768, t.union = 768, t.propersuperset = 713, t.reflexsuperset = 713, t.notsubset = 713, t.propersubset = 713, t.reflexsubset = 713, t.element = 713, t.notelement = 713, t.angle = 768, t.gradient = 713, t.registerserif = 790, t.copyrightserif = 790, t.trademarkserif = 890, t.product = 823, t.radical = 549, t.dotmath = 250, t.logicalnot = 713, t.logicaland = 603, t.logicalor = 603, t.arrowdblboth = 1042, t.arrowdblleft = 987, t.arrowdblup = 603, t.arrowdblright = 987, t.arrowdbldown = 603, t.lozenge = 494, t.angleleft = 329, t.registersans = 790, t.copyrightsans = 790, t.trademarksans = 786, t.summation = 713, t.parenlefttp = 384, t.parenleftex = 384, t.parenleftbt = 384, t.bracketlefttp = 384, t.bracketleftex = 384, t.bracketleftbt = 384, t.bracelefttp = 494, t.braceleftmid = 494, t.braceleftbt = 494, t.braceex = 494, t.angleright = 329, t.integral = 274, t.integraltp = 686, t.integralex = 686, t.integralbt = 686, t.parenrighttp = 384, t.parenrightex = 384, t.parenrightbt = 384, t.bracketrighttp = 384, t.bracketrightex = 384, t.bracketrightbt = 384, t.bracerighttp = 494, t.bracerightmid = 494, t.bracerightbt = 494, t.apple = 790;
  }), i["Times-Roman"] = oi(function(t) {
    t.space = 250, t.exclam = 333, t.quotedbl = 408, t.numbersign = 500, t.dollar = 500, t.percent = 833, t.ampersand = 778, t.quoteright = 333, t.parenleft = 333, t.parenright = 333, t.asterisk = 500, t.plus = 564, t.comma = 250, t.hyphen = 333, t.period = 250, t.slash = 278, t.zero = 500, t.one = 500, t.two = 500, t.three = 500, t.four = 500, t.five = 500, t.six = 500, t.seven = 500, t.eight = 500, t.nine = 500, t.colon = 278, t.semicolon = 278, t.less = 564, t.equal = 564, t.greater = 564, t.question = 444, t.at = 921, t.A = 722, t.B = 667, t.C = 667, t.D = 722, t.E = 611, t.F = 556, t.G = 722, t.H = 722, t.I = 333, t.J = 389, t.K = 722, t.L = 611, t.M = 889, t.N = 722, t.O = 722, t.P = 556, t.Q = 722, t.R = 667, t.S = 556, t.T = 611, t.U = 722, t.V = 722, t.W = 944, t.X = 722, t.Y = 722, t.Z = 611, t.bracketleft = 333, t.backslash = 278, t.bracketright = 333, t.asciicircum = 469, t.underscore = 500, t.quoteleft = 333, t.a = 444, t.b = 500, t.c = 444, t.d = 500, t.e = 444, t.f = 333, t.g = 500, t.h = 500, t.i = 278, t.j = 278, t.k = 500, t.l = 278, t.m = 778, t.n = 500, t.o = 500, t.p = 500, t.q = 500, t.r = 333, t.s = 389, t.t = 278, t.u = 500, t.v = 500, t.w = 722, t.x = 500, t.y = 500, t.z = 444, t.braceleft = 480, t.bar = 200, t.braceright = 480, t.asciitilde = 541, t.exclamdown = 333, t.cent = 500, t.sterling = 500, t.fraction = 167, t.yen = 500, t.florin = 500, t.section = 500, t.currency = 500, t.quotesingle = 180, t.quotedblleft = 444, t.guillemotleft = 500, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 556, t.fl = 556, t.endash = 500, t.dagger = 500, t.daggerdbl = 500, t.periodcentered = 250, t.paragraph = 453, t.bullet = 350, t.quotesinglbase = 333, t.quotedblbase = 444, t.quotedblright = 444, t.guillemotright = 500, t.ellipsis = 1e3, t.perthousand = 1e3, t.questiondown = 444, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 1e3, t.AE = 889, t.ordfeminine = 276, t.Lslash = 611, t.Oslash = 722, t.OE = 889, t.ordmasculine = 310, t.ae = 667, t.dotlessi = 278, t.lslash = 278, t.oslash = 500, t.oe = 722, t.germandbls = 500, t.Idieresis = 333, t.eacute = 444, t.abreve = 444, t.uhungarumlaut = 500, t.ecaron = 444, t.Ydieresis = 722, t.divide = 564, t.Yacute = 722, t.Acircumflex = 722, t.aacute = 444, t.Ucircumflex = 722, t.yacute = 500, t.scommaaccent = 389, t.ecircumflex = 444, t.Uring = 722, t.Udieresis = 722, t.aogonek = 444, t.Uacute = 722, t.uogonek = 500, t.Edieresis = 611, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 760, t.Emacron = 611, t.ccaron = 444, t.aring = 444, t.Ncommaaccent = 722, t.lacute = 278, t.agrave = 444, t.Tcommaaccent = 611, t.Cacute = 667, t.atilde = 444, t.Edotaccent = 611, t.scaron = 389, t.scedilla = 389, t.iacute = 278, t.lozenge = 471, t.Rcaron = 667, t.Gcommaaccent = 722, t.ucircumflex = 500, t.acircumflex = 444, t.Amacron = 722, t.rcaron = 333, t.ccedilla = 444, t.Zdotaccent = 611, t.Thorn = 556, t.Omacron = 722, t.Racute = 667, t.Sacute = 556, t.dcaron = 588, t.Umacron = 722, t.uring = 500, t.threesuperior = 300, t.Ograve = 722, t.Agrave = 722, t.Abreve = 722, t.multiply = 564, t.uacute = 500, t.Tcaron = 611, t.partialdiff = 476, t.ydieresis = 500, t.Nacute = 722, t.icircumflex = 278, t.Ecircumflex = 611, t.adieresis = 444, t.edieresis = 444, t.cacute = 444, t.nacute = 500, t.umacron = 500, t.Ncaron = 722, t.Iacute = 333, t.plusminus = 564, t.brokenbar = 200, t.registered = 760, t.Gbreve = 722, t.Idotaccent = 333, t.summation = 600, t.Egrave = 611, t.racute = 333, t.omacron = 500, t.Zacute = 611, t.Zcaron = 611, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 667, t.lcommaaccent = 278, t.tcaron = 326, t.eogonek = 444, t.Uogonek = 722, t.Aacute = 722, t.Adieresis = 722, t.egrave = 444, t.zacute = 444, t.iogonek = 278, t.Oacute = 722, t.oacute = 500, t.amacron = 444, t.sacute = 389, t.idieresis = 278, t.Ocircumflex = 722, t.Ugrave = 722, t.Delta = 612, t.thorn = 500, t.twosuperior = 300, t.Odieresis = 722, t.mu = 500, t.igrave = 278, t.ohungarumlaut = 500, t.Eogonek = 611, t.dcroat = 500, t.threequarters = 750, t.Scedilla = 556, t.lcaron = 344, t.Kcommaaccent = 722, t.Lacute = 611, t.trademark = 980, t.edotaccent = 444, t.Igrave = 333, t.Imacron = 333, t.Lcaron = 611, t.onehalf = 750, t.lessequal = 549, t.ocircumflex = 500, t.ntilde = 500, t.Uhungarumlaut = 722, t.Eacute = 611, t.emacron = 444, t.gbreve = 500, t.onequarter = 750, t.Scaron = 556, t.Scommaaccent = 556, t.Ohungarumlaut = 722, t.degree = 400, t.ograve = 500, t.Ccaron = 667, t.ugrave = 500, t.radical = 453, t.Dcaron = 722, t.rcommaaccent = 333, t.Ntilde = 722, t.otilde = 500, t.Rcommaaccent = 667, t.Lcommaaccent = 611, t.Atilde = 722, t.Aogonek = 722, t.Aring = 722, t.Otilde = 722, t.zdotaccent = 444, t.Ecaron = 611, t.Iogonek = 333, t.kcommaaccent = 500, t.minus = 564, t.Icircumflex = 333, t.ncaron = 500, t.tcommaaccent = 278, t.logicalnot = 564, t.odieresis = 500, t.udieresis = 500, t.notequal = 549, t.gcommaaccent = 500, t.eth = 500, t.zcaron = 444, t.ncommaaccent = 500, t.onesuperior = 300, t.imacron = 278, t.Euro = 500;
  }), i["Times-Bold"] = oi(function(t) {
    t.space = 250, t.exclam = 333, t.quotedbl = 555, t.numbersign = 500, t.dollar = 500, t.percent = 1e3, t.ampersand = 833, t.quoteright = 333, t.parenleft = 333, t.parenright = 333, t.asterisk = 500, t.plus = 570, t.comma = 250, t.hyphen = 333, t.period = 250, t.slash = 278, t.zero = 500, t.one = 500, t.two = 500, t.three = 500, t.four = 500, t.five = 500, t.six = 500, t.seven = 500, t.eight = 500, t.nine = 500, t.colon = 333, t.semicolon = 333, t.less = 570, t.equal = 570, t.greater = 570, t.question = 500, t.at = 930, t.A = 722, t.B = 667, t.C = 722, t.D = 722, t.E = 667, t.F = 611, t.G = 778, t.H = 778, t.I = 389, t.J = 500, t.K = 778, t.L = 667, t.M = 944, t.N = 722, t.O = 778, t.P = 611, t.Q = 778, t.R = 722, t.S = 556, t.T = 667, t.U = 722, t.V = 722, t.W = 1e3, t.X = 722, t.Y = 722, t.Z = 667, t.bracketleft = 333, t.backslash = 278, t.bracketright = 333, t.asciicircum = 581, t.underscore = 500, t.quoteleft = 333, t.a = 500, t.b = 556, t.c = 444, t.d = 556, t.e = 444, t.f = 333, t.g = 500, t.h = 556, t.i = 278, t.j = 333, t.k = 556, t.l = 278, t.m = 833, t.n = 556, t.o = 500, t.p = 556, t.q = 556, t.r = 444, t.s = 389, t.t = 333, t.u = 556, t.v = 500, t.w = 722, t.x = 500, t.y = 500, t.z = 444, t.braceleft = 394, t.bar = 220, t.braceright = 394, t.asciitilde = 520, t.exclamdown = 333, t.cent = 500, t.sterling = 500, t.fraction = 167, t.yen = 500, t.florin = 500, t.section = 500, t.currency = 500, t.quotesingle = 278, t.quotedblleft = 500, t.guillemotleft = 500, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 556, t.fl = 556, t.endash = 500, t.dagger = 500, t.daggerdbl = 500, t.periodcentered = 250, t.paragraph = 540, t.bullet = 350, t.quotesinglbase = 333, t.quotedblbase = 500, t.quotedblright = 500, t.guillemotright = 500, t.ellipsis = 1e3, t.perthousand = 1e3, t.questiondown = 500, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 1e3, t.AE = 1e3, t.ordfeminine = 300, t.Lslash = 667, t.Oslash = 778, t.OE = 1e3, t.ordmasculine = 330, t.ae = 722, t.dotlessi = 278, t.lslash = 278, t.oslash = 500, t.oe = 722, t.germandbls = 556, t.Idieresis = 389, t.eacute = 444, t.abreve = 500, t.uhungarumlaut = 556, t.ecaron = 444, t.Ydieresis = 722, t.divide = 570, t.Yacute = 722, t.Acircumflex = 722, t.aacute = 500, t.Ucircumflex = 722, t.yacute = 500, t.scommaaccent = 389, t.ecircumflex = 444, t.Uring = 722, t.Udieresis = 722, t.aogonek = 500, t.Uacute = 722, t.uogonek = 556, t.Edieresis = 667, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 747, t.Emacron = 667, t.ccaron = 444, t.aring = 500, t.Ncommaaccent = 722, t.lacute = 278, t.agrave = 500, t.Tcommaaccent = 667, t.Cacute = 722, t.atilde = 500, t.Edotaccent = 667, t.scaron = 389, t.scedilla = 389, t.iacute = 278, t.lozenge = 494, t.Rcaron = 722, t.Gcommaaccent = 778, t.ucircumflex = 556, t.acircumflex = 500, t.Amacron = 722, t.rcaron = 444, t.ccedilla = 444, t.Zdotaccent = 667, t.Thorn = 611, t.Omacron = 778, t.Racute = 722, t.Sacute = 556, t.dcaron = 672, t.Umacron = 722, t.uring = 556, t.threesuperior = 300, t.Ograve = 778, t.Agrave = 722, t.Abreve = 722, t.multiply = 570, t.uacute = 556, t.Tcaron = 667, t.partialdiff = 494, t.ydieresis = 500, t.Nacute = 722, t.icircumflex = 278, t.Ecircumflex = 667, t.adieresis = 500, t.edieresis = 444, t.cacute = 444, t.nacute = 556, t.umacron = 556, t.Ncaron = 722, t.Iacute = 389, t.plusminus = 570, t.brokenbar = 220, t.registered = 747, t.Gbreve = 778, t.Idotaccent = 389, t.summation = 600, t.Egrave = 667, t.racute = 444, t.omacron = 500, t.Zacute = 667, t.Zcaron = 667, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 722, t.lcommaaccent = 278, t.tcaron = 416, t.eogonek = 444, t.Uogonek = 722, t.Aacute = 722, t.Adieresis = 722, t.egrave = 444, t.zacute = 444, t.iogonek = 278, t.Oacute = 778, t.oacute = 500, t.amacron = 500, t.sacute = 389, t.idieresis = 278, t.Ocircumflex = 778, t.Ugrave = 722, t.Delta = 612, t.thorn = 556, t.twosuperior = 300, t.Odieresis = 778, t.mu = 556, t.igrave = 278, t.ohungarumlaut = 500, t.Eogonek = 667, t.dcroat = 556, t.threequarters = 750, t.Scedilla = 556, t.lcaron = 394, t.Kcommaaccent = 778, t.Lacute = 667, t.trademark = 1e3, t.edotaccent = 444, t.Igrave = 389, t.Imacron = 389, t.Lcaron = 667, t.onehalf = 750, t.lessequal = 549, t.ocircumflex = 500, t.ntilde = 556, t.Uhungarumlaut = 722, t.Eacute = 667, t.emacron = 444, t.gbreve = 500, t.onequarter = 750, t.Scaron = 556, t.Scommaaccent = 556, t.Ohungarumlaut = 778, t.degree = 400, t.ograve = 500, t.Ccaron = 722, t.ugrave = 556, t.radical = 549, t.Dcaron = 722, t.rcommaaccent = 444, t.Ntilde = 722, t.otilde = 500, t.Rcommaaccent = 722, t.Lcommaaccent = 667, t.Atilde = 722, t.Aogonek = 722, t.Aring = 722, t.Otilde = 778, t.zdotaccent = 444, t.Ecaron = 667, t.Iogonek = 389, t.kcommaaccent = 556, t.minus = 570, t.Icircumflex = 389, t.ncaron = 556, t.tcommaaccent = 333, t.logicalnot = 570, t.odieresis = 500, t.udieresis = 556, t.notequal = 549, t.gcommaaccent = 500, t.eth = 500, t.zcaron = 444, t.ncommaaccent = 556, t.onesuperior = 300, t.imacron = 278, t.Euro = 500;
  }), i["Times-BoldItalic"] = oi(function(t) {
    t.space = 250, t.exclam = 389, t.quotedbl = 555, t.numbersign = 500, t.dollar = 500, t.percent = 833, t.ampersand = 778, t.quoteright = 333, t.parenleft = 333, t.parenright = 333, t.asterisk = 500, t.plus = 570, t.comma = 250, t.hyphen = 333, t.period = 250, t.slash = 278, t.zero = 500, t.one = 500, t.two = 500, t.three = 500, t.four = 500, t.five = 500, t.six = 500, t.seven = 500, t.eight = 500, t.nine = 500, t.colon = 333, t.semicolon = 333, t.less = 570, t.equal = 570, t.greater = 570, t.question = 500, t.at = 832, t.A = 667, t.B = 667, t.C = 667, t.D = 722, t.E = 667, t.F = 667, t.G = 722, t.H = 778, t.I = 389, t.J = 500, t.K = 667, t.L = 611, t.M = 889, t.N = 722, t.O = 722, t.P = 611, t.Q = 722, t.R = 667, t.S = 556, t.T = 611, t.U = 722, t.V = 667, t.W = 889, t.X = 667, t.Y = 611, t.Z = 611, t.bracketleft = 333, t.backslash = 278, t.bracketright = 333, t.asciicircum = 570, t.underscore = 500, t.quoteleft = 333, t.a = 500, t.b = 500, t.c = 444, t.d = 500, t.e = 444, t.f = 333, t.g = 500, t.h = 556, t.i = 278, t.j = 278, t.k = 500, t.l = 278, t.m = 778, t.n = 556, t.o = 500, t.p = 500, t.q = 500, t.r = 389, t.s = 389, t.t = 278, t.u = 556, t.v = 444, t.w = 667, t.x = 500, t.y = 444, t.z = 389, t.braceleft = 348, t.bar = 220, t.braceright = 348, t.asciitilde = 570, t.exclamdown = 389, t.cent = 500, t.sterling = 500, t.fraction = 167, t.yen = 500, t.florin = 500, t.section = 500, t.currency = 500, t.quotesingle = 278, t.quotedblleft = 500, t.guillemotleft = 500, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 556, t.fl = 556, t.endash = 500, t.dagger = 500, t.daggerdbl = 500, t.periodcentered = 250, t.paragraph = 500, t.bullet = 350, t.quotesinglbase = 333, t.quotedblbase = 500, t.quotedblright = 500, t.guillemotright = 500, t.ellipsis = 1e3, t.perthousand = 1e3, t.questiondown = 500, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 1e3, t.AE = 944, t.ordfeminine = 266, t.Lslash = 611, t.Oslash = 722, t.OE = 944, t.ordmasculine = 300, t.ae = 722, t.dotlessi = 278, t.lslash = 278, t.oslash = 500, t.oe = 722, t.germandbls = 500, t.Idieresis = 389, t.eacute = 444, t.abreve = 500, t.uhungarumlaut = 556, t.ecaron = 444, t.Ydieresis = 611, t.divide = 570, t.Yacute = 611, t.Acircumflex = 667, t.aacute = 500, t.Ucircumflex = 722, t.yacute = 444, t.scommaaccent = 389, t.ecircumflex = 444, t.Uring = 722, t.Udieresis = 722, t.aogonek = 500, t.Uacute = 722, t.uogonek = 556, t.Edieresis = 667, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 747, t.Emacron = 667, t.ccaron = 444, t.aring = 500, t.Ncommaaccent = 722, t.lacute = 278, t.agrave = 500, t.Tcommaaccent = 611, t.Cacute = 667, t.atilde = 500, t.Edotaccent = 667, t.scaron = 389, t.scedilla = 389, t.iacute = 278, t.lozenge = 494, t.Rcaron = 667, t.Gcommaaccent = 722, t.ucircumflex = 556, t.acircumflex = 500, t.Amacron = 667, t.rcaron = 389, t.ccedilla = 444, t.Zdotaccent = 611, t.Thorn = 611, t.Omacron = 722, t.Racute = 667, t.Sacute = 556, t.dcaron = 608, t.Umacron = 722, t.uring = 556, t.threesuperior = 300, t.Ograve = 722, t.Agrave = 667, t.Abreve = 667, t.multiply = 570, t.uacute = 556, t.Tcaron = 611, t.partialdiff = 494, t.ydieresis = 444, t.Nacute = 722, t.icircumflex = 278, t.Ecircumflex = 667, t.adieresis = 500, t.edieresis = 444, t.cacute = 444, t.nacute = 556, t.umacron = 556, t.Ncaron = 722, t.Iacute = 389, t.plusminus = 570, t.brokenbar = 220, t.registered = 747, t.Gbreve = 722, t.Idotaccent = 389, t.summation = 600, t.Egrave = 667, t.racute = 389, t.omacron = 500, t.Zacute = 611, t.Zcaron = 611, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 667, t.lcommaaccent = 278, t.tcaron = 366, t.eogonek = 444, t.Uogonek = 722, t.Aacute = 667, t.Adieresis = 667, t.egrave = 444, t.zacute = 389, t.iogonek = 278, t.Oacute = 722, t.oacute = 500, t.amacron = 500, t.sacute = 389, t.idieresis = 278, t.Ocircumflex = 722, t.Ugrave = 722, t.Delta = 612, t.thorn = 500, t.twosuperior = 300, t.Odieresis = 722, t.mu = 576, t.igrave = 278, t.ohungarumlaut = 500, t.Eogonek = 667, t.dcroat = 500, t.threequarters = 750, t.Scedilla = 556, t.lcaron = 382, t.Kcommaaccent = 667, t.Lacute = 611, t.trademark = 1e3, t.edotaccent = 444, t.Igrave = 389, t.Imacron = 389, t.Lcaron = 611, t.onehalf = 750, t.lessequal = 549, t.ocircumflex = 500, t.ntilde = 556, t.Uhungarumlaut = 722, t.Eacute = 667, t.emacron = 444, t.gbreve = 500, t.onequarter = 750, t.Scaron = 556, t.Scommaaccent = 556, t.Ohungarumlaut = 722, t.degree = 400, t.ograve = 500, t.Ccaron = 667, t.ugrave = 556, t.radical = 549, t.Dcaron = 722, t.rcommaaccent = 389, t.Ntilde = 722, t.otilde = 500, t.Rcommaaccent = 667, t.Lcommaaccent = 611, t.Atilde = 667, t.Aogonek = 667, t.Aring = 667, t.Otilde = 722, t.zdotaccent = 389, t.Ecaron = 667, t.Iogonek = 389, t.kcommaaccent = 500, t.minus = 606, t.Icircumflex = 389, t.ncaron = 556, t.tcommaaccent = 278, t.logicalnot = 606, t.odieresis = 500, t.udieresis = 556, t.notequal = 549, t.gcommaaccent = 500, t.eth = 500, t.zcaron = 389, t.ncommaaccent = 556, t.onesuperior = 300, t.imacron = 278, t.Euro = 500;
  }), i["Times-Italic"] = oi(function(t) {
    t.space = 250, t.exclam = 333, t.quotedbl = 420, t.numbersign = 500, t.dollar = 500, t.percent = 833, t.ampersand = 778, t.quoteright = 333, t.parenleft = 333, t.parenright = 333, t.asterisk = 500, t.plus = 675, t.comma = 250, t.hyphen = 333, t.period = 250, t.slash = 278, t.zero = 500, t.one = 500, t.two = 500, t.three = 500, t.four = 500, t.five = 500, t.six = 500, t.seven = 500, t.eight = 500, t.nine = 500, t.colon = 333, t.semicolon = 333, t.less = 675, t.equal = 675, t.greater = 675, t.question = 500, t.at = 920, t.A = 611, t.B = 611, t.C = 667, t.D = 722, t.E = 611, t.F = 611, t.G = 722, t.H = 722, t.I = 333, t.J = 444, t.K = 667, t.L = 556, t.M = 833, t.N = 667, t.O = 722, t.P = 611, t.Q = 722, t.R = 611, t.S = 500, t.T = 556, t.U = 722, t.V = 611, t.W = 833, t.X = 611, t.Y = 556, t.Z = 556, t.bracketleft = 389, t.backslash = 278, t.bracketright = 389, t.asciicircum = 422, t.underscore = 500, t.quoteleft = 333, t.a = 500, t.b = 500, t.c = 444, t.d = 500, t.e = 444, t.f = 278, t.g = 500, t.h = 500, t.i = 278, t.j = 278, t.k = 444, t.l = 278, t.m = 722, t.n = 500, t.o = 500, t.p = 500, t.q = 500, t.r = 389, t.s = 389, t.t = 278, t.u = 500, t.v = 444, t.w = 667, t.x = 444, t.y = 444, t.z = 389, t.braceleft = 400, t.bar = 275, t.braceright = 400, t.asciitilde = 541, t.exclamdown = 389, t.cent = 500, t.sterling = 500, t.fraction = 167, t.yen = 500, t.florin = 500, t.section = 500, t.currency = 500, t.quotesingle = 214, t.quotedblleft = 556, t.guillemotleft = 500, t.guilsinglleft = 333, t.guilsinglright = 333, t.fi = 500, t.fl = 500, t.endash = 500, t.dagger = 500, t.daggerdbl = 500, t.periodcentered = 250, t.paragraph = 523, t.bullet = 350, t.quotesinglbase = 333, t.quotedblbase = 556, t.quotedblright = 556, t.guillemotright = 500, t.ellipsis = 889, t.perthousand = 1e3, t.questiondown = 500, t.grave = 333, t.acute = 333, t.circumflex = 333, t.tilde = 333, t.macron = 333, t.breve = 333, t.dotaccent = 333, t.dieresis = 333, t.ring = 333, t.cedilla = 333, t.hungarumlaut = 333, t.ogonek = 333, t.caron = 333, t.emdash = 889, t.AE = 889, t.ordfeminine = 276, t.Lslash = 556, t.Oslash = 722, t.OE = 944, t.ordmasculine = 310, t.ae = 667, t.dotlessi = 278, t.lslash = 278, t.oslash = 500, t.oe = 667, t.germandbls = 500, t.Idieresis = 333, t.eacute = 444, t.abreve = 500, t.uhungarumlaut = 500, t.ecaron = 444, t.Ydieresis = 556, t.divide = 675, t.Yacute = 556, t.Acircumflex = 611, t.aacute = 500, t.Ucircumflex = 722, t.yacute = 444, t.scommaaccent = 389, t.ecircumflex = 444, t.Uring = 722, t.Udieresis = 722, t.aogonek = 500, t.Uacute = 722, t.uogonek = 500, t.Edieresis = 611, t.Dcroat = 722, t.commaaccent = 250, t.copyright = 760, t.Emacron = 611, t.ccaron = 444, t.aring = 500, t.Ncommaaccent = 667, t.lacute = 278, t.agrave = 500, t.Tcommaaccent = 556, t.Cacute = 667, t.atilde = 500, t.Edotaccent = 611, t.scaron = 389, t.scedilla = 389, t.iacute = 278, t.lozenge = 471, t.Rcaron = 611, t.Gcommaaccent = 722, t.ucircumflex = 500, t.acircumflex = 500, t.Amacron = 611, t.rcaron = 389, t.ccedilla = 444, t.Zdotaccent = 556, t.Thorn = 611, t.Omacron = 722, t.Racute = 611, t.Sacute = 500, t.dcaron = 544, t.Umacron = 722, t.uring = 500, t.threesuperior = 300, t.Ograve = 722, t.Agrave = 611, t.Abreve = 611, t.multiply = 675, t.uacute = 500, t.Tcaron = 556, t.partialdiff = 476, t.ydieresis = 444, t.Nacute = 667, t.icircumflex = 278, t.Ecircumflex = 611, t.adieresis = 500, t.edieresis = 444, t.cacute = 444, t.nacute = 500, t.umacron = 500, t.Ncaron = 667, t.Iacute = 333, t.plusminus = 675, t.brokenbar = 275, t.registered = 760, t.Gbreve = 722, t.Idotaccent = 333, t.summation = 600, t.Egrave = 611, t.racute = 389, t.omacron = 500, t.Zacute = 556, t.Zcaron = 556, t.greaterequal = 549, t.Eth = 722, t.Ccedilla = 667, t.lcommaaccent = 278, t.tcaron = 300, t.eogonek = 444, t.Uogonek = 722, t.Aacute = 611, t.Adieresis = 611, t.egrave = 444, t.zacute = 389, t.iogonek = 278, t.Oacute = 722, t.oacute = 500, t.amacron = 500, t.sacute = 389, t.idieresis = 278, t.Ocircumflex = 722, t.Ugrave = 722, t.Delta = 612, t.thorn = 500, t.twosuperior = 300, t.Odieresis = 722, t.mu = 500, t.igrave = 278, t.ohungarumlaut = 500, t.Eogonek = 611, t.dcroat = 500, t.threequarters = 750, t.Scedilla = 500, t.lcaron = 300, t.Kcommaaccent = 667, t.Lacute = 556, t.trademark = 980, t.edotaccent = 444, t.Igrave = 333, t.Imacron = 333, t.Lcaron = 611, t.onehalf = 750, t.lessequal = 549, t.ocircumflex = 500, t.ntilde = 500, t.Uhungarumlaut = 722, t.Eacute = 611, t.emacron = 444, t.gbreve = 500, t.onequarter = 750, t.Scaron = 500, t.Scommaaccent = 500, t.Ohungarumlaut = 722, t.degree = 400, t.ograve = 500, t.Ccaron = 667, t.ugrave = 500, t.radical = 453, t.Dcaron = 722, t.rcommaaccent = 389, t.Ntilde = 667, t.otilde = 500, t.Rcommaaccent = 611, t.Lcommaaccent = 556, t.Atilde = 611, t.Aogonek = 611, t.Aring = 611, t.Otilde = 722, t.zdotaccent = 389, t.Ecaron = 611, t.Iogonek = 333, t.kcommaaccent = 444, t.minus = 675, t.Icircumflex = 333, t.ncaron = 500, t.tcommaaccent = 278, t.logicalnot = 675, t.odieresis = 500, t.udieresis = 500, t.notequal = 549, t.gcommaaccent = 500, t.eth = 500, t.zcaron = 389, t.ncommaaccent = 500, t.onesuperior = 300, t.imacron = 278, t.Euro = 500;
  }), i.ZapfDingbats = oi(function(t) {
    t.space = 278, t.a1 = 974, t.a2 = 961, t.a202 = 974, t.a3 = 980, t.a4 = 719, t.a5 = 789, t.a119 = 790, t.a118 = 791, t.a117 = 690, t.a11 = 960, t.a12 = 939, t.a13 = 549, t.a14 = 855, t.a15 = 911, t.a16 = 933, t.a105 = 911, t.a17 = 945, t.a18 = 974, t.a19 = 755, t.a20 = 846, t.a21 = 762, t.a22 = 761, t.a23 = 571, t.a24 = 677, t.a25 = 763, t.a26 = 760, t.a27 = 759, t.a28 = 754, t.a6 = 494, t.a7 = 552, t.a8 = 537, t.a9 = 577, t.a10 = 692, t.a29 = 786, t.a30 = 788, t.a31 = 788, t.a32 = 790, t.a33 = 793, t.a34 = 794, t.a35 = 816, t.a36 = 823, t.a37 = 789, t.a38 = 841, t.a39 = 823, t.a40 = 833, t.a41 = 816, t.a42 = 831, t.a43 = 923, t.a44 = 744, t.a45 = 723, t.a46 = 749, t.a47 = 790, t.a48 = 792, t.a49 = 695, t.a50 = 776, t.a51 = 768, t.a52 = 792, t.a53 = 759, t.a54 = 707, t.a55 = 708, t.a56 = 682, t.a57 = 701, t.a58 = 826, t.a59 = 815, t.a60 = 789, t.a61 = 789, t.a62 = 707, t.a63 = 687, t.a64 = 696, t.a65 = 689, t.a66 = 786, t.a67 = 787, t.a68 = 713, t.a69 = 791, t.a70 = 785, t.a71 = 791, t.a72 = 873, t.a73 = 761, t.a74 = 762, t.a203 = 762, t.a75 = 759, t.a204 = 759, t.a76 = 892, t.a77 = 892, t.a78 = 788, t.a79 = 784, t.a81 = 438, t.a82 = 138, t.a83 = 277, t.a84 = 415, t.a97 = 392, t.a98 = 392, t.a99 = 668, t.a100 = 668, t.a89 = 390, t.a90 = 390, t.a93 = 317, t.a94 = 317, t.a91 = 276, t.a92 = 276, t.a205 = 509, t.a85 = 509, t.a206 = 410, t.a86 = 410, t.a87 = 234, t.a88 = 234, t.a95 = 334, t.a96 = 334, t.a101 = 732, t.a102 = 544, t.a103 = 544, t.a104 = 910, t.a106 = 667, t.a107 = 760, t.a108 = 760, t.a112 = 776, t.a111 = 595, t.a110 = 694, t.a109 = 626, t.a120 = 788, t.a121 = 788, t.a122 = 788, t.a123 = 788, t.a124 = 788, t.a125 = 788, t.a126 = 788, t.a127 = 788, t.a128 = 788, t.a129 = 788, t.a130 = 788, t.a131 = 788, t.a132 = 788, t.a133 = 788, t.a134 = 788, t.a135 = 788, t.a136 = 788, t.a137 = 788, t.a138 = 788, t.a139 = 788, t.a140 = 788, t.a141 = 788, t.a142 = 788, t.a143 = 788, t.a144 = 788, t.a145 = 788, t.a146 = 788, t.a147 = 788, t.a148 = 788, t.a149 = 788, t.a150 = 788, t.a151 = 788, t.a152 = 788, t.a153 = 788, t.a154 = 788, t.a155 = 788, t.a156 = 788, t.a157 = 788, t.a158 = 788, t.a159 = 788, t.a160 = 894, t.a161 = 838, t.a163 = 1016, t.a164 = 458, t.a196 = 748, t.a165 = 924, t.a192 = 748, t.a166 = 918, t.a167 = 927, t.a168 = 928, t.a169 = 928, t.a170 = 834, t.a171 = 873, t.a172 = 828, t.a173 = 924, t.a162 = 924, t.a174 = 917, t.a175 = 930, t.a176 = 931, t.a177 = 463, t.a178 = 883, t.a179 = 836, t.a193 = 836, t.a180 = 867, t.a199 = 867, t.a181 = 696, t.a200 = 696, t.a182 = 874, t.a201 = 874, t.a183 = 760, t.a184 = 946, t.a197 = 771, t.a185 = 865, t.a194 = 771, t.a198 = 888, t.a186 = 967, t.a195 = 888, t.a187 = 831, t.a188 = 873, t.a189 = 927, t.a190 = 970, t.a191 = 918;
  });
}), gN = oi(function(i) {
  i.Courier = { ascent: 629, descent: -157, capHeight: 562, xHeight: -426 }, i["Courier-Bold"] = { ascent: 629, descent: -157, capHeight: 562, xHeight: 439 }, i["Courier-Oblique"] = { ascent: 629, descent: -157, capHeight: 562, xHeight: 426 }, i["Courier-BoldOblique"] = { ascent: 629, descent: -157, capHeight: 562, xHeight: 426 }, i.Helvetica = { ascent: 718, descent: -207, capHeight: 718, xHeight: 523 }, i["Helvetica-Bold"] = { ascent: 718, descent: -207, capHeight: 718, xHeight: 532 }, i["Helvetica-Oblique"] = { ascent: 718, descent: -207, capHeight: 718, xHeight: 523 }, i["Helvetica-BoldOblique"] = { ascent: 718, descent: -207, capHeight: 718, xHeight: 532 }, i["Times-Roman"] = { ascent: 683, descent: -217, capHeight: 662, xHeight: 450 }, i["Times-Bold"] = { ascent: 683, descent: -217, capHeight: 676, xHeight: 461 }, i["Times-Italic"] = { ascent: 683, descent: -217, capHeight: 653, xHeight: 441 }, i["Times-BoldItalic"] = { ascent: 683, descent: -217, capHeight: 669, xHeight: 462 }, i.Symbol = { ascent: Math.NaN, descent: Math.NaN, capHeight: Math.NaN, xHeight: Math.NaN }, i.ZapfDingbats = { ascent: Math.NaN, descent: Math.NaN, capHeight: Math.NaN, xHeight: Math.NaN };
});
class bN {
  constructor({ glyfTable: t, isGlyphLocationsLong: e, locaTable: n, numGlyphs: s }) {
    this.glyphs = [];
    const r = new DataView(n.buffer, n.byteOffset, n.byteLength), a = new DataView(t.buffer, t.byteOffset, t.byteLength), o = e ? 4 : 2;
    let l = e ? r.getUint32(0) : 2 * r.getUint16(0), c = 0;
    for (let h = 0; h < s; h++) {
      c += o;
      const u = e ? r.getUint32(c) : 2 * r.getUint16(c);
      if (u === l) {
        this.glyphs.push(new up({}));
        continue;
      }
      const f = up.parse(l, a);
      this.glyphs.push(f), l = u;
    }
  }
  getSize() {
    return Math.sumPrecise(this.glyphs.map((t) => t.getSize() + 3 & -4));
  }
  write() {
    const t = this.getSize(), e = new DataView(new ArrayBuffer(t)), n = t > 131070, s = n ? 4 : 2, r = new DataView(new ArrayBuffer((this.glyphs.length + 1) * s));
    n ? r.setUint32(0, 0) : r.setUint16(0, 0);
    let a = 0, o = 0;
    for (const l of this.glyphs)
      a += l.write(a, e), a = a + 3 & -4, o += s, n ? r.setUint32(o, a) : r.setUint16(o, a >> 1);
    return { isLocationLong: n, loca: new Uint8Array(r.buffer), glyf: new Uint8Array(e.buffer) };
  }
  scale(t) {
    for (let e = 0, n = this.glyphs.length; e < n; e++) this.glyphs[e].scale(t[e]);
  }
}
class up {
  constructor({ header: t = null, simple: e = null, composites: n = null }) {
    this.header = t, this.simple = e, this.composites = n;
  }
  static parse(t, e) {
    const [n, s] = Qy.parse(t, e);
    if (t += n, s.numberOfContours < 0) {
      const a = [];
      for (; ; ) {
        const [o, l] = ew.parse(t, e);
        if (t += o, a.push(l), !(32 & l.flags)) break;
      }
      return new up({ header: s, composites: a });
    }
    const r = tw.parse(t, e, s.numberOfContours);
    return new up({ header: s, simple: r });
  }
  getSize() {
    if (!this.header) return 0;
    const t = this.simple ? this.simple.getSize() : Math.sumPrecise(this.composites.map((e) => e.getSize()));
    return this.header.getSize() + t;
  }
  write(t, e) {
    if (!this.header) return 0;
    const n = t;
    if (t += this.header.write(t, e), this.simple) t += this.simple.write(t, e);
    else for (const s of this.composites) t += s.write(t, e);
    return t - n;
  }
  scale(t) {
    if (!this.header) return;
    const e = (this.header.xMin + this.header.xMax) / 2;
    if (this.header.scale(e, t), this.simple) this.simple.scale(e, t);
    else for (const n of this.composites) n.scale(e, t);
  }
}
class Qy {
  constructor({ numberOfContours: t, xMin: e, yMin: n, xMax: s, yMax: r }) {
    this.numberOfContours = t, this.xMin = e, this.yMin = n, this.xMax = s, this.yMax = r;
  }
  static parse(t, e) {
    return [10, new Qy({ numberOfContours: e.getInt16(t), xMin: e.getInt16(t + 2), yMin: e.getInt16(t + 4), xMax: e.getInt16(t + 6), yMax: e.getInt16(t + 8) })];
  }
  getSize() {
    return 10;
  }
  write(t, e) {
    return e.setInt16(t, this.numberOfContours), e.setInt16(t + 2, this.xMin), e.setInt16(t + 4, this.yMin), e.setInt16(t + 6, this.xMax), e.setInt16(t + 8, this.yMax), 10;
  }
  scale(t, e) {
    this.xMin = Math.round(t + (this.xMin - t) * e), this.xMax = Math.round(t + (this.xMax - t) * e);
  }
}
class yN {
  constructor({ flags: t, xCoordinates: e, yCoordinates: n }) {
    this.xCoordinates = e, this.yCoordinates = n, this.flags = t;
  }
}
class tw {
  constructor({ contours: t, instructions: e }) {
    this.contours = t, this.instructions = e;
  }
  static parse(t, e, n) {
    const s = [];
    for (let b = 0; b < n; b++) {
      const y = e.getUint16(t);
      t += 2, s.push(y);
    }
    const r = s[n - 1] + 1, a = e.getUint16(t);
    t += 2;
    const o = new Uint8Array(e).slice(t, t + a);
    t += a;
    const l = [];
    for (let b = 0; b < r; t++, b++) {
      let y = e.getUint8(t);
      if (l.push(y), 8 & y) {
        const v = e.getUint8(++t);
        y ^= 8;
        for (let w = 0; w < v; w++) l.push(y);
        b += v;
      }
    }
    const c = [];
    let h = [], u = [], f = [];
    const d = [];
    let p = 0, g = 0;
    for (let b = 0; b < r; b++) {
      const y = l[b];
      if (2 & y) {
        const v = e.getUint8(t++);
        g += 16 & y ? v : -v, h.push(g);
      } else 16 & y || (g += e.getInt16(t), t += 2), h.push(g);
      s[p] === b && (p++, c.push(h), h = []);
    }
    g = 0, p = 0;
    for (let b = 0; b < r; b++) {
      const y = l[b];
      if (4 & y) {
        const v = e.getUint8(t++);
        g += 32 & y ? v : -v, u.push(g);
      } else 32 & y || (g += e.getInt16(t), t += 2), u.push(g);
      f.push(1 & y | 64 & y), s[p] === b && (h = c[p], p++, d.push(new yN({ flags: f, xCoordinates: h, yCoordinates: u })), u = [], f = []);
    }
    return new tw({ contours: d, instructions: o });
  }
  getSize() {
    let t = 2 * this.contours.length + 2 + this.instructions.length, e = 0, n = 0;
    for (const s of this.contours) {
      t += s.flags.length;
      for (let r = 0, a = s.xCoordinates.length; r < a; r++) {
        const o = s.xCoordinates[r], l = s.yCoordinates[r];
        let c = Math.abs(o - e);
        c > 255 ? t += 2 : c > 0 && (t += 1), e = o, c = Math.abs(l - n), c > 255 ? t += 2 : c > 0 && (t += 1), n = l;
      }
    }
    return t;
  }
  write(t, e) {
    const n = t, s = [], r = [], a = [];
    let o = 0, l = 0;
    for (const c of this.contours) {
      for (let h = 0, u = c.xCoordinates.length; h < u; h++) {
        let f = c.flags[h];
        const d = c.xCoordinates[h];
        let p = d - o;
        if (p === 0)
          f |= 16, s.push(0);
        else {
          const b = Math.abs(p);
          b <= 255 ? (f |= p >= 0 ? 18 : 2, s.push(b)) : s.push(p);
        }
        o = d;
        const g = c.yCoordinates[h];
        if (p = g - l, p === 0)
          f |= 32, r.push(0);
        else {
          const b = Math.abs(p);
          b <= 255 ? (f |= p >= 0 ? 36 : 4, r.push(b)) : r.push(p);
        }
        l = g, a.push(f);
      }
      e.setUint16(t, s.length - 1), t += 2;
    }
    e.setUint16(t, this.instructions.length), t += 2, this.instructions.length && (new Uint8Array(e.buffer, 0, e.buffer.byteLength).set(this.instructions, t), t += this.instructions.length);
    for (const c of a) e.setUint8(t++, c);
    for (let c = 0, h = s.length; c < h; c++) {
      const u = s[c], f = a[c];
      2 & f ? e.setUint8(t++, u) : 16 & f || (e.setInt16(t, u), t += 2);
    }
    for (let c = 0, h = r.length; c < h; c++) {
      const u = r[c], f = a[c];
      4 & f ? e.setUint8(t++, u) : 32 & f || (e.setInt16(t, u), t += 2);
    }
    return t - n;
  }
  scale(t, e) {
    for (const n of this.contours) if (n.xCoordinates.length !== 0) for (let s = 0, r = n.xCoordinates.length; s < r; s++) n.xCoordinates[s] = Math.round(t + (n.xCoordinates[s] - t) * e);
  }
}
class ew {
  constructor({ flags: t, glyphIndex: e, argument1: n, argument2: s, transf: r, instructions: a }) {
    this.flags = t, this.glyphIndex = e, this.argument1 = n, this.argument2 = s, this.transf = r, this.instructions = a;
  }
  static parse(t, e) {
    const n = t, s = [];
    let r = e.getUint16(t);
    const a = e.getUint16(t + 2);
    t += 4;
    let o, l;
    1 & r ? (2 & r ? (o = e.getInt16(t), l = e.getInt16(t + 2)) : (o = e.getUint16(t), l = e.getUint16(t + 2)), t += 4, r ^= 1) : (2 & r ? (o = e.getInt8(t), l = e.getInt8(t + 1)) : (o = e.getUint8(t), l = e.getUint8(t + 1)), t += 2), 8 & r ? (s.push(e.getUint16(t)), t += 2) : 64 & r ? (s.push(e.getUint16(t), e.getUint16(t + 2)), t += 4) : 128 & r && (s.push(e.getUint16(t), e.getUint16(t + 2), e.getUint16(t + 4), e.getUint16(t + 6)), t += 8);
    let c = null;
    if (256 & r) {
      const h = e.getUint16(t);
      t += 2, c = new Uint8Array(e).slice(t, t + h), t += h;
    }
    return [t - n, new ew({ flags: r, glyphIndex: a, argument1: o, argument2: l, transf: s, instructions: c })];
  }
  getSize() {
    let t = 4 + 2 * this.transf.length;
    return 256 & this.flags && (t += 2 + this.instructions.length), t += 2, 2 & this.flags ? this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && this.argument2 <= 127 || (t += 2) : this.argument1 >= 0 && this.argument1 <= 255 && this.argument2 >= 0 && this.argument2 <= 255 || (t += 2), t;
  }
  write(t, e) {
    const n = t;
    return 2 & this.flags ? this.argument1 >= -128 && this.argument1 <= 127 && this.argument2 >= -128 && this.argument2 <= 127 || (this.flags |= 1) : this.argument1 >= 0 && this.argument1 <= 255 && this.argument2 >= 0 && this.argument2 <= 255 || (this.flags |= 1), e.setUint16(t, this.flags), e.setUint16(t + 2, this.glyphIndex), t += 4, 1 & this.flags ? (2 & this.flags ? (e.setInt16(t, this.argument1), e.setInt16(t + 2, this.argument2)) : (e.setUint16(t, this.argument1), e.setUint16(t + 2, this.argument2)), t += 4) : (e.setUint8(t, this.argument1), e.setUint8(t + 1, this.argument2), t += 2), 256 & this.flags && (e.setUint16(t, this.instructions.length), t += 2, this.instructions.length && (new Uint8Array(e.buffer, 0, e.buffer.byteLength).set(this.instructions, t), t += this.instructions.length)), t - n;
  }
  scale(t, e) {
  }
}
function a5(i, t, e) {
  i[t] = e >> 8 & 255, i[t + 1] = 255 & e;
}
function S6(i, t, e) {
  i[t] = e >> 24 & 255, i[t + 1] = e >> 16 & 255, i[t + 2] = e >> 8 & 255, i[t + 3] = 255 & e;
}
function wN(i, t, e) {
  if (e instanceof Uint8Array) i.set(e, t);
  else if (typeof e == "string") for (let n = 0, s = e.length; n < s; n++) i[t++] = 255 & e.charCodeAt(n);
  else for (const n of e) i[t++] = 255 & n;
}
class dp {
  constructor(t) {
    this.sfnt = t, this.tables = /* @__PURE__ */ Object.create(null);
  }
  static getSearchParams(t, e) {
    let n = 1, s = 0;
    for (; (n ^ t) > n; )
      n <<= 1, s++;
    const r = n * e;
    return { range: r, entry: s, rangeShift: e * t - r };
  }
  toArray() {
    let t = this.sfnt;
    const e = this.tables, n = Object.keys(e);
    n.sort();
    const s = n.length;
    let r, a, o, l, c, h = 12 + 16 * s;
    const u = [h];
    for (r = 0; r < s; r++)
      l = e[n[r]], h += (l.length + 3 & -4) >>> 0, u.push(h);
    const f = new Uint8Array(h);
    for (r = 0; r < s; r++)
      l = e[n[r]], wN(f, u[r], l);
    t === "true" && (t = An(65536)), f[0] = 255 & t.charCodeAt(0), f[1] = 255 & t.charCodeAt(1), f[2] = 255 & t.charCodeAt(2), f[3] = 255 & t.charCodeAt(3), a5(f, 4, s);
    const d = dp.getSearchParams(s, 16);
    for (a5(f, 6, d.range), a5(f, 8, d.entry), a5(f, 10, d.rangeShift), h = 12, r = 0; r < s; r++) {
      c = n[r], f[h] = 255 & c.charCodeAt(0), f[h + 1] = 255 & c.charCodeAt(1), f[h + 2] = 255 & c.charCodeAt(2), f[h + 3] = 255 & c.charCodeAt(3);
      let p = 0;
      for (a = u[r], o = u[r + 1]; a < o; a += 4)
        p = p + Ne(f, a) >>> 0;
      S6(f, h + 4, p), S6(f, h + 8, u[r]), S6(f, h + 12, e[c].length), h += 16;
    }
    return f;
  }
  addTable(t, e) {
    if (t in this.tables) throw new Error("Table " + t + " already exists");
    this.tables[t] = e;
  }
}
const vN = [4], _N = [5], xN = [6], kN = [7], AN = [8], SN = [12, 35], C6 = [14], T_ = [21], F_ = [22], CN = [30], EN = [31];
class DN {
  constructor() {
    this.width = 0, this.lsb = 0, this.flexing = !1, this.output = [], this.stack = [];
  }
  convert(t, e, n) {
    const s = t.length;
    let r, a, o, l = !1;
    for (let c = 0; c < s; c++) {
      let h = t[c];
      if (h < 32) {
        switch (h === 12 && (h = (h << 8) + t[++c]), h) {
          case 1:
          case 3:
          case 9:
          case 3072:
          case 3073:
          case 3074:
          case 3105:
            this.stack = [];
            break;
          case 4:
            if (this.flexing) {
              if (this.stack.length < 1) {
                l = !0;
                break;
              }
              const g = this.stack.pop();
              this.stack.push(0, g);
              break;
            }
            l = this.executeCommand(1, vN);
            break;
          case 5:
            l = this.executeCommand(2, _N);
            break;
          case 6:
            l = this.executeCommand(1, xN);
            break;
          case 7:
            l = this.executeCommand(1, kN);
            break;
          case 8:
            l = this.executeCommand(6, AN);
            break;
          case 10:
            if (this.stack.length < 1) {
              l = !0;
              break;
            }
            if (o = this.stack.pop(), !e[o]) {
              l = !0;
              break;
            }
            l = this.convert(e[o], e, n);
            break;
          case 11:
            return l;
          case 13:
            if (this.stack.length < 2) {
              l = !0;
              break;
            }
            r = this.stack.pop(), a = this.stack.pop(), this.lsb = a, this.width = r, this.stack.push(r, a), l = this.executeCommand(2, F_);
            break;
          case 14:
            this.output.push(C6[0]);
            break;
          case 21:
            if (this.flexing) break;
            l = this.executeCommand(2, T_);
            break;
          case 22:
            if (this.flexing) {
              this.stack.push(0);
              break;
            }
            l = this.executeCommand(1, F_);
            break;
          case 30:
            l = this.executeCommand(4, CN);
            break;
          case 31:
            l = this.executeCommand(4, EN);
            break;
          case 3078:
            if (n) {
              const g = this.stack.at(-5);
              this.seac = this.stack.splice(-4, 4), this.seac[0] += this.lsb - g, l = this.executeCommand(0, C6);
            } else l = this.executeCommand(4, C6);
            break;
          case 3079:
            if (this.stack.length < 4) {
              l = !0;
              break;
            }
            this.stack.pop(), r = this.stack.pop();
            const u = this.stack.pop();
            a = this.stack.pop(), this.lsb = a, this.width = r, this.stack.push(r, a, u), l = this.executeCommand(3, T_);
            break;
          case 3084:
            if (this.stack.length < 2) {
              l = !0;
              break;
            }
            const f = this.stack.pop(), d = this.stack.pop();
            this.stack.push(d / f);
            break;
          case 3088:
            if (this.stack.length < 2) {
              l = !0;
              break;
            }
            o = this.stack.pop();
            const p = this.stack.pop();
            if (o === 0 && p === 3) {
              const g = this.stack.splice(-17, 17);
              this.stack.push(g[2] + g[0], g[3] + g[1], g[4], g[5], g[6], g[7], g[8], g[9], g[10], g[11], g[12], g[13], g[14]), l = this.executeCommand(13, SN, !0), this.flexing = !1, this.stack.push(g[15], g[16]);
            } else o === 1 && p === 0 && (this.flexing = !0);
            break;
          case 3089:
            break;
          default:
            H('Unknown type 1 charstring command of "' + h + '"');
        }
        if (l) break;
      } else
        h <= 246 ? h -= 139 : h = h <= 250 ? 256 * (h - 247) + t[++c] + 108 : h <= 254 ? -256 * (h - 251) - t[++c] - 108 : (255 & t[++c]) << 24 | (255 & t[++c]) << 16 | (255 & t[++c]) << 8 | 255 & t[++c], this.stack.push(h);
    }
    return l;
  }
  executeCommand(t, e, n) {
    const s = this.stack.length;
    if (t > s) return !0;
    const r = s - t;
    for (let a = r; a < s; a++) {
      let o = this.stack[a];
      Number.isInteger(o) ? this.output.push(28, o >> 8 & 255, 255 & o) : (o = 65536 * o | 0, this.output.push(255, o >> 24 & 255, o >> 16 & 255, o >> 8 & 255, 255 & o));
    }
    return this.output.push(...e), n ? this.stack.splice(r, t) : this.stack.length = 0, !1;
  }
}
function za(i) {
  return i >= 48 && i <= 57 || i >= 65 && i <= 70 || i >= 97 && i <= 102;
}
function I_(i, t, e) {
  if (e >= i.length) return new Uint8Array(0);
  let n, s, r = 0 | t;
  for (n = 0; n < e; n++) r = 52845 * (i[n] + r) + 22719 & 65535;
  const a = i.length - e, o = new Uint8Array(a);
  for (n = e, s = 0; s < a; n++, s++) {
    const l = i[n];
    o[s] = l ^ r >> 8, r = 52845 * (l + r) + 22719 & 65535;
  }
  return o;
}
function M_(i) {
  return i === 47 || i === 91 || i === 93 || i === 123 || i === 125 || i === 40 || i === 41;
}
class R_ {
  constructor(t, e, n) {
    if (e) {
      const s = t.getBytes(), r = !((za(s[0]) || or(s[0])) && za(s[1]) && za(s[2]) && za(s[3]) && za(s[4]) && za(s[5]) && za(s[6]) && za(s[7]));
      t = new gi(r ? I_(s, 55665, 4) : function(o, l, c) {
        let h = 0 | l;
        const u = o.length, f = new Uint8Array(u >>> 1);
        let d, p;
        for (d = 0, p = 0; d < u; d++) {
          const g = o[d];
          if (!za(g)) continue;
          d++;
          let b;
          for (; d < u && !za(b = o[d]); ) d++;
          if (d < u) {
            const y = parseInt(String.fromCharCode(g, b), 16);
            f[p++] = y ^ h >> 8, h = 52845 * (y + h) + 22719 & 65535;
          }
        }
        return f.slice(c, p);
      }(s, 55665, 4));
    }
    this.seacAnalysisEnabled = !!n, this.stream = t, this.nextChar();
  }
  readNumberArray() {
    this.getToken();
    const t = [];
    for (; ; ) {
      const e = this.getToken();
      if (e === null || e === "]" || e === "}") break;
      t.push(parseFloat(e || 0));
    }
    return t;
  }
  readNumber() {
    const t = this.getToken();
    return parseFloat(t || 0);
  }
  readInt() {
    const t = this.getToken();
    return 0 | parseInt(t || 0, 10);
  }
  readBoolean() {
    return this.getToken() === "true" ? 1 : 0;
  }
  nextChar() {
    return this.currentChar = this.stream.getByte();
  }
  prevChar() {
    return this.stream.skip(-2), this.currentChar = this.stream.getByte();
  }
  getToken() {
    let t = !1, e = this.currentChar;
    for (; ; ) {
      if (e === -1) return null;
      if (t) e !== 10 && e !== 13 || (t = !1);
      else if (e === 37) t = !0;
      else if (!or(e)) break;
      e = this.nextChar();
    }
    if (M_(e))
      return this.nextChar(), String.fromCharCode(e);
    let n = "";
    do
      n += String.fromCharCode(e), e = this.nextChar();
    while (e >= 0 && !or(e) && !M_(e));
    return n;
  }
  readCharStrings(t, e) {
    return e === -1 ? t : I_(t, 4330, e);
  }
  extractFontProgram(t) {
    const e = this.stream, n = [], s = [], r = /* @__PURE__ */ Object.create(null);
    r.lenIV = 4;
    const a = { subrs: [], charstrings: [], properties: { privateData: r } };
    let o, l, c, h;
    for (; (o = this.getToken()) !== null; ) if (o === "/")
      switch (o = this.getToken(), o) {
        case "CharStrings":
          for (this.getToken(), this.getToken(), this.getToken(), this.getToken(); o = this.getToken(), !(o === null || o === "end"); ) {
            if (o !== "/") continue;
            const f = this.getToken();
            l = this.readInt(), this.getToken(), c = l > 0 ? e.getBytes(l) : new Uint8Array(0), h = a.properties.privateData.lenIV;
            const d = this.readCharStrings(c, h);
            this.nextChar(), o = this.getToken(), o === "noaccess" ? this.getToken() : o === "/" && this.prevChar(), s.push({ glyph: f, encoded: d });
          }
          break;
        case "Subrs":
          for (this.readInt(), this.getToken(); this.getToken() === "dup"; ) {
            const f = this.readInt();
            l = this.readInt(), this.getToken(), c = l > 0 ? e.getBytes(l) : new Uint8Array(0), h = a.properties.privateData.lenIV;
            const d = this.readCharStrings(c, h);
            this.nextChar(), o = this.getToken(), o === "noaccess" && this.getToken(), n[f] = d;
          }
          break;
        case "BlueValues":
        case "OtherBlues":
        case "FamilyBlues":
        case "FamilyOtherBlues":
          const u = this.readNumberArray();
          u.length > 0 && u.length;
          break;
        case "StemSnapH":
        case "StemSnapV":
          a.properties.privateData[o] = this.readNumberArray();
          break;
        case "StdHW":
        case "StdVW":
          a.properties.privateData[o] = this.readNumberArray()[0];
          break;
        case "BlueShift":
        case "lenIV":
        case "BlueFuzz":
        case "BlueScale":
        case "LanguageGroup":
          a.properties.privateData[o] = this.readNumber();
          break;
        case "ExpansionFactor":
          a.properties.privateData[o] = this.readNumber() || 0.06;
          break;
        case "ForceBold":
          a.properties.privateData[o] = this.readBoolean();
      }
    for (const { encoded: u, glyph: f } of s) {
      const d = new DN(), p = d.convert(u, n, this.seacAnalysisEnabled);
      let g = d.output;
      p && (g = [14]);
      const b = { glyphName: f, charstring: g, width: d.width, lsb: d.lsb, seac: d.seac };
      if (f === ".notdef" ? a.charstrings.unshift(b) : a.charstrings.push(b), t.builtInEncoding) {
        const y = t.builtInEncoding.indexOf(f);
        y > -1 && t.widths[y] === void 0 && y >= t.firstChar && y <= t.lastChar && (t.widths[y] = d.width);
      }
    }
    return a;
  }
  extractFontHeader(t) {
    let e;
    for (; (e = this.getToken()) !== null; ) if (e === "/")
      switch (e = this.getToken(), e) {
        case "FontMatrix":
          const n = this.readNumberArray();
          t.fontMatrix = n;
          break;
        case "Encoding":
          const s = this.getToken();
          let r;
          if (/^\d+$/.test(s)) {
            r = [];
            const o = 0 | parseInt(s, 10);
            this.getToken();
            for (let l = 0; l < o; l++) {
              for (e = this.getToken(); e !== "dup" && e !== "def"; )
                if (e = this.getToken(), e === null) return;
              if (e === "def") break;
              const c = this.readInt();
              this.getToken();
              const h = this.getToken();
              r[c] = h, this.getToken();
            }
          } else r = op(s);
          t.builtInEncoding = r;
          break;
        case "FontBBox":
          const a = this.readNumberArray();
          t.ascent = Math.max(a[3], a[1]), t.descent = Math.min(a[1], a[3]), t.ascentScaled = !0;
      }
  }
}
function B_(i, t, e) {
  const n = i.length, s = t.length, r = n - s;
  let a = e, o = !1;
  for (; a < r; ) {
    let l = 0;
    for (; l < s && i[a + l] === t[l]; ) l++;
    if (l >= s) {
      for (a += l; a < n && or(i[a]); ) a++;
      o = !0;
      break;
    }
    a++;
  }
  return { found: o, length: a };
}
class TN {
  constructor(t, e, n) {
    let s = n.length1;
    n.length2;
    let r = e.peekBytes(6);
    const a = r[0] === 128 && r[1] === 1;
    a && (e.skip(6), s = r[5] << 24 | r[4] << 16 | r[3] << 8 | r[2]);
    const o = function(p, g) {
      const b = [101, 101, 120, 101, 99], y = p.pos;
      let v, w, _, x;
      try {
        v = p.getBytes(g), w = v.length;
      } catch {
      }
      if (w === g && (_ = B_(v, b, g - 2 * b.length), _.found && _.length === g))
        return { stream: new gi(v), length: g };
      for (H('Invalid "Length1" property in Type1 font -- trying to recover.'), p.pos = y; _ = B_(p.peekBytes(2048), b, 0), _.length !== 0; )
        if (p.pos += _.length, _.found) {
          x = p.pos - y;
          break;
        }
      return p.pos = y, x ? { stream: new gi(p.getBytes(x)), length: x } : (H('Unable to recover "Length1" property in Type1 font -- using as is.'), { stream: new gi(p.getBytes(g)), length: g });
    }(e, s);
    new R_(o.stream, !1, lp).extractFontHeader(n), a && (r = e.getBytes(6), r[5] << 24 | r[4] << 16 | r[3] << 8 | r[2]);
    const l = function(p, g) {
      const b = p.getBytes();
      if (b.length === 0) throw new ht("getEexecBlock - no font program found.");
      return { stream: new gi(b), length: b.length };
    }(e), c = new R_(l.stream, !0, lp).extractFontProgram(n);
    for (const d in c.properties) n[d] = c.properties[d];
    const h = c.charstrings, u = this.getType2Charstrings(h), f = this.getType2Subrs(c.subrs);
    this.charstrings = h, this.data = this.wrap(t, u, this.charstrings, f, n), this.seacs = this.getSeacs(c.charstrings);
  }
  get numGlyphs() {
    return this.charstrings.length + 1;
  }
  getCharset() {
    const t = [".notdef"];
    for (const { glyphName: e } of this.charstrings) t.push(e);
    return t;
  }
  getGlyphMapping(t) {
    const e = this.charstrings;
    if (t.composite) {
      const o = /* @__PURE__ */ Object.create(null);
      for (let l = 0, c = e.length; l < c; l++)
        o[t.cMap.charCodeOf(l)] = l + 1;
      return o;
    }
    const n = [".notdef"];
    let s, r;
    for (r = 0; r < e.length; r++) n.push(e[r].glyphName);
    const a = t.builtInEncoding;
    if (a) {
      s = /* @__PURE__ */ Object.create(null);
      for (const o in a)
        r = n.indexOf(a[o]), r >= 0 && (s[o] = r);
    }
    return dD(t, s, n);
  }
  hasGlyphId(t) {
    return t < 0 || t >= this.numGlyphs ? !1 : t === 0 ? !0 : this.charstrings[t - 1].charstring.length > 0;
  }
  getSeacs(t) {
    const e = [];
    for (let n = 0, s = t.length; n < s; n++) {
      const r = t[n];
      r.seac && (e[n + 1] = r.seac);
    }
    return e;
  }
  getType2Charstrings(t) {
    const e = [];
    for (const n of t) e.push(n.charstring);
    return e;
  }
  getType2Subrs(t) {
    let e = 0;
    const n = t.length;
    e = n < 1133 ? 107 : n < 33769 ? 1131 : 32768;
    const s = [];
    let r;
    for (r = 0; r < e; r++) s.push([11]);
    for (r = 0; r < n; r++) s.push(t[r]);
    return s;
  }
  wrap(t, e, n, s, r) {
    const a = new fD();
    a.header = new pD(1, 0, 4, 4), a.names = [t];
    const o = new cp();
    o.setByName("version", 391), o.setByName("Notice", 392), o.setByName("FullName", 393), o.setByName("FamilyName", 394), o.setByName("Weight", 395), o.setByName("Encoding", null), o.setByName("FontMatrix", r.fontMatrix), o.setByName("FontBBox", r.bbox), o.setByName("charset", null), o.setByName("CharStrings", null), o.setByName("Private", null), a.topDict = o;
    const l = new Zy();
    l.add("Version 0.11"), l.add("See original notice"), l.add(t), l.add(t), l.add("Medium"), a.strings = l, a.globalSubrIndex = new n0();
    const c = e.length, h = [".notdef"];
    let u, f;
    for (u = 0; u < c; u++) {
      const y = n[u].glyphName;
      x9.indexOf(y) === -1 && l.add(y), h.push(y);
    }
    a.charset = new w2(!1, 0, h);
    const d = new n0();
    for (d.add([139, 14]), u = 0; u < c; u++) d.add(e[u]);
    a.charStrings = d;
    const p = new hp();
    p.setByName("Subrs", null);
    const g = ["BlueValues", "OtherBlues", "FamilyBlues", "FamilyOtherBlues", "StemSnapH", "StemSnapV", "BlueShift", "BlueFuzz", "BlueScale", "LanguageGroup", "ExpansionFactor", "ForceBold", "StdHW", "StdVW"];
    for (u = 0, f = g.length; u < f; u++) {
      const y = g[u];
      if (!(y in r.privateData)) continue;
      const v = r.privateData[y];
      if (Array.isArray(v)) for (let w = v.length - 1; w > 0; w--) v[w] -= v[w - 1];
      p.setByName(y, v);
    }
    a.topDict.privateDict = p;
    const b = new n0();
    for (u = 0, f = s.length; u < f; u++) b.add(s[u]);
    return p.subrsIndex = b, new Cg(a).compile();
  }
}
const qo = [[57344, 63743], [1048576, 1114109]], O0 = 1e3, P_ = ["ascent", "bbox", "black", "bold", "charProcOperatorList", "cssFontInfo", "data", "defaultVMetrics", "defaultWidth", "descent", "disableFontFace", "fallbackName", "fontExtraProperties", "fontMatrix", "isInvalidPDFjsFont", "isType3Font", "italic", "loadedName", "mimetype", "missingFile", "name", "remeasure", "systemFontInfo", "vertical"], FN = ["cMap", "composite", "defaultEncoding", "differences", "isMonospace", "isSerifFont", "isSymbolicFont", "seacMap", "subtype", "toFontChar", "toUnicode", "type", "vmetrics", "widths"];
function N_(i) {
  if (!i.fontMatrix || i.fontMatrix[0] === f1[0]) return;
  const t = 1e-3 / i.fontMatrix[0], e = i.widths;
  for (const n in e) e[n] *= t;
  i.defaultWidth *= t;
}
function L_(i) {
  if (!i.fallbackToUnicode || i.toUnicode instanceof Dr) return;
  const t = [];
  for (const e in i.fallbackToUnicode) i.toUnicode.has(e) || (t[e] = i.fallbackToUnicode[e]);
  t.length > 0 && i.toUnicode.amend(t);
}
class IN {
  constructor(t, e, n, s, r, a, o, l, c) {
    this.originalCharCode = t, this.fontChar = e, this.unicode = n, this.accent = s, this.width = r, this.vmetric = a, this.operatorListId = o, this.isSpace = l, this.isInFont = c;
  }
  get category() {
    return At(this, "category", function(e) {
      const n = wb.get(e);
      if (n) return n;
      const s = e.match(KP), r = { isWhitespace: !!(s != null && s[1]), isZeroWidthDiacritic: !!(s != null && s[2]), isInvisibleFormatMark: !!(s != null && s[3]) };
      return wb.set(e, r), r;
    }(this.unicode), !0);
  }
}
function E0(i, t) {
  return (i << 8) + t;
}
function Tf(i, t, e) {
  i[t + 1] = e, i[t] = e >>> 8;
}
function Ls(i, t) {
  const e = (i << 8) + t;
  return 32768 & e ? e - 65536 : e;
}
function Me(i) {
  return String.fromCharCode(i >> 8 & 255, 255 & i);
}
function D0(i) {
  return i > 32767 ? i = 32767 : i < -32768 && (i = -32768), String.fromCharCode(i >> 8 & 255, 255 & i);
}
function wD(i) {
  return Is(i.peekBytes(4)) === "ttcf";
}
function MN(i, { type: t, subtype: e, composite: n }) {
  let s, r;
  return function(o) {
    const l = o.peekBytes(4);
    return Ne(l, 0) === 65536 || Is(l) === "true";
  }(i) || wD(i) ? s = n ? "CIDFontType2" : "TrueType" : function(o) {
    return Is(o.peekBytes(4)) === "OTTO";
  }(i) ? s = n ? "CIDFontType2" : "OpenType" : function(o) {
    const l = o.peekBytes(2);
    return l[0] === 37 && l[1] === 33 || l[0] === 128 && l[1] === 1;
  }(i) ? s = n ? "CIDFontType0" : t === "MMType1" ? "MMType1" : "Type1" : function(o) {
    const l = o.peekBytes(4);
    return l[0] >= 1 && l[3] >= 1 && l[3] <= 4;
  }(i) ? n ? (s = "CIDFontType0", r = "CIDFontType0C") : (s = t === "MMType1" ? "MMType1" : "Type1", r = "Type1C") : (H("getFontFileType: Unable to detect correct font file Type/Subtype."), s = t, r = e), [s, r];
}
function o5(i, t) {
  for (const e in t) i[+e] = t[e];
}
function E6(i, t, e) {
  const n = [];
  let s;
  for (let r = 0, a = i.length; r < a; r++)
    s = ef(i[r], t), s !== -1 && (n[r] = s);
  for (const r in e)
    s = ef(e[r], t), s !== -1 && (n[+r] = s);
  return n;
}
function RN(i) {
  return i.platform === 1 && i.encoding === 0 && i.language === 0;
}
function O_(i) {
  return i.platform === 3 && i.encoding === 1 && i.language === 1033;
}
function D6(i, t, e = !1) {
  switch (t.length) {
    case 1:
      return t.charCodeAt(0);
    case 2:
      return t.charCodeAt(0) << 8 | t.charCodeAt(1);
  }
  const n = `Unsupported CID string (charCode ${i}): "${t}".`;
  if (e) throw new ht(n);
  return H(n), t;
}
function $_(i, t, e, n) {
  const s = /* @__PURE__ */ Object.create(null), r = /* @__PURE__ */ new Map(), a = [], o = /* @__PURE__ */ new Set();
  let l = 0, c = qo[l][0], h = qo[l][1], u = null;
  for (const d in i) {
    let p = i[d];
    if (!t(p)) continue;
    if (c > h) {
      if (l++, l >= qo.length) {
        H("Ran out of space in font private use area.");
        break;
      }
      c = qo[l][0], h = qo[l][1];
    }
    const g = c++;
    p === 0 && (p = e);
    let b = n.get(d);
    if (typeof b == "string") if (b.length === 1) b = b.codePointAt(0);
    else {
      if (!u) {
        u = /* @__PURE__ */ new Map();
        for (let y = 64256; y <= 64335; y++) {
          const v = String.fromCharCode(y).normalize("NFKD");
          v.length > 1 && u.set(v, y);
        }
      }
      b = u.get(b) || b.codePointAt(0);
    }
    b && (f = b, !(qo[0][0] <= f && f <= qo[0][1] || qo[1][0] <= f && f <= qo[1][1])) && !o.has(p) && (r.set(b, p), o.add(p)), s[g] = p, a[d] = g;
  }
  var f;
  return { toFontChar: a, charCodeToGlyphId: s, toUnicodeExtraMap: r, nextAvailableFontCharCode: c };
}
function q_(i, t, e) {
  const n = function(L, it, O) {
    const at = [];
    for (const K in L) L[K] >= O || at.push({ fontCharCode: 0 | K, glyphId: L[K] });
    if (it) for (const [K, z] of it) z >= O || at.push({ fontCharCode: K, glyphId: z });
    at.length === 0 && at.push({ fontCharCode: 0, glyphId: 0 }), at.sort((K, z) => K.fontCharCode - z.fontCharCode);
    const W = [], q = at.length;
    for (let K = 0; K < q; ) {
      const z = at[K].fontCharCode, j = [at[K].glyphId];
      ++K;
      let N = z;
      for (; K < q && N + 1 === at[K].fontCharCode && (j.push(at[K].glyphId), ++N, ++K, N !== 65535); )
        ;
      W.push([z, N, j]);
    }
    return W;
  }(i, t, e), s = n.at(-1)[1] > 65535 ? 2 : 1;
  let r, a, o, l, c = "\0\0" + Me(s) + "\0\0" + An(4 + 8 * s);
  for (r = n.length - 1; r >= 0 && !(n[r][0] <= 65535); --r) ;
  const h = r + 1;
  n[r][0] < 65535 && n[r][1] === 65535 && (n[r][1] = 65534);
  const u = n[r][1] < 65535 ? 1 : 0, f = h + u, d = dp.getSearchParams(f, 2);
  let p, g, b, y, v = "", w = "", _ = "", x = "", k = "", S = 0;
  for (r = 0, a = h; r < a; r++) {
    p = n[r], g = p[0], b = p[1], v += Me(g), w += Me(b), y = p[2];
    let B = !0;
    for (o = 1, l = y.length; o < l; ++o) if (y[o] !== y[o - 1] + 1) {
      B = !1;
      break;
    }
    if (B)
      _ += Me(y[0] - g & 65535), x += Me(0);
    else {
      const L = 2 * (f - r) + 2 * S;
      for (S += b - g + 1, _ += Me(0), x += Me(L), o = 0, l = y.length; o < l; ++o) k += Me(y[o]);
    }
  }
  u > 0 && (w += "ÿÿ", v += "ÿÿ", _ += "\0", x += "\0\0");
  const T = "\0\0" + Me(2 * f) + Me(d.range) + Me(d.entry) + Me(d.rangeShift) + w + "\0\0" + v + _ + x + k;
  let I = "", R = "";
  if (s > 1) {
    for (c += `\0\0
` + An(4 + 8 * s + 4 + T.length), I = "", r = 0, a = n.length; r < a; r++) {
      p = n[r], g = p[0], y = p[2];
      let B = y[0];
      for (o = 1, l = y.length; o < l; ++o) y[o] !== y[o - 1] + 1 && (b = p[0] + o - 1, I += An(g) + An(b) + An(B), g = b + 1, B = y[o]);
      I += An(g) + An(p[1]) + An(B);
    }
    R = "\0\f\0\0" + An(I.length + 16) + "\0\0\0\0" + An(I.length / 12);
  }
  return c + "\0" + Me(T.length + 4) + T + R + I;
}
function z_(i, t, e) {
  e || (e = { unitsPerEm: 0, yMax: 0, yMin: 0, ascent: 0, descent: 0 });
  let n = 0, s = 0, r = 0, a = 0, o = null, l = 0, c = -1;
  if (t) {
    for (let y in t)
      if (y |= 0, (o > y || !o) && (o = y), l < y && (l = y), c = YP(y, c), c < 32) n |= 1 << c;
      else if (c < 64) s |= 1 << c - 32;
      else if (c < 96) r |= 1 << c - 64;
      else {
        if (!(c < 123)) throw new ht("Unicode ranges Bits > 123 are reserved for internal usage");
        a |= 1 << c - 96;
      }
    l > 65535 && (l = 65535);
  } else
    o = 0, l = 255;
  const h = i.bbox || [0, 0, 0, 0], u = e.unitsPerEm || (i.fontMatrix ? 1 / Math.max(...i.fontMatrix.slice(0, 4).map(Math.abs)) : 1e3), f = i.ascentScaled ? 1 : u / O0, d = e.ascent || Math.round(f * (i.ascent || h[3]));
  let p = e.descent || Math.round(f * (i.descent || h[1]));
  p > 0 && i.descent > 0 && h[1] < 0 && (p = -p);
  const g = e.yMax || d, b = -e.yMin || -p;
  return "\0$ô\0\0\0»\0\0\0»\0\0ß\x001\0\0\0\0" + String.fromCharCode(i.fixedPitch ? 9 : 0) + "\0\0\0\0\0\0" + An(n) + An(s) + An(r) + An(a) + "*21*" + Me(i.italicAngle ? 1 : 0) + Me(o || i.firstChar) + Me(l || i.lastChar) + Me(d) + Me(p) + "\0d" + Me(g) + Me(b) + "\0\0\0\0\0\0\0\0" + Me(i.xHeight) + Me(i.capHeight) + Me(0) + Me(o || i.firstChar) + "\0";
}
function U_(i) {
  return "\0\0\0" + An(Math.floor(65536 * i.italicAngle)) + "\0\0\0\0" + An(i.fixedPitch ? 1 : 0) + "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0";
}
function BN(i) {
  return i.replaceAll(/[^\x21-\x7E]|[[\](){}<>/%]/g, "").slice(0, 63);
}
function T6(i, t) {
  t || (t = [[], []]);
  const e = [t[0][0] || "Original licence", t[0][1] || i, t[0][2] || "Unknown", t[0][3] || "uniqueID", t[0][4] || i, t[0][5] || "Version 0.11", t[0][6] || BN(i), t[0][7] || "Unknown", t[0][8] || "Unknown", t[0][9] || "Unknown"], n = [];
  let s, r, a, o, l;
  for (s = 0, r = e.length; s < r; s++) {
    l = t[1][s] || e[s];
    const b = [];
    for (a = 0, o = l.length; a < o; a++) b.push(Me(l.charCodeAt(a)));
    n.push(b.join(""));
  }
  const c = [e, n], h = ["\0", "\0"], u = ["\0\0", "\0"], f = ["\0\0", "	"], d = e.length * h.length;
  let p = "\0\0" + Me(d) + Me(12 * d + 6), g = 0;
  for (s = 0, r = h.length; s < r; s++) {
    const b = c[s];
    for (a = 0, o = b.length; a < o; a++)
      l = b[a], p += h[s] + u[s] + f[s] + Me(a) + Me(l.length) + Me(g), g += l.length;
  }
  return p += e.join("") + n.join(""), p;
}
class H_ {
  constructor(t, e, n, s) {
    var h;
    this.name = t, this.psName = null, this.mimetype = null, this.disableFontFace = s.disableFontFace, this.fontExtraProperties = s.fontExtraProperties, this.loadedName = n.loadedName, this.isType3Font = n.isType3Font, this.missingFile = !1, this.cssFontInfo = n.cssFontInfo, this._charsCache = /* @__PURE__ */ Object.create(null), this._glyphCache = /* @__PURE__ */ Object.create(null);
    let r = !!(n.flags & hD);
    if (!r && !n.isSimulatedFlags) {
      const u = t.replaceAll(/[,_]/g, "-").split("-", 1)[0], f = Jy();
      for (const d of u.split("+")) if (f[d]) {
        r = !0;
        break;
      }
    }
    this.isSerifFont = r, this.isSymbolicFont = !!(n.flags & u3), this.isMonospace = !!(n.flags & _9);
    let { type: a, subtype: o } = n;
    this.type = a, this.subtype = o, this.systemFontInfo = n.systemFontInfo;
    const l = t.match(/^InvalidPDFjsFont_(.*)_\d+$/);
    if (this.isInvalidPDFjsFont = !!l, this.isInvalidPDFjsFont ? this.fallbackName = l[1] : this.isMonospace ? this.fallbackName = "monospace" : this.isSerifFont ? this.fallbackName = "serif" : this.fallbackName = "sans-serif", (h = this.systemFontInfo) != null && h.guessFallback && (this.systemFontInfo.guessFallback = !1, this.systemFontInfo.css += `,${this.fallbackName}`), this.differences = n.differences, this.widths = n.widths, this.defaultWidth = n.defaultWidth, this.composite = n.composite, this.cMap = n.cMap, this.capHeight = n.capHeight / O0, this.ascent = n.ascent / O0, this.descent = n.descent / O0, this.lineHeight = this.ascent - this.descent, this.fontMatrix = n.fontMatrix, this.bbox = n.bbox, this.defaultEncoding = n.defaultEncoding, this.toUnicode = n.toUnicode, this.toFontChar = [], n.type === "Type3") {
      for (let u = 0; u < 256; u++) this.toFontChar[u] = this.differences[u] || n.defaultEncoding[u];
      return;
    }
    if (this.cidEncoding = n.cidEncoding || "", this.vertical = !!n.vertical, this.vertical && (this.vmetrics = n.vmetrics, this.defaultVMetrics = n.defaultVMetrics), !e || e.isEmpty) {
      e && H('Font file is empty in "' + t + '" (' + this.loadedName + ")"), this.fallbackToSystemFont(n);
      return;
    }
    [a, o] = MN(e, n), a === this.type && o === this.subtype || ue(`Inconsistent font file Type/SubType, expected: ${this.type}/${this.subtype} but found: ${a}/${o}.`);
    let c;
    try {
      switch (a) {
        case "MMType1":
          ue("MMType1 font (" + t + "), falling back to Type1.");
        case "Type1":
        case "CIDFontType0":
          this.mimetype = "font/opentype";
          const u = o === "Type1C" || o === "CIDFontType0C" ? new A6(e, n) : new TN(t, e, n);
          N_(n), c = this.convert(t, u, n);
          break;
        case "OpenType":
        case "TrueType":
        case "CIDFontType2":
          this.mimetype = "font/opentype", c = this.checkAndRepair(t, e, n), N_(n), this.isOpenType && (a = "OpenType");
          break;
        default:
          throw new ht(`Font ${a} is not supported`);
      }
    } catch (u) {
      H(u), this.fallbackToSystemFont(n);
      return;
    }
    L_(n), this.data = c, this.type = a, this.subtype = o, this.fontMatrix = n.fontMatrix, this.widths = n.widths, this.defaultWidth = n.defaultWidth, this.toUnicode = n.toUnicode, this.seacMap = n.seacMap;
  }
  get renderer() {
    return At(this, "renderer", pN.create(this, lp));
  }
  exportData() {
    const t = this.fontExtraProperties ? [...P_, ...FN] : P_, e = /* @__PURE__ */ Object.create(null);
    for (const n of t) {
      const s = this[n];
      s !== void 0 && (e[n] = s);
    }
    return e;
  }
  fallbackToSystemFont(t) {
    this.missingFile = !0;
    const { name: e, type: n } = this;
    let s = Sg(e);
    const r = B4(), a = gD(), o = !!r[s], l = !(!a[s] || !r[a[s]]);
    s = r[s] || a[s] || s;
    const c = gN()[s];
    c && (isNaN(this.ascent) && (this.ascent = c.ascent / O0), isNaN(this.descent) && (this.descent = c.descent / O0), isNaN(this.capHeight) && (this.capHeight = c.capHeight / O0)), this.bold = /bold/gi.test(s), this.italic = /oblique|italic/gi.test(s), this.black = /Black/g.test(e);
    const h = /Narrow/g.test(e);
    if (this.remeasure = (!o || h) && Object.keys(this.widths).length > 0, (o || l) && n === "CIDFontType2" && this.cidEncoding.startsWith("Identity-")) {
      const u = t.cidToGidMap, f = [];
      if (o5(f, C_()), /Arial-?Black/i.test(e) ? o5(f, oN()) : /Calibri/i.test(e) && o5(f, lN()), u) {
        for (const d in f) {
          const p = f[d];
          u[p] !== void 0 && (f[+d] = u[p]);
        }
        u.length !== this.toUnicode.length && t.hasIncludedToUnicodeMap && this.toUnicode instanceof Dr && this.toUnicode.forEach(function(d, p) {
          const g = f[d];
          u[g] === void 0 && (f[+d] = p);
        });
      }
      this.toUnicode instanceof Dr || this.toUnicode.forEach(function(d, p) {
        f[+d] = p;
      }), this.toFontChar = f, this.toUnicode = new v2(f);
    } else if (/Symbol/i.test(s)) this.toFontChar = E6(Xy, Ga(), this.differences);
    else if (/Dingbats/i.test(s)) this.toFontChar = E6(Yy, WP(), this.differences);
    else if (o || l) {
      const u = E6(this.defaultEncoding, Ga(), this.differences);
      n !== "CIDFontType2" || this.cidEncoding.startsWith("Identity-") || this.toUnicode instanceof Dr || this.toUnicode.forEach(function(f, d) {
        u[+f] = d;
      }), this.toFontChar = u;
    } else {
      const u = Ga(), f = [];
      this.toUnicode.forEach((d, p) => {
        if (!this.composite) {
          const g = ef(this.differences[d] || this.defaultEncoding[d], u);
          g !== -1 && (p = g);
        }
        f[+d] = p;
      }), this.composite && this.toUnicode instanceof Dr && /Tahoma|Verdana/i.test(e) && o5(f, C_()), this.toFontChar = f;
    }
    L_(t), this.loadedName = s.split("-", 1)[0];
  }
  checkAndRepair(t, e, n) {
    var O, at, W;
    const s = ["OS/2", "cmap", "head", "hhea", "hmtx", "maxp", "name", "post", "loca", "glyf", "fpgm", "prep", "cvt ", "CFF "];
    function r(q, K) {
      const z = /* @__PURE__ */ Object.create(null);
      z["OS/2"] = null, z.cmap = null, z.head = null, z.hhea = null, z.hmtx = null, z.maxp = null, z.name = null, z.post = null;
      for (let j = 0; j < K; j++) {
        const N = a(q);
        s.includes(N.tag) && N.length !== 0 && (z[N.tag] = N);
      }
      return z;
    }
    function a(q) {
      const K = q.getString(4), z = q.getInt32() >>> 0, j = q.getInt32() >>> 0, N = q.getInt32() >>> 0, Q = q.pos;
      q.pos = q.start || 0, q.skip(j);
      const Y = q.getBytes(N);
      return q.pos = Q, K === "head" && (Y[8] = Y[9] = Y[10] = Y[11] = 0, Y[17] |= 32), { tag: K, checksum: z, length: N, offset: j, data: Y };
    }
    function o(q) {
      return { version: q.getString(4), numTables: q.getUint16(), searchRange: q.getUint16(), entrySelector: q.getUint16(), rangeShift: q.getUint16() };
    }
    function l(q, K, z, j, N, Q) {
      const Y = { length: 0, sizeOfInstructions: 0 };
      if (K < 0 || K >= q.length || z > q.length || z - K <= 12) return Y;
      const et = q.subarray(K, z), $ = Ls(et[2], et[3]), dt = Ls(et[4], et[5]), tt = Ls(et[6], et[7]), ut = Ls(et[8], et[9]);
      $ > tt && (Tf(et, 2, tt), Tf(et, 6, $)), dt > ut && (Tf(et, 4, ut), Tf(et, 8, dt));
      const St = Ls(et[0], et[1]);
      if (St < 0)
        return St < -1 || (j.set(et, N), Y.length = et.length), Y;
      let G, V = 10, nt = 0;
      for (G = 0; G < St; G++)
        nt = (et[V] << 8 | et[V + 1]) + 1, V += 2;
      const gt = V, _t = et[V] << 8 | et[V + 1];
      Y.sizeOfInstructions = _t, V += 2 + _t;
      const kt = V;
      let xt = 0;
      for (G = 0; G < nt; G++) {
        const yt = et[V++];
        192 & yt && (et[V - 1] = 63 & yt);
        let Ot = 2;
        2 & yt ? Ot = 1 : 16 & yt && (Ot = 0);
        let Kt = 2;
        4 & yt ? Kt = 1 : 32 & yt && (Kt = 0);
        const Ft = Ot + Kt;
        if (xt += Ft, 8 & yt) {
          const It = et[V++];
          It === 0 && (et[V - 1] ^= 8), G += It, xt += It * Ft;
        }
      }
      if (xt === 0) return Y;
      let wt = V + xt;
      return wt > et.length ? Y : !Q && _t > 0 ? (j.set(et.subarray(0, gt), N), j.set([0, 0], N + gt), j.set(et.subarray(kt, wt), N + gt + 2), wt -= _t, et.length - wt > 3 && (wt = wt + 3 & -4), Y.length = wt, Y) : et.length - wt > 3 ? (wt = wt + 3 & -4, j.set(et.subarray(0, wt), N), Y.length = wt, Y) : (j.set(et, N), Y.length = et.length, Y);
    }
    function c(q) {
      const K = (e.start || 0) + q.offset;
      e.pos = K;
      const z = [[], []], j = [], N = q.length, Q = K + N;
      if (e.getUint16() !== 0 || N < 6) return [z, j];
      const Y = e.getUint16(), et = e.getUint16();
      let $, dt;
      for ($ = 0; $ < Y && e.pos + 12 <= Q; $++) {
        const tt = { platform: e.getUint16(), encoding: e.getUint16(), language: e.getUint16(), name: e.getUint16(), length: e.getUint16(), offset: e.getUint16() };
        (RN(tt) || O_(tt)) && j.push(tt);
      }
      for ($ = 0, dt = j.length; $ < dt; $++) {
        const tt = j[$];
        if (tt.length <= 0) continue;
        const ut = K + et + tt.offset;
        if (ut + tt.length > Q) continue;
        e.pos = ut;
        const St = tt.name;
        if (tt.encoding) {
          let G = "";
          for (let V = 0, nt = tt.length; V < nt; V += 2) G += String.fromCharCode(e.getUint16());
          z[1][St] = G;
        } else z[0][St] = e.getString(tt.length);
      }
      return [z, j];
    }
    const h = [0, 0, 0, 0, 0, 0, 0, 0, -2, -2, -2, -2, 0, 0, -2, -5, -1, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, -1, -1, 1, -1, -999, 0, 1, 0, -1, -2, 0, -1, -2, -1, -1, 0, -1, -1, 0, 0, -999, -999, -1, -1, -1, -1, -2, -999, -2, -2, -999, 0, -2, -2, 0, 0, -2, 0, -2, 0, 0, 0, -2, -1, -1, 1, 1, 0, 0, -1, -1, -1, -1, -1, -1, -1, 0, 0, -1, 0, -1, -1, 0, -999, -1, -1, -1, -1, -1, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, -999, -999, -999, -999, -999, -1, -1, -2, -2, 0, 0, 0, 0, -1, -1, -999, -2, -2, 0, 0, -1, -2, -2, 0, 0, 0, -1, -1, -1, -2];
    function u(q, K) {
      let z, j, N, Q, Y, et = q.data, $ = 0, dt = 0, tt = 0;
      const ut = [], St = [], G = [];
      let V = K.tooComplexToFollowFunctions, nt = !1, gt = 0, _t = 0;
      for (let xt = et.length; $ < xt; ) {
        const wt = et[$++];
        if (wt === 64)
          if (j = et[$++], nt || _t) $ += j;
          else for (z = 0; z < j; z++) ut.push(et[$++]);
        else if (wt === 65)
          if (j = et[$++], nt || _t) $ += 2 * j;
          else for (z = 0; z < j; z++)
            N = et[$++], ut.push(N << 8 | et[$++]);
        else if ((248 & wt) == 176)
          if (j = wt - 176 + 1, nt || _t) $ += j;
          else for (z = 0; z < j; z++) ut.push(et[$++]);
        else if ((248 & wt) == 184)
          if (j = wt - 184 + 1, nt || _t) $ += 2 * j;
          else for (z = 0; z < j; z++)
            N = et[$++], ut.push(Ls(N, et[$++]));
        else if (wt !== 43 || V) if (wt !== 44 || V) {
          if (wt === 45) if (nt)
            nt = !1, dt = $;
          else {
            if (Y = St.pop(), !Y) {
              H("TT: ENDF bad stack"), K.hintsValid = !1;
              return;
            }
            Q = G.pop(), et = Y.data, $ = Y.i, K.functionsStackDeltas[Q] = ut.length - Y.stackTop;
          }
          else if (wt === 137)
            (nt || _t) && (H("TT: nested IDEFs not allowed"), V = !0), nt = !0, tt = $;
          else if (wt === 88) ++gt;
          else if (wt === 27) _t = gt;
          else if (wt === 89)
            _t === gt && (_t = 0), --gt;
          else if (wt === 28 && !nt && !_t) {
            const yt = ut.at(-1);
            yt > 0 && ($ += yt - 1);
          }
        } else
          (nt || _t) && (H("TT: nested FDEFs not allowed"), V = !0), nt = !0, tt = $, Q = ut.pop(), K.functionsDefined[Q] = { data: et, i: $ };
        else if (!nt && !_t) {
          if (Q = ut.at(-1), isNaN(Q)) ue("TT: CALL empty stack (or invalid entry).");
          else if (K.functionsUsed[Q] = !0, Q in K.functionsStackDeltas) {
            const yt = ut.length + K.functionsStackDeltas[Q];
            if (yt < 0) {
              H("TT: CALL invalid functions stack delta."), K.hintsValid = !1;
              return;
            }
            ut.length = yt;
          } else if (Q in K.functionsDefined && !G.includes(Q)) {
            if (St.push({ data: et, i: $, stackTop: ut.length - 1 }), G.push(Q), Y = K.functionsDefined[Q], !Y) {
              H("TT: CALL non-existent function"), K.hintsValid = !1;
              return;
            }
            et = Y.data, $ = Y.i;
          }
        }
        if (!nt && !_t) {
          let yt = 0;
          for (wt <= 142 ? yt = h[wt] : wt >= 192 && wt <= 223 ? yt = -1 : wt >= 224 && (yt = -2), wt >= 113 && wt <= 117 && (j = ut.pop(), isNaN(j) || (yt = 2 * -j)); yt < 0 && ut.length > 0; )
            ut.pop(), yt++;
          for (; yt > 0; )
            ut.push(NaN), yt--;
        }
      }
      K.tooComplexToFollowFunctions = V;
      const kt = [et];
      $ > et.length && kt.push(new Uint8Array($ - et.length)), tt > dt && (H("TT: complementing a missing function tail"), kt.push(new Uint8Array([34, 45]))), function(wt, yt) {
        if (yt.length > 1) {
          let Ot, Kt, Ft = 0;
          for (Ot = 0, Kt = yt.length; Ot < Kt; Ot++) Ft += yt[Ot].length;
          Ft = Ft + 3 & -4;
          const It = new Uint8Array(Ft);
          let Pt = 0;
          for (Ot = 0, Kt = yt.length; Ot < Kt; Ot++)
            It.set(yt[Ot], Pt), Pt += yt[Ot].length;
          wt.data = It, wt.length = Ft;
        }
      }(q, kt);
    }
    let f, d, p, g;
    if (wD(e = new gi(new Uint8Array(e.getBytes())))) {
      const q = function(z, j) {
        var $;
        const { numFonts: N, offsetTable: Q } = function(tt) {
          const ut = tt.getString(4);
          pn(ut === "ttcf", "Must be a TrueType Collection font.");
          const St = tt.getUint16(), G = tt.getUint16(), V = tt.getInt32() >>> 0, nt = [];
          for (let _t = 0; _t < V; _t++) nt.push(tt.getInt32() >>> 0);
          const gt = { ttcTag: ut, majorVersion: St, minorVersion: G, numFonts: V, offsetTable: nt };
          switch (St) {
            case 1:
              return gt;
            case 2:
              return gt.dsigTag = tt.getInt32() >>> 0, gt.dsigLength = tt.getInt32() >>> 0, gt.dsigOffset = tt.getInt32() >>> 0, gt;
          }
          throw new ht(`Invalid TrueType Collection majorVersion: ${St}.`);
        }(z), Y = j.split("+");
        let et;
        for (let dt = 0; dt < N; dt++) {
          z.pos = (z.start || 0) + Q[dt];
          const tt = o(z), ut = r(z, tt.numTables);
          if (!ut.name) throw new ht('TrueType Collection font must contain a "name" table.');
          const [St] = c(ut.name);
          for (let G = 0, V = St.length; G < V; G++) for (let nt = 0, gt = St[G].length; nt < gt; nt++) {
            const _t = ($ = St[G][nt]) == null ? void 0 : $.replaceAll(/\s/g, "");
            if (_t) {
              if (_t === j) return { header: tt, tables: ut };
              if (!(Y.length < 2)) for (const kt of Y) _t === kt && (et = { name: kt, header: tt, tables: ut });
            }
          }
        }
        if (et)
          return H(`TrueType Collection does not contain "${j}" font, falling back to "${et.name}" font instead.`), { header: et.header, tables: et.tables };
        throw new ht(`TrueType Collection does not contain "${j}" font.`);
      }(e, this.name);
      f = q.header, d = q.tables;
    } else
      f = o(e), d = r(e, f.numTables);
    const b = !d["CFF "];
    if (b) {
      if (!d.loca) throw new ht('Required "loca" table is not found');
      d.glyf || (H('Required "glyf" table is not found -- trying to recover.'), d.glyf = { tag: "glyf", data: new Uint8Array(0) }), this.isOpenType = !1;
    } else {
      const q = n.composite && (((O = n.cidToGidMap) == null ? void 0 : O.length) > 0 || !(n.cMap instanceof Du));
      if (f.version === "OTTO" && !q || !d.head || !d.hhea || !d.maxp || !d.post)
        return g = new gi(d["CFF "].data), p = new A6(g, n), this.convert(t, p, n);
      delete d.glyf, delete d.loca, delete d.fpgm, delete d.prep, delete d["cvt "], this.isOpenType = !0;
    }
    if (!d.maxp) throw new ht('Required "maxp" table is not found');
    e.pos = (e.start || 0) + d.maxp.offset;
    let y = e.getInt32();
    const v = e.getUint16();
    if (y !== 65536 && y !== 20480) {
      if (d.maxp.length === 6) y = 20480;
      else {
        if (!(d.maxp.length >= 32)) throw new ht('"maxp" table has a wrong version number');
        y = 65536;
      }
      (function(K, z, j) {
        K[z + 3] = 255 & j, K[z + 2] = j >>> 8, K[z + 1] = j >>> 16, K[z] = j >>> 24;
      })(d.maxp.data, 0, y);
    }
    if (((at = n.scaleFactors) == null ? void 0 : at.length) === v && b) {
      const { scaleFactors: q } = n, K = E0(d.head.data[50], d.head.data[51]), z = new bN({ glyfTable: d.glyf.data, isGlyphLocationsLong: K, locaTable: d.loca.data, numGlyphs: v });
      z.scale(q);
      const { glyf: j, loca: N, isLocationLong: Q } = z.write();
      d.glyf.data = j, d.loca.data = N, Q !== !!K && (d.head.data[50] = 0, d.head.data[51] = Q ? 1 : 0);
      const Y = d.hmtx.data;
      for (let et = 0; et < v; et++) {
        const $ = 4 * et, dt = Math.round(q[et] * E0(Y[$], Y[$ + 1]));
        Y[$] = dt >> 8 & 255, Y[$ + 1] = 255 & dt, Tf(Y, $ + 2, Math.round(q[et] * Ls(Y[$ + 2], Y[$ + 3])));
      }
    }
    let w = v + 1, _ = !0;
    w > 65535 && (_ = !1, w = v, H("Not enough space in glyfs to duplicate first glyph."));
    let x = 0, k = 0;
    y >= 65536 && d.maxp.length >= 32 && (e.pos += 8, e.getUint16() > 2 && (d.maxp.data[14] = 0, d.maxp.data[15] = 2), e.pos += 4, x = e.getUint16(), e.pos += 4, k = e.getUint16()), d.maxp.data[4] = w >> 8, d.maxp.data[5] = 255 & w;
    const S = function(K, z, j, N) {
      const Q = { functionsDefined: [], functionsUsed: [], functionsStackDeltas: [], tooComplexToFollowFunctions: !1, hintsValid: !0 };
      if (K && u(K, Q), z && u(z, Q), K && function(et, $) {
        if (!et.tooComplexToFollowFunctions) if (et.functionsDefined.length > $)
          H("TT: more functions defined than expected"), et.hintsValid = !1;
        else for (let dt = 0, tt = et.functionsUsed.length; dt < tt; dt++) {
          if (dt > $) {
            H("TT: invalid function id: " + dt), et.hintsValid = !1;
            return;
          }
          if (et.functionsUsed[dt] && !et.functionsDefined[dt]) {
            H("TT: undefined function: " + dt), et.hintsValid = !1;
            return;
          }
        }
      }(Q, N), j && 1 & j.length) {
        const Y = new Uint8Array(j.length + 1);
        Y.set(j.data), j.data = Y;
      }
      return Q.hintsValid;
    }(d.fpgm, d.prep, d["cvt "], x);
    if (S || (delete d.fpgm, delete d.prep, delete d["cvt "]), function(K, z, j, N, Q, Y) {
      if (!z) {
        j && (j.data = null);
        return;
      }
      K.pos = (K.start || 0) + z.offset, K.pos += 4, K.pos += 2, K.pos += 2, K.pos += 2, K.pos += 2, K.pos += 2, K.pos += 2, K.pos += 2, K.pos += 2, K.pos += 2;
      const et = K.getUint16();
      K.pos += 8, K.pos += 2;
      let $ = K.getUint16();
      et !== 0 && (2 & E0(N.data[44], N.data[45]) || (z.data[22] = 0, z.data[23] = 0)), $ > Q && (ue(`The numOfMetrics (${$}) should not be greater than the numGlyphs (${Q}).`), $ = Q, z.data[34] = (65280 & $) >> 8, z.data[35] = 255 & $);
      const dt = Q - $ - (j.length - 4 * $ >> 1);
      if (dt > 0) {
        const tt = new Uint8Array(j.length + 2 * dt);
        tt.set(j.data), Y && (tt[j.length] = j.data[2], tt[j.length + 1] = j.data[3]), j.data = tt;
      }
    }(e, d.hhea, d.hmtx, d.head, w, _), !d.head) throw new ht('Required "head" table is not found');
    (function(K, z, j) {
      const N = K.data, Q = function($, dt, tt, ut) {
        return ($ << 24) + (dt << 16) + (tt << 8) + ut;
      }(N[0], N[1], N[2], N[3]);
      Q >> 16 != 1 && (ue("Attempting to fix invalid version in head table: " + Q), N[0] = 0, N[1] = 1, N[2] = 0, N[3] = 0);
      const Y = E0(N[50], N[51]);
      if (Y < 0 || Y > 1) {
        ue("Attempting to fix invalid indexToLocFormat in head table: " + Y);
        const et = z + 1;
        if (j === et << 1)
          N[50] = 0, N[51] = 0;
        else {
          if (j !== et << 2) throw new ht("Could not fix indexToLocFormat: " + Y);
          N[50] = 0, N[51] = 1;
        }
      }
    })(d.head, v, b ? d.loca.length : 0);
    let T = /* @__PURE__ */ Object.create(null);
    if (b) {
      const q = E0(d.head.data[50], d.head.data[51]), K = function(j, N, Q, Y, et, $, dt) {
        let tt, ut, St;
        Y ? (tt = 4, ut = function(Pt, ae) {
          return Pt[ae] << 24 | Pt[ae + 1] << 16 | Pt[ae + 2] << 8 | Pt[ae + 3];
        }, St = function(Pt, ae, le) {
          Pt[ae] = le >>> 24 & 255, Pt[ae + 1] = le >> 16 & 255, Pt[ae + 2] = le >> 8 & 255, Pt[ae + 3] = 255 & le;
        }) : (tt = 2, ut = function(Pt, ae) {
          return Pt[ae] << 9 | Pt[ae + 1] << 1;
        }, St = function(Pt, ae, le) {
          Pt[ae] = le >> 9 & 255, Pt[ae + 1] = le >> 1 & 255;
        });
        const G = $ ? Q + 1 : Q, V = tt * (1 + G), nt = new Uint8Array(V);
        nt.set(j.data.subarray(0, V)), j.data = nt;
        const gt = N.data, _t = gt.length, kt = new Uint8Array(_t);
        let xt, wt;
        const yt = [];
        for (xt = 0, wt = 0; xt < Q + 1; xt++, wt += tt) {
          let It = ut(nt, wt);
          It > _t && (It = _t), yt.push({ index: xt, offset: It, endOffset: 0 });
        }
        for (yt.sort((It, Pt) => It.offset - Pt.offset), xt = 0; xt < Q; xt++) yt[xt].endOffset = yt[xt + 1].offset;
        for (yt.sort((It, Pt) => It.index - Pt.index), xt = 0; xt < Q; xt++) {
          const { offset: It, endOffset: Pt } = yt[xt];
          if (It !== 0 || Pt !== 0) break;
          const ae = yt[xt + 1].offset;
          if (ae !== 0) {
            yt[xt].endOffset = ae;
            break;
          }
        }
        const Ot = yt.at(-2);
        Ot.offset !== 0 && Ot.endOffset === 0 && (Ot.endOffset = _t);
        const Kt = /* @__PURE__ */ Object.create(null);
        let Ft = 0;
        for (St(nt, 0, Ft), xt = 0, wt = tt; xt < Q; xt++, wt += tt) {
          const It = l(gt, yt[xt].offset, yt[xt].endOffset, kt, Ft, et), Pt = It.length;
          Pt === 0 && (Kt[xt] = !0), It.sizeOfInstructions > dt && (dt = It.sizeOfInstructions), Ft += Pt, St(nt, wt, Ft);
        }
        if (Ft === 0) {
          const It = new Uint8Array([0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 49, 0]);
          for (xt = 0, wt = tt; xt < G; xt++, wt += tt) St(nt, wt, It.length);
          N.data = It;
        } else if ($) {
          const It = ut(nt, tt);
          kt.length > It + Ft ? N.data = kt.subarray(0, It + Ft) : (N.data = new Uint8Array(It + Ft), N.data.set(kt.subarray(0, Ft))), N.data.set(kt.subarray(0, It), Ft), St(j.data, nt.length - tt, Ft + It);
        } else N.data = kt.subarray(0, Ft);
        return { missingGlyphs: Kt, maxSizeOfInstructions: dt };
      }(d.loca, d.glyf, v, q, S, _, k);
      T = K.missingGlyphs, y >= 65536 && d.maxp.length >= 32 && (d.maxp.data[26] = K.maxSizeOfInstructions >> 8, d.maxp.data[27] = 255 & K.maxSizeOfInstructions);
    }
    if (!d.hhea) throw new ht('Required "hhea" table is not found');
    d.hhea.data[10] === 0 && d.hhea.data[11] === 0 && (d.hhea.data[10] = 255, d.hhea.data[11] = 255);
    const I = { unitsPerEm: E0(d.head.data[18], d.head.data[19]), yMax: Ls(d.head.data[42], d.head.data[43]), yMin: Ls(d.head.data[38], d.head.data[39]), ascent: Ls(d.hhea.data[4], d.hhea.data[5]), descent: Ls(d.hhea.data[6], d.hhea.data[7]), lineGap: Ls(d.hhea.data[8], d.hhea.data[9]) };
    this.ascent = I.ascent / I.unitsPerEm, this.descent = I.descent / I.unitsPerEm, this.lineGap = I.lineGap / I.unitsPerEm, (W = this.cssFontInfo) != null && W.lineHeight ? (this.lineHeight = this.cssFontInfo.metrics.lineHeight, this.lineGap = this.cssFontInfo.metrics.lineGap) : this.lineHeight = this.ascent - this.descent + this.lineGap, d.post && function(K, z, j) {
      const N = (e.start || 0) + K.offset;
      e.pos = N;
      const Q = N + K.length, Y = e.getInt32();
      e.skip(28);
      let et, $, dt = !0;
      switch (Y) {
        case 65536:
          et = A_;
          break;
        case 131072:
          const tt = e.getUint16();
          if (tt !== j) {
            dt = !1;
            break;
          }
          const ut = [];
          for ($ = 0; $ < tt; ++$) {
            const V = e.getUint16();
            if (V >= 32768) {
              dt = !1;
              break;
            }
            ut.push(V);
          }
          if (!dt) break;
          const St = [], G = [];
          for (; e.pos < Q; ) {
            const V = e.getByte();
            for (G.length = V, $ = 0; $ < V; ++$) G[$] = String.fromCharCode(e.getByte());
            St.push(G.join(""));
          }
          for (et = [], $ = 0; $ < tt; ++$) {
            const V = ut[$];
            V < 258 ? et.push(A_[V]) : et.push(St[V - 258]);
          }
          break;
        case 196608:
          break;
        default:
          H("Unknown/unsupported post table version " + Y), dt = !1, z.defaultEncoding && (et = z.defaultEncoding);
      }
      return z.glyphNames = et, dt;
    }(d.post, n, v), d.post = { tag: "post", data: U_(n) };
    const R = /* @__PURE__ */ Object.create(null);
    function B(q) {
      return !T[q];
    }
    if (n.composite) {
      const q = n.cidToGidMap || [], K = q.length === 0;
      n.cMap.forEach(function(z, j) {
        if (typeof j == "string" && (j = D6(z, j, !0)), j > 65535) throw new ht("Max size of CID is 65,535");
        let N = -1;
        K ? N = j : q[j] !== void 0 && (N = q[j]), N >= 0 && N < v && B(N) && (R[z] = N);
      });
    } else {
      const q = function(et, $, dt, tt) {
        if (!et)
          return H("No cmap table available."), { platformId: -1, encodingId: -1, mappings: [], hasShortCmap: !1 };
        let ut, St = ($.start || 0) + et.offset;
        $.pos = St, $.skip(2);
        const G = $.getUint16();
        let V, nt = !1;
        for (let Kt = 0; Kt < G; Kt++) {
          const Ft = $.getUint16(), It = $.getUint16(), Pt = $.getInt32() >>> 0;
          let ae = !1;
          if ((V == null ? void 0 : V.platformId) !== Ft || (V == null ? void 0 : V.encodingId) !== It) {
            if (Ft !== 0 || It !== 0 && It !== 1 && It !== 3) if (Ft === 1 && It === 0) ae = !0;
            else if (Ft !== 3 || It !== 1 || !tt && V) {
              if (dt && Ft === 3 && It === 0) {
                ae = !0;
                let le = !0;
                if (Kt < G - 1) {
                  const ji = $.peekBytes(2);
                  E0(ji[0], ji[1]) < Ft && (le = !1);
                }
                le && (nt = !0);
              }
            } else
              ae = !0, dt || (nt = !0);
            else ae = !0;
            if (ae && (V = { platformId: Ft, encodingId: It, offset: Pt }), nt) break;
          }
        }
        if (V && ($.pos = St + V.offset), !V || $.peekByte() === -1)
          return H("Could not find a preferred cmap table."), { platformId: -1, encodingId: -1, mappings: [], hasShortCmap: !1 };
        const gt = $.getUint16();
        let _t = !1;
        const kt = [];
        let xt, wt;
        if (gt === 0) {
          for ($.skip(4), xt = 0; xt < 256; xt++) {
            const Kt = $.getByte();
            Kt && kt.push({ charCode: xt, glyphId: Kt });
          }
          _t = !0;
        } else if (gt === 2) {
          $.skip(4);
          const Kt = [];
          let Ft = 0;
          for (let Pt = 0; Pt < 256; Pt++) {
            const ae = $.getUint16() >> 3;
            Kt.push(ae), Ft = Math.max(ae, Ft);
          }
          const It = [];
          for (let Pt = 0; Pt <= Ft; Pt++) It.push({ firstCode: $.getUint16(), entryCount: $.getUint16(), idDelta: Ls($.getByte(), $.getByte()), idRangePos: $.pos + $.getUint16() });
          for (let Pt = 0; Pt < 256; Pt++) if (Kt[Pt] === 0)
            $.pos = It[0].idRangePos + 2 * Pt, wt = $.getUint16(), kt.push({ charCode: Pt, glyphId: wt });
          else {
            const ae = It[Kt[Pt]];
            for (xt = 0; xt < ae.entryCount; xt++) {
              const le = (Pt << 8) + xt + ae.firstCode;
              $.pos = ae.idRangePos + 2 * xt, wt = $.getUint16(), wt !== 0 && (wt = (wt + ae.idDelta) % 65536), kt.push({ charCode: le, glyphId: wt });
            }
          }
        } else if (gt === 4) {
          $.skip(4);
          const Kt = $.getUint16() >> 1;
          $.skip(6);
          const Ft = [];
          let It;
          for (It = 0; It < Kt; It++) Ft.push({ end: $.getUint16() });
          for ($.skip(2), It = 0; It < Kt; It++) Ft[It].start = $.getUint16();
          for (It = 0; It < Kt; It++) Ft[It].delta = $.getUint16();
          let Pt, ae = 0;
          for (It = 0; It < Kt; It++) {
            ut = Ft[It];
            const ji = $.getUint16();
            ji ? (Pt = (ji >> 1) - (Kt - It), ut.offsetIndex = Pt, ae = Math.max(ae, Pt + ut.end - ut.start + 1)) : ut.offsetIndex = -1;
          }
          const le = [];
          for (xt = 0; xt < ae; xt++) le.push($.getUint16());
          for (It = 0; It < Kt; It++) {
            ut = Ft[It], St = ut.start;
            const ji = ut.end, Ei = ut.delta;
            for (Pt = ut.offsetIndex, xt = St; xt <= ji; xt++) xt !== 65535 && (wt = Pt < 0 ? xt : le[Pt + xt - St], wt = wt + Ei & 65535, kt.push({ charCode: xt, glyphId: wt }));
          }
        } else if (gt === 6) {
          $.skip(4);
          const Kt = $.getUint16(), Ft = $.getUint16();
          for (xt = 0; xt < Ft; xt++) {
            wt = $.getUint16();
            const It = Kt + xt;
            kt.push({ charCode: It, glyphId: wt });
          }
        } else {
          if (gt !== 12)
            return H("cmap table has unsupported format: " + gt), { platformId: -1, encodingId: -1, mappings: [], hasShortCmap: !1 };
          {
            $.skip(10);
            const Kt = $.getInt32() >>> 0;
            for (xt = 0; xt < Kt; xt++) {
              const Ft = $.getInt32() >>> 0, It = $.getInt32() >>> 0;
              let Pt = $.getInt32() >>> 0;
              for (let ae = Ft; ae <= It; ae++) kt.push({ charCode: ae, glyphId: Pt++ });
            }
          }
        }
        kt.sort((Kt, Ft) => Kt.charCode - Ft.charCode);
        const yt = [], Ot = /* @__PURE__ */ new Set();
        for (const Kt of kt) {
          const { charCode: Ft } = Kt;
          Ot.has(Ft) || (Ot.add(Ft), yt.push(Kt));
        }
        return { platformId: V.platformId, encodingId: V.encodingId, mappings: yt, hasShortCmap: _t };
      }(d.cmap, e, this.isSymbolicFont, n.hasEncoding), K = q.platformId, z = q.encodingId, j = q.mappings;
      let N = [], Q = !1;
      if (!n.hasEncoding || n.baseEncodingName !== "MacRomanEncoding" && n.baseEncodingName !== "WinAnsiEncoding" || (N = op(n.baseEncodingName)), n.hasEncoding && !this.isSymbolicFont && (K === 3 && z === 1 || K === 1 && z === 0)) {
        const Y = Ga();
        for (let et = 0; et < 256; et++) {
          let $;
          if ($ = this.differences[et] !== void 0 ? this.differences[et] : N.length && N[et] !== "" ? N[et] : Pl[et], !$) continue;
          const dt = uD($, Y);
          let tt;
          if (K === 3 && z === 1 ? tt = Y[dt] : K === 1 && z === 0 && (tt = Wy.indexOf(dt)), tt === void 0) {
            if (!n.glyphNames && n.hasIncludedToUnicodeMap && !(this.toUnicode instanceof Dr)) {
              const ut = this.toUnicode.get(et);
              ut && (tt = ut.codePointAt(0));
            }
            if (tt === void 0) continue;
          }
          for (const ut of j) if (ut.charCode === tt) {
            R[et] = ut.glyphId;
            break;
          }
        }
      } else if (K === 0) {
        for (const Y of j) R[Y.charCode] = Y.glyphId;
        Q = !0;
      } else if (K === 3 && z === 0) for (const Y of j) {
        let et = Y.charCode;
        et >= 61440 && et <= 61695 && (et &= 255), R[et] = Y.glyphId;
      }
      else for (const Y of j) R[Y.charCode] = Y.glyphId;
      if (n.glyphNames && (N.length || this.differences.length)) for (let Y = 0; Y < 256; ++Y) {
        if (!Q && R[Y] !== void 0) continue;
        const et = this.differences[Y] || N[Y];
        if (!et) continue;
        const $ = n.glyphNames.indexOf(et);
        $ > 0 && B($) && (R[Y] = $);
      }
    }
    R.length === 0 && (R[0] = 0);
    let L = w - 1;
    if (_ || (L = 0), !n.cssFontInfo) {
      const q = $_(R, B, L, this.toUnicode);
      this.toFontChar = q.toFontChar, d.cmap = { tag: "cmap", data: q_(q.charCodeToGlyphId, q.toUnicodeExtraMap, w) }, d["OS/2"] && function(z, j) {
        j.pos = (j.start || 0) + z.offset;
        const N = j.getUint16();
        j.skip(60);
        const Q = j.getUint16();
        return N < 4 && 768 & Q || j.getUint16() > j.getUint16() || (j.skip(6), j.getUint16() === 0) ? !1 : (z.data[8] = z.data[9] = 0, !0);
      }(d["OS/2"], e) || (d["OS/2"] = { tag: "OS/2", data: z_(n, q.charCodeToGlyphId, I) });
    }
    if (!b) try {
      g = new gi(d["CFF "].data), p = new Ky(g, n, lp).parse(), p.duplicateFirstGlyph();
      const q = new Cg(p);
      d["CFF "].data = q.compile();
    } catch {
      H("Failed to compile font " + n.loadedName);
    }
    if (d.name) {
      const [q, K] = c(d.name);
      d.name.data = T6(t, q), this.psName = q[0][6] || null, n.composite || function(j, N, Q) {
        if (j.isInternalFont || j.hasIncludedToUnicodeMap || j.hasEncoding || j.toUnicode instanceof Dr || !N || Q.length === 0 || j.defaultEncoding === ap) return;
        for (const dt of Q) if (!O_(dt)) return;
        const Y = ap, et = [], $ = Ga();
        for (const dt in Y) {
          const tt = Y[dt];
          if (tt === "") continue;
          const ut = $[tt];
          ut !== void 0 && (et[dt] = String.fromCharCode(ut));
        }
        et.length > 0 && j.toUnicode.amend(et);
      }(n, this.isSymbolicFont, K);
    } else d.name = { tag: "name", data: T6(this.name) };
    const it = new dp(f.version);
    for (const q in d) it.addTable(q, d[q].data);
    return it.toArray();
  }
  convert(t, e, n) {
    n.fixedPitch = !1, n.builtInEncoding && function(b, y) {
      if (b.isInternalFont || b.hasIncludedToUnicodeMap || y === b.defaultEncoding || b.toUnicode instanceof Dr) return;
      const v = [], w = Ga();
      for (const _ in y) {
        if (b.hasEncoding && (b.baseEncodingName || b.differences[_] !== void 0)) continue;
        const x = ef(y[_], w);
        x !== -1 && (v[_] = String.fromCharCode(x));
      }
      v.length > 0 && b.toUnicode.amend(v);
    }(n, n.builtInEncoding);
    let s = 1;
    e instanceof A6 && (s = e.numGlyphs - 1);
    const r = e.getGlyphMapping(n);
    let a = null, o = r, l = null;
    n.cssFontInfo || (a = $_(r, e.hasGlyphId.bind(e), s, this.toUnicode), this.toFontChar = a.toFontChar, o = a.charCodeToGlyphId, l = a.toUnicodeExtraMap);
    const c = e.numGlyphs;
    function h(g, b) {
      let y = null;
      for (const v in g) b === g[v] && (y || (y = [])).push(0 | v);
      return y;
    }
    function u(g, b) {
      for (const y in g) if (b === g[y]) return 0 | y;
      return a.charCodeToGlyphId[a.nextAvailableFontCharCode] = b, a.nextAvailableFontCharCode++;
    }
    const f = e.seacs;
    if (a && (f != null && f.length)) {
      const g = n.fontMatrix || f1, b = e.getCharset(), y = /* @__PURE__ */ Object.create(null);
      for (let v in f) {
        v |= 0;
        const w = f[v], _ = Pl[w[2]], x = Pl[w[3]], k = b.indexOf(_), S = b.indexOf(x);
        if (k < 0 || S < 0) continue;
        const T = { x: w[0] * g[0] + w[1] * g[2] + g[4], y: w[0] * g[1] + w[1] * g[3] + g[5] }, I = h(r, v);
        if (I) for (const R of I) {
          const B = a.charCodeToGlyphId, L = u(B, k), it = u(B, S);
          y[R] = { baseFontCharCode: L, accentFontCharCode: it, accentOffset: T };
        }
      }
      n.seacMap = y;
    }
    const d = n.fontMatrix ? 1 / Math.max(...n.fontMatrix.slice(0, 4).map(Math.abs)) : 1e3, p = new dp("OTTO");
    return p.addTable("CFF ", e.data), p.addTable("OS/2", z_(n, o)), p.addTable("cmap", q_(o, l, c)), p.addTable("head", "\0\0\0\0\0\0\0\0\0\0_<õ\0\0" + D0(d) + "\0\0\0\0\v~'\0\0\0\0\v~'\0\0" + D0(n.descent) + "ÿ" + D0(n.ascent) + Me(n.italicAngle ? 2 : 0) + "\0\0\0\0\0\0\0"), p.addTable("hhea", "\0\0\0" + D0(n.ascent) + D0(n.descent) + "\0\0ÿÿ\0\0\0\0\0\0" + D0(n.capHeight) + D0(Math.tan(n.italicAngle) * n.xHeight) + "\0\0\0\0\0\0\0\0\0\0\0\0" + Me(c)), p.addTable("hmtx", function() {
      const b = e.charstrings, y = e.cff ? e.cff.widths : null;
      let v = "\0\0\0\0";
      for (let w = 1, _ = c; w < _; w++) {
        let x = 0;
        if (b) {
          const k = b[w - 1];
          x = "width" in k ? k.width : 0;
        } else y && (x = Math.ceil(y[w] || 0));
        v += Me(x) + Me(0);
      }
      return v;
    }()), p.addTable("maxp", "\0\0P\0" + Me(c)), p.addTable("name", T6(t)), p.addTable("post", U_(n)), p.toArray();
  }
  get _spaceWidth() {
    const t = ["space", "minus", "one", "i", "I"];
    let e;
    for (const n of t) {
      if (n in this.widths) {
        e = this.widths[n];
        break;
      }
      const s = Ga()[n];
      let r = 0;
      if (this.composite && this.cMap.contains(s) && (r = this.cMap.lookup(s), typeof r == "string" && (r = D6(s, r))), !r && this.toUnicode && (r = this.toUnicode.charCodeOf(s)), r <= 0 && (r = s), e = this.widths[r], e) break;
    }
    return At(this, "_spaceWidth", e || this.defaultWidth);
  }
  _charToGlyph(t, e = !1) {
    var d, p, g;
    let n, s, r, a = this._glyphCache[t];
    if ((a == null ? void 0 : a.isSpace) === e) return a;
    let o = t;
    (d = this.cMap) != null && d.contains(t) && (o = this.cMap.lookup(t), typeof o == "string" && (o = D6(t, o))), s = this.widths[o], typeof s != "number" && (s = this.defaultWidth);
    const l = (p = this.vmetrics) == null ? void 0 : p[o];
    let c = this.toUnicode.get(t) || t;
    typeof c == "number" && (c = String.fromCharCode(c));
    let h = this.toFontChar[t] !== void 0;
    if (n = this.toFontChar[t] || t, this.missingFile) {
      const b = this.differences[t] || this.defaultEncoding[t];
      (b === ".notdef" || b === "") && this.type === "Type1" && (n = 32, b === "" && (s || (s = this._spaceWidth), c = String.fromCharCode(n))), n = function(v) {
        return v >= 65520 && v <= 65535 ? 0 : v >= 62976 && v <= 63743 ? XP()[v] || v : v === 173 ? 45 : v;
      }(n);
    }
    this.isType3Font && (r = n);
    let u = null;
    if ((g = this.seacMap) != null && g[t]) {
      h = !0;
      const b = this.seacMap[t];
      n = b.baseFontCharCode, u = { fontChar: String.fromCodePoint(b.accentFontCharCode), offset: b.accentOffset };
    }
    let f = "";
    if (typeof n == "number" && (n <= 1114111 ? f = String.fromCodePoint(n) : H(`charToGlyph - invalid fontCharCode: ${n}`)), this.missingFile && this.vertical && f.length === 1) {
      const b = ZP()[f.charCodeAt(0)];
      b && (f = c = String.fromCharCode(b));
    }
    return a = new IN(t, f, c, u, s, l, r, e, h), this._glyphCache[t] = a;
  }
  charsToGlyphs(t) {
    let e = this._charsCache[t];
    if (e) return e;
    if (e = [], this.cMap) {
      const n = /* @__PURE__ */ Object.create(null), s = t.length;
      let r = 0;
      for (; r < s; ) {
        this.cMap.readCharCode(t, r, n);
        const { charcode: a, length: o } = n;
        r += o;
        const l = this._charToGlyph(a, o === 1 && t.charCodeAt(r - 1) === 32);
        e.push(l);
      }
    } else for (let n = 0, s = t.length; n < s; ++n) {
      const r = t.charCodeAt(n), a = this._charToGlyph(r, r === 32);
      e.push(a);
    }
    return this._charsCache[t] = e;
  }
  getCharPositions(t) {
    const e = [];
    if (this.cMap) {
      const n = /* @__PURE__ */ Object.create(null);
      let s = 0;
      for (; s < t.length; ) {
        this.cMap.readCharCode(t, s, n);
        const r = n.length;
        e.push([s, s + r]), s += r;
      }
    } else for (let n = 0, s = t.length; n < s; ++n) e.push([n, n + 1]);
    return e;
  }
  get glyphCacheValues() {
    return Object.values(this._glyphCache);
  }
  encodeString(t) {
    const e = [], n = [], s = () => e.length % 2 == 1, r = this.toUnicode instanceof Dr ? (a) => this.toUnicode.charCodeOf(a) : (a) => this.toUnicode.charCodeOf(String.fromCodePoint(a));
    for (let a = 0, o = t.length; a < o; a++) {
      const l = t.codePointAt(a);
      if (l > 55295 && (l < 57344 || l > 65533) && a++, this.toUnicode) {
        const c = r(l);
        if (c !== -1) {
          s() && (e.push(n.join("")), n.length = 0);
          for (let h = (this.cMap ? this.cMap.getCharCodeLength(c) : 1) - 1; h >= 0; h--) n.push(String.fromCharCode(c >> 8 * h & 255));
          continue;
        }
      }
      s() || (e.push(n.join("")), n.length = 0), n.push(String.fromCodePoint(l));
    }
    return e.push(n.join("")), e;
  }
}
class j_ {
  constructor(t) {
    this.error = t, this.loadedName = "g_font_error", this.missingFile = !0;
  }
  charsToGlyphs() {
    return [];
  }
  encodeString(t) {
    return [t];
  }
  exportData() {
    return { error: this.error };
  }
}
const kb = 2, k9 = 3, vD = 4, _D = 5, xD = 6, kD = 7;
class PN {
  constructor() {
    ye("Cannot initialize Pattern.");
  }
  static parseShading(t, e, n, s, r, a) {
    const o = t instanceof oe ? t.dict : t, l = o.get("ShadingType");
    try {
      switch (l) {
        case kb:
        case k9:
          return new NN(o, e, n, s, r, a);
        case vD:
        case _D:
        case xD:
        case kD:
          return new Ab(t, e, n, s, r, a);
        default:
          throw new ht("Unsupported ShadingType: " + l);
      }
    } catch (c) {
      if (c instanceof ti) throw c;
      return H(c), new ON();
    }
  }
}
class Tu {
  getIR() {
    ye("Abstract method `getIR` called.");
  }
}
ft(Tu, "SMALL_NUMBER", 1e-6);
class NN extends Tu {
  constructor(t, e, n, s, r, a) {
    super(), this.shadingType = t.get("ShadingType");
    let o = 0;
    if (this.shadingType === kb ? o = 4 : this.shadingType === k9 && (o = 6), this.coordsArr = t.getArray("Coords"), !cs(this.coordsArr, o)) throw new ht("RadialAxialShading: Invalid /Coords array.");
    const l = Se.parse({ cs: t.getRaw("CS") || t.getRaw("ColorSpace"), xref: e, resources: n, pdfFunctionFactory: s, globalColorSpaceCache: r, localColorSpaceCache: a });
    this.bbox = Wl(t.getArray("BBox"), null);
    let c = 0, h = 1;
    const u = t.getArray("Domain");
    cs(u, 2) && ([c, h] = u);
    let f = !1, d = !1;
    const p = t.getArray("Extend");
    if (function(Q, Y) {
      return Array.isArray(Q) && Q.length === Y && Q.every((et) => typeof et == "boolean");
    }(p, 2) && ([f, d] = p), !(this.shadingType !== k9 || f && d)) {
      const [N, Q, Y, et, $, dt] = this.coordsArr, tt = Math.hypot(N - et, Q - $);
      Y <= dt + tt && dt <= Y + tt && H("Unsupported radial gradient.");
    }
    this.extendStart = f, this.extendEnd = d;
    const g = t.getRaw("Function"), b = s.create(g, !0), y = (h - c) / 840, v = this.colorStops = [];
    if (c >= h || y <= 0) {
      ue("Bad shading domain.");
      return;
    }
    const w = new Float32Array(l.numComps), _ = new Float32Array(1);
    let x = 0;
    _[0] = c, b(_, 0, w, 0);
    const k = new Uint8ClampedArray(3);
    l.getRgb(w, 0, k);
    let [S, T, I] = k;
    v.push([0, Ee.makeHexColor(S, T, I)]);
    let R = 1;
    _[0] = c + y, b(_, 0, w, 0), l.getRgb(w, 0, k);
    let [B, L, it] = k, O = B - S + 1, at = L - T + 1, W = it - I + 1, q = B - S - 1, K = L - T - 1, z = it - I - 1;
    for (let N = 2; N < 840; N++) {
      _[0] = c + N * y, b(_, 0, w, 0), l.getRgb(w, 0, k);
      const [Q, Y, et] = k, $ = N - x;
      if (O = Math.min(O, (Q - S + 1) / $), at = Math.min(at, (Y - T + 1) / $), W = Math.min(W, (et - I + 1) / $), q = Math.max(q, (Q - S - 1) / $), K = Math.max(K, (Y - T - 1) / $), z = Math.max(z, (et - I - 1) / $), !(q <= O && K <= at && z <= W)) {
        const dt = Ee.makeHexColor(B, L, it);
        v.push([R / 840, dt]), O = Q - B + 1, at = Y - L + 1, W = et - it + 1, q = Q - B - 1, K = Y - L - 1, z = et - it - 1, x = R, S = B, T = L, I = it;
      }
      R = N, B = Q, L = Y, it = et;
    }
    v.push([1, Ee.makeHexColor(B, L, it)]);
    let j = "transparent";
    t.has("Background") && (j = l.getRgbHex(t.get("Background"), 0)), f || (v.unshift([0, j]), v[1][0] += Tu.SMALL_NUMBER), d || (v.at(-1)[0] -= Tu.SMALL_NUMBER, v.push([1, j])), this.colorStops = v;
  }
  getIR() {
    const { coordsArr: t, shadingType: e } = this;
    let n, s, r, a, o;
    return e === kb ? (s = [t[0], t[1]], r = [t[2], t[3]], a = null, o = null, n = "axial") : e === k9 ? (s = [t[0], t[1]], r = [t[3], t[4]], a = t[2], o = t[5], n = "radial") : ye(`getPattern type unknown: ${e}`), ["RadialAxial", n, this.bbox, this.colorStops, s, r, a, o];
  }
}
class LN {
  constructor(t, e) {
    this.stream = t, this.context = e, this.buffer = 0, this.bufferLength = 0;
    const n = e.numComps;
    this.tmpCompsBuf = new Float32Array(n);
    const s = e.colorSpace.numComps;
    this.tmpCsCompsBuf = e.colorFn ? new Float32Array(s) : this.tmpCompsBuf;
  }
  get hasData() {
    if (this.stream.end) return this.stream.pos < this.stream.end;
    if (this.bufferLength > 0) return !0;
    const t = this.stream.getByte();
    return t < 0 ? !1 : (this.buffer = t, this.bufferLength = 8, !0);
  }
  readBits(t) {
    const { stream: e } = this;
    let { buffer: n, bufferLength: s } = this;
    if (t === 32) {
      if (s === 0) return e.getInt32() >>> 0;
      n = n << 24 | e.getByte() << 16 | e.getByte() << 8 | e.getByte();
      const r = e.getByte();
      return this.buffer = r & (1 << s) - 1, (n << 8 - s | (255 & r) >> s) >>> 0;
    }
    if (t === 8 && s === 0) return e.getByte();
    for (; s < t; )
      n = n << 8 | e.getByte(), s += 8;
    return s -= t, this.bufferLength = s, this.buffer = n & (1 << s) - 1, n >> s;
  }
  align() {
    this.buffer = 0, this.bufferLength = 0;
  }
  readFlag() {
    return this.readBits(this.context.bitsPerFlag);
  }
  readCoordinate() {
    const { bitsPerCoordinate: t, decode: e } = this.context, n = this.readBits(t), s = this.readBits(t), r = t < 32 ? 1 / ((1 << t) - 1) : 23283064365386963e-26;
    return [n * r * (e[1] - e[0]) + e[0], s * r * (e[3] - e[2]) + e[2]];
  }
  readComponents() {
    const { bitsPerComponent: t, colorFn: e, colorSpace: n, decode: s, numComps: r } = this.context, a = t < 32 ? 1 / ((1 << t) - 1) : 23283064365386963e-26, o = this.tmpCompsBuf;
    for (let c = 0, h = 4; c < r; c++, h += 2) {
      const u = this.readBits(t);
      o[c] = u * a * (s[h + 1] - s[h]) + s[h];
    }
    const l = this.tmpCsCompsBuf;
    return e == null || e(o, 0, l, 0), n.getRgb(l, 0);
  }
}
let A9 = /* @__PURE__ */ Object.create(null);
function G_(i) {
  return A9[i] || (A9[i] = function(e) {
    const n = [];
    for (let s = 0; s <= e; s++) {
      const r = s / e, a = 1 - r;
      n.push(new Float32Array([a ** 3, 3 * r * a ** 2, 3 * r ** 2 * a, r ** 3]));
    }
    return n;
  }(i));
}
const ra = class ra extends Tu {
  constructor(t, e, n, s, r, a) {
    if (super(), !(t instanceof oe)) throw new ht("Mesh data is not a stream");
    const o = t.dict;
    this.shadingType = o.get("ShadingType"), this.bbox = Wl(o.getArray("BBox"), null);
    const l = Se.parse({ cs: o.getRaw("CS") || o.getRaw("ColorSpace"), xref: e, resources: n, pdfFunctionFactory: s, globalColorSpaceCache: r, localColorSpaceCache: a });
    this.background = o.has("Background") ? l.getRgb(o.get("Background"), 0) : null;
    const c = o.getRaw("Function"), h = c ? s.create(c, !0) : null;
    this.coords = [], this.colors = [], this.figures = [];
    const u = { bitsPerCoordinate: o.get("BitsPerCoordinate"), bitsPerComponent: o.get("BitsPerComponent"), bitsPerFlag: o.get("BitsPerFlag"), decode: o.getArray("Decode"), colorFn: h, colorSpace: l, numComps: h ? 1 : l.numComps }, f = new LN(t, u);
    let d = !1;
    switch (this.shadingType) {
      case vD:
        this._decodeType4Shading(f);
        break;
      case _D:
        const p = 0 | o.get("VerticesPerRow");
        if (p < 2) throw new ht("Invalid VerticesPerRow");
        this._decodeType5Shading(f, p);
        break;
      case xD:
        this._decodeType6Shading(f), d = !0;
        break;
      case kD:
        this._decodeType7Shading(f), d = !0;
        break;
      default:
        ye("Unsupported mesh type.");
    }
    if (d) {
      this._updateBounds();
      for (let p = 0, g = this.figures.length; p < g; p++) this._buildFigureFromPatch(p);
    }
    this._updateBounds(), this._packData();
  }
  _decodeType4Shading(t) {
    const e = this.coords, n = this.colors, s = [];
    let r = 0;
    for (; t.hasData; ) {
      const a = t.readFlag(), o = t.readCoordinate(), l = t.readComponents();
      if (r === 0) {
        if (!(0 <= a && a <= 2)) throw new ht("Unknown type4 flag");
        switch (a) {
          case 0:
            r = 3;
            break;
          case 1:
            s.push(s.at(-2), s.at(-1)), r = 1;
            break;
          case 2:
            s.push(s.at(-3), s.at(-1)), r = 1;
        }
      }
      s.push(e.length), e.push(o), n.push(l), r--, t.align();
    }
    this.figures.push({ type: "triangles", coords: new Int32Array(s), colors: new Int32Array(s) });
  }
  _decodeType5Shading(t, e) {
    const n = this.coords, s = this.colors, r = [];
    for (; t.hasData; ) {
      const a = t.readCoordinate(), o = t.readComponents();
      r.push(n.length), n.push(a), s.push(o);
    }
    this.figures.push({ type: "lattice", coords: new Int32Array(r), colors: new Int32Array(r), verticesPerRow: e });
  }
  _decodeType6Shading(t) {
    const e = this.coords, n = this.colors, s = new Int32Array(16), r = new Int32Array(4);
    for (; t.hasData; ) {
      const a = t.readFlag();
      if (!(0 <= a && a <= 3)) throw new ht("Unknown type6 flag");
      const o = e.length;
      for (let d = 0, p = a !== 0 ? 8 : 12; d < p; d++) e.push(t.readCoordinate());
      const l = n.length;
      for (let d = 0, p = a !== 0 ? 2 : 4; d < p; d++) n.push(t.readComponents());
      let c, h, u, f;
      switch (a) {
        case 0:
          s[12] = o + 3, s[13] = o + 4, s[14] = o + 5, s[15] = o + 6, s[8] = o + 2, s[11] = o + 7, s[4] = o + 1, s[7] = o + 8, s[0] = o, s[1] = o + 11, s[2] = o + 10, s[3] = o + 9, r[2] = l + 1, r[3] = l + 2, r[0] = l, r[1] = l + 3;
          break;
        case 1:
          c = s[12], h = s[13], u = s[14], f = s[15], s[12] = f, s[13] = o + 0, s[14] = o + 1, s[15] = o + 2, s[8] = u, s[11] = o + 3, s[4] = h, s[7] = o + 4, s[0] = c, s[1] = o + 7, s[2] = o + 6, s[3] = o + 5, c = r[2], h = r[3], r[2] = h, r[3] = l, r[0] = c, r[1] = l + 1;
          break;
        case 2:
          c = s[15], h = s[11], s[12] = s[3], s[13] = o + 0, s[14] = o + 1, s[15] = o + 2, s[8] = s[7], s[11] = o + 3, s[4] = h, s[7] = o + 4, s[0] = c, s[1] = o + 7, s[2] = o + 6, s[3] = o + 5, c = r[3], r[2] = r[1], r[3] = l, r[0] = c, r[1] = l + 1;
          break;
        case 3:
          s[12] = s[0], s[13] = o + 0, s[14] = o + 1, s[15] = o + 2, s[8] = s[1], s[11] = o + 3, s[4] = s[2], s[7] = o + 4, s[0] = s[3], s[1] = o + 7, s[2] = o + 6, s[3] = o + 5, r[2] = r[0], r[3] = l, r[0] = r[1], r[1] = l + 1;
      }
      s[5] = e.length, e.push([(-4 * e[s[0]][0] - e[s[15]][0] + 6 * (e[s[4]][0] + e[s[1]][0]) - 2 * (e[s[12]][0] + e[s[3]][0]) + 3 * (e[s[13]][0] + e[s[7]][0])) / 9, (-4 * e[s[0]][1] - e[s[15]][1] + 6 * (e[s[4]][1] + e[s[1]][1]) - 2 * (e[s[12]][1] + e[s[3]][1]) + 3 * (e[s[13]][1] + e[s[7]][1])) / 9]), s[6] = e.length, e.push([(-4 * e[s[3]][0] - e[s[12]][0] + 6 * (e[s[2]][0] + e[s[7]][0]) - 2 * (e[s[0]][0] + e[s[15]][0]) + 3 * (e[s[4]][0] + e[s[14]][0])) / 9, (-4 * e[s[3]][1] - e[s[12]][1] + 6 * (e[s[2]][1] + e[s[7]][1]) - 2 * (e[s[0]][1] + e[s[15]][1]) + 3 * (e[s[4]][1] + e[s[14]][1])) / 9]), s[9] = e.length, e.push([(-4 * e[s[12]][0] - e[s[3]][0] + 6 * (e[s[8]][0] + e[s[13]][0]) - 2 * (e[s[0]][0] + e[s[15]][0]) + 3 * (e[s[11]][0] + e[s[1]][0])) / 9, (-4 * e[s[12]][1] - e[s[3]][1] + 6 * (e[s[8]][1] + e[s[13]][1]) - 2 * (e[s[0]][1] + e[s[15]][1]) + 3 * (e[s[11]][1] + e[s[1]][1])) / 9]), s[10] = e.length, e.push([(-4 * e[s[15]][0] - e[s[0]][0] + 6 * (e[s[11]][0] + e[s[14]][0]) - 2 * (e[s[12]][0] + e[s[3]][0]) + 3 * (e[s[2]][0] + e[s[8]][0])) / 9, (-4 * e[s[15]][1] - e[s[0]][1] + 6 * (e[s[11]][1] + e[s[14]][1]) - 2 * (e[s[12]][1] + e[s[3]][1]) + 3 * (e[s[2]][1] + e[s[8]][1])) / 9]), this.figures.push({ type: "patch", coords: new Int32Array(s), colors: new Int32Array(r) });
    }
  }
  _decodeType7Shading(t) {
    const e = this.coords, n = this.colors, s = new Int32Array(16), r = new Int32Array(4);
    for (; t.hasData; ) {
      const a = t.readFlag();
      if (!(0 <= a && a <= 3)) throw new ht("Unknown type7 flag");
      const o = e.length;
      for (let d = 0, p = a !== 0 ? 12 : 16; d < p; d++) e.push(t.readCoordinate());
      const l = n.length;
      for (let d = 0, p = a !== 0 ? 2 : 4; d < p; d++) n.push(t.readComponents());
      let c, h, u, f;
      switch (a) {
        case 0:
          s[12] = o + 3, s[13] = o + 4, s[14] = o + 5, s[15] = o + 6, s[8] = o + 2, s[9] = o + 13, s[10] = o + 14, s[11] = o + 7, s[4] = o + 1, s[5] = o + 12, s[6] = o + 15, s[7] = o + 8, s[0] = o, s[1] = o + 11, s[2] = o + 10, s[3] = o + 9, r[2] = l + 1, r[3] = l + 2, r[0] = l, r[1] = l + 3;
          break;
        case 1:
          c = s[12], h = s[13], u = s[14], f = s[15], s[12] = f, s[13] = o + 0, s[14] = o + 1, s[15] = o + 2, s[8] = u, s[9] = o + 9, s[10] = o + 10, s[11] = o + 3, s[4] = h, s[5] = o + 8, s[6] = o + 11, s[7] = o + 4, s[0] = c, s[1] = o + 7, s[2] = o + 6, s[3] = o + 5, c = r[2], h = r[3], r[2] = h, r[3] = l, r[0] = c, r[1] = l + 1;
          break;
        case 2:
          c = s[15], h = s[11], s[12] = s[3], s[13] = o + 0, s[14] = o + 1, s[15] = o + 2, s[8] = s[7], s[9] = o + 9, s[10] = o + 10, s[11] = o + 3, s[4] = h, s[5] = o + 8, s[6] = o + 11, s[7] = o + 4, s[0] = c, s[1] = o + 7, s[2] = o + 6, s[3] = o + 5, c = r[3], r[2] = r[1], r[3] = l, r[0] = c, r[1] = l + 1;
          break;
        case 3:
          s[12] = s[0], s[13] = o + 0, s[14] = o + 1, s[15] = o + 2, s[8] = s[1], s[9] = o + 9, s[10] = o + 10, s[11] = o + 3, s[4] = s[2], s[5] = o + 8, s[6] = o + 11, s[7] = o + 4, s[0] = s[3], s[1] = o + 7, s[2] = o + 6, s[3] = o + 5, r[2] = r[0], r[3] = l, r[0] = r[1], r[1] = l + 1;
      }
      this.figures.push({ type: "patch", coords: new Int32Array(s), colors: new Int32Array(r) });
    }
  }
  _buildFigureFromPatch(t) {
    const e = this.figures[t];
    pn(e.type === "patch", "Unexpected patch mesh figure");
    const n = this.coords, s = this.colors, r = e.coords, a = e.colors, o = Math.min(n[r[0]][0], n[r[3]][0], n[r[12]][0], n[r[15]][0]), l = Math.min(n[r[0]][1], n[r[3]][1], n[r[12]][1], n[r[15]][1]), c = Math.max(n[r[0]][0], n[r[3]][0], n[r[12]][0], n[r[15]][0]), h = Math.max(n[r[0]][1], n[r[3]][1], n[r[12]][1], n[r[15]][1]);
    let u = Math.ceil((c - o) * ra.TRIANGLE_DENSITY / (this.bounds[2] - this.bounds[0]));
    u = Tn(u, ra.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, ra.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);
    let f = Math.ceil((h - l) * ra.TRIANGLE_DENSITY / (this.bounds[3] - this.bounds[1]));
    f = Tn(f, ra.MIN_SPLIT_PATCH_CHUNKS_AMOUNT, ra.MAX_SPLIT_PATCH_CHUNKS_AMOUNT);
    const d = u + 1, p = new Int32Array((f + 1) * d), g = new Int32Array((f + 1) * d);
    let b = 0;
    const y = new Uint8Array(3), v = new Uint8Array(3), w = s[a[0]], _ = s[a[1]], x = s[a[2]], k = s[a[3]], S = G_(f), T = G_(u);
    for (let I = 0; I <= f; I++) {
      y[0] = (w[0] * (f - I) + x[0] * I) / f | 0, y[1] = (w[1] * (f - I) + x[1] * I) / f | 0, y[2] = (w[2] * (f - I) + x[2] * I) / f | 0, v[0] = (_[0] * (f - I) + k[0] * I) / f | 0, v[1] = (_[1] * (f - I) + k[1] * I) / f | 0, v[2] = (_[2] * (f - I) + k[2] * I) / f | 0;
      for (let R = 0; R <= u; R++, b++) {
        if (!(I !== 0 && I !== f || R !== 0 && R !== u)) continue;
        let B = 0, L = 0, it = 0;
        for (let at = 0; at <= 3; at++) for (let W = 0; W <= 3; W++, it++) {
          const q = S[I][at] * T[R][W];
          B += n[r[it]][0] * q, L += n[r[it]][1] * q;
        }
        p[b] = n.length, n.push([B, L]), g[b] = s.length;
        const O = new Uint8Array(3);
        O[0] = (y[0] * (u - R) + v[0] * R) / u | 0, O[1] = (y[1] * (u - R) + v[1] * R) / u | 0, O[2] = (y[2] * (u - R) + v[2] * R) / u | 0, s.push(O);
      }
    }
    p[0] = r[0], g[0] = a[0], p[u] = r[3], g[u] = a[1], p[d * f] = r[12], g[d * f] = a[2], p[d * f + u] = r[15], g[d * f + u] = a[3], this.figures[t] = { type: "lattice", coords: p, colors: g, verticesPerRow: d };
  }
  _updateBounds() {
    let t = this.coords[0][0], e = this.coords[0][1], n = t, s = e;
    for (let r = 1, a = this.coords.length; r < a; r++) {
      const o = this.coords[r][0], l = this.coords[r][1];
      t = t > o ? o : t, e = e > l ? l : e, n = n < o ? o : n, s = s < l ? l : s;
    }
    this.bounds = [t, e, n, s];
  }
  _packData() {
    let t, e, n, s;
    const r = this.coords, a = new Float32Array(2 * r.length);
    for (t = 0, n = 0, e = r.length; t < e; t++) {
      const h = r[t];
      a[n++] = h[0], a[n++] = h[1];
    }
    this.coords = a;
    const o = this.colors, l = new Uint8Array(3 * o.length);
    for (t = 0, n = 0, e = o.length; t < e; t++) {
      const h = o[t];
      l[n++] = h[0], l[n++] = h[1], l[n++] = h[2];
    }
    this.colors = l;
    const c = this.figures;
    for (t = 0, e = c.length; t < e; t++) {
      const h = c[t], u = h.coords, f = h.colors;
      for (n = 0, s = u.length; n < s; n++)
        u[n] *= 2, f[n] *= 3;
    }
  }
  getIR() {
    const { bounds: t } = this;
    if (t[2] - t[0] == 0 || t[3] - t[1] == 0) throw new ht(`Invalid MeshShading bounds: [${t}].`);
    return ["Mesh", this.shadingType, this.coords, this.colors, this.figures, t, this.bbox, this.background];
  }
};
ft(ra, "MIN_SPLIT_PATCH_CHUNKS_AMOUNT", 3), ft(ra, "MAX_SPLIT_PATCH_CHUNKS_AMOUNT", 20), ft(ra, "TRIANGLE_DENSITY", 20);
let Ab = ra;
class ON extends Tu {
  getIR() {
    return ["Dummy"];
  }
}
function V_(i, t, e) {
  const n = i0(t.getArray("Matrix"), Fa), s = Wl(t.getArray("BBox"), null);
  if (!s || s[2] - s[0] == 0 || s[3] - s[1] == 0) throw new ht("Invalid getTilingPatternIR /BBox array.");
  const r = t.get("XStep");
  if (typeof r != "number") throw new ht("Invalid getTilingPatternIR /XStep value.");
  const a = t.get("YStep");
  if (typeof a != "number") throw new ht("Invalid getTilingPatternIR /YStep value.");
  const o = t.get("PaintType");
  if (!Number.isInteger(o)) throw new ht("Invalid getTilingPatternIR /PaintType value.");
  const l = t.get("TilingType");
  if (!Number.isInteger(l)) throw new ht("Invalid getTilingPatternIR /TilingType value.");
  return ["TilingPattern", e, i, n, s, r, a, o, l];
}
const $N = [1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.54657, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, 0.92138, 0.83908, 0.7762, 0.73293, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356, 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.9121, 0.86943, 0.79795, 0.88198, 0.77958, 0.70864, 0.81055, 0.90399, 0.88653, 0.96017, 0.82577, 0.77892, 0.78257, 0.97507, 1.54657, 0.97507, 0.85284, 0.89552, 0.90176, 0.88762, 0.8785, 0.75241, 0.8785, 0.90518, 0.95015, 0.77618, 0.8785, 0.88401, 0.91916, 0.86304, 0.88401, 0.91488, 0.8785, 0.8801, 0.8785, 0.8785, 0.91343, 0.7173, 1.04106, 0.8785, 0.85075, 0.95794, 0.82616, 0.85162, 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, 1.12401, 0.96839, 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1, 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133, 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539, 0.73293, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958, 0.95958, 0.88506, 0.9121, 0.86943, 0.86943, 0.86943, 0.86943, 0.86943, 0.85284, 0.87508, 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795, 0.90807, 0.88762, 0.88762, 0.88762, 0.88762, 0.88762, 0.88762, 0.8715, 0.75241, 0.90518, 0.90518, 0.90518, 0.90518, 0.88401, 0.88401, 0.88401, 0.88401, 0.8785, 0.8785, 0.8801, 0.8801, 0.8801, 0.8801, 0.8801, 0.90747, 0.89049, 0.8785, 0.8785, 0.8785, 0.8785, 0.85162, 0.8785, 0.85162, 0.83908, 0.88762, 0.83908, 0.88762, 0.83908, 0.88762, 0.73293, 0.75241, 0.73293, 0.75241, 0.73293, 0.75241, 0.73293, 0.75241, 0.87289, 0.83016, 0.88506, 0.93125, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.73133, 0.90518, 0.81921, 0.77618, 0.81921, 0.77618, 0.81921, 0.77618, 1, 1, 0.87356, 0.8785, 0.91075, 0.89608, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.76229, 0.90167, 0.59526, 0.91916, 1, 1, 0.86304, 0.69225, 0.88401, 1, 1, 0.70424, 0.79468, 0.91926, 0.88175, 0.70823, 0.94903, 0.9121, 0.8785, 1, 1, 0.9121, 0.8785, 0.87802, 0.88656, 0.8785, 0.86943, 0.8801, 0.86943, 0.8801, 0.86943, 0.8801, 0.87402, 0.89291, 0.77958, 0.91343, 1, 1, 0.77958, 0.91343, 0.70864, 0.7173, 0.70864, 0.7173, 0.70864, 0.7173, 0.70864, 0.7173, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.90399, 0.8785, 0.96017, 0.95794, 0.77892, 0.85162, 0.77892, 0.78257, 0.79492, 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.88762, 0.77539, 0.8715, 0.87508, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528, 1, 1.15543, 0.70674, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.06303, 0.83908, 0.80352, 0.57184, 0.6965, 0.56289, 0.82001, 0.56029, 0.81235, 1.02988, 0.83908, 0.7762, 0.68156, 0.80367, 0.73133, 0.78257, 0.87356, 0.86943, 0.95958, 0.75727, 0.89019, 1.04924, 0.9121, 0.7648, 0.86943, 0.87356, 0.79795, 0.78275, 0.81055, 0.77892, 0.9762, 0.82577, 0.99819, 0.84896, 0.95958, 0.77892, 0.96108, 1.01407, 0.89049, 1.02988, 0.94211, 0.96108, 0.8936, 0.84021, 0.87842, 0.96399, 0.79109, 0.89049, 1.00813, 1.02988, 0.86077, 0.87445, 0.92099, 0.84723, 0.86513, 0.8801, 0.75638, 0.85714, 0.78216, 0.79586, 0.87965, 0.94211, 0.97747, 0.78287, 0.97926, 0.84971, 1.02988, 0.94211, 0.8801, 0.94211, 0.84971, 0.73133, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90264, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90518, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90548, 1, 1, 1, 1, 1, 1, 0.96017, 0.95794, 0.96017, 0.95794, 0.96017, 0.95794, 0.77892, 0.85162, 1, 1, 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.92794, 0.87012, 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71143, 1.06152, 1, 1, 1.03372, 1.03372, 0.97171, 1.4956, 2.2807, 0.93835, 0.83406, 0.91133, 0.84107, 0.91133, 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90527, 1.81055, 0.90527, 1.81055, 1.31006, 1.53711, 0.94434, 1.08696, 1, 0.95018, 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], qN = { lineHeight: 1.2207, lineGap: 0.2207 }, zN = [1.3877, 1, 1, 1, 0.97801, 0.92482, 0.89552, 0.91133, 0.81988, 0.97566, 0.98152, 0.93548, 0.93548, 1.2798, 0.85284, 0.92794, 1, 0.96134, 1.56239, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.82845, 0.82845, 0.85284, 0.85284, 0.85284, 0.75859, 0.92138, 0.83908, 0.7762, 0.71805, 0.87289, 0.73133, 0.7514, 0.81921, 0.87356, 0.95958, 0.59526, 0.75727, 0.69225, 1.04924, 0.90872, 0.85938, 0.79795, 0.87068, 0.77958, 0.69766, 0.81055, 0.90399, 0.88653, 0.96068, 0.82577, 0.77892, 0.78257, 0.97507, 1.529, 0.97507, 0.85284, 0.89552, 0.90176, 0.94908, 0.86411, 0.74012, 0.86411, 0.88323, 0.95015, 0.86411, 0.86331, 0.88401, 0.91916, 0.86304, 0.88401, 0.9039, 0.86331, 0.86331, 0.86411, 0.86411, 0.90464, 0.70852, 1.04106, 0.86331, 0.84372, 0.95794, 0.82616, 0.84548, 0.79492, 0.88331, 1.69808, 0.88331, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.7801, 0.89552, 1.24487, 1.13254, 1.19129, 0.96839, 0.85284, 0.68787, 0.70645, 0.85592, 0.90747, 1.01466, 1.0088, 0.90323, 1, 1.07463, 1, 0.91056, 0.75806, 1.19118, 0.96839, 0.78864, 0.82845, 0.84133, 0.75859, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.83908, 0.77539, 0.71805, 0.73133, 0.73133, 0.73133, 0.73133, 0.95958, 0.95958, 0.95958, 0.95958, 0.88506, 0.90872, 0.85938, 0.85938, 0.85938, 0.85938, 0.85938, 0.85284, 0.87068, 0.90399, 0.90399, 0.90399, 0.90399, 0.77892, 0.79795, 0.90807, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.94908, 0.85887, 0.74012, 0.88323, 0.88323, 0.88323, 0.88323, 0.88401, 0.88401, 0.88401, 0.88401, 0.8785, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331, 0.86331, 0.90747, 0.89049, 0.86331, 0.86331, 0.86331, 0.86331, 0.84548, 0.86411, 0.84548, 0.83908, 0.94908, 0.83908, 0.94908, 0.83908, 0.94908, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.71805, 0.74012, 0.87289, 0.79538, 0.88506, 0.92726, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.73133, 0.88323, 0.81921, 0.86411, 0.81921, 0.86411, 0.81921, 0.86411, 1, 1, 0.87356, 0.86331, 0.91075, 0.8777, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.95958, 0.88401, 0.76467, 0.90167, 0.59526, 0.91916, 1, 1, 0.86304, 0.69225, 0.88401, 1, 1, 0.70424, 0.77312, 0.91926, 0.88175, 0.70823, 0.94903, 0.90872, 0.86331, 1, 1, 0.90872, 0.86331, 0.86906, 0.88116, 0.86331, 0.85938, 0.86331, 0.85938, 0.86331, 0.85938, 0.86331, 0.87402, 0.86549, 0.77958, 0.90464, 1, 1, 0.77958, 0.90464, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 0.69766, 0.70852, 1, 1, 0.81055, 0.75841, 0.81055, 1.06452, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.90399, 0.86331, 0.96068, 0.95794, 0.77892, 0.84548, 0.77892, 0.78257, 0.79492, 0.78257, 0.79492, 0.78257, 0.79492, 0.9297, 0.56892, 0.83908, 0.94908, 0.77539, 0.85887, 0.87068, 0.89049, 1, 1, 0.81055, 1.04106, 1.20528, 1.20528, 1, 1.15543, 0.70088, 0.98387, 0.94721, 1.33431, 1.45894, 0.95161, 1.48387, 0.83908, 0.80352, 0.57118, 0.6965, 0.56347, 0.79179, 0.55853, 0.80346, 1.02988, 0.83908, 0.7762, 0.67174, 0.86036, 0.73133, 0.78257, 0.87356, 0.86441, 0.95958, 0.75727, 0.89019, 1.04924, 0.90872, 0.74889, 0.85938, 0.87891, 0.79795, 0.7957, 0.81055, 0.77892, 0.97447, 0.82577, 0.97466, 0.87179, 0.95958, 0.77892, 0.94252, 0.95612, 0.8753, 1.02988, 0.92733, 0.94252, 0.87411, 0.84021, 0.8728, 0.95612, 0.74081, 0.8753, 1.02189, 1.02988, 0.84814, 0.87445, 0.91822, 0.84723, 0.85668, 0.86331, 0.81344, 0.87581, 0.76422, 0.82046, 0.96057, 0.92733, 0.99375, 0.78022, 0.95452, 0.86015, 1.02988, 0.92733, 0.86331, 0.92733, 0.86015, 0.73133, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90631, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.88323, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85174, 1, 1, 1, 1, 1, 1, 0.96068, 0.95794, 0.96068, 0.95794, 0.96068, 0.95794, 0.77892, 0.84548, 1, 1, 0.89552, 0.90527, 1, 0.90363, 0.92794, 0.92794, 0.92794, 0.89807, 0.87012, 0.87012, 0.87012, 0.89552, 0.89552, 1.42259, 0.71094, 1.06152, 1, 1, 1.03372, 1.03372, 0.97171, 1.4956, 2.2807, 0.92972, 0.83406, 0.91133, 0.83326, 0.91133, 1, 1, 1, 0.72021, 1, 1.23108, 0.83489, 0.88525, 0.88525, 0.81499, 0.90616, 1.81055, 0.90527, 1.81055, 1.3107, 1.53711, 0.94434, 1.08696, 1, 0.95018, 0.77192, 0.85284, 0.90747, 1.17534, 0.69825, 0.9716, 1.37077, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.08004, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90727, 0.90727, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], UN = { lineHeight: 1.2207, lineGap: 0.2207 }, HN = [1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601, 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39543, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071, 0.8675, 0.81552, 0.72346, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685, 0.6377, 0.77892, 0.75593, 1.02638, 0.89249, 0.84118, 0.77452, 0.85374, 0.75186, 0.67789, 0.79776, 0.88844, 0.85066, 0.94309, 0.77818, 0.7306, 0.76659, 1.10369, 1.38313, 1.10369, 1.06139, 0.89552, 0.8739, 0.9245, 0.9245, 0.83203, 0.9245, 0.85865, 1.09842, 0.9245, 0.9245, 1.03297, 1.07692, 0.90918, 1.03297, 0.94959, 0.9245, 0.92274, 0.9245, 0.9245, 1.02933, 0.77832, 1.20562, 0.9245, 0.8916, 0.98986, 0.86621, 0.89453, 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, 1.16359, 0.92098, 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, 1.0044, 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, 0.80504, 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.76318, 0.72346, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, 0.90685, 0.90685, 0.86477, 0.89249, 0.84118, 0.84118, 0.84118, 0.84118, 0.84118, 0.85284, 0.84557, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, 0.77452, 0.86331, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.9245, 0.84843, 0.83203, 0.85865, 0.85865, 0.85865, 0.85865, 0.82601, 0.82601, 0.82601, 0.82601, 0.94469, 0.9245, 0.92274, 0.92274, 0.92274, 0.92274, 0.92274, 0.90747, 0.86651, 0.9245, 0.9245, 0.9245, 0.9245, 0.89453, 0.9245, 0.89453, 0.8675, 0.9245, 0.8675, 0.9245, 0.8675, 0.9245, 0.72346, 0.83203, 0.72346, 0.83203, 0.72346, 0.83203, 0.72346, 0.83203, 0.85193, 0.8875, 0.86477, 0.99034, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.73206, 0.85865, 0.81105, 0.9245, 0.81105, 0.9245, 0.81105, 0.9245, 1, 1, 0.86275, 0.9245, 0.90872, 0.93591, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, 0.82601, 0.77896, 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, 1, 1, 0.76032, 0.9375, 0.98156, 0.93407, 0.77261, 1.11429, 0.89249, 0.9245, 1, 1, 0.89249, 0.9245, 0.92534, 0.86698, 0.9245, 0.84118, 0.92274, 0.84118, 0.92274, 0.84118, 0.92274, 0.8667, 0.86291, 0.75186, 1.02933, 1, 1, 0.75186, 1.02933, 0.67789, 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 0.67789, 0.77832, 1, 1, 0.79776, 0.97655, 0.79776, 1.23023, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.88844, 0.9245, 0.94309, 0.98986, 0.7306, 0.89453, 0.7306, 0.76659, 0.79004, 0.76659, 0.79004, 0.76659, 0.79004, 1.09231, 0.54873, 0.8675, 0.9245, 0.76318, 0.84843, 0.84557, 0.86651, 1, 1, 0.79776, 1.20562, 1.18622, 1.18622, 1, 1.1437, 0.67009, 0.96334, 0.93695, 1.35191, 1.40909, 0.95161, 1.48387, 0.8675, 0.90861, 0.6192, 0.7363, 0.64824, 0.82411, 0.56321, 0.85696, 1.23516, 0.8675, 0.81552, 0.7286, 0.84134, 0.73206, 0.76659, 0.86275, 0.84369, 0.90685, 0.77892, 0.85871, 1.02638, 0.89249, 0.75828, 0.84118, 0.85984, 0.77452, 0.76466, 0.79776, 0.7306, 0.90782, 0.77818, 0.903, 0.87291, 0.90685, 0.7306, 0.99058, 1.03667, 0.94635, 1.23516, 0.9849, 0.99058, 0.92393, 0.8916, 0.942, 1.03667, 0.75026, 0.94635, 1.0297, 1.23516, 0.90918, 0.94048, 0.98217, 0.89746, 0.84153, 0.92274, 0.82507, 0.88832, 0.84438, 0.88178, 1.03525, 0.9849, 1.00225, 0.78086, 0.97248, 0.89404, 1.23516, 0.9849, 0.92274, 0.9849, 0.89404, 0.73206, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89693, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.85865, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.90933, 1, 1, 1, 1, 1, 1, 0.94309, 0.98986, 0.94309, 0.98986, 0.94309, 0.98986, 0.7306, 0.89453, 1, 1, 0.89552, 0.90527, 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566, 0.89552, 0.89552, 1.42259, 0.68994, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523, 1.4956, 2.01462, 0.97858, 0.82616, 0.91133, 0.83437, 0.91133, 1, 1, 1, 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90572, 1.81055, 0.90749, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, 0.85284, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], jN = { lineHeight: 1.2207, lineGap: 0.2207 }, GN = [1.3877, 1, 1, 1, 1.17223, 1.1293, 0.89552, 0.91133, 0.80395, 1.02269, 1.15601, 0.91056, 0.91056, 1.2798, 0.85284, 0.89807, 1, 0.90861, 1.39016, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.91133, 0.96309, 0.96309, 0.85284, 0.85284, 0.85284, 0.83319, 0.88071, 0.8675, 0.81552, 0.73834, 0.85193, 0.73206, 0.7522, 0.81105, 0.86275, 0.90685, 0.6377, 0.77892, 0.75593, 1.02638, 0.89385, 0.85122, 0.77452, 0.86503, 0.75186, 0.68887, 0.79776, 0.88844, 0.85066, 0.94258, 0.77818, 0.7306, 0.76659, 1.10369, 1.39016, 1.10369, 1.06139, 0.89552, 0.8739, 0.86128, 0.94469, 0.8457, 0.94469, 0.89464, 1.09842, 0.84636, 0.94469, 1.03297, 1.07692, 0.90918, 1.03297, 0.95897, 0.94469, 0.9482, 0.94469, 0.94469, 1.04692, 0.78223, 1.20562, 0.94469, 0.90332, 0.98986, 0.86621, 0.90527, 0.79004, 0.94152, 1.77256, 0.94152, 0.85284, 0.97801, 0.89552, 0.91133, 0.89552, 0.91133, 1.91729, 0.89552, 1.17889, 1.13254, 1.08707, 0.92098, 0.85284, 0.68787, 0.71353, 0.84737, 0.90747, 1.0088, 1.0044, 0.87683, 1, 1.09091, 1, 0.92229, 0.739, 1.15642, 0.92098, 0.76288, 0.80504, 0.80972, 0.75859, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.8675, 0.76318, 0.73834, 0.73206, 0.73206, 0.73206, 0.73206, 0.90685, 0.90685, 0.90685, 0.90685, 0.86477, 0.89385, 0.85122, 0.85122, 0.85122, 0.85122, 0.85122, 0.85284, 0.85311, 0.88844, 0.88844, 0.88844, 0.88844, 0.7306, 0.77452, 0.86331, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.86128, 0.8693, 0.8457, 0.89464, 0.89464, 0.89464, 0.89464, 0.82601, 0.82601, 0.82601, 0.82601, 0.94469, 0.94469, 0.9482, 0.9482, 0.9482, 0.9482, 0.9482, 0.90747, 0.86651, 0.94469, 0.94469, 0.94469, 0.94469, 0.90527, 0.94469, 0.90527, 0.8675, 0.86128, 0.8675, 0.86128, 0.8675, 0.86128, 0.73834, 0.8457, 0.73834, 0.8457, 0.73834, 0.8457, 0.73834, 0.8457, 0.85193, 0.92454, 0.86477, 0.9921, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.73206, 0.89464, 0.81105, 0.84636, 0.81105, 0.84636, 0.81105, 0.84636, 1, 1, 0.86275, 0.94469, 0.90872, 0.95786, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 0.82601, 0.90685, 1.03297, 0.90685, 0.82601, 0.77741, 1.05611, 0.6377, 1.07692, 1, 1, 0.90918, 0.75593, 1.03297, 1, 1, 0.76032, 0.90452, 0.98156, 1.11842, 0.77261, 1.11429, 0.89385, 0.94469, 1, 1, 0.89385, 0.94469, 0.95877, 0.86901, 0.94469, 0.85122, 0.9482, 0.85122, 0.9482, 0.85122, 0.9482, 0.8667, 0.90016, 0.75186, 1.04692, 1, 1, 0.75186, 1.04692, 0.68887, 0.78223, 0.68887, 0.78223, 0.68887, 0.78223, 0.68887, 0.78223, 1, 1, 0.79776, 0.92188, 0.79776, 1.23023, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.88844, 0.94469, 0.94258, 0.98986, 0.7306, 0.90527, 0.7306, 0.76659, 0.79004, 0.76659, 0.79004, 0.76659, 0.79004, 1.09231, 0.54873, 0.8675, 0.86128, 0.76318, 0.8693, 0.85311, 0.86651, 1, 1, 0.79776, 1.20562, 1.18622, 1.18622, 1, 1.1437, 0.67742, 0.96334, 0.93695, 1.35191, 1.40909, 0.95161, 1.48387, 0.86686, 0.90861, 0.62267, 0.74359, 0.65649, 0.85498, 0.56963, 0.88254, 1.23516, 0.8675, 0.81552, 0.75443, 0.84503, 0.73206, 0.76659, 0.86275, 0.85122, 0.90685, 0.77892, 0.85746, 1.02638, 0.89385, 0.75657, 0.85122, 0.86275, 0.77452, 0.74171, 0.79776, 0.7306, 0.95165, 0.77818, 0.89772, 0.88831, 0.90685, 0.7306, 0.98142, 1.02191, 0.96576, 1.23516, 0.99018, 0.98142, 0.9236, 0.89258, 0.94035, 1.02191, 0.78848, 0.96576, 0.9561, 1.23516, 0.90918, 0.92578, 0.95424, 0.89746, 0.83969, 0.9482, 0.80113, 0.89442, 0.85208, 0.86155, 0.98022, 0.99018, 1.00452, 0.81209, 0.99247, 0.89181, 1.23516, 0.99018, 0.9482, 0.99018, 0.89181, 0.73206, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.88844, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89464, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.96766, 1, 1, 1, 1, 1, 1, 0.94258, 0.98986, 0.94258, 0.98986, 0.94258, 0.98986, 0.7306, 0.90527, 1, 1, 0.89552, 0.90527, 1, 0.90186, 1.12308, 1.12308, 1.12308, 1.12308, 1.2566, 1.2566, 1.2566, 0.89552, 0.89552, 1.42259, 0.69043, 1.03809, 1, 1, 1.0176, 1.0176, 1.11523, 1.4956, 2.01462, 0.99331, 0.82616, 0.91133, 0.84286, 0.91133, 1, 1, 1, 0.70508, 1, 1.23108, 0.79801, 0.84426, 0.84426, 0.774, 0.90527, 1.81055, 0.90527, 1.81055, 1.28809, 1.55469, 0.94434, 1.07806, 1, 0.97094, 0.7589, 0.85284, 0.90747, 1.19658, 0.69825, 0.97622, 1.33512, 0.90747, 0.90747, 0.85356, 0.90747, 0.90747, 1.44947, 0.85284, 0.8941, 0.8941, 0.70572, 0.8, 0.70572, 0.70572, 0.70572, 0.70572, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.99862, 0.99862, 1, 1, 1, 1, 1, 1.0336, 0.91027, 1, 1, 1, 0.99862, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05859, 1.05859, 1, 1, 1, 1.07185, 0.99413, 0.96334, 1.08065, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], VN = { lineHeight: 1.2207, lineGap: 0.2207 }, WN = [0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998, 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026, 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026, 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1, 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 1.03374, 0.99977, 1.00026, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.00042, 0.99973, 0.99973, 1.0006, 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.03828, 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 1.00034, 0.99977, 1, 0.99997, 1.00026, 1.00078, 1.00036, 0.99973, 1.00013, 1.0006, 0.99977, 0.99977, 0.99988, 0.85148, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 1.00069, 1.00022, 0.99977, 1.00001, 0.99984, 1.00026, 1.00001, 1.00024, 1.00001, 0.9999, 1, 1.0006, 1.00001, 1.00041, 0.99962, 1.00026, 1.0006, 0.99995, 1.00041, 0.99942, 0.99973, 0.99927, 1.00082, 0.99902, 1.00026, 1.00087, 1.0006, 1.00069, 0.99973, 0.99867, 0.99973, 0.9993, 1.00026, 1.00049, 1.00056, 1, 0.99988, 0.99935, 0.99995, 0.99954, 1.00055, 0.99945, 1.00032, 1.0006, 0.99995, 1.00026, 0.99995, 1.00032, 1.00001, 1.00008, 0.99971, 1.00019, 0.9994, 1.00001, 1.0006, 1.00044, 0.99973, 1.00023, 1.00047, 1, 0.99942, 0.99561, 0.99989, 1.00035, 0.99977, 1.00035, 0.99977, 1.00019, 0.99944, 1.00001, 1.00021, 0.99926, 1.00035, 1.00035, 0.99942, 1.00048, 0.99999, 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, 1.00026, 0.99989, 1.00057, 1.00001, 0.99936, 1.00052, 1.00012, 0.99996, 1.00043, 1, 1.00035, 0.9994, 0.99976, 1.00035, 0.99973, 1.00052, 1.00041, 1.00119, 1.00037, 0.99973, 1.00002, 0.99986, 1.00041, 1.00041, 0.99902, 0.9996, 1.00034, 0.99999, 1.00026, 0.99999, 1.00026, 0.99973, 1.00052, 0.99973, 1, 0.99973, 1.00041, 1.00075, 0.9994, 1.0003, 0.99999, 1, 1.00041, 0.99955, 1, 0.99915, 0.99973, 0.99973, 1.00026, 1.00119, 0.99955, 0.99973, 1.0006, 0.99911, 1.0006, 1.00026, 0.99972, 1.00026, 0.99902, 1.00041, 0.99973, 0.99999, 1, 1, 1.00038, 1.0005, 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1, 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973, 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 0.99971, 1.00047, 1.00023, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, 1, 1, 1, 1, 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], XN = { lineHeight: 1.2, lineGap: 0.2 }, YN = [0.76116, 1, 1, 1.0006, 0.99998, 0.99974, 0.99973, 0.99973, 0.99982, 0.99977, 1.00087, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.00003, 1.00003, 1.00003, 1.00026, 0.9999, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 0.99973, 0.99977, 1.00026, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 0.99998, 1.0006, 0.99998, 1.00003, 0.99973, 0.99998, 0.99973, 1.00026, 0.99973, 1.00026, 0.99973, 0.99998, 1.00026, 1.00026, 1.0006, 1.0006, 0.99973, 1.0006, 0.99982, 1.00026, 1.00026, 1.00026, 1.00026, 0.99959, 0.99973, 0.99998, 1.00026, 0.99973, 1.00022, 0.99973, 0.99973, 1, 0.99959, 1.00077, 0.99959, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.00077, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.99973, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 0.99977, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 1.06409, 1.00026, 1.00026, 1.00026, 1.00026, 1.00026, 0.99973, 1.00026, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 1.0044, 0.99977, 1.00026, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99971, 0.99973, 0.99973, 1.0006, 0.99977, 0.99973, 0.99973, 1.00026, 1.0006, 1.00026, 1.0006, 1.00026, 1.01011, 1.00026, 0.99999, 1.00026, 1.0006, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.9993, 0.9998, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1.00022, 1.00026, 1, 1.00016, 0.99977, 0.99959, 0.99977, 0.99959, 0.99977, 0.99959, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00026, 0.99998, 1.00026, 0.8121, 1.00026, 0.99998, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 0.99977, 1.00026, 1.00016, 1.00022, 1.00001, 0.99973, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 1.0006, 0.99973, 0.99977, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 0.99973, 1.00026, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99977, 1, 1, 1.00026, 0.99969, 0.99972, 0.99981, 0.9998, 1.0006, 0.99977, 0.99977, 1.00022, 0.91155, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 0.99977, 1.00001, 0.99999, 0.99977, 0.99966, 1.00022, 1.00032, 1.00001, 0.99944, 1.00026, 1.00001, 0.99968, 1.00001, 1.00047, 1, 1.0006, 1.00001, 0.99981, 1.00101, 1.00026, 1.0006, 0.99948, 0.99981, 1.00064, 0.99973, 0.99942, 1.00101, 1.00061, 1.00026, 1.00069, 1.0006, 1.00014, 0.99973, 1.01322, 0.99973, 1.00065, 1.00026, 1.00012, 0.99923, 1, 1.00064, 1.00076, 0.99948, 1.00055, 1.00063, 1.00007, 0.99943, 1.0006, 0.99948, 1.00026, 0.99948, 0.99943, 1.00001, 1.00001, 1.00029, 1.00038, 1.00035, 1.00001, 1.0006, 1.0006, 0.99973, 0.99978, 1.00001, 1.00057, 0.99989, 0.99967, 0.99964, 0.99967, 0.99977, 0.99999, 0.99977, 1.00038, 0.99977, 1.00001, 0.99973, 1.00066, 0.99967, 0.99967, 1.00041, 0.99998, 0.99999, 0.99977, 1.00022, 0.99967, 1.00001, 0.99977, 1.00026, 0.99964, 1.00031, 1.00001, 0.99999, 0.99999, 1, 1.00023, 1, 1, 0.99999, 1.00035, 1.00001, 0.99999, 0.99973, 0.99977, 0.99999, 1.00058, 0.99973, 0.99973, 0.99955, 0.9995, 1.00026, 1.00026, 1.00032, 0.99989, 1.00034, 0.99999, 1.00026, 1.00026, 1.00026, 0.99973, 0.45998, 0.99973, 1.00026, 0.99973, 1.00001, 0.99999, 0.99982, 0.99994, 0.99996, 1, 1.00042, 1.00044, 1.00029, 1.00023, 0.99973, 0.99973, 1.00026, 0.99949, 1.00002, 0.99973, 1.0006, 1.0006, 1.0006, 0.99975, 1.00026, 1.00026, 1.00032, 0.98685, 0.99973, 1.00026, 1, 1, 0.99966, 1.00044, 1.00016, 1.00022, 1.00016, 1.00022, 1.00016, 1.00022, 1.00001, 0.99973, 1, 1, 0.99973, 1, 1, 0.99955, 1.0006, 1.0006, 1.0006, 1.0006, 1, 1, 1, 0.99973, 0.99973, 0.99972, 1, 1, 1.00106, 0.99999, 0.99998, 0.99998, 0.99999, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1, 0.99973, 0.99971, 0.99978, 1, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1.00098, 1, 1, 1, 1.00049, 1, 1, 0.99972, 1, 1.20985, 1.39713, 1.00003, 1.00031, 1.00015, 1, 0.99561, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.99972, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], KN = { lineHeight: 1.35, lineGap: 0.2 }, ZN = [0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987, 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973, 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924, 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1, 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.0288, 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, 1.0006, 0.99946, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, 0.99973, 0.99924, 0.99973, 1.06311, 0.99973, 1.00024, 0.99973, 0.99924, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00041, 0.9998, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.89547, 1.00026, 1.0006, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 1.00001, 1, 1.00054, 0.99977, 1.00084, 1.00007, 0.99973, 1.00013, 0.99924, 1.00001, 1.00001, 0.99945, 0.91221, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 1.00001, 1.00001, 0.99999, 0.99977, 0.99933, 1.00022, 1.00054, 1.00001, 1.00065, 1.00026, 1.00001, 1.0001, 1.00001, 1.00052, 1, 1.0006, 1.00001, 0.99945, 0.99897, 0.99968, 0.99924, 1.00036, 0.99945, 0.99949, 1, 1.0006, 0.99897, 0.99918, 0.99968, 0.99911, 0.99924, 1, 0.99962, 1.01487, 1, 1.0005, 0.99973, 1.00012, 1.00043, 1, 0.99995, 0.99994, 1.00036, 0.99947, 1.00019, 1.00063, 1.00025, 0.99924, 1.00036, 0.99973, 1.00036, 1.00025, 1.00001, 1.00001, 1.00027, 1.0001, 1.00068, 1.00001, 1.0006, 1.0006, 1, 1.00008, 0.99957, 0.99972, 0.9994, 0.99954, 0.99975, 1.00051, 1.00001, 1.00019, 1.00001, 1.0001, 0.99986, 1.00001, 1.00001, 1.00038, 0.99954, 0.99954, 0.9994, 1.00066, 0.99999, 0.99977, 1.00022, 1.00054, 1.00001, 0.99977, 1.00026, 0.99975, 1.0001, 1.00001, 0.99993, 0.9995, 0.99955, 1.00016, 0.99978, 0.99974, 1.00019, 1.00022, 0.99955, 1.00053, 0.99973, 1.00089, 1.00005, 0.99967, 1.00048, 0.99973, 1.00002, 1.00034, 0.99973, 0.99973, 0.99964, 1.00006, 1.00066, 0.99947, 0.99973, 0.98894, 0.99973, 1, 0.44898, 1, 0.99946, 1, 1.00039, 1.00082, 0.99991, 0.99991, 0.99985, 1.00022, 1.00023, 1.00061, 1.00006, 0.99966, 0.99973, 0.99973, 0.99973, 1.00019, 1.0008, 1, 0.99924, 0.99924, 0.99924, 0.99983, 1.00044, 0.99973, 0.99964, 0.98332, 1, 0.99973, 1, 1, 0.99962, 0.99895, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, 0.99977, 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, 0.99924, 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, 0.99999, 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 1.00423, 0.99925, 0.99999, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1.00049, 1, 1.00245, 1, 1, 1, 1, 0.96329, 1, 1.20985, 1.39713, 1.00003, 0.8254, 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, 1.00003, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 0.99998, 0.99998, 0.99998, 0.99998, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], JN = { lineHeight: 1.35, lineGap: 0.2 }, QN = [0.76116, 1, 1, 1.0006, 1.0006, 1.00006, 0.99973, 0.99973, 0.99982, 1.00001, 1.00043, 0.99998, 0.99998, 0.99959, 1.00003, 1.0006, 0.99998, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1, 1.00003, 1.00003, 1.00003, 0.99973, 0.99987, 1.00001, 1.00001, 0.99977, 0.99977, 1.00001, 1.00026, 1.00022, 0.99977, 1.0006, 1, 1.00001, 0.99973, 0.99999, 0.99977, 1.00022, 1.00001, 1.00022, 0.99977, 1.00001, 1.00026, 0.99977, 1.00001, 1.00016, 1.00001, 1.00001, 1.00026, 1.0006, 1.0006, 1.0006, 0.99949, 0.99973, 0.99998, 0.99973, 0.99973, 1, 0.99973, 0.99973, 1.0006, 0.99973, 0.99973, 0.99924, 0.99924, 1, 0.99924, 0.99999, 0.99973, 0.99973, 0.99973, 0.99973, 0.99998, 1, 1.0006, 0.99973, 1, 0.99977, 1, 1, 1, 1.00005, 1.0009, 1.00005, 1.00003, 0.99998, 0.99973, 0.99973, 0.99973, 0.99973, 1.0009, 0.99973, 0.99998, 1.00025, 0.99968, 0.99973, 1.00003, 1.00025, 0.60299, 1.00024, 1.06409, 1, 1, 0.99998, 1, 0.9998, 1.0006, 0.99998, 1, 0.99936, 0.99973, 1.00002, 1.00002, 1.00002, 1.00026, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1.00001, 1, 0.99977, 1.00001, 1.00001, 1.00001, 1.00001, 1.0006, 1.0006, 1.0006, 1.0006, 0.99977, 0.99977, 1.00022, 1.00022, 1.00022, 1.00022, 1.00022, 1.00003, 1.00022, 0.99977, 0.99977, 0.99977, 0.99977, 1.00001, 1.00001, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99982, 1, 0.99973, 0.99973, 0.99973, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 0.99973, 1.06409, 1.00026, 0.99973, 0.99973, 0.99973, 0.99973, 1, 0.99973, 1, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1, 0.99977, 1.04596, 0.99977, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00001, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 1.0006, 0.99924, 1.0006, 1.0006, 1.00019, 1.00034, 1, 0.99924, 1.00001, 1, 1, 0.99973, 0.99924, 0.99973, 0.99924, 0.99973, 1.02572, 0.99973, 1.00005, 0.99973, 0.99924, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99999, 0.9998, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1.00022, 0.99973, 1, 1.00016, 0.99977, 0.99998, 0.99977, 0.99998, 0.99977, 0.99998, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00001, 1, 1.00026, 1.0006, 1.00026, 0.84533, 1.00026, 1.0006, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 0.99977, 0.99973, 1.00016, 0.99977, 1.00001, 1, 1.00001, 1.00026, 1, 1.00026, 1, 1.00026, 1, 0.99924, 0.99973, 1.00001, 0.99973, 1, 0.99982, 1.00022, 1.00026, 1.00001, 1, 1.00026, 1.0006, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99998, 0.99928, 1, 0.99977, 1.00013, 1.00055, 0.99947, 0.99945, 0.99941, 0.99924, 1.00001, 1.00001, 1.0004, 0.91621, 1.00001, 1.00026, 0.99977, 1.00022, 1.0006, 1.00001, 1.00005, 0.99999, 0.99977, 1.00015, 1.00022, 0.99977, 1.00001, 0.99973, 1.00026, 1.00001, 1.00019, 1.00001, 0.99946, 1, 1.0006, 1.00001, 0.99978, 1.00045, 0.99973, 0.99924, 1.00023, 0.99978, 0.99966, 1, 1.00065, 1.00045, 1.00019, 0.99973, 0.99973, 0.99924, 1, 1, 0.96499, 1, 1.00055, 0.99973, 1.00008, 1.00027, 1, 0.9997, 0.99995, 1.00023, 0.99933, 1.00019, 1.00015, 1.00031, 0.99924, 1.00023, 0.99973, 1.00023, 1.00031, 1.00001, 0.99928, 1.00029, 1.00092, 1.00035, 1.00001, 1.0006, 1.0006, 1, 0.99988, 0.99975, 1, 1.00082, 0.99561, 0.9996, 1.00035, 1.00001, 0.99962, 1.00001, 1.00092, 0.99964, 1.00001, 0.99963, 0.99999, 1.00035, 1.00035, 1.00082, 0.99962, 0.99999, 0.99977, 1.00022, 1.00035, 1.00001, 0.99977, 1.00026, 0.9996, 0.99967, 1.00001, 1.00034, 1.00074, 1.00054, 1.00053, 1.00063, 0.99971, 0.99962, 1.00035, 0.99975, 0.99977, 0.99973, 1.00043, 0.99953, 1.0007, 0.99915, 0.99973, 1.00008, 0.99892, 1.00073, 1.00073, 1.00114, 0.99915, 1.00073, 0.99955, 0.99973, 1.00092, 0.99973, 1, 0.99998, 1, 1.0003, 1, 1.00043, 1.00001, 0.99969, 1.0003, 1, 1.00035, 1.00001, 0.9995, 1, 1.00092, 0.99973, 0.99973, 0.99973, 1.0007, 0.9995, 1, 0.99924, 1.0006, 0.99924, 0.99972, 1.00062, 0.99973, 1.00114, 1.00073, 1, 0.99955, 1, 1, 1.00047, 0.99968, 1.00016, 0.99977, 1.00016, 0.99977, 1.00016, 0.99977, 1.00001, 1, 1, 1, 0.99973, 1, 1, 0.99955, 0.99924, 0.99924, 0.99924, 0.99924, 0.99998, 0.99998, 0.99998, 0.99973, 0.99973, 0.99972, 1, 1, 1.00267, 0.99999, 0.99998, 0.99998, 1, 0.99998, 1.66475, 1, 0.99973, 0.99973, 1.00023, 0.99973, 0.99971, 0.99925, 1.00023, 1, 0.99991, 0.99984, 1.00002, 1.00002, 1.00002, 1.00002, 1, 1, 1, 1, 1, 1, 1, 0.96329, 1, 1.20985, 1.39713, 1.00003, 0.8254, 1.00015, 1, 1.00035, 1.00027, 1.00031, 1.00031, 0.99915, 1.00031, 1.00031, 0.99999, 1.00003, 0.99999, 0.99999, 1.41144, 1.6, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.41144, 1.40579, 1.40579, 1.36625, 0.99999, 1, 0.99861, 0.99861, 1, 1.00026, 1.00026, 1.00026, 1.00026, 0.95317, 0.99999, 0.99999, 0.99999, 0.99999, 1.40483, 1, 0.99977, 1.00054, 1, 1, 0.99953, 0.99962, 1.00042, 0.9995, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], tL = { lineHeight: 1.2, lineGap: 0.2 }, Ff = [365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1e3, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 719, 722, 611, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611, 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 785, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 385, 611, 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778, 611, 778, 611, 1e3, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556, 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611, 500, 611, 500, 278, 556, 722, 556, 1e3, 889, 778, 611, 667, 556, 611, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 465, 722, 333, 853, 906, 474, 825, 927, 838, 278, 722, 722, 601, 719, 667, 611, 722, 778, 278, 722, 667, 833, 722, 644, 778, 722, 667, 600, 611, 667, 821, 667, 809, 802, 278, 667, 615, 451, 611, 278, 582, 615, 610, 556, 606, 475, 460, 611, 541, 278, 558, 556, 612, 556, 445, 611, 766, 619, 520, 684, 446, 582, 715, 576, 753, 845, 278, 582, 611, 582, 845, 667, 669, 885, 567, 711, 667, 278, 276, 556, 1094, 1062, 875, 610, 722, 622, 719, 722, 719, 722, 567, 712, 667, 904, 626, 719, 719, 610, 702, 833, 722, 778, 719, 667, 722, 611, 622, 854, 667, 730, 703, 1005, 1019, 870, 979, 719, 711, 1031, 719, 556, 618, 615, 417, 635, 556, 709, 497, 615, 615, 500, 635, 740, 604, 611, 604, 611, 556, 490, 556, 875, 556, 615, 581, 833, 844, 729, 854, 615, 552, 854, 583, 556, 556, 611, 417, 552, 556, 278, 281, 278, 969, 906, 611, 500, 615, 556, 604, 778, 611, 487, 447, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1e3, 1e3, 552, 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1e3, 1e3, 240, 479, 333, 333, 604, 333, 167, 396, 556, 556, 1094, 556, 885, 489, 1115, 1e3, 768, 600, 834, 834, 834, 834, 1e3, 500, 1e3, 500, 1e3, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1e3, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333, 333, 333, 333, 333, 333], If = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], Mf = [365, 0, 333, 278, 333, 474, 556, 556, 889, 722, 238, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 333, 333, 584, 584, 584, 611, 975, 722, 722, 722, 722, 667, 611, 778, 722, 278, 556, 722, 611, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 333, 278, 333, 584, 556, 333, 556, 611, 556, 611, 556, 333, 611, 611, 278, 278, 556, 278, 889, 611, 611, 611, 611, 389, 556, 333, 611, 556, 778, 556, 556, 500, 389, 280, 389, 584, 333, 556, 556, 556, 556, 280, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 556, 278, 333, 333, 365, 556, 834, 834, 834, 611, 722, 722, 722, 722, 722, 722, 1e3, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 556, 556, 556, 556, 556, 278, 278, 278, 278, 611, 611, 611, 611, 611, 611, 611, 549, 611, 611, 611, 611, 611, 556, 611, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 740, 722, 611, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 611, 778, 611, 778, 611, 778, 611, 722, 611, 722, 611, 278, 278, 278, 278, 278, 278, 278, 278, 278, 278, 782, 556, 556, 278, 722, 556, 556, 611, 278, 611, 278, 611, 396, 611, 479, 611, 278, 722, 611, 722, 611, 722, 611, 708, 723, 611, 778, 611, 778, 611, 778, 611, 1e3, 944, 722, 389, 722, 389, 722, 389, 667, 556, 667, 556, 667, 556, 667, 556, 611, 333, 611, 479, 611, 333, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 722, 611, 944, 778, 667, 556, 667, 611, 500, 611, 500, 611, 500, 278, 556, 722, 556, 1e3, 889, 778, 611, 667, 556, 611, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 722, 333, 854, 906, 473, 844, 930, 847, 278, 722, 722, 610, 671, 667, 611, 722, 778, 278, 722, 667, 833, 722, 657, 778, 718, 667, 590, 611, 667, 822, 667, 829, 781, 278, 667, 620, 479, 611, 278, 591, 620, 621, 556, 610, 479, 492, 611, 558, 278, 566, 556, 603, 556, 450, 611, 712, 605, 532, 664, 409, 591, 704, 578, 773, 834, 278, 591, 611, 591, 834, 667, 667, 886, 614, 719, 667, 278, 278, 556, 1094, 1042, 854, 622, 719, 677, 719, 722, 708, 722, 614, 722, 667, 927, 643, 719, 719, 615, 687, 833, 722, 778, 719, 667, 722, 611, 677, 781, 667, 729, 708, 979, 989, 854, 1e3, 708, 719, 1042, 729, 556, 619, 604, 534, 618, 556, 736, 510, 611, 611, 507, 622, 740, 604, 611, 611, 611, 556, 889, 556, 885, 556, 646, 583, 889, 935, 707, 854, 594, 552, 865, 589, 556, 556, 611, 469, 563, 556, 278, 278, 278, 969, 906, 611, 507, 619, 556, 611, 778, 611, 575, 467, 944, 778, 944, 778, 944, 778, 667, 556, 333, 333, 556, 1e3, 1e3, 552, 278, 278, 278, 278, 500, 500, 500, 556, 556, 350, 1e3, 1e3, 240, 479, 333, 333, 604, 333, 167, 396, 556, 556, 1104, 556, 885, 516, 1146, 1e3, 768, 600, 834, 834, 834, 834, 999, 500, 1e3, 500, 1e3, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 722, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1e3, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 611, 611, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 333, 333, 333, 333, 333, 333, 333, 333], Rf = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], Bf = [365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1e3, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556, 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 625, 722, 556, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556, 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278, 278, 733, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 281, 556, 400, 556, 222, 722, 556, 722, 556, 722, 556, 615, 723, 556, 778, 556, 778, 556, 778, 556, 1e3, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500, 667, 500, 667, 500, 611, 278, 611, 354, 611, 278, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611, 500, 611, 500, 222, 556, 667, 556, 1e3, 889, 778, 611, 667, 500, 611, 278, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 789, 846, 389, 794, 865, 775, 222, 667, 667, 570, 671, 667, 611, 722, 778, 278, 667, 667, 833, 722, 648, 778, 725, 667, 600, 611, 667, 837, 667, 831, 761, 278, 667, 570, 439, 555, 222, 550, 570, 571, 500, 556, 439, 463, 555, 542, 222, 500, 492, 548, 500, 447, 556, 670, 573, 486, 603, 374, 550, 652, 546, 728, 779, 222, 550, 556, 550, 779, 667, 667, 843, 544, 708, 667, 278, 278, 500, 1066, 982, 844, 589, 715, 639, 724, 667, 651, 667, 544, 704, 667, 917, 614, 715, 715, 589, 686, 833, 722, 778, 725, 667, 722, 611, 639, 795, 667, 727, 673, 920, 923, 805, 886, 651, 694, 1022, 682, 556, 562, 522, 493, 553, 556, 688, 465, 556, 556, 472, 564, 686, 550, 556, 556, 556, 500, 833, 500, 835, 500, 572, 518, 830, 851, 621, 736, 526, 492, 752, 534, 556, 556, 556, 378, 496, 500, 222, 222, 222, 910, 828, 556, 472, 565, 500, 556, 778, 556, 492, 339, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1e3, 1e3, 552, 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1e3, 1e3, 188, 354, 333, 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1083, 1e3, 768, 600, 834, 834, 834, 834, 1e3, 500, 998, 500, 1e3, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 719, 274, 549, 549, 584, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1e3, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324, 324, 316, 328, 398, 285], Pf = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], Nf = [365, 0, 333, 278, 278, 355, 556, 556, 889, 667, 191, 333, 333, 389, 584, 278, 333, 278, 278, 556, 556, 556, 556, 556, 556, 556, 556, 556, 556, 278, 278, 584, 584, 584, 556, 1015, 667, 667, 722, 722, 667, 611, 778, 722, 278, 500, 667, 556, 833, 722, 778, 667, 778, 722, 667, 611, 722, 667, 944, 667, 667, 611, 278, 278, 278, 469, 556, 333, 556, 556, 500, 556, 556, 278, 556, 556, 222, 222, 500, 222, 833, 556, 556, 556, 556, 333, 500, 278, 556, 500, 722, 500, 500, 500, 334, 260, 334, 584, 333, 556, 556, 556, 556, 260, 556, 333, 737, 370, 556, 584, 737, 552, 400, 549, 333, 333, 333, 576, 537, 278, 333, 333, 365, 556, 834, 834, 834, 611, 667, 667, 667, 667, 667, 667, 1e3, 722, 667, 667, 667, 667, 278, 278, 278, 278, 722, 722, 778, 778, 778, 778, 778, 584, 778, 722, 722, 722, 722, 667, 667, 611, 556, 556, 556, 556, 556, 556, 889, 500, 556, 556, 556, 556, 278, 278, 278, 278, 556, 556, 556, 556, 556, 556, 556, 549, 611, 556, 556, 556, 556, 500, 556, 500, 667, 556, 667, 556, 667, 556, 722, 500, 722, 500, 722, 500, 722, 500, 722, 615, 722, 556, 667, 556, 667, 556, 667, 556, 667, 556, 667, 556, 778, 556, 778, 556, 778, 556, 778, 556, 722, 556, 722, 556, 278, 278, 278, 278, 278, 278, 278, 222, 278, 278, 735, 444, 500, 222, 667, 500, 500, 556, 222, 556, 222, 556, 292, 556, 334, 556, 222, 722, 556, 722, 556, 722, 556, 604, 723, 556, 778, 556, 778, 556, 778, 556, 1e3, 944, 722, 333, 722, 333, 722, 333, 667, 500, 667, 500, 667, 500, 667, 500, 611, 278, 611, 375, 611, 278, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 722, 556, 944, 722, 667, 500, 667, 611, 500, 611, 500, 611, 500, 222, 556, 667, 556, 1e3, 889, 778, 611, 667, 500, 611, 278, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 333, 667, 278, 784, 838, 384, 774, 855, 752, 222, 667, 667, 551, 668, 667, 611, 722, 778, 278, 667, 668, 833, 722, 650, 778, 722, 667, 618, 611, 667, 798, 667, 835, 748, 278, 667, 578, 446, 556, 222, 547, 578, 575, 500, 557, 446, 441, 556, 556, 222, 500, 500, 576, 500, 448, 556, 690, 569, 482, 617, 395, 547, 648, 525, 713, 781, 222, 547, 556, 547, 781, 667, 667, 865, 542, 719, 667, 278, 278, 500, 1057, 1010, 854, 583, 722, 635, 719, 667, 656, 667, 542, 677, 667, 923, 604, 719, 719, 583, 656, 833, 722, 778, 719, 667, 722, 611, 635, 760, 667, 740, 667, 917, 938, 792, 885, 656, 719, 1010, 722, 556, 573, 531, 365, 583, 556, 669, 458, 559, 559, 438, 583, 688, 552, 556, 542, 556, 500, 458, 500, 823, 500, 573, 521, 802, 823, 625, 719, 521, 510, 750, 542, 556, 556, 556, 365, 510, 500, 222, 278, 222, 906, 812, 556, 438, 559, 500, 552, 778, 556, 489, 411, 944, 722, 944, 722, 944, 722, 667, 500, 333, 333, 556, 1e3, 1e3, 552, 222, 222, 222, 222, 333, 333, 333, 556, 556, 350, 1e3, 1e3, 188, 354, 333, 333, 500, 333, 167, 365, 556, 556, 1094, 556, 885, 323, 1073, 1e3, 768, 600, 834, 834, 834, 834, 1e3, 500, 1e3, 500, 1e3, 500, 500, 494, 612, 823, 713, 584, 549, 713, 979, 719, 274, 549, 549, 583, 549, 549, 604, 584, 604, 604, 708, 625, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 708, 729, 604, 604, 354, 354, 1e3, 990, 990, 990, 990, 494, 604, 604, 604, 604, 354, 1021, 1052, 917, 750, 750, 531, 656, 594, 510, 500, 750, 750, 500, 500, 333, 333, 333, 333, 333, 333, 333, 333, 222, 222, 294, 294, 324, 324, 316, 328, 398, 285], Lf = [-1, -1, -1, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 161, 162, 163, 164, 165, 166, 167, 168, 169, 170, 171, 172, 174, 175, 176, 177, 178, 179, 180, 181, 182, 183, 184, 185, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 210, 211, 212, 213, 214, 215, 216, 217, 218, 219, 220, 221, 222, 223, 224, 225, 226, 227, 228, 229, 230, 231, 232, 233, 234, 235, 236, 237, 238, 239, 240, 241, 242, 243, 244, 245, 246, 247, 248, 249, 250, 251, 252, 253, 254, 255, 256, 257, 258, 259, 260, 261, 262, 263, 264, 265, 266, 267, 268, 269, 270, 271, 272, 273, 274, 275, 276, 277, 278, 279, 280, 281, 282, 283, 284, 285, 286, 287, 288, 289, 290, 291, 292, 293, 294, 295, 296, 297, 298, 299, 300, 301, 302, 303, 304, 305, 306, 307, 308, 309, 310, 311, 312, 313, 314, 315, 316, 317, 318, 319, 320, 321, 322, 323, 324, 325, 326, 327, 328, 329, 330, 331, 332, 333, 334, 335, 336, 337, 338, 339, 340, 341, 342, 343, 344, 345, 346, 347, 348, 349, 350, 351, 352, 353, 354, 355, 356, 357, 358, 359, 360, 361, 362, 363, 364, 365, 366, 367, 368, 369, 370, 371, 372, 373, 374, 375, 376, 377, 378, 379, 380, 381, 382, 383, 402, 506, 507, 508, 509, 510, 511, 536, 537, 538, 539, 710, 711, 713, 728, 729, 730, 731, 732, 733, 900, 901, 902, 903, 904, 905, 906, 908, 910, 911, 912, 913, 914, 915, 916, 917, 918, 919, 920, 921, 922, 923, 924, 925, 926, 927, 928, 929, 931, 932, 933, 934, 935, 936, 937, 938, 939, 940, 941, 942, 943, 944, 945, 946, 947, 948, 949, 950, 951, 952, 953, 954, 955, 956, 957, 958, 959, 960, 961, 962, 963, 964, 965, 966, 967, 968, 969, 970, 971, 972, 973, 974, 1024, 1025, 1026, 1027, 1028, 1029, 1030, 1031, 1032, 1033, 1034, 1035, 1036, 1037, 1038, 1039, 1040, 1041, 1042, 1043, 1044, 1045, 1046, 1047, 1048, 1049, 1050, 1051, 1052, 1053, 1054, 1055, 1056, 1057, 1058, 1059, 1060, 1061, 1062, 1063, 1064, 1065, 1066, 1067, 1068, 1069, 1070, 1071, 1072, 1073, 1074, 1075, 1076, 1077, 1078, 1079, 1080, 1081, 1082, 1083, 1084, 1085, 1086, 1087, 1088, 1089, 1090, 1091, 1092, 1093, 1094, 1095, 1096, 1097, 1098, 1099, 1100, 1101, 1102, 1103, 1104, 1105, 1106, 1107, 1108, 1109, 1110, 1111, 1112, 1113, 1114, 1115, 1116, 1117, 1118, 1119, 1138, 1139, 1168, 1169, 7808, 7809, 7810, 7811, 7812, 7813, 7922, 7923, 8208, 8209, 8211, 8212, 8213, 8215, 8216, 8217, 8218, 8219, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8242, 8243, 8249, 8250, 8252, 8254, 8260, 8319, 8355, 8356, 8359, 8364, 8453, 8467, 8470, 8482, 8486, 8494, 8539, 8540, 8541, 8542, 8592, 8593, 8594, 8595, 8596, 8597, 8616, 8706, 8710, 8719, 8721, 8722, 8730, 8734, 8735, 8745, 8747, 8776, 8800, 8801, 8804, 8805, 8962, 8976, 8992, 8993, 9472, 9474, 9484, 9488, 9492, 9496, 9500, 9508, 9516, 9524, 9532, 9552, 9553, 9554, 9555, 9556, 9557, 9558, 9559, 9560, 9561, 9562, 9563, 9564, 9565, 9566, 9567, 9568, 9569, 9570, 9571, 9572, 9573, 9574, 9575, 9576, 9577, 9578, 9579, 9580, 9600, 9604, 9608, 9612, 9616, 9617, 9618, 9619, 9632, 9633, 9642, 9643, 9644, 9650, 9658, 9660, 9668, 9674, 9675, 9679, 9688, 9689, 9702, 9786, 9787, 9788, 9792, 9794, 9824, 9827, 9829, 9830, 9834, 9835, 9836, 61441, 61442, 61445, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1], eL = [1.36898, 1, 1, 0.72706, 0.80479, 0.83734, 0.98894, 0.99793, 0.9897, 0.93884, 0.86209, 0.94292, 0.94292, 1.16661, 1.02058, 0.93582, 0.96694, 0.93582, 1.19137, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.99793, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058, 0.72851, 0.78966, 0.90838, 0.83637, 0.82391, 0.96376, 0.80061, 0.86275, 0.8768, 0.95407, 1.0258, 0.73901, 0.85022, 0.83655, 1.0156, 0.95546, 0.92179, 0.87107, 0.92179, 0.82114, 0.8096, 0.89713, 0.94438, 0.95353, 0.94083, 0.91905, 0.90406, 0.9446, 0.94292, 1.18777, 0.94292, 1.02058, 0.89903, 0.90088, 0.94938, 0.97898, 0.81093, 0.97571, 0.94938, 1.024, 0.9577, 0.95933, 0.98621, 1.0474, 0.97455, 0.98981, 0.9672, 0.95933, 0.9446, 0.97898, 0.97407, 0.97646, 0.78036, 1.10208, 0.95442, 0.95298, 0.97579, 0.9332, 0.94039, 0.938, 0.80687, 1.01149, 0.80687, 1.02058, 0.80479, 0.99793, 0.99793, 0.99793, 0.99793, 1.01149, 1.00872, 0.90088, 0.91882, 1.0213, 0.8361, 1.02058, 0.62295, 0.54324, 0.89022, 1.08595, 1, 1, 0.90088, 1, 0.97455, 0.93582, 0.90088, 1, 1.05686, 0.8361, 0.99642, 0.99642, 0.99642, 0.72851, 0.90838, 0.90838, 0.90838, 0.90838, 0.90838, 0.90838, 0.868, 0.82391, 0.80061, 0.80061, 0.80061, 0.80061, 1.0258, 1.0258, 1.0258, 1.0258, 0.97484, 0.95546, 0.92179, 0.92179, 0.92179, 0.92179, 0.92179, 1.02058, 0.92179, 0.94438, 0.94438, 0.94438, 0.94438, 0.90406, 0.86958, 0.98225, 0.94938, 0.94938, 0.94938, 0.94938, 0.94938, 0.94938, 0.9031, 0.81093, 0.94938, 0.94938, 0.94938, 0.94938, 0.98621, 0.98621, 0.98621, 0.98621, 0.93969, 0.95933, 0.9446, 0.9446, 0.9446, 0.9446, 0.9446, 1.08595, 0.9446, 0.95442, 0.95442, 0.95442, 0.95442, 0.94039, 0.97898, 0.94039, 0.90838, 0.94938, 0.90838, 0.94938, 0.90838, 0.94938, 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, 0.82391, 0.81093, 0.96376, 0.84313, 0.97484, 0.97571, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.80061, 0.94938, 0.8768, 0.9577, 0.8768, 0.9577, 0.8768, 0.9577, 1, 1, 0.95407, 0.95933, 0.97069, 0.95933, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 1.0258, 0.98621, 0.887, 1.01591, 0.73901, 1.0474, 1, 1, 0.97455, 0.83655, 0.98981, 1, 1, 0.83655, 0.73977, 0.83655, 0.73903, 0.84638, 1.033, 0.95546, 0.95933, 1, 1, 0.95546, 0.95933, 0.8271, 0.95417, 0.95933, 0.92179, 0.9446, 0.92179, 0.9446, 0.92179, 0.9446, 0.936, 0.91964, 0.82114, 0.97646, 1, 1, 0.82114, 0.97646, 0.8096, 0.78036, 0.8096, 0.78036, 1, 1, 0.8096, 0.78036, 1, 1, 0.89713, 0.77452, 0.89713, 1.10208, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94438, 0.95442, 0.94083, 0.97579, 0.90406, 0.94039, 0.90406, 0.9446, 0.938, 0.9446, 0.938, 0.9446, 0.938, 1, 0.99793, 0.90838, 0.94938, 0.868, 0.9031, 0.92179, 0.9446, 1, 1, 0.89713, 1.10208, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90989, 0.9358, 0.91945, 0.83181, 0.75261, 0.87992, 0.82976, 0.96034, 0.83689, 0.97268, 1.0078, 0.90838, 0.83637, 0.8019, 0.90157, 0.80061, 0.9446, 0.95407, 0.92436, 1.0258, 0.85022, 0.97153, 1.0156, 0.95546, 0.89192, 0.92179, 0.92361, 0.87107, 0.96318, 0.89713, 0.93704, 0.95638, 0.91905, 0.91709, 0.92796, 1.0258, 0.93704, 0.94836, 1.0373, 0.95933, 1.0078, 0.95871, 0.94836, 0.96174, 0.92601, 0.9498, 0.98607, 0.95776, 0.95933, 1.05453, 1.0078, 0.98275, 0.9314, 0.95617, 0.91701, 1.05993, 0.9446, 0.78367, 0.9553, 1, 0.86832, 1.0128, 0.95871, 0.99394, 0.87548, 0.96361, 0.86774, 1.0078, 0.95871, 0.9446, 0.95871, 0.86774, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.94083, 0.97579, 0.94083, 0.97579, 0.94083, 0.97579, 0.90406, 0.94039, 0.96694, 1, 0.89903, 1, 1, 1, 0.93582, 0.93582, 0.93582, 1, 0.908, 0.908, 0.918, 0.94219, 0.94219, 0.96544, 1, 1.285, 1, 1, 0.81079, 0.81079, 1, 1, 0.74854, 1, 1, 1, 1, 0.99793, 1, 1, 1, 0.65, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.17173, 1, 0.80535, 0.76169, 1.02058, 1.0732, 1.05486, 1, 1, 1.30692, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.16161, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], iL = { lineHeight: 1.2, lineGap: 0.2 }, nL = [1.36898, 1, 1, 0.66227, 0.80779, 0.81625, 0.97276, 0.97276, 0.97733, 0.92222, 0.83266, 0.94292, 0.94292, 1.16148, 1.02058, 0.93582, 0.96694, 0.93582, 1.17337, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.97276, 0.78076, 0.78076, 1.02058, 1.02058, 1.02058, 0.71541, 0.76813, 0.85576, 0.80591, 0.80729, 0.94299, 0.77512, 0.83655, 0.86523, 0.92222, 0.98621, 0.71743, 0.81698, 0.79726, 0.98558, 0.92222, 0.90637, 0.83809, 0.90637, 0.80729, 0.76463, 0.86275, 0.90699, 0.91605, 0.9154, 0.85308, 0.85458, 0.90531, 0.94292, 1.21296, 0.94292, 1.02058, 0.89903, 1.18616, 0.99613, 0.91677, 0.78216, 0.91677, 0.90083, 0.98796, 0.9135, 0.92168, 0.95381, 0.98981, 0.95298, 0.95381, 0.93459, 0.92168, 0.91513, 0.92004, 0.91677, 0.95077, 0.748, 1.04502, 0.91677, 0.92061, 0.94236, 0.89544, 0.89364, 0.9, 0.80687, 0.8578, 0.80687, 1.02058, 0.80779, 0.97276, 0.97276, 0.97276, 0.97276, 0.8578, 0.99973, 1.18616, 0.91339, 1.08074, 0.82891, 1.02058, 0.55509, 0.71526, 0.89022, 1.08595, 1, 1, 1.18616, 1, 0.96736, 0.93582, 1.18616, 1, 1.04864, 0.82711, 0.99043, 0.99043, 0.99043, 0.71541, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.85576, 0.845, 0.80729, 0.77512, 0.77512, 0.77512, 0.77512, 0.98621, 0.98621, 0.98621, 0.98621, 0.95961, 0.92222, 0.90637, 0.90637, 0.90637, 0.90637, 0.90637, 1.02058, 0.90251, 0.90699, 0.90699, 0.90699, 0.90699, 0.85458, 0.83659, 0.94951, 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.99613, 0.85811, 0.78216, 0.90083, 0.90083, 0.90083, 0.90083, 0.95381, 0.95381, 0.95381, 0.95381, 0.9135, 0.92168, 0.91513, 0.91513, 0.91513, 0.91513, 0.91513, 1.08595, 0.91677, 0.91677, 0.91677, 0.91677, 0.91677, 0.89364, 0.92332, 0.89364, 0.85576, 0.99613, 0.85576, 0.99613, 0.85576, 0.99613, 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, 0.78216, 0.80729, 0.78216, 0.94299, 0.76783, 0.95961, 0.91677, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.77512, 0.90083, 0.86523, 0.9135, 0.86523, 0.9135, 0.86523, 0.9135, 1, 1, 0.92222, 0.92168, 0.92222, 0.92168, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.98621, 0.95381, 0.86036, 0.97096, 0.71743, 0.98981, 1, 1, 0.95298, 0.79726, 0.95381, 1, 1, 0.79726, 0.6894, 0.79726, 0.74321, 0.81691, 1.0006, 0.92222, 0.92168, 1, 1, 0.92222, 0.92168, 0.79464, 0.92098, 0.92168, 0.90637, 0.91513, 0.90637, 0.91513, 0.90637, 0.91513, 0.909, 0.87514, 0.80729, 0.95077, 1, 1, 0.80729, 0.95077, 0.76463, 0.748, 0.76463, 0.748, 1, 1, 0.76463, 0.748, 1, 1, 0.86275, 0.72651, 0.86275, 1.04502, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.90699, 0.91677, 0.9154, 0.94236, 0.85458, 0.89364, 0.85458, 0.90531, 0.9, 0.90531, 0.9, 0.90531, 0.9, 1, 0.97276, 0.85576, 0.99613, 0.845, 0.85811, 0.90251, 0.91677, 1, 1, 0.86275, 1.04502, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.18616, 1.00899, 1.30628, 0.85576, 0.80178, 0.66862, 0.7927, 0.69323, 0.88127, 0.72459, 0.89711, 0.95381, 0.85576, 0.80591, 0.7805, 0.94729, 0.77512, 0.90531, 0.92222, 0.90637, 0.98621, 0.81698, 0.92655, 0.98558, 0.92222, 0.85359, 0.90637, 0.90976, 0.83809, 0.94523, 0.86275, 0.83509, 0.93157, 0.85308, 0.83392, 0.92346, 0.98621, 0.83509, 0.92886, 0.91324, 0.92168, 0.95381, 0.90646, 0.92886, 0.90557, 0.86847, 0.90276, 0.91324, 0.86842, 0.92168, 0.99531, 0.95381, 0.9224, 0.85408, 0.92699, 0.86847, 1.0051, 0.91513, 0.80487, 0.93481, 1, 0.88159, 1.05214, 0.90646, 0.97355, 0.81539, 0.89398, 0.85923, 0.95381, 0.90646, 0.91513, 0.90646, 0.85923, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9154, 0.94236, 0.9154, 0.94236, 0.9154, 0.94236, 0.85458, 0.89364, 0.96694, 1, 0.89903, 1, 1, 1, 0.91782, 0.91782, 0.91782, 1, 0.896, 0.896, 0.896, 0.9332, 0.9332, 0.95973, 1, 1.26, 1, 1, 0.80479, 0.80178, 1, 1, 0.85633, 1, 1, 1, 1, 0.97276, 1, 1, 1, 0.698, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.14542, 1, 0.79199, 0.78694, 1.02058, 1.03493, 1.05486, 1, 1, 1.23026, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.20006, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], sL = { lineHeight: 1.2, lineGap: 0.2 }, rL = [1.36898, 1, 1, 0.65507, 0.84943, 0.85639, 0.88465, 0.88465, 0.86936, 0.88307, 0.86948, 0.85283, 0.85283, 1.06383, 1.02058, 0.75945, 0.9219, 0.75945, 1.17337, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.88465, 0.75945, 0.75945, 1.02058, 1.02058, 1.02058, 0.69046, 0.70926, 0.85158, 0.77812, 0.76852, 0.89591, 0.70466, 0.76125, 0.80094, 0.86822, 0.83864, 0.728, 0.77212, 0.79475, 0.93637, 0.87514, 0.8588, 0.76013, 0.8588, 0.72421, 0.69866, 0.77598, 0.85991, 0.80811, 0.87832, 0.78112, 0.77512, 0.8562, 1.0222, 1.18417, 1.0222, 1.27014, 0.89903, 1.15012, 0.93859, 0.94399, 0.846, 0.94399, 0.81453, 1.0186, 0.94219, 0.96017, 1.03075, 1.02175, 0.912, 1.03075, 0.96998, 0.96017, 0.93859, 0.94399, 0.94399, 0.95493, 0.746, 1.12658, 0.94578, 0.91, 0.979, 0.882, 0.882, 0.83, 0.85034, 0.83537, 0.85034, 1.02058, 0.70869, 0.88465, 0.88465, 0.88465, 0.88465, 0.83537, 0.90083, 1.15012, 0.9161, 0.94565, 0.73541, 1.02058, 0.53609, 0.69353, 0.79519, 1.08595, 1, 1, 1.15012, 1, 0.91974, 0.75945, 1.15012, 1, 0.9446, 0.73361, 0.9005, 0.9005, 0.9005, 0.62864, 0.85158, 0.85158, 0.85158, 0.85158, 0.85158, 0.85158, 0.773, 0.76852, 0.70466, 0.70466, 0.70466, 0.70466, 0.83864, 0.83864, 0.83864, 0.83864, 0.90561, 0.87514, 0.8588, 0.8588, 0.8588, 0.8588, 0.8588, 1.02058, 0.85751, 0.85991, 0.85991, 0.85991, 0.85991, 0.77512, 0.76013, 0.88075, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 0.8075, 0.846, 0.81453, 0.81453, 0.81453, 0.81453, 0.82424, 0.82424, 0.82424, 0.82424, 0.9278, 0.96017, 0.93859, 0.93859, 0.93859, 0.93859, 0.93859, 1.08595, 0.8562, 0.94578, 0.94578, 0.94578, 0.94578, 0.882, 0.94578, 0.882, 0.85158, 0.93859, 0.85158, 0.93859, 0.85158, 0.93859, 0.76852, 0.846, 0.76852, 0.846, 0.76852, 0.846, 0.76852, 0.846, 0.89591, 0.8544, 0.90561, 0.94399, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.70466, 0.81453, 0.80094, 0.94219, 0.80094, 0.94219, 0.80094, 0.94219, 1, 1, 0.86822, 0.96017, 0.86822, 0.96017, 0.83864, 0.82424, 0.83864, 0.82424, 0.83864, 0.82424, 0.83864, 1.03075, 0.83864, 0.82424, 0.81402, 1.02738, 0.728, 1.02175, 1, 1, 0.912, 0.79475, 1.03075, 1, 1, 0.79475, 0.83911, 0.79475, 0.66266, 0.80553, 1.06676, 0.87514, 0.96017, 1, 1, 0.87514, 0.96017, 0.86865, 0.87396, 0.96017, 0.8588, 0.93859, 0.8588, 0.93859, 0.8588, 0.93859, 0.867, 0.84759, 0.72421, 0.95493, 1, 1, 0.72421, 0.95493, 0.69866, 0.746, 0.69866, 0.746, 1, 1, 0.69866, 0.746, 1, 1, 0.77598, 0.88417, 0.77598, 1.12658, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.85991, 0.94578, 0.87832, 0.979, 0.77512, 0.882, 0.77512, 0.8562, 0.83, 0.8562, 0.83, 0.8562, 0.83, 1, 0.88465, 0.85158, 0.93859, 0.773, 0.8075, 0.85751, 0.8562, 1, 1, 0.77598, 1.12658, 1.15012, 1.15012, 1.15012, 1.15012, 1.15012, 1.15313, 1.15012, 1.15012, 1.15012, 1.08106, 1.03901, 0.85158, 0.77025, 0.62264, 0.7646, 0.65351, 0.86026, 0.69461, 0.89947, 1.03075, 0.85158, 0.77812, 0.76449, 0.88836, 0.70466, 0.8562, 0.86822, 0.8588, 0.83864, 0.77212, 0.85308, 0.93637, 0.87514, 0.82352, 0.8588, 0.85701, 0.76013, 0.89058, 0.77598, 0.8156, 0.82565, 0.78112, 0.77899, 0.89386, 0.83864, 0.8156, 0.9486, 0.92388, 0.96186, 1.03075, 0.91123, 0.9486, 0.93298, 0.878, 0.93942, 0.92388, 0.84596, 0.96186, 0.95119, 1.03075, 0.922, 0.88787, 0.95829, 0.88, 0.93559, 0.93859, 0.78815, 0.93758, 1, 0.89217, 1.03737, 0.91123, 0.93969, 0.77487, 0.85769, 0.86799, 1.03075, 0.91123, 0.93859, 0.91123, 0.86799, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.87832, 0.979, 0.87832, 0.979, 0.87832, 0.979, 0.77512, 0.882, 0.9219, 1, 0.89903, 1, 1, 1, 0.87321, 0.87321, 0.87321, 1, 1.027, 1.027, 1.027, 0.86847, 0.86847, 0.79121, 1, 1.124, 1, 1, 0.73572, 0.73572, 1, 1, 0.85034, 1, 1, 1, 1, 0.88465, 1, 1, 1, 0.669, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.04828, 1, 0.74948, 0.75187, 1.02058, 0.98391, 1.02119, 1, 1, 1.06233, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05233, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], aL = { lineHeight: 1.2, lineGap: 0.2 }, oL = [1.36898, 1, 1, 0.76305, 0.82784, 0.94935, 0.89364, 0.92241, 0.89073, 0.90706, 0.98472, 0.85283, 0.85283, 1.0664, 1.02058, 0.74505, 0.9219, 0.74505, 1.23456, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.92241, 0.74505, 0.74505, 1.02058, 1.02058, 1.02058, 0.73002, 0.72601, 0.91755, 0.8126, 0.80314, 0.92222, 0.73764, 0.79726, 0.83051, 0.90284, 0.86023, 0.74, 0.8126, 0.84869, 0.96518, 0.91115, 0.8858, 0.79761, 0.8858, 0.74498, 0.73914, 0.81363, 0.89591, 0.83659, 0.89633, 0.85608, 0.8111, 0.90531, 1.0222, 1.22736, 1.0222, 1.27014, 0.89903, 0.90088, 0.86667, 1.0231, 0.896, 1.01411, 0.90083, 1.05099, 1.00512, 0.99793, 1.05326, 1.09377, 0.938, 1.06226, 1.00119, 0.99793, 0.98714, 1.0231, 1.01231, 0.98196, 0.792, 1.19137, 0.99074, 0.962, 1.01915, 0.926, 0.942, 0.856, 0.85034, 0.92006, 0.85034, 1.02058, 0.69067, 0.92241, 0.92241, 0.92241, 0.92241, 0.92006, 0.9332, 0.90088, 0.91882, 0.93484, 0.75339, 1.02058, 0.56866, 0.54324, 0.79519, 1.08595, 1, 1, 0.90088, 1, 0.95325, 0.74505, 0.90088, 1, 0.97198, 0.75339, 0.91009, 0.91009, 0.91009, 0.66466, 0.91755, 0.91755, 0.91755, 0.91755, 0.91755, 0.91755, 0.788, 0.80314, 0.73764, 0.73764, 0.73764, 0.73764, 0.86023, 0.86023, 0.86023, 0.86023, 0.92915, 0.91115, 0.8858, 0.8858, 0.8858, 0.8858, 0.8858, 1.02058, 0.8858, 0.89591, 0.89591, 0.89591, 0.89591, 0.8111, 0.79611, 0.89713, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86667, 0.86936, 0.896, 0.90083, 0.90083, 0.90083, 0.90083, 0.84224, 0.84224, 0.84224, 0.84224, 0.97276, 0.99793, 0.98714, 0.98714, 0.98714, 0.98714, 0.98714, 1.08595, 0.89876, 0.99074, 0.99074, 0.99074, 0.99074, 0.942, 1.0231, 0.942, 0.91755, 0.86667, 0.91755, 0.86667, 0.91755, 0.86667, 0.80314, 0.896, 0.80314, 0.896, 0.80314, 0.896, 0.80314, 0.896, 0.92222, 0.93372, 0.92915, 1.01411, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.73764, 0.90083, 0.83051, 1.00512, 0.83051, 1.00512, 0.83051, 1.00512, 1, 1, 0.90284, 0.99793, 0.90976, 0.99793, 0.86023, 0.84224, 0.86023, 0.84224, 0.86023, 0.84224, 0.86023, 1.05326, 0.86023, 0.84224, 0.82873, 1.07469, 0.74, 1.09377, 1, 1, 0.938, 0.84869, 1.06226, 1, 1, 0.84869, 0.83704, 0.84869, 0.81441, 0.85588, 1.08927, 0.91115, 0.99793, 1, 1, 0.91115, 0.99793, 0.91887, 0.90991, 0.99793, 0.8858, 0.98714, 0.8858, 0.98714, 0.8858, 0.98714, 0.894, 0.91434, 0.74498, 0.98196, 1, 1, 0.74498, 0.98196, 0.73914, 0.792, 0.73914, 0.792, 1, 1, 0.73914, 0.792, 1, 1, 0.81363, 0.904, 0.81363, 1.19137, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89591, 0.99074, 0.89633, 1.01915, 0.8111, 0.942, 0.8111, 0.90531, 0.856, 0.90531, 0.856, 0.90531, 0.856, 1, 0.92241, 0.91755, 0.86667, 0.788, 0.86936, 0.8858, 0.89876, 1, 1, 0.81363, 1.19137, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90088, 0.90388, 1.03901, 0.92138, 0.78105, 0.7154, 0.86169, 0.80513, 0.94007, 0.82528, 0.98612, 1.06226, 0.91755, 0.8126, 0.81884, 0.92819, 0.73764, 0.90531, 0.90284, 0.8858, 0.86023, 0.8126, 0.91172, 0.96518, 0.91115, 0.83089, 0.8858, 0.87791, 0.79761, 0.89297, 0.81363, 0.88157, 0.89992, 0.85608, 0.81992, 0.94307, 0.86023, 0.88157, 0.95308, 0.98699, 0.99793, 1.06226, 0.95817, 0.95308, 0.97358, 0.928, 0.98088, 0.98699, 0.92761, 0.99793, 0.96017, 1.06226, 0.986, 0.944, 0.95978, 0.938, 0.96705, 0.98714, 0.80442, 0.98972, 1, 0.89762, 1.04552, 0.95817, 0.99007, 0.87064, 0.91879, 0.88888, 1.06226, 0.95817, 0.98714, 0.95817, 0.88888, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.89633, 1.01915, 0.89633, 1.01915, 0.89633, 1.01915, 0.8111, 0.942, 0.9219, 1, 0.89903, 1, 1, 1, 0.93173, 0.93173, 0.93173, 1, 1.06304, 1.06304, 1.06904, 0.89903, 0.89903, 0.80549, 1, 1.156, 1, 1, 0.76575, 0.76575, 1, 1, 0.72458, 1, 1, 1, 1, 0.92241, 1, 1, 1, 0.619, 1, 1.36145, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.07257, 1, 0.74705, 0.71119, 1.02058, 1.024, 1.02119, 1, 1, 1.1536, 1.08595, 1.08595, 1, 1.08595, 1.08595, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.05638, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], lL = { lineHeight: 1.2, lineGap: 0.2 }, cL = [1.76738, 1, 1, 0.99297, 0.9824, 1.04016, 1.06497, 1.03424, 0.97529, 1.17647, 1.23203, 1.1085, 1.1085, 1.16939, 1.2107, 0.9754, 1.21408, 0.9754, 1.59578, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 1.03424, 0.81378, 0.81378, 1.2107, 1.2107, 1.2107, 0.71703, 0.97847, 0.97363, 0.88776, 0.8641, 1.02096, 0.79795, 0.85132, 0.914, 1.06085, 1.1406, 0.8007, 0.89858, 0.83693, 1.14889, 1.09398, 0.97489, 0.92094, 0.97489, 0.90399, 0.84041, 0.95923, 1.00135, 1, 1.06467, 0.98243, 0.90996, 0.99361, 1.1085, 1.56942, 1.1085, 1.2107, 0.74627, 0.94282, 0.96752, 1.01519, 0.86304, 1.01359, 0.97278, 1.15103, 1.01359, 0.98561, 1.02285, 1.02285, 1.00527, 1.02285, 1.0302, 0.99041, 1.0008, 1.01519, 1.01359, 1.02258, 0.79104, 1.16862, 0.99041, 0.97454, 1.02511, 0.99298, 0.96752, 0.95801, 0.94856, 1.16579, 0.94856, 1.2107, 0.9824, 1.03424, 1.03424, 1, 1.03424, 1.16579, 0.8727, 1.3871, 1.18622, 1.10818, 1.04478, 1.2107, 1.18622, 0.75155, 0.94994, 1.28826, 1.21408, 1.21408, 0.91056, 1, 0.91572, 0.9754, 0.64663, 1.18328, 1.24866, 1.04478, 1.14169, 1.15749, 1.17389, 0.71703, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.93506, 0.8641, 0.79795, 0.79795, 0.79795, 0.79795, 1.1406, 1.1406, 1.1406, 1.1406, 1.02096, 1.09398, 0.97426, 0.97426, 0.97426, 0.97426, 0.97426, 1.2107, 0.97489, 1.00135, 1.00135, 1.00135, 1.00135, 0.90996, 0.92094, 1.02798, 0.96752, 0.96752, 0.96752, 0.96752, 0.96752, 0.96752, 0.93136, 0.86304, 0.97278, 0.97278, 0.97278, 0.97278, 1.02285, 1.02285, 1.02285, 1.02285, 0.97122, 0.99041, 1, 1, 1, 1, 1, 1.28826, 1.0008, 0.99041, 0.99041, 0.99041, 0.99041, 0.96752, 1.01519, 0.96752, 0.97363, 0.96752, 0.97363, 0.96752, 0.97363, 0.96752, 0.8641, 0.86304, 0.8641, 0.86304, 0.8641, 0.86304, 0.8641, 0.86304, 1.02096, 1.03057, 1.02096, 1.03517, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.79795, 0.97278, 0.914, 1.01359, 0.914, 1.01359, 0.914, 1.01359, 1, 1, 1.06085, 0.98561, 1.06085, 1.00879, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 1.1406, 1.02285, 0.97138, 1.08692, 0.8007, 1.02285, 1, 1, 1.00527, 0.83693, 1.02285, 1, 1, 0.83693, 0.9455, 0.83693, 0.90418, 0.83693, 1.13005, 1.09398, 0.99041, 1, 1, 1.09398, 0.99041, 0.96692, 1.09251, 0.99041, 0.97489, 1.0008, 0.97489, 1.0008, 0.97489, 1.0008, 0.93994, 0.97931, 0.90399, 1.02258, 1, 1, 0.90399, 1.02258, 0.84041, 0.79104, 0.84041, 0.79104, 0.84041, 0.79104, 0.84041, 0.79104, 1, 1, 0.95923, 1.07034, 0.95923, 1.16862, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.00135, 0.99041, 1.06467, 1.02511, 0.90996, 0.96752, 0.90996, 0.99361, 0.95801, 0.99361, 0.95801, 0.99361, 0.95801, 1.07733, 1.03424, 0.97363, 0.96752, 0.93506, 0.93136, 0.97489, 1.0008, 1, 1, 0.95923, 1.16862, 1.15103, 1.15103, 1.01173, 1.03959, 0.75953, 0.81378, 0.79912, 1.15103, 1.21994, 0.95161, 0.87815, 1.01149, 0.81525, 0.7676, 0.98167, 1.01134, 1.02546, 0.84097, 1.03089, 1.18102, 0.97363, 0.88776, 0.85134, 0.97826, 0.79795, 0.99361, 1.06085, 0.97489, 1.1406, 0.89858, 1.0388, 1.14889, 1.09398, 0.86039, 0.97489, 1.0595, 0.92094, 0.94793, 0.95923, 0.90996, 0.99346, 0.98243, 1.02112, 0.95493, 1.1406, 0.90996, 1.03574, 1.02597, 1.0008, 1.18102, 1.06628, 1.03574, 1.0192, 1.01932, 1.00886, 0.97531, 1.0106, 1.0008, 1.13189, 1.18102, 1.02277, 0.98683, 1.0016, 0.99561, 1.07237, 1.0008, 0.90434, 0.99921, 0.93803, 0.8965, 1.23085, 1.06628, 1.04983, 0.96268, 1.0499, 0.98439, 1.18102, 1.06628, 1.0008, 1.06628, 0.98439, 0.79795, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.09466, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.97278, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.02065, 1, 1, 1, 1, 1, 1, 1.06467, 1.02511, 1.06467, 1.02511, 1.06467, 1.02511, 0.90996, 0.96752, 1, 1.21408, 0.89903, 1, 1, 0.75155, 1.04394, 1.04394, 1.04394, 1.04394, 0.98633, 0.98633, 0.98633, 0.73047, 0.73047, 1.20642, 0.91211, 1.25635, 1.222, 1.02956, 1.03372, 1.03372, 0.96039, 1.24633, 1, 1.12454, 0.93503, 1.03424, 1.19687, 1.03424, 1, 1, 1, 0.771, 1, 1, 1.15749, 1.15749, 1.15749, 1.10948, 0.86279, 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.16897, 1, 0.96085, 0.90137, 1.2107, 1.18416, 1.13973, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21172, 1.29004, 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18874, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.09193, 1.09193, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], hL = { lineHeight: 1.33008, lineGap: 0 }, uL = [1.76738, 1, 1, 0.98946, 1.03959, 1.04016, 1.02809, 1.036, 0.97639, 1.10953, 1.23203, 1.11144, 1.11144, 1.16939, 1.21237, 0.9754, 1.21261, 0.9754, 1.59754, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 1.036, 0.81378, 0.81378, 1.21237, 1.21237, 1.21237, 0.73541, 0.97847, 0.97363, 0.89723, 0.87897, 1.0426, 0.79429, 0.85292, 0.91149, 1.05815, 1.1406, 0.79631, 0.90128, 0.83853, 1.04396, 1.10615, 0.97552, 0.94436, 0.97552, 0.88641, 0.80527, 0.96083, 1.00135, 1, 1.06777, 0.9817, 0.91142, 0.99361, 1.11144, 1.57293, 1.11144, 1.21237, 0.74627, 1.31818, 1.06585, 0.97042, 0.83055, 0.97042, 0.93503, 1.1261, 0.97042, 0.97922, 1.14236, 0.94552, 1.01054, 1.14236, 1.02471, 0.97922, 0.94165, 0.97042, 0.97042, 1.0276, 0.78929, 1.1261, 0.97922, 0.95874, 1.02197, 0.98507, 0.96752, 0.97168, 0.95107, 1.16579, 0.95107, 1.21237, 1.03959, 1.036, 1.036, 1, 1.036, 1.16579, 0.87357, 1.31818, 1.18754, 1.26781, 1.05356, 1.21237, 1.18622, 0.79487, 0.94994, 1.29004, 1.24047, 1.24047, 1.31818, 1, 0.91484, 0.9754, 1.31818, 1.1349, 1.24866, 1.05356, 1.13934, 1.15574, 1.17389, 0.73541, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.97363, 0.94385, 0.87897, 0.79429, 0.79429, 0.79429, 0.79429, 1.1406, 1.1406, 1.1406, 1.1406, 1.0426, 1.10615, 0.97552, 0.97552, 0.97552, 0.97552, 0.97552, 1.21237, 0.97552, 1.00135, 1.00135, 1.00135, 1.00135, 0.91142, 0.94436, 0.98721, 1.06585, 1.06585, 1.06585, 1.06585, 1.06585, 1.06585, 0.96705, 0.83055, 0.93503, 0.93503, 0.93503, 0.93503, 1.14236, 1.14236, 1.14236, 1.14236, 0.93125, 0.97922, 0.94165, 0.94165, 0.94165, 0.94165, 0.94165, 1.29004, 0.94165, 0.97922, 0.97922, 0.97922, 0.97922, 0.96752, 0.97042, 0.96752, 0.97363, 1.06585, 0.97363, 1.06585, 0.97363, 1.06585, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, 0.83055, 0.87897, 0.83055, 1.0426, 1.0033, 1.0426, 0.97042, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.79429, 0.93503, 0.91149, 0.97042, 0.91149, 0.97042, 0.91149, 0.97042, 1, 1, 1.05815, 0.97922, 1.05815, 0.97922, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 1.1406, 1.14236, 0.97441, 1.04302, 0.79631, 1.01582, 1, 1, 1.01054, 0.83853, 1.14236, 1, 1, 0.83853, 1.09125, 0.83853, 0.90418, 0.83853, 1.19508, 1.10615, 0.97922, 1, 1, 1.10615, 0.97922, 1.01034, 1.10466, 0.97922, 0.97552, 0.94165, 0.97552, 0.94165, 0.97552, 0.94165, 0.91602, 0.91981, 0.88641, 1.0276, 1, 1, 0.88641, 1.0276, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, 0.78929, 0.80527, 0.78929, 1, 1, 0.96083, 1.05403, 0.95923, 1.16862, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.00135, 0.97922, 1.06777, 1.02197, 0.91142, 0.96752, 0.91142, 0.99361, 0.97168, 0.99361, 0.97168, 0.99361, 0.97168, 1.23199, 1.036, 0.97363, 1.06585, 0.94385, 0.96705, 0.97552, 0.94165, 1, 1, 0.96083, 1.1261, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 1.31818, 0.95161, 1.27126, 1.00811, 0.83284, 0.77702, 0.99137, 0.95253, 1.0347, 0.86142, 1.07205, 1.14236, 0.97363, 0.89723, 0.86869, 1.09818, 0.79429, 0.99361, 1.05815, 0.97552, 1.1406, 0.90128, 1.06662, 1.04396, 1.10615, 0.84918, 0.97552, 1.04694, 0.94436, 0.98015, 0.96083, 0.91142, 1.00356, 0.9817, 1.01945, 0.98999, 1.1406, 0.91142, 1.04961, 0.9898, 1.00639, 1.14236, 1.07514, 1.04961, 0.99607, 1.02897, 1.008, 0.9898, 0.95134, 1.00639, 1.11121, 1.14236, 1.00518, 0.97981, 1.02186, 1, 1.08578, 0.94165, 0.99314, 0.98387, 0.93028, 0.93377, 1.35125, 1.07514, 1.10687, 0.93491, 1.04232, 1.00351, 1.14236, 1.07514, 0.94165, 1.07514, 1.00351, 0.79429, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.09097, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.93503, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.96609, 1, 1, 1, 1, 1, 1, 1.06777, 1.02197, 1.06777, 1.02197, 1.06777, 1.02197, 0.91142, 0.96752, 1, 1.21261, 0.89903, 1, 1, 0.75155, 1.04745, 1.04745, 1.04745, 1.04394, 0.98633, 0.98633, 0.98633, 0.72959, 0.72959, 1.20502, 0.91406, 1.26514, 1.222, 1.02956, 1.03372, 1.03372, 0.96039, 1.24633, 1, 1.09125, 0.93327, 1.03336, 1.16541, 1.036, 1, 1, 1, 0.771, 1, 1, 1.15574, 1.15574, 1.15574, 1.15574, 0.86364, 0.94434, 0.86279, 0.94434, 0.86224, 1, 1, 1.16798, 1, 0.96085, 0.90068, 1.21237, 1.18416, 1.13904, 0.69825, 0.9716, 2.10339, 1.29004, 1.29004, 1.21339, 1.29004, 1.29004, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18775, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.13269, 1.13269, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], dL = { lineHeight: 1.33008, lineGap: 0 }, fL = [1.76738, 1, 1, 0.98946, 1.14763, 1.05365, 1.06234, 0.96927, 0.92586, 1.15373, 1.18414, 0.91349, 0.91349, 1.07403, 1.17308, 0.78383, 1.20088, 0.78383, 1.42531, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.78383, 0.78383, 1.17308, 1.17308, 1.17308, 0.77349, 0.94565, 0.94729, 0.85944, 0.88506, 0.9858, 0.74817, 0.80016, 0.88449, 0.98039, 0.95782, 0.69238, 0.89898, 0.83231, 0.98183, 1.03989, 0.96924, 0.86237, 0.96924, 0.80595, 0.74524, 0.86091, 0.95402, 0.94143, 0.98448, 0.8858, 0.83089, 0.93285, 1.0949, 1.39016, 1.0949, 1.45994, 0.74627, 1.04839, 0.97454, 0.97454, 0.87207, 0.97454, 0.87533, 1.06151, 0.97454, 1.00176, 1.16484, 1.08132, 0.98047, 1.16484, 1.02989, 1.01054, 0.96225, 0.97454, 0.97454, 1.06598, 0.79004, 1.16344, 1.00351, 0.94629, 0.9973, 0.91016, 0.96777, 0.9043, 0.91082, 0.92481, 0.91082, 1.17308, 0.95748, 0.96927, 0.96927, 1, 0.96927, 0.92481, 0.80597, 1.04839, 1.23393, 1.1781, 0.9245, 1.17308, 1.20808, 0.63218, 0.94261, 1.24822, 1.09971, 1.09971, 1.04839, 1, 0.85273, 0.78032, 1.04839, 1.09971, 1.22326, 0.9245, 1.09836, 1.13525, 1.15222, 0.70424, 0.94729, 0.94729, 0.94729, 0.94729, 0.94729, 0.94729, 0.85498, 0.88506, 0.74817, 0.74817, 0.74817, 0.74817, 0.95782, 0.95782, 0.95782, 0.95782, 0.9858, 1.03989, 0.96924, 0.96924, 0.96924, 0.96924, 0.96924, 1.17308, 0.96924, 0.95402, 0.95402, 0.95402, 0.95402, 0.83089, 0.86237, 0.88409, 0.97454, 0.97454, 0.97454, 0.97454, 0.97454, 0.97454, 0.92916, 0.87207, 0.87533, 0.87533, 0.87533, 0.87533, 0.93146, 0.93146, 0.93146, 0.93146, 0.93854, 1.01054, 0.96225, 0.96225, 0.96225, 0.96225, 0.96225, 1.24822, 0.8761, 1.00351, 1.00351, 1.00351, 1.00351, 0.96777, 0.97454, 0.96777, 0.94729, 0.97454, 0.94729, 0.97454, 0.94729, 0.97454, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, 0.87207, 0.88506, 0.87207, 0.9858, 0.95391, 0.9858, 0.97454, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.74817, 0.87533, 0.88449, 0.97454, 0.88449, 0.97454, 0.88449, 0.97454, 1, 1, 0.98039, 1.00176, 0.98039, 1.00176, 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 0.93146, 0.95782, 1.16484, 0.95782, 0.93146, 0.84421, 1.12761, 0.69238, 1.08132, 1, 1, 0.98047, 0.83231, 1.16484, 1, 1, 0.84723, 1.04861, 0.84723, 0.78755, 0.83231, 1.23736, 1.03989, 1.01054, 1, 1, 1.03989, 1.01054, 0.9857, 1.03849, 1.01054, 0.96924, 0.96225, 0.96924, 0.96225, 0.96924, 0.96225, 0.92383, 0.90171, 0.80595, 1.06598, 1, 1, 0.80595, 1.06598, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, 0.79004, 0.74524, 0.79004, 1, 1, 0.86091, 1.02759, 0.85771, 1.16344, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.95402, 1.00351, 0.98448, 0.9973, 0.83089, 0.96777, 0.83089, 0.93285, 0.9043, 0.93285, 0.9043, 0.93285, 0.9043, 1.31868, 0.96927, 0.94729, 0.97454, 0.85498, 0.92916, 0.96924, 0.8761, 1, 1, 0.86091, 1.16344, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 1.04839, 0.81965, 0.81965, 0.94729, 0.78032, 0.71022, 0.90883, 0.84171, 0.99877, 0.77596, 1.05734, 1.2, 0.94729, 0.85944, 0.82791, 0.9607, 0.74817, 0.93285, 0.98039, 0.96924, 0.95782, 0.89898, 0.98316, 0.98183, 1.03989, 0.78614, 0.96924, 0.97642, 0.86237, 0.86075, 0.86091, 0.83089, 0.90082, 0.8858, 0.97296, 1.01284, 0.95782, 0.83089, 1.0976, 1.04, 1.03342, 1.2, 1.0675, 1.0976, 0.98205, 1.03809, 1.05097, 1.04, 0.95364, 1.03342, 1.05401, 1.2, 1.02148, 1.0119, 1.04724, 1.0127, 1.02732, 0.96225, 0.8965, 0.97783, 0.93574, 0.94818, 1.30679, 1.0675, 1.11826, 0.99821, 1.0557, 1.0326, 1.2, 1.0675, 0.96225, 1.0675, 1.0326, 0.74817, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.03754, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.87533, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.98705, 1, 1, 1, 1, 1, 1, 0.98448, 0.9973, 0.98448, 0.9973, 0.98448, 0.9973, 0.83089, 0.96777, 1, 1.20088, 0.89903, 1, 1, 0.75155, 0.94945, 0.94945, 0.94945, 0.94945, 1.12317, 1.12317, 1.12317, 0.67603, 0.67603, 1.15621, 0.73584, 1.21191, 1.22135, 1.06483, 0.94868, 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87709, 0.96927, 1.01473, 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.09836, 1.09836, 1.09836, 1.01522, 0.86321, 0.94434, 0.8649, 0.94434, 0.86182, 1, 1, 1.083, 1, 0.91578, 0.86438, 1.17308, 1.18416, 1.14589, 0.69825, 0.97622, 1.96791, 1.24822, 1.24822, 1.17308, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.17984, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.10742, 1.10742, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], pL = { lineHeight: 1.33008, lineGap: 0 }, mL = [1.76738, 1, 1, 0.98594, 1.02285, 1.10454, 1.06234, 0.96927, 0.92037, 1.19985, 1.2046, 0.90616, 0.90616, 1.07152, 1.1714, 0.78032, 1.20088, 0.78032, 1.40246, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.96927, 0.78032, 0.78032, 1.1714, 1.1714, 1.1714, 0.80597, 0.94084, 0.96706, 0.85944, 0.85734, 0.97093, 0.75842, 0.79936, 0.88198, 0.9831, 0.95782, 0.71387, 0.86969, 0.84636, 1.07796, 1.03584, 0.96924, 0.83968, 0.96924, 0.82826, 0.79649, 0.85771, 0.95132, 0.93119, 0.98965, 0.88433, 0.8287, 0.93365, 1.08612, 1.3638, 1.08612, 1.45786, 0.74627, 0.80499, 0.91484, 1.05707, 0.92383, 1.05882, 0.9403, 1.12654, 1.05882, 1.01756, 1.09011, 1.09011, 0.99414, 1.09011, 1.034, 1.01756, 1.05356, 1.05707, 1.05882, 1.04399, 0.84863, 1.21968, 1.01756, 0.95801, 1.00068, 0.91797, 0.96777, 0.9043, 0.90351, 0.92105, 0.90351, 1.1714, 0.85337, 0.96927, 0.96927, 0.99912, 0.96927, 0.92105, 0.80597, 1.2434, 1.20808, 1.05937, 0.90957, 1.1714, 1.20808, 0.75155, 0.94261, 1.24644, 1.09971, 1.09971, 0.84751, 1, 0.85273, 0.78032, 0.61584, 1.05425, 1.17914, 0.90957, 1.08665, 1.11593, 1.14169, 0.73381, 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.96706, 0.86035, 0.85734, 0.75842, 0.75842, 0.75842, 0.75842, 0.95782, 0.95782, 0.95782, 0.95782, 0.97093, 1.03584, 0.96924, 0.96924, 0.96924, 0.96924, 0.96924, 1.1714, 0.96924, 0.95132, 0.95132, 0.95132, 0.95132, 0.8287, 0.83968, 0.89049, 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.91484, 0.93575, 0.92383, 0.9403, 0.9403, 0.9403, 0.9403, 0.8717, 0.8717, 0.8717, 0.8717, 1.00527, 1.01756, 1.05356, 1.05356, 1.05356, 1.05356, 1.05356, 1.24644, 0.95923, 1.01756, 1.01756, 1.01756, 1.01756, 0.96777, 1.05707, 0.96777, 0.96706, 0.91484, 0.96706, 0.91484, 0.96706, 0.91484, 0.85734, 0.92383, 0.85734, 0.92383, 0.85734, 0.92383, 0.85734, 0.92383, 0.97093, 1.0969, 0.97093, 1.05882, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.75842, 0.9403, 0.88198, 1.05882, 0.88198, 1.05882, 0.88198, 1.05882, 1, 1, 0.9831, 1.01756, 0.9831, 1.01756, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782, 0.8717, 0.95782, 1.09011, 0.95782, 0.8717, 0.84784, 1.11551, 0.71387, 1.09011, 1, 1, 0.99414, 0.84636, 1.09011, 1, 1, 0.84636, 1.0536, 0.84636, 0.94298, 0.84636, 1.23297, 1.03584, 1.01756, 1, 1, 1.03584, 1.01756, 1.00323, 1.03444, 1.01756, 0.96924, 1.05356, 0.96924, 1.05356, 0.96924, 1.05356, 0.93066, 0.98293, 0.82826, 1.04399, 1, 1, 0.82826, 1.04399, 0.79649, 0.84863, 0.79649, 0.84863, 0.79649, 0.84863, 0.79649, 0.84863, 1, 1, 0.85771, 1.17318, 0.85771, 1.21968, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.95132, 1.01756, 0.98965, 1.00068, 0.8287, 0.96777, 0.8287, 0.93365, 0.9043, 0.93365, 0.9043, 0.93365, 0.9043, 1.08571, 0.96927, 0.96706, 0.91484, 0.86035, 0.93575, 0.96924, 0.95923, 1, 1, 0.85771, 1.21968, 1.11437, 1.11437, 0.93109, 0.91202, 0.60411, 0.84164, 0.55572, 1.01173, 0.97361, 0.81818, 0.81818, 0.96635, 0.78032, 0.72727, 0.92366, 0.98601, 1.03405, 0.77968, 1.09799, 1.2, 0.96706, 0.85944, 0.85638, 0.96491, 0.75842, 0.93365, 0.9831, 0.96924, 0.95782, 0.86969, 0.94152, 1.07796, 1.03584, 0.78437, 0.96924, 0.98715, 0.83968, 0.83491, 0.85771, 0.8287, 0.94492, 0.88433, 0.9287, 1.0098, 0.95782, 0.8287, 1.0625, 0.98248, 1.03424, 1.2, 1.01071, 1.0625, 0.95246, 1.03809, 1.04912, 0.98248, 1.00221, 1.03424, 1.05443, 1.2, 1.04785, 0.99609, 1.00169, 1.05176, 0.99346, 1.05356, 0.9087, 1.03004, 0.95542, 0.93117, 1.23362, 1.01071, 1.07831, 1.02512, 1.05205, 1.03502, 1.2, 1.01071, 1.05356, 1.01071, 1.03502, 0.75842, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.03719, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0.9403, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.04021, 1, 1, 1, 1, 1, 1, 0.98965, 1.00068, 0.98965, 1.00068, 0.98965, 1.00068, 0.8287, 0.96777, 1, 1.20088, 0.89903, 1, 1, 0.75155, 1.03077, 1.03077, 1.03077, 1.03077, 1.13196, 1.13196, 1.13196, 0.67428, 0.67428, 1.16039, 0.73291, 1.20996, 1.22135, 1.06483, 0.94868, 0.94868, 0.95996, 1.24633, 1, 1.07497, 0.87796, 0.96927, 1.01518, 0.96927, 1, 1, 1, 0.77295, 1, 1, 1.10539, 1.10539, 1.11358, 1.06967, 0.86279, 0.94434, 0.86279, 0.94434, 0.86182, 1, 1, 1.083, 1, 0.91578, 0.86507, 1.1714, 1.18416, 1.14589, 0.69825, 0.97622, 1.9697, 1.24822, 1.24822, 1.17238, 1.24822, 1.24822, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1.42603, 1, 0.99862, 0.99862, 1, 0.87025, 0.87025, 0.87025, 0.87025, 1.18083, 1.42603, 1, 1.42603, 1.42603, 0.99862, 1, 1, 1, 1, 1, 1.2886, 1.04315, 1.15296, 1.34163, 1, 1, 1, 1.10938, 1.10938, 1, 1, 1, 1.05425, 1.09971, 1.09971, 1.09971, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], gL = { lineHeight: 1.33008, lineGap: 0 }, bL = oi(function(i) {
  i["MyriadPro-Regular"] = i["PdfJS-Fallback-Regular"] = { name: "LiberationSans-Regular", factors: oL, baseWidths: Nf, baseMapping: Lf, metrics: lL }, i["MyriadPro-Bold"] = i["PdfJS-Fallback-Bold"] = { name: "LiberationSans-Bold", factors: eL, baseWidths: Ff, baseMapping: If, metrics: iL }, i["MyriadPro-It"] = i["MyriadPro-Italic"] = i["PdfJS-Fallback-Italic"] = { name: "LiberationSans-Italic", factors: rL, baseWidths: Bf, baseMapping: Pf, metrics: aL }, i["MyriadPro-BoldIt"] = i["MyriadPro-BoldItalic"] = i["PdfJS-Fallback-BoldItalic"] = { name: "LiberationSans-BoldItalic", factors: nL, baseWidths: Mf, baseMapping: Rf, metrics: sL }, i.ArialMT = i.Arial = i["Arial-Regular"] = { name: "LiberationSans-Regular", baseWidths: Nf, baseMapping: Lf }, i["Arial-BoldMT"] = i["Arial-Bold"] = { name: "LiberationSans-Bold", baseWidths: Ff, baseMapping: If }, i["Arial-ItalicMT"] = i["Arial-Italic"] = { name: "LiberationSans-Italic", baseWidths: Bf, baseMapping: Pf }, i["Arial-BoldItalicMT"] = i["Arial-BoldItalic"] = { name: "LiberationSans-BoldItalic", baseWidths: Mf, baseMapping: Rf }, i["Calibri-Regular"] = { name: "LiberationSans-Regular", factors: GN, baseWidths: Nf, baseMapping: Lf, metrics: VN }, i["Calibri-Bold"] = { name: "LiberationSans-Bold", factors: $N, baseWidths: Ff, baseMapping: If, metrics: qN }, i["Calibri-Italic"] = { name: "LiberationSans-Italic", factors: HN, baseWidths: Bf, baseMapping: Pf, metrics: jN }, i["Calibri-BoldItalic"] = { name: "LiberationSans-BoldItalic", factors: zN, baseWidths: Mf, baseMapping: Rf, metrics: UN }, i["Segoeui-Regular"] = { name: "LiberationSans-Regular", factors: mL, baseWidths: Nf, baseMapping: Lf, metrics: gL }, i["Segoeui-Bold"] = { name: "LiberationSans-Bold", factors: cL, baseWidths: Ff, baseMapping: If, metrics: hL }, i["Segoeui-Italic"] = { name: "LiberationSans-Italic", factors: fL, baseWidths: Bf, baseMapping: Pf, metrics: pL }, i["Segoeui-BoldItalic"] = { name: "LiberationSans-BoldItalic", factors: uL, baseWidths: Mf, baseMapping: Rf, metrics: dL }, i["Helvetica-Regular"] = i.Helvetica = { name: "LiberationSans-Regular", factors: QN, baseWidths: Nf, baseMapping: Lf, metrics: tL }, i["Helvetica-Bold"] = { name: "LiberationSans-Bold", factors: WN, baseWidths: Ff, baseMapping: If, metrics: XN }, i["Helvetica-Italic"] = { name: "LiberationSans-Italic", factors: ZN, baseWidths: Bf, baseMapping: Pf, metrics: JN }, i["Helvetica-BoldItalic"] = { name: "LiberationSans-BoldItalic", factors: YN, baseWidths: Mf, baseMapping: Rf, metrics: KN };
});
function iw(i) {
  const t = Sg(i);
  return bL()[t];
}
function AD(i) {
  const t = function(a) {
    const o = iw(a);
    if (!o) return null;
    const { baseWidths: l, baseMapping: c, factors: h } = o, u = h ? l.map((g, b) => g * h[b]) : l;
    let f, d = -2;
    const p = [];
    for (const [g, b] of c.map((y, v) => [y, v]).sort(([y], [v]) => y - v)) g !== -1 && (g === d + 1 ? (f.push(u[b]), d += 1) : (d = g, f = [u[b]], p.push(g, f)));
    return p;
  }(i), e = new Z(null);
  e.set("BaseFont", lt.get(i)), e.set("Type", lt.get("Font")), e.set("Subtype", lt.get("CIDFontType2")), e.set("Encoding", lt.get("Identity-H")), e.set("CIDToGIDMap", lt.get("Identity")), e.set("W", t), e.set("FirstChar", t[0]), e.set("LastChar", t.at(-2) + t.at(-1).length - 1);
  const n = new Z(null);
  e.set("FontDescriptor", n);
  const s = new Z(null);
  return s.set("Ordering", "Identity"), s.set("Registry", "Adobe"), s.set("Supplement", 0), e.set("CIDSystemInfo", s), e;
}
class yL {
  constructor(t) {
    this.lexer = t, this.operators = [], this.token = null, this.prev = null;
  }
  nextToken() {
    this.prev = this.token, this.token = this.lexer.getToken();
  }
  accept(t) {
    return this.token.type === t ? (this.nextToken(), !0) : !1;
  }
  expect(t) {
    if (this.accept(t)) return !0;
    throw new ht(`Unexpected symbol: found ${this.token.type} expected ${t}.`);
  }
  parse() {
    return this.nextToken(), this.expect(Wn.LBRACE), this.parseBlock(), this.expect(Wn.RBRACE), this.operators;
  }
  parseBlock() {
    for (; ; ) if (this.accept(Wn.NUMBER)) this.operators.push(this.prev.value);
    else if (this.accept(Wn.OPERATOR)) this.operators.push(this.prev.value);
    else {
      if (!this.accept(Wn.LBRACE)) return;
      this.parseCondition();
    }
  }
  parseCondition() {
    const t = this.operators.length;
    if (this.operators.push(null, null), this.parseBlock(), this.expect(Wn.RBRACE), this.accept(Wn.IF))
      this.operators[t] = this.operators.length, this.operators[t + 1] = "jz";
    else {
      if (!this.accept(Wn.LBRACE)) throw new ht("PS Function: error parsing conditional.");
      {
        const e = this.operators.length;
        this.operators.push(null, null);
        const n = this.operators.length;
        this.parseBlock(), this.expect(Wn.RBRACE), this.expect(Wn.IFELSE), this.operators[e] = this.operators.length, this.operators[e + 1] = "j", this.operators[t] = n, this.operators[t + 1] = "jz";
      }
    }
  }
}
const Wn = { LBRACE: 0, RBRACE: 1, NUMBER: 2, OPERATOR: 3, IF: 4, IFELSE: 5 };
class sr {
  static get opCache() {
    return At(this, "opCache", /* @__PURE__ */ Object.create(null));
  }
  constructor(t, e) {
    this.type = t, this.value = e;
  }
  static getOperator(t) {
    var e;
    return (e = sr.opCache)[t] || (e[t] = new sr(Wn.OPERATOR, t));
  }
  static get LBRACE() {
    return At(this, "LBRACE", new sr(Wn.LBRACE, "{"));
  }
  static get RBRACE() {
    return At(this, "RBRACE", new sr(Wn.RBRACE, "}"));
  }
  static get IF() {
    return At(this, "IF", new sr(Wn.IF, "IF"));
  }
  static get IFELSE() {
    return At(this, "IFELSE", new sr(Wn.IFELSE, "IFELSE"));
  }
}
class wL {
  constructor(t) {
    this.stream = t, this.nextChar(), this.strBuf = [];
  }
  nextChar() {
    return this.currentChar = this.stream.getByte();
  }
  getToken() {
    let t = !1, e = this.currentChar;
    for (; ; ) {
      if (e < 0) return fn;
      if (t) e !== 10 && e !== 13 || (t = !1);
      else if (e === 37) t = !0;
      else if (!or(e)) break;
      e = this.nextChar();
    }
    switch (0 | e) {
      case 48:
      case 49:
      case 50:
      case 51:
      case 52:
      case 53:
      case 54:
      case 55:
      case 56:
      case 57:
      case 43:
      case 45:
      case 46:
        return new sr(Wn.NUMBER, this.getNumber());
      case 123:
        return this.nextChar(), sr.LBRACE;
      case 125:
        return this.nextChar(), sr.RBRACE;
    }
    const n = this.strBuf;
    for (n.length = 0, n[0] = String.fromCharCode(e); (e = this.nextChar()) >= 0 && (e >= 65 && e <= 90 || e >= 97 && e <= 122); ) n.push(String.fromCharCode(e));
    const s = n.join("");
    switch (s.toLowerCase()) {
      case "if":
        return sr.IF;
      case "ifelse":
        return sr.IFELSE;
      default:
        return sr.getOperator(s);
    }
  }
  getNumber() {
    let t = this.currentChar;
    const e = this.strBuf;
    for (e.length = 0, e[0] = String.fromCharCode(t); (t = this.nextChar()) >= 0 && (t >= 48 && t <= 57 || t === 45 || t === 46); ) e.push(String.fromCharCode(t));
    const n = parseFloat(e.join(""));
    if (isNaN(n)) throw new ht(`Invalid floating point number: ${n}`);
    return n;
  }
}
class B1 {
  constructor(t) {
    this._onlyRefs = (t == null ? void 0 : t.onlyRefs) === !0, this._onlyRefs || (this._nameRefMap = /* @__PURE__ */ new Map(), this._imageMap = /* @__PURE__ */ new Map()), this._imageCache = new Ts();
  }
  getByName(t) {
    this._onlyRefs && ye("Should not call `getByName` method.");
    const e = this._nameRefMap.get(t);
    return e ? this.getByRef(e) : this._imageMap.get(t) || null;
  }
  getByRef(t) {
    return this._imageCache.get(t) || null;
  }
  set(t, e, n) {
    ye("Abstract method `set` called.");
  }
}
class W_ extends B1 {
  set(t, e = null, n) {
    if (typeof t != "string") throw new Error('LocalImageCache.set - expected "name" argument.');
    if (e) {
      if (this._imageCache.has(e)) return;
      this._nameRefMap.set(t, e), this._imageCache.put(e, n);
    } else this._imageMap.has(t) || this._imageMap.set(t, n);
  }
}
class SD extends B1 {
  set(t = null, e = null, n) {
    if (typeof t != "string" && !e) throw new Error('LocalColorSpaceCache.set - expected "name" and/or "ref" argument.');
    if (e) {
      if (this._imageCache.has(e)) return;
      t !== null && this._nameRefMap.set(t, e), this._imageCache.put(e, n);
    } else this._imageMap.has(t) || this._imageMap.set(t, n);
  }
}
class vL extends B1 {
  constructor(t) {
    super({ onlyRefs: !0 });
  }
  set(t = null, e, n) {
    if (!e) throw new Error('LocalFunctionCache.set - expected "ref" argument.');
    this._imageCache.has(e) || this._imageCache.put(e, n);
  }
}
class X_ extends B1 {
  set(t, e = null, n) {
    if (typeof t != "string") throw new Error('LocalGStateCache.set - expected "name" argument.');
    if (e) {
      if (this._imageCache.has(e)) return;
      this._nameRefMap.set(t, e), this._imageCache.put(e, n);
    } else this._imageMap.has(t) || this._imageMap.set(t, n);
  }
}
class _L extends B1 {
  constructor(t) {
    super({ onlyRefs: !0 });
  }
  set(t = null, e, n) {
    if (!e) throw new Error('LocalTilingPatternCache.set - expected "ref" argument.');
    this._imageCache.has(e) || this._imageCache.put(e, n);
  }
}
class xL extends B1 {
  constructor(t) {
    super({ onlyRefs: !0 });
  }
  set(t = null, e, n) {
    if (!e) throw new Error('RegionalImageCache.set - expected "ref" argument.');
    this._imageCache.has(e) || this._imageCache.put(e, n);
  }
}
class kL extends B1 {
  constructor(t) {
    super({ onlyRefs: !0 });
  }
  set(t = null, e, n) {
    if (!e) throw new Error('GlobalColorSpaceCache.set - expected "ref" argument.');
    this._imageCache.has(e) || this._imageCache.put(e, n);
  }
  clear() {
    this._imageCache.clear();
  }
}
var Vd, F1, CD, Cb;
const Ko = class Ko {
  constructor() {
    F(this, F1);
    F(this, Vd, new $i());
    this._refCache = new Ts(), this._imageCache = new Ts();
  }
  shouldCache(t, e) {
    let n = this._refCache.get(t);
    return n || (n = /* @__PURE__ */ new Set(), this._refCache.put(t, n)), n.add(e), !(n.size < Ko.NUM_PAGES_THRESHOLD) && !(!this._imageCache.has(t) && m(this, F1, Cb));
  }
  addDecodeFailed(t) {
    m(this, Vd).put(t);
  }
  hasDecodeFailed(t) {
    return m(this, Vd).has(t);
  }
  addByteSize(t, e) {
    const n = this._imageCache.get(t);
    n && (n.byteSize || (n.byteSize = e));
  }
  getData(t, e) {
    const n = this._refCache.get(t);
    if (!n || n.size < Ko.NUM_PAGES_THRESHOLD) return null;
    const s = this._imageCache.get(t);
    return s ? (n.add(e), s) : null;
  }
  setData(t, e) {
    if (!this._refCache.has(t)) throw new Error('GlobalImageCache.setData - expected "shouldCache" to have been called.');
    this._imageCache.has(t) || (m(this, F1, Cb) ? H("GlobalImageCache.setData - cache limit reached.") : this._imageCache.put(t, e));
  }
  clear(t = !1) {
    t || (m(this, Vd).clear(), this._refCache.clear()), this._imageCache.clear();
  }
};
Vd = new WeakMap(), F1 = new WeakSet(), CD = function() {
  let t = 0;
  for (const e of this._imageCache) t += e.byteSize;
  return t;
}, Cb = function() {
  return !(this._imageCache.size < Ko.MIN_IMAGES_TO_CACHE) && !(m(this, F1, CD) < Ko.MAX_BYTE_SIZE);
}, ft(Ko, "NUM_PAGES_THRESHOLD", 2), ft(Ko, "MIN_IMAGES_TO_CACHE", 10), ft(Ko, "MAX_BYTE_SIZE", 5e7);
let Sb = Ko;
class ED {
  constructor({ xref: t, isEvalSupported: e = !0 }) {
    this.xref = t, this.isEvalSupported = e !== !1;
  }
  create(t, e = !1) {
    var a;
    let n, s;
    if (t instanceof Dt ? n = t : t instanceof Z ? n = t.objId : t instanceof oe && (n = (a = t.dict) == null ? void 0 : a.objId), n) {
      const o = this._localFunctionCache.getByRef(n);
      if (o) return o;
    }
    const r = this.xref.fetchIfRef(t);
    if (Array.isArray(r)) {
      if (!e) throw new Error('PDFFunctionFactory.create - expected "parseArray" argument.');
      s = Y_.parseArray(this, r);
    } else s = Y_.parse(this, r);
    return n && this._localFunctionCache.set(null, n, s), s;
  }
  get _localFunctionCache() {
    return At(this, "_localFunctionCache", new vL());
  }
}
function mr(i) {
  return Array.isArray(i) ? cs(i, null) ? i : i.map((t) => +t) : null;
}
class Y_ {
  static getSampleArray(t, e, n, s) {
    let r, a, o = 1;
    for (r = 0, a = t.length; r < a; r++) o *= t[r];
    o *= e;
    const l = new Array(o);
    let c = 0, h = 0;
    const u = 1 / (2 ** n - 1), f = s.getBytes((o * n + 7) / 8);
    let d = 0;
    for (r = 0; r < o; r++) {
      for (; c < n; )
        h <<= 8, h |= f[d++], c += 8;
      c -= n, l[r] = (h >> c) * u, h &= (1 << c) - 1;
    }
    return l;
  }
  static parse(t, e) {
    const n = e.dict || e;
    switch (n.get("FunctionType")) {
      case 0:
        return this.constructSampled(t, e, n);
      case 1:
        break;
      case 2:
        return this.constructInterpolated(t, n);
      case 3:
        return this.constructStiched(t, n);
      case 4:
        return this.constructPostScript(t, e, n);
    }
    throw new ht("Unknown type of function");
  }
  static parseArray(t, e) {
    const { xref: n } = t, s = [];
    for (const r of e) s.push(this.parse(t, n.fetchIfRef(r)));
    return function(r, a, o, l) {
      for (let c = 0, h = s.length; c < h; c++) s[c](r, a, o, l + c);
    };
  }
  static constructSampled(t, e, n) {
    function s(b) {
      const y = b.length, v = [];
      let w = 0;
      for (let _ = 0; _ < y; _ += 2) v[w++] = [b[_], b[_ + 1]];
      return v;
    }
    function r(b, y, v, w, _) {
      return w + (_ - w) / (v - y) * (b - y);
    }
    let a = mr(n.getArray("Domain")), o = mr(n.getArray("Range"));
    if (!a || !o) throw new ht("No domain or range");
    const l = a.length / 2, c = o.length / 2;
    a = s(a), o = s(o);
    const h = mr(n.getArray("Size")), u = n.get("BitsPerSample"), f = n.get("Order") || 1;
    f !== 1 && ue("No support for cubic spline interpolation: " + f);
    let d = mr(n.getArray("Encode"));
    if (d) d = s(d);
    else {
      d = [];
      for (let b = 0; b < l; ++b) d.push([0, h[b] - 1]);
    }
    let p = mr(n.getArray("Decode"));
    p = p ? s(p) : o;
    const g = this.getSampleArray(h, c, u, e);
    return function(y, v, w, _) {
      const x = 1 << l, k = new Float64Array(x).fill(1), S = new Uint32Array(x);
      let T, I, R = c, B = 1;
      for (T = 0; T < l; ++T) {
        const L = a[T][0], it = a[T][1];
        let O = r(Tn(y[v + T], L, it), L, it, d[T][0], d[T][1]);
        const at = h[T];
        O = Tn(O, 0, at - 1);
        const W = O < at - 1 ? Math.floor(O) : O - 1, q = W + 1 - O, K = O - W, z = W * R, j = z + R;
        for (I = 0; I < x; I++) I & B ? (k[I] *= K, S[I] += j) : (k[I] *= q, S[I] += z);
        R *= at, B <<= 1;
      }
      for (I = 0; I < c; ++I) {
        let L = 0;
        for (T = 0; T < x; T++) L += g[S[T] + I] * k[T];
        L = r(L, 0, 1, p[I][0], p[I][1]), w[_ + I] = Tn(L, o[I][0], o[I][1]);
      }
    };
  }
  static constructInterpolated(t, e) {
    const n = mr(e.getArray("C0")) || [0], s = mr(e.getArray("C1")) || [1], r = e.get("N"), a = [];
    for (let l = 0, c = n.length; l < c; ++l) a.push(s[l] - n[l]);
    const o = a.length;
    return function(c, h, u, f) {
      const d = r === 1 ? c[h] : c[h] ** r;
      for (let p = 0; p < o; ++p) u[f + p] = n[p] + d * a[p];
    };
  }
  static constructStiched(t, e) {
    const n = mr(e.getArray("Domain"));
    if (!n) throw new ht("No domain");
    if (n.length / 2 !== 1) throw new ht("Bad domain for stiched function");
    const { xref: s } = t, r = [];
    for (const c of e.get("Functions")) r.push(this.parse(t, s.fetchIfRef(c)));
    const a = mr(e.getArray("Bounds")), o = mr(e.getArray("Encode")), l = new Float32Array(1);
    return function(h, u, f, d) {
      const p = Tn(h[u], n[0], n[1]), g = a.length;
      let b;
      for (b = 0; b < g && !(p < a[b]); ++b) ;
      let y = n[0];
      b > 0 && (y = a[b - 1]);
      let v = n[1];
      b < a.length && (v = a[b]);
      const w = o[2 * b], _ = o[2 * b + 1];
      l[0] = y === v ? w : w + (p - y) * (_ - w) / (v - y), r[b](l, 0, f, d);
    };
  }
  static constructPostScript(t, e, n) {
    const s = mr(n.getArray("Domain")), r = mr(n.getArray("Range"));
    if (!s) throw new ht("No domain.");
    if (!r) throw new ht("No range.");
    const a = new wL(e), o = new yL(a).parse();
    if (t.isEvalSupported && Rs.isEvalSupported) {
      const p = new IL().compile(o, s, r);
      if (p) return new Function("src", "srcOffset", "dest", "destOffset", p);
    }
    ue("Unable to compile PS function");
    const l = r.length >> 1, c = s.length >> 1, h = new AL(o), u = /* @__PURE__ */ Object.create(null);
    let f = 8192;
    const d = new Float32Array(c);
    return function(g, b, y, v) {
      let w, _, x = "";
      const k = d;
      for (w = 0; w < c; w++)
        _ = g[b + w], k[w] = _, x += _ + "_";
      const S = u[x];
      if (S !== void 0) {
        y.set(S, v);
        return;
      }
      const T = new Float32Array(l), I = h.execute(k), R = I.length - l;
      for (w = 0; w < l; w++) {
        _ = I[R + w];
        let B = r[2 * w];
        _ < B ? _ = B : (B = r[2 * w + 1], _ > B && (_ = B)), T[w] = _;
      }
      f > 0 && (f--, u[x] = T), y.set(T, v);
    };
  }
}
function F6(i) {
  let t;
  if (i instanceof Z) t = i;
  else {
    if (!(i instanceof oe)) return !1;
    t = i.dict;
  }
  return t.has("FunctionType");
}
const X2 = class X2 {
  constructor(t) {
    this.stack = t ? Array.from(t) : [];
  }
  push(t) {
    if (this.stack.length >= X2.MAX_STACK_SIZE) throw new Error("PostScript function stack overflow.");
    this.stack.push(t);
  }
  pop() {
    if (this.stack.length <= 0) throw new Error("PostScript function stack underflow.");
    return this.stack.pop();
  }
  copy(t) {
    if (this.stack.length + t >= X2.MAX_STACK_SIZE) throw new Error("PostScript function stack overflow.");
    const e = this.stack;
    for (let n = e.length - t, s = t - 1; s >= 0; s--, n++) e.push(e[n]);
  }
  index(t) {
    this.push(this.stack[this.stack.length - t - 1]);
  }
  roll(t, e) {
    const n = this.stack, s = n.length - t, r = n.length - 1, a = s + (e - Math.floor(e / t) * t);
    for (let o = s, l = r; o < l; o++, l--) {
      const c = n[o];
      n[o] = n[l], n[l] = c;
    }
    for (let o = s, l = a - 1; o < l; o++, l--) {
      const c = n[o];
      n[o] = n[l], n[l] = c;
    }
    for (let o = a, l = r; o < l; o++, l--) {
      const c = n[o];
      n[o] = n[l], n[l] = c;
    }
  }
};
ft(X2, "MAX_STACK_SIZE", 100);
let Eb = X2;
class AL {
  constructor(t) {
    this.operators = t;
  }
  execute(t) {
    const e = new Eb(t);
    let n = 0;
    const s = this.operators, r = s.length;
    let a, o, l;
    for (; n < r; )
      if (a = s[n++], typeof a != "number") switch (a) {
        case "jz":
          l = e.pop(), o = e.pop(), o || (n = l);
          break;
        case "j":
          o = e.pop(), n = o;
          break;
        case "abs":
          o = e.pop(), e.push(Math.abs(o));
          break;
        case "add":
          l = e.pop(), o = e.pop(), e.push(o + l);
          break;
        case "and":
          l = e.pop(), o = e.pop(), typeof o == "boolean" && typeof l == "boolean" ? e.push(o && l) : e.push(o & l);
          break;
        case "atan":
          l = e.pop(), o = e.pop(), o = Math.atan2(o, l) / Math.PI * 180, o < 0 && (o += 360), e.push(o);
          break;
        case "bitshift":
          l = e.pop(), o = e.pop(), o > 0 ? e.push(o << l) : e.push(o >> l);
          break;
        case "ceiling":
          o = e.pop(), e.push(Math.ceil(o));
          break;
        case "copy":
          o = e.pop(), e.copy(o);
          break;
        case "cos":
          o = e.pop(), e.push(Math.cos(o % 360 / 180 * Math.PI));
          break;
        case "cvi":
          o = 0 | e.pop(), e.push(o);
          break;
        case "cvr":
          break;
        case "div":
          l = e.pop(), o = e.pop(), e.push(o / l);
          break;
        case "dup":
          e.copy(1);
          break;
        case "eq":
          l = e.pop(), o = e.pop(), e.push(o === l);
          break;
        case "exch":
          e.roll(2, 1);
          break;
        case "exp":
          l = e.pop(), o = e.pop(), e.push(o ** l);
          break;
        case "false":
          e.push(!1);
          break;
        case "floor":
          o = e.pop(), e.push(Math.floor(o));
          break;
        case "ge":
          l = e.pop(), o = e.pop(), e.push(o >= l);
          break;
        case "gt":
          l = e.pop(), o = e.pop(), e.push(o > l);
          break;
        case "idiv":
          l = e.pop(), o = e.pop(), e.push(o / l | 0);
          break;
        case "index":
          o = e.pop(), e.index(o);
          break;
        case "le":
          l = e.pop(), o = e.pop(), e.push(o <= l);
          break;
        case "ln":
          o = e.pop(), e.push(Math.log(o));
          break;
        case "log":
          o = e.pop(), e.push(Math.log10(o));
          break;
        case "lt":
          l = e.pop(), o = e.pop(), e.push(o < l);
          break;
        case "mod":
          l = e.pop(), o = e.pop(), e.push(o % l);
          break;
        case "mul":
          l = e.pop(), o = e.pop(), e.push(o * l);
          break;
        case "ne":
          l = e.pop(), o = e.pop(), e.push(o !== l);
          break;
        case "neg":
          o = e.pop(), e.push(-o);
          break;
        case "not":
          o = e.pop(), typeof o == "boolean" ? e.push(!o) : e.push(~o);
          break;
        case "or":
          l = e.pop(), o = e.pop(), typeof o == "boolean" && typeof l == "boolean" ? e.push(o || l) : e.push(o | l);
          break;
        case "pop":
          e.pop();
          break;
        case "roll":
          l = e.pop(), o = e.pop(), e.roll(o, l);
          break;
        case "round":
          o = e.pop(), e.push(Math.round(o));
          break;
        case "sin":
          o = e.pop(), e.push(Math.sin(o % 360 / 180 * Math.PI));
          break;
        case "sqrt":
          o = e.pop(), e.push(Math.sqrt(o));
          break;
        case "sub":
          l = e.pop(), o = e.pop(), e.push(o - l);
          break;
        case "true":
          e.push(!0);
          break;
        case "truncate":
          o = e.pop(), o = o < 0 ? Math.ceil(o) : Math.floor(o), e.push(o);
          break;
        case "xor":
          l = e.pop(), o = e.pop(), typeof o == "boolean" && typeof l == "boolean" ? e.push(o !== l) : e.push(o ^ l);
          break;
        default:
          throw new ht(`Unknown operator ${a}`);
      }
      else e.push(a);
    return e.stack;
  }
}
class pf {
  constructor(t) {
    this.type = t;
  }
  visit(t) {
    ye("abstract method");
  }
}
class SL extends pf {
  constructor(t, e, n) {
    super("args"), this.index = t, this.min = e, this.max = n;
  }
  visit(t) {
    t.visitArgument(this);
  }
}
class g1 extends pf {
  constructor(t) {
    super("literal"), this.number = t, this.min = t, this.max = t;
  }
  visit(t) {
    t.visitLiteral(this);
  }
}
class nw extends pf {
  constructor(t, e, n, s, r) {
    super("binary"), this.op = t, this.arg1 = e, this.arg2 = n, this.min = s, this.max = r;
  }
  visit(t) {
    t.visitBinaryOperation(this);
  }
}
class CL extends pf {
  constructor(t, e) {
    super("max"), this.arg = t, this.min = t.min, this.max = e;
  }
  visit(t) {
    t.visitMin(this);
  }
}
class K_ extends pf {
  constructor(t, e, n) {
    super("var"), this.index = t, this.min = e, this.max = n;
  }
  visit(t) {
    t.visitVariable(this);
  }
}
class Z_ extends pf {
  constructor(t, e) {
    super("definition"), this.variable = t, this.arg = e;
  }
  visit(t) {
    t.visitVariableDefinition(this);
  }
}
class J_ {
  constructor() {
    this.parts = [];
  }
  visitArgument(t) {
    this.parts.push("Math.max(", t.min, ", Math.min(", t.max, ", src[srcOffset + ", t.index, "]))");
  }
  visitVariable(t) {
    this.parts.push("v", t.index);
  }
  visitLiteral(t) {
    this.parts.push(t.number);
  }
  visitBinaryOperation(t) {
    this.parts.push("("), t.arg1.visit(this), this.parts.push(" ", t.op, " "), t.arg2.visit(this), this.parts.push(")");
  }
  visitVariableDefinition(t) {
    this.parts.push("var "), t.variable.visit(this), this.parts.push(" = "), t.arg.visit(this), this.parts.push(";");
  }
  visitMin(t) {
    this.parts.push("Math.min("), t.arg.visit(this), this.parts.push(", ", t.max, ")");
  }
  toString() {
    return this.parts.join("");
  }
}
function EL(i, t) {
  return t.type === "literal" && t.number === 0 ? i : i.type === "literal" && i.number === 0 ? t : t.type === "literal" && i.type === "literal" ? new g1(i.number + t.number) : new nw("+", i, t, i.min + t.min, i.max + t.max);
}
function DL(i, t) {
  if (t.type === "literal") {
    if (t.number === 0) return new g1(0);
    if (t.number === 1) return i;
    if (i.type === "literal") return new g1(i.number * t.number);
  }
  if (i.type === "literal") {
    if (i.number === 0) return new g1(0);
    if (i.number === 1) return t;
  }
  const e = Math.min(i.min * t.min, i.min * t.max, i.max * t.min, i.max * t.max), n = Math.max(i.min * t.min, i.min * t.max, i.max * t.min, i.max * t.max);
  return new nw("*", i, t, e, n);
}
function TL(i, t) {
  if (t.type === "literal") {
    if (t.number === 0) return i;
    if (i.type === "literal") return new g1(i.number - t.number);
  }
  return t.type === "binary" && t.op === "-" && i.type === "literal" && i.number === 1 && t.arg1.type === "literal" && t.arg1.number === 1 ? t.arg2 : new nw("-", i, t, i.min - t.max, i.max - t.min);
}
function FL(i, t) {
  return i.min >= t ? new g1(t) : i.max <= t ? i : new CL(i, t);
}
class IL {
  compile(t, e, n) {
    const s = [], r = [], a = e.length >> 1, o = n.length >> 1;
    let l, c, h, u, f, d, p, g, b = 0;
    for (let v = 0; v < a; v++) s.push(new SL(v, e[2 * v], e[2 * v + 1]));
    for (let v = 0, w = t.length; v < w; v++)
      if (g = t[v], typeof g != "number") switch (g) {
        case "add":
          if (s.length < 2) return null;
          u = s.pop(), h = s.pop(), s.push(EL(h, u));
          break;
        case "cvr":
          if (s.length < 1) return null;
          break;
        case "mul":
          if (s.length < 2) return null;
          u = s.pop(), h = s.pop(), s.push(DL(h, u));
          break;
        case "sub":
          if (s.length < 2) return null;
          u = s.pop(), h = s.pop(), s.push(TL(h, u));
          break;
        case "exch":
          if (s.length < 2) return null;
          f = s.pop(), d = s.pop(), s.push(f, d);
          break;
        case "pop":
          if (s.length < 1) return null;
          s.pop();
          break;
        case "index":
          if (s.length < 1 || (h = s.pop(), h.type !== "literal") || (l = h.number, l < 0 || !Number.isInteger(l) || s.length < l)) return null;
          if (f = s[s.length - l - 1], f.type === "literal" || f.type === "var") {
            s.push(f);
            break;
          }
          p = new K_(b++, f.min, f.max), s[s.length - l - 1] = p, s.push(p), r.push(new Z_(p, f));
          break;
        case "dup":
          if (s.length < 1) return null;
          if (typeof t[v + 1] == "number" && t[v + 2] === "gt" && t[v + 3] === v + 7 && t[v + 4] === "jz" && t[v + 5] === "pop" && t[v + 6] === t[v + 1]) {
            h = s.pop(), s.push(FL(h, t[v + 1])), v += 6;
            break;
          }
          if (f = s.at(-1), f.type === "literal" || f.type === "var") {
            s.push(f);
            break;
          }
          p = new K_(b++, f.min, f.max), s[s.length - 1] = p, s.push(p), r.push(new Z_(p, f));
          break;
        case "roll":
          if (s.length < 2 || (u = s.pop(), h = s.pop(), u.type !== "literal" || h.type !== "literal") || (c = u.number, l = h.number, l <= 0 || !Number.isInteger(l) || !Number.isInteger(c) || s.length < l)) return null;
          if (c = (c % l + l) % l, c === 0) break;
          s.push(...s.splice(s.length - l, l - c));
          break;
        default:
          return null;
      }
      else s.push(new g1(g));
    if (s.length !== o) return null;
    const y = [];
    for (const v of r) {
      const w = new J_();
      v.visit(w), y.push(w.toString());
    }
    for (let v = 0, w = s.length; v < w; v++) {
      const _ = s[v], x = new J_();
      _.visit(x);
      const k = n[2 * v], S = n[2 * v + 1], T = [x.toString()];
      k > _.min && (T.unshift("Math.max(", k, ", "), T.push(")")), S < _.max && (T.unshift("Math.min(", S, ", "), T.push(")")), T.unshift("dest[destOffset + ", v, "] = "), T.push(";"), y.push(T.join(""));
    }
    return y.join(`
`);
  }
}
const ML = ["BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "S", "B", "S", "WS", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "B", "B", "B", "S", "WS", "ON", "ON", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "ON", "ES", "CS", "ES", "CS", "CS", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "CS", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "ON", "ON", "ON", "BN", "BN", "BN", "BN", "BN", "BN", "B", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "BN", "CS", "ON", "ET", "ET", "ET", "ET", "ON", "ON", "ON", "ON", "L", "ON", "ON", "BN", "ON", "ON", "ET", "ET", "EN", "EN", "ON", "L", "ON", "ON", "ON", "EN", "L", "ON", "ON", "ON", "ON", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "L", "ON", "L", "L", "L", "L", "L", "L", "L", "L"], RL = ["AN", "AN", "AN", "AN", "AN", "AN", "ON", "ON", "AL", "ET", "ET", "AL", "CS", "AL", "ON", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "AN", "ET", "AN", "AN", "AL", "AL", "AL", "NSM", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "AL", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AN", "ON", "NSM", "NSM", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "NSM", "NSM", "ON", "NSM", "NSM", "NSM", "NSM", "AL", "AL", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "EN", "AL", "AL", "AL", "AL", "AL", "AL"];
function Q_(i) {
  return !!(1 & i);
}
function BL(i) {
  return !(1 & i);
}
function PL(i, t, e) {
  let n, s;
  for (n = t, s = i.length; n < s; ++n) if (i[n] !== e) return n;
  return n;
}
function tx(i, t, e) {
  for (let n = t, s = e - 1; n < s; ++n, --s) {
    const r = i[n];
    i[n] = i[s], i[s] = r;
  }
}
function I6(i, t, e = !1) {
  let n = "ltr";
  return e ? n = "ttb" : t || (n = "rtl"), { str: i, dir: n };
}
const tc = [], De = [];
function DD(i, t = -1, e = !1) {
  let n = !0;
  const s = i.length;
  if (s === 0 || e) return I6(i, n, e);
  tc.length = s, De.length = s;
  let r, a, o = 0;
  for (r = 0; r < s; ++r) {
    tc[r] = i.charAt(r);
    const y = i.charCodeAt(r);
    let v = "L";
    y <= 255 ? v = ML[y] : 1424 <= y && y <= 1524 ? v = "R" : 1536 <= y && y <= 1791 ? (v = RL[255 & y], v || H("Bidi: invalid Unicode character " + y.toString(16))) : (1792 <= y && y <= 2220 || 64336 <= y && y <= 65023 || 65136 <= y && y <= 65279) && (v = "AL"), v !== "R" && v !== "AL" && v !== "AN" || o++, De[r] = v;
  }
  if (o === 0)
    return n = !0, I6(i, n);
  t === -1 && (o / s < 0.3 && s > 4 ? (n = !0, t = 0) : (n = !1, t = 1));
  const l = [];
  for (r = 0; r < s; ++r) l[r] = t;
  const c = Q_(t) ? "R" : "L", h = c, u = h;
  let f, d = h;
  for (r = 0; r < s; ++r) De[r] === "NSM" ? De[r] = d : d = De[r];
  for (d = h, r = 0; r < s; ++r)
    f = De[r], f === "EN" ? De[r] = d === "AL" ? "AN" : "EN" : f !== "R" && f !== "L" && f !== "AL" || (d = f);
  for (r = 0; r < s; ++r)
    f = De[r], f === "AL" && (De[r] = "R");
  for (r = 1; r < s - 1; ++r)
    De[r] === "ES" && De[r - 1] === "EN" && De[r + 1] === "EN" && (De[r] = "EN"), De[r] !== "CS" || De[r - 1] !== "EN" && De[r - 1] !== "AN" || De[r + 1] !== De[r - 1] || (De[r] = De[r - 1]);
  for (r = 0; r < s; ++r) if (De[r] === "EN") {
    for (let y = r - 1; y >= 0 && De[y] === "ET"; --y) De[y] = "EN";
    for (let y = r + 1; y < s && De[y] === "ET"; ++y) De[y] = "EN";
  }
  for (r = 0; r < s; ++r)
    f = De[r], f !== "WS" && f !== "ES" && f !== "ET" && f !== "CS" || (De[r] = "ON");
  for (d = h, r = 0; r < s; ++r)
    f = De[r], f === "EN" ? De[r] = d === "L" ? "L" : "EN" : f !== "R" && f !== "L" || (d = f);
  for (r = 0; r < s; ++r) if (De[r] === "ON") {
    const y = PL(De, r + 1, "ON");
    let v = h;
    r > 0 && (v = De[r - 1]);
    let w = u;
    y + 1 < s && (w = De[y + 1]), v !== "L" && (v = "R"), w !== "L" && (w = "R"), v === w && De.fill(v, r, y), r = y - 1;
  }
  for (r = 0; r < s; ++r) De[r] === "ON" && (De[r] = c);
  for (r = 0; r < s; ++r)
    f = De[r], BL(l[r]) ? f === "R" ? l[r] += 1 : f !== "AN" && f !== "EN" || (l[r] += 2) : f !== "L" && f !== "AN" && f !== "EN" || (l[r] += 1);
  let p, g = -1, b = 99;
  for (r = 0, a = l.length; r < a; ++r)
    p = l[r], g < p && (g = p), b > p && Q_(p) && (b = p);
  for (p = g; p >= b; --p) {
    let y = -1;
    for (r = 0, a = l.length; r < a; ++r) l[r] < p ? y >= 0 && (tx(tc, y, r), y = -1) : y < 0 && (y = r);
    y >= 0 && tx(tc, y, l.length);
  }
  for (r = 0, a = tc.length; r < a; ++r) {
    const y = tc[r];
    y !== "<" && y !== ">" || (tc[r] = "");
  }
  return I6(tc.join(""), n);
}
const $0 = { style: "normal", weight: "normal" }, W0 = { style: "normal", weight: "bold" }, X0 = { style: "italic", weight: "normal" }, Y0 = { style: "italic", weight: "bold" }, F2 = /* @__PURE__ */ new Map([["Times-Roman", { local: ["Times New Roman", "Times-Roman", "Times", "Liberation Serif", "Nimbus Roman", "Nimbus Roman L", "Tinos", "Thorndale", "TeX Gyre Termes", "FreeSerif", "Linux Libertine O", "Libertinus Serif", "DejaVu Serif", "Bitstream Vera Serif", "Ubuntu"], style: $0, ultimate: "serif" }], ["Times-Bold", { alias: "Times-Roman", style: W0, ultimate: "serif" }], ["Times-Italic", { alias: "Times-Roman", style: X0, ultimate: "serif" }], ["Times-BoldItalic", { alias: "Times-Roman", style: Y0, ultimate: "serif" }], ["Helvetica", { local: ["Helvetica", "Helvetica Neue", "Arial", "Arial Nova", "Liberation Sans", "Arimo", "Nimbus Sans", "Nimbus Sans L", "A030", "TeX Gyre Heros", "FreeSans", "DejaVu Sans", "Albany", "Bitstream Vera Sans", "Arial Unicode MS", "Microsoft Sans Serif", "Apple Symbols", "Cantarell"], path: "LiberationSans-Regular.ttf", style: $0, ultimate: "sans-serif" }], ["Helvetica-Bold", { alias: "Helvetica", path: "LiberationSans-Bold.ttf", style: W0, ultimate: "sans-serif" }], ["Helvetica-Oblique", { alias: "Helvetica", path: "LiberationSans-Italic.ttf", style: X0, ultimate: "sans-serif" }], ["Helvetica-BoldOblique", { alias: "Helvetica", path: "LiberationSans-BoldItalic.ttf", style: Y0, ultimate: "sans-serif" }], ["Courier", { local: ["Courier", "Courier New", "Liberation Mono", "Nimbus Mono", "Nimbus Mono L", "Cousine", "Cumberland", "TeX Gyre Cursor", "FreeMono", "Linux Libertine Mono O", "Libertinus Mono"], style: $0, ultimate: "monospace" }], ["Courier-Bold", { alias: "Courier", style: W0, ultimate: "monospace" }], ["Courier-Oblique", { alias: "Courier", style: X0, ultimate: "monospace" }], ["Courier-BoldOblique", { alias: "Courier", style: Y0, ultimate: "monospace" }], ["ArialBlack", { local: ["Arial Black"], style: { style: "normal", weight: "900" }, fallback: "Helvetica-Bold" }], ["ArialBlack-Bold", { alias: "ArialBlack" }], ["ArialBlack-Italic", { alias: "ArialBlack", style: { style: "italic", weight: "900" }, fallback: "Helvetica-BoldOblique" }], ["ArialBlack-BoldItalic", { alias: "ArialBlack-Italic" }], ["ArialNarrow", { local: ["Arial Narrow", "Liberation Sans Narrow", "Helvetica Condensed", "Nimbus Sans Narrow", "TeX Gyre Heros Cn"], style: $0, fallback: "Helvetica" }], ["ArialNarrow-Bold", { alias: "ArialNarrow", style: W0, fallback: "Helvetica-Bold" }], ["ArialNarrow-Italic", { alias: "ArialNarrow", style: X0, fallback: "Helvetica-Oblique" }], ["ArialNarrow-BoldItalic", { alias: "ArialNarrow", style: Y0, fallback: "Helvetica-BoldOblique" }], ["Calibri", { local: ["Calibri", "Carlito"], style: $0, fallback: "Helvetica" }], ["Calibri-Bold", { alias: "Calibri", style: W0, fallback: "Helvetica-Bold" }], ["Calibri-Italic", { alias: "Calibri", style: X0, fallback: "Helvetica-Oblique" }], ["Calibri-BoldItalic", { alias: "Calibri", style: Y0, fallback: "Helvetica-BoldOblique" }], ["Wingdings", { local: ["Wingdings", "URW Dingbats"], style: $0 }], ["Wingdings-Regular", { alias: "Wingdings" }], ["Wingdings-Bold", { alias: "Wingdings" }]]), NL = /* @__PURE__ */ new Map([["Arial-Black", "ArialBlack"]]);
function ex(i) {
  const t = /* @__PURE__ */ new Set(["thin", "extralight", "ultralight", "demilight", "semilight", "light", "book", "regular", "normal", "medium", "demibold", "semibold", "bold", "extrabold", "ultrabold", "black", "heavy", "extrablack", "ultrablack", "roman", "italic", "oblique", "ultracondensed", "extracondensed", "condensed", "semicondensed", "normal", "semiexpanded", "expanded", "extraexpanded", "ultraexpanded", "bolditalic"]);
  return i.split(/[- ,+]+/g).filter((e) => !t.has(e.toLowerCase())).join(" ");
}
function Db({ alias: i, local: t, path: e, fallback: n, style: s, ultimate: r }, a, o, l = !0, c = !0, h = "") {
  const u = { style: null, ultimate: null };
  if (t) {
    const f = h ? ` ${h}` : "";
    for (const d of t) a.push(`local(${d}${f})`);
  }
  if (i) {
    const f = F2.get(i), d = h || function(g) {
      switch (g) {
        case W0:
          return "Bold";
        case X0:
          return "Italic";
        case Y0:
          return "Bold Italic";
        default:
          if ((g == null ? void 0 : g.weight) === "bold") return "Bold";
          if ((g == null ? void 0 : g.style) === "italic") return "Italic";
      }
      return "";
    }(s);
    Object.assign(u, Db(f, a, o, l && !n, c && !e, d));
  }
  if (s && (u.style = s), r && (u.ultimate = r), l && n) {
    const f = F2.get(n), { ultimate: d } = Db(f, a, o, l, c && !e, h);
    u.ultimate || (u.ultimate = d);
  }
  return c && e && o && a.push(`url(${o}${e})`), u;
}
function ix(i, t, e, n, s, r) {
  if (n.startsWith("InvalidPDFjsFont_")) return null;
  r !== "TrueType" && r !== "Type1" || !/^[A-Z]{6}\+/.test(n) || (n = n.slice(7));
  const a = n = Sg(n);
  let o = i.get(a);
  if (o) return o;
  let l = F2.get(n);
  if (!l) {
    for (const [b, y] of NL) if (n.startsWith(b)) {
      n = `${y}${n.substring(b.length)}`, l = F2.get(n);
      break;
    }
  }
  let c = !1;
  l || (l = F2.get(s), c = !0);
  const h = `${t.getDocId()}_s${t.createFontId()}`;
  if (!l) {
    if (!sb(n))
      return H(`Cannot substitute the font because of its name: ${n}`), i.set(a, null), null;
    const b = /bold/gi.test(n), y = /oblique|italic/gi.test(n), v = b && y && Y0 || b && W0 || y && X0 || $0;
    return o = { css: `"${ex(n)}",${h}`, guessFallback: !0, loadedName: h, baseFontName: n, src: `local(${n})`, style: v }, i.set(a, o), o;
  }
  const u = [];
  c && sb(n) && u.push(`local(${n})`);
  const { style: f, ultimate: d } = Db(l, u, e), p = d === null, g = p ? "" : `,${d}`;
  return o = { css: `"${ex(n)}",${h}${g}`, guessFallback: p, loadedName: h, baseFontName: n, src: u.join(","), style: f }, i.set(a, o), o;
}
const nx = 3285377520, gr = 4294901760, ec = 65535;
class LL {
  constructor(t) {
    this.h1 = t ? 4294967295 & t : nx, this.h2 = t ? 4294967295 & t : nx;
  }
  update(t) {
    let e, n;
    if (typeof t == "string") {
      e = new Uint8Array(2 * t.length), n = 0;
      for (let g = 0, b = t.length; g < b; g++) {
        const y = t.charCodeAt(g);
        y <= 255 ? e[n++] = y : (e[n++] = y >>> 8, e[n++] = 255 & y);
      }
    } else {
      if (!ArrayBuffer.isView(t)) throw new Error("Invalid data format, must be a string or TypedArray.");
      e = t.slice(), n = e.byteLength;
    }
    const s = n >> 2, r = n - 4 * s, a = new Uint32Array(e.buffer, 0, s);
    let o = 0, l = 0, c = this.h1, h = this.h2;
    const u = 3432918353, f = 461845907, d = 11601, p = 13715;
    for (let g = 0; g < s; g++) 1 & g ? (o = a[g], o = o * u & gr | o * d & ec, o = o << 15 | o >>> 17, o = o * f & gr | o * p & ec, c ^= o, c = c << 13 | c >>> 19, c = 5 * c + 3864292196) : (l = a[g], l = l * u & gr | l * d & ec, l = l << 15 | l >>> 17, l = l * f & gr | l * p & ec, h ^= l, h = h << 13 | h >>> 19, h = 5 * h + 3864292196);
    switch (o = 0, r) {
      case 3:
        o ^= e[4 * s + 2] << 16;
      case 2:
        o ^= e[4 * s + 1] << 8;
      case 1:
        o ^= e[4 * s], o = o * u & gr | o * d & ec, o = o << 15 | o >>> 17, o = o * f & gr | o * p & ec, 1 & s ? c ^= o : h ^= o;
    }
    this.h1 = c, this.h2 = h;
  }
  hexdigest() {
    let t = this.h1, e = this.h2;
    return t ^= e >>> 1, t = 3981806797 * t & gr | 36045 * t & ec, e = 4283543511 * e & gr | (2950163797 * (e << 16 | t >>> 16) & gr) >>> 16, t ^= e >>> 1, t = 444984403 * t & gr | 60499 * t & ec, e = 3301882366 * e & gr | (3120437893 * (e << 16 | t >>> 16) & gr) >>> 16, t ^= e >>> 1, (t >>> 0).toString(16).padStart(8, "0") + (e >>> 0).toString(16).padStart(8, "0");
  }
}
function sx(i, t, e, n, s, r) {
  const a = s * r;
  let o;
  o = t <= 8 ? new Uint8Array(a) : t <= 16 ? new Uint16Array(a) : new Uint32Array(a);
  const l = e / s, c = n / r;
  let h, u, f, d, p = 0;
  const g = new Uint16Array(s), b = e;
  for (h = 0; h < s; h++) g[h] = Math.floor(h * l);
  for (h = 0; h < r; h++)
    for (f = Math.floor(h * c) * b, u = 0; u < s; u++)
      d = f + g[u], o[p++] = i[d];
  return o;
}
var lg, Tb;
const vu = class vu {
  constructor({ xref: t, res: e, image: n, isInline: s = !1, smask: r = null, mask: a = null, isMask: o = !1, pdfFunctionFactory: l, globalColorSpaceCache: c, localColorSpaceCache: h }) {
    F(this, lg);
    var y, v;
    this.image = n;
    const u = n.dict, f = u.get("F", "Filter");
    let d;
    if (f instanceof lt) d = f.name;
    else if (Array.isArray(f)) {
      const w = t.fetchIfRef(f[0]);
      w instanceof lt && (d = w.name);
    }
    switch (d) {
      case "JPXDecode":
        ({ width: n.width, height: n.height, componentsCount: n.numComps, bitsPerComponent: n.bitsPerComponent } = va.parseImageProperties(n.stream)), n.stream.reset();
        const w = aa.getReducePowerForJPX(n.width, n.height, n.numComps);
        if (this.jpxDecoderOptions = { numComponents: 0, isIndexedColormap: !1, smaskInData: u.has("SMaskInData"), reducePower: w }, w) {
          const _ = 2 ** w;
          n.width = Math.ceil(n.width / _), n.height = Math.ceil(n.height / _);
        }
        break;
      case "JBIG2Decode":
        n.bitsPerComponent = 1, n.numComps = 1;
    }
    let p = u.get("W", "Width"), g = u.get("H", "Height");
    if (Number.isInteger(n.width) && n.width > 0 && Number.isInteger(n.height) && n.height > 0 && (n.width !== p || n.height !== g))
      H("PDFImage - using the Width/Height of the image data, rather than the image dictionary."), p = n.width, g = n.height;
    else {
      const w = typeof p == "number" && p > 0, _ = typeof g == "number" && g > 0;
      if (!w || !_) {
        if (!n.fallbackDims) throw new ht(`Invalid image width: ${p} or height: ${g}`);
        H("PDFImage - using the Width/Height of the parent image, for SMask/Mask data."), w || (p = n.fallbackDims.width), _ || (g = n.fallbackDims.height);
      }
    }
    this.width = p, this.height = g, this.interpolate = u.get("I", "Interpolate"), this.imageMask = u.get("IM", "ImageMask") || !1, this.matte = u.get("Matte") || !1;
    let b = n.bitsPerComponent;
    if (!b && (b = u.get("BPC", "BitsPerComponent"), !b)) {
      if (!this.imageMask) throw new ht(`Bits per component missing in image: ${this.imageMask}`);
      b = 1;
    }
    if (this.bpc = b, !this.imageMask) {
      let w = u.getRaw("CS") || u.getRaw("ColorSpace");
      const _ = !!w;
      if (_) (y = this.jpxDecoderOptions) != null && y.smaskInData && (w = lt.get("DeviceRGBA"));
      else if (this.jpxDecoderOptions) w = lt.get("DeviceRGBA");
      else switch (n.numComps) {
        case 1:
          w = lt.get("DeviceGray");
          break;
        case 3:
          w = lt.get("DeviceRGB");
          break;
        case 4:
          w = lt.get("DeviceCMYK");
          break;
        default:
          throw new Error(`Images with ${n.numComps} color components not supported.`);
      }
      this.colorSpace = Se.parse({ cs: w, xref: t, resources: s ? e : null, pdfFunctionFactory: l, globalColorSpaceCache: c, localColorSpaceCache: h }), this.numComps = this.colorSpace.numComps, this.jpxDecoderOptions && (this.jpxDecoderOptions.numComponents = _ ? this.numComps : 0, this.jpxDecoderOptions.isIndexedColormap = this.colorSpace.name === "Indexed");
    }
    if (this.decode = u.getArray("D", "Decode"), this.needsDecode = !1, this.decode && (this.colorSpace && !this.colorSpace.isDefaultDecode(this.decode, b) || o && !Mn.isDefaultDecode(this.decode, 1))) {
      this.needsDecode = !0;
      const w = (1 << b) - 1;
      this.decodeCoefficients = [], this.decodeAddends = [];
      const _ = ((v = this.colorSpace) == null ? void 0 : v.name) === "Indexed";
      for (let x = 0, k = 0; x < this.decode.length; x += 2, ++k) {
        const S = this.decode[x], T = this.decode[x + 1];
        this.decodeCoefficients[k] = _ ? (T - S) / w : T - S, this.decodeAddends[k] = _ ? S : w * S;
      }
    }
    r ? (r.fallbackDims ?? (r.fallbackDims = { width: p, height: g }), this.smask = new vu({ xref: t, res: e, image: r, isInline: s, pdfFunctionFactory: l, globalColorSpaceCache: c, localColorSpaceCache: h })) : a && (a instanceof oe ? a.dict.get("IM", "ImageMask") ? (a.fallbackDims ?? (a.fallbackDims = { width: p, height: g }), this.mask = new vu({ xref: t, res: e, image: a, isInline: s, isMask: !0, pdfFunctionFactory: l, globalColorSpaceCache: c, localColorSpaceCache: h })) : H("Ignoring /Mask in image without /ImageMask.") : this.mask = a);
  }
  static async buildImage({ xref: t, res: e, image: n, isInline: s = !1, pdfFunctionFactory: r, globalColorSpaceCache: a, localColorSpaceCache: o }) {
    const l = n;
    let c = null, h = null;
    const u = n.dict.get("SMask"), f = n.dict.get("Mask");
    return u ? u instanceof oe ? c = u : H("Unsupported /SMask format.") : f && (f instanceof oe || Array.isArray(f) ? h = f : H("Unsupported /Mask format.")), new vu({ xref: t, res: e, image: l, isInline: s, smask: c, mask: h, pdfFunctionFactory: r, globalColorSpaceCache: a, localColorSpaceCache: o });
  }
  static async createMask({ image: t, isOffscreenCanvasSupported: e = !1 }) {
    const { dict: n } = t, s = n.get("W", "Width"), r = n.get("H", "Height"), a = n.get("I", "Interpolate"), o = n.getArray("D", "Decode"), l = (o == null ? void 0 : o[0]) > 0, c = (s + 7 >> 3) * r, h = t.getBytes(c), u = s === 1 && r === 1 && l === (h.length === 0 || !!(128 & h[0]));
    if (u) return { isSingleOpaquePixel: u };
    if (e) {
      if (aa.needsToBeResized(s, r)) {
        const y = new Uint8ClampedArray(s * r * 4);
        return db({ src: h, dest: y, width: s, height: r, nonBlackColor: 0, inverseDecode: l }), aa.createImage({ kind: Zo, data: y, width: s, height: r, interpolate: a });
      }
      const p = new OffscreenCanvas(s, r), g = p.getContext("2d"), b = g.createImageData(s, r);
      return db({ src: h, dest: b.data, width: s, height: r, nonBlackColor: 0, inverseDecode: l }), g.putImageData(b, 0, 0), { data: null, width: s, height: r, interpolate: a, bitmap: p.transferToImageBitmap() };
    }
    const f = h.byteLength;
    let d;
    if (t instanceof ps && (!l || c === f) ? d = h : l ? (d = new Uint8Array(c), d.set(h), d.fill(255, f)) : d = new Uint8Array(h), l) for (let p = 0; p < f; p++) d[p] ^= 255;
    return { data: d, width: s, height: r, interpolate: a };
  }
  get drawWidth() {
    var t, e;
    return Math.max(this.width, ((t = this.smask) == null ? void 0 : t.width) || 0, ((e = this.mask) == null ? void 0 : e.width) || 0);
  }
  get drawHeight() {
    var t, e;
    return Math.max(this.height, ((t = this.smask) == null ? void 0 : t.height) || 0, ((e = this.mask) == null ? void 0 : e.height) || 0);
  }
  decodeBuffer(t) {
    const e = this.bpc, n = this.numComps, s = this.decodeAddends, r = this.decodeCoefficients, a = (1 << e) - 1;
    let o, l;
    if (e === 1) {
      for (o = 0, l = t.length; o < l; o++) t[o] = +!t[o];
      return;
    }
    let c = 0;
    for (o = 0, l = this.width * this.height; o < l; o++) for (let h = 0; h < n; h++)
      t[c] = Tn(s[h] + t[c] * r[h], 0, a), c++;
  }
  getComponents(t) {
    const e = this.bpc;
    if (e === 8) return t;
    const n = this.width, s = this.height, r = this.numComps, a = n * s * r;
    let o, l = 0;
    o = e <= 8 ? new Uint8Array(a) : e <= 16 ? new Uint16Array(a) : new Uint32Array(a);
    const c = n * r, h = (1 << e) - 1;
    let u, f, d = 0;
    if (e === 1) {
      let p, g, b;
      for (let y = 0; y < s; y++) {
        for (g = d + (-8 & c), b = d + c; d < g; )
          f = t[l++], o[d] = f >> 7 & 1, o[d + 1] = f >> 6 & 1, o[d + 2] = f >> 5 & 1, o[d + 3] = f >> 4 & 1, o[d + 4] = f >> 3 & 1, o[d + 5] = f >> 2 & 1, o[d + 6] = f >> 1 & 1, o[d + 7] = 1 & f, d += 8;
        if (d < b)
          for (f = t[l++], p = 128; d < b; )
            o[d++] = +!!(f & p), p >>= 1;
      }
    } else {
      let p = 0;
      for (f = 0, d = 0, u = a; d < u; ++d) {
        for (d % c == 0 && (f = 0, p = 0); p < e; )
          f = f << 8 | t[l++], p += 8;
        const g = p - e;
        let b = f >> g;
        b < 0 ? b = 0 : b > h && (b = h), o[d] = b, f &= (1 << g) - 1, p = g;
      }
    }
    return o;
  }
  async fillOpacity(t, e, n, s, r) {
    const a = this.smask, o = this.mask;
    let l, c, h, u, f, d;
    if (a)
      c = a.width, h = a.height, l = new Uint8ClampedArray(c * h), await a.fillGrayBuffer(l), c === e && h === n || (l = sx(l, a.bpc, c, h, e, n));
    else if (o) if (o instanceof vu) {
      for (c = o.width, h = o.height, l = new Uint8ClampedArray(c * h), o.numComps = 1, await o.fillGrayBuffer(l), u = 0, f = c * h; u < f; ++u) l[u] = 255 - l[u];
      c === e && h === n || (l = sx(l, o.bpc, c, h, e, n));
    } else {
      if (!Array.isArray(o)) throw new ht("Unknown mask format.");
      {
        l = new Uint8ClampedArray(e * n);
        const p = this.numComps;
        for (u = 0, f = e * n; u < f; ++u) {
          let g = 0;
          const b = u * p;
          for (d = 0; d < p; ++d) {
            const y = r[b + d], v = 2 * d;
            if (y < o[v] || y > o[v + 1]) {
              g = 255;
              break;
            }
          }
          l[u] = g;
        }
      }
    }
    if (l) for (u = 0, d = 3, f = e * s; u < f; ++u, d += 4) t[d] = l[u];
    else for (u = 0, d = 3, f = e * s; u < f; ++u, d += 4) t[d] = 255;
  }
  undoPreblend(t, e, n) {
    var h;
    const s = (h = this.smask) == null ? void 0 : h.matte;
    if (!s) return;
    const r = this.colorSpace.getRgb(s, 0), a = r[0], o = r[1], l = r[2], c = e * n * 4;
    for (let u = 0; u < c; u += 4) {
      const f = t[u + 3];
      if (f === 0) {
        t[u] = 255, t[u + 1] = 255, t[u + 2] = 255;
        continue;
      }
      const d = 255 / f;
      t[u] = (t[u] - a) * d + a, t[u + 1] = (t[u + 1] - o) * d + o, t[u + 2] = (t[u + 2] - l) * d + l;
    }
  }
  async createImageData(t = !1, e = !1) {
    const n = this.drawWidth, s = this.drawHeight, r = { width: n, height: s, interpolate: this.interpolate, kind: 0, data: null }, a = this.numComps, o = this.width, l = this.height, c = this.bpc, h = o * a * c + 7 >> 3, u = e && aa.needsToBeResized(n, s);
    if (!this.smask && !this.mask && this.colorSpace.name === "DeviceRGBA") {
      r.kind = Zo;
      const x = r.data = await this.getImageBytes(l * o * 4, {});
      return e ? u ? aa.createImage(r, !1) : this.createBitmap(Zo, n, s, x) : r;
    }
    if (!t) {
      let x;
      if (this.colorSpace.name === "DeviceGray" && c === 1 ? x = V9 : this.colorSpace.name !== "DeviceRGB" || c !== 8 || this.needsDecode || (x = E2), x && !this.smask && !this.mask && n === o && s === l) {
        const k = await D(this, lg, Tb).call(this, o, l);
        if (k) return k;
        const S = await this.getImageBytes(l * h, {});
        if (e) return u ? aa.createImage({ data: S, kind: x, width: n, height: s, interpolate: this.interpolate }, this.needsDecode) : this.createBitmap(x, o, l, S);
        if (r.kind = x, r.data = S, this.needsDecode) {
          pn(x === V9, "PDFImage.createImageData: The image must be grayscale.");
          const T = r.data;
          for (let I = 0, R = T.length; I < R; I++) T[I] ^= 255;
        }
        return r;
      }
      if (this.image instanceof tf && !this.smask && !this.mask && !this.needsDecode) {
        let k = l * h;
        if (e && !u) {
          let S = !1;
          switch (this.colorSpace.name) {
            case "DeviceGray":
              k *= 4, S = !0;
              break;
            case "DeviceRGB":
              k = k / 3 * 4, S = !0;
              break;
            case "DeviceCMYK":
              S = !0;
          }
          if (S) {
            const T = await D(this, lg, Tb).call(this, n, s);
            if (T) return T;
            const I = await this.getImageBytes(k, { drawWidth: n, drawHeight: s, forceRGBA: !0 });
            return this.createBitmap(Zo, n, s, I);
          }
        } else switch (this.colorSpace.name) {
          case "DeviceGray":
            k *= 3;
          case "DeviceRGB":
          case "DeviceCMYK":
            return r.kind = E2, r.data = await this.getImageBytes(k, { drawWidth: n, drawHeight: s, forceRGB: !0 }), u ? aa.createImage(r) : r;
        }
      }
    }
    const f = await this.getImageBytes(l * h, { internal: !0 }), d = 0 | f.length / h * s / l, p = this.getComponents(f);
    let g, b, y, v, w, _;
    return e && !u && (y = new OffscreenCanvas(n, s), v = y.getContext("2d"), w = v.createImageData(n, s), _ = w.data), r.kind = Zo, t || this.smask || this.mask ? (e && !u || (_ = new Uint8ClampedArray(n * s * 4)), g = 1, b = !0, await this.fillOpacity(_, n, s, d, p)) : (!e || u ? (r.kind = E2, _ = new Uint8ClampedArray(n * s * 3), g = 0) : (new Uint32Array(_.buffer).fill(Rs.isLittleEndian ? 4278190080 : 255), g = 1), b = !1), this.needsDecode && this.decodeBuffer(p), this.colorSpace.fillRgb(_, o, l, n, s, d, c, p, g), b && this.undoPreblend(_, n, d), e && !u ? (v.putImageData(w, 0, 0), { data: null, width: n, height: s, bitmap: y.transferToImageBitmap(), interpolate: this.interpolate }) : (r.data = _, u ? aa.createImage(r) : r);
  }
  async fillGrayBuffer(t) {
    const e = this.numComps;
    if (e !== 1) throw new ht(`Reading gray scale from a color image: ${e}`);
    const n = this.width, s = this.height, r = this.bpc, a = n * e * r + 7 >> 3, o = await this.getImageBytes(s * a, { internal: !0 }), l = this.getComponents(o);
    let c, h;
    if (r === 1) {
      if (h = n * s, this.needsDecode) for (c = 0; c < h; ++c) t[c] = l[c] - 1 & 255;
      else for (c = 0; c < h; ++c) t[c] = 255 & -l[c];
      return;
    }
    this.needsDecode && this.decodeBuffer(l), h = n * s;
    const u = 255 / ((1 << r) - 1);
    for (c = 0; c < h; ++c) t[c] = u * l[c];
  }
  createBitmap(t, e, n, s) {
    const r = new OffscreenCanvas(e, n), a = r.getContext("2d");
    let o;
    return t === Zo ? o = new ImageData(s, e, n) : (o = a.createImageData(e, n), ZE({ kind: t, src: s, dest: new Uint32Array(o.data.buffer), width: e, height: n, inverseDecode: this.needsDecode })), a.putImageData(o, 0, 0), { data: null, width: e, height: n, bitmap: r.transferToImageBitmap(), interpolate: this.interpolate };
  }
  async getImageBytes(t, { drawWidth: e, drawHeight: n, forceRGBA: s = !1, forceRGB: r = !1, internal: a = !1 }) {
    this.image.reset(), this.image.drawWidth = e || this.width, this.image.drawHeight = n || this.height, this.image.forceRGBA = !!s, this.image.forceRGB = !!r;
    const o = await this.image.getImageData(t, this.jpxDecoderOptions);
    return a || this.image instanceof ps ? o : (pn(o instanceof Uint8Array, 'PDFImage.getImageBytes: Unsupported "imageBytes" type.'), new Uint8Array(o));
  }
};
lg = new WeakSet(), Tb = async function(t, e) {
  const n = await this.image.getTransferableImage();
  return n ? { data: null, width: t, height: e, bitmap: n, interpolate: this.interpolate } : null;
};
let I2 = vu;
const OL = Object.freeze({ maxImageSize: -1, disableFontFace: !1, ignoreErrors: !1, isEvalSupported: !0, isOffscreenCanvasSupported: !1, isImageDecoderSupported: !1, canvasMaxAreaInBytes: -1, fontExtraProperties: !1, useSystemFonts: !0, useWasm: !0, useWorkerFetch: !0, cMapUrl: null, iccUrl: null, standardFontDataUrl: null, wasmUrl: null }), $L = 1, qL = 2, rx = Promise.resolve();
function TD(i, t = !1) {
  if (Array.isArray(i)) {
    for (const e of i) {
      const n = TD(e, !0);
      if (n) return n;
    }
    return H(`Unsupported blend mode Array: ${i}`), "source-over";
  }
  if (!(i instanceof lt)) return t ? null : "source-over";
  switch (i.name) {
    case "Normal":
    case "Compatible":
      return "source-over";
    case "Multiply":
      return "multiply";
    case "Screen":
      return "screen";
    case "Overlay":
      return "overlay";
    case "Darken":
      return "darken";
    case "Lighten":
      return "lighten";
    case "ColorDodge":
      return "color-dodge";
    case "ColorBurn":
      return "color-burn";
    case "HardLight":
      return "hard-light";
    case "SoftLight":
      return "soft-light";
    case "Difference":
      return "difference";
    case "Exclusion":
      return "exclusion";
    case "Hue":
      return "hue";
    case "Saturation":
      return "saturation";
    case "Color":
      return "color";
    case "Luminosity":
      return "luminosity";
  }
  return t ? null : (H(`Unsupported blend mode: ${i.name}`), "source-over");
}
function M6(i, { objId: t, fn: e, args: n, optionalContent: s, hasMask: r }) {
  var a;
  t && i.addDependency(t), i.addImageOps(e, n, s, r), e === Jd && ((a = n[0]) == null ? void 0 : a.count) > 0 && n[0].count++;
}
const _u = class _u {
  constructor() {
    this.reset();
  }
  check() {
    return ++this.checked < _u.CHECK_TIME_EVERY ? !1 : (this.checked = 0, this.endTime <= Date.now());
  }
  reset() {
    this.endTime = Date.now() + _u.TIME_SLOT_DURATION_MS, this.checked = 0;
  }
};
ft(_u, "TIME_SLOT_DURATION_MS", 20), ft(_u, "CHECK_TIME_EVERY", 100);
let f3 = _u;
class nf {
  constructor({ xref: t, handler: e, pageIndex: n, idFactory: s, fontCache: r, builtInCMapCache: a, standardFontDataCache: o, globalColorSpaceCache: l, globalImageCache: c, systemFontCache: h, options: u = null }) {
    this.xref = t, this.handler = e, this.pageIndex = n, this.idFactory = s, this.fontCache = r, this.builtInCMapCache = a, this.standardFontDataCache = o, this.globalColorSpaceCache = l, this.globalImageCache = c, this.systemFontCache = h, this.options = u || OL, this.type3FontRefs = null, this._regionalImageCache = new xL(), this._fetchBuiltInCMapBound = this.fetchBuiltInCMap.bind(this);
  }
  get _pdfFunctionFactory() {
    return At(this, "_pdfFunctionFactory", new ED({ xref: this.xref, isEvalSupported: this.options.isEvalSupported }));
  }
  get parsingType3Font() {
    return !!this.type3FontRefs;
  }
  clone(t = null) {
    const e = Object.create(this);
    return e.options = Object.assign(/* @__PURE__ */ Object.create(null), this.options, t), e;
  }
  hasBlendModes(t, e) {
    if (!(t instanceof Z) || t.objId && e.has(t.objId)) return !1;
    const n = new $i(e);
    t.objId && n.put(t.objId);
    const s = [t], r = this.xref;
    for (; s.length; ) {
      const a = s.shift(), o = a.get("ExtGState");
      if (o instanceof Z) for (let c of o.getRawValues()) {
        if (c instanceof Dt) {
          if (n.has(c)) continue;
          try {
            c = r.fetch(c);
          } catch (u) {
            n.put(c), ue(`hasBlendModes - ignoring ExtGState: "${u}".`);
            continue;
          }
        }
        if (!(c instanceof Z)) continue;
        c.objId && n.put(c.objId);
        const h = c.get("BM");
        if (h instanceof lt) {
          if (h.name !== "Normal") return !0;
        } else if (h !== void 0 && Array.isArray(h)) {
          for (const u of h) if (u instanceof lt && u.name !== "Normal") return !0;
        }
      }
      const l = a.get("XObject");
      if (l instanceof Z) for (let c of l.getRawValues()) {
        if (c instanceof Dt) {
          if (n.has(c)) continue;
          try {
            c = r.fetch(c);
          } catch (u) {
            n.put(c), ue(`hasBlendModes - ignoring XObject: "${u}".`);
            continue;
          }
        }
        if (!(c instanceof oe)) continue;
        c.dict.objId && n.put(c.dict.objId);
        const h = c.dict.get("Resources");
        h instanceof Z && (!h.objId || !n.has(h.objId)) && (s.push(h), h.objId && n.put(h.objId));
      }
    }
    for (const a of n) e.put(a);
    return !1;
  }
  async fetchBuiltInCMap(t) {
    const e = this.builtInCMapCache.get(t);
    if (e) return e;
    let n;
    return n = this.options.useWorkerFetch ? { cMapData: await ib(`${this.options.cMapUrl}${t}.bcmap`), isCompressed: !0 } : await this.handler.sendWithPromise("FetchBinaryData", { type: "cMapReaderFactory", name: t }), this.builtInCMapCache.set(t, n), n;
  }
  async fetchStandardFontData(t) {
    const e = this.standardFontDataCache.get(t);
    if (e) return new gi(e);
    if (this.options.useSystemFonts && t !== "Symbol" && t !== "ZapfDingbats") return null;
    const n = aN()[t];
    let s;
    try {
      s = this.options.useWorkerFetch ? await ib(`${this.options.standardFontDataUrl}${n}`) : await this.handler.sendWithPromise("FetchBinaryData", { type: "standardFontDataFactory", filename: n });
    } catch (r) {
      return H(r), null;
    }
    return this.standardFontDataCache.set(t, s), new gi(s);
  }
  async buildFormXObject(t, e, n, s, r, a, o, l) {
    const { dict: c } = e, h = i0(c.getArray("Matrix"), null), u = Wl(c.getArray("BBox"), null);
    let f, d;
    c.has("OC") && (f = await this.parseMarkedContentProps(c.get("OC"), t)), f !== void 0 && s.addOp(ho, ["OC", f]);
    const p = c.get("Group");
    if (p) {
      d = { matrix: h, bbox: u, smask: n, isolated: !1, knockout: !1 };
      let y = null;
      if (ki(p.get("S"), "Transparency") && (d.isolated = p.get("I") || !1, d.knockout = p.get("K") || !1, p.has("CS"))) {
        const v = this._getColorSpace(p.getRaw("CS"), t, o);
        y = v instanceof Mn ? v : await this._handleColorSpace(v);
      }
      n != null && n.backdrop && (y || (y = Se.rgb), n.backdrop = y.getRgbHex(n.backdrop, 0)), s.addOp(SB, [d]);
    }
    const g = [h && new Float32Array(h), !p && u && new Float32Array(u) || null];
    s.addOp(FE, g);
    const b = c.get("Resources");
    await this.getOperatorList({ stream: e, task: r, resources: b instanceof Z ? b : t, operatorList: s, initialState: a, prevRefs: l }), s.addOp(AB, []), p && s.addOp(CB, [d]), f !== void 0 && s.addOp(Zd, []);
  }
  _sendImgData(t, e, n = !1) {
    const s = e ? [e.bitmap || e.data.buffer] : null;
    return this.parsingType3Font || n ? this.handler.send("commonobj", [t, "Image", e], s) : this.handler.send("obj", [t, this.pageIndex, "Image", e], s);
  }
  async buildPaintImageXObject({ resources: t, image: e, isInline: n = !1, operatorList: s, cacheKey: r, localImageCache: a, localColorSpaceCache: o }) {
    const { maxImageSize: l, ignoreErrors: c, isOffscreenCanvasSupported: h } = this.options, { dict: u } = e, f = u.objId, d = u.get("W", "Width"), p = u.get("H", "Height");
    if (!d || typeof d != "number" || !p || typeof p != "number") {
      H("Image dimensions are missing, or not numbers.");
      return;
    }
    if (l !== -1 && d * p > l) {
      const S = "Image exceeded maximum allowed size and was removed.";
      if (!c) throw new Error(S);
      H(S);
      return;
    }
    let g;
    u.has("OC") && (g = await this.parseMarkedContentProps(u.get("OC"), t));
    let b, y, v;
    if (u.get("IM", "ImageMask")) {
      if (b = await I2.createMask({ image: e, isOffscreenCanvasSupported: h && !this.parsingType3Font }), b.isSingleOpaquePixel) {
        if (y = FB, v = [], s.addImageOps(y, v, g), r) {
          const T = { fn: y, args: v, optionalContent: g };
          a.set(r, f, T), f && this._regionalImageCache.set(null, f, T);
        }
        return;
      }
      if (this.parsingType3Font) {
        if (v = function({ data: I, width: R, height: B }) {
          if (R > 1e3 || B > 1e3) return null;
          const L = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]), it = R + 1, O = new Uint8Array(it * (B + 1));
          let at, W, q;
          const K = R + 7 & -8, z = new Uint8Array(K * B);
          let j = 0;
          for (const G of I) {
            let V = 128;
            for (; V > 0; )
              z[j++] = G & V ? 0 : 255, V >>= 1;
          }
          let N = 0;
          for (j = 0, z[j] !== 0 && (O[0] = 1, ++N), W = 1; W < R; W++)
            z[j] !== z[j + 1] && (O[W] = z[j] ? 2 : 1, ++N), j++;
          for (z[j] !== 0 && (O[W] = 2, ++N), at = 1; at < B; at++) {
            j = at * K, q = at * it, z[j - K] !== z[j] && (O[q] = z[j] ? 1 : 8, ++N);
            let G = (z[j] ? 4 : 0) + (z[j - K] ? 8 : 0);
            for (W = 1; W < R; W++)
              G = (G >> 2) + (z[j + 1] ? 4 : 0) + (z[j - K + 1] ? 8 : 0), L[G] && (O[q + W] = L[G], ++N), j++;
            if (z[j - K] !== z[j] && (O[q + W] = z[j] ? 2 : 4, ++N), N > 1e3) return null;
          }
          for (j = K * (B - 1), q = at * it, z[j] !== 0 && (O[q] = 8, ++N), W = 1; W < R; W++)
            z[j] !== z[j + 1] && (O[q + W] = z[j] ? 4 : 8, ++N), j++;
          if (z[j] !== 0 && (O[q + W] = 4, ++N), N > 1e3) return null;
          const Q = new Int32Array([0, it, -1, 0, -it, 0, 0, 0, 1]), Y = [], { a: et, b: $, c: dt, d: tt, e: ut, f: St } = new DOMMatrix().scaleSelf(1 / R, -1 / B).translateSelf(0, -B);
          for (at = 0; N && at <= B; at++) {
            let G = at * it;
            const V = G + R;
            for (; G < V && !O[G]; ) G++;
            if (G === V) continue;
            let nt = G % it, gt = at;
            Y.push(m2, et * nt + dt * gt + ut, $ * nt + tt * gt + St);
            const _t = G;
            let kt = O[G];
            do {
              const xt = Q[kt];
              do
                G += xt;
              while (!O[G]);
              const wt = O[G];
              wt !== 5 && wt !== 10 ? (kt = wt, O[G] = 0) : (kt = wt & 51 * kt >> 4, O[G] &= kt >> 2 | kt << 2), nt = G % it, gt = G / it | 0, Y.push(L0, et * nt + dt * gt + ut, $ * nt + tt * gt + St), O[G] || --N;
            } while (_t !== G);
            --at;
          }
          return [RB, [new Float32Array(Y)], new Float32Array([0, 0, R, B])];
        }(b), v) {
          s.addImageOps(m1, v, g);
          return;
        }
        H("Cannot compile Type3 glyph."), s.addImageOps(Jd, [b], g);
        return;
      }
      const S = `mask_${this.idFactory.createObjId()}`;
      if (s.addDependency(S), b.dataLen = b.bitmap ? b.width * b.height * 4 : b.data.length, this._sendImgData(S, b), y = Jd, v = [{ data: S, width: b.width, height: b.height, interpolate: b.interpolate, count: 1 }], s.addImageOps(y, v, g), r) {
        const T = { objId: S, fn: y, args: v, optionalContent: g };
        a.set(r, f, T), f && this._regionalImageCache.set(null, f, T);
      }
      return;
    }
    const w = u.has("SMask") || u.has("Mask");
    if (n && d + p < 200 && !w) {
      try {
        b = await new I2({ xref: this.xref, res: t, image: e, isInline: n, pdfFunctionFactory: this._pdfFunctionFactory, globalColorSpaceCache: this.globalColorSpaceCache, localColorSpaceCache: o }).createImageData(!0, !1), s.addImageOps(r3, [b], g);
      } catch (S) {
        const T = `Unable to decode inline image: "${S}".`;
        if (!c) throw new Error(T);
        H(T);
      }
      return;
    }
    let _ = `img_${this.idFactory.createObjId()}`, x = !1, k = null;
    if (this.parsingType3Font ? _ = `${this.idFactory.getDocId()}_type3_${_}` : r && f && (x = this.globalImageCache.shouldCache(f, this.pageIndex), x && (pn(!n, "Cannot cache an inline image globally."), _ = `${this.idFactory.getDocId()}_${_}`)), s.addDependency(_), y = Y8, v = [_, d, p], s.addImageOps(y, v, g, w), x) {
      if (k = { objId: _, fn: y, args: v, optionalContent: g, hasMask: w, byteSize: 0 }, this.globalImageCache.hasDecodeFailed(f)) {
        this.globalImageCache.setData(f, k), this._sendImgData(_, null, x);
        return;
      }
      if (d * p > 25e4 || w) {
        const S = await this.handler.sendWithPromise("commonobj", [_, "CopyLocalImage", { imageRef: f }]);
        if (S) {
          this.globalImageCache.setData(f, k), this.globalImageCache.addByteSize(f, S);
          return;
        }
      }
    }
    if (I2.buildImage({ xref: this.xref, res: t, image: e, isInline: n, pdfFunctionFactory: this._pdfFunctionFactory, globalColorSpaceCache: this.globalColorSpaceCache, localColorSpaceCache: o }).then(async (S) => (b = await S.createImageData(!1, h), b.dataLen = b.bitmap ? b.width * b.height * 4 : b.data.length, b.ref = f, x && this.globalImageCache.addByteSize(f, b.dataLen), this._sendImgData(_, b, x))).catch((S) => (H(`Unable to decode image "${_}": "${S}".`), f && this.globalImageCache.addDecodeFailed(f), this._sendImgData(_, null, x))), r) {
      const S = { objId: _, fn: y, args: v, optionalContent: g, hasMask: w };
      a.set(r, f, S), f && (this._regionalImageCache.set(null, f, S), x && (pn(k, "The global cache-data must be available."), this.globalImageCache.setData(f, k)));
    }
  }
  handleSMask(t, e, n, s, r, a, o) {
    const l = t.get("G"), c = { subtype: t.get("S").name, backdrop: t.get("BC") }, h = t.get("TR");
    if (F6(h)) {
      const u = this._pdfFunctionFactory.create(h), f = new Uint8Array(256), d = new Float32Array(1);
      for (let p = 0; p < 256; p++)
        d[0] = p / 255, u(d, 0, d, 0), f[p] = 255 * d[0] | 0;
      c.transferMap = f;
    }
    return this.buildFormXObject(e, l, c, n, s, r.state.clone({ newPath: !0 }), a, o);
  }
  handleTransferFunction(t) {
    let e;
    if (Array.isArray(t)) e = t;
    else {
      if (!F6(t)) return null;
      e = [t];
    }
    const n = [];
    let s = 0, r = 0;
    for (const a of e) {
      const o = this.xref.fetchIfRef(a);
      if (s++, ki(o, "Identity")) {
        n.push(null);
        continue;
      }
      if (!F6(o)) return null;
      const l = this._pdfFunctionFactory.create(o), c = new Uint8Array(256), h = new Float32Array(1);
      for (let u = 0; u < 256; u++)
        h[0] = u / 255, l(h, 0, h, 0), c[u] = 255 * h[0] | 0;
      n.push(c), r++;
    }
    return s !== 1 && s !== 4 || r === 0 ? null : n;
  }
  handleTilingType(t, e, n, s, r, a, o, l) {
    const c = new Xn(), h = Z.merge({ xref: this.xref, dictArray: [r.get("Resources"), n] });
    return this.getOperatorList({ stream: s, task: o, resources: h, operatorList: c }).then(function() {
      const u = c.getIR(), f = V_(u, r, e);
      a.addDependencies(c.dependencies), a.addOp(t, f), r.objId && l.set(null, r.objId, { operatorListIR: u, dict: r });
    }).catch((u) => {
      if (!(u instanceof xn)) {
        if (!this.options.ignoreErrors) throw u;
        H(`handleTilingType - ignoring pattern: "${u}".`);
      }
    });
  }
  async handleSetFont(t, e, n, s, r, a, o = null, l = null) {
    const c = (e == null ? void 0 : e[0]) instanceof lt ? e[0].name : null, h = await this.loadFont(c, n, t, r, o, l);
    return h.font.isType3Font && s.addDependencies(h.type3Dependencies), a.font = h.font, h.send(this.handler), h.loadedName;
  }
  handleText(t, e) {
    const n = e.font, s = n.charsToGlyphs(t);
    return n.data && (e.textRenderingMode & DR || e.fillColorSpace.name === "Pattern" || n.disableFontFace) && nf.buildFontPaths(n, s, this.handler, this.options), s;
  }
  ensureStateFont(t) {
    if (t.font) return;
    const e = new ht("Missing setFont (Tf) operator before text rendering operator.");
    if (!this.options.ignoreErrors) throw e;
    H(`ensureStateFont: "${e}".`);
  }
  async setGState({ resources: t, gState: e, operatorList: n, cacheKey: s, task: r, stateManager: a, localGStateCache: o, localColorSpaceCache: l, seenRefs: c }) {
    const h = e.objId;
    let u = !0;
    const f = [];
    let d = Promise.resolve();
    for (const [p, g] of e) switch (p) {
      case "Type":
        break;
      case "LW":
        if (typeof g != "number") {
          H(`Invalid LW (line width): ${g}`);
          break;
        }
        f.push([p, Math.abs(g)]);
        break;
      case "LC":
      case "LJ":
      case "ML":
      case "D":
      case "RI":
      case "FL":
      case "CA":
      case "ca":
        f.push([p, g]);
        break;
      case "Font":
        u = !1, d = d.then(() => this.handleSetFont(t, null, g[0], n, r, a.state).then(function(y) {
          n.addDependency(y), f.push([p, [y, g[1]]]);
        }));
        break;
      case "BM":
        f.push([p, TD(g)]);
        break;
      case "SMask":
        if (ki(g, "None")) {
          f.push([p, !1]);
          break;
        }
        g instanceof Z ? (u = !1, d = d.then(() => this.handleSMask(g, t, n, r, a, l, c)), f.push([p, !0])) : H("Unsupported SMask type");
        break;
      case "TR":
        const b = this.handleTransferFunction(g);
        f.push([p, b]);
        break;
      case "OP":
      case "op":
      case "OPM":
      case "BG":
      case "BG2":
      case "UCR":
      case "UCR2":
      case "TR2":
      case "HT":
      case "SM":
      case "SA":
      case "AIS":
      case "TK":
        ue("graphic state operator " + p);
        break;
      default:
        ue("Unknown graphic state operator " + p);
    }
    await d, f.length > 0 && n.addOp(eh, [f]), u && o.set(s, h, f);
  }
  loadFont(t, e, n, s, r = null, a = null) {
    var b;
    const o = async () => new R6({ loadedName: "g_font_error", font: new j_(`Font "${t}" is not available.`), dict: e });
    let l;
    if (e) e instanceof Dt && (l = e);
    else {
      const y = n.get("Font");
      y && (l = y.getRaw(t));
    }
    if (l) {
      if ((b = this.type3FontRefs) != null && b.has(l)) return o();
      if (this.fontCache.has(l)) return this.fontCache.get(l);
      try {
        e = this.xref.fetchIfRef(l);
      } catch (y) {
        H(`loadFont - lookup failed: "${y}".`);
      }
    }
    if (!(e instanceof Z)) {
      if (!this.options.ignoreErrors && !this.parsingType3Font)
        return H(`Font "${t}" is not available.`), o();
      H(`Font "${t}" is not available -- attempting to fallback to a default font.`), e = r || nf.fallbackFontDict;
    }
    if (e.cacheKey && this.fontCache.has(e.cacheKey)) return this.fontCache.get(e.cacheKey);
    const { promise: c, resolve: h } = Promise.withResolvers();
    let u;
    try {
      u = this.preEvaluateFont(e), u.cssFontInfo = a;
    } catch (y) {
      return H(`loadFont - preEvaluateFont failed: "${y}".`), o();
    }
    const { descriptor: f, hash: d } = u, p = l instanceof Dt;
    let g;
    if (d && f instanceof Z) {
      const y = f.fontAliases || (f.fontAliases = /* @__PURE__ */ Object.create(null));
      if (y[d]) {
        const v = y[d].aliasRef;
        if (p && v && this.fontCache.has(v))
          return this.fontCache.putAlias(l, v), this.fontCache.get(l);
      } else y[d] = { fontID: this.idFactory.createFontId() };
      p && (y[d].aliasRef = l), g = y[d].fontID;
    } else g = this.idFactory.createFontId();
    return pn(g == null ? void 0 : g.startsWith("f"), 'The "fontID" must be (correctly) defined.'), p ? this.fontCache.put(l, c) : (e.cacheKey = `cacheKey_${g}`, this.fontCache.put(e.cacheKey, c)), e.loadedName = `${this.idFactory.getDocId()}_${g}`, this.translateFont(u).then(async (y) => {
      const v = new R6({ loadedName: e.loadedName, font: y, dict: e });
      if (y.isType3Font) try {
        await v.loadType3Data(this, n, s);
      } catch (w) {
        throw new Error(`Type3 font load error: ${w}`);
      }
      h(v);
    }).catch((y) => {
      H(`loadFont - translateFont failed: "${y}".`), h(new R6({ loadedName: e.loadedName, font: new j_(y == null ? void 0 : y.message), dict: e }));
    }), c;
  }
  buildPath(t, e, n) {
    const { pathMinMax: s, pathBuffer: r } = n;
    switch (0 | t) {
      case U8: {
        const a = n.currentPointX = e[0], o = n.currentPointY = e[1], l = e[2], c = e[3], h = a + l, u = o + c;
        l === 0 || c === 0 ? r.push(m2, a, o, L0, h, u, Xg) : r.push(m2, a, o, L0, h, o, L0, h, u, L0, a, u, Xg), Ee.rectBoundingBox(a, o, h, u, s);
        break;
      }
      case W9: {
        const a = n.currentPointX = e[0], o = n.currentPointY = e[1];
        r.push(m2, a, o), Ee.pointBoundingBox(a, o, s);
        break;
      }
      case L8: {
        const a = n.currentPointX = e[0], o = n.currentPointY = e[1];
        r.push(L0, a, o), Ee.pointBoundingBox(a, o, s);
        break;
      }
      case O8: {
        const a = n.currentPointX, o = n.currentPointY, [l, c, h, u, f, d] = e;
        n.currentPointX = f, n.currentPointY = d, r.push(h9, l, c, h, u, f, d), Ee.bezierBoundingBox(a, o, l, c, h, u, f, d, s);
        break;
      }
      case $8: {
        const a = n.currentPointX, o = n.currentPointY, [l, c, h, u] = e;
        n.currentPointX = h, n.currentPointY = u, r.push(h9, a, o, l, c, h, u), Ee.bezierBoundingBox(a, o, a, o, l, c, h, u, s);
        break;
      }
      case q8: {
        const a = n.currentPointX, o = n.currentPointY, [l, c, h, u] = e;
        n.currentPointX = h, n.currentPointY = u, r.push(h9, l, c, h, u, h, u), Ee.bezierBoundingBox(a, o, l, c, h, u, h, u, s);
        break;
      }
      case z8:
        r.push(Xg);
    }
  }
  _getColorSpace(t, e, n) {
    return Se.parse({ cs: t, xref: this.xref, resources: e, pdfFunctionFactory: this._pdfFunctionFactory, globalColorSpaceCache: this.globalColorSpaceCache, localColorSpaceCache: n, asyncIfNotCached: !0 });
  }
  async _handleColorSpace(t) {
    try {
      return await t;
    } catch (e) {
      if (e instanceof xn) return null;
      if (this.options.ignoreErrors)
        return H(`_handleColorSpace - ignoring ColorSpace: "${e}".`), null;
      throw e;
    }
  }
  parseShading({ shading: t, resources: e, localColorSpaceCache: n, localShadingPatternCache: s }) {
    let r, a = s.get(t);
    if (a) return a;
    try {
      r = PN.parseShading(t, this.xref, e, this._pdfFunctionFactory, this.globalColorSpaceCache, n).getIR();
    } catch (o) {
      if (o instanceof xn) return null;
      if (this.options.ignoreErrors)
        return H(`parseShading - ignoring shading: "${o}".`), s.set(t, null), null;
      throw o;
    }
    return a = `pattern_${this.idFactory.createObjId()}`, this.parsingType3Font && (a = `${this.idFactory.getDocId()}_type3_${a}`), s.set(t, a), this.parsingType3Font ? this.handler.send("commonobj", [a, "Pattern", r]) : this.handler.send("obj", [a, this.pageIndex, "Pattern", r]), a;
  }
  handleColorN(t, e, n, s, r, a, o, l, c, h) {
    const u = n.pop();
    if (u instanceof lt) {
      const f = r.getRaw(u.name), d = f instanceof Dt && c.getByRef(f);
      if (d) try {
        const g = s.base ? s.base.getRgbHex(n, 0) : null, b = V_(d.operatorListIR, d.dict, g);
        t.addOp(e, b);
        return;
      } catch {
      }
      const p = this.xref.fetchIfRef(f);
      if (p) {
        const g = p instanceof oe ? p.dict : p, b = g.get("PatternType");
        if (b === $L) {
          const y = s.base ? s.base.getRgbHex(n, 0) : null;
          return this.handleTilingType(e, y, a, p, g, t, o, c);
        }
        if (b === qL) {
          const y = g.get("Shading"), v = this.parseShading({ shading: y, resources: a, localColorSpaceCache: l, localShadingPatternCache: h });
          if (v) {
            const w = i0(g.getArray("Matrix"), null);
            t.addOp(e, ["Shading", v, w]);
          }
          return;
        }
        throw new ht(`Unknown PatternType: ${b}`);
      }
    }
    throw new ht(`Unknown PatternName: ${u}`);
  }
  _parseVisibilityExpression(t, e, n) {
    if (++e > 10) {
      H("Visibility expression is too deeply nested");
      return;
    }
    const s = t.length, r = this.xref.fetchIfRef(t[0]);
    if (!(s < 2) && r instanceof lt) {
      switch (r.name) {
        case "And":
        case "Or":
        case "Not":
          n.push(r.name);
          break;
        default:
          H(`Invalid operator ${r.name} in visibility expression`);
          return;
      }
      for (let a = 1; a < s; a++) {
        const o = t[a], l = this.xref.fetchIfRef(o);
        if (Array.isArray(l)) {
          const c = [];
          n.push(c), this._parseVisibilityExpression(l, e, c);
        } else o instanceof Dt && n.push(o.toString());
      }
    } else H("Invalid visibility expression");
  }
  async parseMarkedContentProps(t, e) {
    var r;
    let n;
    if (t instanceof lt)
      n = e.get("Properties").get(t.name);
    else {
      if (!(t instanceof Z)) throw new ht("Optional content properties malformed.");
      n = t;
    }
    const s = (r = n.get("Type")) == null ? void 0 : r.name;
    if (s === "OCG") return { type: s, id: n.objId };
    if (s === "OCMD") {
      const a = n.get("VE");
      if (Array.isArray(a)) {
        const l = [];
        if (this._parseVisibilityExpression(a, 0, l), l.length > 0) return { type: "OCMD", expression: l };
      }
      const o = n.get("OCGs");
      if (Array.isArray(o) || o instanceof Z) {
        const l = [];
        if (Array.isArray(o)) for (const c of o) l.push(c.toString());
        else l.push(o.objId);
        return { type: s, ids: l, policy: n.get("P") instanceof lt ? n.get("P").name : null, expression: null };
      }
      if (o instanceof Dt) return { type: s, id: o.toString() };
    }
    return null;
  }
  getOperatorList({ stream: t, task: e, resources: n, operatorList: s, initialState: r = null, fallbackFontDict: a = null, prevRefs: o = null }) {
    var S;
    const l = (S = t.dict) == null ? void 0 : S.objId, c = new $i(o);
    if (l) {
      if (o != null && o.has(l)) throw new Error(`getOperatorList - ignoring circular reference: ${l}`);
      c.put(l);
    }
    if (n || (n = Z.empty), r || (r = new MD()), !s) throw new Error('getOperatorList: missing "operatorList" parameter');
    const h = this, u = this.xref, f = new W_(), d = new SD(), p = new X_(), g = new _L(), b = /* @__PURE__ */ new Map(), y = n.get("XObject") || Z.empty, v = n.get("Pattern") || Z.empty, w = new S9(r), _ = new sf(t, u, w), x = new f3();
    function k(T) {
      for (let I = 0, R = _.savedStatesDepth; I < R; I++) s.addOp(Ms, []);
    }
    return new Promise(function T(I, R) {
      const B = function(z) {
        Promise.all([z, s.ready]).then(function() {
          try {
            T(I, R);
          } catch (j) {
            R(j);
          }
        }, R);
      };
      e.ensureNotTerminated(), x.reset();
      const L = {};
      let it, O, at, W, q, K;
      for (; !(it = x.check()) && (L.args = null, !!_.read(L)); ) {
        let z = L.args, j = L.fn;
        switch (0 | j) {
          case X8:
            if (K = z[0] instanceof lt, q = z[0].name, K) {
              const tt = f.getByName(q);
              if (tt) {
                M6(s, tt), z = null;
                continue;
              }
            }
            B(new Promise(function(tt, ut) {
              if (!K) throw new ht("XObject must be referred to by name.");
              let St = y.getRaw(q);
              if (St instanceof Dt) {
                const V = f.getByRef(St) || h._regionalImageCache.getByRef(St) || h.globalImageCache.getData(St, h.pageIndex);
                if (V) {
                  M6(s, V), tt();
                  return;
                }
                St = u.fetch(St);
              }
              if (!(St instanceof oe)) throw new ht("XObject should be a stream");
              const G = St.dict.get("Subtype");
              if (!(G instanceof lt)) throw new ht("XObject should have a Name subtype");
              if (G.name !== "Form") if (G.name !== "Image") {
                if (G.name !== "PS") throw new ht(`Unhandled XObject subtype ${G.name}`);
                ue("Ignored XObject subtype PS"), tt();
              } else h.buildPaintImageXObject({ resources: n, image: St, operatorList: s, cacheKey: q, localImageCache: f, localColorSpaceCache: d }).then(tt, ut);
              else
                w.save(), h.buildFormXObject(n, St, null, s, e, w.state.clone({ newPath: !0 }), d, c).then(function() {
                  w.restore(), tt();
                }, ut);
            }).catch(function(tt) {
              if (!(tt instanceof xn)) {
                if (!h.options.ignoreErrors) throw tt;
                H(`getOperatorList - ignoring XObject: "${tt}".`);
              }
            }));
            return;
          case o0:
            const N = z[1];
            B(h.handleSetFont(n, z, null, s, e, w.state, a).then(function(tt) {
              s.addDependency(tt), s.addOp(o0, [tt, N]);
            }));
            return;
          case AE:
            const Q = z[0].cacheKey;
            if (Q) {
              const tt = f.getByName(Q);
              if (tt) {
                M6(s, tt), z = null;
                continue;
              }
            }
            B(h.buildPaintImageXObject({ resources: n, image: z[0], isInline: !0, operatorList: s, cacheKey: Q, localImageCache: f, localColorSpaceCache: d }));
            return;
          case Tl:
            if (!w.state.font) {
              h.ensureStateFont(w.state);
              continue;
            }
            z[0] = h.handleText(z[0], w.state);
            break;
          case Q9:
            if (!w.state.font) {
              h.ensureStateFont(w.state);
              continue;
            }
            const Y = [], et = w.state;
            for (const tt of z[0]) typeof tt == "string" ? Y.push(...h.handleText(tt, et)) : typeof tt == "number" && Y.push(tt);
            z[0] = Y, j = Tl;
            break;
          case t3:
            if (!w.state.font) {
              h.ensureStateFont(w.state);
              continue;
            }
            s.addOp(c9), z[0] = h.handleText(z[0], w.state), j = Tl;
            break;
          case e3:
            if (!w.state.font) {
              h.ensureStateFont(w.state);
              continue;
            }
            s.addOp(c9), s.addOp(V8, [z.shift()]), s.addOp(G8, [z.shift()]), z[0] = h.handleText(z[0], w.state), j = Tl;
            break;
          case wE:
            w.state.textRenderingMode = z[0];
            break;
          case T4: {
            const tt = h._getColorSpace(z[0], n, d);
            if (tt instanceof Mn) {
              w.state.fillColorSpace = tt;
              continue;
            }
            B(h._handleColorSpace(tt).then((ut) => {
              w.state.fillColorSpace = ut || Se.gray;
            }));
            return;
          }
          case qy: {
            const tt = h._getColorSpace(z[0], n, d);
            if (tt instanceof Mn) {
              w.state.strokeColorSpace = tt;
              continue;
            }
            B(h._handleColorSpace(tt).then((ut) => {
              w.state.strokeColorSpace = ut || Se.gray;
            }));
            return;
          }
          case F4:
            W = w.state.fillColorSpace, z = [W.getRgbHex(z, 0)], j = co;
            break;
          case zy:
            W = w.state.strokeColorSpace, z = [W.getRgbHex(z, 0)], j = oc;
            break;
          case xg:
            w.state.fillColorSpace = Se.gray, z = [Se.gray.getRgbHex(z, 0)], j = co;
            break;
          case Uy:
            w.state.strokeColorSpace = Se.gray, z = [Se.gray.getRgbHex(z, 0)], j = oc;
            break;
          case kg:
            w.state.fillColorSpace = Se.cmyk, z = [Se.cmyk.getRgbHex(z, 0)], j = co;
            break;
          case Hy:
            w.state.strokeColorSpace = Se.cmyk, z = [Se.cmyk.getRgbHex(z, 0)], j = oc;
            break;
          case co:
            w.state.fillColorSpace = Se.rgb, z = [Se.rgb.getRgbHex(z, 0)];
            break;
          case oc:
            w.state.strokeColorSpace = Se.rgb, z = [Se.rgb.getRgbHex(z, 0)];
            break;
          case n3:
            if (W = w.state.patternFillColorSpace, !W) {
              if (cs(z, null)) {
                z = [Se.gray.getRgbHex(z, 0)], j = co;
                break;
              }
              z = [], j = MB;
              break;
            }
            if (W.name === "Pattern") {
              B(h.handleColorN(s, n3, z, W, v, n, e, d, g, b));
              return;
            }
            z = [W.getRgbHex(z, 0)], j = co;
            break;
          case i3:
            if (W = w.state.patternStrokeColorSpace, !W) {
              if (cs(z, null)) {
                z = [Se.gray.getRgbHex(z, 0)], j = oc;
                break;
              }
              z = [], j = IB;
              break;
            }
            if (W.name === "Pattern") {
              B(h.handleColorN(s, i3, z, W, v, n, e, d, g, b));
              return;
            }
            z = [W.getRgbHex(z, 0)], j = oc;
            break;
          case s3:
            let $;
            try {
              const tt = n.get("Shading");
              if (!tt) throw new ht("No shading resource found");
              if ($ = tt.get(z[0].name), !$) throw new ht("No shading object found");
            } catch (tt) {
              if (tt instanceof xn) continue;
              if (h.options.ignoreErrors) {
                H(`getOperatorList - ignoring Shading: "${tt}".`);
                continue;
              }
              throw tt;
            }
            const dt = h.parseShading({ shading: $, resources: n, localColorSpaceCache: d, localShadingPatternCache: b });
            if (!dt) continue;
            z = [dt], j = s3;
            break;
          case eh:
            if (K = z[0] instanceof lt, q = z[0].name, K) {
              const tt = p.getByName(q);
              if (tt) {
                tt.length > 0 && s.addOp(eh, [tt]), z = null;
                continue;
              }
            }
            B(new Promise(function(tt, ut) {
              if (!K) throw new ht("GState must be referred to by name.");
              const St = n.get("ExtGState");
              if (!(St instanceof Z)) throw new ht("ExtGState should be a dictionary.");
              const G = St.get(q);
              if (!(G instanceof Z)) throw new ht("GState should be a dictionary.");
              h.setGState({ resources: n, gState: G, operatorList: s, cacheKey: q, task: e, stateManager: w, localGStateCache: p, localColorSpaceCache: d, seenRefs: c }).then(tt, ut);
            }).catch(function(tt) {
              if (!(tt instanceof xn)) {
                if (!h.options.ignoreErrors) throw tt;
                H(`getOperatorList - ignoring ExtGState: "${tt}".`);
              }
            }));
            return;
          case pE: {
            const [tt] = z;
            if (typeof tt != "number") {
              H(`Invalid setLineWidth: ${tt}`);
              continue;
            }
            z[0] = Math.abs(tt);
            break;
          }
          case W9:
          case L8:
          case O8:
          case $8:
          case q8:
          case z8:
          case U8:
            h.buildPath(j, z, w.state);
            continue;
          case Ly:
          case X9:
          case H8:
          case gE:
          case Oy:
          case $y:
          case Y9:
          case K9:
          case j8: {
            const { state: { pathBuffer: tt, pathMinMax: ut } } = w;
            j !== X9 && j !== Y9 && j !== K9 || tt.push(Xg), tt.length === 0 ? s.addOp(m1, [j, [null], null]) : (s.addOp(m1, [j, [new Float32Array(tt)], ut.slice()]), tt.length = 0, ut.set([1 / 0, 1 / 0, -1 / 0, -1 / 0], 0));
            continue;
          }
          case x1:
            s.addOp(j, [new Float32Array(z)]);
            continue;
          case SE:
          case CE:
          case DE:
          case TE:
            continue;
          case ho:
            if (!(z[0] instanceof lt)) {
              H(`Expected name for beginMarkedContentProps arg0=${z[0]}`), s.addOp(ho, ["OC", null]);
              continue;
            }
            if (z[0].name === "OC") {
              B(h.parseMarkedContentProps(z[1], n).then((tt) => {
                s.addOp(ho, ["OC", tt]);
              }).catch((tt) => {
                if (!(tt instanceof xn)) {
                  if (!h.options.ignoreErrors) throw tt;
                  H(`getOperatorList - ignoring beginMarkedContentProps: "${tt}".`), s.addOp(ho, ["OC", null]);
                }
              }));
              return;
            }
            z = [z[0].name, z[1] instanceof Z ? z[1].get("MCID") : null];
            break;
          default:
            if (z !== null) {
              for (O = 0, at = z.length; O < at && !(z[O] instanceof Z); O++) ;
              if (O < at) {
                H("getOperatorList - ignoring operator: " + j);
                continue;
              }
            }
        }
        s.addOp(j, z);
      }
      it ? B(rx) : (k(), I());
    }).catch((T) => {
      if (!(T instanceof xn)) {
        if (!this.options.ignoreErrors) throw T;
        H(`getOperatorList - ignoring errors during "${e.name}" task: "${T}".`), k();
      }
    });
  }
  getTextContent({ stream: t, task: e, resources: n, stateManager: s = null, includeMarkedContent: r = !1, sink: a, seenStyles: o = /* @__PURE__ */ new Set(), viewBox: l, lang: c = null, markedContentData: h = null, disableNormalization: u = !1, keepWhiteSpace: f = !1, prevRefs: d = null }) {
    var St;
    const p = (St = t.dict) == null ? void 0 : St.objId, g = new $i(d);
    if (p) {
      if (d != null && d.has(p)) throw new Error(`getTextContent - ignoring circular reference: ${p}`);
      g.put(p);
    }
    n || (n = Z.empty), s || (s = new S9(new zL())), r && (h || (h = { level: 0 }));
    const b = { items: [], styles: /* @__PURE__ */ Object.create(null), lang: c }, y = { initialized: !1, str: [], totalWidth: 0, totalHeight: 0, width: 0, height: 0, vertical: !1, prevTransform: null, textAdvanceScale: 0, spaceInFlowMin: 0, spaceInFlowMax: 0, trackingSpaceMin: 1 / 0, negativeSpaceMax: -1 / 0, notASpace: -1 / 0, transform: null, fontName: null, hasEOL: !1 }, v = [" ", " "];
    let w = 0;
    function _(G) {
      const V = (w + 1) % 2, nt = v[w] !== " " && v[V] === " ";
      return v[w] = G, w = V, !f && nt;
    }
    function x() {
      return !f && v[w] !== " " && v[(w + 1) % 2] === " ";
    }
    function k() {
      v[0] = v[1] = " ", w = 0;
    }
    const S = this, T = this.xref, I = [];
    let R = null;
    const B = new W_(), L = new X_(), it = new sf(t, T, s);
    let O;
    function at({ width: G = 0, height: V = 0, transform: nt = y.prevTransform, fontName: gt = y.fontName }) {
      b.items.push({ str: " ", dir: "ltr", width: G, height: V, transform: nt, fontName: gt, hasEOL: !1 });
    }
    function W() {
      const G = O.font, V = [O.fontSize * O.textHScale, 0, 0, O.fontSize, 0, O.textRise];
      if (G.isType3Font && (O.fontSize <= 1 || G.isCharBBox) && !sp(O.fontMatrix, f1)) {
        const nt = G.bbox[3] - G.bbox[1];
        nt > 0 && (V[3] *= nt * O.fontMatrix[3]);
      }
      return Ee.transform(O.ctm, Ee.transform(O.textMatrix, V));
    }
    function q() {
      if (y.initialized) return y;
      const { font: G, loadedName: V } = O;
      if (!o.has(V) && (o.add(V), b.styles[V] = { fontFamily: G.fallbackName, ascent: G.ascent, descent: G.descent, vertical: G.vertical }, S.options.fontExtraProperties && G.systemFontInfo)) {
        const xt = b.styles[V];
        xt.fontSubstitution = G.systemFontInfo.css, xt.fontSubstitutionLoadedName = G.systemFontInfo.loadedName;
      }
      y.fontName = V;
      const nt = y.transform = W();
      G.vertical ? (y.width = y.totalWidth = Math.hypot(nt[0], nt[1]), y.height = y.totalHeight = 0, y.vertical = !0) : (y.width = y.totalWidth = 0, y.height = y.totalHeight = Math.hypot(nt[2], nt[3]), y.vertical = !1);
      const gt = Math.hypot(O.textLineMatrix[0], O.textLineMatrix[1]), _t = Math.hypot(O.ctm[0], O.ctm[1]);
      y.textAdvanceScale = _t * gt;
      const { fontSize: kt } = O;
      return y.trackingSpaceMin = 0.102 * kt, y.notASpace = 0.03 * kt, y.negativeSpaceMax = -0.2 * kt, y.spaceInFlowMin = 0.102 * kt, y.spaceInFlowMax = 0.6 * kt, y.hasEOL = !1, y.initialized = !0, y;
    }
    function K() {
      if (!y.initialized) return;
      const G = Math.hypot(O.textLineMatrix[0], O.textLineMatrix[1]), V = Math.hypot(O.ctm[0], O.ctm[1]) * G;
      V !== y.textAdvanceScale && (y.vertical ? (y.totalHeight += y.height * y.textAdvanceScale, y.height = 0) : (y.totalWidth += y.width * y.textAdvanceScale, y.width = 0), y.textAdvanceScale = V);
    }
    function z(G) {
      let V = G.str.join("");
      u || (V = function(_t) {
        return m6 || (m6 = /([\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, i_ = /* @__PURE__ */ new Map([["ﬅ", "ſt"]])), _t.replaceAll(m6, (kt, xt, wt) => xt ? xt.normalize("NFKC") : i_.get(wt));
      }(V));
      const nt = DD(V, -1, G.vertical);
      return { str: nt.str, dir: nt.dir, width: Math.abs(G.totalWidth), height: Math.abs(G.totalHeight), transform: G.transform, fontName: G.fontName, hasEOL: G.hasEOL };
    }
    async function j(G, V) {
      const nt = await S.loadFont(G, V, n, e);
      O.loadedName = nt.loadedName, O.font = nt.font, O.fontMatrix = nt.font.fontMatrix || f1;
    }
    function N(G, V, nt) {
      const gt = Math.hypot(nt[0], nt[1]);
      return [(nt[0] * G + nt[1] * V) / gt, (nt[2] * G + nt[3] * V) / gt];
    }
    function Q(G) {
      var Kt;
      const V = W();
      let nt = V[4], gt = V[5];
      if ((Kt = O.font) != null && Kt.vertical) {
        if (nt < l[0] || nt > l[2] || gt + G < l[1] || gt > l[3]) return !1;
      } else if (nt + G < l[0] || nt > l[2] || gt < l[1] || gt > l[3]) return !1;
      if (!O.font || !y.prevTransform) return !0;
      let _t = y.prevTransform[4], kt = y.prevTransform[5];
      if (_t === nt && kt === gt) return !0;
      let xt = -1;
      switch (V[0] && V[1] === 0 && V[2] === 0 ? xt = V[0] > 0 ? 0 : 180 : V[1] && V[0] === 0 && V[3] === 0 && (xt = V[1] > 0 ? 90 : 270), xt) {
        case 0:
          break;
        case 90:
          [nt, gt] = [gt, nt], [_t, kt] = [kt, _t];
          break;
        case 180:
          [nt, gt, _t, kt] = [-nt, -gt, -_t, -kt];
          break;
        case 270:
          [nt, gt] = [-gt, -nt], [_t, kt] = [-kt, -_t];
          break;
        default:
          [nt, gt] = N(nt, gt, V), [_t, kt] = N(_t, kt, y.prevTransform);
      }
      if (O.font.vertical) {
        const Ft = (kt - gt) / y.textAdvanceScale, It = nt - _t, Pt = Math.sign(y.height);
        return Ft < Pt * y.negativeSpaceMax ? Math.abs(It) > 0.5 * y.width ? (et(), !0) : (k(), dt(), !0) : Math.abs(It) > y.width ? (et(), !0) : (Ft <= Pt * y.notASpace && k(), Ft <= Pt * y.trackingSpaceMin ? x() ? (k(), dt(), at({ height: Math.abs(Ft) })) : y.height += Ft : $(Ft, y.prevTransform, Pt) || (y.str.length === 0 ? (k(), at({ height: Math.abs(Ft) })) : y.height += Ft), Math.abs(It) > 0.25 * y.width && dt(), !0);
      }
      const wt = (nt - _t) / y.textAdvanceScale, yt = gt - kt, Ot = Math.sign(y.width);
      return wt < Ot * y.negativeSpaceMax ? Math.abs(yt) > 0.5 * y.height ? (et(), !0) : (k(), dt(), !0) : Math.abs(yt) > y.height ? (et(), !0) : (wt <= Ot * y.notASpace && k(), wt <= Ot * y.trackingSpaceMin ? x() ? (k(), dt(), at({ width: Math.abs(wt) })) : y.width += wt : $(wt, y.prevTransform, Ot) || (y.str.length === 0 ? (k(), at({ width: Math.abs(wt) })) : y.width += wt), Math.abs(yt) > 0.25 * y.height && dt(), !0);
    }
    function Y({ chars: G, extraSpacing: V }) {
      const nt = O.font;
      if (!G) {
        const kt = O.charSpacing + V;
        kt && (nt.vertical ? O.translateTextMatrix(0, -kt) : O.translateTextMatrix(kt * O.textHScale, 0)), f && Q(0);
        return;
      }
      const gt = nt.charsToGlyphs(G), _t = O.fontMatrix[0] * O.fontSize;
      for (let kt = 0, xt = gt.length; kt < xt; kt++) {
        const wt = gt[kt], { category: yt } = wt;
        if (yt.isInvisibleFormatMark) continue;
        let Ot = O.charSpacing + (kt + 1 === xt ? V : 0), Kt = wt.width;
        nt.vertical && (Kt = wt.vmetric ? wt.vmetric[0] : -Kt);
        let Ft = Kt * _t;
        if (!f && yt.isWhitespace) {
          nt.vertical ? (Ot += -Ft + O.wordSpacing, O.translateTextMatrix(0, -Ot)) : (Ot += Ft + O.wordSpacing, O.translateTextMatrix(Ot * O.textHScale, 0)), _(" ");
          continue;
        }
        if (!yt.isZeroWidthDiacritic && !Q(Ft)) {
          nt.vertical ? O.translateTextMatrix(0, Ft) : O.translateTextMatrix(Ft * O.textHScale, 0);
          continue;
        }
        const It = q();
        yt.isZeroWidthDiacritic && (Ft = 0), nt.vertical ? (O.translateTextMatrix(0, Ft), Ft = Math.abs(Ft), It.height += Ft) : (Ft *= O.textHScale, O.translateTextMatrix(Ft, 0), It.width += Ft), Ft && (It.prevTransform = W());
        const Pt = wt.unicode;
        _(Pt) && It.str.push(" "), It.str.push(Pt), Ot && (nt.vertical ? O.translateTextMatrix(0, -Ot) : O.translateTextMatrix(Ot * O.textHScale, 0));
      }
    }
    function et() {
      k(), y.initialized ? (y.hasEOL = !0, dt()) : b.items.push({ str: "", dir: "ltr", width: 0, height: 0, transform: W(), fontName: O.loadedName, hasEOL: !0 });
    }
    function $(G, V, nt) {
      if (nt * y.spaceInFlowMin <= G && G <= nt * y.spaceInFlowMax)
        return y.initialized && (k(), y.str.push(" ")), !1;
      const gt = y.fontName;
      let _t = 0;
      return y.vertical && (_t = G, G = 0), dt(), k(), at({ width: Math.abs(G), height: Math.abs(_t), transform: V || W(), fontName: gt }), !0;
    }
    function dt() {
      y.initialized && y.str && (y.vertical ? y.totalHeight += y.height * y.textAdvanceScale : y.totalWidth += y.width * y.textAdvanceScale, b.items.push(z(y)), y.initialized = !1, y.str.length = 0);
    }
    function tt(G = !1) {
      const V = b.items.length;
      V !== 0 && !(G && V < 10) && (a.enqueue(b, V), b.items = [], b.styles = /* @__PURE__ */ Object.create(null));
    }
    const ut = new f3();
    return new Promise(function G(V, nt) {
      const gt = function(Ot) {
        tt(!0), Promise.all([Ot, a.ready]).then(function() {
          try {
            G(V, nt);
          } catch (Kt) {
            nt(Kt);
          }
        }, nt);
      };
      e.ensureNotTerminated(), ut.reset();
      const _t = {};
      let kt, xt, wt, yt = [];
      for (; !(kt = ut.check()) && (yt.length = 0, _t.args = yt, !!it.read(_t)); ) {
        const Ot = O;
        O = s.state;
        const Kt = _t.fn;
        switch (yt = _t.args, 0 | Kt) {
          case o0:
            const Ft = yt[0].name, It = yt[1];
            if (O.font && Ft === O.fontName && It === O.fontSize) break;
            dt(), O.fontName = Ft, O.fontSize = It, gt(j(Ft, null));
            return;
          case vE:
            O.textRise = yt[0];
            break;
          case bE:
            O.textHScale = yt[0] / 100;
            break;
          case yE:
            O.leading = yt[0];
            break;
          case _E:
            O.translateTextLineMatrix(yt[0], yt[1]), O.textMatrix = O.textLineMatrix.slice();
            break;
          case xE:
            O.leading = -yt[1], O.translateTextLineMatrix(yt[0], yt[1]), O.textMatrix = O.textLineMatrix.slice();
            break;
          case c9:
            O.carriageReturn();
            break;
          case x1:
            O.setTextMatrix(yt[0], yt[1], yt[2], yt[3], yt[4], yt[5]), O.setTextLineMatrix(yt[0], yt[1], yt[2], yt[3], yt[4], yt[5]), K();
            break;
          case G8:
            O.charSpacing = yt[0];
            break;
          case V8:
            O.wordSpacing = yt[0];
            break;
          case Z9:
            O.textMatrix = Fa.slice(), O.textLineMatrix = Fa.slice();
            break;
          case Q9:
            if (!s.state.font) {
              S.ensureStateFont(s.state);
              continue;
            }
            const Pt = (O.font.vertical ? 1 : -1) * O.fontSize / 1e3, ae = yt[0];
            for (let le = 0, ji = ae.length; le < ji; le++) {
              const Ei = ae[le];
              if (typeof Ei == "string") I.push(Ei);
              else if (typeof Ei == "number" && Ei !== 0) {
                const vs = I.join("");
                I.length = 0, Y({ chars: vs, extraSpacing: Ei * Pt });
              }
            }
            if (I.length > 0) {
              const le = I.join("");
              I.length = 0, Y({ chars: le, extraSpacing: 0 });
            }
            break;
          case Tl:
            if (!s.state.font) {
              S.ensureStateFont(s.state);
              continue;
            }
            Y({ chars: yt[0], extraSpacing: 0 });
            break;
          case t3:
            if (!s.state.font) {
              S.ensureStateFont(s.state);
              continue;
            }
            O.carriageReturn(), Y({ chars: yt[0], extraSpacing: 0 });
            break;
          case e3:
            if (!s.state.font) {
              S.ensureStateFont(s.state);
              continue;
            }
            O.wordSpacing = yt[0], O.charSpacing = yt[1], O.carriageReturn(), Y({ chars: yt[2], extraSpacing: 0 });
            break;
          case X8:
            if (dt(), R ?? (R = n.get("XObject") || Z.empty), wt = yt[0] instanceof lt, xt = yt[0].name, wt && B.getByName(xt)) break;
            gt(new Promise(function(le, ji) {
              if (!wt) throw new ht("XObject must be referred to by name.");
              let Ei = R.getRaw(xt);
              if (Ei instanceof Dt) {
                if (B.getByRef(Ei)) {
                  le();
                  return;
                }
                if (S.globalImageCache.getData(Ei, S.pageIndex)) {
                  le();
                  return;
                }
                Ei = T.fetch(Ei);
              }
              if (!(Ei instanceof oe)) throw new ht("XObject should be a stream");
              const { dict: vs } = Ei, No = vs.get("Subtype");
              if (!(No instanceof lt)) throw new ht("XObject should have a Name subtype");
              if (No.name !== "Form") {
                B.set(xt, vs.objId, !0), le();
                return;
              }
              const wf = s.state.clone(), vf = new S9(wf), x0 = i0(vs.getArray("Matrix"), null);
              x0 && vf.transform(x0);
              const k0 = vs.get("Resources");
              tt();
              const fr = { enqueueInvoked: !1, enqueue(Jl, _f) {
                this.enqueueInvoked = !0, a.enqueue(Jl, _f);
              }, get desiredSize() {
                return a.desiredSize;
              }, get ready() {
                return a.ready;
              } };
              S.getTextContent({ stream: Ei, task: e, resources: k0 instanceof Z ? k0 : n, stateManager: vf, includeMarkedContent: r, sink: fr, seenStyles: o, viewBox: l, lang: c, markedContentData: h, disableNormalization: u, keepWhiteSpace: f, prevRefs: g }).then(function() {
                fr.enqueueInvoked || B.set(xt, vs.objId, !0), le();
              }, ji);
            }).catch(function(le) {
              if (!(le instanceof xn)) {
                if (!S.options.ignoreErrors) throw le;
                H(`getTextContent - ignoring XObject: "${le}".`);
              }
            }));
            return;
          case eh:
            if (wt = yt[0] instanceof lt, xt = yt[0].name, wt && L.getByName(xt)) break;
            gt(new Promise(function(le, ji) {
              if (!wt) throw new ht("GState must be referred to by name.");
              const Ei = n.get("ExtGState");
              if (!(Ei instanceof Z)) throw new ht("ExtGState should be a dictionary.");
              const vs = Ei.get(xt);
              if (!(vs instanceof Z)) throw new ht("GState should be a dictionary.");
              const No = vs.get("Font");
              No ? (dt(), O.fontName = null, O.fontSize = No[1], j(null, No[0]).then(le, ji)) : (L.set(xt, vs.objId, !0), le());
            }).catch(function(le) {
              if (!(le instanceof xn)) {
                if (!S.options.ignoreErrors) throw le;
                H(`getTextContent - ignoring ExtGState: "${le}".`);
              }
            }));
            return;
          case EE:
            dt(), r && (h.level++, b.items.push({ type: "beginMarkedContent", tag: yt[0] instanceof lt ? yt[0].name : null }));
            break;
          case ho:
            if (dt(), r) {
              h.level++;
              let le = null;
              yt[1] instanceof Z && (le = yt[1].get("MCID")), b.items.push({ type: "beginMarkedContentProps", id: Number.isInteger(le) ? `${S.idFactory.getPageObjId()}_mc${le}` : null, tag: yt[0] instanceof lt ? yt[0].name : null });
            }
            break;
          case Zd:
            if (dt(), r) {
              if (h.level === 0) break;
              h.level--, b.items.push({ type: "endMarkedContent" });
            }
            break;
          case Ms:
            !Ot || Ot.font === O.font && Ot.fontSize === O.fontSize && Ot.fontName === O.fontName || dt();
        }
        if (b.items.length >= a.desiredSize) {
          kt = !0;
          break;
        }
      }
      kt ? gt(rx) : (dt(), tt(), V());
    }).catch((G) => {
      if (!(G instanceof xn)) {
        if (!this.options.ignoreErrors) throw G;
        H(`getTextContent - ignoring errors during "${e.name}" task: "${G}".`), dt(), tt();
      }
    });
  }
  async extractDataStructures(t, e) {
    const n = this.xref;
    let s;
    const r = this.readToUnicode(e.toUnicode);
    if (e.composite) {
      const f = t.get("CIDSystemInfo");
      f instanceof Z && (e.cidSystemInfo = { registry: xe(f.get("Registry")), ordering: xe(f.get("Ordering")), supplement: f.get("Supplement") });
      try {
        const d = t.get("CIDToGIDMap");
        d instanceof oe && (s = d.getBytes());
      } catch (d) {
        if (!this.options.ignoreErrors) throw d;
        H(`extractDataStructures - ignoring CIDToGIDMap data: "${d}".`);
      }
    }
    const a = [];
    let o, l = null;
    if (t.has("Encoding")) {
      if (o = t.get("Encoding"), o instanceof Z) {
        if (l = o.get("BaseEncoding"), l = l instanceof lt ? l.name : null, o.has("Differences")) {
          const f = o.get("Differences");
          let d = 0;
          for (const p of f) {
            const g = n.fetchIfRef(p);
            if (typeof g == "number") d = g;
            else {
              if (!(g instanceof lt)) throw new ht(`Invalid entry in 'Differences' array: ${g}`);
              a[d++] = g.name;
            }
          }
        }
      } else if (o instanceof lt) l = o.name;
      else {
        const f = "Encoding is not a Name nor a Dict";
        if (!this.options.ignoreErrors) throw new ht(f);
        H(f);
      }
      l !== "MacRomanEncoding" && l !== "MacExpertEncoding" && l !== "WinAnsiEncoding" && (l = null);
    }
    const c = !e.file || e.isInternalFont, h = vb()[e.name];
    if (l && c && h && (l = null), l) e.defaultEncoding = op(l);
    else {
      const f = !!(e.flags & u3), d = !!(e.flags & k_);
      o = Pl, e.type !== "TrueType" || d || (o = ap), (f || h) && (o = Wy, c && (/Symbol/i.test(e.name) ? o = Xy : /Dingbats/i.test(e.name) ? o = Yy : /Wingdings/i.test(e.name) && (o = ap))), e.defaultEncoding = o;
    }
    e.differences = a, e.baseEncodingName = l, e.hasEncoding = !!l || a.length > 0, e.dict = t, e.toUnicode = await r;
    const u = await this.buildToUnicode(e);
    return e.toUnicode = u, s && (e.cidToGidMap = this.readCidToGidMap(s, u)), e;
  }
  _simpleFontToUnicode(t, e = !1) {
    pn(!t.composite, "Must be a simple font.");
    const n = [], s = t.defaultEncoding.slice(), r = t.baseEncodingName, a = t.differences;
    for (const l in a) {
      const c = a[l];
      c !== ".notdef" && (s[l] = c);
    }
    const o = Ga();
    for (const l in s) {
      let c = s[l];
      if (c === "") continue;
      let h = o[c];
      if (h !== void 0) {
        n[l] = String.fromCharCode(h);
        continue;
      }
      let u = 0;
      switch (c[0]) {
        case "G":
          c.length === 3 && (u = parseInt(c.substring(1), 16));
          break;
        case "g":
          c.length === 5 && (u = parseInt(c.substring(1), 16));
          break;
        case "C":
        case "c":
          if (c.length >= 3 && c.length <= 4) {
            const f = c.substring(1);
            if (e) {
              u = parseInt(f, 16);
              break;
            }
            if (u = +f, Number.isNaN(u) && Number.isInteger(parseInt(f, 16))) return this._simpleFontToUnicode(t, !0);
          }
          break;
        case "u":
          h = ef(c, o), h !== -1 && (u = h);
          break;
        default:
          switch (c) {
            case "f_h":
            case "f_t":
            case "T_h":
              n[l] = c.replaceAll("_", "");
              continue;
          }
      }
      if (u > 0 && u <= 1114111 && Number.isInteger(u)) {
        if (r && u === +l) {
          const f = op(r);
          if (f && (c = f[l])) {
            n[l] = String.fromCharCode(o[c]);
            continue;
          }
        }
        n[l] = String.fromCodePoint(u);
      }
    }
    return n;
  }
  async buildToUnicode(t) {
    var e, n;
    if (t.hasIncludedToUnicodeMap = ((e = t.toUnicode) == null ? void 0 : e.length) > 0, t.hasIncludedToUnicodeMap)
      return !t.composite && t.hasEncoding && (t.fallbackToUnicode = this._simpleFontToUnicode(t)), t.toUnicode;
    if (!t.composite) return new v2(this._simpleFontToUnicode(t));
    if (t.composite && (t.cMap.builtInCMap && !(t.cMap instanceof Du) || ((n = t.cidSystemInfo) == null ? void 0 : n.registry) === "Adobe" && (t.cidSystemInfo.ordering === "GB1" || t.cidSystemInfo.ordering === "CNS1" || t.cidSystemInfo.ordering === "Japan1" || t.cidSystemInfo.ordering === "Korea1"))) {
      const { registry: s, ordering: r } = t.cidSystemInfo, a = lt.get(`${s}-${r}-UCS2`), o = await r5.create({ encoding: a, fetchBuiltInCMap: this._fetchBuiltInCMapBound, useCMap: null }), l = [], c = [];
      return t.cMap.forEach(function(h, u) {
        if (u > 65535) throw new ht("Max size of CID is 65,535");
        const f = o.lookup(u);
        if (f) {
          c.length = 0;
          for (let d = 0, p = f.length; d < p; d += 2) c.push((f.charCodeAt(d) << 8) + f.charCodeAt(d + 1));
          l[h] = String.fromCharCode(...c);
        }
      }), new v2(l);
    }
    return new Dr(t.firstChar, t.lastChar);
  }
  async readToUnicode(t) {
    if (!t) return null;
    if (t instanceof lt) {
      const e = await r5.create({ encoding: t, fetchBuiltInCMap: this._fetchBuiltInCMapBound, useCMap: null });
      return e instanceof Du ? new Dr(0, 65535) : new v2(e.getMap());
    }
    if (t instanceof oe) try {
      const e = await r5.create({ encoding: t, fetchBuiltInCMap: this._fetchBuiltInCMapBound, useCMap: null });
      if (e instanceof Du) return new Dr(0, 65535);
      const n = new Array(e.length);
      return e.forEach(function(s, r) {
        if (typeof r == "number") {
          n[s] = String.fromCodePoint(r);
          return;
        }
        r.length % 2 != 0 && (r = "\0" + r);
        const a = [];
        for (let o = 0; o < r.length; o += 2) {
          const l = r.charCodeAt(o) << 8 | r.charCodeAt(o + 1);
          if ((63488 & l) != 55296) {
            a.push(l);
            continue;
          }
          o += 2;
          const c = r.charCodeAt(o) << 8 | r.charCodeAt(o + 1);
          a.push(((1023 & l) << 10) + (1023 & c) + 65536);
        }
        n[s] = String.fromCodePoint(...a);
      }), new v2(n);
    } catch (e) {
      if (e instanceof xn) return null;
      if (this.options.ignoreErrors)
        return H(`readToUnicode - ignoring ToUnicode data: "${e}".`), null;
      throw e;
    }
    return null;
  }
  readCidToGidMap(t, e) {
    const n = [];
    for (let s = 0, r = t.length; s < r; s++) {
      const a = t[s++] << 8 | t[s], o = s >> 1;
      (a !== 0 || e.has(o)) && (n[o] = a);
    }
    return n;
  }
  extractWidths(t, e, n) {
    const s = this.xref;
    let r = [], a = 0;
    const o = [];
    let l;
    if (n.composite) {
      const u = t.get("DW");
      a = typeof u == "number" ? Math.ceil(u) : 1e3;
      const f = t.get("W");
      if (Array.isArray(f)) for (let d = 0, p = f.length; d < p; d++) {
        let g = s.fetchIfRef(f[d++]);
        if (!Number.isInteger(g)) break;
        const b = s.fetchIfRef(f[d]);
        if (Array.isArray(b)) for (const y of b) {
          const v = s.fetchIfRef(y);
          typeof v == "number" && (r[g] = v), g++;
        }
        else {
          if (!Number.isInteger(b)) break;
          {
            const y = s.fetchIfRef(f[++d]);
            if (typeof y != "number") continue;
            for (let v = g; v <= b; v++) r[v] = y;
          }
        }
      }
      if (n.vertical) {
        const d = t.getArray("DW2");
        let p = cs(d, 2) ? d : [880, -1e3];
        if (l = [p[1], 0.5 * a, p[0]], p = t.get("W2"), Array.isArray(p)) for (let g = 0, b = p.length; g < b; g++) {
          let y = s.fetchIfRef(p[g++]);
          if (!Number.isInteger(y)) break;
          const v = s.fetchIfRef(p[g]);
          if (Array.isArray(v)) for (let w = 0, _ = v.length; w < _; w++) {
            const x = [s.fetchIfRef(v[w++]), s.fetchIfRef(v[w++]), s.fetchIfRef(v[w])];
            cs(x, null) && (o[y] = x), y++;
          }
          else {
            if (!Number.isInteger(v)) break;
            {
              const w = [s.fetchIfRef(p[++g]), s.fetchIfRef(p[++g]), s.fetchIfRef(p[++g])];
              if (!cs(w, null)) continue;
              for (let _ = y; _ <= v; _++) o[_] = w;
            }
          }
        }
      }
    } else {
      const u = t.get("Widths");
      if (Array.isArray(u)) {
        let f = n.firstChar;
        for (const p of u) {
          const g = s.fetchIfRef(p);
          typeof g == "number" && (r[f] = g), f++;
        }
        const d = e.get("MissingWidth");
        a = typeof d == "number" ? d : 0;
      } else {
        const f = t.get("BaseFont");
        if (f instanceof lt) {
          const d = this.getBaseFontMetrics(f.name);
          r = this.buildCharCodeToWidth(d.widths, n), a = d.defaultWidth;
        }
      }
    }
    let c = !0, h = a;
    for (const u in r) {
      const f = r[u];
      if (f) if (h) {
        if (h !== f) {
          c = !1;
          break;
        }
      } else h = f;
    }
    c ? n.flags |= _9 : n.flags &= ~_9, n.defaultWidth = a, n.widths = r, n.defaultVMetrics = l, n.vmetrics = o;
  }
  isSerifFont(t) {
    const e = t.split("-", 1)[0];
    return e in Jy() || /serif/gi.test(e);
  }
  getBaseFontMetrics(t) {
    let e = 0, n = /* @__PURE__ */ Object.create(null), s = !1, r = B4()[t] || t;
    const a = mN();
    r in a || (r = this.isSerifFont(t) ? "Times-Roman" : "Helvetica");
    const o = a[r];
    return typeof o == "number" ? (e = o, s = !0) : n = o(), { defaultWidth: e, monospace: s, widths: n };
  }
  buildCharCodeToWidth(t, e) {
    const n = /* @__PURE__ */ Object.create(null), s = e.differences, r = e.defaultEncoding;
    for (let a = 0; a < 256; a++) a in s && t[s[a]] ? n[a] = t[s[a]] : a in r && t[r[a]] && (n[a] = t[r[a]]);
    return n;
  }
  preEvaluateFont(t) {
    const e = t;
    let n = t.get("Subtype");
    if (!(n instanceof lt)) throw new ht("invalid font Subtype");
    let s, r = !1;
    if (n.name === "Type0") {
      const h = t.get("DescendantFonts");
      if (!h) throw new ht("Descendant fonts are not specified");
      if (!((t = Array.isArray(h) ? this.xref.fetchIfRef(h[0]) : h) instanceof Z)) throw new ht("Descendant font is not a dictionary.");
      if (n = t.get("Subtype"), !(n instanceof lt)) throw new ht("invalid font Subtype");
      r = !0;
    }
    let a = t.get("FirstChar");
    Number.isInteger(a) || (a = 0);
    let o = t.get("LastChar");
    Number.isInteger(o) || (o = r ? 65535 : 255);
    const l = t.get("FontDescriptor"), c = t.get("ToUnicode") || e.get("ToUnicode");
    if (l) {
      s = new LL();
      const h = e.getRaw("Encoding");
      if (h instanceof lt) s.update(h.name);
      else if (h instanceof Dt) s.update(h.toString());
      else if (h instanceof Z) {
        for (const f of h.getRawValues()) if (f instanceof lt) s.update(f.name);
        else if (f instanceof Dt) s.update(f.toString());
        else if (Array.isArray(f)) {
          const d = f.length, p = new Array(d);
          for (let g = 0; g < d; g++) {
            const b = f[g];
            b instanceof lt ? p[g] = b.name : (typeof b == "number" || b instanceof Dt) && (p[g] = b.toString());
          }
          s.update(p.join());
        }
      }
      if (s.update(`${a}-${o}`), c instanceof oe) {
        const f = c.str || c, d = f.buffer ? new Uint8Array(f.buffer.buffer, 0, f.bufferLength) : new Uint8Array(f.bytes.buffer, f.start, f.end - f.start);
        s.update(d);
      } else c instanceof lt && s.update(c.name);
      const u = t.get("Widths") || e.get("Widths");
      if (Array.isArray(u)) {
        const f = [];
        for (const d of u) (typeof d == "number" || d instanceof Dt) && f.push(d.toString());
        s.update(f.join());
      }
      if (r) {
        s.update("compositeFont");
        const f = t.get("W") || e.get("W");
        if (Array.isArray(f)) {
          const p = [];
          for (const g of f) if (typeof g == "number" || g instanceof Dt) p.push(g.toString());
          else if (Array.isArray(g)) {
            const b = [];
            for (const y of g) (typeof y == "number" || y instanceof Dt) && b.push(y.toString());
            p.push(`[${b.join()}]`);
          }
          s.update(p.join());
        }
        const d = t.getRaw("CIDToGIDMap") || e.getRaw("CIDToGIDMap");
        d instanceof lt ? s.update(d.name) : d instanceof Dt ? s.update(d.toString()) : d instanceof oe && s.update(d.peekBytes());
      }
    }
    return { descriptor: l, dict: t, baseDict: e, composite: r, type: n.name, firstChar: a, lastChar: o, toUnicode: c, hash: s ? s.hexdigest() : "" };
  }
  async translateFont({ descriptor: t, dict: e, baseDict: n, composite: s, type: r, firstChar: a, lastChar: o, toUnicode: l, cssFontInfo: c }) {
    const h = r === "Type3";
    if (!t) {
      if (!h) {
        let q = e.get("BaseFont");
        if (!(q instanceof lt)) throw new ht("Base font is not specified");
        q = q.name.replaceAll(/[,_]/g, "-");
        const K = this.getBaseFontMetrics(q), z = q.split("-", 1)[0], j = (this.isSerifFont(z) ? hD : 0) | (K.monospace ? _9 : 0) | (vb()[z] ? u3 : k_), N = { type: r, name: q, loadedName: n.loadedName, systemFontInfo: null, widths: K.widths, defaultWidth: K.defaultWidth, isSimulatedFlags: !0, flags: j, firstChar: a, lastChar: o, toUnicode: l, xHeight: 0, capHeight: 0, italicAngle: 0, isType3Font: h }, Q = e.get("Widths"), Y = E_(q);
        let et = null;
        Y && (et = await this.fetchStandardFontData(Y), N.isInternalFont = !!et), !N.isInternalFont && this.options.useSystemFonts && (N.systemFontInfo = ix(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, q, Y, r));
        const $ = await this.extractDataStructures(e, N);
        if (Array.isArray(Q)) {
          const dt = [];
          let tt = a;
          for (const ut of Q) {
            const St = this.xref.fetchIfRef(ut);
            typeof St == "number" && (dt[tt] = St), tt++;
          }
          $.widths = dt;
        } else $.widths = this.buildCharCodeToWidth(K.widths, $);
        return new H_(q, et, $, this.options);
      }
      t = Z.empty;
    }
    let u = t.get("FontName"), f = e.get("BaseFont");
    typeof u == "string" && (u = lt.get(u)), typeof f == "string" && (f = lt.get(f));
    const d = u == null ? void 0 : u.name, p = f == null ? void 0 : f.name;
    if (h ? d || (u = lt.get(r)) : d !== p && (ue(`The FontDescriptor's FontName is "${d}" but should be the same as the Font's BaseFont "${p}".`), d && p && (p.startsWith(d) || !D_(d) && D_(p)) && (u = null), u || (u = f)), !(u instanceof lt)) throw new ht("invalid font name");
    let g, b, y, v, w;
    try {
      if (g = t.get("FontFile", "FontFile2", "FontFile3"), g) {
        if (!(g instanceof oe)) throw new ht("FontFile should be a stream");
        if (g.isEmpty) throw new ht("FontFile is empty");
      }
    } catch (q) {
      if (!this.options.ignoreErrors) throw q;
      H(`translateFont - fetching "${u.name}" font file: "${q}".`), g = null;
    }
    let _ = !1, x = null, k = null;
    if (g) {
      if (g.dict) {
        const q = g.dict.get("Subtype");
        q instanceof lt && (b = q.name), y = g.dict.get("Length1"), v = g.dict.get("Length2"), w = g.dict.get("Length3");
      }
    } else if (c) {
      const q = iw(u.name);
      q && (c.fontFamily = `${c.fontFamily}-PdfJS-XFA`, c.metrics = q.metrics || null, x = q.factors || null, g = await this.fetchStandardFontData(q.name), _ = !!g, n = e = AD(u.name), s = !0);
    } else if (!h) {
      const q = E_(u.name);
      q && (g = await this.fetchStandardFontData(q), _ = !!g), !_ && this.options.useSystemFonts && (k = ix(this.systemFontCache, this.idFactory, this.options.standardFontDataUrl, u.name, q, r));
    }
    const S = i0(e.getArray("FontMatrix"), f1), T = Wl(t.getArray("FontBBox") || e.getArray("FontBBox"), h ? [0, 0, 0, 0] : void 0);
    let I = t.get("Ascent");
    typeof I != "number" && (I = void 0);
    let R = t.get("Descent");
    typeof R != "number" && (R = void 0);
    let B = t.get("XHeight");
    typeof B != "number" && (B = 0);
    let L = t.get("CapHeight");
    typeof L != "number" && (L = 0);
    let it = t.get("Flags");
    Number.isInteger(it) || (it = 0);
    let O = t.get("ItalicAngle");
    typeof O != "number" && (O = 0);
    const at = { type: r, name: u.name, subtype: b, file: g, length1: y, length2: v, length3: w, isInternalFont: _, loadedName: n.loadedName, composite: s, fixedPitch: !1, fontMatrix: S, firstChar: a, lastChar: o, toUnicode: l, bbox: T, ascent: I, descent: R, xHeight: B, capHeight: L, flags: it, italicAngle: O, isType3Font: h, cssFontInfo: c, scaleFactors: x, systemFontInfo: k };
    if (s) {
      const q = n.get("Encoding");
      q instanceof lt && (at.cidEncoding = q.name);
      const K = await r5.create({ encoding: q, fetchBuiltInCMap: this._fetchBuiltInCMapBound, useCMap: null });
      at.cMap = K, at.vertical = at.cMap.vertical;
    }
    const W = await this.extractDataStructures(e, at);
    return this.extractWidths(e, t, W), new H_(u.name, g, W, this.options);
  }
  static buildFontPaths(t, e, n, s) {
    function r(a) {
      const o = `${t.loadedName}_path_${a}`;
      try {
        if (t.renderer.hasBuiltPath(a)) return;
        n.send("commonobj", [o, "FontPath", t.renderer.getPathJs(a)]);
      } catch (l) {
        if (s.ignoreErrors) {
          H(`buildFontPaths - ignoring ${o} glyph: "${l}".`);
          return;
        }
        throw l;
      }
    }
    for (const a of e) {
      r(a.fontChar);
      const o = a.accent;
      o != null && o.fontChar && r(o.fontChar);
    }
  }
  static get fallbackFontDict() {
    const t = new Z();
    return t.set("BaseFont", lt.get("Helvetica")), t.set("Type", lt.get("FallbackType")), t.set("Subtype", lt.get("FallbackType")), t.set("Encoding", lt.get("WinAnsiEncoding")), At(this, "fallbackFontDict", t);
  }
}
var cg, u1, df, FD, ID;
class R6 {
  constructor({ loadedName: t, font: e, dict: n }) {
    F(this, df);
    F(this, cg, !1);
    F(this, u1, null);
    this.loadedName = t, this.font = e, this.dict = n, this.type3Dependencies = e.isType3Font ? /* @__PURE__ */ new Set() : null;
  }
  send(t) {
    m(this, cg) || (E(this, cg, !0), t.send("commonobj", [this.loadedName, "Font", this.font.exportData()]));
  }
  fallback(t, e) {
    this.font.data && (this.font.disableFontFace = !0, nf.buildFontPaths(this.font, this.font.glyphCacheValues, t, e));
  }
  loadType3Data(t, e, n) {
    if (m(this, u1)) return m(this, u1);
    const { font: s, type3Dependencies: r } = this;
    pn(s.isType3Font, "Must be a Type3 font.");
    const a = t.clone({ ignoreErrors: !1 }), o = new $i(t.type3FontRefs);
    this.dict.objId && !o.has(this.dict.objId) && o.put(this.dict.objId), a.type3FontRefs = o;
    let l = Promise.resolve();
    const c = this.dict.get("CharProcs"), h = this.dict.get("Resources") || e, u = /* @__PURE__ */ Object.create(null), [f, d, p, g] = s.bbox, b = p - f, y = g - d, v = Math.hypot(b, y);
    for (const w of c.getKeys()) l = l.then(() => {
      const _ = c.get(w), x = new Xn();
      return a.getOperatorList({ stream: _, task: n, resources: h, operatorList: x }).then(() => {
        switch (x.fnArray[0]) {
          case W8:
            D(this, df, FD).call(this, x, v);
            break;
          case kE:
            v || D(this, df, ID).call(this, x);
        }
        u[w] = x.getIR();
        for (const k of x.dependencies) r.add(k);
      }).catch(function(k) {
        H(`Type3 font resource "${w}" is not available.`);
        const S = new Xn();
        u[w] = S.getIR();
      });
    });
    return E(this, u1, l.then(() => {
      s.charProcOperatorList = u, this._bbox && (s.isCharBBox = !0, s.bbox = this._bbox);
    })), m(this, u1);
  }
}
cg = new WeakMap(), u1 = new WeakMap(), df = new WeakSet(), FD = function(t, e = NaN) {
  const n = Ee.normalizeRect(t.argsArray[0].slice(2)), s = n[2] - n[0], r = n[3] - n[1], a = Math.hypot(s, r);
  s === 0 || r === 0 ? (t.fnArray.splice(0, 1), t.argsArray.splice(0, 1)) : (e === 0 || Math.round(a / e) >= 10) && (this._bbox ?? (this._bbox = [1 / 0, 1 / 0, -1 / 0, -1 / 0]), Ee.rectBoundingBox(...n, this._bbox));
  let o = 0, l = t.length;
  for (; o < l; ) {
    switch (t.fnArray[o]) {
      case W8:
        break;
      case qy:
      case T4:
      case zy:
      case i3:
      case F4:
      case n3:
      case Uy:
      case xg:
      case oc:
      case co:
      case Hy:
      case kg:
      case s3:
      case mE:
        t.fnArray.splice(o, 1), t.argsArray.splice(o, 1), l--;
        continue;
      case eh:
        const [c] = t.argsArray[o];
        let h = 0, u = c.length;
        for (; h < u; ) {
          const [f] = c[h];
          switch (f) {
            case "TR":
            case "TR2":
            case "HT":
            case "BG":
            case "BG2":
            case "UCR":
            case "UCR2":
              c.splice(h, 1), u--;
              continue;
          }
          h++;
        }
    }
    o++;
  }
}, ID = function(t) {
  let e = 1;
  const n = t.length;
  for (; e < n; ) {
    if (t.fnArray[e] === m1) {
      const s = t.argsArray[e][2];
      this._bbox ?? (this._bbox = [1 / 0, 1 / 0, -1 / 0, -1 / 0]), Ee.rectBoundingBox(...s, this._bbox);
    }
    e++;
  }
};
class S9 {
  constructor(t = new MD()) {
    this.state = t, this.stateStack = [];
  }
  save() {
    const t = this.state;
    this.stateStack.push(this.state), this.state = t.clone();
  }
  restore() {
    const t = this.stateStack.pop();
    t && (this.state = t);
  }
  transform(t) {
    this.state.ctm = Ee.transform(this.state.ctm, t);
  }
}
class zL {
  constructor() {
    this.ctm = new Float32Array(Fa), this.fontName = null, this.fontSize = 0, this.loadedName = null, this.font = null, this.fontMatrix = f1, this.textMatrix = Fa.slice(), this.textLineMatrix = Fa.slice(), this.charSpacing = 0, this.wordSpacing = 0, this.leading = 0, this.textHScale = 1, this.textRise = 0;
  }
  setTextMatrix(t, e, n, s, r, a) {
    const o = this.textMatrix;
    o[0] = t, o[1] = e, o[2] = n, o[3] = s, o[4] = r, o[5] = a;
  }
  setTextLineMatrix(t, e, n, s, r, a) {
    const o = this.textLineMatrix;
    o[0] = t, o[1] = e, o[2] = n, o[3] = s, o[4] = r, o[5] = a;
  }
  translateTextMatrix(t, e) {
    const n = this.textMatrix;
    n[4] = n[0] * t + n[2] * e + n[4], n[5] = n[1] * t + n[3] * e + n[5];
  }
  translateTextLineMatrix(t, e) {
    const n = this.textLineMatrix;
    n[4] = n[0] * t + n[2] * e + n[4], n[5] = n[1] * t + n[3] * e + n[5];
  }
  carriageReturn() {
    this.translateTextLineMatrix(0, -this.leading), this.textMatrix = this.textLineMatrix.slice();
  }
  clone() {
    const t = Object.create(this);
    return t.textMatrix = this.textMatrix.slice(), t.textLineMatrix = this.textLineMatrix.slice(), t.fontMatrix = this.fontMatrix.slice(), t;
  }
}
class MD {
  constructor() {
    this.ctm = new Float32Array(Fa), this.font = null, this.textRenderingMode = ER, this._fillColorSpace = this._strokeColorSpace = Se.gray, this.patternFillColorSpace = null, this.patternStrokeColorSpace = null, this.currentPointX = this.currentPointY = 0, this.pathMinMax = new Float32Array([1 / 0, 1 / 0, -1 / 0, -1 / 0]), this.pathBuffer = [];
  }
  get fillColorSpace() {
    return this._fillColorSpace;
  }
  set fillColorSpace(t) {
    this._fillColorSpace = this.patternFillColorSpace = t;
  }
  get strokeColorSpace() {
    return this._strokeColorSpace;
  }
  set strokeColorSpace(t) {
    this._strokeColorSpace = this.patternStrokeColorSpace = t;
  }
  clone({ newPath: t = !1 } = {}) {
    const e = Object.create(this);
    return t && (e.pathBuffer = [], e.pathMinMax = new Float32Array([1 / 0, 1 / 0, -1 / 0, -1 / 0])), e;
  }
}
const xu = class xu {
  static get opMap() {
    return At(this, "opMap", Object.assign(/* @__PURE__ */ Object.create(null), { w: { id: pE, numArgs: 1, variableArgs: !1 }, J: { id: mB, numArgs: 1, variableArgs: !1 }, j: { id: gB, numArgs: 1, variableArgs: !1 }, M: { id: bB, numArgs: 1, variableArgs: !1 }, d: { id: yB, numArgs: 2, variableArgs: !1 }, ri: { id: mE, numArgs: 1, variableArgs: !1 }, i: { id: wB, numArgs: 1, variableArgs: !1 }, gs: { id: eh, numArgs: 1, variableArgs: !1 }, q: { id: Ma, numArgs: 0, variableArgs: !1 }, Q: { id: Ms, numArgs: 0, variableArgs: !1 }, cm: { id: Gl, numArgs: 6, variableArgs: !1 }, m: { id: W9, numArgs: 2, variableArgs: !1 }, l: { id: L8, numArgs: 2, variableArgs: !1 }, c: { id: O8, numArgs: 6, variableArgs: !1 }, v: { id: $8, numArgs: 4, variableArgs: !1 }, y: { id: q8, numArgs: 4, variableArgs: !1 }, h: { id: z8, numArgs: 0, variableArgs: !1 }, re: { id: U8, numArgs: 4, variableArgs: !1 }, S: { id: Ly, numArgs: 0, variableArgs: !1 }, s: { id: X9, numArgs: 0, variableArgs: !1 }, f: { id: H8, numArgs: 0, variableArgs: !1 }, F: { id: H8, numArgs: 0, variableArgs: !1 }, "f*": { id: gE, numArgs: 0, variableArgs: !1 }, B: { id: Oy, numArgs: 0, variableArgs: !1 }, "B*": { id: $y, numArgs: 0, variableArgs: !1 }, b: { id: Y9, numArgs: 0, variableArgs: !1 }, "b*": { id: K9, numArgs: 0, variableArgs: !1 }, n: { id: j8, numArgs: 0, variableArgs: !1 }, W: { id: vB, numArgs: 0, variableArgs: !1 }, "W*": { id: _B, numArgs: 0, variableArgs: !1 }, BT: { id: Z9, numArgs: 0, variableArgs: !1 }, ET: { id: J9, numArgs: 0, variableArgs: !1 }, Tc: { id: G8, numArgs: 1, variableArgs: !1 }, Tw: { id: V8, numArgs: 1, variableArgs: !1 }, Tz: { id: bE, numArgs: 1, variableArgs: !1 }, TL: { id: yE, numArgs: 1, variableArgs: !1 }, Tf: { id: o0, numArgs: 2, variableArgs: !1 }, Tr: { id: wE, numArgs: 1, variableArgs: !1 }, Ts: { id: vE, numArgs: 1, variableArgs: !1 }, Td: { id: _E, numArgs: 2, variableArgs: !1 }, TD: { id: xE, numArgs: 2, variableArgs: !1 }, Tm: { id: x1, numArgs: 6, variableArgs: !1 }, "T*": { id: c9, numArgs: 0, variableArgs: !1 }, Tj: { id: Tl, numArgs: 1, variableArgs: !1 }, TJ: { id: Q9, numArgs: 1, variableArgs: !1 }, "'": { id: t3, numArgs: 1, variableArgs: !1 }, '"': { id: e3, numArgs: 3, variableArgs: !1 }, d0: { id: kE, numArgs: 2, variableArgs: !1 }, d1: { id: W8, numArgs: 6, variableArgs: !1 }, CS: { id: qy, numArgs: 1, variableArgs: !1 }, cs: { id: T4, numArgs: 1, variableArgs: !1 }, SC: { id: zy, numArgs: 4, variableArgs: !0 }, SCN: { id: i3, numArgs: 33, variableArgs: !0 }, sc: { id: F4, numArgs: 4, variableArgs: !0 }, scn: { id: n3, numArgs: 33, variableArgs: !0 }, G: { id: Uy, numArgs: 1, variableArgs: !1 }, g: { id: xg, numArgs: 1, variableArgs: !1 }, RG: { id: oc, numArgs: 3, variableArgs: !1 }, rg: { id: co, numArgs: 3, variableArgs: !1 }, K: { id: Hy, numArgs: 4, variableArgs: !1 }, k: { id: kg, numArgs: 4, variableArgs: !1 }, sh: { id: s3, numArgs: 1, variableArgs: !1 }, BI: { id: xB, numArgs: 0, variableArgs: !1 }, ID: { id: kB, numArgs: 0, variableArgs: !1 }, EI: { id: AE, numArgs: 1, variableArgs: !1 }, Do: { id: X8, numArgs: 1, variableArgs: !1 }, MP: { id: SE, numArgs: 1, variableArgs: !1 }, DP: { id: CE, numArgs: 2, variableArgs: !1 }, BMC: { id: EE, numArgs: 1, variableArgs: !1 }, BDC: { id: ho, numArgs: 2, variableArgs: !1 }, EMC: { id: Zd, numArgs: 0, variableArgs: !1 }, BX: { id: DE, numArgs: 0, variableArgs: !1 }, EX: { id: TE, numArgs: 0, variableArgs: !1 }, BM: null, BD: null, true: null, fa: null, fal: null, fals: null, false: null, nu: null, nul: null, null: null }));
  }
  constructor(t, e, n = new S9()) {
    this.parser = new lc({ lexer: new ka(t, xu.opMap), xref: e }), this.stateManager = n, this.nonProcessedArgs = [], this._isPathOp = !1, this._numInvalidPathOPS = 0;
  }
  get savedStatesDepth() {
    return this.stateManager.stateStack.length;
  }
  read(t) {
    let e = t.args;
    for (; ; ) {
      const n = this.parser.getObj();
      if (n instanceof Li) {
        const s = n.cmd, r = xu.opMap[s];
        if (!r) {
          H(`Unknown command "${s}".`);
          continue;
        }
        const a = r.id, o = r.numArgs;
        let l = e !== null ? e.length : 0;
        if (this._isPathOp || (this._numInvalidPathOPS = 0), this._isPathOp = a >= W9 && a <= j8, r.variableArgs) l > o && ue(`Command ${s}: expected [0, ${o}] args, but received ${l} args.`);
        else {
          if (l !== o) {
            const c = this.nonProcessedArgs;
            for (; l > o; )
              c.push(e.shift()), l--;
            for (; l < o && c.length !== 0; )
              e === null && (e = []), e.unshift(c.pop()), l++;
          }
          if (l < o) {
            const c = `command ${s}: expected ${o} args, but received ${l} args.`;
            if (this._isPathOp && ++this._numInvalidPathOPS > xu.MAX_INVALID_PATH_OPS) throw new ht(`Invalid ${c}`);
            H(`Skipping ${c}`), e !== null && (e.length = 0);
            continue;
          }
        }
        return this.preprocessCommand(a, e), t.fn = a, t.args = e, !0;
      }
      if (n === fn) return !1;
      if (n !== null && (e === null && (e = []), e.push(n), e.length > 33))
        throw new ht("Too many arguments");
    }
  }
  preprocessCommand(t, e) {
    switch (0 | t) {
      case Ma:
        this.stateManager.save();
        break;
      case Ms:
        this.stateManager.restore();
        break;
      case Gl:
        this.stateManager.transform(e);
    }
  }
};
ft(xu, "MAX_INVALID_PATH_OPS", 10);
let sf = xu;
class UL extends sf {
  constructor(t) {
    super(new fs(t));
  }
  parse() {
    const t = { fn: 0, args: [] }, e = { fontSize: 0, fontName: "", fontColor: new Uint8ClampedArray(3) };
    try {
      for (; t.args.length = 0, !!this.read(t); ) {
        if (this.savedStatesDepth !== 0) continue;
        const { fn: n, args: s } = t;
        switch (0 | n) {
          case o0:
            const [r, a] = s;
            r instanceof lt && (e.fontName = r.name), typeof a == "number" && a > 0 && (e.fontSize = a);
            break;
          case co:
            Se.rgb.getRgbItem(s, 0, e.fontColor, 0);
            break;
          case xg:
            Se.gray.getRgbItem(s, 0, e.fontColor, 0);
            break;
          case kg:
            Se.cmyk.getRgbItem(s, 0, e.fontColor, 0);
        }
      }
    } catch (n) {
      H(`parseDefaultAppearance - ignoring errors: "${n}".`);
    }
    return e;
  }
}
function sw(i) {
  return new UL(i).parse();
}
class HL extends sf {
  constructor(t, e, n, s) {
    var r;
    super(t), this.stream = t, this.evaluatorOptions = e, this.xref = n, this.globalColorSpaceCache = s, this.resources = (r = t.dict) == null ? void 0 : r.get("Resources");
  }
  parse() {
    const t = { fn: 0, args: [] };
    let e = { scaleFactor: 1, fontSize: 0, fontName: "", fontColor: new Uint8ClampedArray(3), fillColorSpace: Se.gray }, n = !1;
    const s = [];
    try {
      for (; t.args.length = 0, !(n || !this.read(t)); ) {
        const { fn: r, args: a } = t;
        switch (0 | r) {
          case Ma:
            s.push({ scaleFactor: e.scaleFactor, fontSize: e.fontSize, fontName: e.fontName, fontColor: e.fontColor.slice(), fillColorSpace: e.fillColorSpace });
            break;
          case Ms:
            e = s.pop() || e;
            break;
          case x1:
            e.scaleFactor *= Math.hypot(a[0], a[1]);
            break;
          case o0:
            const [o, l] = a;
            o instanceof lt && (e.fontName = o.name), typeof l == "number" && l > 0 && (e.fontSize = l * e.scaleFactor);
            break;
          case T4:
            e.fillColorSpace = Se.parse({ cs: a[0], xref: this.xref, resources: this.resources, pdfFunctionFactory: this._pdfFunctionFactory, globalColorSpaceCache: this.globalColorSpaceCache, localColorSpaceCache: this._localColorSpaceCache });
            break;
          case F4:
            e.fillColorSpace.getRgbItem(a, 0, e.fontColor, 0);
            break;
          case co:
            Se.rgb.getRgbItem(a, 0, e.fontColor, 0);
            break;
          case xg:
            Se.gray.getRgbItem(a, 0, e.fontColor, 0);
            break;
          case kg:
            Se.cmyk.getRgbItem(a, 0, e.fontColor, 0);
            break;
          case Tl:
          case Q9:
          case t3:
          case e3:
            n = !0;
        }
      }
    } catch (r) {
      H(`parseAppearanceStream - ignoring errors: "${r}".`);
    }
    return this.stream.reset(), delete e.scaleFactor, delete e.fillColorSpace, e;
  }
  get _localColorSpaceCache() {
    return At(this, "_localColorSpaceCache", new SD());
  }
  get _pdfFunctionFactory() {
    return At(this, "_pdfFunctionFactory", new ED({ xref: this.xref, isEvalSupported: this.evaluatorOptions.isEvalSupported }));
  }
}
function Ao(i, t) {
  return i[0] === i[1] && i[1] === i[2] ? `${be(i[0] / 255)} ${t ? "g" : "G"}` : Array.from(i, (e) => be(e / 255)).join(" ") + " " + (t ? "rg" : "RG");
}
class uo {
  constructor(t, e) {
    this.xref = t, this.widths = null, this.firstChar = 1 / 0, this.lastChar = -1 / 0, this.fontFamily = e;
    const n = new OffscreenCanvas(1, 1);
    this.ctxMeasure = n.getContext("2d", { willReadFrequently: !0 }), uo._fontNameId || (uo._fontNameId = 1), this.fontName = lt.get(`InvalidPDFjsFont_${e}_${uo._fontNameId++}`);
  }
  get fontDescriptorRef() {
    if (!uo._fontDescriptorRef) {
      const t = new Z(this.xref);
      t.set("Type", lt.get("FontDescriptor")), t.set("FontName", this.fontName), t.set("FontFamily", "MyriadPro Regular"), t.set("FontBBox", [0, 0, 0, 0]), t.set("FontStretch", lt.get("Normal")), t.set("FontWeight", 400), t.set("ItalicAngle", 0), uo._fontDescriptorRef = this.xref.getNewPersistentRef(t);
    }
    return uo._fontDescriptorRef;
  }
  get descendantFontRef() {
    const t = new Z(this.xref);
    t.set("BaseFont", this.fontName), t.set("Type", lt.get("Font")), t.set("Subtype", lt.get("CIDFontType0")), t.set("CIDToGIDMap", lt.get("Identity")), t.set("FirstChar", this.firstChar), t.set("LastChar", this.lastChar), t.set("FontDescriptor", this.fontDescriptorRef), t.set("DW", 1e3);
    const e = [], n = [...this.widths.entries()].sort();
    let s = null, r = null;
    for (const [o, l] of n) s ? o === s + r.length ? r.push(l) : (e.push(s, r), s = o, r = [l]) : (s = o, r = [l]);
    s && e.push(s, r), t.set("W", e);
    const a = new Z(this.xref);
    return a.set("Ordering", "Identity"), a.set("Registry", "Adobe"), a.set("Supplement", 0), t.set("CIDSystemInfo", a), this.xref.getNewPersistentRef(t);
  }
  get baseFontRef() {
    const t = new Z(this.xref);
    return t.set("BaseFont", this.fontName), t.set("Type", lt.get("Font")), t.set("Subtype", lt.get("Type0")), t.set("Encoding", lt.get("Identity-H")), t.set("DescendantFonts", [this.descendantFontRef]), t.set("ToUnicode", lt.get("Identity-H")), this.xref.getNewPersistentRef(t);
  }
  get resources() {
    const t = new Z(this.xref), e = new Z(this.xref);
    return e.set(this.fontName.name, this.baseFontRef), t.set("Font", e), t;
  }
  _createContext() {
    return this.widths = /* @__PURE__ */ new Map(), this.ctxMeasure.font = `1000px ${this.fontFamily}`, this.ctxMeasure;
  }
  createFontResources(t) {
    const e = this._createContext();
    for (const n of t.split(/\r\n?|\n/)) for (const s of n.split("")) {
      const r = s.charCodeAt(0);
      if (this.widths.has(r)) continue;
      const a = e.measureText(s), o = Math.ceil(a.width);
      this.widths.set(r, o), this.firstChar = Math.min(r, this.firstChar), this.lastChar = Math.max(r, this.lastChar);
    }
    return this.resources;
  }
  static getFirstPositionInfo(t, e, n) {
    const [s, r, a, o] = t;
    let l = a - s, c = o - r;
    e % 180 != 0 && ([l, c] = [c, l]);
    const h = p1 * n;
    return { coords: [0, c + Hv * n - h], bbox: [0, 0, l, c], matrix: e !== 0 ? c3(e, c, h) : void 0 };
  }
  createAppearance(t, e, n, s, r, a) {
    const o = this._createContext(), l = [];
    let c = -1 / 0;
    for (const L of t.split(/\r\n?|\n/)) {
      l.push(L);
      const it = o.measureText(L).width;
      c = Math.max(c, it);
      for (const O of zB(L)) {
        const at = String.fromCodePoint(O);
        let W = this.widths.get(O);
        if (W === void 0) {
          const q = o.measureText(at);
          W = Math.ceil(q.width), this.widths.set(O, W), this.firstChar = Math.min(O, this.firstChar), this.lastChar = Math.max(O, this.lastChar);
        }
      }
    }
    c *= s / 1e3;
    const [h, u, f, d] = e;
    let p = f - h, g = d - u;
    n % 180 != 0 && ([p, g] = [g, p]);
    let b = 1;
    c > p && (b = p / c);
    let y = 1;
    const v = p1 * s, w = Hv * s, _ = v * l.length;
    _ > g && (y = g / _);
    const x = s * Math.min(b, y), k = ["q", `0 0 ${be(p)} ${be(g)} re W n`, "BT", `1 0 0 1 0 ${be(g + w)} Tm 0 Tc ${Ao(r, !0)}`, `/${this.fontName.name} ${be(x)} Tf`], { resources: S } = this;
    if ((a = typeof a == "number" && a >= 0 && a <= 1 ? a : 1) !== 1) {
      k.push("/R0 gs");
      const L = new Z(this.xref), it = new Z(this.xref);
      it.set("ca", a), it.set("CA", a), it.set("Type", lt.get("ExtGState")), L.set("R0", it), S.set("ExtGState", L);
    }
    const T = be(v);
    for (const L of l) k.push(`0 -${T} Td <${HB(L)}> Tj`);
    k.push("ET", "Q");
    const I = k.join(`
`), R = new Z(this.xref);
    if (R.set("Subtype", lt.get("Form")), R.set("Type", lt.get("XObject")), R.set("BBox", [0, 0, p, g]), R.set("Length", I.length), R.set("Resources", S), n) {
      const L = c3(n, p, g);
      R.set("Matrix", L);
    }
    const B = new fs(I);
    return B.dict = R, B;
  }
}
class RD {
  constructor(t, e, n) {
    this.root = t, this.xref = e, this._type = n;
  }
  getAll() {
    const t = /* @__PURE__ */ new Map();
    if (!this.root) return t;
    const e = this.xref, n = new $i();
    n.put(this.root);
    const s = [this.root];
    for (; s.length > 0; ) {
      const r = e.fetchIfRef(s.shift());
      if (!(r instanceof Z)) continue;
      if (r.has("Kids")) {
        const o = r.get("Kids");
        if (!Array.isArray(o)) continue;
        for (const l of o) {
          if (n.has(l)) throw new ht(`Duplicate entry in "${this._type}" tree.`);
          s.push(l), n.put(l);
        }
        continue;
      }
      const a = r.get(this._type);
      if (Array.isArray(a)) for (let o = 0, l = a.length; o < l; o += 2) t.set(e.fetchIfRef(a[o]), e.fetchIfRef(a[o + 1]));
    }
    return t;
  }
  getRaw(t) {
    if (!this.root) return null;
    const e = this.xref;
    let n = e.fetchIfRef(this.root), s = 0;
    for (; n.has("Kids"); ) {
      if (++s > 10)
        return H(`Search depth limit reached for "${this._type}" tree.`), null;
      const a = n.get("Kids");
      if (!Array.isArray(a)) return null;
      let o = 0, l = a.length - 1;
      for (; o <= l; ) {
        const c = o + l >> 1, h = e.fetchIfRef(a[c]), u = h.get("Limits");
        if (t < e.fetchIfRef(u[0])) l = c - 1;
        else {
          if (!(t > e.fetchIfRef(u[1]))) {
            n = h;
            break;
          }
          o = c + 1;
        }
      }
      if (o > l) return null;
    }
    const r = n.get(this._type);
    if (Array.isArray(r)) {
      let a = 0, o = r.length - 2;
      for (; a <= o; ) {
        const l = a + o >> 1, c = l + (1 & l), h = e.fetchIfRef(r[c]);
        if (t < h) o = c - 2;
        else {
          if (!(t > h)) return r[c + 1];
          a = c + 2;
        }
      }
    }
    return null;
  }
  get(t) {
    return this.xref.fetchIfRef(this.getRaw(t));
  }
}
class G1 extends RD {
  constructor(t, e) {
    super(t, e, "Names");
  }
}
class p3 extends RD {
  constructor(t, e) {
    super(t, e, "Nums");
  }
}
function rw() {
  (function() {
    A9 = /* @__PURE__ */ Object.create(null);
  })(), function() {
    d9 = /* @__PURE__ */ Object.create(null), f9 = /* @__PURE__ */ Object.create(null), su = /* @__PURE__ */ Object.create(null);
  }(), function() {
    wb.clear();
  }(), va.cleanup();
}
function ax(i) {
  return i instanceof Z ? i.has("UF") ? i.get("UF") : i.has("F") ? i.get("F") : i.has("Unix") ? i.get("Unix") : i.has("Mac") ? i.get("Mac") : i.has("DOS") ? i.get("DOS") : null : null;
}
var hg;
class Fb {
  constructor(t, e, n = !1) {
    F(this, hg, !1);
    t instanceof Z && (this.xref = e, this.root = t, t.has("FS") && (this.fs = t.get("FS")), t.has("RF") && H("Related file specifications are not supported"), n || (t.has("EF") ? E(this, hg, !0) : H("Non-embedded file specifications are not supported")));
  }
  get filename() {
    let t = "";
    const e = ax(this.root);
    return e && typeof e == "string" && (t = xe(e, !0).replaceAll("\\\\", "\\").replaceAll("\\/", "/").replaceAll("\\", "/")), At(this, "filename", t || "unnamed");
  }
  get content() {
    var e;
    if (!m(this, hg)) return null;
    this._contentRef || (this._contentRef = ax((e = this.root) == null ? void 0 : e.get("EF")));
    let t = null;
    if (this._contentRef) {
      const n = this.xref.fetchIfRef(this._contentRef);
      n instanceof oe ? t = n.getBytes() : H("Embedded file specification points to non-existing/invalid content");
    } else H("Embedded file specification does not have any content");
    return t;
  }
  get description() {
    var n;
    let t = "";
    const e = (n = this.root) == null ? void 0 : n.get("Desc");
    return e && typeof e == "string" && (t = xe(e)), At(this, "description", t);
  }
  get serializable() {
    return { rawFilename: this.filename, filename: (t = this.filename, t.substring(t.lastIndexOf("/") + 1)), content: this.content, description: this.description };
    var t;
  }
}
hg = new WeakMap();
const M2 = 0, jL = -2, GL = -3, ox = -4, VL = -5, lx = -6, cx = -9;
function lu(i, t) {
  const e = i[t];
  return e === " " || e === `
` || e === "\r" || e === "	";
}
class BD {
  _resolveEntities(t) {
    return t.replaceAll(/&([^;]+);/g, (e, n) => {
      if (n.substring(0, 2) === "#x") return String.fromCodePoint(parseInt(n.substring(2), 16));
      if (n.substring(0, 1) === "#") return String.fromCodePoint(parseInt(n.substring(1), 10));
      switch (n) {
        case "lt":
          return "<";
        case "gt":
          return ">";
        case "amp":
          return "&";
        case "quot":
          return '"';
        case "apos":
          return "'";
      }
      return this.onResolveEntity(n);
    });
  }
  _parseContent(t, e) {
    const n = [];
    let s = e;
    function r() {
      for (; s < t.length && lu(t, s); ) ++s;
    }
    for (; s < t.length && !lu(t, s) && t[s] !== ">" && t[s] !== "/"; ) ++s;
    const a = t.substring(e, s);
    for (r(); s < t.length && t[s] !== ">" && t[s] !== "/" && t[s] !== "?"; ) {
      r();
      let o = "", l = "";
      for (; s < t.length && !lu(t, s) && t[s] !== "="; )
        o += t[s], ++s;
      if (r(), t[s] !== "=") return null;
      ++s, r();
      const c = t[s];
      if (c !== '"' && c !== "'") return null;
      const h = t.indexOf(c, ++s);
      if (h < 0) return null;
      l = t.substring(s, h), n.push({ name: o, value: this._resolveEntities(l) }), s = h + 1, r();
    }
    return { name: a, attributes: n, parsed: s - e };
  }
  _parseProcessingInstruction(t, e) {
    let n = e;
    for (; n < t.length && !lu(t, n) && t[n] !== ">" && t[n] !== "?" && t[n] !== "/"; ) ++n;
    const s = t.substring(e, n);
    (function() {
      for (; n < t.length && lu(t, n); ) ++n;
    })();
    const r = n;
    for (; n < t.length && (t[n] !== "?" || t[n + 1] !== ">"); ) ++n;
    return { name: s, value: t.substring(r, n), parsed: n - e };
  }
  parseXml(t) {
    let e = 0;
    for (; e < t.length; ) {
      let n = e;
      if (t[e] === "<") {
        ++n;
        let s;
        switch (t[n]) {
          case "/":
            if (++n, s = t.indexOf(">", n), s < 0) {
              this.onError(cx);
              return;
            }
            this.onEndElement(t.substring(n, s)), n = s + 1;
            break;
          case "?":
            ++n;
            const r = this._parseProcessingInstruction(t, n);
            if (t.substring(n + r.parsed, n + r.parsed + 2) !== "?>") {
              this.onError(GL);
              return;
            }
            this.onPi(r.name, r.value), n += r.parsed + 2;
            break;
          case "!":
            if (t.substring(n + 1, n + 3) === "--") {
              if (s = t.indexOf("-->", n + 3), s < 0) {
                this.onError(VL);
                return;
              }
              this.onComment(t.substring(n + 3, s)), n = s + 3;
            } else if (t.substring(n + 1, n + 8) === "[CDATA[") {
              if (s = t.indexOf("]]>", n + 8), s < 0) {
                this.onError(jL);
                return;
              }
              this.onCdata(t.substring(n + 8, s)), n = s + 3;
            } else {
              if (t.substring(n + 1, n + 8) !== "DOCTYPE") {
                this.onError(lx);
                return;
              }
              {
                const l = t.indexOf("[", n + 8);
                let c = !1;
                if (s = t.indexOf(">", n + 8), s < 0) {
                  this.onError(ox);
                  return;
                }
                if (l > 0 && s > l) {
                  if (s = t.indexOf("]>", n + 8), s < 0) {
                    this.onError(ox);
                    return;
                  }
                  c = !0;
                }
                const h = t.substring(n + 8, s + (c ? 1 : 0));
                this.onDoctype(h), n = s + (c ? 2 : 1);
              }
            }
            break;
          default:
            const a = this._parseContent(t, n);
            if (a === null) {
              this.onError(lx);
              return;
            }
            let o = !1;
            if (t.substring(n + a.parsed, n + a.parsed + 2) === "/>") o = !0;
            else if (t.substring(n + a.parsed, n + a.parsed + 1) !== ">") {
              this.onError(cx);
              return;
            }
            this.onBeginElement(a.name, a.attributes, o), n += a.parsed + (o ? 2 : 1);
        }
      } else {
        for (; n < t.length && t[n] !== "<"; ) n++;
        const s = t.substring(e, n);
        this.onText(this._resolveEntities(s));
      }
      e = n;
    }
  }
  onResolveEntity(t) {
    return `&${t};`;
  }
  onPi(t, e) {
  }
  onComment(t) {
  }
  onCdata(t) {
  }
  onDoctype(t) {
  }
  onText(t) {
  }
  onBeginElement(t, e, n) {
  }
  onEndElement(t) {
  }
  onError(t) {
  }
}
class R2 {
  constructor(t, e) {
    this.nodeName = t, this.nodeValue = e, Object.defineProperty(this, "parentNode", { value: null, writable: !0 });
  }
  get firstChild() {
    var t;
    return (t = this.childNodes) == null ? void 0 : t[0];
  }
  get nextSibling() {
    const t = this.parentNode.childNodes;
    if (!t) return;
    const e = t.indexOf(this);
    return e !== -1 ? t[e + 1] : void 0;
  }
  get textContent() {
    return this.childNodes ? this.childNodes.map((t) => t.textContent).join("") : this.nodeValue || "";
  }
  get children() {
    return this.childNodes || [];
  }
  hasChildNodes() {
    var t;
    return ((t = this.childNodes) == null ? void 0 : t.length) > 0;
  }
  searchNode(t, e) {
    var a;
    if (e >= t.length) return this;
    const n = t[e];
    if (n.name.startsWith("#") && e < t.length - 1) return this.searchNode(t, e + 1);
    const s = [];
    let r = this;
    for (; ; ) {
      if (n.name === r.nodeName) {
        if (n.pos !== 0) {
          if (s.length === 0) return null;
          {
            const [o] = s.pop();
            let l = 0;
            for (const c of o.childNodes) if (n.name === c.nodeName) {
              if (l === n.pos) return c.searchNode(t, e + 1);
              l++;
            }
            return r.searchNode(t, e + 1);
          }
        }
        {
          const o = r.searchNode(t, e + 1);
          if (o !== null) return o;
        }
      }
      if (((a = r.childNodes) == null ? void 0 : a.length) > 0)
        s.push([r, 0]), r = r.childNodes[0];
      else {
        if (s.length === 0) return null;
        for (; s.length !== 0; ) {
          const [o, l] = s.pop(), c = l + 1;
          if (c < o.childNodes.length) {
            s.push([o, c]), r = o.childNodes[c];
            break;
          }
        }
        if (s.length === 0) return null;
      }
    }
  }
  dump(t) {
    if (this.nodeName !== "#text") {
      if (t.push(`<${this.nodeName}`), this.attributes) for (const e of this.attributes) t.push(` ${e.name}="${Eu(e.value)}"`);
      if (this.hasChildNodes()) {
        t.push(">");
        for (const e of this.childNodes) e.dump(t);
        t.push(`</${this.nodeName}>`);
      } else this.nodeValue ? t.push(`>${Eu(this.nodeValue)}</${this.nodeName}>`) : t.push("/>");
    } else t.push(Eu(this.nodeValue));
  }
}
class P4 extends BD {
  constructor({ hasAttributes: t = !1, lowerCaseName: e = !1 }) {
    super(), this._currentFragment = null, this._stack = null, this._errorCode = M2, this._hasAttributes = t, this._lowerCaseName = e;
  }
  parseFromString(t) {
    if (this._currentFragment = [], this._stack = [], this._errorCode = M2, this.parseXml(t), this._errorCode !== M2) return;
    const [e] = this._currentFragment;
    return e ? { documentElement: e } : void 0;
  }
  onText(t) {
    if (function(s) {
      for (let r = 0, a = s.length; r < a; r++) if (!lu(s, r)) return !1;
      return !0;
    }(t)) return;
    const e = new R2("#text", t);
    this._currentFragment.push(e);
  }
  onCdata(t) {
    const e = new R2("#text", t);
    this._currentFragment.push(e);
  }
  onBeginElement(t, e, n) {
    this._lowerCaseName && (t = t.toLowerCase());
    const s = new R2(t);
    s.childNodes = [], this._hasAttributes && (s.attributes = e), this._currentFragment.push(s), n || (this._stack.push(this._currentFragment), this._currentFragment = s.childNodes);
  }
  onEndElement(t) {
    this._currentFragment = this._stack.pop() || [];
    const e = this._currentFragment.at(-1);
    if (!e) return null;
    for (const n of e.childNodes) n.parentNode = e;
    return e;
  }
  onError(t) {
    this._errorCode = t;
  }
}
class WL {
  constructor(t) {
    t = this._repair(t);
    const e = new P4({ lowerCaseName: !0 }).parseFromString(t);
    this._metadataMap = /* @__PURE__ */ new Map(), this._data = t, e && this._parse(e);
  }
  _repair(t) {
    return t.replace(/^[^<]+/, "").replaceAll(/>\\376\\377([^<]+)/g, function(e, n) {
      const s = n.replaceAll(/\\([0-3])([0-7])([0-7])/g, function(a, o, l, c) {
        return String.fromCharCode(64 * o + 8 * l + 1 * c);
      }).replaceAll(/&(amp|apos|gt|lt|quot);/g, function(a, o) {
        switch (o) {
          case "amp":
            return "&";
          case "apos":
            return "'";
          case "gt":
            return ">";
          case "lt":
            return "<";
          case "quot":
            return '"';
        }
        throw new Error(`_repair: ${o} isn't defined.`);
      }), r = [">"];
      for (let a = 0, o = s.length; a < o; a += 2) {
        const l = 256 * s.charCodeAt(a) + s.charCodeAt(a + 1);
        l >= 32 && l < 127 && l !== 60 && l !== 62 && l !== 38 ? r.push(String.fromCharCode(l)) : r.push("&#x" + (65536 + l).toString(16).substring(1) + ";");
      }
      return r.join("");
    });
  }
  _getSequence(t) {
    const e = t.nodeName;
    return e !== "rdf:bag" && e !== "rdf:seq" && e !== "rdf:alt" ? null : t.childNodes.filter((n) => n.nodeName === "rdf:li");
  }
  _parseArray(t) {
    if (!t.hasChildNodes()) return;
    const [e] = t.childNodes, n = this._getSequence(e) || [];
    this._metadataMap.set(t.nodeName, n.map((s) => s.textContent.trim()));
  }
  _parse(t) {
    let e = t.documentElement;
    if (e.nodeName !== "rdf:rdf")
      for (e = e.firstChild; e && e.nodeName !== "rdf:rdf"; ) e = e.nextSibling;
    if (e && e.nodeName === "rdf:rdf" && e.hasChildNodes()) {
      for (const n of e.childNodes) if (n.nodeName === "rdf:description") for (const s of n.childNodes) {
        const r = s.nodeName;
        switch (r) {
          case "#text":
            continue;
          case "dc:creator":
          case "dc:subject":
            this._parseArray(s);
            continue;
        }
        this._metadataMap.set(r, s.textContent.trim());
      }
    }
  }
  get serializable() {
    return { parsedData: this._metadataMap, rawData: this._data };
  }
}
const PD = 1, ND = 2, Ib = 3, LD = 4, Mb = 5;
var b4, OD, Zr, Rb, Bb, $D, qD;
const th = class th {
  constructor(t, e, n) {
    F(this, b4);
    this.xref = t, this.dict = e, this.ref = n instanceof Dt ? n : null, this.roleMap = /* @__PURE__ */ new Map(), this.structParentIds = null;
  }
  init() {
    this.readRoleMap();
  }
  addAnnotationIdToPage(t, e) {
    D(this, b4, OD).call(this, t, e, LD);
  }
  readRoleMap() {
    const t = this.dict.get("RoleMap");
    if (t instanceof Z) for (const [e, n] of t) n instanceof lt && this.roleMap.set(e, n.name);
  }
  static async canCreateStructureTree({ catalogRef: t, pdfManager: e, newAnnotationsByPage: n }) {
    var a;
    if (!(t instanceof Dt))
      return H("Cannot save the struct tree: no catalog reference."), !1;
    let s = 0, r = !0;
    for (const [o, l] of n) {
      const { ref: c } = await e.getPage(o);
      if (!(c instanceof Dt)) {
        H(`Cannot save the struct tree: page ${o} has no ref.`), r = !0;
        break;
      }
      for (const h of l) (a = h.accessibilityData) != null && a.type && (h.parentTreeId = s++, r = !1);
    }
    if (r) {
      for (const o of n.values()) for (const l of o) delete l.parentTreeId;
      return !1;
    }
    return !0;
  }
  static async createStructureTree({ newAnnotationsByPage: t, xref: e, catalogRef: n, pdfManager: s, changes: r }) {
    const a = await s.ensureCatalog("cloneDict"), o = new Ts();
    o.put(n, a);
    const l = e.getNewTemporaryRef();
    a.set("StructTreeRoot", l);
    const c = new Z(e);
    c.set("Type", lt.get("StructTreeRoot"));
    const h = e.getNewTemporaryRef();
    c.set("ParentTree", h);
    const u = [];
    c.set("K", u), o.put(l, c);
    const f = new Z(e), d = [];
    f.set("Nums", d);
    const p = await D(this, Zr, Rb).call(this, { newAnnotationsByPage: t, structTreeRootRef: l, structTreeRoot: null, kids: u, nums: d, xref: e, pdfManager: s, changes: r, cache: o });
    c.set("ParentTreeNextKey", p), o.put(h, f);
    for (const [g, b] of o.items()) r.put(g, { data: b });
  }
  async canUpdateStructTree({ pdfManager: t, newAnnotationsByPage: e }) {
    var l, c;
    if (!this.ref)
      return H("Cannot update the struct tree: no root reference."), !1;
    let n = this.dict.get("ParentTreeNextKey");
    if (!Number.isInteger(n) || n < 0)
      return H("Cannot update the struct tree: invalid next key."), !1;
    const s = this.dict.get("ParentTree");
    if (!(s instanceof Z))
      return H("Cannot update the struct tree: ParentTree isn't a dict."), !1;
    const r = s.get("Nums");
    if (!Array.isArray(r))
      return H("Cannot update the struct tree: nums isn't an array."), !1;
    const a = new p3(s, this.xref);
    for (const h of e.keys()) {
      const { pageDict: u } = await t.getPage(h);
      if (!u.has("StructParents")) continue;
      const f = u.get("StructParents");
      if (!Number.isInteger(f) || !Array.isArray(a.get(f)))
        return H(`Cannot save the struct tree: page ${h} has a wrong id.`), !1;
    }
    let o = !0;
    for (const [h, u] of e) {
      const { pageDict: f } = await t.getPage(h);
      D(l = th, Zr, $D).call(l, { elements: u, xref: this.xref, pageDict: f, numberTree: a });
      for (const d of u) (c = d.accessibilityData) != null && c.type && (d.accessibilityData.structParent >= 0 || (d.parentTreeId = n++), o = !1);
    }
    if (o) {
      for (const h of e.values()) for (const u of h)
        delete u.parentTreeId, delete u.structTreeParent;
      return !1;
    }
    return !0;
  }
  async updateStructureTree({ newAnnotationsByPage: t, pdfManager: e, changes: n }) {
    var d;
    const { ref: s, xref: r } = this, a = this.dict.clone(), o = new Ts();
    o.put(s, a);
    let l, c = a.getRaw("ParentTree");
    c instanceof Dt ? l = r.fetch(c) : (l = c, c = r.getNewTemporaryRef(), a.set("ParentTree", c)), l = l.clone(), o.put(c, l);
    let h = l.getRaw("Nums"), u = null;
    h instanceof Dt && (u = h, h = r.fetch(u)), h = h.slice(), u || l.set("Nums", h);
    const f = await D(d = th, Zr, Rb).call(d, { newAnnotationsByPage: t, structTreeRootRef: s, structTreeRoot: this, kids: null, nums: h, xref: r, pdfManager: e, changes: n, cache: o });
    if (f !== -1) {
      a.set("ParentTreeNextKey", f), u && o.put(u, h);
      for (const [p, g] of o.items()) n.put(p, { data: g });
    }
  }
};
b4 = new WeakSet(), OD = function(t, e, n) {
  if (!(t instanceof Dt) || e < 0) return;
  this.structParentIds || (this.structParentIds = new Ts());
  let s = this.structParentIds.get(t);
  s || (s = [], this.structParentIds.put(t, s)), s.push([e, n]);
}, Zr = new WeakSet(), Rb = async function({ newAnnotationsByPage: t, structTreeRootRef: e, structTreeRoot: n, kids: s, nums: r, xref: a, pdfManager: o, changes: l, cache: c }) {
  var d, p;
  const h = lt.get("OBJR");
  let u, f = -1;
  for (const [g, b] of t) {
    const y = await o.getPage(g), { ref: v } = y, w = v instanceof Dt;
    for (const { accessibilityData: _, ref: x, parentTreeId: k, structTreeParent: S } of b) {
      if (!(_ != null && _.type)) continue;
      const { structParent: T } = _;
      if (n && Number.isInteger(T) && T >= 0) {
        let L = (u || (u = /* @__PURE__ */ new Map())).get(g);
        L === void 0 && (L = new zD(n, y.pageDict).collectObjects(v), u.set(g, L));
        const it = L == null ? void 0 : L.get(T);
        if (it) {
          const O = a.fetch(it).clone();
          D(d = th, Zr, Bb).call(d, O, _), l.put(it, { data: O });
          continue;
        }
      }
      f = Math.max(f, k);
      const I = a.getNewTemporaryRef(), R = new Z(a);
      D(p = th, Zr, Bb).call(p, R, _), await D(this, Zr, qD).call(this, { structTreeParent: S, tagDict: R, newTagRef: I, structTreeRootRef: e, fallbackKids: s, xref: a, cache: c });
      const B = new Z(a);
      R.set("K", B), B.set("Type", h), w && B.set("Pg", v), B.set("Obj", x), c.put(I, R), r.push(k, I);
    }
  }
  return f + 1;
}, Bb = function(t, { type: e, title: n, lang: s, alt: r, expanded: a, actualText: o }) {
  t.set("S", lt.get(e)), n && t.set("T", Rr(n)), s && t.set("Lang", Rr(s)), r && t.set("Alt", Rr(r)), a && t.set("E", Rr(a)), o && t.set("ActualText", Rr(o));
}, $D = function({ elements: t, xref: e, pageDict: n, numberTree: s }) {
  const r = /* @__PURE__ */ new Map();
  for (const c of t) if (c.structTreeParentId) {
    const h = parseInt(c.structTreeParentId.split("_mc")[1], 10);
    let u = r.get(h);
    u || (u = [], r.set(h, u)), u.push(c);
  }
  const a = n.get("StructParents");
  if (!Number.isInteger(a)) return;
  const o = s.get(a), l = (c, h, u) => {
    const f = r.get(c);
    if (f) {
      const d = h.getRaw("P"), p = e.fetchIfRef(d);
      if (d instanceof Dt && p instanceof Z) {
        const g = { ref: u, dict: h };
        for (const b of f) b.structTreeParent = g;
      }
      return !0;
    }
    return !1;
  };
  for (const c of o) {
    if (!(c instanceof Dt)) continue;
    const h = e.fetch(c), u = h.get("K");
    if (Number.isInteger(u)) l(u, h, c);
    else if (Array.isArray(u)) for (let f of u) {
      if (f = e.fetchIfRef(f), Number.isInteger(f) && l(f, h, c)) break;
      if (!(f instanceof Z)) continue;
      if (!ki(f.get("Type"), "MCR")) break;
      const d = f.get("MCID");
      if (Number.isInteger(d) && l(d, h, c)) break;
    }
  }
}, qD = async function({ structTreeParent: t, tagDict: e, newTagRef: n, structTreeRootRef: s, fallbackKids: r, xref: a, cache: o }) {
  let l, c = null;
  t ? ({ ref: c } = t, l = t.dict.getRaw("P") || s) : l = s, e.set("P", l);
  const h = a.fetchIfRef(l);
  if (!h) {
    r.push(n);
    return;
  }
  let u = o.get(l);
  u || (u = h.clone(), o.put(l, u));
  const f = u.getRaw("K");
  let d = f instanceof Dt ? o.get(f) : null;
  if (!d) {
    d = a.fetchIfRef(f), d = Array.isArray(d) ? d.slice() : [f];
    const g = a.getNewTemporaryRef();
    u.set("K", g), o.put(g, d);
  }
  const p = d.indexOf(c);
  d.splice(p >= 0 ? p + 1 : d.length, 0, n);
}, F(th, Zr);
let fp = th;
class XL {
  constructor(t, e) {
    this.tree = t, this.xref = t.xref, this.dict = e, this.kids = [], this.parseKids();
  }
  get role() {
    const t = this.dict.get("S"), e = t instanceof lt ? t.name : "", { root: n } = this.tree;
    return n.roleMap.get(e) ?? e;
  }
  parseKids() {
    let t = null;
    const e = this.dict.getRaw("Pg");
    e instanceof Dt && (t = e.toString());
    const n = this.dict.get("K");
    if (Array.isArray(n)) for (const s of n) {
      const r = this.parseKid(t, this.xref.fetchIfRef(s));
      r && this.kids.push(r);
    }
    else {
      const s = this.parseKid(t, n);
      s && this.kids.push(s);
    }
  }
  parseKid(t, e) {
    if (Number.isInteger(e)) return this.tree.pageDict.objId !== t ? null : new l5({ type: PD, mcid: e, pageObjId: t });
    if (!(e instanceof Z)) return null;
    const n = e.getRaw("Pg");
    n instanceof Dt && (t = n.toString());
    const s = e.get("Type") instanceof lt ? e.get("Type").name : null;
    if (s === "MCR") {
      if (this.tree.pageDict.objId !== t) return null;
      const r = e.getRaw("Stm");
      return new l5({ type: ND, refObjId: r instanceof Dt ? r.toString() : null, pageObjId: t, mcid: e.get("MCID") });
    }
    if (s === "OBJR") {
      if (this.tree.pageDict.objId !== t) return null;
      const r = e.getRaw("Obj");
      return new l5({ type: Ib, refObjId: r instanceof Dt ? r.toString() : null, pageObjId: t });
    }
    return new l5({ type: Mb, dict: e });
  }
}
class l5 {
  constructor({ type: t, dict: e = null, mcid: n = null, pageObjId: s = null, refObjId: r = null }) {
    this.type = t, this.dict = e, this.mcid = n, this.pageObjId = s, this.refObjId = r, this.parentNode = null;
  }
}
class zD {
  constructor(t, e) {
    this.root = t, this.xref = (t == null ? void 0 : t.xref) ?? null, this.rootDict = (t == null ? void 0 : t.dict) ?? null, this.pageDict = e, this.nodes = [];
  }
  collectObjects(t) {
    var a;
    if (!(this.root && this.rootDict && t instanceof Dt)) return null;
    const e = this.rootDict.get("ParentTree");
    if (!e) return null;
    const n = (a = this.root.structParentIds) == null ? void 0 : a.get(t);
    if (!n) return null;
    const s = /* @__PURE__ */ new Map(), r = new p3(e, this.xref);
    for (const [o] of n) {
      const l = r.getRaw(o);
      l instanceof Dt && s.set(o, l);
    }
    return s;
  }
  parse(t) {
    var o, l;
    if (!(this.root && this.rootDict && t instanceof Dt)) return;
    const e = this.rootDict.get("ParentTree");
    if (!e) return;
    const n = this.pageDict.get("StructParents"), s = (o = this.root.structParentIds) == null ? void 0 : o.get(t);
    if (!Number.isInteger(n) && !s) return;
    const r = /* @__PURE__ */ new Map(), a = new p3(e, this.xref);
    if (Number.isInteger(n)) {
      const c = a.get(n);
      if (Array.isArray(c)) for (const h of c) h instanceof Dt && this.addNode(this.xref.fetch(h), r);
    }
    if (s) for (const [c, h] of s) {
      const u = a.get(c);
      if (u) {
        const f = this.addNode(this.xref.fetchIfRef(u), r);
        ((l = f == null ? void 0 : f.kids) == null ? void 0 : l.length) === 1 && f.kids[0].type === Ib && (f.kids[0].type = h);
      }
    }
  }
  addNode(t, e, n = 0) {
    if (n > 40)
      return H("StructTree MAX_DEPTH reached."), null;
    if (!(t instanceof Z)) return null;
    if (e.has(t)) return e.get(t);
    const s = new XL(this, t);
    e.set(t, s);
    const r = t.get("P");
    if (!(r instanceof Z) || ki(r.get("Type"), "StructTreeRoot"))
      return this.addTopLevelNode(t, s) || e.delete(t), s;
    const a = this.addNode(r, e, n + 1);
    if (!a) return s;
    let o = !1;
    for (const l of a.kids) l.type === Mb && l.dict === t && (l.parentNode = s, o = !0);
    return o || e.delete(t), s;
  }
  addTopLevelNode(t, e) {
    const n = this.rootDict.get("K");
    if (!n) return !1;
    if (n instanceof Z)
      return n.objId !== t.objId ? !1 : (this.nodes[0] = e, !0);
    if (!Array.isArray(n)) return !0;
    let s = !1;
    for (let r = 0; r < n.length; r++) {
      const a = n[r];
      (a == null ? void 0 : a.toString()) === t.objId && (this.nodes[r] = e, s = !0);
    }
    return s;
  }
  get serializable() {
    function t(n, s, r = 0) {
      if (r > 40) {
        H("StructTree too deep to be fully serialized.");
        return;
      }
      const a = /* @__PURE__ */ Object.create(null);
      a.role = n.role, a.children = [], s.children.push(a);
      let o = n.dict.get("Alt");
      typeof o != "string" && (o = n.dict.get("ActualText")), typeof o == "string" && (a.alt = xe(o));
      const l = n.dict.get("A");
      if (l instanceof Z) {
        const h = Wl(l.getArray("BBox"), null);
        if (h) a.bbox = h;
        else {
          const u = l.get("Width"), f = l.get("Height");
          typeof u == "number" && u > 0 && typeof f == "number" && f > 0 && (a.bbox = [0, 0, u, f]);
        }
      }
      const c = n.dict.get("Lang");
      typeof c == "string" && (a.lang = xe(c));
      for (const h of n.kids) {
        const u = h.type === Mb ? h.parentNode : null;
        u ? t(u, a, r + 1) : h.type === PD || h.type === ND ? a.children.push({ type: "content", id: `p${h.pageObjId}_mc${h.mcid}` }) : h.type === Ib ? a.children.push({ type: "object", id: h.refObjId }) : h.type === LD && a.children.push({ type: "annotation", id: `pdfjs_internal_id_${h.refObjId}` });
      }
    }
    const e = /* @__PURE__ */ Object.create(null);
    e.children = [], e.role = "Root";
    for (const n of this.nodes) n && t(n, e);
    return e;
  }
}
const m3 = (function(t, e, n) {
  if (!Array.isArray(n) || n.length < 2) return !1;
  const [s, r, ...a] = n;
  if (!t(s) && !Number.isInteger(s) || !e(r)) return !1;
  const o = a.length;
  let l = !0;
  switch (r.name) {
    case "XYZ":
      if (o < 2 || o > 3) return !1;
      break;
    case "Fit":
    case "FitB":
      return o === 0;
    case "FitH":
    case "FitBH":
    case "FitV":
    case "FitBV":
      if (o > 1) return !1;
      break;
    case "FitR":
      if (o !== 4) return !1;
      l = !1;
      break;
    default:
      return !1;
  }
  for (const c of a) if (!(typeof c == "number" || l && c === null)) return !1;
  return !0;
}).bind(null, (i) => i instanceof Dt, ki);
function B6(i) {
  return i instanceof Z && (i = i.get("D")), m3(i) ? i : null;
}
function hx(i) {
  let t = i.get("D");
  if (t) {
    if (t instanceof lt && (t = t.name), typeof t == "string") return xe(t, !0);
    if (m3(t)) return JSON.stringify(t);
  }
  return null;
}
var Wd, Pe, Hi, UD, HD, jD, GD, VD, WD, Pb, XD, YD;
const y4 = class y4 {
  constructor(t, e) {
    F(this, Hi);
    F(this, Wd, null);
    F(this, Pe, null);
    ft(this, "builtInCMapCache", /* @__PURE__ */ new Map());
    ft(this, "fontCache", new Ts());
    ft(this, "globalColorSpaceCache", new kL());
    ft(this, "globalImageCache", new Sb());
    ft(this, "nonBlendModesSet", new $i());
    ft(this, "pageDictCache", new Ts());
    ft(this, "pageIndexCache", new Ts());
    ft(this, "pageKidsCountCache", new Ts());
    ft(this, "standardFontDataCache", /* @__PURE__ */ new Map());
    ft(this, "systemFontCache", /* @__PURE__ */ new Map());
    if (this.pdfManager = t, this.xref = e, E(this, Pe, e.getCatalogObj()), !(m(this, Pe) instanceof Z)) throw new ht("Catalog object is not a dictionary.");
    this.toplevelPagesDict;
  }
  cloneDict() {
    return m(this, Pe).clone();
  }
  get version() {
    const t = m(this, Pe).get("Version");
    if (t instanceof lt) {
      if (NE.test(t.name)) return At(this, "version", t.name);
      H(`Invalid PDF catalog version: ${t.name}`);
    }
    return At(this, "version", null);
  }
  get lang() {
    const t = m(this, Pe).get("Lang");
    return At(this, "lang", t && typeof t == "string" ? xe(t) : null);
  }
  get needsRendering() {
    const t = m(this, Pe).get("NeedsRendering");
    return At(this, "needsRendering", typeof t == "boolean" && t);
  }
  get collection() {
    let t = null;
    try {
      const e = m(this, Pe).get("Collection");
      e instanceof Z && e.size > 0 && (t = e);
    } catch (e) {
      if (e instanceof ti) throw e;
      ue("Cannot fetch Collection entry; assuming no collection is present.");
    }
    return At(this, "collection", t);
  }
  get acroForm() {
    let t = null;
    try {
      const e = m(this, Pe).get("AcroForm");
      e instanceof Z && e.size > 0 && (t = e);
    } catch (e) {
      if (e instanceof ti) throw e;
      ue("Cannot fetch AcroForm entry; assuming no forms are present.");
    }
    return At(this, "acroForm", t);
  }
  get acroFormRef() {
    const t = m(this, Pe).getRaw("AcroForm");
    return At(this, "acroFormRef", t instanceof Dt ? t : null);
  }
  get metadata() {
    var n;
    const t = m(this, Pe).getRaw("Metadata");
    if (!(t instanceof Dt)) return At(this, "metadata", null);
    let e = null;
    try {
      const s = this.xref.fetch(t, !((n = this.xref.encrypt) != null && n.encryptMetadata));
      if (s instanceof oe && s.dict instanceof Z) {
        const r = s.dict.get("Type"), a = s.dict.get("Subtype");
        if (ki(r, "Metadata") && ki(a, "XML")) {
          const o = np(s.getString());
          o && (e = new WL(o).serializable);
        }
      }
    } catch (s) {
      if (s instanceof ti) throw s;
      ue(`Skipping invalid Metadata: "${s}".`);
    }
    return At(this, "metadata", e);
  }
  get markInfo() {
    let t = null;
    try {
      t = D(this, Hi, UD).call(this);
    } catch (e) {
      if (e instanceof ti) throw e;
      H("Unable to read mark info.");
    }
    return At(this, "markInfo", t);
  }
  get structTreeRoot() {
    let t = null;
    try {
      t = D(this, Hi, HD).call(this);
    } catch (e) {
      if (e instanceof ti) throw e;
      H("Unable read to structTreeRoot info.");
    }
    return At(this, "structTreeRoot", t);
  }
  get toplevelPagesDict() {
    const t = m(this, Pe).get("Pages");
    if (!(t instanceof Z)) throw new ht("Invalid top-level pages dictionary.");
    return At(this, "toplevelPagesDict", t);
  }
  get documentOutline() {
    let t = null;
    try {
      t = D(this, Hi, jD).call(this);
    } catch (e) {
      if (e instanceof ti) throw e;
      H("Unable to read document outline.");
    }
    return At(this, "documentOutline", t);
  }
  get permissions() {
    let t = null;
    try {
      t = D(this, Hi, GD).call(this);
    } catch (e) {
      if (e instanceof ti) throw e;
      H("Unable to read permissions.");
    }
    return At(this, "permissions", t);
  }
  get optionalContentConfig() {
    let t = null;
    try {
      const e = m(this, Pe).get("OCProperties");
      if (!e) return At(this, "optionalContentConfig", null);
      const n = e.get("D");
      if (!n) return At(this, "optionalContentConfig", null);
      const s = e.get("OCGs");
      if (!Array.isArray(s)) return At(this, "optionalContentConfig", null);
      const r = new Ts();
      for (const a of s) a instanceof Dt && !r.has(a) && r.put(a, D(this, Hi, VD).call(this, a));
      t = D(this, Hi, WD).call(this, n, r);
    } catch (e) {
      if (e instanceof ti) throw e;
      H(`Unable to read optional content config: ${e}`);
    }
    return At(this, "optionalContentConfig", t);
  }
  setActualNumPages(t = null) {
    E(this, Wd, t);
  }
  get hasActualNumPages() {
    return m(this, Wd) !== null;
  }
  get _pagesCount() {
    const t = this.toplevelPagesDict.get("Count");
    if (!Number.isInteger(t)) throw new ht("Page count in top-level pages dictionary is not an integer.");
    return At(this, "_pagesCount", t);
  }
  get numPages() {
    return m(this, Wd) ?? this._pagesCount;
  }
  get destinations() {
    var n;
    const t = D(this, Hi, Pb).call(this), e = /* @__PURE__ */ Object.create(null);
    for (const s of t) if (s instanceof G1) for (const [r, a] of s.getAll()) {
      const o = B6(a);
      o && (e[xe(r, !0)] = o);
    }
    else if (s instanceof Z) for (const [r, a] of s) {
      const o = B6(a);
      o && (e[n = xe(r, !0)] || (e[n] = o));
    }
    return At(this, "destinations", e);
  }
  getDestination(t) {
    if (this.hasOwnProperty("destinations")) return this.destinations[t] ?? null;
    const e = D(this, Hi, Pb).call(this);
    for (const n of e) if (n instanceof G1 || n instanceof Z) {
      const s = B6(n.get(t));
      if (s) return s;
    }
    if (e.length) {
      const n = this.destinations[t];
      if (n) return n;
    }
    return null;
  }
  get pageLabels() {
    let t = null;
    try {
      t = D(this, Hi, XD).call(this);
    } catch (e) {
      if (e instanceof ti) throw e;
      H("Unable to read page labels.");
    }
    return At(this, "pageLabels", t);
  }
  get pageLayout() {
    const t = m(this, Pe).get("PageLayout");
    let e = "";
    if (t instanceof lt) switch (t.name) {
      case "SinglePage":
      case "OneColumn":
      case "TwoColumnLeft":
      case "TwoColumnRight":
      case "TwoPageLeft":
      case "TwoPageRight":
        e = t.name;
    }
    return At(this, "pageLayout", e);
  }
  get pageMode() {
    const t = m(this, Pe).get("PageMode");
    let e = "UseNone";
    if (t instanceof lt) switch (t.name) {
      case "UseNone":
      case "UseOutlines":
      case "UseThumbs":
      case "FullScreen":
      case "UseOC":
      case "UseAttachments":
        e = t.name;
    }
    return At(this, "pageMode", e);
  }
  get viewerPreferences() {
    const t = m(this, Pe).get("ViewerPreferences");
    if (!(t instanceof Z)) return At(this, "viewerPreferences", null);
    let e = null;
    for (const [n, s] of t) {
      let r;
      switch (n) {
        case "HideToolbar":
        case "HideMenubar":
        case "HideWindowUI":
        case "FitWindow":
        case "CenterWindow":
        case "DisplayDocTitle":
        case "PickTrayByPDFSize":
          typeof s == "boolean" && (r = s);
          break;
        case "NonFullScreenPageMode":
          if (s instanceof lt) switch (s.name) {
            case "UseNone":
            case "UseOutlines":
            case "UseThumbs":
            case "UseOC":
              r = s.name;
              break;
            default:
              r = "UseNone";
          }
          break;
        case "Direction":
          if (s instanceof lt) switch (s.name) {
            case "L2R":
            case "R2L":
              r = s.name;
              break;
            default:
              r = "L2R";
          }
          break;
        case "ViewArea":
        case "ViewClip":
        case "PrintArea":
        case "PrintClip":
          if (s instanceof lt) switch (s.name) {
            case "MediaBox":
            case "CropBox":
            case "BleedBox":
            case "TrimBox":
            case "ArtBox":
              r = s.name;
              break;
            default:
              r = "CropBox";
          }
          break;
        case "PrintScaling":
          if (s instanceof lt) switch (s.name) {
            case "None":
            case "AppDefault":
              r = s.name;
              break;
            default:
              r = "AppDefault";
          }
          break;
        case "Duplex":
          if (s instanceof lt) switch (s.name) {
            case "Simplex":
            case "DuplexFlipShortEdge":
            case "DuplexFlipLongEdge":
              r = s.name;
              break;
            default:
              r = "None";
          }
          break;
        case "PrintPageRange":
          Array.isArray(s) && s.length % 2 == 0 && s.every((a, o, l) => Number.isInteger(a) && a > 0 && (o === 0 || a >= l[o - 1]) && a <= this.numPages) && (r = s);
          break;
        case "NumCopies":
          Number.isInteger(s) && s > 0 && (r = s);
          break;
        default:
          H(`Ignoring non-standard key in ViewerPreferences: ${n}.`);
          continue;
      }
      r !== void 0 ? (e ?? (e = /* @__PURE__ */ Object.create(null)), e[n] = r) : H(`Bad value, for key "${n}", in ViewerPreferences: ${s}.`);
    }
    return At(this, "viewerPreferences", e);
  }
  get openAction() {
    const t = m(this, Pe).get("OpenAction"), e = /* @__PURE__ */ Object.create(null);
    if (t instanceof Z) {
      const n = new Z(this.xref);
      n.set("A", t);
      const s = { url: null, dest: null, action: null };
      y4.parseDestDictionary({ destDict: n, resultObj: s }), Array.isArray(s.dest) ? e.dest = s.dest : s.action && (e.action = s.action);
    } else m3(t) && (e.dest = t);
    return At(this, "openAction", jy(e) > 0 ? e : null);
  }
  get attachments() {
    const t = m(this, Pe).get("Names");
    let e = null;
    if (t instanceof Z && t.has("EmbeddedFiles")) {
      const n = new G1(t.getRaw("EmbeddedFiles"), this.xref);
      for (const [s, r] of n.getAll()) {
        const a = new Fb(r, this.xref);
        e ?? (e = /* @__PURE__ */ Object.create(null)), e[xe(s, !0)] = a.serializable;
      }
    }
    return At(this, "attachments", e);
  }
  get xfaImages() {
    const t = m(this, Pe).get("Names");
    let e = null;
    if (t instanceof Z && t.has("XFAImages")) {
      const n = new G1(t.getRaw("XFAImages"), this.xref);
      for (const [s, r] of n.getAll()) r instanceof oe && (e ?? (e = /* @__PURE__ */ new Map()), e.set(xe(s, !0), r.getBytes()));
    }
    return At(this, "xfaImages", e);
  }
  get jsActions() {
    const t = D(this, Hi, YD).call(this);
    let e = M4(this.xref, m(this, Pe), dB);
    if (t) {
      e || (e = /* @__PURE__ */ Object.create(null));
      for (const [n, s] of t) n in e ? e[n].push(s) : e[n] = [s];
    }
    return At(this, "jsActions", e);
  }
  async cleanup(t = !1) {
    rw(), this.globalColorSpaceCache.clear(), this.globalImageCache.clear(t), this.pageKidsCountCache.clear(), this.pageIndexCache.clear(), this.pageDictCache.clear(), this.nonBlendModesSet.clear();
    for (const { dict: e } of await Promise.all(this.fontCache)) delete e.cacheKey;
    this.fontCache.clear(), this.builtInCMapCache.clear(), this.standardFontDataCache.clear(), this.systemFontCache.clear();
  }
  async getPageDict(t) {
    const e = [this.toplevelPagesDict], n = new $i(), s = m(this, Pe).getRaw("Pages");
    s instanceof Dt && n.put(s);
    const r = this.xref, a = this.pageKidsCountCache, o = this.pageIndexCache, l = this.pageDictCache;
    let c = 0;
    for (; e.length; ) {
      const h = e.pop();
      if (h instanceof Dt) {
        const p = a.get(h);
        if (p >= 0 && c + p <= t) {
          c += p;
          continue;
        }
        if (n.has(h)) throw new ht("Pages tree contains circular reference.");
        n.put(h);
        const g = await (l.get(h) || r.fetchAsync(h));
        if (g instanceof Z) {
          let b = g.getRaw("Type");
          if (b instanceof Dt && (b = await r.fetchAsync(b)), ki(b, "Page") || !g.has("Kids")) {
            if (a.has(h) || a.put(h, 1), o.has(h) || o.put(h, c), c === t) return [g, h];
            c++;
            continue;
          }
        }
        e.push(g);
        continue;
      }
      if (!(h instanceof Z)) throw new ht("Page dictionary kid reference points to wrong type of object.");
      const { objId: u } = h;
      let f = h.getRaw("Count");
      if (f instanceof Dt && (f = await r.fetchAsync(f)), Number.isInteger(f) && f >= 0 && (u && !a.has(u) && a.put(u, f), c + f <= t)) {
        c += f;
        continue;
      }
      let d = h.getRaw("Kids");
      if (d instanceof Dt && (d = await r.fetchAsync(d)), !Array.isArray(d)) {
        let p = h.getRaw("Type");
        if (p instanceof Dt && (p = await r.fetchAsync(p)), ki(p, "Page") || !h.has("Kids")) {
          if (c === t) return [h, null];
          c++;
          continue;
        }
        throw new ht("Page dictionary kids object is not an array.");
      }
      for (let p = d.length - 1; p >= 0; p--) {
        const g = d[p];
        e.push(g), h === this.toplevelPagesDict && g instanceof Dt && !l.has(g) && l.put(g, r.fetchAsync(g));
      }
    }
    throw new Error(`Page index ${t} not found.`);
  }
  async getAllPageDicts(t = !1) {
    const { ignoreErrors: e } = this.pdfManager.evaluatorOptions, n = [{ currentNode: this.toplevelPagesDict, posInKids: 0 }], s = new $i(), r = m(this, Pe).getRaw("Pages");
    r instanceof Dt && s.put(r);
    const a = /* @__PURE__ */ new Map(), o = this.xref, l = this.pageIndexCache;
    let c = 0;
    function h(f, d) {
      d && !l.has(d) && l.put(d, c), a.set(c++, [f, d]);
    }
    function u(f) {
      if (f instanceof e0 && !t) throw f;
      t && e && c === 0 && (H(`getAllPageDicts - Skipping invalid first page: "${f}".`), f = Z.empty), a.set(c++, [f, null]);
    }
    for (; n.length > 0; ) {
      const f = n.at(-1), { currentNode: d, posInKids: p } = f;
      let g = d.getRaw("Kids");
      if (g instanceof Dt) try {
        g = await o.fetchAsync(g);
      } catch (w) {
        u(w);
        break;
      }
      if (!Array.isArray(g)) {
        u(new ht("Page dictionary kids object is not an array."));
        break;
      }
      if (p >= g.length) {
        n.pop();
        continue;
      }
      const b = g[p];
      let y;
      if (b instanceof Dt) {
        if (s.has(b)) {
          u(new ht("Pages tree contains circular reference."));
          break;
        }
        s.put(b);
        try {
          y = await o.fetchAsync(b);
        } catch (w) {
          u(w);
          break;
        }
      } else y = b;
      if (!(y instanceof Z)) {
        u(new ht("Page dictionary kid reference points to wrong type of object."));
        break;
      }
      let v = y.getRaw("Type");
      if (v instanceof Dt) try {
        v = await o.fetchAsync(v);
      } catch (w) {
        u(w);
        break;
      }
      ki(v, "Page") || !y.has("Kids") ? h(y, b instanceof Dt ? b : null) : n.push({ currentNode: y, posInKids: 0 }), f.posInKids++;
    }
    return a;
  }
  getPageIndex(t) {
    const e = this.pageIndexCache.get(t);
    if (e !== void 0) return Promise.resolve(e);
    const n = this.xref;
    let s = 0;
    const r = (a) => function(l) {
      let c, h = 0;
      return n.fetchAsync(l).then(function(u) {
        if (o3(l, t) && !PE(u, "Page") && !(u instanceof Z && !u.has("Type") && u.has("Contents"))) throw new ht("The reference does not point to a /Page dictionary.");
        if (!u) return null;
        if (!(u instanceof Z)) throw new ht("Node must be a dictionary.");
        return c = u.getRaw("Parent"), u.getAsync("Parent");
      }).then(function(u) {
        if (!u) return null;
        if (!(u instanceof Z)) throw new ht("Parent must be a dictionary.");
        return u.getAsync("Kids");
      }).then(function(u) {
        if (!u) return null;
        const f = [];
        let d = !1;
        for (const p of u) {
          if (!(p instanceof Dt)) throw new ht("Kid must be a reference.");
          if (o3(p, l)) {
            d = !0;
            break;
          }
          f.push(n.fetchAsync(p).then(function(g) {
            if (!(g instanceof Z)) throw new ht("Kid node must be a dictionary.");
            g.has("Count") ? h += g.get("Count") : h++;
          }));
        }
        if (!d) throw new ht("Kid reference not found in parent's kids.");
        return Promise.all(f).then(() => [h, c]);
      });
    }(a).then((o) => {
      if (!o)
        return this.pageIndexCache.put(t, s), s;
      const [l, c] = o;
      return s += l, r(c);
    });
    return r(t);
  }
  get baseUrl() {
    const t = m(this, Pe).get("URI");
    if (t instanceof Z) {
      const e = t.get("Base");
      if (typeof e == "string") {
        const n = a3(e, null, { tryConvertEncoding: !0 });
        if (n) return At(this, "baseUrl", n.href);
      }
    }
    return At(this, "baseUrl", this.pdfManager.docBaseUrl);
  }
  static parseDestDictionary({ destDict: t, resultObj: e, docBaseUrl: n = null, docAttachments: s = null }) {
    if (!(t instanceof Z)) {
      H("parseDestDictionary: `destDict` must be a dictionary.");
      return;
    }
    let r, a, o = t.get("A");
    if (o instanceof Z || (t.has("Dest") ? o = t.get("Dest") : (o = t.get("AA"), o instanceof Z && (o.has("D") ? o = o.get("D") : o.has("U") && (o = o.get("U"))))), o instanceof Z) {
      const l = o.get("S");
      if (!(l instanceof lt)) {
        H("parseDestDictionary: Invalid type in Action dictionary.");
        return;
      }
      const c = l.name;
      switch (c) {
        case "ResetForm":
          const h = o.get("Flags"), u = !(1 & (typeof h == "number" ? h : 0)), f = [], d = [];
          for (const R of o.get("Fields") || []) R instanceof Dt ? d.push(R.toString()) : typeof R == "string" && f.push(xe(R));
          e.resetForm = { fields: f, refs: d, include: u };
          break;
        case "URI":
          r = o.get("URI"), r instanceof lt && (r = "/" + r.name);
          break;
        case "GoTo":
          a = o.get("D");
          break;
        case "Launch":
        case "GoToR":
          const p = o.get("F");
          if (p instanceof Z) {
            const R = new Fb(p, null, !0), { rawFilename: B } = R.serializable;
            r = B;
          } else typeof p == "string" && (r = p);
          const g = hx(o);
          g && typeof r == "string" && (r = r.split("#", 1)[0] + "#" + g);
          const b = o.get("NewWindow");
          typeof b == "boolean" && (e.newWindow = b);
          break;
        case "GoToE":
          const y = o.get("T");
          let v;
          if (s && y instanceof Z) {
            const R = y.get("R"), B = y.get("N");
            ki(R, "C") && typeof B == "string" && (v = s[xe(B, !0)]);
          }
          if (v) {
            e.attachment = v;
            const R = hx(o);
            R && (e.attachmentDest = R);
          } else H('parseDestDictionary - unimplemented "GoToE" action.');
          break;
        case "Named":
          const w = o.get("N");
          w instanceof lt && (e.action = w.name);
          break;
        case "SetOCGState":
          const _ = o.get("State"), x = o.get("PreserveRB");
          if (!Array.isArray(_) || _.length === 0) break;
          const k = [];
          for (const R of _) if (R instanceof lt) switch (R.name) {
            case "ON":
            case "OFF":
            case "Toggle":
              k.push(R.name);
          }
          else R instanceof Dt && k.push(R.toString());
          if (k.length !== _.length) break;
          e.setOCGState = { state: k, preserveRB: typeof x != "boolean" || x };
          break;
        case "JavaScript":
          const S = o.get("JS");
          let T;
          S instanceof oe ? T = S.getString() : typeof S == "string" && (T = S);
          const I = T && $E(xe(T, !0));
          if (I) {
            r = I.url, e.newWindow = I.newWindow;
            break;
          }
        default:
          if (c === "JavaScript" || c === "SubmitForm") break;
          H(`parseDestDictionary - unsupported action: "${c}".`);
      }
    } else t.has("Dest") && (a = t.get("Dest"));
    if (typeof r == "string") {
      const l = a3(r, n, { addDefaultProtocol: !0, tryConvertEncoding: !0 });
      l && (e.url = l.href), e.unsafeUrl = r;
    }
    a && (a instanceof lt && (a = a.name), typeof a == "string" ? e.dest = xe(a, !0) : m3(a) && (e.dest = a));
  }
};
Wd = new WeakMap(), Pe = new WeakMap(), Hi = new WeakSet(), UD = function() {
  const t = m(this, Pe).get("MarkInfo");
  if (!(t instanceof Z)) return null;
  const e = { Marked: !1, UserProperties: !1, Suspects: !1 };
  for (const n in e) {
    const s = t.get(n);
    typeof s == "boolean" && (e[n] = s);
  }
  return e;
}, HD = function() {
  const t = m(this, Pe).getRaw("StructTreeRoot"), e = this.xref.fetchIfRef(t);
  if (!(e instanceof Z)) return null;
  const n = new fp(this.xref, e, t);
  return n.init(), n;
}, jD = function() {
  let t = m(this, Pe).get("Outlines");
  if (!(t instanceof Z) || (t = t.getRaw("First"), !(t instanceof Dt))) return null;
  const e = { items: [] }, n = [{ obj: t, parent: e }], s = new $i();
  s.put(t);
  const r = this.xref, a = new Uint8ClampedArray(3);
  for (; n.length > 0; ) {
    const o = n.shift(), l = r.fetchIfRef(o.obj);
    if (l === null) continue;
    l.has("Title") || H("Invalid outline item encountered.");
    const c = { url: null, dest: null, action: null };
    y4.parseDestDictionary({ destDict: l, resultObj: c, docBaseUrl: this.baseUrl, docAttachments: this.attachments });
    const h = l.get("Title"), u = l.get("F") || 0, f = l.getArray("C"), d = l.get("Count");
    let p = a;
    !cs(f, 3) || f[0] === 0 && f[1] === 0 && f[2] === 0 || (p = Se.rgb.getRgb(f, 0));
    const g = { action: c.action, attachment: c.attachment, dest: c.dest, url: c.url, unsafeUrl: c.unsafeUrl, newWindow: c.newWindow, setOCGState: c.setOCGState, title: typeof h == "string" ? xe(h) : "", color: p, count: Number.isInteger(d) ? d : void 0, bold: !!(2 & u), italic: !!(1 & u), items: [] };
    o.parent.items.push(g), t = l.getRaw("First"), t instanceof Dt && !s.has(t) && (n.push({ obj: t, parent: g }), s.put(t)), t = l.getRaw("Next"), t instanceof Dt && !s.has(t) && (n.push({ obj: t, parent: o.parent }), s.put(t));
  }
  return e.items.length > 0 ? e.items : null;
}, GD = function() {
  const t = this.xref.trailer.get("Encrypt");
  if (!(t instanceof Z)) return null;
  let e = t.get("P");
  if (typeof e != "number") return null;
  e += 2 ** 32;
  const n = [];
  for (const s in Qv) {
    const r = Qv[s];
    e & r && n.push(r);
  }
  return n;
}, VD = function(t) {
  const e = this.xref.fetch(t), n = { id: t.toString(), name: null, intent: null, usage: { print: null, view: null }, rbGroups: [] }, s = e.get("Name");
  typeof s == "string" && (n.name = xe(s));
  let r = e.getArray("Intent");
  Array.isArray(r) || (r = [r]), r.every((h) => h instanceof lt) && (n.intent = r.map((h) => h.name));
  const a = e.get("Usage");
  if (!(a instanceof Z)) return n;
  const o = n.usage, l = a.get("Print");
  if (l instanceof Z) {
    const h = l.get("PrintState");
    if (h instanceof lt) switch (h.name) {
      case "ON":
      case "OFF":
        o.print = { printState: h.name };
    }
  }
  const c = a.get("View");
  if (c instanceof Z) {
    const h = c.get("ViewState");
    if (h instanceof lt) switch (h.name) {
      case "ON":
      case "OFF":
        o.view = { viewState: h.name };
    }
  }
  return n;
}, WD = function(t, e) {
  function n(c) {
    const h = [];
    if (Array.isArray(c)) for (const u of c) u instanceof Dt && e.has(u) && h.push(u.toString());
    return h;
  }
  function s(c, h = 0) {
    if (!Array.isArray(c)) return null;
    const u = [];
    for (const d of c) {
      if (d instanceof Dt && e.has(d)) {
        o.put(d), u.push(d.toString());
        continue;
      }
      const p = r(d, h);
      p && u.push(p);
    }
    if (h > 0) return u;
    const f = [];
    for (const [d] of e.items()) o.has(d) || f.push(d.toString());
    return f.length && u.push({ name: null, order: f }), u;
  }
  function r(c, h) {
    if (++h > l)
      return H("parseNestedOrder - reached MAX_NESTED_LEVELS."), null;
    const u = a.fetchIfRef(c);
    if (!Array.isArray(u)) return null;
    const f = a.fetchIfRef(u[0]);
    if (typeof f != "string") return null;
    const d = s(u.slice(1), h);
    return d != null && d.length ? { name: xe(f), order: d } : null;
  }
  const a = this.xref, o = new $i(), l = 10;
  return function(h) {
    if (Array.isArray(h)) for (const u of h) {
      const f = a.fetchIfRef(u);
      if (!Array.isArray(f) || !f.length) continue;
      const d = /* @__PURE__ */ new Set();
      for (const p of f) p instanceof Dt && e.has(p) && !d.has(p.toString()) && (d.add(p.toString()), e.get(p).rbGroups.push(d));
    }
  }(t.get("RBGroups")), { name: typeof t.get("Name") == "string" ? xe(t.get("Name")) : null, creator: typeof t.get("Creator") == "string" ? xe(t.get("Creator")) : null, baseState: t.get("BaseState") instanceof lt ? t.get("BaseState").name : null, on: n(t.get("ON")), off: n(t.get("OFF")), order: s(t.get("Order")), groups: [...e] };
}, Pb = function() {
  const t = m(this, Pe).get("Names"), e = [];
  return t != null && t.has("Dests") && e.push(new G1(t.getRaw("Dests"), this.xref)), m(this, Pe).has("Dests") && e.push(m(this, Pe).get("Dests")), e;
}, XD = function() {
  const t = m(this, Pe).getRaw("PageLabels");
  if (!t) return null;
  const e = new Array(this.numPages);
  let n = null, s = "";
  const r = new p3(t, this.xref).getAll();
  let a = "", o = 1;
  for (let l = 0, c = this.numPages; l < c; l++) {
    const h = r.get(l);
    if (h !== void 0) {
      if (!(h instanceof Z)) throw new ht("PageLabel is not a dictionary.");
      if (h.has("Type") && !ki(h.get("Type"), "PageLabel")) throw new ht("Invalid type in PageLabel dictionary.");
      if (h.has("S")) {
        const u = h.get("S");
        if (!(u instanceof lt)) throw new ht("Invalid style in PageLabel dictionary.");
        n = u.name;
      } else n = null;
      if (h.has("P")) {
        const u = h.get("P");
        if (typeof u != "string") throw new ht("Invalid prefix in PageLabel dictionary.");
        s = xe(u);
      } else s = "";
      if (h.has("St")) {
        const u = h.get("St");
        if (!(Number.isInteger(u) && u >= 1)) throw new ht("Invalid start in PageLabel dictionary.");
        o = u;
      } else o = 1;
    }
    switch (n) {
      case "D":
        a = o;
        break;
      case "R":
      case "r":
        a = $B(o, n === "r");
        break;
      case "A":
      case "a":
        const u = 26, f = n === "a" ? 97 : 65, d = o - 1;
        a = String.fromCharCode(f + d % u).repeat(Math.floor(d / u) + 1);
        break;
      default:
        if (n) throw new ht(`Invalid style "${n}" in PageLabel dictionary.`);
        a = "";
    }
    e[l] = s + a, o++;
  }
  return e;
}, YD = function() {
  const t = m(this, Pe).get("Names");
  let e = null;
  function n(r, a) {
    if (!(a instanceof Z) || !ki(a.get("S"), "JavaScript")) return;
    let o = a.get("JS");
    if (o instanceof oe) o = o.getString();
    else if (typeof o != "string") return;
    o = xe(o, !0).replaceAll("\0", ""), o && (e || (e = /* @__PURE__ */ new Map())).set(r, o);
  }
  if (t instanceof Z && t.has("JavaScript")) {
    const r = new G1(t.getRaw("JavaScript"), this.xref);
    for (const [a, o] of r.getAll()) n(xe(a, !0), o);
  }
  const s = m(this, Pe).get("OpenAction");
  return s && n("OpenAction", s), e;
};
let pp = y4;
function YL(i, t) {
  if (i instanceof Z) i = i.getRawValues();
  else if (i instanceof oe) i = i.dict.getRawValues();
  else if (!Array.isArray(i)) return;
  for (const n of i) ((e = n) instanceof Dt || e instanceof Z || e instanceof oe || Array.isArray(e)) && t.push(n);
  var e;
}
var ug, Nb;
const ov = class ov {
  constructor(t, e, n) {
    F(this, ug);
    ft(this, "refSet", new $i());
    this.dict = t, this.keys = e, this.xref = n;
  }
  async load() {
    const { keys: t, dict: e } = this, n = [];
    for (const s of t) {
      const r = e.getRaw(s);
      r !== void 0 && n.push(r);
    }
    await D(this, ug, Nb).call(this, n), this.refSet = null;
  }
  static async load(t, e, n) {
    if (n.stream.isDataLoaded) return;
    await new ov(t, e, n).load();
  }
};
ug = new WeakSet(), Nb = async function(t) {
  const e = [], n = [];
  for (; t.length; ) {
    let s = t.pop();
    if (s instanceof Dt) {
      if (this.refSet.has(s)) continue;
      try {
        this.refSet.put(s), s = this.xref.fetch(s);
      } catch (r) {
        if (!(r instanceof ti)) {
          H(`ObjectLoader.#walk - requesting all data: "${r}".`), await this.xref.stream.manager.requestAllChunks();
          return;
        }
        e.push(s), n.push({ begin: r.begin, end: r.end });
      }
    }
    if (s instanceof oe) {
      const r = s.getBaseStreams();
      if (r) {
        let a = !1;
        for (const o of r) o.isDataLoaded || (a = !0, n.push({ begin: o.start, end: o.end }));
        a && e.push(s);
      }
    }
    YL(s, t);
  }
  if (n.length) {
    await this.xref.stream.manager.requestRanges(n);
    for (const s of e) s instanceof Dt && this.refSet.remove(s);
    await D(this, ug, Nb).call(this, e);
  }
};
let rf = ov;
const N4 = Symbol(), b1 = Symbol(), pi = Symbol(), f0 = Symbol(), Vr = Symbol(), du = Symbol(), C9 = Symbol(), Aa = Symbol(), fo = Symbol(), mt = Symbol("content"), Br = Symbol("data"), af = Symbol(), ot = Symbol("extra"), Ue = Symbol(), Eg = Symbol(), Lb = Symbol(), KD = Symbol(), y1 = Symbol(), L4 = Symbol(), mp = Symbol(), B2 = Symbol(), aw = Symbol(), Fn = Symbol(), P2 = Symbol(), mn = Symbol(), of = Symbol(), Jo = Symbol(), Mi = Symbol(), Jt = Symbol(), Fi = Symbol(), ze = Symbol(), gp = Symbol(), cu = Symbol(), Ob = Symbol(), E9 = Symbol(), ow = Symbol(), P1 = Symbol(), fu = Symbol(), fc = Symbol(), N2 = Symbol(), Nl = Symbol(), Xl = Symbol(), bp = Symbol(), yp = Symbol(), KL = Symbol(), Ii = Symbol("namespaceId"), Ce = Symbol("nodeName"), Ml = Symbol(), So = Symbol(), $b = Symbol(), Ll = Symbol(), Fo = Symbol(), Fs = Symbol(), mf = Symbol(), s0 = Symbol(), ZD = Symbol("root"), _2 = Symbol(), Rl = Symbol(), qb = Symbol(), JD = Symbol(), Bs = Symbol(), _a = Symbol(), Wi = Symbol(), QD = Symbol(), Gt = Symbol(), L2 = Symbol(), ke = Symbol(), Re = Symbol("uid"), Pa = Symbol(), Ri = { config: { id: 0, check: (i) => i.startsWith("http://www.xfa.org/schema/xci/") }, connectionSet: { id: 1, check: (i) => i.startsWith("http://www.xfa.org/schema/xfa-connection-set/") }, datasets: { id: 2, check: (i) => i.startsWith("http://www.xfa.org/schema/xfa-data/") }, form: { id: 3, check: (i) => i.startsWith("http://www.xfa.org/schema/xfa-form/") }, localeSet: { id: 4, check: (i) => i.startsWith("http://www.xfa.org/schema/xfa-locale-set/") }, pdf: { id: 5, check: (i) => i === "http://ns.adobe.com/xdp/pdf/" }, signature: { id: 6, check: (i) => i === "http://www.w3.org/2000/09/xmldsig#" }, sourceSet: { id: 7, check: (i) => i.startsWith("http://www.xfa.org/schema/xfa-source-set/") }, stylesheet: { id: 8, check: (i) => i === "http://www.w3.org/1999/XSL/Transform" }, template: { id: 9, check: (i) => i.startsWith("http://www.xfa.org/schema/xfa-template/") }, xdc: { id: 10, check: (i) => i.startsWith("http://www.xfa.org/schema/xdc/") }, xdp: { id: 11, check: (i) => i === "http://ns.adobe.com/xdp/" }, xfdf: { id: 12, check: (i) => i === "http://ns.adobe.com/xfdf/" }, xhtml: { id: 13, check: (i) => i === "http://www.w3.org/1999/xhtml" }, xmpmeta: { id: 14, check: (i) => i === "http://ns.adobe.com/xmpmeta/" } }, ZL = { pt: (i) => i, cm: (i) => i / 2.54 * 72, mm: (i) => i / 25.4 * 72, in: (i) => 72 * i, px: (i) => i }, JL = /([+-]?\d+\.?\d*)(.*)/;
function O4(i) {
  return i.startsWith("'") || i.startsWith('"') ? i.slice(1, -1) : i;
}
function Yt({ data: i, defaultValue: t, validate: e }) {
  if (!i) return t;
  i = i.trim();
  const n = parseInt(i, 10);
  return !isNaN(n) && e(n) ? n : t;
}
function g3({ data: i, defaultValue: t, validate: e }) {
  if (!i) return t;
  i = i.trim();
  const n = parseFloat(i);
  return !isNaN(n) && e(n) ? n : t;
}
function $4({ data: i, defaultValue: t, validate: e }) {
  return i && e(i = i.trim()) ? i : t;
}
function bt(i, t) {
  return $4({ data: i, defaultValue: t[0], validate: (e) => t.includes(e) });
}
function Rt(i, t = "0") {
  if (t || (t = "0"), !i) return Rt(t);
  const e = i.trim().match(JL);
  if (!e) return Rt(t);
  const [, n, s] = e, r = parseFloat(n);
  if (isNaN(r)) return Rt(t);
  if (r === 0) return 0;
  const a = ZL[s];
  return a ? a(r) : r;
}
function ux(i) {
  if (!i) return { num: 1, den: 1 };
  const t = i.split(":", 2).map((s) => parseFloat(s.trim())).filter((s) => !isNaN(s));
  if (t.length === 1 && t.push(1), t.length === 0) return { num: 1, den: 1 };
  const [e, n] = t;
  return { num: e, den: n };
}
function Na(i) {
  return i ? i.trim().split(/\s+/).map((t) => ({ excluded: t[0] === "-", viewname: t.substring(1) })) : [];
}
class $t {
  static get FAILURE() {
    return At(this, "FAILURE", new $t(!1, null, null, null));
  }
  static get EMPTY() {
    return At(this, "EMPTY", new $t(!0, null, null, null));
  }
  constructor(t, e, n, s) {
    this.success = t, this.html = e, this.bbox = n, this.breakNode = s;
  }
  isBreak() {
    return !!this.breakNode;
  }
  static breakNode(t) {
    return new $t(!1, null, null, t);
  }
  static success(t, e = null) {
    return new $t(!0, t, e, null);
  }
}
class QL {
  constructor(t) {
    this.fonts = /* @__PURE__ */ new Map(), this.cache = /* @__PURE__ */ new Map(), this.warned = /* @__PURE__ */ new Set(), this.defaultFont = null, this.add(t);
  }
  add(t, e = null) {
    for (const s of t) this.addPdfFont(s);
    for (const s of this.fonts.values()) s.regular || (s.regular = s.italic || s.bold || s.bolditalic);
    if (!e || e.size === 0) return;
    const n = this.fonts.get("PdfJS-Fallback-PdfJS-XFA");
    for (const s of e) this.fonts.set(s, n);
  }
  addPdfFont(t) {
    var o, l, c;
    const e = t.cssFontInfo, n = e.fontFamily;
    let s = this.fonts.get(n);
    s || (s = /* @__PURE__ */ Object.create(null), this.fonts.set(n, s), this.defaultFont || (this.defaultFont = s));
    let r = "";
    const a = parseFloat(e.fontWeight);
    parseFloat(e.italicAngle) !== 0 ? r = a >= 700 ? "bolditalic" : "italic" : a >= 700 && (r = "bold"), r || ((t.name.includes("Bold") || (o = t.psName) != null && o.includes("Bold")) && (r = "bold"), (t.name.includes("Italic") || t.name.endsWith("It") || (l = t.psName) != null && l.includes("Italic") || (c = t.psName) != null && c.endsWith("It")) && (r += "italic")), r || (r = "regular"), s[r] = t;
  }
  getDefault() {
    return this.defaultFont;
  }
  find(t, e = !0) {
    var o, l;
    let n = this.fonts.get(t) || this.cache.get(t);
    if (n) return n;
    const s = /,|-|_| |bolditalic|bold|italic|regular|it/gi;
    let r = t.replaceAll(s, "");
    if (n = this.fonts.get(r), n)
      return this.cache.set(t, n), n;
    r = r.toLowerCase();
    const a = [];
    for (const [c, h] of this.fonts.entries()) c.replaceAll(s, "").toLowerCase().startsWith(r) && a.push(h);
    if (a.length === 0) for (const [, c] of this.fonts.entries()) (o = c.regular.name) != null && o.replaceAll(s, "").toLowerCase().startsWith(r) && a.push(c);
    if (a.length === 0) {
      r = r.replaceAll(/psmt|mt/gi, "");
      for (const [c, h] of this.fonts.entries()) c.replaceAll(s, "").toLowerCase().startsWith(r) && a.push(h);
    }
    if (a.length === 0) for (const c of this.fonts.values()) (l = c.regular.name) != null && l.replaceAll(s, "").toLowerCase().startsWith(r) && a.push(c);
    return a.length >= 1 ? (a.length !== 1 && e && H(`XFA - Too many choices to guess the correct font: ${t}`), this.cache.set(t, a[0]), a[0]) : (e && !this.warned.has(t) && (this.warned.add(t), H(`XFA - Cannot find the font: ${t}`)), null);
  }
}
function lw(i, t) {
  return i.posture === "italic" ? i.weight === "bold" ? t.bolditalic : t.italic : i.weight === "bold" ? t.bold : t.regular;
}
class dx {
  constructor(t, e, n, s) {
    if (this.lineHeight = n, this.paraMargin = e || { top: 0, bottom: 0, left: 0, right: 0 }, !t) {
      [this.pdfFont, this.xfaFont] = this.defaultFont(s);
      return;
    }
    this.xfaFont = { typeface: t.typeface, posture: t.posture, weight: t.weight, size: t.size, letterSpacing: t.letterSpacing };
    const r = s.find(t.typeface);
    r ? (this.pdfFont = lw(t, r), this.pdfFont || ([this.pdfFont, this.xfaFont] = this.defaultFont(s))) : [this.pdfFont, this.xfaFont] = this.defaultFont(s);
  }
  defaultFont(t) {
    const e = t.find("Helvetica", !1) || t.find("Myriad Pro", !1) || t.find("Arial", !1) || t.getDefault();
    if (e != null && e.regular) {
      const n = e.regular;
      return [n, { typeface: n.cssFontInfo.fontFamily, posture: "normal", weight: "normal", size: 10, letterSpacing: 0 }];
    }
    return [null, { typeface: "Courier", posture: "normal", weight: "normal", size: 10, letterSpacing: 0 }];
  }
}
class tO {
  constructor(t, e, n, s) {
    this.fontFinder = s, this.stack = [new dx(t, e, n, s)];
  }
  pushData(t, e, n) {
    const s = this.stack.at(-1);
    for (const a of ["typeface", "posture", "weight", "size", "letterSpacing"]) t[a] || (t[a] = s.xfaFont[a]);
    for (const a of ["top", "bottom", "left", "right"]) isNaN(e[a]) && (e[a] = s.paraMargin[a]);
    const r = new dx(t, e, n || s.lineHeight, this.fontFinder);
    r.pdfFont || (r.pdfFont = s.pdfFont), this.stack.push(r);
  }
  popFont() {
    this.stack.pop();
  }
  topFont() {
    return this.stack.at(-1);
  }
}
class eO {
  constructor(t, e, n, s) {
    this.glyphs = [], this.fontSelector = new tO(t, e, n, s), this.extraHeight = 0;
  }
  pushData(t, e, n) {
    this.fontSelector.pushData(t, e, n);
  }
  popFont(t) {
    return this.fontSelector.popFont();
  }
  addPara() {
    const t = this.fontSelector.topFont();
    this.extraHeight += t.paraMargin.top + t.paraMargin.bottom;
  }
  addString(t) {
    if (!t) return;
    const e = this.fontSelector.topFont(), n = e.xfaFont.size;
    if (e.pdfFont) {
      const s = e.xfaFont.letterSpacing, r = e.pdfFont, a = r.lineHeight || 1.2, o = e.lineHeight || Math.max(1.2, a) * n, l = a - (r.lineGap === void 0 ? 0.2 : r.lineGap), c = Math.max(1, l) * n, h = n / 1e3, u = r.defaultWidth || r.charsToGlyphs(" ")[0].width;
      for (const f of t.split(/[\u2029\n]/)) {
        const d = r.encodeString(f).join(""), p = r.charsToGlyphs(d);
        for (const g of p) {
          const b = g.width || u;
          this.glyphs.push([b * h + s, o, c, g.unicode, !1]);
        }
        this.glyphs.push([0, 0, 0, `
`, !0]);
      }
      this.glyphs.pop();
    } else {
      for (const s of t.split(/[\u2029\n]/)) {
        for (const r of s.split("")) this.glyphs.push([n, 1.2 * n, n, r, !1]);
        this.glyphs.push([0, 0, 0, `
`, !0]);
      }
      this.glyphs.pop();
    }
  }
  compute(t) {
    let e = -1, n = 0, s = 0, r = 0, a = 0, o = 0, l = !1, c = !0;
    for (let h = 0, u = this.glyphs.length; h < u; h++) {
      const [f, d, p, g, b] = this.glyphs[h], y = g === " ", v = c ? p : d;
      b ? (s = Math.max(s, a), a = 0, r += o, o = v, e = -1, n = 0, c = !1) : y ? a + f > t ? (s = Math.max(s, a), a = 0, r += o, o = v, e = -1, n = 0, l = !0, c = !1) : (o = Math.max(v, o), n = a, a += f, e = h) : a + f > t ? (r += o, o = v, e !== -1 ? (h = e, s = Math.max(s, n), a = 0, e = -1, n = 0) : (s = Math.max(s, a), a = f), l = !0, c = !1) : (a += f, o = Math.max(v, o));
    }
    return s = Math.max(s, a), r += o + this.extraHeight, { width: 1.02 * s, height: r, isBroken: l };
  }
}
const fx = /^[^.[]+/, iO = /^[^\]]+/, b3 = 0, y3 = 1, cw = 2, nO = 3, sO = 4, tT = /* @__PURE__ */ new Map([["$data", (i, t) => i.datasets ? i.datasets.data : i], ["$record", (i, t) => (i.datasets ? i.datasets.data : i)[mn]()[0]], ["$template", (i, t) => i.template], ["$connectionSet", (i, t) => i.connectionSet], ["$form", (i, t) => i.form], ["$layout", (i, t) => i.layout], ["$host", (i, t) => i.host], ["$dataWindow", (i, t) => i.dataWindow], ["$event", (i, t) => i.event], ["!", (i, t) => i.datasets], ["$xfa", (i, t) => i], ["xfa", (i, t) => i], ["$", (i, t) => t]]), px = /* @__PURE__ */ new WeakMap();
function eT(i, t, e = !0) {
  let n = i.match(fx);
  if (!n) return null;
  let [s] = n;
  const r = [{ name: s, cacheName: "." + s, index: 0, js: null, formCalc: null, operator: b3 }];
  let a = s.length;
  for (; a < i.length; ) {
    const l = a;
    if (i.charAt(a++) === "[") {
      if (n = i.slice(a).match(iO), !n)
        return H("XFA - Invalid index in SOM expression"), null;
      r.at(-1).index = (o = (o = n[0]).trim()) === "*" ? 1 / 0 : parseInt(o, 10) || 0, a += n[0].length + 1;
      continue;
    }
    let c;
    switch (i.charAt(a)) {
      case ".":
        if (!t) return null;
        a++, c = y3;
        break;
      case "#":
        a++, c = cw;
        break;
      case "[":
        if (e)
          return H("XFA - SOM expression contains a FormCalc subexpression which is not supported for now."), null;
        c = nO;
        break;
      case "(":
        if (e)
          return H("XFA - SOM expression contains a JavaScript subexpression which is not supported for now."), null;
        c = sO;
        break;
      default:
        c = b3;
    }
    if (n = i.slice(a).match(fx), !n) break;
    [s] = n, a += s.length, r.push({ name: s, cacheName: i.slice(l, a), operator: c, index: 0, js: null, formCalc: null });
  }
  var o;
  return r;
}
function cc(i, t, e, n = !0, s = !0) {
  const r = eT(e, n);
  if (!r) return null;
  const a = tT.get(r[0].name);
  let o, l = 0;
  a ? (o = !0, i = [a(i, t)], l = 1) : (o = t === null, i = [t || i]);
  for (let c = r.length; l < c; l++) {
    const { name: h, cacheName: u, operator: f, index: d } = r[l], p = [];
    for (const g of i) {
      if (!g.isXFAObject) continue;
      let b, y;
      if (s && (y = px.get(g), y || (y = /* @__PURE__ */ new Map(), px.set(g, y)), b = y.get(u)), !b) {
        switch (f) {
          case b3:
            b = g[mp](h, !1);
            break;
          case y3:
            b = g[mp](h, !0);
            break;
          case cw:
            b = g[L4](h), b = b.isXFAObjectArray ? b.children : [b];
        }
        s && y.set(u, b);
      }
      b.length > 0 && p.push(b);
    }
    if (p.length !== 0 || o || l !== 0) i = isFinite(d) ? p.filter((g) => d < g.length).map((g) => g[d]) : p.flat();
    else {
      if (!(t = t[Jt]())) return null;
      l = -1, i = [t];
    }
  }
  return i.length === 0 ? null : i;
}
function rO(i, t, e) {
  const n = eT(e);
  if (!n || n.some((a) => a.operator === y3)) return null;
  const s = tT.get(n[0].name);
  let r = 0;
  s ? (i = s(i, t), r = 1) : i = t || i;
  for (let a = n.length; r < a; r++) {
    const { name: o, operator: l, index: c } = n[r];
    if (!isFinite(c))
      return n[r].index = 0, i.createNodes(n.slice(r));
    let h;
    switch (l) {
      case b3:
        h = i[mp](o, !1);
        break;
      case y3:
        h = i[mp](o, !0);
        break;
      case cw:
        h = i[L4](o), h = h.isXFAObjectArray ? h.children : [h];
    }
    if (h.length === 0) return i.createNodes(n.slice(r));
    if (!(c < h.length))
      return n[r].index = c - h.length, i.createNodes(n.slice(r));
    {
      const u = h[c];
      if (!u.isXFAObject)
        return H("XFA - Cannot create a node."), null;
      i = u;
    }
  }
  return null;
}
const c5 = Symbol(), T0 = Symbol(), V1 = Symbol(), he = Symbol("_children"), P6 = Symbol(), ic = Symbol(), N6 = Symbol(), mx = Symbol(), L6 = Symbol(), gx = Symbol(), O6 = Symbol(), x2 = Symbol(), h5 = Symbol(), Tr = Symbol("parent"), Of = Symbol(), $f = Symbol(), $6 = Symbol();
let zb = 0;
const iT = Ri.datasets.id;
class ct {
  constructor(t, e, n = !1) {
    this[Ii] = t, this[Ce] = e, this[O6] = n, this[Tr] = null, this[he] = [], this[Re] = `${e}${zb++}`, this[ze] = null;
  }
  get isXFAObject() {
    return !0;
  }
  get isXFAObjectArray() {
    return !1;
  }
  createNodes(t) {
    let e = this, n = null;
    for (const { name: s, index: r } of t) {
      for (let a = 0, o = isFinite(r) ? r : 0; a <= o; a++) {
        const l = e[Ii] === iT ? -1 : e[Ii];
        n = new Co(l, s), e[pi](n);
      }
      e = n;
    }
    return n;
  }
  [So](t) {
    if (!this[O6] || !this[$b](t)) return !1;
    const e = t[Ce], n = this[e];
    if (!(n instanceof U))
      return n !== null && this[s0](n), this[e] = t, this[pi](t), !0;
    if (n.push(t))
      return this[pi](t), !0;
    let s = "";
    return this.id ? s = ` (id: ${this.id})` : this.name && (s = ` (name: ${this.name} ${this.h.value})`), H(`XFA - node "${this[Ce]}"${s} has already enough "${e}"!`), !1;
  }
  [$b](t) {
    return this.hasOwnProperty(t[Ce]) && t[Ii] === this[Ii];
  }
  [N2]() {
    return !1;
  }
  [N4]() {
    return !1;
  }
  [ow]() {
    return !1;
  }
  [P1]() {
    return !1;
  }
  [Fs]() {
    this.para && this[Fi]()[ot].paraStack.pop();
  }
  [mf]() {
    this[Fi]()[ot].paraStack.push(this.para);
  }
  [qb](t) {
    this.id && this[Ii] === Ri.template.id && t.set(this.id, this);
  }
  [Fi]() {
    return this[ze].template;
  }
  [Nl]() {
    return !1;
  }
  [Xl]() {
    return !1;
  }
  [pi](t) {
    t[Tr] = this, this[he].push(t), !t[ze] && this[ze] && (t[ze] = this[ze]);
  }
  [s0](t) {
    const e = this[he].indexOf(t);
    this[he].splice(e, 1);
  }
  [gp]() {
    return this.hasOwnProperty("value");
  }
  [Bs](t) {
  }
  [Ll](t) {
  }
  [Ue]() {
  }
  [Vr](t) {
    delete this[O6], this[C9] && (t.clean(this[C9]), delete this[C9]);
  }
  [Ob](t) {
    return this[he].indexOf(t);
  }
  [E9](t, e) {
    e[Tr] = this, this[he].splice(t, 0, e), !e[ze] && this[ze] && (e[ze] = this[ze]);
  }
  [bp]() {
    return !this.name;
  }
  [KL]() {
    return "";
  }
  [Wi]() {
    return this[he].length === 0 ? this[mt] : this[he].map((t) => t[Wi]()).join("");
  }
  get [V1]() {
    const t = Object.getPrototypeOf(this);
    if (!t._attributes) {
      const e = t._attributes = /* @__PURE__ */ new Set();
      for (const n of Object.getOwnPropertyNames(this)) {
        if (this[n] === null || this[n] instanceof ct || this[n] instanceof U) break;
        e.add(n);
      }
    }
    return At(this, V1, t._attributes);
  }
  [fc](t) {
    let e = this;
    for (; e; ) {
      if (e === t) return !0;
      e = e[Jt]();
    }
    return !1;
  }
  [Jt]() {
    return this[Tr];
  }
  [Mi]() {
    return this[Jt]();
  }
  [mn](t = null) {
    return t ? this[t] : this[he];
  }
  [af]() {
    const t = /* @__PURE__ */ Object.create(null);
    this[mt] && (t.$content = this[mt]);
    for (const e of Object.getOwnPropertyNames(this)) {
      const n = this[e];
      n !== null && (n instanceof ct ? t[e] = n[af]() : n instanceof U ? n.isEmpty() || (t[e] = n.dump()) : t[e] = n);
    }
    return t;
  }
  [ke]() {
    return null;
  }
  [Gt]() {
    return $t.EMPTY;
  }
  *[of]() {
    for (const t of this[mn]()) yield t;
  }
  *[mx](t, e) {
    for (const n of this[of]()) if (!t || e === t.has(n[Ce])) {
      const s = this[y1](), r = n[Gt](s);
      r.success || (this[ot].failingNode = n), yield r;
    }
  }
  [Eg]() {
    return null;
  }
  [b1](t, e) {
    this[ot].children.push(t);
  }
  [y1]() {
  }
  [f0]({ filter: t = null, include: e = !0 }) {
    if (this[ot].generator) {
      const n = this[y1](), s = this[ot].failingNode[Gt](n);
      if (!s.success) return s;
      s.html && this[b1](s.html, s.bbox), delete this[ot].failingNode;
    } else this[ot].generator = this[mx](t, e);
    for (; ; ) {
      const n = this[ot].generator.next();
      if (n.done) break;
      const s = n.value;
      if (!s.success) return s;
      s.html && this[b1](s.html, s.bbox);
    }
    return this[ot].generator = null, $t.EMPTY;
  }
  [JD](t) {
    this[$f] = new Set(Object.keys(t));
  }
  [gx](t) {
    const e = this[V1], n = this[$f];
    return [...t].filter((s) => e.has(s) && !n.has(s));
  }
  [_2](t, e = /* @__PURE__ */ new Set()) {
    for (const n of this[he]) n[Of](t, e);
  }
  [Of](t, e) {
    const n = this[L6](t, e);
    n ? this[c5](n, t, e) : this[_2](t, e);
  }
  [L6](t, e) {
    const { use: n, usehref: s } = this;
    if (!n && !s) return null;
    let r = null, a = null, o = null, l = n;
    if (s ? (l = s, s.startsWith("#som(") && s.endsWith(")") ? a = s.slice(5, -1) : s.startsWith(".#som(") && s.endsWith(")") ? a = s.slice(6, -1) : s.startsWith("#") ? o = s.slice(1) : s.startsWith(".#") && (o = s.slice(2))) : n.startsWith("#") ? o = n.slice(1) : a = n, this.use = this.usehref = "", o ? r = t.get(o) : (r = cc(t.get(ZD), this, a, !0, !1), r && (r = r[0])), !r)
      return H(`XFA - Invalid prototype reference: ${l}.`), null;
    if (r[Ce] !== this[Ce])
      return H(`XFA - Incompatible prototype: ${r[Ce]} !== ${this[Ce]}.`), null;
    if (e.has(r))
      return H("XFA - Cycle detected in prototypes use."), null;
    e.add(r);
    const c = r[L6](t, e);
    return c && r[c5](c, t, e), r[_2](t, e), e.delete(r), r;
  }
  [c5](t, e, n) {
    if (n.has(t)) {
      H("XFA - Cycle detected in prototypes use.");
      return;
    }
    !this[mt] && t[mt] && (this[mt] = t[mt]), new Set(n).add(t);
    for (const s of this[gx](t[$f]))
      this[s] = t[s], this[$f] && this[$f].add(s);
    for (const s of Object.getOwnPropertyNames(this)) {
      if (this[V1].has(s)) continue;
      const r = this[s], a = t[s];
      if (r instanceof U) {
        for (const o of r[he]) o[Of](e, n);
        for (let o = r[he].length, l = a[he].length; o < l; o++) {
          const c = t[he][o][Aa]();
          if (!r.push(c)) break;
          c[Tr] = this, this[he].push(c), c[Of](e, n);
        }
      } else if (r === null) {
        if (a !== null) {
          const o = a[Aa]();
          o[Tr] = this, this[s] = o, this[he].push(o), o[Of](e, n);
        }
      } else
        r[_2](e, n), a && r[c5](a, e, n);
    }
  }
  static [P6](t) {
    return Array.isArray(t) ? t.map((e) => ct[P6](e)) : typeof t == "object" && t !== null ? Object.assign({}, t) : t;
  }
  [Aa]() {
    const t = Object.create(Object.getPrototypeOf(this));
    for (const e of Object.getOwnPropertySymbols(this)) try {
      t[e] = this[e];
    } catch {
      At(t, e, this[e]);
    }
    t[Re] = `${t[Ce]}${zb++}`, t[he] = [];
    for (const e of Object.getOwnPropertyNames(this)) {
      if (this[V1].has(e)) {
        t[e] = ct[P6](this[e]);
        continue;
      }
      const n = this[e];
      t[e] = n instanceof U ? new U(n[x2]) : null;
    }
    for (const e of this[he]) {
      const n = e[Ce], s = e[Aa]();
      t[he].push(s), s[Tr] = t, t[n] === null ? t[n] = s : t[n][he].push(s);
    }
    return t;
  }
  [mn](t = null) {
    return t ? this[he].filter((e) => e[Ce] === t) : this[he];
  }
  [L4](t) {
    return this[t];
  }
  [mp](t, e, n = !0) {
    return Array.from(this[B2](t, e, n));
  }
  *[B2](t, e, n = !0) {
    if (t !== "parent") {
      for (const s of this[he])
        s[Ce] === t && (yield s), s.name === t && (yield s), (e || s[bp]()) && (yield* s[B2](t, e, !1));
      n && this[V1].has(t) && (yield new hw(this, t, this[t]));
    } else yield this[Tr];
  }
}
class U {
  constructor(t = 1 / 0) {
    this[x2] = t, this[he] = [];
  }
  get isXFAObject() {
    return !1;
  }
  get isXFAObjectArray() {
    return !0;
  }
  push(t) {
    return this[he].length <= this[x2] ? (this[he].push(t), !0) : (H(`XFA - node "${t[Ce]}" accepts no more than ${this[x2]} children`), !1);
  }
  isEmpty() {
    return this[he].length === 0;
  }
  dump() {
    return this[he].length === 1 ? this[he][0][af]() : this[he].map((t) => t[af]());
  }
  [Aa]() {
    const t = new U(this[x2]);
    return t[he] = this[he].map((e) => e[Aa]()), t;
  }
  get children() {
    return this[he];
  }
  clear() {
    this[he].length = 0;
  }
}
class hw {
  constructor(t, e, n) {
    this[Tr] = t, this[Ce] = e, this[mt] = n, this[fo] = !1, this[Re] = "attribute" + zb++;
  }
  [Jt]() {
    return this[Tr];
  }
  [fu]() {
    return !0;
  }
  [aw]() {
    return this[mt].trim();
  }
  [Bs](t) {
    t = t.value || "", this[mt] = t.toString();
  }
  [Wi]() {
    return this[mt];
  }
  [fc](t) {
    return this[Tr] === t || this[Tr][fc](t);
  }
}
class Co extends ct {
  constructor(t, e, n = {}) {
    if (super(t, e), this[mt] = "", this[ic] = null, e !== "#text") {
      const s = /* @__PURE__ */ new Map();
      this[T0] = s;
      for (const [r, a] of Object.entries(n)) s.set(r, new hw(this, r, a));
      if (n.hasOwnProperty(Ml)) {
        const r = n[Ml].xfa.dataNode;
        r !== void 0 && (r === "dataGroup" ? this[ic] = !1 : r === "dataValue" && (this[ic] = !0));
      }
    }
    this[fo] = !1;
  }
  [L2](t) {
    const e = this[Ce];
    if (e === "#text") {
      t.push(Eu(this[mt]));
      return;
    }
    const n = Z8(e), s = this[Ii] === iT ? "xfa:" : "";
    t.push(`<${s}${n}`);
    for (const [r, a] of this[T0].entries()) {
      const o = Z8(r);
      t.push(` ${o}="${Eu(a[mt])}"`);
    }
    if (this[ic] !== null && (this[ic] ? t.push(' xfa:dataNode="dataValue"') : t.push(' xfa:dataNode="dataGroup"')), this[mt] || this[he].length !== 0) {
      if (t.push(">"), this[mt]) typeof this[mt] == "string" ? t.push(Eu(this[mt])) : this[mt][L2](t);
      else for (const r of this[he]) r[L2](t);
      t.push(`</${s}${n}>`);
    } else t.push("/>");
  }
  [So](t) {
    if (this[mt]) {
      const e = new Co(this[Ii], "#text");
      this[pi](e), e[mt] = this[mt], this[mt] = "";
    }
    return this[pi](t), !0;
  }
  [Ll](t) {
    this[mt] += t;
  }
  [Ue]() {
    if (this[mt] && this[he].length > 0) {
      const t = new Co(this[Ii], "#text");
      this[pi](t), t[mt] = this[mt], delete this[mt];
    }
  }
  [Gt]() {
    return this[Ce] === "#text" ? $t.success({ name: "#text", value: this[mt] }) : $t.EMPTY;
  }
  [mn](t = null) {
    return t ? this[he].filter((e) => e[Ce] === t) : this[he];
  }
  [KD]() {
    return this[T0];
  }
  [L4](t) {
    const e = this[T0].get(t);
    return e !== void 0 ? e : this[mn](t);
  }
  *[B2](t, e) {
    const n = this[T0].get(t);
    n && (yield n);
    for (const s of this[he])
      s[Ce] === t && (yield s), e && (yield* s[B2](t, e));
  }
  *[Lb](t, e) {
    const n = this[T0].get(t);
    !n || e && n[fo] || (yield n);
    for (const s of this[he]) yield* s[Lb](t, e);
  }
  *[P2](t, e, n) {
    for (const s of this[he])
      s[Ce] !== t || n && s[fo] || (yield s), e && (yield* s[P2](t, e, n));
  }
  [fu]() {
    return this[ic] === null ? this[he].length === 0 || this[he][0][Ii] === Ri.xhtml.id : this[ic];
  }
  [aw]() {
    return this[ic] === null ? this[he].length === 0 ? this[mt].trim() : this[he][0][Ii] === Ri.xhtml.id ? this[he][0][Wi]().trim() : null : this[mt].trim();
  }
  [Bs](t) {
    t = t.value || "", this[mt] = t.toString();
  }
  [af](t = !1) {
    const e = /* @__PURE__ */ Object.create(null);
    t && (e.$ns = this[Ii]), this[mt] && (e.$content = this[mt]), e.$name = this[Ce], e.children = [];
    for (const n of this[he]) e.children.push(n[af](t));
    e.attributes = /* @__PURE__ */ Object.create(null);
    for (const [n, s] of this[T0]) e.attributes[n] = s[mt];
    return e;
  }
}
class bi extends ct {
  constructor(t, e) {
    super(t, e), this[mt] = "";
  }
  [Ll](t) {
    this[mt] += t;
  }
  [Ue]() {
  }
}
class Be extends bi {
  constructor(t, e, n) {
    super(t, e), this[h5] = n;
  }
  [Ue]() {
    this[mt] = $4({ data: this[mt], defaultValue: this[h5][0], validate: (t) => this[h5].includes(t) });
  }
  [Vr](t) {
    super[Vr](t), delete this[h5];
  }
}
class de extends bi {
  [Ue]() {
    this[mt] = this[mt].trim();
  }
}
class La extends bi {
  constructor(t, e, n, s) {
    super(t, e), this[N6] = n, this[$6] = s;
  }
  [Ue]() {
    this[mt] = Yt({ data: this[mt], defaultValue: this[N6], validate: this[$6] });
  }
  [Vr](t) {
    super[Vr](t), delete this[N6], delete this[$6];
  }
}
class Yi extends La {
  constructor(t, e) {
    super(t, e, 0, (n) => n === 1);
  }
}
class nT extends La {
  constructor(t, e) {
    super(t, e, 1, (n) => n === 0);
  }
}
function Xt(i) {
  return typeof i == "string" ? "0px" : Number.isInteger(i) ? `${i}px` : `${i.toFixed(2)}px`;
}
const bx = { anchorType(i, t) {
  const e = i[Mi]();
  if (e && (!e.layout || e.layout === "position"))
    switch ("transform" in t || (t.transform = ""), i.anchorType) {
      case "bottomCenter":
        t.transform += "translate(-50%, -100%)";
        break;
      case "bottomLeft":
        t.transform += "translate(0,-100%)";
        break;
      case "bottomRight":
        t.transform += "translate(-100%,-100%)";
        break;
      case "middleCenter":
        t.transform += "translate(-50%,-50%)";
        break;
      case "middleLeft":
        t.transform += "translate(0,-50%)";
        break;
      case "middleRight":
        t.transform += "translate(-100%,-50%)";
        break;
      case "topCenter":
        t.transform += "translate(-50%,0)";
        break;
      case "topRight":
        t.transform += "translate(-100%,0)";
    }
}, dimensions(i, t) {
  var r;
  const e = i[Mi]();
  let n = i.w;
  const s = i.h;
  if ((r = e.layout) != null && r.includes("row")) {
    const a = e[ot], o = i.colSpan;
    let l;
    o === -1 ? (l = Math.sumPrecise(a.columnWidths.slice(a.currentColumn)), a.currentColumn = 0) : (l = Math.sumPrecise(a.columnWidths.slice(a.currentColumn, a.currentColumn + o)), a.currentColumn = (a.currentColumn + i.colSpan) % a.columnWidths.length), isNaN(l) || (n = i.w = l);
  }
  t.width = n !== "" ? Xt(n) : "auto", t.height = s !== "" ? Xt(s) : "auto";
}, position(i, t) {
  const e = i[Mi]();
  (!(e != null && e.layout) || e.layout === "position") && (t.position = "absolute", t.left = Xt(i.x), t.top = Xt(i.y));
}, rotate(i, t) {
  i.rotate && ("transform" in t || (t.transform = ""), t.transform += `rotate(-${i.rotate}deg)`, t.transformOrigin = "top left");
}, presence(i, t) {
  switch (i.presence) {
    case "invisible":
      t.visibility = "hidden";
      break;
    case "hidden":
    case "inactive":
      t.display = "none";
  }
}, hAlign(i, t) {
  if (i[Ce] === "para") switch (i.hAlign) {
    case "justifyAll":
      t.textAlign = "justify-all";
      break;
    case "radix":
      t.textAlign = "left";
      break;
    default:
      t.textAlign = i.hAlign;
  }
  else switch (i.hAlign) {
    case "left":
      t.alignSelf = "start";
      break;
    case "center":
      t.alignSelf = "center";
      break;
    case "right":
      t.alignSelf = "end";
  }
}, margin(i, t) {
  i.margin && (t.margin = i.margin[ke]().margin);
} };
function sT(i, t) {
  i[Mi]().layout === "position" && (i.minW > 0 && (t.minWidth = Xt(i.minW)), i.maxW > 0 && (t.maxWidth = Xt(i.maxW)), i.minH > 0 && (t.minHeight = Xt(i.minH)), i.maxH > 0 && (t.maxHeight = Xt(i.maxH)));
}
function yx(i, t, e, n, s, r) {
  const a = new eO(t, e, n, s);
  return typeof i == "string" ? a.addString(i) : i[Fo](a), a.compute(r);
}
function uw(i, t) {
  let e = null, n = null, s = !1;
  if ((!i.w || !i.h) && i.value) {
    let r = 0, a = 0;
    i.margin && (r = i.margin.leftInset + i.margin.rightInset, a = i.margin.topInset + i.margin.bottomInset);
    let o = null, l = null;
    i.para && (l = /* @__PURE__ */ Object.create(null), o = i.para.lineHeight === "" ? null : i.para.lineHeight, l.top = i.para.spaceAbove === "" ? 0 : i.para.spaceAbove, l.bottom = i.para.spaceBelow === "" ? 0 : i.para.spaceBelow, l.left = i.para.marginLeft === "" ? 0 : i.para.marginLeft, l.right = i.para.marginRight === "" ? 0 : i.para.marginRight);
    let c = i.font;
    if (!c) {
      const f = i[Fi]();
      let d = i[Jt]();
      for (; d && d !== f; ) {
        if (d.font) {
          c = d.font;
          break;
        }
        d = d[Jt]();
      }
    }
    const h = (i.w || t.width) - r, u = i[ze].fontFinder;
    if (i.value.exData && i.value.exData[mt] && i.value.exData.contentType === "text/html") {
      const f = yx(i.value.exData[mt], c, l, o, u, h);
      n = f.width, e = f.height, s = f.isBroken;
    } else {
      const f = i.value[Wi]();
      if (f) {
        const d = yx(f, c, l, o, u, h);
        n = d.width, e = d.height, s = d.isBroken;
      }
    }
    n === null || i.w || (n += r), e === null || i.h || (e += a);
  }
  return { w: n, h: e, isBroken: s };
}
function rT(i, t, e) {
  let n;
  if (i.w !== "" && i.h !== "") n = [i.x, i.y, i.w, i.h];
  else {
    if (!e) return null;
    let s = i.w;
    if (s === "") {
      if (i.maxW === 0) {
        const a = i[Mi]();
        s = a.layout === "position" && a.w !== "" ? 0 : i.minW;
      } else s = Math.min(i.maxW, e.width);
      t.attributes.style.width = Xt(s);
    }
    let r = i.h;
    if (r === "") {
      if (i.maxH === 0) {
        const a = i[Mi]();
        r = a.layout === "position" && a.h !== "" ? 0 : i.minH;
      } else r = Math.min(i.maxH, e.height);
      t.attributes.style.height = Xt(r);
    }
    n = [i.x, i.y, s, r];
  }
  return n;
}
function q4(i) {
  var e;
  const t = i[Mi]();
  if ((e = t.layout) != null && e.includes("row")) {
    const n = t[ot], s = i.colSpan;
    let r;
    r = s === -1 ? Math.sumPrecise(n.columnWidths.slice(n.currentColumn)) : Math.sumPrecise(n.columnWidths.slice(n.currentColumn, n.currentColumn + s)), isNaN(r) || (i.w = r);
  }
  t.layout && t.layout !== "position" && (i.x = i.y = 0), i.layout === "table" && i.w === "" && Array.isArray(i.columnWidths) && (i.w = Math.sumPrecise(i.columnWidths));
}
function aT(i) {
  switch (i.layout) {
    case "position":
    default:
      return "xfaPosition";
    case "lr-tb":
      return "xfaLrTb";
    case "rl-row":
      return "xfaRlRow";
    case "rl-tb":
      return "xfaRlTb";
    case "row":
      return "xfaRow";
    case "table":
      return "xfaTable";
    case "tb":
      return "xfaTb";
  }
}
function ys(i, ...t) {
  const e = /* @__PURE__ */ Object.create(null);
  for (const n of t) {
    const s = i[n];
    if (s !== null) {
      if (bx.hasOwnProperty(n)) bx[n](i, e);
      else if (s instanceof ct) {
        const r = s[ke]();
        r ? Object.assign(e, r) : H(`(DEBUG) - XFA - style for ${n} not implemented yet`);
      }
    }
  }
  return e;
}
function w1(i, t) {
  const { attributes: e } = t, { style: n } = e, s = { name: "div", attributes: { class: ["xfaWrapper"], style: /* @__PURE__ */ Object.create(null) }, children: [] };
  if (e.class.push("xfaWrapped"), i.border) {
    const { widths: r, insets: a } = i.border[ot];
    let o, l, c = a[0], h = a[3];
    const u = a[0] + a[2], f = a[1] + a[3];
    switch (i.border.hand) {
      case "even":
        c -= r[0] / 2, h -= r[3] / 2, o = `calc(100% + ${(r[1] + r[3]) / 2 - f}px)`, l = `calc(100% + ${(r[0] + r[2]) / 2 - u}px)`;
        break;
      case "left":
        c -= r[0], h -= r[3], o = `calc(100% + ${r[1] + r[3] - f}px)`, l = `calc(100% + ${r[0] + r[2] - u}px)`;
        break;
      case "right":
        o = f ? `calc(100% - ${f}px)` : "100%", l = u ? `calc(100% - ${u}px)` : "100%";
    }
    const d = ["xfaBorder"];
    gf(i.border) && d.push("xfaPrintOnly");
    const p = { name: "div", attributes: { class: d, style: { top: `${c}px`, left: `${h}px`, width: o, height: l } }, children: [] };
    for (const g of ["border", "borderWidth", "borderColor", "borderRadius", "borderStyle"]) n[g] !== void 0 && (p.attributes.style[g] = n[g], delete n[g]);
    s.children.push(p, t);
  } else s.children.push(t);
  for (const r of ["background", "backgroundClip", "top", "left", "width", "height", "minWidth", "minHeight", "maxWidth", "maxHeight", "transform", "transformOrigin", "visibility"]) n[r] !== void 0 && (s.attributes.style[r] = n[r], delete n[r]);
  return s.attributes.style.position = n.position === "absolute" ? "absolute" : "relative", delete n.position, n.alignSelf && (s.attributes.style.alignSelf = n.alignSelf, delete n.alignSelf), s;
}
function oT(i) {
  const t = Rt(i.textIndent, "0px");
  if (t >= 0) return;
  const e = "padding" + ((i.textAlign === "right" ? "right" : "left") == "left" ? "Left" : "Right"), n = Rt(i[e], "0px");
  i[e] = n - t + "px";
}
function dw(i, t) {
  switch (i.access) {
    case "nonInteractive":
      t.push("xfaNonInteractive");
      break;
    case "readOnly":
      t.push("xfaReadOnly");
      break;
    case "protected":
      t.push("xfaDisabled");
  }
}
function gf(i) {
  return i.relevant.length > 0 && !i.relevant[0].excluded && i.relevant[0].viewname === "print";
}
function lT(i) {
  const t = i[Fi]()[ot].paraStack;
  return t.length ? t.at(-1) : null;
}
function cT(i, t, e) {
  var n;
  if ((n = e.attributes.class) != null && n.includes("xfaRich")) {
    t && (i.h === "" && (t.height = "auto"), i.w === "" && (t.width = "auto"));
    const s = lT(i);
    if (s) {
      const r = e.attributes.style;
      switch (r.display = "flex", r.flexDirection = "column", s.vAlign) {
        case "top":
          r.justifyContent = "start";
          break;
        case "bottom":
          r.justifyContent = "end";
          break;
        case "middle":
          r.justifyContent = "center";
      }
      const a = s[ke]();
      for (const [o, l] of Object.entries(a)) o in r || (r[o] = l);
    }
  }
}
function hT(i, t, e, n) {
  if (!e) {
    delete n.fontFamily;
    return;
  }
  const s = O4(i.typeface);
  n.fontFamily = `"${s}"`;
  const r = e.find(s);
  if (r) {
    const { fontFamily: a } = r.regular.cssFontInfo;
    a !== s && (n.fontFamily = `"${a}"`);
    const o = lT(t);
    if (o && o.lineHeight !== "" || n.lineHeight) return;
    const l = lw(i, r);
    l && (n.lineHeight = Math.max(1.2, l.lineHeight));
  }
}
function uT(i) {
  const t = a3(i, null, { addDefaultProtocol: !0, tryConvertEncoding: !0 });
  return t ? t.href : null;
}
function dT(i, t) {
  return { name: "div", attributes: { class: [i.layout === "lr-tb" ? "xfaLr" : "xfaRl"] }, children: t };
}
function fT(i) {
  if (!i[ot]) return null;
  const t = { name: "div", attributes: i[ot].attributes, children: i[ot].children };
  if (i[ot].failingNode) {
    const e = i[ot].failingNode[Eg]();
    e && (i.layout.endsWith("-tb") ? t.children.push(dT(i, [e])) : t.children.push(e));
  }
  return t.children.length === 0 ? null : t;
}
function pT(i, t, e) {
  const n = i[ot], s = n.availableSpace, [r, a, o, l] = e;
  switch (i.layout) {
    case "position":
      n.width = Math.max(n.width, r + o), n.height = Math.max(n.height, a + l), n.children.push(t);
      break;
    case "lr-tb":
    case "rl-tb":
      (!n.line || n.attempt === 1) && (n.line = dT(i, []), n.children.push(n.line), n.numberInLine = 0), n.numberInLine += 1, n.line.children.push(t), n.attempt === 0 ? (n.currentWidth += o, n.height = Math.max(n.height, n.prevHeight + l)) : (n.currentWidth = o, n.prevHeight = n.height, n.height += l, n.attempt = 0), n.width = Math.max(n.width, n.currentWidth);
      break;
    case "rl-row":
    case "row": {
      n.children.push(t), n.width += o, n.height = Math.max(n.height, l);
      const c = Xt(n.height);
      for (const h of n.children) h.attributes.style.height = c;
      break;
    }
    case "table":
    case "tb":
      n.width = Tn(o, n.width, s.width), n.height += l, n.children.push(t);
  }
}
function mT(i) {
  const t = i[ot].availableSpace, e = i.margin ? i.margin.topInset + i.margin.bottomInset : 0, n = i.margin ? i.margin.leftInset + i.margin.rightInset : 0;
  switch (i.layout) {
    case "lr-tb":
    case "rl-tb":
      return i[ot].attempt === 0 ? { width: t.width - n - i[ot].currentWidth, height: t.height - e - i[ot].prevHeight } : { width: t.width - n, height: t.height - e - i[ot].height };
    case "rl-row":
    case "row":
      return { width: Math.sumPrecise(i[ot].columnWidths.slice(i[ot].currentColumn)), height: t.height - n };
    case "table":
    case "tb":
      return { width: t.width - n, height: t.height - e - i[ot].height };
    default:
      return t;
  }
}
function z4(i, t) {
  var o;
  if (i[Fi]()[ot].firstUnsplittable === null || i.w === 0 || i.h === 0) return !0;
  const e = i[Mi](), n = ((o = e[ot]) == null ? void 0 : o.attempt) || 0, [, s, r, a] = function(c) {
    let h, u, f = c.w === "" ? NaN : c.w, d = c.h === "" ? NaN : c.h, [p, g] = [0, 0];
    switch (c.anchorType || "") {
      case "bottomCenter":
        [p, g] = [f / 2, d];
        break;
      case "bottomLeft":
        [p, g] = [0, d];
        break;
      case "bottomRight":
        [p, g] = [f, d];
        break;
      case "middleCenter":
        [p, g] = [f / 2, d / 2];
        break;
      case "middleLeft":
        [p, g] = [0, d / 2];
        break;
      case "middleRight":
        [p, g] = [f, d / 2];
        break;
      case "topCenter":
        [p, g] = [f / 2, 0];
        break;
      case "topRight":
        [p, g] = [f, 0];
    }
    switch (c.rotate || 0) {
      case 0:
        [h, u] = [-p, -g];
        break;
      case 90:
        [h, u] = [-g, p], [f, d] = [d, -f];
        break;
      case 180:
        [h, u] = [p, g], [f, d] = [-f, -d];
        break;
      case 270:
        [h, u] = [g, -p], [f, d] = [-d, f];
    }
    return [c.x + h + Math.min(0, f), c.y + u + Math.min(0, d), Math.abs(f), Math.abs(d)];
  }(i);
  switch (e.layout) {
    case "lr-tb":
    case "rl-tb":
      return n === 0 ? i[Fi]()[ot].noLayoutFailure ? i.w !== "" ? Math.round(r - t.width) <= 2 : t.width > 2 : !(i.h !== "" && Math.round(a - t.height) > 2) && (i.w !== "" ? Math.round(r - t.width) <= 2 || e[ot].numberInLine === 0 && t.height > 2 : t.width > 2) : !!i[Fi]()[ot].noLayoutFailure || !(i.h !== "" && Math.round(a - t.height) > 2) && (i.w === "" || Math.round(r - t.width) <= 2 || !e[Xl]()) && t.height > 2;
    case "table":
    case "tb":
      return !!i[Fi]()[ot].noLayoutFailure || (i.h === "" || i[Nl]() ? (i.w === "" || Math.round(r - t.width) <= 2 || !e[Xl]()) && t.height > 2 : Math.round(a - t.height) <= 2);
    case "position":
      return i[Fi]()[ot].noLayoutFailure || i.h === "" || Math.round(a + s - t.height) <= 2 ? !0 : a + s > i[Fi]()[ot].currentContentArea.h;
    case "rl-row":
    case "row":
      return !!i[Fi]()[ot].noLayoutFailure || i.h === "" || Math.round(a - t.height) <= 2;
    default:
      return !0;
  }
}
const Ct = Ri.template.id, v1 = "http://www.w3.org/2000/svg", aO = /^H(\d+)$/, oO = /* @__PURE__ */ new Set(["image/gif", "image/jpeg", "image/jpg", "image/pjpeg", "image/png", "image/apng", "image/x-png", "image/bmp", "image/x-ms-bmp", "image/tiff", "image/tif", "application/octet-stream"]), lO = [[[66, 77], "image/bmp"], [[255, 216, 255], "image/jpeg"], [[73, 73, 42, 0], "image/tiff"], [[77, 77, 0, 42], "image/tiff"], [[71, 73, 70, 56, 57, 97], "image/gif"], [[137, 80, 78, 71, 13, 10, 26, 10], "image/png"]];
function wx(i) {
  if (!i || !i.border) return { w: 0, h: 0 };
  const t = i.border[Fn]();
  return t ? { w: t.widths[0] + t.widths[2] + t.insets[0] + t.insets[2], h: t.widths[1] + t.widths[3] + t.insets[1] + t.insets[3] } : { w: 0, h: 0 };
}
function fw(i) {
  return i.margin && (i.margin.topInset || i.margin.rightInset || i.margin.bottomInset || i.margin.leftInset);
}
function pw(i, t) {
  if (!i.value) {
    const e = new _w({});
    i[pi](e), i.value = e;
  }
  i.value[Bs](t);
}
function* mw(i) {
  for (const t of i[mn]()) t instanceof yw ? yield* t[of]() : yield t;
}
function Dg(i) {
  var t;
  return ((t = i.validate) == null ? void 0 : t.nullTest) === "error";
}
function U4(i) {
  for (; i; ) {
    if (!i.traversal) {
      i[_a] = i[Jt]()[_a];
      return;
    }
    if (i[_a]) return;
    let t = null;
    for (const s of i.traversal[mn]()) if (s.operation === "next") {
      t = s;
      break;
    }
    if (!t || !t.ref) {
      i[_a] = i[Jt]()[_a];
      return;
    }
    const e = i[Fi]();
    i[_a] = ++e[_a];
    const n = e[Rl](t.ref, i);
    if (!n) return;
    i = n[0];
  }
}
function H4(i, t) {
  var n;
  const e = i.assist;
  if (e) {
    const s = e[Gt]();
    s && (t.title = s);
    const r = e.role.match(aO);
    if (r) {
      const a = "heading", o = r[1];
      t.role = a, t["aria-level"] = o;
    }
  }
  if (i.layout === "table") t.role = "table";
  else if (i.layout === "row") t.role = "row";
  else {
    const s = i[Jt]();
    s.layout === "row" && (t.role = ((n = s.assist) == null ? void 0 : n.role) === "TH" ? "columnheader" : "cell");
  }
}
function C1(i) {
  if (!i.assist) return null;
  const t = i.assist;
  return t.speak && t.speak[mt] !== "" ? t.speak[mt] : t.toolTip ? t.toolTip[mt] : null;
}
function v0(i) {
  return $t.success({ name: "div", attributes: { class: ["xfaRich"], style: /* @__PURE__ */ Object.create(null) }, children: [{ name: "span", attributes: { style: /* @__PURE__ */ Object.create(null) }, value: i }] });
}
function j4(i) {
  const t = i[Fi]();
  t[ot].firstUnsplittable === null && (t[ot].firstUnsplittable = i, t[ot].noLayoutFailure = !0);
}
function G4(i) {
  const t = i[Fi]();
  t[ot].firstUnsplittable === i && (t[ot].noLayoutFailure = !1);
}
function vx(i) {
  if (i[ot] || (i[ot] = /* @__PURE__ */ Object.create(null), i.targetType === "auto")) return !1;
  const t = i[Fi]();
  let e = null;
  if (i.target) {
    if (e = t[Rl](i.target, i[Jt]()), !e) return !1;
    e = e[0];
  }
  const { currentPageArea: n, currentContentArea: s } = t[ot];
  if (i.targetType === "pageArea")
    return e instanceof lf || (e = null), i.startNew ? (i[ot].target = e || n, !0) : e && e !== n ? (i[ot].target = e, !0) : !1;
  e instanceof gw || (e = null);
  const r = e && e[Jt]();
  let a, o = r;
  if (i.startNew) if (e) {
    const l = r.contentArea.children, c = l.indexOf(s), h = l.indexOf(e);
    c !== -1 && c < h && (o = null), a = h - 1;
  } else a = n.contentArea.children.indexOf(s);
  else {
    if (!e || e === s) return !1;
    a = r.contentArea.children.indexOf(e) - 1, o = r === n ? null : r;
  }
  return i[ot].target = o, i[ot].index = a, !0;
}
function _x(i, t, e) {
  const n = i[Fi](), s = n[ot].noLayoutFailure, r = t[Mi];
  t[Mi] = () => i, n[ot].noLayoutFailure = !0;
  const a = t[Gt](e);
  i[b1](a.html, a.bbox), n[ot].noLayoutFailure = s, t[Mi] = r;
}
class cO extends de {
  constructor(t) {
    super(Ct, "appearanceFilter"), this.id = t.id || "", this.type = bt(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class gT extends ct {
  constructor(t) {
    super(Ct, "arc", !0), this.circular = Yt({ data: t.circular, defaultValue: 0, validate: (e) => e === 1 }), this.hand = bt(t.hand, ["even", "left", "right"]), this.id = t.id || "", this.startAngle = g3({ data: t.startAngle, defaultValue: 0, validate: (e) => !0 }), this.sweepAngle = g3({ data: t.sweepAngle, defaultValue: 360, validate: (e) => !0 }), this.use = t.use || "", this.usehref = t.usehref || "", this.edge = null, this.fill = null;
  }
  [Gt]() {
    var o;
    const t = this.edge || new Tg({}), e = t[ke](), n = /* @__PURE__ */ Object.create(null);
    ((o = this.fill) == null ? void 0 : o.presence) === "visible" ? Object.assign(n, this.fill[ke]()) : n.fill = "transparent", n.strokeWidth = Xt(t.presence === "visible" ? t.thickness : 0), n.stroke = e.color;
    let s;
    const r = { xmlns: v1, style: { width: "100%", height: "100%", overflow: "visible" } };
    if (this.sweepAngle === 360) s = { name: "ellipse", attributes: { xmlns: v1, cx: "50%", cy: "50%", rx: "50%", ry: "50%", style: n } };
    else {
      const l = this.startAngle * Math.PI / 180, c = this.sweepAngle * Math.PI / 180, h = this.sweepAngle > 180 ? 1 : 0, [u, f, d, p] = [50 * (1 + Math.cos(l)), 50 * (1 - Math.sin(l)), 50 * (1 + Math.cos(l + c)), 50 * (1 - Math.sin(l + c))];
      s = { name: "path", attributes: { xmlns: v1, d: `M ${u} ${f} A 50 50 0 ${h} 0 ${d} ${p}`, vectorEffect: "non-scaling-stroke", style: n } }, Object.assign(r, { viewBox: "0 0 100 100", preserveAspectRatio: "none" });
    }
    const a = { name: "svg", children: [s], attributes: r };
    return fw(this[Jt]()[Jt]()) ? $t.success({ name: "div", attributes: { style: { display: "inline", width: "100%", height: "100%" } }, children: [a] }) : (a.attributes.style.position = "absolute", $t.success(a));
  }
}
class hO extends ct {
  constructor(t) {
    super(Ct, "area", !0), this.colSpan = Yt({ data: t.colSpan, defaultValue: 1, validate: (e) => e >= 1 || e === -1 }), this.id = t.id || "", this.name = t.name || "", this.relevant = Na(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.x = Rt(t.x, "0pt"), this.y = Rt(t.y, "0pt"), this.desc = null, this.extras = null, this.area = new U(), this.draw = new U(), this.exObject = new U(), this.exclGroup = new U(), this.field = new U(), this.subform = new U(), this.subformSet = new U();
  }
  *[of]() {
    yield* mw(this);
  }
  [bp]() {
    return !0;
  }
  [P1]() {
    return !0;
  }
  [b1](t, e) {
    const [n, s, r, a] = e;
    this[ot].width = Math.max(this[ot].width, n + r), this[ot].height = Math.max(this[ot].height, s + a), this[ot].children.push(t);
  }
  [y1]() {
    return this[ot].availableSpace;
  }
  [Gt](t) {
    const e = ys(this, "position"), n = { style: e, id: this[Re], class: ["xfaArea"] };
    gf(this) && n.class.push("xfaPrintOnly"), this.name && (n.xfaName = this.name);
    const s = [];
    this[ot] = { children: s, width: 0, height: 0, availableSpace: t };
    const r = this[f0]({ filter: /* @__PURE__ */ new Set(["area", "draw", "field", "exclGroup", "subform", "subformSet"]), include: !0 });
    if (!r.success)
      return r.isBreak() ? r : (delete this[ot], $t.FAILURE);
    e.width = Xt(this[ot].width), e.height = Xt(this[ot].height);
    const a = { name: "div", attributes: n, children: s }, o = [this.x, this.y, this[ot].width, this[ot].height];
    return delete this[ot], $t.success(a, o);
  }
}
class uO extends ct {
  constructor(t) {
    super(Ct, "assist", !0), this.id = t.id || "", this.role = t.role || "", this.use = t.use || "", this.usehref = t.usehref || "", this.speak = null, this.toolTip = null;
  }
  [Gt]() {
    var t;
    return ((t = this.toolTip) == null ? void 0 : t[mt]) || null;
  }
}
class dO extends ct {
  constructor(t) {
    super(Ct, "barcode", !0), this.charEncoding = $4({ data: t.charEncoding ? t.charEncoding.toLowerCase() : "", defaultValue: "", validate: (e) => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(e) || e.match(/iso-8859-\d{2}/) }), this.checksum = bt(t.checksum, ["none", "1mod10", "1mod10_1mod11", "2mod10", "auto"]), this.dataColumnCount = Yt({ data: t.dataColumnCount, defaultValue: -1, validate: (e) => e >= 0 }), this.dataLength = Yt({ data: t.dataLength, defaultValue: -1, validate: (e) => e >= 0 }), this.dataPrep = bt(t.dataPrep, ["none", "flateCompress"]), this.dataRowCount = Yt({ data: t.dataRowCount, defaultValue: -1, validate: (e) => e >= 0 }), this.endChar = t.endChar || "", this.errorCorrectionLevel = Yt({ data: t.errorCorrectionLevel, defaultValue: -1, validate: (e) => e >= 0 && e <= 8 }), this.id = t.id || "", this.moduleHeight = Rt(t.moduleHeight, "5mm"), this.moduleWidth = Rt(t.moduleWidth, "0.25mm"), this.printCheckDigit = Yt({ data: t.printCheckDigit, defaultValue: 0, validate: (e) => e === 1 }), this.rowColumnRatio = ux(t.rowColumnRatio), this.startChar = t.startChar || "", this.textLocation = bt(t.textLocation, ["below", "above", "aboveEmbedded", "belowEmbedded", "none"]), this.truncate = Yt({ data: t.truncate, defaultValue: 0, validate: (e) => e === 1 }), this.type = bt(t.type ? t.type.toLowerCase() : "", ["aztec", "codabar", "code2of5industrial", "code2of5interleaved", "code2of5matrix", "code2of5standard", "code3of9", "code3of9extended", "code11", "code49", "code93", "code128", "code128a", "code128b", "code128c", "code128sscc", "datamatrix", "ean8", "ean8add2", "ean8add5", "ean13", "ean13add2", "ean13add5", "ean13pwcd", "fim", "logmars", "maxicode", "msi", "pdf417", "pdf417macro", "plessey", "postauscust2", "postauscust3", "postausreplypaid", "postausstandard", "postukrm4scc", "postusdpbc", "postusimb", "postusstandard", "postus5zip", "qrcode", "rfid", "rss14", "rss14expanded", "rss14limited", "rss14stacked", "rss14stackedomni", "rss14truncated", "telepen", "ucc128", "ucc128random", "ucc128sscc", "upca", "upcaadd2", "upcaadd5", "upcapwcd", "upce", "upceadd2", "upceadd5", "upcean2", "upcean5", "upsmaxicode"]), this.upsMode = bt(t.upsMode, ["usCarrier", "internationalCarrier", "secureSymbol", "standardSymbol"]), this.use = t.use || "", this.usehref = t.usehref || "", this.wideNarrowRatio = ux(t.wideNarrowRatio), this.encrypt = null, this.extras = null;
  }
}
class fO extends ct {
  constructor(t) {
    super(Ct, "bind", !0), this.match = bt(t.match, ["once", "dataRef", "global", "none"]), this.ref = t.ref || "", this.picture = null;
  }
}
class Ub extends ct {
  constructor(t) {
    super(Ct, "bindItems"), this.connection = t.connection || "", this.labelRef = t.labelRef || "", this.ref = t.ref || "", this.valueRef = t.valueRef || "";
  }
}
class pO extends ct {
  constructor(t) {
    super(Ct, "bookend"), this.id = t.id || "", this.leader = t.leader || "", this.trailer = t.trailer || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class mO extends Yi {
  constructor(t) {
    super(Ct, "boolean"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [Gt](t) {
    return v0(this[mt] === 1 ? "1" : "0");
  }
}
class bT extends ct {
  constructor(t) {
    super(Ct, "border", !0), this.break = bt(t.break, ["close", "open"]), this.hand = bt(t.hand, ["even", "left", "right"]), this.id = t.id || "", this.presence = bt(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.relevant = Na(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.corner = new U(4), this.edge = new U(4), this.extras = null, this.fill = null, this.margin = null;
  }
  [Fn]() {
    if (!this[ot]) {
      const t = this.edge.children.slice();
      if (t.length < 4) {
        const s = t.at(-1) || new Tg({});
        for (let r = t.length; r < 4; r++) t.push(s);
      }
      const e = t.map((s) => s.thickness), n = [0, 0, 0, 0];
      this.margin && (n[0] = this.margin.topInset, n[1] = this.margin.rightInset, n[2] = this.margin.bottomInset, n[3] = this.margin.leftInset), this[ot] = { widths: e, insets: n, edges: t };
    }
    return this[ot];
  }
  [ke]() {
    var s;
    const { edges: t } = this[Fn](), e = t.map((r) => {
      const a = r[ke]();
      return a.color || (a.color = "#000000"), a;
    }), n = /* @__PURE__ */ Object.create(null);
    if (this.margin && Object.assign(n, this.margin[ke]()), ((s = this.fill) == null ? void 0 : s.presence) === "visible" && Object.assign(n, this.fill[ke]()), this.corner.children.some((r) => r.radius !== 0)) {
      const r = this.corner.children.map((a) => a[ke]());
      if (r.length === 2 || r.length === 3) {
        const a = r.at(-1);
        for (let o = r.length; o < 4; o++) r.push(a);
      }
      n.borderRadius = r.map((a) => a.radius).join(" ");
    }
    switch (this.presence) {
      case "invisible":
      case "hidden":
        n.borderStyle = "";
        break;
      case "inactive":
        n.borderStyle = "none";
        break;
      default:
        n.borderStyle = e.map((r) => r.style).join(" ");
    }
    return n.borderWidth = e.map((r) => r.width).join(" "), n.borderColor = e.map((r) => r.color).join(" "), n;
  }
}
class gO extends ct {
  constructor(t) {
    super(Ct, "break", !0), this.after = bt(t.after, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]), this.afterTarget = t.afterTarget || "", this.before = bt(t.before, ["auto", "contentArea", "pageArea", "pageEven", "pageOdd"]), this.beforeTarget = t.beforeTarget || "", this.bookendLeader = t.bookendLeader || "", this.bookendTrailer = t.bookendTrailer || "", this.id = t.id || "", this.overflowLeader = t.overflowLeader || "", this.overflowTarget = t.overflowTarget || "", this.overflowTrailer = t.overflowTrailer || "", this.startNew = Yt({ data: t.startNew, defaultValue: 0, validate: (e) => e === 1 }), this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null;
  }
}
class yT extends ct {
  constructor(t) {
    super(Ct, "breakAfter", !0), this.id = t.id || "", this.leader = t.leader || "", this.startNew = Yt({ data: t.startNew, defaultValue: 0, validate: (e) => e === 1 }), this.target = t.target || "", this.targetType = bt(t.targetType, ["auto", "contentArea", "pageArea"]), this.trailer = t.trailer || "", this.use = t.use || "", this.usehref = t.usehref || "", this.script = null;
  }
}
class wT extends ct {
  constructor(t) {
    super(Ct, "breakBefore", !0), this.id = t.id || "", this.leader = t.leader || "", this.startNew = Yt({ data: t.startNew, defaultValue: 0, validate: (e) => e === 1 }), this.target = t.target || "", this.targetType = bt(t.targetType, ["auto", "contentArea", "pageArea"]), this.trailer = t.trailer || "", this.use = t.use || "", this.usehref = t.usehref || "", this.script = null;
  }
  [Gt](t) {
    return this[ot] = {}, $t.FAILURE;
  }
}
class bO extends ct {
  constructor(t) {
    super(Ct, "button", !0), this.highlight = bt(t.highlight, ["inverted", "none", "outline", "push"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null;
  }
  [Gt](t) {
    const e = this[Jt]()[Jt](), n = { name: "button", attributes: { id: this[Re], class: ["xfaButton"], style: {} }, children: [] };
    for (const s of e.event.children) {
      if (s.activity !== "click" || !s.script) continue;
      const r = $E(s.script[mt]);
      if (!r) continue;
      const a = uT(r.url);
      a && n.children.push({ name: "a", attributes: { id: "link" + this[Re], href: a, newWindow: r.newWindow, class: ["xfaLink"], style: {} }, children: [] });
    }
    return $t.success(n);
  }
}
class yO extends ct {
  constructor(t) {
    super(Ct, "calculate", !0), this.id = t.id || "", this.override = bt(t.override, ["disabled", "error", "ignore", "warning"]), this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.message = null, this.script = null;
  }
}
class wO extends ct {
  constructor(t) {
    super(Ct, "caption", !0), this.id = t.id || "", this.placement = bt(t.placement, ["left", "bottom", "inline", "right", "top"]), this.presence = bt(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.reserve = Math.ceil(Rt(t.reserve)), this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.font = null, this.margin = null, this.para = null, this.value = null;
  }
  [Bs](t) {
    pw(this, t);
  }
  [Fn](t) {
    if (!this[ot]) {
      let { width: e, height: n } = t;
      switch (this.placement) {
        case "left":
        case "right":
        case "inline":
          e = this.reserve <= 0 ? e : this.reserve;
          break;
        case "top":
        case "bottom":
          n = this.reserve <= 0 ? n : this.reserve;
      }
      this[ot] = uw(this, { width: e });
    }
    return this[ot];
  }
  [Gt](t) {
    if (!this.value) return $t.EMPTY;
    this[mf]();
    const e = this.value[Gt](t).html;
    if (!e)
      return this[Fs](), $t.EMPTY;
    const n = this.reserve;
    if (this.reserve <= 0) {
      const { w: a, h: o } = this[Fn](t);
      switch (this.placement) {
        case "left":
        case "right":
        case "inline":
          this.reserve = a;
          break;
        case "top":
        case "bottom":
          this.reserve = o;
      }
    }
    const s = [];
    typeof e == "string" ? s.push({ name: "#text", value: e }) : s.push(e);
    const r = ys(this, "font", "margin", "visibility");
    switch (this.placement) {
      case "left":
      case "right":
        this.reserve > 0 && (r.width = Xt(this.reserve));
        break;
      case "top":
      case "bottom":
        this.reserve > 0 && (r.height = Xt(this.reserve));
    }
    return cT(this, null, e), this[Fs](), this.reserve = n, $t.success({ name: "div", attributes: { style: r, class: ["xfaCaption"] }, children: s });
  }
}
class vO extends de {
  constructor(t) {
    super(Ct, "certificate"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class _O extends ct {
  constructor(t) {
    super(Ct, "certificates", !0), this.credentialServerPolicy = bt(t.credentialServerPolicy, ["optional", "required"]), this.id = t.id || "", this.url = t.url || "", this.urlPolicy = t.urlPolicy || "", this.use = t.use || "", this.usehref = t.usehref || "", this.encryption = null, this.issuers = null, this.keyUsage = null, this.oids = null, this.signing = null, this.subjectDNs = null;
  }
}
class vT extends ct {
  constructor(t) {
    super(Ct, "checkButton", !0), this.id = t.id || "", this.mark = bt(t.mark, ["default", "check", "circle", "cross", "diamond", "square", "star"]), this.shape = bt(t.shape, ["square", "round"]), this.size = Rt(t.size, "10pt"), this.use = t.use || "", this.usehref = t.usehref || "", this.border = null, this.extras = null, this.margin = null;
  }
  [Gt](t) {
    var g, b, y;
    const e = ys(this, "margin"), n = Xt(this.size);
    e.width = e.height = n;
    let s, r, a;
    const o = this[Jt]()[Jt](), l = o.items.children.length && o.items.children[0][Gt]().html || [], c = { on: (l[0] !== void 0 ? l[0] : "on").toString(), off: (l[1] !== void 0 ? l[1] : "off").toString() }, h = (((g = o.value) == null ? void 0 : g[Wi]()) || "off") === c.on || void 0, u = o[Mi](), f = o[Re];
    let d;
    u instanceof AT ? (a = u[Re], s = "radio", r = "xfaRadio", d = ((b = u[Br]) == null ? void 0 : b[Re]) || u[Re]) : (s = "checkbox", r = "xfaCheckbox", d = ((y = o[Br]) == null ? void 0 : y[Re]) || o[Re]);
    const p = { name: "input", attributes: { class: [r], style: e, fieldId: f, dataId: d, type: s, checked: h, xfaOn: c.on, xfaOff: c.off, "aria-label": C1(o), "aria-required": !1 } };
    return a && (p.attributes.name = a), Dg(o) && (p.attributes["aria-required"] = !0, p.attributes.required = !0), $t.success({ name: "label", attributes: { class: ["xfaLabel"] }, children: [p] });
  }
}
class _T extends ct {
  constructor(t) {
    super(Ct, "choiceList", !0), this.commitOn = bt(t.commitOn, ["select", "exit"]), this.id = t.id || "", this.open = bt(t.open, ["userControl", "always", "multiSelect", "onEntry"]), this.textEntry = Yt({ data: t.textEntry, defaultValue: 0, validate: (e) => e === 1 }), this.use = t.use || "", this.usehref = t.usehref || "", this.border = null, this.extras = null, this.margin = null;
  }
  [Gt](t) {
    var o, l, c;
    const e = ys(this, "border", "margin"), n = this[Jt]()[Jt](), s = { fontSize: `calc(${((o = n.font) == null ? void 0 : o.size) || 10}px * var(--total-scale-factor))` }, r = [];
    if (n.items.children.length > 0) {
      const h = n.items;
      let u = 0, f = 0;
      h.children.length === 2 && (u = h.children[0].save, f = 1 - u);
      const d = h.children[u][Gt]().html, p = h.children[f][Gt]().html;
      let g = !1;
      const b = ((l = n.value) == null ? void 0 : l[Wi]()) || "";
      for (let y = 0, v = d.length; y < v; y++) {
        const w = { name: "option", attributes: { value: p[y] || d[y], style: s }, value: d[y] };
        p[y] === b && (w.attributes.selected = g = !0), r.push(w);
      }
      g || r.splice(0, 0, { name: "option", attributes: { hidden: !0, selected: !0 }, value: " " });
    }
    const a = { class: ["xfaSelect"], fieldId: n[Re], dataId: ((c = n[Br]) == null ? void 0 : c[Re]) || n[Re], style: e, "aria-label": C1(n), "aria-required": !1 };
    return Dg(n) && (a["aria-required"] = !0, a.required = !0), this.open === "multiSelect" && (a.multiple = !0), $t.success({ name: "label", attributes: { class: ["xfaLabel"] }, children: [{ name: "select", children: r, attributes: a }] });
  }
}
class xO extends ct {
  constructor(t) {
    super(Ct, "color", !0), this.cSpace = bt(t.cSpace, ["SRGB"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.value = t.value ? function(n, s = [0, 0, 0]) {
      let [r, a, o] = s;
      if (!n) return { r, g: a, b: o };
      const l = n.split(",", 3).map((c) => Tn(parseInt(c.trim(), 10), 0, 255)).map((c) => isNaN(c) ? 0 : c);
      return l.length < 3 ? { r, g: a, b: o } : ([r, a, o] = l, { r, g: a, b: o });
    }(t.value) : "", this.extras = null;
  }
  [gp]() {
    return !1;
  }
  [ke]() {
    return this.value ? Ee.makeHexColor(this.value.r, this.value.g, this.value.b) : null;
  }
}
class kO extends ct {
  constructor(t) {
    super(Ct, "comb"), this.id = t.id || "", this.numberOfCells = Yt({ data: t.numberOfCells, defaultValue: 0, validate: (e) => e >= 0 }), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class AO extends ct {
  constructor(t) {
    super(Ct, "connect", !0), this.connection = t.connection || "", this.id = t.id || "", this.ref = t.ref || "", this.usage = bt(t.usage, ["exportAndImport", "exportOnly", "importOnly"]), this.use = t.use || "", this.usehref = t.usehref || "", this.picture = null;
  }
}
class gw extends ct {
  constructor(t) {
    super(Ct, "contentArea", !0), this.h = Rt(t.h), this.id = t.id || "", this.name = t.name || "", this.relevant = Na(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.w = Rt(t.w), this.x = Rt(t.x, "0pt"), this.y = Rt(t.y, "0pt"), this.desc = null, this.extras = null;
  }
  [Gt](t) {
    const e = { left: Xt(this.x), top: Xt(this.y), width: Xt(this.w), height: Xt(this.h) }, n = ["xfaContentarea"];
    return gf(this) && n.push("xfaPrintOnly"), $t.success({ name: "div", children: [], attributes: { style: e, class: n, id: this[Re] } });
  }
}
class xT extends ct {
  constructor(t) {
    super(Ct, "corner", !0), this.id = t.id || "", this.inverted = Yt({ data: t.inverted, defaultValue: 0, validate: (e) => e === 1 }), this.join = bt(t.join, ["square", "round"]), this.presence = bt(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.radius = Rt(t.radius), this.stroke = bt(t.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]), this.thickness = Rt(t.thickness, "0.5pt"), this.use = t.use || "", this.usehref = t.usehref || "", this.color = null, this.extras = null;
  }
  [ke]() {
    const t = ys(this, "visibility");
    return t.radius = Xt(this.join === "square" ? 0 : this.radius), t;
  }
}
class SO extends bi {
  constructor(t) {
    super(Ct, "date"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [Ue]() {
    const t = this[mt].trim();
    this[mt] = t ? new Date(t) : null;
  }
  [Gt](t) {
    return v0(this[mt] ? this[mt].toString() : "");
  }
}
class CO extends bi {
  constructor(t) {
    super(Ct, "dateTime"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [Ue]() {
    const t = this[mt].trim();
    this[mt] = t ? new Date(t) : null;
  }
  [Gt](t) {
    return v0(this[mt] ? this[mt].toString() : "");
  }
}
class EO extends ct {
  constructor(t) {
    super(Ct, "dateTimeEdit", !0), this.hScrollPolicy = bt(t.hScrollPolicy, ["auto", "off", "on"]), this.id = t.id || "", this.picker = bt(t.picker, ["host", "none"]), this.use = t.use || "", this.usehref = t.usehref || "", this.border = null, this.comb = null, this.extras = null, this.margin = null;
  }
  [Gt](t) {
    var r;
    const e = ys(this, "border", "font", "margin"), n = this[Jt]()[Jt](), s = { name: "input", attributes: { type: "text", fieldId: n[Re], dataId: ((r = n[Br]) == null ? void 0 : r[Re]) || n[Re], class: ["xfaTextfield"], style: e, "aria-label": C1(n), "aria-required": !1 } };
    return Dg(n) && (s.attributes["aria-required"] = !0, s.attributes.required = !0), $t.success({ name: "label", attributes: { class: ["xfaLabel"] }, children: [s] });
  }
}
class DO extends bi {
  constructor(t) {
    super(Ct, "decimal"), this.fracDigits = Yt({ data: t.fracDigits, defaultValue: 2, validate: (e) => !0 }), this.id = t.id || "", this.leadDigits = Yt({ data: t.leadDigits, defaultValue: -1, validate: (e) => !0 }), this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [Ue]() {
    const t = parseFloat(this[mt].trim());
    this[mt] = isNaN(t) ? null : t;
  }
  [Gt](t) {
    return v0(this[mt] !== null ? this[mt].toString() : "");
  }
}
class TO extends ct {
  constructor(t) {
    super(Ct, "defaultUi", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null;
  }
}
class FO extends ct {
  constructor(t) {
    super(Ct, "desc", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.boolean = new U(), this.date = new U(), this.dateTime = new U(), this.decimal = new U(), this.exData = new U(), this.float = new U(), this.image = new U(), this.integer = new U(), this.text = new U(), this.time = new U();
  }
}
class IO extends Be {
  constructor(t) {
    super(Ct, "digestMethod", ["", "SHA1", "SHA256", "SHA512", "RIPEMD160"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class MO extends ct {
  constructor(t) {
    super(Ct, "digestMethods", !0), this.id = t.id || "", this.type = bt(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.digestMethod = new U();
  }
}
class kT extends ct {
  constructor(t) {
    super(Ct, "draw", !0), this.anchorType = bt(t.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]), this.colSpan = Yt({ data: t.colSpan, defaultValue: 1, validate: (e) => e >= 1 || e === -1 }), this.h = t.h ? Rt(t.h) : "", this.hAlign = bt(t.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]), this.id = t.id || "", this.locale = t.locale || "", this.maxH = Rt(t.maxH, "0pt"), this.maxW = Rt(t.maxW, "0pt"), this.minH = Rt(t.minH, "0pt"), this.minW = Rt(t.minW, "0pt"), this.name = t.name || "", this.presence = bt(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.relevant = Na(t.relevant), this.rotate = Yt({ data: t.rotate, defaultValue: 0, validate: (e) => e % 90 == 0 }), this.use = t.use || "", this.usehref = t.usehref || "", this.w = t.w ? Rt(t.w) : "", this.x = Rt(t.x, "0pt"), this.y = Rt(t.y, "0pt"), this.assist = null, this.border = null, this.caption = null, this.desc = null, this.extras = null, this.font = null, this.keep = null, this.margin = null, this.para = null, this.traversal = null, this.ui = null, this.value = null, this.setProperty = new U();
  }
  [Bs](t) {
    pw(this, t);
  }
  [Gt](t) {
    if (U4(this), this.presence === "hidden" || this.presence === "inactive") return $t.EMPTY;
    q4(this), this[mf]();
    const e = this.w, n = this.h, { w: s, h: r, isBroken: a } = uw(this, t);
    if (s && this.w === "") {
      if (a && this[Mi]()[Xl]())
        return this[Fs](), $t.FAILURE;
      this.w = s;
    }
    if (r && this.h === "" && (this.h = r), j4(this), !z4(this, t))
      return this.w = e, this.h = n, this[Fs](), $t.FAILURE;
    G4(this);
    const o = ys(this, "font", "hAlign", "dimensions", "position", "presence", "rotate", "anchorType", "border", "margin");
    sT(this, o), o.margin && (o.padding = o.margin, delete o.margin);
    const l = ["xfaDraw"];
    this.font && l.push("xfaFont"), gf(this) && l.push("xfaPrintOnly");
    const c = { style: o, id: this[Re], class: l };
    this.name && (c.xfaName = this.name);
    const h = { name: "div", attributes: c, children: [] };
    H4(this, c);
    const u = rT(this, h, t), f = this.value ? this.value[Gt](t).html : null;
    return f === null ? (this.w = e, this.h = n, this[Fs](), $t.success(w1(this, h), u)) : (h.children.push(f), cT(this, o, f), this.w = e, this.h = n, this[Fs](), $t.success(w1(this, h), u));
  }
}
class Tg extends ct {
  constructor(t) {
    super(Ct, "edge", !0), this.cap = bt(t.cap, ["square", "butt", "round"]), this.id = t.id || "", this.presence = bt(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.stroke = bt(t.stroke, ["solid", "dashDot", "dashDotDot", "dashed", "dotted", "embossed", "etched", "lowered", "raised"]), this.thickness = Rt(t.thickness, "0.5pt"), this.use = t.use || "", this.usehref = t.usehref || "", this.color = null, this.extras = null;
  }
  [ke]() {
    const t = ys(this, "visibility");
    if (Object.assign(t, { linecap: this.cap, width: Xt(this.thickness), color: this.color ? this.color[ke]() : "#000000", style: "" }), this.presence !== "visible") t.style = "none";
    else switch (this.stroke) {
      case "solid":
        t.style = "solid";
        break;
      case "dashDot":
      case "dashDotDot":
      case "dashed":
        t.style = "dashed";
        break;
      case "dotted":
        t.style = "dotted";
        break;
      case "embossed":
        t.style = "ridge";
        break;
      case "etched":
        t.style = "groove";
        break;
      case "lowered":
        t.style = "inset";
        break;
      case "raised":
        t.style = "outset";
    }
    return t;
  }
}
class RO extends Be {
  constructor(t) {
    super(Ct, "encoding", ["adbe.x509.rsa_sha1", "adbe.pkcs7.detached", "adbe.pkcs7.sha1"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class BO extends ct {
  constructor(t) {
    super(Ct, "encodings", !0), this.id = t.id || "", this.type = bt(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.encoding = new U();
  }
}
class PO extends ct {
  constructor(t) {
    super(Ct, "encrypt", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.certificate = null;
  }
}
class NO extends ct {
  constructor(t) {
    super(Ct, "encryptData", !0), this.id = t.id || "", this.operation = bt(t.operation, ["encrypt", "decrypt"]), this.target = t.target || "", this.use = t.use || "", this.usehref = t.usehref || "", this.filter = null, this.manifest = null;
  }
}
class LO extends ct {
  constructor(t) {
    super(Ct, "encryption", !0), this.id = t.id || "", this.type = bt(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.certificate = new U();
  }
}
class OO extends Be {
  constructor(t) {
    super(Ct, "encryptionMethod", ["", "AES256-CBC", "TRIPLEDES-CBC", "AES128-CBC", "AES192-CBC"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class $O extends ct {
  constructor(t) {
    super(Ct, "encryptionMethods", !0), this.id = t.id || "", this.type = bt(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.encryptionMethod = new U();
  }
}
let qO = class extends ct {
  constructor(t) {
    super(Ct, "event", !0), this.activity = bt(t.activity, ["click", "change", "docClose", "docReady", "enter", "exit", "full", "indexChange", "initialize", "mouseDown", "mouseEnter", "mouseExit", "mouseUp", "postExecute", "postOpen", "postPrint", "postSave", "postSign", "postSubmit", "preExecute", "preOpen", "prePrint", "preSave", "preSign", "preSubmit", "ready", "validationState"]), this.id = t.id || "", this.listen = bt(t.listen, ["refOnly", "refAndDescendents"]), this.name = t.name || "", this.ref = t.ref || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.encryptData = null, this.execute = null, this.script = null, this.signData = null, this.submit = null;
  }
};
class zO extends bi {
  constructor(t) {
    super(Ct, "exData"), this.contentType = t.contentType || "", this.href = t.href || "", this.id = t.id || "", this.maxLength = Yt({ data: t.maxLength, defaultValue: -1, validate: (e) => e >= -1 }), this.name = t.name || "", this.rid = t.rid || "", this.transferEncoding = bt(t.transferEncoding, ["none", "base64", "package"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [ow]() {
    return this.contentType === "text/html";
  }
  [So](t) {
    return this.contentType === "text/html" && t[Ii] === Ri.xhtml.id ? (this[mt] = t, !0) : this.contentType === "text/xml" ? (this[mt] = t, !0) : !1;
  }
  [Gt](t) {
    return this.contentType === "text/html" && this[mt] ? this[mt][Gt](t) : $t.EMPTY;
  }
}
class UO extends ct {
  constructor(t) {
    super(Ct, "exObject", !0), this.archive = t.archive || "", this.classId = t.classId || "", this.codeBase = t.codeBase || "", this.codeType = t.codeType || "", this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.boolean = new U(), this.date = new U(), this.dateTime = new U(), this.decimal = new U(), this.exData = new U(), this.exObject = new U(), this.float = new U(), this.image = new U(), this.integer = new U(), this.text = new U(), this.time = new U();
  }
}
class AT extends ct {
  constructor(t) {
    super(Ct, "exclGroup", !0), this.access = bt(t.access, ["open", "nonInteractive", "protected", "readOnly"]), this.accessKey = t.accessKey || "", this.anchorType = bt(t.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]), this.colSpan = Yt({ data: t.colSpan, defaultValue: 1, validate: (e) => e >= 1 || e === -1 }), this.h = t.h ? Rt(t.h) : "", this.hAlign = bt(t.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]), this.id = t.id || "", this.layout = bt(t.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]), this.maxH = Rt(t.maxH, "0pt"), this.maxW = Rt(t.maxW, "0pt"), this.minH = Rt(t.minH, "0pt"), this.minW = Rt(t.minW, "0pt"), this.name = t.name || "", this.presence = bt(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.relevant = Na(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.w = t.w ? Rt(t.w) : "", this.x = Rt(t.x, "0pt"), this.y = Rt(t.y, "0pt"), this.assist = null, this.bind = null, this.border = null, this.calculate = null, this.caption = null, this.desc = null, this.extras = null, this.margin = null, this.para = null, this.traversal = null, this.validate = null, this.connect = new U(), this.event = new U(), this.field = new U(), this.setProperty = new U();
  }
  [P1]() {
    return !0;
  }
  [gp]() {
    return !0;
  }
  [Bs](t) {
    for (const e of this.field.children) {
      if (!e.value) {
        const n = new _w({});
        e[pi](n), e.value = n;
      }
      e.value[Bs](t);
    }
  }
  [Xl]() {
    return this.layout.endsWith("-tb") && this[ot].attempt === 0 && this[ot].numberInLine > 0 || this[Jt]()[Xl]();
  }
  [Nl]() {
    var e;
    const t = this[Mi]();
    return t[Nl]() ? this[ot]._isSplittable !== void 0 ? this[ot]._isSplittable : this.layout === "position" || this.layout.includes("row") ? (this[ot]._isSplittable = !1, !1) : (e = t.layout) != null && e.endsWith("-tb") && t[ot].numberInLine !== 0 ? !1 : (this[ot]._isSplittable = !0, !0) : !1;
  }
  [Eg]() {
    return fT(this);
  }
  [b1](t, e) {
    pT(this, t, e);
  }
  [y1]() {
    return mT(this);
  }
  [Gt](t) {
    if (U4(this), this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) return $t.EMPTY;
    q4(this);
    const e = [], n = { id: this[Re], class: [] };
    dw(this, n.class), this[ot] || (this[ot] = /* @__PURE__ */ Object.create(null)), Object.assign(this[ot], { children: e, attributes: n, attempt: 0, line: null, numberInLine: 0, availableSpace: { width: Math.min(this.w || 1 / 0, t.width), height: Math.min(this.h || 1 / 0, t.height) }, width: 0, height: 0, prevHeight: 0, currentWidth: 0 });
    const s = this[Nl]();
    if (s || j4(this), !z4(this, t)) return $t.FAILURE;
    const r = /* @__PURE__ */ new Set(["field"]);
    if (this.layout.includes("row")) {
      const y = this[Mi]().columnWidths;
      Array.isArray(y) && y.length > 0 && (this[ot].columnWidths = y, this[ot].currentColumn = 0);
    }
    const a = ys(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign"), o = ["xfaExclgroup"], l = aT(this);
    l && o.push(l), gf(this) && o.push("xfaPrintOnly"), n.style = a, n.class = o, this.name && (n.xfaName = this.name), this[mf]();
    const c = this.layout === "lr-tb" || this.layout === "rl-tb", h = c ? 2 : 1;
    for (; this[ot].attempt < h; this[ot].attempt++) {
      c && this[ot].attempt === 1 && (this[ot].numberInLine = 0);
      const y = this[f0]({ filter: r, include: !0 });
      if (y.success) break;
      if (y.isBreak())
        return this[Fs](), y;
      if (c && this[ot].attempt === 0 && this[ot].numberInLine === 0 && !this[Fi]()[ot].noLayoutFailure) {
        this[ot].attempt = h;
        break;
      }
    }
    if (this[Fs](), s || G4(this), this[ot].attempt === h)
      return s || delete this[ot], $t.FAILURE;
    let u = 0, f = 0;
    this.margin && (u = this.margin.leftInset + this.margin.rightInset, f = this.margin.topInset + this.margin.bottomInset);
    const d = Math.max(this[ot].width + u, this.w || 0), p = Math.max(this[ot].height + f, this.h || 0), g = [this.x, this.y, d, p];
    this.w === "" && (a.width = Xt(d)), this.h === "" && (a.height = Xt(p));
    const b = { name: "div", attributes: n, children: e };
    return H4(this, n), delete this[ot], $t.success(w1(this, b), g);
  }
}
class HO extends ct {
  constructor(t) {
    super(Ct, "execute"), this.connection = t.connection || "", this.executeType = bt(t.executeType, ["import", "remerge"]), this.id = t.id || "", this.runAt = bt(t.runAt, ["client", "both", "server"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class jO extends ct {
  constructor(t) {
    super(Ct, "extras", !0), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "", this.boolean = new U(), this.date = new U(), this.dateTime = new U(), this.decimal = new U(), this.exData = new U(), this.extras = new U(), this.float = new U(), this.image = new U(), this.integer = new U(), this.text = new U(), this.time = new U();
  }
}
class bw extends ct {
  constructor(t) {
    super(Ct, "field", !0), this.access = bt(t.access, ["open", "nonInteractive", "protected", "readOnly"]), this.accessKey = t.accessKey || "", this.anchorType = bt(t.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]), this.colSpan = Yt({ data: t.colSpan, defaultValue: 1, validate: (e) => e >= 1 || e === -1 }), this.h = t.h ? Rt(t.h) : "", this.hAlign = bt(t.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]), this.id = t.id || "", this.locale = t.locale || "", this.maxH = Rt(t.maxH, "0pt"), this.maxW = Rt(t.maxW, "0pt"), this.minH = Rt(t.minH, "0pt"), this.minW = Rt(t.minW, "0pt"), this.name = t.name || "", this.presence = bt(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.relevant = Na(t.relevant), this.rotate = Yt({ data: t.rotate, defaultValue: 0, validate: (e) => e % 90 == 0 }), this.use = t.use || "", this.usehref = t.usehref || "", this.w = t.w ? Rt(t.w) : "", this.x = Rt(t.x, "0pt"), this.y = Rt(t.y, "0pt"), this.assist = null, this.bind = null, this.border = null, this.calculate = null, this.caption = null, this.desc = null, this.extras = null, this.font = null, this.format = null, this.items = new U(2), this.keep = null, this.margin = null, this.para = null, this.traversal = null, this.ui = null, this.validate = null, this.value = null, this.bindItems = new U(), this.connect = new U(), this.event = new U(), this.setProperty = new U();
  }
  [P1]() {
    return !0;
  }
  [Bs](t) {
    pw(this, t);
  }
  [Gt](t) {
    var y, v, w, _, x;
    if (U4(this), !this.ui) {
      this.ui = new vw({}), this.ui[ze] = this[ze], this[pi](this.ui);
      let k;
      switch (this.items.children.length) {
        case 0:
          k = new FT({}), this.ui.textEdit = k;
          break;
        case 1:
          k = new vT({}), this.ui.checkButton = k;
          break;
        case 2:
          k = new _T({}), this.ui.choiceList = k;
      }
      this.ui[pi](k);
    }
    if (!this.ui || this.presence === "hidden" || this.presence === "inactive" || this.h === 0 || this.w === 0) return $t.EMPTY;
    this.caption && delete this.caption[ot], this[mf]();
    const e = this.caption ? this.caption[Gt](t).html : null, n = this.w, s = this.h;
    let r = 0, a = 0;
    this.margin && (r = this.margin.leftInset + this.margin.rightInset, a = this.margin.topInset + this.margin.bottomInset);
    let o = null;
    if (this.w === "" || this.h === "") {
      let k = null, S = null, T = 0, I = 0;
      if (this.ui.checkButton) T = I = this.ui.checkButton.size;
      else {
        const { w: R, h: B } = uw(this, t);
        R !== null ? (T = R, I = B) : I = function(it, O = !1) {
          let at = null;
          if (it) {
            const z = O4(it.typeface), j = it[ze].fontFinder.find(z);
            at = lw(it, j);
          }
          if (!at) return { lineHeight: 12, lineGap: 2, lineNoGap: 10 };
          const W = it.size || 10, q = at.lineHeight ? Math.max(O ? 0 : 1.2, at.lineHeight) : 1.2, K = at.lineGap === void 0 ? 0.2 : at.lineGap;
          return { lineHeight: q * W, lineGap: K * W, lineNoGap: Math.max(1, q - K) * W };
        }(this.font, !0).lineNoGap;
      }
      if (o = wx(this.ui[Fn]()), T += o.w, I += o.h, this.caption) {
        const { w: R, h: B, isBroken: L } = this.caption[Fn](t);
        if (L && this[Mi]()[Xl]())
          return this[Fs](), $t.FAILURE;
        switch (k = R, S = B, this.caption.placement) {
          case "left":
          case "right":
          case "inline":
            k += T;
            break;
          case "top":
          case "bottom":
            S += I;
        }
      } else
        k = T, S = I;
      k && this.w === "" && (k += r, this.w = Math.min(this.maxW <= 0 ? 1 / 0 : this.maxW, this.minW + 1 < k ? k : this.minW)), S && this.h === "" && (S += a, this.h = Math.min(this.maxH <= 0 ? 1 / 0 : this.maxH, this.minH + 1 < S ? S : this.minH));
    }
    if (this[Fs](), q4(this), j4(this), !z4(this, t))
      return this.w = n, this.h = s, this[Fs](), $t.FAILURE;
    G4(this);
    const l = ys(this, "font", "dimensions", "position", "rotate", "anchorType", "presence", "margin", "hAlign");
    sT(this, l);
    const c = ["xfaField"];
    this.font && c.push("xfaFont"), gf(this) && c.push("xfaPrintOnly");
    const h = { style: l, id: this[Re], class: c };
    l.margin && (l.padding = l.margin, delete l.margin), dw(this, c), this.name && (h.xfaName = this.name);
    const u = [], f = { name: "div", attributes: h, children: u };
    H4(this, h);
    const d = this.border ? this.border[ke]() : null, p = rT(this, f, t), g = this.ui[Gt]().html;
    if (!g)
      return Object.assign(l, d), $t.success(w1(this, f), p);
    this[_a] && ((y = g.children) != null && y[0] ? g.children[0].attributes.tabindex = this[_a] : g.attributes.tabindex = this[_a]), (v = g.attributes).style || (v.style = /* @__PURE__ */ Object.create(null));
    let b = null;
    if (this.ui.button ? (g.children.length === 1 && ([b] = g.children.splice(0, 1)), Object.assign(g.attributes.style, d)) : Object.assign(l, d), u.push(g), this.value) {
      if (this.ui.imageEdit) g.children.push(this.value[Gt]().html);
      else if (!this.ui.button) {
        let k = "";
        if (this.value.exData) k = this.value.exData[Wi]();
        else if (this.value.text) k = this.value.text[Fn]();
        else {
          const S = this.value[Gt]().html;
          S !== null && (k = S.children[0].value);
        }
        this.ui.textEdit && ((w = this.value.text) != null && w.maxChars) && (g.children[0].attributes.maxLength = this.value.text.maxChars), k && (this.ui.numericEdit && (k = parseFloat(k), k = isNaN(k) ? "" : k.toString()), g.children[0].name === "textarea" ? g.children[0].attributes.textContent = k : g.children[0].attributes.value = k);
      }
    }
    if (!this.ui.imageEdit && ((_ = g.children) != null && _[0]) && this.h) {
      o = o || wx(this.ui[Fn]());
      let k = 0;
      if (this.caption && ["top", "bottom"].includes(this.caption.placement)) {
        k = this.caption.reserve, k <= 0 && (k = this.caption[Fn](t).h);
        const S = this.h - k - a - o.h;
        g.children[0].attributes.style.height = Xt(S);
      } else g.children[0].attributes.style.height = "100%";
    }
    if (b && g.children.push(b), !e)
      return g.attributes.class && g.attributes.class.push("xfaLeft"), this.w = n, this.h = s, $t.success(w1(this, f), p);
    if (this.ui.button)
      return l.padding && delete l.padding, e.name === "div" && (e.name = "span"), g.children.push(e), $t.success(f, p);
    switch (this.ui.checkButton && (e.attributes.class[0] = "xfaCaptionForCheckButton"), (x = g.attributes).class || (x.class = []), g.children.splice(0, 0, e), this.caption.placement) {
      case "left":
      case "inline":
        g.attributes.class.push("xfaLeft");
        break;
      case "right":
        g.attributes.class.push("xfaRight");
        break;
      case "top":
        g.attributes.class.push("xfaTop");
        break;
      case "bottom":
        g.attributes.class.push("xfaBottom");
    }
    return this.w = n, this.h = s, $t.success(w1(this, f), p);
  }
}
class GO extends ct {
  constructor(t) {
    super(Ct, "fill", !0), this.id = t.id || "", this.presence = bt(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.use = t.use || "", this.usehref = t.usehref || "", this.color = null, this.extras = null, this.linear = null, this.pattern = null, this.radial = null, this.solid = null, this.stipple = null;
  }
  [ke]() {
    var a;
    const t = this[Jt](), e = t[Jt]()[Jt](), n = /* @__PURE__ */ Object.create(null);
    let s = "color", r = s;
    t instanceof bT && (s = "background-color", r = "background", e instanceof vw && (n.backgroundColor = "white")), (t instanceof ET || t instanceof gT) && (s = r = "fill", n.fill = "white");
    for (const o of Object.getOwnPropertyNames(this)) {
      if (o === "extras" || o === "color") continue;
      const l = this[o];
      if (!(l instanceof ct)) continue;
      const c = l[ke](this.color);
      return c && (n[c.startsWith("#") ? s : r] = c), n;
    }
    if ((a = this.color) != null && a.value) {
      const o = this.color[ke]();
      n[o.startsWith("#") ? s : r] = o;
    }
    return n;
  }
}
class VO extends ct {
  constructor(t) {
    super(Ct, "filter", !0), this.addRevocationInfo = bt(t.addRevocationInfo, ["", "required", "optional", "none"]), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "", this.version = Yt({ data: this.version, defaultValue: 5, validate: (e) => e >= 1 && e <= 5 }), this.appearanceFilter = null, this.certificates = null, this.digestMethods = null, this.encodings = null, this.encryptionMethods = null, this.handler = null, this.lockDocument = null, this.mdp = null, this.reasons = null, this.timeStamp = null;
  }
}
class WO extends bi {
  constructor(t) {
    super(Ct, "float"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [Ue]() {
    const t = parseFloat(this[mt].trim());
    this[mt] = isNaN(t) ? null : t;
  }
  [Gt](t) {
    return v0(this[mt] !== null ? this[mt].toString() : "");
  }
}
class XO extends ct {
  constructor(t) {
    super(Ct, "font", !0), this.baselineShift = Rt(t.baselineShift), this.fontHorizontalScale = g3({ data: t.fontHorizontalScale, defaultValue: 100, validate: (e) => e >= 0 }), this.fontVerticalScale = g3({ data: t.fontVerticalScale, defaultValue: 100, validate: (e) => e >= 0 }), this.id = t.id || "", this.kerningMode = bt(t.kerningMode, ["none", "pair"]), this.letterSpacing = Rt(t.letterSpacing, "0"), this.lineThrough = Yt({ data: t.lineThrough, defaultValue: 0, validate: (e) => e === 1 || e === 2 }), this.lineThroughPeriod = bt(t.lineThroughPeriod, ["all", "word"]), this.overline = Yt({ data: t.overline, defaultValue: 0, validate: (e) => e === 1 || e === 2 }), this.overlinePeriod = bt(t.overlinePeriod, ["all", "word"]), this.posture = bt(t.posture, ["normal", "italic"]), this.size = Rt(t.size, "10pt"), this.typeface = t.typeface || "Courier", this.underline = Yt({ data: t.underline, defaultValue: 0, validate: (e) => e === 1 || e === 2 }), this.underlinePeriod = bt(t.underlinePeriod, ["all", "word"]), this.use = t.use || "", this.usehref = t.usehref || "", this.weight = bt(t.weight, ["normal", "bold"]), this.extras = null, this.fill = null;
  }
  [Vr](t) {
    super[Vr](t), this[ze].usedTypefaces.add(this.typeface);
  }
  [ke]() {
    const t = ys(this, "fill"), e = t.color;
    return e && (e === "#000000" ? delete t.color : e.startsWith("#") || (t.background = e, t.backgroundClip = "text", t.color = "transparent")), this.baselineShift && (t.verticalAlign = Xt(this.baselineShift)), t.fontKerning = this.kerningMode === "none" ? "none" : "normal", t.letterSpacing = Xt(this.letterSpacing), this.lineThrough !== 0 && (t.textDecoration = "line-through", this.lineThrough === 2 && (t.textDecorationStyle = "double")), this.overline !== 0 && (t.textDecoration = "overline", this.overline === 2 && (t.textDecorationStyle = "double")), t.fontStyle = this.posture, t.fontSize = Xt(0.99 * this.size), hT(this, this, this[ze].fontFinder, t), this.underline !== 0 && (t.textDecoration = "underline", this.underline === 2 && (t.textDecorationStyle = "double")), t.fontWeight = this.weight, t;
  }
}
class YO extends ct {
  constructor(t) {
    super(Ct, "format", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.picture = null;
  }
}
class KO extends de {
  constructor(t) {
    super(Ct, "handler"), this.id = t.id || "", this.type = bt(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class ZO extends ct {
  constructor(t) {
    super(Ct, "hyphenation"), this.excludeAllCaps = Yt({ data: t.excludeAllCaps, defaultValue: 0, validate: (e) => e === 1 }), this.excludeInitialCap = Yt({ data: t.excludeInitialCap, defaultValue: 0, validate: (e) => e === 1 }), this.hyphenate = Yt({ data: t.hyphenate, defaultValue: 0, validate: (e) => e === 1 }), this.id = t.id || "", this.pushCharacterCount = Yt({ data: t.pushCharacterCount, defaultValue: 3, validate: (e) => e >= 0 }), this.remainCharacterCount = Yt({ data: t.remainCharacterCount, defaultValue: 3, validate: (e) => e >= 0 }), this.use = t.use || "", this.usehref = t.usehref || "", this.wordCharacterCount = Yt({ data: t.wordCharacterCount, defaultValue: 7, validate: (e) => e >= 0 });
  }
}
let ST = class extends de {
  constructor(t) {
    super(Ct, "image"), this.aspect = bt(t.aspect, ["fit", "actual", "height", "none", "width"]), this.contentType = t.contentType || "", this.href = t.href || "", this.id = t.id || "", this.name = t.name || "", this.transferEncoding = bt(t.transferEncoding, ["base64", "none", "package"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [Gt]() {
    var r;
    if (this.contentType && !oO.has(this.contentType.toLowerCase())) return $t.EMPTY;
    let t = (r = this[ze].images) == null ? void 0 : r.get(this.href);
    if (!t && (this.href || !this[mt]) || (t || this.transferEncoding !== "base64" || (t = function(o) {
      return Uint8Array.fromBase64 ? Uint8Array.fromBase64(o) : Dn(atob(o));
    }(this[mt])), !t)) return $t.EMPTY;
    if (!this.contentType) {
      for (const [a, o] of lO) if (t.length > a.length && a.every((l, c) => l === t[c])) {
        this.contentType = o;
        break;
      }
      if (!this.contentType) return $t.EMPTY;
    }
    const e = new Blob([t], { type: this.contentType });
    let n;
    switch (this.aspect) {
      case "fit":
      case "actual":
        break;
      case "height":
        n = { height: "100%", objectFit: "fill" };
        break;
      case "none":
        n = { width: "100%", height: "100%", objectFit: "fill" };
        break;
      case "width":
        n = { width: "100%", objectFit: "fill" };
    }
    const s = this[Jt]();
    return $t.success({ name: "img", attributes: { class: ["xfaImage"], style: n, src: URL.createObjectURL(e), alt: s ? C1(s[Jt]()) : null } });
  }
};
class JO extends ct {
  constructor(t) {
    super(Ct, "imageEdit", !0), this.data = bt(t.data, ["link", "embed"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.border = null, this.extras = null, this.margin = null;
  }
  [Gt](t) {
    return this.data === "embed" ? $t.success({ name: "div", children: [], attributes: {} }) : $t.EMPTY;
  }
}
class QO extends bi {
  constructor(t) {
    super(Ct, "integer"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [Ue]() {
    const t = parseInt(this[mt].trim(), 10);
    this[mt] = isNaN(t) ? null : t;
  }
  [Gt](t) {
    return v0(this[mt] !== null ? this[mt].toString() : "");
  }
}
class t$ extends ct {
  constructor(t) {
    super(Ct, "issuers", !0), this.id = t.id || "", this.type = bt(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.certificate = new U();
  }
}
class Hb extends ct {
  constructor(t) {
    super(Ct, "items", !0), this.id = t.id || "", this.name = t.name || "", this.presence = bt(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.ref = t.ref || "", this.save = Yt({ data: t.save, defaultValue: 0, validate: (e) => e === 1 }), this.use = t.use || "", this.usehref = t.usehref || "", this.boolean = new U(), this.date = new U(), this.dateTime = new U(), this.decimal = new U(), this.exData = new U(), this.float = new U(), this.image = new U(), this.integer = new U(), this.text = new U(), this.time = new U();
  }
  [Gt]() {
    const t = [];
    for (const e of this[mn]()) t.push(e[Wi]());
    return $t.success(t);
  }
}
class e$ extends ct {
  constructor(t) {
    super(Ct, "keep", !0), this.id = t.id || "";
    const e = ["none", "contentArea", "pageArea"];
    this.intact = bt(t.intact, e), this.next = bt(t.next, e), this.previous = bt(t.previous, e), this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null;
  }
}
class i$ extends ct {
  constructor(t) {
    super(Ct, "keyUsage");
    const e = ["", "yes", "no"];
    this.crlSign = bt(t.crlSign, e), this.dataEncipherment = bt(t.dataEncipherment, e), this.decipherOnly = bt(t.decipherOnly, e), this.digitalSignature = bt(t.digitalSignature, e), this.encipherOnly = bt(t.encipherOnly, e), this.id = t.id || "", this.keyAgreement = bt(t.keyAgreement, e), this.keyCertSign = bt(t.keyCertSign, e), this.keyEncipherment = bt(t.keyEncipherment, e), this.nonRepudiation = bt(t.nonRepudiation, e), this.type = bt(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class n$ extends ct {
  constructor(t) {
    super(Ct, "line", !0), this.hand = bt(t.hand, ["even", "left", "right"]), this.id = t.id || "", this.slope = bt(t.slope, ["\\", "/"]), this.use = t.use || "", this.usehref = t.usehref || "", this.edge = null;
  }
  [Gt]() {
    const t = this[Jt]()[Jt](), e = this.edge || new Tg({}), n = e[ke](), s = /* @__PURE__ */ Object.create(null), r = e.presence === "visible" ? e.thickness : 0;
    s.strokeWidth = Xt(r), s.stroke = n.color;
    let a, o, l, c, h = "100%", u = "100%";
    t.w <= r ? ([a, o, l, c] = ["50%", 0, "50%", "100%"], h = s.strokeWidth) : t.h <= r ? ([a, o, l, c] = [0, "50%", "100%", "50%"], u = s.strokeWidth) : this.slope === "\\" ? [a, o, l, c] = [0, 0, "100%", "100%"] : [a, o, l, c] = [0, "100%", "100%", 0];
    const f = { name: "svg", children: [{ name: "line", attributes: { xmlns: v1, x1: a, y1: o, x2: l, y2: c, style: s } }], attributes: { xmlns: v1, width: h, height: u, style: { overflow: "visible" } } };
    return fw(t) ? $t.success({ name: "div", attributes: { style: { display: "inline", width: "100%", height: "100%" } }, children: [f] }) : (f.attributes.style.position = "absolute", $t.success(f));
  }
}
class s$ extends ct {
  constructor(t) {
    super(Ct, "linear", !0), this.id = t.id || "", this.type = bt(t.type, ["toRight", "toBottom", "toLeft", "toTop"]), this.use = t.use || "", this.usehref = t.usehref || "", this.color = null, this.extras = null;
  }
  [ke](t) {
    return t = t ? t[ke]() : "#FFFFFF", `linear-gradient(${this.type.replace(/([RBLT])/, " $1").toLowerCase()}, ${t}, ${this.color ? this.color[ke]() : "#000000"})`;
  }
}
class r$ extends bi {
  constructor(t) {
    super(Ct, "lockDocument"), this.id = t.id || "", this.type = bt(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [Ue]() {
    this[mt] = bt(this[mt], ["auto", "0", "1"]);
  }
}
class a$ extends ct {
  constructor(t) {
    super(Ct, "manifest", !0), this.action = bt(t.action, ["include", "all", "exclude"]), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.ref = new U();
  }
}
class o$ extends ct {
  constructor(t) {
    super(Ct, "margin", !0), this.bottomInset = Rt(t.bottomInset, "0"), this.id = t.id || "", this.leftInset = Rt(t.leftInset, "0"), this.rightInset = Rt(t.rightInset, "0"), this.topInset = Rt(t.topInset, "0"), this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null;
  }
  [ke]() {
    return { margin: Xt(this.topInset) + " " + Xt(this.rightInset) + " " + Xt(this.bottomInset) + " " + Xt(this.leftInset) };
  }
}
class l$ extends ct {
  constructor(t) {
    super(Ct, "mdp"), this.id = t.id || "", this.permissions = Yt({ data: t.permissions, defaultValue: 2, validate: (e) => e === 1 || e === 3 }), this.signatureType = bt(t.signatureType, ["filler", "author"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class c$ extends ct {
  constructor(t) {
    super(Ct, "medium"), this.id = t.id || "", this.imagingBBox = function(n) {
      if (!n) return { x: -1, y: -1, width: -1, height: -1 };
      const r = n.split(",", 4).map((h) => Rt(h.trim(), "-1"));
      if (r.length < 4 || r[2] < 0 || r[3] < 0) return { x: -1, y: -1, width: -1, height: -1 };
      const [a, o, l, c] = r;
      return { x: a, y: o, width: l, height: c };
    }(t.imagingBBox), this.long = Rt(t.long), this.orientation = bt(t.orientation, ["portrait", "landscape"]), this.short = Rt(t.short), this.stock = t.stock || "", this.trayIn = bt(t.trayIn, ["auto", "delegate", "pageFront"]), this.trayOut = bt(t.trayOut, ["auto", "delegate"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class h$ extends ct {
  constructor(t) {
    super(Ct, "message", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.text = new U();
  }
}
class u$ extends ct {
  constructor(t) {
    super(Ct, "numericEdit", !0), this.hScrollPolicy = bt(t.hScrollPolicy, ["auto", "off", "on"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.border = null, this.comb = null, this.extras = null, this.margin = null;
  }
  [Gt](t) {
    var r;
    const e = ys(this, "border", "font", "margin"), n = this[Jt]()[Jt](), s = { name: "input", attributes: { type: "text", fieldId: n[Re], dataId: ((r = n[Br]) == null ? void 0 : r[Re]) || n[Re], class: ["xfaTextfield"], style: e, "aria-label": C1(n), "aria-required": !1 } };
    return Dg(n) && (s.attributes["aria-required"] = !0, s.attributes.required = !0), $t.success({ name: "label", attributes: { class: ["xfaLabel"] }, children: [s] });
  }
}
class d$ extends ct {
  constructor(t) {
    super(Ct, "occur", !0), this.id = t.id || "", this.initial = t.initial !== "" ? Yt({ data: t.initial, defaultValue: "", validate: (e) => !0 }) : "", this.max = t.max !== "" ? Yt({ data: t.max, defaultValue: 1, validate: (e) => !0 }) : "", this.min = t.min !== "" ? Yt({ data: t.min, defaultValue: 1, validate: (e) => !0 }) : "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null;
  }
  [Vr]() {
    const t = this[Jt](), e = this.min;
    this.min === "" && (this.min = t instanceof lf || t instanceof wp ? 0 : 1), this.max === "" && (this.max = e === "" ? t instanceof lf || t instanceof wp ? -1 : 1 : this.min), this.max !== -1 && this.max < this.min && (this.max = this.min), this.initial === "" && (this.initial = t instanceof ww ? 1 : this.min);
  }
}
class f$ extends de {
  constructor(t) {
    super(Ct, "oid"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class p$ extends ct {
  constructor(t) {
    super(Ct, "oids", !0), this.id = t.id || "", this.type = bt(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.oid = new U();
  }
}
class CT extends ct {
  constructor(t) {
    super(Ct, "overflow"), this.id = t.id || "", this.leader = t.leader || "", this.target = t.target || "", this.trailer = t.trailer || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [Fn]() {
    if (!this[ot]) {
      const t = this[Jt](), e = this[Fi](), n = e[Rl](this.target, t), s = e[Rl](this.leader, t), r = e[Rl](this.trailer, t);
      this[ot] = { target: (n == null ? void 0 : n[0]) || null, leader: (s == null ? void 0 : s[0]) || null, trailer: (r == null ? void 0 : r[0]) || null, addLeader: !1, addTrailer: !1 };
    }
    return this[ot];
  }
}
class lf extends ct {
  constructor(t) {
    super(Ct, "pageArea", !0), this.blankOrNotBlank = bt(t.blankOrNotBlank, ["any", "blank", "notBlank"]), this.id = t.id || "", this.initialNumber = Yt({ data: t.initialNumber, defaultValue: 1, validate: (e) => !0 }), this.name = t.name || "", this.numbered = Yt({ data: t.numbered, defaultValue: 1, validate: (e) => !0 }), this.oddOrEven = bt(t.oddOrEven, ["any", "even", "odd"]), this.pagePosition = bt(t.pagePosition, ["any", "first", "last", "only", "rest"]), this.relevant = Na(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.desc = null, this.extras = null, this.medium = null, this.occur = null, this.area = new U(), this.contentArea = new U(), this.draw = new U(), this.exclGroup = new U(), this.field = new U(), this.subform = new U();
  }
  [yp]() {
    return this[ot] ? !this.occur || this.occur.max === -1 || this[ot].numberOfUse < this.occur.max : (this[ot] = { numberOfUse: 0 }, !0);
  }
  [du]() {
    delete this[ot];
  }
  [Jo]() {
    this[ot] || (this[ot] = { numberOfUse: 0 });
    const t = this[Jt]();
    return t.relation === "orderedOccurrence" && this[yp]() ? (this[ot].numberOfUse += 1, this) : t[Jo]();
  }
  [y1]() {
    return this[ot].space || { width: 0, height: 0 };
  }
  [Gt]() {
    this[ot] || (this[ot] = { numberOfUse: 1 });
    const t = [];
    this[ot].children = t;
    const e = /* @__PURE__ */ Object.create(null);
    if (this.medium && this.medium.short && this.medium.long) {
      if (e.width = Xt(this.medium.short), e.height = Xt(this.medium.long), this[ot].space = { width: this.medium.short, height: this.medium.long }, this.medium.orientation === "landscape") {
        const n = e.width;
        e.width = e.height, e.height = n, this[ot].space = { width: this.medium.long, height: this.medium.short };
      }
    } else H("XFA - No medium specified in pageArea: please file a bug.");
    return this[f0]({ filter: /* @__PURE__ */ new Set(["area", "draw", "field", "subform"]), include: !0 }), this[f0]({ filter: /* @__PURE__ */ new Set(["contentArea"]), include: !0 }), $t.success({ name: "div", children: t, attributes: { class: ["xfaPage"], id: this[Re], style: e, xfaName: this.name } });
  }
}
class wp extends ct {
  constructor(t) {
    super(Ct, "pageSet", !0), this.duplexImposition = bt(t.duplexImposition, ["longEdge", "shortEdge"]), this.id = t.id || "", this.name = t.name || "", this.relation = bt(t.relation, ["orderedOccurrence", "duplexPaginated", "simplexPaginated"]), this.relevant = Na(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.occur = null, this.pageArea = new U(), this.pageSet = new U();
  }
  [du]() {
    for (const t of this.pageArea.children) t[du]();
    for (const t of this.pageSet.children) t[du]();
  }
  [yp]() {
    return !this.occur || this.occur.max === -1 || this[ot].numberOfUse < this.occur.max;
  }
  [Jo]() {
    if (this[ot] || (this[ot] = { numberOfUse: 1, pageIndex: -1, pageSetIndex: -1 }), this.relation === "orderedOccurrence") {
      if (this[ot].pageIndex + 1 < this.pageArea.children.length)
        return this[ot].pageIndex += 1, this.pageArea.children[this[ot].pageIndex][Jo]();
      if (this[ot].pageSetIndex + 1 < this.pageSet.children.length)
        return this[ot].pageSetIndex += 1, this.pageSet.children[this[ot].pageSetIndex][Jo]();
      if (this[yp]())
        return this[ot].numberOfUse += 1, this[ot].pageIndex = -1, this[ot].pageSetIndex = -1, this[Jo]();
      const r = this[Jt]();
      return r instanceof wp ? r[Jo]() : (this[du](), this[Jo]());
    }
    const t = this[Fi]()[ot].pageNumber, e = t % 2 == 0 ? "even" : "odd", n = t === 0 ? "first" : "rest";
    let s = this.pageArea.children.find((r) => r.oddOrEven === e && r.pagePosition === n);
    return s || (s = this.pageArea.children.find((r) => r.oddOrEven === "any" && r.pagePosition === n), s) ? s : (s = this.pageArea.children.find((r) => r.oddOrEven === "any" && r.pagePosition === "any"), s || this.pageArea.children[0]);
  }
}
class m$ extends ct {
  constructor(t) {
    super(Ct, "para", !0), this.hAlign = bt(t.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]), this.id = t.id || "", this.lineHeight = t.lineHeight ? Rt(t.lineHeight, "0pt") : "", this.marginLeft = t.marginLeft ? Rt(t.marginLeft, "0pt") : "", this.marginRight = t.marginRight ? Rt(t.marginRight, "0pt") : "", this.orphans = Yt({ data: t.orphans, defaultValue: 0, validate: (e) => e >= 0 }), this.preserve = t.preserve || "", this.radixOffset = t.radixOffset ? Rt(t.radixOffset, "0pt") : "", this.spaceAbove = t.spaceAbove ? Rt(t.spaceAbove, "0pt") : "", this.spaceBelow = t.spaceBelow ? Rt(t.spaceBelow, "0pt") : "", this.tabDefault = t.tabDefault ? Rt(this.tabDefault) : "", this.tabStops = (t.tabStops || "").trim().split(/\s+/).map((e, n) => n % 2 == 1 ? Rt(e) : e), this.textIndent = t.textIndent ? Rt(t.textIndent, "0pt") : "", this.use = t.use || "", this.usehref = t.usehref || "", this.vAlign = bt(t.vAlign, ["top", "bottom", "middle"]), this.widows = Yt({ data: t.widows, defaultValue: 0, validate: (e) => e >= 0 }), this.hyphenation = null;
  }
  [ke]() {
    const t = ys(this, "hAlign");
    return this.marginLeft !== "" && (t.paddingLeft = Xt(this.marginLeft)), this.marginRight !== "" && (t.paddingRight = Xt(this.marginRight)), this.spaceAbove !== "" && (t.paddingTop = Xt(this.spaceAbove)), this.spaceBelow !== "" && (t.paddingBottom = Xt(this.spaceBelow)), this.textIndent !== "" && (t.textIndent = Xt(this.textIndent), oT(t)), this.lineHeight > 0 && (t.lineHeight = Xt(this.lineHeight)), this.tabDefault !== "" && (t.tabSize = Xt(this.tabDefault)), this.tabStops.length, this.hyphenatation && Object.assign(t, this.hyphenatation[ke]()), t;
  }
}
class g$ extends ct {
  constructor(t) {
    super(Ct, "passwordEdit", !0), this.hScrollPolicy = bt(t.hScrollPolicy, ["auto", "off", "on"]), this.id = t.id || "", this.passwordChar = t.passwordChar || "*", this.use = t.use || "", this.usehref = t.usehref || "", this.border = null, this.extras = null, this.margin = null;
  }
}
class b$ extends ct {
  constructor(t) {
    super(Ct, "pattern", !0), this.id = t.id || "", this.type = bt(t.type, ["crossHatch", "crossDiagonal", "diagonalLeft", "diagonalRight", "horizontal", "vertical"]), this.use = t.use || "", this.usehref = t.usehref || "", this.color = null, this.extras = null;
  }
  [ke](t) {
    t = t ? t[ke]() : "#FFFFFF";
    const e = this.color ? this.color[ke]() : "#000000", n = "repeating-linear-gradient", s = `${t},${t} 5px,${e} 5px,${e} 10px`;
    switch (this.type) {
      case "crossHatch":
        return `${n}(to top,${s}) ${n}(to right,${s})`;
      case "crossDiagonal":
        return `${n}(45deg,${s}) ${n}(-45deg,${s})`;
      case "diagonalLeft":
        return `${n}(45deg,${s})`;
      case "diagonalRight":
        return `${n}(-45deg,${s})`;
      case "horizontal":
        return `${n}(to top,${s})`;
      case "vertical":
        return `${n}(to right,${s})`;
    }
    return "";
  }
}
class y$ extends de {
  constructor(t) {
    super(Ct, "picture"), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class w$ extends ct {
  constructor(t) {
    super(Ct, "proto", !0), this.appearanceFilter = new U(), this.arc = new U(), this.area = new U(), this.assist = new U(), this.barcode = new U(), this.bindItems = new U(), this.bookend = new U(), this.boolean = new U(), this.border = new U(), this.break = new U(), this.breakAfter = new U(), this.breakBefore = new U(), this.button = new U(), this.calculate = new U(), this.caption = new U(), this.certificate = new U(), this.certificates = new U(), this.checkButton = new U(), this.choiceList = new U(), this.color = new U(), this.comb = new U(), this.connect = new U(), this.contentArea = new U(), this.corner = new U(), this.date = new U(), this.dateTime = new U(), this.dateTimeEdit = new U(), this.decimal = new U(), this.defaultUi = new U(), this.desc = new U(), this.digestMethod = new U(), this.digestMethods = new U(), this.draw = new U(), this.edge = new U(), this.encoding = new U(), this.encodings = new U(), this.encrypt = new U(), this.encryptData = new U(), this.encryption = new U(), this.encryptionMethod = new U(), this.encryptionMethods = new U(), this.event = new U(), this.exData = new U(), this.exObject = new U(), this.exclGroup = new U(), this.execute = new U(), this.extras = new U(), this.field = new U(), this.fill = new U(), this.filter = new U(), this.float = new U(), this.font = new U(), this.format = new U(), this.handler = new U(), this.hyphenation = new U(), this.image = new U(), this.imageEdit = new U(), this.integer = new U(), this.issuers = new U(), this.items = new U(), this.keep = new U(), this.keyUsage = new U(), this.line = new U(), this.linear = new U(), this.lockDocument = new U(), this.manifest = new U(), this.margin = new U(), this.mdp = new U(), this.medium = new U(), this.message = new U(), this.numericEdit = new U(), this.occur = new U(), this.oid = new U(), this.oids = new U(), this.overflow = new U(), this.pageArea = new U(), this.pageSet = new U(), this.para = new U(), this.passwordEdit = new U(), this.pattern = new U(), this.picture = new U(), this.radial = new U(), this.reason = new U(), this.reasons = new U(), this.rectangle = new U(), this.ref = new U(), this.script = new U(), this.setProperty = new U(), this.signData = new U(), this.signature = new U(), this.signing = new U(), this.solid = new U(), this.speak = new U(), this.stipple = new U(), this.subform = new U(), this.subformSet = new U(), this.subjectDN = new U(), this.subjectDNs = new U(), this.submit = new U(), this.text = new U(), this.textEdit = new U(), this.time = new U(), this.timeStamp = new U(), this.toolTip = new U(), this.traversal = new U(), this.traverse = new U(), this.ui = new U(), this.validate = new U(), this.value = new U(), this.variables = new U();
  }
}
class v$ extends ct {
  constructor(t) {
    super(Ct, "radial", !0), this.id = t.id || "", this.type = bt(t.type, ["toEdge", "toCenter"]), this.use = t.use || "", this.usehref = t.usehref || "", this.color = null, this.extras = null;
  }
  [ke](t) {
    t = t ? t[ke]() : "#FFFFFF";
    const e = this.color ? this.color[ke]() : "#000000";
    return `radial-gradient(circle at center, ${this.type === "toEdge" ? `${t},${e}` : `${e},${t}`})`;
  }
}
class _$ extends de {
  constructor(t) {
    super(Ct, "reason"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class x$ extends ct {
  constructor(t) {
    super(Ct, "reasons", !0), this.id = t.id || "", this.type = bt(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.reason = new U();
  }
}
class ET extends ct {
  constructor(t) {
    super(Ct, "rectangle", !0), this.hand = bt(t.hand, ["even", "left", "right"]), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.corner = new U(4), this.edge = new U(4), this.fill = null;
  }
  [Gt]() {
    var a;
    const t = this.edge.children.length ? this.edge.children[0] : new Tg({}), e = t[ke](), n = /* @__PURE__ */ Object.create(null);
    ((a = this.fill) == null ? void 0 : a.presence) === "visible" ? Object.assign(n, this.fill[ke]()) : n.fill = "transparent", n.strokeWidth = Xt(t.presence === "visible" ? t.thickness : 0), n.stroke = e.color;
    const s = (this.corner.children.length ? this.corner.children[0] : new xT({}))[ke](), r = { name: "svg", children: [{ name: "rect", attributes: { xmlns: v1, width: "100%", height: "100%", x: 0, y: 0, rx: s.radius, ry: s.radius, style: n } }], attributes: { xmlns: v1, style: { overflow: "visible" }, width: "100%", height: "100%" } };
    return fw(this[Jt]()[Jt]()) ? $t.success({ name: "div", attributes: { style: { display: "inline", width: "100%", height: "100%" } }, children: [r] }) : (r.attributes.style.position = "absolute", $t.success(r));
  }
}
class k$ extends de {
  constructor(t) {
    super(Ct, "ref"), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class A$ extends de {
  constructor(t) {
    super(Ct, "script"), this.binding = t.binding || "", this.contentType = t.contentType || "", this.id = t.id || "", this.name = t.name || "", this.runAt = bt(t.runAt, ["client", "both", "server"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class jb extends ct {
  constructor(t) {
    super(Ct, "setProperty"), this.connection = t.connection || "", this.ref = t.ref || "", this.target = t.target || "";
  }
}
class S$ extends ct {
  constructor(t) {
    super(Ct, "signData", !0), this.id = t.id || "", this.operation = bt(t.operation, ["sign", "clear", "verify"]), this.ref = t.ref || "", this.target = t.target || "", this.use = t.use || "", this.usehref = t.usehref || "", this.filter = null, this.manifest = null;
  }
}
class C$ extends ct {
  constructor(t) {
    super(Ct, "signature", !0), this.id = t.id || "", this.type = bt(t.type, ["PDF1.3", "PDF1.6"]), this.use = t.use || "", this.usehref = t.usehref || "", this.border = null, this.extras = null, this.filter = null, this.manifest = null, this.margin = null;
  }
}
class E$ extends ct {
  constructor(t) {
    super(Ct, "signing", !0), this.id = t.id || "", this.type = bt(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.certificate = new U();
  }
}
class D$ extends ct {
  constructor(t) {
    super(Ct, "solid", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null;
  }
  [ke](t) {
    return t ? t[ke]() : "#FFFFFF";
  }
}
class T$ extends de {
  constructor(t) {
    super(Ct, "speak"), this.disable = Yt({ data: t.disable, defaultValue: 0, validate: (e) => e === 1 }), this.id = t.id || "", this.priority = bt(t.priority, ["custom", "caption", "name", "toolTip"]), this.rid = t.rid || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class F$ extends ct {
  constructor(t) {
    super(Ct, "stipple", !0), this.id = t.id || "", this.rate = Yt({ data: t.rate, defaultValue: 50, validate: (e) => e >= 0 && e <= 100 }), this.use = t.use || "", this.usehref = t.usehref || "", this.color = null, this.extras = null;
  }
  [ke](t) {
    const e = this.rate / 100;
    return Ee.makeHexColor(Math.round(t.value.r * (1 - e) + this.value.r * e), Math.round(t.value.g * (1 - e) + this.value.g * e), Math.round(t.value.b * (1 - e) + this.value.b * e));
  }
}
class DT extends ct {
  constructor(t) {
    super(Ct, "subform", !0), this.access = bt(t.access, ["open", "nonInteractive", "protected", "readOnly"]), this.allowMacro = Yt({ data: t.allowMacro, defaultValue: 0, validate: (e) => e === 1 }), this.anchorType = bt(t.anchorType, ["topLeft", "bottomCenter", "bottomLeft", "bottomRight", "middleCenter", "middleLeft", "middleRight", "topCenter", "topRight"]), this.colSpan = Yt({ data: t.colSpan, defaultValue: 1, validate: (e) => e >= 1 || e === -1 }), this.columnWidths = (t.columnWidths || "").trim().split(/\s+/).map((e) => e === "-1" ? -1 : Rt(e)), this.h = t.h ? Rt(t.h) : "", this.hAlign = bt(t.hAlign, ["left", "center", "justify", "justifyAll", "radix", "right"]), this.id = t.id || "", this.layout = bt(t.layout, ["position", "lr-tb", "rl-row", "rl-tb", "row", "table", "tb"]), this.locale = t.locale || "", this.maxH = Rt(t.maxH, "0pt"), this.maxW = Rt(t.maxW, "0pt"), this.mergeMode = bt(t.mergeMode, ["consumeData", "matchTemplate"]), this.minH = Rt(t.minH, "0pt"), this.minW = Rt(t.minW, "0pt"), this.name = t.name || "", this.presence = bt(t.presence, ["visible", "hidden", "inactive", "invisible"]), this.relevant = Na(t.relevant), this.restoreState = bt(t.restoreState, ["manual", "auto"]), this.scope = bt(t.scope, ["name", "none"]), this.use = t.use || "", this.usehref = t.usehref || "", this.w = t.w ? Rt(t.w) : "", this.x = Rt(t.x, "0pt"), this.y = Rt(t.y, "0pt"), this.assist = null, this.bind = null, this.bookend = null, this.border = null, this.break = null, this.calculate = null, this.desc = null, this.extras = null, this.keep = null, this.margin = null, this.occur = null, this.overflow = null, this.pageSet = null, this.para = null, this.traversal = null, this.validate = null, this.variables = null, this.area = new U(), this.breakAfter = new U(), this.breakBefore = new U(), this.connect = new U(), this.draw = new U(), this.event = new U(), this.exObject = new U(), this.exclGroup = new U(), this.field = new U(), this.proto = new U(), this.setProperty = new U(), this.subform = new U(), this.subformSet = new U();
  }
  [Mi]() {
    const t = this[Jt]();
    return t instanceof yw ? t[Mi]() : t;
  }
  [P1]() {
    return !0;
  }
  [Xl]() {
    return this.layout.endsWith("-tb") && this[ot].attempt === 0 && this[ot].numberInLine > 0 || this[Jt]()[Xl]();
  }
  *[of]() {
    yield* mw(this);
  }
  [Eg]() {
    return fT(this);
  }
  [b1](t, e) {
    pT(this, t, e);
  }
  [y1]() {
    return mT(this);
  }
  [Nl]() {
    var e;
    const t = this[Mi]();
    return t[Nl]() ? this[ot]._isSplittable !== void 0 ? this[ot]._isSplittable : this.layout === "position" || this.layout.includes("row") ? (this[ot]._isSplittable = !1, !1) : this.keep && this.keep.intact !== "none" ? (this[ot]._isSplittable = !1, !1) : (e = t.layout) != null && e.endsWith("-tb") && t[ot].numberInLine !== 0 ? !1 : (this[ot]._isSplittable = !0, !0) : !1;
  }
  [Gt](t) {
    var _;
    if (U4(this), this.break) {
      if (this.break.after !== "auto" || this.break.afterTarget !== "") {
        const x = new yT({ targetType: this.break.after, target: this.break.afterTarget, startNew: this.break.startNew.toString() });
        x[ze] = this[ze], this[pi](x), this.breakAfter.push(x);
      }
      if (this.break.before !== "auto" || this.break.beforeTarget !== "") {
        const x = new wT({ targetType: this.break.before, target: this.break.beforeTarget, startNew: this.break.startNew.toString() });
        x[ze] = this[ze], this[pi](x), this.breakBefore.push(x);
      }
      if (this.break.overflowTarget !== "") {
        const x = new CT({ target: this.break.overflowTarget, leader: this.break.overflowLeader, trailer: this.break.overflowTrailer });
        x[ze] = this[ze], this[pi](x), this.overflow.push(x);
      }
      this[s0](this.break), this.break = null;
    }
    if (this.presence === "hidden" || this.presence === "inactive") return $t.EMPTY;
    if ((this.breakBefore.children.length > 1 || this.breakAfter.children.length > 1) && H("XFA - Several breakBefore or breakAfter in subforms: please file a bug."), this.breakBefore.children.length >= 1) {
      const x = this.breakBefore.children[0];
      if (vx(x)) return $t.breakNode(x);
    }
    if ((_ = this[ot]) != null && _.afterBreakAfter) return $t.EMPTY;
    q4(this);
    const e = [], n = { id: this[Re], class: [] };
    dw(this, n.class), this[ot] || (this[ot] = /* @__PURE__ */ Object.create(null)), Object.assign(this[ot], { children: e, line: null, attributes: n, attempt: 0, numberInLine: 0, availableSpace: { width: Math.min(this.w || 1 / 0, t.width), height: Math.min(this.h || 1 / 0, t.height) }, width: 0, height: 0, prevHeight: 0, currentWidth: 0 });
    const s = this[Fi](), r = s[ot].noLayoutFailure, a = this[Nl]();
    if (a || j4(this), !z4(this, t)) return $t.FAILURE;
    const o = /* @__PURE__ */ new Set(["area", "draw", "exclGroup", "field", "subform", "subformSet"]);
    if (this.layout.includes("row")) {
      const x = this[Mi]().columnWidths;
      Array.isArray(x) && x.length > 0 && (this[ot].columnWidths = x, this[ot].currentColumn = 0);
    }
    const l = ys(this, "anchorType", "dimensions", "position", "presence", "border", "margin", "hAlign"), c = ["xfaSubform"], h = aT(this);
    if (h && c.push(h), n.style = l, n.class = c, this.name && (n.xfaName = this.name), this.overflow) {
      const x = this.overflow[Fn]();
      x.addLeader && (x.addLeader = !1, _x(this, x.leader, t));
    }
    this[mf]();
    const u = this.layout === "lr-tb" || this.layout === "rl-tb", f = u ? 2 : 1;
    for (; this[ot].attempt < f; this[ot].attempt++) {
      u && this[ot].attempt === 1 && (this[ot].numberInLine = 0);
      const x = this[f0]({ filter: o, include: !0 });
      if (x.success) break;
      if (x.isBreak())
        return this[Fs](), x;
      if (u && this[ot].attempt === 0 && this[ot].numberInLine === 0 && !s[ot].noLayoutFailure) {
        this[ot].attempt = f;
        break;
      }
    }
    if (this[Fs](), a || G4(this), s[ot].noLayoutFailure = r, this[ot].attempt === f)
      return this.overflow && (this[Fi]()[ot].overflowNode = this.overflow), a || delete this[ot], $t.FAILURE;
    if (this.overflow) {
      const x = this.overflow[Fn]();
      x.addTrailer && (x.addTrailer = !1, _x(this, x.trailer, t));
    }
    let d = 0, p = 0;
    this.margin && (d = this.margin.leftInset + this.margin.rightInset, p = this.margin.topInset + this.margin.bottomInset);
    const g = Math.max(this[ot].width + d, this.w || 0), b = Math.max(this[ot].height + p, this.h || 0), y = [this.x, this.y, g, b];
    if (this.w === "" && (l.width = Xt(g)), this.h === "" && (l.height = Xt(b)), (l.width === "0px" || l.height === "0px") && e.length === 0) return $t.EMPTY;
    const v = { name: "div", attributes: n, children: e };
    H4(this, n);
    const w = $t.success(w1(this, v), y);
    if (this.breakAfter.children.length >= 1) {
      const x = this.breakAfter.children[0];
      if (vx(x))
        return this[ot].afterBreakAfter = w, $t.breakNode(x);
    }
    return delete this[ot], w;
  }
}
class yw extends ct {
  constructor(t) {
    super(Ct, "subformSet", !0), this.id = t.id || "", this.name = t.name || "", this.relation = bt(t.relation, ["ordered", "choice", "unordered"]), this.relevant = Na(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.bookend = null, this.break = null, this.desc = null, this.extras = null, this.occur = null, this.overflow = null, this.breakAfter = new U(), this.breakBefore = new U(), this.subform = new U(), this.subformSet = new U();
  }
  *[of]() {
    yield* mw(this);
  }
  [Mi]() {
    let t = this[Jt]();
    for (; !(t instanceof DT); ) t = t[Jt]();
    return t;
  }
  [P1]() {
    return !0;
  }
}
class I$ extends bi {
  constructor(t) {
    super(Ct, "subjectDN"), this.delimiter = t.delimiter || ",", this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [Ue]() {
    this[mt] = new Map(this[mt].split(this.delimiter).map((t) => ((t = t.split("=", 2))[0] = t[0].trim(), t)));
  }
}
class M$ extends ct {
  constructor(t) {
    super(Ct, "subjectDNs", !0), this.id = t.id || "", this.type = bt(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "", this.subjectDN = new U();
  }
}
class R$ extends ct {
  constructor(t) {
    super(Ct, "submit", !0), this.embedPDF = Yt({ data: t.embedPDF, defaultValue: 0, validate: (e) => e === 1 }), this.format = bt(t.format, ["xdp", "formdata", "pdf", "urlencoded", "xfd", "xml"]), this.id = t.id || "", this.target = t.target || "", this.textEncoding = $4({ data: t.textEncoding ? t.textEncoding.toLowerCase() : "", defaultValue: "", validate: (e) => ["utf-8", "big-five", "fontspecific", "gbk", "gb-18030", "gb-2312", "ksc-5601", "none", "shift-jis", "ucs-2", "utf-16"].includes(e) || e.match(/iso-8859-\d{2}/) }), this.use = t.use || "", this.usehref = t.usehref || "", this.xdpContent = t.xdpContent || "", this.encrypt = null, this.encryptData = new U(), this.signData = new U();
  }
}
class ww extends ct {
  constructor(t) {
    super(Ct, "template", !0), this.baseProfile = bt(t.baseProfile, ["full", "interactiveForms"]), this.extras = null, this.subform = new U();
  }
  [Ue]() {
    this.subform.children.length === 0 && H("XFA - No subforms in template node."), this.subform.children.length >= 2 && H("XFA - Several subforms in template node: please file a bug."), this[_a] = 5e3;
  }
  [Nl]() {
    return !0;
  }
  [Rl](t, e) {
    return t.startsWith("#") ? [this[cu].get(t.slice(1))] : cc(this, e, t, !0, !0);
  }
  *[QD]() {
    var p, g, b;
    if (!this.subform.children.length) return $t.success({ name: "div", children: [] });
    this[ot] = { overflowNode: null, firstUnsplittable: null, currentContentArea: null, currentPageArea: null, noLayoutFailure: !1, pageNumber: 1, pagePosition: "first", oddOrEven: "odd", blankOrNotBlank: "nonBlank", paraStack: [] };
    const t = this.subform.children[0];
    t.pageSet[du]();
    const e = t.pageSet.pageArea.children, n = { name: "div", children: [] };
    let s = null, r = null, a = null;
    if (t.breakBefore.children.length >= 1 ? (r = t.breakBefore.children[0], a = r.target) : t.subform.children.length >= 1 && t.subform.children[0].breakBefore.children.length >= 1 ? (r = t.subform.children[0].breakBefore.children[0], a = r.target) : (p = t.break) != null && p.beforeTarget ? (r = t.break, a = r.beforeTarget) : t.subform.children.length >= 1 && ((g = t.subform.children[0].break) != null && g.beforeTarget) && (r = t.subform.children[0].break, a = r.beforeTarget), r) {
      const y = this[Rl](a, r[Jt]());
      y instanceof lf && (s = y, r[ot] = {});
    }
    s || (s = e[0]), s[ot] = { numberOfUse: 1 };
    const o = s[Jt]();
    o[ot] = { numberOfUse: 1, pageIndex: o.pageArea.children.indexOf(s), pageSetIndex: 0 };
    let l, c = null, h = null, u = !0, f = 0, d = 0;
    for (; ; ) {
      if (u) f = 0;
      else if (n.children.pop(), ++f == 3)
        return H("XFA - Something goes wrong: please file a bug."), n;
      l = null, this[ot].currentPageArea = s;
      const y = s[Gt]().html;
      n.children.push(y), c && (this[ot].noLayoutFailure = !0, y.children.push(c[Gt](s[ot].space).html), c = null), h && (this[ot].noLayoutFailure = !0, y.children.push(h[Gt](s[ot].space).html), h = null);
      const v = s.contentArea.children, w = y.children.filter((x) => x.attributes.class.includes("xfaContentarea"));
      u = !1, this[ot].firstUnsplittable = null, this[ot].noLayoutFailure = !1;
      const _ = (x) => {
        var S;
        const k = t[Eg]();
        k && (u || (u = ((S = k.children) == null ? void 0 : S.length) > 0), w[x].children.push(k));
      };
      for (let x = d, k = v.length; x < k; x++) {
        const S = this[ot].currentContentArea = v[x], T = { width: S.w, height: S.h };
        d = 0, c && (w[x].children.push(c[Gt](T).html), c = null), h && (w[x].children.push(h[Gt](T).html), h = null);
        const I = t[Gt](T);
        if (I.success)
          return I.html ? (u || (u = ((b = I.html.children) == null ? void 0 : b.length) > 0), w[x].children.push(I.html)) : !u && n.children.length > 1 && n.children.pop(), n;
        if (I.isBreak()) {
          const R = I.breakNode;
          if (_(x), R.targetType === "auto") continue;
          R.leader && (c = this[Rl](R.leader, R[Jt]()), c = c ? c[0] : null), R.trailer && (h = this[Rl](R.trailer, R[Jt]()), h = h ? h[0] : null), R.targetType === "pageArea" ? (l = R[ot].target, x = 1 / 0) : R[ot].target ? (l = R[ot].target, d = R[ot].index + 1, x = 1 / 0) : x = R[ot].index;
        } else if (this[ot].overflowNode) {
          const R = this[ot].overflowNode;
          this[ot].overflowNode = null;
          const B = R[Fn](), L = B.target;
          B.addLeader = B.leader !== null, B.addTrailer = B.trailer !== null, _(x);
          const it = x;
          if (x = 1 / 0, L instanceof lf) l = L;
          else if (L instanceof gw) {
            const O = v.indexOf(L);
            O !== -1 ? O > it ? x = O - 1 : d = O : (l = L[Jt](), d = l.contentArea.children.indexOf(L));
          }
        } else _(x);
      }
      this[ot].pageNumber += 1, l && (l[yp]() ? l[ot].numberOfUse += 1 : l = null), s = l || s[Jo](), yield null;
    }
  }
}
class TT extends bi {
  constructor(t) {
    super(Ct, "text"), this.id = t.id || "", this.maxChars = Yt({ data: t.maxChars, defaultValue: 0, validate: (e) => e >= 0 }), this.name = t.name || "", this.rid = t.rid || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [N4]() {
    return !0;
  }
  [So](t) {
    return t[Ii] === Ri.xhtml.id ? (this[mt] = t, !0) : (H(`XFA - Invalid content in Text: ${t[Ce]}.`), !1);
  }
  [Ll](t) {
    this[mt] instanceof ct || super[Ll](t);
  }
  [Ue]() {
    typeof this[mt] == "string" && (this[mt] = this[mt].replaceAll(`\r
`, `
`));
  }
  [Fn]() {
    return typeof this[mt] == "string" ? this[mt].split(/[\u2029\u2028\n]/).filter((t) => !!t).join(`
`) : this[mt][Wi]();
  }
  [Gt](t) {
    if (typeof this[mt] == "string") {
      const e = v0(this[mt]).html;
      return this[mt].includes("\u2029") ? (e.name = "div", e.children = [], this[mt].split("\u2029").map((n) => n.split(/[\u2028\n]/).flatMap((s) => [{ name: "span", value: s }, { name: "br" }])).forEach((n) => {
        e.children.push({ name: "p", children: n });
      })) : /[\u2028\n]/.test(this[mt]) && (e.name = "div", e.children = [], this[mt].split(/[\u2028\n]/).forEach((n) => {
        e.children.push({ name: "span", value: n }, { name: "br" });
      })), $t.success(e);
    }
    return this[mt][Gt](t);
  }
}
class FT extends ct {
  constructor(t) {
    super(Ct, "textEdit", !0), this.allowRichText = Yt({ data: t.allowRichText, defaultValue: 0, validate: (e) => e === 1 }), this.hScrollPolicy = bt(t.hScrollPolicy, ["auto", "off", "on"]), this.id = t.id || "", this.multiLine = Yt({ data: t.multiLine, defaultValue: "", validate: (e) => e === 0 || e === 1 }), this.use = t.use || "", this.usehref = t.usehref || "", this.vScrollPolicy = bt(t.vScrollPolicy, ["auto", "off", "on"]), this.border = null, this.comb = null, this.extras = null, this.margin = null;
  }
  [Gt](t) {
    var r, a;
    const e = ys(this, "border", "font", "margin");
    let n;
    const s = this[Jt]()[Jt]();
    return this.multiLine === "" && (this.multiLine = s instanceof kT ? 1 : 0), n = this.multiLine === 1 ? { name: "textarea", attributes: { dataId: ((r = s[Br]) == null ? void 0 : r[Re]) || s[Re], fieldId: s[Re], class: ["xfaTextfield"], style: e, "aria-label": C1(s), "aria-required": !1 } } : { name: "input", attributes: { type: "text", dataId: ((a = s[Br]) == null ? void 0 : a[Re]) || s[Re], fieldId: s[Re], class: ["xfaTextfield"], style: e, "aria-label": C1(s), "aria-required": !1 } }, Dg(s) && (n.attributes["aria-required"] = !0, n.attributes.required = !0), $t.success({ name: "label", attributes: { class: ["xfaLabel"] }, children: [n] });
  }
}
class B$ extends de {
  constructor(t) {
    super(Ct, "time"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
  [Ue]() {
    const t = this[mt].trim();
    this[mt] = t ? new Date(t) : null;
  }
  [Gt](t) {
    return v0(this[mt] ? this[mt].toString() : "");
  }
}
class P$ extends ct {
  constructor(t) {
    super(Ct, "timeStamp"), this.id = t.id || "", this.server = t.server || "", this.type = bt(t.type, ["optional", "required"]), this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class N$ extends de {
  constructor(t) {
    super(Ct, "toolTip"), this.id = t.id || "", this.rid = t.rid || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class L$ extends ct {
  constructor(t) {
    super(Ct, "traversal", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.traverse = new U();
  }
}
class O$ extends ct {
  constructor(t) {
    super(Ct, "traverse", !0), this.id = t.id || "", this.operation = bt(t.operation, ["next", "back", "down", "first", "left", "right", "up"]), this.ref = t.ref || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.script = null;
  }
  get name() {
    return this.operation;
  }
  [bp]() {
    return !1;
  }
}
class vw extends ct {
  constructor(t) {
    super(Ct, "ui", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.picture = null, this.barcode = null, this.button = null, this.checkButton = null, this.choiceList = null, this.dateTimeEdit = null, this.defaultUi = null, this.imageEdit = null, this.numericEdit = null, this.passwordEdit = null, this.signature = null, this.textEdit = null;
  }
  [Fn]() {
    if (this[ot] === void 0) {
      for (const t of Object.getOwnPropertyNames(this)) {
        if (t === "extras" || t === "picture") continue;
        const e = this[t];
        if (e instanceof ct)
          return this[ot] = e, e;
      }
      this[ot] = null;
    }
    return this[ot];
  }
  [Gt](t) {
    const e = this[Fn]();
    return e ? e[Gt](t) : $t.EMPTY;
  }
}
class $$ extends ct {
  constructor(t) {
    super(Ct, "validate", !0), this.formatTest = bt(t.formatTest, ["warning", "disabled", "error"]), this.id = t.id || "", this.nullTest = bt(t.nullTest, ["disabled", "error", "warning"]), this.scriptTest = bt(t.scriptTest, ["error", "disabled", "warning"]), this.use = t.use || "", this.usehref = t.usehref || "", this.extras = null, this.message = null, this.picture = null, this.script = null;
  }
}
class _w extends ct {
  constructor(t) {
    super(Ct, "value", !0), this.id = t.id || "", this.override = Yt({ data: t.override, defaultValue: 0, validate: (e) => e === 1 }), this.relevant = Na(t.relevant), this.use = t.use || "", this.usehref = t.usehref || "", this.arc = null, this.boolean = null, this.date = null, this.dateTime = null, this.decimal = null, this.exData = null, this.float = null, this.image = null, this.integer = null, this.line = null, this.rectangle = null, this.text = null, this.time = null;
  }
  [Bs](t) {
    var s;
    const e = this[Jt]();
    if (e instanceof bw && ((s = e.ui) != null && s.imageEdit)) {
      this.image || (this.image = new ST({}), this[pi](this.image)), this.image[mt] = t[mt];
      return;
    }
    const n = t[Ce];
    if (this[n] === null) {
      for (const r of Object.getOwnPropertyNames(this)) {
        const a = this[r];
        a instanceof ct && (this[r] = null, this[s0](a));
      }
      this[t[Ce]] = t, this[pi](t);
    } else this[n][mt] = t[mt];
  }
  [Wi]() {
    if (this.exData) return typeof this.exData[mt] == "string" ? this.exData[mt].trim() : this.exData[mt][Wi]().trim();
    for (const t of Object.getOwnPropertyNames(this)) {
      if (t === "image") continue;
      const e = this[t];
      if (e instanceof ct) return (e[mt] || "").toString().trim();
    }
    return null;
  }
  [Gt](t) {
    for (const e of Object.getOwnPropertyNames(this)) {
      const n = this[e];
      if (n instanceof ct) return n[Gt](t);
    }
    return $t.EMPTY;
  }
}
class q$ extends ct {
  constructor(t) {
    super(Ct, "variables", !0), this.id = t.id || "", this.use = t.use || "", this.usehref = t.usehref || "", this.boolean = new U(), this.date = new U(), this.dateTime = new U(), this.decimal = new U(), this.exData = new U(), this.float = new U(), this.image = new U(), this.integer = new U(), this.manifest = new U(), this.script = new U(), this.text = new U(), this.time = new U();
  }
  [bp]() {
    return !0;
  }
}
class w3 {
  static [Pa](t, e) {
    if (w3.hasOwnProperty(t)) {
      const n = w3[t](e);
      return n[JD](e), n;
    }
  }
  static appearanceFilter(t) {
    return new cO(t);
  }
  static arc(t) {
    return new gT(t);
  }
  static area(t) {
    return new hO(t);
  }
  static assist(t) {
    return new uO(t);
  }
  static barcode(t) {
    return new dO(t);
  }
  static bind(t) {
    return new fO(t);
  }
  static bindItems(t) {
    return new Ub(t);
  }
  static bookend(t) {
    return new pO(t);
  }
  static boolean(t) {
    return new mO(t);
  }
  static border(t) {
    return new bT(t);
  }
  static break(t) {
    return new gO(t);
  }
  static breakAfter(t) {
    return new yT(t);
  }
  static breakBefore(t) {
    return new wT(t);
  }
  static button(t) {
    return new bO(t);
  }
  static calculate(t) {
    return new yO(t);
  }
  static caption(t) {
    return new wO(t);
  }
  static certificate(t) {
    return new vO(t);
  }
  static certificates(t) {
    return new _O(t);
  }
  static checkButton(t) {
    return new vT(t);
  }
  static choiceList(t) {
    return new _T(t);
  }
  static color(t) {
    return new xO(t);
  }
  static comb(t) {
    return new kO(t);
  }
  static connect(t) {
    return new AO(t);
  }
  static contentArea(t) {
    return new gw(t);
  }
  static corner(t) {
    return new xT(t);
  }
  static date(t) {
    return new SO(t);
  }
  static dateTime(t) {
    return new CO(t);
  }
  static dateTimeEdit(t) {
    return new EO(t);
  }
  static decimal(t) {
    return new DO(t);
  }
  static defaultUi(t) {
    return new TO(t);
  }
  static desc(t) {
    return new FO(t);
  }
  static digestMethod(t) {
    return new IO(t);
  }
  static digestMethods(t) {
    return new MO(t);
  }
  static draw(t) {
    return new kT(t);
  }
  static edge(t) {
    return new Tg(t);
  }
  static encoding(t) {
    return new RO(t);
  }
  static encodings(t) {
    return new BO(t);
  }
  static encrypt(t) {
    return new PO(t);
  }
  static encryptData(t) {
    return new NO(t);
  }
  static encryption(t) {
    return new LO(t);
  }
  static encryptionMethod(t) {
    return new OO(t);
  }
  static encryptionMethods(t) {
    return new $O(t);
  }
  static event(t) {
    return new qO(t);
  }
  static exData(t) {
    return new zO(t);
  }
  static exObject(t) {
    return new UO(t);
  }
  static exclGroup(t) {
    return new AT(t);
  }
  static execute(t) {
    return new HO(t);
  }
  static extras(t) {
    return new jO(t);
  }
  static field(t) {
    return new bw(t);
  }
  static fill(t) {
    return new GO(t);
  }
  static filter(t) {
    return new VO(t);
  }
  static float(t) {
    return new WO(t);
  }
  static font(t) {
    return new XO(t);
  }
  static format(t) {
    return new YO(t);
  }
  static handler(t) {
    return new KO(t);
  }
  static hyphenation(t) {
    return new ZO(t);
  }
  static image(t) {
    return new ST(t);
  }
  static imageEdit(t) {
    return new JO(t);
  }
  static integer(t) {
    return new QO(t);
  }
  static issuers(t) {
    return new t$(t);
  }
  static items(t) {
    return new Hb(t);
  }
  static keep(t) {
    return new e$(t);
  }
  static keyUsage(t) {
    return new i$(t);
  }
  static line(t) {
    return new n$(t);
  }
  static linear(t) {
    return new s$(t);
  }
  static lockDocument(t) {
    return new r$(t);
  }
  static manifest(t) {
    return new a$(t);
  }
  static margin(t) {
    return new o$(t);
  }
  static mdp(t) {
    return new l$(t);
  }
  static medium(t) {
    return new c$(t);
  }
  static message(t) {
    return new h$(t);
  }
  static numericEdit(t) {
    return new u$(t);
  }
  static occur(t) {
    return new d$(t);
  }
  static oid(t) {
    return new f$(t);
  }
  static oids(t) {
    return new p$(t);
  }
  static overflow(t) {
    return new CT(t);
  }
  static pageArea(t) {
    return new lf(t);
  }
  static pageSet(t) {
    return new wp(t);
  }
  static para(t) {
    return new m$(t);
  }
  static passwordEdit(t) {
    return new g$(t);
  }
  static pattern(t) {
    return new b$(t);
  }
  static picture(t) {
    return new y$(t);
  }
  static proto(t) {
    return new w$(t);
  }
  static radial(t) {
    return new v$(t);
  }
  static reason(t) {
    return new _$(t);
  }
  static reasons(t) {
    return new x$(t);
  }
  static rectangle(t) {
    return new ET(t);
  }
  static ref(t) {
    return new k$(t);
  }
  static script(t) {
    return new A$(t);
  }
  static setProperty(t) {
    return new jb(t);
  }
  static signData(t) {
    return new S$(t);
  }
  static signature(t) {
    return new C$(t);
  }
  static signing(t) {
    return new E$(t);
  }
  static solid(t) {
    return new D$(t);
  }
  static speak(t) {
    return new T$(t);
  }
  static stipple(t) {
    return new F$(t);
  }
  static subform(t) {
    return new DT(t);
  }
  static subformSet(t) {
    return new yw(t);
  }
  static subjectDN(t) {
    return new I$(t);
  }
  static subjectDNs(t) {
    return new M$(t);
  }
  static submit(t) {
    return new R$(t);
  }
  static template(t) {
    return new ww(t);
  }
  static text(t) {
    return new TT(t);
  }
  static textEdit(t) {
    return new FT(t);
  }
  static time(t) {
    return new B$(t);
  }
  static timeStamp(t) {
    return new P$(t);
  }
  static toolTip(t) {
    return new N$(t);
  }
  static traversal(t) {
    return new L$(t);
  }
  static traverse(t) {
    return new O$(t);
  }
  static ui(t) {
    return new vw(t);
  }
  static validate(t) {
    return new $$(t);
  }
  static value(t) {
    return new _w(t);
  }
  static variables(t) {
    return new q$(t);
  }
}
const xx = Ri.datasets.id;
function u5(i) {
  const t = new TT({});
  return t[mt] = i, t;
}
class z$ {
  constructor(t) {
    var e;
    this.root = t, this.datasets = t.datasets, this.data = ((e = t.datasets) == null ? void 0 : e.data) || new Co(Ri.datasets.id, "data"), this.emptyMerge = this.data[mn]().length === 0, this.root.form = this.form = t.template[Aa]();
  }
  _isConsumeData() {
    return !this.emptyMerge && this._mergeMode;
  }
  _isMatchTemplate() {
    return !this._isConsumeData();
  }
  bind() {
    return this._bindElement(this.form, this.data), this.form;
  }
  getData() {
    return this.data;
  }
  _bindValue(t, e, n) {
    var s, r;
    if (t[Br] = e, t[gp]()) if (e[fu]()) {
      const a = e[aw]();
      t[Bs](u5(a));
    } else if (t instanceof bw && ((r = (s = t.ui) == null ? void 0 : s.choiceList) == null ? void 0 : r.open) === "multiSelect") {
      const a = e[mn]().map((o) => o[mt].trim()).join(`
`);
      t[Bs](u5(a));
    } else this._isConsumeData() && H("XFA - Nodes haven't the same type.");
    else !e[fu]() || this._isMatchTemplate() ? this._bindElement(t, e) : H("XFA - Nodes haven't the same type.");
  }
  _findDataByNameToConsume(t, e, n, s) {
    if (!t) return null;
    let r, a;
    for (let o = 0; o < 3; o++) {
      for (r = n[P2](t, !1, !0); a = r.next().value, !!a; )
        if (e === a[fu]()) return a;
      if (n[Ii] === Ri.datasets.id && n[Ce] === "data") break;
      n = n[Jt]();
    }
    return s ? (r = this.data[P2](t, !0, !1), a = r.next().value, a || (r = this.data[Lb](t, !0), a = r.next().value, a != null && a[fu]() ? a : null)) : null;
  }
  _setProperties(t, e) {
    if (t.hasOwnProperty("setProperty")) for (const { ref: n, target: s, connection: r } of t.setProperty.children) {
      if (r || !n) continue;
      const a = cc(this.root, e, n, !1, !1);
      if (!a) {
        H(`XFA - Invalid reference: ${n}.`);
        continue;
      }
      const [o] = a;
      if (!o[fc](this.data)) {
        H("XFA - Invalid node: must be a data node.");
        continue;
      }
      const l = cc(this.root, t, s, !1, !1);
      if (!l) {
        H(`XFA - Invalid target: ${s}.`);
        continue;
      }
      const [c] = l;
      if (!c[fc](t)) {
        H("XFA - Invalid target: must be a property or subproperty.");
        continue;
      }
      const h = c[Jt]();
      if (c instanceof jb || h instanceof jb) {
        H("XFA - Invalid target: cannot be a setProperty or one of its properties.");
        continue;
      }
      if (c instanceof Ub || h instanceof Ub) {
        H("XFA - Invalid target: cannot be a bindItems or one of its properties.");
        continue;
      }
      const u = o[Wi](), f = c[Ce];
      if (c instanceof hw) {
        const d = /* @__PURE__ */ Object.create(null);
        d[f] = u;
        const p = Reflect.construct(Object.getPrototypeOf(h).constructor, [d]);
        h[f] = p[f];
      } else c.hasOwnProperty(mt) ? (c[Br] = o, c[mt] = u, c[Ue]()) : H("XFA - Invalid node to use in setProperty");
    }
  }
  _bindItems(t, e) {
    if (!t.hasOwnProperty("items") || !t.hasOwnProperty("bindItems") || t.bindItems.isEmpty()) return;
    for (const r of t.items.children) t[s0](r);
    t.items.clear();
    const n = new Hb({}), s = new Hb({});
    t[pi](n), t.items.push(n), t[pi](s), t.items.push(s);
    for (const { ref: r, labelRef: a, valueRef: o, connection: l } of t.bindItems.children) {
      if (l || !r) continue;
      const c = cc(this.root, e, r, !1, !1);
      if (c) for (const h of c) {
        if (!h[fc](this.datasets)) {
          H(`XFA - Invalid ref (${r}): must be a datasets child.`);
          continue;
        }
        const u = cc(this.root, h, a, !0, !1);
        if (!u) {
          H(`XFA - Invalid label: ${a}.`);
          continue;
        }
        const [f] = u;
        if (!f[fc](this.datasets)) {
          H("XFA - Invalid label: must be a datasets child.");
          continue;
        }
        const d = cc(this.root, h, o, !0, !1);
        if (!d) {
          H(`XFA - Invalid value: ${o}.`);
          continue;
        }
        const [p] = d;
        if (!p[fc](this.datasets)) {
          H("XFA - Invalid value: must be a datasets child.");
          continue;
        }
        const g = u5(f[Wi]()), b = u5(p[Wi]());
        n[pi](g), n.text.push(g), s[pi](b), s.text.push(b);
      }
      else H(`XFA - Invalid reference: ${r}.`);
    }
  }
  _bindOccurrences(t, e, n) {
    let s;
    if (e.length > 1 && (s = t[Aa](), s[s0](s.occur), s.occur = null), this._bindValue(t, e[0], n), this._setProperties(t, e[0]), this._bindItems(t, e[0]), e.length === 1) return;
    const r = t[Jt](), a = t[Ce], o = r[Ob](t);
    for (let l = 1, c = e.length; l < c; l++) {
      const h = e[l], u = s[Aa]();
      r[a].push(u), r[E9](o + l, u), this._bindValue(u, h, n), this._setProperties(u, h), this._bindItems(u, h);
    }
  }
  _createOccurrences(t) {
    if (!this.emptyMerge) return;
    const { occur: e } = t;
    if (!e || e.initial <= 1) return;
    const n = t[Jt](), s = t[Ce];
    if (!(n[s] instanceof U)) return;
    let r;
    r = t.name ? n[s].children.filter((l) => l.name === t.name).length : n[s].children.length;
    const a = n[Ob](t) + 1, o = e.initial - r;
    if (o) {
      const l = t[Aa]();
      l[s0](l.occur), l.occur = null, n[s].push(l), n[E9](a, l);
      for (let c = 1; c < o; c++) {
        const h = l[Aa]();
        n[s].push(h), n[E9](a + c, h);
      }
    }
  }
  _getOccurInfo(t) {
    const { name: e, occur: n } = t;
    if (!n || !e) return [1, 1];
    const s = n.max === -1 ? 1 / 0 : n.max;
    return [n.min, s];
  }
  _setAndBind(t, e) {
    this._setProperties(t, e), this._bindItems(t, e), this._bindElement(t, e);
  }
  _bindElement(t, e) {
    const n = [];
    this._createOccurrences(t);
    for (const s of t[mn]()) {
      if (s[Br]) continue;
      if (this._mergeMode === void 0 && s[Ce] === "subform") {
        this._mergeMode = s.mergeMode === "consumeData";
        const u = e[mn]();
        if (u.length > 0) this._bindOccurrences(s, [u[0]], null);
        else if (this.emptyMerge) {
          const f = e[Ii] === xx ? -1 : e[Ii], d = s[Br] = new Co(f, s.name || "root");
          e[pi](d), this._bindElement(s, d);
        }
        continue;
      }
      if (!s[P1]()) continue;
      let r = !1, a = null, o = null, l = null;
      if (s.bind) {
        switch (s.bind.match) {
          case "none":
            this._setAndBind(s, e);
            continue;
          case "global":
            r = !0;
            break;
          case "dataRef":
            if (!s.bind.ref) {
              H(`XFA - ref is empty in node ${s[Ce]}.`), this._setAndBind(s, e);
              continue;
            }
            o = s.bind.ref;
        }
        s.bind.picture && (a = s.bind.picture[mt]);
      }
      const [c, h] = this._getOccurInfo(s);
      if (o) {
        if (l = cc(this.root, e, o, !0, !1), l === null) {
          if (l = rO(this.data, e, o), !l) continue;
          this._isConsumeData() && (l[fo] = !0), this._setAndBind(s, l);
          continue;
        }
        this._isConsumeData() && (l = l.filter((u) => !u[fo])), l.length > h ? l = l.slice(0, h) : l.length === 0 && (l = null), l && this._isConsumeData() && l.forEach((u) => {
          u[fo] = !0;
        });
      } else {
        if (!s.name) {
          this._setAndBind(s, e);
          continue;
        }
        if (this._isConsumeData()) {
          const u = [];
          for (; u.length < h; ) {
            const f = this._findDataByNameToConsume(s.name, s[gp](), e, r);
            if (!f) break;
            f[fo] = !0, u.push(f);
          }
          l = u.length > 0 ? u : null;
        } else {
          if (l = e[P2](s.name, !1, this.emptyMerge).next().value, !l) {
            if (c === 0) {
              n.push(s);
              continue;
            }
            const u = e[Ii] === xx ? -1 : e[Ii];
            l = s[Br] = new Co(u, s.name), this.emptyMerge && (l[fo] = !0), e[pi](l), this._setAndBind(s, l);
            continue;
          }
          this.emptyMerge && (l[fo] = !0), l = [l];
        }
      }
      l ? this._bindOccurrences(s, l, a) : c > 0 ? this._setAndBind(s, e) : n.push(s);
    }
    n.forEach((s) => s[Jt]()[s0](s));
  }
}
class U$ {
  constructor(t, e) {
    this.data = e, this.dataset = t.datasets || null;
  }
  serialize(t) {
    const e = [[-1, this.data[mn]()]];
    for (; e.length > 0; ) {
      const s = e.at(-1), [r, a] = s;
      if (r + 1 === a.length) {
        e.pop();
        continue;
      }
      const o = a[++s[0]], l = t.get(o[Re]);
      if (l) o[Bs](l);
      else {
        const h = o[KD]();
        for (const u of h.values()) {
          const f = t.get(u[Re]);
          if (f) {
            u[Bs](f);
            break;
          }
        }
      }
      const c = o[mn]();
      c.length > 0 && e.push([-1, c]);
    }
    const n = ['<xfa:datasets xmlns:xfa="http://www.xfa.org/schema/xfa-data/1.0/">'];
    if (this.dataset) for (const s of this.dataset[mn]()) s[Ce] !== "data" && s[L2](n);
    return this.data[L2](n), n.push("</xfa:datasets>"), n.join("");
  }
}
const vt = Ri.config.id;
class H$ extends ct {
  constructor(t) {
    super(vt, "acrobat", !0), this.acrobat7 = null, this.autoSave = null, this.common = null, this.validate = null, this.validateApprovalSignatures = null, this.submitUrl = new U();
  }
}
class j$ extends ct {
  constructor(t) {
    super(vt, "acrobat7", !0), this.dynamicRender = null;
  }
}
class G$ extends Be {
  constructor(t) {
    super(vt, "ADBE_JSConsole", ["delegate", "Enable", "Disable"]);
  }
}
class V$ extends Be {
  constructor(t) {
    super(vt, "ADBE_JSDebugger", ["delegate", "Enable", "Disable"]);
  }
}
class W$ extends Yi {
  constructor(t) {
    super(vt, "addSilentPrint");
  }
}
class X$ extends Yi {
  constructor(t) {
    super(vt, "addViewerPreferences");
  }
}
class Y$ extends nT {
  constructor(t) {
    super(vt, "adjustData");
  }
}
class K$ extends La {
  constructor(t) {
    super(vt, "adobeExtensionLevel", 0, (e) => e >= 1 && e <= 8);
  }
}
class Z$ extends ct {
  constructor(t) {
    super(vt, "agent", !0), this.name = t.name ? t.name.trim() : "", this.common = new U();
  }
}
class J$ extends bi {
  constructor(t) {
    super(vt, "alwaysEmbed");
  }
}
class Q$ extends de {
  constructor(t) {
    super(vt, "amd");
  }
}
class tq extends ct {
  constructor(t) {
    super(vt, "area"), this.level = Yt({ data: t.level, defaultValue: 0, validate: (e) => e >= 1 && e <= 3 }), this.name = bt(t.name, ["", "barcode", "coreinit", "deviceDriver", "font", "general", "layout", "merge", "script", "signature", "sourceSet", "templateCache"]);
  }
}
class eq extends Be {
  constructor(t) {
    super(vt, "attributes", ["preserve", "delegate", "ignore"]);
  }
}
class iq extends Be {
  constructor(t) {
    super(vt, "autoSave", ["disabled", "enabled"]);
  }
}
class nq extends de {
  constructor(t) {
    super(vt, "base");
  }
}
class sq extends ct {
  constructor(t) {
    super(vt, "batchOutput"), this.format = bt(t.format, ["none", "concat", "zip", "zipCompress"]);
  }
}
class rq extends bi {
  constructor(t) {
    super(vt, "behaviorOverride");
  }
  [Ue]() {
    this[mt] = new Map(this[mt].trim().split(/\s+/).filter((t) => t.includes(":")).map((t) => t.split(":", 2)));
  }
}
class aq extends ct {
  constructor(t) {
    super(vt, "cache", !0), this.templateCache = null;
  }
}
class oq extends Yi {
  constructor(t) {
    super(vt, "change");
  }
}
class lq extends ct {
  constructor(t) {
    super(vt, "common", !0), this.data = null, this.locale = null, this.localeSet = null, this.messaging = null, this.suppressBanner = null, this.template = null, this.validationMessaging = null, this.versionControl = null, this.log = new U();
  }
}
class cq extends ct {
  constructor(t) {
    super(vt, "compress"), this.scope = bt(t.scope, ["imageOnly", "document"]);
  }
}
class hq extends Yi {
  constructor(t) {
    super(vt, "compressLogicalStructure");
  }
}
class uq extends nT {
  constructor(t) {
    super(vt, "compressObjectStream");
  }
}
class dq extends ct {
  constructor(t) {
    super(vt, "compression", !0), this.compressLogicalStructure = null, this.compressObjectStream = null, this.level = null, this.type = null;
  }
}
class fq extends ct {
  constructor(t) {
    super(vt, "config", !0), this.acrobat = null, this.present = null, this.trace = null, this.agent = new U();
  }
}
class pq extends Be {
  constructor(t) {
    super(vt, "conformance", ["A", "B"]);
  }
}
class mq extends Yi {
  constructor(t) {
    super(vt, "contentCopy");
  }
}
class gq extends La {
  constructor(t) {
    super(vt, "copies", 1, (e) => e >= 1);
  }
}
class bq extends de {
  constructor(t) {
    super(vt, "creator");
  }
}
class yq extends La {
  constructor(t) {
    super(vt, "currentPage", 0, (e) => e >= 0);
  }
}
class wq extends ct {
  constructor(t) {
    super(vt, "data", !0), this.adjustData = null, this.attributes = null, this.incrementalLoad = null, this.outputXSL = null, this.range = null, this.record = null, this.startNode = null, this.uri = null, this.window = null, this.xsl = null, this.excludeNS = new U(), this.transform = new U();
  }
}
class vq extends ct {
  constructor(t) {
    super(vt, "debug", !0), this.uri = null;
  }
}
class _q extends bi {
  constructor(t) {
    super(vt, "defaultTypeface"), this.writingScript = bt(t.writingScript, ["*", "Arabic", "Cyrillic", "EastEuropeanRoman", "Greek", "Hebrew", "Japanese", "Korean", "Roman", "SimplifiedChinese", "Thai", "TraditionalChinese", "Vietnamese"]);
  }
}
class xq extends Be {
  constructor(t) {
    super(vt, "destination", ["pdf", "pcl", "ps", "webClient", "zpl"]);
  }
}
class kq extends Yi {
  constructor(t) {
    super(vt, "documentAssembly");
  }
}
class Aq extends ct {
  constructor(t) {
    super(vt, "driver", !0), this.name = t.name ? t.name.trim() : "", this.fontInfo = null, this.xdc = null;
  }
}
class Sq extends Be {
  constructor(t) {
    super(vt, "duplexOption", ["simplex", "duplexFlipLongEdge", "duplexFlipShortEdge"]);
  }
}
class Cq extends Be {
  constructor(t) {
    super(vt, "dynamicRender", ["forbidden", "required"]);
  }
}
class Eq extends Yi {
  constructor(t) {
    super(vt, "embed");
  }
}
class Dq extends Yi {
  constructor(t) {
    super(vt, "encrypt");
  }
}
class Tq extends ct {
  constructor(t) {
    super(vt, "encryption", !0), this.encrypt = null, this.encryptionLevel = null, this.permissions = null;
  }
}
class Fq extends Be {
  constructor(t) {
    super(vt, "encryptionLevel", ["40bit", "128bit"]);
  }
}
class Iq extends de {
  constructor(t) {
    super(vt, "enforce");
  }
}
class Mq extends ct {
  constructor(t) {
    super(vt, "equate"), this.force = Yt({ data: t.force, defaultValue: 1, validate: (e) => e === 0 }), this.from = t.from || "", this.to = t.to || "";
  }
}
class Rq extends ct {
  constructor(t) {
    super(vt, "equateRange"), this.from = t.from || "", this.to = t.to || "", this._unicodeRange = t.unicodeRange || "";
  }
  get unicodeRange() {
    const t = [], e = /U\+([0-9a-fA-F]+)/, n = this._unicodeRange;
    for (let s of n.split(",").map((r) => r.trim()).filter((r) => !!r))
      s = s.split("-", 2).map((r) => {
        const a = r.match(e);
        return a ? parseInt(a[1], 16) : 0;
      }), s.length === 1 && s.push(s[0]), t.push(s);
    return At(this, "unicodeRange", t);
  }
}
class Bq extends bi {
  constructor(t) {
    super(vt, "exclude");
  }
  [Ue]() {
    this[mt] = this[mt].trim().split(/\s+/).filter((t) => t && ["calculate", "close", "enter", "exit", "initialize", "ready", "validate"].includes(t));
  }
}
class Pq extends de {
  constructor(t) {
    super(vt, "excludeNS");
  }
}
class Nq extends Be {
  constructor(t) {
    super(vt, "flipLabel", ["usePrinterSetting", "on", "off"]);
  }
}
class Lq extends ct {
  constructor(t) {
    super(vt, "fontInfo", !0), this.embed = null, this.map = null, this.subsetBelow = null, this.alwaysEmbed = new U(), this.defaultTypeface = new U(), this.neverEmbed = new U();
  }
}
class Oq extends Yi {
  constructor(t) {
    super(vt, "formFieldFilling");
  }
}
class $q extends de {
  constructor(t) {
    super(vt, "groupParent");
  }
}
class qq extends Be {
  constructor(t) {
    super(vt, "ifEmpty", ["dataValue", "dataGroup", "ignore", "remove"]);
  }
}
class zq extends de {
  constructor(t) {
    super(vt, "includeXDPContent");
  }
}
class Uq extends Be {
  constructor(t) {
    super(vt, "incrementalLoad", ["none", "forwardOnly"]);
  }
}
class Hq extends Yi {
  constructor(t) {
    super(vt, "incrementalMerge");
  }
}
class jq extends Yi {
  constructor(t) {
    super(vt, "interactive");
  }
}
class Gq extends Be {
  constructor(t) {
    super(vt, "jog", ["usePrinterSetting", "none", "pageSet"]);
  }
}
class Vq extends ct {
  constructor(t) {
    super(vt, "labelPrinter", !0), this.name = bt(t.name, ["zpl", "dpl", "ipl", "tcpl"]), this.batchOutput = null, this.flipLabel = null, this.fontInfo = null, this.xdc = null;
  }
}
class Wq extends Be {
  constructor(t) {
    super(vt, "layout", ["paginate", "panel"]);
  }
}
class Xq extends La {
  constructor(t) {
    super(vt, "level", 0, (e) => e > 0);
  }
}
class Yq extends Yi {
  constructor(t) {
    super(vt, "linearized");
  }
}
class Kq extends de {
  constructor(t) {
    super(vt, "locale");
  }
}
class Zq extends de {
  constructor(t) {
    super(vt, "localeSet");
  }
}
class Jq extends ct {
  constructor(t) {
    super(vt, "log", !0), this.mode = null, this.threshold = null, this.to = null, this.uri = null;
  }
}
class Qq extends ct {
  constructor(t) {
    super(vt, "map", !0), this.equate = new U(), this.equateRange = new U();
  }
}
class tz extends ct {
  constructor(t) {
    super(vt, "mediumInfo", !0), this.map = null;
  }
}
class ez extends ct {
  constructor(t) {
    super(vt, "message", !0), this.msgId = null, this.severity = null;
  }
}
class iz extends ct {
  constructor(t) {
    super(vt, "messaging", !0), this.message = new U();
  }
}
class nz extends Be {
  constructor(t) {
    super(vt, "mode", ["append", "overwrite"]);
  }
}
class sz extends Yi {
  constructor(t) {
    super(vt, "modifyAnnots");
  }
}
class rz extends La {
  constructor(t) {
    super(vt, "msgId", 1, (e) => e >= 1);
  }
}
class az extends de {
  constructor(t) {
    super(vt, "nameAttr");
  }
}
class oz extends bi {
  constructor(t) {
    super(vt, "neverEmbed");
  }
}
class lz extends La {
  constructor(t) {
    super(vt, "numberOfCopies", null, (e) => e >= 2 && e <= 5);
  }
}
class cz extends ct {
  constructor(t) {
    super(vt, "openAction", !0), this.destination = null;
  }
}
class hz extends ct {
  constructor(t) {
    super(vt, "output", !0), this.to = null, this.type = null, this.uri = null;
  }
}
class uz extends de {
  constructor(t) {
    super(vt, "outputBin");
  }
}
class dz extends ct {
  constructor(t) {
    super(vt, "outputXSL", !0), this.uri = null;
  }
}
class fz extends Be {
  constructor(t) {
    super(vt, "overprint", ["none", "both", "draw", "field"]);
  }
}
class pz extends de {
  constructor(t) {
    super(vt, "packets");
  }
  [Ue]() {
    this[mt] !== "*" && (this[mt] = this[mt].trim().split(/\s+/).filter((t) => ["config", "datasets", "template", "xfdf", "xslt"].includes(t)));
  }
}
class mz extends ct {
  constructor(t) {
    super(vt, "pageOffset"), this.x = Yt({ data: t.x, defaultValue: "useXDCSetting", validate: (e) => !0 }), this.y = Yt({ data: t.y, defaultValue: "useXDCSetting", validate: (e) => !0 });
  }
}
class gz extends de {
  constructor(t) {
    super(vt, "pageRange");
  }
  [Ue]() {
    const t = this[mt].trim().split(/\s+/).map((n) => parseInt(n, 10)), e = [];
    for (let n = 0, s = t.length; n < s; n += 2) e.push(t.slice(n, n + 2));
    this[mt] = e;
  }
}
class bz extends Be {
  constructor(t) {
    super(vt, "pagination", ["simplex", "duplexShortEdge", "duplexLongEdge"]);
  }
}
class yz extends Be {
  constructor(t) {
    super(vt, "paginationOverride", ["none", "forceDuplex", "forceDuplexLongEdge", "forceDuplexShortEdge", "forceSimplex"]);
  }
}
class wz extends La {
  constructor(t) {
    super(vt, "part", 1, (e) => !1);
  }
}
class vz extends ct {
  constructor(t) {
    super(vt, "pcl", !0), this.name = t.name || "", this.batchOutput = null, this.fontInfo = null, this.jog = null, this.mediumInfo = null, this.outputBin = null, this.pageOffset = null, this.staple = null, this.xdc = null;
  }
}
class _z extends ct {
  constructor(t) {
    super(vt, "pdf", !0), this.name = t.name || "", this.adobeExtensionLevel = null, this.batchOutput = null, this.compression = null, this.creator = null, this.encryption = null, this.fontInfo = null, this.interactive = null, this.linearized = null, this.openAction = null, this.pdfa = null, this.producer = null, this.renderPolicy = null, this.scriptModel = null, this.silentPrint = null, this.submitFormat = null, this.tagged = null, this.version = null, this.viewerPreferences = null, this.xdc = null;
  }
}
class xz extends ct {
  constructor(t) {
    super(vt, "pdfa", !0), this.amd = null, this.conformance = null, this.includeXDPContent = null, this.part = null;
  }
}
class kz extends ct {
  constructor(t) {
    super(vt, "permissions", !0), this.accessibleContent = null, this.change = null, this.contentCopy = null, this.documentAssembly = null, this.formFieldFilling = null, this.modifyAnnots = null, this.plaintextMetadata = null, this.print = null, this.printHighQuality = null;
  }
}
class Az extends Yi {
  constructor(t) {
    super(vt, "pickTrayByPDFSize");
  }
}
class Sz extends de {
  constructor(t) {
    super(vt, "picture");
  }
}
class Cz extends Yi {
  constructor(t) {
    super(vt, "plaintextMetadata");
  }
}
class Ez extends Be {
  constructor(t) {
    super(vt, "presence", ["preserve", "dissolve", "dissolveStructure", "ignore", "remove"]);
  }
}
class Dz extends ct {
  constructor(t) {
    super(vt, "present", !0), this.behaviorOverride = null, this.cache = null, this.common = null, this.copies = null, this.destination = null, this.incrementalMerge = null, this.layout = null, this.output = null, this.overprint = null, this.pagination = null, this.paginationOverride = null, this.script = null, this.validate = null, this.xdp = null, this.driver = new U(), this.labelPrinter = new U(), this.pcl = new U(), this.pdf = new U(), this.ps = new U(), this.submitUrl = new U(), this.webClient = new U(), this.zpl = new U();
  }
}
class Tz extends Yi {
  constructor(t) {
    super(vt, "print");
  }
}
class Fz extends Yi {
  constructor(t) {
    super(vt, "printHighQuality");
  }
}
class Iz extends Be {
  constructor(t) {
    super(vt, "printScaling", ["appdefault", "noScaling"]);
  }
}
class Mz extends de {
  constructor(t) {
    super(vt, "printerName");
  }
}
class Rz extends de {
  constructor(t) {
    super(vt, "producer");
  }
}
class Bz extends ct {
  constructor(t) {
    super(vt, "ps", !0), this.name = t.name || "", this.batchOutput = null, this.fontInfo = null, this.jog = null, this.mediumInfo = null, this.outputBin = null, this.staple = null, this.xdc = null;
  }
}
let Pz = class extends bi {
  constructor(t) {
    super(vt, "range");
  }
  [Ue]() {
    this[mt] = this[mt].split(",", 2).map((t) => t.split("-").map((e) => parseInt(e.trim(), 10))).filter((t) => t.every((e) => !isNaN(e))).map((t) => (t.length === 1 && t.push(t[0]), t));
  }
};
class Nz extends bi {
  constructor(t) {
    super(vt, "record");
  }
  [Ue]() {
    this[mt] = this[mt].trim();
    const t = parseInt(this[mt], 10);
    !isNaN(t) && t >= 0 && (this[mt] = t);
  }
}
class Lz extends bi {
  constructor(t) {
    super(vt, "relevant");
  }
  [Ue]() {
    this[mt] = this[mt].trim().split(/\s+/);
  }
}
class Oz extends bi {
  constructor(t) {
    super(vt, "rename");
  }
  [Ue]() {
    this[mt] = this[mt].trim(), (this[mt].toLowerCase().startsWith("xml") || new RegExp("[\\p{L}_][\\p{L}\\d._\\p{M}-]*", "u").test(this[mt])) && H("XFA - Rename: invalid XFA name");
  }
}
class $z extends Be {
  constructor(t) {
    super(vt, "renderPolicy", ["server", "client"]);
  }
}
class qz extends Be {
  constructor(t) {
    super(vt, "runScripts", ["both", "client", "none", "server"]);
  }
}
class zz extends ct {
  constructor(t) {
    super(vt, "script", !0), this.currentPage = null, this.exclude = null, this.runScripts = null;
  }
}
class Uz extends Be {
  constructor(t) {
    super(vt, "scriptModel", ["XFA", "none"]);
  }
}
class Hz extends Be {
  constructor(t) {
    super(vt, "severity", ["ignore", "error", "information", "trace", "warning"]);
  }
}
class jz extends ct {
  constructor(t) {
    super(vt, "silentPrint", !0), this.addSilentPrint = null, this.printerName = null;
  }
}
class Gz extends ct {
  constructor(t) {
    super(vt, "staple"), this.mode = bt(t.mode, ["usePrinterSetting", "on", "off"]);
  }
}
class Vz extends de {
  constructor(t) {
    super(vt, "startNode");
  }
}
class Wz extends La {
  constructor(t) {
    super(vt, "startPage", 0, (e) => !0);
  }
}
class Xz extends Be {
  constructor(t) {
    super(vt, "submitFormat", ["html", "delegate", "fdf", "xml", "pdf"]);
  }
}
class Yz extends de {
  constructor(t) {
    super(vt, "submitUrl");
  }
}
class Kz extends La {
  constructor(t) {
    super(vt, "subsetBelow", 100, (e) => e >= 0 && e <= 100);
  }
}
class Zz extends Yi {
  constructor(t) {
    super(vt, "suppressBanner");
  }
}
class Jz extends Yi {
  constructor(t) {
    super(vt, "tagged");
  }
}
class Qz extends ct {
  constructor(t) {
    super(vt, "template", !0), this.base = null, this.relevant = null, this.startPage = null, this.uri = null, this.xsl = null;
  }
}
class tU extends Be {
  constructor(t) {
    super(vt, "threshold", ["trace", "error", "information", "warning"]);
  }
}
class eU extends Be {
  constructor(t) {
    super(vt, "to", ["null", "memory", "stderr", "stdout", "system", "uri"]);
  }
}
class iU extends ct {
  constructor(t) {
    super(vt, "templateCache"), this.maxEntries = Yt({ data: t.maxEntries, defaultValue: 5, validate: (e) => e >= 0 });
  }
}
class nU extends ct {
  constructor(t) {
    super(vt, "trace", !0), this.area = new U();
  }
}
class sU extends ct {
  constructor(t) {
    super(vt, "transform", !0), this.groupParent = null, this.ifEmpty = null, this.nameAttr = null, this.picture = null, this.presence = null, this.rename = null, this.whitespace = null;
  }
}
class rU extends Be {
  constructor(t) {
    super(vt, "type", ["none", "ascii85", "asciiHex", "ccittfax", "flate", "lzw", "runLength", "native", "xdp", "mergedXDP"]);
  }
}
class aU extends de {
  constructor(t) {
    super(vt, "uri");
  }
}
class oU extends Be {
  constructor(t) {
    super(vt, "validate", ["preSubmit", "prePrint", "preExecute", "preSave"]);
  }
}
class lU extends bi {
  constructor(t) {
    super(vt, "validateApprovalSignatures");
  }
  [Ue]() {
    this[mt] = this[mt].trim().split(/\s+/).filter((t) => ["docReady", "postSign"].includes(t));
  }
}
class cU extends Be {
  constructor(t) {
    super(vt, "validationMessaging", ["allMessagesIndividually", "allMessagesTogether", "firstMessageOnly", "noMessages"]);
  }
}
class hU extends Be {
  constructor(t) {
    super(vt, "version", ["1.7", "1.6", "1.5", "1.4", "1.3", "1.2"]);
  }
}
class uU extends ct {
  constructor(t) {
    super(vt, "VersionControl"), this.outputBelow = bt(t.outputBelow, ["warn", "error", "update"]), this.sourceAbove = bt(t.sourceAbove, ["warn", "error"]), this.sourceBelow = bt(t.sourceBelow, ["update", "maintain"]);
  }
}
class dU extends ct {
  constructor(t) {
    super(vt, "viewerPreferences", !0), this.ADBE_JSConsole = null, this.ADBE_JSDebugger = null, this.addViewerPreferences = null, this.duplexOption = null, this.enforce = null, this.numberOfCopies = null, this.pageRange = null, this.pickTrayByPDFSize = null, this.printScaling = null;
  }
}
class fU extends ct {
  constructor(t) {
    super(vt, "webClient", !0), this.name = t.name ? t.name.trim() : "", this.fontInfo = null, this.xdc = null;
  }
}
class pU extends Be {
  constructor(t) {
    super(vt, "whitespace", ["preserve", "ltrim", "normalize", "rtrim", "trim"]);
  }
}
class mU extends bi {
  constructor(t) {
    super(vt, "window");
  }
  [Ue]() {
    const t = this[mt].split(",", 2).map((e) => parseInt(e.trim(), 10));
    t.some((e) => isNaN(e)) ? this[mt] = [0, 0] : (t.length === 1 && t.push(t[0]), this[mt] = t);
  }
}
class gU extends ct {
  constructor(t) {
    super(vt, "xdc", !0), this.uri = new U(), this.xsl = new U();
  }
}
class bU extends ct {
  constructor(t) {
    super(vt, "xdp", !0), this.packets = null;
  }
}
class yU extends ct {
  constructor(t) {
    super(vt, "xsl", !0), this.debug = null, this.uri = null;
  }
}
class wU extends ct {
  constructor(t) {
    super(vt, "zpl", !0), this.name = t.name ? t.name.trim() : "", this.batchOutput = null, this.flipLabel = null, this.fontInfo = null, this.xdc = null;
  }
}
class v3 {
  static [Pa](t, e) {
    if (v3.hasOwnProperty(t)) return v3[t](e);
  }
  static acrobat(t) {
    return new H$(t);
  }
  static acrobat7(t) {
    return new j$(t);
  }
  static ADBE_JSConsole(t) {
    return new G$(t);
  }
  static ADBE_JSDebugger(t) {
    return new V$(t);
  }
  static addSilentPrint(t) {
    return new W$(t);
  }
  static addViewerPreferences(t) {
    return new X$(t);
  }
  static adjustData(t) {
    return new Y$(t);
  }
  static adobeExtensionLevel(t) {
    return new K$(t);
  }
  static agent(t) {
    return new Z$(t);
  }
  static alwaysEmbed(t) {
    return new J$(t);
  }
  static amd(t) {
    return new Q$(t);
  }
  static area(t) {
    return new tq(t);
  }
  static attributes(t) {
    return new eq(t);
  }
  static autoSave(t) {
    return new iq(t);
  }
  static base(t) {
    return new nq(t);
  }
  static batchOutput(t) {
    return new sq(t);
  }
  static behaviorOverride(t) {
    return new rq(t);
  }
  static cache(t) {
    return new aq(t);
  }
  static change(t) {
    return new oq(t);
  }
  static common(t) {
    return new lq(t);
  }
  static compress(t) {
    return new cq(t);
  }
  static compressLogicalStructure(t) {
    return new hq(t);
  }
  static compressObjectStream(t) {
    return new uq(t);
  }
  static compression(t) {
    return new dq(t);
  }
  static config(t) {
    return new fq(t);
  }
  static conformance(t) {
    return new pq(t);
  }
  static contentCopy(t) {
    return new mq(t);
  }
  static copies(t) {
    return new gq(t);
  }
  static creator(t) {
    return new bq(t);
  }
  static currentPage(t) {
    return new yq(t);
  }
  static data(t) {
    return new wq(t);
  }
  static debug(t) {
    return new vq(t);
  }
  static defaultTypeface(t) {
    return new _q(t);
  }
  static destination(t) {
    return new xq(t);
  }
  static documentAssembly(t) {
    return new kq(t);
  }
  static driver(t) {
    return new Aq(t);
  }
  static duplexOption(t) {
    return new Sq(t);
  }
  static dynamicRender(t) {
    return new Cq(t);
  }
  static embed(t) {
    return new Eq(t);
  }
  static encrypt(t) {
    return new Dq(t);
  }
  static encryption(t) {
    return new Tq(t);
  }
  static encryptionLevel(t) {
    return new Fq(t);
  }
  static enforce(t) {
    return new Iq(t);
  }
  static equate(t) {
    return new Mq(t);
  }
  static equateRange(t) {
    return new Rq(t);
  }
  static exclude(t) {
    return new Bq(t);
  }
  static excludeNS(t) {
    return new Pq(t);
  }
  static flipLabel(t) {
    return new Nq(t);
  }
  static fontInfo(t) {
    return new Lq(t);
  }
  static formFieldFilling(t) {
    return new Oq(t);
  }
  static groupParent(t) {
    return new $q(t);
  }
  static ifEmpty(t) {
    return new qq(t);
  }
  static includeXDPContent(t) {
    return new zq(t);
  }
  static incrementalLoad(t) {
    return new Uq(t);
  }
  static incrementalMerge(t) {
    return new Hq(t);
  }
  static interactive(t) {
    return new jq(t);
  }
  static jog(t) {
    return new Gq(t);
  }
  static labelPrinter(t) {
    return new Vq(t);
  }
  static layout(t) {
    return new Wq(t);
  }
  static level(t) {
    return new Xq(t);
  }
  static linearized(t) {
    return new Yq(t);
  }
  static locale(t) {
    return new Kq(t);
  }
  static localeSet(t) {
    return new Zq(t);
  }
  static log(t) {
    return new Jq(t);
  }
  static map(t) {
    return new Qq(t);
  }
  static mediumInfo(t) {
    return new tz(t);
  }
  static message(t) {
    return new ez(t);
  }
  static messaging(t) {
    return new iz(t);
  }
  static mode(t) {
    return new nz(t);
  }
  static modifyAnnots(t) {
    return new sz(t);
  }
  static msgId(t) {
    return new rz(t);
  }
  static nameAttr(t) {
    return new az(t);
  }
  static neverEmbed(t) {
    return new oz(t);
  }
  static numberOfCopies(t) {
    return new lz(t);
  }
  static openAction(t) {
    return new cz(t);
  }
  static output(t) {
    return new hz(t);
  }
  static outputBin(t) {
    return new uz(t);
  }
  static outputXSL(t) {
    return new dz(t);
  }
  static overprint(t) {
    return new fz(t);
  }
  static packets(t) {
    return new pz(t);
  }
  static pageOffset(t) {
    return new mz(t);
  }
  static pageRange(t) {
    return new gz(t);
  }
  static pagination(t) {
    return new bz(t);
  }
  static paginationOverride(t) {
    return new yz(t);
  }
  static part(t) {
    return new wz(t);
  }
  static pcl(t) {
    return new vz(t);
  }
  static pdf(t) {
    return new _z(t);
  }
  static pdfa(t) {
    return new xz(t);
  }
  static permissions(t) {
    return new kz(t);
  }
  static pickTrayByPDFSize(t) {
    return new Az(t);
  }
  static picture(t) {
    return new Sz(t);
  }
  static plaintextMetadata(t) {
    return new Cz(t);
  }
  static presence(t) {
    return new Ez(t);
  }
  static present(t) {
    return new Dz(t);
  }
  static print(t) {
    return new Tz(t);
  }
  static printHighQuality(t) {
    return new Fz(t);
  }
  static printScaling(t) {
    return new Iz(t);
  }
  static printerName(t) {
    return new Mz(t);
  }
  static producer(t) {
    return new Rz(t);
  }
  static ps(t) {
    return new Bz(t);
  }
  static range(t) {
    return new Pz(t);
  }
  static record(t) {
    return new Nz(t);
  }
  static relevant(t) {
    return new Lz(t);
  }
  static rename(t) {
    return new Oz(t);
  }
  static renderPolicy(t) {
    return new $z(t);
  }
  static runScripts(t) {
    return new qz(t);
  }
  static script(t) {
    return new zz(t);
  }
  static scriptModel(t) {
    return new Uz(t);
  }
  static severity(t) {
    return new Hz(t);
  }
  static silentPrint(t) {
    return new jz(t);
  }
  static staple(t) {
    return new Gz(t);
  }
  static startNode(t) {
    return new Vz(t);
  }
  static startPage(t) {
    return new Wz(t);
  }
  static submitFormat(t) {
    return new Xz(t);
  }
  static submitUrl(t) {
    return new Yz(t);
  }
  static subsetBelow(t) {
    return new Kz(t);
  }
  static suppressBanner(t) {
    return new Zz(t);
  }
  static tagged(t) {
    return new Jz(t);
  }
  static template(t) {
    return new Qz(t);
  }
  static templateCache(t) {
    return new iU(t);
  }
  static threshold(t) {
    return new tU(t);
  }
  static to(t) {
    return new eU(t);
  }
  static trace(t) {
    return new nU(t);
  }
  static transform(t) {
    return new sU(t);
  }
  static type(t) {
    return new rU(t);
  }
  static uri(t) {
    return new aU(t);
  }
  static validate(t) {
    return new oU(t);
  }
  static validateApprovalSignatures(t) {
    return new lU(t);
  }
  static validationMessaging(t) {
    return new cU(t);
  }
  static version(t) {
    return new hU(t);
  }
  static versionControl(t) {
    return new uU(t);
  }
  static viewerPreferences(t) {
    return new dU(t);
  }
  static webClient(t) {
    return new fU(t);
  }
  static whitespace(t) {
    return new pU(t);
  }
  static window(t) {
    return new mU(t);
  }
  static xdc(t) {
    return new gU(t);
  }
  static xdp(t) {
    return new bU(t);
  }
  static xsl(t) {
    return new yU(t);
  }
  static zpl(t) {
    return new wU(t);
  }
}
const Jr = Ri.connectionSet.id;
class vU extends ct {
  constructor(t) {
    super(Jr, "connectionSet", !0), this.wsdlConnection = new U(), this.xmlConnection = new U(), this.xsdConnection = new U();
  }
}
class _U extends ct {
  constructor(t) {
    super(Jr, "effectiveInputPolicy"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class xU extends ct {
  constructor(t) {
    super(Jr, "effectiveOutputPolicy"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class kU extends de {
  constructor(t) {
    super(Jr, "operation"), this.id = t.id || "", this.input = t.input || "", this.name = t.name || "", this.output = t.output || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class AU extends de {
  constructor(t) {
    super(Jr, "rootElement"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class SU extends de {
  constructor(t) {
    super(Jr, "soapAction"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class CU extends de {
  constructor(t) {
    super(Jr, "soapAddress"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class EU extends de {
  constructor(t) {
    super(Jr, "uri"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class DU extends de {
  constructor(t) {
    super(Jr, "wsdlAddress"), this.id = t.id || "", this.name = t.name || "", this.use = t.use || "", this.usehref = t.usehref || "";
  }
}
class TU extends ct {
  constructor(t) {
    super(Jr, "wsdlConnection", !0), this.dataDescription = t.dataDescription || "", this.name = t.name || "", this.effectiveInputPolicy = null, this.effectiveOutputPolicy = null, this.operation = null, this.soapAction = null, this.soapAddress = null, this.wsdlAddress = null;
  }
}
class FU extends ct {
  constructor(t) {
    super(Jr, "xmlConnection", !0), this.dataDescription = t.dataDescription || "", this.name = t.name || "", this.uri = null;
  }
}
class IU extends ct {
  constructor(t) {
    super(Jr, "xsdConnection", !0), this.dataDescription = t.dataDescription || "", this.name = t.name || "", this.rootElement = null, this.uri = null;
  }
}
class _3 {
  static [Pa](t, e) {
    if (_3.hasOwnProperty(t)) return _3[t](e);
  }
  static connectionSet(t) {
    return new vU(t);
  }
  static effectiveInputPolicy(t) {
    return new _U(t);
  }
  static effectiveOutputPolicy(t) {
    return new xU(t);
  }
  static operation(t) {
    return new kU(t);
  }
  static rootElement(t) {
    return new AU(t);
  }
  static soapAction(t) {
    return new SU(t);
  }
  static soapAddress(t) {
    return new CU(t);
  }
  static uri(t) {
    return new EU(t);
  }
  static wsdlAddress(t) {
    return new DU(t);
  }
  static wsdlConnection(t) {
    return new TU(t);
  }
  static xmlConnection(t) {
    return new FU(t);
  }
  static xsdConnection(t) {
    return new IU(t);
  }
}
const Gb = Ri.datasets.id;
class MU extends Co {
  constructor(t) {
    super(Gb, "data", t);
  }
  [N2]() {
    return !0;
  }
}
class RU extends ct {
  constructor(t) {
    super(Gb, "datasets", !0), this.data = null, this.Signature = null;
  }
  [So](t) {
    const e = t[Ce];
    (e === "data" && t[Ii] === Gb || e === "Signature" && t[Ii] === Ri.signature.id) && (this[e] = t), this[pi](t);
  }
}
class x3 {
  static [Pa](t, e) {
    if (x3.hasOwnProperty(t)) return x3[t](e);
  }
  static datasets(t) {
    return new RU(t);
  }
  static data(t) {
    return new MU(t);
  }
}
const yi = Ri.localeSet.id;
class BU extends ct {
  constructor(t) {
    super(yi, "calendarSymbols", !0), this.name = "gregorian", this.dayNames = new U(2), this.eraNames = null, this.meridiemNames = null, this.monthNames = new U(2);
  }
}
class PU extends de {
  constructor(t) {
    super(yi, "currencySymbol"), this.name = bt(t.name, ["symbol", "isoname", "decimal"]);
  }
}
class NU extends ct {
  constructor(t) {
    super(yi, "currencySymbols", !0), this.currencySymbol = new U(3);
  }
}
class LU extends de {
  constructor(t) {
    super(yi, "datePattern"), this.name = bt(t.name, ["full", "long", "med", "short"]);
  }
}
class OU extends ct {
  constructor(t) {
    super(yi, "datePatterns", !0), this.datePattern = new U(4);
  }
}
class $U extends bi {
  constructor(t) {
    super(yi, "dateTimeSymbols");
  }
}
class qU extends de {
  constructor(t) {
    super(yi, "day");
  }
}
class zU extends ct {
  constructor(t) {
    super(yi, "dayNames", !0), this.abbr = Yt({ data: t.abbr, defaultValue: 0, validate: (e) => e === 1 }), this.day = new U(7);
  }
}
class UU extends de {
  constructor(t) {
    super(yi, "era");
  }
}
class HU extends ct {
  constructor(t) {
    super(yi, "eraNames", !0), this.era = new U(2);
  }
}
class jU extends ct {
  constructor(t) {
    super(yi, "locale", !0), this.desc = t.desc || "", this.name = "isoname", this.calendarSymbols = null, this.currencySymbols = null, this.datePatterns = null, this.dateTimeSymbols = null, this.numberPatterns = null, this.numberSymbols = null, this.timePatterns = null, this.typeFaces = null;
  }
}
class GU extends ct {
  constructor(t) {
    super(yi, "localeSet", !0), this.locale = new U();
  }
}
class VU extends de {
  constructor(t) {
    super(yi, "meridiem");
  }
}
class WU extends ct {
  constructor(t) {
    super(yi, "meridiemNames", !0), this.meridiem = new U(2);
  }
}
class XU extends de {
  constructor(t) {
    super(yi, "month");
  }
}
class YU extends ct {
  constructor(t) {
    super(yi, "monthNames", !0), this.abbr = Yt({ data: t.abbr, defaultValue: 0, validate: (e) => e === 1 }), this.month = new U(12);
  }
}
class KU extends de {
  constructor(t) {
    super(yi, "numberPattern"), this.name = bt(t.name, ["full", "long", "med", "short"]);
  }
}
class ZU extends ct {
  constructor(t) {
    super(yi, "numberPatterns", !0), this.numberPattern = new U(4);
  }
}
class JU extends de {
  constructor(t) {
    super(yi, "numberSymbol"), this.name = bt(t.name, ["decimal", "grouping", "percent", "minus", "zero"]);
  }
}
class QU extends ct {
  constructor(t) {
    super(yi, "numberSymbols", !0), this.numberSymbol = new U(5);
  }
}
class tH extends de {
  constructor(t) {
    super(yi, "timePattern"), this.name = bt(t.name, ["full", "long", "med", "short"]);
  }
}
class eH extends ct {
  constructor(t) {
    super(yi, "timePatterns", !0), this.timePattern = new U(4);
  }
}
class iH extends ct {
  constructor(t) {
    super(yi, "typeFace", !0), this.name = "" | t.name;
  }
}
class nH extends ct {
  constructor(t) {
    super(yi, "typeFaces", !0), this.typeFace = new U();
  }
}
class k3 {
  static [Pa](t, e) {
    if (k3.hasOwnProperty(t)) return k3[t](e);
  }
  static calendarSymbols(t) {
    return new BU(t);
  }
  static currencySymbol(t) {
    return new PU(t);
  }
  static currencySymbols(t) {
    return new NU(t);
  }
  static datePattern(t) {
    return new LU(t);
  }
  static datePatterns(t) {
    return new OU(t);
  }
  static dateTimeSymbols(t) {
    return new $U(t);
  }
  static day(t) {
    return new qU(t);
  }
  static dayNames(t) {
    return new zU(t);
  }
  static era(t) {
    return new UU(t);
  }
  static eraNames(t) {
    return new HU(t);
  }
  static locale(t) {
    return new jU(t);
  }
  static localeSet(t) {
    return new GU(t);
  }
  static meridiem(t) {
    return new VU(t);
  }
  static meridiemNames(t) {
    return new WU(t);
  }
  static month(t) {
    return new XU(t);
  }
  static monthNames(t) {
    return new YU(t);
  }
  static numberPattern(t) {
    return new KU(t);
  }
  static numberPatterns(t) {
    return new ZU(t);
  }
  static numberSymbol(t) {
    return new JU(t);
  }
  static numberSymbols(t) {
    return new QU(t);
  }
  static timePattern(t) {
    return new tH(t);
  }
  static timePatterns(t) {
    return new eH(t);
  }
  static typeFace(t) {
    return new iH(t);
  }
  static typeFaces(t) {
    return new nH(t);
  }
}
const sH = Ri.signature.id;
class rH extends ct {
  constructor(t) {
    super(sH, "signature", !0);
  }
}
class A3 {
  static [Pa](t, e) {
    if (A3.hasOwnProperty(t)) return A3[t](e);
  }
  static signature(t) {
    return new rH(t);
  }
}
const aH = Ri.stylesheet.id;
class oH extends ct {
  constructor(t) {
    super(aH, "stylesheet", !0);
  }
}
class S3 {
  static [Pa](t, e) {
    if (S3.hasOwnProperty(t)) return S3[t](e);
  }
  static stylesheet(t) {
    return new oH(t);
  }
}
const lH = Ri.xdp.id;
class cH extends ct {
  constructor(t) {
    super(lH, "xdp", !0), this.uuid = t.uuid || "", this.timeStamp = t.timeStamp || "", this.config = null, this.connectionSet = null, this.datasets = null, this.localeSet = null, this.stylesheet = new U(), this.template = null;
  }
  [$b](t) {
    const e = Ri[t[Ce]];
    return e && t[Ii] === e.id;
  }
}
class C3 {
  static [Pa](t, e) {
    if (C3.hasOwnProperty(t)) return C3[t](e);
  }
  static xdp(t) {
    return new cH(t);
  }
}
const hH = Ri.xhtml.id, d5 = Symbol(), uH = /* @__PURE__ */ new Set(["color", "font", "font-family", "font-size", "font-stretch", "font-style", "font-weight", "margin", "margin-bottom", "margin-left", "margin-right", "margin-top", "letter-spacing", "line-height", "orphans", "page-break-after", "page-break-before", "page-break-inside", "tab-interval", "tab-stop", "text-align", "text-decoration", "text-indent", "vertical-align", "widows", "kerning-mode", "xfa-font-horizontal-scale", "xfa-font-vertical-scale", "xfa-spacerun", "xfa-tab-stops"]), dH = /* @__PURE__ */ new Map([["page-break-after", "breakAfter"], ["page-break-before", "breakBefore"], ["page-break-inside", "breakInside"], ["kerning-mode", (i) => i === "none" ? "none" : "normal"], ["xfa-font-horizontal-scale", (i) => `scaleX(${Math.max(0, parseInt(i) / 100).toFixed(2)})`], ["xfa-font-vertical-scale", (i) => `scaleY(${Math.max(0, parseInt(i) / 100).toFixed(2)})`], ["xfa-spacerun", ""], ["xfa-tab-stops", ""], ["font-size", (i, t) => Xt(0.99 * (i = t.fontSize = Math.abs(Rt(i))))], ["letter-spacing", (i) => Xt(Rt(i))], ["line-height", (i) => Xt(Rt(i))], ["margin", (i) => Xt(Rt(i))], ["margin-bottom", (i) => Xt(Rt(i))], ["margin-left", (i) => Xt(Rt(i))], ["margin-right", (i) => Xt(Rt(i))], ["margin-top", (i) => Xt(Rt(i))], ["text-indent", (i) => Xt(Rt(i))], ["font-family", (i) => i], ["vertical-align", (i) => Xt(Rt(i))]]), fH = /\s+/g, pH = /[\r\n]+/g, mH = /\r\n?/g;
function gH(i, t, e) {
  const n = /* @__PURE__ */ Object.create(null);
  if (!i) return n;
  const s = /* @__PURE__ */ Object.create(null);
  for (const [r, a] of i.split(";").map((o) => o.split(":", 2))) {
    const o = dH.get(r);
    if (o === "") continue;
    let l = a;
    o && (l = typeof o == "string" ? o : o(a, s)), r.endsWith("scale") ? n.transform = n.transform ? `${n[r]} ${l}` : l : n[r.replaceAll(/-([a-zA-Z])/g, (c, h) => h.toUpperCase())] = l;
  }
  if (n.fontFamily && hT({ typeface: n.fontFamily, weight: n.fontWeight || "normal", posture: n.fontStyle || "normal", size: s.fontSize || 0 }, t, t[ze].fontFinder, n), e && n.verticalAlign && n.verticalAlign !== "0px" && n.fontSize) {
    const o = Rt(n.fontSize);
    n.fontSize = Xt(o * 0.583), n.verticalAlign = Xt(Math.sign(Rt(n.verticalAlign)) * o * 0.333);
  }
  return e && n.fontSize && (n.fontSize = `calc(${n.fontSize} * var(--total-scale-factor))`), oT(n), n;
}
const bH = /* @__PURE__ */ new Set(["body", "html"]);
class hr extends Co {
  constructor(t, e) {
    super(hH, e), this[d5] = !1, this.style = t.style || "";
  }
  [Vr](t) {
    super[Vr](t), this.style = function(n) {
      return n.style ? n.style.split(";").filter((s) => !!s.trim()).map((s) => s.split(":", 2).map((r) => r.trim())).filter(([s, r]) => (s === "font-family" && n[ze].usedTypefaces.add(r), uH.has(s))).map((s) => s.join(":")).join(";") : "";
    }(this);
  }
  [N4]() {
    return !bH.has(this[Ce]);
  }
  [Ll](t, e = !1) {
    e ? this[d5] = !0 : (t = t.replaceAll(pH, ""), this.style.includes("xfa-spacerun:yes") || (t = t.replaceAll(fH, " "))), t && (this[mt] += t);
  }
  [Fo](t, e = !0) {
    const n = /* @__PURE__ */ Object.create(null), s = { top: NaN, bottom: NaN, left: NaN, right: NaN };
    let r = null;
    for (const [a, o] of this.style.split(";").map((l) => l.split(":", 2))) switch (a) {
      case "font-family":
        n.typeface = O4(o);
        break;
      case "font-size":
        n.size = Rt(o);
        break;
      case "font-weight":
        n.weight = o;
        break;
      case "font-style":
        n.posture = o;
        break;
      case "letter-spacing":
        n.letterSpacing = Rt(o);
        break;
      case "margin":
        const l = o.split(/ \t/).map((c) => Rt(c));
        switch (l.length) {
          case 1:
            s.top = s.bottom = s.left = s.right = l[0];
            break;
          case 2:
            s.top = s.bottom = l[0], s.left = s.right = l[1];
            break;
          case 3:
            s.top = l[0], s.bottom = l[2], s.left = s.right = l[1];
            break;
          case 4:
            s.top = l[0], s.left = l[1], s.bottom = l[2], s.right = l[3];
        }
        break;
      case "margin-top":
        s.top = Rt(o);
        break;
      case "margin-bottom":
        s.bottom = Rt(o);
        break;
      case "margin-left":
        s.left = Rt(o);
        break;
      case "margin-right":
        s.right = Rt(o);
        break;
      case "line-height":
        r = Rt(o);
    }
    if (t.pushData(n, s, r), this[mt]) t.addString(this[mt]);
    else for (const a of this[mn]()) a[Ce] !== "#text" ? a[Fo](t) : t.addString(a[mt]);
    e && t.popFont();
  }
  [Gt](t) {
    const e = [];
    if (this[ot] = { children: e }, this[f0]({}), e.length === 0 && !this[mt]) return $t.EMPTY;
    let n;
    return n = this[d5] ? this[mt] ? this[mt].replaceAll(mH, `
`) : void 0 : this[mt] || void 0, $t.success({ name: this[Ce], attributes: { href: this.href, style: gH(this.style, this, this[d5]) }, children: e, value: n });
  }
}
class yH extends hr {
  constructor(t) {
    super(t, "a"), this.href = uT(t.href) || "";
  }
}
class wH extends hr {
  constructor(t) {
    super(t, "b");
  }
  [Fo](t) {
    t.pushFont({ weight: "bold" }), super[Fo](t), t.popFont();
  }
}
class vH extends hr {
  constructor(t) {
    super(t, "body");
  }
  [Gt](t) {
    const e = super[Gt](t), { html: n } = e;
    return n ? (n.name = "div", n.attributes.class = ["xfaRich"], e) : $t.EMPTY;
  }
}
class _H extends hr {
  constructor(t) {
    super(t, "br");
  }
  [Wi]() {
    return `
`;
  }
  [Fo](t) {
    t.addString(`
`);
  }
  [Gt](t) {
    return $t.success({ name: "br" });
  }
}
class xH extends hr {
  constructor(t) {
    super(t, "html");
  }
  [Gt](t) {
    var n;
    const e = [];
    if (this[ot] = { children: e }, this[f0]({}), e.length === 0) return $t.success({ name: "div", attributes: { class: ["xfaRich"], style: {} }, value: this[mt] || "" });
    if (e.length === 1) {
      const s = e[0];
      if ((n = s.attributes) != null && n.class.includes("xfaRich")) return $t.success(s);
    }
    return $t.success({ name: "div", attributes: { class: ["xfaRich"], style: {} }, children: e });
  }
}
class kH extends hr {
  constructor(t) {
    super(t, "i");
  }
  [Fo](t) {
    t.pushFont({ posture: "italic" }), super[Fo](t), t.popFont();
  }
}
class AH extends hr {
  constructor(t) {
    super(t, "li");
  }
}
class SH extends hr {
  constructor(t) {
    super(t, "ol");
  }
}
class CH extends hr {
  constructor(t) {
    super(t, "p");
  }
  [Fo](t) {
    super[Fo](t, !1), t.addString(`
`), t.addPara(), t.popFont();
  }
  [Wi]() {
    return this[Jt]()[mn]().at(-1) === this ? super[Wi]() : super[Wi]() + `
`;
  }
}
let EH = class extends hr {
  constructor(t) {
    super(t, "span");
  }
};
class DH extends hr {
  constructor(t) {
    super(t, "sub");
  }
}
class TH extends hr {
  constructor(t) {
    super(t, "sup");
  }
}
class FH extends hr {
  constructor(t) {
    super(t, "ul");
  }
}
class cf {
  static [Pa](t, e) {
    if (cf.hasOwnProperty(t)) return cf[t](e);
  }
  static a(t) {
    return new yH(t);
  }
  static b(t) {
    return new wH(t);
  }
  static body(t) {
    return new vH(t);
  }
  static br(t) {
    return new _H(t);
  }
  static html(t) {
    return new xH(t);
  }
  static i(t) {
    return new kH(t);
  }
  static li(t) {
    return new AH(t);
  }
  static ol(t) {
    return new SH(t);
  }
  static p(t) {
    return new CH(t);
  }
  static span(t) {
    return new EH(t);
  }
  static sub(t) {
    return new DH(t);
  }
  static sup(t) {
    return new TH(t);
  }
  static ul(t) {
    return new FH(t);
  }
}
const kx = { config: v3, connection: _3, datasets: x3, localeSet: k3, signature: A3, stylesheet: S3, template: w3, xdp: C3, xhtml: cf };
class Ax {
  constructor(t) {
    this.namespaceId = t;
  }
  [Pa](t, e) {
    return new Co(this.namespaceId, t, e);
  }
}
class IH extends ct {
  constructor(t) {
    super(-1, "root", /* @__PURE__ */ Object.create(null)), this.element = null, this[cu] = t;
  }
  [So](t) {
    return this.element = t, !0;
  }
  [Ue]() {
    super[Ue](), this.element.template instanceof ww && (this[cu].set(ZD, this.element), this.element.template[_2](this[cu]), this.element.template[cu] = this[cu]);
  }
}
class MH extends ct {
  constructor() {
    super(-1, "", /* @__PURE__ */ Object.create(null));
  }
  [So](t) {
    return !1;
  }
}
class RH {
  constructor(t = null) {
    this._namespaceStack = [], this._nsAgnosticLevel = 0, this._namespacePrefixes = /* @__PURE__ */ new Map(), this._namespaces = /* @__PURE__ */ new Map(), this._nextNsId = Math.max(...Object.values(Ri).map(({ id: e }) => e)), this._currentNamespace = t || new Ax(++this._nextNsId);
  }
  buildRoot(t) {
    return new IH(t);
  }
  build({ nsPrefix: t, name: e, attributes: n, namespace: s, prefixes: r }) {
    const a = s !== null;
    if (a && (this._namespaceStack.push(this._currentNamespace), this._currentNamespace = this._searchNamespace(s)), r && this._addNamespacePrefix(r), n.hasOwnProperty(Ml)) {
      const c = kx.datasets, h = n[Ml];
      let u = null;
      for (const [f, d] of Object.entries(h))
        if (this._getNamespaceToUse(f) === c) {
          u = { xfa: d };
          break;
        }
      u ? n[Ml] = u : delete n[Ml];
    }
    const o = this._getNamespaceToUse(t), l = (o == null ? void 0 : o[Pa](e, n)) || new MH();
    return l[N2]() && this._nsAgnosticLevel++, (a || r || l[N2]()) && (l[C9] = { hasNamespace: a, prefixes: r, nsAgnostic: l[N2]() }), l;
  }
  isNsAgnostic() {
    return this._nsAgnosticLevel > 0;
  }
  _searchNamespace(t) {
    let e = this._namespaces.get(t);
    if (e) return e;
    for (const [n, { check: s }] of Object.entries(Ri)) if (s(t)) {
      if (e = kx[n], e)
        return this._namespaces.set(t, e), e;
      break;
    }
    return e = new Ax(++this._nextNsId), this._namespaces.set(t, e), e;
  }
  _addNamespacePrefix(t) {
    for (const { prefix: e, value: n } of t) {
      const s = this._searchNamespace(n);
      let r = this._namespacePrefixes.get(e);
      r || (r = [], this._namespacePrefixes.set(e, r)), r.push(s);
    }
  }
  _getNamespaceToUse(t) {
    if (!t) return this._currentNamespace;
    const e = this._namespacePrefixes.get(t);
    return (e == null ? void 0 : e.length) > 0 ? e.at(-1) : (H(`Unknown namespace prefix: ${t}.`), null);
  }
  clean(t) {
    const { hasNamespace: e, prefixes: n, nsAgnostic: s } = t;
    e && (this._currentNamespace = this._namespaceStack.pop()), n && n.forEach(({ prefix: r }) => {
      this._namespacePrefixes.get(r).pop();
    }), s && this._nsAgnosticLevel--;
  }
}
class E3 extends BD {
  constructor(t = null, e = !1) {
    super(), this._builder = new RH(t), this._stack = [], this._globalData = { usedTypefaces: /* @__PURE__ */ new Set() }, this._ids = /* @__PURE__ */ new Map(), this._current = this._builder.buildRoot(this._ids), this._errorCode = M2, this._whiteRegex = /^\s+$/, this._nbsps = /\xa0+/g, this._richText = e;
  }
  parse(t) {
    if (this.parseXml(t), this._errorCode === M2)
      return this._current[Ue](), this._current.element;
  }
  onText(t) {
    t = t.replace(this._nbsps, (e) => e.slice(1) + " "), this._richText || this._current[N4]() ? this._current[Ll](t, this._richText) : this._whiteRegex.test(t) || this._current[Ll](t.trim());
  }
  onCdata(t) {
    this._current[Ll](t);
  }
  _mkAttributes(t, e) {
    let n = null, s = null;
    const r = /* @__PURE__ */ Object.create({});
    for (const { name: a, value: o } of t) if (a === "xmlns") n ? H(`XFA - multiple namespace definition in <${e}>`) : n = o;
    else if (a.startsWith("xmlns:")) {
      const l = a.substring(6);
      s ?? (s = []), s.push({ prefix: l, value: o });
    } else {
      const l = a.indexOf(":");
      if (l === -1) r[a] = o;
      else {
        const c = r[Ml] ?? (r[Ml] = /* @__PURE__ */ Object.create(null)), [h, u] = [a.slice(0, l), a.slice(l + 1)];
        (c[h] || (c[h] = /* @__PURE__ */ Object.create(null)))[u] = o;
      }
    }
    return [n, s, r];
  }
  _getNameAndPrefix(t, e) {
    const n = t.indexOf(":");
    return n === -1 ? [t, null] : [t.substring(n + 1), e ? "" : t.substring(0, n)];
  }
  onBeginElement(t, e, n) {
    const [s, r, a] = this._mkAttributes(e, t), [o, l] = this._getNameAndPrefix(t, this._builder.isNsAgnostic()), c = this._builder.build({ nsPrefix: l, name: o, attributes: a, namespace: s, prefixes: r });
    c[ze] = this._globalData, n ? (c[Ue](), this._current[So](c) && c[qb](this._ids), c[Vr](this._builder)) : (this._stack.push(this._current), this._current = c);
  }
  onEndElement(t) {
    const e = this._current;
    if (e[ow]() && typeof e[mt] == "string") {
      const n = new E3();
      n._globalData = this._globalData;
      const s = n.parse(e[mt]);
      e[mt] = null, e[So](s);
    }
    e[Ue](), this._current = this._stack.pop(), this._current[So](e) && e[qb](this._ids), e[Vr](this._builder);
  }
  onError(t) {
    this._errorCode = t;
  }
}
class Fg {
  constructor(t) {
    try {
      this.root = new E3().parse(Fg._createDocument(t));
      const e = new z$(this.root);
      this.form = e.bind(), this.dataHandler = new U$(this.root, e.getData()), this.form[ze].template = this.form;
    } catch (e) {
      H(`XFA - an error occurred during parsing and binding: ${e}`);
    }
  }
  isValid() {
    return !(!this.root || !this.form);
  }
  _createPagesHelper() {
    const t = this.form[QD]();
    return new Promise((e, n) => {
      const s = () => {
        try {
          const r = t.next();
          r.done ? e(r.value) : setTimeout(s, 0);
        } catch (r) {
          n(r);
        }
      };
      setTimeout(s, 0);
    });
  }
  async _createPages() {
    try {
      this.pages = await this._createPagesHelper(), this.dims = this.pages.children.map((t) => {
        const { width: e, height: n } = t.attributes.style;
        return [0, 0, parseInt(e), parseInt(n)];
      });
    } catch (t) {
      H(`XFA - an error occurred during layout: ${t}`);
    }
  }
  getBoundingBox(t) {
    return this.dims[t];
  }
  async getNumPages() {
    return this.pages || await this._createPages(), this.dims.length;
  }
  setImages(t) {
    this.form[ze].images = t;
  }
  setFonts(t) {
    this.form[ze].fontFinder = new QL(t);
    const e = [];
    for (let n of this.form[ze].usedTypefaces)
      n = O4(n), this.form[ze].fontFinder.find(n) || e.push(n);
    return e.length > 0 ? e : null;
  }
  appendFonts(t, e) {
    this.form[ze].fontFinder.add(t, e);
  }
  async getPages() {
    this.pages || await this._createPages();
    const t = this.pages;
    return this.pages = null, t;
  }
  serializeData(t) {
    return this.dataHandler.serialize(t);
  }
  static _createDocument(t) {
    return t["/xdp:xdp"] ? Object.values(t).join("") : t["xdp:xdp"];
  }
  static getRichTextAsHtml(t) {
    if (!t || typeof t != "string") return null;
    try {
      let e = new E3(cf, !0).parse(t);
      if (!["body", "xhtml"].includes(e[Ce])) {
        const a = cf.body({});
        a[pi](e), e = a;
      }
      const n = e[Gt]();
      if (!n.success) return null;
      const { html: s } = n, { attributes: r } = s;
      return r && (r.class && (r.class = r.class.filter((a) => !a.startsWith("xfa"))), r.dir = "auto"), { html: s, str: e[Wi]() };
    } catch (e) {
      H(`XFA - an error occurred during parsing of rich text: ${e}`);
    }
    return null;
  }
}
class pc {
  static createGlobals(t) {
    return Promise.all([t.ensureCatalog("acroForm"), t.ensureDoc("xfaDatasets"), t.ensureCatalog("structTreeRoot"), t.ensureCatalog("baseUrl"), t.ensureCatalog("attachments"), t.ensureCatalog("globalColorSpaceCache")]).then(([e, n, s, r, a, o]) => ({ pdfManager: t, acroForm: e instanceof Z ? e : Z.empty, xfaDatasets: n, structTreeRoot: s, baseUrl: r, attachments: a, globalColorSpaceCache: o }), (e) => (H(`createGlobals: "${e}".`), null));
  }
  static async create(t, e, n, s, r, a, o) {
    const l = r ? await this._getPageIndex(t, e, n.pdfManager) : null;
    return n.pdfManager.ensure(this, "_create", [t, e, n, s, r, a, l, o]);
  }
  static _create(t, e, n, s, r = !1, a = null, o = null, l = null) {
    const c = t.fetchIfRef(e);
    if (!(c instanceof Z)) return;
    const { acroForm: h, pdfManager: u } = n, f = e instanceof Dt ? e.toString() : `annot_${s.createObjId()}`;
    let d = c.get("Subtype");
    d = d instanceof lt ? d.name : null;
    const p = { xref: t, ref: e, dict: c, subtype: d, id: f, annotationGlobals: n, collectFields: r, orphanFields: a, needAppearances: !r && h.get("NeedAppearances") === !0, pageIndex: o, evaluatorOptions: u.evaluatorOptions, pageRef: l };
    switch (d) {
      case "Link":
        return new $H(p);
      case "Text":
        return new OH(p);
      case "Widget":
        let g = Mr({ dict: c, key: "FT" });
        switch (g = g instanceof lt ? g.name : null, g) {
          case "Tx":
            return new PH(p);
          case "Btn":
            return new NH(p);
          case "Ch":
            return new LH(p);
          case "Sig":
            return new IT(p);
        }
        return H(`Unimplemented widget field type "${g}", falling back to base field type.`), new Ra(p);
      case "Popup":
        return new MT(p);
      case "FreeText":
        return new q6(p);
      case "Line":
        return new qH(p);
      case "Square":
        return new zH(p);
      case "Circle":
        return new UH(p);
      case "PolyLine":
        return new RT(p);
      case "Polygon":
        return new BT(p);
      case "Caret":
        return new HH(p);
      case "Ink":
        return new qf(p);
      case "Highlight":
        return new z6(p);
      case "Underline":
        return new jH(p);
      case "Squiggly":
        return new GH(p);
      case "StrikeOut":
        return new VH(p);
      case "Stamp":
        return new q0(p);
      case "FileAttachment":
        return new WH(p);
      default:
        return r || H(d ? `Unimplemented annotation type "${d}", falling back to base annotation.` : "Annotation is missing the required /Subtype."), new Mg(p);
    }
  }
  static async _getPageIndex(t, e, n) {
    try {
      const s = await t.fetchIfRefAsync(e);
      if (!(s instanceof Z)) return -1;
      const r = s.getRaw("P");
      if (r instanceof Dt) try {
        return await n.ensureCatalog("getPageIndex", [r]);
      } catch (o) {
        ue(`_getPageIndex -- not a valid page reference: "${o}".`);
      }
      if (s.has("Kids")) return -1;
      const a = await n.ensureDoc("numPages");
      for (let o = 0; o < a; o++) {
        const l = await n.getPage(o), c = await n.ensure(l, "annotations");
        for (const h of c) if (h instanceof Dt && o3(h, e)) return o;
      }
    } catch (s) {
      H(`_getPageIndex: "${s}".`);
    }
    return -1;
  }
  static generateImages(t, e, n) {
    if (!n)
      return H("generateImages: OffscreenCanvas is not supported, cannot save or print some annotations with images."), null;
    let s;
    for (const { bitmapId: r, bitmap: a } of t) a && (s || (s = /* @__PURE__ */ new Map()), s.set(r, q0.createImage(a, e)));
    return s;
  }
  static async saveNewAnnotations(t, e, n, s, r) {
    const a = t.xref;
    let o;
    const l = [], { isOffscreenCanvasSupported: c } = t.options;
    for (const h of n) if (!h.deleted) switch (h.annotationType) {
      case Xv:
        if (!o) {
          const f = new Z(a);
          f.set("BaseFont", lt.get("Helvetica")), f.set("Type", lt.get("Font")), f.set("Subtype", lt.get("Type1")), f.set("Encoding", lt.get("WinAnsiEncoding")), o = a.getNewTemporaryRef(), r.put(o, { data: f });
        }
        l.push(q6.createNewAnnotation(a, h, r, { evaluator: t, task: e, baseFontRef: o }));
        break;
      case Yv:
        h.quadPoints ? l.push(z6.createNewAnnotation(a, h, r)) : l.push(qf.createNewAnnotation(a, h, r));
        break;
      case Zv:
        l.push(qf.createNewAnnotation(a, h, r));
        break;
      case Kv:
        const u = c ? await (s == null ? void 0 : s.get(h.bitmapId)) : null;
        if (u != null && u.imageStream) {
          const { imageStream: f, smaskStream: d } = u;
          if (d) {
            const g = a.getNewTemporaryRef();
            r.put(g, { data: d }), f.dict.set("SMask", g);
          }
          const p = u.imageRef = a.getNewTemporaryRef();
          r.put(p, { data: f }), u.imageStream = u.smaskStream = null;
        }
        l.push(q0.createNewAnnotation(a, h, r, { image: u }));
        break;
      case Jv:
        l.push(q0.createNewAnnotation(a, h, r, {}));
    }
    return { annotations: await Promise.all(l) };
  }
  static async printNewAnnotations(t, e, n, s, r) {
    if (!s) return null;
    const { options: a, xref: o } = e, l = [];
    for (const c of s) if (!c.deleted) switch (c.annotationType) {
      case Xv:
        l.push(q6.createNewPrintAnnotation(t, o, c, { evaluator: e, task: n, evaluatorOptions: a }));
        break;
      case Yv:
        c.quadPoints ? l.push(z6.createNewPrintAnnotation(t, o, c, { evaluatorOptions: a })) : l.push(qf.createNewPrintAnnotation(t, o, c, { evaluatorOptions: a }));
        break;
      case Zv:
        l.push(qf.createNewPrintAnnotation(t, o, c, { evaluatorOptions: a }));
        break;
      case Kv:
        const h = a.isOffscreenCanvasSupported ? await (r == null ? void 0 : r.get(c.bitmapId)) : null;
        if (h != null && h.imageStream) {
          const { imageStream: u, smaskStream: f } = h;
          f && u.dict.set("SMask", f), h.imageRef = new tf(u, u.length), h.imageStream = h.smaskStream = null;
        }
        l.push(q0.createNewPrintAnnotation(t, o, c, { image: h, evaluatorOptions: a }));
        break;
      case Jv:
        l.push(q0.createNewPrintAnnotation(t, o, c, { evaluatorOptions: a }));
    }
    return Promise.all(l);
  }
}
function Fu(i, t = new Uint8ClampedArray(3)) {
  if (!Array.isArray(i)) return t;
  const e = t || new Uint8ClampedArray(3);
  switch (i.length) {
    case 0:
      return null;
    case 1:
      return Se.gray.getRgbItem(i, 0, e, 0), e;
    case 3:
      return Se.rgb.getRgbItem(i, 0, e, 0), e;
    case 4:
      return Se.cmyk.getRgbItem(i, 0, e, 0), e;
    default:
      return t;
  }
}
function Kn(i) {
  return Array.from(i, (t) => t / 255);
}
function Ig(i, t) {
  const e = i.getArray("QuadPoints");
  if (!cs(e, null) || e.length === 0 || e.length % 8 > 0) return null;
  const n = new Float32Array(e.length);
  for (let s = 0, r = e.length; s < r; s += 8) {
    const [a, o, l, c, h, u, f, d] = e.slice(s, s + 8), p = Math.min(a, l, h, f), g = Math.max(a, l, h, f), b = Math.min(o, c, u, d), y = Math.max(o, c, u, d);
    if (t !== null && (p < t[0] || g > t[2] || b < t[1] || y > t[3])) return null;
    n.set([p, y, g, y, p, b, g, b], s);
  }
  return n;
}
function Vb(i, t, e) {
  const n = new Float32Array([1 / 0, 1 / 0, -1 / 0, -1 / 0]);
  Ee.axialAlignedBoundingBox(t, e, n);
  const [s, r, a, o] = n;
  if (s === a || r === o) return [1, 0, 0, 1, i[0], i[1]];
  const l = (i[2] - i[0]) / (a - s), c = (i[3] - i[1]) / (o - r);
  return [l, 0, 0, c, i[0] - s * l, i[1] - r * c];
}
class Mg {
  constructor(t) {
    const { dict: e, xref: n, annotationGlobals: s, ref: r, orphanFields: a } = t, o = a == null ? void 0 : a.get(r);
    o && e.set("Parent", o), this.setTitle(e.get("T")), this.setContents(e.get("Contents")), this.setModificationDate(e.get("M")), this.setFlags(e.get("F")), this.setRectangle(e.getArray("Rect")), this.setColor(e.getArray("C")), this.setBorderStyle(e), this.setAppearance(e), this.setOptionalContent(e);
    const l = e.get("MK");
    this.setBorderAndBackgroundColors(l), this.setRotation(l, e), this.ref = t.ref instanceof Dt ? t.ref : null, this._streams = [], this.appearance && this._streams.push(this.appearance);
    const c = !!(this.flags & YR), h = !!(this.flags & KR);
    if (this.data = { annotationFlags: this.flags, borderStyle: this.borderStyle, color: this.color, backgroundColor: this.backgroundColor, borderColor: this.borderColor, rotation: this.rotation, contentsObj: this._contents, hasAppearance: !!this.appearance, id: t.id, modificationDate: this.modificationDate, rect: this.rectangle, subtype: t.subtype, hasOwnCanvas: !1, noRotate: !!(this.flags & XR), noHTML: c && h, isEditable: !1, structParent: -1 }, s.structTreeRoot) {
      let f = e.get("StructParent");
      this.data.structParent = f = Number.isInteger(f) && f >= 0 ? f : -1, s.structTreeRoot.addAnnotationIdToPage(t.pageRef, f);
    }
    if (t.collectFields) {
      const f = e.get("Kids");
      if (Array.isArray(f)) {
        const d = [];
        for (const p of f) p instanceof Dt && d.push(p.toString());
        d.length !== 0 && (this.data.kidIds = d);
      }
      this.data.actions = M4(n, e, dE), this.data.fieldName = this._constructFieldName(e), this.data.pageIndex = t.pageIndex;
    }
    const u = e.get("IT");
    u instanceof lt && (this.data.it = u.name), this._isOffscreenCanvasSupported = t.evaluatorOptions.isOffscreenCanvasSupported, this._fallbackFontDict = null, this._needAppearances = !1;
  }
  _hasFlag(t, e) {
    return !!(t & e);
  }
  _buildFlags(t, e) {
    let { flags: n } = this;
    return t === void 0 ? e === void 0 ? void 0 : e ? n & ~q1 : n & ~V0 | q1 : t ? (n |= q1, e ? n & ~D2 | V0 : n & ~V0 | D2) : (n &= -35, e ? n & ~q1 : n | q1);
  }
  _isViewable(t) {
    return !this._hasFlag(t, Wg) && !this._hasFlag(t, D2);
  }
  _isPrintable(t) {
    return this._hasFlag(t, q1) && !this._hasFlag(t, V0) && !this._hasFlag(t, Wg);
  }
  mustBeViewed(t, e) {
    var s;
    const n = (s = t == null ? void 0 : t.get(this.data.id)) == null ? void 0 : s.noView;
    return n !== void 0 ? !n : this.viewable && !this._hasFlag(this.flags, V0);
  }
  mustBePrinted(t) {
    var n;
    const e = (n = t == null ? void 0 : t.get(this.data.id)) == null ? void 0 : n.noPrint;
    return e !== void 0 ? !e : this.printable;
  }
  mustBeViewedWhenEditing(t, e = null) {
    return t ? !this.data.isEditable : !(e != null && e.has(this.data.id));
  }
  get viewable() {
    return this.data.quadPoints !== null && (this.flags === 0 || this._isViewable(this.flags));
  }
  get printable() {
    return this.data.quadPoints !== null && this.flags !== 0 && this._isPrintable(this.flags);
  }
  _parseStringHelper(t) {
    const e = typeof t == "string" ? xe(t) : "";
    return { str: e, dir: e && DD(e).dir === "rtl" ? "rtl" : "ltr" };
  }
  setDefaultAppearance(t) {
    const { dict: e, annotationGlobals: n } = t, s = Mr({ dict: e, key: "DA" }) || n.acroForm.get("DA");
    this._defaultAppearance = typeof s == "string" ? s : "", this.data.defaultAppearanceData = sw(this._defaultAppearance);
  }
  setTitle(t) {
    this._title = this._parseStringHelper(t);
  }
  setContents(t) {
    this._contents = this._parseStringHelper(t);
  }
  setModificationDate(t) {
    this.modificationDate = typeof t == "string" ? t : null;
  }
  setFlags(t) {
    this.flags = Number.isInteger(t) && t > 0 ? t : 0, this.flags & Wg && this.constructor.name !== "Annotation" && (this.flags ^= Wg);
  }
  hasFlag(t) {
    return this._hasFlag(this.flags, t);
  }
  setRectangle(t) {
    this.rectangle = Wl(t, [0, 0, 0, 0]);
  }
  setColor(t) {
    this.color = Fu(t);
  }
  setLineEndings(t) {
    if (this.lineEndings = ["None", "None"], Array.isArray(t) && t.length === 2) for (let e = 0; e < 2; e++) {
      const n = t[e];
      if (n instanceof lt) switch (n.name) {
        case "None":
          continue;
        case "Square":
        case "Circle":
        case "Diamond":
        case "OpenArrow":
        case "ClosedArrow":
        case "Butt":
        case "ROpenArrow":
        case "RClosedArrow":
        case "Slash":
          this.lineEndings[e] = n.name;
          continue;
      }
      H(`Ignoring invalid lineEnding: ${n}`);
    }
  }
  setRotation(t, e) {
    this.rotation = 0;
    let n = t instanceof Z ? t.get("R") || 0 : e.get("Rotate") || 0;
    Number.isInteger(n) && n !== 0 && (n %= 360, n < 0 && (n += 360), n % 90 == 0 && (this.rotation = n));
  }
  setBorderAndBackgroundColors(t) {
    t instanceof Z ? (this.borderColor = Fu(t.getArray("BC"), null), this.backgroundColor = Fu(t.getArray("BG"), null)) : this.borderColor = this.backgroundColor = null;
  }
  setBorderStyle(t) {
    if (this.borderStyle = new BH(), t instanceof Z) if (t.has("BS")) {
      const e = t.get("BS");
      if (e instanceof Z) {
        const n = e.get("Type");
        (!n || ki(n, "Border")) && (this.borderStyle.setWidth(e.get("W"), this.rectangle), this.borderStyle.setStyle(e.get("S")), this.borderStyle.setDashArray(e.getArray("D")));
      }
    } else if (t.has("Border")) {
      const e = t.getArray("Border");
      Array.isArray(e) && e.length >= 3 && (this.borderStyle.setHorizontalCornerRadius(e[0]), this.borderStyle.setVerticalCornerRadius(e[1]), this.borderStyle.setWidth(e[2], this.rectangle), e.length === 4 && this.borderStyle.setDashArray(e[3], !0));
    } else this.borderStyle.setWidth(0);
  }
  setAppearance(t) {
    this.appearance = null;
    const e = t.get("AP");
    if (!(e instanceof Z)) return;
    const n = e.get("N");
    if (n instanceof oe) {
      this.appearance = n;
      return;
    }
    if (!(n instanceof Z)) return;
    const s = t.get("AS");
    if (!(s instanceof lt && n.has(s.name))) return;
    const r = n.get(s.name);
    r instanceof oe && (this.appearance = r);
  }
  setOptionalContent(t) {
    this.oc = null;
    const e = t.get("OC");
    e instanceof lt ? H("setOptionalContent: Support for /Name-entry is not implemented.") : e instanceof Z && (this.oc = e);
  }
  async loadResources(t, e) {
    const n = await e.dict.getAsync("Resources");
    return n && await rf.load(n, t, n.xref), n;
  }
  async getOperatorList(t, e, n, s) {
    const { hasOwnCanvas: r, id: a, rect: o } = this.data;
    let l = this.appearance;
    const c = !!(r && n & G9);
    if (c && (this.width === 0 || this.height === 0))
      return this.data.hasOwnCanvas = !1, { opList: new Xn(), separateForm: !1, separateCanvas: !1 };
    if (!l) {
      if (!c) return { opList: new Xn(), separateForm: !1, separateCanvas: !1 };
      l = new fs(""), l.dict = new Z();
    }
    const h = l.dict, u = await this.loadResources(Q8, l), f = nb(h.getArray("BBox"), [0, 0, 1, 1]), d = i0(h.getArray("Matrix"), Fa), p = Vb(o, f, d), g = new Xn();
    let b;
    return this.oc && (b = await t.parseMarkedContentProps(this.oc, null)), b !== void 0 && g.addOp(ho, ["OC", b]), g.addOp(IE, [a, o, p, d, c]), await t.getOperatorList({ stream: l, task: e, resources: u, operatorList: g, fallbackFontDict: this._fallbackFontDict }), g.addOp(ME, []), b !== void 0 && g.addOp(Zd, []), this.reset(), { opList: g, separateForm: !1, separateCanvas: c };
  }
  async save(t, e, n, s) {
    return null;
  }
  get hasTextContent() {
    return !1;
  }
  async extractTextContent(t, e, n) {
    if (!this.appearance) return;
    const s = await this.loadResources(tb, this.appearance), r = [], a = [];
    let o = null;
    const l = { desiredSize: Math.Infinity, ready: !0, enqueue(c, h) {
      for (const u of c.items) u.str !== void 0 && (o || (o = u.transform.slice(-2)), a.push(u.str), u.hasEOL && (r.push(a.join("").trimEnd()), a.length = 0));
    } };
    if (await t.getTextContent({ stream: this.appearance, task: e, resources: s, includeMarkedContent: !0, keepWhiteSpace: !0, sink: l, viewBox: n }), this.reset(), a.length && r.push(a.join("").trimEnd()), r.length > 1 || r[0]) {
      const c = this.appearance.dict, h = nb(c.getArray("BBox"), null), u = i0(c.getArray("Matrix"), null);
      this.data.textPosition = this._transformPoint(o, h, u), this.data.textContent = r;
    }
  }
  _transformPoint(t, e, n) {
    const { rect: s } = this.data;
    e || (e = [0, 0, 1, 1]), n || (n = [1, 0, 0, 1, 0, 0]);
    const r = Vb(s, e, n);
    r[4] -= s[0], r[5] -= s[1];
    const a = t.slice();
    return Ee.applyTransform(a, r), Ee.applyTransform(a, n), a;
  }
  getFieldObject() {
    return this.data.kidIds ? { id: this.data.id, actions: this.data.actions, name: this.data.fieldName, strokeColor: this.data.borderColor, fillColor: this.data.backgroundColor, type: "", kidIds: this.data.kidIds, page: this.data.pageIndex, rotation: this.rotation } : null;
  }
  reset() {
    for (const t of this._streams) t.reset();
  }
  _constructFieldName(t) {
    if (!t.has("T") && !t.has("Parent"))
      return H("Unknown field name, falling back to empty field name."), "";
    if (!t.has("Parent")) return xe(t.get("T"));
    const e = [];
    t.has("T") && e.unshift(xe(t.get("T")));
    let n = t;
    const s = new $i();
    for (t.objId && s.put(t.objId); n.has("Parent") && (n = n.get("Parent"), !(!(n instanceof Z) || n.objId && s.has(n.objId))); )
      n.objId && s.put(n.objId), n.has("T") && e.unshift(xe(n.get("T")));
    return e.join(".");
  }
  get width() {
    return this.data.rect[2] - this.data.rect[0];
  }
  get height() {
    return this.data.rect[3] - this.data.rect[1];
  }
}
class BH {
  constructor() {
    this.width = 1, this.rawWidth = 1, this.style = t_, this.dashArray = [3], this.horizontalCornerRadius = 0, this.verticalCornerRadius = 0;
  }
  setWidth(t, e = [0, 0, 0, 0]) {
    if (t instanceof lt) this.width = 0;
    else if (typeof t == "number") {
      if (t > 0) {
        this.rawWidth = t;
        const n = (e[2] - e[0]) / 2, s = (e[3] - e[1]) / 2;
        n > 0 && s > 0 && (t > n || t > s) && (H(`AnnotationBorderStyle.setWidth - ignoring width: ${t}`), t = 1);
      }
      this.width = t;
    }
  }
  setStyle(t) {
    if (t instanceof lt) switch (t.name) {
      case "S":
        this.style = t_;
        break;
      case "D":
        this.style = lB;
        break;
      case "B":
        this.style = cB;
        break;
      case "I":
        this.style = hB;
        break;
      case "U":
        this.style = uB;
    }
  }
  setDashArray(t, e = !1) {
    if (Array.isArray(t)) {
      let n = !0, s = !0;
      for (const r of t) {
        if (!(+r >= 0)) {
          n = !1;
          break;
        }
        r > 0 && (s = !1);
      }
      t.length === 0 || n && !s ? (this.dashArray = t, e && this.setStyle(lt.get("D"))) : this.width = 0;
    } else t && (this.width = 0);
  }
  setHorizontalCornerRadius(t) {
    Number.isInteger(t) && (this.horizontalCornerRadius = t);
  }
  setVerticalCornerRadius(t) {
    Number.isInteger(t) && (this.verticalCornerRadius = t);
  }
}
class Ns extends Mg {
  constructor(t) {
    super(t);
    const { dict: e } = t;
    if (e.has("IRT")) {
      const s = e.getRaw("IRT");
      this.data.inReplyTo = s instanceof Dt ? s.toString() : null;
      const r = e.get("RT");
      this.data.replyType = r instanceof lt ? r.name : WR;
    }
    let n = null;
    if (this.data.replyType === uE) {
      const s = e.get("IRT");
      this.setTitle(s.get("T")), this.data.titleObj = this._title, this.setContents(s.get("Contents")), this.data.contentsObj = this._contents, s.has("CreationDate") ? (this.setCreationDate(s.get("CreationDate")), this.data.creationDate = this.creationDate) : this.data.creationDate = null, s.has("M") ? (this.setModificationDate(s.get("M")), this.data.modificationDate = this.modificationDate) : this.data.modificationDate = null, n = s.getRaw("Popup"), s.has("C") ? (this.setColor(s.getArray("C")), this.data.color = this.color) : this.data.color = null;
    } else
      this.data.titleObj = this._title, this.setCreationDate(e.get("CreationDate")), this.data.creationDate = this.creationDate, n = e.getRaw("Popup"), e.has("C") || (this.data.color = null);
    this.data.popupRef = n instanceof Dt ? n.toString() : null, e.has("RC") && (this.data.richText = Fg.getRichTextAsHtml(e.get("RC")));
  }
  setCreationDate(t) {
    this.creationDate = typeof t == "string" ? t : null;
  }
  _setDefaultAppearance({ xref: t, extra: e, strokeColor: n, fillColor: s, blendMode: r, strokeAlpha: a, fillAlpha: o, pointsCallback: l }) {
    const c = this.data.rect = [1 / 0, 1 / 0, -1 / 0, -1 / 0], h = ["q"];
    e && h.push(e), n && h.push(`${n[0]} ${n[1]} ${n[2]} RG`), s && h.push(`${s[0]} ${s[1]} ${s[2]} rg`);
    const u = this.data.quadPoints || Float32Array.from([this.rectangle[0], this.rectangle[3], this.rectangle[2], this.rectangle[3], this.rectangle[0], this.rectangle[1], this.rectangle[2], this.rectangle[1]]);
    for (let w = 0, _ = u.length; w < _; w += 8) {
      const x = l(h, u.subarray(w, w + 8));
      Ee.rectBoundingBox(...x, c);
    }
    h.push("Q");
    const f = new Z(t), d = new Z(t);
    d.set("Subtype", lt.get("Form"));
    const p = new fs(h.join(" "));
    p.dict = d, f.set("Fm0", p);
    const g = new Z(t);
    r && g.set("BM", lt.get(r)), typeof a == "number" && g.set("CA", a), typeof o == "number" && g.set("ca", o);
    const b = new Z(t);
    b.set("GS0", g);
    const y = new Z(t);
    y.set("ExtGState", b), y.set("XObject", f);
    const v = new Z(t);
    v.set("Resources", y), v.set("BBox", c), this.appearance = new fs("/GS0 gs /Fm0 Do"), this.appearance.dict = v, this._streams.push(this.appearance, p);
  }
  static async createNewAnnotation(t, e, n, s) {
    const r = e.ref || (e.ref = t.getNewTemporaryRef()), a = await this.createNewAppearanceStream(e, t, s);
    let o;
    if (a) {
      const l = t.getNewTemporaryRef();
      o = this.createNewDict(e, t, { apRef: l }), n.put(l, { data: a });
    } else o = this.createNewDict(e, t, {});
    return Number.isInteger(e.parentTreeId) && o.set("StructParent", e.parentTreeId), n.put(r, { data: o }), { ref: r };
  }
  static async createNewPrintAnnotation(t, e, n, s) {
    const r = await this.createNewAppearanceStream(n, e, s), a = this.createNewDict(n, e, r ? { ap: r } : {}), o = new this.prototype.constructor({ dict: a, xref: e, annotationGlobals: t, evaluatorOptions: s.evaluatorOptions });
    return n.ref && (o.ref = o.refToReplace = n.ref), o;
  }
}
class Ra extends Mg {
  constructor(t) {
    var f;
    super(t);
    const { dict: e, xref: n, annotationGlobals: s } = t, r = this.data;
    this._needAppearances = t.needAppearances, r.annotationType = VR, r.fieldName === void 0 && (r.fieldName = this._constructFieldName(e)), r.actions === void 0 && (r.actions = M4(n, e, dE));
    let a = Mr({ dict: e, key: "V", getArray: !0 });
    r.fieldValue = this._decodeFormValue(a);
    const o = Mr({ dict: e, key: "DV", getArray: !0 });
    if (r.defaultFieldValue = this._decodeFormValue(o), a === void 0 && s.xfaDatasets) {
      const d = this._title.str;
      d && (this._hasValueFromXFA = !0, r.fieldValue = a = s.xfaDatasets.getValue(d));
    }
    a === void 0 && r.defaultFieldValue !== null && (r.fieldValue = r.defaultFieldValue), r.alternativeText = xe(e.get("TU") || ""), this.setDefaultAppearance(t), r.hasAppearance || (r.hasAppearance = this._needAppearances && r.fieldValue !== void 0 && r.fieldValue !== null);
    const l = Mr({ dict: e, key: "FT" });
    r.fieldType = l instanceof lt ? l.name : null;
    const c = Mr({ dict: e, key: "DR" }), h = s.acroForm.get("DR"), u = (f = this.appearance) == null ? void 0 : f.dict.get("Resources");
    this._fieldResources = { localResources: c, acroFormResources: h, appearanceResources: u, mergedResources: Z.merge({ xref: n, dictArray: [c, u, h], mergeSubDicts: !0 }) }, r.fieldFlags = Mr({ dict: e, key: "Ff" }), (!Number.isInteger(r.fieldFlags) || r.fieldFlags < 0) && (r.fieldFlags = 0), r.password = this.hasFieldFlag(tB), r.readOnly = this.hasFieldFlag(ZR), r.required = this.hasFieldFlag(JR), r.hidden = this._hasFlag(r.annotationFlags, V0) || this._hasFlag(r.annotationFlags, D2);
  }
  _decodeFormValue(t) {
    return Array.isArray(t) ? t.filter((e) => typeof e == "string").map((e) => xe(e)) : t instanceof lt ? xe(t.name) : typeof t == "string" ? xe(t) : null;
  }
  hasFieldFlag(t) {
    return !!(this.data.fieldFlags & t);
  }
  _isViewable(t) {
    return !0;
  }
  mustBeViewed(t, e) {
    return e ? this.viewable : super.mustBeViewed(t, e) && !this._hasFlag(this.flags, D2);
  }
  getRotationMatrix(t) {
    var n;
    let e = (n = t == null ? void 0 : t.get(this.data.id)) == null ? void 0 : n.rotation;
    return e === void 0 && (e = this.rotation), e === 0 ? Fa : c3(e, this.width, this.height);
  }
  getBorderAndBackgroundAppearances(t) {
    var r;
    let e = (r = t == null ? void 0 : t.get(this.data.id)) == null ? void 0 : r.rotation;
    if (e === void 0 && (e = this.rotation), !this.backgroundColor && !this.borderColor) return "";
    const n = e === 0 || e === 180 ? `0 0 ${this.width} ${this.height} re` : `0 0 ${this.height} ${this.width} re`;
    let s = "";
    return this.backgroundColor && (s = `${Ao(this.backgroundColor, !0)} ${n} f `), this.borderColor && (s += `${this.borderStyle.width || 1} w ${Ao(this.borderColor, !1)} ${n} S `), s;
  }
  async getOperatorList(t, e, n, s) {
    if (n & cE && !(this instanceof IT) && !this.data.noHTML && !this.data.hasOwnCanvas) return { opList: new Xn(), separateForm: !0, separateCanvas: !1 };
    if (!this._hasText) return super.getOperatorList(t, e, n, s);
    const r = await this._getAppearance(t, e, n, s);
    if (this.appearance && r === null) return super.getOperatorList(t, e, n, s);
    const a = new Xn();
    if (!this._defaultAppearance || r === null) return { opList: a, separateForm: !1, separateCanvas: !1 };
    const o = !!(this.data.hasOwnCanvas && n & G9), l = [0, 0, this.width, this.height], c = Vb(this.data.rect, l, [1, 0, 0, 1, 0, 0]);
    let h;
    this.oc && (h = await t.parseMarkedContentProps(this.oc, null)), h !== void 0 && a.addOp(ho, ["OC", h]), a.addOp(IE, [this.data.id, this.data.rect, c, this.getRotationMatrix(s), o]);
    const u = new fs(r);
    return await t.getOperatorList({ stream: u, task: e, resources: this._fieldResources.mergedResources, operatorList: a }), a.addOp(ME, []), h !== void 0 && a.addOp(Zd, []), { opList: a, separateForm: !1, separateCanvas: o };
  }
  _getMKDict(t) {
    const e = new Z(null);
    return t && e.set("R", t), this.borderColor && e.set("BC", Kn(this.borderColor)), this.backgroundColor && e.set("BG", Kn(this.backgroundColor)), e.size > 0 ? e : null;
  }
  amendSavedDict(t, e) {
  }
  setValue(t, e, n, s) {
    const { dict: r, ref: a } = function(l, c, h) {
      const u = new $i(), f = l, d = { dict: null, ref: null };
      for (; l instanceof Z && !u.has(c) && (u.put(c), !l.has("T")); ) {
        if (!((c = l.getRaw("Parent")) instanceof Dt)) return d;
        l = h.fetch(c);
      }
      return l instanceof Z && l !== f && (d.dict = l, d.ref = c), d;
    }(t, this.ref, n);
    if (r) {
      if (!s.has(a)) {
        const o = r.clone();
        return o.set("V", e), s.put(a, { data: o }), o;
      }
    } else t.set("V", e);
    return null;
  }
  async save(t, e, n, s) {
    const r = n == null ? void 0 : n.get(this.data.id), a = this._buildFlags(r == null ? void 0 : r.noView, r == null ? void 0 : r.noPrint);
    let o = r == null ? void 0 : r.value, l = r == null ? void 0 : r.rotation;
    if (o === this.data.fieldValue || o === void 0) {
      if (!this._hasValueFromXFA && l === void 0 && a === void 0) return;
      o || (o = this.data.fieldValue);
    }
    if (l === void 0 && !this._hasValueFromXFA && Array.isArray(o) && Array.isArray(this.data.fieldValue) && sp(o, this.data.fieldValue) && a === void 0) return;
    l === void 0 && (l = this.rotation);
    let c = null;
    if (!this._needAppearances && (c = await this._getAppearance(t, e, Wv, n), c === null && a === void 0))
      return;
    let h = !1;
    c != null && c.needAppearances && (h = !0, c = null);
    const { xref: u } = t, f = u.fetchIfRef(this.ref);
    if (!(f instanceof Z)) return;
    const d = new Z(u);
    for (const y of f.getKeys()) y !== "AP" && d.set(y, f.getRaw(y));
    if (a !== void 0 && (d.set("F", a), c === null && !h)) {
      const y = f.getRaw("AP");
      y && d.set("AP", y);
    }
    const p = { path: this.data.fieldName, value: o }, g = this.setValue(d, Array.isArray(o) ? o.map(Rr) : Rr(o), u, s);
    this.amendSavedDict(n, g || d);
    const b = this._getMKDict(l);
    if (b && d.set("MK", b), s.put(this.ref, { data: d, xfa: p, needAppearances: h }), c !== null) {
      const y = u.getNewTemporaryRef(), v = new Z(u);
      d.set("AP", v), v.set("N", y);
      const w = this._getSaveFieldResources(u), _ = new fs(c), x = _.dict = new Z(u);
      x.set("Subtype", lt.get("Form")), x.set("Resources", w);
      const k = l % 180 == 0 ? [0, 0, this.width, this.height] : [0, 0, this.height, this.width];
      x.set("BBox", k);
      const S = this.getRotationMatrix(n);
      S !== Fa && x.set("Matrix", S), s.put(y, { data: _, xfa: null, needAppearances: !1 });
    }
    d.set("M", `D:${Vl()}`);
  }
  async _getAppearance(t, e, n, s) {
    if (this.data.password) return null;
    const r = s == null ? void 0 : s.get(this.data.id);
    let a, o;
    if (r && (a = r.formattedValue || r.value, o = r.rotation), o === void 0 && a === void 0 && !this._needAppearances && (!this._hasValueFromXFA || this.appearance)) return null;
    const l = this.getBorderAndBackgroundAppearances(s);
    if (a === void 0 && (a = this.data.fieldValue, !a))
      return `/Tx BMC q ${l}Q EMC`;
    if (Array.isArray(a) && a.length === 1 && (a = a[0]), pn(typeof a == "string", "Expected `value` to be a string."), a = a.trimEnd(), this.data.combo) {
      const S = this.data.options.find(({ exportValue: T }) => a === T);
      a = (S == null ? void 0 : S.displayValue) || a;
    }
    if (a === "") return `/Tx BMC q ${l}Q EMC`;
    o === void 0 && (o = this.rotation);
    let c, h = -1;
    this.data.multiLine ? (c = a.split(/\r\n?|\n/).map((S) => S.normalize("NFC")), h = c.length) : c = [a.replace(/\r\n?|\n/, "").normalize("NFC")];
    let { width: u, height: f } = this;
    o !== 90 && o !== 270 || ([u, f] = [f, u]), this._defaultAppearance || (this.data.defaultAppearanceData = sw(this._defaultAppearance = "/Helvetica 0 Tf 0 g"));
    let d, p, g, b = await Ra._getFontData(t, e, this.data.defaultAppearanceData, this._fieldResources.mergedResources);
    const y = [];
    let v = !1;
    for (const S of c) {
      const T = b.encodeString(S);
      T.length > 1 && (v = !0), y.push(T.join(""));
    }
    if (v && n & Wv) return { needAppearances: !0 };
    if (v && this._isOffscreenCanvasSupported) {
      const S = this.data.comb ? "monospace" : "sans-serif", T = new uo(t.xref, S), I = T.createFontResources(c.join("")), R = I.getRaw("Font");
      if (this._fieldResources.mergedResources.has("Font")) {
        const it = this._fieldResources.mergedResources.get("Font");
        for (const O of R.getKeys()) it.set(O, R.getRaw(O));
      } else this._fieldResources.mergedResources.set("Font", R);
      const B = T.fontName.name;
      b = await Ra._getFontData(t, e, { fontName: B, fontSize: 0 }, I);
      for (let it = 0, O = y.length; it < O; it++) y[it] = zE(c[it]);
      const L = Object.assign(/* @__PURE__ */ Object.create(null), this.data.defaultAppearanceData);
      this.data.defaultAppearanceData.fontSize = 0, this.data.defaultAppearanceData.fontName = B, [d, p, g] = this._computeFontSize(f - 2, u - 4, a, b, h), this.data.defaultAppearanceData = L;
    } else
      this._isOffscreenCanvasSupported || H("_getAppearance: OffscreenCanvas is not supported, annotation may not render correctly."), [d, p, g] = this._computeFontSize(f - 2, u - 4, a, b, h);
    let w = b.descent;
    w = isNaN(w) ? jv * g : Math.max(jv * g, Math.abs(w) * p);
    const _ = Math.min(Math.floor((f - p) / 2), 1), x = this.data.textAlignment;
    if (this.data.multiLine) return this._getMultilineAppearance(d, y, b, p, u, f, x, 2, _, w, g, s);
    if (this.data.comb) return this._getCombAppearance(d, b, y[0], p, u, f, 2, _, w, g, s);
    const k = _ + w;
    return x === 0 || x > 2 ? `/Tx BMC q ${l}BT ` + d + ` 1 0 0 1 ${be(2)} ${be(k)} Tm (${Qd(y[0])}) Tj ET Q EMC` : `/Tx BMC q ${l}BT ` + d + ` 1 0 0 1 0 0 Tm ${this._renderText(y[0], b, p, u, x, { shift: 0 }, 2, k)} ET Q EMC`;
  }
  static async _getFontData(t, e, n, s) {
    const r = new Xn(), a = { font: null, clone() {
      return this;
    } }, { fontName: o, fontSize: l } = n;
    return await t.handleSetFont(s, [o && lt.get(o), l], null, r, e, a, null), a.font;
  }
  _getTextWidth(t, e) {
    return Math.sumPrecise(e.charsToGlyphs(t).map((n) => n.width)) / 1e3;
  }
  _computeFontSize(t, e, n, s, r) {
    let { fontSize: a } = this.data.defaultAppearanceData, o = (a || 12) * p1, l = Math.round(t / o);
    if (!a) {
      const c = (f) => Math.floor(100 * f) / 100;
      if (r === -1) {
        const f = this._getTextWidth(n, s);
        a = c(Math.min(t / p1, e / f)), l = 1;
      } else {
        const f = n.split(/\r\n?|\n/), d = [];
        for (const g of f) {
          const b = s.encodeString(g).join(""), y = s.charsToGlyphs(b), v = s.getCharPositions(b);
          d.push({ line: b, glyphs: y, positions: v });
        }
        const p = (g) => {
          let b = 0;
          for (const y of d)
            if (b += this._splitLine(null, s, g, e, y).length * g, b > t) return !0;
          return !1;
        };
        for (l = Math.max(l, r); o = t / l, a = c(o / p1), !!p(a); )
          l++;
      }
      const { fontName: h, fontColor: u } = this.data.defaultAppearanceData;
      this._defaultAppearance = function({ fontSize: d, fontName: p, fontColor: g }) {
        return `/${Gy(p)} ${d} Tf ${Ao(g, !0)}`;
      }({ fontSize: a, fontName: h, fontColor: u });
    }
    return [this._defaultAppearance, a, t / l];
  }
  _renderText(t, e, n, s, r, a, o, l) {
    let c;
    r === 1 ? c = (s - this._getTextWidth(t, e) * n) / 2 : r === 2 ? c = s - this._getTextWidth(t, e) * n - o : c = o;
    const h = be(c - a.shift);
    return a.shift = c, `${h} ${l = be(l)} Td (${Qd(t)}) Tj`;
  }
  _getSaveFieldResources(t) {
    var a;
    const { localResources: e, appearanceResources: n, acroFormResources: s } = this._fieldResources, r = (a = this.data.defaultAppearanceData) == null ? void 0 : a.fontName;
    if (!r) return e || Z.empty;
    for (const o of [e, n]) if (o instanceof Z) {
      const l = o.get("Font");
      if (l instanceof Z && l.has(r)) return o;
    }
    if (s instanceof Z) {
      const o = s.get("Font");
      if (o instanceof Z && o.has(r)) {
        const l = new Z(t);
        l.set(r, o.getRaw(r));
        const c = new Z(t);
        return c.set("Font", l), Z.merge({ xref: t, dictArray: [c, e], mergeSubDicts: !0 });
      }
    }
    return e || Z.empty;
  }
  getFieldObject() {
    return null;
  }
}
class PH extends Ra {
  constructor(t) {
    super(t);
    const { dict: e } = t;
    e.has("PMD") && (this.flags |= V0, this.data.hidden = !0, H("Barcodes are not supported")), this.data.hasOwnCanvas = this.data.readOnly && !this.data.noHTML, this._hasText = !0, typeof this.data.fieldValue != "string" && (this.data.fieldValue = "");
    let n = Mr({ dict: e, key: "Q" });
    (!Number.isInteger(n) || n < 0 || n > 2) && (n = null), this.data.textAlignment = n;
    let s = Mr({ dict: e, key: "MaxLen" });
    (!Number.isInteger(s) || s < 0) && (s = 0), this.data.maxLen = s, this.data.multiLine = this.hasFieldFlag(QR), this.data.comb = this.hasFieldFlag(oB) && !this.data.multiLine && !this.data.password && !this.hasFieldFlag(sB) && this.data.maxLen !== 0, this.data.doNotScroll = this.hasFieldFlag(aB);
  }
  get hasTextContent() {
    return !!this.appearance && !this._needAppearances;
  }
  _getCombAppearance(t, e, n, s, r, a, o, l, c, h, u) {
    const f = r / this.data.maxLen, d = this.getBorderAndBackgroundAppearances(u), p = [], g = e.getCharPositions(n);
    for (const [y, v] of g) p.push(`(${Qd(n.substring(y, v))}) Tj`);
    const b = p.join(` ${be(f)} 0 Td `);
    return `/Tx BMC q ${d}BT ` + t + ` 1 0 0 1 ${be(o)} ${be(l + c)} Tm ${b} ET Q EMC`;
  }
  _getMultilineAppearance(t, e, n, s, r, a, o, l, c, h, u, f) {
    const d = [], p = r - 2 * l, g = { shift: 0 };
    for (let v = 0, w = e.length; v < w; v++) {
      const _ = e[v], x = this._splitLine(_, n, s, p);
      for (let k = 0, S = x.length; k < S; k++) {
        const T = x[k], I = v === 0 && k === 0 ? -c - (u - h) : -u;
        d.push(this._renderText(T, n, s, r, o, g, l, I));
      }
    }
    const b = this.getBorderAndBackgroundAppearances(f), y = d.join(`
`);
    return `/Tx BMC q ${b}BT ` + t + ` 1 0 0 1 0 ${be(a)} Tm ${y} ET Q EMC`;
  }
  _splitLine(t, e, n, s, r = {}) {
    t = r.line || t;
    const a = r.glyphs || e.charsToGlyphs(t);
    if (a.length <= 1) return [t];
    const o = r.positions || e.getCharPositions(t), l = n / 1e3, c = [];
    let h = -1, u = -1, f = -1, d = 0, p = 0;
    for (let g = 0, b = a.length; g < b; g++) {
      const [y, v] = o[g], w = a[g], _ = w.width * l;
      w.unicode === " " ? p + _ > s ? (c.push(t.substring(d, y)), d = y, p = _, h = -1, f = -1) : (p += _, h = y, u = v, f = g) : p + _ > s ? h !== -1 ? (c.push(t.substring(d, u)), d = u, g = f + 1, h = -1, p = 0) : (c.push(t.substring(d, y)), d = y, p = _) : p += _;
    }
    return d < t.length && c.push(t.substring(d, t.length)), c;
  }
  async extractTextContent(t, e, n) {
    await super.extractTextContent(t, e, n);
    const s = this.data.textContent;
    if (!s) return;
    const r = s.join(`
`);
    if (r === this.data.fieldValue) return;
    const a = r.replaceAll(/([.*+?^${}()|[\]\\])|(\s+)/g, (o, l) => l ? `\\${l}` : "\\s+");
    new RegExp(`^\\s*${a}\\s*$`).test(this.data.fieldValue) && (this.data.textContent = this.data.fieldValue.split(`
`));
  }
  getFieldObject() {
    return { id: this.data.id, value: this.data.fieldValue, defaultValue: this.data.defaultFieldValue || "", multiline: this.data.multiLine, password: this.data.password, charLimit: this.data.maxLen, comb: this.data.comb, editable: !this.data.readOnly, hidden: this.data.hidden, name: this.data.fieldName, rect: this.data.rect, actions: this.data.actions, page: this.data.pageIndex, strokeColor: this.data.borderColor, fillColor: this.data.backgroundColor, rotation: this.rotation, type: "text" };
  }
}
class NH extends Ra {
  constructor(t) {
    super(t), this.checkedAppearance = null, this.uncheckedAppearance = null;
    const e = this.hasFieldFlag(eB), n = this.hasFieldFlag(iB);
    this.data.checkBox = !e && !n, this.data.radioButton = e && !n, this.data.pushButton = n, this.data.isTooltipOnly = !1, this.data.checkBox ? this._processCheckBox(t) : this.data.radioButton ? this._processRadioButton(t) : this.data.pushButton ? (this.data.hasOwnCanvas = !0, this.data.noHTML = !1, this._processPushButton(t)) : H("Invalid field flags for button widget annotation");
  }
  async getOperatorList(t, e, n, s) {
    if (this.data.pushButton) return super.getOperatorList(t, e, n, !1, s);
    let r = null, a = null;
    if (s) {
      const l = s.get(this.data.id);
      r = l ? l.value : null, a = l ? l.rotation : null;
    }
    if (r === null && this.appearance) return super.getOperatorList(t, e, n, s);
    r == null && (r = this.data.checkBox ? this.data.fieldValue === this.data.exportValue : this.data.fieldValue === this.data.buttonValue);
    const o = r ? this.checkedAppearance : this.uncheckedAppearance;
    if (o) {
      const l = this.appearance, c = i0(o.dict.getArray("Matrix"), Fa);
      a && o.dict.set("Matrix", this.getRotationMatrix(s)), this.appearance = o;
      const h = super.getOperatorList(t, e, n, s);
      return this.appearance = l, o.dict.set("Matrix", c), h;
    }
    return { opList: new Xn(), separateForm: !1, separateCanvas: !1 };
  }
  async save(t, e, n, s) {
    this.data.checkBox ? this._saveCheckbox(t, e, n, s) : this.data.radioButton && this._saveRadioButton(t, e, n, s);
  }
  async _saveCheckbox(t, e, n, s) {
    if (!n) return;
    const r = n.get(this.data.id), a = this._buildFlags(r == null ? void 0 : r.noView, r == null ? void 0 : r.noPrint);
    let o = r == null ? void 0 : r.rotation, l = r == null ? void 0 : r.value;
    if (o === void 0 && a === void 0 && (l === void 0 || this.data.fieldValue === this.data.exportValue === l))
      return;
    let c = t.xref.fetchIfRef(this.ref);
    if (!(c instanceof Z)) return;
    c = c.clone(), o === void 0 && (o = this.rotation), l === void 0 && (l = this.data.fieldValue === this.data.exportValue);
    const h = { path: this.data.fieldName, value: l ? this.data.exportValue : "" }, u = lt.get(l ? this.data.exportValue : "Off");
    this.setValue(c, u, t.xref, s), c.set("AS", u), c.set("M", `D:${Vl()}`), a !== void 0 && c.set("F", a);
    const f = this._getMKDict(o);
    f && c.set("MK", f), s.put(this.ref, { data: c, xfa: h, needAppearances: !1 });
  }
  async _saveRadioButton(t, e, n, s) {
    if (!n) return;
    const r = n.get(this.data.id), a = this._buildFlags(r == null ? void 0 : r.noView, r == null ? void 0 : r.noPrint);
    let o = r == null ? void 0 : r.rotation, l = r == null ? void 0 : r.value;
    if (o === void 0 && a === void 0 && (l === void 0 || this.data.fieldValue === this.data.buttonValue === l))
      return;
    let c = t.xref.fetchIfRef(this.ref);
    if (!(c instanceof Z)) return;
    c = c.clone(), l === void 0 && (l = this.data.fieldValue === this.data.buttonValue), o === void 0 && (o = this.rotation);
    const h = { path: this.data.fieldName, value: l ? this.data.buttonValue : "" }, u = lt.get(l ? this.data.buttonValue : "Off");
    l && this.setValue(c, u, t.xref, s), c.set("AS", u), c.set("M", `D:${Vl()}`), a !== void 0 && c.set("F", a);
    const f = this._getMKDict(o);
    f && c.set("MK", f), s.put(this.ref, { data: c, xfa: h, needAppearances: !1 });
  }
  _getDefaultCheckedAppearance(t, e) {
    const { width: n, height: s } = this, r = [0, 0, n, s], a = 0.8 * Math.min(n, s);
    let o, l;
    e === "check" ? (o = { width: 0.755 * a, height: 0.705 * a }, l = "3") : e === "disc" ? (o = { width: 0.791 * a, height: 0.705 * a }, l = "l") : ye(`_getDefaultCheckedAppearance - unsupported type: ${e}`);
    const c = `q BT /PdfJsZaDb ${a} Tf 0 g ${be((n - o.width) / 2)} ${be((s - o.height) / 2)} Td (${l}) Tj ET Q`, h = new Z(t.xref);
    h.set("FormType", 1), h.set("Subtype", lt.get("Form")), h.set("Type", lt.get("XObject")), h.set("BBox", r), h.set("Matrix", [1, 0, 0, 1, 0, 0]), h.set("Length", c.length);
    const u = new Z(t.xref), f = new Z(t.xref);
    f.set("PdfJsZaDb", this.fallbackFontDict), u.set("Font", f), h.set("Resources", u), this.checkedAppearance = new fs(c), this.checkedAppearance.dict = h, this._streams.push(this.checkedAppearance);
  }
  _processCheckBox(t) {
    const e = t.dict.get("AP");
    if (!(e instanceof Z)) return;
    const n = e.get("N");
    if (!(n instanceof Z)) return;
    const s = this._decodeFormValue(t.dict.get("AS"));
    typeof s == "string" && (this.data.fieldValue = s);
    const r = this.data.fieldValue !== null && this.data.fieldValue !== "Off" ? this.data.fieldValue : "Yes", a = this._decodeFormValue(n.getKeys());
    if (a.length === 0) a.push("Off", r);
    else if (a.length === 1) a[0] === "Off" ? a.push(r) : a.unshift("Off");
    else if (a.includes(r))
      a.length = 0, a.push("Off", r);
    else {
      const c = a.find((h) => h !== "Off");
      a.length = 0, a.push("Off", c);
    }
    a.includes(this.data.fieldValue) || (this.data.fieldValue = "Off"), this.data.exportValue = a[1];
    const o = n.get(this.data.exportValue);
    this.checkedAppearance = o instanceof oe ? o : null;
    const l = n.get("Off");
    this.uncheckedAppearance = l instanceof oe ? l : null, this.checkedAppearance ? this._streams.push(this.checkedAppearance) : this._getDefaultCheckedAppearance(t, "check"), this.uncheckedAppearance && this._streams.push(this.uncheckedAppearance), this._fallbackFontDict = this.fallbackFontDict, this.data.defaultFieldValue === null && (this.data.defaultFieldValue = "Off");
  }
  _processRadioButton(t) {
    this.data.buttonValue = null;
    const e = t.dict.get("Parent");
    if (e instanceof Z) {
      this.parent = t.dict.getRaw("Parent");
      const o = e.get("V");
      o instanceof lt && (this.data.fieldValue = this._decodeFormValue(o));
    }
    const n = t.dict.get("AP");
    if (!(n instanceof Z)) return;
    const s = n.get("N");
    if (!(s instanceof Z)) return;
    for (const o of s.getKeys()) if (o !== "Off") {
      this.data.buttonValue = this._decodeFormValue(o);
      break;
    }
    const r = s.get(this.data.buttonValue);
    this.checkedAppearance = r instanceof oe ? r : null;
    const a = s.get("Off");
    this.uncheckedAppearance = a instanceof oe ? a : null, this.checkedAppearance ? this._streams.push(this.checkedAppearance) : this._getDefaultCheckedAppearance(t, "disc"), this.uncheckedAppearance && this._streams.push(this.uncheckedAppearance), this._fallbackFontDict = this.fallbackFontDict, this.data.defaultFieldValue === null && (this.data.defaultFieldValue = "Off");
  }
  _processPushButton(t) {
    const { dict: e, annotationGlobals: n } = t;
    e.has("A") || e.has("AA") || this.data.alternativeText ? (this.data.isTooltipOnly = !e.has("A") && !e.has("AA"), pp.parseDestDictionary({ destDict: e, resultObj: this.data, docBaseUrl: n.baseUrl, docAttachments: n.attachments })) : H("Push buttons without action dictionaries are not supported");
  }
  getFieldObject() {
    let t, e = "button";
    return this.data.checkBox ? (e = "checkbox", t = this.data.exportValue) : this.data.radioButton && (e = "radiobutton", t = this.data.buttonValue), { id: this.data.id, value: this.data.fieldValue || "Off", defaultValue: this.data.defaultFieldValue, exportValues: t, editable: !this.data.readOnly, name: this.data.fieldName, rect: this.data.rect, hidden: this.data.hidden, actions: this.data.actions, page: this.data.pageIndex, strokeColor: this.data.borderColor, fillColor: this.data.backgroundColor, rotation: this.rotation, type: e };
  }
  get fallbackFontDict() {
    const t = new Z();
    return t.set("BaseFont", lt.get("ZapfDingbats")), t.set("Type", lt.get("FallbackType")), t.set("Subtype", lt.get("FallbackType")), t.set("Encoding", lt.get("ZapfDingbatsEncoding")), At(this, "fallbackFontDict", t);
  }
}
class LH extends Ra {
  constructor(t) {
    var r;
    super(t);
    const { dict: e, xref: n } = t;
    this.indices = e.getArray("I"), this.hasIndices = Array.isArray(this.indices) && this.indices.length > 0, this.data.options = [];
    const s = Mr({ dict: e, key: "Opt" });
    if (Array.isArray(s)) for (let a = 0, o = s.length; a < o; a++) {
      const l = n.fetchIfRef(s[a]), c = Array.isArray(l);
      this.data.options[a] = { exportValue: this._decodeFormValue(c ? n.fetchIfRef(l[0]) : l), displayValue: this._decodeFormValue(c ? n.fetchIfRef(l[1]) : l) };
    }
    if (this.hasIndices) {
      this.data.fieldValue = [];
      const a = this.data.options.length;
      for (const o of this.indices) Number.isInteger(o) && o >= 0 && o < a && this.data.fieldValue.push(this.data.options[o].exportValue);
    } else typeof this.data.fieldValue == "string" ? this.data.fieldValue = [this.data.fieldValue] : (r = this.data).fieldValue || (r.fieldValue = []);
    this.data.options.length === 0 && this.data.fieldValue.length > 0 && (this.data.options = this.data.fieldValue.map((a) => ({ exportValue: a, displayValue: a }))), this.data.combo = this.hasFieldFlag(nB), this.data.multiSelect = this.hasFieldFlag(rB), this._hasText = !0;
  }
  getFieldObject() {
    const t = this.data.combo ? "combobox" : "listbox", e = this.data.fieldValue.length > 0 ? this.data.fieldValue[0] : null;
    return { id: this.data.id, value: e, defaultValue: this.data.defaultFieldValue, editable: !this.data.readOnly, name: this.data.fieldName, rect: this.data.rect, numItems: this.data.fieldValue.length, multipleSelection: this.data.multiSelect, hidden: this.data.hidden, actions: this.data.actions, items: this.data.options, page: this.data.pageIndex, strokeColor: this.data.borderColor, fillColor: this.data.backgroundColor, rotation: this.rotation, type: t };
  }
  amendSavedDict(t, e) {
    var a;
    if (!this.hasIndices) return;
    let n = (a = t == null ? void 0 : t.get(this.data.id)) == null ? void 0 : a.value;
    Array.isArray(n) || (n = [n]);
    const s = [], { options: r } = this.data;
    for (let o = 0, l = 0, c = r.length; o < c; o++) r[o].exportValue === n[l] && (s.push(o), l += 1);
    e.set("I", s);
  }
  async _getAppearance(t, e, n, s) {
    if (this.data.combo) return super._getAppearance(t, e, n, s);
    let r, a;
    const o = s == null ? void 0 : s.get(this.data.id);
    if (o && (a = o.rotation, r = o.value), a === void 0 && r === void 0 && !this._needAppearances) return null;
    r === void 0 ? r = this.data.fieldValue : Array.isArray(r) || (r = [r]);
    let { width: l, height: c } = this;
    a !== 90 && a !== 270 || ([l, c] = [c, l]);
    const h = this.data.options.length, u = [];
    for (let k = 0; k < h; k++) {
      const { exportValue: S } = this.data.options[k];
      r.includes(S) && u.push(k);
    }
    this._defaultAppearance || (this.data.defaultAppearanceData = sw(this._defaultAppearance = "/Helvetica 0 Tf 0 g"));
    const f = await Ra._getFontData(t, e, this.data.defaultAppearanceData, this._fieldResources.mergedResources);
    let d, { fontSize: p } = this.data.defaultAppearanceData;
    if (p) d = this._defaultAppearance;
    else {
      const k = (c - 1) / h;
      let S, T = -1;
      for (const { displayValue: I } of this.data.options) {
        const R = this._getTextWidth(I, f);
        R > T && (T = R, S = I);
      }
      [d, p] = this._computeFontSize(k, l - 4, S, f, -1);
    }
    const g = p * p1, b = (g - p) / 2, y = Math.floor(c / g);
    let v = 0;
    if (u.length > 0) {
      const k = Math.min(...u), S = Math.max(...u);
      v = Math.max(0, S - y + 1), v > k && (v = k);
    }
    const w = Math.min(v + y + 1, h), _ = ["/Tx BMC q", `1 1 ${l} ${c} re W n`];
    if (u.length) {
      _.push("0.600006 0.756866 0.854904 rg");
      for (const k of u) v <= k && k < w && _.push(`1 ${c - (k - v + 1) * g} ${l} ${g} re f`);
    }
    _.push("BT", d, `1 0 0 1 0 ${c} Tm`);
    const x = { shift: 0 };
    for (let k = v; k < w; k++) {
      const { displayValue: S } = this.data.options[k], T = k === v ? b : 0;
      _.push(this._renderText(S, f, p, l, 0, x, 2, -g + T));
    }
    return _.push("ET Q EMC"), _.join(`
`);
  }
}
class IT extends Ra {
  constructor(t) {
    super(t), this.data.fieldValue = null, this.data.hasOwnCanvas = this.data.noRotate, this.data.noHTML = !this.data.hasOwnCanvas;
  }
  getFieldObject() {
    return { id: this.data.id, value: null, page: this.data.pageIndex, type: "signature" };
  }
}
class OH extends Ns {
  constructor(t) {
    super(t), this.data.noRotate = !0, this.data.hasOwnCanvas = this.data.noRotate, this.data.noHTML = !1;
    const { dict: e } = t;
    this.data.annotationType = TR, this.data.hasAppearance ? this.data.name = "NoIcon" : (this.data.rect[1] = this.data.rect[3] - 22, this.data.rect[2] = this.data.rect[0] + 22, this.data.name = e.has("Name") ? e.get("Name").name : "Note"), e.has("State") ? (this.data.state = e.get("State") || null, this.data.stateModel = e.get("StateModel") || null) : (this.data.state = null, this.data.stateModel = null);
  }
}
class $H extends Mg {
  constructor(t) {
    var r;
    super(t);
    const { dict: e, annotationGlobals: n } = t;
    this.data.annotationType = FR, this.data.noHTML = !1;
    const s = Ig(e, this.rectangle);
    s && (this.data.quadPoints = s), (r = this.data).borderColor || (r.borderColor = this.data.color), pp.parseDestDictionary({ destDict: e, resultObj: this.data, docBaseUrl: n.baseUrl, docAttachments: n.attachments });
  }
}
class MT extends Mg {
  constructor(t) {
    super(t);
    const { dict: e } = t;
    this.data.annotationType = jR, this.data.noHTML = !1, this.width !== 0 && this.height !== 0 || (this.data.rect = null);
    let n = e.get("Parent");
    if (!n) {
      H("Popup annotation has a missing or invalid parent annotation.");
      return;
    }
    if (this.data.parentRect = Wl(n.getArray("Rect"), null), ki(n.get("RT"), uE) && (n = n.get("IRT")), n.has("M") ? (this.setModificationDate(n.get("M")), this.data.modificationDate = this.modificationDate) : this.data.modificationDate = null, n.has("C") ? (this.setColor(n.getArray("C")), this.data.color = this.color) : this.data.color = null, !this.viewable) {
      const s = n.get("F");
      this._isViewable(s) && this.setFlags(s);
    }
    this.setTitle(n.get("T")), this.data.titleObj = this._title, this.setContents(n.get("Contents")), this.data.contentsObj = this._contents, n.has("RC") && (this.data.richText = Fg.getRichTextAsHtml(n.get("RC"))), this.data.open = !!e.get("Open");
  }
}
class q6 extends Ns {
  constructor(t) {
    var r;
    super(t), this.data.hasOwnCanvas = this.data.noRotate, this.data.isEditable = !this.data.noHTML, this.data.noHTML = !1;
    const { annotationGlobals: e, evaluatorOptions: n, xref: s } = t;
    if (this.data.annotationType = IR, this.setDefaultAppearance(t), this._hasAppearance = !!this.appearance, this._hasAppearance) {
      const { fontColor: a, fontSize: o } = function(c, h, u, f) {
        return new HL(c, h, u, f).parse();
      }(this.appearance, n, s, e.globalColorSpaceCache);
      this.data.defaultAppearanceData.fontColor = a, this.data.defaultAppearanceData.fontSize = o || 10;
    } else {
      (r = this.data.defaultAppearanceData).fontSize || (r.fontSize = 10);
      const { fontColor: a, fontSize: o } = this.data.defaultAppearanceData;
      if (this._contents.str) {
        this.data.textContent = this._contents.str.split(/\r\n?|\n/).map((u) => u.trimEnd());
        const { coords: l, bbox: c, matrix: h } = uo.getFirstPositionInfo(this.rectangle, this.rotation, o);
        this.data.textPosition = this._transformPoint(l, c, h);
      }
      if (this._isOffscreenCanvasSupported) {
        const l = t.dict.get("CA"), c = new uo(s, "sans-serif");
        this.appearance = c.createAppearance(this._contents.str, this.rectangle, this.rotation, o, a, l), this._streams.push(this.appearance);
      } else H("FreeTextAnnotation: OffscreenCanvas is not supported, annotation may not render correctly.");
    }
  }
  get hasTextContent() {
    return this._hasAppearance;
  }
  static createNewDict(t, e, { apRef: n, ap: s }) {
    const { color: r, fontSize: a, oldAnnotation: o, rect: l, rotation: c, user: h, value: u } = t, f = o || new Z(e);
    f.set("Type", lt.get("Annot")), f.set("Subtype", lt.get("FreeText")), o ? (f.set("M", `D:${Vl()}`), f.delete("RC")) : f.set("CreationDate", `D:${Vl()}`), f.set("Rect", l);
    const d = `/Helv ${a} Tf ${Ao(r, !0)}`;
    if (f.set("DA", d), f.set("Contents", Rr(u)), f.set("F", 4), f.set("Border", [0, 0, 0]), f.set("Rotate", c), h && f.set("T", Rr(h)), n || s) {
      const p = new Z(e);
      f.set("AP", p), n ? p.set("N", n) : p.set("N", s);
    }
    return f;
  }
  static async createNewAppearanceStream(t, e, n) {
    const { baseFontRef: s, evaluator: r, task: a } = n, { color: o, fontSize: l, rect: c, rotation: h, value: u } = t, f = new Z(e), d = new Z(e);
    if (s) d.set("Helv", s);
    else {
      const Y = new Z(e);
      Y.set("BaseFont", lt.get("Helvetica")), Y.set("Type", lt.get("Font")), Y.set("Subtype", lt.get("Type1")), Y.set("Encoding", lt.get("WinAnsiEncoding")), d.set("Helv", Y);
    }
    f.set("Font", d);
    const p = await Ra._getFontData(r, a, { fontName: "Helv", fontSize: l }, f), [g, b, y, v] = c;
    let w = y - g, _ = v - b;
    h % 180 != 0 && ([w, _] = [_, w]);
    const x = u.split(`
`), k = l / 1e3;
    let S = -1 / 0;
    const T = [];
    for (let Y of x) {
      const et = p.encodeString(Y);
      if (et.length > 1) return null;
      Y = et.join(""), T.push(Y);
      let $ = 0;
      const dt = p.charsToGlyphs(Y);
      for (const tt of dt) $ += tt.width * k;
      S = Math.max(S, $);
    }
    let I = 1;
    S > w && (I = w / S);
    let R = 1;
    const B = p1 * l, L = 1 * l, it = B * x.length;
    it > _ && (R = _ / it);
    const O = l * Math.min(I, R);
    let at, W, q;
    switch (h) {
      case 0:
        q = [1, 0, 0, 1], W = [c[0], c[1], w, _], at = [c[0], c[3] - L];
        break;
      case 90:
        q = [0, 1, -1, 0], W = [c[1], -c[2], w, _], at = [c[1], -c[0] - L];
        break;
      case 180:
        q = [-1, 0, 0, -1], W = [-c[2], -c[3], w, _], at = [-c[2], -c[1] - L];
        break;
      case 270:
        q = [0, -1, 1, 0], W = [-c[3], c[0], w, _], at = [-c[3], c[2] - L];
    }
    const K = ["q", `${q.join(" ")} 0 0 cm`, `${W.join(" ")} re W n`, "BT", `${Ao(o, !0)}`, `0 Tc /Helv ${be(O)} Tf`];
    K.push(`${at.join(" ")} Td (${Qd(T[0])}) Tj`);
    const z = be(B);
    for (let Y = 1, et = T.length; Y < et; Y++) {
      const $ = T[Y];
      K.push(`0 -${z} Td (${Qd($)}) Tj`);
    }
    K.push("ET", "Q");
    const j = K.join(`
`), N = new Z(e);
    N.set("FormType", 1), N.set("Subtype", lt.get("Form")), N.set("Type", lt.get("XObject")), N.set("BBox", c), N.set("Resources", f), N.set("Matrix", [1, 0, 0, 1, -c[0], -c[1]]);
    const Q = new fs(j);
    return Q.dict = N, Q;
  }
}
class qH extends Ns {
  constructor(t) {
    super(t);
    const { dict: e, xref: n } = t;
    this.data.annotationType = MR, this.data.hasOwnCanvas = this.data.noRotate, this.data.noHTML = !1;
    const s = nb(e.getArray("L"), [0, 0, 0, 0]);
    if (this.data.lineCoordinates = Ee.normalizeRect(s), this.setLineEndings(e.getArray("LE")), this.data.lineEndings = this.lineEndings, !this.appearance) {
      const r = this.color ? Kn(this.color) : [0, 0, 0], a = e.get("CA"), o = Fu(e.getArray("IC"), null), l = o ? Kn(o) : null, c = l ? a : null, h = this.borderStyle.width || 1, u = 2 * h, f = [this.data.lineCoordinates[0] - u, this.data.lineCoordinates[1] - u, this.data.lineCoordinates[2] + u, this.data.lineCoordinates[3] + u];
      Ee.intersect(this.rectangle, f) || (this.rectangle = f), this._setDefaultAppearance({ xref: n, extra: `${h} w`, strokeColor: r, fillColor: l, strokeAlpha: a, fillAlpha: c, pointsCallback: (d, p) => (d.push(`${s[0]} ${s[1]} m`, `${s[2]} ${s[3]} l`, "S"), [p[0] - h, p[7] - h, p[2] + h, p[3] + h]) });
    }
  }
}
class zH extends Ns {
  constructor(t) {
    super(t);
    const { dict: e, xref: n } = t;
    if (this.data.annotationType = RR, this.data.hasOwnCanvas = this.data.noRotate, this.data.noHTML = !1, !this.appearance) {
      const s = this.color ? Kn(this.color) : [0, 0, 0], r = e.get("CA"), a = Fu(e.getArray("IC"), null), o = a ? Kn(a) : null, l = o ? r : null;
      if (this.borderStyle.width === 0 && !o) return;
      this._setDefaultAppearance({ xref: n, extra: `${this.borderStyle.width} w`, strokeColor: s, fillColor: o, strokeAlpha: r, fillAlpha: l, pointsCallback: (c, h) => {
        const u = h[4] + this.borderStyle.width / 2, f = h[5] + this.borderStyle.width / 2, d = h[6] - h[4] - this.borderStyle.width, p = h[3] - h[7] - this.borderStyle.width;
        return c.push(`${u} ${f} ${d} ${p} re`), o ? c.push("B") : c.push("S"), [h[0], h[7], h[2], h[3]];
      } });
    }
  }
}
class UH extends Ns {
  constructor(t) {
    super(t);
    const { dict: e, xref: n } = t;
    if (this.data.annotationType = BR, !this.appearance) {
      const s = this.color ? Kn(this.color) : [0, 0, 0], r = e.get("CA"), a = Fu(e.getArray("IC"), null), o = a ? Kn(a) : null, l = o ? r : null;
      if (this.borderStyle.width === 0 && !o) return;
      const c = 4 / 3 * Math.tan(Math.PI / 8);
      this._setDefaultAppearance({ xref: n, extra: `${this.borderStyle.width} w`, strokeColor: s, fillColor: o, strokeAlpha: r, fillAlpha: l, pointsCallback: (h, u) => {
        const f = u[0] + this.borderStyle.width / 2, d = u[1] - this.borderStyle.width / 2, p = u[6] - this.borderStyle.width / 2, g = u[7] + this.borderStyle.width / 2, b = f + (p - f) / 2, y = d + (g - d) / 2, v = (p - f) / 2 * c, w = (g - d) / 2 * c;
        return h.push(`${b} ${g} m`, `${b + v} ${g} ${p} ${y + w} ${p} ${y} c`, `${p} ${y - w} ${b + v} ${d} ${b} ${d} c`, `${b - v} ${d} ${f} ${y - w} ${f} ${y} c`, `${f} ${y + w} ${b - v} ${g} ${b} ${g} c`, "h"), o ? h.push("B") : h.push("S"), [u[0], u[7], u[2], u[3]];
      } });
    }
  }
}
class RT extends Ns {
  constructor(t) {
    super(t);
    const { dict: e, xref: n } = t;
    this.data.annotationType = NR, this.data.hasOwnCanvas = this.data.noRotate, this.data.noHTML = !1, this.data.vertices = null, this instanceof BT || (this.setLineEndings(e.getArray("LE")), this.data.lineEndings = this.lineEndings);
    const s = e.getArray("Vertices");
    if (!cs(s, null)) return;
    const r = this.data.vertices = Float32Array.from(s);
    if (!this.appearance) {
      const a = this.color ? Kn(this.color) : [0, 0, 0], o = e.get("CA"), l = this.borderStyle.width || 1, c = 2 * l, h = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
      for (let u = 0, f = r.length; u < f; u += 2) Ee.rectBoundingBox(r[u] - c, r[u + 1] - c, r[u] + c, r[u + 1] + c, h);
      Ee.intersect(this.rectangle, h) || (this.rectangle = h), this._setDefaultAppearance({ xref: n, extra: `${l} w`, strokeColor: a, strokeAlpha: o, pointsCallback: (u, f) => {
        for (let d = 0, p = r.length; d < p; d += 2) u.push(`${r[d]} ${r[d + 1]} ${d === 0 ? "m" : "l"}`);
        return u.push("S"), [f[0], f[7], f[2], f[3]];
      } });
    }
  }
}
class BT extends RT {
  constructor(t) {
    super(t), this.data.annotationType = PR;
  }
}
class HH extends Ns {
  constructor(t) {
    super(t), this.data.annotationType = UR;
  }
}
class qf extends Ns {
  constructor(t) {
    super(t), this.data.hasOwnCanvas = this.data.noRotate, this.data.noHTML = !1;
    const { dict: e, xref: n } = t;
    this.data.annotationType = HR, this.data.inkLists = [], this.data.isEditable = !this.data.noHTML, this.data.noHTML = !1, this.data.opacity = e.get("CA") || 1;
    const s = e.getArray("InkList");
    if (Array.isArray(s)) {
      for (let r = 0, a = s.length; r < a; ++r) {
        if (!Array.isArray(s[r])) continue;
        const o = new Float32Array(s[r].length);
        this.data.inkLists.push(o);
        for (let l = 0, c = s[r].length; l < c; l += 2) {
          const h = n.fetchIfRef(s[r][l]), u = n.fetchIfRef(s[r][l + 1]);
          typeof h == "number" && typeof u == "number" && (o[l] = h, o[l + 1] = u);
        }
      }
      if (!this.appearance) {
        const r = this.color ? Kn(this.color) : [0, 0, 0], a = e.get("CA"), o = this.borderStyle.width || 1, l = 2 * o, c = [1 / 0, 1 / 0, -1 / 0, -1 / 0];
        for (const h of this.data.inkLists) for (let u = 0, f = h.length; u < f; u += 2) Ee.rectBoundingBox(h[u] - l, h[u + 1] - l, h[u] + l, h[u + 1] + l, c);
        Ee.intersect(this.rectangle, c) || (this.rectangle = c), this._setDefaultAppearance({ xref: n, extra: `${o} w`, strokeColor: r, strokeAlpha: a, pointsCallback: (h, u) => {
          for (const f of this.data.inkLists) {
            for (let d = 0, p = f.length; d < p; d += 2) h.push(`${f[d]} ${f[d + 1]} ${d === 0 ? "m" : "l"}`);
            h.push("S");
          }
          return [u[0], u[7], u[2], u[3]];
        } });
      }
    }
  }
  static createNewDict(t, e, { apRef: n, ap: s }) {
    const { oldAnnotation: r, color: a, opacity: o, paths: l, outlines: c, rect: h, rotation: u, thickness: f, user: d } = t, p = r || new Z(e);
    p.set("Type", lt.get("Annot")), p.set("Subtype", lt.get("Ink")), p.set(r ? "M" : "CreationDate", `D:${Vl()}`), p.set("Rect", h), p.set("InkList", (c == null ? void 0 : c.points) || l.points), p.set("F", 4), p.set("Rotate", u), d && p.set("T", Rr(d)), c && p.set("IT", lt.get("InkHighlight"));
    const g = new Z(e);
    p.set("BS", g), g.set("W", f), p.set("C", Kn(a)), p.set("CA", o);
    const b = new Z(e);
    return p.set("AP", b), n ? b.set("N", n) : b.set("N", s), p;
  }
  static async createNewAppearanceStream(t, e, n) {
    if (t.outlines) return this.createNewAppearanceStreamForHighlight(t, e, n);
    const { color: s, rect: r, paths: a, thickness: o, opacity: l } = t, c = [`${o} w 1 J 1 j`, `${Ao(s, !1)}`];
    l !== 1 && c.push("/R0 gs");
    for (const d of a.lines) {
      c.push(`${be(d[4])} ${be(d[5])} m`);
      for (let p = 6, g = d.length; p < g; p += 6) if (isNaN(d[p])) c.push(`${be(d[p + 4])} ${be(d[p + 5])} l`);
      else {
        const [b, y, v, w, _, x] = d.slice(p, p + 6);
        c.push([b, y, v, w, _, x].map(be).join(" ") + " c");
      }
      d.length === 6 && c.push(`${be(d[4])} ${be(d[5])} l`);
    }
    c.push("S");
    const h = c.join(`
`), u = new Z(e);
    if (u.set("FormType", 1), u.set("Subtype", lt.get("Form")), u.set("Type", lt.get("XObject")), u.set("BBox", r), u.set("Length", h.length), l !== 1) {
      const d = new Z(e), p = new Z(e), g = new Z(e);
      g.set("CA", l), g.set("Type", lt.get("ExtGState")), p.set("R0", g), d.set("ExtGState", p), u.set("Resources", d);
    }
    const f = new fs(h);
    return f.dict = u, f;
  }
  static async createNewAppearanceStreamForHighlight(t, e, n) {
    const { color: s, rect: r, outlines: { outline: a }, opacity: o } = t, l = [`${Ao(s, !0)}`, "/R0 gs"];
    l.push(`${be(a[4])} ${be(a[5])} m`);
    for (let g = 6, b = a.length; g < b; g += 6) if (isNaN(a[g])) l.push(`${be(a[g + 4])} ${be(a[g + 5])} l`);
    else {
      const [y, v, w, _, x, k] = a.slice(g, g + 6);
      l.push([y, v, w, _, x, k].map(be).join(" ") + " c");
    }
    l.push("h f");
    const c = l.join(`
`), h = new Z(e);
    h.set("FormType", 1), h.set("Subtype", lt.get("Form")), h.set("Type", lt.get("XObject")), h.set("BBox", r), h.set("Length", c.length);
    const u = new Z(e), f = new Z(e);
    u.set("ExtGState", f), h.set("Resources", u);
    const d = new Z(e);
    f.set("R0", d), d.set("BM", lt.get("Multiply")), o !== 1 && (d.set("ca", o), d.set("Type", lt.get("ExtGState")));
    const p = new fs(c);
    return p.dict = h, p;
  }
}
class z6 extends Ns {
  constructor(t) {
    var s;
    super(t);
    const { dict: e, xref: n } = t;
    if (this.data.annotationType = LR, this.data.isEditable = !this.data.noHTML, this.data.noHTML = !1, this.data.opacity = e.get("CA") || 1, this.data.quadPoints = Ig(e, null)) {
      const r = (s = this.appearance) == null ? void 0 : s.dict.get("Resources");
      if (!this.appearance || !(r != null && r.has("ExtGState"))) {
        this.appearance && H("HighlightAnnotation - ignoring built-in appearance stream.");
        const a = this.color ? Kn(this.color) : [1, 1, 0], o = e.get("CA");
        this._setDefaultAppearance({ xref: n, fillColor: a, blendMode: "Multiply", fillAlpha: o, pointsCallback: (l, c) => (l.push(`${c[0]} ${c[1]} m`, `${c[2]} ${c[3]} l`, `${c[6]} ${c[7]} l`, `${c[4]} ${c[5]} l`, "f"), [c[0], c[7], c[2], c[3]]) });
      }
    } else this.data.popupRef = null;
  }
  static createNewDict(t, e, { apRef: n, ap: s }) {
    const { color: r, oldAnnotation: a, opacity: o, rect: l, rotation: c, user: h, quadPoints: u } = t, f = a || new Z(e);
    if (f.set("Type", lt.get("Annot")), f.set("Subtype", lt.get("Highlight")), f.set(a ? "M" : "CreationDate", `D:${Vl()}`), f.set("CreationDate", `D:${Vl()}`), f.set("Rect", l), f.set("F", 4), f.set("Border", [0, 0, 0]), f.set("Rotate", c), f.set("QuadPoints", u), f.set("C", Kn(r)), f.set("CA", o), h && f.set("T", Rr(h)), n || s) {
      const d = new Z(e);
      f.set("AP", d), d.set("N", n || s);
    }
    return f;
  }
  static async createNewAppearanceStream(t, e, n) {
    const { color: s, rect: r, outlines: a, opacity: o } = t, l = [`${Ao(s, !0)}`, "/R0 gs"], c = [];
    for (const b of a) {
      c.length = 0, c.push(`${be(b[0])} ${be(b[1])} m`);
      for (let y = 2, v = b.length; y < v; y += 2) c.push(`${be(b[y])} ${be(b[y + 1])} l`);
      c.push("h"), l.push(c.join(`
`));
    }
    l.push("f*");
    const h = l.join(`
`), u = new Z(e);
    u.set("FormType", 1), u.set("Subtype", lt.get("Form")), u.set("Type", lt.get("XObject")), u.set("BBox", r), u.set("Length", h.length);
    const f = new Z(e), d = new Z(e);
    f.set("ExtGState", d), u.set("Resources", f);
    const p = new Z(e);
    d.set("R0", p), p.set("BM", lt.get("Multiply")), o !== 1 && (p.set("ca", o), p.set("Type", lt.get("ExtGState")));
    const g = new fs(h);
    return g.dict = u, g;
  }
}
class jH extends Ns {
  constructor(t) {
    super(t);
    const { dict: e, xref: n } = t;
    if (this.data.annotationType = OR, this.data.quadPoints = Ig(e, null)) {
      if (!this.appearance) {
        const s = this.color ? Kn(this.color) : [0, 0, 0], r = e.get("CA");
        this._setDefaultAppearance({ xref: n, extra: "[] 0 d 0.571 w", strokeColor: s, strokeAlpha: r, pointsCallback: (a, o) => (a.push(`${o[4]} ${o[5] + 1.3} m`, `${o[6]} ${o[7] + 1.3} l`, "S"), [o[0], o[7], o[2], o[3]]) });
      }
    } else this.data.popupRef = null;
  }
}
class GH extends Ns {
  constructor(t) {
    super(t);
    const { dict: e, xref: n } = t;
    if (this.data.annotationType = $R, this.data.quadPoints = Ig(e, null)) {
      if (!this.appearance) {
        const s = this.color ? Kn(this.color) : [0, 0, 0], r = e.get("CA");
        this._setDefaultAppearance({ xref: n, extra: "[] 0 d 1 w", strokeColor: s, strokeAlpha: r, pointsCallback: (a, o) => {
          const l = (o[1] - o[5]) / 6;
          let c = l, h = o[4];
          const u = o[5], f = o[6];
          a.push(`${h} ${u + c} m`);
          do
            h += 2, c = c === 0 ? l : 0, a.push(`${h} ${u + c} l`);
          while (h < f);
          return a.push("S"), [o[4], u - 2 * l, f, u + 2 * l];
        } });
      }
    } else this.data.popupRef = null;
  }
}
class VH extends Ns {
  constructor(t) {
    super(t);
    const { dict: e, xref: n } = t;
    if (this.data.annotationType = qR, this.data.quadPoints = Ig(e, null)) {
      if (!this.appearance) {
        const s = this.color ? Kn(this.color) : [0, 0, 0], r = e.get("CA");
        this._setDefaultAppearance({ xref: n, extra: "[] 0 d 1 w", strokeColor: s, strokeAlpha: r, pointsCallback: (a, o) => (a.push((o[0] + o[4]) / 2 + " " + (o[1] + o[5]) / 2 + " m", (o[2] + o[6]) / 2 + " " + (o[3] + o[7]) / 2 + " l", "S"), [o[0], o[7], o[2], o[3]]) });
      }
    } else this.data.popupRef = null;
  }
}
var d1, w4, PT;
class q0 extends Ns {
  constructor(e) {
    super(e);
    F(this, d1, null);
    this.data.annotationType = zR, this.data.hasOwnCanvas = this.data.noRotate, this.data.isEditable = !this.data.noHTML, this.data.noHTML = !1;
  }
  mustBeViewedWhenEditing(e, n = null) {
    return e ? (this.data.isEditable && (m(this, d1) ?? E(this, d1, this.data.hasOwnCanvas), this.data.hasOwnCanvas = !0), !0) : (m(this, d1) !== null && (this.data.hasOwnCanvas = m(this, d1), E(this, d1, null)), !(n != null && n.has(this.data.id)));
  }
  static async createImage(e, n) {
    const { width: s, height: r } = e, a = new OffscreenCanvas(s, r), o = a.getContext("2d", { alpha: !0 });
    o.drawImage(e, 0, 0);
    const l = o.getImageData(0, 0, s, r).data, c = new Uint32Array(l.buffer), h = c.some(Rs.isLittleEndian ? (b) => b >>> 24 != 255 : (b) => !!(255 & ~b));
    h && (o.fillStyle = "white", o.fillRect(0, 0, s, r), o.drawImage(e, 0, 0));
    const u = a.convertToBlob({ type: "image/jpeg", quality: 1 }).then((b) => b.arrayBuffer()), f = lt.get("XObject"), d = lt.get("Image"), p = new Z(n);
    p.set("Type", f), p.set("Subtype", d), p.set("BitsPerComponent", 8), p.set("ColorSpace", lt.get("DeviceRGB")), p.set("Filter", lt.get("DCTDecode")), p.set("BBox", [0, 0, s, r]), p.set("Width", s), p.set("Height", r);
    let g = null;
    if (h) {
      const b = new Uint8Array(c.length);
      if (Rs.isLittleEndian) for (let v = 0, w = c.length; v < w; v++) b[v] = c[v] >>> 24;
      else for (let v = 0, w = c.length; v < w; v++) b[v] = 255 & c[v];
      const y = new Z(n);
      y.set("Type", f), y.set("Subtype", d), y.set("BitsPerComponent", 8), y.set("ColorSpace", lt.get("DeviceGray")), y.set("Width", s), y.set("Height", r), g = new gi(b, 0, 0, y);
    }
    return { imageStream: new gi(await u, 0, 0, p), smaskStream: g, width: s, height: r };
  }
  static createNewDict(e, n, { apRef: s, ap: r }) {
    const { oldAnnotation: a, rect: o, rotation: l, user: c } = e, h = a || new Z(n);
    if (h.set("Type", lt.get("Annot")), h.set("Subtype", lt.get("Stamp")), h.set(a ? "M" : "CreationDate", `D:${Vl()}`), h.set("Rect", o), h.set("F", 4), h.set("Border", [0, 0, 0]), h.set("Rotate", l), c && h.set("T", Rr(c)), s || r) {
      const u = new Z(n);
      h.set("AP", u), s ? u.set("N", s) : u.set("N", r);
    }
    return h;
  }
  static async createNewAppearanceStream(e, n, s) {
    if (e.oldAnnotation) return null;
    if (e.isSignature) return D(this, w4, PT).call(this, e, n);
    const { rotation: r } = e, { imageRef: a, width: o, height: l } = s.image, c = new Z(n), h = new Z(n);
    c.set("XObject", h), h.set("Im0", a);
    const u = `q ${o} 0 0 ${l} 0 0 cm /Im0 Do Q`, f = new Z(n);
    if (f.set("FormType", 1), f.set("Subtype", lt.get("Form")), f.set("Type", lt.get("XObject")), f.set("BBox", [0, 0, o, l]), f.set("Resources", c), r) {
      const p = c3(r, o, l);
      f.set("Matrix", p);
    }
    const d = new fs(u);
    return d.dict = f, d;
  }
}
d1 = new WeakMap(), w4 = new WeakSet(), PT = async function(e, n) {
  const { areContours: s, color: r, rect: a, lines: o, thickness: l } = e, c = [`${l} w 1 J 1 j`, `${Ao(r, s)}`];
  for (const d of o) {
    c.push(`${be(d[4])} ${be(d[5])} m`);
    for (let p = 6, g = d.length; p < g; p += 6) if (isNaN(d[p])) c.push(`${be(d[p + 4])} ${be(d[p + 5])} l`);
    else {
      const [b, y, v, w, _, x] = d.slice(p, p + 6);
      c.push([b, y, v, w, _, x].map(be).join(" ") + " c");
    }
    d.length === 6 && c.push(`${be(d[4])} ${be(d[5])} l`);
  }
  c.push(s ? "F" : "S");
  const h = c.join(`
`), u = new Z(n);
  u.set("FormType", 1), u.set("Subtype", lt.get("Form")), u.set("Type", lt.get("XObject")), u.set("BBox", a), u.set("Length", h.length);
  const f = new fs(h);
  return f.dict = u, f;
}, F(q0, w4);
class WH extends Ns {
  constructor(t) {
    super(t);
    const { dict: e, xref: n } = t, s = new Fb(e.get("FS"), n);
    this.data.annotationType = GR, this.data.hasOwnCanvas = this.data.noRotate, this.data.noHTML = !1, this.data.file = s.serializable;
    const r = e.get("Name");
    this.data.name = r instanceof lt ? xe(r.name) : "PushPin";
    const a = e.get("ca");
    this.data.fillAlpha = typeof a == "number" && a >= 0 && a <= 1 ? a : null;
  }
}
const XH = { get r() {
  return At(this, "r", new Uint8Array([7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21]));
}, get k() {
  return At(this, "k", new Int32Array([-680876936, -389564586, 606105819, -1044525330, -176418897, 1200080426, -1473231341, -45705983, 1770035416, -1958414417, -42063, -1990404162, 1804603682, -40341101, -1502002290, 1236535329, -165796510, -1069501632, 643717713, -373897302, -701558691, 38016083, -660478335, -405537848, 568446438, -1019803690, -187363961, 1163531501, -1444681467, -51403784, 1735328473, -1926607734, -378558, -2022574463, 1839030562, -35309556, -1530992060, 1272893353, -155497632, -1094730640, 681279174, -358537222, -722521979, 76029189, -640364487, -421815835, 530742520, -995338651, -198630844, 1126891415, -1416354905, -57434055, 1700485571, -1894986606, -1051523, -2054922799, 1873313359, -30611744, -1560198380, 1309151649, -145523070, -1120210379, 718787259, -343485551]));
} };
function hc(i, t, e) {
  let n = 1732584193, s = -271733879, r = -1732584194, a = 271733878;
  const o = e + 72 & -64, l = new Uint8Array(o);
  let c, h;
  for (c = 0; c < e; ++c) l[c] = i[t++];
  l[c++] = 128;
  const u = o - 8;
  c < u && (c = u), l[c++] = e << 3 & 255, l[c++] = e >> 5 & 255, l[c++] = e >> 13 & 255, l[c++] = e >> 21 & 255, l[c++] = e >>> 29 & 255, c += 3;
  const f = new Int32Array(16), { k: d, r: p } = XH;
  for (c = 0; c < o; ) {
    for (h = 0; h < 16; ++h, c += 4) f[h] = l[c] | l[c + 1] << 8 | l[c + 2] << 16 | l[c + 3] << 24;
    let g, b, y = n, v = s, w = r, _ = a;
    for (h = 0; h < 64; ++h) {
      h < 16 ? (g = v & w | ~v & _, b = h) : h < 32 ? (g = _ & v | ~_ & w, b = 5 * h + 1 & 15) : h < 48 ? (g = v ^ w ^ _, b = 3 * h + 5 & 15) : (g = w ^ (v | ~_), b = 7 * h & 15);
      const x = _, k = y + g + d[h] + f[b] | 0, S = p[h];
      _ = w, w = v, v = v + (k << S | k >>> 32 - S) | 0, y = x;
    }
    n = n + y | 0, s = s + v | 0, r = r + w | 0, a = a + _ | 0;
  }
  return new Uint8Array([255 & n, n >> 8 & 255, n >> 16 & 255, n >>> 24 & 255, 255 & s, s >> 8 & 255, s >> 16 & 255, s >>> 24 & 255, 255 & r, r >> 8 & 255, r >> 16 & 255, r >>> 24 & 255, 255 & a, a >> 8 & 255, a >> 16 & 255, a >>> 24 & 255]);
}
function Sx(i) {
  try {
    return np(i);
  } catch (t) {
    return H(`UTF-8 decoding failed: "${t}".`), i;
  }
}
class YH extends P4 {
  constructor(t) {
    super(t), this.node = null;
  }
  onEndElement(t) {
    const e = super.onEndElement(t);
    if (e && t === "xfa:datasets")
      throw this.node = e, new Error("Aborting DatasetXMLParser.");
  }
}
class KH {
  constructor(t) {
    if (t.datasets) this.node = new P4({ hasAttributes: !0 }).parseFromString(t.datasets).documentElement;
    else {
      const e = new YH({ hasAttributes: !0 });
      try {
        e.parseFromString(t["xdp:xdp"]);
      } catch {
      }
      this.node = e.node;
    }
  }
  getValue(t) {
    if (!this.node || !t) return "";
    const e = this.node.searchNode(OE(t), 0);
    if (!e) return "";
    const n = e.firstChild;
    return (n == null ? void 0 : n.nodeName) === "value" ? e.children.map((s) => Sx(s.textContent)) : Sx(e.textContent);
  }
}
class Et {
  constructor(t, e) {
    this.high = 0 | t, this.low = 0 | e;
  }
  and(t) {
    this.high &= t.high, this.low &= t.low;
  }
  xor(t) {
    this.high ^= t.high, this.low ^= t.low;
  }
  shiftRight(t) {
    t >= 32 ? (this.low = this.high >>> t - 32 | 0, this.high = 0) : (this.low = this.low >>> t | this.high << 32 - t, this.high = this.high >>> t | 0);
  }
  rotateRight(t) {
    let e, n;
    32 & t ? (n = this.low, e = this.high) : (e = this.low, n = this.high), t &= 31, this.low = e >>> t | n << 32 - t, this.high = n >>> t | e << 32 - t;
  }
  not() {
    this.high = ~this.high, this.low = ~this.low;
  }
  add(t) {
    const e = (this.low >>> 0) + (t.low >>> 0);
    let n = (this.high >>> 0) + (t.high >>> 0);
    e > 4294967295 && (n += 1), this.low = 0 | e, this.high = 0 | n;
  }
  copyTo(t, e) {
    t[e] = this.high >>> 24 & 255, t[e + 1] = this.high >> 16 & 255, t[e + 2] = this.high >> 8 & 255, t[e + 3] = 255 & this.high, t[e + 4] = this.low >>> 24 & 255, t[e + 5] = this.low >> 16 & 255, t[e + 6] = this.low >> 8 & 255, t[e + 7] = 255 & this.low;
  }
  assign(t) {
    this.high = t.high, this.low = t.low;
  }
}
const ZH = { get k() {
  return At(this, "k", [new Et(1116352408, 3609767458), new Et(1899447441, 602891725), new Et(3049323471, 3964484399), new Et(3921009573, 2173295548), new Et(961987163, 4081628472), new Et(1508970993, 3053834265), new Et(2453635748, 2937671579), new Et(2870763221, 3664609560), new Et(3624381080, 2734883394), new Et(310598401, 1164996542), new Et(607225278, 1323610764), new Et(1426881987, 3590304994), new Et(1925078388, 4068182383), new Et(2162078206, 991336113), new Et(2614888103, 633803317), new Et(3248222580, 3479774868), new Et(3835390401, 2666613458), new Et(4022224774, 944711139), new Et(264347078, 2341262773), new Et(604807628, 2007800933), new Et(770255983, 1495990901), new Et(1249150122, 1856431235), new Et(1555081692, 3175218132), new Et(1996064986, 2198950837), new Et(2554220882, 3999719339), new Et(2821834349, 766784016), new Et(2952996808, 2566594879), new Et(3210313671, 3203337956), new Et(3336571891, 1034457026), new Et(3584528711, 2466948901), new Et(113926993, 3758326383), new Et(338241895, 168717936), new Et(666307205, 1188179964), new Et(773529912, 1546045734), new Et(1294757372, 1522805485), new Et(1396182291, 2643833823), new Et(1695183700, 2343527390), new Et(1986661051, 1014477480), new Et(2177026350, 1206759142), new Et(2456956037, 344077627), new Et(2730485921, 1290863460), new Et(2820302411, 3158454273), new Et(3259730800, 3505952657), new Et(3345764771, 106217008), new Et(3516065817, 3606008344), new Et(3600352804, 1432725776), new Et(4094571909, 1467031594), new Et(275423344, 851169720), new Et(430227734, 3100823752), new Et(506948616, 1363258195), new Et(659060556, 3750685593), new Et(883997877, 3785050280), new Et(958139571, 3318307427), new Et(1322822218, 3812723403), new Et(1537002063, 2003034995), new Et(1747873779, 3602036899), new Et(1955562222, 1575990012), new Et(2024104815, 1125592928), new Et(2227730452, 2716904306), new Et(2361852424, 442776044), new Et(2428436474, 593698344), new Et(2756734187, 3733110249), new Et(3204031479, 2999351573), new Et(3329325298, 3815920427), new Et(3391569614, 3928383900), new Et(3515267271, 566280711), new Et(3940187606, 3454069534), new Et(4118630271, 4000239992), new Et(116418474, 1914138554), new Et(174292421, 2731055270), new Et(289380356, 3203993006), new Et(460393269, 320620315), new Et(685471733, 587496836), new Et(852142971, 1086792851), new Et(1017036298, 365543100), new Et(1126000580, 2618297676), new Et(1288033470, 3409855158), new Et(1501505948, 4234509866), new Et(1607167915, 987167468), new Et(1816402316, 1246189591)]);
} };
function JH(i, t, e, n, s) {
  i.assign(t), i.and(e), s.assign(t), s.not(), s.and(n), i.xor(s);
}
function QH(i, t, e, n, s) {
  i.assign(t), i.and(e), s.assign(t), s.and(n), i.xor(s), s.assign(e), s.and(n), i.xor(s);
}
function tj(i, t, e) {
  i.assign(t), i.rotateRight(28), e.assign(t), e.rotateRight(34), i.xor(e), e.assign(t), e.rotateRight(39), i.xor(e);
}
function ej(i, t, e) {
  i.assign(t), i.rotateRight(14), e.assign(t), e.rotateRight(18), i.xor(e), e.assign(t), e.rotateRight(41), i.xor(e);
}
function ij(i, t, e) {
  i.assign(t), i.rotateRight(1), e.assign(t), e.rotateRight(8), i.xor(e), e.assign(t), e.shiftRight(7), i.xor(e);
}
function nj(i, t, e) {
  i.assign(t), i.rotateRight(19), e.assign(t), e.rotateRight(61), i.xor(e), e.assign(t), e.shiftRight(6), i.xor(e);
}
function Cx(i, t, e, n = !1) {
  let s, r, a, o, l, c, h, u;
  n ? (s = new Et(3418070365, 3238371032), r = new Et(1654270250, 914150663), a = new Et(2438529370, 812702999), o = new Et(355462360, 4144912697), l = new Et(1731405415, 4290775857), c = new Et(2394180231, 1750603025), h = new Et(3675008525, 1694076839), u = new Et(1203062813, 3204075428)) : (s = new Et(1779033703, 4089235720), r = new Et(3144134277, 2227873595), a = new Et(1013904242, 4271175723), o = new Et(2773480762, 1595750129), l = new Et(1359893119, 2917565137), c = new Et(2600822924, 725511199), h = new Et(528734635, 4215389547), u = new Et(1541459225, 327033209));
  const f = 128 * Math.ceil((e + 17) / 128), d = new Uint8Array(f);
  let p, g;
  for (p = 0; p < e; ++p) d[p] = i[t++];
  d[p++] = 128;
  const b = f - 16;
  p < b && (p = b), p += 11, d[p++] = e >>> 29 & 255, d[p++] = e >> 21 & 255, d[p++] = e >> 13 & 255, d[p++] = e >> 5 & 255, d[p++] = e << 3 & 255;
  const y = new Array(80);
  for (p = 0; p < 80; p++) y[p] = new Et(0, 0);
  const { k: v } = ZH;
  let w = new Et(0, 0), _ = new Et(0, 0), x = new Et(0, 0), k = new Et(0, 0), S = new Et(0, 0), T = new Et(0, 0), I = new Et(0, 0), R = new Et(0, 0);
  const B = new Et(0, 0), L = new Et(0, 0), it = new Et(0, 0), O = new Et(0, 0);
  let at, W;
  for (p = 0; p < f; ) {
    for (g = 0; g < 16; ++g)
      y[g].high = d[p] << 24 | d[p + 1] << 16 | d[p + 2] << 8 | d[p + 3], y[g].low = d[p + 4] << 24 | d[p + 5] << 16 | d[p + 6] << 8 | d[p + 7], p += 8;
    for (g = 16; g < 80; ++g)
      at = y[g], nj(at, y[g - 2], O), at.add(y[g - 7]), ij(it, y[g - 15], O), at.add(it), at.add(y[g - 16]);
    for (w.assign(s), _.assign(r), x.assign(a), k.assign(o), S.assign(l), T.assign(c), I.assign(h), R.assign(u), g = 0; g < 80; ++g)
      B.assign(R), ej(it, S, O), B.add(it), JH(it, S, T, I, O), B.add(it), B.add(v[g]), B.add(y[g]), tj(L, w, O), QH(it, w, _, x, O), L.add(it), at = R, R = I, I = T, T = S, k.add(B), S = k, k = x, x = _, _ = w, at.assign(B), at.add(L), w = at;
    s.add(w), r.add(_), a.add(x), o.add(k), l.add(S), c.add(T), h.add(I), u.add(R);
  }
  return n ? (W = new Uint8Array(48), s.copyTo(W, 0), r.copyTo(W, 8), a.copyTo(W, 16), o.copyTo(W, 24), l.copyTo(W, 32), c.copyTo(W, 40)) : (W = new Uint8Array(64), s.copyTo(W, 0), r.copyTo(W, 8), a.copyTo(W, 16), o.copyTo(W, 24), l.copyTo(W, 32), c.copyTo(W, 40), h.copyTo(W, 48), u.copyTo(W, 56)), W;
}
const sj = { get k() {
  return At(this, "k", [1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298]);
} };
function Eo(i, t) {
  return i >>> t | i << 32 - t;
}
function rj(i, t, e) {
  return i & t ^ ~i & e;
}
function aj(i, t, e) {
  return i & t ^ i & e ^ t & e;
}
function oj(i) {
  return Eo(i, 2) ^ Eo(i, 13) ^ Eo(i, 22);
}
function lj(i) {
  return Eo(i, 6) ^ Eo(i, 11) ^ Eo(i, 25);
}
function cj(i) {
  return Eo(i, 7) ^ Eo(i, 18) ^ i >>> 3;
}
function Wb(i, t, e) {
  let n = 1779033703, s = 3144134277, r = 1013904242, a = 2773480762, o = 1359893119, l = 2600822924, c = 528734635, h = 1541459225;
  const u = 64 * Math.ceil((e + 9) / 64), f = new Uint8Array(u);
  let d, p;
  for (d = 0; d < e; ++d) f[d] = i[t++];
  f[d++] = 128;
  const g = u - 8;
  d < g && (d = g), d += 3, f[d++] = e >>> 29 & 255, f[d++] = e >> 21 & 255, f[d++] = e >> 13 & 255, f[d++] = e >> 5 & 255, f[d++] = e << 3 & 255;
  const b = new Uint32Array(64), { k: y } = sj;
  for (d = 0; d < u; ) {
    for (p = 0; p < 16; ++p)
      b[p] = f[d] << 24 | f[d + 1] << 16 | f[d + 2] << 8 | f[d + 3], d += 4;
    for (p = 16; p < 64; ++p) b[p] = (Eo(v = b[p - 2], 17) ^ Eo(v, 19) ^ v >>> 10) + b[p - 7] + cj(b[p - 15]) + b[p - 16] | 0;
    let w, _, x = n, k = s, S = r, T = a, I = o, R = l, B = c, L = h;
    for (p = 0; p < 64; ++p)
      w = L + lj(I) + rj(I, R, B) + y[p] + b[p], _ = oj(x) + aj(x, k, S), L = B, B = R, R = I, I = T + w | 0, T = S, S = k, k = x, x = w + _ | 0;
    n = n + x | 0, s = s + k | 0, r = r + S | 0, a = a + T | 0, o = o + I | 0, l = l + R | 0, c = c + B | 0, h = h + L | 0;
  }
  var v;
  return new Uint8Array([n >> 24 & 255, n >> 16 & 255, n >> 8 & 255, 255 & n, s >> 24 & 255, s >> 16 & 255, s >> 8 & 255, 255 & s, r >> 24 & 255, r >> 16 & 255, r >> 8 & 255, 255 & r, a >> 24 & 255, a >> 16 & 255, a >> 8 & 255, 255 & a, o >> 24 & 255, o >> 16 & 255, o >> 8 & 255, 255 & o, l >> 24 & 255, l >> 16 & 255, l >> 8 & 255, 255 & l, c >> 24 & 255, c >> 16 & 255, c >> 8 & 255, 255 & c, h >> 24 & 255, h >> 16 & 255, h >> 8 & 255, 255 & h]);
}
class hj extends ps {
  constructor(t, e, n) {
    super(e), this.str = t, this.dict = t.dict, this.decrypt = n, this.nextChunk = null, this.initialized = !1;
  }
  readBlock() {
    var r;
    let t;
    if (this.initialized ? t = this.nextChunk : (t = this.str.getBytes(512), this.initialized = !0), !(t != null && t.length)) {
      this.eof = !0;
      return;
    }
    this.nextChunk = this.str.getBytes(512);
    const e = ((r = this.nextChunk) == null ? void 0 : r.length) > 0;
    t = (0, this.decrypt)(t, !e);
    const n = this.bufferLength, s = n + t.length;
    this.ensureBuffer(s).set(t, n), this.bufferLength = s;
  }
}
class F0 {
  constructor(t) {
    this.a = 0, this.b = 0;
    const e = new Uint8Array(256), n = t.length;
    for (let s = 0; s < 256; ++s) e[s] = s;
    for (let s = 0, r = 0; s < 256; ++s) {
      const a = e[s];
      r = r + a + t[s % n] & 255, e[s] = e[r], e[r] = a;
    }
    this.s = e;
  }
  encryptBlock(t) {
    let e = this.a, n = this.b;
    const s = this.s, r = t.length, a = new Uint8Array(r);
    for (let o = 0; o < r; ++o) {
      e = e + 1 & 255;
      const l = s[e];
      n = n + l & 255;
      const c = s[n];
      s[e] = c, s[n] = l, a[o] = t[o] ^ s[l + c & 255];
    }
    return this.a = e, this.b = n, a;
  }
  decryptBlock(t) {
    return this.encryptBlock(t);
  }
  encrypt(t) {
    return this.encryptBlock(t);
  }
}
class uj {
  decryptBlock(t) {
    return t;
  }
  encrypt(t) {
    return t;
  }
}
class xw {
  constructor() {
    ft(this, "_s", new Uint8Array([99, 124, 119, 123, 242, 107, 111, 197, 48, 1, 103, 43, 254, 215, 171, 118, 202, 130, 201, 125, 250, 89, 71, 240, 173, 212, 162, 175, 156, 164, 114, 192, 183, 253, 147, 38, 54, 63, 247, 204, 52, 165, 229, 241, 113, 216, 49, 21, 4, 199, 35, 195, 24, 150, 5, 154, 7, 18, 128, 226, 235, 39, 178, 117, 9, 131, 44, 26, 27, 110, 90, 160, 82, 59, 214, 179, 41, 227, 47, 132, 83, 209, 0, 237, 32, 252, 177, 91, 106, 203, 190, 57, 74, 76, 88, 207, 208, 239, 170, 251, 67, 77, 51, 133, 69, 249, 2, 127, 80, 60, 159, 168, 81, 163, 64, 143, 146, 157, 56, 245, 188, 182, 218, 33, 16, 255, 243, 210, 205, 12, 19, 236, 95, 151, 68, 23, 196, 167, 126, 61, 100, 93, 25, 115, 96, 129, 79, 220, 34, 42, 144, 136, 70, 238, 184, 20, 222, 94, 11, 219, 224, 50, 58, 10, 73, 6, 36, 92, 194, 211, 172, 98, 145, 149, 228, 121, 231, 200, 55, 109, 141, 213, 78, 169, 108, 86, 244, 234, 101, 122, 174, 8, 186, 120, 37, 46, 28, 166, 180, 198, 232, 221, 116, 31, 75, 189, 139, 138, 112, 62, 181, 102, 72, 3, 246, 14, 97, 53, 87, 185, 134, 193, 29, 158, 225, 248, 152, 17, 105, 217, 142, 148, 155, 30, 135, 233, 206, 85, 40, 223, 140, 161, 137, 13, 191, 230, 66, 104, 65, 153, 45, 15, 176, 84, 187, 22]));
    ft(this, "_inv_s", new Uint8Array([82, 9, 106, 213, 48, 54, 165, 56, 191, 64, 163, 158, 129, 243, 215, 251, 124, 227, 57, 130, 155, 47, 255, 135, 52, 142, 67, 68, 196, 222, 233, 203, 84, 123, 148, 50, 166, 194, 35, 61, 238, 76, 149, 11, 66, 250, 195, 78, 8, 46, 161, 102, 40, 217, 36, 178, 118, 91, 162, 73, 109, 139, 209, 37, 114, 248, 246, 100, 134, 104, 152, 22, 212, 164, 92, 204, 93, 101, 182, 146, 108, 112, 72, 80, 253, 237, 185, 218, 94, 21, 70, 87, 167, 141, 157, 132, 144, 216, 171, 0, 140, 188, 211, 10, 247, 228, 88, 5, 184, 179, 69, 6, 208, 44, 30, 143, 202, 63, 15, 2, 193, 175, 189, 3, 1, 19, 138, 107, 58, 145, 17, 65, 79, 103, 220, 234, 151, 242, 207, 206, 240, 180, 230, 115, 150, 172, 116, 34, 231, 173, 53, 133, 226, 249, 55, 232, 28, 117, 223, 110, 71, 241, 26, 113, 29, 41, 197, 137, 111, 183, 98, 14, 170, 24, 190, 27, 252, 86, 62, 75, 198, 210, 121, 32, 154, 219, 192, 254, 120, 205, 90, 244, 31, 221, 168, 51, 136, 7, 199, 49, 177, 18, 16, 89, 39, 128, 236, 95, 96, 81, 127, 169, 25, 181, 74, 13, 45, 229, 122, 159, 147, 201, 156, 239, 160, 224, 59, 77, 174, 42, 245, 176, 200, 235, 187, 60, 131, 83, 153, 97, 23, 43, 4, 126, 186, 119, 214, 38, 225, 105, 20, 99, 85, 33, 12, 125]));
    ft(this, "_mix", new Uint32Array([0, 235474187, 470948374, 303765277, 941896748, 908933415, 607530554, 708780849, 1883793496, 2118214995, 1817866830, 1649639237, 1215061108, 1181045119, 1417561698, 1517767529, 3767586992, 4003061179, 4236429990, 4069246893, 3635733660, 3602770327, 3299278474, 3400528769, 2430122216, 2664543715, 2362090238, 2193862645, 2835123396, 2801107407, 3035535058, 3135740889, 3678124923, 3576870512, 3341394285, 3374361702, 3810496343, 3977675356, 4279080257, 4043610186, 2876494627, 2776292904, 3076639029, 3110650942, 2472011535, 2640243204, 2403728665, 2169303058, 1001089995, 899835584, 666464733, 699432150, 59727847, 226906860, 530400753, 294930682, 1273168787, 1172967064, 1475418501, 1509430414, 1942435775, 2110667444, 1876241833, 1641816226, 2910219766, 2743034109, 2976151520, 3211623147, 2505202138, 2606453969, 2302690252, 2269728455, 3711829422, 3543599269, 3240894392, 3475313331, 3843699074, 3943906441, 4178062228, 4144047775, 1306967366, 1139781709, 1374988112, 1610459739, 1975683434, 2076935265, 1775276924, 1742315127, 1034867998, 866637845, 566021896, 800440835, 92987698, 193195065, 429456164, 395441711, 1984812685, 2017778566, 1784663195, 1683407248, 1315562145, 1080094634, 1383856311, 1551037884, 101039829, 135050206, 437757123, 337553864, 1042385657, 807962610, 573804783, 742039012, 2531067453, 2564033334, 2328828971, 2227573024, 2935566865, 2700099354, 3001755655, 3168937228, 3868552805, 3902563182, 4203181171, 4102977912, 3736164937, 3501741890, 3265478751, 3433712980, 1106041591, 1340463100, 1576976609, 1408749034, 2043211483, 2009195472, 1708848333, 1809054150, 832877231, 1068351396, 766945465, 599762354, 159417987, 126454664, 361929877, 463180190, 2709260871, 2943682380, 3178106961, 3009879386, 2572697195, 2538681184, 2236228733, 2336434550, 3509871135, 3745345300, 3441850377, 3274667266, 3910161971, 3877198648, 4110568485, 4211818798, 2597806476, 2497604743, 2261089178, 2295101073, 2733856160, 2902087851, 3202437046, 2968011453, 3936291284, 3835036895, 4136440770, 4169408201, 3535486456, 3702665459, 3467192302, 3231722213, 2051518780, 1951317047, 1716890410, 1750902305, 1113818384, 1282050075, 1584504582, 1350078989, 168810852, 67556463, 371049330, 404016761, 841739592, 1008918595, 775550814, 540080725, 3969562369, 3801332234, 4035489047, 4269907996, 3569255213, 3669462566, 3366754619, 3332740144, 2631065433, 2463879762, 2160117071, 2395588676, 2767645557, 2868897406, 3102011747, 3069049960, 202008497, 33778362, 270040487, 504459436, 875451293, 975658646, 675039627, 641025152, 2084704233, 1917518562, 1615861247, 1851332852, 1147550661, 1248802510, 1484005843, 1451044056, 933301370, 967311729, 733156972, 632953703, 260388950, 25965917, 328671808, 496906059, 1206477858, 1239443753, 1543208500, 1441952575, 2144161806, 1908694277, 1675577880, 1842759443, 3610369226, 3644379585, 3408119516, 3307916247, 4011190502, 3776767469, 4077384432, 4245618683, 2809771154, 2842737049, 3144396420, 3043140495, 2673705150, 2438237621, 2203032232, 2370213795]));
    ft(this, "_mixCol", new Uint8Array(256).map((t, e) => e < 128 ? e << 1 : e << 1 ^ 27));
    this.buffer = new Uint8Array(16), this.bufferPosition = 0;
  }
  _expandKey(t) {
    ye("Cannot call `_expandKey` on the base class");
  }
  _decrypt(t, e) {
    let n, s, r;
    const a = new Uint8Array(16);
    a.set(t);
    for (let o = 0, l = this._keySize; o < 16; ++o, ++l) a[o] ^= e[l];
    for (let o = this._cyclesOfRepetition - 1; o >= 1; --o) {
      n = a[13], a[13] = a[9], a[9] = a[5], a[5] = a[1], a[1] = n, n = a[14], s = a[10], a[14] = a[6], a[10] = a[2], a[6] = n, a[2] = s, n = a[15], s = a[11], r = a[7], a[15] = a[3], a[11] = n, a[7] = s, a[3] = r;
      for (let l = 0; l < 16; ++l) a[l] = this._inv_s[a[l]];
      for (let l = 0, c = 16 * o; l < 16; ++l, ++c) a[l] ^= e[c];
      for (let l = 0; l < 16; l += 4) {
        const c = this._mix[a[l]], h = this._mix[a[l + 1]], u = this._mix[a[l + 2]], f = this._mix[a[l + 3]];
        n = c ^ h >>> 8 ^ h << 24 ^ u >>> 16 ^ u << 16 ^ f >>> 24 ^ f << 8, a[l] = n >>> 24 & 255, a[l + 1] = n >> 16 & 255, a[l + 2] = n >> 8 & 255, a[l + 3] = 255 & n;
      }
    }
    n = a[13], a[13] = a[9], a[9] = a[5], a[5] = a[1], a[1] = n, n = a[14], s = a[10], a[14] = a[6], a[10] = a[2], a[6] = n, a[2] = s, n = a[15], s = a[11], r = a[7], a[15] = a[3], a[11] = n, a[7] = s, a[3] = r;
    for (let o = 0; o < 16; ++o)
      a[o] = this._inv_s[a[o]], a[o] ^= e[o];
    return a;
  }
  _encrypt(t, e) {
    const n = this._s;
    let s, r, a;
    const o = new Uint8Array(16);
    o.set(t);
    for (let l = 0; l < 16; ++l) o[l] ^= e[l];
    for (let l = 1; l < this._cyclesOfRepetition; l++) {
      for (let c = 0; c < 16; ++c) o[c] = n[o[c]];
      a = o[1], o[1] = o[5], o[5] = o[9], o[9] = o[13], o[13] = a, a = o[2], r = o[6], o[2] = o[10], o[6] = o[14], o[10] = a, o[14] = r, a = o[3], r = o[7], s = o[11], o[3] = o[15], o[7] = a, o[11] = r, o[15] = s;
      for (let c = 0; c < 16; c += 4) {
        const h = o[c], u = o[c + 1], f = o[c + 2], d = o[c + 3];
        s = h ^ u ^ f ^ d, o[c] ^= s ^ this._mixCol[h ^ u], o[c + 1] ^= s ^ this._mixCol[u ^ f], o[c + 2] ^= s ^ this._mixCol[f ^ d], o[c + 3] ^= s ^ this._mixCol[d ^ h];
      }
      for (let c = 0, h = 16 * l; c < 16; ++c, ++h) o[c] ^= e[h];
    }
    for (let l = 0; l < 16; ++l) o[l] = n[o[l]];
    a = o[1], o[1] = o[5], o[5] = o[9], o[9] = o[13], o[13] = a, a = o[2], r = o[6], o[2] = o[10], o[6] = o[14], o[10] = a, o[14] = r, a = o[3], r = o[7], s = o[11], o[3] = o[15], o[7] = a, o[11] = r, o[15] = s;
    for (let l = 0, c = this._keySize; l < 16; ++l, ++c) o[l] ^= e[c];
    return o;
  }
  _decryptBlock2(t, e) {
    const n = t.length;
    let s = this.buffer, r = this.bufferPosition;
    const a = [];
    let o = this.iv;
    for (let h = 0; h < n; ++h) {
      if (s[r] = t[h], ++r, r < 16) continue;
      const u = this._decrypt(s, this._key);
      for (let f = 0; f < 16; ++f) u[f] ^= o[f];
      o = s, a.push(u), s = new Uint8Array(16), r = 0;
    }
    if (this.buffer = s, this.bufferLength = r, this.iv = o, a.length === 0) return new Uint8Array(0);
    let l = 16 * a.length;
    if (e) {
      const h = a.at(-1);
      let u = h[15];
      if (u <= 16) {
        for (let f = 15, d = 16 - u; f >= d; --f) if (h[f] !== u) {
          u = 0;
          break;
        }
        l -= u, a[a.length - 1] = h.subarray(0, 16 - u);
      }
    }
    const c = new Uint8Array(l);
    for (let h = 0, u = 0, f = a.length; h < f; ++h, u += 16) c.set(a[h], u);
    return c;
  }
  decryptBlock(t, e, n = null) {
    const s = t.length, r = this.buffer;
    let a = this.bufferPosition;
    if (n) this.iv = n;
    else {
      for (let o = 0; a < 16 && o < s; ++o, ++a) r[a] = t[o];
      if (a < 16)
        return this.bufferLength = a, new Uint8Array(0);
      this.iv = r, t = t.subarray(16);
    }
    return this.buffer = new Uint8Array(16), this.bufferLength = 0, this.decryptBlock = this._decryptBlock2, this.decryptBlock(t, e);
  }
  encrypt(t, e) {
    const n = t.length;
    let s = this.buffer, r = this.bufferPosition;
    const a = [];
    e || (e = new Uint8Array(16));
    for (let c = 0; c < n; ++c) {
      if (s[r] = t[c], ++r, r < 16) continue;
      for (let u = 0; u < 16; ++u) s[u] ^= e[u];
      const h = this._encrypt(s, this._key);
      e = h, a.push(h), s = new Uint8Array(16), r = 0;
    }
    if (this.buffer = s, this.bufferLength = r, this.iv = e, a.length === 0) return new Uint8Array(0);
    const o = 16 * a.length, l = new Uint8Array(o);
    for (let c = 0, h = 0, u = a.length; c < u; ++c, h += 16) l.set(a[c], h);
    return l;
  }
}
class NT extends xw {
  constructor(e) {
    super();
    ft(this, "_rcon", new Uint8Array([141, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145, 57, 114, 228, 211, 189, 97, 194, 159, 37, 74, 148, 51, 102, 204, 131, 29, 58, 116, 232, 203, 141, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145, 57, 114, 228, 211, 189, 97, 194, 159, 37, 74, 148, 51, 102, 204, 131, 29, 58, 116, 232, 203, 141, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145, 57, 114, 228, 211, 189, 97, 194, 159, 37, 74, 148, 51, 102, 204, 131, 29, 58, 116, 232, 203, 141, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145, 57, 114, 228, 211, 189, 97, 194, 159, 37, 74, 148, 51, 102, 204, 131, 29, 58, 116, 232, 203, 141, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54, 108, 216, 171, 77, 154, 47, 94, 188, 99, 198, 151, 53, 106, 212, 179, 125, 250, 239, 197, 145, 57, 114, 228, 211, 189, 97, 194, 159, 37, 74, 148, 51, 102, 204, 131, 29, 58, 116, 232, 203, 141]));
    this._cyclesOfRepetition = 10, this._keySize = 160, this._key = this._expandKey(e);
  }
  _expandKey(e) {
    const n = this._s, s = this._rcon, r = new Uint8Array(176);
    r.set(e);
    for (let a = 16, o = 1; a < 176; ++o) {
      let l = r[a - 3], c = r[a - 2], h = r[a - 1], u = r[a - 4];
      l = n[l], c = n[c], h = n[h], u = n[u], l ^= s[o];
      for (let f = 0; f < 4; ++f)
        r[a] = l ^= r[a - 16], a++, r[a] = c ^= r[a - 16], a++, r[a] = h ^= r[a - 16], a++, r[a] = u ^= r[a - 16], a++;
    }
    return r;
  }
}
class Xb extends xw {
  constructor(t) {
    super(), this._cyclesOfRepetition = 14, this._keySize = 224, this._key = this._expandKey(t);
  }
  _expandKey(t) {
    const e = this._s, n = new Uint8Array(240);
    n.set(t);
    let s, r, a, o, l = 1;
    for (let c = 32, h = 1; c < 240; ++h) {
      c % 32 == 16 ? (s = e[s], r = e[r], a = e[a], o = e[o]) : c % 32 == 0 && (s = n[c - 3], r = n[c - 2], a = n[c - 1], o = n[c - 4], s = e[s], r = e[r], a = e[a], o = e[o], s ^= l, (l <<= 1) >= 256 && (l = 255 & (27 ^ l)));
      for (let u = 0; u < 4; ++u)
        n[c] = s ^= n[c - 32], c++, n[c] = r ^= n[c - 32], c++, n[c] = a ^= n[c - 32], c++, n[c] = o ^= n[c - 32], c++;
    }
    return n;
  }
}
class LT {
  _hash(t, e, n) {
    ye("Abstract method `_hash` called");
  }
  checkOwnerPassword(t, e, n, s) {
    const r = new Uint8Array(t.length + 56);
    return r.set(t, 0), r.set(e, t.length), r.set(n, t.length + e.length), sp(this._hash(t, r, n), s);
  }
  checkUserPassword(t, e, n) {
    const s = new Uint8Array(t.length + 8);
    return s.set(t, 0), s.set(e, t.length), sp(this._hash(t, s, []), n);
  }
  getOwnerKey(t, e, n, s) {
    const r = new Uint8Array(t.length + 56);
    r.set(t, 0), r.set(e, t.length), r.set(n, t.length + e.length);
    const a = this._hash(t, r, n);
    return new Xb(a).decryptBlock(s, !1, new Uint8Array(16));
  }
  getUserKey(t, e, n) {
    const s = new Uint8Array(t.length + 8);
    s.set(t, 0), s.set(e, t.length);
    const r = this._hash(t, s, []);
    return new Xb(r).decryptBlock(n, !1, new Uint8Array(16));
  }
}
class dj extends LT {
  _hash(t, e, n) {
    return Wb(e, 0, e.length);
  }
}
class fj extends LT {
  _hash(t, e, n) {
    let s = Wb(e, 0, e.length).subarray(0, 32), r = [0], a = 0;
    for (; a < 64 || r.at(-1) > a - 32; ) {
      const h = t.length + s.length + n.length, u = new Uint8Array(h);
      let f = 0;
      u.set(t, f), f += t.length, u.set(s, f), f += s.length, u.set(n, f);
      const d = new Uint8Array(64 * h);
      for (let g = 0, b = 0; g < 64; g++, b += h) d.set(u, b);
      r = new NT(s.subarray(0, 16)).encrypt(d, s.subarray(16, 32));
      const p = Math.sumPrecise(r.slice(0, 16)) % 3;
      p === 0 ? s = Wb(r, 0, r.length) : p === 1 ? s = (o = r, l = 0, c = r.length, Cx(o, l, c, !0)) : p === 2 && (s = Cx(r, 0, r.length)), a++;
    }
    var o, l, c;
    return s.subarray(0, 32);
  }
}
class Ex {
  constructor(t, e) {
    this.StringCipherConstructor = t, this.StreamCipherConstructor = e;
  }
  createStream(t, e) {
    const n = new this.StreamCipherConstructor();
    return new hj(t, e, function(r, a) {
      return n.decryptBlock(r, a);
    });
  }
  decryptString(t) {
    const e = new this.StringCipherConstructor();
    let n = Dn(t);
    return n = e.decryptBlock(n, !0), Is(n);
  }
  encryptString(t) {
    const e = new this.StringCipherConstructor();
    if (e instanceof xw) {
      const s = 16 - t.length % 16;
      t += String.fromCharCode(s).repeat(s);
      const r = new Uint8Array(16);
      crypto.getRandomValues(r);
      let a = Dn(t);
      a = e.encrypt(a, r);
      const o = new Uint8Array(16 + a.length);
      return o.set(r), o.set(a, 16), Is(o);
    }
    let n = Dn(t);
    return n = e.encrypt(n), Is(n);
  }
}
var Yn, OT, Kb, $T, D9, Zb;
const ku = class ku {
  constructor(t, e, n) {
    F(this, Yn);
    const s = t.get("Filter");
    if (!ki(s, "Standard")) throw new ht("unknown encryption method");
    this.filterName = s.name, this.dict = t;
    const r = t.get("V");
    if (!Number.isInteger(r) || r !== 1 && r !== 2 && r !== 4 && r !== 5) throw new ht("unsupported encryption algorithm");
    this.algorithm = r;
    let a = t.get("Length");
    if (!a) if (r <= 3) a = 40;
    else {
      const y = t.get("CF"), v = t.get("StmF");
      if (y instanceof Z && v instanceof lt) {
        y.suppressEncryption = !0;
        const w = y.get(v.name);
        a = (w == null ? void 0 : w.get("Length")) || 128, a < 40 && (a <<= 3);
      }
    }
    if (!Number.isInteger(a) || a < 40 || a % 8 != 0) throw new ht("invalid key length");
    const o = Dn(t.get("O")), l = Dn(t.get("U")), c = o.subarray(0, 32), h = l.subarray(0, 32), u = t.get("P"), f = t.get("R"), d = (r === 4 || r === 5) && t.get("EncryptMetadata") !== !1;
    this.encryptMetadata = d;
    const p = Dn(e);
    let g, b;
    if (n) {
      if (f === 6) try {
        n = Z8(n);
      } catch {
        H("CipherTransformFactory: Unable to convert UTF8 encoded password.");
      }
      g = Dn(n);
    }
    if (r !== 5) b = D(this, Yn, Kb).call(this, p, g, c, h, u, f, a, d);
    else {
      const y = o.subarray(32, 40), v = o.subarray(40, 48), w = l.subarray(0, 48), _ = l.subarray(32, 40), x = l.subarray(40, 48), k = Dn(t.get("OE")), S = Dn(t.get("UE")), T = Dn(t.get("Perms"));
      b = D(this, Yn, OT).call(this, f, g, c, y, v, w, h, _, x, k, S, T);
    }
    if (!b) {
      if (!n) throw new ep("No password given", BB);
      const y = D(this, Yn, $T).call(this, g, c, f, a);
      b = D(this, Yn, Kb).call(this, p, y, c, h, u, f, a, d);
    }
    if (!b) throw new ep("Incorrect Password", PB);
    if (r === 4 && b.length < 16 ? (this.encryptionKey = new Uint8Array(16), this.encryptionKey.set(b)) : this.encryptionKey = b, r >= 4) {
      const y = t.get("CF");
      y instanceof Z && (y.suppressEncryption = !0), this.cf = y, this.stmf = t.get("StmF") || lt.get("Identity"), this.strf = t.get("StrF") || lt.get("Identity"), this.eff = t.get("EFF") || this.stmf;
    }
  }
  static get _defaultPasswordBytes() {
    return At(this, "_defaultPasswordBytes", new Uint8Array([40, 191, 78, 94, 78, 117, 138, 65, 100, 0, 78, 86, 255, 250, 1, 8, 46, 46, 0, 182, 208, 104, 62, 128, 47, 12, 169, 254, 100, 83, 105, 122]));
  }
  createCipherTransform(t, e) {
    if (this.algorithm === 4 || this.algorithm === 5) return new Ex(D(this, Yn, Zb).call(this, this.cf, this.strf, t, e, this.encryptionKey), D(this, Yn, Zb).call(this, this.cf, this.stmf, t, e, this.encryptionKey));
    const n = D(this, Yn, D9).call(this, t, e, this.encryptionKey, !1), s = function() {
      return new F0(n);
    };
    return new Ex(s, s);
  }
};
Yn = new WeakSet(), OT = function(t, e, n, s, r, a, o, l, c, h, u, f) {
  if (e) {
    const p = Math.min(127, e.length);
    e = e.subarray(0, p);
  } else e = [];
  const d = t === 6 ? new fj() : new dj();
  return d.checkUserPassword(e, l, o) ? d.getUserKey(e, c, u) : e.length && d.checkOwnerPassword(e, s, a, n) ? d.getOwnerKey(e, r, a, h) : null;
}, Kb = function(t, e, n, s, r, a, o, l) {
  const c = 40 + n.length + t.length, h = new Uint8Array(c);
  let u, f, d = 0;
  if (e)
    for (f = Math.min(32, e.length); d < f; ++d) h[d] = e[d];
  for (u = 0; d < 32; ) h[d++] = ku._defaultPasswordBytes[u++];
  h.set(n, d), d += n.length, h[d++] = 255 & r, h[d++] = r >> 8 & 255, h[d++] = r >> 16 & 255, h[d++] = r >>> 24 & 255, h.set(t, d), d += t.length, a >= 4 && !l && (h.fill(255, d, d + 4), d += 4);
  let p = hc(h, 0, d);
  const g = o >> 3;
  if (a >= 3) for (u = 0; u < 50; ++u) p = hc(p, 0, g);
  const b = p.subarray(0, g);
  let y, v;
  if (a >= 3) {
    d = 0, h.set(ku._defaultPasswordBytes, d), d += 32, h.set(t, d), d += t.length, y = new F0(b), v = y.encryptBlock(hc(h, 0, d)), f = b.length;
    const w = new Uint8Array(f);
    for (u = 1; u <= 19; ++u) {
      for (let _ = 0; _ < f; ++_) w[_] = b[_] ^ u;
      y = new F0(w), v = y.encryptBlock(v);
    }
  } else
    y = new F0(b), v = y.encryptBlock(ku._defaultPasswordBytes);
  return v.every((w, _) => s[_] === w) ? b : null;
}, $T = function(t, e, n, s) {
  const r = new Uint8Array(32);
  let a = 0;
  const o = Math.min(32, t.length);
  for (; a < o; ++a) r[a] = t[a];
  let l = 0;
  for (; a < 32; ) r[a++] = ku._defaultPasswordBytes[l++];
  let c = hc(r, 0, a);
  const h = s >> 3;
  if (n >= 3) for (l = 0; l < 50; ++l) c = hc(c, 0, c.length);
  let u, f;
  if (n >= 3) {
    f = e;
    const d = new Uint8Array(h);
    for (l = 19; l >= 0; l--) {
      for (let p = 0; p < h; ++p) d[p] = c[p] ^ l;
      u = new F0(d), f = u.encryptBlock(f);
    }
  } else
    u = new F0(c.subarray(0, h)), f = u.encryptBlock(e);
  return f;
}, D9 = function(t, e, n, s = !1) {
  const r = n.length, a = new Uint8Array(r + 9);
  a.set(n);
  let o = r;
  return a[o++] = 255 & t, a[o++] = t >> 8 & 255, a[o++] = t >> 16 & 255, a[o++] = 255 & e, a[o++] = e >> 8 & 255, s && (a[o++] = 115, a[o++] = 65, a[o++] = 108, a[o++] = 84), hc(a, 0, o).subarray(0, Math.min(r + 5, 16));
}, Zb = function(t, e, n, s, r) {
  if (!(e instanceof lt)) throw new ht("Invalid crypt filter name.");
  const a = this, o = t.get(e.name), l = o == null ? void 0 : o.get("CFM");
  if (!l || l.name === "None") return function() {
    return new uj();
  };
  if (l.name === "V2") return function() {
    var c;
    return new F0(D(c = a, Yn, D9).call(c, n, s, r, !1));
  };
  if (l.name === "AESV2") return function() {
    var c;
    return new NT(D(c = a, Yn, D9).call(c, n, s, r, !0));
  };
  if (l.name === "AESV3") return function() {
    return new Xb(r);
  };
  throw new ht("Unknown crypto method");
};
let Yb = ku;
var dg;
class pj {
  constructor(t, e) {
    F(this, dg, null);
    this.stream = t, this.pdfManager = e, this.entries = [], this._xrefStms = /* @__PURE__ */ new Set(), this._cacheMap = /* @__PURE__ */ new Map(), this._pendingRefs = new $i(), this._newPersistentRefNum = null, this._newTemporaryRefNum = null, this._persistentRefsCache = null;
  }
  getNewPersistentRef(t) {
    this._newPersistentRefNum === null && (this._newPersistentRefNum = this.entries.length || 1);
    const e = this._newPersistentRefNum++;
    return this._cacheMap.set(e, t), Dt.get(e, 0);
  }
  getNewTemporaryRef() {
    if (this._newTemporaryRefNum === null && (this._newTemporaryRefNum = this.entries.length || 1, this._newPersistentRefNum)) {
      this._persistentRefsCache = /* @__PURE__ */ new Map();
      for (let t = this._newTemporaryRefNum; t < this._newPersistentRefNum; t++)
        this._persistentRefsCache.set(t, this._cacheMap.get(t)), this._cacheMap.delete(t);
    }
    return Dt.get(this._newTemporaryRefNum++, 0);
  }
  resetNewTemporaryRef() {
    if (this._newTemporaryRefNum = null, this._persistentRefsCache) for (const [t, e] of this._persistentRefsCache) this._cacheMap.set(t, e);
    this._persistentRefsCache = null;
  }
  setStartXRef(t) {
    this.startXRefQueue = [t];
  }
  parse(t = !1) {
    let e, n, s;
    t ? (H("Indexing all PDF objects"), e = this.indexObjects()) : e = this.readXRef(), e.assignXref(this), this.trailer = e;
    try {
      n = e.get("Encrypt");
    } catch (r) {
      if (r instanceof ti) throw r;
      H(`XRef.parse - Invalid "Encrypt" reference: "${r}".`);
    }
    if (n instanceof Z) {
      const r = e.get("ID"), a = r != null && r.length ? r[0] : "";
      n.suppressEncryption = !0, this.encrypt = new Yb(n, a, this.pdfManager.password);
    }
    try {
      s = e.get("Root");
    } catch (r) {
      if (r instanceof ti) throw r;
      H(`XRef.parse - Invalid "Root" reference: "${r}".`);
    }
    if (s instanceof Z) try {
      if (s.get("Pages") instanceof Z) {
        this.root = s;
        return;
      }
    } catch (r) {
      if (r instanceof ti) throw r;
      H(`XRef.parse - Invalid "Pages" reference: "${r}".`);
    }
    throw t ? new ip("Invalid Root reference.") : new Cu();
  }
  processXRefTable(t) {
    if ("tableState" in this || (this.tableState = { entryNum: 0, streamPos: t.lexer.stream.pos, parserBuf1: t.buf1, parserBuf2: t.buf2 }), !nn(this.readXRefTable(t), "trailer")) throw new ht("Invalid XRef table: could not find trailer dictionary");
    let e = t.getObj();
    if (e instanceof Z || !e.dict || (e = e.dict), !(e instanceof Z)) throw new ht("Invalid XRef table: could not parse trailer dictionary");
    return delete this.tableState, e;
  }
  readXRefTable(t) {
    const e = t.lexer.stream, n = this.tableState;
    e.pos = n.streamPos, t.buf1 = n.parserBuf1, t.buf2 = n.parserBuf2;
    let s;
    for (; ; ) {
      if (!("firstEntryNum" in n) || !("entryCount" in n)) {
        if (nn(s = t.getObj(), "trailer")) break;
        n.firstEntryNum = s, n.entryCount = t.getObj();
      }
      let r = n.firstEntryNum;
      const a = n.entryCount;
      if (!Number.isInteger(r) || !Number.isInteger(a)) throw new ht("Invalid XRef table: wrong types in subsection header");
      for (let o = n.entryNum; o < a; o++) {
        n.streamPos = e.pos, n.entryNum = o, n.parserBuf1 = t.buf1, n.parserBuf2 = t.buf2;
        const l = {};
        l.offset = t.getObj(), l.gen = t.getObj();
        const c = t.getObj();
        if (c instanceof Li) switch (c.cmd) {
          case "f":
            l.free = !0;
            break;
          case "n":
            l.uncompressed = !0;
        }
        if (!Number.isInteger(l.offset) || !Number.isInteger(l.gen) || !l.free && !l.uncompressed) throw new ht(`Invalid entry in XRef subsection: ${r}, ${a}`);
        o === 0 && l.free && r === 1 && (r = 0), this.entries[o + r] || (this.entries[o + r] = l);
      }
      n.entryNum = 0, n.streamPos = e.pos, n.parserBuf1 = t.buf1, n.parserBuf2 = t.buf2, delete n.firstEntryNum, delete n.entryCount;
    }
    if (this.entries[0] && !this.entries[0].free) throw new ht("Invalid XRef table: unexpected first object");
    return s;
  }
  processXRefStream(t) {
    if (!("streamState" in this)) {
      const { dict: e, pos: n } = t, s = e.get("W"), r = e.get("Index") || [0, e.get("Size")];
      this.streamState = { entryRanges: r, byteWidths: s, entryNum: 0, streamPos: n };
    }
    return this.readXRefStream(t), delete this.streamState, t.dict;
  }
  readXRefStream(t) {
    const e = this.streamState;
    t.pos = e.streamPos;
    const [n, s, r] = e.byteWidths, a = e.entryRanges;
    for (; a.length > 0; ) {
      const [o, l] = a;
      if (!Number.isInteger(o) || !Number.isInteger(l)) throw new ht(`Invalid XRef range fields: ${o}, ${l}`);
      if (!Number.isInteger(n) || !Number.isInteger(s) || !Number.isInteger(r)) throw new ht(`Invalid XRef entry fields length: ${o}, ${l}`);
      for (let c = e.entryNum; c < l; ++c) {
        e.entryNum = c, e.streamPos = t.pos;
        let h = 0, u = 0, f = 0;
        for (let p = 0; p < n; ++p) {
          const g = t.getByte();
          if (g === -1) throw new ht("Invalid XRef byteWidths 'type'.");
          h = h << 8 | g;
        }
        n === 0 && (h = 1);
        for (let p = 0; p < s; ++p) {
          const g = t.getByte();
          if (g === -1) throw new ht("Invalid XRef byteWidths 'offset'.");
          u = u << 8 | g;
        }
        for (let p = 0; p < r; ++p) {
          const g = t.getByte();
          if (g === -1) throw new ht("Invalid XRef byteWidths 'generation'.");
          f = f << 8 | g;
        }
        const d = {};
        switch (d.offset = u, d.gen = f, h) {
          case 0:
            d.free = !0;
            break;
          case 1:
            d.uncompressed = !0;
            break;
          case 2:
            break;
          default:
            throw new ht(`Invalid XRef entry type: ${h}`);
        }
        this.entries[o + c] || (this.entries[o + c] = d);
      }
      e.entryNum = 0, e.streamPos = t.pos, a.splice(0, 2);
    }
  }
  indexObjects() {
    function t(_, x) {
      let k = "", S = _[x];
      for (; S !== 10 && S !== 13 && S !== 60 && !(++x >= _.length); )
        k += String.fromCharCode(S), S = _[x];
      return k;
    }
    function e(_, x, k) {
      const S = k.length, T = _.length;
      let I = 0;
      for (; x < T; ) {
        let R = 0;
        for (; R < S && _[x + R] === k[R]; ) ++R;
        if (R >= S) break;
        x++, I++;
      }
      return I;
    }
    const n = /\b(endobj|\d+\s+\d+\s+obj|xref|trailer\s*<<)\b/g, s = /\b(startxref|\d+\s+\d+\s+obj)\b/g, r = /^(\d+)\s+(\d+)\s+obj\b/, a = new Uint8Array([116, 114, 97, 105, 108, 101, 114]), o = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]), l = new Uint8Array([47, 88, 82, 101, 102]);
    this.entries.length = 0, this._cacheMap.clear();
    const c = this.stream;
    c.pos = 0;
    const h = c.getBytes(), u = Is(h), f = h.length;
    let d = c.start;
    const p = [], g = [];
    for (; d < f; ) {
      let _ = h[d];
      if (_ === 9 || _ === 10 || _ === 13 || _ === 32) {
        ++d;
        continue;
      }
      if (_ === 37) {
        do {
          if (++d, d >= f) break;
          _ = h[d];
        } while (_ !== 10 && _ !== 13);
        continue;
      }
      const x = t(h, d);
      let k;
      if (x.startsWith("xref") && (x.length === 4 || /\s/.test(x[4])))
        d += e(h, d, a), p.push(d), d += e(h, d, o);
      else if (k = r.exec(x)) {
        const S = 0 | k[1], T = 0 | k[2], I = d + x.length;
        let R, B = !1;
        if (this.entries[S]) {
          if (this.entries[S].gen === T) try {
            new lc({ lexer: new ka(c.makeSubStream(I)) }).getObj(), B = !0;
          } catch (at) {
            at instanceof eb ? H(`indexObjects -- checking object (${x}): "${at}".`) : B = !0;
          }
        } else B = !0;
        B && (this.entries[S] = { offset: d - c.start, gen: T, uncompressed: !0 }), n.lastIndex = I;
        const L = n.exec(u);
        L ? (R = n.lastIndex + 1 - d, L[1] !== "endobj" && (H(`indexObjects: Found "${L[1]}" inside of another "obj", caused by missing "endobj" -- trying to recover.`), R -= L[1].length + 1)) : R = f - d;
        const it = h.subarray(d, d + R), O = e(it, 0, l);
        O < R && it[O + 5] < 64 && (g.push(d - c.start), this._xrefStms.add(d - c.start)), d += R;
      } else if (x.startsWith("trailer") && (x.length === 7 || /\s/.test(x[7]))) {
        p.push(d);
        const S = d + x.length;
        let T;
        s.lastIndex = S;
        const I = s.exec(u);
        I ? (T = s.lastIndex + 1 - d, I[1] !== "startxref" && (H(`indexObjects: Found "${I[1]}" after "trailer", caused by missing "startxref" -- trying to recover.`), T -= I[1].length + 1)) : T = f - d, d += T;
      } else d += x.length + 1;
    }
    for (const _ of g)
      this.startXRefQueue.push(_), this.readXRef(!0);
    const b = [];
    let y, v, w = !1;
    for (const _ of p) {
      c.pos = _;
      const x = new lc({ lexer: new ka(c), xref: this, allowStreams: !0, recoveryMode: !0 });
      if (!nn(x.getObj(), "trailer")) continue;
      const k = x.getObj();
      k instanceof Z && (b.push(k), k.has("Encrypt") && (w = !0));
    }
    for (const _ of [...b, "genFallback", ...b]) {
      if (_ === "genFallback") {
        if (!v) break;
        this._generationFallback = !0;
        continue;
      }
      let x = !1;
      try {
        const k = _.get("Root");
        if (!(k instanceof Z)) continue;
        const S = k.get("Pages");
        if (!(S instanceof Z)) continue;
        const T = S.get("Count");
        Number.isInteger(T) && (x = !0);
      } catch (k) {
        v = k;
        continue;
      }
      if (x && (!w || _.has("Encrypt")) && _.has("ID")) return _;
      y = _;
    }
    if (y) return y;
    if (this.topDict) return this.topDict;
    if (!b.length) for (const [_, x] of this.entries.entries()) {
      if (!x) continue;
      const k = Dt.get(_, x.gen);
      let S;
      try {
        S = this.fetch(k);
      } catch {
        continue;
      }
      if (S instanceof oe && (S = S.dict), S instanceof Z && S.has("Root")) return S;
    }
    throw new ip("Invalid PDF structure.");
  }
  readXRef(t = !1) {
    const e = this.stream, n = /* @__PURE__ */ new Set();
    for (; this.startXRefQueue.length; ) {
      try {
        const s = this.startXRefQueue[0];
        if (n.has(s)) {
          H("readXRef - skipping XRef table since it was already parsed."), this.startXRefQueue.shift();
          continue;
        }
        n.add(s), e.pos = s + e.start;
        const r = new lc({ lexer: new ka(e), xref: this, allowStreams: !0 });
        let a, o = r.getObj();
        if (nn(o, "xref"))
          a = this.processXRefTable(r), this.topDict || (this.topDict = a), o = a.get("XRefStm"), Number.isInteger(o) && !this._xrefStms.has(o) && (this._xrefStms.add(o), this.startXRefQueue.push(o), m(this, dg) ?? E(this, dg, o));
        else {
          if (!Number.isInteger(o)) throw new ht("Invalid XRef stream header");
          if (!(Number.isInteger(r.getObj()) && nn(r.getObj(), "obj") && (o = r.getObj()) instanceof oe)) throw new ht("Invalid XRef stream");
          if (a = this.processXRefStream(o), this.topDict || (this.topDict = a), !a) throw new ht("Failed to read XRef stream");
        }
        o = a.get("Prev"), Number.isInteger(o) ? this.startXRefQueue.push(o) : o instanceof Dt && this.startXRefQueue.push(o.num);
      } catch (s) {
        if (s instanceof ti) throw s;
        ue("(while reading XRef): " + s);
      }
      this.startXRefQueue.shift();
    }
    if (this.topDict) return this.topDict;
    if (!t) throw new Cu();
  }
  get lastXRefStreamPos() {
    return m(this, dg) ?? (this._xrefStms.size > 0 ? Math.max(...this._xrefStms) : null);
  }
  getEntry(t) {
    const e = this.entries[t];
    return e && !e.free && e.offset ? e : null;
  }
  fetchIfRef(t, e = !1) {
    return t instanceof Dt ? this.fetch(t, e) : t;
  }
  fetch(t, e = !1) {
    if (!(t instanceof Dt)) throw new Error("ref object is not a reference");
    const n = t.num, s = this._cacheMap.get(n);
    if (s !== void 0)
      return s instanceof Z && !s.objId && (s.objId = t.toString()), s;
    let r = this.getEntry(n);
    if (r === null) return r;
    if (this._pendingRefs.has(t))
      return this._pendingRefs.remove(t), H(`Ignoring circular reference: ${t}.`), OB;
    this._pendingRefs.put(t);
    try {
      r = r.uncompressed ? this.fetchUncompressed(t, r, e) : this.fetchCompressed(t, r, e), this._pendingRefs.remove(t);
    } catch (a) {
      throw this._pendingRefs.remove(t), a;
    }
    return r instanceof Z ? r.objId = t.toString() : r instanceof oe && (r.dict.objId = t.toString()), r;
  }
  fetchUncompressed(t, e, n = !1) {
    const s = t.gen;
    let r = t.num;
    if (e.gen !== s) {
      const u = `Inconsistent generation in XRef: ${t}`;
      if (this._generationFallback && e.gen < s)
        return H(u), this.fetchUncompressed(Dt.get(r, e.gen), e, n);
      throw new e0(u);
    }
    const a = this.stream.makeSubStream(e.offset + this.stream.start), o = new lc({ lexer: new ka(a), xref: this, allowStreams: !0 }), l = o.getObj(), c = o.getObj(), h = o.getObj();
    if (l !== r || c !== s || !(h instanceof Li)) throw new e0(`Bad (uncompressed) XRef entry: ${t}`);
    if (h.cmd !== "obj") {
      if (h.cmd.startsWith("obj") && (r = parseInt(h.cmd.substring(3), 10), !Number.isNaN(r)))
        return r;
      throw new e0(`Bad (uncompressed) XRef entry: ${t}`);
    }
    return (e = this.encrypt && !n ? o.getObj(this.encrypt.createCipherTransform(r, s)) : o.getObj()) instanceof oe || this._cacheMap.set(r, e), e;
  }
  fetchCompressed(t, e, n = !1) {
    const s = e.offset, r = this.fetch(Dt.get(s, 0));
    if (!(r instanceof oe)) throw new ht("bad ObjStm stream");
    const a = r.dict.get("First"), o = r.dict.get("N");
    if (!Number.isInteger(a) || !Number.isInteger(o)) throw new ht("invalid first and n parameters for ObjStm stream");
    let l = new lc({ lexer: new ka(r), xref: this, allowStreams: !0 });
    const c = new Array(o), h = new Array(o);
    for (let d = 0; d < o; ++d) {
      const p = l.getObj();
      if (!Number.isInteger(p)) throw new ht(`invalid object number in the ObjStm stream: ${p}`);
      const g = l.getObj();
      if (!Number.isInteger(g)) throw new ht(`invalid object offset in the ObjStm stream: ${g}`);
      c[d] = p, h[d] = g;
    }
    const u = (r.start || 0) + a, f = new Array(o);
    for (let d = 0; d < o; ++d) {
      const p = d < o - 1 ? h[d + 1] - h[d] : void 0;
      if (p < 0) throw new ht("Invalid offset in the ObjStm stream.");
      l = new lc({ lexer: new ka(r.makeSubStream(u + h[d], p, r.dict)), xref: this, allowStreams: !0 });
      const g = l.getObj();
      if (f[d] = g, g instanceof oe) continue;
      const b = c[d], y = this.entries[b];
      y && y.offset === s && y.gen === d && this._cacheMap.set(b, g);
    }
    if ((e = f[e.gen]) === void 0) throw new e0(`Bad (compressed) XRef entry: ${t}`);
    return e;
  }
  async fetchIfRefAsync(t, e) {
    return t instanceof Dt ? this.fetchAsync(t, e) : t;
  }
  async fetchAsync(t, e) {
    try {
      return this.fetch(t, e);
    } catch (n) {
      if (!(n instanceof ti)) throw n;
      return await this.pdfManager.requestRange(n.begin, n.end), this.fetchAsync(t, e);
    }
  }
  getCatalogObj() {
    return this.root;
  }
}
dg = new WeakMap();
const mj = [0, 0, 612, 792];
var v4, mi, hu, k2, Jb, qT, Qb, ty;
class Dx {
  constructor({ pdfManager: t, xref: e, pageIndex: n, pageDict: s, ref: r, globalIdFactory: a, fontCache: o, builtInCMapCache: l, standardFontDataCache: c, globalColorSpaceCache: h, globalImageCache: u, systemFontCache: f, nonBlendModesSet: d, xfaFactory: p }) {
    F(this, mi);
    F(this, v4, null);
    this.pdfManager = t, this.pageIndex = n, this.pageDict = s, this.xref = e, this.ref = r, this.fontCache = o, this.builtInCMapCache = l, this.standardFontDataCache = c, this.globalColorSpaceCache = h, this.globalImageCache = u, this.systemFontCache = f, this.nonBlendModesSet = d, this.evaluatorOptions = t.evaluatorOptions, this.xfaFactory = p;
    const g = { obj: 0 };
    this._localIdFactory = class extends a {
      static createObjId() {
        return `p${n}_${++g.obj}`;
      }
      static getPageObjId() {
        return `p${r.toString()}`;
      }
    };
  }
  get content() {
    return this.pageDict.getArray("Contents");
  }
  get resources() {
    const t = D(this, mi, k2).call(this, "Resources");
    return At(this, "resources", t instanceof Z ? t : Z.empty);
  }
  get mediaBox() {
    return At(this, "mediaBox", D(this, mi, Jb).call(this, "MediaBox") || mj);
  }
  get cropBox() {
    return At(this, "cropBox", D(this, mi, Jb).call(this, "CropBox") || this.mediaBox);
  }
  get userUnit() {
    const t = this.pageDict.get("UserUnit");
    return At(this, "userUnit", typeof t == "number" && t > 0 ? t : 1);
  }
  get view() {
    const { cropBox: t, mediaBox: e } = this;
    if (t !== e && !sp(t, e)) {
      const n = Ee.intersect(t, e);
      if (n && n[2] - n[0] > 0 && n[3] - n[1] > 0) return At(this, "view", n);
      H("Empty /CropBox and /MediaBox intersection.");
    }
    return At(this, "view", e);
  }
  get rotate() {
    let t = D(this, mi, k2).call(this, "Rotate") || 0;
    return t % 90 != 0 ? t = 0 : t >= 360 ? t %= 360 : t < 0 && (t = (t % 360 + 360) % 360), At(this, "rotate", t);
  }
  async getContentStream() {
    const t = await this.pdfManager.ensure(this, "content");
    return t instanceof oe ? t : Array.isArray(t) ? new nP(t, D(this, mi, qT).bind(this)) : new ub();
  }
  get xfaData() {
    return At(this, "xfaData", this.xfaFactory ? { bbox: this.xfaFactory.getBoundingBox(this.pageIndex) } : null);
  }
  async saveNewAnnotations(t, e, n, s, r) {
    if (this.xfaFactory) throw new Error("XFA: Cannot save new annotations.");
    const a = D(this, mi, hu).call(this, t), o = new Ts(), l = new $i();
    await D(this, mi, Qb).call(this, n, o, l);
    const c = this.pageDict, h = this.annotations.filter((d) => !(d instanceof Dt && o.has(d))), u = await pc.saveNewAnnotations(a, e, n, s, r);
    for (const { ref: d } of u.annotations) d instanceof Dt && !l.has(d) && h.push(d);
    const f = c.clone();
    f.set("Annots", h), r.put(this.ref, { data: f });
    for (const d of o) r.put(d, { data: null });
  }
  async save(t, e, n, s) {
    const r = D(this, mi, hu).call(this, t), a = await this._parsedAnnotations, o = [];
    for (const l of a) o.push(l.save(r, e, n, s).catch(function(c) {
      return H(`save - ignoring annotation data during "${e.name}" task: "${c}".`), null;
    }));
    return Promise.all(o);
  }
  async loadResources(t) {
    await (m(this, v4) ?? E(this, v4, this.pdfManager.ensure(this, "resources"))), await rf.load(this.resources, t, this.xref);
  }
  async getOperatorList({ handler: t, sink: e, task: n, intent: s, cacheKey: r, annotationStorage: a = null, modifiedIds: o = null }) {
    const l = this.getContentStream(), c = this.loadResources(Q8), h = D(this, mi, hu).call(this, t), u = this.xfaFactory ? null : qE(a), f = u == null ? void 0 : u.get(this.pageIndex);
    let d = Promise.resolve(null), p = null;
    if (f) {
      const L = this.pdfManager.ensureDoc("annotationGlobals");
      let it;
      const O = /* @__PURE__ */ new Set();
      for (const { bitmapId: W, bitmap: q } of f) !W || q || O.has(W) || O.add(W);
      const { isOffscreenCanvasSupported: at } = this.evaluatorOptions;
      if (O.size > 0) {
        const W = f.slice();
        for (const [q, K] of a) q.startsWith(hE) && K.bitmap && O.has(K.bitmapId) && W.push(K);
        it = pc.generateImages(W, this.xref, at);
      } else it = pc.generateImages(f, this.xref, at);
      p = new $i(), d = Promise.all([L, D(this, mi, Qb).call(this, f, p, null)]).then(([W]) => W ? pc.printNewAnnotations(W, h, n, f, it) : null);
    }
    const g = Promise.all([l, c]).then(async ([L]) => {
      const it = await D(this, mi, ty).call(this, L.dict, Q8), O = new Xn(s, e);
      return t.send("StartRenderPage", { transparency: h.hasBlendModes(it, this.nonBlendModesSet), pageIndex: this.pageIndex, cacheKey: r }), await h.getOperatorList({ stream: L, task: n, resources: it, operatorList: O }), O;
    });
    let [b, y, v] = await Promise.all([g, this._parsedAnnotations, d]);
    if (v) {
      y = y.filter((L) => !(L.ref && p.has(L.ref)));
      for (let L = 0, it = v.length; L < it; L++) {
        const O = v[L];
        if (O.refToReplace) {
          const at = y.findIndex((W) => W.ref && o3(W.ref, O.refToReplace));
          at >= 0 && (y.splice(at, 1, O), v.splice(L--, 1), it--);
        }
      }
      y = y.concat(v);
    }
    if (y.length === 0 || s & AR)
      return b.flush(!0), { length: b.totalLength };
    const w = !!(s & cE), _ = !!(s & SR), x = !!(s & Gv), k = !!(s & G9), S = !!(s & Vv), T = [];
    for (const L of y) (x || k && L.mustBeViewed(a, w) && L.mustBeViewedWhenEditing(_, o) || S && L.mustBePrinted(a)) && T.push(L.getOperatorList(h, n, s, a).catch(function(it) {
      return H(`getOperatorList - ignoring annotation data during "${n.name}" task: "${it}".`), { opList: null, separateForm: !1, separateCanvas: !1 };
    }));
    const I = await Promise.all(T);
    let R = !1, B = !1;
    for (const { opList: L, separateForm: it, separateCanvas: O } of I)
      b.addOpList(L), R || (R = it), B || (B = O);
    return b.flush(!0, { form: R, canvas: B }), { length: b.totalLength };
  }
  async extractTextContent({ handler: t, task: e, includeMarkedContent: n, disableNormalization: s, sink: r }) {
    const a = this.getContentStream(), o = this.loadResources(tb), l = this.pdfManager.ensureCatalog("lang"), [c, , h] = await Promise.all([a, o, l]), u = await D(this, mi, ty).call(this, c.dict, tb);
    return D(this, mi, hu).call(this, t).getTextContent({ stream: c, task: e, resources: u, includeMarkedContent: n, disableNormalization: s, sink: r, viewBox: this.view, lang: h });
  }
  async getStructTree() {
    const t = await this.pdfManager.ensureCatalog("structTreeRoot");
    if (!t) return null;
    await this._parsedAnnotations;
    try {
      const e = await this.pdfManager.ensure(this, "_parseStructTree", [t]);
      return await this.pdfManager.ensure(e, "serializable");
    } catch (e) {
      return H(`getStructTree: "${e}".`), null;
    }
  }
  _parseStructTree(t) {
    const e = new zD(t, this.pageDict);
    return e.parse(this.ref), e;
  }
  async getAnnotationsData(t, e, n) {
    const s = await this._parsedAnnotations;
    if (s.length === 0) return s;
    const r = [], a = [];
    let o;
    const l = !!(n & Gv), c = !!(n & G9), h = !!(n & Vv);
    for (const u of s) {
      const f = l || c && u.viewable;
      (f || h && u.printable) && r.push(u.data), u.hasTextContent && f && (o ?? (o = D(this, mi, hu).call(this, t)), a.push(u.extractTextContent(o, e, [-1 / 0, -1 / 0, 1 / 0, 1 / 0]).catch(function(d) {
        H(`getAnnotationsData - ignoring textContent during "${e.name}" task: "${d}".`);
      })));
    }
    return await Promise.all(a), r;
  }
  get annotations() {
    const t = D(this, mi, k2).call(this, "Annots");
    return At(this, "annotations", Array.isArray(t) ? t : []);
  }
  get _parsedAnnotations() {
    return At(this, "_parsedAnnotations", this.pdfManager.ensure(this, "annotations").then(async (t) => {
      if (t.length === 0) return t;
      const [e, n] = await Promise.all([this.pdfManager.ensureDoc("annotationGlobals"), this.pdfManager.ensureDoc("fieldObjects")]);
      if (!e) return [];
      const s = n == null ? void 0 : n.orphanFields, r = [];
      for (const c of t) r.push(pc.create(this.xref, c, e, this._localIdFactory, !1, s, this.ref).catch(function(h) {
        return H(`_parsedAnnotations: "${h}".`), null;
      }));
      const a = [];
      let o, l;
      for (const c of await Promise.all(r)) c && (c instanceof Ra ? (l || (l = [])).push(c) : c instanceof MT ? (o || (o = [])).push(c) : a.push(c));
      return l && a.push(...l), o && a.push(...o), a;
    }));
  }
  get jsActions() {
    return At(this, "jsActions", M4(this.xref, this.pageDict, fB));
  }
}
v4 = new WeakMap(), mi = new WeakSet(), hu = function(t) {
  return new nf({ xref: this.xref, handler: t, pageIndex: this.pageIndex, idFactory: this._localIdFactory, fontCache: this.fontCache, builtInCMapCache: this.builtInCMapCache, standardFontDataCache: this.standardFontDataCache, globalColorSpaceCache: this.globalColorSpaceCache, globalImageCache: this.globalImageCache, systemFontCache: this.systemFontCache, options: this.evaluatorOptions });
}, k2 = function(t, e = !1) {
  const n = Mr({ dict: this.pageDict, key: t, getArray: e, stopWhenFound: !1 });
  return Array.isArray(n) ? n.length !== 1 && n[0] instanceof Z ? Z.merge({ xref: this.xref, dictArray: n }) : n[0] : n;
}, Jb = function(t) {
  if (this.xfaData) return this.xfaData.bbox;
  const e = Wl(D(this, mi, k2).call(this, t, !0), null);
  if (e) {
    if (e[2] - e[0] > 0 && e[3] - e[1] > 0) return e;
    H(`Empty, or invalid, /${t} entry.`);
  }
  return null;
}, qT = function(t, e) {
  if (!this.evaluatorOptions.ignoreErrors) throw t;
  H(`getContentStream - ignoring sub-stream (${e}): "${t}".`);
}, Qb = async function(t, e, n) {
  const s = [];
  for (const r of t) if (r.id) {
    const a = Dt.fromString(r.id);
    if (!a) {
      H(`A non-linked annotation cannot be modified: ${r.id}`);
      continue;
    }
    if (r.deleted) {
      if (e.put(a, a), r.popupRef) {
        const o = Dt.fromString(r.popupRef);
        o && e.put(o, o);
      }
      continue;
    }
    n == null || n.put(a), r.ref = a, s.push(this.xref.fetchAsync(a).then((o) => {
      o instanceof Z && (r.oldAnnotation = o.clone());
    }, () => {
      H(`Cannot fetch \`oldAnnotation\` for: ${a}.`);
    })), delete r.id;
  }
  await Promise.all(s);
}, ty = async function(t, e) {
  const n = t == null ? void 0 : t.get("Resources");
  return n instanceof Z && n.size ? (await rf.load(n, e, this.xref), Z.merge({ xref: this.xref, dictArray: [n, this.resources], mergeSubDicts: !0 })) : this.resources;
};
const Tx = new Uint8Array([37, 80, 68, 70, 45]), Fx = new Uint8Array([115, 116, 97, 114, 116, 120, 114, 101, 102]), gj = new Uint8Array([101, 110, 100, 111, 98, 106]);
function U6(i, t, e = 1024, n = !1) {
  const s = t.length, r = i.peekBytes(e), a = r.length - s;
  if (a <= 0) return !1;
  if (n) {
    const o = s - 1;
    let l = r.length - 1;
    for (; l >= o; ) {
      let c = 0;
      for (; c < s && r[l - c] === t[o - c]; ) c++;
      if (c >= s)
        return i.pos += l - o, !0;
      l--;
    }
  } else {
    let o = 0;
    for (; o <= a; ) {
      let l = 0;
      for (; l < s && r[o + l] === t[l]; ) l++;
      if (l >= s)
        return i.pos += o, !0;
      o++;
    }
  }
  return !1;
}
var t0, fg, Ps, ey, UT, HT, jT, iy;
class zT {
  constructor(t, e) {
    F(this, Ps);
    F(this, t0, /* @__PURE__ */ new Map());
    F(this, fg, null);
    if (e.length <= 0) throw new ip("The PDF file is empty, i.e. its size is zero bytes.");
    this.pdfManager = t, this.stream = e, this.xref = new pj(e, t);
    const n = { font: 0 };
    this._globalIdFactory = class {
      static getDocId() {
        return `g_${t.docId}`;
      }
      static createFontId() {
        return "f" + ++n.font;
      }
      static createObjId() {
        ye("Abstract method `createObjId` called.");
      }
      static getPageObjId() {
        ye("Abstract method `getPageObjId` called.");
      }
    };
  }
  parse(t) {
    this.xref.parse(t), this.catalog = new pp(this.pdfManager, this.xref);
  }
  get linearization() {
    let t = null;
    try {
      t = LP.create(this.stream);
    } catch (e) {
      if (e instanceof ti) throw e;
      ue(e);
    }
    return At(this, "linearization", t);
  }
  get startXRef() {
    const t = this.stream;
    let e = 0;
    if (this.linearization) {
      if (t.reset(), U6(t, gj)) {
        t.skip(6);
        let n = t.peekByte();
        for (; or(n); )
          t.pos++, n = t.peekByte();
        e = t.pos - t.start;
      }
    } else {
      const s = Fx.length;
      let r = !1, a = t.end;
      for (; !r && a > 0; )
        a -= 1024 - s, a < 0 && (a = 0), t.pos = a, r = U6(t, Fx, 1024, !0);
      if (r) {
        t.skip(9);
        let o;
        do
          o = t.getByte();
        while (or(o));
        let l = "";
        for (; o >= 32 && o <= 57; )
          l += String.fromCharCode(o), o = t.getByte();
        e = parseInt(l, 10), isNaN(e) && (e = 0);
      }
    }
    return At(this, "startXRef", e);
  }
  checkHeader() {
    const t = this.stream;
    if (t.reset(), !U6(t, Tx)) return;
    t.moveStart(), t.skip(Tx.length);
    let e, n = "";
    for (; (e = t.getByte()) > 32 && n.length < 7; ) n += String.fromCharCode(e);
    NE.test(n) ? E(this, fg, n) : H(`Invalid PDF header version: ${n}`);
  }
  parseStartXRef() {
    this.xref.setStartXRef(this.startXRef);
  }
  get numPages() {
    let t = 0;
    return t = this.catalog.hasActualNumPages ? this.catalog.numPages : this.xfaFactory ? this.xfaFactory.getNumPages() : this.linearization ? this.linearization.numPages : this.catalog.numPages, At(this, "numPages", t);
  }
  get _xfaStreams() {
    const { acroForm: t } = this.catalog;
    if (!t) return null;
    const e = t.get("XFA"), n = new Map(["xdp:xdp", "template", "datasets", "config", "connectionSet", "localeSet", "stylesheet", "/xdp:xdp"].map((s) => [s, null]));
    if (e instanceof oe && !e.isEmpty)
      return n.set("xdp:xdp", e), n;
    if (!Array.isArray(e) || e.length === 0) return null;
    for (let s = 0, r = e.length; s < r; s += 2) {
      let a;
      if (a = s === 0 ? "xdp:xdp" : s === r - 2 ? "/xdp:xdp" : e[s], !n.has(a)) continue;
      const o = this.xref.fetchIfRef(e[s + 1]);
      o instanceof oe && !o.isEmpty && n.set(a, o);
    }
    return n;
  }
  get xfaDatasets() {
    const t = this._xfaStreams;
    if (!t) return At(this, "xfaDatasets", null);
    for (const e of ["datasets", "xdp:xdp"]) {
      const n = t.get(e);
      if (n) try {
        const s = np(n.getString());
        return At(this, "xfaDatasets", new KH({ [e]: s }));
      } catch {
        H("XFA - Invalid utf-8 string.");
        break;
      }
    }
    return At(this, "xfaDatasets", null);
  }
  get xfaData() {
    const t = this._xfaStreams;
    if (!t) return null;
    const e = /* @__PURE__ */ Object.create(null);
    for (const [n, s] of t) if (s) try {
      e[n] = np(s.getString());
    } catch {
      return H("XFA - Invalid utf-8 string."), null;
    }
    return e;
  }
  get xfaFactory() {
    let t;
    return this.pdfManager.enableXfa && this.catalog.needsRendering && this.formInfo.hasXfa && !this.formInfo.hasAcroForm && (t = this.xfaData), At(this, "xfaFactory", t ? new Fg(t) : null);
  }
  get isPureXfa() {
    return !!this.xfaFactory && this.xfaFactory.isValid();
  }
  get htmlForXfa() {
    return this.xfaFactory ? this.xfaFactory.getPages() : null;
  }
  loadXfaResources(t, e) {
    return Promise.all([D(this, Ps, HT).call(this, t, e).catch(() => {
    }), D(this, Ps, UT).call(this)]);
  }
  serializeXfaData(t) {
    return this.xfaFactory ? this.xfaFactory.serializeData(t) : null;
  }
  get version() {
    return this.catalog.version || m(this, fg);
  }
  get formInfo() {
    const t = { hasFields: !1, hasAcroForm: !1, hasXfa: !1, hasSignatures: !1 }, { acroForm: e } = this.catalog;
    if (!e) return At(this, "formInfo", t);
    try {
      const n = e.get("Fields"), s = Array.isArray(n) && n.length > 0;
      t.hasFields = s;
      const r = e.get("XFA");
      t.hasXfa = Array.isArray(r) && r.length > 0 || r instanceof oe && !r.isEmpty;
      const a = !!(1 & e.get("SigFlags")), o = a && D(this, Ps, ey).call(this, n);
      t.hasAcroForm = s && !o, t.hasSignatures = a;
    } catch (n) {
      if (n instanceof ti) throw n;
      H(`Cannot fetch form information: "${n}".`);
    }
    return At(this, "formInfo", t);
  }
  get documentInfo() {
    var a;
    const { catalog: t, formInfo: e, xref: n } = this, s = { PDFFormatVersion: this.version, Language: t.lang, EncryptFilterName: ((a = n.encrypt) == null ? void 0 : a.filterName) ?? null, IsLinearized: !!this.linearization, IsAcroFormPresent: e.hasAcroForm, IsXFAPresent: e.hasXfa, IsCollectionPresent: !!t.collection, IsSignaturesPresent: e.hasSignatures };
    let r;
    try {
      r = n.trailer.get("Info");
    } catch (o) {
      if (o instanceof ti) throw o;
      ue("The document information dictionary is invalid.");
    }
    if (!(r instanceof Z)) return At(this, "documentInfo", s);
    for (const [o, l] of r) {
      switch (o) {
        case "Title":
        case "Author":
        case "Subject":
        case "Keywords":
        case "Creator":
        case "Producer":
        case "CreationDate":
        case "ModDate":
          if (typeof l == "string") {
            s[o] = xe(l);
            continue;
          }
          break;
        case "Trapped":
          if (l instanceof lt) {
            s[o] = l;
            continue;
          }
          break;
        default:
          let c;
          switch (typeof l) {
            case "string":
              c = xe(l);
              break;
            case "number":
            case "boolean":
              c = l;
              break;
            default:
              l instanceof lt && (c = l);
          }
          if (c === void 0) {
            H(`Bad value, for custom key "${o}", in Info: ${l}.`);
            continue;
          }
          s.Custom ?? (s.Custom = /* @__PURE__ */ Object.create(null)), s.Custom[o] = c;
          continue;
      }
      H(`Bad value, for key "${o}", in Info: ${l}.`);
    }
    return At(this, "documentInfo", s);
  }
  get fingerprints() {
    const t = "\0".repeat(16);
    function e(a) {
      return typeof a == "string" && a.length === 16 && a !== t;
    }
    const n = this.xref.trailer.get("ID");
    let s, r;
    return Array.isArray(n) && e(n[0]) ? (s = Dn(n[0]), n[1] !== n[0] && e(n[1]) && (r = Dn(n[1]))) : s = hc(this.stream.getByteRange(0, 1024), 0, 1024), At(this, "fingerprints", [n_(s), r ? n_(r) : null]);
  }
  getPage(t) {
    const e = m(this, t0).get(t);
    if (e) return e;
    const { catalog: n, linearization: s, xfaFactory: r } = this;
    let a;
    return a = r ? Promise.resolve([Z.empty, null]) : (s == null ? void 0 : s.pageFirst) === t ? D(this, Ps, jT).call(this, t) : n.getPageDict(t), a = a.then(([o, l]) => new Dx({ pdfManager: this.pdfManager, xref: this.xref, pageIndex: t, pageDict: o, ref: l, globalIdFactory: this._globalIdFactory, fontCache: n.fontCache, builtInCMapCache: n.builtInCMapCache, standardFontDataCache: n.standardFontDataCache, globalColorSpaceCache: n.globalColorSpaceCache, globalImageCache: n.globalImageCache, systemFontCache: n.systemFontCache, nonBlendModesSet: n.nonBlendModesSet, xfaFactory: r })), m(this, t0).set(t, a), a;
  }
  async checkFirstPage(t = !1) {
    if (!t) try {
      await this.getPage(0);
    } catch (e) {
      if (e instanceof e0)
        throw m(this, t0).delete(0), await this.cleanup(), new Cu();
    }
  }
  async checkLastPage(t = !1) {
    const { catalog: e, pdfManager: n } = this;
    e.setActualNumPages();
    let s;
    try {
      if (await Promise.all([n.ensureDoc("xfaFactory"), n.ensureDoc("linearization"), n.ensureCatalog("numPages")]), this.xfaFactory) return;
      if (s = this.linearization ? this.linearization.numPages : e.numPages, !Number.isInteger(s)) throw new ht("Page count is not an integer.");
      if (s <= 1) return;
      await this.getPage(s - 1);
    } catch (r) {
      if (m(this, t0).delete(s - 1), await this.cleanup(), r instanceof e0 && !t) throw new Cu();
      H(`checkLastPage - invalid /Pages tree /Count: ${s}.`);
      let a;
      try {
        a = await e.getAllPageDicts(t);
      } catch (o) {
        if (o instanceof e0 && !t) throw new Cu();
        e.setActualNumPages(1);
        return;
      }
      for (const [o, [l, c]] of a) {
        let h;
        l instanceof Error ? (h = Promise.reject(l), h.catch(() => {
        })) : h = Promise.resolve(new Dx({ pdfManager: n, xref: this.xref, pageIndex: o, pageDict: l, ref: c, globalIdFactory: this._globalIdFactory, fontCache: e.fontCache, builtInCMapCache: e.builtInCMapCache, standardFontDataCache: e.standardFontDataCache, globalColorSpaceCache: this.globalColorSpaceCache, globalImageCache: e.globalImageCache, systemFontCache: e.systemFontCache, nonBlendModesSet: e.nonBlendModesSet, xfaFactory: null })), m(this, t0).set(o, h);
      }
      e.setActualNumPages(a.size);
    }
  }
  async fontFallback(t, e) {
    const { catalog: n, pdfManager: s } = this;
    for (const r of await Promise.all(n.fontCache)) if (r.loadedName === t) {
      r.fallback(e, s.evaluatorOptions);
      return;
    }
  }
  async cleanup(t = !1) {
    return this.catalog ? this.catalog.cleanup(t) : rw();
  }
  get fieldObjects() {
    return At(this, "fieldObjects", this.pdfManager.ensureDoc("formInfo").then(async (t) => {
      if (!t.hasFields) return null;
      const e = await this.annotationGlobals;
      if (!e) return null;
      const { acroForm: n } = e, s = new $i(), r = /* @__PURE__ */ Object.create(null), a = /* @__PURE__ */ new Map(), o = new Ts();
      for (const c of n.get("Fields")) await D(this, Ps, iy).call(this, "", null, c, a, e, s, o);
      const l = [];
      for (const [c, h] of a) l.push(Promise.all(h).then((u) => {
        (u = u.filter((f) => !!f)).length > 0 && (r[c] = u);
      }));
      return await Promise.all(l), { allFields: jy(r) > 0 ? r : null, orphanFields: o };
    }));
  }
  get hasJSActions() {
    return At(this, "hasJSActions", this.pdfManager.ensureDoc("_parseHasJSActions"));
  }
  async _parseHasJSActions() {
    const [t, e] = await Promise.all([this.pdfManager.ensureCatalog("jsActions"), this.pdfManager.ensureDoc("fieldObjects")]);
    return !!t || !!(e != null && e.allFields) && Object.values(e.allFields).some((n) => n.some((s) => s.actions !== null));
  }
  get calculationOrderIds() {
    var n;
    const t = (n = this.catalog.acroForm) == null ? void 0 : n.get("CO");
    if (!Array.isArray(t) || t.length === 0) return At(this, "calculationOrderIds", null);
    const e = [];
    for (const s of t) s instanceof Dt && e.push(s.toString());
    return At(this, "calculationOrderIds", e.length ? e : null);
  }
  get annotationGlobals() {
    return At(this, "annotationGlobals", pc.createGlobals(this.pdfManager));
  }
}
t0 = new WeakMap(), fg = new WeakMap(), Ps = new WeakSet(), ey = function(t, e = 0) {
  return !!Array.isArray(t) && t.every((n) => {
    if (!((n = this.xref.fetchIfRef(n)) instanceof Z)) return !1;
    if (n.has("Kids"))
      return ++e > 10 ? (H("#hasOnlyDocumentSignatures: maximum recursion depth reached"), !1) : D(this, Ps, ey).call(this, n.get("Kids"), e);
    const s = ki(n.get("FT"), "Sig"), r = n.get("Rect"), a = Array.isArray(r) && r.every((o) => o === 0);
    return s && a;
  });
}, UT = async function() {
  const t = await this.pdfManager.ensureCatalog("xfaImages");
  t && this.xfaFactory.setImages(t);
}, HT = async function(t, e) {
  const n = await this.pdfManager.ensureCatalog("acroForm");
  if (!n) return;
  const s = await n.getAsync("DR");
  if (!(s instanceof Z)) return;
  await rf.load(s, ["Font"], this.xref);
  const r = s.get("Font");
  if (!(r instanceof Z)) return;
  const a = Object.assign(/* @__PURE__ */ Object.create(null), this.pdfManager.evaluatorOptions, { useSystemFonts: !1 }), { builtInCMapCache: o, fontCache: l, standardFontDataCache: c } = this.catalog, h = new nf({ xref: this.xref, handler: t, pageIndex: -1, idFactory: this._globalIdFactory, fontCache: l, builtInCMapCache: o, standardFontDataCache: c, options: a }), u = new Xn(), f = [], d = { get font() {
    return f.at(-1);
  }, set font(v) {
    f.push(v);
  }, clone() {
    return this;
  } }, p = (v, w, _) => h.handleSetFont(s, [lt.get(v), 1], null, u, e, d, w, _).catch((x) => (H(`loadXfaFonts: "${x}".`), null)), g = [];
  for (const [v, w] of r) {
    const _ = w.get("FontDescriptor");
    if (!(_ instanceof Z)) continue;
    let x = _.get("FontFamily");
    x = x.replaceAll(/[ ]+(\d)/g, "$1");
    const k = { fontFamily: x, fontWeight: _.get("FontWeight"), italicAngle: -_.get("ItalicAngle") };
    UB(k) && g.push(p(v, null, k));
  }
  await Promise.all(g);
  const b = this.xfaFactory.setFonts(f);
  if (!b) return;
  a.ignoreErrors = !0, g.length = 0, f.length = 0;
  const y = /* @__PURE__ */ new Set();
  for (const v of b) iw(`${v}-Regular`) || y.add(v);
  y.size && b.push("PdfJS-Fallback");
  for (const v of b) if (!y.has(v)) for (const w of [{ name: "Regular", fontWeight: 400, italicAngle: 0 }, { name: "Bold", fontWeight: 700, italicAngle: 0 }, { name: "Italic", fontWeight: 400, italicAngle: 12 }, { name: "BoldItalic", fontWeight: 700, italicAngle: 12 }]) {
    const _ = `${v}-${w.name}`;
    g.push(p(_, AD(_), { fontFamily: v, fontWeight: w.fontWeight, italicAngle: w.italicAngle }));
  }
  await Promise.all(g), this.xfaFactory.appendFonts(f, y);
}, jT = async function(t) {
  const { catalog: e, linearization: n, xref: s } = this, r = Dt.get(n.objectNumberFirst, 0);
  try {
    const a = await s.fetchAsync(r);
    if (a instanceof Z) {
      let o = a.getRaw("Type");
      if (o instanceof Dt && (o = await s.fetchAsync(o)), ki(o, "Page") || !a.has("Type") && !a.has("Kids") && a.has("Contents"))
        return e.pageKidsCountCache.has(r) || e.pageKidsCountCache.put(r, 1), e.pageIndexCache.has(r) || e.pageIndexCache.put(r, 0), [a, r];
    }
    throw new ht("The Linearization dictionary doesn't point to a valid Page dictionary.");
  } catch (a) {
    return H(`_getLinearizationPage: "${a.message}".`), e.getPageDict(t);
  }
}, iy = async function(t, e, n, s, r, a, o) {
  const { xref: l } = this;
  if (!(n instanceof Dt) || a.has(n)) return;
  a.put(n);
  const c = await l.fetchAsync(n);
  if (!(c instanceof Z)) return;
  let h = await c.getAsync("Subtype");
  if (h = h instanceof lt ? h.name : null, h === "Link") return;
  if (c.has("T")) {
    const f = xe(await c.getAsync("T"));
    t = t === "" ? f : `${t}.${f}`;
  } else {
    let f = c;
    for (; ; ) {
      if (f = f.getRaw("Parent") || e, f instanceof Dt) {
        if (a.has(f)) break;
        f = await l.fetchAsync(f);
      }
      if (!(f instanceof Z)) break;
      if (f.has("T")) {
        const d = xe(await f.getAsync("T"));
        t = t === "" ? d : `${t}.${d}`;
        break;
      }
    }
  }
  if (e && !c.has("Parent") && ki(c.get("Subtype"), "Widget") && o.put(n, e), s.has(t) || s.set(t, []), s.get(t).push(pc.create(l, n, r, null, !0, o, null).then((f) => f == null ? void 0 : f.getFieldObject()).catch(function(f) {
    return H(`#collectFieldObjects: "${f}".`), null;
  })), !c.has("Kids")) return;
  const u = await c.getAsync("Kids");
  if (Array.isArray(u)) for (const f of u) await D(this, Ps, iy).call(this, t, n, f, s, r, a, o);
};
class GT {
  constructor({ docBaseUrl: t, docId: e, enableXfa: n, evaluatorOptions: s, handler: r, password: a }) {
    this._docBaseUrl = function(c) {
      if (c) {
        const h = a3(c);
        if (h) return h.href;
        H(`Invalid absolute docBaseUrl: "${c}".`);
      }
      return null;
    }(t), this._docId = e, this._password = a, this.enableXfa = n, s.isOffscreenCanvasSupported && (s.isOffscreenCanvasSupported = Rs.isOffscreenCanvasSupported), s.isImageDecoderSupported && (s.isImageDecoderSupported = Rs.isImageDecoderSupported), this.evaluatorOptions = Object.freeze(s), aa.setOptions(s), tf.setOptions(s), Xn.setOptions(s);
    const o = { ...s, handler: r };
    va.setOptions(o), k1.setOptions(o), rp.setOptions(o);
  }
  get docId() {
    return this._docId;
  }
  get password() {
    return this._password;
  }
  get docBaseUrl() {
    return this._docBaseUrl;
  }
  ensureDoc(t, e) {
    return this.ensure(this.pdfDocument, t, e);
  }
  ensureXRef(t, e) {
    return this.ensure(this.pdfDocument.xref, t, e);
  }
  ensureCatalog(t, e) {
    return this.ensure(this.pdfDocument.catalog, t, e);
  }
  getPage(t) {
    return this.pdfDocument.getPage(t);
  }
  fontFallback(t, e) {
    return this.pdfDocument.fontFallback(t, e);
  }
  cleanup(t = !1) {
    return this.pdfDocument.cleanup(t);
  }
  async ensure(t, e, n) {
    ye("Abstract method `ensure` called");
  }
  requestRange(t, e) {
    ye("Abstract method `requestRange` called");
  }
  requestLoadedStream(t = !1) {
    ye("Abstract method `requestLoadedStream` called");
  }
  sendProgressiveData(t) {
    ye("Abstract method `sendProgressiveData` called");
  }
  updatePassword(t) {
    this._password = t;
  }
  terminate(t) {
    ye("Abstract method `terminate` called");
  }
}
class Ix extends GT {
  constructor(t) {
    super(t);
    const e = new gi(t.source);
    this.pdfDocument = new zT(this, e), this._loadedStreamPromise = Promise.resolve(e);
  }
  async ensure(t, e, n) {
    const s = t[e];
    return typeof s == "function" ? s.apply(t, n) : s;
  }
  requestRange(t, e) {
    return Promise.resolve();
  }
  requestLoadedStream(t = !1) {
    return this._loadedStreamPromise;
  }
  terminate(t) {
  }
}
class bj extends GT {
  constructor(t) {
    super(t), this.streamManager = new eP(t.source, { msgHandler: t.handler, length: t.length, disableAutoFetch: t.disableAutoFetch, rangeChunkSize: t.rangeChunkSize }), this.pdfDocument = new zT(this, this.streamManager.getStream());
  }
  async ensure(t, e, n) {
    try {
      const s = t[e];
      return typeof s == "function" ? s.apply(t, n) : s;
    } catch (s) {
      if (!(s instanceof ti)) throw s;
      return await this.requestRange(s.begin, s.end), this.ensure(t, e, n);
    }
  }
  requestRange(t, e) {
    return this.streamManager.requestRange(t, e);
  }
  requestLoadedStream(t = !1) {
    return this.streamManager.requestAllChunks(t);
  }
  sendProgressiveData(t) {
    this.streamManager.onReceiveData({ chunk: t });
  }
  terminate(t) {
    this.streamManager.abort(t);
  }
}
const Mx = 1, Rx = 2, Bx = 1, H6 = 2, Px = 3, Nx = 4, Lx = 5, Ox = 6, f5 = 7, j6 = 8;
function $x() {
}
function $s(i) {
  if (i instanceof xn || i instanceof ip || i instanceof ep || i instanceof e_ || i instanceof p6) return i;
  switch (i instanceof Error || typeof i == "object" && i !== null || ye('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), i.name) {
    case "AbortException":
      return new xn(i.message);
    case "InvalidPDFException":
      return new ip(i.message);
    case "PasswordException":
      return new ep(i.message, i.code);
    case "ResponseException":
      return new e_(i.message, i.status, i.missing);
    case "UnknownErrorException":
      return new p6(i.message, i.details);
  }
  return new p6(i.message, i.toString());
}
var Xd, jr, VT, WT, XT, T9;
class qx {
  constructor(t, e, n) {
    F(this, jr);
    F(this, Xd, new AbortController());
    this.sourceName = t, this.targetName = e, this.comObj = n, 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), n.addEventListener("message", D(this, jr, VT).bind(this), { signal: m(this, Xd).signal });
  }
  on(t, e) {
    const n = this.actionHandler;
    if (n[t]) throw new Error(`There is already an actionName called "${t}"`);
    n[t] = e;
  }
  send(t, e, n) {
    this.comObj.postMessage({ sourceName: this.sourceName, targetName: this.targetName, action: t, data: e }, n);
  }
  sendWithPromise(t, e, n) {
    const s = this.callbackId++, r = Promise.withResolvers();
    this.callbackCapabilities[s] = r;
    try {
      this.comObj.postMessage({ sourceName: this.sourceName, targetName: this.targetName, action: t, callbackId: s, data: e }, n);
    } catch (a) {
      r.reject(a);
    }
    return r.promise;
  }
  sendWithStream(t, e, n, s) {
    const r = this.streamId++, a = this.sourceName, o = this.targetName, l = this.comObj;
    return new ReadableStream({ start: (c) => {
      const h = Promise.withResolvers();
      return this.streamControllers[r] = { controller: c, startCall: h, pullCall: null, cancelCall: null, isClosed: !1 }, l.postMessage({ sourceName: a, targetName: o, action: t, streamId: r, data: e, desiredSize: c.desiredSize }, s), h.promise;
    }, pull: (c) => {
      const h = Promise.withResolvers();
      return this.streamControllers[r].pullCall = h, l.postMessage({ sourceName: a, targetName: o, stream: Ox, streamId: r, desiredSize: c.desiredSize }), h.promise;
    }, cancel: (c) => {
      pn(c instanceof Error, "cancel must have a valid reason");
      const h = Promise.withResolvers();
      return this.streamControllers[r].cancelCall = h, this.streamControllers[r].isClosed = !0, l.postMessage({ sourceName: a, targetName: o, stream: Bx, streamId: r, reason: $s(c) }), h.promise;
    } }, n);
  }
  destroy() {
    var t;
    (t = m(this, Xd)) == null || t.abort(), E(this, Xd, null);
  }
}
Xd = new WeakMap(), jr = new WeakSet(), VT = function({ data: t }) {
  if (t.targetName !== this.sourceName) return;
  if (t.stream) {
    D(this, jr, XT).call(this, t);
    return;
  }
  if (t.callback) {
    const n = t.callbackId, s = this.callbackCapabilities[n];
    if (!s) throw new Error(`Cannot resolve callback ${n}`);
    if (delete this.callbackCapabilities[n], t.callback === Mx) s.resolve(t.data);
    else {
      if (t.callback !== Rx) throw new Error("Unexpected callback case");
      s.reject($s(t.reason));
    }
    return;
  }
  const e = this.actionHandler[t.action];
  if (!e) throw new Error(`Unknown action from worker: ${t.action}`);
  if (t.callbackId) {
    const n = this.sourceName, s = t.sourceName, r = this.comObj;
    Promise.try(e, t.data).then(function(a) {
      r.postMessage({ sourceName: n, targetName: s, callback: Mx, callbackId: t.callbackId, data: a });
    }, function(a) {
      r.postMessage({ sourceName: n, targetName: s, callback: Rx, callbackId: t.callbackId, reason: $s(a) });
    });
  } else t.streamId ? D(this, jr, WT).call(this, t) : e(t.data);
}, WT = function(t) {
  const e = t.streamId, n = this.sourceName, s = t.sourceName, r = this.comObj, a = this, o = this.actionHandler[t.action], l = { enqueue(c, h = 1, u) {
    if (this.isCancelled) return;
    const f = this.desiredSize;
    this.desiredSize -= h, f > 0 && this.desiredSize <= 0 && (this.sinkCapability = Promise.withResolvers(), this.ready = this.sinkCapability.promise), r.postMessage({ sourceName: n, targetName: s, stream: Nx, streamId: e, chunk: c }, u);
  }, close() {
    this.isCancelled || (this.isCancelled = !0, r.postMessage({ sourceName: n, targetName: s, stream: Px, streamId: e }), delete a.streamSinks[e]);
  }, error(c) {
    pn(c instanceof Error, "error must have a valid reason"), this.isCancelled || (this.isCancelled = !0, r.postMessage({ sourceName: n, targetName: s, stream: Lx, streamId: e, reason: $s(c) }));
  }, sinkCapability: Promise.withResolvers(), onPull: null, onCancel: null, isCancelled: !1, desiredSize: t.desiredSize, ready: null };
  l.sinkCapability.resolve(), l.ready = l.sinkCapability.promise, this.streamSinks[e] = l, Promise.try(o, t.data, l).then(function() {
    r.postMessage({ sourceName: n, targetName: s, stream: j6, streamId: e, success: !0 });
  }, function(c) {
    r.postMessage({ sourceName: n, targetName: s, stream: j6, streamId: e, reason: $s(c) });
  });
}, XT = function(t) {
  const e = t.streamId, n = this.sourceName, s = t.sourceName, r = this.comObj, a = this.streamControllers[e], o = this.streamSinks[e];
  switch (t.stream) {
    case j6:
      t.success ? a.startCall.resolve() : a.startCall.reject($s(t.reason));
      break;
    case f5:
      t.success ? a.pullCall.resolve() : a.pullCall.reject($s(t.reason));
      break;
    case Ox:
      if (!o) {
        r.postMessage({ sourceName: n, targetName: s, stream: f5, streamId: e, success: !0 });
        break;
      }
      o.desiredSize <= 0 && t.desiredSize > 0 && o.sinkCapability.resolve(), o.desiredSize = t.desiredSize, Promise.try(o.onPull || $x).then(function() {
        r.postMessage({ sourceName: n, targetName: s, stream: f5, streamId: e, success: !0 });
      }, function(c) {
        r.postMessage({ sourceName: n, targetName: s, stream: f5, streamId: e, reason: $s(c) });
      });
      break;
    case Nx:
      if (pn(a, "enqueue should have stream controller"), a.isClosed) break;
      a.controller.enqueue(t.chunk);
      break;
    case Px:
      if (pn(a, "close should have stream controller"), a.isClosed) break;
      a.isClosed = !0, a.controller.close(), D(this, jr, T9).call(this, a, e);
      break;
    case Lx:
      pn(a, "error should have stream controller"), a.controller.error($s(t.reason)), D(this, jr, T9).call(this, a, e);
      break;
    case H6:
      t.success ? a.cancelCall.resolve() : a.cancelCall.reject($s(t.reason)), D(this, jr, T9).call(this, a, e);
      break;
    case Bx:
      if (!o) break;
      const l = $s(t.reason);
      Promise.try(o.onCancel || $x, l).then(function() {
        r.postMessage({ sourceName: n, targetName: s, stream: H6, streamId: e, success: !0 });
      }, function(c) {
        r.postMessage({ sourceName: n, targetName: s, stream: H6, streamId: e, reason: $s(c) });
      }), o.sinkCapability.reject(l), o.isCancelled = !0, delete this.streamSinks[e];
      break;
    default:
      throw new Error("Unexpected stream case");
  }
}, T9 = async function(t, e) {
  var n, s, r;
  await Promise.allSettled([(n = t.startCall) == null ? void 0 : n.promise, (s = t.pullCall) == null ? void 0 : s.promise, (r = t.cancelCall) == null ? void 0 : r.promise]), delete this.streamControllers[e];
};
async function zx(i, t, e, { encrypt: n = null }) {
  const s = n == null ? void 0 : n.createCipherTransform(i.num, i.gen);
  e.push(`${i.num} ${i.gen} obj
`), t instanceof Z ? await V4(t, e, s) : t instanceof oe ? await YT(t, e, s) : (Array.isArray(t) || ArrayBuffer.isView(t)) && await KT(t, e, s), e.push(`
endobj
`);
}
async function V4(i, t, e) {
  t.push("<<");
  for (const n of i.getKeys())
    t.push(` /${Gy(n)} `), await ZT(i.getRaw(n), t, e);
  t.push(">>");
}
async function YT(i, t, e) {
  let n = i.getBytes();
  const { dict: s } = i, [r, a] = await Promise.all([s.getAsync("Filter"), s.getAsync("DecodeParms")]), o = ki(Array.isArray(r) ? await s.xref.fetchIfRefAsync(r[0]) : r, "FlateDecode");
  if (n.length >= 256 || o) try {
    const c = new CompressionStream("deflate"), h = c.writable.getWriter();
    await h.ready, h.write(n).then(async () => {
      await h.ready, await h.close();
    }).catch(() => {
    });
    const u = await new Response(c.readable).arrayBuffer();
    n = new Uint8Array(u);
    let f, d;
    r ? o || (f = Array.isArray(r) ? [lt.get("FlateDecode"), ...r] : [lt.get("FlateDecode"), r], a && (d = Array.isArray(a) ? [null, ...a] : [null, a])) : f = lt.get("FlateDecode"), f && s.set("Filter", f), d && s.set("DecodeParms", d);
  } catch (c) {
    ue(`writeStream - cannot compress data: "${c}".`);
  }
  let l = Is(n);
  e && (l = e.encryptString(l)), s.set("Length", l.length), await V4(s, t, e), t.push(` stream
`, l, `
endstream`);
}
async function KT(i, t, e) {
  t.push("[");
  let n = !0;
  for (const s of i)
    n ? n = !1 : t.push(" "), await ZT(s, t, e);
  t.push("]");
}
async function ZT(i, t, e) {
  i instanceof lt ? t.push(`/${Gy(i.name)}`) : i instanceof Dt ? t.push(`${i.num} ${i.gen} R`) : Array.isArray(i) || ArrayBuffer.isView(i) ? await KT(i, t, e) : typeof i == "string" ? (e && (i = e.encryptString(i)), t.push(`(${Qd(i)})`)) : typeof i == "number" ? t.push(be(i)) : typeof i == "boolean" ? t.push(i.toString()) : i instanceof Z ? await V4(i, t, e) : i instanceof oe ? await YT(i, t, e) : i === null ? t.push("null") : H(`Unhandled value in writer: ${typeof i}, please file a bug.`);
}
function G6(i, t, e, n) {
  for (let s = t + e - 1; s > e - 1; s--)
    n[s] = 255 & i, i >>= 8;
  return e + t;
}
function JT(i, t, e) {
  const n = i.length;
  for (let s = 0; s < n; s++) e[t + s] = 255 & i.charCodeAt(s);
  return t + n;
}
function yj({ xfaData: i, xfaDatasetsRef: t, changes: e, xref: n }) {
  i === null && (i = function(a, o) {
    const l = new P4({ hasAttributes: !0 }).parseFromString(a);
    for (const { xfa: h } of o) {
      if (!h) continue;
      const { path: u, value: f } = h;
      if (!u) continue;
      const d = OE(u);
      let p = l.documentElement.searchNode(d, 0);
      !p && d.length > 1 && (p = l.documentElement.searchNode([d.at(-1)], 0)), p ? p.childNodes = Array.isArray(f) ? f.map((g) => new R2("value", g)) : [new R2("#text", f)] : H(`Node not found for path: ${u}`);
    }
    const c = [];
    return l.documentElement.dump(c), c.join("");
  }(n.fetchIfRef(t).getString(), e));
  const s = new fs(i);
  s.dict = new Z(n), s.dict.set("Type", lt.get("EmbeddedFile")), e.put(t, { data: s });
}
function Ux(i) {
  const t = [];
  for (const { ref: e } of i) e.num === t.at(-2) + t.at(-1) ? t[t.length - 1] += 1 : t.push(e.num, 1);
  return t;
}
function Hx(i, t, e) {
  if (Array.isArray(t.fileIds) && t.fileIds.length > 0) {
    const n = function(r, a) {
      const o = Math.floor(Date.now() / 1e3), l = a.filename || "", c = [o.toString(), l, r.toString(), ...a.infoMap.values()], h = Math.sumPrecise(c.map((d) => d.length)), u = new Uint8Array(h);
      let f = 0;
      for (const d of c) f = JT(d, f, u);
      return Is(hc(u, 0, u.length));
    }(i, t);
    e.set("ID", [t.fileIds[0], n]);
  }
}
async function wj({ originalData: i, xrefInfo: t, changes: e, xref: n = null, hasXfa: s = !1, xfaDatasetsRef: r = null, hasXfaDatasetsEntry: a = !1, needAppearances: o, acroFormRef: l = null, acroForm: c = null, xfaData: h = null, useXrefStream: u = !1 }) {
  await async function({ xref: x, acroForm: k, acroFormRef: S, hasXfa: T, hasXfaDatasetsEntry: I, xfaDatasetsRef: R, needAppearances: B, changes: L }) {
    if (!T || I || R || H("XFA - Cannot save it"), !B && (!T || !R || I)) return;
    const it = k.clone();
    if (T && !I) {
      const O = k.get("XFA").slice();
      O.splice(2, 0, "datasets"), O.splice(3, 0, R), it.set("XFA", O);
    }
    B && it.set("NeedAppearances", !0), L.put(S, { data: it });
  }({ xref: n, acroForm: c, acroFormRef: l, hasXfa: s, hasXfaDatasetsEntry: a, xfaDatasetsRef: r, needAppearances: o, changes: e }), s && yj({ xfaData: h, xfaDatasetsRef: r, changes: e, xref: n });
  const f = function(x, k, S) {
    const T = new Z(null);
    T.set("Prev", x.startXRef);
    const I = x.newRef;
    return S ? (k.put(I, { data: "" }), T.set("Size", I.num + 1), T.set("Type", lt.get("XRef"))) : T.set("Size", I.num), x.rootRef !== null && T.set("Root", x.rootRef), x.infoRef !== null && T.set("Info", x.infoRef), x.encryptRef !== null && T.set("Encrypt", x.encryptRef), T;
  }(t, e, u), d = [], p = await async function(x, k, S = []) {
    const T = [];
    for (const [I, { data: R }] of x.items()) R !== null && typeof R != "string" ? (await zx(I, R, S, k), T.push({ ref: I, data: S.join("") }), S.length = 0) : T.push({ ref: I, data: R });
    return T.sort((I, R) => I.ref.num - R.ref.num);
  }(e, n, d);
  let g = i.length;
  const b = i.at(-1);
  b !== 10 && b !== 13 && (d.push(`
`), g += 1);
  for (const { data: _ } of p) _ !== null && d.push(_);
  await (u ? async function(x, k, S, T, I) {
    const R = [];
    let B = 0, L = 0;
    for (const { ref: K, data: z } of S) {
      let j;
      B = Math.max(B, k), z !== null ? (j = Math.min(K.gen, 65535), R.push([1, k, j]), k += z.length) : (j = Math.min(K.gen + 1, 65535), R.push([0, 0, j])), L = Math.max(L, j);
    }
    T.set("Index", Ux(S));
    const it = [1, s_(B), s_(L)];
    T.set("W", it), Hx(k, x, T);
    const O = Math.sumPrecise(it), at = new Uint8Array(O * R.length), W = new gi(at);
    W.dict = T;
    let q = 0;
    for (const [K, z, j] of R)
      q = G6(K, it[0], q, at), q = G6(z, it[1], q, at), q = G6(j, it[2], q, at);
    await zx(x.newRef, W, I, {}), I.push(`startxref
`, k.toString(), `
%%EOF
`);
  }(t, g, p, f, d) : async function(x, k, S, T, I) {
    I.push(`xref
`);
    const R = Ux(S);
    let B = 0;
    for (const { ref: L, data: it } of S)
      L.num === R[B] && (I.push(`${R[B]} ${R[B + 1]}
`), B += 2), it !== null ? (I.push(`${k.toString().padStart(10, "0")} ${Math.min(L.gen, 65535).toString().padStart(5, "0")} n\r
`), k += it.length) : I.push(`0000000000 ${Math.min(L.gen + 1, 65535).toString().padStart(5, "0")} f\r
`);
    Hx(k, x, T), I.push(`trailer
`), await V4(T, I), I.push(`
startxref
`, k.toString(), `
%%EOF
`);
  }(t, g, p, f, d));
  const y = i.length + Math.sumPrecise(d.map((_) => _.length)), v = new Uint8Array(y);
  v.set(i);
  let w = i.length;
  for (const _ of d) w = JT(_, w, v);
  return v;
}
class vj {
  constructor(t) {
    this._msgHandler = t, this._contentLength = null, this._fullRequestReader = null, this._rangeRequestReaders = [];
  }
  getFullReader() {
    return pn(!this._fullRequestReader, "PDFWorkerStream.getFullReader can only be called once."), this._fullRequestReader = new _j(this._msgHandler), this._fullRequestReader;
  }
  getRangeReader(t, e) {
    const n = new xj(t, e, this._msgHandler);
    return this._rangeRequestReaders.push(n), n;
  }
  cancelAllRequests(t) {
    var e;
    (e = this._fullRequestReader) == null || e.cancel(t);
    for (const n of this._rangeRequestReaders.slice(0)) n.cancel(t);
  }
}
class _j {
  constructor(t) {
    this._msgHandler = t, this.onProgress = null, this._contentLength = null, this._isRangeSupported = !1, this._isStreamingSupported = !1;
    const e = this._msgHandler.sendWithStream("GetReader");
    this._reader = e.getReader(), this._headersReady = this._msgHandler.sendWithPromise("ReaderHeadersReady").then((n) => {
      this._isStreamingSupported = n.isStreamingSupported, this._isRangeSupported = n.isRangeSupported, this._contentLength = n.contentLength;
    });
  }
  get headersReady() {
    return this._headersReady;
  }
  get contentLength() {
    return this._contentLength;
  }
  get isStreamingSupported() {
    return this._isStreamingSupported;
  }
  get isRangeSupported() {
    return this._isRangeSupported;
  }
  async read() {
    const { value: t, done: e } = await this._reader.read();
    return e ? { value: void 0, done: !0 } : { value: t.buffer, done: !1 };
  }
  cancel(t) {
    this._reader.cancel(t);
  }
}
class xj {
  constructor(t, e, n) {
    this._msgHandler = n, this.onProgress = null;
    const s = this._msgHandler.sendWithStream("GetRangeReader", { begin: t, end: e });
    this._reader = s.getReader();
  }
  get isStreamingSupported() {
    return !1;
  }
  async read() {
    const { value: t, done: e } = await this._reader.read();
    return e ? { value: void 0, done: !0 } : { value: t.buffer, done: !1 };
  }
  cancel(t) {
    this._reader.cancel(t);
  }
}
class I0 {
  constructor(t) {
    this.name = t, this.terminated = !1, this._capability = Promise.withResolvers();
  }
  get finished() {
    return this._capability.promise;
  }
  finish() {
    this._capability.resolve();
  }
  terminate() {
    this.terminated = !0;
  }
  ensureNotTerminated() {
    if (this.terminated) throw new Error("Worker task was terminated");
  }
}
const lv = class lv {
  static setup(t, e) {
    let n = !1;
    t.on("test", (s) => {
      n || (n = !0, t.send("test", s instanceof Uint8Array));
    }), t.on("configure", (s) => {
      (function(a) {
        Number.isInteger(a) && (I4 = a);
      })(s.verbosity);
    }), t.on("GetDocRequest", (s) => this.createDocumentHandler(s, e));
  }
  static createDocumentHandler(t, e) {
    let n, s = !1, r = null;
    const a = /* @__PURE__ */ new Set(), o = NB(), { docId: l, apiVersion: c } = t, h = "5.3.31";
    if (c !== h) throw new Error(`The API version "${c}" does not match the Worker version "${h}".`);
    const u = (w, _) => `The \`${w}.prototype\` contains unexpected enumerable property "${_}", thus breaking e.g. \`for...in\` iteration of ${w}s.`;
    for (const w in {}) throw new Error(u("Object", w));
    for (const w in []) throw new Error(u("Array", w));
    const f = l + "_worker";
    let d = new qx(f, l, e);
    function p() {
      if (s) throw new Error("Worker was terminated");
    }
    function g(w) {
      a.add(w);
    }
    function b(w) {
      w.finish(), a.delete(w);
    }
    async function y(w) {
      await n.ensureDoc("checkHeader"), await n.ensureDoc("parseStartXRef"), await n.ensureDoc("parse", [w]), await n.ensureDoc("checkFirstPage", [w]), await n.ensureDoc("checkLastPage", [w]);
      const _ = await n.ensureDoc("isPureXfa");
      if (_) {
        const S = new I0("loadXfaResources");
        g(S), await n.ensureDoc("loadXfaResources", [d, S]), b(S);
      }
      const [x, k] = await Promise.all([n.ensureDoc("numPages"), n.ensureDoc("fingerprints")]);
      return { numPages: x, fingerprints: k, htmlForXfa: _ ? await n.ensureDoc("htmlForXfa") : null };
    }
    function v(w) {
      function _(S) {
        p(), d.send("GetDoc", { pdfInfo: S });
      }
      function x(S) {
        if (p(), S instanceof ep) {
          const T = new I0(`PasswordException: response ${S.code}`);
          g(T), d.sendWithPromise("PasswordRequest", S).then(function({ password: I }) {
            b(T), n.updatePassword(I), k();
          }).catch(function() {
            b(T), d.send("DocException", S);
          });
        } else d.send("DocException", $s(S));
      }
      function k() {
        p(), y(!1).then(_, function(S) {
          p(), S instanceof Cu ? n.requestLoadedStream().then(function() {
            p(), y(!0).then(_, x);
          }) : x(S);
        });
      }
      p(), async function({ data: T, password: I, disableAutoFetch: R, rangeChunkSize: B, length: L, docBaseUrl: it, enableXfa: O, evaluatorOptions: at }) {
        const W = { source: null, disableAutoFetch: R, docBaseUrl: it, docId: l, enableXfa: O, evaluatorOptions: at, handler: d, length: L, password: I, rangeChunkSize: B };
        if (T)
          return W.source = T, new Ix(W);
        const q = new vj(d), K = q.getFullReader(), z = Promise.withResolvers();
        let j, N = [], Q = 0;
        return K.headersReady.then(function() {
          if (K.isRangeSupported) {
            W.source = q, W.length = K.contentLength, W.disableAutoFetch || (W.disableAutoFetch = K.isStreamingSupported), j = new bj(W);
            for (const Y of N) j.sendProgressiveData(Y);
            N = [], z.resolve(j), r = null;
          }
        }).catch(function(Y) {
          z.reject(Y), r = null;
        }), new Promise(function(Y, et) {
          const $ = function({ value: dt, done: tt }) {
            try {
              if (p(), tt) {
                if (!j) {
                  const ut = LE(N);
                  N = [], L && ut.length !== L && H("reported HTTP length is different from actual"), W.source = ut, j = new Ix(W), z.resolve(j);
                }
                r = null;
                return;
              }
              Q += dt.byteLength, K.isStreamingSupported || d.send("DocProgress", { loaded: Q, total: Math.max(Q, K.contentLength || 0) }), j ? j.sendProgressiveData(dt) : N.push(dt), K.read().then($, et);
            } catch (ut) {
              et(ut);
            }
          };
          K.read().then($, et);
        }).catch(function(Y) {
          z.reject(Y), r = null;
        }), r = (Y) => {
          q.cancelAllRequests(Y);
        }, z.promise;
      }(w).then(function(S) {
        if (s)
          throw S.terminate(new xn("Worker was terminated.")), new Error("Worker was terminated");
        n = S, n.requestLoadedStream(!0).then((T) => {
          d.send("DataLoaded", { length: T.bytes.byteLength });
        });
      }).then(k, x);
    }
    return d.on("GetPage", function(w) {
      return n.getPage(w.pageIndex).then(function(_) {
        return Promise.all([n.ensure(_, "rotate"), n.ensure(_, "ref"), n.ensure(_, "userUnit"), n.ensure(_, "view")]).then(function([x, k, S, T]) {
          return { rotate: x, ref: k, refStr: (k == null ? void 0 : k.toString()) ?? null, userUnit: S, view: T };
        });
      });
    }), d.on("GetPageIndex", function(w) {
      const _ = Dt.get(w.num, w.gen);
      return n.ensureCatalog("getPageIndex", [_]);
    }), d.on("GetDestinations", function(w) {
      return n.ensureCatalog("destinations");
    }), d.on("GetDestination", function(w) {
      return n.ensureCatalog("getDestination", [w.id]);
    }), d.on("GetPageLabels", function(w) {
      return n.ensureCatalog("pageLabels");
    }), d.on("GetPageLayout", function(w) {
      return n.ensureCatalog("pageLayout");
    }), d.on("GetPageMode", function(w) {
      return n.ensureCatalog("pageMode");
    }), d.on("GetViewerPreferences", function(w) {
      return n.ensureCatalog("viewerPreferences");
    }), d.on("GetOpenAction", function(w) {
      return n.ensureCatalog("openAction");
    }), d.on("GetAttachments", function(w) {
      return n.ensureCatalog("attachments");
    }), d.on("GetDocJSActions", function(w) {
      return n.ensureCatalog("jsActions");
    }), d.on("GetPageJSActions", function({ pageIndex: w }) {
      return n.getPage(w).then((_) => n.ensure(_, "jsActions"));
    }), d.on("GetOutline", function(w) {
      return n.ensureCatalog("documentOutline");
    }), d.on("GetOptionalContentConfig", function(w) {
      return n.ensureCatalog("optionalContentConfig");
    }), d.on("GetPermissions", function(w) {
      return n.ensureCatalog("permissions");
    }), d.on("GetMetadata", function(w) {
      return Promise.all([n.ensureDoc("documentInfo"), n.ensureCatalog("metadata")]);
    }), d.on("GetMarkInfo", function(w) {
      return n.ensureCatalog("markInfo");
    }), d.on("GetData", function(w) {
      return n.requestLoadedStream().then((_) => _.bytes);
    }), d.on("GetAnnotations", function({ pageIndex: w, intent: _ }) {
      return n.getPage(w).then(function(x) {
        const k = new I0(`GetAnnotations: page ${w}`);
        return g(k), x.getAnnotationsData(d, k, _).then((S) => (b(k), S), (S) => {
          throw b(k), S;
        });
      });
    }), d.on("GetFieldObjects", function(w) {
      return n.ensureDoc("fieldObjects").then((_) => (_ == null ? void 0 : _.allFields) || null);
    }), d.on("HasJSActions", function(w) {
      return n.ensureDoc("hasJSActions");
    }), d.on("GetCalculationOrderIds", function(w) {
      return n.ensureDoc("calculationOrderIds");
    }), d.on("SaveDocument", async function({ isPureXfa: w, numPages: _, annotationStorage: x, filename: k }) {
      const S = [n.requestLoadedStream(), n.ensureCatalog("acroForm"), n.ensureCatalog("acroFormRef"), n.ensureDoc("startXRef"), n.ensureDoc("xref"), n.ensureDoc("linearization"), n.ensureCatalog("structTreeRoot")], T = new Ts(), I = [], R = w ? null : qE(x), [B, L, it, O, at, W, q] = await Promise.all(S), K = at.trailer.getRaw("Root") || null;
      let z;
      if (R) {
        q ? await q.canUpdateStructTree({ pdfManager: n, newAnnotationsByPage: R }) && (z = q) : await fp.canCreateStructureTree({ catalogRef: K, pdfManager: n, newAnnotationsByPage: R }) && (z = null);
        const tt = pc.generateImages(x.values(), at, n.evaluatorOptions.isOffscreenCanvasSupported), ut = z === void 0 ? I : [];
        for (const [St, G] of R) ut.push(n.getPage(St).then((V) => {
          const nt = new I0(`Save (editor): page ${St}`);
          return g(nt), V.saveNewAnnotations(d, nt, G, tt, T).finally(function() {
            b(nt);
          });
        }));
        z === null ? I.push(Promise.all(ut).then(async () => {
          await fp.createStructureTree({ newAnnotationsByPage: R, xref: at, catalogRef: K, pdfManager: n, changes: T });
        })) : z && I.push(Promise.all(ut).then(async () => {
          await z.updateStructureTree({ newAnnotationsByPage: R, pdfManager: n, changes: T });
        }));
      }
      if (w) I.push(n.ensureDoc("serializeXfaData", [x]));
      else for (let tt = 0; tt < _; tt++) I.push(n.getPage(tt).then(function(ut) {
        const St = new I0(`Save: page ${tt}`);
        return g(St), ut.save(d, St, x, T).finally(function() {
          b(St);
        });
      }));
      const j = await Promise.all(I);
      let N = null;
      if (w) {
        if (N = j[0], !N) return B.bytes;
      } else if (T.size === 0) return B.bytes;
      const Q = it && L instanceof Z && T.values().some((tt) => tt.needAppearances), Y = L instanceof Z && L.get("XFA") || null;
      let et = null, $ = !1;
      if (Array.isArray(Y)) {
        for (let tt = 0, ut = Y.length; tt < ut; tt += 2) Y[tt] === "datasets" && (et = Y[tt + 1], $ = !0);
        et === null && (et = at.getNewTemporaryRef());
      } else Y && H("Unsupported XFA type.");
      let dt = /* @__PURE__ */ Object.create(null);
      if (at.trailer) {
        const tt = /* @__PURE__ */ new Map(), ut = at.trailer.get("Info") || null;
        if (ut instanceof Z) for (const [St, G] of ut) typeof G == "string" && tt.set(St, xe(G));
        dt = { rootRef: K, encryptRef: at.trailer.getRaw("Encrypt") || null, newRef: at.getNewTemporaryRef(), infoRef: at.trailer.getRaw("Info") || null, infoMap: tt, fileIds: at.trailer.get("ID") || null, startXRef: W ? O : at.lastXRefStreamPos ?? O, filename: k };
      }
      return wj({ originalData: B.bytes, xrefInfo: dt, changes: T, xref: at, hasXfa: !!Y, xfaDatasetsRef: et, hasXfaDatasetsEntry: $, needAppearances: Q, acroFormRef: it, acroForm: L, xfaData: N, useXrefStream: PE(at.topDict, "XRef") }).finally(() => {
        at.resetNewTemporaryRef();
      });
    }), d.on("GetOperatorList", function(w, _) {
      const x = w.pageIndex;
      n.getPage(x).then(function(k) {
        const S = new I0(`GetOperatorList: page ${x}`);
        g(S);
        const T = o >= N8 ? Date.now() : 0;
        k.getOperatorList({ handler: d, sink: _, task: S, intent: w.intent, cacheKey: w.cacheKey, annotationStorage: w.annotationStorage, modifiedIds: w.modifiedIds }).then(function(I) {
          b(S), T && ue(`page=${x + 1} - getOperatorList: time=${Date.now() - T}ms, len=${I.length}`), _.close();
        }, function(I) {
          b(S), S.terminated || _.error(I);
        });
      });
    }), d.on("GetTextContent", function(w, _) {
      const { pageIndex: x, includeMarkedContent: k, disableNormalization: S } = w;
      n.getPage(x).then(function(T) {
        const I = new I0("GetTextContent: page " + x);
        g(I);
        const R = o >= N8 ? Date.now() : 0;
        T.extractTextContent({ handler: d, task: I, sink: _, includeMarkedContent: k, disableNormalization: S }).then(function() {
          b(I), R && ue(`page=${x + 1} - getTextContent: time=` + (Date.now() - R) + "ms"), _.close();
        }, function(B) {
          b(I), I.terminated || _.error(B);
        });
      });
    }), d.on("GetStructTree", function(w) {
      return n.getPage(w.pageIndex).then((_) => n.ensure(_, "getStructTree"));
    }), d.on("FontFallback", function(w) {
      return n.fontFallback(w.id, d);
    }), d.on("Cleanup", function(w) {
      return n.cleanup(!0);
    }), d.on("Terminate", function(w) {
      s = !0;
      const _ = [];
      if (n) {
        n.terminate(new xn("Worker was terminated."));
        const x = n.cleanup();
        _.push(x), n = null;
      } else rw();
      r == null || r(new xn("Worker was terminated."));
      for (const x of a)
        _.push(x.finished), x.terminate();
      return Promise.all(_).then(function() {
        d.destroy(), d = null;
      });
    }), d.on("Ready", function(w) {
      v(t), t = null;
    }), f;
  }
  static initializeFromPort(t) {
    const e = new qx("worker", "main", t);
    this.setup(e, t), e.send("ready", null);
  }
};
typeof window > "u" && !kR && typeof self < "u" && typeof self.postMessage == "function" && "onmessage" in self && lv.initializeFromPort(self);
let ny = lv;
globalThis.pdfjsWorker = { WorkerMessageHandler: ny };
const {
  SvelteComponent: kj,
  append_hydration: kn,
  attr: ai,
  children: Il,
  claim_element: Pr,
  claim_space: z0,
  claim_svg_element: jx,
  claim_text: kw,
  detach: Cn,
  element: Nr,
  empty: Gx,
  get_svelte_dataset: D3,
  init: Aj,
  insert_hydration: l0,
  listen: sy,
  noop: T3,
  run_all: Sj,
  safe_not_equal: Cj,
  set_data: Aw,
  space: U0,
  svg_element: Vx,
  text: Sw
} = window.__gradio__svelte__internal, { createEventDispatcher: Ej } = window.__gradio__svelte__internal;
function Dj(i) {
  let t, e = "PDF files only";
  return {
    c() {
      t = Nr("p"), t.textContent = e, this.h();
    },
    l(n) {
      t = Pr(n, "P", { class: !0, "data-svelte-h": !0 }), D3(t) !== "svelte-950tbk" && (t.textContent = e), this.h();
    },
    h() {
      ai(t, "class", "file-type-info svelte-18dkc5v");
    },
    m(n, s) {
      l0(n, t, s);
    },
    p: T3,
    d(n) {
      n && Cn(t);
    }
  };
}
function Tj(i) {
  let t, e;
  return {
    c() {
      t = Nr("p"), e = Sw(
        /*errorMessage*/
        i[2]
      ), this.h();
    },
    l(n) {
      t = Pr(n, "P", { class: !0 });
      var s = Il(t);
      e = kw(
        s,
        /*errorMessage*/
        i[2]
      ), s.forEach(Cn), this.h();
    },
    h() {
      ai(t, "class", "error-message svelte-18dkc5v");
    },
    m(n, s) {
      l0(n, t, s), kn(t, e);
    },
    p(n, s) {
      s & /*errorMessage*/
      4 && Aw(
        e,
        /*errorMessage*/
        n[2]
      );
    },
    d(n) {
      n && Cn(t);
    }
  };
}
function Wx(i) {
  let t, e;
  return {
    c() {
      t = Nr("p"), e = Sw(
        /*fileName*/
        i[0]
      ), this.h();
    },
    l(n) {
      t = Pr(n, "P", { class: !0 });
      var s = Il(t);
      e = kw(
        s,
        /*fileName*/
        i[0]
      ), s.forEach(Cn), this.h();
    },
    h() {
      ai(t, "class", "file-name svelte-18dkc5v");
    },
    m(n, s) {
      l0(n, t, s), kn(t, e);
    },
    p(n, s) {
      s & /*fileName*/
      1 && Aw(
        e,
        /*fileName*/
        n[0]
      );
    },
    d(n) {
      n && Cn(t);
    }
  };
}
function Xx(i) {
  let t, e;
  return {
    c() {
      t = Nr("p"), e = Sw(
        /*progessStatus*/
        i[3]
      ), this.h();
    },
    l(n) {
      t = Pr(n, "P", { class: !0 });
      var s = Il(t);
      e = kw(
        s,
        /*progessStatus*/
        i[3]
      ), s.forEach(Cn), this.h();
    },
    h() {
      ai(t, "class", "progess-status svelte-18dkc5v");
    },
    m(n, s) {
      l0(n, t, s), kn(t, e);
    },
    p(n, s) {
      s & /*progessStatus*/
      8 && Aw(
        e,
        /*progessStatus*/
        n[3]
      );
    },
    d(n) {
      n && Cn(t);
    }
  };
}
function Yx(i) {
  let t, e, n = "Cancel", s, r, a = "Upload and Extract Text", o, l;
  return {
    c() {
      t = Nr("div"), e = Nr("button"), e.textContent = n, s = U0(), r = Nr("button"), r.textContent = a, this.h();
    },
    l(c) {
      t = Pr(c, "DIV", { class: !0 });
      var h = Il(t);
      e = Pr(h, "BUTTON", { class: !0, "data-svelte-h": !0 }), D3(e) !== "svelte-q4w5wr" && (e.textContent = n), s = z0(h), r = Pr(h, "BUTTON", { class: !0, "data-svelte-h": !0 }), D3(r) !== "svelte-ohnl2u" && (r.textContent = a), h.forEach(Cn), this.h();
    },
    h() {
      ai(e, "class", "cancel-button svelte-18dkc5v"), ai(r, "class", "upload-button svelte-18dkc5v"), ai(t, "class", "action-buttons svelte-18dkc5v");
    },
    m(c, h) {
      l0(c, t, h), kn(t, e), kn(t, s), kn(t, r), o || (l = [
        sy(
          e,
          "click",
          /*click_handler*/
          i[6]
        ),
        sy(
          r,
          "click",
          /*dispatchUpload*/
          i[5]
        )
      ], o = !0);
    },
    p: T3,
    d(c) {
      c && Cn(t), o = !1, Sj(l);
    }
  };
}
function Fj(i) {
  let t, e, n, s, r, a, o, l, c, h = '<span class="upload-text-main svelte-18dkc5v">Click to upload</span>', u, f, d, p, g, b, y;
  function v(T, I) {
    return (
      /*errorMessage*/
      T[2] ? Tj : Dj
    );
  }
  let w = v(i), _ = w(i), x = (
    /*fileName*/
    i[0] && Wx(i)
  ), k = (
    /*progessStatus*/
    i[3] && Xx(i)
  ), S = (
    /*selectedFile*/
    i[1] && Yx(i)
  );
  return {
    c() {
      t = Nr("div"), e = Nr("input"), n = U0(), s = Nr("label"), r = Nr("div"), a = Vx("svg"), o = Vx("path"), l = U0(), c = Nr("div"), c.innerHTML = h, u = U0(), _.c(), f = U0(), x && x.c(), d = U0(), k && k.c(), p = U0(), S && S.c(), g = Gx(), this.h();
    },
    l(T) {
      t = Pr(T, "DIV", { class: !0 });
      var I = Il(t);
      e = Pr(I, "INPUT", {
        type: !0,
        accept: !0,
        class: !0,
        id: !0
      }), n = z0(I), s = Pr(I, "LABEL", { for: !0, class: !0 });
      var R = Il(s);
      r = Pr(R, "DIV", { class: !0 });
      var B = Il(r);
      a = jx(B, "svg", {
        xmlns: !0,
        class: !0,
        fill: !0,
        viewBox: !0,
        stroke: !0
      });
      var L = Il(a);
      o = jx(L, "path", {
        "stroke-linecap": !0,
        "stroke-linejoin": !0,
        "stroke-width": !0,
        d: !0
      }), Il(o).forEach(Cn), L.forEach(Cn), l = z0(B), c = Pr(B, "DIV", { class: !0, "data-svelte-h": !0 }), D3(c) !== "svelte-1qejmv7" && (c.innerHTML = h), u = z0(B), _.l(B), f = z0(B), x && x.l(B), d = z0(B), k && k.l(B), B.forEach(Cn), R.forEach(Cn), I.forEach(Cn), p = z0(T), S && S.l(T), g = Gx(), this.h();
    },
    h() {
      ai(e, "type", "file"), ai(e, "accept", ".pdf"), ai(e, "class", "file-input svelte-18dkc5v"), ai(e, "id", "file-upload"), ai(o, "stroke-linecap", "round"), ai(o, "stroke-linejoin", "round"), ai(o, "stroke-width", "2"), ai(o, "d", "M7 16a4 4 0 01-.88-7.903A5 5 0 1115.9 6L16 6a5 5 0 011 9.9M15 13l-3-3m0 0l-3 3m3-3v12"), ai(a, "xmlns", "http://www.w3.org/2000/svg"), ai(a, "class", "icon svelte-18dkc5v"), ai(a, "fill", "none"), ai(a, "viewBox", "0 0 24 24"), ai(a, "stroke", "currentColor"), ai(c, "class", "upload-text svelte-18dkc5v"), ai(r, "class", "label-content svelte-18dkc5v"), ai(s, "for", "file-upload"), ai(s, "class", "file-label svelte-18dkc5v"), ai(t, "class", "upload-container svelte-18dkc5v");
    },
    m(T, I) {
      l0(T, t, I), kn(t, e), kn(t, n), kn(t, s), kn(s, r), kn(r, a), kn(a, o), kn(r, l), kn(r, c), kn(r, u), _.m(r, null), kn(r, f), x && x.m(r, null), kn(r, d), k && k.m(r, null), l0(T, p, I), S && S.m(T, I), l0(T, g, I), b || (y = sy(
        e,
        "change",
        /*handleFileSelect*/
        i[4]
      ), b = !0);
    },
    p(T, [I]) {
      w === (w = v(T)) && _ ? _.p(T, I) : (_.d(1), _ = w(T), _ && (_.c(), _.m(r, f))), /*fileName*/
      T[0] ? x ? x.p(T, I) : (x = Wx(T), x.c(), x.m(r, d)) : x && (x.d(1), x = null), /*progessStatus*/
      T[3] ? k ? k.p(T, I) : (k = Xx(T), k.c(), k.m(r, null)) : k && (k.d(1), k = null), /*selectedFile*/
      T[1] ? S ? S.p(T, I) : (S = Yx(T), S.c(), S.m(g.parentNode, g)) : S && (S.d(1), S = null);
    },
    i: T3,
    o: T3,
    d(T) {
      T && (Cn(t), Cn(p), Cn(g)), _.d(), x && x.d(), k && k.d(), S && S.d(T), b = !1, y();
    }
  };
}
function Ij(i, t, e) {
  let n;
  var s = this && this.__awaiter || function(p, g, b, y) {
    function v(w) {
      return w instanceof b ? w : new b(function(_) {
        _(w);
      });
    }
    return new (b || (b = Promise))(function(w, _) {
      function x(T) {
        try {
          S(y.next(T));
        } catch (I) {
          _(I);
        }
      }
      function k(T) {
        try {
          S(y.throw(T));
        } catch (I) {
          _(I);
        }
      }
      function S(T) {
        T.done ? w(T.value) : v(T.value).then(x, k);
      }
      S((y = y.apply(p, g || [])).next());
    });
  };
  Ir.workerSrc = "https://cdn.bootcss.com/pdf.js/3.11.174/pdf.worker.js";
  const r = Ej();
  let a = "", o = null, l = "", c = "";
  function h(p) {
    e(2, c = "");
    const g = p.target;
    g.files && g.files[0] && (e(1, o = g.files[0]), e(0, a = o.name));
  }
  function u() {
    return s(this, void 0, void 0, function* () {
      if (e(3, n = "Checking file..."), !o) {
        e(3, n = ""), e(2, c = "No file selected. Please select a file to upload.");
        return;
      }
      if (o.type !== "application/pdf") {
        e(3, n = ""), e(1, o = null), e(2, c = "The file you selected is not a PDF. Please select a PDF file and try again.");
        return;
      }
      if (e(3, n = "Extracting text..."), l = yield f(o), o && l.length === 0) {
        e(3, n = ""), e(1, o = null), e(2, c = "No text found in the file. Please select a different file.");
        return;
      }
      r("upload", {
        content: {
          asString: l,
          asFile: o
        },
        type: "pdf"
      }), e(3, n = "Text extracted successfully");
    });
  }
  function f(p) {
    return s(this, void 0, void 0, function* () {
      if (!lE)
        return console.log("pdfjsLib is not initialized"), "";
      if (!p)
        return console.log("no file input"), "";
      const g = yield p.arrayBuffer(), b = yield E4({ data: g }).promise;
      let y = "";
      for (let v = 1; v <= b.numPages; v++) {
        const x = (yield (yield b.getPage(v)).getTextContent()).items.map((k) => k.str).join(" ");
        y += x + `

`;
      }
      return y.trim();
    });
  }
  const d = () => {
    e(1, o = null), e(0, a = ""), e(2, c = ""), e(3, n = "");
  };
  return e(3, n = ""), [
    a,
    o,
    c,
    n,
    h,
    u,
    d
  ];
}
class Mj extends kj {
  constructor(t) {
    super(), Aj(this, t, Ij, Fj, Cj, {});
  }
}
const {
  SvelteComponent: Rj,
  append_hydration: ir,
  attr: Lr,
  children: Rg,
  claim_element: Do,
  claim_space: H0,
  claim_text: Cw,
  detach: ar,
  element: To,
  empty: Kx,
  get_svelte_dataset: F3,
  init: Bj,
  insert_hydration: c0,
  listen: I3,
  noop: ry,
  run_all: QT,
  safe_not_equal: Pj,
  set_data: Ew,
  set_input_value: Zx,
  space: j0,
  text: Dw
} = window.__gradio__svelte__internal, { createEventDispatcher: Nj } = window.__gradio__svelte__internal;
function Jx(i) {
  let t, e;
  return {
    c() {
      t = To("p"), e = Dw(
        /*fileName*/
        i[3]
      ), this.h();
    },
    l(n) {
      t = Do(n, "P", { class: !0 });
      var s = Rg(t);
      e = Cw(
        s,
        /*fileName*/
        i[3]
      ), s.forEach(ar), this.h();
    },
    h() {
      Lr(t, "class", "file-name svelte-16wve4y");
    },
    m(n, s) {
      c0(n, t, s), ir(t, e);
    },
    p(n, s) {
      s & /*fileName*/
      8 && Ew(
        e,
        /*fileName*/
        n[3]
      );
    },
    d(n) {
      n && ar(t);
    }
  };
}
function Qx(i) {
  let t, e = "Fetching PDF...";
  return {
    c() {
      t = To("p"), t.textContent = e, this.h();
    },
    l(n) {
      t = Do(n, "P", { class: !0, "data-svelte-h": !0 }), F3(t) !== "svelte-su2spr" && (t.textContent = e), this.h();
    },
    h() {
      Lr(t, "class", "fetching-message svelte-16wve4y");
    },
    m(n, s) {
      c0(n, t, s);
    },
    d(n) {
      n && ar(t);
    }
  };
}
function tk(i) {
  let t, e;
  return {
    c() {
      t = To("p"), e = Dw(
        /*errorMessage*/
        i[2]
      ), this.h();
    },
    l(n) {
      t = Do(n, "P", { class: !0 });
      var s = Rg(t);
      e = Cw(
        s,
        /*errorMessage*/
        i[2]
      ), s.forEach(ar), this.h();
    },
    h() {
      Lr(t, "class", "error-message svelte-16wve4y");
    },
    m(n, s) {
      c0(n, t, s), ir(t, e);
    },
    p(n, s) {
      s & /*errorMessage*/
      4 && Ew(
        e,
        /*errorMessage*/
        n[2]
      );
    },
    d(n) {
      n && ar(t);
    }
  };
}
function ek(i) {
  let t, e;
  return {
    c() {
      t = To("p"), e = Dw(
        /*progessStatus*/
        i[5]
      ), this.h();
    },
    l(n) {
      t = Do(n, "P", { class: !0 });
      var s = Rg(t);
      e = Cw(
        s,
        /*progessStatus*/
        i[5]
      ), s.forEach(ar), this.h();
    },
    h() {
      Lr(t, "class", "progess-status svelte-16wve4y");
    },
    m(n, s) {
      c0(n, t, s), ir(t, e);
    },
    p(n, s) {
      s & /*progessStatus*/
      32 && Ew(
        e,
        /*progessStatus*/
        n[5]
      );
    },
    d(n) {
      n && ar(t);
    }
  };
}
function ik(i) {
  let t, e, n = "Cancel", s, r, a = "Upload and Extract Text", o, l;
  return {
    c() {
      t = To("div"), e = To("button"), e.textContent = n, s = j0(), r = To("button"), r.textContent = a, this.h();
    },
    l(c) {
      t = Do(c, "DIV", { class: !0 });
      var h = Rg(t);
      e = Do(h, "BUTTON", { class: !0, "data-svelte-h": !0 }), F3(e) !== "svelte-1txfzh9" && (e.textContent = n), s = H0(h), r = Do(h, "BUTTON", { class: !0, "data-svelte-h": !0 }), F3(r) !== "svelte-y6120m" && (r.textContent = a), h.forEach(ar), this.h();
    },
    h() {
      Lr(e, "class", "cancel-button svelte-16wve4y"), Lr(r, "class", "upload-button svelte-16wve4y"), Lr(t, "class", "action-buttons svelte-16wve4y");
    },
    m(c, h) {
      c0(c, t, h), ir(t, e), ir(t, s), ir(t, r), o || (l = [
        I3(
          e,
          "click",
          /*click_handler_1*/
          i[10]
        ),
        I3(
          r,
          "click",
          /*dispatchUpload*/
          i[7]
        )
      ], o = !0);
    },
    p: ry,
    d(c) {
      c && ar(t), o = !1, QT(l);
    }
  };
}
function Lj(i) {
  let t, e, n, s, r = "Get PDF", a, o, l, c, h, u, f, d, p = (
    /*fileName*/
    i[3] && Jx(i)
  ), g = (
    /*fetching*/
    i[4] && Qx()
  ), b = (
    /*errorMessage*/
    i[2] && tk(i)
  ), y = (
    /*progessStatus*/
    i[5] && ek(i)
  ), v = (
    /*selectedFile*/
    i[1] && ik(i)
  );
  return {
    c() {
      t = To("div"), e = To("input"), n = j0(), s = To("button"), s.textContent = r, a = j0(), p && p.c(), o = j0(), g && g.c(), l = j0(), b && b.c(), c = j0(), y && y.c(), h = j0(), v && v.c(), u = Kx(), this.h();
    },
    l(w) {
      t = Do(w, "DIV", { class: !0 });
      var _ = Rg(t);
      e = Do(_, "INPUT", {
        type: !0,
        class: !0,
        placeholder: !0
      }), n = H0(_), s = Do(_, "BUTTON", { class: !0, "data-svelte-h": !0 }), F3(s) !== "svelte-11gw4mi" && (s.textContent = r), a = H0(_), p && p.l(_), o = H0(_), g && g.l(_), l = H0(_), b && b.l(_), c = H0(_), y && y.l(_), _.forEach(ar), h = H0(w), v && v.l(w), u = Kx(), this.h();
    },
    h() {
      Lr(e, "type", "url"), Lr(e, "class", "url-input svelte-16wve4y"), Lr(e, "placeholder", "Enter PDF URL..."), Lr(s, "class", "get-pdf-button svelte-16wve4y"), Lr(t, "class", "upload-url-container svelte-16wve4y");
    },
    m(w, _) {
      c0(w, t, _), ir(t, e), Zx(
        e,
        /*pdfUrl*/
        i[0]
      ), ir(t, n), ir(t, s), ir(t, a), p && p.m(t, null), ir(t, o), g && g.m(t, null), ir(t, l), b && b.m(t, null), ir(t, c), y && y.m(t, null), c0(w, h, _), v && v.m(w, _), c0(w, u, _), f || (d = [
        I3(
          e,
          "input",
          /*input_input_handler*/
          i[8]
        ),
        I3(
          s,
          "click",
          /*click_handler*/
          i[9]
        )
      ], f = !0);
    },
    p(w, [_]) {
      _ & /*pdfUrl*/
      1 && e.value !== /*pdfUrl*/
      w[0] && Zx(
        e,
        /*pdfUrl*/
        w[0]
      ), /*fileName*/
      w[3] ? p ? p.p(w, _) : (p = Jx(w), p.c(), p.m(t, o)) : p && (p.d(1), p = null), /*fetching*/
      w[4] ? g || (g = Qx(), g.c(), g.m(t, l)) : g && (g.d(1), g = null), /*errorMessage*/
      w[2] ? b ? b.p(w, _) : (b = tk(w), b.c(), b.m(t, c)) : b && (b.d(1), b = null), /*progessStatus*/
      w[5] ? y ? y.p(w, _) : (y = ek(w), y.c(), y.m(t, null)) : y && (y.d(1), y = null), /*selectedFile*/
      w[1] ? v ? v.p(w, _) : (v = ik(w), v.c(), v.m(u.parentNode, u)) : v && (v.d(1), v = null);
    },
    i: ry,
    o: ry,
    d(w) {
      w && (ar(t), ar(h), ar(u)), p && p.d(), g && g.d(), b && b.d(), y && y.d(), v && v.d(w), f = !1, QT(d);
    }
  };
}
function Oj(i, t, e) {
  var n = this && this.__awaiter || function(v, w, _, x) {
    function k(S) {
      return S instanceof _ ? S : new _(function(T) {
        T(S);
      });
    }
    return new (_ || (_ = Promise))(function(S, T) {
      function I(L) {
        try {
          B(x.next(L));
        } catch (it) {
          T(it);
        }
      }
      function R(L) {
        try {
          B(x.throw(L));
        } catch (it) {
          T(it);
        }
      }
      function B(L) {
        L.done ? S(L.value) : k(L.value).then(I, R);
      }
      B((x = x.apply(v, w || [])).next());
    });
  };
  Ir.workerSrc = "https://cdn.bootcss.com/pdf.js/3.11.174/pdf.worker.js";
  const s = Nj();
  let r = "", a = null, o = "", l = "", c = "", h = !1, u = "";
  function f() {
    return n(this, void 0, void 0, function* () {
      if (e(4, h = !0), e(1, a = null), e(2, l = ""), !r) {
        e(4, h = !1), e(2, l = "Please enter a valid URL");
        return;
      }
      const v = yield fetch(r);
      if (!v.ok) {
        e(4, h = !1), e(2, l = `Failed to fetch PDF: ${v.status}`);
        return;
      }
      const w = yield v.blob();
      if (w.size === 0) {
        e(4, h = !1), e(2, l = "The url you provided did not return a PDF. Please check the URL and try again.");
        return;
      }
      if (w.type !== "application/pdf") {
        e(4, h = !1), e(2, l = "The url you provided did not return a PDF. Please check the URL and try again.");
        return;
      }
      e(1, a = new File([w], "downloaded.pdf", { type: w.type })), e(3, c = a.name), e(4, h = !1), e(2, l = "");
    });
  }
  function d() {
    return n(this, void 0, void 0, function* () {
      if (e(5, u = "Checking file..."), !a) {
        e(2, l = "No file selected. Please select a file to upload.");
        return;
      }
      if (e(5, u = "Extracting text..."), o = yield p(a), a && o.length === 0) {
        e(5, u = ""), e(1, a = null), e(2, l = "No text found in the file. Please select a different file.");
        return;
      }
      e(5, u = "Text extracted successfully"), s("upload", {
        content: {
          asString: o,
          asFile: a
        },
        type: "pdf"
      });
    });
  }
  function p(v) {
    return n(this, void 0, void 0, function* () {
      if (!lE)
        return console.log("pdfjsLib is not initialized"), "";
      if (!v)
        return console.log("no file input"), "";
      const w = yield v.arrayBuffer(), _ = yield E4({ data: w }).promise;
      let x = "";
      for (let k = 1; k <= _.numPages; k++) {
        const I = (yield (yield _.getPage(k)).getTextContent()).items.map((R) => R.str).join(" ");
        x += I + `

`;
      }
      return x.trim();
    });
  }
  function g() {
    r = this.value, e(0, r);
  }
  return [
    r,
    a,
    l,
    c,
    h,
    u,
    f,
    d,
    g,
    () => f(),
    () => {
      e(1, a = null), e(3, c = ""), e(2, l = "");
    }
  ];
}
class $j extends Rj {
  constructor(t) {
    super(), Bj(this, t, Oj, Lj, Pj, {});
  }
}
const {
  SvelteComponent: qj,
  append_hydration: zf,
  attr: Uf,
  bubble: nk,
  check_outros: zj,
  children: V6,
  claim_component: tF,
  claim_element: W6,
  claim_space: sk,
  claim_text: rk,
  create_component: eF,
  destroy_component: iF,
  detach: W1,
  element: X6,
  empty: ak,
  group_outros: Uj,
  init: Hj,
  insert_hydration: Y6,
  listen: ok,
  mount_component: nF,
  run_all: jj,
  safe_not_equal: Gj,
  space: lk,
  text: ck,
  transition_in: M3,
  transition_out: R3
} = window.__gradio__svelte__internal;
function Vj(i) {
  let t, e;
  return t = new $j({}), t.$on(
    "upload",
    /*upload_handler_1*/
    i[4]
  ), {
    c() {
      eF(t.$$.fragment);
    },
    l(n) {
      tF(t.$$.fragment, n);
    },
    m(n, s) {
      nF(t, n, s), e = !0;
    },
    i(n) {
      e || (M3(t.$$.fragment, n), e = !0);
    },
    o(n) {
      R3(t.$$.fragment, n), e = !1;
    },
    d(n) {
      iF(t, n);
    }
  };
}
function Wj(i) {
  let t, e;
  return t = new Mj({}), t.$on(
    "upload",
    /*upload_handler*/
    i[3]
  ), {
    c() {
      eF(t.$$.fragment);
    },
    l(n) {
      tF(t.$$.fragment, n);
    },
    m(n, s) {
      nF(t, n, s), e = !0;
    },
    i(n) {
      e || (M3(t.$$.fragment, n), e = !0);
    },
    o(n) {
      R3(t.$$.fragment, n), e = !1;
    },
    d(n) {
      iF(t, n);
    }
  };
}
function Xj(i) {
  let t, e, n, s, r, a, o, l, c, h, u, f, d, p, g;
  const b = [Wj, Vj], y = [];
  function v(w, _) {
    return (
      /*uploadMode*/
      w[0] === "device" ? 0 : 1
    );
  }
  return h = v(i), u = y[h] = b[h](i), {
    c() {
      t = X6("div"), e = X6("button"), n = ck("Upload from Device"), r = lk(), a = X6("button"), o = ck("Upload from URL"), c = lk(), u.c(), f = ak(), this.h();
    },
    l(w) {
      t = W6(w, "DIV", { class: !0 });
      var _ = V6(t);
      e = W6(_, "BUTTON", { class: !0 });
      var x = V6(e);
      n = rk(x, "Upload from Device"), x.forEach(W1), r = sk(_), a = W6(_, "BUTTON", { class: !0 });
      var k = V6(a);
      o = rk(k, "Upload from URL"), k.forEach(W1), _.forEach(W1), c = sk(w), u.l(w), f = ak(), this.h();
    },
    h() {
      Uf(e, "class", s = "upload-mode-button " + /*uploadMode*/
      (i[0] === "device" ? "active" : "") + " svelte-2ax2qy"), Uf(a, "class", l = "upload-mode-button " + /*uploadMode*/
      (i[0] === "url" ? "active" : "") + " svelte-2ax2qy"), Uf(t, "class", "upload-mode-selector svelte-2ax2qy");
    },
    m(w, _) {
      Y6(w, t, _), zf(t, e), zf(e, n), zf(t, r), zf(t, a), zf(a, o), Y6(w, c, _), y[h].m(w, _), Y6(w, f, _), d = !0, p || (g = [
        ok(
          e,
          "click",
          /*click_handler*/
          i[1]
        ),
        ok(
          a,
          "click",
          /*click_handler_1*/
          i[2]
        )
      ], p = !0);
    },
    p(w, [_]) {
      (!d || _ & /*uploadMode*/
      1 && s !== (s = "upload-mode-button " + /*uploadMode*/
      (w[0] === "device" ? "active" : "") + " svelte-2ax2qy")) && Uf(e, "class", s), (!d || _ & /*uploadMode*/
      1 && l !== (l = "upload-mode-button " + /*uploadMode*/
      (w[0] === "url" ? "active" : "") + " svelte-2ax2qy")) && Uf(a, "class", l);
      let x = h;
      h = v(w), h !== x && (Uj(), R3(y[x], 1, 1, () => {
        y[x] = null;
      }), zj(), u = y[h], u || (u = y[h] = b[h](w), u.c()), M3(u, 1), u.m(f.parentNode, f));
    },
    i(w) {
      d || (M3(u), d = !0);
    },
    o(w) {
      R3(u), d = !1;
    },
    d(w) {
      w && (W1(t), W1(c), W1(f)), y[h].d(w), p = !1, jj(g);
    }
  };
}
function Yj(i, t, e) {
  let n = "device";
  const s = () => e(0, n = "device"), r = () => e(0, n = "url");
  function a(l) {
    nk.call(this, i, l);
  }
  function o(l) {
    nk.call(this, i, l);
  }
  return [n, s, r, a, o];
}
class Kj extends qj {
  constructor(t) {
    super(), Hj(this, t, Yj, Xj, Gj, {});
  }
}
const {
  SvelteComponent: Zj,
  append_hydration: G0,
  attr: is,
  children: A2,
  claim_element: pu,
  claim_space: hk,
  claim_text: F9,
  detach: Sa,
  element: mu,
  empty: uk,
  get_svelte_dataset: Jj,
  init: Qj,
  insert_hydration: gu,
  listen: tG,
  noop: dk,
  safe_not_equal: eG,
  set_data: iG,
  space: fk,
  text: I9
} = window.__gradio__svelte__internal;
function pk(i) {
  let t, e, n, s, r, a, o, l, c;
  return {
    c() {
      t = mu("div"), e = mu("object"), n = mu("p"), s = I9("Your browser doesn't support PDF viewing. "), r = mu("a"), a = I9("Click here to download the PDF"), l = I9("."), this.h();
    },
    l(h) {
      t = pu(h, "DIV", { class: !0 });
      var u = A2(t);
      e = pu(u, "OBJECT", {
        data: !0,
        type: !0,
        class: !0,
        title: !0,
        "aria-label": !0,
        role: !0
      });
      var f = A2(e);
      n = pu(f, "P", {});
      var d = A2(n);
      s = F9(d, "Your browser doesn't support PDF viewing. "), r = pu(d, "A", {
        href: !0,
        target: !0,
        "aria-label": !0,
        title: !0
      });
      var p = A2(r);
      a = F9(p, "Click here to download the PDF"), p.forEach(Sa), l = F9(d, "."), d.forEach(Sa), f.forEach(Sa), u.forEach(Sa), this.h();
    },
    h() {
      is(r, "href", o = URL.createObjectURL(
        /*file*/
        i[0]
      )), is(r, "target", "_blank"), is(r, "aria-label", "Download resume PDF"), is(r, "title", "Download PDF"), is(e, "data", c = URL.createObjectURL(
        /*file*/
        i[0]
      )), is(e, "type", "application/pdf"), is(e, "class", "pdf-object svelte-1y7apjc"), is(e, "title", "Resume PDF Viewer"), is(e, "aria-label", "PDF resume document viewer"), is(e, "role", "document"), is(t, "class", "pdf-viewer-container svelte-1y7apjc");
    },
    m(h, u) {
      gu(h, t, u), G0(t, e), G0(e, n), G0(n, s), G0(n, r), G0(r, a), G0(n, l);
    },
    p(h, u) {
      u & /*file*/
      1 && o !== (o = URL.createObjectURL(
        /*file*/
        h[0]
      )) && is(r, "href", o), u & /*file*/
      1 && c !== (c = URL.createObjectURL(
        /*file*/
        h[0]
      )) && is(e, "data", c);
    },
    d(h) {
      h && Sa(t);
    }
  };
}
function mk(i) {
  let t, e = "<p>The PDF will appear here</p>";
  return {
    c() {
      t = mu("div"), t.innerHTML = e, this.h();
    },
    l(n) {
      t = pu(n, "DIV", { class: !0, "data-svelte-h": !0 }), Jj(t) !== "svelte-8k1pwj" && (t.innerHTML = e), this.h();
    },
    h() {
      is(t, "class", "container svelte-1y7apjc");
    },
    m(n, s) {
      gu(n, t, s);
    },
    d(n) {
      n && Sa(t);
    }
  };
}
function nG(i) {
  let t, e = (
    /*showPDF*/
    i[1] ? "Hide PDF" : "Show PDF"
  ), n, s, r, a, o, l, c = (
    /*file*/
    i[0] && /*showPDF*/
    i[1] && pk(i)
  ), h = !/*file*/
  i[0] && mk();
  return {
    c() {
      t = mu("button"), n = I9(e), s = fk(), c && c.c(), r = fk(), h && h.c(), a = uk(), this.h();
    },
    l(u) {
      t = pu(u, "BUTTON", { class: !0 });
      var f = A2(t);
      n = F9(f, e), f.forEach(Sa), s = hk(u), c && c.l(u), r = hk(u), h && h.l(u), a = uk(), this.h();
    },
    h() {
      is(t, "class", "button svelte-1y7apjc");
    },
    m(u, f) {
      gu(u, t, f), G0(t, n), gu(u, s, f), c && c.m(u, f), gu(u, r, f), h && h.m(u, f), gu(u, a, f), o || (l = tG(
        t,
        "click",
        /*click_handler*/
        i[2]
      ), o = !0);
    },
    p(u, [f]) {
      f & /*showPDF*/
      2 && e !== (e = /*showPDF*/
      u[1] ? "Hide PDF" : "Show PDF") && iG(n, e), /*file*/
      u[0] && /*showPDF*/
      u[1] ? c ? c.p(u, f) : (c = pk(u), c.c(), c.m(r.parentNode, r)) : c && (c.d(1), c = null), /*file*/
      u[0] ? h && (h.d(1), h = null) : h || (h = mk(), h.c(), h.m(a.parentNode, a));
    },
    i: dk,
    o: dk,
    d(u) {
      u && (Sa(t), Sa(s), Sa(r), Sa(a)), c && c.d(u), h && h.d(u), o = !1, l();
    }
  };
}
function sG(i, t, e) {
  let { file: n = null } = t, s = !0;
  const r = () => e(1, s = !s);
  return i.$$set = (a) => {
    "file" in a && e(0, n = a.file);
  }, [n, s, r];
}
class rG extends Zj {
  constructor(t) {
    super(), Qj(this, t, sG, nG, eG, { file: 0 });
  }
}
const {
  SvelteComponent: aG,
  append_hydration: oG,
  attr: sF,
  children: rF,
  claim_element: Tw,
  claim_space: lG,
  claim_text: aF,
  detach: r0,
  element: Fw,
  empty: gk,
  get_svelte_dataset: cG,
  init: hG,
  insert_hydration: Iu,
  listen: uG,
  noop: ay,
  safe_not_equal: dG,
  set_data: oF,
  set_style: fG,
  space: pG,
  text: lF
} = window.__gradio__svelte__internal;
function bk(i) {
  let t;
  function e(r, a) {
    return (
      /*textContent*/
      r[0] ? gG : mG
    );
  }
  let n = e(i), s = n(i);
  return {
    c() {
      t = Fw("div"), s.c(), this.h();
    },
    l(r) {
      t = Tw(r, "DIV", { class: !0 });
      var a = rF(t);
      s.l(a), a.forEach(r0), this.h();
    },
    h() {
      sF(t, "class", "scrollable-content svelte-olw9pd");
    },
    m(r, a) {
      Iu(r, t, a), s.m(t, null);
    },
    p(r, a) {
      n === (n = e(r)) && s ? s.p(r, a) : (s.d(1), s = n(r), s && (s.c(), s.m(t, null)));
    },
    d(r) {
      r && r0(t), s.d();
    }
  };
}
function mG(i) {
  let t, e = "The Extracted Text Will Appear Here";
  return {
    c() {
      t = Fw("p"), t.textContent = e, this.h();
    },
    l(n) {
      t = Tw(n, "P", { style: !0, "data-svelte-h": !0 }), cG(t) !== "svelte-1cinss4" && (t.textContent = e), this.h();
    },
    h() {
      fG(t, "text-align", "center");
    },
    m(n, s) {
      Iu(n, t, s);
    },
    p: ay,
    d(n) {
      n && r0(t);
    }
  };
}
function gG(i) {
  let t;
  return {
    c() {
      t = lF(
        /*textContent*/
        i[0]
      );
    },
    l(e) {
      t = aF(
        e,
        /*textContent*/
        i[0]
      );
    },
    m(e, n) {
      Iu(e, t, n);
    },
    p(e, n) {
      n & /*textContent*/
      1 && oF(
        t,
        /*textContent*/
        e[0]
      );
    },
    d(e) {
      e && r0(t);
    }
  };
}
function bG(i) {
  let t, e = (
    /*showTextContent*/
    i[1] ? "Hide Text" : "Show Text"
  ), n, s, r, a, o, l = (
    /*showTextContent*/
    i[1] && bk(i)
  );
  return {
    c() {
      t = Fw("button"), n = lF(e), s = pG(), l && l.c(), r = gk(), this.h();
    },
    l(c) {
      t = Tw(c, "BUTTON", { class: !0 });
      var h = rF(t);
      n = aF(h, e), h.forEach(r0), s = lG(c), l && l.l(c), r = gk(), this.h();
    },
    h() {
      sF(t, "class", "button svelte-olw9pd");
    },
    m(c, h) {
      Iu(c, t, h), oG(t, n), Iu(c, s, h), l && l.m(c, h), Iu(c, r, h), a || (o = uG(
        t,
        "click",
        /*click_handler*/
        i[2]
      ), a = !0);
    },
    p(c, [h]) {
      h & /*showTextContent*/
      2 && e !== (e = /*showTextContent*/
      c[1] ? "Hide Text" : "Show Text") && oF(n, e), /*showTextContent*/
      c[1] ? l ? l.p(c, h) : (l = bk(c), l.c(), l.m(r.parentNode, r)) : l && (l.d(1), l = null);
    },
    i: ay,
    o: ay,
    d(c) {
      c && (r0(t), r0(s), r0(r)), l && l.d(c), a = !1, o();
    }
  };
}
function yG(i, t, e) {
  let { textContent: n } = t, s = !0;
  const r = () => e(1, s = !s);
  return i.$$set = (a) => {
    "textContent" in a && e(0, n = a.textContent);
  }, [n, s, r];
}
class wG extends aG {
  constructor(t) {
    super(), hG(this, t, yG, bG, dG, { textContent: 0 });
  }
}
const {
  SvelteComponent: vG,
  append_hydration: oy,
  assign: _G,
  attr: qn,
  binding_callbacks: xG,
  children: O2,
  claim_element: cF,
  claim_space: hF,
  claim_svg_element: K6,
  create_slot: kG,
  detach: go,
  element: uF,
  empty: yk,
  get_all_dirty_from_scope: AG,
  get_slot_changes: SG,
  get_spread_update: CG,
  init: EG,
  insert_hydration: vp,
  listen: DG,
  noop: TG,
  safe_not_equal: FG,
  set_dynamic_element_data: wk,
  set_style: We,
  space: dF,
  svg_element: Z6,
  toggle_class: an,
  transition_in: fF,
  transition_out: pF,
  update_slot_base: IG
} = window.__gradio__svelte__internal;
function vk(i) {
  let t, e, n, s, r;
  return {
    c() {
      t = Z6("svg"), e = Z6("line"), n = Z6("line"), this.h();
    },
    l(a) {
      t = K6(a, "svg", { class: !0, xmlns: !0, viewBox: !0 });
      var o = O2(t);
      e = K6(o, "line", {
        x1: !0,
        y1: !0,
        x2: !0,
        y2: !0,
        stroke: !0,
        "stroke-width": !0
      }), O2(e).forEach(go), n = K6(o, "line", {
        x1: !0,
        y1: !0,
        x2: !0,
        y2: !0,
        stroke: !0,
        "stroke-width": !0
      }), O2(n).forEach(go), o.forEach(go), this.h();
    },
    h() {
      qn(e, "x1", "1"), qn(e, "y1", "9"), qn(e, "x2", "9"), qn(e, "y2", "1"), qn(e, "stroke", "gray"), qn(e, "stroke-width", "0.5"), qn(n, "x1", "5"), qn(n, "y1", "9"), qn(n, "x2", "9"), qn(n, "y2", "5"), qn(n, "stroke", "gray"), qn(n, "stroke-width", "0.5"), qn(t, "class", "resize-handle svelte-239wnu"), qn(t, "xmlns", "http://www.w3.org/2000/svg"), qn(t, "viewBox", "0 0 10 10");
    },
    m(a, o) {
      vp(a, t, o), oy(t, e), oy(t, n), s || (r = DG(
        t,
        "mousedown",
        /*resize*/
        i[27]
      ), s = !0);
    },
    p: TG,
    d(a) {
      a && go(t), s = !1, r();
    }
  };
}
function MG(i) {
  var u;
  let t, e, n, s, r;
  const a = (
    /*#slots*/
    i[31].default
  ), o = kG(
    a,
    i,
    /*$$scope*/
    i[30],
    null
  );
  let l = (
    /*resizable*/
    i[19] && vk(i)
  ), c = [
    { "data-testid": (
      /*test_id*/
      i[11]
    ) },
    { id: (
      /*elem_id*/
      i[6]
    ) },
    {
      class: n = "block " + /*elem_classes*/
      (((u = i[7]) == null ? void 0 : u.join(" ")) || "") + " svelte-239wnu"
    },
    {
      dir: s = /*rtl*/
      i[20] ? "rtl" : "ltr"
    }
  ], h = {};
  for (let f = 0; f < c.length; f += 1)
    h = _G(h, c[f]);
  return {
    c() {
      t = uF(
        /*tag*/
        i[25]
      ), o && o.c(), e = dF(), l && l.c(), this.h();
    },
    l(f) {
      t = cF(
        f,
        /*tag*/
        (i[25] || "null").toUpperCase(),
        {
          "data-testid": !0,
          id: !0,
          class: !0,
          dir: !0
        }
      );
      var d = O2(t);
      o && o.l(d), e = hF(d), l && l.l(d), d.forEach(go), this.h();
    },
    h() {
      wk(
        /*tag*/
        i[25]
      )(t, h), an(
        t,
        "hidden",
        /*visible*/
        i[14] === !1
      ), an(
        t,
        "padded",
        /*padding*/
        i[10]
      ), an(
        t,
        "flex",
        /*flex*/
        i[1]
      ), an(
        t,
        "border_focus",
        /*border_mode*/
        i[9] === "focus"
      ), an(
        t,
        "border_contrast",
        /*border_mode*/
        i[9] === "contrast"
      ), an(t, "hide-container", !/*explicit_call*/
      i[12] && !/*container*/
      i[13]), an(
        t,
        "fullscreen",
        /*fullscreen*/
        i[0]
      ), an(
        t,
        "animating",
        /*fullscreen*/
        i[0] && /*preexpansionBoundingRect*/
        i[24] !== null
      ), an(
        t,
        "auto-margin",
        /*scale*/
        i[17] === null
      ), We(
        t,
        "height",
        /*fullscreen*/
        i[0] ? void 0 : (
          /*get_dimension*/
          i[26](
            /*height*/
            i[2]
          )
        )
      ), We(
        t,
        "min-height",
        /*fullscreen*/
        i[0] ? void 0 : (
          /*get_dimension*/
          i[26](
            /*min_height*/
            i[3]
          )
        )
      ), We(
        t,
        "max-height",
        /*fullscreen*/
        i[0] ? void 0 : (
          /*get_dimension*/
          i[26](
            /*max_height*/
            i[4]
          )
        )
      ), We(
        t,
        "--start-top",
        /*preexpansionBoundingRect*/
        i[24] ? `${/*preexpansionBoundingRect*/
        i[24].top}px` : "0px"
      ), We(
        t,
        "--start-left",
        /*preexpansionBoundingRect*/
        i[24] ? `${/*preexpansionBoundingRect*/
        i[24].left}px` : "0px"
      ), We(
        t,
        "--start-width",
        /*preexpansionBoundingRect*/
        i[24] ? `${/*preexpansionBoundingRect*/
        i[24].width}px` : "0px"
      ), We(
        t,
        "--start-height",
        /*preexpansionBoundingRect*/
        i[24] ? `${/*preexpansionBoundingRect*/
        i[24].height}px` : "0px"
      ), We(
        t,
        "width",
        /*fullscreen*/
        i[0] ? void 0 : typeof /*width*/
        i[5] == "number" ? `calc(min(${/*width*/
        i[5]}px, 100%))` : (
          /*get_dimension*/
          i[26](
            /*width*/
            i[5]
          )
        )
      ), We(
        t,
        "border-style",
        /*variant*/
        i[8]
      ), We(
        t,
        "overflow",
        /*allow_overflow*/
        i[15] ? (
          /*overflow_behavior*/
          i[16]
        ) : "hidden"
      ), We(
        t,
        "flex-grow",
        /*scale*/
        i[17]
      ), We(t, "min-width", `calc(min(${/*min_width*/
      i[18]}px, 100%))`), We(t, "border-width", "var(--block-border-width)");
    },
    m(f, d) {
      vp(f, t, d), o && o.m(t, null), oy(t, e), l && l.m(t, null), i[32](t), r = !0;
    },
    p(f, d) {
      var p;
      o && o.p && (!r || d[0] & /*$$scope*/
      1073741824) && IG(
        o,
        a,
        f,
        /*$$scope*/
        f[30],
        r ? SG(
          a,
          /*$$scope*/
          f[30],
          d,
          null
        ) : AG(
          /*$$scope*/
          f[30]
        ),
        null
      ), /*resizable*/
      f[19] ? l ? l.p(f, d) : (l = vk(f), l.c(), l.m(t, null)) : l && (l.d(1), l = null), wk(
        /*tag*/
        f[25]
      )(t, h = CG(c, [
        (!r || d[0] & /*test_id*/
        2048) && { "data-testid": (
          /*test_id*/
          f[11]
        ) },
        (!r || d[0] & /*elem_id*/
        64) && { id: (
          /*elem_id*/
          f[6]
        ) },
        (!r || d[0] & /*elem_classes*/
        128 && n !== (n = "block " + /*elem_classes*/
        (((p = f[7]) == null ? void 0 : p.join(" ")) || "") + " svelte-239wnu")) && { class: n },
        (!r || d[0] & /*rtl*/
        1048576 && s !== (s = /*rtl*/
        f[20] ? "rtl" : "ltr")) && { dir: s }
      ])), an(
        t,
        "hidden",
        /*visible*/
        f[14] === !1
      ), an(
        t,
        "padded",
        /*padding*/
        f[10]
      ), an(
        t,
        "flex",
        /*flex*/
        f[1]
      ), an(
        t,
        "border_focus",
        /*border_mode*/
        f[9] === "focus"
      ), an(
        t,
        "border_contrast",
        /*border_mode*/
        f[9] === "contrast"
      ), an(t, "hide-container", !/*explicit_call*/
      f[12] && !/*container*/
      f[13]), an(
        t,
        "fullscreen",
        /*fullscreen*/
        f[0]
      ), an(
        t,
        "animating",
        /*fullscreen*/
        f[0] && /*preexpansionBoundingRect*/
        f[24] !== null
      ), an(
        t,
        "auto-margin",
        /*scale*/
        f[17] === null
      ), d[0] & /*fullscreen, height*/
      5 && We(
        t,
        "height",
        /*fullscreen*/
        f[0] ? void 0 : (
          /*get_dimension*/
          f[26](
            /*height*/
            f[2]
          )
        )
      ), d[0] & /*fullscreen, min_height*/
      9 && We(
        t,
        "min-height",
        /*fullscreen*/
        f[0] ? void 0 : (
          /*get_dimension*/
          f[26](
            /*min_height*/
            f[3]
          )
        )
      ), d[0] & /*fullscreen, max_height*/
      17 && We(
        t,
        "max-height",
        /*fullscreen*/
        f[0] ? void 0 : (
          /*get_dimension*/
          f[26](
            /*max_height*/
            f[4]
          )
        )
      ), d[0] & /*preexpansionBoundingRect*/
      16777216 && We(
        t,
        "--start-top",
        /*preexpansionBoundingRect*/
        f[24] ? `${/*preexpansionBoundingRect*/
        f[24].top}px` : "0px"
      ), d[0] & /*preexpansionBoundingRect*/
      16777216 && We(
        t,
        "--start-left",
        /*preexpansionBoundingRect*/
        f[24] ? `${/*preexpansionBoundingRect*/
        f[24].left}px` : "0px"
      ), d[0] & /*preexpansionBoundingRect*/
      16777216 && We(
        t,
        "--start-width",
        /*preexpansionBoundingRect*/
        f[24] ? `${/*preexpansionBoundingRect*/
        f[24].width}px` : "0px"
      ), d[0] & /*preexpansionBoundingRect*/
      16777216 && We(
        t,
        "--start-height",
        /*preexpansionBoundingRect*/
        f[24] ? `${/*preexpansionBoundingRect*/
        f[24].height}px` : "0px"
      ), d[0] & /*fullscreen, width*/
      33 && We(
        t,
        "width",
        /*fullscreen*/
        f[0] ? void 0 : typeof /*width*/
        f[5] == "number" ? `calc(min(${/*width*/
        f[5]}px, 100%))` : (
          /*get_dimension*/
          f[26](
            /*width*/
            f[5]
          )
        )
      ), d[0] & /*variant*/
      256 && We(
        t,
        "border-style",
        /*variant*/
        f[8]
      ), d[0] & /*allow_overflow, overflow_behavior*/
      98304 && We(
        t,
        "overflow",
        /*allow_overflow*/
        f[15] ? (
          /*overflow_behavior*/
          f[16]
        ) : "hidden"
      ), d[0] & /*scale*/
      131072 && We(
        t,
        "flex-grow",
        /*scale*/
        f[17]
      ), d[0] & /*min_width*/
      262144 && We(t, "min-width", `calc(min(${/*min_width*/
      f[18]}px, 100%))`);
    },
    i(f) {
      r || (fF(o, f), r = !0);
    },
    o(f) {
      pF(o, f), r = !1;
    },
    d(f) {
      f && go(t), o && o.d(f), l && l.d(), i[32](null);
    }
  };
}
function _k(i) {
  let t;
  return {
    c() {
      t = uF("div"), this.h();
    },
    l(e) {
      t = cF(e, "DIV", { class: !0 }), O2(t).forEach(go), this.h();
    },
    h() {
      qn(t, "class", "placeholder svelte-239wnu"), We(
        t,
        "height",
        /*placeholder_height*/
        i[22] + "px"
      ), We(
        t,
        "width",
        /*placeholder_width*/
        i[23] + "px"
      );
    },
    m(e, n) {
      vp(e, t, n);
    },
    p(e, n) {
      n[0] & /*placeholder_height*/
      4194304 && We(
        t,
        "height",
        /*placeholder_height*/
        e[22] + "px"
      ), n[0] & /*placeholder_width*/
      8388608 && We(
        t,
        "width",
        /*placeholder_width*/
        e[23] + "px"
      );
    },
    d(e) {
      e && go(t);
    }
  };
}
function RG(i) {
  let t, e, n, s = (
    /*tag*/
    i[25] && MG(i)
  ), r = (
    /*fullscreen*/
    i[0] && _k(i)
  );
  return {
    c() {
      s && s.c(), t = dF(), r && r.c(), e = yk();
    },
    l(a) {
      s && s.l(a), t = hF(a), r && r.l(a), e = yk();
    },
    m(a, o) {
      s && s.m(a, o), vp(a, t, o), r && r.m(a, o), vp(a, e, o), n = !0;
    },
    p(a, o) {
      /*tag*/
      a[25] && s.p(a, o), /*fullscreen*/
      a[0] ? r ? r.p(a, o) : (r = _k(a), r.c(), r.m(e.parentNode, e)) : r && (r.d(1), r = null);
    },
    i(a) {
      n || (fF(s, a), n = !0);
    },
    o(a) {
      pF(s, a), n = !1;
    },
    d(a) {
      a && (go(t), go(e)), s && s.d(a), r && r.d(a);
    }
  };
}
function BG(i, t, e) {
  let { $$slots: n = {}, $$scope: s } = t, { height: r = void 0 } = t, { min_height: a = void 0 } = t, { max_height: o = void 0 } = t, { width: l = void 0 } = t, { elem_id: c = "" } = t, { elem_classes: h = [] } = t, { variant: u = "solid" } = t, { border_mode: f = "base" } = t, { padding: d = !0 } = t, { type: p = "normal" } = t, { test_id: g = void 0 } = t, { explicit_call: b = !1 } = t, { container: y = !0 } = t, { visible: v = !0 } = t, { allow_overflow: w = !0 } = t, { overflow_behavior: _ = "auto" } = t, { scale: x = null } = t, { min_width: k = 0 } = t, { flex: S = !1 } = t, { resizable: T = !1 } = t, { rtl: I = !1 } = t, { fullscreen: R = !1 } = t, B = R, L, it = p === "fieldset" ? "fieldset" : "div", O = 0, at = 0, W = null;
  function q(N) {
    R && N.key === "Escape" && e(0, R = !1);
  }
  const K = (N) => {
    if (N !== void 0) {
      if (typeof N == "number")
        return N + "px";
      if (typeof N == "string")
        return N;
    }
  }, z = (N) => {
    let Q = N.clientY;
    const Y = ($) => {
      const dt = $.clientY - Q;
      Q = $.clientY, e(21, L.style.height = `${L.offsetHeight + dt}px`, L);
    }, et = () => {
      window.removeEventListener("mousemove", Y), window.removeEventListener("mouseup", et);
    };
    window.addEventListener("mousemove", Y), window.addEventListener("mouseup", et);
  };
  function j(N) {
    xG[N ? "unshift" : "push"](() => {
      L = N, e(21, L);
    });
  }
  return i.$$set = (N) => {
    "height" in N && e(2, r = N.height), "min_height" in N && e(3, a = N.min_height), "max_height" in N && e(4, o = N.max_height), "width" in N && e(5, l = N.width), "elem_id" in N && e(6, c = N.elem_id), "elem_classes" in N && e(7, h = N.elem_classes), "variant" in N && e(8, u = N.variant), "border_mode" in N && e(9, f = N.border_mode), "padding" in N && e(10, d = N.padding), "type" in N && e(28, p = N.type), "test_id" in N && e(11, g = N.test_id), "explicit_call" in N && e(12, b = N.explicit_call), "container" in N && e(13, y = N.container), "visible" in N && e(14, v = N.visible), "allow_overflow" in N && e(15, w = N.allow_overflow), "overflow_behavior" in N && e(16, _ = N.overflow_behavior), "scale" in N && e(17, x = N.scale), "min_width" in N && e(18, k = N.min_width), "flex" in N && e(1, S = N.flex), "resizable" in N && e(19, T = N.resizable), "rtl" in N && e(20, I = N.rtl), "fullscreen" in N && e(0, R = N.fullscreen), "$$scope" in N && e(30, s = N.$$scope);
  }, i.$$.update = () => {
    i.$$.dirty[0] & /*fullscreen, old_fullscreen, element*/
    538968065 && R !== B && (e(29, B = R), R ? (e(24, W = L.getBoundingClientRect()), e(22, O = L.offsetHeight), e(23, at = L.offsetWidth), window.addEventListener("keydown", q)) : (e(24, W = null), window.removeEventListener("keydown", q))), i.$$.dirty[0] & /*visible*/
    16384 && (v || e(1, S = !1));
  }, [
    R,
    S,
    r,
    a,
    o,
    l,
    c,
    h,
    u,
    f,
    d,
    g,
    b,
    y,
    v,
    w,
    _,
    x,
    k,
    T,
    I,
    L,
    O,
    at,
    W,
    it,
    K,
    z,
    p,
    B,
    s,
    n,
    j
  ];
}
class PG extends vG {
  constructor(t) {
    super(), EG(
      this,
      t,
      BG,
      RG,
      FG,
      {
        height: 2,
        min_height: 3,
        max_height: 4,
        width: 5,
        elem_id: 6,
        elem_classes: 7,
        variant: 8,
        border_mode: 9,
        padding: 10,
        type: 28,
        test_id: 11,
        explicit_call: 12,
        container: 13,
        visible: 14,
        allow_overflow: 15,
        overflow_behavior: 16,
        scale: 17,
        min_width: 18,
        flex: 1,
        resizable: 19,
        rtl: 20,
        fullscreen: 0
      },
      null,
      [-1, -1]
    );
  }
}
class Iw {
  // The + prefix indicates that these fields aren't writeable
  // Lexer holding the input string.
  // Start offset, zero-based inclusive.
  // End offset, zero-based exclusive.
  constructor(t, e, n) {
    this.lexer = void 0, this.start = void 0, this.end = void 0, this.lexer = t, this.start = e, this.end = n;
  }
  /**
   * Merges two `SourceLocation`s from location providers, given they are
   * provided in order of appearance.
   * - Returns the first one's location if only the first is provided.
   * - Returns a merged range of the first and the last if both are provided
   *   and their lexers match.
   * - Otherwise, returns null.
   */
  static range(t, e) {
    return e ? !t || !t.loc || !e.loc || t.loc.lexer !== e.loc.lexer ? null : new Iw(t.loc.lexer, t.loc.start, e.loc.end) : t && t.loc;
  }
}
class Mw {
  // don't expand the token
  // used in \noexpand
  constructor(t, e) {
    this.text = void 0, this.loc = void 0, this.noexpand = void 0, this.treatAsRelax = void 0, this.text = t, this.loc = e;
  }
  /**
   * Given a pair of tokens (this and endToken), compute a `Token` encompassing
   * the whole input range enclosed by these two.
   */
  range(t, e) {
    return new Mw(e, Iw.range(this, t));
  }
}
class te {
  // Error start position based on passed-in Token or ParseNode.
  // Length of affected text based on passed-in Token or ParseNode.
  // The underlying error message without any context added.
  constructor(t, e) {
    this.name = void 0, this.position = void 0, this.length = void 0, this.rawMessage = void 0;
    var n = "KaTeX parse error: " + t, s, r, a = e && e.loc;
    if (a && a.start <= a.end) {
      var o = a.lexer.input;
      s = a.start, r = a.end, s === o.length ? n += " at end of input: " : n += " at position " + (s + 1) + ": ";
      var l = o.slice(s, r).replace(/[^]/g, "$&̲"), c;
      s > 15 ? c = "…" + o.slice(s - 15, s) : c = o.slice(0, s);
      var h;
      r + 15 < o.length ? h = o.slice(r, r + 15) + "…" : h = o.slice(r), n += c + l + h;
    }
    var u = new Error(n);
    return u.name = "ParseError", u.__proto__ = te.prototype, u.position = s, s != null && r != null && (u.length = r - s), u.rawMessage = t, u;
  }
}
te.prototype.__proto__ = Error.prototype;
var NG = function(t, e) {
  return t.indexOf(e) !== -1;
}, LG = function(t, e) {
  return t === void 0 ? e : t;
}, OG = /([A-Z])/g, $G = function(t) {
  return t.replace(OG, "-$1").toLowerCase();
}, qG = {
  "&": "&amp;",
  ">": "&gt;",
  "<": "&lt;",
  '"': "&quot;",
  "'": "&#x27;"
}, zG = /[&><"']/g;
function UG(i) {
  return String(i).replace(zG, (t) => qG[t]);
}
var mF = function i(t) {
  return t.type === "ordgroup" || t.type === "color" ? t.body.length === 1 ? i(t.body[0]) : t : t.type === "font" ? i(t.body) : t;
}, HG = function(t) {
  var e = mF(t);
  return e.type === "mathord" || e.type === "textord" || e.type === "atom";
}, jG = function(t) {
  if (!t)
    throw new Error("Expected non-null, but got " + String(t));
  return t;
}, GG = function(t) {
  var e = /^[\x00-\x20]*([^\\/#?]*?)(:|&#0*58|&#x0*3a|&colon)/i.exec(t);
  return e ? e[2] !== ":" || !/^[a-zA-Z][a-zA-Z0-9+\-.]*$/.test(e[1]) ? null : e[1].toLowerCase() : "_relative";
}, ne = {
  contains: NG,
  deflt: LG,
  escape: UG,
  hyphenate: $G,
  getBaseElem: mF,
  isCharacterBox: HG,
  protocolFromUrl: GG
};
class nc {
  constructor(t, e, n) {
    this.id = void 0, this.size = void 0, this.cramped = void 0, this.id = t, this.size = e, this.cramped = n;
  }
  /**
   * Get the style of a superscript given a base in the current style.
   */
  sup() {
    return po[VG[this.id]];
  }
  /**
   * Get the style of a subscript given a base in the current style.
   */
  sub() {
    return po[WG[this.id]];
  }
  /**
   * Get the style of a fraction numerator given the fraction in the current
   * style.
   */
  fracNum() {
    return po[XG[this.id]];
  }
  /**
   * Get the style of a fraction denominator given the fraction in the current
   * style.
   */
  fracDen() {
    return po[YG[this.id]];
  }
  /**
   * Get the cramped version of a style (in particular, cramping a cramped style
   * doesn't change the style).
   */
  cramp() {
    return po[KG[this.id]];
  }
  /**
   * Get a text or display version of this style.
   */
  text() {
    return po[ZG[this.id]];
  }
  /**
   * Return true if this style is tightly spaced (scriptstyle/scriptscriptstyle)
   */
  isTight() {
    return this.size >= 2;
  }
}
var Rw = 0, B3 = 1, Mu = 2, Ol = 3, _p = 4, qr = 5, hf = 6, hs = 7, po = [new nc(Rw, 0, !1), new nc(B3, 0, !0), new nc(Mu, 1, !1), new nc(Ol, 1, !0), new nc(_p, 2, !1), new nc(qr, 2, !0), new nc(hf, 3, !1), new nc(hs, 3, !0)], VG = [_p, qr, _p, qr, hf, hs, hf, hs], WG = [qr, qr, qr, qr, hs, hs, hs, hs], XG = [Mu, Ol, _p, qr, hf, hs, hf, hs], YG = [Ol, Ol, qr, qr, hs, hs, hs, hs], KG = [B3, B3, Ol, Ol, qr, qr, hs, hs], ZG = [Rw, B3, Mu, Ol, Mu, Ol, Mu, Ol], re = {
  DISPLAY: po[Rw],
  TEXT: po[Mu],
  SCRIPT: po[_p],
  SCRIPTSCRIPT: po[hf]
}, ly = [{
  // Latin characters beyond the Latin-1 characters we have metrics for.
  // Needed for Czech, Hungarian and Turkish text, for example.
  name: "latin",
  blocks: [
    [256, 591],
    // Latin Extended-A and Latin Extended-B
    [768, 879]
    // Combining Diacritical marks
  ]
}, {
  // The Cyrillic script used by Russian and related languages.
  // A Cyrillic subset used to be supported as explicitly defined
  // symbols in symbols.js
  name: "cyrillic",
  blocks: [[1024, 1279]]
}, {
  // Armenian
  name: "armenian",
  blocks: [[1328, 1423]]
}, {
  // The Brahmic scripts of South and Southeast Asia
  // Devanagari (0900–097F)
  // Bengali (0980–09FF)
  // Gurmukhi (0A00–0A7F)
  // Gujarati (0A80–0AFF)
  // Oriya (0B00–0B7F)
  // Tamil (0B80–0BFF)
  // Telugu (0C00–0C7F)
  // Kannada (0C80–0CFF)
  // Malayalam (0D00–0D7F)
  // Sinhala (0D80–0DFF)
  // Thai (0E00–0E7F)
  // Lao (0E80–0EFF)
  // Tibetan (0F00–0FFF)
  // Myanmar (1000–109F)
  name: "brahmic",
  blocks: [[2304, 4255]]
}, {
  name: "georgian",
  blocks: [[4256, 4351]]
}, {
  // Chinese and Japanese.
  // The "k" in cjk is for Korean, but we've separated Korean out
  name: "cjk",
  blocks: [
    [12288, 12543],
    // CJK symbols and punctuation, Hiragana, Katakana
    [19968, 40879],
    // CJK ideograms
    [65280, 65376]
    // Fullwidth punctuation
    // TODO: add halfwidth Katakana and Romanji glyphs
  ]
}, {
  // Korean
  name: "hangul",
  blocks: [[44032, 55215]]
}];
function JG(i) {
  for (var t = 0; t < ly.length; t++)
    for (var e = ly[t], n = 0; n < e.blocks.length; n++) {
      var s = e.blocks[n];
      if (i >= s[0] && i <= s[1])
        return e.name;
    }
  return null;
}
var M9 = [];
ly.forEach((i) => i.blocks.forEach((t) => M9.push(...t)));
function QG(i) {
  for (var t = 0; t < M9.length; t += 2)
    if (i >= M9[t] && i <= M9[t + 1])
      return !0;
  return !1;
}
var X1 = 80, tV = function(t, e) {
  return "M95," + (622 + t + e) + `
c-2.7,0,-7.17,-2.7,-13.5,-8c-5.8,-5.3,-9.5,-10,-9.5,-14
c0,-2,0.3,-3.3,1,-4c1.3,-2.7,23.83,-20.7,67.5,-54
c44.2,-33.3,65.8,-50.3,66.5,-51c1.3,-1.3,3,-2,5,-2c4.7,0,8.7,3.3,12,10
s173,378,173,378c0.7,0,35.3,-71,104,-213c68.7,-142,137.5,-285,206.5,-429
c69,-144,104.5,-217.7,106.5,-221
l` + t / 2.075 + " -" + t + `
c5.3,-9.3,12,-14,20,-14
H400000v` + (40 + t) + `H845.2724
s-225.272,467,-225.272,467s-235,486,-235,486c-2.7,4.7,-9,7,-19,7
c-6,0,-10,-1,-12,-3s-194,-422,-194,-422s-65,47,-65,47z
M` + (834 + t) + " " + e + "h400000v" + (40 + t) + "h-400000z";
}, eV = function(t, e) {
  return "M263," + (601 + t + e) + `c0.7,0,18,39.7,52,119
c34,79.3,68.167,158.7,102.5,238c34.3,79.3,51.8,119.3,52.5,120
c340,-704.7,510.7,-1060.3,512,-1067
l` + t / 2.084 + " -" + t + `
c4.7,-7.3,11,-11,19,-11
H40000v` + (40 + t) + `H1012.3
s-271.3,567,-271.3,567c-38.7,80.7,-84,175,-136,283c-52,108,-89.167,185.3,-111.5,232
c-22.3,46.7,-33.8,70.3,-34.5,71c-4.7,4.7,-12.3,7,-23,7s-12,-1,-12,-1
s-109,-253,-109,-253c-72.7,-168,-109.3,-252,-110,-252c-10.7,8,-22,16.7,-34,26
c-22,17.3,-33.3,26,-34,26s-26,-26,-26,-26s76,-59,76,-59s76,-60,76,-60z
M` + (1001 + t) + " " + e + "h400000v" + (40 + t) + "h-400000z";
}, iV = function(t, e) {
  return "M983 " + (10 + t + e) + `
l` + t / 3.13 + " -" + t + `
c4,-6.7,10,-10,18,-10 H400000v` + (40 + t) + `
H1013.1s-83.4,268,-264.1,840c-180.7,572,-277,876.3,-289,913c-4.7,4.7,-12.7,7,-24,7
s-12,0,-12,0c-1.3,-3.3,-3.7,-11.7,-7,-25c-35.3,-125.3,-106.7,-373.3,-214,-744
c-10,12,-21,25,-33,39s-32,39,-32,39c-6,-5.3,-15,-14,-27,-26s25,-30,25,-30
c26.7,-32.7,52,-63,76,-91s52,-60,52,-60s208,722,208,722
c56,-175.3,126.3,-397.3,211,-666c84.7,-268.7,153.8,-488.2,207.5,-658.5
c53.7,-170.3,84.5,-266.8,92.5,-289.5z
M` + (1001 + t) + " " + e + "h400000v" + (40 + t) + "h-400000z";
}, nV = function(t, e) {
  return "M424," + (2398 + t + e) + `
c-1.3,-0.7,-38.5,-172,-111.5,-514c-73,-342,-109.8,-513.3,-110.5,-514
c0,-2,-10.7,14.3,-32,49c-4.7,7.3,-9.8,15.7,-15.5,25c-5.7,9.3,-9.8,16,-12.5,20
s-5,7,-5,7c-4,-3.3,-8.3,-7.7,-13,-13s-13,-13,-13,-13s76,-122,76,-122s77,-121,77,-121
s209,968,209,968c0,-2,84.7,-361.7,254,-1079c169.3,-717.3,254.7,-1077.7,256,-1081
l` + t / 4.223 + " -" + t + `c4,-6.7,10,-10,18,-10 H400000
v` + (40 + t) + `H1014.6
s-87.3,378.7,-272.6,1166c-185.3,787.3,-279.3,1182.3,-282,1185
c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2z M` + (1001 + t) + " " + e + `
h400000v` + (40 + t) + "h-400000z";
}, sV = function(t, e) {
  return "M473," + (2713 + t + e) + `
c339.3,-1799.3,509.3,-2700,510,-2702 l` + t / 5.298 + " -" + t + `
c3.3,-7.3,9.3,-11,18,-11 H400000v` + (40 + t) + `H1017.7
s-90.5,478,-276.2,1466c-185.7,988,-279.5,1483,-281.5,1485c-2,6,-10,9,-24,9
c-8,0,-12,-0.7,-12,-2c0,-1.3,-5.3,-32,-16,-92c-50.7,-293.3,-119.7,-693.3,-207,-1200
c0,-1.3,-5.3,8.7,-16,30c-10.7,21.3,-21.3,42.7,-32,64s-16,33,-16,33s-26,-26,-26,-26
s76,-153,76,-153s77,-151,77,-151c0.7,0.7,35.7,202,105,604c67.3,400.7,102,602.7,104,
606zM` + (1001 + t) + " " + e + "h400000v" + (40 + t) + "H1017.7z";
}, rV = function(t) {
  var e = t / 2;
  return "M400000 " + t + " H0 L" + e + " 0 l65 45 L145 " + (t - 80) + " H400000z";
}, aV = function(t, e, n) {
  var s = n - 54 - e - t;
  return "M702 " + (t + e) + "H400000" + (40 + t) + `
H742v` + s + `l-4 4-4 4c-.667.7 -2 1.5-4 2.5s-4.167 1.833-6.5 2.5-5.5 1-9.5 1
h-12l-28-84c-16.667-52-96.667 -294.333-240-727l-212 -643 -85 170
c-4-3.333-8.333-7.667-13 -13l-13-13l77-155 77-156c66 199.333 139 419.667
219 661 l218 661zM702 ` + e + "H400000v" + (40 + t) + "H742z";
}, oV = function(t, e, n) {
  e = 1e3 * e;
  var s = "";
  switch (t) {
    case "sqrtMain":
      s = tV(e, X1);
      break;
    case "sqrtSize1":
      s = eV(e, X1);
      break;
    case "sqrtSize2":
      s = iV(e, X1);
      break;
    case "sqrtSize3":
      s = nV(e, X1);
      break;
    case "sqrtSize4":
      s = sV(e, X1);
      break;
    case "sqrtTall":
      s = aV(e, X1, n);
  }
  return s;
}, lV = function(t, e) {
  switch (t) {
    case "⎜":
      return "M291 0 H417 V" + e + " H291z M291 0 H417 V" + e + " H291z";
    case "∣":
      return "M145 0 H188 V" + e + " H145z M145 0 H188 V" + e + " H145z";
    case "∥":
      return "M145 0 H188 V" + e + " H145z M145 0 H188 V" + e + " H145z" + ("M367 0 H410 V" + e + " H367z M367 0 H410 V" + e + " H367z");
    case "⎟":
      return "M457 0 H583 V" + e + " H457z M457 0 H583 V" + e + " H457z";
    case "⎢":
      return "M319 0 H403 V" + e + " H319z M319 0 H403 V" + e + " H319z";
    case "⎥":
      return "M263 0 H347 V" + e + " H263z M263 0 H347 V" + e + " H263z";
    case "⎪":
      return "M384 0 H504 V" + e + " H384z M384 0 H504 V" + e + " H384z";
    case "⏐":
      return "M312 0 H355 V" + e + " H312z M312 0 H355 V" + e + " H312z";
    case "‖":
      return "M257 0 H300 V" + e + " H257z M257 0 H300 V" + e + " H257z" + ("M478 0 H521 V" + e + " H478z M478 0 H521 V" + e + " H478z");
    default:
      return "";
  }
}, xk = {
  // The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main
  doubleleftarrow: `M262 157
l10-10c34-36 62.7-77 86-123 3.3-8 5-13.3 5-16 0-5.3-6.7-8-20-8-7.3
 0-12.2.5-14.5 1.5-2.3 1-4.8 4.5-7.5 10.5-49.3 97.3-121.7 169.3-217 216-28
 14-57.3 25-88 33-6.7 2-11 3.8-13 5.5-2 1.7-3 4.2-3 7.5s1 5.8 3 7.5
c2 1.7 6.3 3.5 13 5.5 68 17.3 128.2 47.8 180.5 91.5 52.3 43.7 93.8 96.2 124.5
 157.5 9.3 8 15.3 12.3 18 13h6c12-.7 18-4 18-10 0-2-1.7-7-5-15-23.3-46-52-87
-86-123l-10-10h399738v-40H218c328 0 0 0 0 0l-10-8c-26.7-20-65.7-43-117-69 2.7
-2 6-3.7 10-5 36.7-16 72.3-37.3 107-64l10-8h399782v-40z
m8 0v40h399730v-40zm0 194v40h399730v-40z`,
  // doublerightarrow is from glyph U+21D2 in font KaTeX Main
  doublerightarrow: `M399738 392l
-10 10c-34 36-62.7 77-86 123-3.3 8-5 13.3-5 16 0 5.3 6.7 8 20 8 7.3 0 12.2-.5
 14.5-1.5 2.3-1 4.8-4.5 7.5-10.5 49.3-97.3 121.7-169.3 217-216 28-14 57.3-25 88
-33 6.7-2 11-3.8 13-5.5 2-1.7 3-4.2 3-7.5s-1-5.8-3-7.5c-2-1.7-6.3-3.5-13-5.5-68
-17.3-128.2-47.8-180.5-91.5-52.3-43.7-93.8-96.2-124.5-157.5-9.3-8-15.3-12.3-18
-13h-6c-12 .7-18 4-18 10 0 2 1.7 7 5 15 23.3 46 52 87 86 123l10 10H0v40h399782
c-328 0 0 0 0 0l10 8c26.7 20 65.7 43 117 69-2.7 2-6 3.7-10 5-36.7 16-72.3 37.3
-107 64l-10 8H0v40zM0 157v40h399730v-40zm0 194v40h399730v-40z`,
  // leftarrow is from glyph U+2190 in font KaTeX Main
  leftarrow: `M400000 241H110l3-3c68.7-52.7 113.7-120
 135-202 4-14.7 6-23 6-25 0-7.3-7-11-21-11-8 0-13.2.8-15.5 2.5-2.3 1.7-4.2 5.8
-5.5 12.5-1.3 4.7-2.7 10.3-4 17-12 48.7-34.8 92-68.5 130S65.3 228.3 18 247
c-10 4-16 7.7-18 11 0 8.7 6 14.3 18 17 47.3 18.7 87.8 47 121.5 85S196 441.3 208
 490c.7 2 1.3 5 2 9s1.2 6.7 1.5 8c.3 1.3 1 3.3 2 6s2.2 4.5 3.5 5.5c1.3 1 3.3
 1.8 6 2.5s6 1 10 1c14 0 21-3.7 21-11 0-2-2-10.3-6-25-20-79.3-65-146.7-135-202
 l-3-3h399890zM100 241v40h399900v-40z`,
  // overbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular
  leftbrace: `M6 548l-6-6v-35l6-11c56-104 135.3-181.3 238-232 57.3-28.7 117
-45 179-50h399577v120H403c-43.3 7-81 15-113 26-100.7 33-179.7 91-237 174-2.7
 5-6 9-10 13-.7 1-7.3 1-20 1H6z`,
  leftbraceunder: `M0 6l6-6h17c12.688 0 19.313.3 20 1 4 4 7.313 8.3 10 13
 35.313 51.3 80.813 93.8 136.5 127.5 55.688 33.7 117.188 55.8 184.5 66.5.688
 0 2 .3 4 1 18.688 2.7 76 4.3 172 5h399450v120H429l-6-1c-124.688-8-235-61.7
-331-161C60.687 138.7 32.312 99.3 7 54L0 41V6z`,
  // overgroup is from the MnSymbol package (public domain)
  leftgroup: `M400000 80
H435C64 80 168.3 229.4 21 260c-5.9 1.2-18 0-18 0-2 0-3-1-3-3v-38C76 61 257 0
 435 0h399565z`,
  leftgroupunder: `M400000 262
H435C64 262 168.3 112.6 21 82c-5.9-1.2-18 0-18 0-2 0-3 1-3 3v38c76 158 257 219
 435 219h399565z`,
  // Harpoons are from glyph U+21BD in font KaTeX Main
  leftharpoon: `M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3
-3.3 10.2-9.5 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5
-18.3 3-21-1.3-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7
-196 228-6.7 4.7-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40z`,
  leftharpoonplus: `M0 267c.7 5.3 3 10 7 14h399993v-40H93c3.3-3.3 10.2-9.5
 20.5-18.5s17.8-15.8 22.5-20.5c50.7-52 88-110.3 112-175 4-11.3 5-18.3 3-21-1.3
-4-7.3-6-18-6-8 0-13 .7-15 2s-4.7 6.7-8 16c-42 98.7-107.3 174.7-196 228-6.7 4.7
-10.7 8-12 10-1.3 2-2 5.7-2 11zm100-26v40h399900v-40zM0 435v40h400000v-40z
m0 0v40h400000v-40z`,
  leftharpoondown: `M7 241c-4 4-6.333 8.667-7 14 0 5.333.667 9 2 11s5.333
 5.333 12 10c90.667 54 156 130 196 228 3.333 10.667 6.333 16.333 9 17 2 .667 5
 1 9 1h5c10.667 0 16.667-2 18-6 2-2.667 1-9.667-3-21-32-87.333-82.667-157.667
-152-211l-3-3h399907v-40zM93 281 H400000 v-40L7 241z`,
  leftharpoondownplus: `M7 435c-4 4-6.3 8.7-7 14 0 5.3.7 9 2 11s5.3 5.3 12
 10c90.7 54 156 130 196 228 3.3 10.7 6.3 16.3 9 17 2 .7 5 1 9 1h5c10.7 0 16.7
-2 18-6 2-2.7 1-9.7-3-21-32-87.3-82.7-157.7-152-211l-3-3h399907v-40H7zm93 0
v40h399900v-40zM0 241v40h399900v-40zm0 0v40h399900v-40z`,
  // hook is from glyph U+21A9 in font KaTeX Main
  lefthook: `M400000 281 H103s-33-11.2-61-33.5S0 197.3 0 164s14.2-61.2 42.5
-83.5C70.8 58.2 104 47 142 47 c16.7 0 25 6.7 25 20 0 12-8.7 18.7-26 20-40 3.3
-68.7 15.7-86 37-10 12-15 25.3-15 40 0 22.7 9.8 40.7 29.5 54 19.7 13.3 43.5 21
 71.5 23h399859zM103 281v-40h399897v40z`,
  leftlinesegment: `M40 281 V428 H0 V94 H40 V241 H400000 v40z
M40 281 V428 H0 V94 H40 V241 H400000 v40z`,
  leftmapsto: `M40 281 V448H0V74H40V241H400000v40z
M40 281 V448H0V74H40V241H400000v40z`,
  // tofrom is from glyph U+21C4 in font KaTeX AMS Regular
  leftToFrom: `M0 147h400000v40H0zm0 214c68 40 115.7 95.7 143 167h22c15.3 0 23
-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69-70-101l-7-8h399905v-40H95l7-8
c28.7-32 52-65.7 70-101 10.7-23.3 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 265.3
 68 321 0 361zm0-174v-40h399900v40zm100 154v40h399900v-40z`,
  longequal: `M0 50 h400000 v40H0z m0 194h40000v40H0z
M0 50 h400000 v40H0z m0 194h40000v40H0z`,
  midbrace: `M200428 334
c-100.7-8.3-195.3-44-280-108-55.3-42-101.7-93-139-153l-9-14c-2.7 4-5.7 8.7-9 14
-53.3 86.7-123.7 153-211 199-66.7 36-137.3 56.3-212 62H0V214h199568c178.3-11.7
 311.7-78.3 403-201 6-8 9.7-12 11-12 .7-.7 6.7-1 18-1s17.3.3 18 1c1.3 0 5 4 11
 12 44.7 59.3 101.3 106.3 170 141s145.3 54.3 229 60h199572v120z`,
  midbraceunder: `M199572 214
c100.7 8.3 195.3 44 280 108 55.3 42 101.7 93 139 153l9 14c2.7-4 5.7-8.7 9-14
 53.3-86.7 123.7-153 211-199 66.7-36 137.3-56.3 212-62h199568v120H200432c-178.3
 11.7-311.7 78.3-403 201-6 8-9.7 12-11 12-.7.7-6.7 1-18 1s-17.3-.3-18-1c-1.3 0
-5-4-11-12-44.7-59.3-101.3-106.3-170-141s-145.3-54.3-229-60H0V214z`,
  oiintSize1: `M512.6 71.6c272.6 0 320.3 106.8 320.3 178.2 0 70.8-47.7 177.6
-320.3 177.6S193.1 320.6 193.1 249.8c0-71.4 46.9-178.2 319.5-178.2z
m368.1 178.2c0-86.4-60.9-215.4-368.1-215.4-306.4 0-367.3 129-367.3 215.4 0 85.8
60.9 214.8 367.3 214.8 307.2 0 368.1-129 368.1-214.8z`,
  oiintSize2: `M757.8 100.1c384.7 0 451.1 137.6 451.1 230 0 91.3-66.4 228.8
-451.1 228.8-386.3 0-452.7-137.5-452.7-228.8 0-92.4 66.4-230 452.7-230z
m502.4 230c0-111.2-82.4-277.2-502.4-277.2s-504 166-504 277.2
c0 110 84 276 504 276s502.4-166 502.4-276z`,
  oiiintSize1: `M681.4 71.6c408.9 0 480.5 106.8 480.5 178.2 0 70.8-71.6 177.6
-480.5 177.6S202.1 320.6 202.1 249.8c0-71.4 70.5-178.2 479.3-178.2z
m525.8 178.2c0-86.4-86.8-215.4-525.7-215.4-437.9 0-524.7 129-524.7 215.4 0
85.8 86.8 214.8 524.7 214.8 438.9 0 525.7-129 525.7-214.8z`,
  oiiintSize2: `M1021.2 53c603.6 0 707.8 165.8 707.8 277.2 0 110-104.2 275.8
-707.8 275.8-606 0-710.2-165.8-710.2-275.8C311 218.8 415.2 53 1021.2 53z
m770.4 277.1c0-131.2-126.4-327.6-770.5-327.6S248.4 198.9 248.4 330.1
c0 130 128.8 326.4 772.7 326.4s770.5-196.4 770.5-326.4z`,
  rightarrow: `M0 241v40h399891c-47.3 35.3-84 78-110 128
-16.7 32-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20
 11 8 0 13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7
 39-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85
-40.5-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
 151.7 139 205zm0 0v40h399900v-40z`,
  rightbrace: `M400000 542l
-6 6h-17c-12.7 0-19.3-.3-20-1-4-4-7.3-8.3-10-13-35.3-51.3-80.8-93.8-136.5-127.5
s-117.2-55.8-184.5-66.5c-.7 0-2-.3-4-1-18.7-2.7-76-4.3-172-5H0V214h399571l6 1
c124.7 8 235 61.7 331 161 31.3 33.3 59.7 72.7 85 118l7 13v35z`,
  rightbraceunder: `M399994 0l6 6v35l-6 11c-56 104-135.3 181.3-238 232-57.3
 28.7-117 45-179 50H-300V214h399897c43.3-7 81-15 113-26 100.7-33 179.7-91 237
-174 2.7-5 6-9 10-13 .7-1 7.3-1 20-1h17z`,
  rightgroup: `M0 80h399565c371 0 266.7 149.4 414 180 5.9 1.2 18 0 18 0 2 0
 3-1 3-3v-38c-76-158-257-219-435-219H0z`,
  rightgroupunder: `M0 262h399565c371 0 266.7-149.4 414-180 5.9-1.2 18 0 18
 0 2 0 3 1 3 3v38c-76 158-257 219-435 219H0z`,
  rightharpoon: `M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3
-3.7-15.3-11-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2
-10.7 0-16.7 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58
 69.2 92 94.5zm0 0v40h399900v-40z`,
  rightharpoonplus: `M0 241v40h399993c4.7-4.7 7-9.3 7-14 0-9.3-3.7-15.3-11
-18-92.7-56.7-159-133.7-199-231-3.3-9.3-6-14.7-8-16-2-1.3-7-2-15-2-10.7 0-16.7
 2-18 6-2 2.7-1 9.7 3 21 15.3 42 36.7 81.8 64 119.5 27.3 37.7 58 69.2 92 94.5z
m0 0v40h399900v-40z m100 194v40h399900v-40zm0 0v40h399900v-40z`,
  rightharpoondown: `M399747 511c0 7.3 6.7 11 20 11 8 0 13-.8 15-2.5s4.7-6.8
 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3 8.5-5.8 9.5
-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3-64.7 57-92 95
-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 241v40h399900v-40z`,
  rightharpoondownplus: `M399747 705c0 7.3 6.7 11 20 11 8 0 13-.8
 15-2.5s4.7-6.8 8-15.5c40-94 99.3-166.3 178-217 13.3-8 20.3-12.3 21-13 5.3-3.3
 8.5-5.8 9.5-7.5 1-1.7 1.5-5.2 1.5-10.5s-2.3-10.3-7-15H0v40h399908c-34 25.3
-64.7 57-92 95-27.3 38-48.7 77.7-64 119-3.3 8.7-5 14-5 16zM0 435v40h399900v-40z
m0-194v40h400000v-40zm0 0v40h400000v-40z`,
  righthook: `M399859 241c-764 0 0 0 0 0 40-3.3 68.7-15.7 86-37 10-12 15-25.3
 15-40 0-22.7-9.8-40.7-29.5-54-19.7-13.3-43.5-21-71.5-23-17.3-1.3-26-8-26-20 0
-13.3 8.7-20 26-20 38 0 71 11.2 99 33.5 0 0 7 5.6 21 16.7 14 11.2 21 33.5 21
 66.8s-14 61.2-42 83.5c-28 22.3-61 33.5-99 33.5L0 241z M0 281v-40h399859v40z`,
  rightlinesegment: `M399960 241 V94 h40 V428 h-40 V281 H0 v-40z
M399960 241 V94 h40 V428 h-40 V281 H0 v-40z`,
  rightToFrom: `M400000 167c-70.7-42-118-97.7-142-167h-23c-15.3 0-23 .3-23
 1 0 1.3 5.3 13.7 16 37 18 35.3 41.3 69 70 101l7 8H0v40h399905l-7 8c-28.7 32
-52 65.7-70 101-10.7 23.3-16 35.7-16 37 0 .7 7.7 1 23 1h23c24-69.3 71.3-125 142
-167z M100 147v40h399900v-40zM0 341v40h399900v-40z`,
  // twoheadleftarrow is from glyph U+219E in font KaTeX AMS Regular
  twoheadleftarrow: `M0 167c68 40
 115.7 95.7 143 167h22c15.3 0 23-.3 23-1 0-1.3-5.3-13.7-16-37-18-35.3-41.3-69
-70-101l-7-8h125l9 7c50.7 39.3 85 86 103 140h46c0-4.7-6.3-18.7-19-42-18-35.3
-40-67.3-66-96l-9-9h399716v-40H284l9-9c26-28.7 48-60.7 66-96 12.7-23.333 19
-37.333 19-42h-46c-18 54-52.3 100.7-103 140l-9 7H95l7-8c28.7-32 52-65.7 70-101
 10.7-23.333 16-35.7 16-37 0-.7-7.7-1-23-1h-22C115.7 71.3 68 127 0 167z`,
  twoheadrightarrow: `M400000 167
c-68-40-115.7-95.7-143-167h-22c-15.3 0-23 .3-23 1 0 1.3 5.3 13.7 16 37 18 35.3
 41.3 69 70 101l7 8h-125l-9-7c-50.7-39.3-85-86-103-140h-46c0 4.7 6.3 18.7 19 42
 18 35.3 40 67.3 66 96l9 9H0v40h399716l-9 9c-26 28.7-48 60.7-66 96-12.7 23.333
-19 37.333-19 42h46c18-54 52.3-100.7 103-140l9-7h125l-7 8c-28.7 32-52 65.7-70
 101-10.7 23.333-16 35.7-16 37 0 .7 7.7 1 23 1h22c27.3-71.3 75-127 143-167z`,
  // tilde1 is a modified version of a glyph from the MnSymbol package
  tilde1: `M200 55.538c-77 0-168 73.953-177 73.953-3 0-7
-2.175-9-5.437L2 97c-1-2-2-4-2-6 0-4 2-7 5-9l20-12C116 12 171 0 207 0c86 0
 114 68 191 68 78 0 168-68 177-68 4 0 7 2 9 5l12 19c1 2.175 2 4.35 2 6.525 0
 4.35-2 7.613-5 9.788l-19 13.05c-92 63.077-116.937 75.308-183 76.128
-68.267.847-113-73.952-191-73.952z`,
  // ditto tilde2, tilde3, & tilde4
  tilde2: `M344 55.266c-142 0-300.638 81.316-311.5 86.418
-8.01 3.762-22.5 10.91-23.5 5.562L1 120c-1-2-1-3-1-4 0-5 3-9 8-10l18.4-9C160.9
 31.9 283 0 358 0c148 0 188 122 331 122s314-97 326-97c4 0 8 2 10 7l7 21.114
c1 2.14 1 3.21 1 4.28 0 5.347-3 9.626-7 10.696l-22.3 12.622C852.6 158.372 751
 181.476 676 181.476c-149 0-189-126.21-332-126.21z`,
  tilde3: `M786 59C457 59 32 175.242 13 175.242c-6 0-10-3.457
-11-10.37L.15 138c-1-7 3-12 10-13l19.2-6.4C378.4 40.7 634.3 0 804.3 0c337 0
 411.8 157 746.8 157 328 0 754-112 773-112 5 0 10 3 11 9l1 14.075c1 8.066-.697
 16.595-6.697 17.492l-21.052 7.31c-367.9 98.146-609.15 122.696-778.15 122.696
 -338 0-409-156.573-744-156.573z`,
  tilde4: `M786 58C457 58 32 177.487 13 177.487c-6 0-10-3.345
-11-10.035L.15 143c-1-7 3-12 10-13l22-6.7C381.2 35 637.15 0 807.15 0c337 0 409
 177 744 177 328 0 754-127 773-127 5 0 10 3 11 9l1 14.794c1 7.805-3 13.38-9
 14.495l-20.7 5.574c-366.85 99.79-607.3 139.372-776.3 139.372-338 0-409
 -175.236-744-175.236z`,
  // vec is from glyph U+20D7 in font KaTeX Main
  vec: `M377 20c0-5.333 1.833-10 5.5-14S391 0 397 0c4.667 0 8.667 1.667 12 5
3.333 2.667 6.667 9 10 19 6.667 24.667 20.333 43.667 41 57 7.333 4.667 11
10.667 11 18 0 6-1 10-3 12s-6.667 5-14 9c-28.667 14.667-53.667 35.667-75 63
-1.333 1.333-3.167 3.5-5.5 6.5s-4 4.833-5 5.5c-1 .667-2.5 1.333-4.5 2s-4.333 1
-7 1c-4.667 0-9.167-1.833-13.5-5.5S337 184 337 178c0-12.667 15.667-32.333 47-59
H213l-171-1c-8.667-6-13-12.333-13-19 0-4.667 4.333-11.333 13-20h359
c-16-25.333-24-45-24-59z`,
  // widehat1 is a modified version of a glyph from the MnSymbol package
  widehat1: `M529 0h5l519 115c5 1 9 5 9 10 0 1-1 2-1 3l-4 22
c-1 5-5 9-11 9h-2L532 67 19 159h-2c-5 0-9-4-11-9l-5-22c-1-6 2-12 8-13z`,
  // ditto widehat2, widehat3, & widehat4
  widehat2: `M1181 0h2l1171 176c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 220h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,
  widehat3: `M1181 0h2l1171 236c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 280h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,
  widehat4: `M1181 0h2l1171 296c6 0 10 5 10 11l-2 23c-1 6-5 10
-11 10h-1L1182 67 15 340h-1c-6 0-10-4-11-10l-2-23c-1-6 4-11 10-11z`,
  // widecheck paths are all inverted versions of widehat
  widecheck1: `M529,159h5l519,-115c5,-1,9,-5,9,-10c0,-1,-1,-2,-1,-3l-4,-22c-1,
-5,-5,-9,-11,-9h-2l-512,92l-513,-92h-2c-5,0,-9,4,-11,9l-5,22c-1,6,2,12,8,13z`,
  widecheck2: `M1181,220h2l1171,-176c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,153l-1167,-153h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,
  widecheck3: `M1181,280h2l1171,-236c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,213l-1167,-213h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,
  widecheck4: `M1181,340h2l1171,-296c6,0,10,-5,10,-11l-2,-23c-1,-6,-5,-10,
-11,-10h-1l-1168,273l-1167,-273h-1c-6,0,-10,4,-11,10l-2,23c-1,6,4,11,10,11z`,
  // The next ten paths support reaction arrows from the mhchem package.
  // Arrows for \ce{<-->} are offset from xAxis by 0.22ex, per mhchem in LaTeX
  // baraboveleftarrow is mostly from glyph U+2190 in font KaTeX Main
  baraboveleftarrow: `M400000 620h-399890l3 -3c68.7 -52.7 113.7 -120 135 -202
c4 -14.7 6 -23 6 -25c0 -7.3 -7 -11 -21 -11c-8 0 -13.2 0.8 -15.5 2.5
c-2.3 1.7 -4.2 5.8 -5.5 12.5c-1.3 4.7 -2.7 10.3 -4 17c-12 48.7 -34.8 92 -68.5 130
s-74.2 66.3 -121.5 85c-10 4 -16 7.7 -18 11c0 8.7 6 14.3 18 17c47.3 18.7 87.8 47
121.5 85s56.5 81.3 68.5 130c0.7 2 1.3 5 2 9s1.2 6.7 1.5 8c0.3 1.3 1 3.3 2 6
s2.2 4.5 3.5 5.5c1.3 1 3.3 1.8 6 2.5s6 1 10 1c14 0 21 -3.7 21 -11
c0 -2 -2 -10.3 -6 -25c-20 -79.3 -65 -146.7 -135 -202l-3 -3h399890z
M100 620v40h399900v-40z M0 241v40h399900v-40zM0 241v40h399900v-40z`,
  // rightarrowabovebar is mostly from glyph U+2192, KaTeX Main
  rightarrowabovebar: `M0 241v40h399891c-47.3 35.3-84 78-110 128-16.7 32
-27.7 63.7-33 95 0 1.3-.2 2.7-.5 4-.3 1.3-.5 2.3-.5 3 0 7.3 6.7 11 20 11 8 0
13.2-.8 15.5-2.5 2.3-1.7 4.2-5.5 5.5-11.5 2-13.3 5.7-27 11-41 14.7-44.7 39
-84.5 73-119.5s73.7-60.2 119-75.5c6-2 9-5.7 9-11s-3-9-9-11c-45.3-15.3-85-40.5
-119-75.5s-58.3-74.8-73-119.5c-4.7-14-8.3-27.3-11-40-1.3-6.7-3.2-10.8-5.5
-12.5-2.3-1.7-7.5-2.5-15.5-2.5-14 0-21 3.7-21 11 0 2 2 10.3 6 25 20.7 83.3 67
151.7 139 205zm96 379h399894v40H0zm0 0h399904v40H0z`,
  // The short left harpoon has 0.5em (i.e. 500 units) kern on the left end.
  // Ref from mhchem.sty: \rlap{\raisebox{-.22ex}{$\kern0.5em
  baraboveshortleftharpoon: `M507,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17
c2,0.7,5,1,9,1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21
c-32,-87.3,-82.7,-157.7,-152,-211c0,0,-3,-3,-3,-3l399351,0l0,-40
c-398570,0,-399437,0,-399437,0z M593 435 v40 H399500 v-40z
M0 281 v-40 H399908 v40z M0 281 v-40 H399908 v40z`,
  rightharpoonaboveshortbar: `M0,241 l0,40c399126,0,399993,0,399993,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M0 241 v40 H399908 v-40z M0 475 v-40 H399500 v40z M0 475 v-40 H399500 v40z`,
  shortbaraboveleftharpoon: `M7,435c-4,4,-6.3,8.7,-7,14c0,5.3,0.7,9,2,11
c1.3,2,5.3,5.3,12,10c90.7,54,156,130,196,228c3.3,10.7,6.3,16.3,9,17c2,0.7,5,1,9,
1c0,0,5,0,5,0c10.7,0,16.7,-2,18,-6c2,-2.7,1,-9.7,-3,-21c-32,-87.3,-82.7,-157.7,
-152,-211c0,0,-3,-3,-3,-3l399907,0l0,-40c-399126,0,-399993,0,-399993,0z
M93 435 v40 H400000 v-40z M500 241 v40 H400000 v-40z M500 241 v40 H400000 v-40z`,
  shortrightharpoonabovebar: `M53,241l0,40c398570,0,399437,0,399437,0
c4.7,-4.7,7,-9.3,7,-14c0,-9.3,-3.7,-15.3,-11,-18c-92.7,-56.7,-159,-133.7,-199,
-231c-3.3,-9.3,-6,-14.7,-8,-16c-2,-1.3,-7,-2,-15,-2c-10.7,0,-16.7,2,-18,6
c-2,2.7,-1,9.7,3,21c15.3,42,36.7,81.8,64,119.5c27.3,37.7,58,69.2,92,94.5z
M500 241 v40 H399408 v-40z M500 435 v40 H400000 v-40z`
}, cV = function(t, e) {
  switch (t) {
    case "lbrack":
      return "M403 1759 V84 H666 V0 H319 V1759 v" + e + ` v1759 h347 v-84
H403z M403 1759 V0 H319 V1759 v` + e + " v1759 h84z";
    case "rbrack":
      return "M347 1759 V0 H0 V84 H263 V1759 v" + e + ` v1759 H0 v84 H347z
M347 1759 V0 H263 V1759 v` + e + " v1759 h84z";
    case "vert":
      return "M145 15 v585 v" + e + ` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v` + -e + ` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v` + e + " v585 h43z";
    case "doublevert":
      return "M145 15 v585 v" + e + ` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v` + -e + ` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M188 15 H145 v585 v` + e + ` v585 h43z
M367 15 v585 v` + e + ` v585 c2.667,10,9.667,15,21,15
c10,0,16.667,-5,20,-15 v-585 v` + -e + ` v-585 c-2.667,-10,-9.667,-15,-21,-15
c-10,0,-16.667,5,-20,15z M410 15 H367 v585 v` + e + " v585 h43z";
    case "lfloor":
      return "M319 602 V0 H403 V602 v" + e + ` v1715 h263 v84 H319z
MM319 602 V0 H403 V602 v` + e + " v1715 H319z";
    case "rfloor":
      return "M319 602 V0 H403 V602 v" + e + ` v1799 H0 v-84 H319z
MM319 602 V0 H403 V602 v` + e + " v1715 H319z";
    case "lceil":
      return "M403 1759 V84 H666 V0 H319 V1759 v" + e + ` v602 h84z
M403 1759 V0 H319 V1759 v` + e + " v602 h84z";
    case "rceil":
      return "M347 1759 V0 H0 V84 H263 V1759 v" + e + ` v602 h84z
M347 1759 V0 h-84 V1759 v` + e + " v602 h84z";
    case "lparen":
      return `M863,9c0,-2,-2,-5,-6,-9c0,0,-17,0,-17,0c-12.7,0,-19.3,0.3,-20,1
c-5.3,5.3,-10.3,11,-15,17c-242.7,294.7,-395.3,682,-458,1162c-21.3,163.3,-33.3,349,
-36,557 l0,` + (e + 84) + `c0.2,6,0,26,0,60c2,159.3,10,310.7,24,454c53.3,528,210,
949.7,470,1265c4.7,6,9.7,11.7,15,17c0.7,0.7,7,1,19,1c0,0,18,0,18,0c4,-4,6,-7,6,-9
c0,-2.7,-3.3,-8.7,-10,-18c-135.3,-192.7,-235.5,-414.3,-300.5,-665c-65,-250.7,-102.5,
-544.7,-112.5,-882c-2,-104,-3,-167,-3,-189
l0,-` + (e + 92) + `c0,-162.7,5.7,-314,17,-454c20.7,-272,63.7,-513,129,-723c65.3,
-210,155.3,-396.3,270,-559c6.7,-9.3,10,-15.3,10,-18z`;
    case "rparen":
      return `M76,0c-16.7,0,-25,3,-25,9c0,2,2,6.3,6,13c21.3,28.7,42.3,60.3,
63,95c96.7,156.7,172.8,332.5,228.5,527.5c55.7,195,92.8,416.5,111.5,664.5
c11.3,139.3,17,290.7,17,454c0,28,1.7,43,3.3,45l0,` + (e + 9) + `
c-3,4,-3.3,16.7,-3.3,38c0,162,-5.7,313.7,-17,455c-18.7,248,-55.8,469.3,-111.5,664
c-55.7,194.7,-131.8,370.3,-228.5,527c-20.7,34.7,-41.7,66.3,-63,95c-2,3.3,-4,7,-6,11
c0,7.3,5.7,11,17,11c0,0,11,0,11,0c9.3,0,14.3,-0.3,15,-1c5.3,-5.3,10.3,-11,15,-17
c242.7,-294.7,395.3,-681.7,458,-1161c21.3,-164.7,33.3,-350.7,36,-558
l0,-` + (e + 144) + `c-2,-159.3,-10,-310.7,-24,-454c-53.3,-528,-210,-949.7,
-470,-1265c-4.7,-6,-9.7,-11.7,-15,-17c-0.7,-0.7,-6.7,-1,-18,-1z`;
    default:
      throw new Error("Unknown stretchy delimiter.");
  }
};
class Bg {
  // HtmlDomNode
  // Never used; needed for satisfying interface.
  constructor(t) {
    this.children = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.maxFontSize = void 0, this.style = void 0, this.children = t, this.classes = [], this.height = 0, this.depth = 0, this.maxFontSize = 0, this.style = {};
  }
  hasClass(t) {
    return ne.contains(this.classes, t);
  }
  /** Convert the fragment into a node. */
  toNode() {
    for (var t = document.createDocumentFragment(), e = 0; e < this.children.length; e++)
      t.appendChild(this.children[e].toNode());
    return t;
  }
  /** Convert the fragment into HTML markup. */
  toMarkup() {
    for (var t = "", e = 0; e < this.children.length; e++)
      t += this.children[e].toMarkup();
    return t;
  }
  /**
   * Converts the math node into a string, similar to innerText. Applies to
   * MathDomNode's only.
   */
  toText() {
    var t = (e) => e.toText();
    return this.children.map(t).join("");
  }
}
var Bl = {
  "AMS-Regular": {
    32: [0, 0, 0, 0, 0.25],
    65: [0, 0.68889, 0, 0, 0.72222],
    66: [0, 0.68889, 0, 0, 0.66667],
    67: [0, 0.68889, 0, 0, 0.72222],
    68: [0, 0.68889, 0, 0, 0.72222],
    69: [0, 0.68889, 0, 0, 0.66667],
    70: [0, 0.68889, 0, 0, 0.61111],
    71: [0, 0.68889, 0, 0, 0.77778],
    72: [0, 0.68889, 0, 0, 0.77778],
    73: [0, 0.68889, 0, 0, 0.38889],
    74: [0.16667, 0.68889, 0, 0, 0.5],
    75: [0, 0.68889, 0, 0, 0.77778],
    76: [0, 0.68889, 0, 0, 0.66667],
    77: [0, 0.68889, 0, 0, 0.94445],
    78: [0, 0.68889, 0, 0, 0.72222],
    79: [0.16667, 0.68889, 0, 0, 0.77778],
    80: [0, 0.68889, 0, 0, 0.61111],
    81: [0.16667, 0.68889, 0, 0, 0.77778],
    82: [0, 0.68889, 0, 0, 0.72222],
    83: [0, 0.68889, 0, 0, 0.55556],
    84: [0, 0.68889, 0, 0, 0.66667],
    85: [0, 0.68889, 0, 0, 0.72222],
    86: [0, 0.68889, 0, 0, 0.72222],
    87: [0, 0.68889, 0, 0, 1],
    88: [0, 0.68889, 0, 0, 0.72222],
    89: [0, 0.68889, 0, 0, 0.72222],
    90: [0, 0.68889, 0, 0, 0.66667],
    107: [0, 0.68889, 0, 0, 0.55556],
    160: [0, 0, 0, 0, 0.25],
    165: [0, 0.675, 0.025, 0, 0.75],
    174: [0.15559, 0.69224, 0, 0, 0.94666],
    240: [0, 0.68889, 0, 0, 0.55556],
    295: [0, 0.68889, 0, 0, 0.54028],
    710: [0, 0.825, 0, 0, 2.33334],
    732: [0, 0.9, 0, 0, 2.33334],
    770: [0, 0.825, 0, 0, 2.33334],
    771: [0, 0.9, 0, 0, 2.33334],
    989: [0.08167, 0.58167, 0, 0, 0.77778],
    1008: [0, 0.43056, 0.04028, 0, 0.66667],
    8245: [0, 0.54986, 0, 0, 0.275],
    8463: [0, 0.68889, 0, 0, 0.54028],
    8487: [0, 0.68889, 0, 0, 0.72222],
    8498: [0, 0.68889, 0, 0, 0.55556],
    8502: [0, 0.68889, 0, 0, 0.66667],
    8503: [0, 0.68889, 0, 0, 0.44445],
    8504: [0, 0.68889, 0, 0, 0.66667],
    8513: [0, 0.68889, 0, 0, 0.63889],
    8592: [-0.03598, 0.46402, 0, 0, 0.5],
    8594: [-0.03598, 0.46402, 0, 0, 0.5],
    8602: [-0.13313, 0.36687, 0, 0, 1],
    8603: [-0.13313, 0.36687, 0, 0, 1],
    8606: [0.01354, 0.52239, 0, 0, 1],
    8608: [0.01354, 0.52239, 0, 0, 1],
    8610: [0.01354, 0.52239, 0, 0, 1.11111],
    8611: [0.01354, 0.52239, 0, 0, 1.11111],
    8619: [0, 0.54986, 0, 0, 1],
    8620: [0, 0.54986, 0, 0, 1],
    8621: [-0.13313, 0.37788, 0, 0, 1.38889],
    8622: [-0.13313, 0.36687, 0, 0, 1],
    8624: [0, 0.69224, 0, 0, 0.5],
    8625: [0, 0.69224, 0, 0, 0.5],
    8630: [0, 0.43056, 0, 0, 1],
    8631: [0, 0.43056, 0, 0, 1],
    8634: [0.08198, 0.58198, 0, 0, 0.77778],
    8635: [0.08198, 0.58198, 0, 0, 0.77778],
    8638: [0.19444, 0.69224, 0, 0, 0.41667],
    8639: [0.19444, 0.69224, 0, 0, 0.41667],
    8642: [0.19444, 0.69224, 0, 0, 0.41667],
    8643: [0.19444, 0.69224, 0, 0, 0.41667],
    8644: [0.1808, 0.675, 0, 0, 1],
    8646: [0.1808, 0.675, 0, 0, 1],
    8647: [0.1808, 0.675, 0, 0, 1],
    8648: [0.19444, 0.69224, 0, 0, 0.83334],
    8649: [0.1808, 0.675, 0, 0, 1],
    8650: [0.19444, 0.69224, 0, 0, 0.83334],
    8651: [0.01354, 0.52239, 0, 0, 1],
    8652: [0.01354, 0.52239, 0, 0, 1],
    8653: [-0.13313, 0.36687, 0, 0, 1],
    8654: [-0.13313, 0.36687, 0, 0, 1],
    8655: [-0.13313, 0.36687, 0, 0, 1],
    8666: [0.13667, 0.63667, 0, 0, 1],
    8667: [0.13667, 0.63667, 0, 0, 1],
    8669: [-0.13313, 0.37788, 0, 0, 1],
    8672: [-0.064, 0.437, 0, 0, 1.334],
    8674: [-0.064, 0.437, 0, 0, 1.334],
    8705: [0, 0.825, 0, 0, 0.5],
    8708: [0, 0.68889, 0, 0, 0.55556],
    8709: [0.08167, 0.58167, 0, 0, 0.77778],
    8717: [0, 0.43056, 0, 0, 0.42917],
    8722: [-0.03598, 0.46402, 0, 0, 0.5],
    8724: [0.08198, 0.69224, 0, 0, 0.77778],
    8726: [0.08167, 0.58167, 0, 0, 0.77778],
    8733: [0, 0.69224, 0, 0, 0.77778],
    8736: [0, 0.69224, 0, 0, 0.72222],
    8737: [0, 0.69224, 0, 0, 0.72222],
    8738: [0.03517, 0.52239, 0, 0, 0.72222],
    8739: [0.08167, 0.58167, 0, 0, 0.22222],
    8740: [0.25142, 0.74111, 0, 0, 0.27778],
    8741: [0.08167, 0.58167, 0, 0, 0.38889],
    8742: [0.25142, 0.74111, 0, 0, 0.5],
    8756: [0, 0.69224, 0, 0, 0.66667],
    8757: [0, 0.69224, 0, 0, 0.66667],
    8764: [-0.13313, 0.36687, 0, 0, 0.77778],
    8765: [-0.13313, 0.37788, 0, 0, 0.77778],
    8769: [-0.13313, 0.36687, 0, 0, 0.77778],
    8770: [-0.03625, 0.46375, 0, 0, 0.77778],
    8774: [0.30274, 0.79383, 0, 0, 0.77778],
    8776: [-0.01688, 0.48312, 0, 0, 0.77778],
    8778: [0.08167, 0.58167, 0, 0, 0.77778],
    8782: [0.06062, 0.54986, 0, 0, 0.77778],
    8783: [0.06062, 0.54986, 0, 0, 0.77778],
    8785: [0.08198, 0.58198, 0, 0, 0.77778],
    8786: [0.08198, 0.58198, 0, 0, 0.77778],
    8787: [0.08198, 0.58198, 0, 0, 0.77778],
    8790: [0, 0.69224, 0, 0, 0.77778],
    8791: [0.22958, 0.72958, 0, 0, 0.77778],
    8796: [0.08198, 0.91667, 0, 0, 0.77778],
    8806: [0.25583, 0.75583, 0, 0, 0.77778],
    8807: [0.25583, 0.75583, 0, 0, 0.77778],
    8808: [0.25142, 0.75726, 0, 0, 0.77778],
    8809: [0.25142, 0.75726, 0, 0, 0.77778],
    8812: [0.25583, 0.75583, 0, 0, 0.5],
    8814: [0.20576, 0.70576, 0, 0, 0.77778],
    8815: [0.20576, 0.70576, 0, 0, 0.77778],
    8816: [0.30274, 0.79383, 0, 0, 0.77778],
    8817: [0.30274, 0.79383, 0, 0, 0.77778],
    8818: [0.22958, 0.72958, 0, 0, 0.77778],
    8819: [0.22958, 0.72958, 0, 0, 0.77778],
    8822: [0.1808, 0.675, 0, 0, 0.77778],
    8823: [0.1808, 0.675, 0, 0, 0.77778],
    8828: [0.13667, 0.63667, 0, 0, 0.77778],
    8829: [0.13667, 0.63667, 0, 0, 0.77778],
    8830: [0.22958, 0.72958, 0, 0, 0.77778],
    8831: [0.22958, 0.72958, 0, 0, 0.77778],
    8832: [0.20576, 0.70576, 0, 0, 0.77778],
    8833: [0.20576, 0.70576, 0, 0, 0.77778],
    8840: [0.30274, 0.79383, 0, 0, 0.77778],
    8841: [0.30274, 0.79383, 0, 0, 0.77778],
    8842: [0.13597, 0.63597, 0, 0, 0.77778],
    8843: [0.13597, 0.63597, 0, 0, 0.77778],
    8847: [0.03517, 0.54986, 0, 0, 0.77778],
    8848: [0.03517, 0.54986, 0, 0, 0.77778],
    8858: [0.08198, 0.58198, 0, 0, 0.77778],
    8859: [0.08198, 0.58198, 0, 0, 0.77778],
    8861: [0.08198, 0.58198, 0, 0, 0.77778],
    8862: [0, 0.675, 0, 0, 0.77778],
    8863: [0, 0.675, 0, 0, 0.77778],
    8864: [0, 0.675, 0, 0, 0.77778],
    8865: [0, 0.675, 0, 0, 0.77778],
    8872: [0, 0.69224, 0, 0, 0.61111],
    8873: [0, 0.69224, 0, 0, 0.72222],
    8874: [0, 0.69224, 0, 0, 0.88889],
    8876: [0, 0.68889, 0, 0, 0.61111],
    8877: [0, 0.68889, 0, 0, 0.61111],
    8878: [0, 0.68889, 0, 0, 0.72222],
    8879: [0, 0.68889, 0, 0, 0.72222],
    8882: [0.03517, 0.54986, 0, 0, 0.77778],
    8883: [0.03517, 0.54986, 0, 0, 0.77778],
    8884: [0.13667, 0.63667, 0, 0, 0.77778],
    8885: [0.13667, 0.63667, 0, 0, 0.77778],
    8888: [0, 0.54986, 0, 0, 1.11111],
    8890: [0.19444, 0.43056, 0, 0, 0.55556],
    8891: [0.19444, 0.69224, 0, 0, 0.61111],
    8892: [0.19444, 0.69224, 0, 0, 0.61111],
    8901: [0, 0.54986, 0, 0, 0.27778],
    8903: [0.08167, 0.58167, 0, 0, 0.77778],
    8905: [0.08167, 0.58167, 0, 0, 0.77778],
    8906: [0.08167, 0.58167, 0, 0, 0.77778],
    8907: [0, 0.69224, 0, 0, 0.77778],
    8908: [0, 0.69224, 0, 0, 0.77778],
    8909: [-0.03598, 0.46402, 0, 0, 0.77778],
    8910: [0, 0.54986, 0, 0, 0.76042],
    8911: [0, 0.54986, 0, 0, 0.76042],
    8912: [0.03517, 0.54986, 0, 0, 0.77778],
    8913: [0.03517, 0.54986, 0, 0, 0.77778],
    8914: [0, 0.54986, 0, 0, 0.66667],
    8915: [0, 0.54986, 0, 0, 0.66667],
    8916: [0, 0.69224, 0, 0, 0.66667],
    8918: [0.0391, 0.5391, 0, 0, 0.77778],
    8919: [0.0391, 0.5391, 0, 0, 0.77778],
    8920: [0.03517, 0.54986, 0, 0, 1.33334],
    8921: [0.03517, 0.54986, 0, 0, 1.33334],
    8922: [0.38569, 0.88569, 0, 0, 0.77778],
    8923: [0.38569, 0.88569, 0, 0, 0.77778],
    8926: [0.13667, 0.63667, 0, 0, 0.77778],
    8927: [0.13667, 0.63667, 0, 0, 0.77778],
    8928: [0.30274, 0.79383, 0, 0, 0.77778],
    8929: [0.30274, 0.79383, 0, 0, 0.77778],
    8934: [0.23222, 0.74111, 0, 0, 0.77778],
    8935: [0.23222, 0.74111, 0, 0, 0.77778],
    8936: [0.23222, 0.74111, 0, 0, 0.77778],
    8937: [0.23222, 0.74111, 0, 0, 0.77778],
    8938: [0.20576, 0.70576, 0, 0, 0.77778],
    8939: [0.20576, 0.70576, 0, 0, 0.77778],
    8940: [0.30274, 0.79383, 0, 0, 0.77778],
    8941: [0.30274, 0.79383, 0, 0, 0.77778],
    8994: [0.19444, 0.69224, 0, 0, 0.77778],
    8995: [0.19444, 0.69224, 0, 0, 0.77778],
    9416: [0.15559, 0.69224, 0, 0, 0.90222],
    9484: [0, 0.69224, 0, 0, 0.5],
    9488: [0, 0.69224, 0, 0, 0.5],
    9492: [0, 0.37788, 0, 0, 0.5],
    9496: [0, 0.37788, 0, 0, 0.5],
    9585: [0.19444, 0.68889, 0, 0, 0.88889],
    9586: [0.19444, 0.74111, 0, 0, 0.88889],
    9632: [0, 0.675, 0, 0, 0.77778],
    9633: [0, 0.675, 0, 0, 0.77778],
    9650: [0, 0.54986, 0, 0, 0.72222],
    9651: [0, 0.54986, 0, 0, 0.72222],
    9654: [0.03517, 0.54986, 0, 0, 0.77778],
    9660: [0, 0.54986, 0, 0, 0.72222],
    9661: [0, 0.54986, 0, 0, 0.72222],
    9664: [0.03517, 0.54986, 0, 0, 0.77778],
    9674: [0.11111, 0.69224, 0, 0, 0.66667],
    9733: [0.19444, 0.69224, 0, 0, 0.94445],
    10003: [0, 0.69224, 0, 0, 0.83334],
    10016: [0, 0.69224, 0, 0, 0.83334],
    10731: [0.11111, 0.69224, 0, 0, 0.66667],
    10846: [0.19444, 0.75583, 0, 0, 0.61111],
    10877: [0.13667, 0.63667, 0, 0, 0.77778],
    10878: [0.13667, 0.63667, 0, 0, 0.77778],
    10885: [0.25583, 0.75583, 0, 0, 0.77778],
    10886: [0.25583, 0.75583, 0, 0, 0.77778],
    10887: [0.13597, 0.63597, 0, 0, 0.77778],
    10888: [0.13597, 0.63597, 0, 0, 0.77778],
    10889: [0.26167, 0.75726, 0, 0, 0.77778],
    10890: [0.26167, 0.75726, 0, 0, 0.77778],
    10891: [0.48256, 0.98256, 0, 0, 0.77778],
    10892: [0.48256, 0.98256, 0, 0, 0.77778],
    10901: [0.13667, 0.63667, 0, 0, 0.77778],
    10902: [0.13667, 0.63667, 0, 0, 0.77778],
    10933: [0.25142, 0.75726, 0, 0, 0.77778],
    10934: [0.25142, 0.75726, 0, 0, 0.77778],
    10935: [0.26167, 0.75726, 0, 0, 0.77778],
    10936: [0.26167, 0.75726, 0, 0, 0.77778],
    10937: [0.26167, 0.75726, 0, 0, 0.77778],
    10938: [0.26167, 0.75726, 0, 0, 0.77778],
    10949: [0.25583, 0.75583, 0, 0, 0.77778],
    10950: [0.25583, 0.75583, 0, 0, 0.77778],
    10955: [0.28481, 0.79383, 0, 0, 0.77778],
    10956: [0.28481, 0.79383, 0, 0, 0.77778],
    57350: [0.08167, 0.58167, 0, 0, 0.22222],
    57351: [0.08167, 0.58167, 0, 0, 0.38889],
    57352: [0.08167, 0.58167, 0, 0, 0.77778],
    57353: [0, 0.43056, 0.04028, 0, 0.66667],
    57356: [0.25142, 0.75726, 0, 0, 0.77778],
    57357: [0.25142, 0.75726, 0, 0, 0.77778],
    57358: [0.41951, 0.91951, 0, 0, 0.77778],
    57359: [0.30274, 0.79383, 0, 0, 0.77778],
    57360: [0.30274, 0.79383, 0, 0, 0.77778],
    57361: [0.41951, 0.91951, 0, 0, 0.77778],
    57366: [0.25142, 0.75726, 0, 0, 0.77778],
    57367: [0.25142, 0.75726, 0, 0, 0.77778],
    57368: [0.25142, 0.75726, 0, 0, 0.77778],
    57369: [0.25142, 0.75726, 0, 0, 0.77778],
    57370: [0.13597, 0.63597, 0, 0, 0.77778],
    57371: [0.13597, 0.63597, 0, 0, 0.77778]
  },
  "Caligraphic-Regular": {
    32: [0, 0, 0, 0, 0.25],
    65: [0, 0.68333, 0, 0.19445, 0.79847],
    66: [0, 0.68333, 0.03041, 0.13889, 0.65681],
    67: [0, 0.68333, 0.05834, 0.13889, 0.52653],
    68: [0, 0.68333, 0.02778, 0.08334, 0.77139],
    69: [0, 0.68333, 0.08944, 0.11111, 0.52778],
    70: [0, 0.68333, 0.09931, 0.11111, 0.71875],
    71: [0.09722, 0.68333, 0.0593, 0.11111, 0.59487],
    72: [0, 0.68333, 965e-5, 0.11111, 0.84452],
    73: [0, 0.68333, 0.07382, 0, 0.54452],
    74: [0.09722, 0.68333, 0.18472, 0.16667, 0.67778],
    75: [0, 0.68333, 0.01445, 0.05556, 0.76195],
    76: [0, 0.68333, 0, 0.13889, 0.68972],
    77: [0, 0.68333, 0, 0.13889, 1.2009],
    78: [0, 0.68333, 0.14736, 0.08334, 0.82049],
    79: [0, 0.68333, 0.02778, 0.11111, 0.79611],
    80: [0, 0.68333, 0.08222, 0.08334, 0.69556],
    81: [0.09722, 0.68333, 0, 0.11111, 0.81667],
    82: [0, 0.68333, 0, 0.08334, 0.8475],
    83: [0, 0.68333, 0.075, 0.13889, 0.60556],
    84: [0, 0.68333, 0.25417, 0, 0.54464],
    85: [0, 0.68333, 0.09931, 0.08334, 0.62583],
    86: [0, 0.68333, 0.08222, 0, 0.61278],
    87: [0, 0.68333, 0.08222, 0.08334, 0.98778],
    88: [0, 0.68333, 0.14643, 0.13889, 0.7133],
    89: [0.09722, 0.68333, 0.08222, 0.08334, 0.66834],
    90: [0, 0.68333, 0.07944, 0.13889, 0.72473],
    160: [0, 0, 0, 0, 0.25]
  },
  "Fraktur-Regular": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69141, 0, 0, 0.29574],
    34: [0, 0.69141, 0, 0, 0.21471],
    38: [0, 0.69141, 0, 0, 0.73786],
    39: [0, 0.69141, 0, 0, 0.21201],
    40: [0.24982, 0.74947, 0, 0, 0.38865],
    41: [0.24982, 0.74947, 0, 0, 0.38865],
    42: [0, 0.62119, 0, 0, 0.27764],
    43: [0.08319, 0.58283, 0, 0, 0.75623],
    44: [0, 0.10803, 0, 0, 0.27764],
    45: [0.08319, 0.58283, 0, 0, 0.75623],
    46: [0, 0.10803, 0, 0, 0.27764],
    47: [0.24982, 0.74947, 0, 0, 0.50181],
    48: [0, 0.47534, 0, 0, 0.50181],
    49: [0, 0.47534, 0, 0, 0.50181],
    50: [0, 0.47534, 0, 0, 0.50181],
    51: [0.18906, 0.47534, 0, 0, 0.50181],
    52: [0.18906, 0.47534, 0, 0, 0.50181],
    53: [0.18906, 0.47534, 0, 0, 0.50181],
    54: [0, 0.69141, 0, 0, 0.50181],
    55: [0.18906, 0.47534, 0, 0, 0.50181],
    56: [0, 0.69141, 0, 0, 0.50181],
    57: [0.18906, 0.47534, 0, 0, 0.50181],
    58: [0, 0.47534, 0, 0, 0.21606],
    59: [0.12604, 0.47534, 0, 0, 0.21606],
    61: [-0.13099, 0.36866, 0, 0, 0.75623],
    63: [0, 0.69141, 0, 0, 0.36245],
    65: [0, 0.69141, 0, 0, 0.7176],
    66: [0, 0.69141, 0, 0, 0.88397],
    67: [0, 0.69141, 0, 0, 0.61254],
    68: [0, 0.69141, 0, 0, 0.83158],
    69: [0, 0.69141, 0, 0, 0.66278],
    70: [0.12604, 0.69141, 0, 0, 0.61119],
    71: [0, 0.69141, 0, 0, 0.78539],
    72: [0.06302, 0.69141, 0, 0, 0.7203],
    73: [0, 0.69141, 0, 0, 0.55448],
    74: [0.12604, 0.69141, 0, 0, 0.55231],
    75: [0, 0.69141, 0, 0, 0.66845],
    76: [0, 0.69141, 0, 0, 0.66602],
    77: [0, 0.69141, 0, 0, 1.04953],
    78: [0, 0.69141, 0, 0, 0.83212],
    79: [0, 0.69141, 0, 0, 0.82699],
    80: [0.18906, 0.69141, 0, 0, 0.82753],
    81: [0.03781, 0.69141, 0, 0, 0.82699],
    82: [0, 0.69141, 0, 0, 0.82807],
    83: [0, 0.69141, 0, 0, 0.82861],
    84: [0, 0.69141, 0, 0, 0.66899],
    85: [0, 0.69141, 0, 0, 0.64576],
    86: [0, 0.69141, 0, 0, 0.83131],
    87: [0, 0.69141, 0, 0, 1.04602],
    88: [0, 0.69141, 0, 0, 0.71922],
    89: [0.18906, 0.69141, 0, 0, 0.83293],
    90: [0.12604, 0.69141, 0, 0, 0.60201],
    91: [0.24982, 0.74947, 0, 0, 0.27764],
    93: [0.24982, 0.74947, 0, 0, 0.27764],
    94: [0, 0.69141, 0, 0, 0.49965],
    97: [0, 0.47534, 0, 0, 0.50046],
    98: [0, 0.69141, 0, 0, 0.51315],
    99: [0, 0.47534, 0, 0, 0.38946],
    100: [0, 0.62119, 0, 0, 0.49857],
    101: [0, 0.47534, 0, 0, 0.40053],
    102: [0.18906, 0.69141, 0, 0, 0.32626],
    103: [0.18906, 0.47534, 0, 0, 0.5037],
    104: [0.18906, 0.69141, 0, 0, 0.52126],
    105: [0, 0.69141, 0, 0, 0.27899],
    106: [0, 0.69141, 0, 0, 0.28088],
    107: [0, 0.69141, 0, 0, 0.38946],
    108: [0, 0.69141, 0, 0, 0.27953],
    109: [0, 0.47534, 0, 0, 0.76676],
    110: [0, 0.47534, 0, 0, 0.52666],
    111: [0, 0.47534, 0, 0, 0.48885],
    112: [0.18906, 0.52396, 0, 0, 0.50046],
    113: [0.18906, 0.47534, 0, 0, 0.48912],
    114: [0, 0.47534, 0, 0, 0.38919],
    115: [0, 0.47534, 0, 0, 0.44266],
    116: [0, 0.62119, 0, 0, 0.33301],
    117: [0, 0.47534, 0, 0, 0.5172],
    118: [0, 0.52396, 0, 0, 0.5118],
    119: [0, 0.52396, 0, 0, 0.77351],
    120: [0.18906, 0.47534, 0, 0, 0.38865],
    121: [0.18906, 0.47534, 0, 0, 0.49884],
    122: [0.18906, 0.47534, 0, 0, 0.39054],
    160: [0, 0, 0, 0, 0.25],
    8216: [0, 0.69141, 0, 0, 0.21471],
    8217: [0, 0.69141, 0, 0, 0.21471],
    58112: [0, 0.62119, 0, 0, 0.49749],
    58113: [0, 0.62119, 0, 0, 0.4983],
    58114: [0.18906, 0.69141, 0, 0, 0.33328],
    58115: [0.18906, 0.69141, 0, 0, 0.32923],
    58116: [0.18906, 0.47534, 0, 0, 0.50343],
    58117: [0, 0.69141, 0, 0, 0.33301],
    58118: [0, 0.62119, 0, 0, 0.33409],
    58119: [0, 0.47534, 0, 0, 0.50073]
  },
  "Main-Bold": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.35],
    34: [0, 0.69444, 0, 0, 0.60278],
    35: [0.19444, 0.69444, 0, 0, 0.95833],
    36: [0.05556, 0.75, 0, 0, 0.575],
    37: [0.05556, 0.75, 0, 0, 0.95833],
    38: [0, 0.69444, 0, 0, 0.89444],
    39: [0, 0.69444, 0, 0, 0.31944],
    40: [0.25, 0.75, 0, 0, 0.44722],
    41: [0.25, 0.75, 0, 0, 0.44722],
    42: [0, 0.75, 0, 0, 0.575],
    43: [0.13333, 0.63333, 0, 0, 0.89444],
    44: [0.19444, 0.15556, 0, 0, 0.31944],
    45: [0, 0.44444, 0, 0, 0.38333],
    46: [0, 0.15556, 0, 0, 0.31944],
    47: [0.25, 0.75, 0, 0, 0.575],
    48: [0, 0.64444, 0, 0, 0.575],
    49: [0, 0.64444, 0, 0, 0.575],
    50: [0, 0.64444, 0, 0, 0.575],
    51: [0, 0.64444, 0, 0, 0.575],
    52: [0, 0.64444, 0, 0, 0.575],
    53: [0, 0.64444, 0, 0, 0.575],
    54: [0, 0.64444, 0, 0, 0.575],
    55: [0, 0.64444, 0, 0, 0.575],
    56: [0, 0.64444, 0, 0, 0.575],
    57: [0, 0.64444, 0, 0, 0.575],
    58: [0, 0.44444, 0, 0, 0.31944],
    59: [0.19444, 0.44444, 0, 0, 0.31944],
    60: [0.08556, 0.58556, 0, 0, 0.89444],
    61: [-0.10889, 0.39111, 0, 0, 0.89444],
    62: [0.08556, 0.58556, 0, 0, 0.89444],
    63: [0, 0.69444, 0, 0, 0.54305],
    64: [0, 0.69444, 0, 0, 0.89444],
    65: [0, 0.68611, 0, 0, 0.86944],
    66: [0, 0.68611, 0, 0, 0.81805],
    67: [0, 0.68611, 0, 0, 0.83055],
    68: [0, 0.68611, 0, 0, 0.88194],
    69: [0, 0.68611, 0, 0, 0.75555],
    70: [0, 0.68611, 0, 0, 0.72361],
    71: [0, 0.68611, 0, 0, 0.90416],
    72: [0, 0.68611, 0, 0, 0.9],
    73: [0, 0.68611, 0, 0, 0.43611],
    74: [0, 0.68611, 0, 0, 0.59444],
    75: [0, 0.68611, 0, 0, 0.90138],
    76: [0, 0.68611, 0, 0, 0.69166],
    77: [0, 0.68611, 0, 0, 1.09166],
    78: [0, 0.68611, 0, 0, 0.9],
    79: [0, 0.68611, 0, 0, 0.86388],
    80: [0, 0.68611, 0, 0, 0.78611],
    81: [0.19444, 0.68611, 0, 0, 0.86388],
    82: [0, 0.68611, 0, 0, 0.8625],
    83: [0, 0.68611, 0, 0, 0.63889],
    84: [0, 0.68611, 0, 0, 0.8],
    85: [0, 0.68611, 0, 0, 0.88472],
    86: [0, 0.68611, 0.01597, 0, 0.86944],
    87: [0, 0.68611, 0.01597, 0, 1.18888],
    88: [0, 0.68611, 0, 0, 0.86944],
    89: [0, 0.68611, 0.02875, 0, 0.86944],
    90: [0, 0.68611, 0, 0, 0.70277],
    91: [0.25, 0.75, 0, 0, 0.31944],
    92: [0.25, 0.75, 0, 0, 0.575],
    93: [0.25, 0.75, 0, 0, 0.31944],
    94: [0, 0.69444, 0, 0, 0.575],
    95: [0.31, 0.13444, 0.03194, 0, 0.575],
    97: [0, 0.44444, 0, 0, 0.55902],
    98: [0, 0.69444, 0, 0, 0.63889],
    99: [0, 0.44444, 0, 0, 0.51111],
    100: [0, 0.69444, 0, 0, 0.63889],
    101: [0, 0.44444, 0, 0, 0.52708],
    102: [0, 0.69444, 0.10903, 0, 0.35139],
    103: [0.19444, 0.44444, 0.01597, 0, 0.575],
    104: [0, 0.69444, 0, 0, 0.63889],
    105: [0, 0.69444, 0, 0, 0.31944],
    106: [0.19444, 0.69444, 0, 0, 0.35139],
    107: [0, 0.69444, 0, 0, 0.60694],
    108: [0, 0.69444, 0, 0, 0.31944],
    109: [0, 0.44444, 0, 0, 0.95833],
    110: [0, 0.44444, 0, 0, 0.63889],
    111: [0, 0.44444, 0, 0, 0.575],
    112: [0.19444, 0.44444, 0, 0, 0.63889],
    113: [0.19444, 0.44444, 0, 0, 0.60694],
    114: [0, 0.44444, 0, 0, 0.47361],
    115: [0, 0.44444, 0, 0, 0.45361],
    116: [0, 0.63492, 0, 0, 0.44722],
    117: [0, 0.44444, 0, 0, 0.63889],
    118: [0, 0.44444, 0.01597, 0, 0.60694],
    119: [0, 0.44444, 0.01597, 0, 0.83055],
    120: [0, 0.44444, 0, 0, 0.60694],
    121: [0.19444, 0.44444, 0.01597, 0, 0.60694],
    122: [0, 0.44444, 0, 0, 0.51111],
    123: [0.25, 0.75, 0, 0, 0.575],
    124: [0.25, 0.75, 0, 0, 0.31944],
    125: [0.25, 0.75, 0, 0, 0.575],
    126: [0.35, 0.34444, 0, 0, 0.575],
    160: [0, 0, 0, 0, 0.25],
    163: [0, 0.69444, 0, 0, 0.86853],
    168: [0, 0.69444, 0, 0, 0.575],
    172: [0, 0.44444, 0, 0, 0.76666],
    176: [0, 0.69444, 0, 0, 0.86944],
    177: [0.13333, 0.63333, 0, 0, 0.89444],
    184: [0.17014, 0, 0, 0, 0.51111],
    198: [0, 0.68611, 0, 0, 1.04166],
    215: [0.13333, 0.63333, 0, 0, 0.89444],
    216: [0.04861, 0.73472, 0, 0, 0.89444],
    223: [0, 0.69444, 0, 0, 0.59722],
    230: [0, 0.44444, 0, 0, 0.83055],
    247: [0.13333, 0.63333, 0, 0, 0.89444],
    248: [0.09722, 0.54167, 0, 0, 0.575],
    305: [0, 0.44444, 0, 0, 0.31944],
    338: [0, 0.68611, 0, 0, 1.16944],
    339: [0, 0.44444, 0, 0, 0.89444],
    567: [0.19444, 0.44444, 0, 0, 0.35139],
    710: [0, 0.69444, 0, 0, 0.575],
    711: [0, 0.63194, 0, 0, 0.575],
    713: [0, 0.59611, 0, 0, 0.575],
    714: [0, 0.69444, 0, 0, 0.575],
    715: [0, 0.69444, 0, 0, 0.575],
    728: [0, 0.69444, 0, 0, 0.575],
    729: [0, 0.69444, 0, 0, 0.31944],
    730: [0, 0.69444, 0, 0, 0.86944],
    732: [0, 0.69444, 0, 0, 0.575],
    733: [0, 0.69444, 0, 0, 0.575],
    915: [0, 0.68611, 0, 0, 0.69166],
    916: [0, 0.68611, 0, 0, 0.95833],
    920: [0, 0.68611, 0, 0, 0.89444],
    923: [0, 0.68611, 0, 0, 0.80555],
    926: [0, 0.68611, 0, 0, 0.76666],
    928: [0, 0.68611, 0, 0, 0.9],
    931: [0, 0.68611, 0, 0, 0.83055],
    933: [0, 0.68611, 0, 0, 0.89444],
    934: [0, 0.68611, 0, 0, 0.83055],
    936: [0, 0.68611, 0, 0, 0.89444],
    937: [0, 0.68611, 0, 0, 0.83055],
    8211: [0, 0.44444, 0.03194, 0, 0.575],
    8212: [0, 0.44444, 0.03194, 0, 1.14999],
    8216: [0, 0.69444, 0, 0, 0.31944],
    8217: [0, 0.69444, 0, 0, 0.31944],
    8220: [0, 0.69444, 0, 0, 0.60278],
    8221: [0, 0.69444, 0, 0, 0.60278],
    8224: [0.19444, 0.69444, 0, 0, 0.51111],
    8225: [0.19444, 0.69444, 0, 0, 0.51111],
    8242: [0, 0.55556, 0, 0, 0.34444],
    8407: [0, 0.72444, 0.15486, 0, 0.575],
    8463: [0, 0.69444, 0, 0, 0.66759],
    8465: [0, 0.69444, 0, 0, 0.83055],
    8467: [0, 0.69444, 0, 0, 0.47361],
    8472: [0.19444, 0.44444, 0, 0, 0.74027],
    8476: [0, 0.69444, 0, 0, 0.83055],
    8501: [0, 0.69444, 0, 0, 0.70277],
    8592: [-0.10889, 0.39111, 0, 0, 1.14999],
    8593: [0.19444, 0.69444, 0, 0, 0.575],
    8594: [-0.10889, 0.39111, 0, 0, 1.14999],
    8595: [0.19444, 0.69444, 0, 0, 0.575],
    8596: [-0.10889, 0.39111, 0, 0, 1.14999],
    8597: [0.25, 0.75, 0, 0, 0.575],
    8598: [0.19444, 0.69444, 0, 0, 1.14999],
    8599: [0.19444, 0.69444, 0, 0, 1.14999],
    8600: [0.19444, 0.69444, 0, 0, 1.14999],
    8601: [0.19444, 0.69444, 0, 0, 1.14999],
    8636: [-0.10889, 0.39111, 0, 0, 1.14999],
    8637: [-0.10889, 0.39111, 0, 0, 1.14999],
    8640: [-0.10889, 0.39111, 0, 0, 1.14999],
    8641: [-0.10889, 0.39111, 0, 0, 1.14999],
    8656: [-0.10889, 0.39111, 0, 0, 1.14999],
    8657: [0.19444, 0.69444, 0, 0, 0.70277],
    8658: [-0.10889, 0.39111, 0, 0, 1.14999],
    8659: [0.19444, 0.69444, 0, 0, 0.70277],
    8660: [-0.10889, 0.39111, 0, 0, 1.14999],
    8661: [0.25, 0.75, 0, 0, 0.70277],
    8704: [0, 0.69444, 0, 0, 0.63889],
    8706: [0, 0.69444, 0.06389, 0, 0.62847],
    8707: [0, 0.69444, 0, 0, 0.63889],
    8709: [0.05556, 0.75, 0, 0, 0.575],
    8711: [0, 0.68611, 0, 0, 0.95833],
    8712: [0.08556, 0.58556, 0, 0, 0.76666],
    8715: [0.08556, 0.58556, 0, 0, 0.76666],
    8722: [0.13333, 0.63333, 0, 0, 0.89444],
    8723: [0.13333, 0.63333, 0, 0, 0.89444],
    8725: [0.25, 0.75, 0, 0, 0.575],
    8726: [0.25, 0.75, 0, 0, 0.575],
    8727: [-0.02778, 0.47222, 0, 0, 0.575],
    8728: [-0.02639, 0.47361, 0, 0, 0.575],
    8729: [-0.02639, 0.47361, 0, 0, 0.575],
    8730: [0.18, 0.82, 0, 0, 0.95833],
    8733: [0, 0.44444, 0, 0, 0.89444],
    8734: [0, 0.44444, 0, 0, 1.14999],
    8736: [0, 0.69224, 0, 0, 0.72222],
    8739: [0.25, 0.75, 0, 0, 0.31944],
    8741: [0.25, 0.75, 0, 0, 0.575],
    8743: [0, 0.55556, 0, 0, 0.76666],
    8744: [0, 0.55556, 0, 0, 0.76666],
    8745: [0, 0.55556, 0, 0, 0.76666],
    8746: [0, 0.55556, 0, 0, 0.76666],
    8747: [0.19444, 0.69444, 0.12778, 0, 0.56875],
    8764: [-0.10889, 0.39111, 0, 0, 0.89444],
    8768: [0.19444, 0.69444, 0, 0, 0.31944],
    8771: [222e-5, 0.50222, 0, 0, 0.89444],
    8773: [0.027, 0.638, 0, 0, 0.894],
    8776: [0.02444, 0.52444, 0, 0, 0.89444],
    8781: [222e-5, 0.50222, 0, 0, 0.89444],
    8801: [222e-5, 0.50222, 0, 0, 0.89444],
    8804: [0.19667, 0.69667, 0, 0, 0.89444],
    8805: [0.19667, 0.69667, 0, 0, 0.89444],
    8810: [0.08556, 0.58556, 0, 0, 1.14999],
    8811: [0.08556, 0.58556, 0, 0, 1.14999],
    8826: [0.08556, 0.58556, 0, 0, 0.89444],
    8827: [0.08556, 0.58556, 0, 0, 0.89444],
    8834: [0.08556, 0.58556, 0, 0, 0.89444],
    8835: [0.08556, 0.58556, 0, 0, 0.89444],
    8838: [0.19667, 0.69667, 0, 0, 0.89444],
    8839: [0.19667, 0.69667, 0, 0, 0.89444],
    8846: [0, 0.55556, 0, 0, 0.76666],
    8849: [0.19667, 0.69667, 0, 0, 0.89444],
    8850: [0.19667, 0.69667, 0, 0, 0.89444],
    8851: [0, 0.55556, 0, 0, 0.76666],
    8852: [0, 0.55556, 0, 0, 0.76666],
    8853: [0.13333, 0.63333, 0, 0, 0.89444],
    8854: [0.13333, 0.63333, 0, 0, 0.89444],
    8855: [0.13333, 0.63333, 0, 0, 0.89444],
    8856: [0.13333, 0.63333, 0, 0, 0.89444],
    8857: [0.13333, 0.63333, 0, 0, 0.89444],
    8866: [0, 0.69444, 0, 0, 0.70277],
    8867: [0, 0.69444, 0, 0, 0.70277],
    8868: [0, 0.69444, 0, 0, 0.89444],
    8869: [0, 0.69444, 0, 0, 0.89444],
    8900: [-0.02639, 0.47361, 0, 0, 0.575],
    8901: [-0.02639, 0.47361, 0, 0, 0.31944],
    8902: [-0.02778, 0.47222, 0, 0, 0.575],
    8968: [0.25, 0.75, 0, 0, 0.51111],
    8969: [0.25, 0.75, 0, 0, 0.51111],
    8970: [0.25, 0.75, 0, 0, 0.51111],
    8971: [0.25, 0.75, 0, 0, 0.51111],
    8994: [-0.13889, 0.36111, 0, 0, 1.14999],
    8995: [-0.13889, 0.36111, 0, 0, 1.14999],
    9651: [0.19444, 0.69444, 0, 0, 1.02222],
    9657: [-0.02778, 0.47222, 0, 0, 0.575],
    9661: [0.19444, 0.69444, 0, 0, 1.02222],
    9667: [-0.02778, 0.47222, 0, 0, 0.575],
    9711: [0.19444, 0.69444, 0, 0, 1.14999],
    9824: [0.12963, 0.69444, 0, 0, 0.89444],
    9825: [0.12963, 0.69444, 0, 0, 0.89444],
    9826: [0.12963, 0.69444, 0, 0, 0.89444],
    9827: [0.12963, 0.69444, 0, 0, 0.89444],
    9837: [0, 0.75, 0, 0, 0.44722],
    9838: [0.19444, 0.69444, 0, 0, 0.44722],
    9839: [0.19444, 0.69444, 0, 0, 0.44722],
    10216: [0.25, 0.75, 0, 0, 0.44722],
    10217: [0.25, 0.75, 0, 0, 0.44722],
    10815: [0, 0.68611, 0, 0, 0.9],
    10927: [0.19667, 0.69667, 0, 0, 0.89444],
    10928: [0.19667, 0.69667, 0, 0, 0.89444],
    57376: [0.19444, 0.69444, 0, 0, 0]
  },
  "Main-BoldItalic": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0.11417, 0, 0.38611],
    34: [0, 0.69444, 0.07939, 0, 0.62055],
    35: [0.19444, 0.69444, 0.06833, 0, 0.94444],
    37: [0.05556, 0.75, 0.12861, 0, 0.94444],
    38: [0, 0.69444, 0.08528, 0, 0.88555],
    39: [0, 0.69444, 0.12945, 0, 0.35555],
    40: [0.25, 0.75, 0.15806, 0, 0.47333],
    41: [0.25, 0.75, 0.03306, 0, 0.47333],
    42: [0, 0.75, 0.14333, 0, 0.59111],
    43: [0.10333, 0.60333, 0.03306, 0, 0.88555],
    44: [0.19444, 0.14722, 0, 0, 0.35555],
    45: [0, 0.44444, 0.02611, 0, 0.41444],
    46: [0, 0.14722, 0, 0, 0.35555],
    47: [0.25, 0.75, 0.15806, 0, 0.59111],
    48: [0, 0.64444, 0.13167, 0, 0.59111],
    49: [0, 0.64444, 0.13167, 0, 0.59111],
    50: [0, 0.64444, 0.13167, 0, 0.59111],
    51: [0, 0.64444, 0.13167, 0, 0.59111],
    52: [0.19444, 0.64444, 0.13167, 0, 0.59111],
    53: [0, 0.64444, 0.13167, 0, 0.59111],
    54: [0, 0.64444, 0.13167, 0, 0.59111],
    55: [0.19444, 0.64444, 0.13167, 0, 0.59111],
    56: [0, 0.64444, 0.13167, 0, 0.59111],
    57: [0, 0.64444, 0.13167, 0, 0.59111],
    58: [0, 0.44444, 0.06695, 0, 0.35555],
    59: [0.19444, 0.44444, 0.06695, 0, 0.35555],
    61: [-0.10889, 0.39111, 0.06833, 0, 0.88555],
    63: [0, 0.69444, 0.11472, 0, 0.59111],
    64: [0, 0.69444, 0.09208, 0, 0.88555],
    65: [0, 0.68611, 0, 0, 0.86555],
    66: [0, 0.68611, 0.0992, 0, 0.81666],
    67: [0, 0.68611, 0.14208, 0, 0.82666],
    68: [0, 0.68611, 0.09062, 0, 0.87555],
    69: [0, 0.68611, 0.11431, 0, 0.75666],
    70: [0, 0.68611, 0.12903, 0, 0.72722],
    71: [0, 0.68611, 0.07347, 0, 0.89527],
    72: [0, 0.68611, 0.17208, 0, 0.8961],
    73: [0, 0.68611, 0.15681, 0, 0.47166],
    74: [0, 0.68611, 0.145, 0, 0.61055],
    75: [0, 0.68611, 0.14208, 0, 0.89499],
    76: [0, 0.68611, 0, 0, 0.69777],
    77: [0, 0.68611, 0.17208, 0, 1.07277],
    78: [0, 0.68611, 0.17208, 0, 0.8961],
    79: [0, 0.68611, 0.09062, 0, 0.85499],
    80: [0, 0.68611, 0.0992, 0, 0.78721],
    81: [0.19444, 0.68611, 0.09062, 0, 0.85499],
    82: [0, 0.68611, 0.02559, 0, 0.85944],
    83: [0, 0.68611, 0.11264, 0, 0.64999],
    84: [0, 0.68611, 0.12903, 0, 0.7961],
    85: [0, 0.68611, 0.17208, 0, 0.88083],
    86: [0, 0.68611, 0.18625, 0, 0.86555],
    87: [0, 0.68611, 0.18625, 0, 1.15999],
    88: [0, 0.68611, 0.15681, 0, 0.86555],
    89: [0, 0.68611, 0.19803, 0, 0.86555],
    90: [0, 0.68611, 0.14208, 0, 0.70888],
    91: [0.25, 0.75, 0.1875, 0, 0.35611],
    93: [0.25, 0.75, 0.09972, 0, 0.35611],
    94: [0, 0.69444, 0.06709, 0, 0.59111],
    95: [0.31, 0.13444, 0.09811, 0, 0.59111],
    97: [0, 0.44444, 0.09426, 0, 0.59111],
    98: [0, 0.69444, 0.07861, 0, 0.53222],
    99: [0, 0.44444, 0.05222, 0, 0.53222],
    100: [0, 0.69444, 0.10861, 0, 0.59111],
    101: [0, 0.44444, 0.085, 0, 0.53222],
    102: [0.19444, 0.69444, 0.21778, 0, 0.4],
    103: [0.19444, 0.44444, 0.105, 0, 0.53222],
    104: [0, 0.69444, 0.09426, 0, 0.59111],
    105: [0, 0.69326, 0.11387, 0, 0.35555],
    106: [0.19444, 0.69326, 0.1672, 0, 0.35555],
    107: [0, 0.69444, 0.11111, 0, 0.53222],
    108: [0, 0.69444, 0.10861, 0, 0.29666],
    109: [0, 0.44444, 0.09426, 0, 0.94444],
    110: [0, 0.44444, 0.09426, 0, 0.64999],
    111: [0, 0.44444, 0.07861, 0, 0.59111],
    112: [0.19444, 0.44444, 0.07861, 0, 0.59111],
    113: [0.19444, 0.44444, 0.105, 0, 0.53222],
    114: [0, 0.44444, 0.11111, 0, 0.50167],
    115: [0, 0.44444, 0.08167, 0, 0.48694],
    116: [0, 0.63492, 0.09639, 0, 0.385],
    117: [0, 0.44444, 0.09426, 0, 0.62055],
    118: [0, 0.44444, 0.11111, 0, 0.53222],
    119: [0, 0.44444, 0.11111, 0, 0.76777],
    120: [0, 0.44444, 0.12583, 0, 0.56055],
    121: [0.19444, 0.44444, 0.105, 0, 0.56166],
    122: [0, 0.44444, 0.13889, 0, 0.49055],
    126: [0.35, 0.34444, 0.11472, 0, 0.59111],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.69444, 0.11473, 0, 0.59111],
    176: [0, 0.69444, 0, 0, 0.94888],
    184: [0.17014, 0, 0, 0, 0.53222],
    198: [0, 0.68611, 0.11431, 0, 1.02277],
    216: [0.04861, 0.73472, 0.09062, 0, 0.88555],
    223: [0.19444, 0.69444, 0.09736, 0, 0.665],
    230: [0, 0.44444, 0.085, 0, 0.82666],
    248: [0.09722, 0.54167, 0.09458, 0, 0.59111],
    305: [0, 0.44444, 0.09426, 0, 0.35555],
    338: [0, 0.68611, 0.11431, 0, 1.14054],
    339: [0, 0.44444, 0.085, 0, 0.82666],
    567: [0.19444, 0.44444, 0.04611, 0, 0.385],
    710: [0, 0.69444, 0.06709, 0, 0.59111],
    711: [0, 0.63194, 0.08271, 0, 0.59111],
    713: [0, 0.59444, 0.10444, 0, 0.59111],
    714: [0, 0.69444, 0.08528, 0, 0.59111],
    715: [0, 0.69444, 0, 0, 0.59111],
    728: [0, 0.69444, 0.10333, 0, 0.59111],
    729: [0, 0.69444, 0.12945, 0, 0.35555],
    730: [0, 0.69444, 0, 0, 0.94888],
    732: [0, 0.69444, 0.11472, 0, 0.59111],
    733: [0, 0.69444, 0.11472, 0, 0.59111],
    915: [0, 0.68611, 0.12903, 0, 0.69777],
    916: [0, 0.68611, 0, 0, 0.94444],
    920: [0, 0.68611, 0.09062, 0, 0.88555],
    923: [0, 0.68611, 0, 0, 0.80666],
    926: [0, 0.68611, 0.15092, 0, 0.76777],
    928: [0, 0.68611, 0.17208, 0, 0.8961],
    931: [0, 0.68611, 0.11431, 0, 0.82666],
    933: [0, 0.68611, 0.10778, 0, 0.88555],
    934: [0, 0.68611, 0.05632, 0, 0.82666],
    936: [0, 0.68611, 0.10778, 0, 0.88555],
    937: [0, 0.68611, 0.0992, 0, 0.82666],
    8211: [0, 0.44444, 0.09811, 0, 0.59111],
    8212: [0, 0.44444, 0.09811, 0, 1.18221],
    8216: [0, 0.69444, 0.12945, 0, 0.35555],
    8217: [0, 0.69444, 0.12945, 0, 0.35555],
    8220: [0, 0.69444, 0.16772, 0, 0.62055],
    8221: [0, 0.69444, 0.07939, 0, 0.62055]
  },
  "Main-Italic": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0.12417, 0, 0.30667],
    34: [0, 0.69444, 0.06961, 0, 0.51444],
    35: [0.19444, 0.69444, 0.06616, 0, 0.81777],
    37: [0.05556, 0.75, 0.13639, 0, 0.81777],
    38: [0, 0.69444, 0.09694, 0, 0.76666],
    39: [0, 0.69444, 0.12417, 0, 0.30667],
    40: [0.25, 0.75, 0.16194, 0, 0.40889],
    41: [0.25, 0.75, 0.03694, 0, 0.40889],
    42: [0, 0.75, 0.14917, 0, 0.51111],
    43: [0.05667, 0.56167, 0.03694, 0, 0.76666],
    44: [0.19444, 0.10556, 0, 0, 0.30667],
    45: [0, 0.43056, 0.02826, 0, 0.35778],
    46: [0, 0.10556, 0, 0, 0.30667],
    47: [0.25, 0.75, 0.16194, 0, 0.51111],
    48: [0, 0.64444, 0.13556, 0, 0.51111],
    49: [0, 0.64444, 0.13556, 0, 0.51111],
    50: [0, 0.64444, 0.13556, 0, 0.51111],
    51: [0, 0.64444, 0.13556, 0, 0.51111],
    52: [0.19444, 0.64444, 0.13556, 0, 0.51111],
    53: [0, 0.64444, 0.13556, 0, 0.51111],
    54: [0, 0.64444, 0.13556, 0, 0.51111],
    55: [0.19444, 0.64444, 0.13556, 0, 0.51111],
    56: [0, 0.64444, 0.13556, 0, 0.51111],
    57: [0, 0.64444, 0.13556, 0, 0.51111],
    58: [0, 0.43056, 0.0582, 0, 0.30667],
    59: [0.19444, 0.43056, 0.0582, 0, 0.30667],
    61: [-0.13313, 0.36687, 0.06616, 0, 0.76666],
    63: [0, 0.69444, 0.1225, 0, 0.51111],
    64: [0, 0.69444, 0.09597, 0, 0.76666],
    65: [0, 0.68333, 0, 0, 0.74333],
    66: [0, 0.68333, 0.10257, 0, 0.70389],
    67: [0, 0.68333, 0.14528, 0, 0.71555],
    68: [0, 0.68333, 0.09403, 0, 0.755],
    69: [0, 0.68333, 0.12028, 0, 0.67833],
    70: [0, 0.68333, 0.13305, 0, 0.65277],
    71: [0, 0.68333, 0.08722, 0, 0.77361],
    72: [0, 0.68333, 0.16389, 0, 0.74333],
    73: [0, 0.68333, 0.15806, 0, 0.38555],
    74: [0, 0.68333, 0.14028, 0, 0.525],
    75: [0, 0.68333, 0.14528, 0, 0.76888],
    76: [0, 0.68333, 0, 0, 0.62722],
    77: [0, 0.68333, 0.16389, 0, 0.89666],
    78: [0, 0.68333, 0.16389, 0, 0.74333],
    79: [0, 0.68333, 0.09403, 0, 0.76666],
    80: [0, 0.68333, 0.10257, 0, 0.67833],
    81: [0.19444, 0.68333, 0.09403, 0, 0.76666],
    82: [0, 0.68333, 0.03868, 0, 0.72944],
    83: [0, 0.68333, 0.11972, 0, 0.56222],
    84: [0, 0.68333, 0.13305, 0, 0.71555],
    85: [0, 0.68333, 0.16389, 0, 0.74333],
    86: [0, 0.68333, 0.18361, 0, 0.74333],
    87: [0, 0.68333, 0.18361, 0, 0.99888],
    88: [0, 0.68333, 0.15806, 0, 0.74333],
    89: [0, 0.68333, 0.19383, 0, 0.74333],
    90: [0, 0.68333, 0.14528, 0, 0.61333],
    91: [0.25, 0.75, 0.1875, 0, 0.30667],
    93: [0.25, 0.75, 0.10528, 0, 0.30667],
    94: [0, 0.69444, 0.06646, 0, 0.51111],
    95: [0.31, 0.12056, 0.09208, 0, 0.51111],
    97: [0, 0.43056, 0.07671, 0, 0.51111],
    98: [0, 0.69444, 0.06312, 0, 0.46],
    99: [0, 0.43056, 0.05653, 0, 0.46],
    100: [0, 0.69444, 0.10333, 0, 0.51111],
    101: [0, 0.43056, 0.07514, 0, 0.46],
    102: [0.19444, 0.69444, 0.21194, 0, 0.30667],
    103: [0.19444, 0.43056, 0.08847, 0, 0.46],
    104: [0, 0.69444, 0.07671, 0, 0.51111],
    105: [0, 0.65536, 0.1019, 0, 0.30667],
    106: [0.19444, 0.65536, 0.14467, 0, 0.30667],
    107: [0, 0.69444, 0.10764, 0, 0.46],
    108: [0, 0.69444, 0.10333, 0, 0.25555],
    109: [0, 0.43056, 0.07671, 0, 0.81777],
    110: [0, 0.43056, 0.07671, 0, 0.56222],
    111: [0, 0.43056, 0.06312, 0, 0.51111],
    112: [0.19444, 0.43056, 0.06312, 0, 0.51111],
    113: [0.19444, 0.43056, 0.08847, 0, 0.46],
    114: [0, 0.43056, 0.10764, 0, 0.42166],
    115: [0, 0.43056, 0.08208, 0, 0.40889],
    116: [0, 0.61508, 0.09486, 0, 0.33222],
    117: [0, 0.43056, 0.07671, 0, 0.53666],
    118: [0, 0.43056, 0.10764, 0, 0.46],
    119: [0, 0.43056, 0.10764, 0, 0.66444],
    120: [0, 0.43056, 0.12042, 0, 0.46389],
    121: [0.19444, 0.43056, 0.08847, 0, 0.48555],
    122: [0, 0.43056, 0.12292, 0, 0.40889],
    126: [0.35, 0.31786, 0.11585, 0, 0.51111],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.66786, 0.10474, 0, 0.51111],
    176: [0, 0.69444, 0, 0, 0.83129],
    184: [0.17014, 0, 0, 0, 0.46],
    198: [0, 0.68333, 0.12028, 0, 0.88277],
    216: [0.04861, 0.73194, 0.09403, 0, 0.76666],
    223: [0.19444, 0.69444, 0.10514, 0, 0.53666],
    230: [0, 0.43056, 0.07514, 0, 0.71555],
    248: [0.09722, 0.52778, 0.09194, 0, 0.51111],
    338: [0, 0.68333, 0.12028, 0, 0.98499],
    339: [0, 0.43056, 0.07514, 0, 0.71555],
    710: [0, 0.69444, 0.06646, 0, 0.51111],
    711: [0, 0.62847, 0.08295, 0, 0.51111],
    713: [0, 0.56167, 0.10333, 0, 0.51111],
    714: [0, 0.69444, 0.09694, 0, 0.51111],
    715: [0, 0.69444, 0, 0, 0.51111],
    728: [0, 0.69444, 0.10806, 0, 0.51111],
    729: [0, 0.66786, 0.11752, 0, 0.30667],
    730: [0, 0.69444, 0, 0, 0.83129],
    732: [0, 0.66786, 0.11585, 0, 0.51111],
    733: [0, 0.69444, 0.1225, 0, 0.51111],
    915: [0, 0.68333, 0.13305, 0, 0.62722],
    916: [0, 0.68333, 0, 0, 0.81777],
    920: [0, 0.68333, 0.09403, 0, 0.76666],
    923: [0, 0.68333, 0, 0, 0.69222],
    926: [0, 0.68333, 0.15294, 0, 0.66444],
    928: [0, 0.68333, 0.16389, 0, 0.74333],
    931: [0, 0.68333, 0.12028, 0, 0.71555],
    933: [0, 0.68333, 0.11111, 0, 0.76666],
    934: [0, 0.68333, 0.05986, 0, 0.71555],
    936: [0, 0.68333, 0.11111, 0, 0.76666],
    937: [0, 0.68333, 0.10257, 0, 0.71555],
    8211: [0, 0.43056, 0.09208, 0, 0.51111],
    8212: [0, 0.43056, 0.09208, 0, 1.02222],
    8216: [0, 0.69444, 0.12417, 0, 0.30667],
    8217: [0, 0.69444, 0.12417, 0, 0.30667],
    8220: [0, 0.69444, 0.1685, 0, 0.51444],
    8221: [0, 0.69444, 0.06961, 0, 0.51444],
    8463: [0, 0.68889, 0, 0, 0.54028]
  },
  "Main-Regular": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.27778],
    34: [0, 0.69444, 0, 0, 0.5],
    35: [0.19444, 0.69444, 0, 0, 0.83334],
    36: [0.05556, 0.75, 0, 0, 0.5],
    37: [0.05556, 0.75, 0, 0, 0.83334],
    38: [0, 0.69444, 0, 0, 0.77778],
    39: [0, 0.69444, 0, 0, 0.27778],
    40: [0.25, 0.75, 0, 0, 0.38889],
    41: [0.25, 0.75, 0, 0, 0.38889],
    42: [0, 0.75, 0, 0, 0.5],
    43: [0.08333, 0.58333, 0, 0, 0.77778],
    44: [0.19444, 0.10556, 0, 0, 0.27778],
    45: [0, 0.43056, 0, 0, 0.33333],
    46: [0, 0.10556, 0, 0, 0.27778],
    47: [0.25, 0.75, 0, 0, 0.5],
    48: [0, 0.64444, 0, 0, 0.5],
    49: [0, 0.64444, 0, 0, 0.5],
    50: [0, 0.64444, 0, 0, 0.5],
    51: [0, 0.64444, 0, 0, 0.5],
    52: [0, 0.64444, 0, 0, 0.5],
    53: [0, 0.64444, 0, 0, 0.5],
    54: [0, 0.64444, 0, 0, 0.5],
    55: [0, 0.64444, 0, 0, 0.5],
    56: [0, 0.64444, 0, 0, 0.5],
    57: [0, 0.64444, 0, 0, 0.5],
    58: [0, 0.43056, 0, 0, 0.27778],
    59: [0.19444, 0.43056, 0, 0, 0.27778],
    60: [0.0391, 0.5391, 0, 0, 0.77778],
    61: [-0.13313, 0.36687, 0, 0, 0.77778],
    62: [0.0391, 0.5391, 0, 0, 0.77778],
    63: [0, 0.69444, 0, 0, 0.47222],
    64: [0, 0.69444, 0, 0, 0.77778],
    65: [0, 0.68333, 0, 0, 0.75],
    66: [0, 0.68333, 0, 0, 0.70834],
    67: [0, 0.68333, 0, 0, 0.72222],
    68: [0, 0.68333, 0, 0, 0.76389],
    69: [0, 0.68333, 0, 0, 0.68056],
    70: [0, 0.68333, 0, 0, 0.65278],
    71: [0, 0.68333, 0, 0, 0.78472],
    72: [0, 0.68333, 0, 0, 0.75],
    73: [0, 0.68333, 0, 0, 0.36111],
    74: [0, 0.68333, 0, 0, 0.51389],
    75: [0, 0.68333, 0, 0, 0.77778],
    76: [0, 0.68333, 0, 0, 0.625],
    77: [0, 0.68333, 0, 0, 0.91667],
    78: [0, 0.68333, 0, 0, 0.75],
    79: [0, 0.68333, 0, 0, 0.77778],
    80: [0, 0.68333, 0, 0, 0.68056],
    81: [0.19444, 0.68333, 0, 0, 0.77778],
    82: [0, 0.68333, 0, 0, 0.73611],
    83: [0, 0.68333, 0, 0, 0.55556],
    84: [0, 0.68333, 0, 0, 0.72222],
    85: [0, 0.68333, 0, 0, 0.75],
    86: [0, 0.68333, 0.01389, 0, 0.75],
    87: [0, 0.68333, 0.01389, 0, 1.02778],
    88: [0, 0.68333, 0, 0, 0.75],
    89: [0, 0.68333, 0.025, 0, 0.75],
    90: [0, 0.68333, 0, 0, 0.61111],
    91: [0.25, 0.75, 0, 0, 0.27778],
    92: [0.25, 0.75, 0, 0, 0.5],
    93: [0.25, 0.75, 0, 0, 0.27778],
    94: [0, 0.69444, 0, 0, 0.5],
    95: [0.31, 0.12056, 0.02778, 0, 0.5],
    97: [0, 0.43056, 0, 0, 0.5],
    98: [0, 0.69444, 0, 0, 0.55556],
    99: [0, 0.43056, 0, 0, 0.44445],
    100: [0, 0.69444, 0, 0, 0.55556],
    101: [0, 0.43056, 0, 0, 0.44445],
    102: [0, 0.69444, 0.07778, 0, 0.30556],
    103: [0.19444, 0.43056, 0.01389, 0, 0.5],
    104: [0, 0.69444, 0, 0, 0.55556],
    105: [0, 0.66786, 0, 0, 0.27778],
    106: [0.19444, 0.66786, 0, 0, 0.30556],
    107: [0, 0.69444, 0, 0, 0.52778],
    108: [0, 0.69444, 0, 0, 0.27778],
    109: [0, 0.43056, 0, 0, 0.83334],
    110: [0, 0.43056, 0, 0, 0.55556],
    111: [0, 0.43056, 0, 0, 0.5],
    112: [0.19444, 0.43056, 0, 0, 0.55556],
    113: [0.19444, 0.43056, 0, 0, 0.52778],
    114: [0, 0.43056, 0, 0, 0.39167],
    115: [0, 0.43056, 0, 0, 0.39445],
    116: [0, 0.61508, 0, 0, 0.38889],
    117: [0, 0.43056, 0, 0, 0.55556],
    118: [0, 0.43056, 0.01389, 0, 0.52778],
    119: [0, 0.43056, 0.01389, 0, 0.72222],
    120: [0, 0.43056, 0, 0, 0.52778],
    121: [0.19444, 0.43056, 0.01389, 0, 0.52778],
    122: [0, 0.43056, 0, 0, 0.44445],
    123: [0.25, 0.75, 0, 0, 0.5],
    124: [0.25, 0.75, 0, 0, 0.27778],
    125: [0.25, 0.75, 0, 0, 0.5],
    126: [0.35, 0.31786, 0, 0, 0.5],
    160: [0, 0, 0, 0, 0.25],
    163: [0, 0.69444, 0, 0, 0.76909],
    167: [0.19444, 0.69444, 0, 0, 0.44445],
    168: [0, 0.66786, 0, 0, 0.5],
    172: [0, 0.43056, 0, 0, 0.66667],
    176: [0, 0.69444, 0, 0, 0.75],
    177: [0.08333, 0.58333, 0, 0, 0.77778],
    182: [0.19444, 0.69444, 0, 0, 0.61111],
    184: [0.17014, 0, 0, 0, 0.44445],
    198: [0, 0.68333, 0, 0, 0.90278],
    215: [0.08333, 0.58333, 0, 0, 0.77778],
    216: [0.04861, 0.73194, 0, 0, 0.77778],
    223: [0, 0.69444, 0, 0, 0.5],
    230: [0, 0.43056, 0, 0, 0.72222],
    247: [0.08333, 0.58333, 0, 0, 0.77778],
    248: [0.09722, 0.52778, 0, 0, 0.5],
    305: [0, 0.43056, 0, 0, 0.27778],
    338: [0, 0.68333, 0, 0, 1.01389],
    339: [0, 0.43056, 0, 0, 0.77778],
    567: [0.19444, 0.43056, 0, 0, 0.30556],
    710: [0, 0.69444, 0, 0, 0.5],
    711: [0, 0.62847, 0, 0, 0.5],
    713: [0, 0.56778, 0, 0, 0.5],
    714: [0, 0.69444, 0, 0, 0.5],
    715: [0, 0.69444, 0, 0, 0.5],
    728: [0, 0.69444, 0, 0, 0.5],
    729: [0, 0.66786, 0, 0, 0.27778],
    730: [0, 0.69444, 0, 0, 0.75],
    732: [0, 0.66786, 0, 0, 0.5],
    733: [0, 0.69444, 0, 0, 0.5],
    915: [0, 0.68333, 0, 0, 0.625],
    916: [0, 0.68333, 0, 0, 0.83334],
    920: [0, 0.68333, 0, 0, 0.77778],
    923: [0, 0.68333, 0, 0, 0.69445],
    926: [0, 0.68333, 0, 0, 0.66667],
    928: [0, 0.68333, 0, 0, 0.75],
    931: [0, 0.68333, 0, 0, 0.72222],
    933: [0, 0.68333, 0, 0, 0.77778],
    934: [0, 0.68333, 0, 0, 0.72222],
    936: [0, 0.68333, 0, 0, 0.77778],
    937: [0, 0.68333, 0, 0, 0.72222],
    8211: [0, 0.43056, 0.02778, 0, 0.5],
    8212: [0, 0.43056, 0.02778, 0, 1],
    8216: [0, 0.69444, 0, 0, 0.27778],
    8217: [0, 0.69444, 0, 0, 0.27778],
    8220: [0, 0.69444, 0, 0, 0.5],
    8221: [0, 0.69444, 0, 0, 0.5],
    8224: [0.19444, 0.69444, 0, 0, 0.44445],
    8225: [0.19444, 0.69444, 0, 0, 0.44445],
    8230: [0, 0.123, 0, 0, 1.172],
    8242: [0, 0.55556, 0, 0, 0.275],
    8407: [0, 0.71444, 0.15382, 0, 0.5],
    8463: [0, 0.68889, 0, 0, 0.54028],
    8465: [0, 0.69444, 0, 0, 0.72222],
    8467: [0, 0.69444, 0, 0.11111, 0.41667],
    8472: [0.19444, 0.43056, 0, 0.11111, 0.63646],
    8476: [0, 0.69444, 0, 0, 0.72222],
    8501: [0, 0.69444, 0, 0, 0.61111],
    8592: [-0.13313, 0.36687, 0, 0, 1],
    8593: [0.19444, 0.69444, 0, 0, 0.5],
    8594: [-0.13313, 0.36687, 0, 0, 1],
    8595: [0.19444, 0.69444, 0, 0, 0.5],
    8596: [-0.13313, 0.36687, 0, 0, 1],
    8597: [0.25, 0.75, 0, 0, 0.5],
    8598: [0.19444, 0.69444, 0, 0, 1],
    8599: [0.19444, 0.69444, 0, 0, 1],
    8600: [0.19444, 0.69444, 0, 0, 1],
    8601: [0.19444, 0.69444, 0, 0, 1],
    8614: [0.011, 0.511, 0, 0, 1],
    8617: [0.011, 0.511, 0, 0, 1.126],
    8618: [0.011, 0.511, 0, 0, 1.126],
    8636: [-0.13313, 0.36687, 0, 0, 1],
    8637: [-0.13313, 0.36687, 0, 0, 1],
    8640: [-0.13313, 0.36687, 0, 0, 1],
    8641: [-0.13313, 0.36687, 0, 0, 1],
    8652: [0.011, 0.671, 0, 0, 1],
    8656: [-0.13313, 0.36687, 0, 0, 1],
    8657: [0.19444, 0.69444, 0, 0, 0.61111],
    8658: [-0.13313, 0.36687, 0, 0, 1],
    8659: [0.19444, 0.69444, 0, 0, 0.61111],
    8660: [-0.13313, 0.36687, 0, 0, 1],
    8661: [0.25, 0.75, 0, 0, 0.61111],
    8704: [0, 0.69444, 0, 0, 0.55556],
    8706: [0, 0.69444, 0.05556, 0.08334, 0.5309],
    8707: [0, 0.69444, 0, 0, 0.55556],
    8709: [0.05556, 0.75, 0, 0, 0.5],
    8711: [0, 0.68333, 0, 0, 0.83334],
    8712: [0.0391, 0.5391, 0, 0, 0.66667],
    8715: [0.0391, 0.5391, 0, 0, 0.66667],
    8722: [0.08333, 0.58333, 0, 0, 0.77778],
    8723: [0.08333, 0.58333, 0, 0, 0.77778],
    8725: [0.25, 0.75, 0, 0, 0.5],
    8726: [0.25, 0.75, 0, 0, 0.5],
    8727: [-0.03472, 0.46528, 0, 0, 0.5],
    8728: [-0.05555, 0.44445, 0, 0, 0.5],
    8729: [-0.05555, 0.44445, 0, 0, 0.5],
    8730: [0.2, 0.8, 0, 0, 0.83334],
    8733: [0, 0.43056, 0, 0, 0.77778],
    8734: [0, 0.43056, 0, 0, 1],
    8736: [0, 0.69224, 0, 0, 0.72222],
    8739: [0.25, 0.75, 0, 0, 0.27778],
    8741: [0.25, 0.75, 0, 0, 0.5],
    8743: [0, 0.55556, 0, 0, 0.66667],
    8744: [0, 0.55556, 0, 0, 0.66667],
    8745: [0, 0.55556, 0, 0, 0.66667],
    8746: [0, 0.55556, 0, 0, 0.66667],
    8747: [0.19444, 0.69444, 0.11111, 0, 0.41667],
    8764: [-0.13313, 0.36687, 0, 0, 0.77778],
    8768: [0.19444, 0.69444, 0, 0, 0.27778],
    8771: [-0.03625, 0.46375, 0, 0, 0.77778],
    8773: [-0.022, 0.589, 0, 0, 0.778],
    8776: [-0.01688, 0.48312, 0, 0, 0.77778],
    8781: [-0.03625, 0.46375, 0, 0, 0.77778],
    8784: [-0.133, 0.673, 0, 0, 0.778],
    8801: [-0.03625, 0.46375, 0, 0, 0.77778],
    8804: [0.13597, 0.63597, 0, 0, 0.77778],
    8805: [0.13597, 0.63597, 0, 0, 0.77778],
    8810: [0.0391, 0.5391, 0, 0, 1],
    8811: [0.0391, 0.5391, 0, 0, 1],
    8826: [0.0391, 0.5391, 0, 0, 0.77778],
    8827: [0.0391, 0.5391, 0, 0, 0.77778],
    8834: [0.0391, 0.5391, 0, 0, 0.77778],
    8835: [0.0391, 0.5391, 0, 0, 0.77778],
    8838: [0.13597, 0.63597, 0, 0, 0.77778],
    8839: [0.13597, 0.63597, 0, 0, 0.77778],
    8846: [0, 0.55556, 0, 0, 0.66667],
    8849: [0.13597, 0.63597, 0, 0, 0.77778],
    8850: [0.13597, 0.63597, 0, 0, 0.77778],
    8851: [0, 0.55556, 0, 0, 0.66667],
    8852: [0, 0.55556, 0, 0, 0.66667],
    8853: [0.08333, 0.58333, 0, 0, 0.77778],
    8854: [0.08333, 0.58333, 0, 0, 0.77778],
    8855: [0.08333, 0.58333, 0, 0, 0.77778],
    8856: [0.08333, 0.58333, 0, 0, 0.77778],
    8857: [0.08333, 0.58333, 0, 0, 0.77778],
    8866: [0, 0.69444, 0, 0, 0.61111],
    8867: [0, 0.69444, 0, 0, 0.61111],
    8868: [0, 0.69444, 0, 0, 0.77778],
    8869: [0, 0.69444, 0, 0, 0.77778],
    8872: [0.249, 0.75, 0, 0, 0.867],
    8900: [-0.05555, 0.44445, 0, 0, 0.5],
    8901: [-0.05555, 0.44445, 0, 0, 0.27778],
    8902: [-0.03472, 0.46528, 0, 0, 0.5],
    8904: [5e-3, 0.505, 0, 0, 0.9],
    8942: [0.03, 0.903, 0, 0, 0.278],
    8943: [-0.19, 0.313, 0, 0, 1.172],
    8945: [-0.1, 0.823, 0, 0, 1.282],
    8968: [0.25, 0.75, 0, 0, 0.44445],
    8969: [0.25, 0.75, 0, 0, 0.44445],
    8970: [0.25, 0.75, 0, 0, 0.44445],
    8971: [0.25, 0.75, 0, 0, 0.44445],
    8994: [-0.14236, 0.35764, 0, 0, 1],
    8995: [-0.14236, 0.35764, 0, 0, 1],
    9136: [0.244, 0.744, 0, 0, 0.412],
    9137: [0.244, 0.745, 0, 0, 0.412],
    9651: [0.19444, 0.69444, 0, 0, 0.88889],
    9657: [-0.03472, 0.46528, 0, 0, 0.5],
    9661: [0.19444, 0.69444, 0, 0, 0.88889],
    9667: [-0.03472, 0.46528, 0, 0, 0.5],
    9711: [0.19444, 0.69444, 0, 0, 1],
    9824: [0.12963, 0.69444, 0, 0, 0.77778],
    9825: [0.12963, 0.69444, 0, 0, 0.77778],
    9826: [0.12963, 0.69444, 0, 0, 0.77778],
    9827: [0.12963, 0.69444, 0, 0, 0.77778],
    9837: [0, 0.75, 0, 0, 0.38889],
    9838: [0.19444, 0.69444, 0, 0, 0.38889],
    9839: [0.19444, 0.69444, 0, 0, 0.38889],
    10216: [0.25, 0.75, 0, 0, 0.38889],
    10217: [0.25, 0.75, 0, 0, 0.38889],
    10222: [0.244, 0.744, 0, 0, 0.412],
    10223: [0.244, 0.745, 0, 0, 0.412],
    10229: [0.011, 0.511, 0, 0, 1.609],
    10230: [0.011, 0.511, 0, 0, 1.638],
    10231: [0.011, 0.511, 0, 0, 1.859],
    10232: [0.024, 0.525, 0, 0, 1.609],
    10233: [0.024, 0.525, 0, 0, 1.638],
    10234: [0.024, 0.525, 0, 0, 1.858],
    10236: [0.011, 0.511, 0, 0, 1.638],
    10815: [0, 0.68333, 0, 0, 0.75],
    10927: [0.13597, 0.63597, 0, 0, 0.77778],
    10928: [0.13597, 0.63597, 0, 0, 0.77778],
    57376: [0.19444, 0.69444, 0, 0, 0]
  },
  "Math-BoldItalic": {
    32: [0, 0, 0, 0, 0.25],
    48: [0, 0.44444, 0, 0, 0.575],
    49: [0, 0.44444, 0, 0, 0.575],
    50: [0, 0.44444, 0, 0, 0.575],
    51: [0.19444, 0.44444, 0, 0, 0.575],
    52: [0.19444, 0.44444, 0, 0, 0.575],
    53: [0.19444, 0.44444, 0, 0, 0.575],
    54: [0, 0.64444, 0, 0, 0.575],
    55: [0.19444, 0.44444, 0, 0, 0.575],
    56: [0, 0.64444, 0, 0, 0.575],
    57: [0.19444, 0.44444, 0, 0, 0.575],
    65: [0, 0.68611, 0, 0, 0.86944],
    66: [0, 0.68611, 0.04835, 0, 0.8664],
    67: [0, 0.68611, 0.06979, 0, 0.81694],
    68: [0, 0.68611, 0.03194, 0, 0.93812],
    69: [0, 0.68611, 0.05451, 0, 0.81007],
    70: [0, 0.68611, 0.15972, 0, 0.68889],
    71: [0, 0.68611, 0, 0, 0.88673],
    72: [0, 0.68611, 0.08229, 0, 0.98229],
    73: [0, 0.68611, 0.07778, 0, 0.51111],
    74: [0, 0.68611, 0.10069, 0, 0.63125],
    75: [0, 0.68611, 0.06979, 0, 0.97118],
    76: [0, 0.68611, 0, 0, 0.75555],
    77: [0, 0.68611, 0.11424, 0, 1.14201],
    78: [0, 0.68611, 0.11424, 0, 0.95034],
    79: [0, 0.68611, 0.03194, 0, 0.83666],
    80: [0, 0.68611, 0.15972, 0, 0.72309],
    81: [0.19444, 0.68611, 0, 0, 0.86861],
    82: [0, 0.68611, 421e-5, 0, 0.87235],
    83: [0, 0.68611, 0.05382, 0, 0.69271],
    84: [0, 0.68611, 0.15972, 0, 0.63663],
    85: [0, 0.68611, 0.11424, 0, 0.80027],
    86: [0, 0.68611, 0.25555, 0, 0.67778],
    87: [0, 0.68611, 0.15972, 0, 1.09305],
    88: [0, 0.68611, 0.07778, 0, 0.94722],
    89: [0, 0.68611, 0.25555, 0, 0.67458],
    90: [0, 0.68611, 0.06979, 0, 0.77257],
    97: [0, 0.44444, 0, 0, 0.63287],
    98: [0, 0.69444, 0, 0, 0.52083],
    99: [0, 0.44444, 0, 0, 0.51342],
    100: [0, 0.69444, 0, 0, 0.60972],
    101: [0, 0.44444, 0, 0, 0.55361],
    102: [0.19444, 0.69444, 0.11042, 0, 0.56806],
    103: [0.19444, 0.44444, 0.03704, 0, 0.5449],
    104: [0, 0.69444, 0, 0, 0.66759],
    105: [0, 0.69326, 0, 0, 0.4048],
    106: [0.19444, 0.69326, 0.0622, 0, 0.47083],
    107: [0, 0.69444, 0.01852, 0, 0.6037],
    108: [0, 0.69444, 88e-4, 0, 0.34815],
    109: [0, 0.44444, 0, 0, 1.0324],
    110: [0, 0.44444, 0, 0, 0.71296],
    111: [0, 0.44444, 0, 0, 0.58472],
    112: [0.19444, 0.44444, 0, 0, 0.60092],
    113: [0.19444, 0.44444, 0.03704, 0, 0.54213],
    114: [0, 0.44444, 0.03194, 0, 0.5287],
    115: [0, 0.44444, 0, 0, 0.53125],
    116: [0, 0.63492, 0, 0, 0.41528],
    117: [0, 0.44444, 0, 0, 0.68102],
    118: [0, 0.44444, 0.03704, 0, 0.56666],
    119: [0, 0.44444, 0.02778, 0, 0.83148],
    120: [0, 0.44444, 0, 0, 0.65903],
    121: [0.19444, 0.44444, 0.03704, 0, 0.59028],
    122: [0, 0.44444, 0.04213, 0, 0.55509],
    160: [0, 0, 0, 0, 0.25],
    915: [0, 0.68611, 0.15972, 0, 0.65694],
    916: [0, 0.68611, 0, 0, 0.95833],
    920: [0, 0.68611, 0.03194, 0, 0.86722],
    923: [0, 0.68611, 0, 0, 0.80555],
    926: [0, 0.68611, 0.07458, 0, 0.84125],
    928: [0, 0.68611, 0.08229, 0, 0.98229],
    931: [0, 0.68611, 0.05451, 0, 0.88507],
    933: [0, 0.68611, 0.15972, 0, 0.67083],
    934: [0, 0.68611, 0, 0, 0.76666],
    936: [0, 0.68611, 0.11653, 0, 0.71402],
    937: [0, 0.68611, 0.04835, 0, 0.8789],
    945: [0, 0.44444, 0, 0, 0.76064],
    946: [0.19444, 0.69444, 0.03403, 0, 0.65972],
    947: [0.19444, 0.44444, 0.06389, 0, 0.59003],
    948: [0, 0.69444, 0.03819, 0, 0.52222],
    949: [0, 0.44444, 0, 0, 0.52882],
    950: [0.19444, 0.69444, 0.06215, 0, 0.50833],
    951: [0.19444, 0.44444, 0.03704, 0, 0.6],
    952: [0, 0.69444, 0.03194, 0, 0.5618],
    953: [0, 0.44444, 0, 0, 0.41204],
    954: [0, 0.44444, 0, 0, 0.66759],
    955: [0, 0.69444, 0, 0, 0.67083],
    956: [0.19444, 0.44444, 0, 0, 0.70787],
    957: [0, 0.44444, 0.06898, 0, 0.57685],
    958: [0.19444, 0.69444, 0.03021, 0, 0.50833],
    959: [0, 0.44444, 0, 0, 0.58472],
    960: [0, 0.44444, 0.03704, 0, 0.68241],
    961: [0.19444, 0.44444, 0, 0, 0.6118],
    962: [0.09722, 0.44444, 0.07917, 0, 0.42361],
    963: [0, 0.44444, 0.03704, 0, 0.68588],
    964: [0, 0.44444, 0.13472, 0, 0.52083],
    965: [0, 0.44444, 0.03704, 0, 0.63055],
    966: [0.19444, 0.44444, 0, 0, 0.74722],
    967: [0.19444, 0.44444, 0, 0, 0.71805],
    968: [0.19444, 0.69444, 0.03704, 0, 0.75833],
    969: [0, 0.44444, 0.03704, 0, 0.71782],
    977: [0, 0.69444, 0, 0, 0.69155],
    981: [0.19444, 0.69444, 0, 0, 0.7125],
    982: [0, 0.44444, 0.03194, 0, 0.975],
    1009: [0.19444, 0.44444, 0, 0, 0.6118],
    1013: [0, 0.44444, 0, 0, 0.48333],
    57649: [0, 0.44444, 0, 0, 0.39352],
    57911: [0.19444, 0.44444, 0, 0, 0.43889]
  },
  "Math-Italic": {
    32: [0, 0, 0, 0, 0.25],
    48: [0, 0.43056, 0, 0, 0.5],
    49: [0, 0.43056, 0, 0, 0.5],
    50: [0, 0.43056, 0, 0, 0.5],
    51: [0.19444, 0.43056, 0, 0, 0.5],
    52: [0.19444, 0.43056, 0, 0, 0.5],
    53: [0.19444, 0.43056, 0, 0, 0.5],
    54: [0, 0.64444, 0, 0, 0.5],
    55: [0.19444, 0.43056, 0, 0, 0.5],
    56: [0, 0.64444, 0, 0, 0.5],
    57: [0.19444, 0.43056, 0, 0, 0.5],
    65: [0, 0.68333, 0, 0.13889, 0.75],
    66: [0, 0.68333, 0.05017, 0.08334, 0.75851],
    67: [0, 0.68333, 0.07153, 0.08334, 0.71472],
    68: [0, 0.68333, 0.02778, 0.05556, 0.82792],
    69: [0, 0.68333, 0.05764, 0.08334, 0.7382],
    70: [0, 0.68333, 0.13889, 0.08334, 0.64306],
    71: [0, 0.68333, 0, 0.08334, 0.78625],
    72: [0, 0.68333, 0.08125, 0.05556, 0.83125],
    73: [0, 0.68333, 0.07847, 0.11111, 0.43958],
    74: [0, 0.68333, 0.09618, 0.16667, 0.55451],
    75: [0, 0.68333, 0.07153, 0.05556, 0.84931],
    76: [0, 0.68333, 0, 0.02778, 0.68056],
    77: [0, 0.68333, 0.10903, 0.08334, 0.97014],
    78: [0, 0.68333, 0.10903, 0.08334, 0.80347],
    79: [0, 0.68333, 0.02778, 0.08334, 0.76278],
    80: [0, 0.68333, 0.13889, 0.08334, 0.64201],
    81: [0.19444, 0.68333, 0, 0.08334, 0.79056],
    82: [0, 0.68333, 773e-5, 0.08334, 0.75929],
    83: [0, 0.68333, 0.05764, 0.08334, 0.6132],
    84: [0, 0.68333, 0.13889, 0.08334, 0.58438],
    85: [0, 0.68333, 0.10903, 0.02778, 0.68278],
    86: [0, 0.68333, 0.22222, 0, 0.58333],
    87: [0, 0.68333, 0.13889, 0, 0.94445],
    88: [0, 0.68333, 0.07847, 0.08334, 0.82847],
    89: [0, 0.68333, 0.22222, 0, 0.58056],
    90: [0, 0.68333, 0.07153, 0.08334, 0.68264],
    97: [0, 0.43056, 0, 0, 0.52859],
    98: [0, 0.69444, 0, 0, 0.42917],
    99: [0, 0.43056, 0, 0.05556, 0.43276],
    100: [0, 0.69444, 0, 0.16667, 0.52049],
    101: [0, 0.43056, 0, 0.05556, 0.46563],
    102: [0.19444, 0.69444, 0.10764, 0.16667, 0.48959],
    103: [0.19444, 0.43056, 0.03588, 0.02778, 0.47697],
    104: [0, 0.69444, 0, 0, 0.57616],
    105: [0, 0.65952, 0, 0, 0.34451],
    106: [0.19444, 0.65952, 0.05724, 0, 0.41181],
    107: [0, 0.69444, 0.03148, 0, 0.5206],
    108: [0, 0.69444, 0.01968, 0.08334, 0.29838],
    109: [0, 0.43056, 0, 0, 0.87801],
    110: [0, 0.43056, 0, 0, 0.60023],
    111: [0, 0.43056, 0, 0.05556, 0.48472],
    112: [0.19444, 0.43056, 0, 0.08334, 0.50313],
    113: [0.19444, 0.43056, 0.03588, 0.08334, 0.44641],
    114: [0, 0.43056, 0.02778, 0.05556, 0.45116],
    115: [0, 0.43056, 0, 0.05556, 0.46875],
    116: [0, 0.61508, 0, 0.08334, 0.36111],
    117: [0, 0.43056, 0, 0.02778, 0.57246],
    118: [0, 0.43056, 0.03588, 0.02778, 0.48472],
    119: [0, 0.43056, 0.02691, 0.08334, 0.71592],
    120: [0, 0.43056, 0, 0.02778, 0.57153],
    121: [0.19444, 0.43056, 0.03588, 0.05556, 0.49028],
    122: [0, 0.43056, 0.04398, 0.05556, 0.46505],
    160: [0, 0, 0, 0, 0.25],
    915: [0, 0.68333, 0.13889, 0.08334, 0.61528],
    916: [0, 0.68333, 0, 0.16667, 0.83334],
    920: [0, 0.68333, 0.02778, 0.08334, 0.76278],
    923: [0, 0.68333, 0, 0.16667, 0.69445],
    926: [0, 0.68333, 0.07569, 0.08334, 0.74236],
    928: [0, 0.68333, 0.08125, 0.05556, 0.83125],
    931: [0, 0.68333, 0.05764, 0.08334, 0.77986],
    933: [0, 0.68333, 0.13889, 0.05556, 0.58333],
    934: [0, 0.68333, 0, 0.08334, 0.66667],
    936: [0, 0.68333, 0.11, 0.05556, 0.61222],
    937: [0, 0.68333, 0.05017, 0.08334, 0.7724],
    945: [0, 0.43056, 37e-4, 0.02778, 0.6397],
    946: [0.19444, 0.69444, 0.05278, 0.08334, 0.56563],
    947: [0.19444, 0.43056, 0.05556, 0, 0.51773],
    948: [0, 0.69444, 0.03785, 0.05556, 0.44444],
    949: [0, 0.43056, 0, 0.08334, 0.46632],
    950: [0.19444, 0.69444, 0.07378, 0.08334, 0.4375],
    951: [0.19444, 0.43056, 0.03588, 0.05556, 0.49653],
    952: [0, 0.69444, 0.02778, 0.08334, 0.46944],
    953: [0, 0.43056, 0, 0.05556, 0.35394],
    954: [0, 0.43056, 0, 0, 0.57616],
    955: [0, 0.69444, 0, 0, 0.58334],
    956: [0.19444, 0.43056, 0, 0.02778, 0.60255],
    957: [0, 0.43056, 0.06366, 0.02778, 0.49398],
    958: [0.19444, 0.69444, 0.04601, 0.11111, 0.4375],
    959: [0, 0.43056, 0, 0.05556, 0.48472],
    960: [0, 0.43056, 0.03588, 0, 0.57003],
    961: [0.19444, 0.43056, 0, 0.08334, 0.51702],
    962: [0.09722, 0.43056, 0.07986, 0.08334, 0.36285],
    963: [0, 0.43056, 0.03588, 0, 0.57141],
    964: [0, 0.43056, 0.1132, 0.02778, 0.43715],
    965: [0, 0.43056, 0.03588, 0.02778, 0.54028],
    966: [0.19444, 0.43056, 0, 0.08334, 0.65417],
    967: [0.19444, 0.43056, 0, 0.05556, 0.62569],
    968: [0.19444, 0.69444, 0.03588, 0.11111, 0.65139],
    969: [0, 0.43056, 0.03588, 0, 0.62245],
    977: [0, 0.69444, 0, 0.08334, 0.59144],
    981: [0.19444, 0.69444, 0, 0.08334, 0.59583],
    982: [0, 0.43056, 0.02778, 0, 0.82813],
    1009: [0.19444, 0.43056, 0, 0.08334, 0.51702],
    1013: [0, 0.43056, 0, 0.05556, 0.4059],
    57649: [0, 0.43056, 0, 0.02778, 0.32246],
    57911: [0.19444, 0.43056, 0, 0.08334, 0.38403]
  },
  "SansSerif-Bold": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.36667],
    34: [0, 0.69444, 0, 0, 0.55834],
    35: [0.19444, 0.69444, 0, 0, 0.91667],
    36: [0.05556, 0.75, 0, 0, 0.55],
    37: [0.05556, 0.75, 0, 0, 1.02912],
    38: [0, 0.69444, 0, 0, 0.83056],
    39: [0, 0.69444, 0, 0, 0.30556],
    40: [0.25, 0.75, 0, 0, 0.42778],
    41: [0.25, 0.75, 0, 0, 0.42778],
    42: [0, 0.75, 0, 0, 0.55],
    43: [0.11667, 0.61667, 0, 0, 0.85556],
    44: [0.10556, 0.13056, 0, 0, 0.30556],
    45: [0, 0.45833, 0, 0, 0.36667],
    46: [0, 0.13056, 0, 0, 0.30556],
    47: [0.25, 0.75, 0, 0, 0.55],
    48: [0, 0.69444, 0, 0, 0.55],
    49: [0, 0.69444, 0, 0, 0.55],
    50: [0, 0.69444, 0, 0, 0.55],
    51: [0, 0.69444, 0, 0, 0.55],
    52: [0, 0.69444, 0, 0, 0.55],
    53: [0, 0.69444, 0, 0, 0.55],
    54: [0, 0.69444, 0, 0, 0.55],
    55: [0, 0.69444, 0, 0, 0.55],
    56: [0, 0.69444, 0, 0, 0.55],
    57: [0, 0.69444, 0, 0, 0.55],
    58: [0, 0.45833, 0, 0, 0.30556],
    59: [0.10556, 0.45833, 0, 0, 0.30556],
    61: [-0.09375, 0.40625, 0, 0, 0.85556],
    63: [0, 0.69444, 0, 0, 0.51945],
    64: [0, 0.69444, 0, 0, 0.73334],
    65: [0, 0.69444, 0, 0, 0.73334],
    66: [0, 0.69444, 0, 0, 0.73334],
    67: [0, 0.69444, 0, 0, 0.70278],
    68: [0, 0.69444, 0, 0, 0.79445],
    69: [0, 0.69444, 0, 0, 0.64167],
    70: [0, 0.69444, 0, 0, 0.61111],
    71: [0, 0.69444, 0, 0, 0.73334],
    72: [0, 0.69444, 0, 0, 0.79445],
    73: [0, 0.69444, 0, 0, 0.33056],
    74: [0, 0.69444, 0, 0, 0.51945],
    75: [0, 0.69444, 0, 0, 0.76389],
    76: [0, 0.69444, 0, 0, 0.58056],
    77: [0, 0.69444, 0, 0, 0.97778],
    78: [0, 0.69444, 0, 0, 0.79445],
    79: [0, 0.69444, 0, 0, 0.79445],
    80: [0, 0.69444, 0, 0, 0.70278],
    81: [0.10556, 0.69444, 0, 0, 0.79445],
    82: [0, 0.69444, 0, 0, 0.70278],
    83: [0, 0.69444, 0, 0, 0.61111],
    84: [0, 0.69444, 0, 0, 0.73334],
    85: [0, 0.69444, 0, 0, 0.76389],
    86: [0, 0.69444, 0.01528, 0, 0.73334],
    87: [0, 0.69444, 0.01528, 0, 1.03889],
    88: [0, 0.69444, 0, 0, 0.73334],
    89: [0, 0.69444, 0.0275, 0, 0.73334],
    90: [0, 0.69444, 0, 0, 0.67223],
    91: [0.25, 0.75, 0, 0, 0.34306],
    93: [0.25, 0.75, 0, 0, 0.34306],
    94: [0, 0.69444, 0, 0, 0.55],
    95: [0.35, 0.10833, 0.03056, 0, 0.55],
    97: [0, 0.45833, 0, 0, 0.525],
    98: [0, 0.69444, 0, 0, 0.56111],
    99: [0, 0.45833, 0, 0, 0.48889],
    100: [0, 0.69444, 0, 0, 0.56111],
    101: [0, 0.45833, 0, 0, 0.51111],
    102: [0, 0.69444, 0.07639, 0, 0.33611],
    103: [0.19444, 0.45833, 0.01528, 0, 0.55],
    104: [0, 0.69444, 0, 0, 0.56111],
    105: [0, 0.69444, 0, 0, 0.25556],
    106: [0.19444, 0.69444, 0, 0, 0.28611],
    107: [0, 0.69444, 0, 0, 0.53056],
    108: [0, 0.69444, 0, 0, 0.25556],
    109: [0, 0.45833, 0, 0, 0.86667],
    110: [0, 0.45833, 0, 0, 0.56111],
    111: [0, 0.45833, 0, 0, 0.55],
    112: [0.19444, 0.45833, 0, 0, 0.56111],
    113: [0.19444, 0.45833, 0, 0, 0.56111],
    114: [0, 0.45833, 0.01528, 0, 0.37222],
    115: [0, 0.45833, 0, 0, 0.42167],
    116: [0, 0.58929, 0, 0, 0.40417],
    117: [0, 0.45833, 0, 0, 0.56111],
    118: [0, 0.45833, 0.01528, 0, 0.5],
    119: [0, 0.45833, 0.01528, 0, 0.74445],
    120: [0, 0.45833, 0, 0, 0.5],
    121: [0.19444, 0.45833, 0.01528, 0, 0.5],
    122: [0, 0.45833, 0, 0, 0.47639],
    126: [0.35, 0.34444, 0, 0, 0.55],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.69444, 0, 0, 0.55],
    176: [0, 0.69444, 0, 0, 0.73334],
    180: [0, 0.69444, 0, 0, 0.55],
    184: [0.17014, 0, 0, 0, 0.48889],
    305: [0, 0.45833, 0, 0, 0.25556],
    567: [0.19444, 0.45833, 0, 0, 0.28611],
    710: [0, 0.69444, 0, 0, 0.55],
    711: [0, 0.63542, 0, 0, 0.55],
    713: [0, 0.63778, 0, 0, 0.55],
    728: [0, 0.69444, 0, 0, 0.55],
    729: [0, 0.69444, 0, 0, 0.30556],
    730: [0, 0.69444, 0, 0, 0.73334],
    732: [0, 0.69444, 0, 0, 0.55],
    733: [0, 0.69444, 0, 0, 0.55],
    915: [0, 0.69444, 0, 0, 0.58056],
    916: [0, 0.69444, 0, 0, 0.91667],
    920: [0, 0.69444, 0, 0, 0.85556],
    923: [0, 0.69444, 0, 0, 0.67223],
    926: [0, 0.69444, 0, 0, 0.73334],
    928: [0, 0.69444, 0, 0, 0.79445],
    931: [0, 0.69444, 0, 0, 0.79445],
    933: [0, 0.69444, 0, 0, 0.85556],
    934: [0, 0.69444, 0, 0, 0.79445],
    936: [0, 0.69444, 0, 0, 0.85556],
    937: [0, 0.69444, 0, 0, 0.79445],
    8211: [0, 0.45833, 0.03056, 0, 0.55],
    8212: [0, 0.45833, 0.03056, 0, 1.10001],
    8216: [0, 0.69444, 0, 0, 0.30556],
    8217: [0, 0.69444, 0, 0, 0.30556],
    8220: [0, 0.69444, 0, 0, 0.55834],
    8221: [0, 0.69444, 0, 0, 0.55834]
  },
  "SansSerif-Italic": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0.05733, 0, 0.31945],
    34: [0, 0.69444, 316e-5, 0, 0.5],
    35: [0.19444, 0.69444, 0.05087, 0, 0.83334],
    36: [0.05556, 0.75, 0.11156, 0, 0.5],
    37: [0.05556, 0.75, 0.03126, 0, 0.83334],
    38: [0, 0.69444, 0.03058, 0, 0.75834],
    39: [0, 0.69444, 0.07816, 0, 0.27778],
    40: [0.25, 0.75, 0.13164, 0, 0.38889],
    41: [0.25, 0.75, 0.02536, 0, 0.38889],
    42: [0, 0.75, 0.11775, 0, 0.5],
    43: [0.08333, 0.58333, 0.02536, 0, 0.77778],
    44: [0.125, 0.08333, 0, 0, 0.27778],
    45: [0, 0.44444, 0.01946, 0, 0.33333],
    46: [0, 0.08333, 0, 0, 0.27778],
    47: [0.25, 0.75, 0.13164, 0, 0.5],
    48: [0, 0.65556, 0.11156, 0, 0.5],
    49: [0, 0.65556, 0.11156, 0, 0.5],
    50: [0, 0.65556, 0.11156, 0, 0.5],
    51: [0, 0.65556, 0.11156, 0, 0.5],
    52: [0, 0.65556, 0.11156, 0, 0.5],
    53: [0, 0.65556, 0.11156, 0, 0.5],
    54: [0, 0.65556, 0.11156, 0, 0.5],
    55: [0, 0.65556, 0.11156, 0, 0.5],
    56: [0, 0.65556, 0.11156, 0, 0.5],
    57: [0, 0.65556, 0.11156, 0, 0.5],
    58: [0, 0.44444, 0.02502, 0, 0.27778],
    59: [0.125, 0.44444, 0.02502, 0, 0.27778],
    61: [-0.13, 0.37, 0.05087, 0, 0.77778],
    63: [0, 0.69444, 0.11809, 0, 0.47222],
    64: [0, 0.69444, 0.07555, 0, 0.66667],
    65: [0, 0.69444, 0, 0, 0.66667],
    66: [0, 0.69444, 0.08293, 0, 0.66667],
    67: [0, 0.69444, 0.11983, 0, 0.63889],
    68: [0, 0.69444, 0.07555, 0, 0.72223],
    69: [0, 0.69444, 0.11983, 0, 0.59722],
    70: [0, 0.69444, 0.13372, 0, 0.56945],
    71: [0, 0.69444, 0.11983, 0, 0.66667],
    72: [0, 0.69444, 0.08094, 0, 0.70834],
    73: [0, 0.69444, 0.13372, 0, 0.27778],
    74: [0, 0.69444, 0.08094, 0, 0.47222],
    75: [0, 0.69444, 0.11983, 0, 0.69445],
    76: [0, 0.69444, 0, 0, 0.54167],
    77: [0, 0.69444, 0.08094, 0, 0.875],
    78: [0, 0.69444, 0.08094, 0, 0.70834],
    79: [0, 0.69444, 0.07555, 0, 0.73611],
    80: [0, 0.69444, 0.08293, 0, 0.63889],
    81: [0.125, 0.69444, 0.07555, 0, 0.73611],
    82: [0, 0.69444, 0.08293, 0, 0.64584],
    83: [0, 0.69444, 0.09205, 0, 0.55556],
    84: [0, 0.69444, 0.13372, 0, 0.68056],
    85: [0, 0.69444, 0.08094, 0, 0.6875],
    86: [0, 0.69444, 0.1615, 0, 0.66667],
    87: [0, 0.69444, 0.1615, 0, 0.94445],
    88: [0, 0.69444, 0.13372, 0, 0.66667],
    89: [0, 0.69444, 0.17261, 0, 0.66667],
    90: [0, 0.69444, 0.11983, 0, 0.61111],
    91: [0.25, 0.75, 0.15942, 0, 0.28889],
    93: [0.25, 0.75, 0.08719, 0, 0.28889],
    94: [0, 0.69444, 0.0799, 0, 0.5],
    95: [0.35, 0.09444, 0.08616, 0, 0.5],
    97: [0, 0.44444, 981e-5, 0, 0.48056],
    98: [0, 0.69444, 0.03057, 0, 0.51667],
    99: [0, 0.44444, 0.08336, 0, 0.44445],
    100: [0, 0.69444, 0.09483, 0, 0.51667],
    101: [0, 0.44444, 0.06778, 0, 0.44445],
    102: [0, 0.69444, 0.21705, 0, 0.30556],
    103: [0.19444, 0.44444, 0.10836, 0, 0.5],
    104: [0, 0.69444, 0.01778, 0, 0.51667],
    105: [0, 0.67937, 0.09718, 0, 0.23889],
    106: [0.19444, 0.67937, 0.09162, 0, 0.26667],
    107: [0, 0.69444, 0.08336, 0, 0.48889],
    108: [0, 0.69444, 0.09483, 0, 0.23889],
    109: [0, 0.44444, 0.01778, 0, 0.79445],
    110: [0, 0.44444, 0.01778, 0, 0.51667],
    111: [0, 0.44444, 0.06613, 0, 0.5],
    112: [0.19444, 0.44444, 0.0389, 0, 0.51667],
    113: [0.19444, 0.44444, 0.04169, 0, 0.51667],
    114: [0, 0.44444, 0.10836, 0, 0.34167],
    115: [0, 0.44444, 0.0778, 0, 0.38333],
    116: [0, 0.57143, 0.07225, 0, 0.36111],
    117: [0, 0.44444, 0.04169, 0, 0.51667],
    118: [0, 0.44444, 0.10836, 0, 0.46111],
    119: [0, 0.44444, 0.10836, 0, 0.68334],
    120: [0, 0.44444, 0.09169, 0, 0.46111],
    121: [0.19444, 0.44444, 0.10836, 0, 0.46111],
    122: [0, 0.44444, 0.08752, 0, 0.43472],
    126: [0.35, 0.32659, 0.08826, 0, 0.5],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.67937, 0.06385, 0, 0.5],
    176: [0, 0.69444, 0, 0, 0.73752],
    184: [0.17014, 0, 0, 0, 0.44445],
    305: [0, 0.44444, 0.04169, 0, 0.23889],
    567: [0.19444, 0.44444, 0.04169, 0, 0.26667],
    710: [0, 0.69444, 0.0799, 0, 0.5],
    711: [0, 0.63194, 0.08432, 0, 0.5],
    713: [0, 0.60889, 0.08776, 0, 0.5],
    714: [0, 0.69444, 0.09205, 0, 0.5],
    715: [0, 0.69444, 0, 0, 0.5],
    728: [0, 0.69444, 0.09483, 0, 0.5],
    729: [0, 0.67937, 0.07774, 0, 0.27778],
    730: [0, 0.69444, 0, 0, 0.73752],
    732: [0, 0.67659, 0.08826, 0, 0.5],
    733: [0, 0.69444, 0.09205, 0, 0.5],
    915: [0, 0.69444, 0.13372, 0, 0.54167],
    916: [0, 0.69444, 0, 0, 0.83334],
    920: [0, 0.69444, 0.07555, 0, 0.77778],
    923: [0, 0.69444, 0, 0, 0.61111],
    926: [0, 0.69444, 0.12816, 0, 0.66667],
    928: [0, 0.69444, 0.08094, 0, 0.70834],
    931: [0, 0.69444, 0.11983, 0, 0.72222],
    933: [0, 0.69444, 0.09031, 0, 0.77778],
    934: [0, 0.69444, 0.04603, 0, 0.72222],
    936: [0, 0.69444, 0.09031, 0, 0.77778],
    937: [0, 0.69444, 0.08293, 0, 0.72222],
    8211: [0, 0.44444, 0.08616, 0, 0.5],
    8212: [0, 0.44444, 0.08616, 0, 1],
    8216: [0, 0.69444, 0.07816, 0, 0.27778],
    8217: [0, 0.69444, 0.07816, 0, 0.27778],
    8220: [0, 0.69444, 0.14205, 0, 0.5],
    8221: [0, 0.69444, 316e-5, 0, 0.5]
  },
  "SansSerif-Regular": {
    32: [0, 0, 0, 0, 0.25],
    33: [0, 0.69444, 0, 0, 0.31945],
    34: [0, 0.69444, 0, 0, 0.5],
    35: [0.19444, 0.69444, 0, 0, 0.83334],
    36: [0.05556, 0.75, 0, 0, 0.5],
    37: [0.05556, 0.75, 0, 0, 0.83334],
    38: [0, 0.69444, 0, 0, 0.75834],
    39: [0, 0.69444, 0, 0, 0.27778],
    40: [0.25, 0.75, 0, 0, 0.38889],
    41: [0.25, 0.75, 0, 0, 0.38889],
    42: [0, 0.75, 0, 0, 0.5],
    43: [0.08333, 0.58333, 0, 0, 0.77778],
    44: [0.125, 0.08333, 0, 0, 0.27778],
    45: [0, 0.44444, 0, 0, 0.33333],
    46: [0, 0.08333, 0, 0, 0.27778],
    47: [0.25, 0.75, 0, 0, 0.5],
    48: [0, 0.65556, 0, 0, 0.5],
    49: [0, 0.65556, 0, 0, 0.5],
    50: [0, 0.65556, 0, 0, 0.5],
    51: [0, 0.65556, 0, 0, 0.5],
    52: [0, 0.65556, 0, 0, 0.5],
    53: [0, 0.65556, 0, 0, 0.5],
    54: [0, 0.65556, 0, 0, 0.5],
    55: [0, 0.65556, 0, 0, 0.5],
    56: [0, 0.65556, 0, 0, 0.5],
    57: [0, 0.65556, 0, 0, 0.5],
    58: [0, 0.44444, 0, 0, 0.27778],
    59: [0.125, 0.44444, 0, 0, 0.27778],
    61: [-0.13, 0.37, 0, 0, 0.77778],
    63: [0, 0.69444, 0, 0, 0.47222],
    64: [0, 0.69444, 0, 0, 0.66667],
    65: [0, 0.69444, 0, 0, 0.66667],
    66: [0, 0.69444, 0, 0, 0.66667],
    67: [0, 0.69444, 0, 0, 0.63889],
    68: [0, 0.69444, 0, 0, 0.72223],
    69: [0, 0.69444, 0, 0, 0.59722],
    70: [0, 0.69444, 0, 0, 0.56945],
    71: [0, 0.69444, 0, 0, 0.66667],
    72: [0, 0.69444, 0, 0, 0.70834],
    73: [0, 0.69444, 0, 0, 0.27778],
    74: [0, 0.69444, 0, 0, 0.47222],
    75: [0, 0.69444, 0, 0, 0.69445],
    76: [0, 0.69444, 0, 0, 0.54167],
    77: [0, 0.69444, 0, 0, 0.875],
    78: [0, 0.69444, 0, 0, 0.70834],
    79: [0, 0.69444, 0, 0, 0.73611],
    80: [0, 0.69444, 0, 0, 0.63889],
    81: [0.125, 0.69444, 0, 0, 0.73611],
    82: [0, 0.69444, 0, 0, 0.64584],
    83: [0, 0.69444, 0, 0, 0.55556],
    84: [0, 0.69444, 0, 0, 0.68056],
    85: [0, 0.69444, 0, 0, 0.6875],
    86: [0, 0.69444, 0.01389, 0, 0.66667],
    87: [0, 0.69444, 0.01389, 0, 0.94445],
    88: [0, 0.69444, 0, 0, 0.66667],
    89: [0, 0.69444, 0.025, 0, 0.66667],
    90: [0, 0.69444, 0, 0, 0.61111],
    91: [0.25, 0.75, 0, 0, 0.28889],
    93: [0.25, 0.75, 0, 0, 0.28889],
    94: [0, 0.69444, 0, 0, 0.5],
    95: [0.35, 0.09444, 0.02778, 0, 0.5],
    97: [0, 0.44444, 0, 0, 0.48056],
    98: [0, 0.69444, 0, 0, 0.51667],
    99: [0, 0.44444, 0, 0, 0.44445],
    100: [0, 0.69444, 0, 0, 0.51667],
    101: [0, 0.44444, 0, 0, 0.44445],
    102: [0, 0.69444, 0.06944, 0, 0.30556],
    103: [0.19444, 0.44444, 0.01389, 0, 0.5],
    104: [0, 0.69444, 0, 0, 0.51667],
    105: [0, 0.67937, 0, 0, 0.23889],
    106: [0.19444, 0.67937, 0, 0, 0.26667],
    107: [0, 0.69444, 0, 0, 0.48889],
    108: [0, 0.69444, 0, 0, 0.23889],
    109: [0, 0.44444, 0, 0, 0.79445],
    110: [0, 0.44444, 0, 0, 0.51667],
    111: [0, 0.44444, 0, 0, 0.5],
    112: [0.19444, 0.44444, 0, 0, 0.51667],
    113: [0.19444, 0.44444, 0, 0, 0.51667],
    114: [0, 0.44444, 0.01389, 0, 0.34167],
    115: [0, 0.44444, 0, 0, 0.38333],
    116: [0, 0.57143, 0, 0, 0.36111],
    117: [0, 0.44444, 0, 0, 0.51667],
    118: [0, 0.44444, 0.01389, 0, 0.46111],
    119: [0, 0.44444, 0.01389, 0, 0.68334],
    120: [0, 0.44444, 0, 0, 0.46111],
    121: [0.19444, 0.44444, 0.01389, 0, 0.46111],
    122: [0, 0.44444, 0, 0, 0.43472],
    126: [0.35, 0.32659, 0, 0, 0.5],
    160: [0, 0, 0, 0, 0.25],
    168: [0, 0.67937, 0, 0, 0.5],
    176: [0, 0.69444, 0, 0, 0.66667],
    184: [0.17014, 0, 0, 0, 0.44445],
    305: [0, 0.44444, 0, 0, 0.23889],
    567: [0.19444, 0.44444, 0, 0, 0.26667],
    710: [0, 0.69444, 0, 0, 0.5],
    711: [0, 0.63194, 0, 0, 0.5],
    713: [0, 0.60889, 0, 0, 0.5],
    714: [0, 0.69444, 0, 0, 0.5],
    715: [0, 0.69444, 0, 0, 0.5],
    728: [0, 0.69444, 0, 0, 0.5],
    729: [0, 0.67937, 0, 0, 0.27778],
    730: [0, 0.69444, 0, 0, 0.66667],
    732: [0, 0.67659, 0, 0, 0.5],
    733: [0, 0.69444, 0, 0, 0.5],
    915: [0, 0.69444, 0, 0, 0.54167],
    916: [0, 0.69444, 0, 0, 0.83334],
    920: [0, 0.69444, 0, 0, 0.77778],
    923: [0, 0.69444, 0, 0, 0.61111],
    926: [0, 0.69444, 0, 0, 0.66667],
    928: [0, 0.69444, 0, 0, 0.70834],
    931: [0, 0.69444, 0, 0, 0.72222],
    933: [0, 0.69444, 0, 0, 0.77778],
    934: [0, 0.69444, 0, 0, 0.72222],
    936: [0, 0.69444, 0, 0, 0.77778],
    937: [0, 0.69444, 0, 0, 0.72222],
    8211: [0, 0.44444, 0.02778, 0, 0.5],
    8212: [0, 0.44444, 0.02778, 0, 1],
    8216: [0, 0.69444, 0, 0, 0.27778],
    8217: [0, 0.69444, 0, 0, 0.27778],
    8220: [0, 0.69444, 0, 0, 0.5],
    8221: [0, 0.69444, 0, 0, 0.5]
  },
  "Script-Regular": {
    32: [0, 0, 0, 0, 0.25],
    65: [0, 0.7, 0.22925, 0, 0.80253],
    66: [0, 0.7, 0.04087, 0, 0.90757],
    67: [0, 0.7, 0.1689, 0, 0.66619],
    68: [0, 0.7, 0.09371, 0, 0.77443],
    69: [0, 0.7, 0.18583, 0, 0.56162],
    70: [0, 0.7, 0.13634, 0, 0.89544],
    71: [0, 0.7, 0.17322, 0, 0.60961],
    72: [0, 0.7, 0.29694, 0, 0.96919],
    73: [0, 0.7, 0.19189, 0, 0.80907],
    74: [0.27778, 0.7, 0.19189, 0, 1.05159],
    75: [0, 0.7, 0.31259, 0, 0.91364],
    76: [0, 0.7, 0.19189, 0, 0.87373],
    77: [0, 0.7, 0.15981, 0, 1.08031],
    78: [0, 0.7, 0.3525, 0, 0.9015],
    79: [0, 0.7, 0.08078, 0, 0.73787],
    80: [0, 0.7, 0.08078, 0, 1.01262],
    81: [0, 0.7, 0.03305, 0, 0.88282],
    82: [0, 0.7, 0.06259, 0, 0.85],
    83: [0, 0.7, 0.19189, 0, 0.86767],
    84: [0, 0.7, 0.29087, 0, 0.74697],
    85: [0, 0.7, 0.25815, 0, 0.79996],
    86: [0, 0.7, 0.27523, 0, 0.62204],
    87: [0, 0.7, 0.27523, 0, 0.80532],
    88: [0, 0.7, 0.26006, 0, 0.94445],
    89: [0, 0.7, 0.2939, 0, 0.70961],
    90: [0, 0.7, 0.24037, 0, 0.8212],
    160: [0, 0, 0, 0, 0.25]
  },
  "Size1-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [0.35001, 0.85, 0, 0, 0.45834],
    41: [0.35001, 0.85, 0, 0, 0.45834],
    47: [0.35001, 0.85, 0, 0, 0.57778],
    91: [0.35001, 0.85, 0, 0, 0.41667],
    92: [0.35001, 0.85, 0, 0, 0.57778],
    93: [0.35001, 0.85, 0, 0, 0.41667],
    123: [0.35001, 0.85, 0, 0, 0.58334],
    125: [0.35001, 0.85, 0, 0, 0.58334],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.72222, 0, 0, 0.55556],
    732: [0, 0.72222, 0, 0, 0.55556],
    770: [0, 0.72222, 0, 0, 0.55556],
    771: [0, 0.72222, 0, 0, 0.55556],
    8214: [-99e-5, 0.601, 0, 0, 0.77778],
    8593: [1e-5, 0.6, 0, 0, 0.66667],
    8595: [1e-5, 0.6, 0, 0, 0.66667],
    8657: [1e-5, 0.6, 0, 0, 0.77778],
    8659: [1e-5, 0.6, 0, 0, 0.77778],
    8719: [0.25001, 0.75, 0, 0, 0.94445],
    8720: [0.25001, 0.75, 0, 0, 0.94445],
    8721: [0.25001, 0.75, 0, 0, 1.05556],
    8730: [0.35001, 0.85, 0, 0, 1],
    8739: [-599e-5, 0.606, 0, 0, 0.33333],
    8741: [-599e-5, 0.606, 0, 0, 0.55556],
    8747: [0.30612, 0.805, 0.19445, 0, 0.47222],
    8748: [0.306, 0.805, 0.19445, 0, 0.47222],
    8749: [0.306, 0.805, 0.19445, 0, 0.47222],
    8750: [0.30612, 0.805, 0.19445, 0, 0.47222],
    8896: [0.25001, 0.75, 0, 0, 0.83334],
    8897: [0.25001, 0.75, 0, 0, 0.83334],
    8898: [0.25001, 0.75, 0, 0, 0.83334],
    8899: [0.25001, 0.75, 0, 0, 0.83334],
    8968: [0.35001, 0.85, 0, 0, 0.47222],
    8969: [0.35001, 0.85, 0, 0, 0.47222],
    8970: [0.35001, 0.85, 0, 0, 0.47222],
    8971: [0.35001, 0.85, 0, 0, 0.47222],
    9168: [-99e-5, 0.601, 0, 0, 0.66667],
    10216: [0.35001, 0.85, 0, 0, 0.47222],
    10217: [0.35001, 0.85, 0, 0, 0.47222],
    10752: [0.25001, 0.75, 0, 0, 1.11111],
    10753: [0.25001, 0.75, 0, 0, 1.11111],
    10754: [0.25001, 0.75, 0, 0, 1.11111],
    10756: [0.25001, 0.75, 0, 0, 0.83334],
    10758: [0.25001, 0.75, 0, 0, 0.83334]
  },
  "Size2-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [0.65002, 1.15, 0, 0, 0.59722],
    41: [0.65002, 1.15, 0, 0, 0.59722],
    47: [0.65002, 1.15, 0, 0, 0.81111],
    91: [0.65002, 1.15, 0, 0, 0.47222],
    92: [0.65002, 1.15, 0, 0, 0.81111],
    93: [0.65002, 1.15, 0, 0, 0.47222],
    123: [0.65002, 1.15, 0, 0, 0.66667],
    125: [0.65002, 1.15, 0, 0, 0.66667],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.75, 0, 0, 1],
    732: [0, 0.75, 0, 0, 1],
    770: [0, 0.75, 0, 0, 1],
    771: [0, 0.75, 0, 0, 1],
    8719: [0.55001, 1.05, 0, 0, 1.27778],
    8720: [0.55001, 1.05, 0, 0, 1.27778],
    8721: [0.55001, 1.05, 0, 0, 1.44445],
    8730: [0.65002, 1.15, 0, 0, 1],
    8747: [0.86225, 1.36, 0.44445, 0, 0.55556],
    8748: [0.862, 1.36, 0.44445, 0, 0.55556],
    8749: [0.862, 1.36, 0.44445, 0, 0.55556],
    8750: [0.86225, 1.36, 0.44445, 0, 0.55556],
    8896: [0.55001, 1.05, 0, 0, 1.11111],
    8897: [0.55001, 1.05, 0, 0, 1.11111],
    8898: [0.55001, 1.05, 0, 0, 1.11111],
    8899: [0.55001, 1.05, 0, 0, 1.11111],
    8968: [0.65002, 1.15, 0, 0, 0.52778],
    8969: [0.65002, 1.15, 0, 0, 0.52778],
    8970: [0.65002, 1.15, 0, 0, 0.52778],
    8971: [0.65002, 1.15, 0, 0, 0.52778],
    10216: [0.65002, 1.15, 0, 0, 0.61111],
    10217: [0.65002, 1.15, 0, 0, 0.61111],
    10752: [0.55001, 1.05, 0, 0, 1.51112],
    10753: [0.55001, 1.05, 0, 0, 1.51112],
    10754: [0.55001, 1.05, 0, 0, 1.51112],
    10756: [0.55001, 1.05, 0, 0, 1.11111],
    10758: [0.55001, 1.05, 0, 0, 1.11111]
  },
  "Size3-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [0.95003, 1.45, 0, 0, 0.73611],
    41: [0.95003, 1.45, 0, 0, 0.73611],
    47: [0.95003, 1.45, 0, 0, 1.04445],
    91: [0.95003, 1.45, 0, 0, 0.52778],
    92: [0.95003, 1.45, 0, 0, 1.04445],
    93: [0.95003, 1.45, 0, 0, 0.52778],
    123: [0.95003, 1.45, 0, 0, 0.75],
    125: [0.95003, 1.45, 0, 0, 0.75],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.75, 0, 0, 1.44445],
    732: [0, 0.75, 0, 0, 1.44445],
    770: [0, 0.75, 0, 0, 1.44445],
    771: [0, 0.75, 0, 0, 1.44445],
    8730: [0.95003, 1.45, 0, 0, 1],
    8968: [0.95003, 1.45, 0, 0, 0.58334],
    8969: [0.95003, 1.45, 0, 0, 0.58334],
    8970: [0.95003, 1.45, 0, 0, 0.58334],
    8971: [0.95003, 1.45, 0, 0, 0.58334],
    10216: [0.95003, 1.45, 0, 0, 0.75],
    10217: [0.95003, 1.45, 0, 0, 0.75]
  },
  "Size4-Regular": {
    32: [0, 0, 0, 0, 0.25],
    40: [1.25003, 1.75, 0, 0, 0.79167],
    41: [1.25003, 1.75, 0, 0, 0.79167],
    47: [1.25003, 1.75, 0, 0, 1.27778],
    91: [1.25003, 1.75, 0, 0, 0.58334],
    92: [1.25003, 1.75, 0, 0, 1.27778],
    93: [1.25003, 1.75, 0, 0, 0.58334],
    123: [1.25003, 1.75, 0, 0, 0.80556],
    125: [1.25003, 1.75, 0, 0, 0.80556],
    160: [0, 0, 0, 0, 0.25],
    710: [0, 0.825, 0, 0, 1.8889],
    732: [0, 0.825, 0, 0, 1.8889],
    770: [0, 0.825, 0, 0, 1.8889],
    771: [0, 0.825, 0, 0, 1.8889],
    8730: [1.25003, 1.75, 0, 0, 1],
    8968: [1.25003, 1.75, 0, 0, 0.63889],
    8969: [1.25003, 1.75, 0, 0, 0.63889],
    8970: [1.25003, 1.75, 0, 0, 0.63889],
    8971: [1.25003, 1.75, 0, 0, 0.63889],
    9115: [0.64502, 1.155, 0, 0, 0.875],
    9116: [1e-5, 0.6, 0, 0, 0.875],
    9117: [0.64502, 1.155, 0, 0, 0.875],
    9118: [0.64502, 1.155, 0, 0, 0.875],
    9119: [1e-5, 0.6, 0, 0, 0.875],
    9120: [0.64502, 1.155, 0, 0, 0.875],
    9121: [0.64502, 1.155, 0, 0, 0.66667],
    9122: [-99e-5, 0.601, 0, 0, 0.66667],
    9123: [0.64502, 1.155, 0, 0, 0.66667],
    9124: [0.64502, 1.155, 0, 0, 0.66667],
    9125: [-99e-5, 0.601, 0, 0, 0.66667],
    9126: [0.64502, 1.155, 0, 0, 0.66667],
    9127: [1e-5, 0.9, 0, 0, 0.88889],
    9128: [0.65002, 1.15, 0, 0, 0.88889],
    9129: [0.90001, 0, 0, 0, 0.88889],
    9130: [0, 0.3, 0, 0, 0.88889],
    9131: [1e-5, 0.9, 0, 0, 0.88889],
    9132: [0.65002, 1.15, 0, 0, 0.88889],
    9133: [0.90001, 0, 0, 0, 0.88889],
    9143: [0.88502, 0.915, 0, 0, 1.05556],
    10216: [1.25003, 1.75, 0, 0, 0.80556],
    10217: [1.25003, 1.75, 0, 0, 0.80556],
    57344: [-499e-5, 0.605, 0, 0, 1.05556],
    57345: [-499e-5, 0.605, 0, 0, 1.05556],
    57680: [0, 0.12, 0, 0, 0.45],
    57681: [0, 0.12, 0, 0, 0.45],
    57682: [0, 0.12, 0, 0, 0.45],
    57683: [0, 0.12, 0, 0, 0.45]
  },
  "Typewriter-Regular": {
    32: [0, 0, 0, 0, 0.525],
    33: [0, 0.61111, 0, 0, 0.525],
    34: [0, 0.61111, 0, 0, 0.525],
    35: [0, 0.61111, 0, 0, 0.525],
    36: [0.08333, 0.69444, 0, 0, 0.525],
    37: [0.08333, 0.69444, 0, 0, 0.525],
    38: [0, 0.61111, 0, 0, 0.525],
    39: [0, 0.61111, 0, 0, 0.525],
    40: [0.08333, 0.69444, 0, 0, 0.525],
    41: [0.08333, 0.69444, 0, 0, 0.525],
    42: [0, 0.52083, 0, 0, 0.525],
    43: [-0.08056, 0.53055, 0, 0, 0.525],
    44: [0.13889, 0.125, 0, 0, 0.525],
    45: [-0.08056, 0.53055, 0, 0, 0.525],
    46: [0, 0.125, 0, 0, 0.525],
    47: [0.08333, 0.69444, 0, 0, 0.525],
    48: [0, 0.61111, 0, 0, 0.525],
    49: [0, 0.61111, 0, 0, 0.525],
    50: [0, 0.61111, 0, 0, 0.525],
    51: [0, 0.61111, 0, 0, 0.525],
    52: [0, 0.61111, 0, 0, 0.525],
    53: [0, 0.61111, 0, 0, 0.525],
    54: [0, 0.61111, 0, 0, 0.525],
    55: [0, 0.61111, 0, 0, 0.525],
    56: [0, 0.61111, 0, 0, 0.525],
    57: [0, 0.61111, 0, 0, 0.525],
    58: [0, 0.43056, 0, 0, 0.525],
    59: [0.13889, 0.43056, 0, 0, 0.525],
    60: [-0.05556, 0.55556, 0, 0, 0.525],
    61: [-0.19549, 0.41562, 0, 0, 0.525],
    62: [-0.05556, 0.55556, 0, 0, 0.525],
    63: [0, 0.61111, 0, 0, 0.525],
    64: [0, 0.61111, 0, 0, 0.525],
    65: [0, 0.61111, 0, 0, 0.525],
    66: [0, 0.61111, 0, 0, 0.525],
    67: [0, 0.61111, 0, 0, 0.525],
    68: [0, 0.61111, 0, 0, 0.525],
    69: [0, 0.61111, 0, 0, 0.525],
    70: [0, 0.61111, 0, 0, 0.525],
    71: [0, 0.61111, 0, 0, 0.525],
    72: [0, 0.61111, 0, 0, 0.525],
    73: [0, 0.61111, 0, 0, 0.525],
    74: [0, 0.61111, 0, 0, 0.525],
    75: [0, 0.61111, 0, 0, 0.525],
    76: [0, 0.61111, 0, 0, 0.525],
    77: [0, 0.61111, 0, 0, 0.525],
    78: [0, 0.61111, 0, 0, 0.525],
    79: [0, 0.61111, 0, 0, 0.525],
    80: [0, 0.61111, 0, 0, 0.525],
    81: [0.13889, 0.61111, 0, 0, 0.525],
    82: [0, 0.61111, 0, 0, 0.525],
    83: [0, 0.61111, 0, 0, 0.525],
    84: [0, 0.61111, 0, 0, 0.525],
    85: [0, 0.61111, 0, 0, 0.525],
    86: [0, 0.61111, 0, 0, 0.525],
    87: [0, 0.61111, 0, 0, 0.525],
    88: [0, 0.61111, 0, 0, 0.525],
    89: [0, 0.61111, 0, 0, 0.525],
    90: [0, 0.61111, 0, 0, 0.525],
    91: [0.08333, 0.69444, 0, 0, 0.525],
    92: [0.08333, 0.69444, 0, 0, 0.525],
    93: [0.08333, 0.69444, 0, 0, 0.525],
    94: [0, 0.61111, 0, 0, 0.525],
    95: [0.09514, 0, 0, 0, 0.525],
    96: [0, 0.61111, 0, 0, 0.525],
    97: [0, 0.43056, 0, 0, 0.525],
    98: [0, 0.61111, 0, 0, 0.525],
    99: [0, 0.43056, 0, 0, 0.525],
    100: [0, 0.61111, 0, 0, 0.525],
    101: [0, 0.43056, 0, 0, 0.525],
    102: [0, 0.61111, 0, 0, 0.525],
    103: [0.22222, 0.43056, 0, 0, 0.525],
    104: [0, 0.61111, 0, 0, 0.525],
    105: [0, 0.61111, 0, 0, 0.525],
    106: [0.22222, 0.61111, 0, 0, 0.525],
    107: [0, 0.61111, 0, 0, 0.525],
    108: [0, 0.61111, 0, 0, 0.525],
    109: [0, 0.43056, 0, 0, 0.525],
    110: [0, 0.43056, 0, 0, 0.525],
    111: [0, 0.43056, 0, 0, 0.525],
    112: [0.22222, 0.43056, 0, 0, 0.525],
    113: [0.22222, 0.43056, 0, 0, 0.525],
    114: [0, 0.43056, 0, 0, 0.525],
    115: [0, 0.43056, 0, 0, 0.525],
    116: [0, 0.55358, 0, 0, 0.525],
    117: [0, 0.43056, 0, 0, 0.525],
    118: [0, 0.43056, 0, 0, 0.525],
    119: [0, 0.43056, 0, 0, 0.525],
    120: [0, 0.43056, 0, 0, 0.525],
    121: [0.22222, 0.43056, 0, 0, 0.525],
    122: [0, 0.43056, 0, 0, 0.525],
    123: [0.08333, 0.69444, 0, 0, 0.525],
    124: [0.08333, 0.69444, 0, 0, 0.525],
    125: [0.08333, 0.69444, 0, 0, 0.525],
    126: [0, 0.61111, 0, 0, 0.525],
    127: [0, 0.61111, 0, 0, 0.525],
    160: [0, 0, 0, 0, 0.525],
    176: [0, 0.61111, 0, 0, 0.525],
    184: [0.19445, 0, 0, 0, 0.525],
    305: [0, 0.43056, 0, 0, 0.525],
    567: [0.22222, 0.43056, 0, 0, 0.525],
    711: [0, 0.56597, 0, 0, 0.525],
    713: [0, 0.56555, 0, 0, 0.525],
    714: [0, 0.61111, 0, 0, 0.525],
    715: [0, 0.61111, 0, 0, 0.525],
    728: [0, 0.61111, 0, 0, 0.525],
    730: [0, 0.61111, 0, 0, 0.525],
    770: [0, 0.61111, 0, 0, 0.525],
    771: [0, 0.61111, 0, 0, 0.525],
    776: [0, 0.61111, 0, 0, 0.525],
    915: [0, 0.61111, 0, 0, 0.525],
    916: [0, 0.61111, 0, 0, 0.525],
    920: [0, 0.61111, 0, 0, 0.525],
    923: [0, 0.61111, 0, 0, 0.525],
    926: [0, 0.61111, 0, 0, 0.525],
    928: [0, 0.61111, 0, 0, 0.525],
    931: [0, 0.61111, 0, 0, 0.525],
    933: [0, 0.61111, 0, 0, 0.525],
    934: [0, 0.61111, 0, 0, 0.525],
    936: [0, 0.61111, 0, 0, 0.525],
    937: [0, 0.61111, 0, 0, 0.525],
    8216: [0, 0.61111, 0, 0, 0.525],
    8217: [0, 0.61111, 0, 0, 0.525],
    8242: [0, 0.61111, 0, 0, 0.525],
    9251: [0.11111, 0.21944, 0, 0, 0.525]
  }
}, kk = {
  // Latin-1
  Å: "A",
  Ð: "D",
  Þ: "o",
  å: "a",
  ð: "d",
  þ: "o",
  // Cyrillic
  А: "A",
  Б: "B",
  В: "B",
  Г: "F",
  Д: "A",
  Е: "E",
  Ж: "K",
  З: "3",
  И: "N",
  Й: "N",
  К: "K",
  Л: "N",
  М: "M",
  Н: "H",
  О: "O",
  П: "N",
  Р: "P",
  С: "C",
  Т: "T",
  У: "y",
  Ф: "O",
  Х: "X",
  Ц: "U",
  Ч: "h",
  Ш: "W",
  Щ: "W",
  Ъ: "B",
  Ы: "X",
  Ь: "B",
  Э: "3",
  Ю: "X",
  Я: "R",
  а: "a",
  б: "b",
  в: "a",
  г: "r",
  д: "y",
  е: "e",
  ж: "m",
  з: "e",
  и: "n",
  й: "n",
  к: "n",
  л: "n",
  м: "m",
  н: "n",
  о: "o",
  п: "n",
  р: "p",
  с: "c",
  т: "o",
  у: "y",
  ф: "b",
  х: "x",
  ц: "n",
  ч: "n",
  ш: "w",
  щ: "w",
  ъ: "a",
  ы: "m",
  ь: "a",
  э: "e",
  ю: "m",
  я: "r"
};
function Bw(i, t, e) {
  if (!Bl[t])
    throw new Error("Font metrics not found for font: " + t + ".");
  var n = i.charCodeAt(0), s = Bl[t][n];
  if (!s && i[0] in kk && (n = kk[i[0]].charCodeAt(0), s = Bl[t][n]), !s && e === "text" && QG(n) && (s = Bl[t][77]), s)
    return {
      depth: s[0],
      height: s[1],
      italic: s[2],
      skew: s[3],
      width: s[4]
    };
}
var cy = {
  // https://en.wikibooks.org/wiki/LaTeX/Lengths and
  // https://tex.stackexchange.com/a/8263
  pt: 1,
  // TeX point
  mm: 7227 / 2540,
  // millimeter
  cm: 7227 / 254,
  // centimeter
  in: 72.27,
  // inch
  bp: 803 / 800,
  // big (PostScript) points
  pc: 12,
  // pica
  dd: 1238 / 1157,
  // didot
  cc: 14856 / 1157,
  // cicero (12 didot)
  nd: 685 / 642,
  // new didot
  nc: 1370 / 107,
  // new cicero (12 new didot)
  sp: 1 / 65536,
  // scaled point (TeX's internal smallest unit)
  // https://tex.stackexchange.com/a/41371
  px: 803 / 800
  // \pdfpxdimen defaults to 1 bp in pdfTeX and LuaTeX
}, hV = {
  ex: !0,
  em: !0,
  mu: !0
}, uV = function(t) {
  return typeof t != "string" && (t = t.unit), t in cy || t in hV || t === "ex";
}, Ai = function(t, e) {
  var n;
  if (t.unit in cy)
    n = cy[t.unit] / e.fontMetrics().ptPerEm / e.sizeMultiplier;
  else if (t.unit === "mu")
    n = e.fontMetrics().cssEmPerMu;
  else {
    var s;
    if (e.style.isTight() ? s = e.havingStyle(e.style.text()) : s = e, t.unit === "ex")
      n = s.fontMetrics().xHeight;
    else if (t.unit === "em")
      n = s.fontMetrics().quad;
    else
      throw new te("Invalid unit: '" + t.unit + "'");
    s !== e && (n *= s.sizeMultiplier / e.sizeMultiplier);
  }
  return Math.min(t.number * n, e.maxSize);
}, Nt = function(t) {
  return +t.toFixed(4) + "em";
}, p0 = function(t) {
  return t.filter((e) => e).join(" ");
}, gF = function(t, e, n) {
  if (this.classes = t || [], this.attributes = {}, this.height = 0, this.depth = 0, this.maxFontSize = 0, this.style = n || {}, e) {
    e.style.isTight() && this.classes.push("mtight");
    var s = e.getColor();
    s && (this.style.color = s);
  }
}, bF = function(t) {
  var e = document.createElement(t);
  e.className = p0(this.classes);
  for (var n in this.style)
    this.style.hasOwnProperty(n) && (e.style[n] = this.style[n]);
  for (var s in this.attributes)
    this.attributes.hasOwnProperty(s) && e.setAttribute(s, this.attributes[s]);
  for (var r = 0; r < this.children.length; r++)
    e.appendChild(this.children[r].toNode());
  return e;
}, dV = /[\s"'>/=\x00-\x1f]/, yF = function(t) {
  var e = "<" + t;
  this.classes.length && (e += ' class="' + ne.escape(p0(this.classes)) + '"');
  var n = "";
  for (var s in this.style)
    this.style.hasOwnProperty(s) && (n += ne.hyphenate(s) + ":" + this.style[s] + ";");
  n && (e += ' style="' + ne.escape(n) + '"');
  for (var r in this.attributes)
    if (this.attributes.hasOwnProperty(r)) {
      if (dV.test(r))
        throw new te("Invalid attribute name '" + r + "'");
      e += " " + r + '="' + ne.escape(this.attributes[r]) + '"';
    }
  e += ">";
  for (var a = 0; a < this.children.length; a++)
    e += this.children[a].toMarkup();
  return e += "</" + t + ">", e;
};
class W4 {
  constructor(t, e, n, s) {
    this.children = void 0, this.attributes = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.width = void 0, this.maxFontSize = void 0, this.style = void 0, gF.call(this, t, n, s), this.children = e || [];
  }
  /**
   * Sets an arbitrary attribute on the span. Warning: use this wisely. Not
   * all browsers support attributes the same, and having too many custom
   * attributes is probably bad.
   */
  setAttribute(t, e) {
    this.attributes[t] = e;
  }
  hasClass(t) {
    return ne.contains(this.classes, t);
  }
  toNode() {
    return bF.call(this, "span");
  }
  toMarkup() {
    return yF.call(this, "span");
  }
}
class wF {
  constructor(t, e, n, s) {
    this.children = void 0, this.attributes = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.maxFontSize = void 0, this.style = void 0, gF.call(this, e, s), this.children = n || [], this.setAttribute("href", t);
  }
  setAttribute(t, e) {
    this.attributes[t] = e;
  }
  hasClass(t) {
    return ne.contains(this.classes, t);
  }
  toNode() {
    return bF.call(this, "a");
  }
  toMarkup() {
    return yF.call(this, "a");
  }
}
class fV {
  constructor(t, e, n) {
    this.src = void 0, this.alt = void 0, this.classes = void 0, this.height = void 0, this.depth = void 0, this.maxFontSize = void 0, this.style = void 0, this.alt = e, this.src = t, this.classes = ["mord"], this.style = n;
  }
  hasClass(t) {
    return ne.contains(this.classes, t);
  }
  toNode() {
    var t = document.createElement("img");
    t.src = this.src, t.alt = this.alt, t.className = "mord";
    for (var e in this.style)
      this.style.hasOwnProperty(e) && (t.style[e] = this.style[e]);
    return t;
  }
  toMarkup() {
    var t = '<img src="' + ne.escape(this.src) + '"' + (' alt="' + ne.escape(this.alt) + '"'), e = "";
    for (var n in this.style)
      this.style.hasOwnProperty(n) && (e += ne.hyphenate(n) + ":" + this.style[n] + ";");
    return e && (t += ' style="' + ne.escape(e) + '"'), t += "'/>", t;
  }
}
var pV = {
  î: "ı̂",
  ï: "ı̈",
  í: "ı́",
  // 'ī': '\u0131\u0304', // enable when we add Extended Latin
  ì: "ı̀"
};
class Io {
  constructor(t, e, n, s, r, a, o, l) {
    this.text = void 0, this.height = void 0, this.depth = void 0, this.italic = void 0, this.skew = void 0, this.width = void 0, this.maxFontSize = void 0, this.classes = void 0, this.style = void 0, this.text = t, this.height = e || 0, this.depth = n || 0, this.italic = s || 0, this.skew = r || 0, this.width = a || 0, this.classes = o || [], this.style = l || {}, this.maxFontSize = 0;
    var c = JG(this.text.charCodeAt(0));
    c && this.classes.push(c + "_fallback"), /[îïíì]/.test(this.text) && (this.text = pV[this.text]);
  }
  hasClass(t) {
    return ne.contains(this.classes, t);
  }
  /**
   * Creates a text node or span from a symbol node. Note that a span is only
   * created if it is needed.
   */
  toNode() {
    var t = document.createTextNode(this.text), e = null;
    this.italic > 0 && (e = document.createElement("span"), e.style.marginRight = Nt(this.italic)), this.classes.length > 0 && (e = e || document.createElement("span"), e.className = p0(this.classes));
    for (var n in this.style)
      this.style.hasOwnProperty(n) && (e = e || document.createElement("span"), e.style[n] = this.style[n]);
    return e ? (e.appendChild(t), e) : t;
  }
  /**
   * Creates markup for a symbol node.
   */
  toMarkup() {
    var t = !1, e = "<span";
    this.classes.length && (t = !0, e += ' class="', e += ne.escape(p0(this.classes)), e += '"');
    var n = "";
    this.italic > 0 && (n += "margin-right:" + this.italic + "em;");
    for (var s in this.style)
      this.style.hasOwnProperty(s) && (n += ne.hyphenate(s) + ":" + this.style[s] + ";");
    n && (t = !0, e += ' style="' + ne.escape(n) + '"');
    var r = ne.escape(this.text);
    return t ? (e += ">", e += r, e += "</span>", e) : r;
  }
}
class m0 {
  constructor(t, e) {
    this.children = void 0, this.attributes = void 0, this.children = t || [], this.attributes = e || {};
  }
  toNode() {
    var t = "http://www.w3.org/2000/svg", e = document.createElementNS(t, "svg");
    for (var n in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, n) && e.setAttribute(n, this.attributes[n]);
    for (var s = 0; s < this.children.length; s++)
      e.appendChild(this.children[s].toNode());
    return e;
  }
  toMarkup() {
    var t = '<svg xmlns="http://www.w3.org/2000/svg"';
    for (var e in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, e) && (t += " " + e + '="' + ne.escape(this.attributes[e]) + '"');
    t += ">";
    for (var n = 0; n < this.children.length; n++)
      t += this.children[n].toMarkup();
    return t += "</svg>", t;
  }
}
class E1 {
  constructor(t, e) {
    this.pathName = void 0, this.alternate = void 0, this.pathName = t, this.alternate = e;
  }
  toNode() {
    var t = "http://www.w3.org/2000/svg", e = document.createElementNS(t, "path");
    return this.alternate ? e.setAttribute("d", this.alternate) : e.setAttribute("d", xk[this.pathName]), e;
  }
  toMarkup() {
    return this.alternate ? '<path d="' + ne.escape(this.alternate) + '"/>' : '<path d="' + ne.escape(xk[this.pathName]) + '"/>';
  }
}
class Ak {
  constructor(t) {
    this.attributes = void 0, this.attributes = t || {};
  }
  toNode() {
    var t = "http://www.w3.org/2000/svg", e = document.createElementNS(t, "line");
    for (var n in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, n) && e.setAttribute(n, this.attributes[n]);
    return e;
  }
  toMarkup() {
    var t = "<line";
    for (var e in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, e) && (t += " " + e + '="' + ne.escape(this.attributes[e]) + '"');
    return t += "/>", t;
  }
}
function Sk(i) {
  if (i instanceof Io)
    return i;
  throw new Error("Expected symbolNode but got " + String(i) + ".");
}
function mV(i) {
  if (i instanceof W4)
    return i;
  throw new Error("Expected span<HtmlDomNode> but got " + String(i) + ".");
}
var gV = {
  "accent-token": 1,
  mathord: 1,
  "op-token": 1,
  spacing: 1,
  textord: 1
}, zi = {
  math: {},
  text: {}
};
function A(i, t, e, n, s, r) {
  zi[i][s] = {
    font: t,
    group: e,
    replace: n
  }, r && n && (zi[i][n] = zi[i][s]);
}
var C = "math", Tt = "text", M = "main", X = "ams", wi = "accent-token", zt = "bin", ws = "close", bf = "inner", ie = "mathord", Ki = "op-token", ur = "open", X4 = "punct", J = "rel", Zl = "spacing", st = "textord";
A(C, M, J, "≡", "\\equiv", !0);
A(C, M, J, "≺", "\\prec", !0);
A(C, M, J, "≻", "\\succ", !0);
A(C, M, J, "∼", "\\sim", !0);
A(C, M, J, "⊥", "\\perp");
A(C, M, J, "⪯", "\\preceq", !0);
A(C, M, J, "⪰", "\\succeq", !0);
A(C, M, J, "≃", "\\simeq", !0);
A(C, M, J, "∣", "\\mid", !0);
A(C, M, J, "≪", "\\ll", !0);
A(C, M, J, "≫", "\\gg", !0);
A(C, M, J, "≍", "\\asymp", !0);
A(C, M, J, "∥", "\\parallel");
A(C, M, J, "⋈", "\\bowtie", !0);
A(C, M, J, "⌣", "\\smile", !0);
A(C, M, J, "⊑", "\\sqsubseteq", !0);
A(C, M, J, "⊒", "\\sqsupseteq", !0);
A(C, M, J, "≐", "\\doteq", !0);
A(C, M, J, "⌢", "\\frown", !0);
A(C, M, J, "∋", "\\ni", !0);
A(C, M, J, "∝", "\\propto", !0);
A(C, M, J, "⊢", "\\vdash", !0);
A(C, M, J, "⊣", "\\dashv", !0);
A(C, M, J, "∋", "\\owns");
A(C, M, X4, ".", "\\ldotp");
A(C, M, X4, "⋅", "\\cdotp");
A(C, M, st, "#", "\\#");
A(Tt, M, st, "#", "\\#");
A(C, M, st, "&", "\\&");
A(Tt, M, st, "&", "\\&");
A(C, M, st, "ℵ", "\\aleph", !0);
A(C, M, st, "∀", "\\forall", !0);
A(C, M, st, "ℏ", "\\hbar", !0);
A(C, M, st, "∃", "\\exists", !0);
A(C, M, st, "∇", "\\nabla", !0);
A(C, M, st, "♭", "\\flat", !0);
A(C, M, st, "ℓ", "\\ell", !0);
A(C, M, st, "♮", "\\natural", !0);
A(C, M, st, "♣", "\\clubsuit", !0);
A(C, M, st, "℘", "\\wp", !0);
A(C, M, st, "♯", "\\sharp", !0);
A(C, M, st, "♢", "\\diamondsuit", !0);
A(C, M, st, "ℜ", "\\Re", !0);
A(C, M, st, "♡", "\\heartsuit", !0);
A(C, M, st, "ℑ", "\\Im", !0);
A(C, M, st, "♠", "\\spadesuit", !0);
A(C, M, st, "§", "\\S", !0);
A(Tt, M, st, "§", "\\S");
A(C, M, st, "¶", "\\P", !0);
A(Tt, M, st, "¶", "\\P");
A(C, M, st, "†", "\\dag");
A(Tt, M, st, "†", "\\dag");
A(Tt, M, st, "†", "\\textdagger");
A(C, M, st, "‡", "\\ddag");
A(Tt, M, st, "‡", "\\ddag");
A(Tt, M, st, "‡", "\\textdaggerdbl");
A(C, M, ws, "⎱", "\\rmoustache", !0);
A(C, M, ur, "⎰", "\\lmoustache", !0);
A(C, M, ws, "⟯", "\\rgroup", !0);
A(C, M, ur, "⟮", "\\lgroup", !0);
A(C, M, zt, "∓", "\\mp", !0);
A(C, M, zt, "⊖", "\\ominus", !0);
A(C, M, zt, "⊎", "\\uplus", !0);
A(C, M, zt, "⊓", "\\sqcap", !0);
A(C, M, zt, "∗", "\\ast");
A(C, M, zt, "⊔", "\\sqcup", !0);
A(C, M, zt, "◯", "\\bigcirc", !0);
A(C, M, zt, "∙", "\\bullet", !0);
A(C, M, zt, "‡", "\\ddagger");
A(C, M, zt, "≀", "\\wr", !0);
A(C, M, zt, "⨿", "\\amalg");
A(C, M, zt, "&", "\\And");
A(C, M, J, "⟵", "\\longleftarrow", !0);
A(C, M, J, "⇐", "\\Leftarrow", !0);
A(C, M, J, "⟸", "\\Longleftarrow", !0);
A(C, M, J, "⟶", "\\longrightarrow", !0);
A(C, M, J, "⇒", "\\Rightarrow", !0);
A(C, M, J, "⟹", "\\Longrightarrow", !0);
A(C, M, J, "↔", "\\leftrightarrow", !0);
A(C, M, J, "⟷", "\\longleftrightarrow", !0);
A(C, M, J, "⇔", "\\Leftrightarrow", !0);
A(C, M, J, "⟺", "\\Longleftrightarrow", !0);
A(C, M, J, "↦", "\\mapsto", !0);
A(C, M, J, "⟼", "\\longmapsto", !0);
A(C, M, J, "↗", "\\nearrow", !0);
A(C, M, J, "↩", "\\hookleftarrow", !0);
A(C, M, J, "↪", "\\hookrightarrow", !0);
A(C, M, J, "↘", "\\searrow", !0);
A(C, M, J, "↼", "\\leftharpoonup", !0);
A(C, M, J, "⇀", "\\rightharpoonup", !0);
A(C, M, J, "↙", "\\swarrow", !0);
A(C, M, J, "↽", "\\leftharpoondown", !0);
A(C, M, J, "⇁", "\\rightharpoondown", !0);
A(C, M, J, "↖", "\\nwarrow", !0);
A(C, M, J, "⇌", "\\rightleftharpoons", !0);
A(C, X, J, "≮", "\\nless", !0);
A(C, X, J, "", "\\@nleqslant");
A(C, X, J, "", "\\@nleqq");
A(C, X, J, "⪇", "\\lneq", !0);
A(C, X, J, "≨", "\\lneqq", !0);
A(C, X, J, "", "\\@lvertneqq");
A(C, X, J, "⋦", "\\lnsim", !0);
A(C, X, J, "⪉", "\\lnapprox", !0);
A(C, X, J, "⊀", "\\nprec", !0);
A(C, X, J, "⋠", "\\npreceq", !0);
A(C, X, J, "⋨", "\\precnsim", !0);
A(C, X, J, "⪹", "\\precnapprox", !0);
A(C, X, J, "≁", "\\nsim", !0);
A(C, X, J, "", "\\@nshortmid");
A(C, X, J, "∤", "\\nmid", !0);
A(C, X, J, "⊬", "\\nvdash", !0);
A(C, X, J, "⊭", "\\nvDash", !0);
A(C, X, J, "⋪", "\\ntriangleleft");
A(C, X, J, "⋬", "\\ntrianglelefteq", !0);
A(C, X, J, "⊊", "\\subsetneq", !0);
A(C, X, J, "", "\\@varsubsetneq");
A(C, X, J, "⫋", "\\subsetneqq", !0);
A(C, X, J, "", "\\@varsubsetneqq");
A(C, X, J, "≯", "\\ngtr", !0);
A(C, X, J, "", "\\@ngeqslant");
A(C, X, J, "", "\\@ngeqq");
A(C, X, J, "⪈", "\\gneq", !0);
A(C, X, J, "≩", "\\gneqq", !0);
A(C, X, J, "", "\\@gvertneqq");
A(C, X, J, "⋧", "\\gnsim", !0);
A(C, X, J, "⪊", "\\gnapprox", !0);
A(C, X, J, "⊁", "\\nsucc", !0);
A(C, X, J, "⋡", "\\nsucceq", !0);
A(C, X, J, "⋩", "\\succnsim", !0);
A(C, X, J, "⪺", "\\succnapprox", !0);
A(C, X, J, "≆", "\\ncong", !0);
A(C, X, J, "", "\\@nshortparallel");
A(C, X, J, "∦", "\\nparallel", !0);
A(C, X, J, "⊯", "\\nVDash", !0);
A(C, X, J, "⋫", "\\ntriangleright");
A(C, X, J, "⋭", "\\ntrianglerighteq", !0);
A(C, X, J, "", "\\@nsupseteqq");
A(C, X, J, "⊋", "\\supsetneq", !0);
A(C, X, J, "", "\\@varsupsetneq");
A(C, X, J, "⫌", "\\supsetneqq", !0);
A(C, X, J, "", "\\@varsupsetneqq");
A(C, X, J, "⊮", "\\nVdash", !0);
A(C, X, J, "⪵", "\\precneqq", !0);
A(C, X, J, "⪶", "\\succneqq", !0);
A(C, X, J, "", "\\@nsubseteqq");
A(C, X, zt, "⊴", "\\unlhd");
A(C, X, zt, "⊵", "\\unrhd");
A(C, X, J, "↚", "\\nleftarrow", !0);
A(C, X, J, "↛", "\\nrightarrow", !0);
A(C, X, J, "⇍", "\\nLeftarrow", !0);
A(C, X, J, "⇏", "\\nRightarrow", !0);
A(C, X, J, "↮", "\\nleftrightarrow", !0);
A(C, X, J, "⇎", "\\nLeftrightarrow", !0);
A(C, X, J, "△", "\\vartriangle");
A(C, X, st, "ℏ", "\\hslash");
A(C, X, st, "▽", "\\triangledown");
A(C, X, st, "◊", "\\lozenge");
A(C, X, st, "Ⓢ", "\\circledS");
A(C, X, st, "®", "\\circledR");
A(Tt, X, st, "®", "\\circledR");
A(C, X, st, "∡", "\\measuredangle", !0);
A(C, X, st, "∄", "\\nexists");
A(C, X, st, "℧", "\\mho");
A(C, X, st, "Ⅎ", "\\Finv", !0);
A(C, X, st, "⅁", "\\Game", !0);
A(C, X, st, "‵", "\\backprime");
A(C, X, st, "▲", "\\blacktriangle");
A(C, X, st, "▼", "\\blacktriangledown");
A(C, X, st, "■", "\\blacksquare");
A(C, X, st, "⧫", "\\blacklozenge");
A(C, X, st, "★", "\\bigstar");
A(C, X, st, "∢", "\\sphericalangle", !0);
A(C, X, st, "∁", "\\complement", !0);
A(C, X, st, "ð", "\\eth", !0);
A(Tt, M, st, "ð", "ð");
A(C, X, st, "╱", "\\diagup");
A(C, X, st, "╲", "\\diagdown");
A(C, X, st, "□", "\\square");
A(C, X, st, "□", "\\Box");
A(C, X, st, "◊", "\\Diamond");
A(C, X, st, "¥", "\\yen", !0);
A(Tt, X, st, "¥", "\\yen", !0);
A(C, X, st, "✓", "\\checkmark", !0);
A(Tt, X, st, "✓", "\\checkmark");
A(C, X, st, "ℶ", "\\beth", !0);
A(C, X, st, "ℸ", "\\daleth", !0);
A(C, X, st, "ℷ", "\\gimel", !0);
A(C, X, st, "ϝ", "\\digamma", !0);
A(C, X, st, "ϰ", "\\varkappa");
A(C, X, ur, "┌", "\\@ulcorner", !0);
A(C, X, ws, "┐", "\\@urcorner", !0);
A(C, X, ur, "└", "\\@llcorner", !0);
A(C, X, ws, "┘", "\\@lrcorner", !0);
A(C, X, J, "≦", "\\leqq", !0);
A(C, X, J, "⩽", "\\leqslant", !0);
A(C, X, J, "⪕", "\\eqslantless", !0);
A(C, X, J, "≲", "\\lesssim", !0);
A(C, X, J, "⪅", "\\lessapprox", !0);
A(C, X, J, "≊", "\\approxeq", !0);
A(C, X, zt, "⋖", "\\lessdot");
A(C, X, J, "⋘", "\\lll", !0);
A(C, X, J, "≶", "\\lessgtr", !0);
A(C, X, J, "⋚", "\\lesseqgtr", !0);
A(C, X, J, "⪋", "\\lesseqqgtr", !0);
A(C, X, J, "≑", "\\doteqdot");
A(C, X, J, "≓", "\\risingdotseq", !0);
A(C, X, J, "≒", "\\fallingdotseq", !0);
A(C, X, J, "∽", "\\backsim", !0);
A(C, X, J, "⋍", "\\backsimeq", !0);
A(C, X, J, "⫅", "\\subseteqq", !0);
A(C, X, J, "⋐", "\\Subset", !0);
A(C, X, J, "⊏", "\\sqsubset", !0);
A(C, X, J, "≼", "\\preccurlyeq", !0);
A(C, X, J, "⋞", "\\curlyeqprec", !0);
A(C, X, J, "≾", "\\precsim", !0);
A(C, X, J, "⪷", "\\precapprox", !0);
A(C, X, J, "⊲", "\\vartriangleleft");
A(C, X, J, "⊴", "\\trianglelefteq");
A(C, X, J, "⊨", "\\vDash", !0);
A(C, X, J, "⊪", "\\Vvdash", !0);
A(C, X, J, "⌣", "\\smallsmile");
A(C, X, J, "⌢", "\\smallfrown");
A(C, X, J, "≏", "\\bumpeq", !0);
A(C, X, J, "≎", "\\Bumpeq", !0);
A(C, X, J, "≧", "\\geqq", !0);
A(C, X, J, "⩾", "\\geqslant", !0);
A(C, X, J, "⪖", "\\eqslantgtr", !0);
A(C, X, J, "≳", "\\gtrsim", !0);
A(C, X, J, "⪆", "\\gtrapprox", !0);
A(C, X, zt, "⋗", "\\gtrdot");
A(C, X, J, "⋙", "\\ggg", !0);
A(C, X, J, "≷", "\\gtrless", !0);
A(C, X, J, "⋛", "\\gtreqless", !0);
A(C, X, J, "⪌", "\\gtreqqless", !0);
A(C, X, J, "≖", "\\eqcirc", !0);
A(C, X, J, "≗", "\\circeq", !0);
A(C, X, J, "≜", "\\triangleq", !0);
A(C, X, J, "∼", "\\thicksim");
A(C, X, J, "≈", "\\thickapprox");
A(C, X, J, "⫆", "\\supseteqq", !0);
A(C, X, J, "⋑", "\\Supset", !0);
A(C, X, J, "⊐", "\\sqsupset", !0);
A(C, X, J, "≽", "\\succcurlyeq", !0);
A(C, X, J, "⋟", "\\curlyeqsucc", !0);
A(C, X, J, "≿", "\\succsim", !0);
A(C, X, J, "⪸", "\\succapprox", !0);
A(C, X, J, "⊳", "\\vartriangleright");
A(C, X, J, "⊵", "\\trianglerighteq");
A(C, X, J, "⊩", "\\Vdash", !0);
A(C, X, J, "∣", "\\shortmid");
A(C, X, J, "∥", "\\shortparallel");
A(C, X, J, "≬", "\\between", !0);
A(C, X, J, "⋔", "\\pitchfork", !0);
A(C, X, J, "∝", "\\varpropto");
A(C, X, J, "◀", "\\blacktriangleleft");
A(C, X, J, "∴", "\\therefore", !0);
A(C, X, J, "∍", "\\backepsilon");
A(C, X, J, "▶", "\\blacktriangleright");
A(C, X, J, "∵", "\\because", !0);
A(C, X, J, "⋘", "\\llless");
A(C, X, J, "⋙", "\\gggtr");
A(C, X, zt, "⊲", "\\lhd");
A(C, X, zt, "⊳", "\\rhd");
A(C, X, J, "≂", "\\eqsim", !0);
A(C, M, J, "⋈", "\\Join");
A(C, X, J, "≑", "\\Doteq", !0);
A(C, X, zt, "∔", "\\dotplus", !0);
A(C, X, zt, "∖", "\\smallsetminus");
A(C, X, zt, "⋒", "\\Cap", !0);
A(C, X, zt, "⋓", "\\Cup", !0);
A(C, X, zt, "⩞", "\\doublebarwedge", !0);
A(C, X, zt, "⊟", "\\boxminus", !0);
A(C, X, zt, "⊞", "\\boxplus", !0);
A(C, X, zt, "⋇", "\\divideontimes", !0);
A(C, X, zt, "⋉", "\\ltimes", !0);
A(C, X, zt, "⋊", "\\rtimes", !0);
A(C, X, zt, "⋋", "\\leftthreetimes", !0);
A(C, X, zt, "⋌", "\\rightthreetimes", !0);
A(C, X, zt, "⋏", "\\curlywedge", !0);
A(C, X, zt, "⋎", "\\curlyvee", !0);
A(C, X, zt, "⊝", "\\circleddash", !0);
A(C, X, zt, "⊛", "\\circledast", !0);
A(C, X, zt, "⋅", "\\centerdot");
A(C, X, zt, "⊺", "\\intercal", !0);
A(C, X, zt, "⋒", "\\doublecap");
A(C, X, zt, "⋓", "\\doublecup");
A(C, X, zt, "⊠", "\\boxtimes", !0);
A(C, X, J, "⇢", "\\dashrightarrow", !0);
A(C, X, J, "⇠", "\\dashleftarrow", !0);
A(C, X, J, "⇇", "\\leftleftarrows", !0);
A(C, X, J, "⇆", "\\leftrightarrows", !0);
A(C, X, J, "⇚", "\\Lleftarrow", !0);
A(C, X, J, "↞", "\\twoheadleftarrow", !0);
A(C, X, J, "↢", "\\leftarrowtail", !0);
A(C, X, J, "↫", "\\looparrowleft", !0);
A(C, X, J, "⇋", "\\leftrightharpoons", !0);
A(C, X, J, "↶", "\\curvearrowleft", !0);
A(C, X, J, "↺", "\\circlearrowleft", !0);
A(C, X, J, "↰", "\\Lsh", !0);
A(C, X, J, "⇈", "\\upuparrows", !0);
A(C, X, J, "↿", "\\upharpoonleft", !0);
A(C, X, J, "⇃", "\\downharpoonleft", !0);
A(C, M, J, "⊶", "\\origof", !0);
A(C, M, J, "⊷", "\\imageof", !0);
A(C, X, J, "⊸", "\\multimap", !0);
A(C, X, J, "↭", "\\leftrightsquigarrow", !0);
A(C, X, J, "⇉", "\\rightrightarrows", !0);
A(C, X, J, "⇄", "\\rightleftarrows", !0);
A(C, X, J, "↠", "\\twoheadrightarrow", !0);
A(C, X, J, "↣", "\\rightarrowtail", !0);
A(C, X, J, "↬", "\\looparrowright", !0);
A(C, X, J, "↷", "\\curvearrowright", !0);
A(C, X, J, "↻", "\\circlearrowright", !0);
A(C, X, J, "↱", "\\Rsh", !0);
A(C, X, J, "⇊", "\\downdownarrows", !0);
A(C, X, J, "↾", "\\upharpoonright", !0);
A(C, X, J, "⇂", "\\downharpoonright", !0);
A(C, X, J, "⇝", "\\rightsquigarrow", !0);
A(C, X, J, "⇝", "\\leadsto");
A(C, X, J, "⇛", "\\Rrightarrow", !0);
A(C, X, J, "↾", "\\restriction");
A(C, M, st, "‘", "`");
A(C, M, st, "$", "\\$");
A(Tt, M, st, "$", "\\$");
A(Tt, M, st, "$", "\\textdollar");
A(C, M, st, "%", "\\%");
A(Tt, M, st, "%", "\\%");
A(C, M, st, "_", "\\_");
A(Tt, M, st, "_", "\\_");
A(Tt, M, st, "_", "\\textunderscore");
A(C, M, st, "∠", "\\angle", !0);
A(C, M, st, "∞", "\\infty", !0);
A(C, M, st, "′", "\\prime");
A(C, M, st, "△", "\\triangle");
A(C, M, st, "Γ", "\\Gamma", !0);
A(C, M, st, "Δ", "\\Delta", !0);
A(C, M, st, "Θ", "\\Theta", !0);
A(C, M, st, "Λ", "\\Lambda", !0);
A(C, M, st, "Ξ", "\\Xi", !0);
A(C, M, st, "Π", "\\Pi", !0);
A(C, M, st, "Σ", "\\Sigma", !0);
A(C, M, st, "Υ", "\\Upsilon", !0);
A(C, M, st, "Φ", "\\Phi", !0);
A(C, M, st, "Ψ", "\\Psi", !0);
A(C, M, st, "Ω", "\\Omega", !0);
A(C, M, st, "A", "Α");
A(C, M, st, "B", "Β");
A(C, M, st, "E", "Ε");
A(C, M, st, "Z", "Ζ");
A(C, M, st, "H", "Η");
A(C, M, st, "I", "Ι");
A(C, M, st, "K", "Κ");
A(C, M, st, "M", "Μ");
A(C, M, st, "N", "Ν");
A(C, M, st, "O", "Ο");
A(C, M, st, "P", "Ρ");
A(C, M, st, "T", "Τ");
A(C, M, st, "X", "Χ");
A(C, M, st, "¬", "\\neg", !0);
A(C, M, st, "¬", "\\lnot");
A(C, M, st, "⊤", "\\top");
A(C, M, st, "⊥", "\\bot");
A(C, M, st, "∅", "\\emptyset");
A(C, X, st, "∅", "\\varnothing");
A(C, M, ie, "α", "\\alpha", !0);
A(C, M, ie, "β", "\\beta", !0);
A(C, M, ie, "γ", "\\gamma", !0);
A(C, M, ie, "δ", "\\delta", !0);
A(C, M, ie, "ϵ", "\\epsilon", !0);
A(C, M, ie, "ζ", "\\zeta", !0);
A(C, M, ie, "η", "\\eta", !0);
A(C, M, ie, "θ", "\\theta", !0);
A(C, M, ie, "ι", "\\iota", !0);
A(C, M, ie, "κ", "\\kappa", !0);
A(C, M, ie, "λ", "\\lambda", !0);
A(C, M, ie, "μ", "\\mu", !0);
A(C, M, ie, "ν", "\\nu", !0);
A(C, M, ie, "ξ", "\\xi", !0);
A(C, M, ie, "ο", "\\omicron", !0);
A(C, M, ie, "π", "\\pi", !0);
A(C, M, ie, "ρ", "\\rho", !0);
A(C, M, ie, "σ", "\\sigma", !0);
A(C, M, ie, "τ", "\\tau", !0);
A(C, M, ie, "υ", "\\upsilon", !0);
A(C, M, ie, "ϕ", "\\phi", !0);
A(C, M, ie, "χ", "\\chi", !0);
A(C, M, ie, "ψ", "\\psi", !0);
A(C, M, ie, "ω", "\\omega", !0);
A(C, M, ie, "ε", "\\varepsilon", !0);
A(C, M, ie, "ϑ", "\\vartheta", !0);
A(C, M, ie, "ϖ", "\\varpi", !0);
A(C, M, ie, "ϱ", "\\varrho", !0);
A(C, M, ie, "ς", "\\varsigma", !0);
A(C, M, ie, "φ", "\\varphi", !0);
A(C, M, zt, "∗", "*", !0);
A(C, M, zt, "+", "+");
A(C, M, zt, "−", "-", !0);
A(C, M, zt, "⋅", "\\cdot", !0);
A(C, M, zt, "∘", "\\circ", !0);
A(C, M, zt, "÷", "\\div", !0);
A(C, M, zt, "±", "\\pm", !0);
A(C, M, zt, "×", "\\times", !0);
A(C, M, zt, "∩", "\\cap", !0);
A(C, M, zt, "∪", "\\cup", !0);
A(C, M, zt, "∖", "\\setminus", !0);
A(C, M, zt, "∧", "\\land");
A(C, M, zt, "∨", "\\lor");
A(C, M, zt, "∧", "\\wedge", !0);
A(C, M, zt, "∨", "\\vee", !0);
A(C, M, st, "√", "\\surd");
A(C, M, ur, "⟨", "\\langle", !0);
A(C, M, ur, "∣", "\\lvert");
A(C, M, ur, "∥", "\\lVert");
A(C, M, ws, "?", "?");
A(C, M, ws, "!", "!");
A(C, M, ws, "⟩", "\\rangle", !0);
A(C, M, ws, "∣", "\\rvert");
A(C, M, ws, "∥", "\\rVert");
A(C, M, J, "=", "=");
A(C, M, J, ":", ":");
A(C, M, J, "≈", "\\approx", !0);
A(C, M, J, "≅", "\\cong", !0);
A(C, M, J, "≥", "\\ge");
A(C, M, J, "≥", "\\geq", !0);
A(C, M, J, "←", "\\gets");
A(C, M, J, ">", "\\gt", !0);
A(C, M, J, "∈", "\\in", !0);
A(C, M, J, "", "\\@not");
A(C, M, J, "⊂", "\\subset", !0);
A(C, M, J, "⊃", "\\supset", !0);
A(C, M, J, "⊆", "\\subseteq", !0);
A(C, M, J, "⊇", "\\supseteq", !0);
A(C, X, J, "⊈", "\\nsubseteq", !0);
A(C, X, J, "⊉", "\\nsupseteq", !0);
A(C, M, J, "⊨", "\\models");
A(C, M, J, "←", "\\leftarrow", !0);
A(C, M, J, "≤", "\\le");
A(C, M, J, "≤", "\\leq", !0);
A(C, M, J, "<", "\\lt", !0);
A(C, M, J, "→", "\\rightarrow", !0);
A(C, M, J, "→", "\\to");
A(C, X, J, "≱", "\\ngeq", !0);
A(C, X, J, "≰", "\\nleq", !0);
A(C, M, Zl, " ", "\\ ");
A(C, M, Zl, " ", "\\space");
A(C, M, Zl, " ", "\\nobreakspace");
A(Tt, M, Zl, " ", "\\ ");
A(Tt, M, Zl, " ", " ");
A(Tt, M, Zl, " ", "\\space");
A(Tt, M, Zl, " ", "\\nobreakspace");
A(C, M, Zl, null, "\\nobreak");
A(C, M, Zl, null, "\\allowbreak");
A(C, M, X4, ",", ",");
A(C, M, X4, ";", ";");
A(C, X, zt, "⊼", "\\barwedge", !0);
A(C, X, zt, "⊻", "\\veebar", !0);
A(C, M, zt, "⊙", "\\odot", !0);
A(C, M, zt, "⊕", "\\oplus", !0);
A(C, M, zt, "⊗", "\\otimes", !0);
A(C, M, st, "∂", "\\partial", !0);
A(C, M, zt, "⊘", "\\oslash", !0);
A(C, X, zt, "⊚", "\\circledcirc", !0);
A(C, X, zt, "⊡", "\\boxdot", !0);
A(C, M, zt, "△", "\\bigtriangleup");
A(C, M, zt, "▽", "\\bigtriangledown");
A(C, M, zt, "†", "\\dagger");
A(C, M, zt, "⋄", "\\diamond");
A(C, M, zt, "⋆", "\\star");
A(C, M, zt, "◃", "\\triangleleft");
A(C, M, zt, "▹", "\\triangleright");
A(C, M, ur, "{", "\\{");
A(Tt, M, st, "{", "\\{");
A(Tt, M, st, "{", "\\textbraceleft");
A(C, M, ws, "}", "\\}");
A(Tt, M, st, "}", "\\}");
A(Tt, M, st, "}", "\\textbraceright");
A(C, M, ur, "{", "\\lbrace");
A(C, M, ws, "}", "\\rbrace");
A(C, M, ur, "[", "\\lbrack", !0);
A(Tt, M, st, "[", "\\lbrack", !0);
A(C, M, ws, "]", "\\rbrack", !0);
A(Tt, M, st, "]", "\\rbrack", !0);
A(C, M, ur, "(", "\\lparen", !0);
A(C, M, ws, ")", "\\rparen", !0);
A(Tt, M, st, "<", "\\textless", !0);
A(Tt, M, st, ">", "\\textgreater", !0);
A(C, M, ur, "⌊", "\\lfloor", !0);
A(C, M, ws, "⌋", "\\rfloor", !0);
A(C, M, ur, "⌈", "\\lceil", !0);
A(C, M, ws, "⌉", "\\rceil", !0);
A(C, M, st, "\\", "\\backslash");
A(C, M, st, "∣", "|");
A(C, M, st, "∣", "\\vert");
A(Tt, M, st, "|", "\\textbar", !0);
A(C, M, st, "∥", "\\|");
A(C, M, st, "∥", "\\Vert");
A(Tt, M, st, "∥", "\\textbardbl");
A(Tt, M, st, "~", "\\textasciitilde");
A(Tt, M, st, "\\", "\\textbackslash");
A(Tt, M, st, "^", "\\textasciicircum");
A(C, M, J, "↑", "\\uparrow", !0);
A(C, M, J, "⇑", "\\Uparrow", !0);
A(C, M, J, "↓", "\\downarrow", !0);
A(C, M, J, "⇓", "\\Downarrow", !0);
A(C, M, J, "↕", "\\updownarrow", !0);
A(C, M, J, "⇕", "\\Updownarrow", !0);
A(C, M, Ki, "∐", "\\coprod");
A(C, M, Ki, "⋁", "\\bigvee");
A(C, M, Ki, "⋀", "\\bigwedge");
A(C, M, Ki, "⨄", "\\biguplus");
A(C, M, Ki, "⋂", "\\bigcap");
A(C, M, Ki, "⋃", "\\bigcup");
A(C, M, Ki, "∫", "\\int");
A(C, M, Ki, "∫", "\\intop");
A(C, M, Ki, "∬", "\\iint");
A(C, M, Ki, "∭", "\\iiint");
A(C, M, Ki, "∏", "\\prod");
A(C, M, Ki, "∑", "\\sum");
A(C, M, Ki, "⨂", "\\bigotimes");
A(C, M, Ki, "⨁", "\\bigoplus");
A(C, M, Ki, "⨀", "\\bigodot");
A(C, M, Ki, "∮", "\\oint");
A(C, M, Ki, "∯", "\\oiint");
A(C, M, Ki, "∰", "\\oiiint");
A(C, M, Ki, "⨆", "\\bigsqcup");
A(C, M, Ki, "∫", "\\smallint");
A(Tt, M, bf, "…", "\\textellipsis");
A(C, M, bf, "…", "\\mathellipsis");
A(Tt, M, bf, "…", "\\ldots", !0);
A(C, M, bf, "…", "\\ldots", !0);
A(C, M, bf, "⋯", "\\@cdots", !0);
A(C, M, bf, "⋱", "\\ddots", !0);
A(C, M, st, "⋮", "\\varvdots");
A(Tt, M, st, "⋮", "\\varvdots");
A(C, M, wi, "ˊ", "\\acute");
A(C, M, wi, "ˋ", "\\grave");
A(C, M, wi, "¨", "\\ddot");
A(C, M, wi, "~", "\\tilde");
A(C, M, wi, "ˉ", "\\bar");
A(C, M, wi, "˘", "\\breve");
A(C, M, wi, "ˇ", "\\check");
A(C, M, wi, "^", "\\hat");
A(C, M, wi, "⃗", "\\vec");
A(C, M, wi, "˙", "\\dot");
A(C, M, wi, "˚", "\\mathring");
A(C, M, ie, "", "\\@imath");
A(C, M, ie, "", "\\@jmath");
A(C, M, st, "ı", "ı");
A(C, M, st, "ȷ", "ȷ");
A(Tt, M, st, "ı", "\\i", !0);
A(Tt, M, st, "ȷ", "\\j", !0);
A(Tt, M, st, "ß", "\\ss", !0);
A(Tt, M, st, "æ", "\\ae", !0);
A(Tt, M, st, "œ", "\\oe", !0);
A(Tt, M, st, "ø", "\\o", !0);
A(Tt, M, st, "Æ", "\\AE", !0);
A(Tt, M, st, "Œ", "\\OE", !0);
A(Tt, M, st, "Ø", "\\O", !0);
A(Tt, M, wi, "ˊ", "\\'");
A(Tt, M, wi, "ˋ", "\\`");
A(Tt, M, wi, "ˆ", "\\^");
A(Tt, M, wi, "˜", "\\~");
A(Tt, M, wi, "ˉ", "\\=");
A(Tt, M, wi, "˘", "\\u");
A(Tt, M, wi, "˙", "\\.");
A(Tt, M, wi, "¸", "\\c");
A(Tt, M, wi, "˚", "\\r");
A(Tt, M, wi, "ˇ", "\\v");
A(Tt, M, wi, "¨", '\\"');
A(Tt, M, wi, "˝", "\\H");
A(Tt, M, wi, "◯", "\\textcircled");
var vF = {
  "--": !0,
  "---": !0,
  "``": !0,
  "''": !0
};
A(Tt, M, st, "–", "--", !0);
A(Tt, M, st, "–", "\\textendash");
A(Tt, M, st, "—", "---", !0);
A(Tt, M, st, "—", "\\textemdash");
A(Tt, M, st, "‘", "`", !0);
A(Tt, M, st, "‘", "\\textquoteleft");
A(Tt, M, st, "’", "'", !0);
A(Tt, M, st, "’", "\\textquoteright");
A(Tt, M, st, "“", "``", !0);
A(Tt, M, st, "“", "\\textquotedblleft");
A(Tt, M, st, "”", "''", !0);
A(Tt, M, st, "”", "\\textquotedblright");
A(C, M, st, "°", "\\degree", !0);
A(Tt, M, st, "°", "\\degree");
A(Tt, M, st, "°", "\\textdegree", !0);
A(C, M, st, "£", "\\pounds");
A(C, M, st, "£", "\\mathsterling", !0);
A(Tt, M, st, "£", "\\pounds");
A(Tt, M, st, "£", "\\textsterling", !0);
A(C, X, st, "✠", "\\maltese");
A(Tt, X, st, "✠", "\\maltese");
var Ck = '0123456789/@."';
for (var J6 = 0; J6 < Ck.length; J6++) {
  var Ek = Ck.charAt(J6);
  A(C, M, st, Ek, Ek);
}
var Dk = '0123456789!@*()-=+";:?/.,';
for (var Q6 = 0; Q6 < Dk.length; Q6++) {
  var Tk = Dk.charAt(Q6);
  A(Tt, M, st, Tk, Tk);
}
var P3 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz";
for (var t7 = 0; t7 < P3.length; t7++) {
  var p5 = P3.charAt(t7);
  A(C, M, ie, p5, p5), A(Tt, M, st, p5, p5);
}
A(C, X, st, "C", "ℂ");
A(Tt, X, st, "C", "ℂ");
A(C, X, st, "H", "ℍ");
A(Tt, X, st, "H", "ℍ");
A(C, X, st, "N", "ℕ");
A(Tt, X, st, "N", "ℕ");
A(C, X, st, "P", "ℙ");
A(Tt, X, st, "P", "ℙ");
A(C, X, st, "Q", "ℚ");
A(Tt, X, st, "Q", "ℚ");
A(C, X, st, "R", "ℝ");
A(Tt, X, st, "R", "ℝ");
A(C, X, st, "Z", "ℤ");
A(Tt, X, st, "Z", "ℤ");
A(C, M, ie, "h", "ℎ");
A(Tt, M, ie, "h", "ℎ");
var ce = "";
for (var Qn = 0; Qn < P3.length; Qn++) {
  var Di = P3.charAt(Qn);
  ce = String.fromCharCode(55349, 56320 + Qn), A(C, M, ie, Di, ce), A(Tt, M, st, Di, ce), ce = String.fromCharCode(55349, 56372 + Qn), A(C, M, ie, Di, ce), A(Tt, M, st, Di, ce), ce = String.fromCharCode(55349, 56424 + Qn), A(C, M, ie, Di, ce), A(Tt, M, st, Di, ce), ce = String.fromCharCode(55349, 56580 + Qn), A(C, M, ie, Di, ce), A(Tt, M, st, Di, ce), ce = String.fromCharCode(55349, 56684 + Qn), A(C, M, ie, Di, ce), A(Tt, M, st, Di, ce), ce = String.fromCharCode(55349, 56736 + Qn), A(C, M, ie, Di, ce), A(Tt, M, st, Di, ce), ce = String.fromCharCode(55349, 56788 + Qn), A(C, M, ie, Di, ce), A(Tt, M, st, Di, ce), ce = String.fromCharCode(55349, 56840 + Qn), A(C, M, ie, Di, ce), A(Tt, M, st, Di, ce), ce = String.fromCharCode(55349, 56944 + Qn), A(C, M, ie, Di, ce), A(Tt, M, st, Di, ce), Qn < 26 && (ce = String.fromCharCode(55349, 56632 + Qn), A(C, M, ie, Di, ce), A(Tt, M, st, Di, ce), ce = String.fromCharCode(55349, 56476 + Qn), A(C, M, ie, Di, ce), A(Tt, M, st, Di, ce));
}
ce = "𝕜";
A(C, M, ie, "k", ce);
A(Tt, M, st, "k", ce);
for (var M0 = 0; M0 < 10; M0++) {
  var sc = M0.toString();
  ce = String.fromCharCode(55349, 57294 + M0), A(C, M, ie, sc, ce), A(Tt, M, st, sc, ce), ce = String.fromCharCode(55349, 57314 + M0), A(C, M, ie, sc, ce), A(Tt, M, st, sc, ce), ce = String.fromCharCode(55349, 57324 + M0), A(C, M, ie, sc, ce), A(Tt, M, st, sc, ce), ce = String.fromCharCode(55349, 57334 + M0), A(C, M, ie, sc, ce), A(Tt, M, st, sc, ce);
}
var Fk = "ÐÞþ";
for (var e7 = 0; e7 < Fk.length; e7++) {
  var m5 = Fk.charAt(e7);
  A(C, M, ie, m5, m5), A(Tt, M, st, m5, m5);
}
var g5 = [
  ["mathbf", "textbf", "Main-Bold"],
  // A-Z bold upright
  ["mathbf", "textbf", "Main-Bold"],
  // a-z bold upright
  ["mathnormal", "textit", "Math-Italic"],
  // A-Z italic
  ["mathnormal", "textit", "Math-Italic"],
  // a-z italic
  ["boldsymbol", "boldsymbol", "Main-BoldItalic"],
  // A-Z bold italic
  ["boldsymbol", "boldsymbol", "Main-BoldItalic"],
  // a-z bold italic
  // Map fancy A-Z letters to script, not calligraphic.
  // This aligns with unicode-math and math fonts (except Cambria Math).
  ["mathscr", "textscr", "Script-Regular"],
  // A-Z script
  ["", "", ""],
  // a-z script.  No font
  ["", "", ""],
  // A-Z bold script. No font
  ["", "", ""],
  // a-z bold script. No font
  ["mathfrak", "textfrak", "Fraktur-Regular"],
  // A-Z Fraktur
  ["mathfrak", "textfrak", "Fraktur-Regular"],
  // a-z Fraktur
  ["mathbb", "textbb", "AMS-Regular"],
  // A-Z double-struck
  ["mathbb", "textbb", "AMS-Regular"],
  // k double-struck
  // Note that we are using a bold font, but font metrics for regular Fraktur.
  ["mathboldfrak", "textboldfrak", "Fraktur-Regular"],
  // A-Z bold Fraktur
  ["mathboldfrak", "textboldfrak", "Fraktur-Regular"],
  // a-z bold Fraktur
  ["mathsf", "textsf", "SansSerif-Regular"],
  // A-Z sans-serif
  ["mathsf", "textsf", "SansSerif-Regular"],
  // a-z sans-serif
  ["mathboldsf", "textboldsf", "SansSerif-Bold"],
  // A-Z bold sans-serif
  ["mathboldsf", "textboldsf", "SansSerif-Bold"],
  // a-z bold sans-serif
  ["mathitsf", "textitsf", "SansSerif-Italic"],
  // A-Z italic sans-serif
  ["mathitsf", "textitsf", "SansSerif-Italic"],
  // a-z italic sans-serif
  ["", "", ""],
  // A-Z bold italic sans. No font
  ["", "", ""],
  // a-z bold italic sans. No font
  ["mathtt", "texttt", "Typewriter-Regular"],
  // A-Z monospace
  ["mathtt", "texttt", "Typewriter-Regular"]
  // a-z monospace
], Ik = [
  ["mathbf", "textbf", "Main-Bold"],
  // 0-9 bold
  ["", "", ""],
  // 0-9 double-struck. No KaTeX font.
  ["mathsf", "textsf", "SansSerif-Regular"],
  // 0-9 sans-serif
  ["mathboldsf", "textboldsf", "SansSerif-Bold"],
  // 0-9 bold sans-serif
  ["mathtt", "texttt", "Typewriter-Regular"]
  // 0-9 monospace
], bV = function(t, e) {
  var n = t.charCodeAt(0), s = t.charCodeAt(1), r = (n - 55296) * 1024 + (s - 56320) + 65536, a = e === "math" ? 0 : 1;
  if (119808 <= r && r < 120484) {
    var o = Math.floor((r - 119808) / 26);
    return [g5[o][2], g5[o][a]];
  } else if (120782 <= r && r <= 120831) {
    var l = Math.floor((r - 120782) / 10);
    return [Ik[l][2], Ik[l][a]];
  } else {
    if (r === 120485 || r === 120486)
      return [g5[0][2], g5[0][a]];
    if (120486 < r && r < 120782)
      return ["", ""];
    throw new te("Unsupported character: " + t);
  }
}, Y4 = function(t, e, n) {
  return zi[n][t] && zi[n][t].replace && (t = zi[n][t].replace), {
    value: t,
    metrics: Bw(t, e, n)
  };
}, xa = function(t, e, n, s, r) {
  var a = Y4(t, e, n), o = a.metrics;
  t = a.value;
  var l;
  if (o) {
    var c = o.italic;
    (n === "text" || s && s.font === "mathit") && (c = 0), l = new Io(t, o.height, o.depth, c, o.skew, o.width, r);
  } else
    typeof console < "u" && console.warn("No character metrics " + ("for '" + t + "' in style '" + e + "' and mode '" + n + "'")), l = new Io(t, 0, 0, 0, 0, 0, r);
  if (s) {
    l.maxFontSize = s.sizeMultiplier, s.style.isTight() && l.classes.push("mtight");
    var h = s.getColor();
    h && (l.style.color = h);
  }
  return l;
}, yV = function(t, e, n, s) {
  return s === void 0 && (s = []), n.font === "boldsymbol" && Y4(t, "Main-Bold", e).metrics ? xa(t, "Main-Bold", e, n, s.concat(["mathbf"])) : t === "\\" || zi[e][t].font === "main" ? xa(t, "Main-Regular", e, n, s) : xa(t, "AMS-Regular", e, n, s.concat(["amsrm"]));
}, wV = function(t, e, n, s, r) {
  return r !== "textord" && Y4(t, "Math-BoldItalic", e).metrics ? {
    fontName: "Math-BoldItalic",
    fontClass: "boldsymbol"
  } : {
    fontName: "Main-Bold",
    fontClass: "mathbf"
  };
}, vV = function(t, e, n) {
  var s = t.mode, r = t.text, a = ["mord"], o = s === "math" || s === "text" && e.font, l = o ? e.font : e.fontFamily, c = "", h = "";
  if (r.charCodeAt(0) === 55349 && ([c, h] = bV(r, s)), c.length > 0)
    return xa(r, c, s, e, a.concat(h));
  if (l) {
    var u, f;
    if (l === "boldsymbol") {
      var d = wV(r, s, e, a, n);
      u = d.fontName, f = [d.fontClass];
    } else o ? (u = kF[l].fontName, f = [l]) : (u = b5(l, e.fontWeight, e.fontShape), f = [l, e.fontWeight, e.fontShape]);
    if (Y4(r, u, s).metrics)
      return xa(r, u, s, e, a.concat(f));
    if (vF.hasOwnProperty(r) && u.slice(0, 10) === "Typewriter") {
      for (var p = [], g = 0; g < r.length; g++)
        p.push(xa(r[g], u, s, e, a.concat(f)));
      return xF(p);
    }
  }
  if (n === "mathord")
    return xa(r, "Math-Italic", s, e, a.concat(["mathnormal"]));
  if (n === "textord") {
    var b = zi[s][r] && zi[s][r].font;
    if (b === "ams") {
      var y = b5("amsrm", e.fontWeight, e.fontShape);
      return xa(r, y, s, e, a.concat("amsrm", e.fontWeight, e.fontShape));
    } else if (b === "main" || !b) {
      var v = b5("textrm", e.fontWeight, e.fontShape);
      return xa(r, v, s, e, a.concat(e.fontWeight, e.fontShape));
    } else {
      var w = b5(b, e.fontWeight, e.fontShape);
      return xa(r, w, s, e, a.concat(w, e.fontWeight, e.fontShape));
    }
  } else
    throw new Error("unexpected type: " + n + " in makeOrd");
}, _V = (i, t) => {
  if (p0(i.classes) !== p0(t.classes) || i.skew !== t.skew || i.maxFontSize !== t.maxFontSize)
    return !1;
  if (i.classes.length === 1) {
    var e = i.classes[0];
    if (e === "mbin" || e === "mord")
      return !1;
  }
  for (var n in i.style)
    if (i.style.hasOwnProperty(n) && i.style[n] !== t.style[n])
      return !1;
  for (var s in t.style)
    if (t.style.hasOwnProperty(s) && i.style[s] !== t.style[s])
      return !1;
  return !0;
}, xV = (i) => {
  for (var t = 0; t < i.length - 1; t++) {
    var e = i[t], n = i[t + 1];
    e instanceof Io && n instanceof Io && _V(e, n) && (e.text += n.text, e.height = Math.max(e.height, n.height), e.depth = Math.max(e.depth, n.depth), e.italic = n.italic, i.splice(t + 1, 1), t--);
  }
  return i;
}, Pw = function(t) {
  for (var e = 0, n = 0, s = 0, r = 0; r < t.children.length; r++) {
    var a = t.children[r];
    a.height > e && (e = a.height), a.depth > n && (n = a.depth), a.maxFontSize > s && (s = a.maxFontSize);
  }
  t.height = e, t.depth = n, t.maxFontSize = s;
}, Es = function(t, e, n, s) {
  var r = new W4(t, e, n, s);
  return Pw(r), r;
}, _F = (i, t, e, n) => new W4(i, t, e, n), kV = function(t, e, n) {
  var s = Es([t], [], e);
  return s.height = Math.max(n || e.fontMetrics().defaultRuleThickness, e.minRuleThickness), s.style.borderBottomWidth = Nt(s.height), s.maxFontSize = 1, s;
}, AV = function(t, e, n, s) {
  var r = new wF(t, e, n, s);
  return Pw(r), r;
}, xF = function(t) {
  var e = new Bg(t);
  return Pw(e), e;
}, SV = function(t, e) {
  return t instanceof Bg ? Es([], [t], e) : t;
}, CV = function(t) {
  if (t.positionType === "individualShift") {
    for (var e = t.children, n = [e[0]], s = -e[0].shift - e[0].elem.depth, r = s, a = 1; a < e.length; a++) {
      var o = -e[a].shift - r - e[a].elem.depth, l = o - (e[a - 1].elem.height + e[a - 1].elem.depth);
      r = r + o, n.push({
        type: "kern",
        size: l
      }), n.push(e[a]);
    }
    return {
      children: n,
      depth: s
    };
  }
  var c;
  if (t.positionType === "top") {
    for (var h = t.positionData, u = 0; u < t.children.length; u++) {
      var f = t.children[u];
      h -= f.type === "kern" ? f.size : f.elem.height + f.elem.depth;
    }
    c = h;
  } else if (t.positionType === "bottom")
    c = -t.positionData;
  else {
    var d = t.children[0];
    if (d.type !== "elem")
      throw new Error('First child must have type "elem".');
    if (t.positionType === "shift")
      c = -d.elem.depth - t.positionData;
    else if (t.positionType === "firstBaseline")
      c = -d.elem.depth;
    else
      throw new Error("Invalid positionType " + t.positionType + ".");
  }
  return {
    children: t.children,
    depth: c
  };
}, EV = function(t, e) {
  for (var {
    children: n,
    depth: s
  } = CV(t), r = 0, a = 0; a < n.length; a++) {
    var o = n[a];
    if (o.type === "elem") {
      var l = o.elem;
      r = Math.max(r, l.maxFontSize, l.height);
    }
  }
  r += 2;
  var c = Es(["pstrut"], []);
  c.style.height = Nt(r);
  for (var h = [], u = s, f = s, d = s, p = 0; p < n.length; p++) {
    var g = n[p];
    if (g.type === "kern")
      d += g.size;
    else {
      var b = g.elem, y = g.wrapperClasses || [], v = g.wrapperStyle || {}, w = Es(y, [c, b], void 0, v);
      w.style.top = Nt(-r - d - b.depth), g.marginLeft && (w.style.marginLeft = g.marginLeft), g.marginRight && (w.style.marginRight = g.marginRight), h.push(w), d += b.height + b.depth;
    }
    u = Math.min(u, d), f = Math.max(f, d);
  }
  var _ = Es(["vlist"], h);
  _.style.height = Nt(f);
  var x;
  if (u < 0) {
    var k = Es([], []), S = Es(["vlist"], [k]);
    S.style.height = Nt(-u);
    var T = Es(["vlist-s"], [new Io("​")]);
    x = [Es(["vlist-r"], [_, T]), Es(["vlist-r"], [S])];
  } else
    x = [Es(["vlist-r"], [_])];
  var I = Es(["vlist-t"], x);
  return x.length === 2 && I.classes.push("vlist-t2"), I.height = f, I.depth = -u, I;
}, DV = (i, t) => {
  var e = Es(["mspace"], [], t), n = Ai(i, t);
  return e.style.marginRight = Nt(n), e;
}, b5 = function(t, e, n) {
  var s = "";
  switch (t) {
    case "amsrm":
      s = "AMS";
      break;
    case "textrm":
      s = "Main";
      break;
    case "textsf":
      s = "SansSerif";
      break;
    case "texttt":
      s = "Typewriter";
      break;
    default:
      s = t;
  }
  var r;
  return e === "textbf" && n === "textit" ? r = "BoldItalic" : e === "textbf" ? r = "Bold" : e === "textit" ? r = "Italic" : r = "Regular", s + "-" + r;
}, kF = {
  // styles
  mathbf: {
    variant: "bold",
    fontName: "Main-Bold"
  },
  mathrm: {
    variant: "normal",
    fontName: "Main-Regular"
  },
  textit: {
    variant: "italic",
    fontName: "Main-Italic"
  },
  mathit: {
    variant: "italic",
    fontName: "Main-Italic"
  },
  mathnormal: {
    variant: "italic",
    fontName: "Math-Italic"
  },
  mathsfit: {
    variant: "sans-serif-italic",
    fontName: "SansSerif-Italic"
  },
  // "boldsymbol" is missing because they require the use of multiple fonts:
  // Math-BoldItalic and Main-Bold.  This is handled by a special case in
  // makeOrd which ends up calling boldsymbol.
  // families
  mathbb: {
    variant: "double-struck",
    fontName: "AMS-Regular"
  },
  mathcal: {
    variant: "script",
    fontName: "Caligraphic-Regular"
  },
  mathfrak: {
    variant: "fraktur",
    fontName: "Fraktur-Regular"
  },
  mathscr: {
    variant: "script",
    fontName: "Script-Regular"
  },
  mathsf: {
    variant: "sans-serif",
    fontName: "SansSerif-Regular"
  },
  mathtt: {
    variant: "monospace",
    fontName: "Typewriter-Regular"
  }
}, AF = {
  //   path, width, height
  vec: ["vec", 0.471, 0.714],
  // values from the font glyph
  oiintSize1: ["oiintSize1", 0.957, 0.499],
  // oval to overlay the integrand
  oiintSize2: ["oiintSize2", 1.472, 0.659],
  oiiintSize1: ["oiiintSize1", 1.304, 0.499],
  oiiintSize2: ["oiiintSize2", 1.98, 0.659]
}, TV = function(t, e) {
  var [n, s, r] = AF[t], a = new E1(n), o = new m0([a], {
    width: Nt(s),
    height: Nt(r),
    // Override CSS rule `.katex svg { width: 100% }`
    style: "width:" + Nt(s),
    viewBox: "0 0 " + 1e3 * s + " " + 1e3 * r,
    preserveAspectRatio: "xMinYMin"
  }), l = _F(["overlay"], [o], e);
  return l.height = r, l.style.height = Nt(r), l.style.width = Nt(s), l;
}, pt = {
  fontMap: kF,
  makeSymbol: xa,
  mathsym: yV,
  makeSpan: Es,
  makeSvgSpan: _F,
  makeLineSpan: kV,
  makeAnchor: AV,
  makeFragment: xF,
  wrapFragment: SV,
  makeVList: EV,
  makeOrd: vV,
  makeGlue: DV,
  staticSvg: TV,
  svgData: AF,
  tryCombineChars: xV
}, xi = {
  number: 3,
  unit: "mu"
}, R0 = {
  number: 4,
  unit: "mu"
}, zo = {
  number: 5,
  unit: "mu"
}, FV = {
  mord: {
    mop: xi,
    mbin: R0,
    mrel: zo,
    minner: xi
  },
  mop: {
    mord: xi,
    mop: xi,
    mrel: zo,
    minner: xi
  },
  mbin: {
    mord: R0,
    mop: R0,
    mopen: R0,
    minner: R0
  },
  mrel: {
    mord: zo,
    mop: zo,
    mopen: zo,
    minner: zo
  },
  mopen: {},
  mclose: {
    mop: xi,
    mbin: R0,
    mrel: zo,
    minner: xi
  },
  mpunct: {
    mord: xi,
    mop: xi,
    mrel: zo,
    mopen: xi,
    mclose: xi,
    mpunct: xi,
    minner: xi
  },
  minner: {
    mord: xi,
    mop: xi,
    mbin: R0,
    mrel: zo,
    mopen: xi,
    mpunct: xi,
    minner: xi
  }
}, IV = {
  mord: {
    mop: xi
  },
  mop: {
    mord: xi,
    mop: xi
  },
  mbin: {},
  mrel: {},
  mopen: {},
  mclose: {
    mop: xi
  },
  mpunct: {},
  minner: {
    mop: xi
  }
}, SF = {}, N3 = {}, L3 = {};
function qt(i) {
  for (var {
    type: t,
    names: e,
    props: n,
    handler: s,
    htmlBuilder: r,
    mathmlBuilder: a
  } = i, o = {
    type: t,
    numArgs: n.numArgs,
    argTypes: n.argTypes,
    allowedInArgument: !!n.allowedInArgument,
    allowedInText: !!n.allowedInText,
    allowedInMath: n.allowedInMath === void 0 ? !0 : n.allowedInMath,
    numOptionalArgs: n.numOptionalArgs || 0,
    infix: !!n.infix,
    primitive: !!n.primitive,
    handler: s
  }, l = 0; l < e.length; ++l)
    SF[e[l]] = o;
  t && (r && (N3[t] = r), a && (L3[t] = a));
}
function N1(i) {
  var {
    type: t,
    htmlBuilder: e,
    mathmlBuilder: n
  } = i;
  qt({
    type: t,
    names: [],
    props: {
      numArgs: 0
    },
    handler() {
      throw new Error("Should never be called.");
    },
    htmlBuilder: e,
    mathmlBuilder: n
  });
}
var O3 = function(t) {
  return t.type === "ordgroup" && t.body.length === 1 ? t.body[0] : t;
}, qi = function(t) {
  return t.type === "ordgroup" ? t.body : [t];
}, uf = pt.makeSpan, MV = ["leftmost", "mbin", "mopen", "mrel", "mop", "mpunct"], RV = ["rightmost", "mrel", "mclose", "mpunct"], BV = {
  display: re.DISPLAY,
  text: re.TEXT,
  script: re.SCRIPT,
  scriptscript: re.SCRIPTSCRIPT
}, PV = {
  mord: "mord",
  mop: "mop",
  mbin: "mbin",
  mrel: "mrel",
  mopen: "mopen",
  mclose: "mclose",
  mpunct: "mpunct",
  minner: "minner"
}, Rn = function(t, e, n, s) {
  s === void 0 && (s = [null, null]);
  for (var r = [], a = 0; a < t.length; a++) {
    var o = qe(t[a], e);
    if (o instanceof Bg) {
      var l = o.children;
      r.push(...l);
    } else
      r.push(o);
  }
  if (pt.tryCombineChars(r), !n)
    return r;
  var c = e;
  if (t.length === 1) {
    var h = t[0];
    h.type === "sizing" ? c = e.havingSize(h.size) : h.type === "styling" && (c = e.havingStyle(BV[h.style]));
  }
  var u = uf([s[0] || "leftmost"], [], e), f = uf([s[1] || "rightmost"], [], e), d = n === "root";
  return Mk(r, (p, g) => {
    var b = g.classes[0], y = p.classes[0];
    b === "mbin" && ne.contains(RV, y) ? g.classes[0] = "mord" : y === "mbin" && ne.contains(MV, b) && (p.classes[0] = "mord");
  }, {
    node: u
  }, f, d), Mk(r, (p, g) => {
    var b = hy(g), y = hy(p), v = b && y ? p.hasClass("mtight") ? IV[b][y] : FV[b][y] : null;
    if (v)
      return pt.makeGlue(v, c);
  }, {
    node: u
  }, f, d), r;
}, Mk = function i(t, e, n, s, r) {
  s && t.push(s);
  for (var a = 0; a < t.length; a++) {
    var o = t[a], l = CF(o);
    if (l) {
      i(l.children, e, n, null, r);
      continue;
    }
    var c = !o.hasClass("mspace");
    if (c) {
      var h = e(o, n.node);
      h && (n.insertAfter ? n.insertAfter(h) : (t.unshift(h), a++));
    }
    c ? n.node = o : r && o.hasClass("newline") && (n.node = uf(["leftmost"])), n.insertAfter = /* @__PURE__ */ ((u) => (f) => {
      t.splice(u + 1, 0, f), a++;
    })(a);
  }
  s && t.pop();
}, CF = function(t) {
  return t instanceof Bg || t instanceof wF || t instanceof W4 && t.hasClass("enclosing") ? t : null;
}, NV = function i(t, e) {
  var n = CF(t);
  if (n) {
    var s = n.children;
    if (s.length) {
      if (e === "right")
        return i(s[s.length - 1], "right");
      if (e === "left")
        return i(s[0], "left");
    }
  }
  return t;
}, hy = function(t, e) {
  return t ? (e && (t = NV(t, e)), PV[t.classes[0]] || null) : null;
}, xp = function(t, e) {
  var n = ["nulldelimiter"].concat(t.baseSizingClasses());
  return uf(e.concat(n));
}, qe = function(t, e, n) {
  if (!t)
    return uf();
  if (N3[t.type]) {
    var s = N3[t.type](t, e);
    if (n && e.size !== n.size) {
      s = uf(e.sizingClasses(n), [s], e);
      var r = e.sizeMultiplier / n.sizeMultiplier;
      s.height *= r, s.depth *= r;
    }
    return s;
  } else
    throw new te("Got group of unknown type: '" + t.type + "'");
};
function EF(i) {
  return new Bg(i);
}
class Or {
  constructor(t, e, n) {
    this.type = void 0, this.attributes = void 0, this.children = void 0, this.classes = void 0, this.type = t, this.attributes = {}, this.children = e || [], this.classes = n || [];
  }
  /**
   * Sets an attribute on a MathML node. MathML depends on attributes to convey a
   * semantic content, so this is used heavily.
   */
  setAttribute(t, e) {
    this.attributes[t] = e;
  }
  /**
   * Gets an attribute on a MathML node.
   */
  getAttribute(t) {
    return this.attributes[t];
  }
  /**
   * Converts the math node into a MathML-namespaced DOM element.
   */
  toNode() {
    var t = document.createElementNS("http://www.w3.org/1998/Math/MathML", this.type);
    for (var e in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, e) && t.setAttribute(e, this.attributes[e]);
    this.classes.length > 0 && (t.className = p0(this.classes));
    for (var n = 0; n < this.children.length; n++)
      if (this.children[n] instanceof bo && this.children[n + 1] instanceof bo) {
        for (var s = this.children[n].toText() + this.children[++n].toText(); this.children[n + 1] instanceof bo; )
          s += this.children[++n].toText();
        t.appendChild(new bo(s).toNode());
      } else
        t.appendChild(this.children[n].toNode());
    return t;
  }
  /**
   * Converts the math node into an HTML markup string.
   */
  toMarkup() {
    var t = "<" + this.type;
    for (var e in this.attributes)
      Object.prototype.hasOwnProperty.call(this.attributes, e) && (t += " " + e + '="', t += ne.escape(this.attributes[e]), t += '"');
    this.classes.length > 0 && (t += ' class ="' + ne.escape(p0(this.classes)) + '"'), t += ">";
    for (var n = 0; n < this.children.length; n++)
      t += this.children[n].toMarkup();
    return t += "</" + this.type + ">", t;
  }
  /**
   * Converts the math node into a string, similar to innerText, but escaped.
   */
  toText() {
    return this.children.map((t) => t.toText()).join("");
  }
}
class bo {
  constructor(t) {
    this.text = void 0, this.text = t;
  }
  /**
   * Converts the text node into a DOM text node.
   */
  toNode() {
    return document.createTextNode(this.text);
  }
  /**
   * Converts the text node into escaped HTML markup
   * (representing the text itself).
   */
  toMarkup() {
    return ne.escape(this.toText());
  }
  /**
   * Converts the text node into a string
   * (representing the text itself).
   */
  toText() {
    return this.text;
  }
}
class LV {
  /**
   * Create a Space node with width given in CSS ems.
   */
  constructor(t) {
    this.width = void 0, this.character = void 0, this.width = t, t >= 0.05555 && t <= 0.05556 ? this.character = " " : t >= 0.1666 && t <= 0.1667 ? this.character = " " : t >= 0.2222 && t <= 0.2223 ? this.character = " " : t >= 0.2777 && t <= 0.2778 ? this.character = "  " : t >= -0.05556 && t <= -0.05555 ? this.character = " ⁣" : t >= -0.1667 && t <= -0.1666 ? this.character = " ⁣" : t >= -0.2223 && t <= -0.2222 ? this.character = " ⁣" : t >= -0.2778 && t <= -0.2777 ? this.character = " ⁣" : this.character = null;
  }
  /**
   * Converts the math node into a MathML-namespaced DOM element.
   */
  toNode() {
    if (this.character)
      return document.createTextNode(this.character);
    var t = document.createElementNS("http://www.w3.org/1998/Math/MathML", "mspace");
    return t.setAttribute("width", Nt(this.width)), t;
  }
  /**
   * Converts the math node into an HTML markup string.
   */
  toMarkup() {
    return this.character ? "<mtext>" + this.character + "</mtext>" : '<mspace width="' + Nt(this.width) + '"/>';
  }
  /**
   * Converts the math node into a string, similar to innerText.
   */
  toText() {
    return this.character ? this.character : " ";
  }
}
var Mt = {
  MathNode: Or,
  TextNode: bo,
  SpaceNode: LV,
  newDocumentFragment: EF
}, Wr = function(t, e, n) {
  return zi[e][t] && zi[e][t].replace && t.charCodeAt(0) !== 55349 && !(vF.hasOwnProperty(t) && n && (n.fontFamily && n.fontFamily.slice(4, 6) === "tt" || n.font && n.font.slice(4, 6) === "tt")) && (t = zi[e][t].replace), new Mt.TextNode(t);
}, Nw = function(t) {
  return t.length === 1 ? t[0] : new Mt.MathNode("mrow", t);
}, Lw = function(t, e) {
  if (e.fontFamily === "texttt")
    return "monospace";
  if (e.fontFamily === "textsf")
    return e.fontShape === "textit" && e.fontWeight === "textbf" ? "sans-serif-bold-italic" : e.fontShape === "textit" ? "sans-serif-italic" : e.fontWeight === "textbf" ? "bold-sans-serif" : "sans-serif";
  if (e.fontShape === "textit" && e.fontWeight === "textbf")
    return "bold-italic";
  if (e.fontShape === "textit")
    return "italic";
  if (e.fontWeight === "textbf")
    return "bold";
  var n = e.font;
  if (!n || n === "mathnormal")
    return null;
  var s = t.mode;
  if (n === "mathit")
    return "italic";
  if (n === "boldsymbol")
    return t.type === "textord" ? "bold" : "bold-italic";
  if (n === "mathbf")
    return "bold";
  if (n === "mathbb")
    return "double-struck";
  if (n === "mathsfit")
    return "sans-serif-italic";
  if (n === "mathfrak")
    return "fraktur";
  if (n === "mathscr" || n === "mathcal")
    return "script";
  if (n === "mathsf")
    return "sans-serif";
  if (n === "mathtt")
    return "monospace";
  var r = t.text;
  if (ne.contains(["\\imath", "\\jmath"], r))
    return null;
  zi[s][r] && zi[s][r].replace && (r = zi[s][r].replace);
  var a = pt.fontMap[n].fontName;
  return Bw(r, a, s) ? pt.fontMap[n].variant : null;
};
function i7(i) {
  if (!i)
    return !1;
  if (i.type === "mi" && i.children.length === 1) {
    var t = i.children[0];
    return t instanceof bo && t.text === ".";
  } else if (i.type === "mo" && i.children.length === 1 && i.getAttribute("separator") === "true" && i.getAttribute("lspace") === "0em" && i.getAttribute("rspace") === "0em") {
    var e = i.children[0];
    return e instanceof bo && e.text === ",";
  } else
    return !1;
}
var dr = function(t, e, n) {
  if (t.length === 1) {
    var s = ei(t[0], e);
    return n && s instanceof Or && s.type === "mo" && (s.setAttribute("lspace", "0em"), s.setAttribute("rspace", "0em")), [s];
  }
  for (var r = [], a, o = 0; o < t.length; o++) {
    var l = ei(t[o], e);
    if (l instanceof Or && a instanceof Or) {
      if (l.type === "mtext" && a.type === "mtext" && l.getAttribute("mathvariant") === a.getAttribute("mathvariant")) {
        a.children.push(...l.children);
        continue;
      } else if (l.type === "mn" && a.type === "mn") {
        a.children.push(...l.children);
        continue;
      } else if (i7(l) && a.type === "mn") {
        a.children.push(...l.children);
        continue;
      } else if (l.type === "mn" && i7(a))
        l.children = [...a.children, ...l.children], r.pop();
      else if ((l.type === "msup" || l.type === "msub") && l.children.length >= 1 && (a.type === "mn" || i7(a))) {
        var c = l.children[0];
        c instanceof Or && c.type === "mn" && (c.children = [...a.children, ...c.children], r.pop());
      } else if (a.type === "mi" && a.children.length === 1) {
        var h = a.children[0];
        if (h instanceof bo && h.text === "̸" && (l.type === "mo" || l.type === "mi" || l.type === "mn")) {
          var u = l.children[0];
          u instanceof bo && u.text.length > 0 && (u.text = u.text.slice(0, 1) + "̸" + u.text.slice(1), r.pop());
        }
      }
    }
    r.push(l), a = l;
  }
  return r;
}, g0 = function(t, e, n) {
  return Nw(dr(t, e, n));
}, ei = function(t, e) {
  if (!t)
    return new Mt.MathNode("mrow");
  if (L3[t.type]) {
    var n = L3[t.type](t, e);
    return n;
  } else
    throw new te("Got group of unknown type: '" + t.type + "'");
}, OV = {
  widehat: "^",
  widecheck: "ˇ",
  widetilde: "~",
  utilde: "~",
  overleftarrow: "←",
  underleftarrow: "←",
  xleftarrow: "←",
  overrightarrow: "→",
  underrightarrow: "→",
  xrightarrow: "→",
  underbrace: "⏟",
  overbrace: "⏞",
  overgroup: "⏠",
  undergroup: "⏡",
  overleftrightarrow: "↔",
  underleftrightarrow: "↔",
  xleftrightarrow: "↔",
  Overrightarrow: "⇒",
  xRightarrow: "⇒",
  overleftharpoon: "↼",
  xleftharpoonup: "↼",
  overrightharpoon: "⇀",
  xrightharpoonup: "⇀",
  xLeftarrow: "⇐",
  xLeftrightarrow: "⇔",
  xhookleftarrow: "↩",
  xhookrightarrow: "↪",
  xmapsto: "↦",
  xrightharpoondown: "⇁",
  xleftharpoondown: "↽",
  xrightleftharpoons: "⇌",
  xleftrightharpoons: "⇋",
  xtwoheadleftarrow: "↞",
  xtwoheadrightarrow: "↠",
  xlongequal: "=",
  xtofrom: "⇄",
  xrightleftarrows: "⇄",
  xrightequilibrium: "⇌",
  // Not a perfect match.
  xleftequilibrium: "⇋",
  // None better available.
  "\\cdrightarrow": "→",
  "\\cdleftarrow": "←",
  "\\cdlongequal": "="
}, $V = function(t) {
  var e = new Mt.MathNode("mo", [new Mt.TextNode(OV[t.replace(/^\\/, "")])]);
  return e.setAttribute("stretchy", "true"), e;
}, qV = {
  //   path(s), minWidth, height, align
  overrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
  overleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
  underrightarrow: [["rightarrow"], 0.888, 522, "xMaxYMin"],
  underleftarrow: [["leftarrow"], 0.888, 522, "xMinYMin"],
  xrightarrow: [["rightarrow"], 1.469, 522, "xMaxYMin"],
  "\\cdrightarrow": [["rightarrow"], 3, 522, "xMaxYMin"],
  // CD minwwidth2.5pc
  xleftarrow: [["leftarrow"], 1.469, 522, "xMinYMin"],
  "\\cdleftarrow": [["leftarrow"], 3, 522, "xMinYMin"],
  Overrightarrow: [["doublerightarrow"], 0.888, 560, "xMaxYMin"],
  xRightarrow: [["doublerightarrow"], 1.526, 560, "xMaxYMin"],
  xLeftarrow: [["doubleleftarrow"], 1.526, 560, "xMinYMin"],
  overleftharpoon: [["leftharpoon"], 0.888, 522, "xMinYMin"],
  xleftharpoonup: [["leftharpoon"], 0.888, 522, "xMinYMin"],
  xleftharpoondown: [["leftharpoondown"], 0.888, 522, "xMinYMin"],
  overrightharpoon: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
  xrightharpoonup: [["rightharpoon"], 0.888, 522, "xMaxYMin"],
  xrightharpoondown: [["rightharpoondown"], 0.888, 522, "xMaxYMin"],
  xlongequal: [["longequal"], 0.888, 334, "xMinYMin"],
  "\\cdlongequal": [["longequal"], 3, 334, "xMinYMin"],
  xtwoheadleftarrow: [["twoheadleftarrow"], 0.888, 334, "xMinYMin"],
  xtwoheadrightarrow: [["twoheadrightarrow"], 0.888, 334, "xMaxYMin"],
  overleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
  overbrace: [["leftbrace", "midbrace", "rightbrace"], 1.6, 548],
  underbrace: [["leftbraceunder", "midbraceunder", "rightbraceunder"], 1.6, 548],
  underleftrightarrow: [["leftarrow", "rightarrow"], 0.888, 522],
  xleftrightarrow: [["leftarrow", "rightarrow"], 1.75, 522],
  xLeftrightarrow: [["doubleleftarrow", "doublerightarrow"], 1.75, 560],
  xrightleftharpoons: [["leftharpoondownplus", "rightharpoonplus"], 1.75, 716],
  xleftrightharpoons: [["leftharpoonplus", "rightharpoondownplus"], 1.75, 716],
  xhookleftarrow: [["leftarrow", "righthook"], 1.08, 522],
  xhookrightarrow: [["lefthook", "rightarrow"], 1.08, 522],
  overlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
  underlinesegment: [["leftlinesegment", "rightlinesegment"], 0.888, 522],
  overgroup: [["leftgroup", "rightgroup"], 0.888, 342],
  undergroup: [["leftgroupunder", "rightgroupunder"], 0.888, 342],
  xmapsto: [["leftmapsto", "rightarrow"], 1.5, 522],
  xtofrom: [["leftToFrom", "rightToFrom"], 1.75, 528],
  // The next three arrows are from the mhchem package.
  // In mhchem.sty, min-length is 2.0em. But these arrows might appear in the
  // document as \xrightarrow or \xrightleftharpoons. Those have
  // min-length = 1.75em, so we set min-length on these next three to match.
  xrightleftarrows: [["baraboveleftarrow", "rightarrowabovebar"], 1.75, 901],
  xrightequilibrium: [["baraboveshortleftharpoon", "rightharpoonaboveshortbar"], 1.75, 716],
  xleftequilibrium: [["shortbaraboveleftharpoon", "shortrightharpoonabovebar"], 1.75, 716]
}, zV = function(t) {
  return t.type === "ordgroup" ? t.body.length : 1;
}, UV = function(t, e) {
  function n() {
    var o = 4e5, l = t.label.slice(1);
    if (ne.contains(["widehat", "widecheck", "widetilde", "utilde"], l)) {
      var c = t, h = zV(c.base), u, f, d;
      if (h > 5)
        l === "widehat" || l === "widecheck" ? (u = 420, o = 2364, d = 0.42, f = l + "4") : (u = 312, o = 2340, d = 0.34, f = "tilde4");
      else {
        var p = [1, 1, 2, 2, 3, 3][h];
        l === "widehat" || l === "widecheck" ? (o = [0, 1062, 2364, 2364, 2364][p], u = [0, 239, 300, 360, 420][p], d = [0, 0.24, 0.3, 0.3, 0.36, 0.42][p], f = l + p) : (o = [0, 600, 1033, 2339, 2340][p], u = [0, 260, 286, 306, 312][p], d = [0, 0.26, 0.286, 0.3, 0.306, 0.34][p], f = "tilde" + p);
      }
      var g = new E1(f), b = new m0([g], {
        width: "100%",
        height: Nt(d),
        viewBox: "0 0 " + o + " " + u,
        preserveAspectRatio: "none"
      });
      return {
        span: pt.makeSvgSpan([], [b], e),
        minWidth: 0,
        height: d
      };
    } else {
      var y = [], v = qV[l], [w, _, x] = v, k = x / 1e3, S = w.length, T, I;
      if (S === 1) {
        var R = v[3];
        T = ["hide-tail"], I = [R];
      } else if (S === 2)
        T = ["halfarrow-left", "halfarrow-right"], I = ["xMinYMin", "xMaxYMin"];
      else if (S === 3)
        T = ["brace-left", "brace-center", "brace-right"], I = ["xMinYMin", "xMidYMin", "xMaxYMin"];
      else
        throw new Error(`Correct katexImagesData or update code here to support
                    ` + S + " children.");
      for (var B = 0; B < S; B++) {
        var L = new E1(w[B]), it = new m0([L], {
          width: "400em",
          height: Nt(k),
          viewBox: "0 0 " + o + " " + x,
          preserveAspectRatio: I[B] + " slice"
        }), O = pt.makeSvgSpan([T[B]], [it], e);
        if (S === 1)
          return {
            span: O,
            minWidth: _,
            height: k
          };
        O.style.height = Nt(k), y.push(O);
      }
      return {
        span: pt.makeSpan(["stretchy"], y, e),
        minWidth: _,
        height: k
      };
    }
  }
  var {
    span: s,
    minWidth: r,
    height: a
  } = n();
  return s.height = a, s.style.height = Nt(a), r > 0 && (s.style.minWidth = Nt(r)), s;
}, HV = function(t, e, n, s, r) {
  var a, o = t.height + t.depth + n + s;
  if (/fbox|color|angl/.test(e)) {
    if (a = pt.makeSpan(["stretchy", e], [], r), e === "fbox") {
      var l = r.color && r.getColor();
      l && (a.style.borderColor = l);
    }
  } else {
    var c = [];
    /^[bx]cancel$/.test(e) && c.push(new Ak({
      x1: "0",
      y1: "0",
      x2: "100%",
      y2: "100%",
      "stroke-width": "0.046em"
    })), /^x?cancel$/.test(e) && c.push(new Ak({
      x1: "0",
      y1: "100%",
      x2: "100%",
      y2: "0",
      "stroke-width": "0.046em"
    }));
    var h = new m0(c, {
      width: "100%",
      height: Nt(o)
    });
    a = pt.makeSvgSpan([], [h], r);
  }
  return a.height = o, a.style.height = Nt(o), a;
}, Yl = {
  encloseSpan: HV,
  mathMLnode: $V,
  svgSpan: UV
};
function ve(i, t) {
  if (!i || i.type !== t)
    throw new Error("Expected node of type " + t + ", but got " + (i ? "node of type " + i.type : String(i)));
  return i;
}
function Ow(i) {
  var t = K4(i);
  if (!t)
    throw new Error("Expected node of symbol group type, but got " + (i ? "node of type " + i.type : String(i)));
  return t;
}
function K4(i) {
  return i && (i.type === "atom" || gV.hasOwnProperty(i.type)) ? i : null;
}
var $w = (i, t) => {
  var e, n, s;
  i && i.type === "supsub" ? (n = ve(i.base, "accent"), e = n.base, i.base = e, s = mV(qe(i, t)), i.base = n) : (n = ve(i, "accent"), e = n.base);
  var r = qe(e, t.havingCrampedStyle()), a = n.isShifty && ne.isCharacterBox(e), o = 0;
  if (a) {
    var l = ne.getBaseElem(e), c = qe(l, t.havingCrampedStyle());
    o = Sk(c).skew;
  }
  var h = n.label === "\\c", u = h ? r.height + r.depth : Math.min(r.height, t.fontMetrics().xHeight), f;
  if (n.isStretchy)
    f = Yl.svgSpan(n, t), f = pt.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: r
      }, {
        type: "elem",
        elem: f,
        wrapperClasses: ["svg-align"],
        wrapperStyle: o > 0 ? {
          width: "calc(100% - " + Nt(2 * o) + ")",
          marginLeft: Nt(2 * o)
        } : void 0
      }]
    }, t);
  else {
    var d, p;
    n.label === "\\vec" ? (d = pt.staticSvg("vec", t), p = pt.svgData.vec[1]) : (d = pt.makeOrd({
      mode: n.mode,
      text: n.label
    }, t, "textord"), d = Sk(d), d.italic = 0, p = d.width, h && (u += d.depth)), f = pt.makeSpan(["accent-body"], [d]);
    var g = n.label === "\\textcircled";
    g && (f.classes.push("accent-full"), u = r.height);
    var b = o;
    g || (b -= p / 2), f.style.left = Nt(b), n.label === "\\textcircled" && (f.style.top = ".2em"), f = pt.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: r
      }, {
        type: "kern",
        size: -u
      }, {
        type: "elem",
        elem: f
      }]
    }, t);
  }
  var y = pt.makeSpan(["mord", "accent"], [f], t);
  return s ? (s.children[0] = y, s.height = Math.max(y.height, s.height), s.classes[0] = "mord", s) : y;
}, DF = (i, t) => {
  var e = i.isStretchy ? Yl.mathMLnode(i.label) : new Mt.MathNode("mo", [Wr(i.label, i.mode)]), n = new Mt.MathNode("mover", [ei(i.base, t), e]);
  return n.setAttribute("accent", "true"), n;
}, jV = new RegExp(["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring"].map((i) => "\\" + i).join("|"));
qt({
  type: "accent",
  names: ["\\acute", "\\grave", "\\ddot", "\\tilde", "\\bar", "\\breve", "\\check", "\\hat", "\\vec", "\\dot", "\\mathring", "\\widecheck", "\\widehat", "\\widetilde", "\\overrightarrow", "\\overleftarrow", "\\Overrightarrow", "\\overleftrightarrow", "\\overgroup", "\\overlinesegment", "\\overleftharpoon", "\\overrightharpoon"],
  props: {
    numArgs: 1
  },
  handler: (i, t) => {
    var e = O3(t[0]), n = !jV.test(i.funcName), s = !n || i.funcName === "\\widehat" || i.funcName === "\\widetilde" || i.funcName === "\\widecheck";
    return {
      type: "accent",
      mode: i.parser.mode,
      label: i.funcName,
      isStretchy: n,
      isShifty: s,
      base: e
    };
  },
  htmlBuilder: $w,
  mathmlBuilder: DF
});
qt({
  type: "accent",
  names: ["\\'", "\\`", "\\^", "\\~", "\\=", "\\u", "\\.", '\\"', "\\c", "\\r", "\\H", "\\v", "\\textcircled"],
  props: {
    numArgs: 1,
    allowedInText: !0,
    allowedInMath: !0,
    // unless in strict mode
    argTypes: ["primitive"]
  },
  handler: (i, t) => {
    var e = t[0], n = i.parser.mode;
    return n === "math" && (i.parser.settings.reportNonstrict("mathVsTextAccents", "LaTeX's accent " + i.funcName + " works only in text mode"), n = "text"), {
      type: "accent",
      mode: n,
      label: i.funcName,
      isStretchy: !1,
      isShifty: !0,
      base: e
    };
  },
  htmlBuilder: $w,
  mathmlBuilder: DF
});
qt({
  type: "accentUnder",
  names: ["\\underleftarrow", "\\underrightarrow", "\\underleftrightarrow", "\\undergroup", "\\underlinesegment", "\\utilde"],
  props: {
    numArgs: 1
  },
  handler: (i, t) => {
    var {
      parser: e,
      funcName: n
    } = i, s = t[0];
    return {
      type: "accentUnder",
      mode: e.mode,
      label: n,
      base: s
    };
  },
  htmlBuilder: (i, t) => {
    var e = qe(i.base, t), n = Yl.svgSpan(i, t), s = i.label === "\\utilde" ? 0.12 : 0, r = pt.makeVList({
      positionType: "top",
      positionData: e.height,
      children: [{
        type: "elem",
        elem: n,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: s
      }, {
        type: "elem",
        elem: e
      }]
    }, t);
    return pt.makeSpan(["mord", "accentunder"], [r], t);
  },
  mathmlBuilder: (i, t) => {
    var e = Yl.mathMLnode(i.label), n = new Mt.MathNode("munder", [ei(i.base, t), e]);
    return n.setAttribute("accentunder", "true"), n;
  }
});
var y5 = (i) => {
  var t = new Mt.MathNode("mpadded", i ? [i] : []);
  return t.setAttribute("width", "+0.6em"), t.setAttribute("lspace", "0.3em"), t;
};
qt({
  type: "xArrow",
  names: [
    "\\xleftarrow",
    "\\xrightarrow",
    "\\xLeftarrow",
    "\\xRightarrow",
    "\\xleftrightarrow",
    "\\xLeftrightarrow",
    "\\xhookleftarrow",
    "\\xhookrightarrow",
    "\\xmapsto",
    "\\xrightharpoondown",
    "\\xrightharpoonup",
    "\\xleftharpoondown",
    "\\xleftharpoonup",
    "\\xrightleftharpoons",
    "\\xleftrightharpoons",
    "\\xlongequal",
    "\\xtwoheadrightarrow",
    "\\xtwoheadleftarrow",
    "\\xtofrom",
    // The next 3 functions are here to support the mhchem extension.
    // Direct use of these functions is discouraged and may break someday.
    "\\xrightleftarrows",
    "\\xrightequilibrium",
    "\\xleftequilibrium",
    // The next 3 functions are here only to support the {CD} environment.
    "\\\\cdrightarrow",
    "\\\\cdleftarrow",
    "\\\\cdlongequal"
  ],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(i, t, e) {
    var {
      parser: n,
      funcName: s
    } = i;
    return {
      type: "xArrow",
      mode: n.mode,
      label: s,
      body: t[0],
      below: e[0]
    };
  },
  // Flow is unable to correctly infer the type of `group`, even though it's
  // unambiguously determined from the passed-in `type` above.
  htmlBuilder(i, t) {
    var e = t.style, n = t.havingStyle(e.sup()), s = pt.wrapFragment(qe(i.body, n, t), t), r = i.label.slice(0, 2) === "\\x" ? "x" : "cd";
    s.classes.push(r + "-arrow-pad");
    var a;
    i.below && (n = t.havingStyle(e.sub()), a = pt.wrapFragment(qe(i.below, n, t), t), a.classes.push(r + "-arrow-pad"));
    var o = Yl.svgSpan(i, t), l = -t.fontMetrics().axisHeight + 0.5 * o.height, c = -t.fontMetrics().axisHeight - 0.5 * o.height - 0.111;
    (s.depth > 0.25 || i.label === "\\xleftequilibrium") && (c -= s.depth);
    var h;
    if (a) {
      var u = -t.fontMetrics().axisHeight + a.height + 0.5 * o.height + 0.111;
      h = pt.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: s,
          shift: c
        }, {
          type: "elem",
          elem: o,
          shift: l
        }, {
          type: "elem",
          elem: a,
          shift: u
        }]
      }, t);
    } else
      h = pt.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: s,
          shift: c
        }, {
          type: "elem",
          elem: o,
          shift: l
        }]
      }, t);
    return h.children[0].children[0].children[1].classes.push("svg-align"), pt.makeSpan(["mrel", "x-arrow"], [h], t);
  },
  mathmlBuilder(i, t) {
    var e = Yl.mathMLnode(i.label);
    e.setAttribute("minsize", i.label.charAt(0) === "x" ? "1.75em" : "3.0em");
    var n;
    if (i.body) {
      var s = y5(ei(i.body, t));
      if (i.below) {
        var r = y5(ei(i.below, t));
        n = new Mt.MathNode("munderover", [e, r, s]);
      } else
        n = new Mt.MathNode("mover", [e, s]);
    } else if (i.below) {
      var a = y5(ei(i.below, t));
      n = new Mt.MathNode("munder", [e, a]);
    } else
      n = y5(), n = new Mt.MathNode("mover", [e, n]);
    return n;
  }
});
var GV = pt.makeSpan;
function TF(i, t) {
  var e = Rn(i.body, t, !0);
  return GV([i.mclass], e, t);
}
function FF(i, t) {
  var e, n = dr(i.body, t);
  return i.mclass === "minner" ? e = new Mt.MathNode("mpadded", n) : i.mclass === "mord" ? i.isCharacterBox ? (e = n[0], e.type = "mi") : e = new Mt.MathNode("mi", n) : (i.isCharacterBox ? (e = n[0], e.type = "mo") : e = new Mt.MathNode("mo", n), i.mclass === "mbin" ? (e.attributes.lspace = "0.22em", e.attributes.rspace = "0.22em") : i.mclass === "mpunct" ? (e.attributes.lspace = "0em", e.attributes.rspace = "0.17em") : i.mclass === "mopen" || i.mclass === "mclose" ? (e.attributes.lspace = "0em", e.attributes.rspace = "0em") : i.mclass === "minner" && (e.attributes.lspace = "0.0556em", e.attributes.width = "+0.1111em")), e;
}
qt({
  type: "mclass",
  names: ["\\mathord", "\\mathbin", "\\mathrel", "\\mathopen", "\\mathclose", "\\mathpunct", "\\mathinner"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler(i, t) {
    var {
      parser: e,
      funcName: n
    } = i, s = t[0];
    return {
      type: "mclass",
      mode: e.mode,
      mclass: "m" + n.slice(5),
      // TODO(kevinb): don't prefix with 'm'
      body: qi(s),
      isCharacterBox: ne.isCharacterBox(s)
    };
  },
  htmlBuilder: TF,
  mathmlBuilder: FF
});
var Z4 = (i) => {
  var t = i.type === "ordgroup" && i.body.length ? i.body[0] : i;
  return t.type === "atom" && (t.family === "bin" || t.family === "rel") ? "m" + t.family : "mord";
};
qt({
  type: "mclass",
  names: ["\\@binrel"],
  props: {
    numArgs: 2
  },
  handler(i, t) {
    var {
      parser: e
    } = i;
    return {
      type: "mclass",
      mode: e.mode,
      mclass: Z4(t[0]),
      body: qi(t[1]),
      isCharacterBox: ne.isCharacterBox(t[1])
    };
  }
});
qt({
  type: "mclass",
  names: ["\\stackrel", "\\overset", "\\underset"],
  props: {
    numArgs: 2
  },
  handler(i, t) {
    var {
      parser: e,
      funcName: n
    } = i, s = t[1], r = t[0], a;
    n !== "\\stackrel" ? a = Z4(s) : a = "mrel";
    var o = {
      type: "op",
      mode: s.mode,
      limits: !0,
      alwaysHandleSupSub: !0,
      parentIsSupSub: !1,
      symbol: !1,
      suppressBaseShift: n !== "\\stackrel",
      body: qi(s)
    }, l = {
      type: "supsub",
      mode: r.mode,
      base: o,
      sup: n === "\\underset" ? null : r,
      sub: n === "\\underset" ? r : null
    };
    return {
      type: "mclass",
      mode: e.mode,
      mclass: a,
      body: [l],
      isCharacterBox: ne.isCharacterBox(l)
    };
  },
  htmlBuilder: TF,
  mathmlBuilder: FF
});
qt({
  type: "pmb",
  names: ["\\pmb"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(i, t) {
    var {
      parser: e
    } = i;
    return {
      type: "pmb",
      mode: e.mode,
      mclass: Z4(t[0]),
      body: qi(t[0])
    };
  },
  htmlBuilder(i, t) {
    var e = Rn(i.body, t, !0), n = pt.makeSpan([i.mclass], e, t);
    return n.style.textShadow = "0.02em 0.01em 0.04px", n;
  },
  mathmlBuilder(i, t) {
    var e = dr(i.body, t), n = new Mt.MathNode("mstyle", e);
    return n.setAttribute("style", "text-shadow: 0.02em 0.01em 0.04px"), n;
  }
});
var VV = {
  ">": "\\\\cdrightarrow",
  "<": "\\\\cdleftarrow",
  "=": "\\\\cdlongequal",
  A: "\\uparrow",
  V: "\\downarrow",
  "|": "\\Vert",
  ".": "no arrow"
}, Rk = () => ({
  type: "styling",
  body: [],
  mode: "math",
  style: "display"
}), Bk = (i) => i.type === "textord" && i.text === "@", WV = (i, t) => (i.type === "mathord" || i.type === "atom") && i.text === t;
function XV(i, t, e) {
  var n = VV[i];
  switch (n) {
    case "\\\\cdrightarrow":
    case "\\\\cdleftarrow":
      return e.callFunction(n, [t[0]], [t[1]]);
    case "\\uparrow":
    case "\\downarrow": {
      var s = e.callFunction("\\\\cdleft", [t[0]], []), r = {
        type: "atom",
        text: n,
        mode: "math",
        family: "rel"
      }, a = e.callFunction("\\Big", [r], []), o = e.callFunction("\\\\cdright", [t[1]], []), l = {
        type: "ordgroup",
        mode: "math",
        body: [s, a, o]
      };
      return e.callFunction("\\\\cdparent", [l], []);
    }
    case "\\\\cdlongequal":
      return e.callFunction("\\\\cdlongequal", [], []);
    case "\\Vert": {
      var c = {
        type: "textord",
        text: "\\Vert",
        mode: "math"
      };
      return e.callFunction("\\Big", [c], []);
    }
    default:
      return {
        type: "textord",
        text: " ",
        mode: "math"
      };
  }
}
function YV(i) {
  var t = [];
  for (i.gullet.beginGroup(), i.gullet.macros.set("\\cr", "\\\\\\relax"), i.gullet.beginGroup(); ; ) {
    t.push(i.parseExpression(!1, "\\\\")), i.gullet.endGroup(), i.gullet.beginGroup();
    var e = i.fetch().text;
    if (e === "&" || e === "\\\\")
      i.consume();
    else if (e === "\\end") {
      t[t.length - 1].length === 0 && t.pop();
      break;
    } else
      throw new te("Expected \\\\ or \\cr or \\end", i.nextToken);
  }
  for (var n = [], s = [n], r = 0; r < t.length; r++) {
    for (var a = t[r], o = Rk(), l = 0; l < a.length; l++)
      if (!Bk(a[l]))
        o.body.push(a[l]);
      else {
        n.push(o), l += 1;
        var c = Ow(a[l]).text, h = new Array(2);
        if (h[0] = {
          type: "ordgroup",
          mode: "math",
          body: []
        }, h[1] = {
          type: "ordgroup",
          mode: "math",
          body: []
        }, !("=|.".indexOf(c) > -1)) if ("<>AV".indexOf(c) > -1)
          for (var u = 0; u < 2; u++) {
            for (var f = !0, d = l + 1; d < a.length; d++) {
              if (WV(a[d], c)) {
                f = !1, l = d;
                break;
              }
              if (Bk(a[d]))
                throw new te("Missing a " + c + " character to complete a CD arrow.", a[d]);
              h[u].body.push(a[d]);
            }
            if (f)
              throw new te("Missing a " + c + " character to complete a CD arrow.", a[l]);
          }
        else
          throw new te('Expected one of "<>AV=|." after @', a[l]);
        var p = XV(c, h, i), g = {
          type: "styling",
          body: [p],
          mode: "math",
          style: "display"
          // CD is always displaystyle.
        };
        n.push(g), o = Rk();
      }
    r % 2 === 0 ? n.push(o) : n.shift(), n = [], s.push(n);
  }
  i.gullet.endGroup(), i.gullet.endGroup();
  var b = new Array(s[0].length).fill({
    type: "align",
    align: "c",
    pregap: 0.25,
    // CD package sets \enskip between columns.
    postgap: 0.25
    // So pre and post each get half an \enskip, i.e. 0.25em.
  });
  return {
    type: "array",
    mode: "math",
    body: s,
    arraystretch: 1,
    addJot: !0,
    rowGaps: [null],
    cols: b,
    colSeparationType: "CD",
    hLinesBeforeRow: new Array(s.length + 1).fill([])
  };
}
qt({
  type: "cdlabel",
  names: ["\\\\cdleft", "\\\\cdright"],
  props: {
    numArgs: 1
  },
  handler(i, t) {
    var {
      parser: e,
      funcName: n
    } = i;
    return {
      type: "cdlabel",
      mode: e.mode,
      side: n.slice(4),
      label: t[0]
    };
  },
  htmlBuilder(i, t) {
    var e = t.havingStyle(t.style.sup()), n = pt.wrapFragment(qe(i.label, e, t), t);
    return n.classes.push("cd-label-" + i.side), n.style.bottom = Nt(0.8 - n.depth), n.height = 0, n.depth = 0, n;
  },
  mathmlBuilder(i, t) {
    var e = new Mt.MathNode("mrow", [ei(i.label, t)]);
    return e = new Mt.MathNode("mpadded", [e]), e.setAttribute("width", "0"), i.side === "left" && e.setAttribute("lspace", "-1width"), e.setAttribute("voffset", "0.7em"), e = new Mt.MathNode("mstyle", [e]), e.setAttribute("displaystyle", "false"), e.setAttribute("scriptlevel", "1"), e;
  }
});
qt({
  type: "cdlabelparent",
  names: ["\\\\cdparent"],
  props: {
    numArgs: 1
  },
  handler(i, t) {
    var {
      parser: e
    } = i;
    return {
      type: "cdlabelparent",
      mode: e.mode,
      fragment: t[0]
    };
  },
  htmlBuilder(i, t) {
    var e = pt.wrapFragment(qe(i.fragment, t), t);
    return e.classes.push("cd-vert-arrow"), e;
  },
  mathmlBuilder(i, t) {
    return new Mt.MathNode("mrow", [ei(i.fragment, t)]);
  }
});
qt({
  type: "textord",
  names: ["\\@char"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(i, t) {
    for (var {
      parser: e
    } = i, n = ve(t[0], "ordgroup"), s = n.body, r = "", a = 0; a < s.length; a++) {
      var o = ve(s[a], "textord");
      r += o.text;
    }
    var l = parseInt(r), c;
    if (isNaN(l))
      throw new te("\\@char has non-numeric argument " + r);
    if (l < 0 || l >= 1114111)
      throw new te("\\@char with invalid code point " + r);
    return l <= 65535 ? c = String.fromCharCode(l) : (l -= 65536, c = String.fromCharCode((l >> 10) + 55296, (l & 1023) + 56320)), {
      type: "textord",
      mode: e.mode,
      text: c
    };
  }
});
var IF = (i, t) => {
  var e = Rn(i.body, t.withColor(i.color), !1);
  return pt.makeFragment(e);
}, MF = (i, t) => {
  var e = dr(i.body, t.withColor(i.color)), n = new Mt.MathNode("mstyle", e);
  return n.setAttribute("mathcolor", i.color), n;
};
qt({
  type: "color",
  names: ["\\textcolor"],
  props: {
    numArgs: 2,
    allowedInText: !0,
    argTypes: ["color", "original"]
  },
  handler(i, t) {
    var {
      parser: e
    } = i, n = ve(t[0], "color-token").color, s = t[1];
    return {
      type: "color",
      mode: e.mode,
      color: n,
      body: qi(s)
    };
  },
  htmlBuilder: IF,
  mathmlBuilder: MF
});
qt({
  type: "color",
  names: ["\\color"],
  props: {
    numArgs: 1,
    allowedInText: !0,
    argTypes: ["color"]
  },
  handler(i, t) {
    var {
      parser: e,
      breakOnTokenText: n
    } = i, s = ve(t[0], "color-token").color;
    e.gullet.macros.set("\\current@color", s);
    var r = e.parseExpression(!0, n);
    return {
      type: "color",
      mode: e.mode,
      color: s,
      body: r
    };
  },
  htmlBuilder: IF,
  mathmlBuilder: MF
});
qt({
  type: "cr",
  names: ["\\\\"],
  props: {
    numArgs: 0,
    numOptionalArgs: 0,
    allowedInText: !0
  },
  handler(i, t, e) {
    var {
      parser: n
    } = i, s = n.gullet.future().text === "[" ? n.parseSizeGroup(!0) : null, r = !n.settings.displayMode || !n.settings.useStrictBehavior("newLineInDisplayMode", "In LaTeX, \\\\ or \\newline does nothing in display mode");
    return {
      type: "cr",
      mode: n.mode,
      newLine: r,
      size: s && ve(s, "size").value
    };
  },
  // The following builders are called only at the top level,
  // not within tabular/array environments.
  htmlBuilder(i, t) {
    var e = pt.makeSpan(["mspace"], [], t);
    return i.newLine && (e.classes.push("newline"), i.size && (e.style.marginTop = Nt(Ai(i.size, t)))), e;
  },
  mathmlBuilder(i, t) {
    var e = new Mt.MathNode("mspace");
    return i.newLine && (e.setAttribute("linebreak", "newline"), i.size && e.setAttribute("height", Nt(Ai(i.size, t)))), e;
  }
});
var uy = {
  "\\global": "\\global",
  "\\long": "\\\\globallong",
  "\\\\globallong": "\\\\globallong",
  "\\def": "\\gdef",
  "\\gdef": "\\gdef",
  "\\edef": "\\xdef",
  "\\xdef": "\\xdef",
  "\\let": "\\\\globallet",
  "\\futurelet": "\\\\globalfuture"
}, RF = (i) => {
  var t = i.text;
  if (/^(?:[\\{}$&#^_]|EOF)$/.test(t))
    throw new te("Expected a control sequence", i);
  return t;
}, KV = (i) => {
  var t = i.gullet.popToken();
  return t.text === "=" && (t = i.gullet.popToken(), t.text === " " && (t = i.gullet.popToken())), t;
}, BF = (i, t, e, n) => {
  var s = i.gullet.macros.get(e.text);
  s == null && (e.noexpand = !0, s = {
    tokens: [e],
    numArgs: 0,
    // reproduce the same behavior in expansion
    unexpandable: !i.gullet.isExpandable(e.text)
  }), i.gullet.macros.set(t, s, n);
};
qt({
  type: "internal",
  names: [
    "\\global",
    "\\long",
    "\\\\globallong"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(i) {
    var {
      parser: t,
      funcName: e
    } = i;
    t.consumeSpaces();
    var n = t.fetch();
    if (uy[n.text])
      return (e === "\\global" || e === "\\\\globallong") && (n.text = uy[n.text]), ve(t.parseFunction(), "internal");
    throw new te("Invalid token after macro prefix", n);
  }
});
qt({
  type: "internal",
  names: ["\\def", "\\gdef", "\\edef", "\\xdef"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(i) {
    var {
      parser: t,
      funcName: e
    } = i, n = t.gullet.popToken(), s = n.text;
    if (/^(?:[\\{}$&#^_]|EOF)$/.test(s))
      throw new te("Expected a control sequence", n);
    for (var r = 0, a, o = [[]]; t.gullet.future().text !== "{"; )
      if (n = t.gullet.popToken(), n.text === "#") {
        if (t.gullet.future().text === "{") {
          a = t.gullet.future(), o[r].push("{");
          break;
        }
        if (n = t.gullet.popToken(), !/^[1-9]$/.test(n.text))
          throw new te('Invalid argument number "' + n.text + '"');
        if (parseInt(n.text) !== r + 1)
          throw new te('Argument number "' + n.text + '" out of order');
        r++, o.push([]);
      } else {
        if (n.text === "EOF")
          throw new te("Expected a macro definition");
        o[r].push(n.text);
      }
    var {
      tokens: l
    } = t.gullet.consumeArg();
    return a && l.unshift(a), (e === "\\edef" || e === "\\xdef") && (l = t.gullet.expandTokens(l), l.reverse()), t.gullet.macros.set(s, {
      tokens: l,
      numArgs: r,
      delimiters: o
    }, e === uy[e]), {
      type: "internal",
      mode: t.mode
    };
  }
});
qt({
  type: "internal",
  names: [
    "\\let",
    "\\\\globallet"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(i) {
    var {
      parser: t,
      funcName: e
    } = i, n = RF(t.gullet.popToken());
    t.gullet.consumeSpaces();
    var s = KV(t);
    return BF(t, n, s, e === "\\\\globallet"), {
      type: "internal",
      mode: t.mode
    };
  }
});
qt({
  type: "internal",
  names: [
    "\\futurelet",
    "\\\\globalfuture"
    // can’t be entered directly
  ],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(i) {
    var {
      parser: t,
      funcName: e
    } = i, n = RF(t.gullet.popToken()), s = t.gullet.popToken(), r = t.gullet.popToken();
    return BF(t, n, r, e === "\\\\globalfuture"), t.gullet.pushToken(r), t.gullet.pushToken(s), {
      type: "internal",
      mode: t.mode
    };
  }
});
var S2 = function(t, e, n) {
  var s = zi.math[t] && zi.math[t].replace, r = Bw(s || t, e, n);
  if (!r)
    throw new Error("Unsupported symbol " + t + " and font size " + e + ".");
  return r;
}, qw = function(t, e, n, s) {
  var r = n.havingBaseStyle(e), a = pt.makeSpan(s.concat(r.sizingClasses(n)), [t], n), o = r.sizeMultiplier / n.sizeMultiplier;
  return a.height *= o, a.depth *= o, a.maxFontSize = r.sizeMultiplier, a;
}, PF = function(t, e, n) {
  var s = e.havingBaseStyle(n), r = (1 - e.sizeMultiplier / s.sizeMultiplier) * e.fontMetrics().axisHeight;
  t.classes.push("delimcenter"), t.style.top = Nt(r), t.height -= r, t.depth += r;
}, ZV = function(t, e, n, s, r, a) {
  var o = pt.makeSymbol(t, "Main-Regular", r, s), l = qw(o, e, s, a);
  return n && PF(l, s, e), l;
}, JV = function(t, e, n, s) {
  return pt.makeSymbol(t, "Size" + e + "-Regular", n, s);
}, NF = function(t, e, n, s, r, a) {
  var o = JV(t, e, r, s), l = qw(pt.makeSpan(["delimsizing", "size" + e], [o], s), re.TEXT, s, a);
  return n && PF(l, s, re.TEXT), l;
}, n7 = function(t, e, n) {
  var s;
  e === "Size1-Regular" ? s = "delim-size1" : s = "delim-size4";
  var r = pt.makeSpan(["delimsizinginner", s], [pt.makeSpan([], [pt.makeSymbol(t, e, n)])]);
  return {
    type: "elem",
    elem: r
  };
}, s7 = function(t, e, n) {
  var s = Bl["Size4-Regular"][t.charCodeAt(0)] ? Bl["Size4-Regular"][t.charCodeAt(0)][4] : Bl["Size1-Regular"][t.charCodeAt(0)][4], r = new E1("inner", lV(t, Math.round(1e3 * e))), a = new m0([r], {
    width: Nt(s),
    height: Nt(e),
    // Override CSS rule `.katex svg { width: 100% }`
    style: "width:" + Nt(s),
    viewBox: "0 0 " + 1e3 * s + " " + Math.round(1e3 * e),
    preserveAspectRatio: "xMinYMin"
  }), o = pt.makeSvgSpan([], [a], n);
  return o.height = e, o.style.height = Nt(e), o.style.width = Nt(s), {
    type: "elem",
    elem: o
  };
}, dy = 8e-3, w5 = {
  type: "kern",
  size: -1 * dy
}, QV = ["|", "\\lvert", "\\rvert", "\\vert"], tW = ["\\|", "\\lVert", "\\rVert", "\\Vert"], LF = function(t, e, n, s, r, a) {
  var o, l, c, h, u = "", f = 0;
  o = c = h = t, l = null;
  var d = "Size1-Regular";
  t === "\\uparrow" ? c = h = "⏐" : t === "\\Uparrow" ? c = h = "‖" : t === "\\downarrow" ? o = c = "⏐" : t === "\\Downarrow" ? o = c = "‖" : t === "\\updownarrow" ? (o = "\\uparrow", c = "⏐", h = "\\downarrow") : t === "\\Updownarrow" ? (o = "\\Uparrow", c = "‖", h = "\\Downarrow") : ne.contains(QV, t) ? (c = "∣", u = "vert", f = 333) : ne.contains(tW, t) ? (c = "∥", u = "doublevert", f = 556) : t === "[" || t === "\\lbrack" ? (o = "⎡", c = "⎢", h = "⎣", d = "Size4-Regular", u = "lbrack", f = 667) : t === "]" || t === "\\rbrack" ? (o = "⎤", c = "⎥", h = "⎦", d = "Size4-Regular", u = "rbrack", f = 667) : t === "\\lfloor" || t === "⌊" ? (c = o = "⎢", h = "⎣", d = "Size4-Regular", u = "lfloor", f = 667) : t === "\\lceil" || t === "⌈" ? (o = "⎡", c = h = "⎢", d = "Size4-Regular", u = "lceil", f = 667) : t === "\\rfloor" || t === "⌋" ? (c = o = "⎥", h = "⎦", d = "Size4-Regular", u = "rfloor", f = 667) : t === "\\rceil" || t === "⌉" ? (o = "⎤", c = h = "⎥", d = "Size4-Regular", u = "rceil", f = 667) : t === "(" || t === "\\lparen" ? (o = "⎛", c = "⎜", h = "⎝", d = "Size4-Regular", u = "lparen", f = 875) : t === ")" || t === "\\rparen" ? (o = "⎞", c = "⎟", h = "⎠", d = "Size4-Regular", u = "rparen", f = 875) : t === "\\{" || t === "\\lbrace" ? (o = "⎧", l = "⎨", h = "⎩", c = "⎪", d = "Size4-Regular") : t === "\\}" || t === "\\rbrace" ? (o = "⎫", l = "⎬", h = "⎭", c = "⎪", d = "Size4-Regular") : t === "\\lgroup" || t === "⟮" ? (o = "⎧", h = "⎩", c = "⎪", d = "Size4-Regular") : t === "\\rgroup" || t === "⟯" ? (o = "⎫", h = "⎭", c = "⎪", d = "Size4-Regular") : t === "\\lmoustache" || t === "⎰" ? (o = "⎧", h = "⎭", c = "⎪", d = "Size4-Regular") : (t === "\\rmoustache" || t === "⎱") && (o = "⎫", h = "⎩", c = "⎪", d = "Size4-Regular");
  var p = S2(o, d, r), g = p.height + p.depth, b = S2(c, d, r), y = b.height + b.depth, v = S2(h, d, r), w = v.height + v.depth, _ = 0, x = 1;
  if (l !== null) {
    var k = S2(l, d, r);
    _ = k.height + k.depth, x = 2;
  }
  var S = g + w + _, T = Math.max(0, Math.ceil((e - S) / (x * y))), I = S + T * x * y, R = s.fontMetrics().axisHeight;
  n && (R *= s.sizeMultiplier);
  var B = I / 2 - R, L = [];
  if (u.length > 0) {
    var it = I - g - w, O = Math.round(I * 1e3), at = cV(u, Math.round(it * 1e3)), W = new E1(u, at), q = (f / 1e3).toFixed(3) + "em", K = (O / 1e3).toFixed(3) + "em", z = new m0([W], {
      width: q,
      height: K,
      viewBox: "0 0 " + f + " " + O
    }), j = pt.makeSvgSpan([], [z], s);
    j.height = O / 1e3, j.style.width = q, j.style.height = K, L.push({
      type: "elem",
      elem: j
    });
  } else {
    if (L.push(n7(h, d, r)), L.push(w5), l === null) {
      var N = I - g - w + 2 * dy;
      L.push(s7(c, N, s));
    } else {
      var Q = (I - g - w - _) / 2 + 2 * dy;
      L.push(s7(c, Q, s)), L.push(w5), L.push(n7(l, d, r)), L.push(w5), L.push(s7(c, Q, s));
    }
    L.push(w5), L.push(n7(o, d, r));
  }
  var Y = s.havingBaseStyle(re.TEXT), et = pt.makeVList({
    positionType: "bottom",
    positionData: B,
    children: L
  }, Y);
  return qw(pt.makeSpan(["delimsizing", "mult"], [et], Y), re.TEXT, s, a);
}, r7 = 80, a7 = 0.08, o7 = function(t, e, n, s, r) {
  var a = oV(t, s, n), o = new E1(t, a), l = new m0([o], {
    // Note: 1000:1 ratio of viewBox to document em width.
    width: "400em",
    height: Nt(e),
    viewBox: "0 0 400000 " + n,
    preserveAspectRatio: "xMinYMin slice"
  });
  return pt.makeSvgSpan(["hide-tail"], [l], r);
}, eW = function(t, e) {
  var n = e.havingBaseSizing(), s = zF("\\surd", t * n.sizeMultiplier, qF, n), r = n.sizeMultiplier, a = Math.max(0, e.minRuleThickness - e.fontMetrics().sqrtRuleThickness), o, l = 0, c = 0, h = 0, u;
  return s.type === "small" ? (h = 1e3 + 1e3 * a + r7, t < 1 ? r = 1 : t < 1.4 && (r = 0.7), l = (1 + a + a7) / r, c = (1 + a) / r, o = o7("sqrtMain", l, h, a, e), o.style.minWidth = "0.853em", u = 0.833 / r) : s.type === "large" ? (h = (1e3 + r7) * $2[s.size], c = ($2[s.size] + a) / r, l = ($2[s.size] + a + a7) / r, o = o7("sqrtSize" + s.size, l, h, a, e), o.style.minWidth = "1.02em", u = 1 / r) : (l = t + a + a7, c = t + a, h = Math.floor(1e3 * t + a) + r7, o = o7("sqrtTall", l, h, a, e), o.style.minWidth = "0.742em", u = 1.056), o.height = c, o.style.height = Nt(l), {
    span: o,
    advanceWidth: u,
    // Calculate the actual line width.
    // This actually should depend on the chosen font -- e.g. \boldmath
    // should use the thicker surd symbols from e.g. KaTeX_Main-Bold, and
    // have thicker rules.
    ruleWidth: (e.fontMetrics().sqrtRuleThickness + a) * r
  };
}, OF = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "⌊", "⌋", "\\lceil", "\\rceil", "⌈", "⌉", "\\surd"], iW = ["\\uparrow", "\\downarrow", "\\updownarrow", "\\Uparrow", "\\Downarrow", "\\Updownarrow", "|", "\\|", "\\vert", "\\Vert", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "⟮", "⟯", "\\lmoustache", "\\rmoustache", "⎰", "⎱"], $F = ["<", ">", "\\langle", "\\rangle", "/", "\\backslash", "\\lt", "\\gt"], $2 = [0, 1.2, 1.8, 2.4, 3], nW = function(t, e, n, s, r) {
  if (t === "<" || t === "\\lt" || t === "⟨" ? t = "\\langle" : (t === ">" || t === "\\gt" || t === "⟩") && (t = "\\rangle"), ne.contains(OF, t) || ne.contains($F, t))
    return NF(t, e, !1, n, s, r);
  if (ne.contains(iW, t))
    return LF(t, $2[e], !1, n, s, r);
  throw new te("Illegal delimiter: '" + t + "'");
}, sW = [{
  type: "small",
  style: re.SCRIPTSCRIPT
}, {
  type: "small",
  style: re.SCRIPT
}, {
  type: "small",
  style: re.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}], rW = [{
  type: "small",
  style: re.SCRIPTSCRIPT
}, {
  type: "small",
  style: re.SCRIPT
}, {
  type: "small",
  style: re.TEXT
}, {
  type: "stack"
}], qF = [{
  type: "small",
  style: re.SCRIPTSCRIPT
}, {
  type: "small",
  style: re.SCRIPT
}, {
  type: "small",
  style: re.TEXT
}, {
  type: "large",
  size: 1
}, {
  type: "large",
  size: 2
}, {
  type: "large",
  size: 3
}, {
  type: "large",
  size: 4
}, {
  type: "stack"
}], aW = function(t) {
  if (t.type === "small")
    return "Main-Regular";
  if (t.type === "large")
    return "Size" + t.size + "-Regular";
  if (t.type === "stack")
    return "Size4-Regular";
  throw new Error("Add support for delim type '" + t.type + "' here.");
}, zF = function(t, e, n, s) {
  for (var r = Math.min(2, 3 - s.style.size), a = r; a < n.length && n[a].type !== "stack"; a++) {
    var o = S2(t, aW(n[a]), "math"), l = o.height + o.depth;
    if (n[a].type === "small") {
      var c = s.havingBaseStyle(n[a].style);
      l *= c.sizeMultiplier;
    }
    if (l > e)
      return n[a];
  }
  return n[n.length - 1];
}, UF = function(t, e, n, s, r, a) {
  t === "<" || t === "\\lt" || t === "⟨" ? t = "\\langle" : (t === ">" || t === "\\gt" || t === "⟩") && (t = "\\rangle");
  var o;
  ne.contains($F, t) ? o = sW : ne.contains(OF, t) ? o = qF : o = rW;
  var l = zF(t, e, o, s);
  return l.type === "small" ? ZV(t, l.style, n, s, r, a) : l.type === "large" ? NF(t, l.size, n, s, r, a) : LF(t, e, n, s, r, a);
}, oW = function(t, e, n, s, r, a) {
  var o = s.fontMetrics().axisHeight * s.sizeMultiplier, l = 901, c = 5 / s.fontMetrics().ptPerEm, h = Math.max(e - o, n + o), u = Math.max(
    // In real TeX, calculations are done using integral values which are
    // 65536 per pt, or 655360 per em. So, the division here truncates in
    // TeX but doesn't here, producing different results. If we wanted to
    // exactly match TeX's calculation, we could do
    //   Math.floor(655360 * maxDistFromAxis / 500) *
    //    delimiterFactor / 655360
    // (To see the difference, compare
    //    x^{x^{\left(\rule{0.1em}{0.68em}\right)}}
    // in TeX and KaTeX)
    h / 500 * l,
    2 * h - c
  );
  return UF(t, u, !0, s, r, a);
}, $l = {
  sqrtImage: eW,
  sizedDelim: nW,
  sizeToMaxHeight: $2,
  customSizedDelim: UF,
  leftRightDelim: oW
}, Pk = {
  "\\bigl": {
    mclass: "mopen",
    size: 1
  },
  "\\Bigl": {
    mclass: "mopen",
    size: 2
  },
  "\\biggl": {
    mclass: "mopen",
    size: 3
  },
  "\\Biggl": {
    mclass: "mopen",
    size: 4
  },
  "\\bigr": {
    mclass: "mclose",
    size: 1
  },
  "\\Bigr": {
    mclass: "mclose",
    size: 2
  },
  "\\biggr": {
    mclass: "mclose",
    size: 3
  },
  "\\Biggr": {
    mclass: "mclose",
    size: 4
  },
  "\\bigm": {
    mclass: "mrel",
    size: 1
  },
  "\\Bigm": {
    mclass: "mrel",
    size: 2
  },
  "\\biggm": {
    mclass: "mrel",
    size: 3
  },
  "\\Biggm": {
    mclass: "mrel",
    size: 4
  },
  "\\big": {
    mclass: "mord",
    size: 1
  },
  "\\Big": {
    mclass: "mord",
    size: 2
  },
  "\\bigg": {
    mclass: "mord",
    size: 3
  },
  "\\Bigg": {
    mclass: "mord",
    size: 4
  }
}, lW = ["(", "\\lparen", ")", "\\rparen", "[", "\\lbrack", "]", "\\rbrack", "\\{", "\\lbrace", "\\}", "\\rbrace", "\\lfloor", "\\rfloor", "⌊", "⌋", "\\lceil", "\\rceil", "⌈", "⌉", "<", ">", "\\langle", "⟨", "\\rangle", "⟩", "\\lt", "\\gt", "\\lvert", "\\rvert", "\\lVert", "\\rVert", "\\lgroup", "\\rgroup", "⟮", "⟯", "\\lmoustache", "\\rmoustache", "⎰", "⎱", "/", "\\backslash", "|", "\\vert", "\\|", "\\Vert", "\\uparrow", "\\Uparrow", "\\downarrow", "\\Downarrow", "\\updownarrow", "\\Updownarrow", "."];
function J4(i, t) {
  var e = K4(i);
  if (e && ne.contains(lW, e.text))
    return e;
  throw e ? new te("Invalid delimiter '" + e.text + "' after '" + t.funcName + "'", i) : new te("Invalid delimiter type '" + i.type + "'", i);
}
qt({
  type: "delimsizing",
  names: ["\\bigl", "\\Bigl", "\\biggl", "\\Biggl", "\\bigr", "\\Bigr", "\\biggr", "\\Biggr", "\\bigm", "\\Bigm", "\\biggm", "\\Biggm", "\\big", "\\Big", "\\bigg", "\\Bigg"],
  props: {
    numArgs: 1,
    argTypes: ["primitive"]
  },
  handler: (i, t) => {
    var e = J4(t[0], i);
    return {
      type: "delimsizing",
      mode: i.parser.mode,
      size: Pk[i.funcName].size,
      mclass: Pk[i.funcName].mclass,
      delim: e.text
    };
  },
  htmlBuilder: (i, t) => i.delim === "." ? pt.makeSpan([i.mclass]) : $l.sizedDelim(i.delim, i.size, t, i.mode, [i.mclass]),
  mathmlBuilder: (i) => {
    var t = [];
    i.delim !== "." && t.push(Wr(i.delim, i.mode));
    var e = new Mt.MathNode("mo", t);
    i.mclass === "mopen" || i.mclass === "mclose" ? e.setAttribute("fence", "true") : e.setAttribute("fence", "false"), e.setAttribute("stretchy", "true");
    var n = Nt($l.sizeToMaxHeight[i.size]);
    return e.setAttribute("minsize", n), e.setAttribute("maxsize", n), e;
  }
});
function Nk(i) {
  if (!i.body)
    throw new Error("Bug: The leftright ParseNode wasn't fully parsed.");
}
qt({
  type: "leftright-right",
  names: ["\\right"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (i, t) => {
    var e = i.parser.gullet.macros.get("\\current@color");
    if (e && typeof e != "string")
      throw new te("\\current@color set to non-string in \\right");
    return {
      type: "leftright-right",
      mode: i.parser.mode,
      delim: J4(t[0], i).text,
      color: e
      // undefined if not set via \color
    };
  }
});
qt({
  type: "leftright",
  names: ["\\left"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (i, t) => {
    var e = J4(t[0], i), n = i.parser;
    ++n.leftrightDepth;
    var s = n.parseExpression(!1);
    --n.leftrightDepth, n.expect("\\right", !1);
    var r = ve(n.parseFunction(), "leftright-right");
    return {
      type: "leftright",
      mode: n.mode,
      body: s,
      left: e.text,
      right: r.delim,
      rightColor: r.color
    };
  },
  htmlBuilder: (i, t) => {
    Nk(i);
    for (var e = Rn(i.body, t, !0, ["mopen", "mclose"]), n = 0, s = 0, r = !1, a = 0; a < e.length; a++)
      e[a].isMiddle ? r = !0 : (n = Math.max(e[a].height, n), s = Math.max(e[a].depth, s));
    n *= t.sizeMultiplier, s *= t.sizeMultiplier;
    var o;
    if (i.left === "." ? o = xp(t, ["mopen"]) : o = $l.leftRightDelim(i.left, n, s, t, i.mode, ["mopen"]), e.unshift(o), r)
      for (var l = 1; l < e.length; l++) {
        var c = e[l], h = c.isMiddle;
        h && (e[l] = $l.leftRightDelim(h.delim, n, s, h.options, i.mode, []));
      }
    var u;
    if (i.right === ".")
      u = xp(t, ["mclose"]);
    else {
      var f = i.rightColor ? t.withColor(i.rightColor) : t;
      u = $l.leftRightDelim(i.right, n, s, f, i.mode, ["mclose"]);
    }
    return e.push(u), pt.makeSpan(["minner"], e, t);
  },
  mathmlBuilder: (i, t) => {
    Nk(i);
    var e = dr(i.body, t);
    if (i.left !== ".") {
      var n = new Mt.MathNode("mo", [Wr(i.left, i.mode)]);
      n.setAttribute("fence", "true"), e.unshift(n);
    }
    if (i.right !== ".") {
      var s = new Mt.MathNode("mo", [Wr(i.right, i.mode)]);
      s.setAttribute("fence", "true"), i.rightColor && s.setAttribute("mathcolor", i.rightColor), e.push(s);
    }
    return Nw(e);
  }
});
qt({
  type: "middle",
  names: ["\\middle"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (i, t) => {
    var e = J4(t[0], i);
    if (!i.parser.leftrightDepth)
      throw new te("\\middle without preceding \\left", e);
    return {
      type: "middle",
      mode: i.parser.mode,
      delim: e.text
    };
  },
  htmlBuilder: (i, t) => {
    var e;
    if (i.delim === ".")
      e = xp(t, []);
    else {
      e = $l.sizedDelim(i.delim, 1, t, i.mode, []);
      var n = {
        delim: i.delim,
        options: t
      };
      e.isMiddle = n;
    }
    return e;
  },
  mathmlBuilder: (i, t) => {
    var e = i.delim === "\\vert" || i.delim === "|" ? Wr("|", "text") : Wr(i.delim, i.mode), n = new Mt.MathNode("mo", [e]);
    return n.setAttribute("fence", "true"), n.setAttribute("lspace", "0.05em"), n.setAttribute("rspace", "0.05em"), n;
  }
});
var zw = (i, t) => {
  var e = pt.wrapFragment(qe(i.body, t), t), n = i.label.slice(1), s = t.sizeMultiplier, r, a = 0, o = ne.isCharacterBox(i.body);
  if (n === "sout")
    r = pt.makeSpan(["stretchy", "sout"]), r.height = t.fontMetrics().defaultRuleThickness / s, a = -0.5 * t.fontMetrics().xHeight;
  else if (n === "phase") {
    var l = Ai({
      number: 0.6,
      unit: "pt"
    }, t), c = Ai({
      number: 0.35,
      unit: "ex"
    }, t), h = t.havingBaseSizing();
    s = s / h.sizeMultiplier;
    var u = e.height + e.depth + l + c;
    e.style.paddingLeft = Nt(u / 2 + l);
    var f = Math.floor(1e3 * u * s), d = rV(f), p = new m0([new E1("phase", d)], {
      width: "400em",
      height: Nt(f / 1e3),
      viewBox: "0 0 400000 " + f,
      preserveAspectRatio: "xMinYMin slice"
    });
    r = pt.makeSvgSpan(["hide-tail"], [p], t), r.style.height = Nt(u), a = e.depth + l + c;
  } else {
    /cancel/.test(n) ? o || e.classes.push("cancel-pad") : n === "angl" ? e.classes.push("anglpad") : e.classes.push("boxpad");
    var g = 0, b = 0, y = 0;
    /box/.test(n) ? (y = Math.max(
      t.fontMetrics().fboxrule,
      // default
      t.minRuleThickness
      // User override.
    ), g = t.fontMetrics().fboxsep + (n === "colorbox" ? 0 : y), b = g) : n === "angl" ? (y = Math.max(t.fontMetrics().defaultRuleThickness, t.minRuleThickness), g = 4 * y, b = Math.max(0, 0.25 - e.depth)) : (g = o ? 0.2 : 0, b = g), r = Yl.encloseSpan(e, n, g, b, t), /fbox|boxed|fcolorbox/.test(n) ? (r.style.borderStyle = "solid", r.style.borderWidth = Nt(y)) : n === "angl" && y !== 0.049 && (r.style.borderTopWidth = Nt(y), r.style.borderRightWidth = Nt(y)), a = e.depth + b, i.backgroundColor && (r.style.backgroundColor = i.backgroundColor, i.borderColor && (r.style.borderColor = i.borderColor));
  }
  var v;
  if (i.backgroundColor)
    v = pt.makeVList({
      positionType: "individualShift",
      children: [
        // Put the color background behind inner;
        {
          type: "elem",
          elem: r,
          shift: a
        },
        {
          type: "elem",
          elem: e,
          shift: 0
        }
      ]
    }, t);
  else {
    var w = /cancel|phase/.test(n) ? ["svg-align"] : [];
    v = pt.makeVList({
      positionType: "individualShift",
      children: [
        // Write the \cancel stroke on top of inner.
        {
          type: "elem",
          elem: e,
          shift: 0
        },
        {
          type: "elem",
          elem: r,
          shift: a,
          wrapperClasses: w
        }
      ]
    }, t);
  }
  return /cancel/.test(n) && (v.height = e.height, v.depth = e.depth), /cancel/.test(n) && !o ? pt.makeSpan(["mord", "cancel-lap"], [v], t) : pt.makeSpan(["mord"], [v], t);
}, Uw = (i, t) => {
  var e = 0, n = new Mt.MathNode(i.label.indexOf("colorbox") > -1 ? "mpadded" : "menclose", [ei(i.body, t)]);
  switch (i.label) {
    case "\\cancel":
      n.setAttribute("notation", "updiagonalstrike");
      break;
    case "\\bcancel":
      n.setAttribute("notation", "downdiagonalstrike");
      break;
    case "\\phase":
      n.setAttribute("notation", "phasorangle");
      break;
    case "\\sout":
      n.setAttribute("notation", "horizontalstrike");
      break;
    case "\\fbox":
      n.setAttribute("notation", "box");
      break;
    case "\\angl":
      n.setAttribute("notation", "actuarial");
      break;
    case "\\fcolorbox":
    case "\\colorbox":
      if (e = t.fontMetrics().fboxsep * t.fontMetrics().ptPerEm, n.setAttribute("width", "+" + 2 * e + "pt"), n.setAttribute("height", "+" + 2 * e + "pt"), n.setAttribute("lspace", e + "pt"), n.setAttribute("voffset", e + "pt"), i.label === "\\fcolorbox") {
        var s = Math.max(
          t.fontMetrics().fboxrule,
          // default
          t.minRuleThickness
          // user override
        );
        n.setAttribute("style", "border: " + s + "em solid " + String(i.borderColor));
      }
      break;
    case "\\xcancel":
      n.setAttribute("notation", "updiagonalstrike downdiagonalstrike");
      break;
  }
  return i.backgroundColor && n.setAttribute("mathbackground", i.backgroundColor), n;
};
qt({
  type: "enclose",
  names: ["\\colorbox"],
  props: {
    numArgs: 2,
    allowedInText: !0,
    argTypes: ["color", "text"]
  },
  handler(i, t, e) {
    var {
      parser: n,
      funcName: s
    } = i, r = ve(t[0], "color-token").color, a = t[1];
    return {
      type: "enclose",
      mode: n.mode,
      label: s,
      backgroundColor: r,
      body: a
    };
  },
  htmlBuilder: zw,
  mathmlBuilder: Uw
});
qt({
  type: "enclose",
  names: ["\\fcolorbox"],
  props: {
    numArgs: 3,
    allowedInText: !0,
    argTypes: ["color", "color", "text"]
  },
  handler(i, t, e) {
    var {
      parser: n,
      funcName: s
    } = i, r = ve(t[0], "color-token").color, a = ve(t[1], "color-token").color, o = t[2];
    return {
      type: "enclose",
      mode: n.mode,
      label: s,
      backgroundColor: a,
      borderColor: r,
      body: o
    };
  },
  htmlBuilder: zw,
  mathmlBuilder: Uw
});
qt({
  type: "enclose",
  names: ["\\fbox"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: !0
  },
  handler(i, t) {
    var {
      parser: e
    } = i;
    return {
      type: "enclose",
      mode: e.mode,
      label: "\\fbox",
      body: t[0]
    };
  }
});
qt({
  type: "enclose",
  names: ["\\cancel", "\\bcancel", "\\xcancel", "\\sout", "\\phase"],
  props: {
    numArgs: 1
  },
  handler(i, t) {
    var {
      parser: e,
      funcName: n
    } = i, s = t[0];
    return {
      type: "enclose",
      mode: e.mode,
      label: n,
      body: s
    };
  },
  htmlBuilder: zw,
  mathmlBuilder: Uw
});
qt({
  type: "enclose",
  names: ["\\angl"],
  props: {
    numArgs: 1,
    argTypes: ["hbox"],
    allowedInText: !1
  },
  handler(i, t) {
    var {
      parser: e
    } = i;
    return {
      type: "enclose",
      mode: e.mode,
      label: "\\angl",
      body: t[0]
    };
  }
});
var HF = {};
function Ro(i) {
  for (var {
    type: t,
    names: e,
    props: n,
    handler: s,
    htmlBuilder: r,
    mathmlBuilder: a
  } = i, o = {
    type: t,
    numArgs: n.numArgs || 0,
    allowedInText: !1,
    numOptionalArgs: 0,
    handler: s
  }, l = 0; l < e.length; ++l)
    HF[e[l]] = o;
  r && (N3[t] = r), a && (L3[t] = a);
}
var cW = {};
function P(i, t) {
  cW[i] = t;
}
function Lk(i) {
  var t = [];
  i.consumeSpaces();
  var e = i.fetch().text;
  for (e === "\\relax" && (i.consume(), i.consumeSpaces(), e = i.fetch().text); e === "\\hline" || e === "\\hdashline"; )
    i.consume(), t.push(e === "\\hdashline"), i.consumeSpaces(), e = i.fetch().text;
  return t;
}
var Q4 = (i) => {
  var t = i.parser.settings;
  if (!t.displayMode)
    throw new te("{" + i.envName + "} can be used only in display mode.");
};
function Hw(i) {
  if (i.indexOf("ed") === -1)
    return i.indexOf("*") === -1;
}
function _0(i, t, e) {
  var {
    hskipBeforeAndAfter: n,
    addJot: s,
    cols: r,
    arraystretch: a,
    colSeparationType: o,
    autoTag: l,
    singleRow: c,
    emptySingleRow: h,
    maxNumCols: u,
    leqno: f
  } = t;
  if (i.gullet.beginGroup(), c || i.gullet.macros.set("\\cr", "\\\\\\relax"), !a) {
    var d = i.gullet.expandMacroAsText("\\arraystretch");
    if (d == null)
      a = 1;
    else if (a = parseFloat(d), !a || a < 0)
      throw new te("Invalid \\arraystretch: " + d);
  }
  i.gullet.beginGroup();
  var p = [], g = [p], b = [], y = [], v = l != null ? [] : void 0;
  function w() {
    l && i.gullet.macros.set("\\@eqnsw", "1", !0);
  }
  function _() {
    v && (i.gullet.macros.get("\\df@tag") ? (v.push(i.subparse([new Mw("\\df@tag")])), i.gullet.macros.set("\\df@tag", void 0, !0)) : v.push(!!l && i.gullet.macros.get("\\@eqnsw") === "1"));
  }
  for (w(), y.push(Lk(i)); ; ) {
    var x = i.parseExpression(!1, c ? "\\end" : "\\\\");
    i.gullet.endGroup(), i.gullet.beginGroup(), x = {
      type: "ordgroup",
      mode: i.mode,
      body: x
    }, e && (x = {
      type: "styling",
      mode: i.mode,
      style: e,
      body: [x]
    }), p.push(x);
    var k = i.fetch().text;
    if (k === "&") {
      if (u && p.length === u) {
        if (c || o)
          throw new te("Too many tab characters: &", i.nextToken);
        i.settings.reportNonstrict("textEnv", "Too few columns specified in the {array} column argument.");
      }
      i.consume();
    } else if (k === "\\end") {
      _(), p.length === 1 && x.type === "styling" && x.body[0].body.length === 0 && (g.length > 1 || !h) && g.pop(), y.length < g.length + 1 && y.push([]);
      break;
    } else if (k === "\\\\") {
      i.consume();
      var S = void 0;
      i.gullet.future().text !== " " && (S = i.parseSizeGroup(!0)), b.push(S ? S.value : null), _(), y.push(Lk(i)), p = [], g.push(p), w();
    } else
      throw new te("Expected & or \\\\ or \\cr or \\end", i.nextToken);
  }
  return i.gullet.endGroup(), i.gullet.endGroup(), {
    type: "array",
    mode: i.mode,
    addJot: s,
    arraystretch: a,
    body: g,
    cols: r,
    rowGaps: b,
    hskipBeforeAndAfter: n,
    hLinesBeforeRow: y,
    colSeparationType: o,
    tags: v,
    leqno: f
  };
}
function jw(i) {
  return i.slice(0, 1) === "d" ? "display" : "text";
}
var Bo = function(t, e) {
  var n, s, r = t.body.length, a = t.hLinesBeforeRow, o = 0, l = new Array(r), c = [], h = Math.max(
    // From LaTeX \showthe\arrayrulewidth. Equals 0.04 em.
    e.fontMetrics().arrayRuleWidth,
    e.minRuleThickness
    // User override.
  ), u = 1 / e.fontMetrics().ptPerEm, f = 5 * u;
  if (t.colSeparationType && t.colSeparationType === "small") {
    var d = e.havingStyle(re.SCRIPT).sizeMultiplier;
    f = 0.2778 * (d / e.sizeMultiplier);
  }
  var p = t.colSeparationType === "CD" ? Ai({
    number: 3,
    unit: "ex"
  }, e) : 12 * u, g = 3 * u, b = t.arraystretch * p, y = 0.7 * b, v = 0.3 * b, w = 0;
  function _(yt) {
    for (var Ot = 0; Ot < yt.length; ++Ot)
      Ot > 0 && (w += 0.25), c.push({
        pos: w,
        isDashed: yt[Ot]
      });
  }
  for (_(a[0]), n = 0; n < t.body.length; ++n) {
    var x = t.body[n], k = y, S = v;
    o < x.length && (o = x.length);
    var T = new Array(x.length);
    for (s = 0; s < x.length; ++s) {
      var I = qe(x[s], e);
      S < I.depth && (S = I.depth), k < I.height && (k = I.height), T[s] = I;
    }
    var R = t.rowGaps[n], B = 0;
    R && (B = Ai(R, e), B > 0 && (B += v, S < B && (S = B), B = 0)), t.addJot && (S += g), T.height = k, T.depth = S, w += k, T.pos = w, w += S + B, l[n] = T, _(a[n + 1]);
  }
  var L = w / 2 + e.fontMetrics().axisHeight, it = t.cols || [], O = [], at, W, q = [];
  if (t.tags && t.tags.some((yt) => yt))
    for (n = 0; n < r; ++n) {
      var K = l[n], z = K.pos - L, j = t.tags[n], N = void 0;
      j === !0 ? N = pt.makeSpan(["eqn-num"], [], e) : j === !1 ? N = pt.makeSpan([], [], e) : N = pt.makeSpan([], Rn(j, e, !0), e), N.depth = K.depth, N.height = K.height, q.push({
        type: "elem",
        elem: N,
        shift: z
      });
    }
  for (
    s = 0, W = 0;
    // Continue while either there are more columns or more column
    // descriptions, so trailing separators don't get lost.
    s < o || W < it.length;
    ++s, ++W
  ) {
    for (var Q = it[W] || {}, Y = !0; Q.type === "separator"; ) {
      if (Y || (at = pt.makeSpan(["arraycolsep"], []), at.style.width = Nt(e.fontMetrics().doubleRuleSep), O.push(at)), Q.separator === "|" || Q.separator === ":") {
        var et = Q.separator === "|" ? "solid" : "dashed", $ = pt.makeSpan(["vertical-separator"], [], e);
        $.style.height = Nt(w), $.style.borderRightWidth = Nt(h), $.style.borderRightStyle = et, $.style.margin = "0 " + Nt(-h / 2);
        var dt = w - L;
        dt && ($.style.verticalAlign = Nt(-dt)), O.push($);
      } else
        throw new te("Invalid separator type: " + Q.separator);
      W++, Q = it[W] || {}, Y = !1;
    }
    if (!(s >= o)) {
      var tt = void 0;
      (s > 0 || t.hskipBeforeAndAfter) && (tt = ne.deflt(Q.pregap, f), tt !== 0 && (at = pt.makeSpan(["arraycolsep"], []), at.style.width = Nt(tt), O.push(at)));
      var ut = [];
      for (n = 0; n < r; ++n) {
        var St = l[n], G = St[s];
        if (G) {
          var V = St.pos - L;
          G.depth = St.depth, G.height = St.height, ut.push({
            type: "elem",
            elem: G,
            shift: V
          });
        }
      }
      ut = pt.makeVList({
        positionType: "individualShift",
        children: ut
      }, e), ut = pt.makeSpan(["col-align-" + (Q.align || "c")], [ut]), O.push(ut), (s < o - 1 || t.hskipBeforeAndAfter) && (tt = ne.deflt(Q.postgap, f), tt !== 0 && (at = pt.makeSpan(["arraycolsep"], []), at.style.width = Nt(tt), O.push(at)));
    }
  }
  if (l = pt.makeSpan(["mtable"], O), c.length > 0) {
    for (var nt = pt.makeLineSpan("hline", e, h), gt = pt.makeLineSpan("hdashline", e, h), _t = [{
      type: "elem",
      elem: l,
      shift: 0
    }]; c.length > 0; ) {
      var kt = c.pop(), xt = kt.pos - L;
      kt.isDashed ? _t.push({
        type: "elem",
        elem: gt,
        shift: xt
      }) : _t.push({
        type: "elem",
        elem: nt,
        shift: xt
      });
    }
    l = pt.makeVList({
      positionType: "individualShift",
      children: _t
    }, e);
  }
  if (q.length === 0)
    return pt.makeSpan(["mord"], [l], e);
  var wt = pt.makeVList({
    positionType: "individualShift",
    children: q
  }, e);
  return wt = pt.makeSpan(["tag"], [wt], e), pt.makeFragment([l, wt]);
}, hW = {
  c: "center ",
  l: "left ",
  r: "right "
}, Po = function(t, e) {
  for (var n = [], s = new Mt.MathNode("mtd", [], ["mtr-glue"]), r = new Mt.MathNode("mtd", [], ["mml-eqn-num"]), a = 0; a < t.body.length; a++) {
    for (var o = t.body[a], l = [], c = 0; c < o.length; c++)
      l.push(new Mt.MathNode("mtd", [ei(o[c], e)]));
    t.tags && t.tags[a] && (l.unshift(s), l.push(s), t.leqno ? l.unshift(r) : l.push(r)), n.push(new Mt.MathNode("mtr", l));
  }
  var h = new Mt.MathNode("mtable", n), u = t.arraystretch === 0.5 ? 0.1 : 0.16 + t.arraystretch - 1 + (t.addJot ? 0.09 : 0);
  h.setAttribute("rowspacing", Nt(u));
  var f = "", d = "";
  if (t.cols && t.cols.length > 0) {
    var p = t.cols, g = "", b = !1, y = 0, v = p.length;
    p[0].type === "separator" && (f += "top ", y = 1), p[p.length - 1].type === "separator" && (f += "bottom ", v -= 1);
    for (var w = y; w < v; w++)
      p[w].type === "align" ? (d += hW[p[w].align], b && (g += "none "), b = !0) : p[w].type === "separator" && b && (g += p[w].separator === "|" ? "solid " : "dashed ", b = !1);
    h.setAttribute("columnalign", d.trim()), /[sd]/.test(g) && h.setAttribute("columnlines", g.trim());
  }
  if (t.colSeparationType === "align") {
    for (var _ = t.cols || [], x = "", k = 1; k < _.length; k++)
      x += k % 2 ? "0em " : "1em ";
    h.setAttribute("columnspacing", x.trim());
  } else t.colSeparationType === "alignat" || t.colSeparationType === "gather" ? h.setAttribute("columnspacing", "0em") : t.colSeparationType === "small" ? h.setAttribute("columnspacing", "0.2778em") : t.colSeparationType === "CD" ? h.setAttribute("columnspacing", "0.5em") : h.setAttribute("columnspacing", "1em");
  var S = "", T = t.hLinesBeforeRow;
  f += T[0].length > 0 ? "left " : "", f += T[T.length - 1].length > 0 ? "right " : "";
  for (var I = 1; I < T.length - 1; I++)
    S += T[I].length === 0 ? "none " : T[I][0] ? "dashed " : "solid ";
  return /[sd]/.test(S) && h.setAttribute("rowlines", S.trim()), f !== "" && (h = new Mt.MathNode("menclose", [h]), h.setAttribute("notation", f.trim())), t.arraystretch && t.arraystretch < 1 && (h = new Mt.MathNode("mstyle", [h]), h.setAttribute("scriptlevel", "1")), h;
}, jF = function(t, e) {
  t.envName.indexOf("ed") === -1 && Q4(t);
  var n = [], s = t.envName.indexOf("at") > -1 ? "alignat" : "align", r = t.envName === "split", a = _0(t.parser, {
    cols: n,
    addJot: !0,
    autoTag: r ? void 0 : Hw(t.envName),
    emptySingleRow: !0,
    colSeparationType: s,
    maxNumCols: r ? 2 : void 0,
    leqno: t.parser.settings.leqno
  }, "display"), o, l = 0, c = {
    type: "ordgroup",
    mode: t.mode,
    body: []
  };
  if (e[0] && e[0].type === "ordgroup") {
    for (var h = "", u = 0; u < e[0].body.length; u++) {
      var f = ve(e[0].body[u], "textord");
      h += f.text;
    }
    o = Number(h), l = o * 2;
  }
  var d = !l;
  a.body.forEach(function(y) {
    for (var v = 1; v < y.length; v += 2) {
      var w = ve(y[v], "styling"), _ = ve(w.body[0], "ordgroup");
      _.body.unshift(c);
    }
    if (d)
      l < y.length && (l = y.length);
    else {
      var x = y.length / 2;
      if (o < x)
        throw new te("Too many math in a row: " + ("expected " + o + ", but got " + x), y[0]);
    }
  });
  for (var p = 0; p < l; ++p) {
    var g = "r", b = 0;
    p % 2 === 1 ? g = "l" : p > 0 && d && (b = 1), n[p] = {
      type: "align",
      align: g,
      pregap: b,
      postgap: 0
    };
  }
  return a.colSeparationType = d ? "align" : "alignat", a;
};
Ro({
  type: "array",
  names: ["array", "darray"],
  props: {
    numArgs: 1
  },
  handler(i, t) {
    var e = K4(t[0]), n = e ? [t[0]] : ve(t[0], "ordgroup").body, s = n.map(function(a) {
      var o = Ow(a), l = o.text;
      if ("lcr".indexOf(l) !== -1)
        return {
          type: "align",
          align: l
        };
      if (l === "|")
        return {
          type: "separator",
          separator: "|"
        };
      if (l === ":")
        return {
          type: "separator",
          separator: ":"
        };
      throw new te("Unknown column alignment: " + l, a);
    }), r = {
      cols: s,
      hskipBeforeAndAfter: !0,
      // \@preamble in lttab.dtx
      maxNumCols: s.length
    };
    return _0(i.parser, r, jw(i.envName));
  },
  htmlBuilder: Bo,
  mathmlBuilder: Po
});
Ro({
  type: "array",
  names: ["matrix", "pmatrix", "bmatrix", "Bmatrix", "vmatrix", "Vmatrix", "matrix*", "pmatrix*", "bmatrix*", "Bmatrix*", "vmatrix*", "Vmatrix*"],
  props: {
    numArgs: 0
  },
  handler(i) {
    var t = {
      matrix: null,
      pmatrix: ["(", ")"],
      bmatrix: ["[", "]"],
      Bmatrix: ["\\{", "\\}"],
      vmatrix: ["|", "|"],
      Vmatrix: ["\\Vert", "\\Vert"]
    }[i.envName.replace("*", "")], e = "c", n = {
      hskipBeforeAndAfter: !1,
      cols: [{
        type: "align",
        align: e
      }]
    };
    if (i.envName.charAt(i.envName.length - 1) === "*") {
      var s = i.parser;
      if (s.consumeSpaces(), s.fetch().text === "[") {
        if (s.consume(), s.consumeSpaces(), e = s.fetch().text, "lcr".indexOf(e) === -1)
          throw new te("Expected l or c or r", s.nextToken);
        s.consume(), s.consumeSpaces(), s.expect("]"), s.consume(), n.cols = [{
          type: "align",
          align: e
        }];
      }
    }
    var r = _0(i.parser, n, jw(i.envName)), a = Math.max(0, ...r.body.map((o) => o.length));
    return r.cols = new Array(a).fill({
      type: "align",
      align: e
    }), t ? {
      type: "leftright",
      mode: i.mode,
      body: [r],
      left: t[0],
      right: t[1],
      rightColor: void 0
      // \right uninfluenced by \color in array
    } : r;
  },
  htmlBuilder: Bo,
  mathmlBuilder: Po
});
Ro({
  type: "array",
  names: ["smallmatrix"],
  props: {
    numArgs: 0
  },
  handler(i) {
    var t = {
      arraystretch: 0.5
    }, e = _0(i.parser, t, "script");
    return e.colSeparationType = "small", e;
  },
  htmlBuilder: Bo,
  mathmlBuilder: Po
});
Ro({
  type: "array",
  names: ["subarray"],
  props: {
    numArgs: 1
  },
  handler(i, t) {
    var e = K4(t[0]), n = e ? [t[0]] : ve(t[0], "ordgroup").body, s = n.map(function(a) {
      var o = Ow(a), l = o.text;
      if ("lc".indexOf(l) !== -1)
        return {
          type: "align",
          align: l
        };
      throw new te("Unknown column alignment: " + l, a);
    });
    if (s.length > 1)
      throw new te("{subarray} can contain only one column");
    var r = {
      cols: s,
      hskipBeforeAndAfter: !1,
      arraystretch: 0.5
    };
    if (r = _0(i.parser, r, "script"), r.body.length > 0 && r.body[0].length > 1)
      throw new te("{subarray} can contain only one column");
    return r;
  },
  htmlBuilder: Bo,
  mathmlBuilder: Po
});
Ro({
  type: "array",
  names: ["cases", "dcases", "rcases", "drcases"],
  props: {
    numArgs: 0
  },
  handler(i) {
    var t = {
      arraystretch: 1.2,
      cols: [{
        type: "align",
        align: "l",
        pregap: 0,
        // TODO(kevinb) get the current style.
        // For now we use the metrics for TEXT style which is what we were
        // doing before.  Before attempting to get the current style we
        // should look at TeX's behavior especially for \over and matrices.
        postgap: 1
        /* 1em quad */
      }, {
        type: "align",
        align: "l",
        pregap: 0,
        postgap: 0
      }]
    }, e = _0(i.parser, t, jw(i.envName));
    return {
      type: "leftright",
      mode: i.mode,
      body: [e],
      left: i.envName.indexOf("r") > -1 ? "." : "\\{",
      right: i.envName.indexOf("r") > -1 ? "\\}" : ".",
      rightColor: void 0
    };
  },
  htmlBuilder: Bo,
  mathmlBuilder: Po
});
Ro({
  type: "array",
  names: ["align", "align*", "aligned", "split"],
  props: {
    numArgs: 0
  },
  handler: jF,
  htmlBuilder: Bo,
  mathmlBuilder: Po
});
Ro({
  type: "array",
  names: ["gathered", "gather", "gather*"],
  props: {
    numArgs: 0
  },
  handler(i) {
    ne.contains(["gather", "gather*"], i.envName) && Q4(i);
    var t = {
      cols: [{
        type: "align",
        align: "c"
      }],
      addJot: !0,
      colSeparationType: "gather",
      autoTag: Hw(i.envName),
      emptySingleRow: !0,
      leqno: i.parser.settings.leqno
    };
    return _0(i.parser, t, "display");
  },
  htmlBuilder: Bo,
  mathmlBuilder: Po
});
Ro({
  type: "array",
  names: ["alignat", "alignat*", "alignedat"],
  props: {
    numArgs: 1
  },
  handler: jF,
  htmlBuilder: Bo,
  mathmlBuilder: Po
});
Ro({
  type: "array",
  names: ["equation", "equation*"],
  props: {
    numArgs: 0
  },
  handler(i) {
    Q4(i);
    var t = {
      autoTag: Hw(i.envName),
      emptySingleRow: !0,
      singleRow: !0,
      maxNumCols: 1,
      leqno: i.parser.settings.leqno
    };
    return _0(i.parser, t, "display");
  },
  htmlBuilder: Bo,
  mathmlBuilder: Po
});
Ro({
  type: "array",
  names: ["CD"],
  props: {
    numArgs: 0
  },
  handler(i) {
    return Q4(i), YV(i.parser);
  },
  htmlBuilder: Bo,
  mathmlBuilder: Po
});
P("\\nonumber", "\\gdef\\@eqnsw{0}");
P("\\notag", "\\nonumber");
qt({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\hline", "\\hdashline"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !0
  },
  handler(i, t) {
    throw new te(i.funcName + " valid only within array environment");
  }
});
var Ok = HF;
qt({
  type: "environment",
  names: ["\\begin", "\\end"],
  props: {
    numArgs: 1,
    argTypes: ["text"]
  },
  handler(i, t) {
    var {
      parser: e,
      funcName: n
    } = i, s = t[0];
    if (s.type !== "ordgroup")
      throw new te("Invalid environment name", s);
    for (var r = "", a = 0; a < s.body.length; ++a)
      r += ve(s.body[a], "textord").text;
    if (n === "\\begin") {
      if (!Ok.hasOwnProperty(r))
        throw new te("No such environment: " + r, s);
      var o = Ok[r], {
        args: l,
        optArgs: c
      } = e.parseArguments("\\begin{" + r + "}", o), h = {
        mode: e.mode,
        envName: r,
        parser: e
      }, u = o.handler(h, l, c);
      e.expect("\\end", !1);
      var f = e.nextToken, d = ve(e.parseFunction(), "environment");
      if (d.name !== r)
        throw new te("Mismatch: \\begin{" + r + "} matched by \\end{" + d.name + "}", f);
      return u;
    }
    return {
      type: "environment",
      mode: e.mode,
      name: r,
      nameGroup: s
    };
  }
});
var GF = (i, t) => {
  var e = i.font, n = t.withFont(e);
  return qe(i.body, n);
}, VF = (i, t) => {
  var e = i.font, n = t.withFont(e);
  return ei(i.body, n);
}, $k = {
  "\\Bbb": "\\mathbb",
  "\\bold": "\\mathbf",
  "\\frak": "\\mathfrak",
  "\\bm": "\\boldsymbol"
};
qt({
  type: "font",
  names: [
    // styles, except \boldsymbol defined below
    "\\mathrm",
    "\\mathit",
    "\\mathbf",
    "\\mathnormal",
    "\\mathsfit",
    // families
    "\\mathbb",
    "\\mathcal",
    "\\mathfrak",
    "\\mathscr",
    "\\mathsf",
    "\\mathtt",
    // aliases, except \bm defined below
    "\\Bbb",
    "\\bold",
    "\\frak"
  ],
  props: {
    numArgs: 1,
    allowedInArgument: !0
  },
  handler: (i, t) => {
    var {
      parser: e,
      funcName: n
    } = i, s = O3(t[0]), r = n;
    return r in $k && (r = $k[r]), {
      type: "font",
      mode: e.mode,
      font: r.slice(1),
      body: s
    };
  },
  htmlBuilder: GF,
  mathmlBuilder: VF
});
qt({
  type: "mclass",
  names: ["\\boldsymbol", "\\bm"],
  props: {
    numArgs: 1
  },
  handler: (i, t) => {
    var {
      parser: e
    } = i, n = t[0], s = ne.isCharacterBox(n);
    return {
      type: "mclass",
      mode: e.mode,
      mclass: Z4(n),
      body: [{
        type: "font",
        mode: e.mode,
        font: "boldsymbol",
        body: n
      }],
      isCharacterBox: s
    };
  }
});
qt({
  type: "font",
  names: ["\\rm", "\\sf", "\\tt", "\\bf", "\\it", "\\cal"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler: (i, t) => {
    var {
      parser: e,
      funcName: n,
      breakOnTokenText: s
    } = i, {
      mode: r
    } = e, a = e.parseExpression(!0, s), o = "math" + n.slice(1);
    return {
      type: "font",
      mode: r,
      font: o,
      body: {
        type: "ordgroup",
        mode: e.mode,
        body: a
      }
    };
  },
  htmlBuilder: GF,
  mathmlBuilder: VF
});
var WF = (i, t) => {
  var e = t;
  return i === "display" ? e = e.id >= re.SCRIPT.id ? e.text() : re.DISPLAY : i === "text" && e.size === re.DISPLAY.size ? e = re.TEXT : i === "script" ? e = re.SCRIPT : i === "scriptscript" && (e = re.SCRIPTSCRIPT), e;
}, Gw = (i, t) => {
  var e = WF(i.size, t.style), n = e.fracNum(), s = e.fracDen(), r;
  r = t.havingStyle(n);
  var a = qe(i.numer, r, t);
  if (i.continued) {
    var o = 8.5 / t.fontMetrics().ptPerEm, l = 3.5 / t.fontMetrics().ptPerEm;
    a.height = a.height < o ? o : a.height, a.depth = a.depth < l ? l : a.depth;
  }
  r = t.havingStyle(s);
  var c = qe(i.denom, r, t), h, u, f;
  i.hasBarLine ? (i.barSize ? (u = Ai(i.barSize, t), h = pt.makeLineSpan("frac-line", t, u)) : h = pt.makeLineSpan("frac-line", t), u = h.height, f = h.height) : (h = null, u = 0, f = t.fontMetrics().defaultRuleThickness);
  var d, p, g;
  e.size === re.DISPLAY.size || i.size === "display" ? (d = t.fontMetrics().num1, u > 0 ? p = 3 * f : p = 7 * f, g = t.fontMetrics().denom1) : (u > 0 ? (d = t.fontMetrics().num2, p = f) : (d = t.fontMetrics().num3, p = 3 * f), g = t.fontMetrics().denom2);
  var b;
  if (h) {
    var v = t.fontMetrics().axisHeight;
    d - a.depth - (v + 0.5 * u) < p && (d += p - (d - a.depth - (v + 0.5 * u))), v - 0.5 * u - (c.height - g) < p && (g += p - (v - 0.5 * u - (c.height - g)));
    var w = -(v - 0.5 * u);
    b = pt.makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: c,
        shift: g
      }, {
        type: "elem",
        elem: h,
        shift: w
      }, {
        type: "elem",
        elem: a,
        shift: -d
      }]
    }, t);
  } else {
    var y = d - a.depth - (c.height - g);
    y < p && (d += 0.5 * (p - y), g += 0.5 * (p - y)), b = pt.makeVList({
      positionType: "individualShift",
      children: [{
        type: "elem",
        elem: c,
        shift: g
      }, {
        type: "elem",
        elem: a,
        shift: -d
      }]
    }, t);
  }
  r = t.havingStyle(e), b.height *= r.sizeMultiplier / t.sizeMultiplier, b.depth *= r.sizeMultiplier / t.sizeMultiplier;
  var _;
  e.size === re.DISPLAY.size ? _ = t.fontMetrics().delim1 : e.size === re.SCRIPTSCRIPT.size ? _ = t.havingStyle(re.SCRIPT).fontMetrics().delim2 : _ = t.fontMetrics().delim2;
  var x, k;
  return i.leftDelim == null ? x = xp(t, ["mopen"]) : x = $l.customSizedDelim(i.leftDelim, _, !0, t.havingStyle(e), i.mode, ["mopen"]), i.continued ? k = pt.makeSpan([]) : i.rightDelim == null ? k = xp(t, ["mclose"]) : k = $l.customSizedDelim(i.rightDelim, _, !0, t.havingStyle(e), i.mode, ["mclose"]), pt.makeSpan(["mord"].concat(r.sizingClasses(t)), [x, pt.makeSpan(["mfrac"], [b]), k], t);
}, Vw = (i, t) => {
  var e = new Mt.MathNode("mfrac", [ei(i.numer, t), ei(i.denom, t)]);
  if (!i.hasBarLine)
    e.setAttribute("linethickness", "0px");
  else if (i.barSize) {
    var n = Ai(i.barSize, t);
    e.setAttribute("linethickness", Nt(n));
  }
  var s = WF(i.size, t.style);
  if (s.size !== t.style.size) {
    e = new Mt.MathNode("mstyle", [e]);
    var r = s.size === re.DISPLAY.size ? "true" : "false";
    e.setAttribute("displaystyle", r), e.setAttribute("scriptlevel", "0");
  }
  if (i.leftDelim != null || i.rightDelim != null) {
    var a = [];
    if (i.leftDelim != null) {
      var o = new Mt.MathNode("mo", [new Mt.TextNode(i.leftDelim.replace("\\", ""))]);
      o.setAttribute("fence", "true"), a.push(o);
    }
    if (a.push(e), i.rightDelim != null) {
      var l = new Mt.MathNode("mo", [new Mt.TextNode(i.rightDelim.replace("\\", ""))]);
      l.setAttribute("fence", "true"), a.push(l);
    }
    return Nw(a);
  }
  return e;
};
qt({
  type: "genfrac",
  names: [
    "\\dfrac",
    "\\frac",
    "\\tfrac",
    "\\dbinom",
    "\\binom",
    "\\tbinom",
    "\\\\atopfrac",
    // can’t be entered directly
    "\\\\bracefrac",
    "\\\\brackfrac"
    // ditto
  ],
  props: {
    numArgs: 2,
    allowedInArgument: !0
  },
  handler: (i, t) => {
    var {
      parser: e,
      funcName: n
    } = i, s = t[0], r = t[1], a, o = null, l = null, c = "auto";
    switch (n) {
      case "\\dfrac":
      case "\\frac":
      case "\\tfrac":
        a = !0;
        break;
      case "\\\\atopfrac":
        a = !1;
        break;
      case "\\dbinom":
      case "\\binom":
      case "\\tbinom":
        a = !1, o = "(", l = ")";
        break;
      case "\\\\bracefrac":
        a = !1, o = "\\{", l = "\\}";
        break;
      case "\\\\brackfrac":
        a = !1, o = "[", l = "]";
        break;
      default:
        throw new Error("Unrecognized genfrac command");
    }
    switch (n) {
      case "\\dfrac":
      case "\\dbinom":
        c = "display";
        break;
      case "\\tfrac":
      case "\\tbinom":
        c = "text";
        break;
    }
    return {
      type: "genfrac",
      mode: e.mode,
      continued: !1,
      numer: s,
      denom: r,
      hasBarLine: a,
      leftDelim: o,
      rightDelim: l,
      size: c,
      barSize: null
    };
  },
  htmlBuilder: Gw,
  mathmlBuilder: Vw
});
qt({
  type: "genfrac",
  names: ["\\cfrac"],
  props: {
    numArgs: 2
  },
  handler: (i, t) => {
    var {
      parser: e,
      funcName: n
    } = i, s = t[0], r = t[1];
    return {
      type: "genfrac",
      mode: e.mode,
      continued: !0,
      numer: s,
      denom: r,
      hasBarLine: !0,
      leftDelim: null,
      rightDelim: null,
      size: "display",
      barSize: null
    };
  }
});
qt({
  type: "infix",
  names: ["\\over", "\\choose", "\\atop", "\\brace", "\\brack"],
  props: {
    numArgs: 0,
    infix: !0
  },
  handler(i) {
    var {
      parser: t,
      funcName: e,
      token: n
    } = i, s;
    switch (e) {
      case "\\over":
        s = "\\frac";
        break;
      case "\\choose":
        s = "\\binom";
        break;
      case "\\atop":
        s = "\\\\atopfrac";
        break;
      case "\\brace":
        s = "\\\\bracefrac";
        break;
      case "\\brack":
        s = "\\\\brackfrac";
        break;
      default:
        throw new Error("Unrecognized infix genfrac command");
    }
    return {
      type: "infix",
      mode: t.mode,
      replaceWith: s,
      token: n
    };
  }
});
var qk = ["display", "text", "script", "scriptscript"], zk = function(t) {
  var e = null;
  return t.length > 0 && (e = t, e = e === "." ? null : e), e;
};
qt({
  type: "genfrac",
  names: ["\\genfrac"],
  props: {
    numArgs: 6,
    allowedInArgument: !0,
    argTypes: ["math", "math", "size", "text", "math", "math"]
  },
  handler(i, t) {
    var {
      parser: e
    } = i, n = t[4], s = t[5], r = O3(t[0]), a = r.type === "atom" && r.family === "open" ? zk(r.text) : null, o = O3(t[1]), l = o.type === "atom" && o.family === "close" ? zk(o.text) : null, c = ve(t[2], "size"), h, u = null;
    c.isBlank ? h = !0 : (u = c.value, h = u.number > 0);
    var f = "auto", d = t[3];
    if (d.type === "ordgroup") {
      if (d.body.length > 0) {
        var p = ve(d.body[0], "textord");
        f = qk[Number(p.text)];
      }
    } else
      d = ve(d, "textord"), f = qk[Number(d.text)];
    return {
      type: "genfrac",
      mode: e.mode,
      numer: n,
      denom: s,
      continued: !1,
      hasBarLine: h,
      barSize: u,
      leftDelim: a,
      rightDelim: l,
      size: f
    };
  },
  htmlBuilder: Gw,
  mathmlBuilder: Vw
});
qt({
  type: "infix",
  names: ["\\above"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    infix: !0
  },
  handler(i, t) {
    var {
      parser: e,
      funcName: n,
      token: s
    } = i;
    return {
      type: "infix",
      mode: e.mode,
      replaceWith: "\\\\abovefrac",
      size: ve(t[0], "size").value,
      token: s
    };
  }
});
qt({
  type: "genfrac",
  names: ["\\\\abovefrac"],
  props: {
    numArgs: 3,
    argTypes: ["math", "size", "math"]
  },
  handler: (i, t) => {
    var {
      parser: e,
      funcName: n
    } = i, s = t[0], r = jG(ve(t[1], "infix").size), a = t[2], o = r.number > 0;
    return {
      type: "genfrac",
      mode: e.mode,
      numer: s,
      denom: a,
      continued: !1,
      hasBarLine: o,
      barSize: r,
      leftDelim: null,
      rightDelim: null,
      size: "auto"
    };
  },
  htmlBuilder: Gw,
  mathmlBuilder: Vw
});
var XF = (i, t) => {
  var e = t.style, n, s;
  i.type === "supsub" ? (n = i.sup ? qe(i.sup, t.havingStyle(e.sup()), t) : qe(i.sub, t.havingStyle(e.sub()), t), s = ve(i.base, "horizBrace")) : s = ve(i, "horizBrace");
  var r = qe(s.base, t.havingBaseStyle(re.DISPLAY)), a = Yl.svgSpan(s, t), o;
  if (s.isOver ? (o = pt.makeVList({
    positionType: "firstBaseline",
    children: [{
      type: "elem",
      elem: r
    }, {
      type: "kern",
      size: 0.1
    }, {
      type: "elem",
      elem: a
    }]
  }, t), o.children[0].children[0].children[1].classes.push("svg-align")) : (o = pt.makeVList({
    positionType: "bottom",
    positionData: r.depth + 0.1 + a.height,
    children: [{
      type: "elem",
      elem: a
    }, {
      type: "kern",
      size: 0.1
    }, {
      type: "elem",
      elem: r
    }]
  }, t), o.children[0].children[0].children[0].classes.push("svg-align")), n) {
    var l = pt.makeSpan(["mord", s.isOver ? "mover" : "munder"], [o], t);
    s.isOver ? o = pt.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: l
      }, {
        type: "kern",
        size: 0.2
      }, {
        type: "elem",
        elem: n
      }]
    }, t) : o = pt.makeVList({
      positionType: "bottom",
      positionData: l.depth + 0.2 + n.height + n.depth,
      children: [{
        type: "elem",
        elem: n
      }, {
        type: "kern",
        size: 0.2
      }, {
        type: "elem",
        elem: l
      }]
    }, t);
  }
  return pt.makeSpan(["mord", s.isOver ? "mover" : "munder"], [o], t);
}, uW = (i, t) => {
  var e = Yl.mathMLnode(i.label);
  return new Mt.MathNode(i.isOver ? "mover" : "munder", [ei(i.base, t), e]);
};
qt({
  type: "horizBrace",
  names: ["\\overbrace", "\\underbrace"],
  props: {
    numArgs: 1
  },
  handler(i, t) {
    var {
      parser: e,
      funcName: n
    } = i;
    return {
      type: "horizBrace",
      mode: e.mode,
      label: n,
      isOver: /^\\over/.test(n),
      base: t[0]
    };
  },
  htmlBuilder: XF,
  mathmlBuilder: uW
});
qt({
  type: "href",
  names: ["\\href"],
  props: {
    numArgs: 2,
    argTypes: ["url", "original"],
    allowedInText: !0
  },
  handler: (i, t) => {
    var {
      parser: e
    } = i, n = t[1], s = ve(t[0], "url").url;
    return e.settings.isTrusted({
      command: "\\href",
      url: s
    }) ? {
      type: "href",
      mode: e.mode,
      href: s,
      body: qi(n)
    } : e.formatUnsupportedCmd("\\href");
  },
  htmlBuilder: (i, t) => {
    var e = Rn(i.body, t, !1);
    return pt.makeAnchor(i.href, [], e, t);
  },
  mathmlBuilder: (i, t) => {
    var e = g0(i.body, t);
    return e instanceof Or || (e = new Or("mrow", [e])), e.setAttribute("href", i.href), e;
  }
});
qt({
  type: "href",
  names: ["\\url"],
  props: {
    numArgs: 1,
    argTypes: ["url"],
    allowedInText: !0
  },
  handler: (i, t) => {
    var {
      parser: e
    } = i, n = ve(t[0], "url").url;
    if (!e.settings.isTrusted({
      command: "\\url",
      url: n
    }))
      return e.formatUnsupportedCmd("\\url");
    for (var s = [], r = 0; r < n.length; r++) {
      var a = n[r];
      a === "~" && (a = "\\textasciitilde"), s.push({
        type: "textord",
        mode: "text",
        text: a
      });
    }
    var o = {
      type: "text",
      mode: e.mode,
      font: "\\texttt",
      body: s
    };
    return {
      type: "href",
      mode: e.mode,
      href: n,
      body: qi(o)
    };
  }
});
qt({
  type: "hbox",
  names: ["\\hbox"],
  props: {
    numArgs: 1,
    argTypes: ["text"],
    allowedInText: !0,
    primitive: !0
  },
  handler(i, t) {
    var {
      parser: e
    } = i;
    return {
      type: "hbox",
      mode: e.mode,
      body: qi(t[0])
    };
  },
  htmlBuilder(i, t) {
    var e = Rn(i.body, t, !1);
    return pt.makeFragment(e);
  },
  mathmlBuilder(i, t) {
    return new Mt.MathNode("mrow", dr(i.body, t));
  }
});
qt({
  type: "html",
  names: ["\\htmlClass", "\\htmlId", "\\htmlStyle", "\\htmlData"],
  props: {
    numArgs: 2,
    argTypes: ["raw", "original"],
    allowedInText: !0
  },
  handler: (i, t) => {
    var {
      parser: e,
      funcName: n,
      token: s
    } = i, r = ve(t[0], "raw").string, a = t[1];
    e.settings.strict && e.settings.reportNonstrict("htmlExtension", "HTML extension is disabled on strict mode");
    var o, l = {};
    switch (n) {
      case "\\htmlClass":
        l.class = r, o = {
          command: "\\htmlClass",
          class: r
        };
        break;
      case "\\htmlId":
        l.id = r, o = {
          command: "\\htmlId",
          id: r
        };
        break;
      case "\\htmlStyle":
        l.style = r, o = {
          command: "\\htmlStyle",
          style: r
        };
        break;
      case "\\htmlData": {
        for (var c = r.split(","), h = 0; h < c.length; h++) {
          var u = c[h].split("=");
          if (u.length !== 2)
            throw new te("Error parsing key-value for \\htmlData");
          l["data-" + u[0].trim()] = u[1].trim();
        }
        o = {
          command: "\\htmlData",
          attributes: l
        };
        break;
      }
      default:
        throw new Error("Unrecognized html command");
    }
    return e.settings.isTrusted(o) ? {
      type: "html",
      mode: e.mode,
      attributes: l,
      body: qi(a)
    } : e.formatUnsupportedCmd(n);
  },
  htmlBuilder: (i, t) => {
    var e = Rn(i.body, t, !1), n = ["enclosing"];
    i.attributes.class && n.push(...i.attributes.class.trim().split(/\s+/));
    var s = pt.makeSpan(n, e, t);
    for (var r in i.attributes)
      r !== "class" && i.attributes.hasOwnProperty(r) && s.setAttribute(r, i.attributes[r]);
    return s;
  },
  mathmlBuilder: (i, t) => g0(i.body, t)
});
qt({
  type: "htmlmathml",
  names: ["\\html@mathml"],
  props: {
    numArgs: 2,
    allowedInText: !0
  },
  handler: (i, t) => {
    var {
      parser: e
    } = i;
    return {
      type: "htmlmathml",
      mode: e.mode,
      html: qi(t[0]),
      mathml: qi(t[1])
    };
  },
  htmlBuilder: (i, t) => {
    var e = Rn(i.html, t, !1);
    return pt.makeFragment(e);
  },
  mathmlBuilder: (i, t) => g0(i.mathml, t)
});
var l7 = function(t) {
  if (/^[-+]? *(\d+(\.\d*)?|\.\d+)$/.test(t))
    return {
      number: +t,
      unit: "bp"
    };
  var e = /([-+]?) *(\d+(?:\.\d*)?|\.\d+) *([a-z]{2})/.exec(t);
  if (!e)
    throw new te("Invalid size: '" + t + "' in \\includegraphics");
  var n = {
    number: +(e[1] + e[2]),
    // sign + magnitude, cast to number
    unit: e[3]
  };
  if (!uV(n))
    throw new te("Invalid unit: '" + n.unit + "' in \\includegraphics.");
  return n;
};
qt({
  type: "includegraphics",
  names: ["\\includegraphics"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    argTypes: ["raw", "url"],
    allowedInText: !1
  },
  handler: (i, t, e) => {
    var {
      parser: n
    } = i, s = {
      number: 0,
      unit: "em"
    }, r = {
      number: 0.9,
      unit: "em"
    }, a = {
      number: 0,
      unit: "em"
    }, o = "";
    if (e[0])
      for (var l = ve(e[0], "raw").string, c = l.split(","), h = 0; h < c.length; h++) {
        var u = c[h].split("=");
        if (u.length === 2) {
          var f = u[1].trim();
          switch (u[0].trim()) {
            case "alt":
              o = f;
              break;
            case "width":
              s = l7(f);
              break;
            case "height":
              r = l7(f);
              break;
            case "totalheight":
              a = l7(f);
              break;
            default:
              throw new te("Invalid key: '" + u[0] + "' in \\includegraphics.");
          }
        }
      }
    var d = ve(t[0], "url").url;
    return o === "" && (o = d, o = o.replace(/^.*[\\/]/, ""), o = o.substring(0, o.lastIndexOf("."))), n.settings.isTrusted({
      command: "\\includegraphics",
      url: d
    }) ? {
      type: "includegraphics",
      mode: n.mode,
      alt: o,
      width: s,
      height: r,
      totalheight: a,
      src: d
    } : n.formatUnsupportedCmd("\\includegraphics");
  },
  htmlBuilder: (i, t) => {
    var e = Ai(i.height, t), n = 0;
    i.totalheight.number > 0 && (n = Ai(i.totalheight, t) - e);
    var s = 0;
    i.width.number > 0 && (s = Ai(i.width, t));
    var r = {
      height: Nt(e + n)
    };
    s > 0 && (r.width = Nt(s)), n > 0 && (r.verticalAlign = Nt(-n));
    var a = new fV(i.src, i.alt, r);
    return a.height = e, a.depth = n, a;
  },
  mathmlBuilder: (i, t) => {
    var e = new Mt.MathNode("mglyph", []);
    e.setAttribute("alt", i.alt);
    var n = Ai(i.height, t), s = 0;
    if (i.totalheight.number > 0 && (s = Ai(i.totalheight, t) - n, e.setAttribute("valign", Nt(-s))), e.setAttribute("height", Nt(n + s)), i.width.number > 0) {
      var r = Ai(i.width, t);
      e.setAttribute("width", Nt(r));
    }
    return e.setAttribute("src", i.src), e;
  }
});
qt({
  type: "kern",
  names: ["\\kern", "\\mkern", "\\hskip", "\\mskip"],
  props: {
    numArgs: 1,
    argTypes: ["size"],
    primitive: !0,
    allowedInText: !0
  },
  handler(i, t) {
    var {
      parser: e,
      funcName: n
    } = i, s = ve(t[0], "size");
    if (e.settings.strict) {
      var r = n[1] === "m", a = s.value.unit === "mu";
      r ? (a || e.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + n + " supports only mu units, " + ("not " + s.value.unit + " units")), e.mode !== "math" && e.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + n + " works only in math mode")) : a && e.settings.reportNonstrict("mathVsTextUnits", "LaTeX's " + n + " doesn't support mu units");
    }
    return {
      type: "kern",
      mode: e.mode,
      dimension: s.value
    };
  },
  htmlBuilder(i, t) {
    return pt.makeGlue(i.dimension, t);
  },
  mathmlBuilder(i, t) {
    var e = Ai(i.dimension, t);
    return new Mt.SpaceNode(e);
  }
});
qt({
  type: "lap",
  names: ["\\mathllap", "\\mathrlap", "\\mathclap"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (i, t) => {
    var {
      parser: e,
      funcName: n
    } = i, s = t[0];
    return {
      type: "lap",
      mode: e.mode,
      alignment: n.slice(5),
      body: s
    };
  },
  htmlBuilder: (i, t) => {
    var e;
    i.alignment === "clap" ? (e = pt.makeSpan([], [qe(i.body, t)]), e = pt.makeSpan(["inner"], [e], t)) : e = pt.makeSpan(["inner"], [qe(i.body, t)]);
    var n = pt.makeSpan(["fix"], []), s = pt.makeSpan([i.alignment], [e, n], t), r = pt.makeSpan(["strut"]);
    return r.style.height = Nt(s.height + s.depth), s.depth && (r.style.verticalAlign = Nt(-s.depth)), s.children.unshift(r), s = pt.makeSpan(["thinbox"], [s], t), pt.makeSpan(["mord", "vbox"], [s], t);
  },
  mathmlBuilder: (i, t) => {
    var e = new Mt.MathNode("mpadded", [ei(i.body, t)]);
    if (i.alignment !== "rlap") {
      var n = i.alignment === "llap" ? "-1" : "-0.5";
      e.setAttribute("lspace", n + "width");
    }
    return e.setAttribute("width", "0px"), e;
  }
});
qt({
  type: "styling",
  names: ["\\(", "$"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !1
  },
  handler(i, t) {
    var {
      funcName: e,
      parser: n
    } = i, s = n.mode;
    n.switchMode("math");
    var r = e === "\\(" ? "\\)" : "$", a = n.parseExpression(!1, r);
    return n.expect(r), n.switchMode(s), {
      type: "styling",
      mode: n.mode,
      style: "text",
      body: a
    };
  }
});
qt({
  type: "text",
  // Doesn't matter what this is.
  names: ["\\)", "\\]"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInMath: !1
  },
  handler(i, t) {
    throw new te("Mismatched " + i.funcName);
  }
});
var Uk = (i, t) => {
  switch (t.style.size) {
    case re.DISPLAY.size:
      return i.display;
    case re.TEXT.size:
      return i.text;
    case re.SCRIPT.size:
      return i.script;
    case re.SCRIPTSCRIPT.size:
      return i.scriptscript;
    default:
      return i.text;
  }
};
qt({
  type: "mathchoice",
  names: ["\\mathchoice"],
  props: {
    numArgs: 4,
    primitive: !0
  },
  handler: (i, t) => {
    var {
      parser: e
    } = i;
    return {
      type: "mathchoice",
      mode: e.mode,
      display: qi(t[0]),
      text: qi(t[1]),
      script: qi(t[2]),
      scriptscript: qi(t[3])
    };
  },
  htmlBuilder: (i, t) => {
    var e = Uk(i, t), n = Rn(e, t, !1);
    return pt.makeFragment(n);
  },
  mathmlBuilder: (i, t) => {
    var e = Uk(i, t);
    return g0(e, t);
  }
});
var YF = (i, t, e, n, s, r, a) => {
  i = pt.makeSpan([], [i]);
  var o = e && ne.isCharacterBox(e), l, c;
  if (t) {
    var h = qe(t, n.havingStyle(s.sup()), n);
    c = {
      elem: h,
      kern: Math.max(n.fontMetrics().bigOpSpacing1, n.fontMetrics().bigOpSpacing3 - h.depth)
    };
  }
  if (e) {
    var u = qe(e, n.havingStyle(s.sub()), n);
    l = {
      elem: u,
      kern: Math.max(n.fontMetrics().bigOpSpacing2, n.fontMetrics().bigOpSpacing4 - u.height)
    };
  }
  var f;
  if (c && l) {
    var d = n.fontMetrics().bigOpSpacing5 + l.elem.height + l.elem.depth + l.kern + i.depth + a;
    f = pt.makeVList({
      positionType: "bottom",
      positionData: d,
      children: [{
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: l.elem,
        marginLeft: Nt(-r)
      }, {
        type: "kern",
        size: l.kern
      }, {
        type: "elem",
        elem: i
      }, {
        type: "kern",
        size: c.kern
      }, {
        type: "elem",
        elem: c.elem,
        marginLeft: Nt(r)
      }, {
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }]
    }, n);
  } else if (l) {
    var p = i.height - a;
    f = pt.makeVList({
      positionType: "top",
      positionData: p,
      children: [{
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }, {
        type: "elem",
        elem: l.elem,
        marginLeft: Nt(-r)
      }, {
        type: "kern",
        size: l.kern
      }, {
        type: "elem",
        elem: i
      }]
    }, n);
  } else if (c) {
    var g = i.depth + a;
    f = pt.makeVList({
      positionType: "bottom",
      positionData: g,
      children: [{
        type: "elem",
        elem: i
      }, {
        type: "kern",
        size: c.kern
      }, {
        type: "elem",
        elem: c.elem,
        marginLeft: Nt(r)
      }, {
        type: "kern",
        size: n.fontMetrics().bigOpSpacing5
      }]
    }, n);
  } else
    return i;
  var b = [f];
  if (l && r !== 0 && !o) {
    var y = pt.makeSpan(["mspace"], [], n);
    y.style.marginRight = Nt(r), b.unshift(y);
  }
  return pt.makeSpan(["mop", "op-limits"], b, n);
}, KF = ["\\smallint"], yf = (i, t) => {
  var e, n, s = !1, r;
  i.type === "supsub" ? (e = i.sup, n = i.sub, r = ve(i.base, "op"), s = !0) : r = ve(i, "op");
  var a = t.style, o = !1;
  a.size === re.DISPLAY.size && r.symbol && !ne.contains(KF, r.name) && (o = !0);
  var l;
  if (r.symbol) {
    var c = o ? "Size2-Regular" : "Size1-Regular", h = "";
    if ((r.name === "\\oiint" || r.name === "\\oiiint") && (h = r.name.slice(1), r.name = h === "oiint" ? "\\iint" : "\\iiint"), l = pt.makeSymbol(r.name, c, "math", t, ["mop", "op-symbol", o ? "large-op" : "small-op"]), h.length > 0) {
      var u = l.italic, f = pt.staticSvg(h + "Size" + (o ? "2" : "1"), t);
      l = pt.makeVList({
        positionType: "individualShift",
        children: [{
          type: "elem",
          elem: l,
          shift: 0
        }, {
          type: "elem",
          elem: f,
          shift: o ? 0.08 : 0
        }]
      }, t), r.name = "\\" + h, l.classes.unshift("mop"), l.italic = u;
    }
  } else if (r.body) {
    var d = Rn(r.body, t, !0);
    d.length === 1 && d[0] instanceof Io ? (l = d[0], l.classes[0] = "mop") : l = pt.makeSpan(["mop"], d, t);
  } else {
    for (var p = [], g = 1; g < r.name.length; g++)
      p.push(pt.mathsym(r.name[g], r.mode, t));
    l = pt.makeSpan(["mop"], p, t);
  }
  var b = 0, y = 0;
  return (l instanceof Io || r.name === "\\oiint" || r.name === "\\oiiint") && !r.suppressBaseShift && (b = (l.height - l.depth) / 2 - t.fontMetrics().axisHeight, y = l.italic), s ? YF(l, e, n, t, a, y, b) : (b && (l.style.position = "relative", l.style.top = Nt(b)), l);
}, Pg = (i, t) => {
  var e;
  if (i.symbol)
    e = new Or("mo", [Wr(i.name, i.mode)]), ne.contains(KF, i.name) && e.setAttribute("largeop", "false");
  else if (i.body)
    e = new Or("mo", dr(i.body, t));
  else {
    e = new Or("mi", [new bo(i.name.slice(1))]);
    var n = new Or("mo", [Wr("⁡", "text")]);
    i.parentIsSupSub ? e = new Or("mrow", [e, n]) : e = EF([e, n]);
  }
  return e;
}, dW = {
  "∏": "\\prod",
  "∐": "\\coprod",
  "∑": "\\sum",
  "⋀": "\\bigwedge",
  "⋁": "\\bigvee",
  "⋂": "\\bigcap",
  "⋃": "\\bigcup",
  "⨀": "\\bigodot",
  "⨁": "\\bigoplus",
  "⨂": "\\bigotimes",
  "⨄": "\\biguplus",
  "⨆": "\\bigsqcup"
};
qt({
  type: "op",
  names: ["\\coprod", "\\bigvee", "\\bigwedge", "\\biguplus", "\\bigcap", "\\bigcup", "\\intop", "\\prod", "\\sum", "\\bigotimes", "\\bigoplus", "\\bigodot", "\\bigsqcup", "\\smallint", "∏", "∐", "∑", "⋀", "⋁", "⋂", "⋃", "⨀", "⨁", "⨂", "⨄", "⨆"],
  props: {
    numArgs: 0
  },
  handler: (i, t) => {
    var {
      parser: e,
      funcName: n
    } = i, s = n;
    return s.length === 1 && (s = dW[s]), {
      type: "op",
      mode: e.mode,
      limits: !0,
      parentIsSupSub: !1,
      symbol: !0,
      name: s
    };
  },
  htmlBuilder: yf,
  mathmlBuilder: Pg
});
qt({
  type: "op",
  names: ["\\mathop"],
  props: {
    numArgs: 1,
    primitive: !0
  },
  handler: (i, t) => {
    var {
      parser: e
    } = i, n = t[0];
    return {
      type: "op",
      mode: e.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !1,
      body: qi(n)
    };
  },
  htmlBuilder: yf,
  mathmlBuilder: Pg
});
var fW = {
  "∫": "\\int",
  "∬": "\\iint",
  "∭": "\\iiint",
  "∮": "\\oint",
  "∯": "\\oiint",
  "∰": "\\oiiint"
};
qt({
  type: "op",
  names: ["\\arcsin", "\\arccos", "\\arctan", "\\arctg", "\\arcctg", "\\arg", "\\ch", "\\cos", "\\cosec", "\\cosh", "\\cot", "\\cotg", "\\coth", "\\csc", "\\ctg", "\\cth", "\\deg", "\\dim", "\\exp", "\\hom", "\\ker", "\\lg", "\\ln", "\\log", "\\sec", "\\sin", "\\sinh", "\\sh", "\\tan", "\\tanh", "\\tg", "\\th"],
  props: {
    numArgs: 0
  },
  handler(i) {
    var {
      parser: t,
      funcName: e
    } = i;
    return {
      type: "op",
      mode: t.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !1,
      name: e
    };
  },
  htmlBuilder: yf,
  mathmlBuilder: Pg
});
qt({
  type: "op",
  names: ["\\det", "\\gcd", "\\inf", "\\lim", "\\max", "\\min", "\\Pr", "\\sup"],
  props: {
    numArgs: 0
  },
  handler(i) {
    var {
      parser: t,
      funcName: e
    } = i;
    return {
      type: "op",
      mode: t.mode,
      limits: !0,
      parentIsSupSub: !1,
      symbol: !1,
      name: e
    };
  },
  htmlBuilder: yf,
  mathmlBuilder: Pg
});
qt({
  type: "op",
  names: ["\\int", "\\iint", "\\iiint", "\\oint", "\\oiint", "\\oiiint", "∫", "∬", "∭", "∮", "∯", "∰"],
  props: {
    numArgs: 0
  },
  handler(i) {
    var {
      parser: t,
      funcName: e
    } = i, n = e;
    return n.length === 1 && (n = fW[n]), {
      type: "op",
      mode: t.mode,
      limits: !1,
      parentIsSupSub: !1,
      symbol: !0,
      name: n
    };
  },
  htmlBuilder: yf,
  mathmlBuilder: Pg
});
var ZF = (i, t) => {
  var e, n, s = !1, r;
  i.type === "supsub" ? (e = i.sup, n = i.sub, r = ve(i.base, "operatorname"), s = !0) : r = ve(i, "operatorname");
  var a;
  if (r.body.length > 0) {
    for (var o = r.body.map((u) => {
      var f = u.text;
      return typeof f == "string" ? {
        type: "textord",
        mode: u.mode,
        text: f
      } : u;
    }), l = Rn(o, t.withFont("mathrm"), !0), c = 0; c < l.length; c++) {
      var h = l[c];
      h instanceof Io && (h.text = h.text.replace(/\u2212/, "-").replace(/\u2217/, "*"));
    }
    a = pt.makeSpan(["mop"], l, t);
  } else
    a = pt.makeSpan(["mop"], [], t);
  return s ? YF(a, e, n, t, t.style, 0, 0) : a;
}, pW = (i, t) => {
  for (var e = dr(i.body, t.withFont("mathrm")), n = !0, s = 0; s < e.length; s++) {
    var r = e[s];
    if (!(r instanceof Mt.SpaceNode)) if (r instanceof Mt.MathNode)
      switch (r.type) {
        case "mi":
        case "mn":
        case "ms":
        case "mspace":
        case "mtext":
          break;
        case "mo": {
          var a = r.children[0];
          r.children.length === 1 && a instanceof Mt.TextNode ? a.text = a.text.replace(/\u2212/, "-").replace(/\u2217/, "*") : n = !1;
          break;
        }
        default:
          n = !1;
      }
    else
      n = !1;
  }
  if (n) {
    var o = e.map((h) => h.toText()).join("");
    e = [new Mt.TextNode(o)];
  }
  var l = new Mt.MathNode("mi", e);
  l.setAttribute("mathvariant", "normal");
  var c = new Mt.MathNode("mo", [Wr("⁡", "text")]);
  return i.parentIsSupSub ? new Mt.MathNode("mrow", [l, c]) : Mt.newDocumentFragment([l, c]);
};
qt({
  type: "operatorname",
  names: ["\\operatorname@", "\\operatornamewithlimits"],
  props: {
    numArgs: 1
  },
  handler: (i, t) => {
    var {
      parser: e,
      funcName: n
    } = i, s = t[0];
    return {
      type: "operatorname",
      mode: e.mode,
      body: qi(s),
      alwaysHandleSupSub: n === "\\operatornamewithlimits",
      limits: !1,
      parentIsSupSub: !1
    };
  },
  htmlBuilder: ZF,
  mathmlBuilder: pW
});
P("\\operatorname", "\\@ifstar\\operatornamewithlimits\\operatorname@");
N1({
  type: "ordgroup",
  htmlBuilder(i, t) {
    return i.semisimple ? pt.makeFragment(Rn(i.body, t, !1)) : pt.makeSpan(["mord"], Rn(i.body, t, !0), t);
  },
  mathmlBuilder(i, t) {
    return g0(i.body, t, !0);
  }
});
qt({
  type: "overline",
  names: ["\\overline"],
  props: {
    numArgs: 1
  },
  handler(i, t) {
    var {
      parser: e
    } = i, n = t[0];
    return {
      type: "overline",
      mode: e.mode,
      body: n
    };
  },
  htmlBuilder(i, t) {
    var e = qe(i.body, t.havingCrampedStyle()), n = pt.makeLineSpan("overline-line", t), s = t.fontMetrics().defaultRuleThickness, r = pt.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: e
      }, {
        type: "kern",
        size: 3 * s
      }, {
        type: "elem",
        elem: n
      }, {
        type: "kern",
        size: s
      }]
    }, t);
    return pt.makeSpan(["mord", "overline"], [r], t);
  },
  mathmlBuilder(i, t) {
    var e = new Mt.MathNode("mo", [new Mt.TextNode("‾")]);
    e.setAttribute("stretchy", "true");
    var n = new Mt.MathNode("mover", [ei(i.body, t), e]);
    return n.setAttribute("accent", "true"), n;
  }
});
qt({
  type: "phantom",
  names: ["\\phantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (i, t) => {
    var {
      parser: e
    } = i, n = t[0];
    return {
      type: "phantom",
      mode: e.mode,
      body: qi(n)
    };
  },
  htmlBuilder: (i, t) => {
    var e = Rn(i.body, t.withPhantom(), !1);
    return pt.makeFragment(e);
  },
  mathmlBuilder: (i, t) => {
    var e = dr(i.body, t);
    return new Mt.MathNode("mphantom", e);
  }
});
qt({
  type: "hphantom",
  names: ["\\hphantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (i, t) => {
    var {
      parser: e
    } = i, n = t[0];
    return {
      type: "hphantom",
      mode: e.mode,
      body: n
    };
  },
  htmlBuilder: (i, t) => {
    var e = pt.makeSpan([], [qe(i.body, t.withPhantom())]);
    if (e.height = 0, e.depth = 0, e.children)
      for (var n = 0; n < e.children.length; n++)
        e.children[n].height = 0, e.children[n].depth = 0;
    return e = pt.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: e
      }]
    }, t), pt.makeSpan(["mord"], [e], t);
  },
  mathmlBuilder: (i, t) => {
    var e = dr(qi(i.body), t), n = new Mt.MathNode("mphantom", e), s = new Mt.MathNode("mpadded", [n]);
    return s.setAttribute("height", "0px"), s.setAttribute("depth", "0px"), s;
  }
});
qt({
  type: "vphantom",
  names: ["\\vphantom"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler: (i, t) => {
    var {
      parser: e
    } = i, n = t[0];
    return {
      type: "vphantom",
      mode: e.mode,
      body: n
    };
  },
  htmlBuilder: (i, t) => {
    var e = pt.makeSpan(["inner"], [qe(i.body, t.withPhantom())]), n = pt.makeSpan(["fix"], []);
    return pt.makeSpan(["mord", "rlap"], [e, n], t);
  },
  mathmlBuilder: (i, t) => {
    var e = dr(qi(i.body), t), n = new Mt.MathNode("mphantom", e), s = new Mt.MathNode("mpadded", [n]);
    return s.setAttribute("width", "0px"), s;
  }
});
qt({
  type: "raisebox",
  names: ["\\raisebox"],
  props: {
    numArgs: 2,
    argTypes: ["size", "hbox"],
    allowedInText: !0
  },
  handler(i, t) {
    var {
      parser: e
    } = i, n = ve(t[0], "size").value, s = t[1];
    return {
      type: "raisebox",
      mode: e.mode,
      dy: n,
      body: s
    };
  },
  htmlBuilder(i, t) {
    var e = qe(i.body, t), n = Ai(i.dy, t);
    return pt.makeVList({
      positionType: "shift",
      positionData: -n,
      children: [{
        type: "elem",
        elem: e
      }]
    }, t);
  },
  mathmlBuilder(i, t) {
    var e = new Mt.MathNode("mpadded", [ei(i.body, t)]), n = i.dy.number + i.dy.unit;
    return e.setAttribute("voffset", n), e;
  }
});
qt({
  type: "internal",
  names: ["\\relax"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    allowedInArgument: !0
  },
  handler(i) {
    var {
      parser: t
    } = i;
    return {
      type: "internal",
      mode: t.mode
    };
  }
});
qt({
  type: "rule",
  names: ["\\rule"],
  props: {
    numArgs: 2,
    numOptionalArgs: 1,
    allowedInText: !0,
    allowedInMath: !0,
    argTypes: ["size", "size", "size"]
  },
  handler(i, t, e) {
    var {
      parser: n
    } = i, s = e[0], r = ve(t[0], "size"), a = ve(t[1], "size");
    return {
      type: "rule",
      mode: n.mode,
      shift: s && ve(s, "size").value,
      width: r.value,
      height: a.value
    };
  },
  htmlBuilder(i, t) {
    var e = pt.makeSpan(["mord", "rule"], [], t), n = Ai(i.width, t), s = Ai(i.height, t), r = i.shift ? Ai(i.shift, t) : 0;
    return e.style.borderRightWidth = Nt(n), e.style.borderTopWidth = Nt(s), e.style.bottom = Nt(r), e.width = n, e.height = s + r, e.depth = -r, e.maxFontSize = s * 1.125 * t.sizeMultiplier, e;
  },
  mathmlBuilder(i, t) {
    var e = Ai(i.width, t), n = Ai(i.height, t), s = i.shift ? Ai(i.shift, t) : 0, r = t.color && t.getColor() || "black", a = new Mt.MathNode("mspace");
    a.setAttribute("mathbackground", r), a.setAttribute("width", Nt(e)), a.setAttribute("height", Nt(n));
    var o = new Mt.MathNode("mpadded", [a]);
    return s >= 0 ? o.setAttribute("height", Nt(s)) : (o.setAttribute("height", Nt(s)), o.setAttribute("depth", Nt(-s))), o.setAttribute("voffset", Nt(s)), o;
  }
});
function JF(i, t, e) {
  for (var n = Rn(i, t, !1), s = t.sizeMultiplier / e.sizeMultiplier, r = 0; r < n.length; r++) {
    var a = n[r].classes.indexOf("sizing");
    a < 0 ? Array.prototype.push.apply(n[r].classes, t.sizingClasses(e)) : n[r].classes[a + 1] === "reset-size" + t.size && (n[r].classes[a + 1] = "reset-size" + e.size), n[r].height *= s, n[r].depth *= s;
  }
  return pt.makeFragment(n);
}
var Hk = ["\\tiny", "\\sixptsize", "\\scriptsize", "\\footnotesize", "\\small", "\\normalsize", "\\large", "\\Large", "\\LARGE", "\\huge", "\\Huge"], mW = (i, t) => {
  var e = t.havingSize(i.size);
  return JF(i.body, e, t);
};
qt({
  type: "sizing",
  names: Hk,
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler: (i, t) => {
    var {
      breakOnTokenText: e,
      funcName: n,
      parser: s
    } = i, r = s.parseExpression(!1, e);
    return {
      type: "sizing",
      mode: s.mode,
      // Figure out what size to use based on the list of functions above
      size: Hk.indexOf(n) + 1,
      body: r
    };
  },
  htmlBuilder: mW,
  mathmlBuilder: (i, t) => {
    var e = t.havingSize(i.size), n = dr(i.body, e), s = new Mt.MathNode("mstyle", n);
    return s.setAttribute("mathsize", Nt(e.sizeMultiplier)), s;
  }
});
qt({
  type: "smash",
  names: ["\\smash"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1,
    allowedInText: !0
  },
  handler: (i, t, e) => {
    var {
      parser: n
    } = i, s = !1, r = !1, a = e[0] && ve(e[0], "ordgroup");
    if (a)
      for (var o = "", l = 0; l < a.body.length; ++l) {
        var c = a.body[l];
        if (o = c.text, o === "t")
          s = !0;
        else if (o === "b")
          r = !0;
        else {
          s = !1, r = !1;
          break;
        }
      }
    else
      s = !0, r = !0;
    var h = t[0];
    return {
      type: "smash",
      mode: n.mode,
      body: h,
      smashHeight: s,
      smashDepth: r
    };
  },
  htmlBuilder: (i, t) => {
    var e = pt.makeSpan([], [qe(i.body, t)]);
    if (!i.smashHeight && !i.smashDepth)
      return e;
    if (i.smashHeight && (e.height = 0, e.children))
      for (var n = 0; n < e.children.length; n++)
        e.children[n].height = 0;
    if (i.smashDepth && (e.depth = 0, e.children))
      for (var s = 0; s < e.children.length; s++)
        e.children[s].depth = 0;
    var r = pt.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: e
      }]
    }, t);
    return pt.makeSpan(["mord"], [r], t);
  },
  mathmlBuilder: (i, t) => {
    var e = new Mt.MathNode("mpadded", [ei(i.body, t)]);
    return i.smashHeight && e.setAttribute("height", "0px"), i.smashDepth && e.setAttribute("depth", "0px"), e;
  }
});
qt({
  type: "sqrt",
  names: ["\\sqrt"],
  props: {
    numArgs: 1,
    numOptionalArgs: 1
  },
  handler(i, t, e) {
    var {
      parser: n
    } = i, s = e[0], r = t[0];
    return {
      type: "sqrt",
      mode: n.mode,
      body: r,
      index: s
    };
  },
  htmlBuilder(i, t) {
    var e = qe(i.body, t.havingCrampedStyle());
    e.height === 0 && (e.height = t.fontMetrics().xHeight), e = pt.wrapFragment(e, t);
    var n = t.fontMetrics(), s = n.defaultRuleThickness, r = s;
    t.style.id < re.TEXT.id && (r = t.fontMetrics().xHeight);
    var a = s + r / 4, o = e.height + e.depth + a + s, {
      span: l,
      ruleWidth: c,
      advanceWidth: h
    } = $l.sqrtImage(o, t), u = l.height - c;
    u > e.height + e.depth + a && (a = (a + u - e.height - e.depth) / 2);
    var f = l.height - e.height - a - c;
    e.style.paddingLeft = Nt(h);
    var d = pt.makeVList({
      positionType: "firstBaseline",
      children: [{
        type: "elem",
        elem: e,
        wrapperClasses: ["svg-align"]
      }, {
        type: "kern",
        size: -(e.height + f)
      }, {
        type: "elem",
        elem: l
      }, {
        type: "kern",
        size: c
      }]
    }, t);
    if (i.index) {
      var p = t.havingStyle(re.SCRIPTSCRIPT), g = qe(i.index, p, t), b = 0.6 * (d.height - d.depth), y = pt.makeVList({
        positionType: "shift",
        positionData: -b,
        children: [{
          type: "elem",
          elem: g
        }]
      }, t), v = pt.makeSpan(["root"], [y]);
      return pt.makeSpan(["mord", "sqrt"], [v, d], t);
    } else
      return pt.makeSpan(["mord", "sqrt"], [d], t);
  },
  mathmlBuilder(i, t) {
    var {
      body: e,
      index: n
    } = i;
    return n ? new Mt.MathNode("mroot", [ei(e, t), ei(n, t)]) : new Mt.MathNode("msqrt", [ei(e, t)]);
  }
});
var jk = {
  display: re.DISPLAY,
  text: re.TEXT,
  script: re.SCRIPT,
  scriptscript: re.SCRIPTSCRIPT
};
qt({
  type: "styling",
  names: ["\\displaystyle", "\\textstyle", "\\scriptstyle", "\\scriptscriptstyle"],
  props: {
    numArgs: 0,
    allowedInText: !0,
    primitive: !0
  },
  handler(i, t) {
    var {
      breakOnTokenText: e,
      funcName: n,
      parser: s
    } = i, r = s.parseExpression(!0, e), a = n.slice(1, n.length - 5);
    return {
      type: "styling",
      mode: s.mode,
      // Figure out what style to use by pulling out the style from
      // the function name
      style: a,
      body: r
    };
  },
  htmlBuilder(i, t) {
    var e = jk[i.style], n = t.havingStyle(e).withFont("");
    return JF(i.body, n, t);
  },
  mathmlBuilder(i, t) {
    var e = jk[i.style], n = t.havingStyle(e), s = dr(i.body, n), r = new Mt.MathNode("mstyle", s), a = {
      display: ["0", "true"],
      text: ["0", "false"],
      script: ["1", "false"],
      scriptscript: ["2", "false"]
    }, o = a[i.style];
    return r.setAttribute("scriptlevel", o[0]), r.setAttribute("displaystyle", o[1]), r;
  }
});
var gW = function(t, e) {
  var n = t.base;
  if (n)
    if (n.type === "op") {
      var s = n.limits && (e.style.size === re.DISPLAY.size || n.alwaysHandleSupSub);
      return s ? yf : null;
    } else if (n.type === "operatorname") {
      var r = n.alwaysHandleSupSub && (e.style.size === re.DISPLAY.size || n.limits);
      return r ? ZF : null;
    } else {
      if (n.type === "accent")
        return ne.isCharacterBox(n.base) ? $w : null;
      if (n.type === "horizBrace") {
        var a = !t.sub;
        return a === n.isOver ? XF : null;
      } else
        return null;
    }
  else return null;
};
N1({
  type: "supsub",
  htmlBuilder(i, t) {
    var e = gW(i, t);
    if (e)
      return e(i, t);
    var {
      base: n,
      sup: s,
      sub: r
    } = i, a = qe(n, t), o, l, c = t.fontMetrics(), h = 0, u = 0, f = n && ne.isCharacterBox(n);
    if (s) {
      var d = t.havingStyle(t.style.sup());
      o = qe(s, d, t), f || (h = a.height - d.fontMetrics().supDrop * d.sizeMultiplier / t.sizeMultiplier);
    }
    if (r) {
      var p = t.havingStyle(t.style.sub());
      l = qe(r, p, t), f || (u = a.depth + p.fontMetrics().subDrop * p.sizeMultiplier / t.sizeMultiplier);
    }
    var g;
    t.style === re.DISPLAY ? g = c.sup1 : t.style.cramped ? g = c.sup3 : g = c.sup2;
    var b = t.sizeMultiplier, y = Nt(0.5 / c.ptPerEm / b), v = null;
    if (l) {
      var w = i.base && i.base.type === "op" && i.base.name && (i.base.name === "\\oiint" || i.base.name === "\\oiiint");
      (a instanceof Io || w) && (v = Nt(-a.italic));
    }
    var _;
    if (o && l) {
      h = Math.max(h, g, o.depth + 0.25 * c.xHeight), u = Math.max(u, c.sub2);
      var x = c.defaultRuleThickness, k = 4 * x;
      if (h - o.depth - (l.height - u) < k) {
        u = k - (h - o.depth) + l.height;
        var S = 0.8 * c.xHeight - (h - o.depth);
        S > 0 && (h += S, u -= S);
      }
      var T = [{
        type: "elem",
        elem: l,
        shift: u,
        marginRight: y,
        marginLeft: v
      }, {
        type: "elem",
        elem: o,
        shift: -h,
        marginRight: y
      }];
      _ = pt.makeVList({
        positionType: "individualShift",
        children: T
      }, t);
    } else if (l) {
      u = Math.max(u, c.sub1, l.height - 0.8 * c.xHeight);
      var I = [{
        type: "elem",
        elem: l,
        marginLeft: v,
        marginRight: y
      }];
      _ = pt.makeVList({
        positionType: "shift",
        positionData: u,
        children: I
      }, t);
    } else if (o)
      h = Math.max(h, g, o.depth + 0.25 * c.xHeight), _ = pt.makeVList({
        positionType: "shift",
        positionData: -h,
        children: [{
          type: "elem",
          elem: o,
          marginRight: y
        }]
      }, t);
    else
      throw new Error("supsub must have either sup or sub.");
    var R = hy(a, "right") || "mord";
    return pt.makeSpan([R], [a, pt.makeSpan(["msupsub"], [_])], t);
  },
  mathmlBuilder(i, t) {
    var e = !1, n, s;
    i.base && i.base.type === "horizBrace" && (s = !!i.sup, s === i.base.isOver && (e = !0, n = i.base.isOver)), i.base && (i.base.type === "op" || i.base.type === "operatorname") && (i.base.parentIsSupSub = !0);
    var r = [ei(i.base, t)];
    i.sub && r.push(ei(i.sub, t)), i.sup && r.push(ei(i.sup, t));
    var a;
    if (e)
      a = n ? "mover" : "munder";
    else if (i.sub)
      if (i.sup) {
        var c = i.base;
        c && c.type === "op" && c.limits && t.style === re.DISPLAY || c && c.type === "operatorname" && c.alwaysHandleSupSub && (t.style === re.DISPLAY || c.limits) ? a = "munderover" : a = "msubsup";
      } else {
        var l = i.base;
        l && l.type === "op" && l.limits && (t.style === re.DISPLAY || l.alwaysHandleSupSub) || l && l.type === "operatorname" && l.alwaysHandleSupSub && (l.limits || t.style === re.DISPLAY) ? a = "munder" : a = "msub";
      }
    else {
      var o = i.base;
      o && o.type === "op" && o.limits && (t.style === re.DISPLAY || o.alwaysHandleSupSub) || o && o.type === "operatorname" && o.alwaysHandleSupSub && (o.limits || t.style === re.DISPLAY) ? a = "mover" : a = "msup";
    }
    return new Mt.MathNode(a, r);
  }
});
N1({
  type: "atom",
  htmlBuilder(i, t) {
    return pt.mathsym(i.text, i.mode, t, ["m" + i.family]);
  },
  mathmlBuilder(i, t) {
    var e = new Mt.MathNode("mo", [Wr(i.text, i.mode)]);
    if (i.family === "bin") {
      var n = Lw(i, t);
      n === "bold-italic" && e.setAttribute("mathvariant", n);
    } else i.family === "punct" ? e.setAttribute("separator", "true") : (i.family === "open" || i.family === "close") && e.setAttribute("stretchy", "false");
    return e;
  }
});
var QF = {
  mi: "italic",
  mn: "normal",
  mtext: "normal"
};
N1({
  type: "mathord",
  htmlBuilder(i, t) {
    return pt.makeOrd(i, t, "mathord");
  },
  mathmlBuilder(i, t) {
    var e = new Mt.MathNode("mi", [Wr(i.text, i.mode, t)]), n = Lw(i, t) || "italic";
    return n !== QF[e.type] && e.setAttribute("mathvariant", n), e;
  }
});
N1({
  type: "textord",
  htmlBuilder(i, t) {
    return pt.makeOrd(i, t, "textord");
  },
  mathmlBuilder(i, t) {
    var e = Wr(i.text, i.mode, t), n = Lw(i, t) || "normal", s;
    return i.mode === "text" ? s = new Mt.MathNode("mtext", [e]) : /[0-9]/.test(i.text) ? s = new Mt.MathNode("mn", [e]) : i.text === "\\prime" ? s = new Mt.MathNode("mo", [e]) : s = new Mt.MathNode("mi", [e]), n !== QF[s.type] && s.setAttribute("mathvariant", n), s;
  }
});
var c7 = {
  "\\nobreak": "nobreak",
  "\\allowbreak": "allowbreak"
}, h7 = {
  " ": {},
  "\\ ": {},
  "~": {
    className: "nobreak"
  },
  "\\space": {},
  "\\nobreakspace": {
    className: "nobreak"
  }
};
N1({
  type: "spacing",
  htmlBuilder(i, t) {
    if (h7.hasOwnProperty(i.text)) {
      var e = h7[i.text].className || "";
      if (i.mode === "text") {
        var n = pt.makeOrd(i, t, "textord");
        return n.classes.push(e), n;
      } else
        return pt.makeSpan(["mspace", e], [pt.mathsym(i.text, i.mode, t)], t);
    } else {
      if (c7.hasOwnProperty(i.text))
        return pt.makeSpan(["mspace", c7[i.text]], [], t);
      throw new te('Unknown type of space "' + i.text + '"');
    }
  },
  mathmlBuilder(i, t) {
    var e;
    if (h7.hasOwnProperty(i.text))
      e = new Mt.MathNode("mtext", [new Mt.TextNode(" ")]);
    else {
      if (c7.hasOwnProperty(i.text))
        return new Mt.MathNode("mspace");
      throw new te('Unknown type of space "' + i.text + '"');
    }
    return e;
  }
});
var Gk = () => {
  var i = new Mt.MathNode("mtd", []);
  return i.setAttribute("width", "50%"), i;
};
N1({
  type: "tag",
  mathmlBuilder(i, t) {
    var e = new Mt.MathNode("mtable", [new Mt.MathNode("mtr", [Gk(), new Mt.MathNode("mtd", [g0(i.body, t)]), Gk(), new Mt.MathNode("mtd", [g0(i.tag, t)])])]);
    return e.setAttribute("width", "100%"), e;
  }
});
var Vk = {
  "\\text": void 0,
  "\\textrm": "textrm",
  "\\textsf": "textsf",
  "\\texttt": "texttt",
  "\\textnormal": "textrm"
}, Wk = {
  "\\textbf": "textbf",
  "\\textmd": "textmd"
}, bW = {
  "\\textit": "textit",
  "\\textup": "textup"
}, Xk = (i, t) => {
  var e = i.font;
  if (e) {
    if (Vk[e])
      return t.withTextFontFamily(Vk[e]);
    if (Wk[e])
      return t.withTextFontWeight(Wk[e]);
    if (e === "\\emph")
      return t.fontShape === "textit" ? t.withTextFontShape("textup") : t.withTextFontShape("textit");
  } else return t;
  return t.withTextFontShape(bW[e]);
};
qt({
  type: "text",
  names: [
    // Font families
    "\\text",
    "\\textrm",
    "\\textsf",
    "\\texttt",
    "\\textnormal",
    // Font weights
    "\\textbf",
    "\\textmd",
    // Font Shapes
    "\\textit",
    "\\textup",
    "\\emph"
  ],
  props: {
    numArgs: 1,
    argTypes: ["text"],
    allowedInArgument: !0,
    allowedInText: !0
  },
  handler(i, t) {
    var {
      parser: e,
      funcName: n
    } = i, s = t[0];
    return {
      type: "text",
      mode: e.mode,
      body: qi(s),
      font: n
    };
  },
  htmlBuilder(i, t) {
    var e = Xk(i, t), n = Rn(i.body, e, !0);
    return pt.makeSpan(["mord", "text"], n, e);
  },
  mathmlBuilder(i, t) {
    var e = Xk(i, t);
    return g0(i.body, e);
  }
});
qt({
  type: "underline",
  names: ["\\underline"],
  props: {
    numArgs: 1,
    allowedInText: !0
  },
  handler(i, t) {
    var {
      parser: e
    } = i;
    return {
      type: "underline",
      mode: e.mode,
      body: t[0]
    };
  },
  htmlBuilder(i, t) {
    var e = qe(i.body, t), n = pt.makeLineSpan("underline-line", t), s = t.fontMetrics().defaultRuleThickness, r = pt.makeVList({
      positionType: "top",
      positionData: e.height,
      children: [{
        type: "kern",
        size: s
      }, {
        type: "elem",
        elem: n
      }, {
        type: "kern",
        size: 3 * s
      }, {
        type: "elem",
        elem: e
      }]
    }, t);
    return pt.makeSpan(["mord", "underline"], [r], t);
  },
  mathmlBuilder(i, t) {
    var e = new Mt.MathNode("mo", [new Mt.TextNode("‾")]);
    e.setAttribute("stretchy", "true");
    var n = new Mt.MathNode("munder", [ei(i.body, t), e]);
    return n.setAttribute("accentunder", "true"), n;
  }
});
qt({
  type: "vcenter",
  names: ["\\vcenter"],
  props: {
    numArgs: 1,
    argTypes: ["original"],
    // In LaTeX, \vcenter can act only on a box.
    allowedInText: !1
  },
  handler(i, t) {
    var {
      parser: e
    } = i;
    return {
      type: "vcenter",
      mode: e.mode,
      body: t[0]
    };
  },
  htmlBuilder(i, t) {
    var e = qe(i.body, t), n = t.fontMetrics().axisHeight, s = 0.5 * (e.height - n - (e.depth + n));
    return pt.makeVList({
      positionType: "shift",
      positionData: s,
      children: [{
        type: "elem",
        elem: e
      }]
    }, t);
  },
  mathmlBuilder(i, t) {
    return new Mt.MathNode("mpadded", [ei(i.body, t)], ["vcenter"]);
  }
});
qt({
  type: "verb",
  names: ["\\verb"],
  props: {
    numArgs: 0,
    allowedInText: !0
  },
  handler(i, t, e) {
    throw new te("\\verb ended by end of line instead of matching delimiter");
  },
  htmlBuilder(i, t) {
    for (var e = Yk(i), n = [], s = t.havingStyle(t.style.text()), r = 0; r < e.length; r++) {
      var a = e[r];
      a === "~" && (a = "\\textasciitilde"), n.push(pt.makeSymbol(a, "Typewriter-Regular", i.mode, s, ["mord", "texttt"]));
    }
    return pt.makeSpan(["mord", "text"].concat(s.sizingClasses(t)), pt.tryCombineChars(n), s);
  },
  mathmlBuilder(i, t) {
    var e = new Mt.TextNode(Yk(i)), n = new Mt.MathNode("mtext", [e]);
    return n.setAttribute("mathvariant", "monospace"), n;
  }
});
var Yk = (i) => i.body.replace(/ /g, i.star ? "␣" : " "), yW = SF;
P("\\noexpand", function(i) {
  var t = i.popToken();
  return i.isExpandable(t.text) && (t.noexpand = !0, t.treatAsRelax = !0), {
    tokens: [t],
    numArgs: 0
  };
});
P("\\expandafter", function(i) {
  var t = i.popToken();
  return i.expandOnce(!0), {
    tokens: [t],
    numArgs: 0
  };
});
P("\\@firstoftwo", function(i) {
  var t = i.consumeArgs(2);
  return {
    tokens: t[0],
    numArgs: 0
  };
});
P("\\@secondoftwo", function(i) {
  var t = i.consumeArgs(2);
  return {
    tokens: t[1],
    numArgs: 0
  };
});
P("\\@ifnextchar", function(i) {
  var t = i.consumeArgs(3);
  i.consumeSpaces();
  var e = i.future();
  return t[0].length === 1 && t[0][0].text === e.text ? {
    tokens: t[1],
    numArgs: 0
  } : {
    tokens: t[2],
    numArgs: 0
  };
});
P("\\@ifstar", "\\@ifnextchar *{\\@firstoftwo{#1}}");
P("\\TextOrMath", function(i) {
  var t = i.consumeArgs(2);
  return i.mode === "text" ? {
    tokens: t[0],
    numArgs: 0
  } : {
    tokens: t[1],
    numArgs: 0
  };
});
var Kk = {
  0: 0,
  1: 1,
  2: 2,
  3: 3,
  4: 4,
  5: 5,
  6: 6,
  7: 7,
  8: 8,
  9: 9,
  a: 10,
  A: 10,
  b: 11,
  B: 11,
  c: 12,
  C: 12,
  d: 13,
  D: 13,
  e: 14,
  E: 14,
  f: 15,
  F: 15
};
P("\\char", function(i) {
  var t = i.popToken(), e, n = "";
  if (t.text === "'")
    e = 8, t = i.popToken();
  else if (t.text === '"')
    e = 16, t = i.popToken();
  else if (t.text === "`")
    if (t = i.popToken(), t.text[0] === "\\")
      n = t.text.charCodeAt(1);
    else {
      if (t.text === "EOF")
        throw new te("\\char` missing argument");
      n = t.text.charCodeAt(0);
    }
  else
    e = 10;
  if (e) {
    if (n = Kk[t.text], n == null || n >= e)
      throw new te("Invalid base-" + e + " digit " + t.text);
    for (var s; (s = Kk[i.future().text]) != null && s < e; )
      n *= e, n += s, i.popToken();
  }
  return "\\@char{" + n + "}";
});
var Ww = (i, t, e, n) => {
  var s = i.consumeArg().tokens;
  if (s.length !== 1)
    throw new te("\\newcommand's first argument must be a macro name");
  var r = s[0].text, a = i.isDefined(r);
  if (a && !t)
    throw new te("\\newcommand{" + r + "} attempting to redefine " + (r + "; use \\renewcommand"));
  if (!a && !e)
    throw new te("\\renewcommand{" + r + "} when command " + r + " does not yet exist; use \\newcommand");
  var o = 0;
  if (s = i.consumeArg().tokens, s.length === 1 && s[0].text === "[") {
    for (var l = "", c = i.expandNextToken(); c.text !== "]" && c.text !== "EOF"; )
      l += c.text, c = i.expandNextToken();
    if (!l.match(/^\s*[0-9]+\s*$/))
      throw new te("Invalid number of arguments: " + l);
    o = parseInt(l), s = i.consumeArg().tokens;
  }
  return a && n || i.macros.set(r, {
    tokens: s,
    numArgs: o
  }), "";
};
P("\\newcommand", (i) => Ww(i, !1, !0, !1));
P("\\renewcommand", (i) => Ww(i, !0, !1, !1));
P("\\providecommand", (i) => Ww(i, !0, !0, !0));
P("\\message", (i) => {
  var t = i.consumeArgs(1)[0];
  return console.log(t.reverse().map((e) => e.text).join("")), "";
});
P("\\errmessage", (i) => {
  var t = i.consumeArgs(1)[0];
  return console.error(t.reverse().map((e) => e.text).join("")), "";
});
P("\\show", (i) => {
  var t = i.popToken(), e = t.text;
  return console.log(t, i.macros.get(e), yW[e], zi.math[e], zi.text[e]), "";
});
P("\\bgroup", "{");
P("\\egroup", "}");
P("~", "\\nobreakspace");
P("\\lq", "`");
P("\\rq", "'");
P("\\aa", "\\r a");
P("\\AA", "\\r A");
P("\\textcopyright", "\\html@mathml{\\textcircled{c}}{\\char`©}");
P("\\copyright", "\\TextOrMath{\\textcopyright}{\\text{\\textcopyright}}");
P("\\textregistered", "\\html@mathml{\\textcircled{\\scriptsize R}}{\\char`®}");
P("ℬ", "\\mathscr{B}");
P("ℰ", "\\mathscr{E}");
P("ℱ", "\\mathscr{F}");
P("ℋ", "\\mathscr{H}");
P("ℐ", "\\mathscr{I}");
P("ℒ", "\\mathscr{L}");
P("ℳ", "\\mathscr{M}");
P("ℛ", "\\mathscr{R}");
P("ℭ", "\\mathfrak{C}");
P("ℌ", "\\mathfrak{H}");
P("ℨ", "\\mathfrak{Z}");
P("\\Bbbk", "\\Bbb{k}");
P("·", "\\cdotp");
P("\\llap", "\\mathllap{\\textrm{#1}}");
P("\\rlap", "\\mathrlap{\\textrm{#1}}");
P("\\clap", "\\mathclap{\\textrm{#1}}");
P("\\mathstrut", "\\vphantom{(}");
P("\\underbar", "\\underline{\\text{#1}}");
P("\\not", '\\html@mathml{\\mathrel{\\mathrlap\\@not}}{\\char"338}');
P("\\neq", "\\html@mathml{\\mathrel{\\not=}}{\\mathrel{\\char`≠}}");
P("\\ne", "\\neq");
P("≠", "\\neq");
P("\\notin", "\\html@mathml{\\mathrel{{\\in}\\mathllap{/\\mskip1mu}}}{\\mathrel{\\char`∉}}");
P("∉", "\\notin");
P("≘", "\\html@mathml{\\mathrel{=\\kern{-1em}\\raisebox{0.4em}{$\\scriptsize\\frown$}}}{\\mathrel{\\char`≘}}");
P("≙", "\\html@mathml{\\stackrel{\\tiny\\wedge}{=}}{\\mathrel{\\char`≘}}");
P("≚", "\\html@mathml{\\stackrel{\\tiny\\vee}{=}}{\\mathrel{\\char`≚}}");
P("≛", "\\html@mathml{\\stackrel{\\scriptsize\\star}{=}}{\\mathrel{\\char`≛}}");
P("≝", "\\html@mathml{\\stackrel{\\tiny\\mathrm{def}}{=}}{\\mathrel{\\char`≝}}");
P("≞", "\\html@mathml{\\stackrel{\\tiny\\mathrm{m}}{=}}{\\mathrel{\\char`≞}}");
P("≟", "\\html@mathml{\\stackrel{\\tiny?}{=}}{\\mathrel{\\char`≟}}");
P("⟂", "\\perp");
P("‼", "\\mathclose{!\\mkern-0.8mu!}");
P("∌", "\\notni");
P("⌜", "\\ulcorner");
P("⌝", "\\urcorner");
P("⌞", "\\llcorner");
P("⌟", "\\lrcorner");
P("©", "\\copyright");
P("®", "\\textregistered");
P("️", "\\textregistered");
P("\\ulcorner", '\\html@mathml{\\@ulcorner}{\\mathop{\\char"231c}}');
P("\\urcorner", '\\html@mathml{\\@urcorner}{\\mathop{\\char"231d}}');
P("\\llcorner", '\\html@mathml{\\@llcorner}{\\mathop{\\char"231e}}');
P("\\lrcorner", '\\html@mathml{\\@lrcorner}{\\mathop{\\char"231f}}');
P("\\vdots", "{\\varvdots\\rule{0pt}{15pt}}");
P("⋮", "\\vdots");
P("\\varGamma", "\\mathit{\\Gamma}");
P("\\varDelta", "\\mathit{\\Delta}");
P("\\varTheta", "\\mathit{\\Theta}");
P("\\varLambda", "\\mathit{\\Lambda}");
P("\\varXi", "\\mathit{\\Xi}");
P("\\varPi", "\\mathit{\\Pi}");
P("\\varSigma", "\\mathit{\\Sigma}");
P("\\varUpsilon", "\\mathit{\\Upsilon}");
P("\\varPhi", "\\mathit{\\Phi}");
P("\\varPsi", "\\mathit{\\Psi}");
P("\\varOmega", "\\mathit{\\Omega}");
P("\\substack", "\\begin{subarray}{c}#1\\end{subarray}");
P("\\colon", "\\nobreak\\mskip2mu\\mathpunct{}\\mathchoice{\\mkern-3mu}{\\mkern-3mu}{}{}{:}\\mskip6mu\\relax");
P("\\boxed", "\\fbox{$\\displaystyle{#1}$}");
P("\\iff", "\\DOTSB\\;\\Longleftrightarrow\\;");
P("\\implies", "\\DOTSB\\;\\Longrightarrow\\;");
P("\\impliedby", "\\DOTSB\\;\\Longleftarrow\\;");
P("\\dddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ...}}{#1}}");
P("\\ddddot", "{\\overset{\\raisebox{-0.1ex}{\\normalsize ....}}{#1}}");
var Zk = {
  ",": "\\dotsc",
  "\\not": "\\dotsb",
  // \keybin@ checks for the following:
  "+": "\\dotsb",
  "=": "\\dotsb",
  "<": "\\dotsb",
  ">": "\\dotsb",
  "-": "\\dotsb",
  "*": "\\dotsb",
  ":": "\\dotsb",
  // Symbols whose definition starts with \DOTSB:
  "\\DOTSB": "\\dotsb",
  "\\coprod": "\\dotsb",
  "\\bigvee": "\\dotsb",
  "\\bigwedge": "\\dotsb",
  "\\biguplus": "\\dotsb",
  "\\bigcap": "\\dotsb",
  "\\bigcup": "\\dotsb",
  "\\prod": "\\dotsb",
  "\\sum": "\\dotsb",
  "\\bigotimes": "\\dotsb",
  "\\bigoplus": "\\dotsb",
  "\\bigodot": "\\dotsb",
  "\\bigsqcup": "\\dotsb",
  "\\And": "\\dotsb",
  "\\longrightarrow": "\\dotsb",
  "\\Longrightarrow": "\\dotsb",
  "\\longleftarrow": "\\dotsb",
  "\\Longleftarrow": "\\dotsb",
  "\\longleftrightarrow": "\\dotsb",
  "\\Longleftrightarrow": "\\dotsb",
  "\\mapsto": "\\dotsb",
  "\\longmapsto": "\\dotsb",
  "\\hookrightarrow": "\\dotsb",
  "\\doteq": "\\dotsb",
  // Symbols whose definition starts with \mathbin:
  "\\mathbin": "\\dotsb",
  // Symbols whose definition starts with \mathrel:
  "\\mathrel": "\\dotsb",
  "\\relbar": "\\dotsb",
  "\\Relbar": "\\dotsb",
  "\\xrightarrow": "\\dotsb",
  "\\xleftarrow": "\\dotsb",
  // Symbols whose definition starts with \DOTSI:
  "\\DOTSI": "\\dotsi",
  "\\int": "\\dotsi",
  "\\oint": "\\dotsi",
  "\\iint": "\\dotsi",
  "\\iiint": "\\dotsi",
  "\\iiiint": "\\dotsi",
  "\\idotsint": "\\dotsi",
  // Symbols whose definition starts with \DOTSX:
  "\\DOTSX": "\\dotsx"
};
P("\\dots", function(i) {
  var t = "\\dotso", e = i.expandAfterFuture().text;
  return e in Zk ? t = Zk[e] : (e.slice(0, 4) === "\\not" || e in zi.math && ne.contains(["bin", "rel"], zi.math[e].group)) && (t = "\\dotsb"), t;
});
var Xw = {
  // \rightdelim@ checks for the following:
  ")": !0,
  "]": !0,
  "\\rbrack": !0,
  "\\}": !0,
  "\\rbrace": !0,
  "\\rangle": !0,
  "\\rceil": !0,
  "\\rfloor": !0,
  "\\rgroup": !0,
  "\\rmoustache": !0,
  "\\right": !0,
  "\\bigr": !0,
  "\\biggr": !0,
  "\\Bigr": !0,
  "\\Biggr": !0,
  // \extra@ also tests for the following:
  $: !0,
  // \extrap@ checks for the following:
  ";": !0,
  ".": !0,
  ",": !0
};
P("\\dotso", function(i) {
  var t = i.future().text;
  return t in Xw ? "\\ldots\\," : "\\ldots";
});
P("\\dotsc", function(i) {
  var t = i.future().text;
  return t in Xw && t !== "," ? "\\ldots\\," : "\\ldots";
});
P("\\cdots", function(i) {
  var t = i.future().text;
  return t in Xw ? "\\@cdots\\," : "\\@cdots";
});
P("\\dotsb", "\\cdots");
P("\\dotsm", "\\cdots");
P("\\dotsi", "\\!\\cdots");
P("\\dotsx", "\\ldots\\,");
P("\\DOTSI", "\\relax");
P("\\DOTSB", "\\relax");
P("\\DOTSX", "\\relax");
P("\\tmspace", "\\TextOrMath{\\kern#1#3}{\\mskip#1#2}\\relax");
P("\\,", "\\tmspace+{3mu}{.1667em}");
P("\\thinspace", "\\,");
P("\\>", "\\mskip{4mu}");
P("\\:", "\\tmspace+{4mu}{.2222em}");
P("\\medspace", "\\:");
P("\\;", "\\tmspace+{5mu}{.2777em}");
P("\\thickspace", "\\;");
P("\\!", "\\tmspace-{3mu}{.1667em}");
P("\\negthinspace", "\\!");
P("\\negmedspace", "\\tmspace-{4mu}{.2222em}");
P("\\negthickspace", "\\tmspace-{5mu}{.277em}");
P("\\enspace", "\\kern.5em ");
P("\\enskip", "\\hskip.5em\\relax");
P("\\quad", "\\hskip1em\\relax");
P("\\qquad", "\\hskip2em\\relax");
P("\\tag", "\\@ifstar\\tag@literal\\tag@paren");
P("\\tag@paren", "\\tag@literal{({#1})}");
P("\\tag@literal", (i) => {
  if (i.macros.get("\\df@tag"))
    throw new te("Multiple \\tag");
  return "\\gdef\\df@tag{\\text{#1}}";
});
P("\\bmod", "\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}\\mathbin{\\rm mod}\\mathchoice{\\mskip1mu}{\\mskip1mu}{\\mskip5mu}{\\mskip5mu}");
P("\\pod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern8mu}{\\mkern8mu}{\\mkern8mu}(#1)");
P("\\pmod", "\\pod{{\\rm mod}\\mkern6mu#1}");
P("\\mod", "\\allowbreak\\mathchoice{\\mkern18mu}{\\mkern12mu}{\\mkern12mu}{\\mkern12mu}{\\rm mod}\\,\\,#1");
P("\\newline", "\\\\\\relax");
P("\\TeX", "\\textrm{\\html@mathml{T\\kern-.1667em\\raisebox{-.5ex}{E}\\kern-.125emX}{TeX}}");
var tI = Nt(Bl["Main-Regular"][84][1] - 0.7 * Bl["Main-Regular"][65][1]);
P("\\LaTeX", "\\textrm{\\html@mathml{" + ("L\\kern-.36em\\raisebox{" + tI + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{LaTeX}}");
P("\\KaTeX", "\\textrm{\\html@mathml{" + ("K\\kern-.17em\\raisebox{" + tI + "}{\\scriptstyle A}") + "\\kern-.15em\\TeX}{KaTeX}}");
P("\\hspace", "\\@ifstar\\@hspacer\\@hspace");
P("\\@hspace", "\\hskip #1\\relax");
P("\\@hspacer", "\\rule{0pt}{0pt}\\hskip #1\\relax");
P("\\ordinarycolon", ":");
P("\\vcentcolon", "\\mathrel{\\mathop\\ordinarycolon}");
P("\\dblcolon", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-.9mu}\\vcentcolon}}{\\mathop{\\char"2237}}');
P("\\coloneqq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2254}}');
P("\\Coloneqq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}=}}{\\mathop{\\char"2237\\char"3d}}');
P("\\coloneq", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"3a\\char"2212}}');
P("\\Coloneq", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\mathrel{-}}}{\\mathop{\\char"2237\\char"2212}}');
P("\\eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2255}}');
P("\\Eqqcolon", '\\html@mathml{\\mathrel{=\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"3d\\char"2237}}');
P("\\eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\vcentcolon}}{\\mathop{\\char"2239}}');
P("\\Eqcolon", '\\html@mathml{\\mathrel{\\mathrel{-}\\mathrel{\\mkern-1.2mu}\\dblcolon}}{\\mathop{\\char"2212\\char"2237}}');
P("\\colonapprox", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"3a\\char"2248}}');
P("\\Colonapprox", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\approx}}{\\mathop{\\char"2237\\char"2248}}');
P("\\colonsim", '\\html@mathml{\\mathrel{\\vcentcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"3a\\char"223c}}');
P("\\Colonsim", '\\html@mathml{\\mathrel{\\dblcolon\\mathrel{\\mkern-1.2mu}\\sim}}{\\mathop{\\char"2237\\char"223c}}');
P("∷", "\\dblcolon");
P("∹", "\\eqcolon");
P("≔", "\\coloneqq");
P("≕", "\\eqqcolon");
P("⩴", "\\Coloneqq");
P("\\ratio", "\\vcentcolon");
P("\\coloncolon", "\\dblcolon");
P("\\colonequals", "\\coloneqq");
P("\\coloncolonequals", "\\Coloneqq");
P("\\equalscolon", "\\eqqcolon");
P("\\equalscoloncolon", "\\Eqqcolon");
P("\\colonminus", "\\coloneq");
P("\\coloncolonminus", "\\Coloneq");
P("\\minuscolon", "\\eqcolon");
P("\\minuscoloncolon", "\\Eqcolon");
P("\\coloncolonapprox", "\\Colonapprox");
P("\\coloncolonsim", "\\Colonsim");
P("\\simcolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
P("\\simcoloncolon", "\\mathrel{\\sim\\mathrel{\\mkern-1.2mu}\\dblcolon}");
P("\\approxcolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\vcentcolon}");
P("\\approxcoloncolon", "\\mathrel{\\approx\\mathrel{\\mkern-1.2mu}\\dblcolon}");
P("\\notni", "\\html@mathml{\\not\\ni}{\\mathrel{\\char`∌}}");
P("\\limsup", "\\DOTSB\\operatorname*{lim\\,sup}");
P("\\liminf", "\\DOTSB\\operatorname*{lim\\,inf}");
P("\\injlim", "\\DOTSB\\operatorname*{inj\\,lim}");
P("\\projlim", "\\DOTSB\\operatorname*{proj\\,lim}");
P("\\varlimsup", "\\DOTSB\\operatorname*{\\overline{lim}}");
P("\\varliminf", "\\DOTSB\\operatorname*{\\underline{lim}}");
P("\\varinjlim", "\\DOTSB\\operatorname*{\\underrightarrow{lim}}");
P("\\varprojlim", "\\DOTSB\\operatorname*{\\underleftarrow{lim}}");
P("\\gvertneqq", "\\html@mathml{\\@gvertneqq}{≩}");
P("\\lvertneqq", "\\html@mathml{\\@lvertneqq}{≨}");
P("\\ngeqq", "\\html@mathml{\\@ngeqq}{≱}");
P("\\ngeqslant", "\\html@mathml{\\@ngeqslant}{≱}");
P("\\nleqq", "\\html@mathml{\\@nleqq}{≰}");
P("\\nleqslant", "\\html@mathml{\\@nleqslant}{≰}");
P("\\nshortmid", "\\html@mathml{\\@nshortmid}{∤}");
P("\\nshortparallel", "\\html@mathml{\\@nshortparallel}{∦}");
P("\\nsubseteqq", "\\html@mathml{\\@nsubseteqq}{⊈}");
P("\\nsupseteqq", "\\html@mathml{\\@nsupseteqq}{⊉}");
P("\\varsubsetneq", "\\html@mathml{\\@varsubsetneq}{⊊}");
P("\\varsubsetneqq", "\\html@mathml{\\@varsubsetneqq}{⫋}");
P("\\varsupsetneq", "\\html@mathml{\\@varsupsetneq}{⊋}");
P("\\varsupsetneqq", "\\html@mathml{\\@varsupsetneqq}{⫌}");
P("\\imath", "\\html@mathml{\\@imath}{ı}");
P("\\jmath", "\\html@mathml{\\@jmath}{ȷ}");
P("\\llbracket", "\\html@mathml{\\mathopen{[\\mkern-3.2mu[}}{\\mathopen{\\char`⟦}}");
P("\\rrbracket", "\\html@mathml{\\mathclose{]\\mkern-3.2mu]}}{\\mathclose{\\char`⟧}}");
P("⟦", "\\llbracket");
P("⟧", "\\rrbracket");
P("\\lBrace", "\\html@mathml{\\mathopen{\\{\\mkern-3.2mu[}}{\\mathopen{\\char`⦃}}");
P("\\rBrace", "\\html@mathml{\\mathclose{]\\mkern-3.2mu\\}}}{\\mathclose{\\char`⦄}}");
P("⦃", "\\lBrace");
P("⦄", "\\rBrace");
P("\\minuso", "\\mathbin{\\html@mathml{{\\mathrlap{\\mathchoice{\\kern{0.145em}}{\\kern{0.145em}}{\\kern{0.1015em}}{\\kern{0.0725em}}\\circ}{-}}}{\\char`⦵}}");
P("⦵", "\\minuso");
P("\\darr", "\\downarrow");
P("\\dArr", "\\Downarrow");
P("\\Darr", "\\Downarrow");
P("\\lang", "\\langle");
P("\\rang", "\\rangle");
P("\\uarr", "\\uparrow");
P("\\uArr", "\\Uparrow");
P("\\Uarr", "\\Uparrow");
P("\\N", "\\mathbb{N}");
P("\\R", "\\mathbb{R}");
P("\\Z", "\\mathbb{Z}");
P("\\alef", "\\aleph");
P("\\alefsym", "\\aleph");
P("\\Alpha", "\\mathrm{A}");
P("\\Beta", "\\mathrm{B}");
P("\\bull", "\\bullet");
P("\\Chi", "\\mathrm{X}");
P("\\clubs", "\\clubsuit");
P("\\cnums", "\\mathbb{C}");
P("\\Complex", "\\mathbb{C}");
P("\\Dagger", "\\ddagger");
P("\\diamonds", "\\diamondsuit");
P("\\empty", "\\emptyset");
P("\\Epsilon", "\\mathrm{E}");
P("\\Eta", "\\mathrm{H}");
P("\\exist", "\\exists");
P("\\harr", "\\leftrightarrow");
P("\\hArr", "\\Leftrightarrow");
P("\\Harr", "\\Leftrightarrow");
P("\\hearts", "\\heartsuit");
P("\\image", "\\Im");
P("\\infin", "\\infty");
P("\\Iota", "\\mathrm{I}");
P("\\isin", "\\in");
P("\\Kappa", "\\mathrm{K}");
P("\\larr", "\\leftarrow");
P("\\lArr", "\\Leftarrow");
P("\\Larr", "\\Leftarrow");
P("\\lrarr", "\\leftrightarrow");
P("\\lrArr", "\\Leftrightarrow");
P("\\Lrarr", "\\Leftrightarrow");
P("\\Mu", "\\mathrm{M}");
P("\\natnums", "\\mathbb{N}");
P("\\Nu", "\\mathrm{N}");
P("\\Omicron", "\\mathrm{O}");
P("\\plusmn", "\\pm");
P("\\rarr", "\\rightarrow");
P("\\rArr", "\\Rightarrow");
P("\\Rarr", "\\Rightarrow");
P("\\real", "\\Re");
P("\\reals", "\\mathbb{R}");
P("\\Reals", "\\mathbb{R}");
P("\\Rho", "\\mathrm{P}");
P("\\sdot", "\\cdot");
P("\\sect", "\\S");
P("\\spades", "\\spadesuit");
P("\\sub", "\\subset");
P("\\sube", "\\subseteq");
P("\\supe", "\\supseteq");
P("\\Tau", "\\mathrm{T}");
P("\\thetasym", "\\vartheta");
P("\\weierp", "\\wp");
P("\\Zeta", "\\mathrm{Z}");
P("\\argmin", "\\DOTSB\\operatorname*{arg\\,min}");
P("\\argmax", "\\DOTSB\\operatorname*{arg\\,max}");
P("\\plim", "\\DOTSB\\mathop{\\operatorname{plim}}\\limits");
P("\\bra", "\\mathinner{\\langle{#1}|}");
P("\\ket", "\\mathinner{|{#1}\\rangle}");
P("\\braket", "\\mathinner{\\langle{#1}\\rangle}");
P("\\Bra", "\\left\\langle#1\\right|");
P("\\Ket", "\\left|#1\\right\\rangle");
var eI = (i) => (t) => {
  var e = t.consumeArg().tokens, n = t.consumeArg().tokens, s = t.consumeArg().tokens, r = t.consumeArg().tokens, a = t.macros.get("|"), o = t.macros.get("\\|");
  t.macros.beginGroup();
  var l = (u) => (f) => {
    i && (f.macros.set("|", a), s.length && f.macros.set("\\|", o));
    var d = u;
    if (!u && s.length) {
      var p = f.future();
      p.text === "|" && (f.popToken(), d = !0);
    }
    return {
      tokens: d ? s : n,
      numArgs: 0
    };
  };
  t.macros.set("|", l(!1)), s.length && t.macros.set("\\|", l(!0));
  var c = t.consumeArg().tokens, h = t.expandTokens([
    ...r,
    ...c,
    ...e
    // reversed
  ]);
  return t.macros.endGroup(), {
    tokens: h.reverse(),
    numArgs: 0
  };
};
P("\\bra@ket", eI(!1));
P("\\bra@set", eI(!0));
P("\\Braket", "\\bra@ket{\\left\\langle}{\\,\\middle\\vert\\,}{\\,\\middle\\vert\\,}{\\right\\rangle}");
P("\\Set", "\\bra@set{\\left\\{\\:}{\\;\\middle\\vert\\;}{\\;\\middle\\Vert\\;}{\\:\\right\\}}");
P("\\set", "\\bra@set{\\{\\,}{\\mid}{}{\\,\\}}");
P("\\angln", "{\\angl n}");
P("\\blue", "\\textcolor{##6495ed}{#1}");
P("\\orange", "\\textcolor{##ffa500}{#1}");
P("\\pink", "\\textcolor{##ff00af}{#1}");
P("\\red", "\\textcolor{##df0030}{#1}");
P("\\green", "\\textcolor{##28ae7b}{#1}");
P("\\gray", "\\textcolor{gray}{#1}");
P("\\purple", "\\textcolor{##9d38bd}{#1}");
P("\\blueA", "\\textcolor{##ccfaff}{#1}");
P("\\blueB", "\\textcolor{##80f6ff}{#1}");
P("\\blueC", "\\textcolor{##63d9ea}{#1}");
P("\\blueD", "\\textcolor{##11accd}{#1}");
P("\\blueE", "\\textcolor{##0c7f99}{#1}");
P("\\tealA", "\\textcolor{##94fff5}{#1}");
P("\\tealB", "\\textcolor{##26edd5}{#1}");
P("\\tealC", "\\textcolor{##01d1c1}{#1}");
P("\\tealD", "\\textcolor{##01a995}{#1}");
P("\\tealE", "\\textcolor{##208170}{#1}");
P("\\greenA", "\\textcolor{##b6ffb0}{#1}");
P("\\greenB", "\\textcolor{##8af281}{#1}");
P("\\greenC", "\\textcolor{##74cf70}{#1}");
P("\\greenD", "\\textcolor{##1fab54}{#1}");
P("\\greenE", "\\textcolor{##0d923f}{#1}");
P("\\goldA", "\\textcolor{##ffd0a9}{#1}");
P("\\goldB", "\\textcolor{##ffbb71}{#1}");
P("\\goldC", "\\textcolor{##ff9c39}{#1}");
P("\\goldD", "\\textcolor{##e07d10}{#1}");
P("\\goldE", "\\textcolor{##a75a05}{#1}");
P("\\redA", "\\textcolor{##fca9a9}{#1}");
P("\\redB", "\\textcolor{##ff8482}{#1}");
P("\\redC", "\\textcolor{##f9685d}{#1}");
P("\\redD", "\\textcolor{##e84d39}{#1}");
P("\\redE", "\\textcolor{##bc2612}{#1}");
P("\\maroonA", "\\textcolor{##ffbde0}{#1}");
P("\\maroonB", "\\textcolor{##ff92c6}{#1}");
P("\\maroonC", "\\textcolor{##ed5fa6}{#1}");
P("\\maroonD", "\\textcolor{##ca337c}{#1}");
P("\\maroonE", "\\textcolor{##9e034e}{#1}");
P("\\purpleA", "\\textcolor{##ddd7ff}{#1}");
P("\\purpleB", "\\textcolor{##c6b9fc}{#1}");
P("\\purpleC", "\\textcolor{##aa87ff}{#1}");
P("\\purpleD", "\\textcolor{##7854ab}{#1}");
P("\\purpleE", "\\textcolor{##543b78}{#1}");
P("\\mintA", "\\textcolor{##f5f9e8}{#1}");
P("\\mintB", "\\textcolor{##edf2df}{#1}");
P("\\mintC", "\\textcolor{##e0e5cc}{#1}");
P("\\grayA", "\\textcolor{##f6f7f7}{#1}");
P("\\grayB", "\\textcolor{##f0f1f2}{#1}");
P("\\grayC", "\\textcolor{##e3e5e6}{#1}");
P("\\grayD", "\\textcolor{##d6d8da}{#1}");
P("\\grayE", "\\textcolor{##babec2}{#1}");
P("\\grayF", "\\textcolor{##888d93}{#1}");
P("\\grayG", "\\textcolor{##626569}{#1}");
P("\\grayH", "\\textcolor{##3b3e40}{#1}");
P("\\grayI", "\\textcolor{##21242c}{#1}");
P("\\kaBlue", "\\textcolor{##314453}{#1}");
P("\\kaGreen", "\\textcolor{##71B307}{#1}");
typeof document < "u" && document.compatMode !== "CSS1Compat" && typeof console < "u" && console.warn("Warning: KaTeX doesn't work in quirks mode. Make sure your website has a suitable doctype.");
function Yw() {
  return {
    async: !1,
    breaks: !1,
    extensions: null,
    gfm: !0,
    hooks: null,
    pedantic: !1,
    renderer: null,
    silent: !1,
    tokenizer: null,
    walkTokens: null
  };
}
let L1 = Yw();
function iI(i) {
  L1 = i;
}
const nI = /[&<>"']/, wW = new RegExp(nI.source, "g"), sI = /[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/, vW = new RegExp(sI.source, "g"), _W = {
  "&": "&amp;",
  "<": "&lt;",
  ">": "&gt;",
  '"': "&quot;",
  "'": "&#39;"
}, Jk = (i) => _W[i];
function nr(i, t) {
  if (t) {
    if (nI.test(i))
      return i.replace(wW, Jk);
  } else if (sI.test(i))
    return i.replace(vW, Jk);
  return i;
}
const xW = /&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;
function kW(i) {
  return i.replace(xW, (t, e) => (e = e.toLowerCase(), e === "colon" ? ":" : e.charAt(0) === "#" ? e.charAt(1) === "x" ? String.fromCharCode(parseInt(e.substring(2), 16)) : String.fromCharCode(+e.substring(1)) : ""));
}
const AW = /(^|[^\[])\^/g;
function Qe(i, t) {
  let e = typeof i == "string" ? i : i.source;
  t = t || "";
  const n = {
    replace: (s, r) => {
      let a = typeof r == "string" ? r : r.source;
      return a = a.replace(AW, "$1"), e = e.replace(s, a), n;
    },
    getRegex: () => new RegExp(e, t)
  };
  return n;
}
function Qk(i) {
  try {
    i = encodeURI(i).replace(/%25/g, "%");
  } catch {
    return null;
  }
  return i;
}
const q2 = { exec: () => null };
function tA(i, t) {
  const e = i.replace(/\|/g, (r, a, o) => {
    let l = !1, c = a;
    for (; --c >= 0 && o[c] === "\\"; )
      l = !l;
    return l ? "|" : " |";
  }), n = e.split(/ \|/);
  let s = 0;
  if (n[0].trim() || n.shift(), n.length > 0 && !n[n.length - 1].trim() && n.pop(), t)
    if (n.length > t)
      n.splice(t);
    else
      for (; n.length < t; )
        n.push("");
  for (; s < n.length; s++)
    n[s] = n[s].trim().replace(/\\\|/g, "|");
  return n;
}
function v5(i, t, e) {
  const n = i.length;
  if (n === 0)
    return "";
  let s = 0;
  for (; s < n && i.charAt(n - s - 1) === t; )
    s++;
  return i.slice(0, n - s);
}
function SW(i, t) {
  if (i.indexOf(t[1]) === -1)
    return -1;
  let e = 0;
  for (let n = 0; n < i.length; n++)
    if (i[n] === "\\")
      n++;
    else if (i[n] === t[0])
      e++;
    else if (i[n] === t[1] && (e--, e < 0))
      return n;
  return -1;
}
function eA(i, t, e, n) {
  const s = t.href, r = t.title ? nr(t.title) : null, a = i[1].replace(/\\([\[\]])/g, "$1");
  if (i[0].charAt(0) !== "!") {
    n.state.inLink = !0;
    const o = {
      type: "link",
      raw: e,
      href: s,
      title: r,
      text: a,
      tokens: n.inlineTokens(a)
    };
    return n.state.inLink = !1, o;
  }
  return {
    type: "image",
    raw: e,
    href: s,
    title: r,
    text: nr(a)
  };
}
function CW(i, t) {
  const e = i.match(/^(\s+)(?:```)/);
  if (e === null)
    return t;
  const n = e[1];
  return t.split(`
`).map((s) => {
    const r = s.match(/^\s+/);
    if (r === null)
      return s;
    const [a] = r;
    return a.length >= n.length ? s.slice(n.length) : s;
  }).join(`
`);
}
class $3 {
  // set by the lexer
  constructor(t) {
    ft(this, "options");
    ft(this, "rules");
    // set by the lexer
    ft(this, "lexer");
    this.options = t || L1;
  }
  space(t) {
    const e = this.rules.block.newline.exec(t);
    if (e && e[0].length > 0)
      return {
        type: "space",
        raw: e[0]
      };
  }
  code(t) {
    const e = this.rules.block.code.exec(t);
    if (e) {
      const n = e[0].replace(/^ {1,4}/gm, "");
      return {
        type: "code",
        raw: e[0],
        codeBlockStyle: "indented",
        text: this.options.pedantic ? n : v5(n, `
`)
      };
    }
  }
  fences(t) {
    const e = this.rules.block.fences.exec(t);
    if (e) {
      const n = e[0], s = CW(n, e[3] || "");
      return {
        type: "code",
        raw: n,
        lang: e[2] ? e[2].trim().replace(this.rules.inline.anyPunctuation, "$1") : e[2],
        text: s
      };
    }
  }
  heading(t) {
    const e = this.rules.block.heading.exec(t);
    if (e) {
      let n = e[2].trim();
      if (/#$/.test(n)) {
        const s = v5(n, "#");
        (this.options.pedantic || !s || / $/.test(s)) && (n = s.trim());
      }
      return {
        type: "heading",
        raw: e[0],
        depth: e[1].length,
        text: n,
        tokens: this.lexer.inline(n)
      };
    }
  }
  hr(t) {
    const e = this.rules.block.hr.exec(t);
    if (e)
      return {
        type: "hr",
        raw: e[0]
      };
  }
  blockquote(t) {
    const e = this.rules.block.blockquote.exec(t);
    if (e) {
      let n = e[0].replace(/\n {0,3}((?:=+|-+) *)(?=\n|$)/g, `
    $1`);
      n = v5(n.replace(/^ *>[ \t]?/gm, ""), `
`);
      const s = this.lexer.state.top;
      this.lexer.state.top = !0;
      const r = this.lexer.blockTokens(n);
      return this.lexer.state.top = s, {
        type: "blockquote",
        raw: e[0],
        tokens: r,
        text: n
      };
    }
  }
  list(t) {
    let e = this.rules.block.list.exec(t);
    if (e) {
      let n = e[1].trim();
      const s = n.length > 1, r = {
        type: "list",
        raw: "",
        ordered: s,
        start: s ? +n.slice(0, -1) : "",
        loose: !1,
        items: []
      };
      n = s ? `\\d{1,9}\\${n.slice(-1)}` : `\\${n}`, this.options.pedantic && (n = s ? n : "[*+-]");
      const a = new RegExp(`^( {0,3}${n})((?:[	 ][^\\n]*)?(?:\\n|$))`);
      let o = "", l = "", c = !1;
      for (; t; ) {
        let h = !1;
        if (!(e = a.exec(t)) || this.rules.block.hr.test(t))
          break;
        o = e[0], t = t.substring(o.length);
        let u = e[2].split(`
`, 1)[0].replace(/^\t+/, (y) => " ".repeat(3 * y.length)), f = t.split(`
`, 1)[0], d = 0;
        this.options.pedantic ? (d = 2, l = u.trimStart()) : (d = e[2].search(/[^ ]/), d = d > 4 ? 1 : d, l = u.slice(d), d += e[1].length);
        let p = !1;
        if (!u && /^ *$/.test(f) && (o += f + `
`, t = t.substring(f.length + 1), h = !0), !h) {
          const y = new RegExp(`^ {0,${Math.min(3, d - 1)}}(?:[*+-]|\\d{1,9}[.)])((?:[ 	][^\\n]*)?(?:\\n|$))`), v = new RegExp(`^ {0,${Math.min(3, d - 1)}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`), w = new RegExp(`^ {0,${Math.min(3, d - 1)}}(?:\`\`\`|~~~)`), _ = new RegExp(`^ {0,${Math.min(3, d - 1)}}#`);
          for (; t; ) {
            const x = t.split(`
`, 1)[0];
            if (f = x, this.options.pedantic && (f = f.replace(/^ {1,4}(?=( {4})*[^ ])/g, "  ")), w.test(f) || _.test(f) || y.test(f) || v.test(t))
              break;
            if (f.search(/[^ ]/) >= d || !f.trim())
              l += `
` + f.slice(d);
            else {
              if (p || u.search(/[^ ]/) >= 4 || w.test(u) || _.test(u) || v.test(u))
                break;
              l += `
` + f;
            }
            !p && !f.trim() && (p = !0), o += x + `
`, t = t.substring(x.length + 1), u = f.slice(d);
          }
        }
        r.loose || (c ? r.loose = !0 : /\n *\n *$/.test(o) && (c = !0));
        let g = null, b;
        this.options.gfm && (g = /^\[[ xX]\] /.exec(l), g && (b = g[0] !== "[ ] ", l = l.replace(/^\[[ xX]\] +/, ""))), r.items.push({
          type: "list_item",
          raw: o,
          task: !!g,
          checked: b,
          loose: !1,
          text: l,
          tokens: []
        }), r.raw += o;
      }
      r.items[r.items.length - 1].raw = o.trimEnd(), r.items[r.items.length - 1].text = l.trimEnd(), r.raw = r.raw.trimEnd();
      for (let h = 0; h < r.items.length; h++)
        if (this.lexer.state.top = !1, r.items[h].tokens = this.lexer.blockTokens(r.items[h].text, []), !r.loose) {
          const u = r.items[h].tokens.filter((d) => d.type === "space"), f = u.length > 0 && u.some((d) => /\n.*\n/.test(d.raw));
          r.loose = f;
        }
      if (r.loose)
        for (let h = 0; h < r.items.length; h++)
          r.items[h].loose = !0;
      return r;
    }
  }
  html(t) {
    const e = this.rules.block.html.exec(t);
    if (e)
      return {
        type: "html",
        block: !0,
        raw: e[0],
        pre: e[1] === "pre" || e[1] === "script" || e[1] === "style",
        text: e[0]
      };
  }
  def(t) {
    const e = this.rules.block.def.exec(t);
    if (e) {
      const n = e[1].toLowerCase().replace(/\s+/g, " "), s = e[2] ? e[2].replace(/^<(.*)>$/, "$1").replace(this.rules.inline.anyPunctuation, "$1") : "", r = e[3] ? e[3].substring(1, e[3].length - 1).replace(this.rules.inline.anyPunctuation, "$1") : e[3];
      return {
        type: "def",
        tag: n,
        raw: e[0],
        href: s,
        title: r
      };
    }
  }
  table(t) {
    const e = this.rules.block.table.exec(t);
    if (!e || !/[:|]/.test(e[2]))
      return;
    const n = tA(e[1]), s = e[2].replace(/^\||\| *$/g, "").split("|"), r = e[3] && e[3].trim() ? e[3].replace(/\n[ \t]*$/, "").split(`
`) : [], a = {
      type: "table",
      raw: e[0],
      header: [],
      align: [],
      rows: []
    };
    if (n.length === s.length) {
      for (const o of s)
        /^ *-+: *$/.test(o) ? a.align.push("right") : /^ *:-+: *$/.test(o) ? a.align.push("center") : /^ *:-+ *$/.test(o) ? a.align.push("left") : a.align.push(null);
      for (const o of n)
        a.header.push({
          text: o,
          tokens: this.lexer.inline(o)
        });
      for (const o of r)
        a.rows.push(tA(o, a.header.length).map((l) => ({
          text: l,
          tokens: this.lexer.inline(l)
        })));
      return a;
    }
  }
  lheading(t) {
    const e = this.rules.block.lheading.exec(t);
    if (e)
      return {
        type: "heading",
        raw: e[0],
        depth: e[2].charAt(0) === "=" ? 1 : 2,
        text: e[1],
        tokens: this.lexer.inline(e[1])
      };
  }
  paragraph(t) {
    const e = this.rules.block.paragraph.exec(t);
    if (e) {
      const n = e[1].charAt(e[1].length - 1) === `
` ? e[1].slice(0, -1) : e[1];
      return {
        type: "paragraph",
        raw: e[0],
        text: n,
        tokens: this.lexer.inline(n)
      };
    }
  }
  text(t) {
    const e = this.rules.block.text.exec(t);
    if (e)
      return {
        type: "text",
        raw: e[0],
        text: e[0],
        tokens: this.lexer.inline(e[0])
      };
  }
  escape(t) {
    const e = this.rules.inline.escape.exec(t);
    if (e)
      return {
        type: "escape",
        raw: e[0],
        text: nr(e[1])
      };
  }
  tag(t) {
    const e = this.rules.inline.tag.exec(t);
    if (e)
      return !this.lexer.state.inLink && /^<a /i.test(e[0]) ? this.lexer.state.inLink = !0 : this.lexer.state.inLink && /^<\/a>/i.test(e[0]) && (this.lexer.state.inLink = !1), !this.lexer.state.inRawBlock && /^<(pre|code|kbd|script)(\s|>)/i.test(e[0]) ? this.lexer.state.inRawBlock = !0 : this.lexer.state.inRawBlock && /^<\/(pre|code|kbd|script)(\s|>)/i.test(e[0]) && (this.lexer.state.inRawBlock = !1), {
        type: "html",
        raw: e[0],
        inLink: this.lexer.state.inLink,
        inRawBlock: this.lexer.state.inRawBlock,
        block: !1,
        text: e[0]
      };
  }
  link(t) {
    const e = this.rules.inline.link.exec(t);
    if (e) {
      const n = e[2].trim();
      if (!this.options.pedantic && /^</.test(n)) {
        if (!/>$/.test(n))
          return;
        const a = v5(n.slice(0, -1), "\\");
        if ((n.length - a.length) % 2 === 0)
          return;
      } else {
        const a = SW(e[2], "()");
        if (a > -1) {
          const l = (e[0].indexOf("!") === 0 ? 5 : 4) + e[1].length + a;
          e[2] = e[2].substring(0, a), e[0] = e[0].substring(0, l).trim(), e[3] = "";
        }
      }
      let s = e[2], r = "";
      if (this.options.pedantic) {
        const a = /^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(s);
        a && (s = a[1], r = a[3]);
      } else
        r = e[3] ? e[3].slice(1, -1) : "";
      return s = s.trim(), /^</.test(s) && (this.options.pedantic && !/>$/.test(n) ? s = s.slice(1) : s = s.slice(1, -1)), eA(e, {
        href: s && s.replace(this.rules.inline.anyPunctuation, "$1"),
        title: r && r.replace(this.rules.inline.anyPunctuation, "$1")
      }, e[0], this.lexer);
    }
  }
  reflink(t, e) {
    let n;
    if ((n = this.rules.inline.reflink.exec(t)) || (n = this.rules.inline.nolink.exec(t))) {
      const s = (n[2] || n[1]).replace(/\s+/g, " "), r = e[s.toLowerCase()];
      if (!r) {
        const a = n[0].charAt(0);
        return {
          type: "text",
          raw: a,
          text: a
        };
      }
      return eA(n, r, n[0], this.lexer);
    }
  }
  emStrong(t, e, n = "") {
    let s = this.rules.inline.emStrongLDelim.exec(t);
    if (!s || s[3] && n.match(/[\p{L}\p{N}]/u))
      return;
    if (!(s[1] || s[2] || "") || !n || this.rules.inline.punctuation.exec(n)) {
      const a = [...s[0]].length - 1;
      let o, l, c = a, h = 0;
      const u = s[0][0] === "*" ? this.rules.inline.emStrongRDelimAst : this.rules.inline.emStrongRDelimUnd;
      for (u.lastIndex = 0, e = e.slice(-1 * t.length + a); (s = u.exec(e)) != null; ) {
        if (o = s[1] || s[2] || s[3] || s[4] || s[5] || s[6], !o)
          continue;
        if (l = [...o].length, s[3] || s[4]) {
          c += l;
          continue;
        } else if ((s[5] || s[6]) && a % 3 && !((a + l) % 3)) {
          h += l;
          continue;
        }
        if (c -= l, c > 0)
          continue;
        l = Math.min(l, l + c + h);
        const f = [...s[0]][0].length, d = t.slice(0, a + s.index + f + l);
        if (Math.min(a, l) % 2) {
          const g = d.slice(1, -1);
          return {
            type: "em",
            raw: d,
            text: g,
            tokens: this.lexer.inlineTokens(g)
          };
        }
        const p = d.slice(2, -2);
        return {
          type: "strong",
          raw: d,
          text: p,
          tokens: this.lexer.inlineTokens(p)
        };
      }
    }
  }
  codespan(t) {
    const e = this.rules.inline.code.exec(t);
    if (e) {
      let n = e[2].replace(/\n/g, " ");
      const s = /[^ ]/.test(n), r = /^ /.test(n) && / $/.test(n);
      return s && r && (n = n.substring(1, n.length - 1)), n = nr(n, !0), {
        type: "codespan",
        raw: e[0],
        text: n
      };
    }
  }
  br(t) {
    const e = this.rules.inline.br.exec(t);
    if (e)
      return {
        type: "br",
        raw: e[0]
      };
  }
  del(t) {
    const e = this.rules.inline.del.exec(t);
    if (e)
      return {
        type: "del",
        raw: e[0],
        text: e[2],
        tokens: this.lexer.inlineTokens(e[2])
      };
  }
  autolink(t) {
    const e = this.rules.inline.autolink.exec(t);
    if (e) {
      let n, s;
      return e[2] === "@" ? (n = nr(e[1]), s = "mailto:" + n) : (n = nr(e[1]), s = n), {
        type: "link",
        raw: e[0],
        text: n,
        href: s,
        tokens: [
          {
            type: "text",
            raw: n,
            text: n
          }
        ]
      };
    }
  }
  url(t) {
    var n;
    let e;
    if (e = this.rules.inline.url.exec(t)) {
      let s, r;
      if (e[2] === "@")
        s = nr(e[0]), r = "mailto:" + s;
      else {
        let a;
        do
          a = e[0], e[0] = ((n = this.rules.inline._backpedal.exec(e[0])) == null ? void 0 : n[0]) ?? "";
        while (a !== e[0]);
        s = nr(e[0]), e[1] === "www." ? r = "http://" + e[0] : r = e[0];
      }
      return {
        type: "link",
        raw: e[0],
        text: s,
        href: r,
        tokens: [
          {
            type: "text",
            raw: s,
            text: s
          }
        ]
      };
    }
  }
  inlineText(t) {
    const e = this.rules.inline.text.exec(t);
    if (e) {
      let n;
      return this.lexer.state.inRawBlock ? n = e[0] : n = nr(e[0]), {
        type: "text",
        raw: e[0],
        text: n
      };
    }
  }
}
const EW = /^(?: *(?:\n|$))+/, DW = /^( {4}[^\n]+(?:\n(?: *(?:\n|$))*)?)+/, TW = /^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/, Ng = /^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/, FW = /^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/, rI = /(?:[*+-]|\d{1,9}[.)])/, aI = Qe(/^(?!bull |blockCode|fences|blockquote|heading|html)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html))+?)\n {0,3}(=+|-+) *(?:\n+|$)/).replace(/bull/g, rI).replace(/blockCode/g, / {4}/).replace(/fences/g, / {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g, / {0,3}>/).replace(/heading/g, / {0,3}#{1,6}/).replace(/html/g, / {0,3}<[^\n>]+>\n/).getRegex(), Kw = /^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table| +\n)[^\n]+)*)/, IW = /^[^\n]+/, Zw = /(?!\s*\])(?:\\.|[^\[\]\\])+/, MW = Qe(/^ {0,3}\[(label)\]: *(?:\n *)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n *)?| *\n *)(title))? *(?:\n+|$)/).replace("label", Zw).replace("title", /(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(), RW = Qe(/^( {0,3}bull)([ \t][^\n]+?)?(?:\n|$)/).replace(/bull/g, rI).getRegex(), t6 = "address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul", Jw = /<!--(?:-?>|[\s\S]*?(?:-->|$))/, BW = Qe("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>\\n*|$)|<![A-Z][\\s\\S]*?(?:>\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n *)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))", "i").replace("comment", Jw).replace("tag", t6).replace("attribute", / +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(), oI = Qe(Kw).replace("hr", Ng).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("|table", "").replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", t6).getRegex(), PW = Qe(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph", oI).getRegex(), Qw = {
  blockquote: PW,
  code: DW,
  def: MW,
  fences: TW,
  heading: FW,
  hr: Ng,
  html: BW,
  lheading: aI,
  list: RW,
  newline: EW,
  paragraph: oI,
  table: q2,
  text: IW
}, iA = Qe("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr", Ng).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("blockquote", " {0,3}>").replace("code", " {4}[^\\n]").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", t6).getRegex(), NW = {
  ...Qw,
  table: iA,
  paragraph: Qe(Kw).replace("hr", Ng).replace("heading", " {0,3}#{1,6}(?:\\s|$)").replace("|lheading", "").replace("table", iA).replace("blockquote", " {0,3}>").replace("fences", " {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list", " {0,3}(?:[*+-]|1[.)]) ").replace("html", "</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag", t6).getRegex()
}, LW = {
  ...Qw,
  html: Qe(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment", Jw).replace(/tag/g, "(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),
  def: /^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,
  heading: /^(#{1,6})(.*)(?:\n+|$)/,
  fences: q2,
  // fences not supported
  lheading: /^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,
  paragraph: Qe(Kw).replace("hr", Ng).replace("heading", ` *#{1,6} *[^
]`).replace("lheading", aI).replace("|table", "").replace("blockquote", " {0,3}>").replace("|fences", "").replace("|list", "").replace("|html", "").replace("|tag", "").getRegex()
}, lI = /^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/, OW = /^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/, cI = /^( {2,}|\\)\n(?!\s*$)/, $W = /^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/, Lg = "\\p{P}\\p{S}", qW = Qe(/^((?![*_])[\spunctuation])/, "u").replace(/punctuation/g, Lg).getRegex(), zW = /\[[^[\]]*?\]\([^\(\)]*?\)|`[^`]*?`|<[^<>]*?>/g, UW = Qe(/^(?:\*+(?:((?!\*)[punct])|[^\s*]))|^_+(?:((?!_)[punct])|([^\s_]))/, "u").replace(/punct/g, Lg).getRegex(), HW = Qe("^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)[punct](\\*+)(?=[\\s]|$)|[^punct\\s](\\*+)(?!\\*)(?=[punct\\s]|$)|(?!\\*)[punct\\s](\\*+)(?=[^punct\\s])|[\\s](\\*+)(?!\\*)(?=[punct])|(?!\\*)[punct](\\*+)(?!\\*)(?=[punct])|[^punct\\s](\\*+)(?=[^punct\\s])", "gu").replace(/punct/g, Lg).getRegex(), jW = Qe("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)[punct](_+)(?=[\\s]|$)|[^punct\\s](_+)(?!_)(?=[punct\\s]|$)|(?!_)[punct\\s](_+)(?=[^punct\\s])|[\\s](_+)(?!_)(?=[punct])|(?!_)[punct](_+)(?!_)(?=[punct])", "gu").replace(/punct/g, Lg).getRegex(), GW = Qe(/\\([punct])/, "gu").replace(/punct/g, Lg).getRegex(), VW = Qe(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme", /[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email", /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(), WW = Qe(Jw).replace("(?:-->|$)", "-->").getRegex(), XW = Qe("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment", WW).replace("attribute", /\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(), q3 = /(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/, YW = Qe(/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/).replace("label", q3).replace("href", /<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/).replace("title", /"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(), hI = Qe(/^!?\[(label)\]\[(ref)\]/).replace("label", q3).replace("ref", Zw).getRegex(), uI = Qe(/^!?\[(ref)\](?:\[\])?/).replace("ref", Zw).getRegex(), KW = Qe("reflink|nolink(?!\\()", "g").replace("reflink", hI).replace("nolink", uI).getRegex(), tv = {
  _backpedal: q2,
  // only used for GFM url
  anyPunctuation: GW,
  autolink: VW,
  blockSkip: zW,
  br: cI,
  code: OW,
  del: q2,
  emStrongLDelim: UW,
  emStrongRDelimAst: HW,
  emStrongRDelimUnd: jW,
  escape: lI,
  link: YW,
  nolink: uI,
  punctuation: qW,
  reflink: hI,
  reflinkSearch: KW,
  tag: XW,
  text: $W,
  url: q2
}, ZW = {
  ...tv,
  link: Qe(/^!?\[(label)\]\((.*?)\)/).replace("label", q3).getRegex(),
  reflink: Qe(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label", q3).getRegex()
}, fy = {
  ...tv,
  escape: Qe(lI).replace("])", "~|])").getRegex(),
  url: Qe(/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/, "i").replace("email", /[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),
  _backpedal: /(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,
  del: /^(~~?)(?=[^\s~])([\s\S]*?[^\s~])\1(?=[^~]|$)/,
  text: /^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/
}, JW = {
  ...fy,
  br: Qe(cI).replace("{2,}", "*").getRegex(),
  text: Qe(fy.text).replace("\\b_", "\\b_| {2,}\\n").replace(/\{2,\}/g, "*").getRegex()
}, _5 = {
  normal: Qw,
  gfm: NW,
  pedantic: LW
}, Hf = {
  normal: tv,
  gfm: fy,
  breaks: JW,
  pedantic: ZW
};
class yo {
  constructor(t) {
    ft(this, "tokens");
    ft(this, "options");
    ft(this, "state");
    ft(this, "tokenizer");
    ft(this, "inlineQueue");
    this.tokens = [], this.tokens.links = /* @__PURE__ */ Object.create(null), this.options = t || L1, this.options.tokenizer = this.options.tokenizer || new $3(), this.tokenizer = this.options.tokenizer, this.tokenizer.options = this.options, this.tokenizer.lexer = this, this.inlineQueue = [], this.state = {
      inLink: !1,
      inRawBlock: !1,
      top: !0
    };
    const e = {
      block: _5.normal,
      inline: Hf.normal
    };
    this.options.pedantic ? (e.block = _5.pedantic, e.inline = Hf.pedantic) : this.options.gfm && (e.block = _5.gfm, this.options.breaks ? e.inline = Hf.breaks : e.inline = Hf.gfm), this.tokenizer.rules = e;
  }
  /**
   * Expose Rules
   */
  static get rules() {
    return {
      block: _5,
      inline: Hf
    };
  }
  /**
   * Static Lex Method
   */
  static lex(t, e) {
    return new yo(e).lex(t);
  }
  /**
   * Static Lex Inline Method
   */
  static lexInline(t, e) {
    return new yo(e).inlineTokens(t);
  }
  /**
   * Preprocessing
   */
  lex(t) {
    t = t.replace(/\r\n|\r/g, `
`), this.blockTokens(t, this.tokens);
    for (let e = 0; e < this.inlineQueue.length; e++) {
      const n = this.inlineQueue[e];
      this.inlineTokens(n.src, n.tokens);
    }
    return this.inlineQueue = [], this.tokens;
  }
  blockTokens(t, e = []) {
    this.options.pedantic ? t = t.replace(/\t/g, "    ").replace(/^ +$/gm, "") : t = t.replace(/^( *)(\t+)/gm, (o, l, c) => l + "    ".repeat(c.length));
    let n, s, r, a;
    for (; t; )
      if (!(this.options.extensions && this.options.extensions.block && this.options.extensions.block.some((o) => (n = o.call({ lexer: this }, t, e)) ? (t = t.substring(n.raw.length), e.push(n), !0) : !1))) {
        if (n = this.tokenizer.space(t)) {
          t = t.substring(n.raw.length), n.raw.length === 1 && e.length > 0 ? e[e.length - 1].raw += `
` : e.push(n);
          continue;
        }
        if (n = this.tokenizer.code(t)) {
          t = t.substring(n.raw.length), s = e[e.length - 1], s && (s.type === "paragraph" || s.type === "text") ? (s.raw += `
` + n.raw, s.text += `
` + n.text, this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : e.push(n);
          continue;
        }
        if (n = this.tokenizer.fences(t)) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (n = this.tokenizer.heading(t)) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (n = this.tokenizer.hr(t)) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (n = this.tokenizer.blockquote(t)) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (n = this.tokenizer.list(t)) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (n = this.tokenizer.html(t)) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (n = this.tokenizer.def(t)) {
          t = t.substring(n.raw.length), s = e[e.length - 1], s && (s.type === "paragraph" || s.type === "text") ? (s.raw += `
` + n.raw, s.text += `
` + n.raw, this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : this.tokens.links[n.tag] || (this.tokens.links[n.tag] = {
            href: n.href,
            title: n.title
          });
          continue;
        }
        if (n = this.tokenizer.table(t)) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (n = this.tokenizer.lheading(t)) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (r = t, this.options.extensions && this.options.extensions.startBlock) {
          let o = 1 / 0;
          const l = t.slice(1);
          let c;
          this.options.extensions.startBlock.forEach((h) => {
            c = h.call({ lexer: this }, l), typeof c == "number" && c >= 0 && (o = Math.min(o, c));
          }), o < 1 / 0 && o >= 0 && (r = t.substring(0, o + 1));
        }
        if (this.state.top && (n = this.tokenizer.paragraph(r))) {
          s = e[e.length - 1], a && s.type === "paragraph" ? (s.raw += `
` + n.raw, s.text += `
` + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : e.push(n), a = r.length !== t.length, t = t.substring(n.raw.length);
          continue;
        }
        if (n = this.tokenizer.text(t)) {
          t = t.substring(n.raw.length), s = e[e.length - 1], s && s.type === "text" ? (s.raw += `
` + n.raw, s.text += `
` + n.text, this.inlineQueue.pop(), this.inlineQueue[this.inlineQueue.length - 1].src = s.text) : e.push(n);
          continue;
        }
        if (t) {
          const o = "Infinite loop on byte: " + t.charCodeAt(0);
          if (this.options.silent) {
            console.error(o);
            break;
          } else
            throw new Error(o);
        }
      }
    return this.state.top = !0, e;
  }
  inline(t, e = []) {
    return this.inlineQueue.push({ src: t, tokens: e }), e;
  }
  /**
   * Lexing/Compiling
   */
  inlineTokens(t, e = []) {
    let n, s, r, a = t, o, l, c;
    if (this.tokens.links) {
      const h = Object.keys(this.tokens.links);
      if (h.length > 0)
        for (; (o = this.tokenizer.rules.inline.reflinkSearch.exec(a)) != null; )
          h.includes(o[0].slice(o[0].lastIndexOf("[") + 1, -1)) && (a = a.slice(0, o.index) + "[" + "a".repeat(o[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex));
    }
    for (; (o = this.tokenizer.rules.inline.blockSkip.exec(a)) != null; )
      a = a.slice(0, o.index) + "[" + "a".repeat(o[0].length - 2) + "]" + a.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);
    for (; (o = this.tokenizer.rules.inline.anyPunctuation.exec(a)) != null; )
      a = a.slice(0, o.index) + "++" + a.slice(this.tokenizer.rules.inline.anyPunctuation.lastIndex);
    for (; t; )
      if (l || (c = ""), l = !1, !(this.options.extensions && this.options.extensions.inline && this.options.extensions.inline.some((h) => (n = h.call({ lexer: this }, t, e)) ? (t = t.substring(n.raw.length), e.push(n), !0) : !1))) {
        if (n = this.tokenizer.escape(t)) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (n = this.tokenizer.tag(t)) {
          t = t.substring(n.raw.length), s = e[e.length - 1], s && n.type === "text" && s.type === "text" ? (s.raw += n.raw, s.text += n.text) : e.push(n);
          continue;
        }
        if (n = this.tokenizer.link(t)) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (n = this.tokenizer.reflink(t, this.tokens.links)) {
          t = t.substring(n.raw.length), s = e[e.length - 1], s && n.type === "text" && s.type === "text" ? (s.raw += n.raw, s.text += n.text) : e.push(n);
          continue;
        }
        if (n = this.tokenizer.emStrong(t, a, c)) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (n = this.tokenizer.codespan(t)) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (n = this.tokenizer.br(t)) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (n = this.tokenizer.del(t)) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (n = this.tokenizer.autolink(t)) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (!this.state.inLink && (n = this.tokenizer.url(t))) {
          t = t.substring(n.raw.length), e.push(n);
          continue;
        }
        if (r = t, this.options.extensions && this.options.extensions.startInline) {
          let h = 1 / 0;
          const u = t.slice(1);
          let f;
          this.options.extensions.startInline.forEach((d) => {
            f = d.call({ lexer: this }, u), typeof f == "number" && f >= 0 && (h = Math.min(h, f));
          }), h < 1 / 0 && h >= 0 && (r = t.substring(0, h + 1));
        }
        if (n = this.tokenizer.inlineText(r)) {
          t = t.substring(n.raw.length), n.raw.slice(-1) !== "_" && (c = n.raw.slice(-1)), l = !0, s = e[e.length - 1], s && s.type === "text" ? (s.raw += n.raw, s.text += n.text) : e.push(n);
          continue;
        }
        if (t) {
          const h = "Infinite loop on byte: " + t.charCodeAt(0);
          if (this.options.silent) {
            console.error(h);
            break;
          } else
            throw new Error(h);
        }
      }
    return e;
  }
}
class z3 {
  constructor(t) {
    ft(this, "options");
    this.options = t || L1;
  }
  code(t, e, n) {
    var r;
    const s = (r = (e || "").match(/^\S*/)) == null ? void 0 : r[0];
    return t = t.replace(/\n$/, "") + `
`, s ? '<pre><code class="language-' + nr(s) + '">' + (n ? t : nr(t, !0)) + `</code></pre>
` : "<pre><code>" + (n ? t : nr(t, !0)) + `</code></pre>
`;
  }
  blockquote(t) {
    return `<blockquote>
${t}</blockquote>
`;
  }
  html(t, e) {
    return t;
  }
  heading(t, e, n) {
    return `<h${e}>${t}</h${e}>
`;
  }
  hr() {
    return `<hr>
`;
  }
  list(t, e, n) {
    const s = e ? "ol" : "ul", r = e && n !== 1 ? ' start="' + n + '"' : "";
    return "<" + s + r + `>
` + t + "</" + s + `>
`;
  }
  listitem(t, e, n) {
    return `<li>${t}</li>
`;
  }
  checkbox(t) {
    return "<input " + (t ? 'checked="" ' : "") + 'disabled="" type="checkbox">';
  }
  paragraph(t) {
    return `<p>${t}</p>
`;
  }
  table(t, e) {
    return e && (e = `<tbody>${e}</tbody>`), `<table>
<thead>
` + t + `</thead>
` + e + `</table>
`;
  }
  tablerow(t) {
    return `<tr>
${t}</tr>
`;
  }
  tablecell(t, e) {
    const n = e.header ? "th" : "td";
    return (e.align ? `<${n} align="${e.align}">` : `<${n}>`) + t + `</${n}>
`;
  }
  /**
   * span level renderer
   */
  strong(t) {
    return `<strong>${t}</strong>`;
  }
  em(t) {
    return `<em>${t}</em>`;
  }
  codespan(t) {
    return `<code>${t}</code>`;
  }
  br() {
    return "<br>";
  }
  del(t) {
    return `<del>${t}</del>`;
  }
  link(t, e, n) {
    const s = Qk(t);
    if (s === null)
      return n;
    t = s;
    let r = '<a href="' + t + '"';
    return e && (r += ' title="' + e + '"'), r += ">" + n + "</a>", r;
  }
  image(t, e, n) {
    const s = Qk(t);
    if (s === null)
      return n;
    t = s;
    let r = `<img src="${t}" alt="${n}"`;
    return e && (r += ` title="${e}"`), r += ">", r;
  }
  text(t) {
    return t;
  }
}
class ev {
  // no need for block level renderers
  strong(t) {
    return t;
  }
  em(t) {
    return t;
  }
  codespan(t) {
    return t;
  }
  del(t) {
    return t;
  }
  html(t) {
    return t;
  }
  text(t) {
    return t;
  }
  link(t, e, n) {
    return "" + n;
  }
  image(t, e, n) {
    return "" + n;
  }
  br() {
    return "";
  }
}
class wo {
  constructor(t) {
    ft(this, "options");
    ft(this, "renderer");
    ft(this, "textRenderer");
    this.options = t || L1, this.options.renderer = this.options.renderer || new z3(), this.renderer = this.options.renderer, this.renderer.options = this.options, this.textRenderer = new ev();
  }
  /**
   * Static Parse Method
   */
  static parse(t, e) {
    return new wo(e).parse(t);
  }
  /**
   * Static Parse Inline Method
   */
  static parseInline(t, e) {
    return new wo(e).parseInline(t);
  }
  /**
   * Parse Loop
   */
  parse(t, e = !0) {
    let n = "";
    for (let s = 0; s < t.length; s++) {
      const r = t[s];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[r.type]) {
        const a = r, o = this.options.extensions.renderers[a.type].call({ parser: this }, a);
        if (o !== !1 || !["space", "hr", "heading", "code", "table", "blockquote", "list", "html", "paragraph", "text"].includes(a.type)) {
          n += o || "";
          continue;
        }
      }
      switch (r.type) {
        case "space":
          continue;
        case "hr": {
          n += this.renderer.hr();
          continue;
        }
        case "heading": {
          const a = r;
          n += this.renderer.heading(this.parseInline(a.tokens), a.depth, kW(this.parseInline(a.tokens, this.textRenderer)));
          continue;
        }
        case "code": {
          const a = r;
          n += this.renderer.code(a.text, a.lang, !!a.escaped);
          continue;
        }
        case "table": {
          const a = r;
          let o = "", l = "";
          for (let h = 0; h < a.header.length; h++)
            l += this.renderer.tablecell(this.parseInline(a.header[h].tokens), { header: !0, align: a.align[h] });
          o += this.renderer.tablerow(l);
          let c = "";
          for (let h = 0; h < a.rows.length; h++) {
            const u = a.rows[h];
            l = "";
            for (let f = 0; f < u.length; f++)
              l += this.renderer.tablecell(this.parseInline(u[f].tokens), { header: !1, align: a.align[f] });
            c += this.renderer.tablerow(l);
          }
          n += this.renderer.table(o, c);
          continue;
        }
        case "blockquote": {
          const a = r, o = this.parse(a.tokens);
          n += this.renderer.blockquote(o);
          continue;
        }
        case "list": {
          const a = r, o = a.ordered, l = a.start, c = a.loose;
          let h = "";
          for (let u = 0; u < a.items.length; u++) {
            const f = a.items[u], d = f.checked, p = f.task;
            let g = "";
            if (f.task) {
              const b = this.renderer.checkbox(!!d);
              c ? f.tokens.length > 0 && f.tokens[0].type === "paragraph" ? (f.tokens[0].text = b + " " + f.tokens[0].text, f.tokens[0].tokens && f.tokens[0].tokens.length > 0 && f.tokens[0].tokens[0].type === "text" && (f.tokens[0].tokens[0].text = b + " " + f.tokens[0].tokens[0].text)) : f.tokens.unshift({
                type: "text",
                text: b + " "
              }) : g += b + " ";
            }
            g += this.parse(f.tokens, c), h += this.renderer.listitem(g, p, !!d);
          }
          n += this.renderer.list(h, o, l);
          continue;
        }
        case "html": {
          const a = r;
          n += this.renderer.html(a.text, a.block);
          continue;
        }
        case "paragraph": {
          const a = r;
          n += this.renderer.paragraph(this.parseInline(a.tokens));
          continue;
        }
        case "text": {
          let a = r, o = a.tokens ? this.parseInline(a.tokens) : a.text;
          for (; s + 1 < t.length && t[s + 1].type === "text"; )
            a = t[++s], o += `
` + (a.tokens ? this.parseInline(a.tokens) : a.text);
          n += e ? this.renderer.paragraph(o) : o;
          continue;
        }
        default: {
          const a = 'Token with "' + r.type + '" type was not found.';
          if (this.options.silent)
            return console.error(a), "";
          throw new Error(a);
        }
      }
    }
    return n;
  }
  /**
   * Parse Inline Tokens
   */
  parseInline(t, e) {
    e = e || this.renderer;
    let n = "";
    for (let s = 0; s < t.length; s++) {
      const r = t[s];
      if (this.options.extensions && this.options.extensions.renderers && this.options.extensions.renderers[r.type]) {
        const a = this.options.extensions.renderers[r.type].call({ parser: this }, r);
        if (a !== !1 || !["escape", "html", "link", "image", "strong", "em", "codespan", "br", "del", "text"].includes(r.type)) {
          n += a || "";
          continue;
        }
      }
      switch (r.type) {
        case "escape": {
          const a = r;
          n += e.text(a.text);
          break;
        }
        case "html": {
          const a = r;
          n += e.html(a.text);
          break;
        }
        case "link": {
          const a = r;
          n += e.link(a.href, a.title, this.parseInline(a.tokens, e));
          break;
        }
        case "image": {
          const a = r;
          n += e.image(a.href, a.title, a.text);
          break;
        }
        case "strong": {
          const a = r;
          n += e.strong(this.parseInline(a.tokens, e));
          break;
        }
        case "em": {
          const a = r;
          n += e.em(this.parseInline(a.tokens, e));
          break;
        }
        case "codespan": {
          const a = r;
          n += e.codespan(a.text);
          break;
        }
        case "br": {
          n += e.br();
          break;
        }
        case "del": {
          const a = r;
          n += e.del(this.parseInline(a.tokens, e));
          break;
        }
        case "text": {
          const a = r;
          n += e.text(a.text);
          break;
        }
        default: {
          const a = 'Token with "' + r.type + '" type was not found.';
          if (this.options.silent)
            return console.error(a), "";
          throw new Error(a);
        }
      }
    }
    return n;
  }
}
class z2 {
  constructor(t) {
    ft(this, "options");
    this.options = t || L1;
  }
  /**
   * Process markdown before marked
   */
  preprocess(t) {
    return t;
  }
  /**
   * Process HTML after marked is finished
   */
  postprocess(t) {
    return t;
  }
  /**
   * Process all tokens before walk tokens
   */
  processAllTokens(t) {
    return t;
  }
}
ft(z2, "passThroughHooks", /* @__PURE__ */ new Set([
  "preprocess",
  "postprocess",
  "processAllTokens"
]));
var I1, py, dI;
class QW {
  constructor(...t) {
    F(this, I1);
    ft(this, "defaults", Yw());
    ft(this, "options", this.setOptions);
    ft(this, "parse", D(this, I1, py).call(this, yo.lex, wo.parse));
    ft(this, "parseInline", D(this, I1, py).call(this, yo.lexInline, wo.parseInline));
    ft(this, "Parser", wo);
    ft(this, "Renderer", z3);
    ft(this, "TextRenderer", ev);
    ft(this, "Lexer", yo);
    ft(this, "Tokenizer", $3);
    ft(this, "Hooks", z2);
    this.use(...t);
  }
  /**
   * Run callback for every token
   */
  walkTokens(t, e) {
    var s, r;
    let n = [];
    for (const a of t)
      switch (n = n.concat(e.call(this, a)), a.type) {
        case "table": {
          const o = a;
          for (const l of o.header)
            n = n.concat(this.walkTokens(l.tokens, e));
          for (const l of o.rows)
            for (const c of l)
              n = n.concat(this.walkTokens(c.tokens, e));
          break;
        }
        case "list": {
          const o = a;
          n = n.concat(this.walkTokens(o.items, e));
          break;
        }
        default: {
          const o = a;
          (r = (s = this.defaults.extensions) == null ? void 0 : s.childTokens) != null && r[o.type] ? this.defaults.extensions.childTokens[o.type].forEach((l) => {
            const c = o[l].flat(1 / 0);
            n = n.concat(this.walkTokens(c, e));
          }) : o.tokens && (n = n.concat(this.walkTokens(o.tokens, e)));
        }
      }
    return n;
  }
  use(...t) {
    const e = this.defaults.extensions || { renderers: {}, childTokens: {} };
    return t.forEach((n) => {
      const s = { ...n };
      if (s.async = this.defaults.async || s.async || !1, n.extensions && (n.extensions.forEach((r) => {
        if (!r.name)
          throw new Error("extension name required");
        if ("renderer" in r) {
          const a = e.renderers[r.name];
          a ? e.renderers[r.name] = function(...o) {
            let l = r.renderer.apply(this, o);
            return l === !1 && (l = a.apply(this, o)), l;
          } : e.renderers[r.name] = r.renderer;
        }
        if ("tokenizer" in r) {
          if (!r.level || r.level !== "block" && r.level !== "inline")
            throw new Error("extension level must be 'block' or 'inline'");
          const a = e[r.level];
          a ? a.unshift(r.tokenizer) : e[r.level] = [r.tokenizer], r.start && (r.level === "block" ? e.startBlock ? e.startBlock.push(r.start) : e.startBlock = [r.start] : r.level === "inline" && (e.startInline ? e.startInline.push(r.start) : e.startInline = [r.start]));
        }
        "childTokens" in r && r.childTokens && (e.childTokens[r.name] = r.childTokens);
      }), s.extensions = e), n.renderer) {
        const r = this.defaults.renderer || new z3(this.defaults);
        for (const a in n.renderer) {
          if (!(a in r))
            throw new Error(`renderer '${a}' does not exist`);
          if (a === "options")
            continue;
          const o = a, l = n.renderer[o], c = r[o];
          r[o] = (...h) => {
            let u = l.apply(r, h);
            return u === !1 && (u = c.apply(r, h)), u || "";
          };
        }
        s.renderer = r;
      }
      if (n.tokenizer) {
        const r = this.defaults.tokenizer || new $3(this.defaults);
        for (const a in n.tokenizer) {
          if (!(a in r))
            throw new Error(`tokenizer '${a}' does not exist`);
          if (["options", "rules", "lexer"].includes(a))
            continue;
          const o = a, l = n.tokenizer[o], c = r[o];
          r[o] = (...h) => {
            let u = l.apply(r, h);
            return u === !1 && (u = c.apply(r, h)), u;
          };
        }
        s.tokenizer = r;
      }
      if (n.hooks) {
        const r = this.defaults.hooks || new z2();
        for (const a in n.hooks) {
          if (!(a in r))
            throw new Error(`hook '${a}' does not exist`);
          if (a === "options")
            continue;
          const o = a, l = n.hooks[o], c = r[o];
          z2.passThroughHooks.has(a) ? r[o] = (h) => {
            if (this.defaults.async)
              return Promise.resolve(l.call(r, h)).then((f) => c.call(r, f));
            const u = l.call(r, h);
            return c.call(r, u);
          } : r[o] = (...h) => {
            let u = l.apply(r, h);
            return u === !1 && (u = c.apply(r, h)), u;
          };
        }
        s.hooks = r;
      }
      if (n.walkTokens) {
        const r = this.defaults.walkTokens, a = n.walkTokens;
        s.walkTokens = function(o) {
          let l = [];
          return l.push(a.call(this, o)), r && (l = l.concat(r.call(this, o))), l;
        };
      }
      this.defaults = { ...this.defaults, ...s };
    }), this;
  }
  setOptions(t) {
    return this.defaults = { ...this.defaults, ...t }, this;
  }
  lexer(t, e) {
    return yo.lex(t, e ?? this.defaults);
  }
  parser(t, e) {
    return wo.parse(t, e ?? this.defaults);
  }
}
I1 = new WeakSet(), py = function(t, e) {
  return (n, s) => {
    const r = { ...s }, a = { ...this.defaults, ...r };
    this.defaults.async === !0 && r.async === !1 && (a.silent || console.warn("marked(): The async option was set to true by an extension. The async: false option sent to parse will be ignored."), a.async = !0);
    const o = D(this, I1, dI).call(this, !!a.silent, !!a.async);
    if (typeof n > "u" || n === null)
      return o(new Error("marked(): input parameter is undefined or null"));
    if (typeof n != "string")
      return o(new Error("marked(): input parameter is of type " + Object.prototype.toString.call(n) + ", string expected"));
    if (a.hooks && (a.hooks.options = a), a.async)
      return Promise.resolve(a.hooks ? a.hooks.preprocess(n) : n).then((l) => t(l, a)).then((l) => a.hooks ? a.hooks.processAllTokens(l) : l).then((l) => a.walkTokens ? Promise.all(this.walkTokens(l, a.walkTokens)).then(() => l) : l).then((l) => e(l, a)).then((l) => a.hooks ? a.hooks.postprocess(l) : l).catch(o);
    try {
      a.hooks && (n = a.hooks.preprocess(n));
      let l = t(n, a);
      a.hooks && (l = a.hooks.processAllTokens(l)), a.walkTokens && this.walkTokens(l, a.walkTokens);
      let c = e(l, a);
      return a.hooks && (c = a.hooks.postprocess(c)), c;
    } catch (l) {
      return o(l);
    }
  };
}, dI = function(t, e) {
  return (n) => {
    if (n.message += `
Please report this to https://github.com/markedjs/marked.`, t) {
      const s = "<p>An error occurred:</p><pre>" + nr(n.message + "", !0) + "</pre>";
      return e ? Promise.resolve(s) : s;
    }
    if (e)
      return Promise.reject(n);
    throw n;
  };
};
const D1 = new QW();
function Ke(i, t) {
  return D1.parse(i, t);
}
Ke.options = Ke.setOptions = function(i) {
  return D1.setOptions(i), Ke.defaults = D1.defaults, iI(Ke.defaults), Ke;
};
Ke.getDefaults = Yw;
Ke.defaults = L1;
Ke.use = function(...i) {
  return D1.use(...i), Ke.defaults = D1.defaults, iI(Ke.defaults), Ke;
};
Ke.walkTokens = function(i, t) {
  return D1.walkTokens(i, t);
};
Ke.parseInline = D1.parseInline;
Ke.Parser = wo;
Ke.parser = wo.parse;
Ke.Renderer = z3;
Ke.TextRenderer = ev;
Ke.Lexer = yo;
Ke.lexer = yo.lex;
Ke.Tokenizer = $3;
Ke.Hooks = z2;
Ke.parse = Ke;
Ke.options;
Ke.setOptions;
Ke.use;
Ke.walkTokens;
Ke.parseInline;
wo.parse;
yo.lex;
const tX = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF7\u02C2-\u02C5\u02D2-\u02DF\u02E5-\u02EB\u02ED\u02EF-\u02FF\u0375\u0378\u0379\u037E\u0380-\u0385\u0387\u038B\u038D\u03A2\u03F6\u0482\u0530\u0557\u0558\u055A-\u055F\u0589-\u0590\u05BE\u05C0\u05C3\u05C6\u05C8-\u05CF\u05EB-\u05EE\u05F3-\u060F\u061B-\u061F\u066A-\u066D\u06D4\u06DD\u06DE\u06E9\u06FD\u06FE\u0700-\u070F\u074B\u074C\u07B2-\u07BF\u07F6-\u07F9\u07FB\u07FC\u07FE\u07FF\u082E-\u083F\u085C-\u085F\u086B-\u089F\u08B5\u08C8-\u08D2\u08E2\u0964\u0965\u0970\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09F2-\u09FB\u09FD\u09FF\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF0-\u0AF8\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B54\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B70\u0B72-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BF0-\u0BFF\u0C0D\u0C11\u0C29\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5B-\u0C5F\u0C64\u0C65\u0C70-\u0C7F\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0CFF\u0D0D\u0D11\u0D45\u0D49\u0D4F-\u0D53\u0D58-\u0D5E\u0D64\u0D65\u0D70-\u0D79\u0D80\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DE5\u0DF0\u0DF1\u0DF4-\u0E00\u0E3B-\u0E3F\u0E4F\u0E5A-\u0E80\u0E83\u0E85\u0E8B\u0EA4\u0EA6\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F01-\u0F17\u0F1A-\u0F1F\u0F2A-\u0F34\u0F36\u0F38\u0F3A-\u0F3D\u0F48\u0F6D-\u0F70\u0F85\u0F98\u0FBD-\u0FC5\u0FC7-\u0FFF\u104A-\u104F\u109E\u109F\u10C6\u10C8-\u10CC\u10CE\u10CF\u10FB\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u1360-\u137F\u1390-\u139F\u13F6\u13F7\u13FE-\u1400\u166D\u166E\u1680\u169B-\u169F\u16EB-\u16ED\u16F9-\u16FF\u170D\u1715-\u171F\u1735-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17D4-\u17D6\u17D8-\u17DB\u17DE\u17DF\u17EA-\u180A\u180E\u180F\u181A-\u181F\u1879-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191F\u192C-\u192F\u193C-\u1945\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DA-\u19FF\u1A1C-\u1A1F\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1AA6\u1AA8-\u1AAF\u1AC1-\u1AFF\u1B4C-\u1B4F\u1B5A-\u1B6A\u1B74-\u1B7F\u1BF4-\u1BFF\u1C38-\u1C3F\u1C4A-\u1C4C\u1C7E\u1C7F\u1C89-\u1C8F\u1CBB\u1CBC\u1CC0-\u1CCF\u1CD3\u1CFB-\u1CFF\u1DFA\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FBD\u1FBF-\u1FC1\u1FC5\u1FCD-\u1FCF\u1FD4\u1FD5\u1FDC-\u1FDF\u1FED-\u1FF1\u1FF5\u1FFD-\u203E\u2041-\u2053\u2055-\u2070\u2072-\u207E\u2080-\u208F\u209D-\u20CF\u20F1-\u2101\u2103-\u2106\u2108\u2109\u2114\u2116-\u2118\u211E-\u2123\u2125\u2127\u2129\u212E\u213A\u213B\u2140-\u2144\u214A-\u214D\u214F-\u215F\u2189-\u24B5\u24EA-\u2BFF\u2C2F\u2C5F\u2CE5-\u2CEA\u2CF4-\u2CFF\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D70-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E00-\u2E2E\u2E30-\u3004\u3008-\u3020\u3030\u3036\u3037\u303D-\u3040\u3097\u3098\u309B\u309C\u30A0\u30FB\u3100-\u3104\u3130\u318F-\u319F\u31C0-\u31EF\u3200-\u33FF\u4DC0-\u4DFF\u9FFD-\u9FFF\uA48D-\uA4CF\uA4FE\uA4FF\uA60D-\uA60F\uA62C-\uA63F\uA673\uA67E\uA6F2-\uA716\uA720\uA721\uA789\uA78A\uA7C0\uA7C1\uA7CB-\uA7F4\uA828-\uA82B\uA82D-\uA83F\uA874-\uA87F\uA8C6-\uA8CF\uA8DA-\uA8DF\uA8F8-\uA8FA\uA8FC\uA92E\uA92F\uA954-\uA95F\uA97D-\uA97F\uA9C1-\uA9CE\uA9DA-\uA9DF\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A-\uAA5F\uAA77-\uAA79\uAAC3-\uAADA\uAADE\uAADF\uAAF0\uAAF1\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F\uAB5B\uAB6A-\uAB6F\uABEB\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB29\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBB2-\uFBD2\uFD3E-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFC-\uFDFF\uFE10-\uFE1F\uFE30-\uFE32\uFE35-\uFE4C\uFE50-\uFE6F\uFE75\uFEFD-\uFF0F\uFF1A-\uFF20\uFF3B-\uFF3E\uFF40\uFF5B-\uFF65\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFFF]|\uD800[\uDC0C\uDC27\uDC3B\uDC3E\uDC4E\uDC4F\uDC5E-\uDC7F\uDCFB-\uDD3F\uDD75-\uDDFC\uDDFE-\uDE7F\uDE9D-\uDE9F\uDED1-\uDEDF\uDEE1-\uDEFF\uDF20-\uDF2C\uDF4B-\uDF4F\uDF7B-\uDF7F\uDF9E\uDF9F\uDFC4-\uDFC7\uDFD0\uDFD6-\uDFFF]|\uD801[\uDC9E\uDC9F\uDCAA-\uDCAF\uDCD4-\uDCD7\uDCFC-\uDCFF\uDD28-\uDD2F\uDD64-\uDDFF\uDF37-\uDF3F\uDF56-\uDF5F\uDF68-\uDFFF]|\uD802[\uDC06\uDC07\uDC09\uDC36\uDC39-\uDC3B\uDC3D\uDC3E\uDC56-\uDC5F\uDC77-\uDC7F\uDC9F-\uDCDF\uDCF3\uDCF6-\uDCFF\uDD16-\uDD1F\uDD3A-\uDD7F\uDDB8-\uDDBD\uDDC0-\uDDFF\uDE04\uDE07-\uDE0B\uDE14\uDE18\uDE36\uDE37\uDE3B-\uDE3E\uDE40-\uDE5F\uDE7D-\uDE7F\uDE9D-\uDEBF\uDEC8\uDEE7-\uDEFF\uDF36-\uDF3F\uDF56-\uDF5F\uDF73-\uDF7F\uDF92-\uDFFF]|\uD803[\uDC49-\uDC7F\uDCB3-\uDCBF\uDCF3-\uDCFF\uDD28-\uDD2F\uDD3A-\uDE7F\uDEAA\uDEAD-\uDEAF\uDEB2-\uDEFF\uDF1D-\uDF26\uDF28-\uDF2F\uDF51-\uDFAF\uDFC5-\uDFDF\uDFF7-\uDFFF]|\uD804[\uDC47-\uDC65\uDC70-\uDC7E\uDCBB-\uDCCF\uDCE9-\uDCEF\uDCFA-\uDCFF\uDD35\uDD40-\uDD43\uDD48-\uDD4F\uDD74\uDD75\uDD77-\uDD7F\uDDC5-\uDDC8\uDDCD\uDDDB\uDDDD-\uDDFF\uDE12\uDE38-\uDE3D\uDE3F-\uDE7F\uDE87\uDE89\uDE8E\uDE9E\uDEA9-\uDEAF\uDEEB-\uDEEF\uDEFA-\uDEFF\uDF04\uDF0D\uDF0E\uDF11\uDF12\uDF29\uDF31\uDF34\uDF3A\uDF45\uDF46\uDF49\uDF4A\uDF4E\uDF4F\uDF51-\uDF56\uDF58-\uDF5C\uDF64\uDF65\uDF6D-\uDF6F\uDF75-\uDFFF]|\uD805[\uDC4B-\uDC4F\uDC5A-\uDC5D\uDC62-\uDC7F\uDCC6\uDCC8-\uDCCF\uDCDA-\uDD7F\uDDB6\uDDB7\uDDC1-\uDDD7\uDDDE-\uDDFF\uDE41-\uDE43\uDE45-\uDE4F\uDE5A-\uDE7F\uDEB9-\uDEBF\uDECA-\uDEFF\uDF1B\uDF1C\uDF2C-\uDF2F\uDF3A-\uDFFF]|\uD806[\uDC3B-\uDC9F\uDCEA-\uDCFE\uDD07\uDD08\uDD0A\uDD0B\uDD14\uDD17\uDD36\uDD39\uDD3A\uDD44-\uDD4F\uDD5A-\uDD9F\uDDA8\uDDA9\uDDD8\uDDD9\uDDE2\uDDE5-\uDDFF\uDE3F-\uDE46\uDE48-\uDE4F\uDE9A-\uDE9C\uDE9E-\uDEBF\uDEF9-\uDFFF]|\uD807[\uDC09\uDC37\uDC41-\uDC4F\uDC5A-\uDC71\uDC90\uDC91\uDCA8\uDCB7-\uDCFF\uDD07\uDD0A\uDD37-\uDD39\uDD3B\uDD3E\uDD48-\uDD4F\uDD5A-\uDD5F\uDD66\uDD69\uDD8F\uDD92\uDD99-\uDD9F\uDDAA-\uDEDF\uDEF7-\uDFAF\uDFB1-\uDFFF]|\uD808[\uDF9A-\uDFFF]|\uD809[\uDC6F-\uDC7F\uDD44-\uDFFF]|[\uD80A\uD80B\uD80E-\uD810\uD812-\uD819\uD824-\uD82B\uD82D\uD82E\uD830-\uD833\uD837\uD839\uD83D\uD83F\uD87B-\uD87D\uD87F\uD885-\uDB3F\uDB41-\uDBFF][\uDC00-\uDFFF]|\uD80D[\uDC2F-\uDFFF]|\uD811[\uDE47-\uDFFF]|\uD81A[\uDE39-\uDE3F\uDE5F\uDE6A-\uDECF\uDEEE\uDEEF\uDEF5-\uDEFF\uDF37-\uDF3F\uDF44-\uDF4F\uDF5A-\uDF62\uDF78-\uDF7C\uDF90-\uDFFF]|\uD81B[\uDC00-\uDE3F\uDE80-\uDEFF\uDF4B-\uDF4E\uDF88-\uDF8E\uDFA0-\uDFDF\uDFE2\uDFE5-\uDFEF\uDFF2-\uDFFF]|\uD821[\uDFF8-\uDFFF]|\uD823[\uDCD6-\uDCFF\uDD09-\uDFFF]|\uD82C[\uDD1F-\uDD4F\uDD53-\uDD63\uDD68-\uDD6F\uDEFC-\uDFFF]|\uD82F[\uDC6B-\uDC6F\uDC7D-\uDC7F\uDC89-\uDC8F\uDC9A-\uDC9C\uDC9F-\uDFFF]|\uD834[\uDC00-\uDD64\uDD6A-\uDD6C\uDD73-\uDD7A\uDD83\uDD84\uDD8C-\uDDA9\uDDAE-\uDE41\uDE45-\uDFFF]|\uD835[\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDEC1\uDEDB\uDEFB\uDF15\uDF35\uDF4F\uDF6F\uDF89\uDFA9\uDFC3\uDFCC\uDFCD]|\uD836[\uDC00-\uDDFF\uDE37-\uDE3A\uDE6D-\uDE74\uDE76-\uDE83\uDE85-\uDE9A\uDEA0\uDEB0-\uDFFF]|\uD838[\uDC07\uDC19\uDC1A\uDC22\uDC25\uDC2B-\uDCFF\uDD2D-\uDD2F\uDD3E\uDD3F\uDD4A-\uDD4D\uDD4F-\uDEBF\uDEFA-\uDFFF]|\uD83A[\uDCC5-\uDCCF\uDCD7-\uDCFF\uDD4C-\uDD4F\uDD5A-\uDFFF]|\uD83B[\uDC00-\uDDFF\uDE04\uDE20\uDE23\uDE25\uDE26\uDE28\uDE33\uDE38\uDE3A\uDE3C-\uDE41\uDE43-\uDE46\uDE48\uDE4A\uDE4C\uDE50\uDE53\uDE55\uDE56\uDE58\uDE5A\uDE5C\uDE5E\uDE60\uDE63\uDE65\uDE66\uDE6B\uDE73\uDE78\uDE7D\uDE7F\uDE8A\uDE9C-\uDEA0\uDEA4\uDEAA\uDEBC-\uDFFF]|\uD83C[\uDC00-\uDD2F\uDD4A-\uDD4F\uDD6A-\uDD6F\uDD8A-\uDFFF]|\uD83E[\uDC00-\uDFEF\uDFFA-\uDFFF]|\uD869[\uDEDE-\uDEFF]|\uD86D[\uDF35-\uDF3F]|\uD86E[\uDC1E\uDC1F]|\uD873[\uDEA2-\uDEAF]|\uD87A[\uDFE1-\uDFFF]|\uD87E[\uDE1E-\uDFFF]|\uD884[\uDF4B-\uDFFF]|\uDB40[\uDC00-\uDCFF\uDDF0-\uDFFF]/g, eX = Object.hasOwnProperty;
class fI {
  /**
   * Create a new slug class.
   */
  constructor() {
    this.occurrences, this.reset();
  }
  /**
   * Generate a unique slug.
  *
  * Tracks previously generated slugs: repeated calls with the same value
  * will result in different slugs.
  * Use the `slug` function to get same slugs.
   *
   * @param  {string} value
   *   String of text to slugify
   * @param  {boolean} [maintainCase=false]
   *   Keep the current case, otherwise make all lowercase
   * @return {string}
   *   A unique slug string
   */
  slug(t, e) {
    const n = this;
    let s = iX(t, e === !0);
    const r = s;
    for (; eX.call(n.occurrences, s); )
      n.occurrences[r]++, s = r + "-" + n.occurrences[r];
    return n.occurrences[s] = 0, s;
  }
  /**
   * Reset - Forget all previous slugs
   *
   * @return void
   */
  reset() {
    this.occurrences = /* @__PURE__ */ Object.create(null);
  }
}
function iX(i, t) {
  return typeof i != "string" ? "" : (t || (i = i.toLowerCase()), i.replace(tX, "").replace(/ /g, "-"));
}
new fI();
var nA = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {}, nX = { exports: {} };
(function(i) {
  var t = typeof window < "u" ? window : typeof WorkerGlobalScope < "u" && self instanceof WorkerGlobalScope ? self : {};
  /**
   * Prism: Lightweight, robust, elegant syntax highlighting
   *
   * @license MIT <https://opensource.org/licenses/MIT>
   * @author Lea Verou <https://lea.verou.me>
   * @namespace
   * @public
   */
  var e = function(n) {
    var s = /(?:^|\s)lang(?:uage)?-([\w-]+)(?=\s|$)/i, r = 0, a = {}, o = {
      /**
       * By default, Prism will attempt to highlight all code elements (by calling {@link Prism.highlightAll}) on the
       * current page after the page finished loading. This might be a problem if e.g. you wanted to asynchronously load
       * additional languages or plugins yourself.
       *
       * By setting this value to `true`, Prism will not automatically highlight all code elements on the page.
       *
       * You obviously have to change this value before the automatic highlighting started. To do this, you can add an
       * empty Prism object into the global scope before loading the Prism script like this:
       *
       * ```js
       * window.Prism = window.Prism || {};
       * Prism.manual = true;
       * // add a new <script> to load Prism's script
       * ```
       *
       * @default false
       * @type {boolean}
       * @memberof Prism
       * @public
       */
      manual: n.Prism && n.Prism.manual,
      /**
       * By default, if Prism is in a web worker, it assumes that it is in a worker it created itself, so it uses
       * `addEventListener` to communicate with its parent instance. However, if you're using Prism manually in your
       * own worker, you don't want it to do this.
       *
       * By setting this value to `true`, Prism will not add its own listeners to the worker.
       *
       * You obviously have to change this value before Prism executes. To do this, you can add an
       * empty Prism object into the global scope before loading the Prism script like this:
       *
       * ```js
       * window.Prism = window.Prism || {};
       * Prism.disableWorkerMessageHandler = true;
       * // Load Prism's script
       * ```
       *
       * @default false
       * @type {boolean}
       * @memberof Prism
       * @public
       */
      disableWorkerMessageHandler: n.Prism && n.Prism.disableWorkerMessageHandler,
      /**
       * A namespace for utility methods.
       *
       * All function in this namespace that are not explicitly marked as _public_ are for __internal use only__ and may
       * change or disappear at any time.
       *
       * @namespace
       * @memberof Prism
       */
      util: {
        encode: function v(w) {
          return w instanceof l ? new l(w.type, v(w.content), w.alias) : Array.isArray(w) ? w.map(v) : w.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/\u00a0/g, " ");
        },
        /**
         * Returns the name of the type of the given value.
         *
         * @param {any} o
         * @returns {string}
         * @example
         * type(null)      === 'Null'
         * type(undefined) === 'Undefined'
         * type(123)       === 'Number'
         * type('foo')     === 'String'
         * type(true)      === 'Boolean'
         * type([1, 2])    === 'Array'
         * type({})        === 'Object'
         * type(String)    === 'Function'
         * type(/abc+/)    === 'RegExp'
         */
        type: function(v) {
          return Object.prototype.toString.call(v).slice(8, -1);
        },
        /**
         * Returns a unique number for the given object. Later calls will still return the same number.
         *
         * @param {Object} obj
         * @returns {number}
         */
        objId: function(v) {
          return v.__id || Object.defineProperty(v, "__id", { value: ++r }), v.__id;
        },
        /**
         * Creates a deep clone of the given object.
         *
         * The main intended use of this function is to clone language definitions.
         *
         * @param {T} o
         * @param {Record<number, any>} [visited]
         * @returns {T}
         * @template T
         */
        clone: function v(w, _) {
          _ = _ || {};
          var x, k;
          switch (o.util.type(w)) {
            case "Object":
              if (k = o.util.objId(w), _[k])
                return _[k];
              x = /** @type {Record<string, any>} */
              {}, _[k] = x;
              for (var S in w)
                w.hasOwnProperty(S) && (x[S] = v(w[S], _));
              return (
                /** @type {any} */
                x
              );
            case "Array":
              return k = o.util.objId(w), _[k] ? _[k] : (x = [], _[k] = x, /** @type {Array} */
              /** @type {any} */
              w.forEach(function(T, I) {
                x[I] = v(T, _);
              }), /** @type {any} */
              x);
            default:
              return w;
          }
        },
        /**
         * Returns the Prism language of the given element set by a `language-xxxx` or `lang-xxxx` class.
         *
         * If no language is set for the element or the element is `null` or `undefined`, `none` will be returned.
         *
         * @param {Element} element
         * @returns {string}
         */
        getLanguage: function(v) {
          for (; v; ) {
            var w = s.exec(v.className);
            if (w)
              return w[1].toLowerCase();
            v = v.parentElement;
          }
          return "none";
        },
        /**
         * Sets the Prism `language-xxxx` class of the given element.
         *
         * @param {Element} element
         * @param {string} language
         * @returns {void}
         */
        setLanguage: function(v, w) {
          v.className = v.className.replace(RegExp(s, "gi"), ""), v.classList.add("language-" + w);
        },
        /**
         * Returns the script element that is currently executing.
         *
         * This does __not__ work for line script element.
         *
         * @returns {HTMLScriptElement | null}
         */
        currentScript: function() {
          if (typeof document > "u")
            return null;
          if ("currentScript" in document)
            return (
              /** @type {any} */
              document.currentScript
            );
          try {
            throw new Error();
          } catch (x) {
            var v = (/at [^(\r\n]*\((.*):[^:]+:[^:]+\)$/i.exec(x.stack) || [])[1];
            if (v) {
              var w = document.getElementsByTagName("script");
              for (var _ in w)
                if (w[_].src == v)
                  return w[_];
            }
            return null;
          }
        },
        /**
         * Returns whether a given class is active for `element`.
         *
         * The class can be activated if `element` or one of its ancestors has the given class and it can be deactivated
         * if `element` or one of its ancestors has the negated version of the given class. The _negated version_ of the
         * given class is just the given class with a `no-` prefix.
         *
         * Whether the class is active is determined by the closest ancestor of `element` (where `element` itself is
         * closest ancestor) that has the given class or the negated version of it. If neither `element` nor any of its
         * ancestors have the given class or the negated version of it, then the default activation will be returned.
         *
         * In the paradoxical situation where the closest ancestor contains __both__ the given class and the negated
         * version of it, the class is considered active.
         *
         * @param {Element} element
         * @param {string} className
         * @param {boolean} [defaultActivation=false]
         * @returns {boolean}
         */
        isActive: function(v, w, _) {
          for (var x = "no-" + w; v; ) {
            var k = v.classList;
            if (k.contains(w))
              return !0;
            if (k.contains(x))
              return !1;
            v = v.parentElement;
          }
          return !!_;
        }
      },
      /**
       * This namespace contains all currently loaded languages and the some helper functions to create and modify languages.
       *
       * @namespace
       * @memberof Prism
       * @public
       */
      languages: {
        /**
         * The grammar for plain, unformatted text.
         */
        plain: a,
        plaintext: a,
        text: a,
        txt: a,
        /**
         * Creates a deep copy of the language with the given id and appends the given tokens.
         *
         * If a token in `redef` also appears in the copied language, then the existing token in the copied language
         * will be overwritten at its original position.
         *
         * ## Best practices
         *
         * Since the position of overwriting tokens (token in `redef` that overwrite tokens in the copied language)
         * doesn't matter, they can technically be in any order. However, this can be confusing to others that trying to
         * understand the language definition because, normally, the order of tokens matters in Prism grammars.
         *
         * Therefore, it is encouraged to order overwriting tokens according to the positions of the overwritten tokens.
         * Furthermore, all non-overwriting tokens should be placed after the overwriting ones.
         *
         * @param {string} id The id of the language to extend. This has to be a key in `Prism.languages`.
         * @param {Grammar} redef The new tokens to append.
         * @returns {Grammar} The new language created.
         * @public
         * @example
         * Prism.languages['css-with-colors'] = Prism.languages.extend('css', {
         *     // Prism.languages.css already has a 'comment' token, so this token will overwrite CSS' 'comment' token
         *     // at its original position
         *     'comment': { ... },
         *     // CSS doesn't have a 'color' token, so this token will be appended
         *     'color': /\b(?:red|green|blue)\b/
         * });
         */
        extend: function(v, w) {
          var _ = o.util.clone(o.languages[v]);
          for (var x in w)
            _[x] = w[x];
          return _;
        },
        /**
         * Inserts tokens _before_ another token in a language definition or any other grammar.
         *
         * ## Usage
         *
         * This helper method makes it easy to modify existing languages. For example, the CSS language definition
         * not only defines CSS highlighting for CSS documents, but also needs to define highlighting for CSS embedded
         * in HTML through `<style>` elements. To do this, it needs to modify `Prism.languages.markup` and add the
         * appropriate tokens. However, `Prism.languages.markup` is a regular JavaScript object literal, so if you do
         * this:
         *
         * ```js
         * Prism.languages.markup.style = {
         *     // token
         * };
         * ```
         *
         * then the `style` token will be added (and processed) at the end. `insertBefore` allows you to insert tokens
         * before existing tokens. For the CSS example above, you would use it like this:
         *
         * ```js
         * Prism.languages.insertBefore('markup', 'cdata', {
         *     'style': {
         *         // token
         *     }
         * });
         * ```
         *
         * ## Special cases
         *
         * If the grammars of `inside` and `insert` have tokens with the same name, the tokens in `inside`'s grammar
         * will be ignored.
         *
         * This behavior can be used to insert tokens after `before`:
         *
         * ```js
         * Prism.languages.insertBefore('markup', 'comment', {
         *     'comment': Prism.languages.markup.comment,
         *     // tokens after 'comment'
         * });
         * ```
         *
         * ## Limitations
         *
         * The main problem `insertBefore` has to solve is iteration order. Since ES2015, the iteration order for object
         * properties is guaranteed to be the insertion order (except for integer keys) but some browsers behave
         * differently when keys are deleted and re-inserted. So `insertBefore` can't be implemented by temporarily
         * deleting properties which is necessary to insert at arbitrary positions.
         *
         * To solve this problem, `insertBefore` doesn't actually insert the given tokens into the target object.
         * Instead, it will create a new object and replace all references to the target object with the new one. This
         * can be done without temporarily deleting properties, so the iteration order is well-defined.
         *
         * However, only references that can be reached from `Prism.languages` or `insert` will be replaced. I.e. if
         * you hold the target object in a variable, then the value of the variable will not change.
         *
         * ```js
         * var oldMarkup = Prism.languages.markup;
         * var newMarkup = Prism.languages.insertBefore('markup', 'comment', { ... });
         *
         * assert(oldMarkup !== Prism.languages.markup);
         * assert(newMarkup === Prism.languages.markup);
         * ```
         *
         * @param {string} inside The property of `root` (e.g. a language id in `Prism.languages`) that contains the
         * object to be modified.
         * @param {string} before The key to insert before.
         * @param {Grammar} insert An object containing the key-value pairs to be inserted.
         * @param {Object<string, any>} [root] The object containing `inside`, i.e. the object that contains the
         * object to be modified.
         *
         * Defaults to `Prism.languages`.
         * @returns {Grammar} The new grammar object.
         * @public
         */
        insertBefore: function(v, w, _, x) {
          x = x || /** @type {any} */
          o.languages;
          var k = x[v], S = {};
          for (var T in k)
            if (k.hasOwnProperty(T)) {
              if (T == w)
                for (var I in _)
                  _.hasOwnProperty(I) && (S[I] = _[I]);
              _.hasOwnProperty(T) || (S[T] = k[T]);
            }
          var R = x[v];
          return x[v] = S, o.languages.DFS(o.languages, function(B, L) {
            L === R && B != v && (this[B] = S);
          }), S;
        },
        // Traverse a language definition with Depth First Search
        DFS: function v(w, _, x, k) {
          k = k || {};
          var S = o.util.objId;
          for (var T in w)
            if (w.hasOwnProperty(T)) {
              _.call(w, T, w[T], x || T);
              var I = w[T], R = o.util.type(I);
              R === "Object" && !k[S(I)] ? (k[S(I)] = !0, v(I, _, null, k)) : R === "Array" && !k[S(I)] && (k[S(I)] = !0, v(I, _, T, k));
            }
        }
      },
      plugins: {},
      /**
       * This is the most high-level function in Prism’s API.
       * It fetches all the elements that have a `.language-xxxx` class and then calls {@link Prism.highlightElement} on
       * each one of them.
       *
       * This is equivalent to `Prism.highlightAllUnder(document, async, callback)`.
       *
       * @param {boolean} [async=false] Same as in {@link Prism.highlightAllUnder}.
       * @param {HighlightCallback} [callback] Same as in {@link Prism.highlightAllUnder}.
       * @memberof Prism
       * @public
       */
      highlightAll: function(v, w) {
        o.highlightAllUnder(document, v, w);
      },
      /**
       * Fetches all the descendants of `container` that have a `.language-xxxx` class and then calls
       * {@link Prism.highlightElement} on each one of them.
       *
       * The following hooks will be run:
       * 1. `before-highlightall`
       * 2. `before-all-elements-highlight`
       * 3. All hooks of {@link Prism.highlightElement} for each element.
       *
       * @param {ParentNode} container The root element, whose descendants that have a `.language-xxxx` class will be highlighted.
       * @param {boolean} [async=false] Whether each element is to be highlighted asynchronously using Web Workers.
       * @param {HighlightCallback} [callback] An optional callback to be invoked on each element after its highlighting is done.
       * @memberof Prism
       * @public
       */
      highlightAllUnder: function(v, w, _) {
        var x = {
          callback: _,
          container: v,
          selector: 'code[class*="language-"], [class*="language-"] code, code[class*="lang-"], [class*="lang-"] code'
        };
        o.hooks.run("before-highlightall", x), x.elements = Array.prototype.slice.apply(x.container.querySelectorAll(x.selector)), o.hooks.run("before-all-elements-highlight", x);
        for (var k = 0, S; S = x.elements[k++]; )
          o.highlightElement(S, w === !0, x.callback);
      },
      /**
       * Highlights the code inside a single element.
       *
       * The following hooks will be run:
       * 1. `before-sanity-check`
       * 2. `before-highlight`
       * 3. All hooks of {@link Prism.highlight}. These hooks will be run by an asynchronous worker if `async` is `true`.
       * 4. `before-insert`
       * 5. `after-highlight`
       * 6. `complete`
       *
       * Some the above hooks will be skipped if the element doesn't contain any text or there is no grammar loaded for
       * the element's language.
       *
       * @param {Element} element The element containing the code.
       * It must have a class of `language-xxxx` to be processed, where `xxxx` is a valid language identifier.
       * @param {boolean} [async=false] Whether the element is to be highlighted asynchronously using Web Workers
       * to improve performance and avoid blocking the UI when highlighting very large chunks of code. This option is
       * [disabled by default](https://prismjs.com/faq.html#why-is-asynchronous-highlighting-disabled-by-default).
       *
       * Note: All language definitions required to highlight the code must be included in the main `prism.js` file for
       * asynchronous highlighting to work. You can build your own bundle on the
       * [Download page](https://prismjs.com/download.html).
       * @param {HighlightCallback} [callback] An optional callback to be invoked after the highlighting is done.
       * Mostly useful when `async` is `true`, since in that case, the highlighting is done asynchronously.
       * @memberof Prism
       * @public
       */
      highlightElement: function(v, w, _) {
        var x = o.util.getLanguage(v), k = o.languages[x];
        o.util.setLanguage(v, x);
        var S = v.parentElement;
        S && S.nodeName.toLowerCase() === "pre" && o.util.setLanguage(S, x);
        var T = v.textContent, I = {
          element: v,
          language: x,
          grammar: k,
          code: T
        };
        function R(L) {
          I.highlightedCode = L, o.hooks.run("before-insert", I), I.element.innerHTML = I.highlightedCode, o.hooks.run("after-highlight", I), o.hooks.run("complete", I), _ && _.call(I.element);
        }
        if (o.hooks.run("before-sanity-check", I), S = I.element.parentElement, S && S.nodeName.toLowerCase() === "pre" && !S.hasAttribute("tabindex") && S.setAttribute("tabindex", "0"), !I.code) {
          o.hooks.run("complete", I), _ && _.call(I.element);
          return;
        }
        if (o.hooks.run("before-highlight", I), !I.grammar) {
          R(o.util.encode(I.code));
          return;
        }
        if (w && n.Worker) {
          var B = new Worker(o.filename);
          B.onmessage = function(L) {
            R(L.data);
          }, B.postMessage(JSON.stringify({
            language: I.language,
            code: I.code,
            immediateClose: !0
          }));
        } else
          R(o.highlight(I.code, I.grammar, I.language));
      },
      /**
       * Low-level function, only use if you know what you’re doing. It accepts a string of text as input
       * and the language definitions to use, and returns a string with the HTML produced.
       *
       * The following hooks will be run:
       * 1. `before-tokenize`
       * 2. `after-tokenize`
       * 3. `wrap`: On each {@link Token}.
       *
       * @param {string} text A string with the code to be highlighted.
       * @param {Grammar} grammar An object containing the tokens to use.
       *
       * Usually a language definition like `Prism.languages.markup`.
       * @param {string} language The name of the language definition passed to `grammar`.
       * @returns {string} The highlighted HTML.
       * @memberof Prism
       * @public
       * @example
       * Prism.highlight('var foo = true;', Prism.languages.javascript, 'javascript');
       */
      highlight: function(v, w, _) {
        var x = {
          code: v,
          grammar: w,
          language: _
        };
        if (o.hooks.run("before-tokenize", x), !x.grammar)
          throw new Error('The language "' + x.language + '" has no grammar.');
        return x.tokens = o.tokenize(x.code, x.grammar), o.hooks.run("after-tokenize", x), l.stringify(o.util.encode(x.tokens), x.language);
      },
      /**
       * This is the heart of Prism, and the most low-level function you can use. It accepts a string of text as input
       * and the language definitions to use, and returns an array with the tokenized code.
       *
       * When the language definition includes nested tokens, the function is called recursively on each of these tokens.
       *
       * This method could be useful in other contexts as well, as a very crude parser.
       *
       * @param {string} text A string with the code to be highlighted.
       * @param {Grammar} grammar An object containing the tokens to use.
       *
       * Usually a language definition like `Prism.languages.markup`.
       * @returns {TokenStream} An array of strings and tokens, a token stream.
       * @memberof Prism
       * @public
       * @example
       * let code = `var foo = 0;`;
       * let tokens = Prism.tokenize(code, Prism.languages.javascript);
       * tokens.forEach(token => {
       *     if (token instanceof Prism.Token && token.type === 'number') {
       *         console.log(`Found numeric literal: ${token.content}`);
       *     }
       * });
       */
      tokenize: function(v, w) {
        var _ = w.rest;
        if (_) {
          for (var x in _)
            w[x] = _[x];
          delete w.rest;
        }
        var k = new u();
        return f(k, k.head, v), h(v, k, w, k.head, 0), p(k);
      },
      /**
       * @namespace
       * @memberof Prism
       * @public
       */
      hooks: {
        all: {},
        /**
         * Adds the given callback to the list of callbacks for the given hook.
         *
         * The callback will be invoked when the hook it is registered for is run.
         * Hooks are usually directly run by a highlight function but you can also run hooks yourself.
         *
         * One callback function can be registered to multiple hooks and the same hook multiple times.
         *
         * @param {string} name The name of the hook.
         * @param {HookCallback} callback The callback function which is given environment variables.
         * @public
         */
        add: function(v, w) {
          var _ = o.hooks.all;
          _[v] = _[v] || [], _[v].push(w);
        },
        /**
         * Runs a hook invoking all registered callbacks with the given environment variables.
         *
         * Callbacks will be invoked synchronously and in the order in which they were registered.
         *
         * @param {string} name The name of the hook.
         * @param {Object<string, any>} env The environment variables of the hook passed to all callbacks registered.
         * @public
         */
        run: function(v, w) {
          var _ = o.hooks.all[v];
          if (!(!_ || !_.length))
            for (var x = 0, k; k = _[x++]; )
              k(w);
        }
      },
      Token: l
    };
    n.Prism = o;
    function l(v, w, _, x) {
      this.type = v, this.content = w, this.alias = _, this.length = (x || "").length | 0;
    }
    l.stringify = function v(w, _) {
      if (typeof w == "string")
        return w;
      if (Array.isArray(w)) {
        var x = "";
        return w.forEach(function(R) {
          x += v(R, _);
        }), x;
      }
      var k = {
        type: w.type,
        content: v(w.content, _),
        tag: "span",
        classes: ["token", w.type],
        attributes: {},
        language: _
      }, S = w.alias;
      S && (Array.isArray(S) ? Array.prototype.push.apply(k.classes, S) : k.classes.push(S)), o.hooks.run("wrap", k);
      var T = "";
      for (var I in k.attributes)
        T += " " + I + '="' + (k.attributes[I] || "").replace(/"/g, "&quot;") + '"';
      return "<" + k.tag + ' class="' + k.classes.join(" ") + '"' + T + ">" + k.content + "</" + k.tag + ">";
    };
    function c(v, w, _, x) {
      v.lastIndex = w;
      var k = v.exec(_);
      if (k && x && k[1]) {
        var S = k[1].length;
        k.index += S, k[0] = k[0].slice(S);
      }
      return k;
    }
    function h(v, w, _, x, k, S) {
      for (var T in _)
        if (!(!_.hasOwnProperty(T) || !_[T])) {
          var I = _[T];
          I = Array.isArray(I) ? I : [I];
          for (var R = 0; R < I.length; ++R) {
            if (S && S.cause == T + "," + R)
              return;
            var B = I[R], L = B.inside, it = !!B.lookbehind, O = !!B.greedy, at = B.alias;
            if (O && !B.pattern.global) {
              var W = B.pattern.toString().match(/[imsuy]*$/)[0];
              B.pattern = RegExp(B.pattern.source, W + "g");
            }
            for (var q = B.pattern || B, K = x.next, z = k; K !== w.tail && !(S && z >= S.reach); z += K.value.length, K = K.next) {
              var j = K.value;
              if (w.length > v.length)
                return;
              if (!(j instanceof l)) {
                var N = 1, Q;
                if (O) {
                  if (Q = c(q, z, v, it), !Q || Q.index >= v.length)
                    break;
                  var dt = Q.index, Y = Q.index + Q[0].length, et = z;
                  for (et += K.value.length; dt >= et; )
                    K = K.next, et += K.value.length;
                  if (et -= K.value.length, z = et, K.value instanceof l)
                    continue;
                  for (var $ = K; $ !== w.tail && (et < Y || typeof $.value == "string"); $ = $.next)
                    N++, et += $.value.length;
                  N--, j = v.slice(z, et), Q.index -= z;
                } else if (Q = c(q, 0, j, it), !Q)
                  continue;
                var dt = Q.index, tt = Q[0], ut = j.slice(0, dt), St = j.slice(dt + tt.length), G = z + j.length;
                S && G > S.reach && (S.reach = G);
                var V = K.prev;
                ut && (V = f(w, V, ut), z += ut.length), d(w, V, N);
                var nt = new l(T, L ? o.tokenize(tt, L) : tt, at, tt);
                if (K = f(w, V, nt), St && f(w, K, St), N > 1) {
                  var gt = {
                    cause: T + "," + R,
                    reach: G
                  };
                  h(v, w, _, K.prev, z, gt), S && gt.reach > S.reach && (S.reach = gt.reach);
                }
              }
            }
          }
        }
    }
    function u() {
      var v = { value: null, prev: null, next: null }, w = { value: null, prev: v, next: null };
      v.next = w, this.head = v, this.tail = w, this.length = 0;
    }
    function f(v, w, _) {
      var x = w.next, k = { value: _, prev: w, next: x };
      return w.next = k, x.prev = k, v.length++, k;
    }
    function d(v, w, _) {
      for (var x = w.next, k = 0; k < _ && x !== v.tail; k++)
        x = x.next;
      w.next = x, x.prev = w, v.length -= k;
    }
    function p(v) {
      for (var w = [], _ = v.head.next; _ !== v.tail; )
        w.push(_.value), _ = _.next;
      return w;
    }
    if (!n.document)
      return n.addEventListener && (o.disableWorkerMessageHandler || n.addEventListener("message", function(v) {
        var w = JSON.parse(v.data), _ = w.language, x = w.code, k = w.immediateClose;
        n.postMessage(o.highlight(x, o.languages[_], _)), k && n.close();
      }, !1)), o;
    var g = o.util.currentScript();
    g && (o.filename = g.src, g.hasAttribute("data-manual") && (o.manual = !0));
    function b() {
      o.manual || o.highlightAll();
    }
    if (!o.manual) {
      var y = document.readyState;
      y === "loading" || y === "interactive" && g && g.defer ? document.addEventListener("DOMContentLoaded", b) : window.requestAnimationFrame ? window.requestAnimationFrame(b) : window.setTimeout(b, 16);
    }
    return o;
  }(t);
  i.exports && (i.exports = e), typeof nA < "u" && (nA.Prism = e), e.languages.markup = {
    comment: {
      pattern: /<!--(?:(?!<!--)[\s\S])*?-->/,
      greedy: !0
    },
    prolog: {
      pattern: /<\?[\s\S]+?\?>/,
      greedy: !0
    },
    doctype: {
      // https://www.w3.org/TR/xml/#NT-doctypedecl
      pattern: /<!DOCTYPE(?:[^>"'[\]]|"[^"]*"|'[^']*')+(?:\[(?:[^<"'\]]|"[^"]*"|'[^']*'|<(?!!--)|<!--(?:[^-]|-(?!->))*-->)*\]\s*)?>/i,
      greedy: !0,
      inside: {
        "internal-subset": {
          pattern: /(^[^\[]*\[)[\s\S]+(?=\]>$)/,
          lookbehind: !0,
          greedy: !0,
          inside: null
          // see below
        },
        string: {
          pattern: /"[^"]*"|'[^']*'/,
          greedy: !0
        },
        punctuation: /^<!|>$|[[\]]/,
        "doctype-tag": /^DOCTYPE/i,
        name: /[^\s<>'"]+/
      }
    },
    cdata: {
      pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
      greedy: !0
    },
    tag: {
      pattern: /<\/?(?!\d)[^\s>\/=$<%]+(?:\s(?:\s*[^\s>\/=]+(?:\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))|(?=[\s/>])))+)?\s*\/?>/,
      greedy: !0,
      inside: {
        tag: {
          pattern: /^<\/?[^\s>\/]+/,
          inside: {
            punctuation: /^<\/?/,
            namespace: /^[^\s>\/:]+:/
          }
        },
        "special-attr": [],
        "attr-value": {
          pattern: /=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+)/,
          inside: {
            punctuation: [
              {
                pattern: /^=/,
                alias: "attr-equals"
              },
              {
                pattern: /^(\s*)["']|["']$/,
                lookbehind: !0
              }
            ]
          }
        },
        punctuation: /\/?>/,
        "attr-name": {
          pattern: /[^\s>\/]+/,
          inside: {
            namespace: /^[^\s>\/:]+:/
          }
        }
      }
    },
    entity: [
      {
        pattern: /&[\da-z]{1,8};/i,
        alias: "named-entity"
      },
      /&#x?[\da-f]{1,8};/i
    ]
  }, e.languages.markup.tag.inside["attr-value"].inside.entity = e.languages.markup.entity, e.languages.markup.doctype.inside["internal-subset"].inside = e.languages.markup, e.hooks.add("wrap", function(n) {
    n.type === "entity" && (n.attributes.title = n.content.replace(/&amp;/, "&"));
  }), Object.defineProperty(e.languages.markup.tag, "addInlined", {
    /**
     * Adds an inlined language to markup.
     *
     * An example of an inlined language is CSS with `<style>` tags.
     *
     * @param {string} tagName The name of the tag that contains the inlined language. This name will be treated as
     * case insensitive.
     * @param {string} lang The language key.
     * @example
     * addInlined('style', 'css');
     */
    value: function(s, r) {
      var a = {};
      a["language-" + r] = {
        pattern: /(^<!\[CDATA\[)[\s\S]+?(?=\]\]>$)/i,
        lookbehind: !0,
        inside: e.languages[r]
      }, a.cdata = /^<!\[CDATA\[|\]\]>$/i;
      var o = {
        "included-cdata": {
          pattern: /<!\[CDATA\[[\s\S]*?\]\]>/i,
          inside: a
        }
      };
      o["language-" + r] = {
        pattern: /[\s\S]+/,
        inside: e.languages[r]
      };
      var l = {};
      l[s] = {
        pattern: RegExp(/(<__[^>]*>)(?:<!\[CDATA\[(?:[^\]]|\](?!\]>))*\]\]>|(?!<!\[CDATA\[)[\s\S])*?(?=<\/__>)/.source.replace(/__/g, function() {
          return s;
        }), "i"),
        lookbehind: !0,
        greedy: !0,
        inside: o
      }, e.languages.insertBefore("markup", "cdata", l);
    }
  }), Object.defineProperty(e.languages.markup.tag, "addAttribute", {
    /**
     * Adds an pattern to highlight languages embedded in HTML attributes.
     *
     * An example of an inlined language is CSS with `style` attributes.
     *
     * @param {string} attrName The name of the tag that contains the inlined language. This name will be treated as
     * case insensitive.
     * @param {string} lang The language key.
     * @example
     * addAttribute('style', 'css');
     */
    value: function(n, s) {
      e.languages.markup.tag.inside["special-attr"].push({
        pattern: RegExp(
          /(^|["'\s])/.source + "(?:" + n + ")" + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
          "i"
        ),
        lookbehind: !0,
        inside: {
          "attr-name": /^[^\s=]+/,
          "attr-value": {
            pattern: /=[\s\S]+/,
            inside: {
              value: {
                pattern: /(^=\s*(["']|(?!["'])))\S[\s\S]*(?=\2$)/,
                lookbehind: !0,
                alias: [s, "language-" + s],
                inside: e.languages[s]
              },
              punctuation: [
                {
                  pattern: /^=/,
                  alias: "attr-equals"
                },
                /"|'/
              ]
            }
          }
        }
      });
    }
  }), e.languages.html = e.languages.markup, e.languages.mathml = e.languages.markup, e.languages.svg = e.languages.markup, e.languages.xml = e.languages.extend("markup", {}), e.languages.ssml = e.languages.xml, e.languages.atom = e.languages.xml, e.languages.rss = e.languages.xml, function(n) {
    var s = /(?:"(?:\\(?:\r\n|[\s\S])|[^"\\\r\n])*"|'(?:\\(?:\r\n|[\s\S])|[^'\\\r\n])*')/;
    n.languages.css = {
      comment: /\/\*[\s\S]*?\*\//,
      atrule: {
        pattern: RegExp("@[\\w-](?:" + /[^;{\s"']|\s+(?!\s)/.source + "|" + s.source + ")*?" + /(?:;|(?=\s*\{))/.source),
        inside: {
          rule: /^@[\w-]+/,
          "selector-function-argument": {
            pattern: /(\bselector\s*\(\s*(?![\s)]))(?:[^()\s]|\s+(?![\s)])|\((?:[^()]|\([^()]*\))*\))+(?=\s*\))/,
            lookbehind: !0,
            alias: "selector"
          },
          keyword: {
            pattern: /(^|[^\w-])(?:and|not|only|or)(?![\w-])/,
            lookbehind: !0
          }
          // See rest below
        }
      },
      url: {
        // https://drafts.csswg.org/css-values-3/#urls
        pattern: RegExp("\\burl\\((?:" + s.source + "|" + /(?:[^\\\r\n()"']|\\[\s\S])*/.source + ")\\)", "i"),
        greedy: !0,
        inside: {
          function: /^url/i,
          punctuation: /^\(|\)$/,
          string: {
            pattern: RegExp("^" + s.source + "$"),
            alias: "url"
          }
        }
      },
      selector: {
        pattern: RegExp(`(^|[{}\\s])[^{}\\s](?:[^{};"'\\s]|\\s+(?![\\s{])|` + s.source + ")*(?=\\s*\\{)"),
        lookbehind: !0
      },
      string: {
        pattern: s,
        greedy: !0
      },
      property: {
        pattern: /(^|[^-\w\xA0-\uFFFF])(?!\s)[-_a-z\xA0-\uFFFF](?:(?!\s)[-\w\xA0-\uFFFF])*(?=\s*:)/i,
        lookbehind: !0
      },
      important: /!important\b/i,
      function: {
        pattern: /(^|[^-a-z0-9])[-a-z0-9]+(?=\()/i,
        lookbehind: !0
      },
      punctuation: /[(){};:,]/
    }, n.languages.css.atrule.inside.rest = n.languages.css;
    var r = n.languages.markup;
    r && (r.tag.addInlined("style", "css"), r.tag.addAttribute("style", "css"));
  }(e), e.languages.clike = {
    comment: [
      {
        pattern: /(^|[^\\])\/\*[\s\S]*?(?:\*\/|$)/,
        lookbehind: !0,
        greedy: !0
      },
      {
        pattern: /(^|[^\\:])\/\/.*/,
        lookbehind: !0,
        greedy: !0
      }
    ],
    string: {
      pattern: /(["'])(?:\\(?:\r\n|[\s\S])|(?!\1)[^\\\r\n])*\1/,
      greedy: !0
    },
    "class-name": {
      pattern: /(\b(?:class|extends|implements|instanceof|interface|new|trait)\s+|\bcatch\s+\()[\w.\\]+/i,
      lookbehind: !0,
      inside: {
        punctuation: /[.\\]/
      }
    },
    keyword: /\b(?:break|catch|continue|do|else|finally|for|function|if|in|instanceof|new|null|return|throw|try|while)\b/,
    boolean: /\b(?:false|true)\b/,
    function: /\b\w+(?=\()/,
    number: /\b0x[\da-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:e[+-]?\d+)?/i,
    operator: /[<>]=?|[!=]=?=?|--?|\+\+?|&&?|\|\|?|[?*/~^%]/,
    punctuation: /[{}[\];(),.:]/
  }, e.languages.javascript = e.languages.extend("clike", {
    "class-name": [
      e.languages.clike["class-name"],
      {
        pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$A-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\.(?:constructor|prototype))/,
        lookbehind: !0
      }
    ],
    keyword: [
      {
        pattern: /((?:^|\})\s*)catch\b/,
        lookbehind: !0
      },
      {
        pattern: /(^|[^.]|\.\.\.\s*)\b(?:as|assert(?=\s*\{)|async(?=\s*(?:function\b|\(|[$\w\xA0-\uFFFF]|$))|await|break|case|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally(?=\s*(?:\{|$))|for|from(?=\s*(?:['"]|$))|function|(?:get|set)(?=\s*(?:[#\[$\w\xA0-\uFFFF]|$))|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)\b/,
        lookbehind: !0
      }
    ],
    // Allow for all non-ASCII characters (See http://stackoverflow.com/a/2008444)
    function: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*(?:\.\s*(?:apply|bind|call)\s*)?\()/,
    number: {
      pattern: RegExp(
        /(^|[^\w$])/.source + "(?:" + // constant
        (/NaN|Infinity/.source + "|" + // binary integer
        /0[bB][01]+(?:_[01]+)*n?/.source + "|" + // octal integer
        /0[oO][0-7]+(?:_[0-7]+)*n?/.source + "|" + // hexadecimal integer
        /0[xX][\dA-Fa-f]+(?:_[\dA-Fa-f]+)*n?/.source + "|" + // decimal bigint
        /\d+(?:_\d+)*n/.source + "|" + // decimal number (integer or float) but no bigint
        /(?:\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\.\d+(?:_\d+)*)(?:[Ee][+-]?\d+(?:_\d+)*)?/.source) + ")" + /(?![\w$])/.source
      ),
      lookbehind: !0
    },
    operator: /--|\+\+|\*\*=?|=>|&&=?|\|\|=?|[!=]==|<<=?|>>>?=?|[-+*/%&|^!=<>]=?|\.{3}|\?\?=?|\?\.?|[~:]/
  }), e.languages.javascript["class-name"][0].pattern = /(\b(?:class|extends|implements|instanceof|interface|new)\s+)[\w.\\]+/, e.languages.insertBefore("javascript", "keyword", {
    regex: {
      pattern: RegExp(
        // lookbehind
        // eslint-disable-next-line regexp/no-dupe-characters-character-class
        /((?:^|[^$\w\xA0-\uFFFF."'\])\s]|\b(?:return|yield))\s*)/.source + // Regex pattern:
        // There are 2 regex patterns here. The RegExp set notation proposal added support for nested character
        // classes if the `v` flag is present. Unfortunately, nested CCs are both context-free and incompatible
        // with the only syntax, so we have to define 2 different regex patterns.
        /\//.source + "(?:" + /(?:\[(?:[^\]\\\r\n]|\\.)*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}/.source + "|" + // `v` flag syntax. This supports 3 levels of nested character classes.
        /(?:\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.|\[(?:[^[\]\\\r\n]|\\.)*\])*\])*\]|\\.|[^/\\\[\r\n])+\/[dgimyus]{0,7}v[dgimyus]{0,7}/.source + ")" + // lookahead
        /(?=(?:\s|\/\*(?:[^*]|\*(?!\/))*\*\/)*(?:$|[\r\n,.;:})\]]|\/\/))/.source
      ),
      lookbehind: !0,
      greedy: !0,
      inside: {
        "regex-source": {
          pattern: /^(\/)[\s\S]+(?=\/[a-z]*$)/,
          lookbehind: !0,
          alias: "language-regex",
          inside: e.languages.regex
        },
        "regex-delimiter": /^\/|\/$/,
        "regex-flags": /^[a-z]+$/
      }
    },
    // This must be declared before keyword because we use "function" inside the look-forward
    "function-variable": {
      pattern: /#?(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*[=:]\s*(?:async\s*)?(?:\bfunction\b|(?:\((?:[^()]|\([^()]*\))*\)|(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)\s*=>))/,
      alias: "function"
    },
    parameter: [
      {
        pattern: /(function(?:\s+(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*)?\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\))/,
        lookbehind: !0,
        inside: e.languages.javascript
      },
      {
        pattern: /(^|[^$\w\xA0-\uFFFF])(?!\s)[_$a-z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*=>)/i,
        lookbehind: !0,
        inside: e.languages.javascript
      },
      {
        pattern: /(\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*=>)/,
        lookbehind: !0,
        inside: e.languages.javascript
      },
      {
        pattern: /((?:\b|\s|^)(?!(?:as|async|await|break|case|catch|class|const|continue|debugger|default|delete|do|else|enum|export|extends|finally|for|from|function|get|if|implements|import|in|instanceof|interface|let|new|null|of|package|private|protected|public|return|set|static|super|switch|this|throw|try|typeof|undefined|var|void|while|with|yield)(?![$\w\xA0-\uFFFF]))(?:(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*\s*)\(\s*|\]\s*\(\s*)(?!\s)(?:[^()\s]|\s+(?![\s)])|\([^()]*\))+(?=\s*\)\s*\{)/,
        lookbehind: !0,
        inside: e.languages.javascript
      }
    ],
    constant: /\b[A-Z](?:[A-Z_]|\dx?)*\b/
  }), e.languages.insertBefore("javascript", "string", {
    hashbang: {
      pattern: /^#!.*/,
      greedy: !0,
      alias: "comment"
    },
    "template-string": {
      pattern: /`(?:\\[\s\S]|\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}|(?!\$\{)[^\\`])*`/,
      greedy: !0,
      inside: {
        "template-punctuation": {
          pattern: /^`|`$/,
          alias: "string"
        },
        interpolation: {
          pattern: /((?:^|[^\\])(?:\\{2})*)\$\{(?:[^{}]|\{(?:[^{}]|\{[^}]*\})*\})+\}/,
          lookbehind: !0,
          inside: {
            "interpolation-punctuation": {
              pattern: /^\$\{|\}$/,
              alias: "punctuation"
            },
            rest: e.languages.javascript
          }
        },
        string: /[\s\S]+/
      }
    },
    "string-property": {
      pattern: /((?:^|[,{])[ \t]*)(["'])(?:\\(?:\r\n|[\s\S])|(?!\2)[^\\\r\n])*\2(?=\s*:)/m,
      lookbehind: !0,
      greedy: !0,
      alias: "property"
    }
  }), e.languages.insertBefore("javascript", "operator", {
    "literal-property": {
      pattern: /((?:^|[,{])[ \t]*)(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*:)/m,
      lookbehind: !0,
      alias: "property"
    }
  }), e.languages.markup && (e.languages.markup.tag.addInlined("script", "javascript"), e.languages.markup.tag.addAttribute(
    /on(?:abort|blur|change|click|composition(?:end|start|update)|dblclick|error|focus(?:in|out)?|key(?:down|up)|load|mouse(?:down|enter|leave|move|out|over|up)|reset|resize|scroll|select|slotchange|submit|unload|wheel)/.source,
    "javascript"
  )), e.languages.js = e.languages.javascript, function() {
    if (typeof e > "u" || typeof document > "u")
      return;
    Element.prototype.matches || (Element.prototype.matches = Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector);
    var n = "Loading…", s = function(g, b) {
      return "✖ Error " + g + " while fetching file: " + b;
    }, r = "✖ Error: File does not exist or is empty", a = {
      js: "javascript",
      py: "python",
      rb: "ruby",
      ps1: "powershell",
      psm1: "powershell",
      sh: "bash",
      bat: "batch",
      h: "c",
      tex: "latex"
    }, o = "data-src-status", l = "loading", c = "loaded", h = "failed", u = "pre[data-src]:not([" + o + '="' + c + '"]):not([' + o + '="' + l + '"])';
    function f(g, b, y) {
      var v = new XMLHttpRequest();
      v.open("GET", g, !0), v.onreadystatechange = function() {
        v.readyState == 4 && (v.status < 400 && v.responseText ? b(v.responseText) : v.status >= 400 ? y(s(v.status, v.statusText)) : y(r));
      }, v.send(null);
    }
    function d(g) {
      var b = /^\s*(\d+)\s*(?:(,)\s*(?:(\d+)\s*)?)?$/.exec(g || "");
      if (b) {
        var y = Number(b[1]), v = b[2], w = b[3];
        return v ? w ? [y, Number(w)] : [y, void 0] : [y, y];
      }
    }
    e.hooks.add("before-highlightall", function(g) {
      g.selector += ", " + u;
    }), e.hooks.add("before-sanity-check", function(g) {
      var b = (
        /** @type {HTMLPreElement} */
        g.element
      );
      if (b.matches(u)) {
        g.code = "", b.setAttribute(o, l);
        var y = b.appendChild(document.createElement("CODE"));
        y.textContent = n;
        var v = b.getAttribute("data-src"), w = g.language;
        if (w === "none") {
          var _ = (/\.(\w+)$/.exec(v) || [, "none"])[1];
          w = a[_] || _;
        }
        e.util.setLanguage(y, w), e.util.setLanguage(b, w);
        var x = e.plugins.autoloader;
        x && x.loadLanguages(w), f(
          v,
          function(k) {
            b.setAttribute(o, c);
            var S = d(b.getAttribute("data-range"));
            if (S) {
              var T = k.split(/\r\n?|\n/g), I = S[0], R = S[1] == null ? T.length : S[1];
              I < 0 && (I += T.length), I = Math.max(0, Math.min(I - 1, T.length)), R < 0 && (R += T.length), R = Math.max(0, Math.min(R, T.length)), k = T.slice(I, R).join(`
`), b.hasAttribute("data-start") || b.setAttribute("data-start", String(I + 1));
            }
            y.textContent = k, e.highlightElement(y);
          },
          function(k) {
            b.setAttribute(o, h), y.textContent = k;
          }
        );
      }
    }), e.plugins.fileHighlight = {
      /**
       * Executes the File Highlight plugin for all matching `pre` elements under the given container.
       *
       * Note: Elements which are already loaded or currently loading will not be touched by this method.
       *
       * @param {ParentNode} [container=document]
       */
      highlight: function(b) {
        for (var y = (b || document).querySelectorAll(u), v = 0, w; w = y[v++]; )
          e.highlightElement(w);
      }
    };
    var p = !1;
    e.fileHighlight = function() {
      p || (console.warn("Prism.fileHighlight is deprecated. Use `Prism.plugins.fileHighlight.highlight` instead."), p = !0), e.plugins.fileHighlight.highlight.apply(this, arguments);
    };
  }();
})(nX);
Prism.languages.python = {
  comment: {
    pattern: /(^|[^\\])#.*/,
    lookbehind: !0,
    greedy: !0
  },
  "string-interpolation": {
    pattern: /(?:f|fr|rf)(?:("""|''')[\s\S]*?\1|("|')(?:\\.|(?!\2)[^\\\r\n])*\2)/i,
    greedy: !0,
    inside: {
      interpolation: {
        // "{" <expression> <optional "!s", "!r", or "!a"> <optional ":" format specifier> "}"
        pattern: /((?:^|[^{])(?:\{\{)*)\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}]|\{(?!\{)(?:[^{}])+\})+\})+\}/,
        lookbehind: !0,
        inside: {
          "format-spec": {
            pattern: /(:)[^:(){}]+(?=\}$)/,
            lookbehind: !0
          },
          "conversion-option": {
            pattern: /![sra](?=[:}]$)/,
            alias: "punctuation"
          },
          rest: null
        }
      },
      string: /[\s\S]+/
    }
  },
  "triple-quoted-string": {
    pattern: /(?:[rub]|br|rb)?("""|''')[\s\S]*?\1/i,
    greedy: !0,
    alias: "string"
  },
  string: {
    pattern: /(?:[rub]|br|rb)?("|')(?:\\.|(?!\1)[^\\\r\n])*\1/i,
    greedy: !0
  },
  function: {
    pattern: /((?:^|\s)def[ \t]+)[a-zA-Z_]\w*(?=\s*\()/g,
    lookbehind: !0
  },
  "class-name": {
    pattern: /(\bclass\s+)\w+/i,
    lookbehind: !0
  },
  decorator: {
    pattern: /(^[\t ]*)@\w+(?:\.\w+)*/m,
    lookbehind: !0,
    alias: ["annotation", "punctuation"],
    inside: {
      punctuation: /\./
    }
  },
  keyword: /\b(?:_(?=\s*:)|and|as|assert|async|await|break|case|class|continue|def|del|elif|else|except|exec|finally|for|from|global|if|import|in|is|lambda|match|nonlocal|not|or|pass|print|raise|return|try|while|with|yield)\b/,
  builtin: /\b(?:__import__|abs|all|any|apply|ascii|basestring|bin|bool|buffer|bytearray|bytes|callable|chr|classmethod|cmp|coerce|compile|complex|delattr|dict|dir|divmod|enumerate|eval|execfile|file|filter|float|format|frozenset|getattr|globals|hasattr|hash|help|hex|id|input|int|intern|isinstance|issubclass|iter|len|list|locals|long|map|max|memoryview|min|next|object|oct|open|ord|pow|property|range|raw_input|reduce|reload|repr|reversed|round|set|setattr|slice|sorted|staticmethod|str|sum|super|tuple|type|unichr|unicode|vars|xrange|zip)\b/,
  boolean: /\b(?:False|None|True)\b/,
  number: /\b0(?:b(?:_?[01])+|o(?:_?[0-7])+|x(?:_?[a-f0-9])+)\b|(?:\b\d+(?:_\d+)*(?:\.(?:\d+(?:_\d+)*)?)?|\B\.\d+(?:_\d+)*)(?:e[+-]?\d+(?:_\d+)*)?j?(?!\w)/i,
  operator: /[-+%=]=?|!=|:=|\*\*?=?|\/\/?=?|<[<=>]?|>[=>]?|[&|^~]/,
  punctuation: /[{}[\];(),.:]/
};
Prism.languages.python["string-interpolation"].inside.interpolation.inside.rest = Prism.languages.python;
Prism.languages.py = Prism.languages.python;
(function(i) {
  var t = /\\(?:[^a-z()[\]]|[a-z*]+)/i, e = {
    "equation-command": {
      pattern: t,
      alias: "regex"
    }
  };
  i.languages.latex = {
    comment: /%.*/,
    // the verbatim environment prints whitespace to the document
    cdata: {
      pattern: /(\\begin\{((?:lstlisting|verbatim)\*?)\})[\s\S]*?(?=\\end\{\2\})/,
      lookbehind: !0
    },
    /*
     * equations can be between $$ $$ or $ $ or \( \) or \[ \]
     * (all are multiline)
     */
    equation: [
      {
        pattern: /\$\$(?:\\[\s\S]|[^\\$])+\$\$|\$(?:\\[\s\S]|[^\\$])+\$|\\\([\s\S]*?\\\)|\\\[[\s\S]*?\\\]/,
        inside: e,
        alias: "string"
      },
      {
        pattern: /(\\begin\{((?:align|eqnarray|equation|gather|math|multline)\*?)\})[\s\S]*?(?=\\end\{\2\})/,
        lookbehind: !0,
        inside: e,
        alias: "string"
      }
    ],
    /*
     * arguments which are keywords or references are highlighted
     * as keywords
     */
    keyword: {
      pattern: /(\\(?:begin|cite|documentclass|end|label|ref|usepackage)(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
      lookbehind: !0
    },
    url: {
      pattern: /(\\url\{)[^}]+(?=\})/,
      lookbehind: !0
    },
    /*
     * section or chapter headlines are highlighted as bold so that
     * they stand out more
     */
    headline: {
      pattern: /(\\(?:chapter|frametitle|paragraph|part|section|subparagraph|subsection|subsubparagraph|subsubsection|subsubsubparagraph)\*?(?:\[[^\]]+\])?\{)[^}]+(?=\})/,
      lookbehind: !0,
      alias: "class-name"
    },
    function: {
      pattern: t,
      alias: "selector"
    },
    punctuation: /[[\]{}&]/
  }, i.languages.tex = i.languages.latex, i.languages.context = i.languages.latex;
})(Prism);
(function(i) {
  var t = "\\b(?:BASH|BASHOPTS|BASH_ALIASES|BASH_ARGC|BASH_ARGV|BASH_CMDS|BASH_COMPLETION_COMPAT_DIR|BASH_LINENO|BASH_REMATCH|BASH_SOURCE|BASH_VERSINFO|BASH_VERSION|COLORTERM|COLUMNS|COMP_WORDBREAKS|DBUS_SESSION_BUS_ADDRESS|DEFAULTS_PATH|DESKTOP_SESSION|DIRSTACK|DISPLAY|EUID|GDMSESSION|GDM_LANG|GNOME_KEYRING_CONTROL|GNOME_KEYRING_PID|GPG_AGENT_INFO|GROUPS|HISTCONTROL|HISTFILE|HISTFILESIZE|HISTSIZE|HOME|HOSTNAME|HOSTTYPE|IFS|INSTANCE|JOB|LANG|LANGUAGE|LC_ADDRESS|LC_ALL|LC_IDENTIFICATION|LC_MEASUREMENT|LC_MONETARY|LC_NAME|LC_NUMERIC|LC_PAPER|LC_TELEPHONE|LC_TIME|LESSCLOSE|LESSOPEN|LINES|LOGNAME|LS_COLORS|MACHTYPE|MAILCHECK|MANDATORY_PATH|NO_AT_BRIDGE|OLDPWD|OPTERR|OPTIND|ORBIT_SOCKETDIR|OSTYPE|PAPERSIZE|PATH|PIPESTATUS|PPID|PS1|PS2|PS3|PS4|PWD|RANDOM|REPLY|SECONDS|SELINUX_INIT|SESSION|SESSIONTYPE|SESSION_MANAGER|SHELL|SHELLOPTS|SHLVL|SSH_AUTH_SOCK|TERM|UID|UPSTART_EVENTS|UPSTART_INSTANCE|UPSTART_JOB|UPSTART_SESSION|USER|WINDOWID|XAUTHORITY|XDG_CONFIG_DIRS|XDG_CURRENT_DESKTOP|XDG_DATA_DIRS|XDG_GREETER_DATA_DIR|XDG_MENU_PREFIX|XDG_RUNTIME_DIR|XDG_SEAT|XDG_SEAT_PATH|XDG_SESSION_DESKTOP|XDG_SESSION_ID|XDG_SESSION_PATH|XDG_SESSION_TYPE|XDG_VTNR|XMODIFIERS)\\b", e = {
    pattern: /(^(["']?)\w+\2)[ \t]+\S.*/,
    lookbehind: !0,
    alias: "punctuation",
    // this looks reasonably well in all themes
    inside: null
    // see below
  }, n = {
    bash: e,
    environment: {
      pattern: RegExp("\\$" + t),
      alias: "constant"
    },
    variable: [
      // [0]: Arithmetic Environment
      {
        pattern: /\$?\(\([\s\S]+?\)\)/,
        greedy: !0,
        inside: {
          // If there is a $ sign at the beginning highlight $(( and )) as variable
          variable: [
            {
              pattern: /(^\$\(\([\s\S]+)\)\)/,
              lookbehind: !0
            },
            /^\$\(\(/
          ],
          number: /\b0x[\dA-Fa-f]+\b|(?:\b\d+(?:\.\d*)?|\B\.\d+)(?:[Ee]-?\d+)?/,
          // Operators according to https://www.gnu.org/software/bash/manual/bashref.html#Shell-Arithmetic
          operator: /--|\+\+|\*\*=?|<<=?|>>=?|&&|\|\||[=!+\-*/%<>^&|]=?|[?~:]/,
          // If there is no $ sign at the beginning highlight (( and )) as punctuation
          punctuation: /\(\(?|\)\)?|,|;/
        }
      },
      // [1]: Command Substitution
      {
        pattern: /\$\((?:\([^)]+\)|[^()])+\)|`[^`]+`/,
        greedy: !0,
        inside: {
          variable: /^\$\(|^`|\)$|`$/
        }
      },
      // [2]: Brace expansion
      {
        pattern: /\$\{[^}]+\}/,
        greedy: !0,
        inside: {
          operator: /:[-=?+]?|[!\/]|##?|%%?|\^\^?|,,?/,
          punctuation: /[\[\]]/,
          environment: {
            pattern: RegExp("(\\{)" + t),
            lookbehind: !0,
            alias: "constant"
          }
        }
      },
      /\$(?:\w+|[#?*!@$])/
    ],
    // Escape sequences from echo and printf's manuals, and escaped quotes.
    entity: /\\(?:[abceEfnrtv\\"]|O?[0-7]{1,3}|U[0-9a-fA-F]{8}|u[0-9a-fA-F]{4}|x[0-9a-fA-F]{1,2})/
  };
  i.languages.bash = {
    shebang: {
      pattern: /^#!\s*\/.*/,
      alias: "important"
    },
    comment: {
      pattern: /(^|[^"{\\$])#.*/,
      lookbehind: !0
    },
    "function-name": [
      // a) function foo {
      // b) foo() {
      // c) function foo() {
      // but not “foo {”
      {
        // a) and c)
        pattern: /(\bfunction\s+)[\w-]+(?=(?:\s*\(?:\s*\))?\s*\{)/,
        lookbehind: !0,
        alias: "function"
      },
      {
        // b)
        pattern: /\b[\w-]+(?=\s*\(\s*\)\s*\{)/,
        alias: "function"
      }
    ],
    // Highlight variable names as variables in for and select beginnings.
    "for-or-select": {
      pattern: /(\b(?:for|select)\s+)\w+(?=\s+in\s)/,
      alias: "variable",
      lookbehind: !0
    },
    // Highlight variable names as variables in the left-hand part
    // of assignments (“=” and “+=”).
    "assign-left": {
      pattern: /(^|[\s;|&]|[<>]\()\w+(?:\.\w+)*(?=\+?=)/,
      inside: {
        environment: {
          pattern: RegExp("(^|[\\s;|&]|[<>]\\()" + t),
          lookbehind: !0,
          alias: "constant"
        }
      },
      alias: "variable",
      lookbehind: !0
    },
    // Highlight parameter names as variables
    parameter: {
      pattern: /(^|\s)-{1,2}(?:\w+:[+-]?)?\w+(?:\.\w+)*(?=[=\s]|$)/,
      alias: "variable",
      lookbehind: !0
    },
    string: [
      // Support for Here-documents https://en.wikipedia.org/wiki/Here_document
      {
        pattern: /((?:^|[^<])<<-?\s*)(\w+)\s[\s\S]*?(?:\r?\n|\r)\2/,
        lookbehind: !0,
        greedy: !0,
        inside: n
      },
      // Here-document with quotes around the tag
      // → No expansion (so no “inside”).
      {
        pattern: /((?:^|[^<])<<-?\s*)(["'])(\w+)\2\s[\s\S]*?(?:\r?\n|\r)\3/,
        lookbehind: !0,
        greedy: !0,
        inside: {
          bash: e
        }
      },
      // “Normal” string
      {
        // https://www.gnu.org/software/bash/manual/html_node/Double-Quotes.html
        pattern: /(^|[^\\](?:\\\\)*)"(?:\\[\s\S]|\$\([^)]+\)|\$(?!\()|`[^`]+`|[^"\\`$])*"/,
        lookbehind: !0,
        greedy: !0,
        inside: n
      },
      {
        // https://www.gnu.org/software/bash/manual/html_node/Single-Quotes.html
        pattern: /(^|[^$\\])'[^']*'/,
        lookbehind: !0,
        greedy: !0
      },
      {
        // https://www.gnu.org/software/bash/manual/html_node/ANSI_002dC-Quoting.html
        pattern: /\$'(?:[^'\\]|\\[\s\S])*'/,
        greedy: !0,
        inside: {
          entity: n.entity
        }
      }
    ],
    environment: {
      pattern: RegExp("\\$?" + t),
      alias: "constant"
    },
    variable: n.variable,
    function: {
      pattern: /(^|[\s;|&]|[<>]\()(?:add|apropos|apt|apt-cache|apt-get|aptitude|aspell|automysqlbackup|awk|basename|bash|bc|bconsole|bg|bzip2|cal|cargo|cat|cfdisk|chgrp|chkconfig|chmod|chown|chroot|cksum|clear|cmp|column|comm|composer|cp|cron|crontab|csplit|curl|cut|date|dc|dd|ddrescue|debootstrap|df|diff|diff3|dig|dir|dircolors|dirname|dirs|dmesg|docker|docker-compose|du|egrep|eject|env|ethtool|expand|expect|expr|fdformat|fdisk|fg|fgrep|file|find|fmt|fold|format|free|fsck|ftp|fuser|gawk|git|gparted|grep|groupadd|groupdel|groupmod|groups|grub-mkconfig|gzip|halt|head|hg|history|host|hostname|htop|iconv|id|ifconfig|ifdown|ifup|import|install|ip|java|jobs|join|kill|killall|less|link|ln|locate|logname|logrotate|look|lpc|lpr|lprint|lprintd|lprintq|lprm|ls|lsof|lynx|make|man|mc|mdadm|mkconfig|mkdir|mke2fs|mkfifo|mkfs|mkisofs|mknod|mkswap|mmv|more|most|mount|mtools|mtr|mutt|mv|nano|nc|netstat|nice|nl|node|nohup|notify-send|npm|nslookup|op|open|parted|passwd|paste|pathchk|ping|pkill|pnpm|podman|podman-compose|popd|pr|printcap|printenv|ps|pushd|pv|quota|quotacheck|quotactl|ram|rar|rcp|reboot|remsync|rename|renice|rev|rm|rmdir|rpm|rsync|scp|screen|sdiff|sed|sendmail|seq|service|sftp|sh|shellcheck|shuf|shutdown|sleep|slocate|sort|split|ssh|stat|strace|su|sudo|sum|suspend|swapon|sync|sysctl|tac|tail|tar|tee|time|timeout|top|touch|tr|traceroute|tsort|tty|umount|uname|unexpand|uniq|units|unrar|unshar|unzip|update-grub|uptime|useradd|userdel|usermod|users|uudecode|uuencode|v|vcpkg|vdir|vi|vim|virsh|vmstat|wait|watch|wc|wget|whereis|which|who|whoami|write|xargs|xdg-open|yarn|yes|zenity|zip|zsh|zypper)(?=$|[)\s;|&])/,
      lookbehind: !0
    },
    keyword: {
      pattern: /(^|[\s;|&]|[<>]\()(?:case|do|done|elif|else|esac|fi|for|function|if|in|select|then|until|while)(?=$|[)\s;|&])/,
      lookbehind: !0
    },
    // https://www.gnu.org/software/bash/manual/html_node/Shell-Builtin-Commands.html
    builtin: {
      pattern: /(^|[\s;|&]|[<>]\()(?:\.|:|alias|bind|break|builtin|caller|cd|command|continue|declare|echo|enable|eval|exec|exit|export|getopts|hash|help|let|local|logout|mapfile|printf|pwd|read|readarray|readonly|return|set|shift|shopt|source|test|times|trap|type|typeset|ulimit|umask|unalias|unset)(?=$|[)\s;|&])/,
      lookbehind: !0,
      // Alias added to make those easier to distinguish from strings.
      alias: "class-name"
    },
    boolean: {
      pattern: /(^|[\s;|&]|[<>]\()(?:false|true)(?=$|[)\s;|&])/,
      lookbehind: !0
    },
    "file-descriptor": {
      pattern: /\B&\d\b/,
      alias: "important"
    },
    operator: {
      // Lots of redirections here, but not just that.
      pattern: /\d?<>|>\||\+=|=[=~]?|!=?|<<[<-]?|[&\d]?>>|\d[<>]&?|[<>][&=]?|&[>&]?|\|[&|]?/,
      inside: {
        "file-descriptor": {
          pattern: /^\d/,
          alias: "important"
        }
      }
    },
    punctuation: /\$?\(\(?|\)\)?|\.\.|[{}[\];\\]/,
    number: {
      pattern: /(^|\s)(?:[1-9]\d*|0)(?:[.,]\d+)?\b/,
      lookbehind: !0
    }
  }, e.inside = i.languages.bash;
  for (var s = [
    "comment",
    "function-name",
    "for-or-select",
    "assign-left",
    "parameter",
    "string",
    "environment",
    "function",
    "keyword",
    "builtin",
    "boolean",
    "file-descriptor",
    "operator",
    "punctuation",
    "number"
  ], r = n.variable[1].inside, a = 0; a < s.length; a++)
    r[s[a]] = i.languages.bash[s[a]];
  i.languages.sh = i.languages.bash, i.languages.shell = i.languages.bash;
})(Prism);
new fI();
const sX = (i) => {
  const t = {};
  for (let e = 0, n = i.length; e < n; e++) {
    const s = i[e];
    for (const r in s)
      t[r] ? t[r] = t[r].concat(s[r]) : t[r] = s[r];
  }
  return t;
}, rX = [
  "abbr",
  "accept",
  "accept-charset",
  "accesskey",
  "action",
  "align",
  "alink",
  "allow",
  "allowfullscreen",
  "alt",
  "anchor",
  "archive",
  "as",
  "async",
  "autocapitalize",
  "autocomplete",
  "autocorrect",
  "autofocus",
  "autopictureinpicture",
  "autoplay",
  "axis",
  "background",
  "behavior",
  "bgcolor",
  "border",
  "bordercolor",
  "capture",
  "cellpadding",
  "cellspacing",
  "challenge",
  "char",
  "charoff",
  "charset",
  "checked",
  "cite",
  "class",
  "classid",
  "clear",
  "code",
  "codebase",
  "codetype",
  "color",
  "cols",
  "colspan",
  "compact",
  "content",
  "contenteditable",
  "controls",
  "controlslist",
  "conversiondestination",
  "coords",
  "crossorigin",
  "csp",
  "data",
  "datetime",
  "declare",
  "decoding",
  "default",
  "defer",
  "dir",
  "direction",
  "dirname",
  "disabled",
  "disablepictureinpicture",
  "disableremoteplayback",
  "disallowdocumentaccess",
  "download",
  "draggable",
  "elementtiming",
  "enctype",
  "end",
  "enterkeyhint",
  "event",
  "exportparts",
  "face",
  "for",
  "form",
  "formaction",
  "formenctype",
  "formmethod",
  "formnovalidate",
  "formtarget",
  "frame",
  "frameborder",
  "headers",
  "height",
  "hidden",
  "high",
  "href",
  "hreflang",
  "hreftranslate",
  "hspace",
  "http-equiv",
  "id",
  "imagesizes",
  "imagesrcset",
  "importance",
  "impressiondata",
  "impressionexpiry",
  "incremental",
  "inert",
  "inputmode",
  "integrity",
  "invisible",
  "ismap",
  "keytype",
  "kind",
  "label",
  "lang",
  "language",
  "latencyhint",
  "leftmargin",
  "link",
  "list",
  "loading",
  "longdesc",
  "loop",
  "low",
  "lowsrc",
  "manifest",
  "marginheight",
  "marginwidth",
  "max",
  "maxlength",
  "mayscript",
  "media",
  "method",
  "min",
  "minlength",
  "multiple",
  "muted",
  "name",
  "nohref",
  "nomodule",
  "nonce",
  "noresize",
  "noshade",
  "novalidate",
  "nowrap",
  "object",
  "open",
  "optimum",
  "part",
  "pattern",
  "ping",
  "placeholder",
  "playsinline",
  "policy",
  "poster",
  "preload",
  "pseudo",
  "readonly",
  "referrerpolicy",
  "rel",
  "reportingorigin",
  "required",
  "resources",
  "rev",
  "reversed",
  "role",
  "rows",
  "rowspan",
  "rules",
  "sandbox",
  "scheme",
  "scope",
  "scopes",
  "scrollamount",
  "scrolldelay",
  "scrolling",
  "select",
  "selected",
  "shadowroot",
  "shadowrootdelegatesfocus",
  "shape",
  "size",
  "sizes",
  "slot",
  "span",
  "spellcheck",
  "src",
  "srclang",
  "srcset",
  "standby",
  "start",
  "step",
  "style",
  "summary",
  "tabindex",
  "target",
  "text",
  "title",
  "topmargin",
  "translate",
  "truespeed",
  "trusttoken",
  "type",
  "usemap",
  "valign",
  "value",
  "valuetype",
  "version",
  "virtualkeyboardpolicy",
  "vlink",
  "vspace",
  "webkitdirectory",
  "width",
  "wrap"
], aX = [
  "accent-height",
  "accumulate",
  "additive",
  "alignment-baseline",
  "ascent",
  "attributename",
  "attributetype",
  "azimuth",
  "basefrequency",
  "baseline-shift",
  "begin",
  "bias",
  "by",
  "class",
  "clip",
  "clippathunits",
  "clip-path",
  "clip-rule",
  "color",
  "color-interpolation",
  "color-interpolation-filters",
  "color-profile",
  "color-rendering",
  "cx",
  "cy",
  "d",
  "dx",
  "dy",
  "diffuseconstant",
  "direction",
  "display",
  "divisor",
  "dominant-baseline",
  "dur",
  "edgemode",
  "elevation",
  "end",
  "fill",
  "fill-opacity",
  "fill-rule",
  "filter",
  "filterunits",
  "flood-color",
  "flood-opacity",
  "font-family",
  "font-size",
  "font-size-adjust",
  "font-stretch",
  "font-style",
  "font-variant",
  "font-weight",
  "fx",
  "fy",
  "g1",
  "g2",
  "glyph-name",
  "glyphref",
  "gradientunits",
  "gradienttransform",
  "height",
  "href",
  "id",
  "image-rendering",
  "in",
  "in2",
  "k",
  "k1",
  "k2",
  "k3",
  "k4",
  "kerning",
  "keypoints",
  "keysplines",
  "keytimes",
  "lang",
  "lengthadjust",
  "letter-spacing",
  "kernelmatrix",
  "kernelunitlength",
  "lighting-color",
  "local",
  "marker-end",
  "marker-mid",
  "marker-start",
  "markerheight",
  "markerunits",
  "markerwidth",
  "maskcontentunits",
  "maskunits",
  "max",
  "mask",
  "media",
  "method",
  "mode",
  "min",
  "name",
  "numoctaves",
  "offset",
  "operator",
  "opacity",
  "order",
  "orient",
  "orientation",
  "origin",
  "overflow",
  "paint-order",
  "path",
  "pathlength",
  "patterncontentunits",
  "patterntransform",
  "patternunits",
  "points",
  "preservealpha",
  "preserveaspectratio",
  "primitiveunits",
  "r",
  "rx",
  "ry",
  "radius",
  "refx",
  "refy",
  "repeatcount",
  "repeatdur",
  "restart",
  "result",
  "rotate",
  "scale",
  "seed",
  "shape-rendering",
  "specularconstant",
  "specularexponent",
  "spreadmethod",
  "startoffset",
  "stddeviation",
  "stitchtiles",
  "stop-color",
  "stop-opacity",
  "stroke-dasharray",
  "stroke-dashoffset",
  "stroke-linecap",
  "stroke-linejoin",
  "stroke-miterlimit",
  "stroke-opacity",
  "stroke",
  "stroke-width",
  "style",
  "surfacescale",
  "systemlanguage",
  "tabindex",
  "targetx",
  "targety",
  "transform",
  "transform-origin",
  "text-anchor",
  "text-decoration",
  "text-rendering",
  "textlength",
  "type",
  "u1",
  "u2",
  "unicode",
  "values",
  "viewbox",
  "visibility",
  "version",
  "vert-adv-y",
  "vert-origin-x",
  "vert-origin-y",
  "width",
  "word-spacing",
  "wrap",
  "writing-mode",
  "xchannelselector",
  "ychannelselector",
  "x",
  "x1",
  "x2",
  "xmlns",
  "y",
  "y1",
  "y2",
  "z",
  "zoomandpan"
], oX = [
  "accent",
  "accentunder",
  "align",
  "bevelled",
  "close",
  "columnsalign",
  "columnlines",
  "columnspan",
  "denomalign",
  "depth",
  "dir",
  "display",
  "displaystyle",
  "encoding",
  "fence",
  "frame",
  "height",
  "href",
  "id",
  "largeop",
  "length",
  "linethickness",
  "lspace",
  "lquote",
  "mathbackground",
  "mathcolor",
  "mathsize",
  "mathvariant",
  "maxsize",
  "minsize",
  "movablelimits",
  "notation",
  "numalign",
  "open",
  "rowalign",
  "rowlines",
  "rowspacing",
  "rowspan",
  "rspace",
  "rquote",
  "scriptlevel",
  "scriptminsize",
  "scriptsizemultiplier",
  "selection",
  "separator",
  "separators",
  "stretchy",
  "subscriptshift",
  "supscriptshift",
  "symmetric",
  "voffset",
  "width",
  "xmlns"
];
sX([
  Object.fromEntries(rX.map((i) => [i, ["*"]])),
  Object.fromEntries(aX.map((i) => [i, ["svg:*"]])),
  Object.fromEntries(oX.map((i) => [i, ["math:*"]]))
]);
const {
  HtmlTagHydration: dK,
  SvelteComponent: fK,
  attr: pK,
  binding_callbacks: mK,
  children: gK,
  claim_element: bK,
  claim_html_tag: yK,
  detach: wK,
  element: vK,
  init: _K,
  insert_hydration: xK,
  noop: kK,
  safe_not_equal: AK,
  toggle_class: SK
} = window.__gradio__svelte__internal, { afterUpdate: CK, tick: EK, onMount: DK } = window.__gradio__svelte__internal, {
  SvelteComponent: TK,
  attr: FK,
  children: IK,
  claim_component: MK,
  claim_element: RK,
  create_component: BK,
  destroy_component: PK,
  detach: NK,
  element: LK,
  init: OK,
  insert_hydration: $K,
  mount_component: qK,
  safe_not_equal: zK,
  transition_in: UK,
  transition_out: HK
} = window.__gradio__svelte__internal, {
  SvelteComponent: jK,
  attr: GK,
  check_outros: VK,
  children: WK,
  claim_component: XK,
  claim_element: YK,
  claim_space: KK,
  create_component: ZK,
  create_slot: JK,
  destroy_component: QK,
  detach: tZ,
  element: eZ,
  empty: iZ,
  get_all_dirty_from_scope: nZ,
  get_slot_changes: sZ,
  group_outros: rZ,
  init: aZ,
  insert_hydration: oZ,
  mount_component: lZ,
  safe_not_equal: cZ,
  space: hZ,
  toggle_class: uZ,
  transition_in: dZ,
  transition_out: fZ,
  update_slot_base: pZ
} = window.__gradio__svelte__internal, {
  SvelteComponent: mZ,
  append_hydration: gZ,
  attr: bZ,
  children: yZ,
  claim_component: wZ,
  claim_element: vZ,
  claim_space: _Z,
  claim_text: xZ,
  create_component: kZ,
  destroy_component: AZ,
  detach: SZ,
  element: CZ,
  init: EZ,
  insert_hydration: DZ,
  mount_component: TZ,
  safe_not_equal: FZ,
  set_data: IZ,
  space: MZ,
  text: RZ,
  toggle_class: BZ,
  transition_in: PZ,
  transition_out: NZ
} = window.__gradio__svelte__internal, {
  SvelteComponent: lX,
  append_hydration: R9,
  attr: Go,
  bubble: cX,
  check_outros: hX,
  children: my,
  claim_component: uX,
  claim_element: gy,
  claim_space: sA,
  claim_text: dX,
  construct_svelte_component: rA,
  create_component: aA,
  create_slot: fX,
  destroy_component: oA,
  detach: U2,
  element: by,
  get_all_dirty_from_scope: pX,
  get_slot_changes: mX,
  group_outros: gX,
  init: bX,
  insert_hydration: pI,
  listen: yX,
  mount_component: lA,
  safe_not_equal: wX,
  set_data: vX,
  set_style: x5,
  space: cA,
  text: _X,
  toggle_class: Ln,
  transition_in: u7,
  transition_out: d7,
  update_slot_base: xX
} = window.__gradio__svelte__internal;
function hA(i) {
  let t, e;
  return {
    c() {
      t = by("span"), e = _X(
        /*label*/
        i[1]
      ), this.h();
    },
    l(n) {
      t = gy(n, "SPAN", { class: !0 });
      var s = my(t);
      e = dX(
        s,
        /*label*/
        i[1]
      ), s.forEach(U2), this.h();
    },
    h() {
      Go(t, "class", "svelte-qgco6m");
    },
    m(n, s) {
      pI(n, t, s), R9(t, e);
    },
    p(n, s) {
      s & /*label*/
      2 && vX(
        e,
        /*label*/
        n[1]
      );
    },
    d(n) {
      n && U2(t);
    }
  };
}
function kX(i) {
  let t, e, n, s, r, a, o, l, c = (
    /*show_label*/
    i[2] && hA(i)
  );
  var h = (
    /*Icon*/
    i[0]
  );
  function u(p, g) {
    return {};
  }
  h && (s = rA(h, u()));
  const f = (
    /*#slots*/
    i[14].default
  ), d = fX(
    f,
    i,
    /*$$scope*/
    i[13],
    null
  );
  return {
    c() {
      t = by("button"), c && c.c(), e = cA(), n = by("div"), s && aA(s.$$.fragment), r = cA(), d && d.c(), this.h();
    },
    l(p) {
      t = gy(p, "BUTTON", {
        "aria-label": !0,
        "aria-haspopup": !0,
        title: !0,
        class: !0
      });
      var g = my(t);
      c && c.l(g), e = sA(g), n = gy(g, "DIV", { class: !0 });
      var b = my(n);
      s && uX(s.$$.fragment, b), r = sA(b), d && d.l(b), b.forEach(U2), g.forEach(U2), this.h();
    },
    h() {
      Go(n, "class", "svelte-qgco6m"), Ln(
        n,
        "x-small",
        /*size*/
        i[4] === "x-small"
      ), Ln(
        n,
        "small",
        /*size*/
        i[4] === "small"
      ), Ln(
        n,
        "large",
        /*size*/
        i[4] === "large"
      ), Ln(
        n,
        "medium",
        /*size*/
        i[4] === "medium"
      ), t.disabled = /*disabled*/
      i[7], Go(
        t,
        "aria-label",
        /*label*/
        i[1]
      ), Go(
        t,
        "aria-haspopup",
        /*hasPopup*/
        i[8]
      ), Go(
        t,
        "title",
        /*label*/
        i[1]
      ), Go(t, "class", "svelte-qgco6m"), Ln(
        t,
        "pending",
        /*pending*/
        i[3]
      ), Ln(
        t,
        "padded",
        /*padded*/
        i[5]
      ), Ln(
        t,
        "highlight",
        /*highlight*/
        i[6]
      ), Ln(
        t,
        "transparent",
        /*transparent*/
        i[9]
      ), x5(t, "color", !/*disabled*/
      i[7] && /*_color*/
      i[11] ? (
        /*_color*/
        i[11]
      ) : "var(--block-label-text-color)"), x5(t, "--bg-color", /*disabled*/
      i[7] ? "auto" : (
        /*background*/
        i[10]
      ));
    },
    m(p, g) {
      pI(p, t, g), c && c.m(t, null), R9(t, e), R9(t, n), s && lA(s, n, null), R9(n, r), d && d.m(n, null), a = !0, o || (l = yX(
        t,
        "click",
        /*click_handler*/
        i[15]
      ), o = !0);
    },
    p(p, [g]) {
      if (/*show_label*/
      p[2] ? c ? c.p(p, g) : (c = hA(p), c.c(), c.m(t, e)) : c && (c.d(1), c = null), g & /*Icon*/
      1 && h !== (h = /*Icon*/
      p[0])) {
        if (s) {
          gX();
          const b = s;
          d7(b.$$.fragment, 1, 0, () => {
            oA(b, 1);
          }), hX();
        }
        h ? (s = rA(h, u()), aA(s.$$.fragment), u7(s.$$.fragment, 1), lA(s, n, r)) : s = null;
      }
      d && d.p && (!a || g & /*$$scope*/
      8192) && xX(
        d,
        f,
        p,
        /*$$scope*/
        p[13],
        a ? mX(
          f,
          /*$$scope*/
          p[13],
          g,
          null
        ) : pX(
          /*$$scope*/
          p[13]
        ),
        null
      ), (!a || g & /*size*/
      16) && Ln(
        n,
        "x-small",
        /*size*/
        p[4] === "x-small"
      ), (!a || g & /*size*/
      16) && Ln(
        n,
        "small",
        /*size*/
        p[4] === "small"
      ), (!a || g & /*size*/
      16) && Ln(
        n,
        "large",
        /*size*/
        p[4] === "large"
      ), (!a || g & /*size*/
      16) && Ln(
        n,
        "medium",
        /*size*/
        p[4] === "medium"
      ), (!a || g & /*disabled*/
      128) && (t.disabled = /*disabled*/
      p[7]), (!a || g & /*label*/
      2) && Go(
        t,
        "aria-label",
        /*label*/
        p[1]
      ), (!a || g & /*hasPopup*/
      256) && Go(
        t,
        "aria-haspopup",
        /*hasPopup*/
        p[8]
      ), (!a || g & /*label*/
      2) && Go(
        t,
        "title",
        /*label*/
        p[1]
      ), (!a || g & /*pending*/
      8) && Ln(
        t,
        "pending",
        /*pending*/
        p[3]
      ), (!a || g & /*padded*/
      32) && Ln(
        t,
        "padded",
        /*padded*/
        p[5]
      ), (!a || g & /*highlight*/
      64) && Ln(
        t,
        "highlight",
        /*highlight*/
        p[6]
      ), (!a || g & /*transparent*/
      512) && Ln(
        t,
        "transparent",
        /*transparent*/
        p[9]
      ), g & /*disabled, _color*/
      2176 && x5(t, "color", !/*disabled*/
      p[7] && /*_color*/
      p[11] ? (
        /*_color*/
        p[11]
      ) : "var(--block-label-text-color)"), g & /*disabled, background*/
      1152 && x5(t, "--bg-color", /*disabled*/
      p[7] ? "auto" : (
        /*background*/
        p[10]
      ));
    },
    i(p) {
      a || (s && u7(s.$$.fragment, p), u7(d, p), a = !0);
    },
    o(p) {
      s && d7(s.$$.fragment, p), d7(d, p), a = !1;
    },
    d(p) {
      p && U2(t), c && c.d(), s && oA(s), d && d.d(p), o = !1, l();
    }
  };
}
function AX(i, t, e) {
  let n, { $$slots: s = {}, $$scope: r } = t, { Icon: a } = t, { label: o = "" } = t, { show_label: l = !1 } = t, { pending: c = !1 } = t, { size: h = "small" } = t, { padded: u = !0 } = t, { highlight: f = !1 } = t, { disabled: d = !1 } = t, { hasPopup: p = !1 } = t, { color: g = "var(--block-label-text-color)" } = t, { transparent: b = !1 } = t, { background: y = "var(--block-background-fill)" } = t;
  function v(w) {
    cX.call(this, i, w);
  }
  return i.$$set = (w) => {
    "Icon" in w && e(0, a = w.Icon), "label" in w && e(1, o = w.label), "show_label" in w && e(2, l = w.show_label), "pending" in w && e(3, c = w.pending), "size" in w && e(4, h = w.size), "padded" in w && e(5, u = w.padded), "highlight" in w && e(6, f = w.highlight), "disabled" in w && e(7, d = w.disabled), "hasPopup" in w && e(8, p = w.hasPopup), "color" in w && e(12, g = w.color), "transparent" in w && e(9, b = w.transparent), "background" in w && e(10, y = w.background), "$$scope" in w && e(13, r = w.$$scope);
  }, i.$$.update = () => {
    i.$$.dirty & /*highlight, color*/
    4160 && e(11, n = f ? "var(--color-accent)" : g);
  }, [
    a,
    o,
    l,
    c,
    h,
    u,
    f,
    d,
    p,
    b,
    y,
    n,
    g,
    r,
    s,
    v
  ];
}
class SX extends lX {
  constructor(t) {
    super(), bX(this, t, AX, kX, wX, {
      Icon: 0,
      label: 1,
      show_label: 2,
      pending: 3,
      size: 4,
      padded: 5,
      highlight: 6,
      disabled: 7,
      hasPopup: 8,
      color: 12,
      transparent: 9,
      background: 10
    });
  }
}
const {
  SvelteComponent: LZ,
  append_hydration: OZ,
  attr: $Z,
  binding_callbacks: qZ,
  children: zZ,
  claim_element: UZ,
  create_slot: HZ,
  detach: jZ,
  element: GZ,
  get_all_dirty_from_scope: VZ,
  get_slot_changes: WZ,
  init: XZ,
  insert_hydration: YZ,
  safe_not_equal: KZ,
  toggle_class: ZZ,
  transition_in: JZ,
  transition_out: QZ,
  update_slot_base: tJ
} = window.__gradio__svelte__internal, {
  SvelteComponent: eJ,
  append_hydration: iJ,
  attr: nJ,
  children: sJ,
  claim_svg_element: rJ,
  detach: aJ,
  init: oJ,
  insert_hydration: lJ,
  noop: cJ,
  safe_not_equal: hJ,
  svg_element: uJ
} = window.__gradio__svelte__internal, {
  SvelteComponent: dJ,
  append_hydration: fJ,
  attr: pJ,
  children: mJ,
  claim_svg_element: gJ,
  detach: bJ,
  init: yJ,
  insert_hydration: wJ,
  noop: vJ,
  safe_not_equal: _J,
  svg_element: xJ
} = window.__gradio__svelte__internal, {
  SvelteComponent: kJ,
  append_hydration: AJ,
  attr: SJ,
  children: CJ,
  claim_svg_element: EJ,
  detach: DJ,
  init: TJ,
  insert_hydration: FJ,
  noop: IJ,
  safe_not_equal: MJ,
  svg_element: RJ
} = window.__gradio__svelte__internal, {
  SvelteComponent: BJ,
  append_hydration: PJ,
  attr: NJ,
  children: LJ,
  claim_svg_element: OJ,
  detach: $J,
  init: qJ,
  insert_hydration: zJ,
  noop: UJ,
  safe_not_equal: HJ,
  svg_element: jJ
} = window.__gradio__svelte__internal, {
  SvelteComponent: GJ,
  append_hydration: VJ,
  attr: WJ,
  children: XJ,
  claim_svg_element: YJ,
  detach: KJ,
  init: ZJ,
  insert_hydration: JJ,
  noop: QJ,
  safe_not_equal: tQ,
  svg_element: eQ
} = window.__gradio__svelte__internal, {
  SvelteComponent: iQ,
  append_hydration: nQ,
  attr: sQ,
  children: rQ,
  claim_svg_element: aQ,
  detach: oQ,
  init: lQ,
  insert_hydration: cQ,
  noop: hQ,
  safe_not_equal: uQ,
  svg_element: dQ
} = window.__gradio__svelte__internal, {
  SvelteComponent: fQ,
  append_hydration: pQ,
  attr: mQ,
  children: gQ,
  claim_svg_element: bQ,
  detach: yQ,
  init: wQ,
  insert_hydration: vQ,
  noop: _Q,
  safe_not_equal: xQ,
  svg_element: kQ
} = window.__gradio__svelte__internal, {
  SvelteComponent: AQ,
  append_hydration: SQ,
  attr: CQ,
  children: EQ,
  claim_svg_element: DQ,
  detach: TQ,
  init: FQ,
  insert_hydration: IQ,
  noop: MQ,
  safe_not_equal: RQ,
  svg_element: BQ
} = window.__gradio__svelte__internal, {
  SvelteComponent: PQ,
  append_hydration: NQ,
  attr: LQ,
  children: OQ,
  claim_svg_element: $Q,
  detach: qQ,
  init: zQ,
  insert_hydration: UQ,
  noop: HQ,
  safe_not_equal: jQ,
  svg_element: GQ
} = window.__gradio__svelte__internal, {
  SvelteComponent: VQ,
  append_hydration: WQ,
  attr: XQ,
  children: YQ,
  claim_svg_element: KQ,
  detach: ZQ,
  init: JQ,
  insert_hydration: QQ,
  noop: ttt,
  safe_not_equal: ett,
  svg_element: itt
} = window.__gradio__svelte__internal, {
  SvelteComponent: ntt,
  append_hydration: stt,
  attr: rtt,
  children: att,
  claim_svg_element: ott,
  detach: ltt,
  init: ctt,
  insert_hydration: htt,
  noop: utt,
  safe_not_equal: dtt,
  svg_element: ftt
} = window.__gradio__svelte__internal, {
  SvelteComponent: ptt,
  append_hydration: mtt,
  attr: gtt,
  children: btt,
  claim_svg_element: ytt,
  detach: wtt,
  init: vtt,
  insert_hydration: _tt,
  noop: xtt,
  safe_not_equal: ktt,
  svg_element: Att
} = window.__gradio__svelte__internal, {
  SvelteComponent: CX,
  append_hydration: f7,
  attr: Qr,
  children: k5,
  claim_svg_element: A5,
  detach: jf,
  init: EX,
  insert_hydration: DX,
  noop: p7,
  safe_not_equal: TX,
  set_style: Ua,
  svg_element: S5
} = window.__gradio__svelte__internal;
function FX(i) {
  let t, e, n, s;
  return {
    c() {
      t = S5("svg"), e = S5("g"), n = S5("path"), s = S5("path"), this.h();
    },
    l(r) {
      t = A5(r, "svg", {
        width: !0,
        height: !0,
        viewBox: !0,
        version: !0,
        xmlns: !0,
        "xmlns:xlink": !0,
        "xml:space": !0,
        stroke: !0,
        style: !0
      });
      var a = k5(t);
      e = A5(a, "g", { transform: !0 });
      var o = k5(e);
      n = A5(o, "path", { d: !0, style: !0 }), k5(n).forEach(jf), o.forEach(jf), s = A5(a, "path", { d: !0, style: !0 }), k5(s).forEach(jf), a.forEach(jf), this.h();
    },
    h() {
      Qr(n, "d", "M18,6L6.087,17.913"), Ua(n, "fill", "none"), Ua(n, "fill-rule", "nonzero"), Ua(n, "stroke-width", "2px"), Qr(e, "transform", "matrix(1.14096,-0.140958,-0.140958,1.14096,-0.0559523,0.0559523)"), Qr(s, "d", "M4.364,4.364L19.636,19.636"), Ua(s, "fill", "none"), Ua(s, "fill-rule", "nonzero"), Ua(s, "stroke-width", "2px"), Qr(t, "width", "100%"), Qr(t, "height", "100%"), Qr(t, "viewBox", "0 0 24 24"), Qr(t, "version", "1.1"), Qr(t, "xmlns", "http://www.w3.org/2000/svg"), Qr(t, "xmlns:xlink", "http://www.w3.org/1999/xlink"), Qr(t, "xml:space", "preserve"), Qr(t, "stroke", "currentColor"), Ua(t, "fill-rule", "evenodd"), Ua(t, "clip-rule", "evenodd"), Ua(t, "stroke-linecap", "round"), Ua(t, "stroke-linejoin", "round");
    },
    m(r, a) {
      DX(r, t, a), f7(t, e), f7(e, n), f7(t, s);
    },
    p: p7,
    i: p7,
    o: p7,
    d(r) {
      r && jf(t);
    }
  };
}
class IX extends CX {
  constructor(t) {
    super(), EX(this, t, null, FX, TX, {});
  }
}
const {
  SvelteComponent: Stt,
  append_hydration: Ctt,
  attr: Ett,
  children: Dtt,
  claim_svg_element: Ttt,
  detach: Ftt,
  init: Itt,
  insert_hydration: Mtt,
  noop: Rtt,
  safe_not_equal: Btt,
  svg_element: Ptt
} = window.__gradio__svelte__internal, {
  SvelteComponent: Ntt,
  append_hydration: Ltt,
  attr: Ott,
  children: $tt,
  claim_svg_element: qtt,
  detach: ztt,
  init: Utt,
  insert_hydration: Htt,
  noop: jtt,
  safe_not_equal: Gtt,
  svg_element: Vtt
} = window.__gradio__svelte__internal, {
  SvelteComponent: Wtt,
  append_hydration: Xtt,
  attr: Ytt,
  children: Ktt,
  claim_svg_element: Ztt,
  detach: Jtt,
  init: Qtt,
  insert_hydration: tet,
  noop: eet,
  safe_not_equal: iet,
  svg_element: net
} = window.__gradio__svelte__internal, {
  SvelteComponent: set,
  append_hydration: ret,
  attr: aet,
  children: oet,
  claim_svg_element: cet,
  detach: het,
  init: uet,
  insert_hydration: det,
  noop: fet,
  safe_not_equal: pet,
  svg_element: met
} = window.__gradio__svelte__internal, {
  SvelteComponent: get,
  append_hydration: bet,
  attr: yet,
  children: wet,
  claim_svg_element: vet,
  detach: _et,
  init: xet,
  insert_hydration: ket,
  noop: Aet,
  safe_not_equal: Cet,
  svg_element: Eet
} = window.__gradio__svelte__internal, {
  SvelteComponent: Det,
  append_hydration: Tet,
  attr: Fet,
  children: Iet,
  claim_svg_element: Met,
  detach: Ret,
  init: Bet,
  insert_hydration: Pet,
  noop: Net,
  safe_not_equal: Let,
  svg_element: Oet
} = window.__gradio__svelte__internal, {
  SvelteComponent: $et,
  append_hydration: qet,
  attr: zet,
  children: Uet,
  claim_svg_element: Het,
  detach: jet,
  init: Get,
  insert_hydration: Vet,
  noop: Wet,
  safe_not_equal: Xet,
  svg_element: Yet
} = window.__gradio__svelte__internal, {
  SvelteComponent: Ket,
  append_hydration: Zet,
  attr: Jet,
  children: Qet,
  claim_svg_element: tit,
  detach: eit,
  init: iit,
  insert_hydration: nit,
  noop: sit,
  safe_not_equal: rit,
  svg_element: ait
} = window.__gradio__svelte__internal, {
  SvelteComponent: oit,
  append_hydration: lit,
  attr: cit,
  children: hit,
  claim_svg_element: uit,
  detach: dit,
  init: fit,
  insert_hydration: pit,
  noop: mit,
  safe_not_equal: git,
  svg_element: bit
} = window.__gradio__svelte__internal, {
  SvelteComponent: yit,
  append_hydration: wit,
  attr: vit,
  children: _it,
  claim_svg_element: xit,
  detach: kit,
  init: Ait,
  insert_hydration: Sit,
  noop: Cit,
  safe_not_equal: Eit,
  svg_element: Dit
} = window.__gradio__svelte__internal, {
  SvelteComponent: Tit,
  append_hydration: Fit,
  attr: Iit,
  children: Mit,
  claim_svg_element: Rit,
  detach: Bit,
  init: Pit,
  insert_hydration: Nit,
  noop: Lit,
  safe_not_equal: Oit,
  svg_element: $it
} = window.__gradio__svelte__internal, {
  SvelteComponent: qit,
  append_hydration: zit,
  attr: Uit,
  children: Hit,
  claim_svg_element: jit,
  detach: Git,
  init: Vit,
  insert_hydration: Wit,
  noop: Xit,
  safe_not_equal: Yit,
  svg_element: Kit
} = window.__gradio__svelte__internal, {
  SvelteComponent: Zit,
  append_hydration: Jit,
  attr: Qit,
  children: tnt,
  claim_svg_element: ent,
  detach: int,
  init: nnt,
  insert_hydration: snt,
  noop: rnt,
  safe_not_equal: ant,
  svg_element: ont
} = window.__gradio__svelte__internal, {
  SvelteComponent: lnt,
  append_hydration: cnt,
  attr: hnt,
  children: unt,
  claim_svg_element: dnt,
  detach: fnt,
  init: pnt,
  insert_hydration: mnt,
  noop: gnt,
  safe_not_equal: bnt,
  svg_element: ynt
} = window.__gradio__svelte__internal, {
  SvelteComponent: wnt,
  append_hydration: vnt,
  attr: _nt,
  children: xnt,
  claim_svg_element: knt,
  detach: Ant,
  init: Snt,
  insert_hydration: Cnt,
  noop: Ent,
  safe_not_equal: Dnt,
  svg_element: Tnt
} = window.__gradio__svelte__internal, {
  SvelteComponent: Fnt,
  append_hydration: Int,
  attr: Mnt,
  children: Rnt,
  claim_svg_element: Bnt,
  detach: Pnt,
  init: Nnt,
  insert_hydration: Lnt,
  noop: Ont,
  safe_not_equal: $nt,
  svg_element: qnt
} = window.__gradio__svelte__internal, {
  SvelteComponent: znt,
  append_hydration: Unt,
  attr: Hnt,
  children: jnt,
  claim_svg_element: Gnt,
  detach: Vnt,
  init: Wnt,
  insert_hydration: Xnt,
  noop: Ynt,
  safe_not_equal: Knt,
  svg_element: Znt
} = window.__gradio__svelte__internal, {
  SvelteComponent: Jnt,
  append_hydration: Qnt,
  attr: tst,
  children: est,
  claim_svg_element: ist,
  detach: nst,
  init: sst,
  insert_hydration: rst,
  noop: ast,
  safe_not_equal: ost,
  svg_element: lst
} = window.__gradio__svelte__internal, {
  SvelteComponent: cst,
  append_hydration: hst,
  attr: ust,
  children: dst,
  claim_svg_element: fst,
  detach: pst,
  init: mst,
  insert_hydration: gst,
  noop: bst,
  safe_not_equal: yst,
  svg_element: wst
} = window.__gradio__svelte__internal, {
  SvelteComponent: vst,
  append_hydration: _st,
  attr: xst,
  children: kst,
  claim_svg_element: Ast,
  detach: Sst,
  init: Cst,
  insert_hydration: Est,
  noop: Dst,
  safe_not_equal: Tst,
  svg_element: Fst
} = window.__gradio__svelte__internal, {
  SvelteComponent: Ist,
  append_hydration: Mst,
  attr: Rst,
  children: Bst,
  claim_svg_element: Pst,
  detach: Nst,
  init: Lst,
  insert_hydration: Ost,
  noop: $st,
  safe_not_equal: qst,
  svg_element: zst
} = window.__gradio__svelte__internal, {
  SvelteComponent: Ust,
  append_hydration: Hst,
  attr: jst,
  children: Gst,
  claim_svg_element: Vst,
  detach: Wst,
  init: Xst,
  insert_hydration: Yst,
  noop: Kst,
  safe_not_equal: Zst,
  svg_element: Jst
} = window.__gradio__svelte__internal, {
  SvelteComponent: Qst,
  append_hydration: trt,
  attr: ert,
  children: irt,
  claim_svg_element: nrt,
  detach: srt,
  init: rrt,
  insert_hydration: art,
  noop: ort,
  safe_not_equal: lrt,
  svg_element: crt
} = window.__gradio__svelte__internal, {
  SvelteComponent: hrt,
  append_hydration: urt,
  attr: drt,
  children: frt,
  claim_svg_element: prt,
  detach: mrt,
  init: grt,
  insert_hydration: brt,
  noop: yrt,
  safe_not_equal: wrt,
  svg_element: vrt
} = window.__gradio__svelte__internal, {
  SvelteComponent: _rt,
  append_hydration: xrt,
  attr: krt,
  children: Art,
  claim_svg_element: Srt,
  detach: Crt,
  init: Ert,
  insert_hydration: Drt,
  noop: Trt,
  safe_not_equal: Frt,
  svg_element: Irt
} = window.__gradio__svelte__internal, {
  SvelteComponent: Mrt,
  append_hydration: Rrt,
  attr: Brt,
  children: Prt,
  claim_svg_element: Nrt,
  detach: Lrt,
  init: Ort,
  insert_hydration: $rt,
  noop: qrt,
  safe_not_equal: zrt,
  svg_element: Urt
} = window.__gradio__svelte__internal, {
  SvelteComponent: Hrt,
  append_hydration: jrt,
  attr: Grt,
  children: Vrt,
  claim_svg_element: Wrt,
  detach: Xrt,
  init: Yrt,
  insert_hydration: Krt,
  noop: Zrt,
  safe_not_equal: Jrt,
  svg_element: Qrt
} = window.__gradio__svelte__internal, {
  SvelteComponent: tat,
  append_hydration: eat,
  attr: iat,
  children: nat,
  claim_svg_element: sat,
  detach: rat,
  init: aat,
  insert_hydration: oat,
  noop: lat,
  safe_not_equal: cat,
  svg_element: hat
} = window.__gradio__svelte__internal, {
  SvelteComponent: uat,
  append_hydration: dat,
  attr: fat,
  children: pat,
  claim_svg_element: mat,
  detach: gat,
  init: bat,
  insert_hydration: yat,
  noop: wat,
  safe_not_equal: vat,
  svg_element: _at
} = window.__gradio__svelte__internal, {
  SvelteComponent: xat,
  append_hydration: kat,
  attr: Aat,
  children: Sat,
  claim_svg_element: Cat,
  detach: Eat,
  init: Dat,
  insert_hydration: Tat,
  noop: Fat,
  safe_not_equal: Iat,
  svg_element: Mat
} = window.__gradio__svelte__internal, {
  SvelteComponent: Rat,
  append_hydration: Bat,
  attr: Pat,
  children: Nat,
  claim_svg_element: Lat,
  detach: Oat,
  init: $at,
  insert_hydration: qat,
  noop: zat,
  safe_not_equal: Uat,
  svg_element: Hat
} = window.__gradio__svelte__internal, {
  SvelteComponent: jat,
  append_hydration: Gat,
  attr: Vat,
  children: Wat,
  claim_svg_element: Xat,
  detach: Yat,
  init: Kat,
  insert_hydration: Zat,
  noop: Jat,
  safe_not_equal: Qat,
  svg_element: tot
} = window.__gradio__svelte__internal, {
  SvelteComponent: eot,
  append_hydration: iot,
  attr: not,
  children: sot,
  claim_svg_element: rot,
  detach: aot,
  init: oot,
  insert_hydration: lot,
  noop: cot,
  safe_not_equal: hot,
  svg_element: uot
} = window.__gradio__svelte__internal, {
  SvelteComponent: dot,
  append_hydration: fot,
  attr: pot,
  children: mot,
  claim_svg_element: got,
  detach: bot,
  init: yot,
  insert_hydration: wot,
  noop: vot,
  safe_not_equal: _ot,
  svg_element: xot
} = window.__gradio__svelte__internal, {
  SvelteComponent: kot,
  append_hydration: Aot,
  attr: Sot,
  children: Cot,
  claim_svg_element: Eot,
  detach: Dot,
  init: Tot,
  insert_hydration: Fot,
  noop: Iot,
  safe_not_equal: Mot,
  set_style: Rot,
  svg_element: Bot
} = window.__gradio__svelte__internal, {
  SvelteComponent: Pot,
  append_hydration: Not,
  attr: Lot,
  children: Oot,
  claim_svg_element: $ot,
  detach: qot,
  init: zot,
  insert_hydration: Uot,
  noop: Hot,
  safe_not_equal: jot,
  svg_element: Got
} = window.__gradio__svelte__internal, {
  SvelteComponent: Vot,
  append_hydration: Wot,
  attr: Xot,
  children: Yot,
  claim_svg_element: Kot,
  detach: Zot,
  init: Jot,
  insert_hydration: Qot,
  noop: tlt,
  safe_not_equal: elt,
  svg_element: ilt
} = window.__gradio__svelte__internal, {
  SvelteComponent: nlt,
  append_hydration: slt,
  attr: rlt,
  children: alt,
  claim_svg_element: olt,
  detach: llt,
  init: clt,
  insert_hydration: hlt,
  noop: ult,
  safe_not_equal: dlt,
  svg_element: flt
} = window.__gradio__svelte__internal, {
  SvelteComponent: plt,
  append_hydration: mlt,
  attr: glt,
  children: blt,
  claim_svg_element: ylt,
  detach: wlt,
  init: vlt,
  insert_hydration: _lt,
  noop: xlt,
  safe_not_equal: klt,
  svg_element: Alt
} = window.__gradio__svelte__internal, {
  SvelteComponent: Slt,
  append_hydration: Clt,
  attr: Elt,
  children: Dlt,
  claim_svg_element: Tlt,
  detach: Flt,
  init: Ilt,
  insert_hydration: Mlt,
  noop: Rlt,
  safe_not_equal: Blt,
  svg_element: Plt
} = window.__gradio__svelte__internal, {
  SvelteComponent: Nlt,
  append_hydration: Llt,
  attr: Olt,
  children: $lt,
  claim_svg_element: qlt,
  detach: zlt,
  init: Ult,
  insert_hydration: Hlt,
  noop: jlt,
  safe_not_equal: Glt,
  svg_element: Vlt
} = window.__gradio__svelte__internal, {
  SvelteComponent: Wlt,
  append_hydration: Xlt,
  attr: Ylt,
  children: Klt,
  claim_svg_element: Zlt,
  detach: Jlt,
  init: Qlt,
  insert_hydration: tct,
  noop: ect,
  safe_not_equal: ict,
  svg_element: nct
} = window.__gradio__svelte__internal, {
  SvelteComponent: sct,
  append_hydration: rct,
  attr: act,
  children: oct,
  claim_svg_element: lct,
  detach: cct,
  init: hct,
  insert_hydration: uct,
  noop: dct,
  safe_not_equal: fct,
  svg_element: pct
} = window.__gradio__svelte__internal, {
  SvelteComponent: mct,
  append_hydration: gct,
  attr: bct,
  children: yct,
  claim_svg_element: wct,
  claim_text: vct,
  detach: _ct,
  init: xct,
  insert_hydration: kct,
  noop: Act,
  safe_not_equal: Sct,
  svg_element: Cct,
  text: Ect
} = window.__gradio__svelte__internal, {
  SvelteComponent: Dct,
  append_hydration: Tct,
  attr: Fct,
  children: Ict,
  claim_svg_element: Mct,
  detach: Rct,
  init: Bct,
  insert_hydration: Pct,
  noop: Nct,
  safe_not_equal: Lct,
  svg_element: Oct
} = window.__gradio__svelte__internal, {
  SvelteComponent: $ct,
  append_hydration: qct,
  attr: zct,
  children: Uct,
  claim_svg_element: Hct,
  detach: jct,
  init: Gct,
  insert_hydration: Vct,
  noop: Wct,
  safe_not_equal: Xct,
  svg_element: Yct
} = window.__gradio__svelte__internal, {
  SvelteComponent: Kct,
  append_hydration: Zct,
  attr: Jct,
  children: Qct,
  claim_svg_element: t0t,
  detach: e0t,
  init: i0t,
  insert_hydration: n0t,
  noop: s0t,
  safe_not_equal: r0t,
  svg_element: a0t
} = window.__gradio__svelte__internal, {
  SvelteComponent: o0t,
  append_hydration: l0t,
  attr: c0t,
  children: h0t,
  claim_svg_element: u0t,
  detach: d0t,
  init: f0t,
  insert_hydration: p0t,
  noop: m0t,
  safe_not_equal: g0t,
  svg_element: b0t
} = window.__gradio__svelte__internal, {
  SvelteComponent: y0t,
  append_hydration: w0t,
  attr: v0t,
  children: _0t,
  claim_svg_element: x0t,
  detach: k0t,
  init: A0t,
  insert_hydration: S0t,
  noop: C0t,
  safe_not_equal: E0t,
  svg_element: D0t
} = window.__gradio__svelte__internal, {
  SvelteComponent: T0t,
  append_hydration: F0t,
  attr: I0t,
  children: M0t,
  claim_svg_element: R0t,
  detach: B0t,
  init: P0t,
  insert_hydration: N0t,
  noop: L0t,
  safe_not_equal: O0t,
  svg_element: $0t
} = window.__gradio__svelte__internal, {
  SvelteComponent: q0t,
  append_hydration: z0t,
  attr: U0t,
  children: H0t,
  claim_svg_element: j0t,
  detach: G0t,
  init: V0t,
  insert_hydration: W0t,
  noop: X0t,
  safe_not_equal: Y0t,
  svg_element: K0t
} = window.__gradio__svelte__internal, {
  SvelteComponent: Z0t,
  append_hydration: J0t,
  attr: Q0t,
  children: tht,
  claim_svg_element: eht,
  claim_text: iht,
  detach: nht,
  init: sht,
  insert_hydration: rht,
  noop: aht,
  safe_not_equal: oht,
  svg_element: lht,
  text: cht
} = window.__gradio__svelte__internal, {
  SvelteComponent: hht,
  append_hydration: uht,
  attr: dht,
  children: fht,
  claim_svg_element: pht,
  claim_text: mht,
  detach: ght,
  init: bht,
  insert_hydration: yht,
  noop: wht,
  safe_not_equal: vht,
  svg_element: _ht,
  text: xht
} = window.__gradio__svelte__internal, {
  SvelteComponent: kht,
  append_hydration: Aht,
  attr: Sht,
  children: Cht,
  claim_svg_element: Eht,
  claim_text: Dht,
  detach: Tht,
  init: Fht,
  insert_hydration: Iht,
  noop: Mht,
  safe_not_equal: Rht,
  svg_element: Bht,
  text: Pht
} = window.__gradio__svelte__internal, {
  SvelteComponent: Nht,
  append_hydration: Lht,
  attr: Oht,
  children: $ht,
  claim_svg_element: qht,
  detach: zht,
  init: Uht,
  insert_hydration: Hht,
  noop: jht,
  safe_not_equal: Ght,
  svg_element: Vht
} = window.__gradio__svelte__internal, {
  SvelteComponent: Wht,
  append_hydration: Xht,
  attr: Yht,
  children: Kht,
  claim_svg_element: Zht,
  detach: Jht,
  init: Qht,
  insert_hydration: t1t,
  noop: e1t,
  safe_not_equal: i1t,
  svg_element: n1t
} = window.__gradio__svelte__internal, {
  SvelteComponent: s1t,
  append_hydration: r1t,
  attr: a1t,
  children: o1t,
  claim_svg_element: l1t,
  detach: c1t,
  init: h1t,
  insert_hydration: u1t,
  noop: d1t,
  safe_not_equal: f1t,
  svg_element: p1t
} = window.__gradio__svelte__internal, {
  SvelteComponent: m1t,
  append_hydration: g1t,
  attr: b1t,
  children: y1t,
  claim_svg_element: w1t,
  detach: v1t,
  init: _1t,
  insert_hydration: x1t,
  noop: k1t,
  safe_not_equal: A1t,
  svg_element: S1t
} = window.__gradio__svelte__internal, {
  SvelteComponent: C1t,
  append_hydration: E1t,
  attr: D1t,
  children: T1t,
  claim_svg_element: F1t,
  detach: I1t,
  init: M1t,
  insert_hydration: R1t,
  noop: B1t,
  safe_not_equal: P1t,
  svg_element: N1t
} = window.__gradio__svelte__internal, {
  SvelteComponent: L1t,
  append_hydration: O1t,
  attr: $1t,
  children: q1t,
  claim_svg_element: z1t,
  detach: U1t,
  init: H1t,
  insert_hydration: j1t,
  noop: G1t,
  safe_not_equal: V1t,
  svg_element: W1t
} = window.__gradio__svelte__internal, {
  SvelteComponent: X1t,
  append_hydration: Y1t,
  attr: K1t,
  children: Z1t,
  claim_svg_element: J1t,
  detach: Q1t,
  init: tut,
  insert_hydration: eut,
  noop: iut,
  safe_not_equal: nut,
  svg_element: sut
} = window.__gradio__svelte__internal, {
  SvelteComponent: rut,
  append_hydration: aut,
  attr: out,
  children: lut,
  claim_svg_element: cut,
  detach: hut,
  init: uut,
  insert_hydration: dut,
  noop: fut,
  safe_not_equal: put,
  svg_element: mut
} = window.__gradio__svelte__internal, MX = [
  { 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 }
], uA = {
  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"
  }
};
MX.reduce(
  (i, { color: t, primary: e, secondary: n }) => ({
    ...i,
    [t]: {
      primary: uA[t][e],
      secondary: uA[t][n]
    }
  }),
  {}
);
const {
  SvelteComponent: gut,
  claim_component: but,
  create_component: yut,
  destroy_component: wut,
  init: vut,
  mount_component: _ut,
  safe_not_equal: xut,
  transition_in: kut,
  transition_out: Aut
} = window.__gradio__svelte__internal, { createEventDispatcher: Sut } = window.__gradio__svelte__internal, {
  SvelteComponent: Cut,
  append_hydration: Eut,
  attr: Dut,
  check_outros: Tut,
  children: Fut,
  claim_component: Iut,
  claim_element: Mut,
  claim_space: Rut,
  claim_text: But,
  create_component: Put,
  destroy_component: Nut,
  detach: Lut,
  element: Out,
  empty: $ut,
  group_outros: qut,
  init: zut,
  insert_hydration: Uut,
  mount_component: Hut,
  safe_not_equal: jut,
  set_data: Gut,
  space: Vut,
  text: Wut,
  toggle_class: Xut,
  transition_in: Yut,
  transition_out: Kut
} = window.__gradio__svelte__internal, {
  SvelteComponent: Zut,
  attr: Jut,
  children: Qut,
  claim_element: tdt,
  create_slot: edt,
  detach: idt,
  element: ndt,
  get_all_dirty_from_scope: sdt,
  get_slot_changes: rdt,
  init: adt,
  insert_hydration: odt,
  safe_not_equal: ldt,
  toggle_class: cdt,
  transition_in: hdt,
  transition_out: udt,
  update_slot_base: ddt
} = window.__gradio__svelte__internal, {
  SvelteComponent: fdt,
  append_hydration: pdt,
  attr: mdt,
  check_outros: gdt,
  children: bdt,
  claim_component: ydt,
  claim_element: wdt,
  claim_space: vdt,
  create_component: _dt,
  destroy_component: xdt,
  detach: kdt,
  element: Adt,
  empty: Sdt,
  group_outros: Cdt,
  init: Edt,
  insert_hydration: Ddt,
  listen: Tdt,
  mount_component: Fdt,
  safe_not_equal: Idt,
  space: Mdt,
  toggle_class: Rdt,
  transition_in: Bdt,
  transition_out: Pdt
} = window.__gradio__svelte__internal, {
  SvelteComponent: Ndt,
  attr: Ldt,
  children: Odt,
  claim_element: $dt,
  create_slot: qdt,
  detach: zdt,
  element: Udt,
  get_all_dirty_from_scope: Hdt,
  get_slot_changes: jdt,
  init: Gdt,
  insert_hydration: Vdt,
  null_to_empty: Wdt,
  safe_not_equal: Xdt,
  transition_in: Ydt,
  transition_out: Kdt,
  update_slot_base: Zdt
} = window.__gradio__svelte__internal, {
  SvelteComponent: Jdt,
  check_outros: Qdt,
  claim_component: tft,
  create_component: eft,
  destroy_component: ift,
  detach: nft,
  empty: sft,
  group_outros: rft,
  init: aft,
  insert_hydration: oft,
  mount_component: lft,
  noop: cft,
  safe_not_equal: hft,
  transition_in: uft,
  transition_out: dft
} = window.__gradio__svelte__internal, { createEventDispatcher: fft } = window.__gradio__svelte__internal;
function bu(i) {
  let t = ["", "k", "M", "G", "T", "P", "E", "Z"], e = 0;
  for (; i > 1e3 && e < t.length - 1; )
    i /= 1e3, e++;
  let n = t[e];
  return (Number.isInteger(i) ? i : i.toFixed(1)) + n;
}
function B9() {
}
function RX(i, t) {
  return i != i ? t == t : i !== t || i && typeof i == "object" || typeof i == "function";
}
const mI = typeof window < "u";
let dA = mI ? () => window.performance.now() : () => Date.now(), gI = mI ? (i) => requestAnimationFrame(i) : B9;
const Ru = /* @__PURE__ */ new Set();
function bI(i) {
  Ru.forEach((t) => {
    t.c(i) || (Ru.delete(t), t.f());
  }), Ru.size !== 0 && gI(bI);
}
function BX(i) {
  let t;
  return Ru.size === 0 && gI(bI), {
    promise: new Promise((e) => {
      Ru.add(t = { c: i, f: e });
    }),
    abort() {
      Ru.delete(t);
    }
  };
}
const Y1 = [];
function PX(i, t = B9) {
  let e;
  const n = /* @__PURE__ */ new Set();
  function s(o) {
    if (RX(i, o) && (i = o, e)) {
      const l = !Y1.length;
      for (const c of n)
        c[1](), Y1.push(c, i);
      if (l) {
        for (let c = 0; c < Y1.length; c += 2)
          Y1[c][0](Y1[c + 1]);
        Y1.length = 0;
      }
    }
  }
  function r(o) {
    s(o(i));
  }
  function a(o, l = B9) {
    const c = [o, l];
    return n.add(c), n.size === 1 && (e = t(s, r) || B9), o(i), () => {
      n.delete(c), n.size === 0 && e && (e(), e = null);
    };
  }
  return { set: s, update: r, subscribe: a };
}
function fA(i) {
  return Object.prototype.toString.call(i) === "[object Date]";
}
function yy(i, t, e, n) {
  if (typeof e == "number" || fA(e)) {
    const s = n - e, r = (e - t) / (i.dt || 1 / 60), a = i.opts.stiffness * s, o = i.opts.damping * r, l = (a - o) * i.inv_mass, c = (r + l) * i.dt;
    return Math.abs(c) < i.opts.precision && Math.abs(s) < i.opts.precision ? n : (i.settled = !1, fA(e) ? new Date(e.getTime() + c) : e + c);
  } else {
    if (Array.isArray(e))
      return e.map(
        (s, r) => yy(i, t[r], e[r], n[r])
      );
    if (typeof e == "object") {
      const s = {};
      for (const r in e)
        s[r] = yy(i, t[r], e[r], n[r]);
      return s;
    } else
      throw new Error(`Cannot spring ${typeof e} values`);
  }
}
function pA(i, t = {}) {
  const e = PX(i), { stiffness: n = 0.15, damping: s = 0.8, precision: r = 0.01 } = t;
  let a, o, l, c = i, h = i, u = 1, f = 0, d = !1;
  function p(b, y = {}) {
    h = b;
    const v = l = {};
    return i == null || y.hard || g.stiffness >= 1 && g.damping >= 1 ? (d = !0, a = dA(), c = b, e.set(i = h), Promise.resolve()) : (y.soft && (f = 1 / ((y.soft === !0 ? 0.5 : +y.soft) * 60), u = 0), o || (a = dA(), d = !1, o = BX((w) => {
      if (d)
        return d = !1, o = null, !1;
      u = Math.min(u + f, 1);
      const _ = {
        inv_mass: u,
        opts: g,
        settled: !0,
        dt: (w - a) * 60 / 1e3
      }, x = yy(_, c, i, h);
      return a = w, c = i, e.set(i = x), _.settled && (o = null), !_.settled;
    })), new Promise((w) => {
      o.promise.then(() => {
        v === l && w();
      });
    }));
  }
  const g = {
    set: p,
    update: (b, y) => p(b(h, i), y),
    subscribe: e.subscribe,
    stiffness: n,
    damping: s,
    precision: r
  };
  return g;
}
const {
  SvelteComponent: NX,
  append_hydration: ta,
  attr: Le,
  children: br,
  claim_element: LX,
  claim_svg_element: ea,
  component_subscribe: mA,
  detach: Os,
  element: OX,
  init: $X,
  insert_hydration: qX,
  noop: gA,
  safe_not_equal: zX,
  set_style: C5,
  svg_element: ia,
  toggle_class: bA
} = window.__gradio__svelte__internal, { onMount: UX } = window.__gradio__svelte__internal;
function HX(i) {
  let t, e, n, s, r, a, o, l, c, h, u, f;
  return {
    c() {
      t = OX("div"), e = ia("svg"), n = ia("g"), s = ia("path"), r = ia("path"), a = ia("path"), o = ia("path"), l = ia("g"), c = ia("path"), h = ia("path"), u = ia("path"), f = ia("path"), this.h();
    },
    l(d) {
      t = LX(d, "DIV", { class: !0 });
      var p = br(t);
      e = ea(p, "svg", {
        viewBox: !0,
        fill: !0,
        xmlns: !0,
        class: !0
      });
      var g = br(e);
      n = ea(g, "g", { style: !0 });
      var b = br(n);
      s = ea(b, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), br(s).forEach(Os), r = ea(b, "path", { d: !0, fill: !0, class: !0 }), br(r).forEach(Os), a = ea(b, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), br(a).forEach(Os), o = ea(b, "path", { d: !0, fill: !0, class: !0 }), br(o).forEach(Os), b.forEach(Os), l = ea(g, "g", { style: !0 });
      var y = br(l);
      c = ea(y, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), br(c).forEach(Os), h = ea(y, "path", { d: !0, fill: !0, class: !0 }), br(h).forEach(Os), u = ea(y, "path", {
        d: !0,
        fill: !0,
        "fill-opacity": !0,
        class: !0
      }), br(u).forEach(Os), f = ea(y, "path", { d: !0, fill: !0, class: !0 }), br(f).forEach(Os), y.forEach(Os), g.forEach(Os), p.forEach(Os), this.h();
    },
    h() {
      Le(s, "d", "M255.926 0.754768L509.702 139.936V221.027L255.926 81.8465V0.754768Z"), Le(s, "fill", "#FF7C00"), Le(s, "fill-opacity", "0.4"), Le(s, "class", "svelte-43sxxs"), Le(r, "d", "M509.69 139.936L254.981 279.641V361.255L509.69 221.55V139.936Z"), Le(r, "fill", "#FF7C00"), Le(r, "class", "svelte-43sxxs"), Le(a, "d", "M0.250138 139.937L254.981 279.641V361.255L0.250138 221.55V139.937Z"), Le(a, "fill", "#FF7C00"), Le(a, "fill-opacity", "0.4"), Le(a, "class", "svelte-43sxxs"), Le(o, "d", "M255.923 0.232622L0.236328 139.936V221.55L255.923 81.8469V0.232622Z"), Le(o, "fill", "#FF7C00"), Le(o, "class", "svelte-43sxxs"), C5(n, "transform", "translate(" + /*$top*/
      i[1][0] + "px, " + /*$top*/
      i[1][1] + "px)"), Le(c, "d", "M255.926 141.5L509.702 280.681V361.773L255.926 222.592V141.5Z"), Le(c, "fill", "#FF7C00"), Le(c, "fill-opacity", "0.4"), Le(c, "class", "svelte-43sxxs"), Le(h, "d", "M509.69 280.679L254.981 420.384V501.998L509.69 362.293V280.679Z"), Le(h, "fill", "#FF7C00"), Le(h, "class", "svelte-43sxxs"), Le(u, "d", "M0.250138 280.681L254.981 420.386V502L0.250138 362.295V280.681Z"), Le(u, "fill", "#FF7C00"), Le(u, "fill-opacity", "0.4"), Le(u, "class", "svelte-43sxxs"), Le(f, "d", "M255.923 140.977L0.236328 280.68V362.294L255.923 222.591V140.977Z"), Le(f, "fill", "#FF7C00"), Le(f, "class", "svelte-43sxxs"), C5(l, "transform", "translate(" + /*$bottom*/
      i[2][0] + "px, " + /*$bottom*/
      i[2][1] + "px)"), Le(e, "viewBox", "-1200 -1200 3000 3000"), Le(e, "fill", "none"), Le(e, "xmlns", "http://www.w3.org/2000/svg"), Le(e, "class", "svelte-43sxxs"), Le(t, "class", "svelte-43sxxs"), bA(
        t,
        "margin",
        /*margin*/
        i[0]
      );
    },
    m(d, p) {
      qX(d, t, p), ta(t, e), ta(e, n), ta(n, s), ta(n, r), ta(n, a), ta(n, o), ta(e, l), ta(l, c), ta(l, h), ta(l, u), ta(l, f);
    },
    p(d, [p]) {
      p & /*$top*/
      2 && C5(n, "transform", "translate(" + /*$top*/
      d[1][0] + "px, " + /*$top*/
      d[1][1] + "px)"), p & /*$bottom*/
      4 && C5(l, "transform", "translate(" + /*$bottom*/
      d[2][0] + "px, " + /*$bottom*/
      d[2][1] + "px)"), p & /*margin*/
      1 && bA(
        t,
        "margin",
        /*margin*/
        d[0]
      );
    },
    i: gA,
    o: gA,
    d(d) {
      d && Os(t);
    }
  };
}
function jX(i, t, e) {
  let n, s;
  var r = this && this.__awaiter || function(d, p, g, b) {
    function y(v) {
      return v instanceof g ? v : new g(function(w) {
        w(v);
      });
    }
    return new (g || (g = Promise))(function(v, w) {
      function _(S) {
        try {
          k(b.next(S));
        } catch (T) {
          w(T);
        }
      }
      function x(S) {
        try {
          k(b.throw(S));
        } catch (T) {
          w(T);
        }
      }
      function k(S) {
        S.done ? v(S.value) : y(S.value).then(_, x);
      }
      k((b = b.apply(d, p || [])).next());
    });
  };
  let { margin: a = !0 } = t;
  const o = pA([0, 0]);
  mA(i, o, (d) => e(1, n = d));
  const l = pA([0, 0]);
  mA(i, l, (d) => e(2, s = d));
  let c;
  function h() {
    return r(this, void 0, void 0, function* () {
      yield Promise.all([o.set([125, 140]), l.set([-125, -140])]), yield Promise.all([o.set([-125, 140]), l.set([125, -140])]), yield Promise.all([o.set([-125, 0]), l.set([125, -0])]), yield Promise.all([o.set([125, 0]), l.set([-125, 0])]);
    });
  }
  function u() {
    return r(this, void 0, void 0, function* () {
      yield h(), c || u();
    });
  }
  function f() {
    return r(this, void 0, void 0, function* () {
      yield Promise.all([o.set([125, 0]), l.set([-125, 0])]), u();
    });
  }
  return UX(() => (f(), () => c = !0)), i.$$set = (d) => {
    "margin" in d && e(0, a = d.margin);
  }, [a, n, s, o, l];
}
class GX extends NX {
  constructor(t) {
    super(), $X(this, t, jX, HX, zX, { margin: 0 });
  }
}
const {
  SvelteComponent: VX,
  append_hydration: ih,
  attr: Ea,
  binding_callbacks: yA,
  check_outros: wy,
  children: vo,
  claim_component: yI,
  claim_element: _o,
  claim_space: zr,
  claim_text: Si,
  create_component: wI,
  create_slot: vI,
  destroy_component: _I,
  destroy_each: xI,
  detach: ee,
  element: xo,
  empty: Xr,
  ensure_array_like: U3,
  get_all_dirty_from_scope: kI,
  get_slot_changes: AI,
  group_outros: vy,
  init: WX,
  insert_hydration: ge,
  mount_component: SI,
  noop: _y,
  safe_not_equal: XX,
  set_data: Yr,
  set_style: a0,
  space: Ur,
  text: Ci,
  toggle_class: Fr,
  transition_in: Ca,
  transition_out: ko,
  update_slot_base: CI
} = window.__gradio__svelte__internal, { tick: YX } = window.__gradio__svelte__internal, { onDestroy: KX } = window.__gradio__svelte__internal, { createEventDispatcher: ZX } = window.__gradio__svelte__internal, JX = (i) => ({}), wA = (i) => ({}), QX = (i) => ({}), vA = (i) => ({});
function _A(i, t, e) {
  const n = i.slice();
  return n[40] = t[e], n[42] = e, n;
}
function xA(i, t, e) {
  const n = i.slice();
  return n[40] = t[e], n;
}
function tY(i) {
  let t, e, n, s, r = (
    /*i18n*/
    i[1]("common.error") + ""
  ), a, o, l;
  e = new SX({
    props: {
      Icon: IX,
      label: (
        /*i18n*/
        i[1]("common.clear")
      ),
      disabled: !1
    }
  }), e.$on(
    "click",
    /*click_handler*/
    i[32]
  );
  const c = (
    /*#slots*/
    i[30].error
  ), h = vI(
    c,
    i,
    /*$$scope*/
    i[29],
    wA
  );
  return {
    c() {
      t = xo("div"), wI(e.$$.fragment), n = Ur(), s = xo("span"), a = Ci(r), o = Ur(), h && h.c(), this.h();
    },
    l(u) {
      t = _o(u, "DIV", { class: !0 });
      var f = vo(t);
      yI(e.$$.fragment, f), f.forEach(ee), n = zr(u), s = _o(u, "SPAN", { class: !0 });
      var d = vo(s);
      a = Si(d, r), d.forEach(ee), o = zr(u), h && h.l(u), this.h();
    },
    h() {
      Ea(t, "class", "clear-status svelte-17v219f"), Ea(s, "class", "error svelte-17v219f");
    },
    m(u, f) {
      ge(u, t, f), SI(e, t, null), ge(u, n, f), ge(u, s, f), ih(s, a), ge(u, o, f), h && h.m(u, f), l = !0;
    },
    p(u, f) {
      const d = {};
      f[0] & /*i18n*/
      2 && (d.label = /*i18n*/
      u[1]("common.clear")), e.$set(d), (!l || f[0] & /*i18n*/
      2) && r !== (r = /*i18n*/
      u[1]("common.error") + "") && Yr(a, r), h && h.p && (!l || f[0] & /*$$scope*/
      536870912) && CI(
        h,
        c,
        u,
        /*$$scope*/
        u[29],
        l ? AI(
          c,
          /*$$scope*/
          u[29],
          f,
          JX
        ) : kI(
          /*$$scope*/
          u[29]
        ),
        wA
      );
    },
    i(u) {
      l || (Ca(e.$$.fragment, u), Ca(h, u), l = !0);
    },
    o(u) {
      ko(e.$$.fragment, u), ko(h, u), l = !1;
    },
    d(u) {
      u && (ee(t), ee(n), ee(s), ee(o)), _I(e), h && h.d(u);
    }
  };
}
function eY(i) {
  let t, e, n, s, r, a, o, l, c, h = (
    /*variant*/
    i[8] === "default" && /*show_eta_bar*/
    i[18] && /*show_progress*/
    i[6] === "full" && kA(i)
  );
  function u(w, _) {
    if (
      /*progress*/
      w[7]
    ) return sY;
    if (
      /*queue_position*/
      w[2] !== null && /*queue_size*/
      w[3] !== void 0 && /*queue_position*/
      w[2] >= 0
    ) return nY;
    if (
      /*queue_position*/
      w[2] === 0
    ) return iY;
  }
  let f = u(i), d = f && f(i), p = (
    /*timer*/
    i[5] && CA(i)
  );
  const g = [lY, oY], b = [];
  function y(w, _) {
    return (
      /*last_progress_level*/
      w[15] != null ? 0 : (
        /*show_progress*/
        w[6] === "full" ? 1 : -1
      )
    );
  }
  ~(r = y(i)) && (a = b[r] = g[r](i));
  let v = !/*timer*/
  i[5] && RA(i);
  return {
    c() {
      h && h.c(), t = Ur(), e = xo("div"), d && d.c(), n = Ur(), p && p.c(), s = Ur(), a && a.c(), o = Ur(), v && v.c(), l = Xr(), this.h();
    },
    l(w) {
      h && h.l(w), t = zr(w), e = _o(w, "DIV", { class: !0 });
      var _ = vo(e);
      d && d.l(_), n = zr(_), p && p.l(_), _.forEach(ee), s = zr(w), a && a.l(w), o = zr(w), v && v.l(w), l = Xr(), this.h();
    },
    h() {
      Ea(e, "class", "progress-text svelte-17v219f"), Fr(
        e,
        "meta-text-center",
        /*variant*/
        i[8] === "center"
      ), Fr(
        e,
        "meta-text",
        /*variant*/
        i[8] === "default"
      );
    },
    m(w, _) {
      h && h.m(w, _), ge(w, t, _), ge(w, e, _), d && d.m(e, null), ih(e, n), p && p.m(e, null), ge(w, s, _), ~r && b[r].m(w, _), ge(w, o, _), v && v.m(w, _), ge(w, l, _), c = !0;
    },
    p(w, _) {
      /*variant*/
      w[8] === "default" && /*show_eta_bar*/
      w[18] && /*show_progress*/
      w[6] === "full" ? h ? h.p(w, _) : (h = kA(w), h.c(), h.m(t.parentNode, t)) : h && (h.d(1), h = null), f === (f = u(w)) && d ? d.p(w, _) : (d && d.d(1), d = f && f(w), d && (d.c(), d.m(e, n))), /*timer*/
      w[5] ? p ? p.p(w, _) : (p = CA(w), p.c(), p.m(e, null)) : p && (p.d(1), p = null), (!c || _[0] & /*variant*/
      256) && Fr(
        e,
        "meta-text-center",
        /*variant*/
        w[8] === "center"
      ), (!c || _[0] & /*variant*/
      256) && Fr(
        e,
        "meta-text",
        /*variant*/
        w[8] === "default"
      );
      let x = r;
      r = y(w), r === x ? ~r && b[r].p(w, _) : (a && (vy(), ko(b[x], 1, 1, () => {
        b[x] = null;
      }), wy()), ~r ? (a = b[r], a ? a.p(w, _) : (a = b[r] = g[r](w), a.c()), Ca(a, 1), a.m(o.parentNode, o)) : a = null), /*timer*/
      w[5] ? v && (vy(), ko(v, 1, 1, () => {
        v = null;
      }), wy()) : v ? (v.p(w, _), _[0] & /*timer*/
      32 && Ca(v, 1)) : (v = RA(w), v.c(), Ca(v, 1), v.m(l.parentNode, l));
    },
    i(w) {
      c || (Ca(a), Ca(v), c = !0);
    },
    o(w) {
      ko(a), ko(v), c = !1;
    },
    d(w) {
      w && (ee(t), ee(e), ee(s), ee(o), ee(l)), h && h.d(w), d && d.d(), p && p.d(), ~r && b[r].d(w), v && v.d(w);
    }
  };
}
function kA(i) {
  let t, e = `translateX(${/*eta_level*/
  (i[17] || 0) * 100 - 100}%)`;
  return {
    c() {
      t = xo("div"), this.h();
    },
    l(n) {
      t = _o(n, "DIV", { class: !0 }), vo(t).forEach(ee), this.h();
    },
    h() {
      Ea(t, "class", "eta-bar svelte-17v219f"), a0(t, "transform", e);
    },
    m(n, s) {
      ge(n, t, s);
    },
    p(n, s) {
      s[0] & /*eta_level*/
      131072 && e !== (e = `translateX(${/*eta_level*/
      (n[17] || 0) * 100 - 100}%)`) && a0(t, "transform", e);
    },
    d(n) {
      n && ee(t);
    }
  };
}
function iY(i) {
  let t;
  return {
    c() {
      t = Ci("processing |");
    },
    l(e) {
      t = Si(e, "processing |");
    },
    m(e, n) {
      ge(e, t, n);
    },
    p: _y,
    d(e) {
      e && ee(t);
    }
  };
}
function nY(i) {
  let t, e = (
    /*queue_position*/
    i[2] + 1 + ""
  ), n, s, r, a;
  return {
    c() {
      t = Ci("queue: "), n = Ci(e), s = Ci("/"), r = Ci(
        /*queue_size*/
        i[3]
      ), a = Ci(" |");
    },
    l(o) {
      t = Si(o, "queue: "), n = Si(o, e), s = Si(o, "/"), r = Si(
        o,
        /*queue_size*/
        i[3]
      ), a = Si(o, " |");
    },
    m(o, l) {
      ge(o, t, l), ge(o, n, l), ge(o, s, l), ge(o, r, l), ge(o, a, l);
    },
    p(o, l) {
      l[0] & /*queue_position*/
      4 && e !== (e = /*queue_position*/
      o[2] + 1 + "") && Yr(n, e), l[0] & /*queue_size*/
      8 && Yr(
        r,
        /*queue_size*/
        o[3]
      );
    },
    d(o) {
      o && (ee(t), ee(n), ee(s), ee(r), ee(a));
    }
  };
}
function sY(i) {
  let t, e = U3(
    /*progress*/
    i[7]
  ), n = [];
  for (let s = 0; s < e.length; s += 1)
    n[s] = SA(xA(i, e, s));
  return {
    c() {
      for (let s = 0; s < n.length; s += 1)
        n[s].c();
      t = Xr();
    },
    l(s) {
      for (let r = 0; r < n.length; r += 1)
        n[r].l(s);
      t = Xr();
    },
    m(s, r) {
      for (let a = 0; a < n.length; a += 1)
        n[a] && n[a].m(s, r);
      ge(s, t, r);
    },
    p(s, r) {
      if (r[0] & /*progress*/
      128) {
        e = U3(
          /*progress*/
          s[7]
        );
        let a;
        for (a = 0; a < e.length; a += 1) {
          const o = xA(s, e, a);
          n[a] ? n[a].p(o, r) : (n[a] = SA(o), n[a].c(), n[a].m(t.parentNode, t));
        }
        for (; a < n.length; a += 1)
          n[a].d(1);
        n.length = e.length;
      }
    },
    d(s) {
      s && ee(t), xI(n, s);
    }
  };
}
function AA(i) {
  let t, e = (
    /*p*/
    i[40].unit + ""
  ), n, s, r = " ", a;
  function o(h, u) {
    return (
      /*p*/
      h[40].length != null ? aY : rY
    );
  }
  let l = o(i), c = l(i);
  return {
    c() {
      c.c(), t = Ur(), n = Ci(e), s = Ci(" | "), a = Ci(r);
    },
    l(h) {
      c.l(h), t = zr(h), n = Si(h, e), s = Si(h, " | "), a = Si(h, r);
    },
    m(h, u) {
      c.m(h, u), ge(h, t, u), ge(h, n, u), ge(h, s, u), ge(h, a, u);
    },
    p(h, u) {
      l === (l = o(h)) && c ? c.p(h, u) : (c.d(1), c = l(h), c && (c.c(), c.m(t.parentNode, t))), u[0] & /*progress*/
      128 && e !== (e = /*p*/
      h[40].unit + "") && Yr(n, e);
    },
    d(h) {
      h && (ee(t), ee(n), ee(s), ee(a)), c.d(h);
    }
  };
}
function rY(i) {
  let t = bu(
    /*p*/
    i[40].index || 0
  ) + "", e;
  return {
    c() {
      e = Ci(t);
    },
    l(n) {
      e = Si(n, t);
    },
    m(n, s) {
      ge(n, e, s);
    },
    p(n, s) {
      s[0] & /*progress*/
      128 && t !== (t = bu(
        /*p*/
        n[40].index || 0
      ) + "") && Yr(e, t);
    },
    d(n) {
      n && ee(e);
    }
  };
}
function aY(i) {
  let t = bu(
    /*p*/
    i[40].index || 0
  ) + "", e, n, s = bu(
    /*p*/
    i[40].length
  ) + "", r;
  return {
    c() {
      e = Ci(t), n = Ci("/"), r = Ci(s);
    },
    l(a) {
      e = Si(a, t), n = Si(a, "/"), r = Si(a, s);
    },
    m(a, o) {
      ge(a, e, o), ge(a, n, o), ge(a, r, o);
    },
    p(a, o) {
      o[0] & /*progress*/
      128 && t !== (t = bu(
        /*p*/
        a[40].index || 0
      ) + "") && Yr(e, t), o[0] & /*progress*/
      128 && s !== (s = bu(
        /*p*/
        a[40].length
      ) + "") && Yr(r, s);
    },
    d(a) {
      a && (ee(e), ee(n), ee(r));
    }
  };
}
function SA(i) {
  let t, e = (
    /*p*/
    i[40].index != null && AA(i)
  );
  return {
    c() {
      e && e.c(), t = Xr();
    },
    l(n) {
      e && e.l(n), t = Xr();
    },
    m(n, s) {
      e && e.m(n, s), ge(n, t, s);
    },
    p(n, s) {
      /*p*/
      n[40].index != null ? e ? e.p(n, s) : (e = AA(n), e.c(), e.m(t.parentNode, t)) : e && (e.d(1), e = null);
    },
    d(n) {
      n && ee(t), e && e.d(n);
    }
  };
}
function CA(i) {
  let t, e = (
    /*eta*/
    i[0] ? `/${/*formatted_eta*/
    i[19]}` : ""
  ), n, s;
  return {
    c() {
      t = Ci(
        /*formatted_timer*/
        i[20]
      ), n = Ci(e), s = Ci("s");
    },
    l(r) {
      t = Si(
        r,
        /*formatted_timer*/
        i[20]
      ), n = Si(r, e), s = Si(r, "s");
    },
    m(r, a) {
      ge(r, t, a), ge(r, n, a), ge(r, s, a);
    },
    p(r, a) {
      a[0] & /*formatted_timer*/
      1048576 && Yr(
        t,
        /*formatted_timer*/
        r[20]
      ), a[0] & /*eta, formatted_eta*/
      524289 && e !== (e = /*eta*/
      r[0] ? `/${/*formatted_eta*/
      r[19]}` : "") && Yr(n, e);
    },
    d(r) {
      r && (ee(t), ee(n), ee(s));
    }
  };
}
function oY(i) {
  let t, e;
  return t = new GX({
    props: { margin: (
      /*variant*/
      i[8] === "default"
    ) }
  }), {
    c() {
      wI(t.$$.fragment);
    },
    l(n) {
      yI(t.$$.fragment, n);
    },
    m(n, s) {
      SI(t, n, s), e = !0;
    },
    p(n, s) {
      const r = {};
      s[0] & /*variant*/
      256 && (r.margin = /*variant*/
      n[8] === "default"), t.$set(r);
    },
    i(n) {
      e || (Ca(t.$$.fragment, n), e = !0);
    },
    o(n) {
      ko(t.$$.fragment, n), e = !1;
    },
    d(n) {
      _I(t, n);
    }
  };
}
function lY(i) {
  let t, e, n, s, r, a = `${/*last_progress_level*/
  i[15] * 100}%`, o = (
    /*progress*/
    i[7] != null && EA(i)
  );
  return {
    c() {
      t = xo("div"), e = xo("div"), o && o.c(), n = Ur(), s = xo("div"), r = xo("div"), this.h();
    },
    l(l) {
      t = _o(l, "DIV", { class: !0 });
      var c = vo(t);
      e = _o(c, "DIV", { class: !0 });
      var h = vo(e);
      o && o.l(h), h.forEach(ee), n = zr(c), s = _o(c, "DIV", { class: !0 });
      var u = vo(s);
      r = _o(u, "DIV", { class: !0 }), vo(r).forEach(ee), u.forEach(ee), c.forEach(ee), this.h();
    },
    h() {
      Ea(e, "class", "progress-level-inner svelte-17v219f"), Ea(r, "class", "progress-bar svelte-17v219f"), a0(r, "width", a), Ea(s, "class", "progress-bar-wrap svelte-17v219f"), Ea(t, "class", "progress-level svelte-17v219f");
    },
    m(l, c) {
      ge(l, t, c), ih(t, e), o && o.m(e, null), ih(t, n), ih(t, s), ih(s, r), i[31](r);
    },
    p(l, c) {
      /*progress*/
      l[7] != null ? o ? o.p(l, c) : (o = EA(l), o.c(), o.m(e, null)) : o && (o.d(1), o = null), c[0] & /*last_progress_level*/
      32768 && a !== (a = `${/*last_progress_level*/
      l[15] * 100}%`) && a0(r, "width", a);
    },
    i: _y,
    o: _y,
    d(l) {
      l && ee(t), o && o.d(), i[31](null);
    }
  };
}
function EA(i) {
  let t, e = U3(
    /*progress*/
    i[7]
  ), n = [];
  for (let s = 0; s < e.length; s += 1)
    n[s] = MA(_A(i, e, s));
  return {
    c() {
      for (let s = 0; s < n.length; s += 1)
        n[s].c();
      t = Xr();
    },
    l(s) {
      for (let r = 0; r < n.length; r += 1)
        n[r].l(s);
      t = Xr();
    },
    m(s, r) {
      for (let a = 0; a < n.length; a += 1)
        n[a] && n[a].m(s, r);
      ge(s, t, r);
    },
    p(s, r) {
      if (r[0] & /*progress_level, progress*/
      16512) {
        e = U3(
          /*progress*/
          s[7]
        );
        let a;
        for (a = 0; a < e.length; a += 1) {
          const o = _A(s, e, a);
          n[a] ? n[a].p(o, r) : (n[a] = MA(o), n[a].c(), n[a].m(t.parentNode, t));
        }
        for (; a < n.length; a += 1)
          n[a].d(1);
        n.length = e.length;
      }
    },
    d(s) {
      s && ee(t), xI(n, s);
    }
  };
}
function DA(i) {
  let t, e, n, s, r = (
    /*i*/
    i[42] !== 0 && cY()
  ), a = (
    /*p*/
    i[40].desc != null && TA(i)
  ), o = (
    /*p*/
    i[40].desc != null && /*progress_level*/
    i[14] && /*progress_level*/
    i[14][
      /*i*/
      i[42]
    ] != null && FA()
  ), l = (
    /*progress_level*/
    i[14] != null && IA(i)
  );
  return {
    c() {
      r && r.c(), t = Ur(), a && a.c(), e = Ur(), o && o.c(), n = Ur(), l && l.c(), s = Xr();
    },
    l(c) {
      r && r.l(c), t = zr(c), a && a.l(c), e = zr(c), o && o.l(c), n = zr(c), l && l.l(c), s = Xr();
    },
    m(c, h) {
      r && r.m(c, h), ge(c, t, h), a && a.m(c, h), ge(c, e, h), o && o.m(c, h), ge(c, n, h), l && l.m(c, h), ge(c, s, h);
    },
    p(c, h) {
      /*p*/
      c[40].desc != null ? a ? a.p(c, h) : (a = TA(c), a.c(), a.m(e.parentNode, e)) : a && (a.d(1), a = null), /*p*/
      c[40].desc != null && /*progress_level*/
      c[14] && /*progress_level*/
      c[14][
        /*i*/
        c[42]
      ] != null ? o || (o = FA(), o.c(), o.m(n.parentNode, n)) : o && (o.d(1), o = null), /*progress_level*/
      c[14] != null ? l ? l.p(c, h) : (l = IA(c), l.c(), l.m(s.parentNode, s)) : l && (l.d(1), l = null);
    },
    d(c) {
      c && (ee(t), ee(e), ee(n), ee(s)), r && r.d(c), a && a.d(c), o && o.d(c), l && l.d(c);
    }
  };
}
function cY(i) {
  let t;
  return {
    c() {
      t = Ci(" /");
    },
    l(e) {
      t = Si(e, " /");
    },
    m(e, n) {
      ge(e, t, n);
    },
    d(e) {
      e && ee(t);
    }
  };
}
function TA(i) {
  let t = (
    /*p*/
    i[40].desc + ""
  ), e;
  return {
    c() {
      e = Ci(t);
    },
    l(n) {
      e = Si(n, t);
    },
    m(n, s) {
      ge(n, e, s);
    },
    p(n, s) {
      s[0] & /*progress*/
      128 && t !== (t = /*p*/
      n[40].desc + "") && Yr(e, t);
    },
    d(n) {
      n && ee(e);
    }
  };
}
function FA(i) {
  let t;
  return {
    c() {
      t = Ci("-");
    },
    l(e) {
      t = Si(e, "-");
    },
    m(e, n) {
      ge(e, t, n);
    },
    d(e) {
      e && ee(t);
    }
  };
}
function IA(i) {
  let t = (100 * /*progress_level*/
  (i[14][
    /*i*/
    i[42]
  ] || 0)).toFixed(1) + "", e, n;
  return {
    c() {
      e = Ci(t), n = Ci("%");
    },
    l(s) {
      e = Si(s, t), n = Si(s, "%");
    },
    m(s, r) {
      ge(s, e, r), ge(s, n, r);
    },
    p(s, r) {
      r[0] & /*progress_level*/
      16384 && t !== (t = (100 * /*progress_level*/
      (s[14][
        /*i*/
        s[42]
      ] || 0)).toFixed(1) + "") && Yr(e, t);
    },
    d(s) {
      s && (ee(e), ee(n));
    }
  };
}
function MA(i) {
  let t, e = (
    /*p*/
    (i[40].desc != null || /*progress_level*/
    i[14] && /*progress_level*/
    i[14][
      /*i*/
      i[42]
    ] != null) && DA(i)
  );
  return {
    c() {
      e && e.c(), t = Xr();
    },
    l(n) {
      e && e.l(n), t = Xr();
    },
    m(n, s) {
      e && e.m(n, s), ge(n, t, s);
    },
    p(n, s) {
      /*p*/
      n[40].desc != null || /*progress_level*/
      n[14] && /*progress_level*/
      n[14][
        /*i*/
        n[42]
      ] != null ? e ? e.p(n, s) : (e = DA(n), e.c(), e.m(t.parentNode, t)) : e && (e.d(1), e = null);
    },
    d(n) {
      n && ee(t), e && e.d(n);
    }
  };
}
function RA(i) {
  let t, e, n, s;
  const r = (
    /*#slots*/
    i[30]["additional-loading-text"]
  ), a = vI(
    r,
    i,
    /*$$scope*/
    i[29],
    vA
  );
  return {
    c() {
      t = xo("p"), e = Ci(
        /*loading_text*/
        i[9]
      ), n = Ur(), a && a.c(), this.h();
    },
    l(o) {
      t = _o(o, "P", { class: !0 });
      var l = vo(t);
      e = Si(
        l,
        /*loading_text*/
        i[9]
      ), l.forEach(ee), n = zr(o), a && a.l(o), this.h();
    },
    h() {
      Ea(t, "class", "loading svelte-17v219f");
    },
    m(o, l) {
      ge(o, t, l), ih(t, e), ge(o, n, l), a && a.m(o, l), s = !0;
    },
    p(o, l) {
      (!s || l[0] & /*loading_text*/
      512) && Yr(
        e,
        /*loading_text*/
        o[9]
      ), a && a.p && (!s || l[0] & /*$$scope*/
      536870912) && CI(
        a,
        r,
        o,
        /*$$scope*/
        o[29],
        s ? AI(
          r,
          /*$$scope*/
          o[29],
          l,
          QX
        ) : kI(
          /*$$scope*/
          o[29]
        ),
        vA
      );
    },
    i(o) {
      s || (Ca(a, o), s = !0);
    },
    o(o) {
      ko(a, o), s = !1;
    },
    d(o) {
      o && (ee(t), ee(n)), a && a.d(o);
    }
  };
}
function hY(i) {
  let t, e, n, s, r;
  const a = [eY, tY], o = [];
  function l(c, h) {
    return (
      /*status*/
      c[4] === "pending" ? 0 : (
        /*status*/
        c[4] === "error" ? 1 : -1
      )
    );
  }
  return ~(e = l(i)) && (n = o[e] = a[e](i)), {
    c() {
      t = xo("div"), n && n.c(), this.h();
    },
    l(c) {
      t = _o(c, "DIV", { class: !0 });
      var h = vo(t);
      n && n.l(h), h.forEach(ee), this.h();
    },
    h() {
      Ea(t, "class", s = "wrap " + /*variant*/
      i[8] + " " + /*show_progress*/
      i[6] + " svelte-17v219f"), Fr(t, "hide", !/*status*/
      i[4] || /*status*/
      i[4] === "complete" || /*show_progress*/
      i[6] === "hidden" || /*status*/
      i[4] == "streaming"), Fr(
        t,
        "translucent",
        /*variant*/
        i[8] === "center" && /*status*/
        (i[4] === "pending" || /*status*/
        i[4] === "error") || /*translucent*/
        i[11] || /*show_progress*/
        i[6] === "minimal"
      ), Fr(
        t,
        "generating",
        /*status*/
        i[4] === "generating" && /*show_progress*/
        i[6] === "full"
      ), Fr(
        t,
        "border",
        /*border*/
        i[12]
      ), a0(
        t,
        "position",
        /*absolute*/
        i[10] ? "absolute" : "static"
      ), a0(
        t,
        "padding",
        /*absolute*/
        i[10] ? "0" : "var(--size-8) 0"
      );
    },
    m(c, h) {
      ge(c, t, h), ~e && o[e].m(t, null), i[33](t), r = !0;
    },
    p(c, h) {
      let u = e;
      e = l(c), e === u ? ~e && o[e].p(c, h) : (n && (vy(), ko(o[u], 1, 1, () => {
        o[u] = null;
      }), wy()), ~e ? (n = o[e], n ? n.p(c, h) : (n = o[e] = a[e](c), n.c()), Ca(n, 1), n.m(t, null)) : n = null), (!r || h[0] & /*variant, show_progress*/
      320 && s !== (s = "wrap " + /*variant*/
      c[8] + " " + /*show_progress*/
      c[6] + " svelte-17v219f")) && Ea(t, "class", s), (!r || h[0] & /*variant, show_progress, status, show_progress*/
      336) && Fr(t, "hide", !/*status*/
      c[4] || /*status*/
      c[4] === "complete" || /*show_progress*/
      c[6] === "hidden" || /*status*/
      c[4] == "streaming"), (!r || h[0] & /*variant, show_progress, variant, status, translucent, show_progress*/
      2384) && Fr(
        t,
        "translucent",
        /*variant*/
        c[8] === "center" && /*status*/
        (c[4] === "pending" || /*status*/
        c[4] === "error") || /*translucent*/
        c[11] || /*show_progress*/
        c[6] === "minimal"
      ), (!r || h[0] & /*variant, show_progress, status, show_progress*/
      336) && Fr(
        t,
        "generating",
        /*status*/
        c[4] === "generating" && /*show_progress*/
        c[6] === "full"
      ), (!r || h[0] & /*variant, show_progress, border*/
      4416) && Fr(
        t,
        "border",
        /*border*/
        c[12]
      ), h[0] & /*absolute*/
      1024 && a0(
        t,
        "position",
        /*absolute*/
        c[10] ? "absolute" : "static"
      ), h[0] & /*absolute*/
      1024 && a0(
        t,
        "padding",
        /*absolute*/
        c[10] ? "0" : "var(--size-8) 0"
      );
    },
    i(c) {
      r || (Ca(n), r = !0);
    },
    o(c) {
      ko(n), r = !1;
    },
    d(c) {
      c && ee(t), ~e && o[e].d(), i[33](null);
    }
  };
}
var uY = function(i, t, e, n) {
  function s(r) {
    return r instanceof e ? r : new e(function(a) {
      a(r);
    });
  }
  return new (e || (e = Promise))(function(r, a) {
    function o(h) {
      try {
        c(n.next(h));
      } catch (u) {
        a(u);
      }
    }
    function l(h) {
      try {
        c(n.throw(h));
      } catch (u) {
        a(u);
      }
    }
    function c(h) {
      h.done ? r(h.value) : s(h.value).then(o, l);
    }
    c((n = n.apply(i, t || [])).next());
  });
};
let E5 = [], m7 = !1;
const dY = typeof window < "u", EI = dY ? window.requestAnimationFrame : (i) => {
};
function fY(i) {
  return uY(this, arguments, void 0, function* (t, e = !0) {
    if (!(window.__gradio_mode__ === "website" || window.__gradio_mode__ !== "app" && e !== !0)) {
      if (E5.push(t), !m7) m7 = !0;
      else return;
      yield YX(), EI(() => {
        let n = [0, 0];
        for (let s = 0; s < E5.length; s++) {
          const a = E5[s].getBoundingClientRect();
          (s === 0 || a.top + window.scrollY <= n[0]) && (n[0] = a.top + window.scrollY, n[1] = s);
        }
        window.scrollTo({ top: n[0] - 20, behavior: "smooth" }), m7 = !1, E5 = [];
      });
    }
  });
}
function pY(i, t, e) {
  let n, { $$slots: s = {}, $$scope: r } = t;
  const a = ZX();
  let { i18n: o } = t, { eta: l = null } = t, { queue_position: c } = t, { queue_size: h } = t, { status: u } = t, { scroll_to_output: f = !1 } = t, { timer: d = !0 } = t, { show_progress: p = "full" } = t, { message: g = null } = t, { progress: b = null } = t, { variant: y = "default" } = t, { loading_text: v = "Loading..." } = t, { absolute: w = !0 } = t, { translucent: _ = !1 } = t, { border: x = !1 } = t, { autoscroll: k } = t, S, T = !1, I = 0, R = 0, B = null, L = null, it = 0, O = null, at, W = null, q = !0;
  const K = () => {
    e(0, l = e(27, B = e(19, N = null))), e(25, I = performance.now()), e(26, R = 0), T = !0, z();
  };
  function z() {
    EI(() => {
      e(26, R = (performance.now() - I) / 1e3), T && z();
    });
  }
  function j() {
    e(26, R = 0), e(0, l = e(27, B = e(19, N = null))), T && (T = !1);
  }
  KX(() => {
    T && j();
  });
  let N = null;
  function Q($) {
    yA[$ ? "unshift" : "push"](() => {
      W = $, e(16, W), e(7, b), e(14, O), e(15, at);
    });
  }
  const Y = () => {
    a("clear_status");
  };
  function et($) {
    yA[$ ? "unshift" : "push"](() => {
      S = $, e(13, S);
    });
  }
  return i.$$set = ($) => {
    "i18n" in $ && e(1, o = $.i18n), "eta" in $ && e(0, l = $.eta), "queue_position" in $ && e(2, c = $.queue_position), "queue_size" in $ && e(3, h = $.queue_size), "status" in $ && e(4, u = $.status), "scroll_to_output" in $ && e(22, f = $.scroll_to_output), "timer" in $ && e(5, d = $.timer), "show_progress" in $ && e(6, p = $.show_progress), "message" in $ && e(23, g = $.message), "progress" in $ && e(7, b = $.progress), "variant" in $ && e(8, y = $.variant), "loading_text" in $ && e(9, v = $.loading_text), "absolute" in $ && e(10, w = $.absolute), "translucent" in $ && e(11, _ = $.translucent), "border" in $ && e(12, x = $.border), "autoscroll" in $ && e(24, k = $.autoscroll), "$$scope" in $ && e(29, r = $.$$scope);
  }, i.$$.update = () => {
    i.$$.dirty[0] & /*eta, old_eta, timer_start, eta_from_start*/
    436207617 && (l === null && e(0, l = B), l != null && B !== l && (e(28, L = (performance.now() - I) / 1e3 + l), e(19, N = L.toFixed(1)), e(27, B = l))), i.$$.dirty[0] & /*eta_from_start, timer_diff*/
    335544320 && e(17, it = L === null || L <= 0 || !R ? null : Math.min(R / L, 1)), i.$$.dirty[0] & /*progress*/
    128 && b != null && e(18, q = !1), i.$$.dirty[0] & /*progress, progress_level, progress_bar, last_progress_level*/
    114816 && (b != null ? e(14, O = b.map(($) => {
      if ($.index != null && $.length != null)
        return $.index / $.length;
      if ($.progress != null)
        return $.progress;
    })) : e(14, O = null), O ? (e(15, at = O[O.length - 1]), W && (at === 0 ? e(16, W.style.transition = "0", W) : e(16, W.style.transition = "150ms", W))) : e(15, at = void 0)), i.$$.dirty[0] & /*status*/
    16 && (u === "pending" ? K() : j()), i.$$.dirty[0] & /*el, scroll_to_output, status, autoscroll*/
    20979728 && S && f && (u === "pending" || u === "complete") && fY(S, k), i.$$.dirty[0] & /*status, message*/
    8388624, i.$$.dirty[0] & /*timer_diff*/
    67108864 && e(20, n = R.toFixed(1));
  }, [
    l,
    o,
    c,
    h,
    u,
    d,
    p,
    b,
    y,
    v,
    w,
    _,
    x,
    S,
    O,
    at,
    W,
    it,
    q,
    N,
    n,
    a,
    f,
    g,
    k,
    I,
    R,
    B,
    L,
    r,
    s,
    Q,
    Y,
    et
  ];
}
class mY extends VX {
  constructor(t) {
    super(), WX(
      this,
      t,
      pY,
      hY,
      XX,
      {
        i18n: 1,
        eta: 0,
        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]
    );
  }
}
/*! @license DOMPurify 3.2.6 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.2.6/LICENSE */
const {
  entries: DI,
  setPrototypeOf: BA,
  isFrozen: gY,
  getPrototypeOf: bY,
  getOwnPropertyDescriptor: yY
} = Object;
let {
  freeze: ms,
  seal: Kr,
  create: TI
} = Object, {
  apply: xy,
  construct: ky
} = typeof Reflect < "u" && Reflect;
ms || (ms = function(t) {
  return t;
});
Kr || (Kr = function(t) {
  return t;
});
xy || (xy = function(t, e, n) {
  return t.apply(e, n);
});
ky || (ky = function(t, e) {
  return new t(...e);
});
const D5 = gs(Array.prototype.forEach), wY = gs(Array.prototype.lastIndexOf), PA = gs(Array.prototype.pop), Gf = gs(Array.prototype.push), vY = gs(Array.prototype.splice), P9 = gs(String.prototype.toLowerCase), g7 = gs(String.prototype.toString), NA = gs(String.prototype.match), Vf = gs(String.prototype.replace), _Y = gs(String.prototype.indexOf), xY = gs(String.prototype.trim), na = gs(Object.prototype.hasOwnProperty), ts = gs(RegExp.prototype.test), Wf = kY(TypeError);
function gs(i) {
  return function(t) {
    t instanceof RegExp && (t.lastIndex = 0);
    for (var e = arguments.length, n = new Array(e > 1 ? e - 1 : 0), s = 1; s < e; s++)
      n[s - 1] = arguments[s];
    return xy(i, t, n);
  };
}
function kY(i) {
  return function() {
    for (var t = arguments.length, e = new Array(t), n = 0; n < t; n++)
      e[n] = arguments[n];
    return ky(i, e);
  };
}
function Te(i, t) {
  let e = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : P9;
  BA && BA(i, null);
  let n = t.length;
  for (; n--; ) {
    let s = t[n];
    if (typeof s == "string") {
      const r = e(s);
      r !== s && (gY(t) || (t[n] = r), s = r);
    }
    i[s] = !0;
  }
  return i;
}
function AY(i) {
  for (let t = 0; t < i.length; t++)
    na(i, t) || (i[t] = null);
  return i;
}
function Vo(i) {
  const t = TI(null);
  for (const [e, n] of DI(i))
    na(i, e) && (Array.isArray(n) ? t[e] = AY(n) : n && typeof n == "object" && n.constructor === Object ? t[e] = Vo(n) : t[e] = n);
  return t;
}
function Xf(i, t) {
  for (; i !== null; ) {
    const n = yY(i, t);
    if (n) {
      if (n.get)
        return gs(n.get);
      if (typeof n.value == "function")
        return gs(n.value);
    }
    i = bY(i);
  }
  function e() {
    return null;
  }
  return e;
}
const LA = ms(["a", "abbr", "acronym", "address", "area", "article", "aside", "audio", "b", "bdi", "bdo", "big", "blink", "blockquote", "body", "br", "button", "canvas", "caption", "center", "cite", "code", "col", "colgroup", "content", "data", "datalist", "dd", "decorator", "del", "details", "dfn", "dialog", "dir", "div", "dl", "dt", "element", "em", "fieldset", "figcaption", "figure", "font", "footer", "form", "h1", "h2", "h3", "h4", "h5", "h6", "head", "header", "hgroup", "hr", "html", "i", "img", "input", "ins", "kbd", "label", "legend", "li", "main", "map", "mark", "marquee", "menu", "menuitem", "meter", "nav", "nobr", "ol", "optgroup", "option", "output", "p", "picture", "pre", "progress", "q", "rp", "rt", "ruby", "s", "samp", "section", "select", "shadow", "small", "source", "spacer", "span", "strike", "strong", "style", "sub", "summary", "sup", "table", "tbody", "td", "template", "textarea", "tfoot", "th", "thead", "time", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]), b7 = ms(["svg", "a", "altglyph", "altglyphdef", "altglyphitem", "animatecolor", "animatemotion", "animatetransform", "circle", "clippath", "defs", "desc", "ellipse", "filter", "font", "g", "glyph", "glyphref", "hkern", "image", "line", "lineargradient", "marker", "mask", "metadata", "mpath", "path", "pattern", "polygon", "polyline", "radialgradient", "rect", "stop", "style", "switch", "symbol", "text", "textpath", "title", "tref", "tspan", "view", "vkern"]), y7 = ms(["feBlend", "feColorMatrix", "feComponentTransfer", "feComposite", "feConvolveMatrix", "feDiffuseLighting", "feDisplacementMap", "feDistantLight", "feDropShadow", "feFlood", "feFuncA", "feFuncB", "feFuncG", "feFuncR", "feGaussianBlur", "feImage", "feMerge", "feMergeNode", "feMorphology", "feOffset", "fePointLight", "feSpecularLighting", "feSpotLight", "feTile", "feTurbulence"]), SY = ms(["animate", "color-profile", "cursor", "discard", "font-face", "font-face-format", "font-face-name", "font-face-src", "font-face-uri", "foreignobject", "hatch", "hatchpath", "mesh", "meshgradient", "meshpatch", "meshrow", "missing-glyph", "script", "set", "solidcolor", "unknown", "use"]), w7 = ms(["math", "menclose", "merror", "mfenced", "mfrac", "mglyph", "mi", "mlabeledtr", "mmultiscripts", "mn", "mo", "mover", "mpadded", "mphantom", "mroot", "mrow", "ms", "mspace", "msqrt", "mstyle", "msub", "msup", "msubsup", "mtable", "mtd", "mtext", "mtr", "munder", "munderover", "mprescripts"]), CY = ms(["maction", "maligngroup", "malignmark", "mlongdiv", "mscarries", "mscarry", "msgroup", "mstack", "msline", "msrow", "semantics", "annotation", "annotation-xml", "mprescripts", "none"]), OA = ms(["#text"]), $A = ms(["accept", "action", "align", "alt", "autocapitalize", "autocomplete", "autopictureinpicture", "autoplay", "background", "bgcolor", "border", "capture", "cellpadding", "cellspacing", "checked", "cite", "class", "clear", "color", "cols", "colspan", "controls", "controlslist", "coords", "crossorigin", "datetime", "decoding", "default", "dir", "disabled", "disablepictureinpicture", "disableremoteplayback", "download", "draggable", "enctype", "enterkeyhint", "face", "for", "headers", "height", "hidden", "high", "href", "hreflang", "id", "inputmode", "integrity", "ismap", "kind", "label", "lang", "list", "loading", "loop", "low", "max", "maxlength", "media", "method", "min", "minlength", "multiple", "muted", "name", "nonce", "noshade", "novalidate", "nowrap", "open", "optimum", "pattern", "placeholder", "playsinline", "popover", "popovertarget", "popovertargetaction", "poster", "preload", "pubdate", "radiogroup", "readonly", "rel", "required", "rev", "reversed", "role", "rows", "rowspan", "spellcheck", "scope", "selected", "shape", "size", "sizes", "span", "srclang", "start", "src", "srcset", "step", "style", "summary", "tabindex", "title", "translate", "type", "usemap", "valign", "value", "width", "wrap", "xmlns", "slot"]), v7 = ms(["accent-height", "accumulate", "additive", "alignment-baseline", "amplitude", "ascent", "attributename", "attributetype", "azimuth", "basefrequency", "baseline-shift", "begin", "bias", "by", "class", "clip", "clippathunits", "clip-path", "clip-rule", "color", "color-interpolation", "color-interpolation-filters", "color-profile", "color-rendering", "cx", "cy", "d", "dx", "dy", "diffuseconstant", "direction", "display", "divisor", "dur", "edgemode", "elevation", "end", "exponent", "fill", "fill-opacity", "fill-rule", "filter", "filterunits", "flood-color", "flood-opacity", "font-family", "font-size", "font-size-adjust", "font-stretch", "font-style", "font-variant", "font-weight", "fx", "fy", "g1", "g2", "glyph-name", "glyphref", "gradientunits", "gradienttransform", "height", "href", "id", "image-rendering", "in", "in2", "intercept", "k", "k1", "k2", "k3", "k4", "kerning", "keypoints", "keysplines", "keytimes", "lang", "lengthadjust", "letter-spacing", "kernelmatrix", "kernelunitlength", "lighting-color", "local", "marker-end", "marker-mid", "marker-start", "markerheight", "markerunits", "markerwidth", "maskcontentunits", "maskunits", "max", "mask", "media", "method", "mode", "min", "name", "numoctaves", "offset", "operator", "opacity", "order", "orient", "orientation", "origin", "overflow", "paint-order", "path", "pathlength", "patterncontentunits", "patterntransform", "patternunits", "points", "preservealpha", "preserveaspectratio", "primitiveunits", "r", "rx", "ry", "radius", "refx", "refy", "repeatcount", "repeatdur", "restart", "result", "rotate", "scale", "seed", "shape-rendering", "slope", "specularconstant", "specularexponent", "spreadmethod", "startoffset", "stddeviation", "stitchtiles", "stop-color", "stop-opacity", "stroke-dasharray", "stroke-dashoffset", "stroke-linecap", "stroke-linejoin", "stroke-miterlimit", "stroke-opacity", "stroke", "stroke-width", "style", "surfacescale", "systemlanguage", "tabindex", "tablevalues", "targetx", "targety", "transform", "transform-origin", "text-anchor", "text-decoration", "text-rendering", "textlength", "type", "u1", "u2", "unicode", "values", "viewbox", "visibility", "version", "vert-adv-y", "vert-origin-x", "vert-origin-y", "width", "word-spacing", "wrap", "writing-mode", "xchannelselector", "ychannelselector", "x", "x1", "x2", "xmlns", "y", "y1", "y2", "z", "zoomandpan"]), qA = ms(["accent", "accentunder", "align", "bevelled", "close", "columnsalign", "columnlines", "columnspan", "denomalign", "depth", "dir", "display", "displaystyle", "encoding", "fence", "frame", "height", "href", "id", "largeop", "length", "linethickness", "lspace", "lquote", "mathbackground", "mathcolor", "mathsize", "mathvariant", "maxsize", "minsize", "movablelimits", "notation", "numalign", "open", "rowalign", "rowlines", "rowspacing", "rowspan", "rspace", "rquote", "scriptlevel", "scriptminsize", "scriptsizemultiplier", "selection", "separator", "separators", "stretchy", "subscriptshift", "supscriptshift", "symmetric", "voffset", "width", "xmlns"]), T5 = ms(["xlink:href", "xml:id", "xlink:title", "xml:space", "xmlns:xlink"]), EY = Kr(/\{\{[\w\W]*|[\w\W]*\}\}/gm), DY = Kr(/<%[\w\W]*|[\w\W]*%>/gm), TY = Kr(/\$\{[\w\W]*/gm), FY = Kr(/^data-[\-\w.\u00B7-\uFFFF]+$/), IY = Kr(/^aria-[\-\w]+$/), FI = Kr(
  /^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i
  // eslint-disable-line no-useless-escape
), MY = Kr(/^(?:\w+script|data):/i), RY = Kr(
  /[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g
  // eslint-disable-line no-control-regex
), II = Kr(/^html$/i), BY = Kr(/^[a-z][.\w]*(-[.\w]+)+$/i);
var zA = /* @__PURE__ */ Object.freeze({
  __proto__: null,
  ARIA_ATTR: IY,
  ATTR_WHITESPACE: RY,
  CUSTOM_ELEMENT: BY,
  DATA_ATTR: FY,
  DOCTYPE_NAME: II,
  ERB_EXPR: DY,
  IS_ALLOWED_URI: FI,
  IS_SCRIPT_OR_DATA: MY,
  MUSTACHE_EXPR: EY,
  TMPLIT_EXPR: TY
});
const Yf = {
  element: 1,
  text: 3,
  // Deprecated
  progressingInstruction: 7,
  comment: 8,
  document: 9
}, PY = function() {
  return typeof window > "u" ? null : window;
}, NY = function(t, e) {
  if (typeof t != "object" || typeof t.createPolicy != "function")
    return null;
  let n = null;
  const s = "data-tt-policy-suffix";
  e && e.hasAttribute(s) && (n = e.getAttribute(s));
  const r = "dompurify" + (n ? "#" + n : "");
  try {
    return t.createPolicy(r, {
      createHTML(a) {
        return a;
      },
      createScriptURL(a) {
        return a;
      }
    });
  } catch {
    return console.warn("TrustedTypes policy " + r + " could not be created."), null;
  }
}, UA = function() {
  return {
    afterSanitizeAttributes: [],
    afterSanitizeElements: [],
    afterSanitizeShadowDOM: [],
    beforeSanitizeAttributes: [],
    beforeSanitizeElements: [],
    beforeSanitizeShadowDOM: [],
    uponSanitizeAttribute: [],
    uponSanitizeElement: [],
    uponSanitizeShadowNode: []
  };
};
function MI() {
  let i = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : PY();
  const t = (Qt) => MI(Qt);
  if (t.version = "3.2.6", t.removed = [], !i || !i.document || i.document.nodeType !== Yf.document || !i.Element)
    return t.isSupported = !1, t;
  let {
    document: e
  } = i;
  const n = e, s = n.currentScript, {
    DocumentFragment: r,
    HTMLTemplateElement: a,
    Node: o,
    Element: l,
    NodeFilter: c,
    NamedNodeMap: h = i.NamedNodeMap || i.MozNamedAttrMap,
    HTMLFormElement: u,
    DOMParser: f,
    trustedTypes: d
  } = i, p = l.prototype, g = Xf(p, "cloneNode"), b = Xf(p, "remove"), y = Xf(p, "nextSibling"), v = Xf(p, "childNodes"), w = Xf(p, "parentNode");
  if (typeof a == "function") {
    const Qt = e.createElement("template");
    Qt.content && Qt.content.ownerDocument && (e = Qt.content.ownerDocument);
  }
  let _, x = "";
  const {
    implementation: k,
    createNodeIterator: S,
    createDocumentFragment: T,
    getElementsByTagName: I
  } = e, {
    importNode: R
  } = n;
  let B = UA();
  t.isSupported = typeof DI == "function" && typeof w == "function" && k && k.createHTMLDocument !== void 0;
  const {
    MUSTACHE_EXPR: L,
    ERB_EXPR: it,
    TMPLIT_EXPR: O,
    DATA_ATTR: at,
    ARIA_ATTR: W,
    IS_SCRIPT_OR_DATA: q,
    ATTR_WHITESPACE: K,
    CUSTOM_ELEMENT: z
  } = zA;
  let {
    IS_ALLOWED_URI: j
  } = zA, N = null;
  const Q = Te({}, [...LA, ...b7, ...y7, ...w7, ...OA]);
  let Y = null;
  const et = Te({}, [...$A, ...v7, ...qA, ...T5]);
  let $ = Object.seal(TI(null, {
    tagNameCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    },
    attributeNameCheck: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: null
    },
    allowCustomizedBuiltInElements: {
      writable: !0,
      configurable: !1,
      enumerable: !0,
      value: !1
    }
  })), dt = null, tt = null, ut = !0, St = !0, G = !1, V = !0, nt = !1, gt = !0, _t = !1, kt = !1, xt = !1, wt = !1, yt = !1, Ot = !1, Kt = !0, Ft = !1;
  const It = "user-content-";
  let Pt = !0, ae = !1, le = {}, ji = null;
  const Ei = Te({}, ["annotation-xml", "audio", "colgroup", "desc", "foreignobject", "head", "iframe", "math", "mi", "mn", "mo", "ms", "mtext", "noembed", "noframes", "noscript", "plaintext", "script", "style", "svg", "template", "thead", "title", "video", "xmp"]);
  let vs = null;
  const No = Te({}, ["audio", "video", "img", "source", "image", "track"]);
  let wf = null;
  const vf = Te({}, ["alt", "class", "for", "id", "label", "name", "pattern", "placeholder", "role", "summary", "title", "value", "style", "xmlns"]), x0 = "http://www.w3.org/1998/Math/MathML", k0 = "http://www.w3.org/2000/svg", fr = "http://www.w3.org/1999/xhtml";
  let Jl = fr, _f = !1, e6 = null;
  const RI = Te({}, [x0, k0, fr], g7);
  let Og = Te({}, ["mi", "mo", "mn", "ms", "mtext"]), $g = Te({}, ["annotation-xml"]);
  const BI = Te({}, ["title", "style", "font", "a", "script"]);
  let xf = null;
  const PI = ["application/xhtml+xml", "text/html"], NI = "text/html";
  let rn = null, O1 = null;
  const LI = e.createElement("form"), cv = function(rt) {
    return rt instanceof RegExp || rt instanceof Function;
  }, i6 = function() {
    let rt = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    if (!(O1 && O1 === rt)) {
      if ((!rt || typeof rt != "object") && (rt = {}), rt = Vo(rt), xf = // eslint-disable-next-line unicorn/prefer-includes
      PI.indexOf(rt.PARSER_MEDIA_TYPE) === -1 ? NI : rt.PARSER_MEDIA_TYPE, rn = xf === "application/xhtml+xml" ? g7 : P9, N = na(rt, "ALLOWED_TAGS") ? Te({}, rt.ALLOWED_TAGS, rn) : Q, Y = na(rt, "ALLOWED_ATTR") ? Te({}, rt.ALLOWED_ATTR, rn) : et, e6 = na(rt, "ALLOWED_NAMESPACES") ? Te({}, rt.ALLOWED_NAMESPACES, g7) : RI, wf = na(rt, "ADD_URI_SAFE_ATTR") ? Te(Vo(vf), rt.ADD_URI_SAFE_ATTR, rn) : vf, vs = na(rt, "ADD_DATA_URI_TAGS") ? Te(Vo(No), rt.ADD_DATA_URI_TAGS, rn) : No, ji = na(rt, "FORBID_CONTENTS") ? Te({}, rt.FORBID_CONTENTS, rn) : Ei, dt = na(rt, "FORBID_TAGS") ? Te({}, rt.FORBID_TAGS, rn) : Vo({}), tt = na(rt, "FORBID_ATTR") ? Te({}, rt.FORBID_ATTR, rn) : Vo({}), le = na(rt, "USE_PROFILES") ? rt.USE_PROFILES : !1, ut = rt.ALLOW_ARIA_ATTR !== !1, St = rt.ALLOW_DATA_ATTR !== !1, G = rt.ALLOW_UNKNOWN_PROTOCOLS || !1, V = rt.ALLOW_SELF_CLOSE_IN_ATTR !== !1, nt = rt.SAFE_FOR_TEMPLATES || !1, gt = rt.SAFE_FOR_XML !== !1, _t = rt.WHOLE_DOCUMENT || !1, wt = rt.RETURN_DOM || !1, yt = rt.RETURN_DOM_FRAGMENT || !1, Ot = rt.RETURN_TRUSTED_TYPE || !1, xt = rt.FORCE_BODY || !1, Kt = rt.SANITIZE_DOM !== !1, Ft = rt.SANITIZE_NAMED_PROPS || !1, Pt = rt.KEEP_CONTENT !== !1, ae = rt.IN_PLACE || !1, j = rt.ALLOWED_URI_REGEXP || FI, Jl = rt.NAMESPACE || fr, Og = rt.MATHML_TEXT_INTEGRATION_POINTS || Og, $g = rt.HTML_INTEGRATION_POINTS || $g, $ = rt.CUSTOM_ELEMENT_HANDLING || {}, rt.CUSTOM_ELEMENT_HANDLING && cv(rt.CUSTOM_ELEMENT_HANDLING.tagNameCheck) && ($.tagNameCheck = rt.CUSTOM_ELEMENT_HANDLING.tagNameCheck), rt.CUSTOM_ELEMENT_HANDLING && cv(rt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck) && ($.attributeNameCheck = rt.CUSTOM_ELEMENT_HANDLING.attributeNameCheck), rt.CUSTOM_ELEMENT_HANDLING && typeof rt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements == "boolean" && ($.allowCustomizedBuiltInElements = rt.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements), nt && (St = !1), yt && (wt = !0), le && (N = Te({}, OA), Y = [], le.html === !0 && (Te(N, LA), Te(Y, $A)), le.svg === !0 && (Te(N, b7), Te(Y, v7), Te(Y, T5)), le.svgFilters === !0 && (Te(N, y7), Te(Y, v7), Te(Y, T5)), le.mathMl === !0 && (Te(N, w7), Te(Y, qA), Te(Y, T5))), rt.ADD_TAGS && (N === Q && (N = Vo(N)), Te(N, rt.ADD_TAGS, rn)), rt.ADD_ATTR && (Y === et && (Y = Vo(Y)), Te(Y, rt.ADD_ATTR, rn)), rt.ADD_URI_SAFE_ATTR && Te(wf, rt.ADD_URI_SAFE_ATTR, rn), rt.FORBID_CONTENTS && (ji === Ei && (ji = Vo(ji)), Te(ji, rt.FORBID_CONTENTS, rn)), Pt && (N["#text"] = !0), _t && Te(N, ["html", "head", "body"]), N.table && (Te(N, ["tbody"]), delete dt.tbody), rt.TRUSTED_TYPES_POLICY) {
        if (typeof rt.TRUSTED_TYPES_POLICY.createHTML != "function")
          throw Wf('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');
        if (typeof rt.TRUSTED_TYPES_POLICY.createScriptURL != "function")
          throw Wf('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');
        _ = rt.TRUSTED_TYPES_POLICY, x = _.createHTML("");
      } else
        _ === void 0 && (_ = NY(d, s)), _ !== null && typeof x == "string" && (x = _.createHTML(""));
      ms && ms(rt), O1 = rt;
    }
  }, hv = Te({}, [...b7, ...y7, ...SY]), uv = Te({}, [...w7, ...CY]), OI = function(rt) {
    let Bt = w(rt);
    (!Bt || !Bt.tagName) && (Bt = {
      namespaceURI: Jl,
      tagName: "template"
    });
    const Vt = P9(rt.tagName), li = P9(Bt.tagName);
    return e6[rt.namespaceURI] ? rt.namespaceURI === k0 ? Bt.namespaceURI === fr ? Vt === "svg" : Bt.namespaceURI === x0 ? Vt === "svg" && (li === "annotation-xml" || Og[li]) : !!hv[Vt] : rt.namespaceURI === x0 ? Bt.namespaceURI === fr ? Vt === "math" : Bt.namespaceURI === k0 ? Vt === "math" && $g[li] : !!uv[Vt] : rt.namespaceURI === fr ? Bt.namespaceURI === k0 && !$g[li] || Bt.namespaceURI === x0 && !Og[li] ? !1 : !uv[Vt] && (BI[Vt] || !hv[Vt]) : !!(xf === "application/xhtml+xml" && e6[rt.namespaceURI]) : !1;
  }, Oa = function(rt) {
    Gf(t.removed, {
      element: rt
    });
    try {
      w(rt).removeChild(rt);
    } catch {
      b(rt);
    }
  }, $1 = function(rt, Bt) {
    try {
      Gf(t.removed, {
        attribute: Bt.getAttributeNode(rt),
        from: Bt
      });
    } catch {
      Gf(t.removed, {
        attribute: null,
        from: Bt
      });
    }
    if (Bt.removeAttribute(rt), rt === "is")
      if (wt || yt)
        try {
          Oa(Bt);
        } catch {
        }
      else
        try {
          Bt.setAttribute(rt, "");
        } catch {
        }
  }, dv = function(rt) {
    let Bt = null, Vt = null;
    if (xt)
      rt = "<remove></remove>" + rt;
    else {
      const Zi = NA(rt, /^[\r\n\t ]+/);
      Vt = Zi && Zi[0];
    }
    xf === "application/xhtml+xml" && Jl === fr && (rt = '<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>' + rt + "</body></html>");
    const li = _ ? _.createHTML(rt) : rt;
    if (Jl === fr)
      try {
        Bt = new f().parseFromString(li, xf);
      } catch {
      }
    if (!Bt || !Bt.documentElement) {
      Bt = k.createDocument(Jl, "template", null);
      try {
        Bt.documentElement.innerHTML = _f ? x : li;
      } catch {
      }
    }
    const Bn = Bt.body || Bt.documentElement;
    return rt && Vt && Bn.insertBefore(e.createTextNode(Vt), Bn.childNodes[0] || null), Jl === fr ? I.call(Bt, _t ? "html" : "body")[0] : _t ? Bt.documentElement : Bn;
  }, fv = function(rt) {
    return S.call(
      rt.ownerDocument || rt,
      rt,
      // eslint-disable-next-line no-bitwise
      c.SHOW_ELEMENT | c.SHOW_COMMENT | c.SHOW_TEXT | c.SHOW_PROCESSING_INSTRUCTION | c.SHOW_CDATA_SECTION,
      null
    );
  }, n6 = function(rt) {
    return rt instanceof u && (typeof rt.nodeName != "string" || typeof rt.textContent != "string" || typeof rt.removeChild != "function" || !(rt.attributes instanceof h) || typeof rt.removeAttribute != "function" || typeof rt.setAttribute != "function" || typeof rt.namespaceURI != "string" || typeof rt.insertBefore != "function" || typeof rt.hasChildNodes != "function");
  }, pv = function(rt) {
    return typeof o == "function" && rt instanceof o;
  };
  function Lo(Qt, rt, Bt) {
    D5(Qt, (Vt) => {
      Vt.call(t, rt, Bt, O1);
    });
  }
  const mv = function(rt) {
    let Bt = null;
    if (Lo(B.beforeSanitizeElements, rt, null), n6(rt))
      return Oa(rt), !0;
    const Vt = rn(rt.nodeName);
    if (Lo(B.uponSanitizeElement, rt, {
      tagName: Vt,
      allowedTags: N
    }), gt && rt.hasChildNodes() && !pv(rt.firstElementChild) && ts(/<[/\w!]/g, rt.innerHTML) && ts(/<[/\w!]/g, rt.textContent) || rt.nodeType === Yf.progressingInstruction || gt && rt.nodeType === Yf.comment && ts(/<[/\w]/g, rt.data))
      return Oa(rt), !0;
    if (!N[Vt] || dt[Vt]) {
      if (!dt[Vt] && bv(Vt) && ($.tagNameCheck instanceof RegExp && ts($.tagNameCheck, Vt) || $.tagNameCheck instanceof Function && $.tagNameCheck(Vt)))
        return !1;
      if (Pt && !ji[Vt]) {
        const li = w(rt) || rt.parentNode, Bn = v(rt) || rt.childNodes;
        if (Bn && li) {
          const Zi = Bn.length;
          for (let _s = Zi - 1; _s >= 0; --_s) {
            const Oo = g(Bn[_s], !0);
            Oo.__removalCount = (rt.__removalCount || 0) + 1, li.insertBefore(Oo, y(rt));
          }
        }
      }
      return Oa(rt), !0;
    }
    return rt instanceof l && !OI(rt) || (Vt === "noscript" || Vt === "noembed" || Vt === "noframes") && ts(/<\/no(script|embed|frames)/i, rt.innerHTML) ? (Oa(rt), !0) : (nt && rt.nodeType === Yf.text && (Bt = rt.textContent, D5([L, it, O], (li) => {
      Bt = Vf(Bt, li, " ");
    }), rt.textContent !== Bt && (Gf(t.removed, {
      element: rt.cloneNode()
    }), rt.textContent = Bt)), Lo(B.afterSanitizeElements, rt, null), !1);
  }, gv = function(rt, Bt, Vt) {
    if (Kt && (Bt === "id" || Bt === "name") && (Vt in e || Vt in LI))
      return !1;
    if (!(St && !tt[Bt] && ts(at, Bt))) {
      if (!(ut && ts(W, Bt))) {
        if (!Y[Bt] || tt[Bt]) {
          if (
            // First condition does a very basic check if a) it's basically a valid custom element tagname AND
            // b) if the tagName passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
            // and c) if the attribute name passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.attributeNameCheck
            !(bv(rt) && ($.tagNameCheck instanceof RegExp && ts($.tagNameCheck, rt) || $.tagNameCheck instanceof Function && $.tagNameCheck(rt)) && ($.attributeNameCheck instanceof RegExp && ts($.attributeNameCheck, Bt) || $.attributeNameCheck instanceof Function && $.attributeNameCheck(Bt)) || // Alternative, second condition checks if it's an `is`-attribute, AND
            // the value passes whatever the user has configured for CUSTOM_ELEMENT_HANDLING.tagNameCheck
            Bt === "is" && $.allowCustomizedBuiltInElements && ($.tagNameCheck instanceof RegExp && ts($.tagNameCheck, Vt) || $.tagNameCheck instanceof Function && $.tagNameCheck(Vt)))
          ) return !1;
        } else if (!wf[Bt]) {
          if (!ts(j, Vf(Vt, K, ""))) {
            if (!((Bt === "src" || Bt === "xlink:href" || Bt === "href") && rt !== "script" && _Y(Vt, "data:") === 0 && vs[rt])) {
              if (!(G && !ts(q, Vf(Vt, K, "")))) {
                if (Vt)
                  return !1;
              }
            }
          }
        }
      }
    }
    return !0;
  }, bv = function(rt) {
    return rt !== "annotation-xml" && NA(rt, z);
  }, yv = function(rt) {
    Lo(B.beforeSanitizeAttributes, rt, null);
    const {
      attributes: Bt
    } = rt;
    if (!Bt || n6(rt))
      return;
    const Vt = {
      attrName: "",
      attrValue: "",
      keepAttr: !0,
      allowedAttributes: Y,
      forceKeepAttr: void 0
    };
    let li = Bt.length;
    for (; li--; ) {
      const Bn = Bt[li], {
        name: Zi,
        namespaceURI: _s,
        value: Oo
      } = Bn, kf = rn(Zi), s6 = Oo;
      let Pn = Zi === "value" ? s6 : xY(s6);
      if (Vt.attrName = kf, Vt.attrValue = Pn, Vt.keepAttr = !0, Vt.forceKeepAttr = void 0, Lo(B.uponSanitizeAttribute, rt, Vt), Pn = Vt.attrValue, Ft && (kf === "id" || kf === "name") && ($1(Zi, rt), Pn = It + Pn), gt && ts(/((--!?|])>)|<\/(style|title)/i, Pn)) {
        $1(Zi, rt);
        continue;
      }
      if (Vt.forceKeepAttr)
        continue;
      if (!Vt.keepAttr) {
        $1(Zi, rt);
        continue;
      }
      if (!V && ts(/\/>/i, Pn)) {
        $1(Zi, rt);
        continue;
      }
      nt && D5([L, it, O], (vv) => {
        Pn = Vf(Pn, vv, " ");
      });
      const wv = rn(rt.nodeName);
      if (!gv(wv, kf, Pn)) {
        $1(Zi, rt);
        continue;
      }
      if (_ && typeof d == "object" && typeof d.getAttributeType == "function" && !_s)
        switch (d.getAttributeType(wv, kf)) {
          case "TrustedHTML": {
            Pn = _.createHTML(Pn);
            break;
          }
          case "TrustedScriptURL": {
            Pn = _.createScriptURL(Pn);
            break;
          }
        }
      if (Pn !== s6)
        try {
          _s ? rt.setAttributeNS(_s, Zi, Pn) : rt.setAttribute(Zi, Pn), n6(rt) ? Oa(rt) : PA(t.removed);
        } catch {
          $1(Zi, rt);
        }
    }
    Lo(B.afterSanitizeAttributes, rt, null);
  }, $I = function Qt(rt) {
    let Bt = null;
    const Vt = fv(rt);
    for (Lo(B.beforeSanitizeShadowDOM, rt, null); Bt = Vt.nextNode(); )
      Lo(B.uponSanitizeShadowNode, Bt, null), mv(Bt), yv(Bt), Bt.content instanceof r && Qt(Bt.content);
    Lo(B.afterSanitizeShadowDOM, rt, null);
  };
  return t.sanitize = function(Qt) {
    let rt = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, Bt = null, Vt = null, li = null, Bn = null;
    if (_f = !Qt, _f && (Qt = "<!-->"), typeof Qt != "string" && !pv(Qt))
      if (typeof Qt.toString == "function") {
        if (Qt = Qt.toString(), typeof Qt != "string")
          throw Wf("dirty is not a string, aborting");
      } else
        throw Wf("toString is not a function");
    if (!t.isSupported)
      return Qt;
    if (kt || i6(rt), t.removed = [], typeof Qt == "string" && (ae = !1), ae) {
      if (Qt.nodeName) {
        const Oo = rn(Qt.nodeName);
        if (!N[Oo] || dt[Oo])
          throw Wf("root node is forbidden and cannot be sanitized in-place");
      }
    } else if (Qt instanceof o)
      Bt = dv("<!---->"), Vt = Bt.ownerDocument.importNode(Qt, !0), Vt.nodeType === Yf.element && Vt.nodeName === "BODY" || Vt.nodeName === "HTML" ? Bt = Vt : Bt.appendChild(Vt);
    else {
      if (!wt && !nt && !_t && // eslint-disable-next-line unicorn/prefer-includes
      Qt.indexOf("<") === -1)
        return _ && Ot ? _.createHTML(Qt) : Qt;
      if (Bt = dv(Qt), !Bt)
        return wt ? null : Ot ? x : "";
    }
    Bt && xt && Oa(Bt.firstChild);
    const Zi = fv(ae ? Qt : Bt);
    for (; li = Zi.nextNode(); )
      mv(li), yv(li), li.content instanceof r && $I(li.content);
    if (ae)
      return Qt;
    if (wt) {
      if (yt)
        for (Bn = T.call(Bt.ownerDocument); Bt.firstChild; )
          Bn.appendChild(Bt.firstChild);
      else
        Bn = Bt;
      return (Y.shadowroot || Y.shadowrootmode) && (Bn = R.call(n, Bn, !0)), Bn;
    }
    let _s = _t ? Bt.outerHTML : Bt.innerHTML;
    return _t && N["!doctype"] && Bt.ownerDocument && Bt.ownerDocument.doctype && Bt.ownerDocument.doctype.name && ts(II, Bt.ownerDocument.doctype.name) && (_s = "<!DOCTYPE " + Bt.ownerDocument.doctype.name + `>
` + _s), nt && D5([L, it, O], (Oo) => {
      _s = Vf(_s, Oo, " ");
    }), _ && Ot ? _.createHTML(_s) : _s;
  }, t.setConfig = function() {
    let Qt = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : {};
    i6(Qt), kt = !0;
  }, t.clearConfig = function() {
    O1 = null, kt = !1;
  }, t.isValidAttribute = function(Qt, rt, Bt) {
    O1 || i6({});
    const Vt = rn(Qt), li = rn(rt);
    return gv(Vt, li, Bt);
  }, t.addHook = function(Qt, rt) {
    typeof rt == "function" && Gf(B[Qt], rt);
  }, t.removeHook = function(Qt, rt) {
    if (rt !== void 0) {
      const Bt = wY(B[Qt], rt);
      return Bt === -1 ? void 0 : vY(B[Qt], Bt, 1)[0];
    }
    return PA(B[Qt]);
  }, t.removeHooks = function(Qt) {
    B[Qt] = [];
  }, t.removeAllHooks = function() {
    B = UA();
  }, t;
}
MI();
const {
  HtmlTagHydration: pft,
  SvelteComponent: mft,
  add_render_callback: gft,
  append_hydration: bft,
  attr: yft,
  bubble: wft,
  check_outros: vft,
  children: _ft,
  claim_component: xft,
  claim_element: kft,
  claim_html_tag: Aft,
  claim_space: Sft,
  claim_text: Cft,
  create_component: Eft,
  create_in_transition: Dft,
  create_out_transition: Tft,
  destroy_component: Fft,
  detach: Ift,
  element: Mft,
  get_svelte_dataset: Rft,
  group_outros: Bft,
  init: Pft,
  insert_hydration: Nft,
  listen: Lft,
  mount_component: Oft,
  run_all: $ft,
  safe_not_equal: qft,
  set_data: zft,
  space: Uft,
  stop_propagation: Hft,
  text: jft,
  toggle_class: Gft,
  transition_in: Vft,
  transition_out: Wft
} = window.__gradio__svelte__internal, { createEventDispatcher: Xft, onMount: Yft } = window.__gradio__svelte__internal, {
  SvelteComponent: Kft,
  append_hydration: Zft,
  attr: Jft,
  bubble: Qft,
  check_outros: t2t,
  children: e2t,
  claim_component: i2t,
  claim_element: n2t,
  claim_space: s2t,
  create_animation: r2t,
  create_component: a2t,
  destroy_component: o2t,
  detach: l2t,
  element: c2t,
  ensure_array_like: h2t,
  fix_and_outro_and_destroy_block: u2t,
  fix_position: d2t,
  group_outros: f2t,
  init: p2t,
  insert_hydration: m2t,
  mount_component: g2t,
  noop: b2t,
  safe_not_equal: y2t,
  set_style: w2t,
  space: v2t,
  transition_in: _2t,
  transition_out: x2t,
  update_keyed_each: k2t
} = window.__gradio__svelte__internal, {
  SvelteComponent: A2t,
  attr: S2t,
  children: C2t,
  claim_element: E2t,
  detach: D2t,
  element: T2t,
  empty: F2t,
  init: I2t,
  insert_hydration: M2t,
  noop: R2t,
  safe_not_equal: B2t,
  set_style: P2t
} = window.__gradio__svelte__internal, {
  SvelteComponent: LY,
  append_hydration: _7,
  assign: OY,
  attr: $Y,
  check_outros: qY,
  children: HA,
  claim_component: H2,
  claim_element: jA,
  claim_space: F5,
  claim_text: zY,
  create_component: j2,
  destroy_component: G2,
  detach: K1,
  element: GA,
  get_spread_object: UY,
  get_spread_update: HY,
  group_outros: jY,
  init: GY,
  insert_hydration: I5,
  mount_component: V2,
  safe_not_equal: VY,
  set_data: WY,
  space: M5,
  text: XY,
  transition_in: uc,
  transition_out: K0
} = window.__gradio__svelte__internal;
function VA(i) {
  let t, e;
  const n = [
    { autoscroll: (
      /*gradio*/
      i[8].autoscroll
    ) },
    { i18n: (
      /*gradio*/
      i[8].i18n
    ) },
    /*loading_status*/
    i[7]
  ];
  let s = {};
  for (let r = 0; r < n.length; r += 1)
    s = OY(s, n[r]);
  return t = new mY({ props: s }), t.$on(
    "clear_status",
    /*clear_status_handler*/
    i[11]
  ), {
    c() {
      j2(t.$$.fragment);
    },
    l(r) {
      H2(t.$$.fragment, r);
    },
    m(r, a) {
      V2(t, r, a), e = !0;
    },
    p(r, a) {
      const o = a & /*gradio, loading_status*/
      384 ? HY(n, [
        a & /*gradio*/
        256 && { autoscroll: (
          /*gradio*/
          r[8].autoscroll
        ) },
        a & /*gradio*/
        256 && { i18n: (
          /*gradio*/
          r[8].i18n
        ) },
        a & /*loading_status*/
        128 && UY(
          /*loading_status*/
          r[7]
        )
      ]) : {};
      t.$set(o);
    },
    i(r) {
      e || (uc(t.$$.fragment, r), e = !0);
    },
    o(r) {
      K0(t.$$.fragment, r), e = !1;
    },
    d(r) {
      G2(t, r);
    }
  };
}
function YY(i) {
  let t, e, n, s, r, a, o, l, c, h = (
    /*value*/
    i[0] ? "Value is set ✅" : "Value is not set ❌"
  ), u, f, d = (
    /*loading_status*/
    i[7] && VA(i)
  );
  return n = new Kj({}), n.$on(
    "upload",
    /*handleUpload*/
    i[10]
  ), r = new wG({ props: { textContent: (
    /*value*/
    i[0]
  ) } }), o = new rG({ props: { file: (
    /*file*/
    i[9]
  ) } }), {
    c() {
      d && d.c(), t = M5(), e = GA("div"), j2(n.$$.fragment), s = M5(), j2(r.$$.fragment), a = M5(), j2(o.$$.fragment), l = M5(), c = GA("p"), u = XY(h), this.h();
    },
    l(p) {
      d && d.l(p), t = F5(p), e = jA(p, "DIV", {});
      var g = HA(e);
      H2(n.$$.fragment, g), s = F5(g), H2(r.$$.fragment, g), a = F5(g), H2(o.$$.fragment, g), g.forEach(K1), l = F5(p), c = jA(p, "P", { class: !0 });
      var b = HA(c);
      u = zY(b, h), b.forEach(K1), this.h();
    },
    h() {
      $Y(c, "class", "value-status svelte-cjeulj");
    },
    m(p, g) {
      d && d.m(p, g), I5(p, t, g), I5(p, e, g), V2(n, e, null), _7(e, s), V2(r, e, null), _7(e, a), V2(o, e, null), I5(p, l, g), I5(p, c, g), _7(c, u), f = !0;
    },
    p(p, g) {
      /*loading_status*/
      p[7] ? d ? (d.p(p, g), g & /*loading_status*/
      128 && uc(d, 1)) : (d = VA(p), d.c(), uc(d, 1), d.m(t.parentNode, t)) : d && (jY(), K0(d, 1, 1, () => {
        d = null;
      }), qY());
      const b = {};
      g & /*value*/
      1 && (b.textContent = /*value*/
      p[0]), r.$set(b);
      const y = {};
      g & /*file*/
      512 && (y.file = /*file*/
      p[9]), o.$set(y), (!f || g & /*value*/
      1) && h !== (h = /*value*/
      p[0] ? "Value is set ✅" : "Value is not set ❌") && WY(u, h);
    },
    i(p) {
      f || (uc(d), uc(n.$$.fragment, p), uc(r.$$.fragment, p), uc(o.$$.fragment, p), f = !0);
    },
    o(p) {
      K0(d), K0(n.$$.fragment, p), K0(r.$$.fragment, p), K0(o.$$.fragment, p), f = !1;
    },
    d(p) {
      p && (K1(t), K1(e), K1(l), K1(c)), d && d.d(p), G2(n), G2(r), G2(o);
    }
  };
}
function KY(i) {
  let t, e;
  return t = new PG({
    props: {
      visible: (
        /*visible*/
        i[3]
      ),
      elem_id: (
        /*elem_id*/
        i[1]
      ),
      elem_classes: (
        /*elem_classes*/
        i[2]
      ),
      container: (
        /*container*/
        i[4]
      ),
      scale: (
        /*scale*/
        i[5]
      ),
      min_width: (
        /*min_width*/
        i[6]
      ),
      $$slots: { default: [YY] },
      $$scope: { ctx: i }
    }
  }), {
    c() {
      j2(t.$$.fragment);
    },
    l(n) {
      H2(t.$$.fragment, n);
    },
    m(n, s) {
      V2(t, n, s), e = !0;
    },
    p(n, [s]) {
      const r = {};
      s & /*visible*/
      8 && (r.visible = /*visible*/
      n[3]), s & /*elem_id*/
      2 && (r.elem_id = /*elem_id*/
      n[1]), s & /*elem_classes*/
      4 && (r.elem_classes = /*elem_classes*/
      n[2]), s & /*container*/
      16 && (r.container = /*container*/
      n[4]), s & /*scale*/
      32 && (r.scale = /*scale*/
      n[5]), s & /*min_width*/
      64 && (r.min_width = /*min_width*/
      n[6]), s & /*$$scope, value, file, gradio, loading_status*/
      4993 && (r.$$scope = { dirty: s, ctx: n }), t.$set(r);
    },
    i(n) {
      e || (uc(t.$$.fragment, n), e = !0);
    },
    o(n) {
      K0(t.$$.fragment, n), e = !1;
    },
    d(n) {
      G2(t, n);
    }
  };
}
function ZY(i, t, e) {
  let { elem_id: n = "" } = t, { elem_classes: s = [] } = t, { visible: r = !0 } = t, { value: a } = t, { container: o = !0 } = t, { scale: l = null } = t, { min_width: c = void 0 } = t, { loading_status: h } = t, { gradio: u } = t, f = null;
  function d(g) {
    let { content: { asString: b, asFile: y } } = g.detail;
    e(0, a = b), e(9, f = y), console.log("uploaded");
  }
  const p = () => u.dispatch("clear_status", h);
  return i.$$set = (g) => {
    "elem_id" in g && e(1, n = g.elem_id), "elem_classes" in g && e(2, s = g.elem_classes), "visible" in g && e(3, r = g.visible), "value" in g && e(0, a = g.value), "container" in g && e(4, o = g.container), "scale" in g && e(5, l = g.scale), "min_width" in g && e(6, c = g.min_width), "loading_status" in g && e(7, h = g.loading_status), "gradio" in g && e(8, u = g.gradio);
  }, [
    a,
    n,
    s,
    r,
    o,
    l,
    c,
    h,
    u,
    f,
    d,
    p
  ];
}
class N2t extends LY {
  constructor(t) {
    super(), GY(this, t, ZY, KY, VY, {
      elem_id: 1,
      elem_classes: 2,
      visible: 3,
      value: 0,
      container: 4,
      scale: 5,
      min_width: 6,
      loading_status: 7,
      gradio: 8
    });
  }
}
export {
  N2t as default
};
