var Zi = Object.defineProperty;
var ts = (dt, d, et) => d in dt ? Zi(dt, d, { enumerable: !0, configurable: !0, writable: !0, value: et }) : dt[d] = et;
var ee = (dt, d, et) => (ts(dt, typeof d != "symbol" ? d + "" : d, et), et), Ne = (dt, d, et) => {
  if (!d.has(dt))
    throw TypeError("Cannot " + et);
};
var t = (dt, d, et) => (Ne(dt, d, "read from private field"), et ? et.call(dt) : d.get(dt)), I = (dt, d, et) => {
  if (d.has(dt))
    throw TypeError("Cannot add the same private member more than once");
  d instanceof WeakSet ? d.add(dt) : d.set(dt, et);
}, Z = (dt, d, et, c) => (Ne(dt, d, "write to private field"), c ? c.call(dt, et) : d.set(dt, et), et);
var ge = (dt, d, et, c) => ({
  set _(P) {
    Z(dt, d, P, et);
  },
  get _() {
    return t(dt, d, c);
  }
}), W = (dt, d, et) => (Ne(dt, d, "access private method"), et);
function getDefaultExportFromCjs(dt) {
  return dt && dt.__esModule && Object.prototype.hasOwnProperty.call(dt, "default") ? dt.default : dt;
}
function getAugmentedNamespace(dt) {
  if (dt.__esModule)
    return dt;
  var d = dt.default;
  if (typeof d == "function") {
    var et = function c() {
      return this instanceof c ? Reflect.construct(d, arguments, this.constructor) : d.apply(this, arguments);
    };
    et.prototype = d.prototype;
  } else
    et = {};
  return Object.defineProperty(et, "__esModule", { value: !0 }), Object.keys(dt).forEach(function(c) {
    var P = Object.getOwnPropertyDescriptor(dt, c);
    Object.defineProperty(et, c, P.get ? P : {
      enumerable: !0,
      get: function() {
        return dt[c];
      }
    });
  }), et;
}
function commonjsRequire(dt) {
  throw new Error('Could not dynamically require "' + dt + '". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.');
}
var pdf = { exports: {} };
const __viteBrowserExternal = {}, __viteBrowserExternal$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
  __proto__: null,
  default: __viteBrowserExternal
}, Symbol.toStringTag, { value: "Module" })), require$$5 = /* @__PURE__ */ getAugmentedNamespace(__viteBrowserExternal$1);
(function(module, exports) {
  (function(d, et) {
    module.exports = d.pdfjsLib = et();
  })(globalThis, () => (
    /******/
    (() => {
      var __webpack_modules__ = [
        ,
        /* 1 */
        /***/
        (dt, d) => {
          var $t;
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.VerbosityLevel = d.Util = d.UnknownErrorException = d.UnexpectedResponseException = d.TextRenderingMode = d.RenderingIntentFlag = d.PromiseCapability = d.PermissionFlag = d.PasswordResponses = d.PasswordException = d.PageActionEventType = d.OPS = d.MissingPDFException = d.MAX_IMAGE_SIZE_TO_CACHE = d.LINE_FACTOR = d.LINE_DESCENT_FACTOR = d.InvalidPDFException = d.ImageKind = d.IDENTITY_MATRIX = d.FormatError = d.FeatureTest = d.FONT_IDENTITY_MATRIX = d.DocumentActionEventType = d.CMapCompressionType = d.BaseException = d.BASELINE_FACTOR = d.AnnotationType = d.AnnotationReplyType = d.AnnotationPrefix = d.AnnotationMode = d.AnnotationFlag = d.AnnotationFieldFlag = d.AnnotationEditorType = d.AnnotationEditorPrefix = d.AnnotationEditorParamsType = d.AnnotationBorderStyleType = d.AnnotationActionEventType = d.AbortException = void 0, d.assert = lt, d.bytesToString = N, d.createValidAbsoluteUrl = wt, d.getModificationDate = Ct, d.getUuid = Vt, d.getVerbosityLevel = V, d.info = st, d.isArrayBuffer = ht, d.isArrayEqual = Et, d.isNodeJS = void 0, d.normalizeUnicode = Xt, d.objectFromMap = ct, d.objectSize = nt, d.setVerbosityLevel = C, d.shadow = Pt, d.string32 = Q, d.stringToBytes = tt, d.stringToPDFString = ft, d.stringToUTF8String = K, d.unreachable = H, d.utf8StringToString = J, d.warn = at;
          const et = typeof process == "object" && process + "" == "[object process]" && !process.versions.nw && !(process.versions.electron && process.type && process.type !== "browser");
          d.isNodeJS = et;
          const c = [1, 0, 0, 1, 0, 0];
          d.IDENTITY_MATRIX = c;
          const P = [1e-3, 0, 0, 1e-3, 0, 0];
          d.FONT_IDENTITY_MATRIX = P;
          const rt = 1e7;
          d.MAX_IMAGE_SIZE_TO_CACHE = rt;
          const X = 1.35;
          d.LINE_FACTOR = X;
          const pt = 0.35;
          d.LINE_DESCENT_FACTOR = pt;
          const B = pt / X;
          d.BASELINE_FACTOR = B;
          const F = {
            ANY: 1,
            DISPLAY: 2,
            PRINT: 4,
            SAVE: 8,
            ANNOTATIONS_FORMS: 16,
            ANNOTATIONS_STORAGE: 32,
            ANNOTATIONS_DISABLE: 64,
            OPLIST: 256
          };
          d.RenderingIntentFlag = F;
          const g = {
            DISABLE: 0,
            ENABLE: 1,
            ENABLE_FORMS: 2,
            ENABLE_STORAGE: 3
          };
          d.AnnotationMode = g;
          const L = "pdfjs_internal_editor_";
          d.AnnotationEditorPrefix = L;
          const O = {
            DISABLE: -1,
            NONE: 0,
            FREETEXT: 3,
            STAMP: 13,
            INK: 15
          };
          d.AnnotationEditorType = O;
          const T = {
            RESIZE: 1,
            CREATE: 2,
            FREETEXT_SIZE: 11,
            FREETEXT_COLOR: 12,
            FREETEXT_OPACITY: 13,
            INK_COLOR: 21,
            INK_THICKNESS: 22,
            INK_OPACITY: 23
          };
          d.AnnotationEditorParamsType = T;
          const v = {
            PRINT: 4,
            MODIFY_CONTENTS: 8,
            COPY: 16,
            MODIFY_ANNOTATIONS: 32,
            FILL_INTERACTIVE_FORMS: 256,
            COPY_FOR_ACCESSIBILITY: 512,
            ASSEMBLE: 1024,
            PRINT_HIGH_QUALITY: 2048
          };
          d.PermissionFlag = v;
          const A = {
            FILL: 0,
            STROKE: 1,
            FILL_STROKE: 2,
            INVISIBLE: 3,
            FILL_ADD_TO_PATH: 4,
            STROKE_ADD_TO_PATH: 5,
            FILL_STROKE_ADD_TO_PATH: 6,
            ADD_TO_PATH: 7,
            FILL_STROKE_MASK: 3,
            ADD_TO_PATH_FLAG: 4
          };
          d.TextRenderingMode = A;
          const u = {
            GRAYSCALE_1BPP: 1,
            RGB_24BPP: 2,
            RGBA_32BPP: 3
          };
          d.ImageKind = u;
          const b = {
            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
          };
          d.AnnotationType = b;
          const E = {
            GROUP: "Group",
            REPLY: "R"
          };
          d.AnnotationReplyType = E;
          const w = {
            INVISIBLE: 1,
            HIDDEN: 2,
            PRINT: 4,
            NOZOOM: 8,
            NOROTATE: 16,
            NOVIEW: 32,
            READONLY: 64,
            LOCKED: 128,
            TOGGLENOVIEW: 256,
            LOCKEDCONTENTS: 512
          };
          d.AnnotationFlag = w;
          const y = {
            READONLY: 1,
            REQUIRED: 2,
            NOEXPORT: 4,
            MULTILINE: 4096,
            PASSWORD: 8192,
            NOTOGGLETOOFF: 16384,
            RADIO: 32768,
            PUSHBUTTON: 65536,
            COMBO: 131072,
            EDIT: 262144,
            SORT: 524288,
            FILESELECT: 1048576,
            MULTISELECT: 2097152,
            DONOTSPELLCHECK: 4194304,
            DONOTSCROLL: 8388608,
            COMB: 16777216,
            RICHTEXT: 33554432,
            RADIOSINUNISON: 33554432,
            COMMITONSELCHANGE: 67108864
          };
          d.AnnotationFieldFlag = y;
          const a = {
            SOLID: 1,
            DASHED: 2,
            BEVELED: 3,
            INSET: 4,
            UNDERLINE: 5
          };
          d.AnnotationBorderStyleType = a;
          const l = {
            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"
          };
          d.AnnotationActionEventType = l;
          const k = {
            WC: "WillClose",
            WS: "WillSave",
            DS: "DidSave",
            WP: "WillPrint",
            DP: "DidPrint"
          };
          d.DocumentActionEventType = k;
          const p = {
            O: "PageOpen",
            C: "PageClose"
          };
          d.PageActionEventType = p;
          const r = {
            ERRORS: 0,
            WARNINGS: 1,
            INFOS: 5
          };
          d.VerbosityLevel = r;
          const x = {
            NONE: 0,
            BINARY: 1
          };
          d.CMapCompressionType = x;
          const m = {
            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
          };
          d.OPS = m;
          const U = {
            NEED_PASSWORD: 1,
            INCORRECT_PASSWORD: 2
          };
          d.PasswordResponses = U;
          let z = r.WARNINGS;
          function C(ot) {
            Number.isInteger(ot) && (z = ot);
          }
          function V() {
            return z;
          }
          function st(ot) {
            z >= r.INFOS && console.log(`Info: ${ot}`);
          }
          function at(ot) {
            z >= r.WARNINGS && console.log(`Warning: ${ot}`);
          }
          function H(ot) {
            throw new Error(ot);
          }
          function lt(ot, Y) {
            ot || H(Y);
          }
          function gt(ot) {
            switch (ot == null ? void 0 : ot.protocol) {
              case "http:":
              case "https:":
              case "ftp:":
              case "mailto:":
              case "tel:":
                return !0;
              default:
                return !1;
            }
          }
          function wt(ot, Y = null, G = null) {
            if (!ot)
              return null;
            try {
              if (G && typeof ot == "string") {
                if (G.addDefaultProtocol && ot.startsWith("www.")) {
                  const At = ot.match(/\./g);
                  (At == null ? void 0 : At.length) >= 2 && (ot = `http://${ot}`);
                }
                if (G.tryConvertEncoding)
                  try {
                    ot = K(ot);
                  } catch {
                  }
              }
              const bt = Y ? new URL(ot, Y) : new URL(ot);
              if (gt(bt))
                return bt;
            } catch {
            }
            return null;
          }
          function Pt(ot, Y, G, bt = !1) {
            return Object.defineProperty(ot, Y, {
              value: G,
              enumerable: !bt,
              configurable: !0,
              writable: !1
            }), G;
          }
          const S = function() {
            function Y(G, bt) {
              this.constructor === Y && H("Cannot initialize BaseException."), this.message = G, this.name = bt;
            }
            return Y.prototype = new Error(), Y.constructor = Y, Y;
          }();
          d.BaseException = S;
          class i extends S {
            constructor(Y, G) {
              super(Y, "PasswordException"), this.code = G;
            }
          }
          d.PasswordException = i;
          class n extends S {
            constructor(Y, G) {
              super(Y, "UnknownErrorException"), this.details = G;
            }
          }
          d.UnknownErrorException = n;
          class s extends S {
            constructor(Y) {
              super(Y, "InvalidPDFException");
            }
          }
          d.InvalidPDFException = s;
          class o extends S {
            constructor(Y) {
              super(Y, "MissingPDFException");
            }
          }
          d.MissingPDFException = o;
          class h extends S {
            constructor(Y, G) {
              super(Y, "UnexpectedResponseException"), this.status = G;
            }
          }
          d.UnexpectedResponseException = h;
          class _ extends S {
            constructor(Y) {
              super(Y, "FormatError");
            }
          }
          d.FormatError = _;
          class M extends S {
            constructor(Y) {
              super(Y, "AbortException");
            }
          }
          d.AbortException = M;
          function N(ot) {
            (typeof ot != "object" || (ot == null ? void 0 : ot.length) === void 0) && H("Invalid argument for bytesToString");
            const Y = ot.length, G = 8192;
            if (Y < G)
              return String.fromCharCode.apply(null, ot);
            const bt = [];
            for (let At = 0; At < Y; At += G) {
              const te = Math.min(At + G, Y), Zt = ot.subarray(At, te);
              bt.push(String.fromCharCode.apply(null, Zt));
            }
            return bt.join("");
          }
          function tt(ot) {
            typeof ot != "string" && H("Invalid argument for stringToBytes");
            const Y = ot.length, G = new Uint8Array(Y);
            for (let bt = 0; bt < Y; ++bt)
              G[bt] = ot.charCodeAt(bt) & 255;
            return G;
          }
          function Q(ot) {
            return String.fromCharCode(ot >> 24 & 255, ot >> 16 & 255, ot >> 8 & 255, ot & 255);
          }
          function nt(ot) {
            return Object.keys(ot).length;
          }
          function ct(ot) {
            const Y = /* @__PURE__ */ Object.create(null);
            for (const [G, bt] of ot)
              Y[G] = bt;
            return Y;
          }
          function yt() {
            const ot = new Uint8Array(4);
            return ot[0] = 1, new Uint32Array(ot.buffer, 0, 1)[0] === 1;
          }
          function ut() {
            try {
              return new Function(""), !0;
            } catch {
              return !1;
            }
          }
          class Ft {
            static get isLittleEndian() {
              return Pt(this, "isLittleEndian", yt());
            }
            static get isEvalSupported() {
              return Pt(this, "isEvalSupported", ut());
            }
            static get isOffscreenCanvasSupported() {
              return Pt(this, "isOffscreenCanvasSupported", typeof OffscreenCanvas < "u");
            }
            static get platform() {
              return typeof navigator > "u" ? Pt(this, "platform", {
                isWin: !1,
                isMac: !1
              }) : Pt(this, "platform", {
                isWin: navigator.platform.includes("Win"),
                isMac: navigator.platform.includes("Mac")
              });
            }
            static get isCSSRoundSupported() {
              var Y, G;
              return Pt(this, "isCSSRoundSupported", (G = (Y = globalThis.CSS) == null ? void 0 : Y.supports) == null ? void 0 : G.call(Y, "width: round(1.5px, 1px)"));
            }
          }
          d.FeatureTest = Ft;
          const Bt = [...Array(256).keys()].map((ot) => ot.toString(16).padStart(2, "0"));
          class St {
            static makeHexColor(Y, G, bt) {
              return `#${Bt[Y]}${Bt[G]}${Bt[bt]}`;
            }
            static scaleMinMax(Y, G) {
              let bt;
              Y[0] ? (Y[0] < 0 && (bt = G[0], G[0] = G[1], G[1] = bt), G[0] *= Y[0], G[1] *= Y[0], Y[3] < 0 && (bt = G[2], G[2] = G[3], G[3] = bt), G[2] *= Y[3], G[3] *= Y[3]) : (bt = G[0], G[0] = G[2], G[2] = bt, bt = G[1], G[1] = G[3], G[3] = bt, Y[1] < 0 && (bt = G[2], G[2] = G[3], G[3] = bt), G[2] *= Y[1], G[3] *= Y[1], Y[2] < 0 && (bt = G[0], G[0] = G[1], G[1] = bt), G[0] *= Y[2], G[1] *= Y[2]), G[0] += Y[4], G[1] += Y[4], G[2] += Y[5], G[3] += Y[5];
            }
            static transform(Y, G) {
              return [Y[0] * G[0] + Y[2] * G[1], Y[1] * G[0] + Y[3] * G[1], Y[0] * G[2] + Y[2] * G[3], Y[1] * G[2] + Y[3] * G[3], Y[0] * G[4] + Y[2] * G[5] + Y[4], Y[1] * G[4] + Y[3] * G[5] + Y[5]];
            }
            static applyTransform(Y, G) {
              const bt = Y[0] * G[0] + Y[1] * G[2] + G[4], At = Y[0] * G[1] + Y[1] * G[3] + G[5];
              return [bt, At];
            }
            static applyInverseTransform(Y, G) {
              const bt = G[0] * G[3] - G[1] * G[2], At = (Y[0] * G[3] - Y[1] * G[2] + G[2] * G[5] - G[4] * G[3]) / bt, te = (-Y[0] * G[1] + Y[1] * G[0] + G[4] * G[1] - G[5] * G[0]) / bt;
              return [At, te];
            }
            static getAxialAlignedBoundingBox(Y, G) {
              const bt = this.applyTransform(Y, G), At = this.applyTransform(Y.slice(2, 4), G), te = this.applyTransform([Y[0], Y[3]], G), Zt = this.applyTransform([Y[2], Y[1]], G);
              return [Math.min(bt[0], At[0], te[0], Zt[0]), Math.min(bt[1], At[1], te[1], Zt[1]), Math.max(bt[0], At[0], te[0], Zt[0]), Math.max(bt[1], At[1], te[1], Zt[1])];
            }
            static inverseTransform(Y) {
              const G = Y[0] * Y[3] - Y[1] * Y[2];
              return [Y[3] / G, -Y[1] / G, -Y[2] / G, Y[0] / G, (Y[2] * Y[5] - Y[4] * Y[3]) / G, (Y[4] * Y[1] - Y[5] * Y[0]) / G];
            }
            static singularValueDecompose2dScale(Y) {
              const G = [Y[0], Y[2], Y[1], Y[3]], bt = Y[0] * G[0] + Y[1] * G[2], At = Y[0] * G[1] + Y[1] * G[3], te = Y[2] * G[0] + Y[3] * G[2], Zt = Y[2] * G[1] + Y[3] * G[3], $ = (bt + Zt) / 2, vt = Math.sqrt((bt + Zt) ** 2 - 4 * (bt * Zt - te * At)) / 2, Lt = $ + vt || 1, Tt = $ - vt || 1;
              return [Math.sqrt(Lt), Math.sqrt(Tt)];
            }
            static normalizeRect(Y) {
              const G = Y.slice(0);
              return Y[0] > Y[2] && (G[0] = Y[2], G[2] = Y[0]), Y[1] > Y[3] && (G[1] = Y[3], G[3] = Y[1]), G;
            }
            static intersect(Y, G) {
              const bt = Math.max(Math.min(Y[0], Y[2]), Math.min(G[0], G[2])), At = Math.min(Math.max(Y[0], Y[2]), Math.max(G[0], G[2]));
              if (bt > At)
                return null;
              const te = Math.max(Math.min(Y[1], Y[3]), Math.min(G[1], G[3])), Zt = Math.min(Math.max(Y[1], Y[3]), Math.max(G[1], G[3]));
              return te > Zt ? null : [bt, te, At, Zt];
            }
            static bezierBoundingBox(Y, G, bt, At, te, Zt, $, vt) {
              const Lt = [], Tt = [[], []];
              let Ot, Nt, Jt, _t, Yt, It, R, e;
              for (let q = 0; q < 2; ++q) {
                if (q === 0 ? (Nt = 6 * Y - 12 * bt + 6 * te, Ot = -3 * Y + 9 * bt - 9 * te + 3 * $, Jt = 3 * bt - 3 * Y) : (Nt = 6 * G - 12 * At + 6 * Zt, Ot = -3 * G + 9 * At - 9 * Zt + 3 * vt, Jt = 3 * At - 3 * G), Math.abs(Ot) < 1e-12) {
                  if (Math.abs(Nt) < 1e-12)
                    continue;
                  _t = -Jt / Nt, 0 < _t && _t < 1 && Lt.push(_t);
                  continue;
                }
                R = Nt * Nt - 4 * Jt * Ot, e = Math.sqrt(R), !(R < 0) && (Yt = (-Nt + e) / (2 * Ot), 0 < Yt && Yt < 1 && Lt.push(Yt), It = (-Nt - e) / (2 * Ot), 0 < It && It < 1 && Lt.push(It));
              }
              let f = Lt.length, D;
              const j = f;
              for (; f--; )
                _t = Lt[f], D = 1 - _t, Tt[0][f] = D * D * D * Y + 3 * D * D * _t * bt + 3 * D * _t * _t * te + _t * _t * _t * $, Tt[1][f] = D * D * D * G + 3 * D * D * _t * At + 3 * D * _t * _t * Zt + _t * _t * _t * vt;
              return Tt[0][j] = Y, Tt[1][j] = G, Tt[0][j + 1] = $, Tt[1][j + 1] = vt, Tt[0].length = Tt[1].length = j + 2, [Math.min(...Tt[0]), Math.min(...Tt[1]), Math.max(...Tt[0]), Math.max(...Tt[1])];
            }
          }
          d.Util = St;
          const Dt = [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 ft(ot) {
            if (ot[0] >= "ï") {
              let G;
              if (ot[0] === "þ" && ot[1] === "ÿ" ? G = "utf-16be" : ot[0] === "ÿ" && ot[1] === "þ" ? G = "utf-16le" : ot[0] === "ï" && ot[1] === "»" && ot[2] === "¿" && (G = "utf-8"), G)
                try {
                  const bt = new TextDecoder(G, {
                    fatal: !0
                  }), At = tt(ot);
                  return bt.decode(At);
                } catch (bt) {
                  at(`stringToPDFString: "${bt}".`);
                }
            }
            const Y = [];
            for (let G = 0, bt = ot.length; G < bt; G++) {
              const At = Dt[ot.charCodeAt(G)];
              Y.push(At ? String.fromCharCode(At) : ot.charAt(G));
            }
            return Y.join("");
          }
          function K(ot) {
            return decodeURIComponent(escape(ot));
          }
          function J(ot) {
            return unescape(encodeURIComponent(ot));
          }
          function ht(ot) {
            return typeof ot == "object" && (ot == null ? void 0 : ot.byteLength) !== void 0;
          }
          function Et(ot, Y) {
            if (ot.length !== Y.length)
              return !1;
            for (let G = 0, bt = ot.length; G < bt; G++)
              if (ot[G] !== Y[G])
                return !1;
            return !0;
          }
          function Ct(ot = /* @__PURE__ */ new Date()) {
            return [ot.getUTCFullYear().toString(), (ot.getUTCMonth() + 1).toString().padStart(2, "0"), ot.getUTCDate().toString().padStart(2, "0"), ot.getUTCHours().toString().padStart(2, "0"), ot.getUTCMinutes().toString().padStart(2, "0"), ot.getUTCSeconds().toString().padStart(2, "0")].join("");
          }
          class Ut {
            constructor() {
              I(this, $t, !1);
              this.promise = new Promise((Y, G) => {
                this.resolve = (bt) => {
                  Z(this, $t, !0), Y(bt);
                }, this.reject = (bt) => {
                  Z(this, $t, !0), G(bt);
                };
              });
            }
            get settled() {
              return t(this, $t);
            }
          }
          $t = new WeakMap(), d.PromiseCapability = Ut;
          let Gt = null, Ht = null;
          function Xt(ot) {
            return Gt || (Gt = /([\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, Ht = /* @__PURE__ */ new Map([["ﬅ", "ſt"]])), ot.replaceAll(Gt, (Y, G, bt) => G ? G.normalize("NFKC") : Ht.get(bt));
          }
          function Vt() {
            if (typeof crypto < "u" && typeof (crypto == null ? void 0 : crypto.randomUUID) == "function")
              return crypto.randomUUID();
            const ot = new Uint8Array(32);
            if (typeof crypto < "u" && typeof (crypto == null ? void 0 : crypto.getRandomValues) == "function")
              crypto.getRandomValues(ot);
            else
              for (let Y = 0; Y < 32; Y++)
                ot[Y] = Math.floor(Math.random() * 255);
            return N(ot);
          }
          const Wt = "pdfjs_internal_id_";
          d.AnnotationPrefix = Wt;
        },
        /* 2 */
        /***/
        (__unused_webpack_module, exports, __w_pdfjs_require__) => {
          var dt, et, c, P, he, X, Ee, B, F, g, L, O, T, v, A, u, we, E, w, Be, a, l;
          Object.defineProperty(exports, "__esModule", {
            value: !0
          }), exports.RenderTask = exports.PDFWorkerUtil = exports.PDFWorker = exports.PDFPageProxy = exports.PDFDocumentProxy = exports.PDFDocumentLoadingTask = exports.PDFDataRangeTransport = exports.LoopbackPort = exports.DefaultStandardFontDataFactory = exports.DefaultFilterFactory = exports.DefaultCanvasFactory = exports.DefaultCMapReaderFactory = void 0, Object.defineProperty(exports, "SVGGraphics", {
            enumerable: !0,
            get: function() {
              return _displaySvg.SVGGraphics;
            }
          }), exports.build = void 0, exports.getDocument = getDocument, exports.version = void 0;
          var _util = __w_pdfjs_require__(1), _annotation_storage = __w_pdfjs_require__(3), _display_utils = __w_pdfjs_require__(6), _font_loader = __w_pdfjs_require__(9), _displayNode_utils = __w_pdfjs_require__(10), _canvas = __w_pdfjs_require__(11), _worker_options = __w_pdfjs_require__(14), _message_handler = __w_pdfjs_require__(15), _metadata = __w_pdfjs_require__(16), _optional_content_config = __w_pdfjs_require__(17), _transport_stream = __w_pdfjs_require__(18), _displayFetch_stream = __w_pdfjs_require__(19), _displayNetwork = __w_pdfjs_require__(22), _displayNode_stream = __w_pdfjs_require__(23), _displaySvg = __w_pdfjs_require__(24), _xfa_text = __w_pdfjs_require__(25);
          const DEFAULT_RANGE_CHUNK_SIZE = 65536, RENDERING_CANCELLED_TIMEOUT = 100, DELAYED_CLEANUP_TIMEOUT = 5e3, DefaultCanvasFactory = _util.isNodeJS ? _displayNode_utils.NodeCanvasFactory : _display_utils.DOMCanvasFactory;
          exports.DefaultCanvasFactory = DefaultCanvasFactory;
          const DefaultCMapReaderFactory = _util.isNodeJS ? _displayNode_utils.NodeCMapReaderFactory : _display_utils.DOMCMapReaderFactory;
          exports.DefaultCMapReaderFactory = DefaultCMapReaderFactory;
          const DefaultFilterFactory = _util.isNodeJS ? _displayNode_utils.NodeFilterFactory : _display_utils.DOMFilterFactory;
          exports.DefaultFilterFactory = DefaultFilterFactory;
          const DefaultStandardFontDataFactory = _util.isNodeJS ? _displayNode_utils.NodeStandardFontDataFactory : _display_utils.DOMStandardFontDataFactory;
          exports.DefaultStandardFontDataFactory = DefaultStandardFontDataFactory;
          function getDocument(p) {
            if (typeof p == "string" || p instanceof URL ? p = {
              url: p
            } : (0, _util.isArrayBuffer)(p) && (p = {
              data: p
            }), typeof p != "object")
              throw new Error("Invalid parameter in getDocument, need parameter object.");
            if (!p.url && !p.data && !p.range)
              throw new Error("Invalid parameter object: need either .data, .range or .url");
            const r = new PDFDocumentLoadingTask(), {
              docId: x
            } = r, m = p.url ? getUrlProp(p.url) : null, U = p.data ? getDataProp(p.data) : null, z = p.httpHeaders || null, C = p.withCredentials === !0, V = p.password ?? null, st = p.range instanceof PDFDataRangeTransport ? p.range : null, at = Number.isInteger(p.rangeChunkSize) && p.rangeChunkSize > 0 ? p.rangeChunkSize : DEFAULT_RANGE_CHUNK_SIZE;
            let H = p.worker instanceof PDFWorker ? p.worker : null;
            const lt = p.verbosity, gt = typeof p.docBaseUrl == "string" && !(0, _display_utils.isDataScheme)(p.docBaseUrl) ? p.docBaseUrl : null, wt = typeof p.cMapUrl == "string" ? p.cMapUrl : null, Pt = p.cMapPacked !== !1, S = p.CMapReaderFactory || DefaultCMapReaderFactory, i = typeof p.standardFontDataUrl == "string" ? p.standardFontDataUrl : null, n = p.StandardFontDataFactory || DefaultStandardFontDataFactory, s = p.stopAtErrors !== !0, o = Number.isInteger(p.maxImageSize) && p.maxImageSize > -1 ? p.maxImageSize : -1, h = p.isEvalSupported !== !1, _ = typeof p.isOffscreenCanvasSupported == "boolean" ? p.isOffscreenCanvasSupported : !_util.isNodeJS, M = Number.isInteger(p.canvasMaxAreaInBytes) ? p.canvasMaxAreaInBytes : -1, N = typeof p.disableFontFace == "boolean" ? p.disableFontFace : _util.isNodeJS, tt = p.fontExtraProperties === !0, Q = p.enableXfa === !0, nt = p.ownerDocument || globalThis.document, ct = p.disableRange === !0, yt = p.disableStream === !0, ut = p.disableAutoFetch === !0, Ft = p.pdfBug === !0, Bt = st ? st.length : p.length ?? NaN, St = typeof p.useSystemFonts == "boolean" ? p.useSystemFonts : !_util.isNodeJS && !N, Dt = typeof p.useWorkerFetch == "boolean" ? p.useWorkerFetch : S === _display_utils.DOMCMapReaderFactory && n === _display_utils.DOMStandardFontDataFactory && wt && i && (0, _display_utils.isValidFetchUrl)(wt, document.baseURI) && (0, _display_utils.isValidFetchUrl)(i, document.baseURI), ft = p.canvasFactory || new DefaultCanvasFactory({
              ownerDocument: nt
            }), K = p.filterFactory || new DefaultFilterFactory({
              docId: x,
              ownerDocument: nt
            }), J = null;
            (0, _util.setVerbosityLevel)(lt);
            const ht = {
              canvasFactory: ft,
              filterFactory: K
            };
            if (Dt || (ht.cMapReaderFactory = new S({
              baseUrl: wt,
              isCompressed: Pt
            }), ht.standardFontDataFactory = new n({
              baseUrl: i
            })), !H) {
              const Ut = {
                verbosity: lt,
                port: _worker_options.GlobalWorkerOptions.workerPort
              };
              H = Ut.port ? PDFWorker.fromPort(Ut) : new PDFWorker(Ut), r._worker = H;
            }
            const Et = {
              docId: x,
              apiVersion: "3.11.174",
              data: U,
              password: V,
              disableAutoFetch: ut,
              rangeChunkSize: at,
              length: Bt,
              docBaseUrl: gt,
              enableXfa: Q,
              evaluatorOptions: {
                maxImageSize: o,
                disableFontFace: N,
                ignoreErrors: s,
                isEvalSupported: h,
                isOffscreenCanvasSupported: _,
                canvasMaxAreaInBytes: M,
                fontExtraProperties: tt,
                useSystemFonts: St,
                cMapUrl: Dt ? wt : null,
                standardFontDataUrl: Dt ? i : null
              }
            }, Ct = {
              ignoreErrors: s,
              isEvalSupported: h,
              disableFontFace: N,
              fontExtraProperties: tt,
              enableXfa: Q,
              ownerDocument: nt,
              disableAutoFetch: ut,
              pdfBug: Ft,
              styleElement: J
            };
            return H.promise.then(function() {
              if (r.destroyed)
                throw new Error("Loading aborted");
              const Ut = _fetchDocument(H, Et), Gt = new Promise(function(Ht) {
                let Xt;
                st ? Xt = new _transport_stream.PDFDataTransportStream({
                  length: Bt,
                  initialData: st.initialData,
                  progressiveDone: st.progressiveDone,
                  contentDispositionFilename: st.contentDispositionFilename,
                  disableRange: ct,
                  disableStream: yt
                }, st) : U || (Xt = ((Wt) => _util.isNodeJS ? new _displayNode_stream.PDFNodeStream(Wt) : (0, _display_utils.isValidFetchUrl)(Wt.url) ? new _displayFetch_stream.PDFFetchStream(Wt) : new _displayNetwork.PDFNetworkStream(Wt))({
                  url: m,
                  length: Bt,
                  httpHeaders: z,
                  withCredentials: C,
                  rangeChunkSize: at,
                  disableRange: ct,
                  disableStream: yt
                })), Ht(Xt);
              });
              return Promise.all([Ut, Gt]).then(function([Ht, Xt]) {
                if (r.destroyed)
                  throw new Error("Loading aborted");
                const Vt = new _message_handler.MessageHandler(x, Ht, H.port), Wt = new WorkerTransport(Vt, r, Xt, Ct, ht);
                r._transport = Wt, Vt.send("Ready", null);
              });
            }).catch(r._capability.reject), r;
          }
          async function _fetchDocument(p, r) {
            if (p.destroyed)
              throw new Error("Worker was destroyed");
            const x = await p.messageHandler.sendWithPromise("GetDocRequest", r, r.data ? [r.data.buffer] : null);
            if (p.destroyed)
              throw new Error("Worker was destroyed");
            return x;
          }
          function getUrlProp(p) {
            if (p instanceof URL)
              return p.href;
            try {
              return new URL(p, window.location).href;
            } catch {
              if (_util.isNodeJS && typeof p == "string")
                return p;
            }
            throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.");
          }
          function getDataProp(p) {
            if (_util.isNodeJS && typeof Buffer < "u" && p instanceof Buffer)
              throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");
            if (p instanceof Uint8Array && p.byteLength === p.buffer.byteLength)
              return p;
            if (typeof p == "string")
              return (0, _util.stringToBytes)(p);
            if (typeof p == "object" && !isNaN(p == null ? void 0 : p.length) || (0, _util.isArrayBuffer)(p))
              return new Uint8Array(p);
            throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.");
          }
          const d = class d {
            constructor() {
              this._capability = new _util.PromiseCapability(), this._transport = null, this._worker = null, this.docId = `d${ge(d, dt)._++}`, this.destroyed = !1, this.onPassword = null, this.onProgress = null;
            }
            get promise() {
              return this._capability.promise;
            }
            async destroy() {
              var r, x, m;
              this.destroyed = !0;
              try {
                (r = this._worker) != null && r.port && (this._worker._pendingDestroy = !0), await ((x = this._transport) == null ? void 0 : x.destroy());
              } catch (U) {
                throw (m = this._worker) != null && m.port && delete this._worker._pendingDestroy, U;
              }
              this._transport = null, this._worker && (this._worker.destroy(), this._worker = null);
            }
          };
          dt = new WeakMap(), I(d, dt, 0);
          let PDFDocumentLoadingTask = d;
          exports.PDFDocumentLoadingTask = PDFDocumentLoadingTask;
          class PDFDataRangeTransport {
            constructor(r, x, m = !1, U = null) {
              this.length = r, this.initialData = x, this.progressiveDone = m, this.contentDispositionFilename = U, this._rangeListeners = [], this._progressListeners = [], this._progressiveReadListeners = [], this._progressiveDoneListeners = [], this._readyCapability = new _util.PromiseCapability();
            }
            addRangeListener(r) {
              this._rangeListeners.push(r);
            }
            addProgressListener(r) {
              this._progressListeners.push(r);
            }
            addProgressiveReadListener(r) {
              this._progressiveReadListeners.push(r);
            }
            addProgressiveDoneListener(r) {
              this._progressiveDoneListeners.push(r);
            }
            onDataRange(r, x) {
              for (const m of this._rangeListeners)
                m(r, x);
            }
            onDataProgress(r, x) {
              this._readyCapability.promise.then(() => {
                for (const m of this._progressListeners)
                  m(r, x);
              });
            }
            onDataProgressiveRead(r) {
              this._readyCapability.promise.then(() => {
                for (const x of this._progressiveReadListeners)
                  x(r);
              });
            }
            onDataProgressiveDone() {
              this._readyCapability.promise.then(() => {
                for (const r of this._progressiveDoneListeners)
                  r();
              });
            }
            transportReady() {
              this._readyCapability.resolve();
            }
            requestDataRange(r, x) {
              (0, _util.unreachable)("Abstract method PDFDataRangeTransport.requestDataRange");
            }
            abort() {
            }
          }
          exports.PDFDataRangeTransport = PDFDataRangeTransport;
          class PDFDocumentProxy {
            constructor(r, x) {
              this._pdfInfo = r, this._transport = x, Object.defineProperty(this, "getJavaScript", {
                value: () => ((0, _display_utils.deprecated)("`PDFDocumentProxy.getJavaScript`, please use `PDFDocumentProxy.getJSActions` instead."), this.getJSActions().then((m) => {
                  if (!m)
                    return m;
                  const U = [];
                  for (const z in m)
                    U.push(...m[z]);
                  return U;
                }))
              });
            }
            get annotationStorage() {
              return this._transport.annotationStorage;
            }
            get filterFactory() {
              return this._transport.filterFactory;
            }
            get numPages() {
              return this._pdfInfo.numPages;
            }
            get fingerprints() {
              return this._pdfInfo.fingerprints;
            }
            get isPureXfa() {
              return (0, _util.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa);
            }
            get allXfaHtml() {
              return this._transport._htmlForXfa;
            }
            getPage(r) {
              return this._transport.getPage(r);
            }
            getPageIndex(r) {
              return this._transport.getPageIndex(r);
            }
            getDestinations() {
              return this._transport.getDestinations();
            }
            getDestination(r) {
              return this._transport.getDestination(r);
            }
            getPageLabels() {
              return this._transport.getPageLabels();
            }
            getPageLayout() {
              return this._transport.getPageLayout();
            }
            getPageMode() {
              return this._transport.getPageMode();
            }
            getViewerPreferences() {
              return this._transport.getViewerPreferences();
            }
            getOpenAction() {
              return this._transport.getOpenAction();
            }
            getAttachments() {
              return this._transport.getAttachments();
            }
            getJSActions() {
              return this._transport.getDocJSActions();
            }
            getOutline() {
              return this._transport.getOutline();
            }
            getOptionalContentConfig() {
              return this._transport.getOptionalContentConfig();
            }
            getPermissions() {
              return this._transport.getPermissions();
            }
            getMetadata() {
              return this._transport.getMetadata();
            }
            getMarkInfo() {
              return this._transport.getMarkInfo();
            }
            getData() {
              return this._transport.getData();
            }
            saveDocument() {
              return this._transport.saveDocument();
            }
            getDownloadInfo() {
              return this._transport.downloadInfoCapability.promise;
            }
            cleanup(r = !1) {
              return this._transport.startCleanup(r || this.isPureXfa);
            }
            destroy() {
              return this.loadingTask.destroy();
            }
            get loadingParams() {
              return this._transport.loadingParams;
            }
            get loadingTask() {
              return this._transport.loadingTask;
            }
            getFieldObjects() {
              return this._transport.getFieldObjects();
            }
            hasJSActions() {
              return this._transport.hasJSActions();
            }
            getCalculationOrderIds() {
              return this._transport.getCalculationOrderIds();
            }
          }
          exports.PDFDocumentProxy = PDFDocumentProxy;
          class PDFPageProxy {
            constructor(r, x, m, U = !1) {
              I(this, P);
              I(this, X);
              I(this, et, null);
              I(this, c, !1);
              this._pageIndex = r, this._pageInfo = x, this._transport = m, this._stats = U ? new _display_utils.StatTimer() : null, this._pdfBug = U, this.commonObjs = m.commonObjs, this.objs = new PDFObjects(), this._maybeCleanupAfterRender = !1, this._intentStates = /* @__PURE__ */ new Map(), this.destroyed = !1;
            }
            get pageNumber() {
              return this._pageIndex + 1;
            }
            get rotate() {
              return this._pageInfo.rotate;
            }
            get ref() {
              return this._pageInfo.ref;
            }
            get userUnit() {
              return this._pageInfo.userUnit;
            }
            get view() {
              return this._pageInfo.view;
            }
            getViewport({
              scale: r,
              rotation: x = this.rotate,
              offsetX: m = 0,
              offsetY: U = 0,
              dontFlip: z = !1
            } = {}) {
              return new _display_utils.PageViewport({
                viewBox: this.view,
                scale: r,
                rotation: x,
                offsetX: m,
                offsetY: U,
                dontFlip: z
              });
            }
            getAnnotations({
              intent: r = "display"
            } = {}) {
              const x = this._transport.getRenderingIntent(r);
              return this._transport.getAnnotations(this._pageIndex, x.renderingIntent);
            }
            getJSActions() {
              return this._transport.getPageJSActions(this._pageIndex);
            }
            get filterFactory() {
              return this._transport.filterFactory;
            }
            get isPureXfa() {
              return (0, _util.shadow)(this, "isPureXfa", !!this._transport._htmlForXfa);
            }
            async getXfa() {
              var r;
              return ((r = this._transport._htmlForXfa) == null ? void 0 : r.children[this._pageIndex]) || null;
            }
            render({
              canvasContext: r,
              viewport: x,
              intent: m = "display",
              annotationMode: U = _util.AnnotationMode.ENABLE,
              transform: z = null,
              background: C = null,
              optionalContentConfigPromise: V = null,
              annotationCanvasMap: st = null,
              pageColors: at = null,
              printAnnotationStorage: H = null
            }) {
              var n, s;
              (n = this._stats) == null || n.time("Overall");
              const lt = this._transport.getRenderingIntent(m, U, H);
              Z(this, c, !1), W(this, X, Ee).call(this), V || (V = this._transport.getOptionalContentConfig());
              let gt = this._intentStates.get(lt.cacheKey);
              gt || (gt = /* @__PURE__ */ Object.create(null), this._intentStates.set(lt.cacheKey, gt)), gt.streamReaderCancelTimeout && (clearTimeout(gt.streamReaderCancelTimeout), gt.streamReaderCancelTimeout = null);
              const wt = !!(lt.renderingIntent & _util.RenderingIntentFlag.PRINT);
              gt.displayReadyCapability || (gt.displayReadyCapability = new _util.PromiseCapability(), gt.operatorList = {
                fnArray: [],
                argsArray: [],
                lastChunk: !1,
                separateAnnots: null
              }, (s = this._stats) == null || s.time("Page Request"), this._pumpOperatorList(lt));
              const Pt = (o) => {
                var h, _;
                gt.renderTasks.delete(S), (this._maybeCleanupAfterRender || wt) && Z(this, c, !0), W(this, P, he).call(this, !wt), o ? (S.capability.reject(o), this._abortOperatorList({
                  intentState: gt,
                  reason: o instanceof Error ? o : new Error(o)
                })) : S.capability.resolve(), (h = this._stats) == null || h.timeEnd("Rendering"), (_ = this._stats) == null || _.timeEnd("Overall");
              }, S = new InternalRenderTask({
                callback: Pt,
                params: {
                  canvasContext: r,
                  viewport: x,
                  transform: z,
                  background: C
                },
                objs: this.objs,
                commonObjs: this.commonObjs,
                annotationCanvasMap: st,
                operatorList: gt.operatorList,
                pageIndex: this._pageIndex,
                canvasFactory: this._transport.canvasFactory,
                filterFactory: this._transport.filterFactory,
                useRequestAnimationFrame: !wt,
                pdfBug: this._pdfBug,
                pageColors: at
              });
              (gt.renderTasks || (gt.renderTasks = /* @__PURE__ */ new Set())).add(S);
              const i = S.task;
              return Promise.all([gt.displayReadyCapability.promise, V]).then(([o, h]) => {
                var _;
                if (this.destroyed) {
                  Pt();
                  return;
                }
                (_ = this._stats) == null || _.time("Rendering"), S.initializeGraphics({
                  transparency: o,
                  optionalContentConfig: h
                }), S.operatorListChanged();
              }).catch(Pt), i;
            }
            getOperatorList({
              intent: r = "display",
              annotationMode: x = _util.AnnotationMode.ENABLE,
              printAnnotationStorage: m = null
            } = {}) {
              var st;
              function U() {
                C.operatorList.lastChunk && (C.opListReadCapability.resolve(C.operatorList), C.renderTasks.delete(V));
              }
              const z = this._transport.getRenderingIntent(r, x, m, !0);
              let C = this._intentStates.get(z.cacheKey);
              C || (C = /* @__PURE__ */ Object.create(null), this._intentStates.set(z.cacheKey, C));
              let V;
              return C.opListReadCapability || (V = /* @__PURE__ */ Object.create(null), V.operatorListChanged = U, C.opListReadCapability = new _util.PromiseCapability(), (C.renderTasks || (C.renderTasks = /* @__PURE__ */ new Set())).add(V), C.operatorList = {
                fnArray: [],
                argsArray: [],
                lastChunk: !1,
                separateAnnots: null
              }, (st = this._stats) == null || st.time("Page Request"), this._pumpOperatorList(z)), C.opListReadCapability.promise;
            }
            streamTextContent({
              includeMarkedContent: r = !1,
              disableNormalization: x = !1
            } = {}) {
              return this._transport.messageHandler.sendWithStream("GetTextContent", {
                pageIndex: this._pageIndex,
                includeMarkedContent: r === !0,
                disableNormalization: x === !0
              }, {
                highWaterMark: 100,
                size(U) {
                  return U.items.length;
                }
              });
            }
            getTextContent(r = {}) {
              if (this._transport._htmlForXfa)
                return this.getXfa().then((m) => _xfa_text.XfaText.textContent(m));
              const x = this.streamTextContent(r);
              return new Promise(function(m, U) {
                function z() {
                  C.read().then(function({
                    value: st,
                    done: at
                  }) {
                    if (at) {
                      m(V);
                      return;
                    }
                    Object.assign(V.styles, st.styles), V.items.push(...st.items), z();
                  }, U);
                }
                const C = x.getReader(), V = {
                  items: [],
                  styles: /* @__PURE__ */ Object.create(null)
                };
                z();
              });
            }
            getStructTree() {
              return this._transport.getStructTree(this._pageIndex);
            }
            _destroy() {
              this.destroyed = !0;
              const r = [];
              for (const x of this._intentStates.values())
                if (this._abortOperatorList({
                  intentState: x,
                  reason: new Error("Page was destroyed."),
                  force: !0
                }), !x.opListReadCapability)
                  for (const m of x.renderTasks)
                    r.push(m.completed), m.cancel();
              return this.objs.clear(), Z(this, c, !1), W(this, X, Ee).call(this), Promise.all(r);
            }
            cleanup(r = !1) {
              Z(this, c, !0);
              const x = W(this, P, he).call(this, !1);
              return r && x && this._stats && (this._stats = new _display_utils.StatTimer()), x;
            }
            _startRenderPage(r, x) {
              var U, z;
              const m = this._intentStates.get(x);
              m && ((U = this._stats) == null || U.timeEnd("Page Request"), (z = m.displayReadyCapability) == null || z.resolve(r));
            }
            _renderPageChunk(r, x) {
              for (let m = 0, U = r.length; m < U; m++)
                x.operatorList.fnArray.push(r.fnArray[m]), x.operatorList.argsArray.push(r.argsArray[m]);
              x.operatorList.lastChunk = r.lastChunk, x.operatorList.separateAnnots = r.separateAnnots;
              for (const m of x.renderTasks)
                m.operatorListChanged();
              r.lastChunk && W(this, P, he).call(this, !0);
            }
            _pumpOperatorList({
              renderingIntent: r,
              cacheKey: x,
              annotationStorageSerializable: m
            }) {
              const {
                map: U,
                transfers: z
              } = m, V = this._transport.messageHandler.sendWithStream("GetOperatorList", {
                pageIndex: this._pageIndex,
                intent: r,
                cacheKey: x,
                annotationStorage: U
              }, z).getReader(), st = this._intentStates.get(x);
              st.streamReader = V;
              const at = () => {
                V.read().then(({
                  value: H,
                  done: lt
                }) => {
                  if (lt) {
                    st.streamReader = null;
                    return;
                  }
                  this._transport.destroyed || (this._renderPageChunk(H, st), at());
                }, (H) => {
                  if (st.streamReader = null, !this._transport.destroyed) {
                    if (st.operatorList) {
                      st.operatorList.lastChunk = !0;
                      for (const lt of st.renderTasks)
                        lt.operatorListChanged();
                      W(this, P, he).call(this, !0);
                    }
                    if (st.displayReadyCapability)
                      st.displayReadyCapability.reject(H);
                    else if (st.opListReadCapability)
                      st.opListReadCapability.reject(H);
                    else
                      throw H;
                  }
                });
              };
              at();
            }
            _abortOperatorList({
              intentState: r,
              reason: x,
              force: m = !1
            }) {
              if (r.streamReader) {
                if (r.streamReaderCancelTimeout && (clearTimeout(r.streamReaderCancelTimeout), r.streamReaderCancelTimeout = null), !m) {
                  if (r.renderTasks.size > 0)
                    return;
                  if (x instanceof _display_utils.RenderingCancelledException) {
                    let U = RENDERING_CANCELLED_TIMEOUT;
                    x.extraDelay > 0 && x.extraDelay < 1e3 && (U += x.extraDelay), r.streamReaderCancelTimeout = setTimeout(() => {
                      r.streamReaderCancelTimeout = null, this._abortOperatorList({
                        intentState: r,
                        reason: x,
                        force: !0
                      });
                    }, U);
                    return;
                  }
                }
                if (r.streamReader.cancel(new _util.AbortException(x.message)).catch(() => {
                }), r.streamReader = null, !this._transport.destroyed) {
                  for (const [U, z] of this._intentStates)
                    if (z === r) {
                      this._intentStates.delete(U);
                      break;
                    }
                  this.cleanup();
                }
              }
            }
            get stats() {
              return this._stats;
            }
          }
          et = new WeakMap(), c = new WeakMap(), P = new WeakSet(), he = function(r = !1) {
            if (W(this, X, Ee).call(this), !t(this, c) || this.destroyed)
              return !1;
            if (r)
              return Z(this, et, setTimeout(() => {
                Z(this, et, null), W(this, P, he).call(this, !1);
              }, DELAYED_CLEANUP_TIMEOUT)), !1;
            for (const {
              renderTasks: x,
              operatorList: m
            } of this._intentStates.values())
              if (x.size > 0 || !m.lastChunk)
                return !1;
            return this._intentStates.clear(), this.objs.clear(), Z(this, c, !1), !0;
          }, X = new WeakSet(), Ee = function() {
            t(this, et) && (clearTimeout(t(this, et)), Z(this, et, null));
          }, exports.PDFPageProxy = PDFPageProxy;
          class LoopbackPort {
            constructor() {
              I(this, B, /* @__PURE__ */ new Set());
              I(this, F, Promise.resolve());
            }
            postMessage(r, x) {
              const m = {
                data: structuredClone(r, x ? {
                  transfer: x
                } : null)
              };
              t(this, F).then(() => {
                for (const U of t(this, B))
                  U.call(this, m);
              });
            }
            addEventListener(r, x) {
              t(this, B).add(x);
            }
            removeEventListener(r, x) {
              t(this, B).delete(x);
            }
            terminate() {
              t(this, B).clear();
            }
          }
          B = new WeakMap(), F = new WeakMap(), exports.LoopbackPort = LoopbackPort;
          const PDFWorkerUtil = {
            isWorkerDisabled: !1,
            fallbackWorkerSrc: null,
            fakeWorkerId: 0
          };
          exports.PDFWorkerUtil = PDFWorkerUtil;
          {
            if (_util.isNodeJS && typeof commonjsRequire == "function")
              PDFWorkerUtil.isWorkerDisabled = !0, PDFWorkerUtil.fallbackWorkerSrc = "./pdf.worker.js";
            else if (typeof document == "object") {
              const p = (g = document == null ? void 0 : document.currentScript) == null ? void 0 : g.src;
              p && (PDFWorkerUtil.fallbackWorkerSrc = p.replace(/(\.(?:min\.)?js)(\?.*)?$/i, ".worker$1$2"));
            }
            PDFWorkerUtil.isSameOrigin = function(p, r) {
              let x;
              try {
                if (x = new URL(p), !x.origin || x.origin === "null")
                  return !1;
              } catch {
                return !1;
              }
              const m = new URL(r, x);
              return x.origin === m.origin;
            }, PDFWorkerUtil.createCDNWrapper = function(p) {
              const r = `importScripts("${p}");`;
              return URL.createObjectURL(new Blob([r]));
            };
          }
          const _PDFWorker = class _PDFWorker {
            constructor({
              name: p = null,
              port: r = null,
              verbosity: x = (0, _util.getVerbosityLevel)()
            } = {}) {
              var m;
              if (this.name = p, this.destroyed = !1, this.verbosity = x, this._readyCapability = new _util.PromiseCapability(), this._port = null, this._webWorker = null, this._messageHandler = null, r) {
                if ((m = t(_PDFWorker, L)) != null && m.has(r))
                  throw new Error("Cannot use more than one PDFWorker per port.");
                (t(_PDFWorker, L) || Z(_PDFWorker, L, /* @__PURE__ */ new WeakMap())).set(r, this), this._initializeFromPort(r);
                return;
              }
              this._initialize();
            }
            get promise() {
              return this._readyCapability.promise;
            }
            get port() {
              return this._port;
            }
            get messageHandler() {
              return this._messageHandler;
            }
            _initializeFromPort(p) {
              this._port = p, this._messageHandler = new _message_handler.MessageHandler("main", "worker", p), this._messageHandler.on("ready", function() {
              }), this._readyCapability.resolve(), this._messageHandler.send("configure", {
                verbosity: this.verbosity
              });
            }
            _initialize() {
              if (!PDFWorkerUtil.isWorkerDisabled && !_PDFWorker._mainThreadWorkerMessageHandler) {
                let {
                  workerSrc: p
                } = _PDFWorker;
                try {
                  PDFWorkerUtil.isSameOrigin(window.location.href, p) || (p = PDFWorkerUtil.createCDNWrapper(new URL(p, window.location).href));
                  const r = new Worker(p), x = new _message_handler.MessageHandler("main", "worker", r), m = () => {
                    r.removeEventListener("error", U), x.destroy(), r.terminate(), this.destroyed ? this._readyCapability.reject(new Error("Worker was destroyed")) : this._setupFakeWorker();
                  }, U = () => {
                    this._webWorker || m();
                  };
                  r.addEventListener("error", U), x.on("test", (C) => {
                    if (r.removeEventListener("error", U), this.destroyed) {
                      m();
                      return;
                    }
                    C ? (this._messageHandler = x, this._port = r, this._webWorker = r, this._readyCapability.resolve(), x.send("configure", {
                      verbosity: this.verbosity
                    })) : (this._setupFakeWorker(), x.destroy(), r.terminate());
                  }), x.on("ready", (C) => {
                    if (r.removeEventListener("error", U), this.destroyed) {
                      m();
                      return;
                    }
                    try {
                      z();
                    } catch {
                      this._setupFakeWorker();
                    }
                  });
                  const z = () => {
                    const C = new Uint8Array();
                    x.send("test", C, [C.buffer]);
                  };
                  z();
                  return;
                } catch {
                  (0, _util.info)("The worker has been disabled.");
                }
              }
              this._setupFakeWorker();
            }
            _setupFakeWorker() {
              PDFWorkerUtil.isWorkerDisabled || ((0, _util.warn)("Setting up fake worker."), PDFWorkerUtil.isWorkerDisabled = !0), _PDFWorker._setupFakeWorkerGlobal.then((p) => {
                if (this.destroyed) {
                  this._readyCapability.reject(new Error("Worker was destroyed"));
                  return;
                }
                const r = new LoopbackPort();
                this._port = r;
                const x = `fake${PDFWorkerUtil.fakeWorkerId++}`, m = new _message_handler.MessageHandler(x + "_worker", x, r);
                p.setup(m, r);
                const U = new _message_handler.MessageHandler(x, x + "_worker", r);
                this._messageHandler = U, this._readyCapability.resolve(), U.send("configure", {
                  verbosity: this.verbosity
                });
              }).catch((p) => {
                this._readyCapability.reject(new Error(`Setting up fake worker failed: "${p.message}".`));
              });
            }
            destroy() {
              var p;
              this.destroyed = !0, this._webWorker && (this._webWorker.terminate(), this._webWorker = null), (p = t(_PDFWorker, L)) == null || p.delete(this._port), this._port = null, this._messageHandler && (this._messageHandler.destroy(), this._messageHandler = null);
            }
            static fromPort(p) {
              var x;
              if (!(p != null && p.port))
                throw new Error("PDFWorker.fromPort - invalid method signature.");
              const r = (x = t(this, L)) == null ? void 0 : x.get(p.port);
              if (r) {
                if (r._pendingDestroy)
                  throw new Error("PDFWorker.fromPort - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");
                return r;
              }
              return new _PDFWorker(p);
            }
            static get workerSrc() {
              if (_worker_options.GlobalWorkerOptions.workerSrc)
                return _worker_options.GlobalWorkerOptions.workerSrc;
              if (PDFWorkerUtil.fallbackWorkerSrc !== null)
                return _util.isNodeJS || (0, _display_utils.deprecated)('No "GlobalWorkerOptions.workerSrc" specified.'), PDFWorkerUtil.fallbackWorkerSrc;
              throw new Error('No "GlobalWorkerOptions.workerSrc" specified.');
            }
            static get _mainThreadWorkerMessageHandler() {
              var p;
              try {
                return ((p = globalThis.pdfjsWorker) == null ? void 0 : p.WorkerMessageHandler) || null;
              } catch {
                return null;
              }
            }
            static get _setupFakeWorkerGlobal() {
              const loader = async () => {
                const mainWorkerMessageHandler = this._mainThreadWorkerMessageHandler;
                if (mainWorkerMessageHandler)
                  return mainWorkerMessageHandler;
                if (_util.isNodeJS && typeof commonjsRequire == "function") {
                  const worker = eval("require")(this.workerSrc);
                  return worker.WorkerMessageHandler;
                }
                return await (0, _display_utils.loadScript)(this.workerSrc), window.pdfjsWorker.WorkerMessageHandler;
              };
              return (0, _util.shadow)(this, "_setupFakeWorkerGlobal", loader());
            }
          };
          L = new WeakMap(), I(_PDFWorker, L, void 0);
          let PDFWorker = _PDFWorker;
          exports.PDFWorker = PDFWorker;
          class WorkerTransport {
            constructor(r, x, m, U, z) {
              I(this, u);
              I(this, O, /* @__PURE__ */ new Map());
              I(this, T, /* @__PURE__ */ new Map());
              I(this, v, /* @__PURE__ */ new Map());
              I(this, A, null);
              this.messageHandler = r, this.loadingTask = x, this.commonObjs = new PDFObjects(), this.fontLoader = new _font_loader.FontLoader({
                ownerDocument: U.ownerDocument,
                styleElement: U.styleElement
              }), this._params = U, this.canvasFactory = z.canvasFactory, this.filterFactory = z.filterFactory, this.cMapReaderFactory = z.cMapReaderFactory, this.standardFontDataFactory = z.standardFontDataFactory, this.destroyed = !1, this.destroyCapability = null, this._networkStream = m, this._fullReader = null, this._lastProgress = null, this.downloadInfoCapability = new _util.PromiseCapability(), this.setupMessageHandler();
            }
            get annotationStorage() {
              return (0, _util.shadow)(this, "annotationStorage", new _annotation_storage.AnnotationStorage());
            }
            getRenderingIntent(r, x = _util.AnnotationMode.ENABLE, m = null, U = !1) {
              let z = _util.RenderingIntentFlag.DISPLAY, C = _annotation_storage.SerializableEmpty;
              switch (r) {
                case "any":
                  z = _util.RenderingIntentFlag.ANY;
                  break;
                case "display":
                  break;
                case "print":
                  z = _util.RenderingIntentFlag.PRINT;
                  break;
                default:
                  (0, _util.warn)(`getRenderingIntent - invalid intent: ${r}`);
              }
              switch (x) {
                case _util.AnnotationMode.DISABLE:
                  z += _util.RenderingIntentFlag.ANNOTATIONS_DISABLE;
                  break;
                case _util.AnnotationMode.ENABLE:
                  break;
                case _util.AnnotationMode.ENABLE_FORMS:
                  z += _util.RenderingIntentFlag.ANNOTATIONS_FORMS;
                  break;
                case _util.AnnotationMode.ENABLE_STORAGE:
                  z += _util.RenderingIntentFlag.ANNOTATIONS_STORAGE, C = (z & _util.RenderingIntentFlag.PRINT && m instanceof _annotation_storage.PrintAnnotationStorage ? m : this.annotationStorage).serializable;
                  break;
                default:
                  (0, _util.warn)(`getRenderingIntent - invalid annotationMode: ${x}`);
              }
              return U && (z += _util.RenderingIntentFlag.OPLIST), {
                renderingIntent: z,
                cacheKey: `${z}_${C.hash}`,
                annotationStorageSerializable: C
              };
            }
            destroy() {
              var m;
              if (this.destroyCapability)
                return this.destroyCapability.promise;
              this.destroyed = !0, this.destroyCapability = new _util.PromiseCapability(), (m = t(this, A)) == null || m.reject(new Error("Worker was destroyed during onPassword callback"));
              const r = [];
              for (const U of t(this, T).values())
                r.push(U._destroy());
              t(this, T).clear(), t(this, v).clear(), this.hasOwnProperty("annotationStorage") && this.annotationStorage.resetModified();
              const x = this.messageHandler.sendWithPromise("Terminate", null);
              return r.push(x), Promise.all(r).then(() => {
                var U;
                this.commonObjs.clear(), this.fontLoader.clear(), t(this, O).clear(), this.filterFactory.destroy(), (U = this._networkStream) == null || U.cancelAllRequests(new _util.AbortException("Worker was terminated.")), this.messageHandler && (this.messageHandler.destroy(), this.messageHandler = null), this.destroyCapability.resolve();
              }, this.destroyCapability.reject), this.destroyCapability.promise;
            }
            setupMessageHandler() {
              const {
                messageHandler: r,
                loadingTask: x
              } = this;
              r.on("GetReader", (m, U) => {
                (0, _util.assert)(this._networkStream, "GetReader - no `IPDFStream` instance available."), this._fullReader = this._networkStream.getFullReader(), this._fullReader.onProgress = (z) => {
                  this._lastProgress = {
                    loaded: z.loaded,
                    total: z.total
                  };
                }, U.onPull = () => {
                  this._fullReader.read().then(function({
                    value: z,
                    done: C
                  }) {
                    if (C) {
                      U.close();
                      return;
                    }
                    (0, _util.assert)(z instanceof ArrayBuffer, "GetReader - expected an ArrayBuffer."), U.enqueue(new Uint8Array(z), 1, [z]);
                  }).catch((z) => {
                    U.error(z);
                  });
                }, U.onCancel = (z) => {
                  this._fullReader.cancel(z), U.ready.catch((C) => {
                    if (!this.destroyed)
                      throw C;
                  });
                };
              }), r.on("ReaderHeadersReady", (m) => {
                const U = new _util.PromiseCapability(), z = this._fullReader;
                return z.headersReady.then(() => {
                  var C;
                  (!z.isStreamingSupported || !z.isRangeSupported) && (this._lastProgress && ((C = x.onProgress) == null || C.call(x, this._lastProgress)), z.onProgress = (V) => {
                    var st;
                    (st = x.onProgress) == null || st.call(x, {
                      loaded: V.loaded,
                      total: V.total
                    });
                  }), U.resolve({
                    isStreamingSupported: z.isStreamingSupported,
                    isRangeSupported: z.isRangeSupported,
                    contentLength: z.contentLength
                  });
                }, U.reject), U.promise;
              }), r.on("GetRangeReader", (m, U) => {
                (0, _util.assert)(this._networkStream, "GetRangeReader - no `IPDFStream` instance available.");
                const z = this._networkStream.getRangeReader(m.begin, m.end);
                if (!z) {
                  U.close();
                  return;
                }
                U.onPull = () => {
                  z.read().then(function({
                    value: C,
                    done: V
                  }) {
                    if (V) {
                      U.close();
                      return;
                    }
                    (0, _util.assert)(C instanceof ArrayBuffer, "GetRangeReader - expected an ArrayBuffer."), U.enqueue(new Uint8Array(C), 1, [C]);
                  }).catch((C) => {
                    U.error(C);
                  });
                }, U.onCancel = (C) => {
                  z.cancel(C), U.ready.catch((V) => {
                    if (!this.destroyed)
                      throw V;
                  });
                };
              }), r.on("GetDoc", ({
                pdfInfo: m
              }) => {
                this._numPages = m.numPages, this._htmlForXfa = m.htmlForXfa, delete m.htmlForXfa, x._capability.resolve(new PDFDocumentProxy(m, this));
              }), r.on("DocException", function(m) {
                let U;
                switch (m.name) {
                  case "PasswordException":
                    U = new _util.PasswordException(m.message, m.code);
                    break;
                  case "InvalidPDFException":
                    U = new _util.InvalidPDFException(m.message);
                    break;
                  case "MissingPDFException":
                    U = new _util.MissingPDFException(m.message);
                    break;
                  case "UnexpectedResponseException":
                    U = new _util.UnexpectedResponseException(m.message, m.status);
                    break;
                  case "UnknownErrorException":
                    U = new _util.UnknownErrorException(m.message, m.details);
                    break;
                  default:
                    (0, _util.unreachable)("DocException - expected a valid Error.");
                }
                x._capability.reject(U);
              }), r.on("PasswordRequest", (m) => {
                if (Z(this, A, new _util.PromiseCapability()), x.onPassword) {
                  const U = (z) => {
                    z instanceof Error ? t(this, A).reject(z) : t(this, A).resolve({
                      password: z
                    });
                  };
                  try {
                    x.onPassword(U, m.code);
                  } catch (z) {
                    t(this, A).reject(z);
                  }
                } else
                  t(this, A).reject(new _util.PasswordException(m.message, m.code));
                return t(this, A).promise;
              }), r.on("DataLoaded", (m) => {
                var U;
                (U = x.onProgress) == null || U.call(x, {
                  loaded: m.length,
                  total: m.length
                }), this.downloadInfoCapability.resolve(m);
              }), r.on("StartRenderPage", (m) => {
                if (this.destroyed)
                  return;
                t(this, T).get(m.pageIndex)._startRenderPage(m.transparency, m.cacheKey);
              }), r.on("commonobj", ([m, U, z]) => {
                var C;
                if (!this.destroyed && !this.commonObjs.has(m))
                  switch (U) {
                    case "Font":
                      const V = this._params;
                      if ("error" in z) {
                        const H = z.error;
                        (0, _util.warn)(`Error during font loading: ${H}`), this.commonObjs.resolve(m, H);
                        break;
                      }
                      const st = V.pdfBug && ((C = globalThis.FontInspector) != null && C.enabled) ? (H, lt) => globalThis.FontInspector.fontAdded(H, lt) : null, at = new _font_loader.FontFaceObject(z, {
                        isEvalSupported: V.isEvalSupported,
                        disableFontFace: V.disableFontFace,
                        ignoreErrors: V.ignoreErrors,
                        inspectFont: st
                      });
                      this.fontLoader.bind(at).catch((H) => r.sendWithPromise("FontFallback", {
                        id: m
                      })).finally(() => {
                        !V.fontExtraProperties && at.data && (at.data = null), this.commonObjs.resolve(m, at);
                      });
                      break;
                    case "FontPath":
                    case "Image":
                    case "Pattern":
                      this.commonObjs.resolve(m, z);
                      break;
                    default:
                      throw new Error(`Got unknown common object type ${U}`);
                  }
              }), r.on("obj", ([m, U, z, C]) => {
                var st;
                if (this.destroyed)
                  return;
                const V = t(this, T).get(U);
                if (!V.objs.has(m))
                  switch (z) {
                    case "Image":
                      if (V.objs.resolve(m, C), C) {
                        let at;
                        if (C.bitmap) {
                          const {
                            width: H,
                            height: lt
                          } = C;
                          at = H * lt * 4;
                        } else
                          at = ((st = C.data) == null ? void 0 : st.length) || 0;
                        at > _util.MAX_IMAGE_SIZE_TO_CACHE && (V._maybeCleanupAfterRender = !0);
                      }
                      break;
                    case "Pattern":
                      V.objs.resolve(m, C);
                      break;
                    default:
                      throw new Error(`Got unknown object type ${z}`);
                  }
              }), r.on("DocProgress", (m) => {
                var U;
                this.destroyed || (U = x.onProgress) == null || U.call(x, {
                  loaded: m.loaded,
                  total: m.total
                });
              }), r.on("FetchBuiltInCMap", (m) => this.destroyed ? Promise.reject(new Error("Worker was destroyed.")) : this.cMapReaderFactory ? this.cMapReaderFactory.fetch(m) : Promise.reject(new Error("CMapReaderFactory not initialized, see the `useWorkerFetch` parameter."))), r.on("FetchStandardFontData", (m) => this.destroyed ? Promise.reject(new Error("Worker was destroyed.")) : this.standardFontDataFactory ? this.standardFontDataFactory.fetch(m) : Promise.reject(new Error("StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.")));
            }
            getData() {
              return this.messageHandler.sendWithPromise("GetData", null);
            }
            saveDocument() {
              var m;
              this.annotationStorage.size <= 0 && (0, _util.warn)("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");
              const {
                map: r,
                transfers: x
              } = this.annotationStorage.serializable;
              return this.messageHandler.sendWithPromise("SaveDocument", {
                isPureXfa: !!this._htmlForXfa,
                numPages: this._numPages,
                annotationStorage: r,
                filename: ((m = this._fullReader) == null ? void 0 : m.filename) ?? null
              }, x).finally(() => {
                this.annotationStorage.resetModified();
              });
            }
            getPage(r) {
              if (!Number.isInteger(r) || r <= 0 || r > this._numPages)
                return Promise.reject(new Error("Invalid page request."));
              const x = r - 1, m = t(this, v).get(x);
              if (m)
                return m;
              const U = this.messageHandler.sendWithPromise("GetPage", {
                pageIndex: x
              }).then((z) => {
                if (this.destroyed)
                  throw new Error("Transport destroyed");
                const C = new PDFPageProxy(x, z, this, this._params.pdfBug);
                return t(this, T).set(x, C), C;
              });
              return t(this, v).set(x, U), U;
            }
            getPageIndex(r) {
              return typeof r != "object" || r === null || !Number.isInteger(r.num) || r.num < 0 || !Number.isInteger(r.gen) || r.gen < 0 ? Promise.reject(new Error("Invalid pageIndex request.")) : this.messageHandler.sendWithPromise("GetPageIndex", {
                num: r.num,
                gen: r.gen
              });
            }
            getAnnotations(r, x) {
              return this.messageHandler.sendWithPromise("GetAnnotations", {
                pageIndex: r,
                intent: x
              });
            }
            getFieldObjects() {
              return W(this, u, we).call(this, "GetFieldObjects");
            }
            hasJSActions() {
              return W(this, u, we).call(this, "HasJSActions");
            }
            getCalculationOrderIds() {
              return this.messageHandler.sendWithPromise("GetCalculationOrderIds", null);
            }
            getDestinations() {
              return this.messageHandler.sendWithPromise("GetDestinations", null);
            }
            getDestination(r) {
              return typeof r != "string" ? Promise.reject(new Error("Invalid destination request.")) : this.messageHandler.sendWithPromise("GetDestination", {
                id: r
              });
            }
            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 W(this, u, we).call(this, "GetDocJSActions");
            }
            getPageJSActions(r) {
              return this.messageHandler.sendWithPromise("GetPageJSActions", {
                pageIndex: r
              });
            }
            getStructTree(r) {
              return this.messageHandler.sendWithPromise("GetStructTree", {
                pageIndex: r
              });
            }
            getOutline() {
              return this.messageHandler.sendWithPromise("GetOutline", null);
            }
            getOptionalContentConfig() {
              return this.messageHandler.sendWithPromise("GetOptionalContentConfig", null).then((r) => new _optional_content_config.OptionalContentConfig(r));
            }
            getPermissions() {
              return this.messageHandler.sendWithPromise("GetPermissions", null);
            }
            getMetadata() {
              const r = "GetMetadata", x = t(this, O).get(r);
              if (x)
                return x;
              const m = this.messageHandler.sendWithPromise(r, null).then((U) => {
                var z, C;
                return {
                  info: U[0],
                  metadata: U[1] ? new _metadata.Metadata(U[1]) : null,
                  contentDispositionFilename: ((z = this._fullReader) == null ? void 0 : z.filename) ?? null,
                  contentLength: ((C = this._fullReader) == null ? void 0 : C.contentLength) ?? null
                };
              });
              return t(this, O).set(r, m), m;
            }
            getMarkInfo() {
              return this.messageHandler.sendWithPromise("GetMarkInfo", null);
            }
            async startCleanup(r = !1) {
              if (!this.destroyed) {
                await this.messageHandler.sendWithPromise("Cleanup", null);
                for (const x of t(this, T).values())
                  if (!x.cleanup())
                    throw new Error(`startCleanup: Page ${x.pageNumber} is currently rendering.`);
                this.commonObjs.clear(), r || this.fontLoader.clear(), t(this, O).clear(), this.filterFactory.destroy(!0);
              }
            }
            get loadingParams() {
              const {
                disableAutoFetch: r,
                enableXfa: x
              } = this._params;
              return (0, _util.shadow)(this, "loadingParams", {
                disableAutoFetch: r,
                enableXfa: x
              });
            }
          }
          O = new WeakMap(), T = new WeakMap(), v = new WeakMap(), A = new WeakMap(), u = new WeakSet(), we = function(r, x = null) {
            const m = t(this, O).get(r);
            if (m)
              return m;
            const U = this.messageHandler.sendWithPromise(r, x);
            return t(this, O).set(r, U), U;
          };
          class PDFObjects {
            constructor() {
              I(this, w);
              I(this, E, /* @__PURE__ */ Object.create(null));
            }
            get(r, x = null) {
              if (x) {
                const U = W(this, w, Be).call(this, r);
                return U.capability.promise.then(() => x(U.data)), null;
              }
              const m = t(this, E)[r];
              if (!(m != null && m.capability.settled))
                throw new Error(`Requesting object that isn't resolved yet ${r}.`);
              return m.data;
            }
            has(r) {
              const x = t(this, E)[r];
              return (x == null ? void 0 : x.capability.settled) || !1;
            }
            resolve(r, x = null) {
              const m = W(this, w, Be).call(this, r);
              m.data = x, m.capability.resolve();
            }
            clear() {
              var r;
              for (const x in t(this, E)) {
                const {
                  data: m
                } = t(this, E)[x];
                (r = m == null ? void 0 : m.bitmap) == null || r.close();
              }
              Z(this, E, /* @__PURE__ */ Object.create(null));
            }
          }
          E = new WeakMap(), w = new WeakSet(), Be = function(r) {
            var x;
            return (x = t(this, E))[r] || (x[r] = {
              capability: new _util.PromiseCapability(),
              data: null
            });
          };
          class RenderTask {
            constructor(r) {
              I(this, a, null);
              Z(this, a, r), this.onContinue = null;
            }
            get promise() {
              return t(this, a).capability.promise;
            }
            cancel(r = 0) {
              t(this, a).cancel(null, r);
            }
            get separateAnnots() {
              const {
                separateAnnots: r
              } = t(this, a).operatorList;
              if (!r)
                return !1;
              const {
                annotationCanvasMap: x
              } = t(this, a);
              return r.form || r.canvas && (x == null ? void 0 : x.size) > 0;
            }
          }
          a = new WeakMap(), exports.RenderTask = RenderTask;
          const k = class k {
            constructor({
              callback: r,
              params: x,
              objs: m,
              commonObjs: U,
              annotationCanvasMap: z,
              operatorList: C,
              pageIndex: V,
              canvasFactory: st,
              filterFactory: at,
              useRequestAnimationFrame: H = !1,
              pdfBug: lt = !1,
              pageColors: gt = null
            }) {
              this.callback = r, this.params = x, this.objs = m, this.commonObjs = U, this.annotationCanvasMap = z, this.operatorListIdx = null, this.operatorList = C, this._pageIndex = V, this.canvasFactory = st, this.filterFactory = at, this._pdfBug = lt, this.pageColors = gt, this.running = !1, this.graphicsReadyCallback = null, this.graphicsReady = !1, this._useRequestAnimationFrame = H === !0 && typeof window < "u", this.cancelled = !1, this.capability = new _util.PromiseCapability(), this.task = new RenderTask(this), this._cancelBound = this.cancel.bind(this), this._continueBound = this._continue.bind(this), this._scheduleNextBound = this._scheduleNext.bind(this), this._nextBound = this._next.bind(this), this._canvas = x.canvasContext.canvas;
            }
            get completed() {
              return this.capability.promise.catch(function() {
              });
            }
            initializeGraphics({
              transparency: r = !1,
              optionalContentConfig: x
            }) {
              var V, st;
              if (this.cancelled)
                return;
              if (this._canvas) {
                if (t(k, l).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.");
                t(k, l).add(this._canvas);
              }
              this._pdfBug && ((V = globalThis.StepperManager) != null && V.enabled) && (this.stepper = globalThis.StepperManager.create(this._pageIndex), this.stepper.init(this.operatorList), this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint());
              const {
                canvasContext: m,
                viewport: U,
                transform: z,
                background: C
              } = this.params;
              this.gfx = new _canvas.CanvasGraphics(m, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
                optionalContentConfig: x
              }, this.annotationCanvasMap, this.pageColors), this.gfx.beginDrawing({
                transform: z,
                viewport: U,
                transparency: r,
                background: C
              }), this.operatorListIdx = 0, this.graphicsReady = !0, (st = this.graphicsReadyCallback) == null || st.call(this);
            }
            cancel(r = null, x = 0) {
              var m;
              this.running = !1, this.cancelled = !0, (m = this.gfx) == null || m.endDrawing(), t(k, l).delete(this._canvas), this.callback(r || new _display_utils.RenderingCancelledException(`Rendering cancelled, page ${this._pageIndex + 1}`, x));
            }
            operatorListChanged() {
              var r;
              if (!this.graphicsReady) {
                this.graphicsReadyCallback || (this.graphicsReadyCallback = this._continueBound);
                return;
              }
              (r = this.stepper) == null || r.updateOperatorList(this.operatorList), !this.running && this._continue();
            }
            _continue() {
              this.running = !0, !this.cancelled && (this.task.onContinue ? this.task.onContinue(this._scheduleNextBound) : this._scheduleNext());
            }
            _scheduleNext() {
              this._useRequestAnimationFrame ? window.requestAnimationFrame(() => {
                this._nextBound().catch(this._cancelBound);
              }) : Promise.resolve().then(this._nextBound).catch(this._cancelBound);
            }
            async _next() {
              this.cancelled || (this.operatorListIdx = this.gfx.executeOperatorList(this.operatorList, this.operatorListIdx, this._continueBound, this.stepper), this.operatorListIdx === this.operatorList.argsArray.length && (this.running = !1, this.operatorList.lastChunk && (this.gfx.endDrawing(), t(k, l).delete(this._canvas), this.callback())));
            }
          };
          l = new WeakMap(), I(k, l, /* @__PURE__ */ new WeakSet());
          let InternalRenderTask = k;
          const version = "3.11.174";
          exports.version = version;
          const build = "ce8716743";
          exports.build = build;
        },
        /* 3 */
        /***/
        (dt, d, et) => {
          var F, g, L, Ai, T;
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.SerializableEmpty = d.PrintAnnotationStorage = d.AnnotationStorage = void 0;
          var c = et(1), P = et(4), rt = et(8);
          const X = Object.freeze({
            map: null,
            hash: "",
            transfers: void 0
          });
          d.SerializableEmpty = X;
          class pt {
            constructor() {
              I(this, L);
              I(this, F, !1);
              I(this, g, /* @__PURE__ */ new Map());
              this.onSetModified = null, this.onResetModified = null, this.onAnnotationEditor = null;
            }
            getValue(A, u) {
              const b = t(this, g).get(A);
              return b === void 0 ? u : Object.assign(u, b);
            }
            getRawValue(A) {
              return t(this, g).get(A);
            }
            remove(A) {
              if (t(this, g).delete(A), t(this, g).size === 0 && this.resetModified(), typeof this.onAnnotationEditor == "function") {
                for (const u of t(this, g).values())
                  if (u instanceof P.AnnotationEditor)
                    return;
                this.onAnnotationEditor(null);
              }
            }
            setValue(A, u) {
              const b = t(this, g).get(A);
              let E = !1;
              if (b !== void 0)
                for (const [w, y] of Object.entries(u))
                  b[w] !== y && (E = !0, b[w] = y);
              else
                E = !0, t(this, g).set(A, u);
              E && W(this, L, Ai).call(this), u instanceof P.AnnotationEditor && typeof this.onAnnotationEditor == "function" && this.onAnnotationEditor(u.constructor._type);
            }
            has(A) {
              return t(this, g).has(A);
            }
            getAll() {
              return t(this, g).size > 0 ? (0, c.objectFromMap)(t(this, g)) : null;
            }
            setAll(A) {
              for (const [u, b] of Object.entries(A))
                this.setValue(u, b);
            }
            get size() {
              return t(this, g).size;
            }
            resetModified() {
              t(this, F) && (Z(this, F, !1), typeof this.onResetModified == "function" && this.onResetModified());
            }
            get print() {
              return new B(this);
            }
            get serializable() {
              if (t(this, g).size === 0)
                return X;
              const A = /* @__PURE__ */ new Map(), u = new rt.MurmurHash3_64(), b = [], E = /* @__PURE__ */ Object.create(null);
              let w = !1;
              for (const [y, a] of t(this, g)) {
                const l = a instanceof P.AnnotationEditor ? a.serialize(!1, E) : a;
                l && (A.set(y, l), u.update(`${y}:${JSON.stringify(l)}`), w || (w = !!l.bitmap));
              }
              if (w)
                for (const y of A.values())
                  y.bitmap && b.push(y.bitmap);
              return A.size > 0 ? {
                map: A,
                hash: u.hexdigest(),
                transfers: b
              } : X;
            }
          }
          F = new WeakMap(), g = new WeakMap(), L = new WeakSet(), Ai = function() {
            t(this, F) || (Z(this, F, !0), typeof this.onSetModified == "function" && this.onSetModified());
          }, d.AnnotationStorage = pt;
          class B extends pt {
            constructor(u) {
              super();
              I(this, T, void 0);
              const {
                map: b,
                hash: E,
                transfers: w
              } = u.serializable, y = structuredClone(b, w ? {
                transfer: w
              } : null);
              Z(this, T, {
                map: y,
                hash: E,
                transfers: w
              });
            }
            get print() {
              (0, c.unreachable)("Should not call PrintAnnotationStorage.print");
            }
            get serializable() {
              return t(this, T);
            }
          }
          T = new WeakMap(), d.PrintAnnotationStorage = B;
        },
        /* 4 */
        /***/
        (dt, d, et) => {
          var B, F, g, L, O, T, v, A, u, b, E, w, y, a, l, Ue, p, je, x, He, U, We, C, yi, st, vi, H, Si, gt, Ge, Pt, Ei;
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.AnnotationEditor = void 0;
          var c = et(5), P = et(1), rt = et(6);
          const i = class i {
            constructor(s) {
              I(this, l);
              I(this, p);
              I(this, U);
              I(this, C);
              I(this, st);
              I(this, H);
              I(this, gt);
              I(this, Pt);
              I(this, B, "");
              I(this, F, !1);
              I(this, g, null);
              I(this, L, null);
              I(this, O, null);
              I(this, T, !1);
              I(this, v, null);
              I(this, A, this.focusin.bind(this));
              I(this, u, this.focusout.bind(this));
              I(this, b, !1);
              I(this, E, !1);
              I(this, w, !1);
              ee(this, "_initialOptions", /* @__PURE__ */ Object.create(null));
              ee(this, "_uiManager", null);
              ee(this, "_focusEventsAllowed", !0);
              ee(this, "_l10nPromise", null);
              I(this, y, !1);
              I(this, a, i._zIndex++);
              this.constructor === i && (0, P.unreachable)("Cannot initialize AnnotationEditor."), this.parent = s.parent, this.id = s.id, this.width = this.height = null, this.pageIndex = s.parent.pageIndex, this.name = s.name, this.div = null, this._uiManager = s.uiManager, this.annotationElementId = null, this._willKeepAspectRatio = !1, this._initialOptions.isCentered = s.isCentered, this._structTreeParentId = null;
              const {
                rotation: o,
                rawDims: {
                  pageWidth: h,
                  pageHeight: _,
                  pageX: M,
                  pageY: N
                }
              } = this.parent.viewport;
              this.rotation = o, this.pageRotation = (360 + o - this._uiManager.viewParameters.rotation) % 360, this.pageDimensions = [h, _], this.pageTranslation = [M, N];
              const [tt, Q] = this.parentDimensions;
              this.x = s.x / tt, this.y = s.y / Q, this.isAttachedToDOM = !1, this.deleted = !1;
            }
            get editorType() {
              return Object.getPrototypeOf(this).constructor._type;
            }
            static get _defaultLineColor() {
              return (0, P.shadow)(this, "_defaultLineColor", this._colorManager.getHexCode("CanvasText"));
            }
            static deleteAnnotationElement(s) {
              const o = new pt({
                id: s.parent.getNextId(),
                parent: s.parent,
                uiManager: s._uiManager
              });
              o.annotationElementId = s.annotationElementId, o.deleted = !0, o._uiManager.addToAnnotationStorage(o);
            }
            static initialize(s, o = null) {
              if (i._l10nPromise || (i._l10nPromise = new Map(["editor_alt_text_button_label", "editor_alt_text_edit_button_label", "editor_alt_text_decorative_tooltip"].map((_) => [_, s.get(_)]))), o != null && o.strings)
                for (const _ of o.strings)
                  i._l10nPromise.set(_, s.get(_));
              if (i._borderLineWidth !== -1)
                return;
              const h = getComputedStyle(document.documentElement);
              i._borderLineWidth = parseFloat(h.getPropertyValue("--outline-width")) || 0;
            }
            static updateDefaultParams(s, o) {
            }
            static get defaultPropertiesToUpdate() {
              return [];
            }
            static isHandlingMimeForPasting(s) {
              return !1;
            }
            static paste(s, o) {
              (0, P.unreachable)("Not implemented");
            }
            get propertiesToUpdate() {
              return [];
            }
            get _isDraggable() {
              return t(this, y);
            }
            set _isDraggable(s) {
              var o;
              Z(this, y, s), (o = this.div) == null || o.classList.toggle("draggable", s);
            }
            center() {
              const [s, o] = this.pageDimensions;
              switch (this.parentRotation) {
                case 90:
                  this.x -= this.height * o / (s * 2), this.y += this.width * s / (o * 2);
                  break;
                case 180:
                  this.x += this.width / 2, this.y += this.height / 2;
                  break;
                case 270:
                  this.x += this.height * o / (s * 2), this.y -= this.width * s / (o * 2);
                  break;
                default:
                  this.x -= this.width / 2, this.y -= this.height / 2;
                  break;
              }
              this.fixAndSetPosition();
            }
            addCommands(s) {
              this._uiManager.addCommands(s);
            }
            get currentLayer() {
              return this._uiManager.currentLayer;
            }
            setInBackground() {
              this.div.style.zIndex = 0;
            }
            setInForeground() {
              this.div.style.zIndex = t(this, a);
            }
            setParent(s) {
              s !== null && (this.pageIndex = s.pageIndex, this.pageDimensions = s.pageDimensions), this.parent = s;
            }
            focusin(s) {
              this._focusEventsAllowed && (t(this, b) ? Z(this, b, !1) : this.parent.setSelected(this));
            }
            focusout(s) {
              var h;
              if (!this._focusEventsAllowed || !this.isAttachedToDOM)
                return;
              const o = s.relatedTarget;
              o != null && o.closest(`#${this.id}`) || (s.preventDefault(), (h = this.parent) != null && h.isMultipleSelection || this.commitOrRemove());
            }
            commitOrRemove() {
              this.isEmpty() ? this.remove() : this.commit();
            }
            commit() {
              this.addToAnnotationStorage();
            }
            addToAnnotationStorage() {
              this._uiManager.addToAnnotationStorage(this);
            }
            setAt(s, o, h, _) {
              const [M, N] = this.parentDimensions;
              [h, _] = this.screenToPageTranslation(h, _), this.x = (s + h) / M, this.y = (o + _) / N, this.fixAndSetPosition();
            }
            translate(s, o) {
              W(this, l, Ue).call(this, this.parentDimensions, s, o);
            }
            translateInPage(s, o) {
              W(this, l, Ue).call(this, this.pageDimensions, s, o), this.div.scrollIntoView({
                block: "nearest"
              });
            }
            drag(s, o) {
              const [h, _] = this.parentDimensions;
              if (this.x += s / h, this.y += o / _, this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {
                const {
                  x: nt,
                  y: ct
                } = this.div.getBoundingClientRect();
                this.parent.findNewParent(this, nt, ct) && (this.x -= Math.floor(this.x), this.y -= Math.floor(this.y));
              }
              let {
                x: M,
                y: N
              } = this;
              const [tt, Q] = W(this, p, je).call(this);
              M += tt, N += Q, this.div.style.left = `${(100 * M).toFixed(2)}%`, this.div.style.top = `${(100 * N).toFixed(2)}%`, this.div.scrollIntoView({
                block: "nearest"
              });
            }
            fixAndSetPosition() {
              const [s, o] = this.pageDimensions;
              let {
                x: h,
                y: _,
                width: M,
                height: N
              } = this;
              switch (M *= s, N *= o, h *= s, _ *= o, this.rotation) {
                case 0:
                  h = Math.max(0, Math.min(s - M, h)), _ = Math.max(0, Math.min(o - N, _));
                  break;
                case 90:
                  h = Math.max(0, Math.min(s - N, h)), _ = Math.min(o, Math.max(M, _));
                  break;
                case 180:
                  h = Math.min(s, Math.max(M, h)), _ = Math.min(o, Math.max(N, _));
                  break;
                case 270:
                  h = Math.min(s, Math.max(N, h)), _ = Math.max(0, Math.min(o - M, _));
                  break;
              }
              this.x = h /= s, this.y = _ /= o;
              const [tt, Q] = W(this, p, je).call(this);
              h += tt, _ += Q;
              const {
                style: nt
              } = this.div;
              nt.left = `${(100 * h).toFixed(2)}%`, nt.top = `${(100 * _).toFixed(2)}%`, this.moveInDOM();
            }
            screenToPageTranslation(s, o) {
              var h;
              return W(h = i, x, He).call(h, s, o, this.parentRotation);
            }
            pageTranslationToScreen(s, o) {
              var h;
              return W(h = i, x, He).call(h, s, o, 360 - this.parentRotation);
            }
            get parentScale() {
              return this._uiManager.viewParameters.realScale;
            }
            get parentRotation() {
              return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360;
            }
            get parentDimensions() {
              const {
                parentScale: s,
                pageDimensions: [o, h]
              } = this, _ = o * s, M = h * s;
              return P.FeatureTest.isCSSRoundSupported ? [Math.round(_), Math.round(M)] : [_, M];
            }
            setDims(s, o) {
              var M;
              const [h, _] = this.parentDimensions;
              this.div.style.width = `${(100 * s / h).toFixed(2)}%`, t(this, T) || (this.div.style.height = `${(100 * o / _).toFixed(2)}%`), (M = t(this, g)) == null || M.classList.toggle("small", s < i.SMALL_EDITOR_SIZE || o < i.SMALL_EDITOR_SIZE);
            }
            fixDims() {
              const {
                style: s
              } = this.div, {
                height: o,
                width: h
              } = s, _ = h.endsWith("%"), M = !t(this, T) && o.endsWith("%");
              if (_ && M)
                return;
              const [N, tt] = this.parentDimensions;
              _ || (s.width = `${(100 * parseFloat(h) / N).toFixed(2)}%`), !t(this, T) && !M && (s.height = `${(100 * parseFloat(o) / tt).toFixed(2)}%`);
            }
            getInitialTranslation() {
              return [0, 0];
            }
            async addAltTextButton() {
              if (t(this, g))
                return;
              const s = Z(this, g, document.createElement("button"));
              s.className = "altText";
              const o = await i._l10nPromise.get("editor_alt_text_button_label");
              s.textContent = o, s.setAttribute("aria-label", o), s.tabIndex = "0", s.addEventListener("contextmenu", rt.noContextMenu), s.addEventListener("pointerdown", (h) => h.stopPropagation()), s.addEventListener("click", (h) => {
                h.preventDefault(), this._uiManager.editAltText(this);
              }, {
                capture: !0
              }), s.addEventListener("keydown", (h) => {
                h.target === s && h.key === "Enter" && (h.preventDefault(), this._uiManager.editAltText(this));
              }), W(this, gt, Ge).call(this), this.div.append(s), i.SMALL_EDITOR_SIZE || (i.SMALL_EDITOR_SIZE = Math.min(128, Math.round(s.getBoundingClientRect().width * 1.4)));
            }
            getClientDimensions() {
              return this.div.getBoundingClientRect();
            }
            get altTextData() {
              return {
                altText: t(this, B),
                decorative: t(this, F)
              };
            }
            set altTextData({
              altText: s,
              decorative: o
            }) {
              t(this, B) === s && t(this, F) === o || (Z(this, B, s), Z(this, F, o), W(this, gt, Ge).call(this));
            }
            render() {
              this.div = document.createElement("div"), this.div.setAttribute("data-editor-rotation", (360 - this.rotation) % 360), this.div.className = this.name, this.div.setAttribute("id", this.id), this.div.setAttribute("tabIndex", 0), this.setInForeground(), this.div.addEventListener("focusin", t(this, A)), this.div.addEventListener("focusout", t(this, u));
              const [s, o] = this.parentDimensions;
              this.parentRotation % 180 !== 0 && (this.div.style.maxWidth = `${(100 * o / s).toFixed(2)}%`, this.div.style.maxHeight = `${(100 * s / o).toFixed(2)}%`);
              const [h, _] = this.getInitialTranslation();
              return this.translate(h, _), (0, c.bindEvents)(this, this.div, ["pointerdown"]), this.div;
            }
            pointerdown(s) {
              const {
                isMac: o
              } = P.FeatureTest.platform;
              if (s.button !== 0 || s.ctrlKey && o) {
                s.preventDefault();
                return;
              }
              Z(this, b, !0), W(this, Pt, Ei).call(this, s);
            }
            moveInDOM() {
              var s;
              (s = this.parent) == null || s.moveEditorInDOM(this);
            }
            _setParentAndPosition(s, o, h) {
              s.changeParent(this), this.x = o, this.y = h, this.fixAndSetPosition();
            }
            getRect(s, o) {
              const h = this.parentScale, [_, M] = this.pageDimensions, [N, tt] = this.pageTranslation, Q = s / h, nt = o / h, ct = this.x * _, yt = this.y * M, ut = this.width * _, Ft = this.height * M;
              switch (this.rotation) {
                case 0:
                  return [ct + Q + N, M - yt - nt - Ft + tt, ct + Q + ut + N, M - yt - nt + tt];
                case 90:
                  return [ct + nt + N, M - yt + Q + tt, ct + nt + Ft + N, M - yt + Q + ut + tt];
                case 180:
                  return [ct - Q - ut + N, M - yt + nt + tt, ct - Q + N, M - yt + nt + Ft + tt];
                case 270:
                  return [ct - nt - Ft + N, M - yt - Q - ut + tt, ct - nt + N, M - yt - Q + tt];
                default:
                  throw new Error("Invalid rotation");
              }
            }
            getRectInCurrentCoords(s, o) {
              const [h, _, M, N] = s, tt = M - h, Q = N - _;
              switch (this.rotation) {
                case 0:
                  return [h, o - N, tt, Q];
                case 90:
                  return [h, o - _, Q, tt];
                case 180:
                  return [M, o - _, tt, Q];
                case 270:
                  return [M, o - N, Q, tt];
                default:
                  throw new Error("Invalid rotation");
              }
            }
            onceAdded() {
            }
            isEmpty() {
              return !1;
            }
            enableEditMode() {
              Z(this, w, !0);
            }
            disableEditMode() {
              Z(this, w, !1);
            }
            isInEditMode() {
              return t(this, w);
            }
            shouldGetKeyboardEvents() {
              return !1;
            }
            needsToBeRebuilt() {
              return this.div && !this.isAttachedToDOM;
            }
            rebuild() {
              var s, o;
              (s = this.div) == null || s.addEventListener("focusin", t(this, A)), (o = this.div) == null || o.addEventListener("focusout", t(this, u));
            }
            serialize(s = !1, o = null) {
              (0, P.unreachable)("An editor must be serializable");
            }
            static deserialize(s, o, h) {
              const _ = new this.prototype.constructor({
                parent: o,
                id: o.getNextId(),
                uiManager: h
              });
              _.rotation = s.rotation;
              const [M, N] = _.pageDimensions, [tt, Q, nt, ct] = _.getRectInCurrentCoords(s.rect, N);
              return _.x = tt / M, _.y = Q / N, _.width = nt / M, _.height = ct / N, _;
            }
            remove() {
              var s;
              this.div.removeEventListener("focusin", t(this, A)), this.div.removeEventListener("focusout", t(this, u)), this.isEmpty() || this.commit(), this.parent ? this.parent.remove(this) : this._uiManager.removeEditor(this), (s = t(this, g)) == null || s.remove(), Z(this, g, null), Z(this, L, null);
            }
            get isResizable() {
              return !1;
            }
            makeResizable() {
              this.isResizable && (W(this, C, yi).call(this), t(this, v).classList.remove("hidden"));
            }
            select() {
              var s;
              this.makeResizable(), (s = this.div) == null || s.classList.add("selectedEditor");
            }
            unselect() {
              var s, o, h;
              (s = t(this, v)) == null || s.classList.add("hidden"), (o = this.div) == null || o.classList.remove("selectedEditor"), (h = this.div) != null && h.contains(document.activeElement) && this._uiManager.currentLayer.div.focus();
            }
            updateParams(s, o) {
            }
            disableEditing() {
              t(this, g) && (t(this, g).hidden = !0);
            }
            enableEditing() {
              t(this, g) && (t(this, g).hidden = !1);
            }
            enterInEditMode() {
            }
            get contentDiv() {
              return this.div;
            }
            get isEditing() {
              return t(this, E);
            }
            set isEditing(s) {
              Z(this, E, s), this.parent && (s ? (this.parent.setSelected(this), this.parent.setActiveEditor(this)) : this.parent.setActiveEditor(null));
            }
            setAspectRatio(s, o) {
              Z(this, T, !0);
              const h = s / o, {
                style: _
              } = this.div;
              _.aspectRatio = h, _.height = "auto";
            }
            static get MIN_SIZE() {
              return 16;
            }
          };
          B = new WeakMap(), F = new WeakMap(), g = new WeakMap(), L = new WeakMap(), O = new WeakMap(), T = new WeakMap(), v = new WeakMap(), A = new WeakMap(), u = new WeakMap(), b = new WeakMap(), E = new WeakMap(), w = new WeakMap(), y = new WeakMap(), a = new WeakMap(), l = new WeakSet(), Ue = function([s, o], h, _) {
            [h, _] = this.screenToPageTranslation(h, _), this.x += h / s, this.y += _ / o, this.fixAndSetPosition();
          }, p = new WeakSet(), je = function() {
            const [s, o] = this.parentDimensions, {
              _borderLineWidth: h
            } = i, _ = h / s, M = h / o;
            switch (this.rotation) {
              case 90:
                return [-_, M];
              case 180:
                return [_, M];
              case 270:
                return [_, -M];
              default:
                return [-_, -M];
            }
          }, x = new WeakSet(), He = function(s, o, h) {
            switch (h) {
              case 90:
                return [o, -s];
              case 180:
                return [-s, -o];
              case 270:
                return [-o, s];
              default:
                return [s, o];
            }
          }, U = new WeakSet(), We = function(s) {
            switch (s) {
              case 90: {
                const [o, h] = this.pageDimensions;
                return [0, -o / h, h / o, 0];
              }
              case 180:
                return [-1, 0, 0, -1];
              case 270: {
                const [o, h] = this.pageDimensions;
                return [0, o / h, -h / o, 0];
              }
              default:
                return [1, 0, 0, 1];
            }
          }, C = new WeakSet(), yi = function() {
            if (t(this, v))
              return;
            Z(this, v, document.createElement("div")), t(this, v).classList.add("resizers");
            const s = ["topLeft", "topRight", "bottomRight", "bottomLeft"];
            this._willKeepAspectRatio || s.push("topMiddle", "middleRight", "bottomMiddle", "middleLeft");
            for (const o of s) {
              const h = document.createElement("div");
              t(this, v).append(h), h.classList.add("resizer", o), h.addEventListener("pointerdown", W(this, st, vi).bind(this, o)), h.addEventListener("contextmenu", rt.noContextMenu);
            }
            this.div.prepend(t(this, v));
          }, st = new WeakSet(), vi = function(s, o) {
            o.preventDefault();
            const {
              isMac: h
            } = P.FeatureTest.platform;
            if (o.button !== 0 || o.ctrlKey && h)
              return;
            const _ = W(this, H, Si).bind(this, s), M = this._isDraggable;
            this._isDraggable = !1;
            const N = {
              passive: !0,
              capture: !0
            };
            window.addEventListener("pointermove", _, N);
            const tt = this.x, Q = this.y, nt = this.width, ct = this.height, yt = this.parent.div.style.cursor, ut = this.div.style.cursor;
            this.div.style.cursor = this.parent.div.style.cursor = window.getComputedStyle(o.target).cursor;
            const Ft = () => {
              this._isDraggable = M, window.removeEventListener("pointerup", Ft), window.removeEventListener("blur", Ft), window.removeEventListener("pointermove", _, N), this.parent.div.style.cursor = yt, this.div.style.cursor = ut;
              const Bt = this.x, St = this.y, Dt = this.width, ft = this.height;
              Bt === tt && St === Q && Dt === nt && ft === ct || this.addCommands({
                cmd: () => {
                  this.width = Dt, this.height = ft, this.x = Bt, this.y = St;
                  const [K, J] = this.parentDimensions;
                  this.setDims(K * Dt, J * ft), this.fixAndSetPosition();
                },
                undo: () => {
                  this.width = nt, this.height = ct, this.x = tt, this.y = Q;
                  const [K, J] = this.parentDimensions;
                  this.setDims(K * nt, J * ct), this.fixAndSetPosition();
                },
                mustExec: !0
              });
            };
            window.addEventListener("pointerup", Ft), window.addEventListener("blur", Ft);
          }, H = new WeakSet(), Si = function(s, o) {
            const [h, _] = this.parentDimensions, M = this.x, N = this.y, tt = this.width, Q = this.height, nt = i.MIN_SIZE / h, ct = i.MIN_SIZE / _, yt = (bt) => Math.round(bt * 1e4) / 1e4, ut = W(this, U, We).call(this, this.rotation), Ft = (bt, At) => [ut[0] * bt + ut[2] * At, ut[1] * bt + ut[3] * At], Bt = W(this, U, We).call(this, 360 - this.rotation), St = (bt, At) => [Bt[0] * bt + Bt[2] * At, Bt[1] * bt + Bt[3] * At];
            let Dt, ft, K = !1, J = !1;
            switch (s) {
              case "topLeft":
                K = !0, Dt = (bt, At) => [0, 0], ft = (bt, At) => [bt, At];
                break;
              case "topMiddle":
                Dt = (bt, At) => [bt / 2, 0], ft = (bt, At) => [bt / 2, At];
                break;
              case "topRight":
                K = !0, Dt = (bt, At) => [bt, 0], ft = (bt, At) => [0, At];
                break;
              case "middleRight":
                J = !0, Dt = (bt, At) => [bt, At / 2], ft = (bt, At) => [0, At / 2];
                break;
              case "bottomRight":
                K = !0, Dt = (bt, At) => [bt, At], ft = (bt, At) => [0, 0];
                break;
              case "bottomMiddle":
                Dt = (bt, At) => [bt / 2, At], ft = (bt, At) => [bt / 2, 0];
                break;
              case "bottomLeft":
                K = !0, Dt = (bt, At) => [0, At], ft = (bt, At) => [bt, 0];
                break;
              case "middleLeft":
                J = !0, Dt = (bt, At) => [0, At / 2], ft = (bt, At) => [bt, At / 2];
                break;
            }
            const ht = Dt(tt, Q), Et = ft(tt, Q);
            let Ct = Ft(...Et);
            const Ut = yt(M + Ct[0]), Gt = yt(N + Ct[1]);
            let Ht = 1, Xt = 1, [Vt, Wt] = this.screenToPageTranslation(o.movementX, o.movementY);
            if ([Vt, Wt] = St(Vt / h, Wt / _), K) {
              const bt = Math.hypot(tt, Q);
              Ht = Xt = Math.max(Math.min(Math.hypot(Et[0] - ht[0] - Vt, Et[1] - ht[1] - Wt) / bt, 1 / tt, 1 / Q), nt / tt, ct / Q);
            } else
              J ? Ht = Math.max(nt, Math.min(1, Math.abs(Et[0] - ht[0] - Vt))) / tt : Xt = Math.max(ct, Math.min(1, Math.abs(Et[1] - ht[1] - Wt))) / Q;
            const $t = yt(tt * Ht), ot = yt(Q * Xt);
            Ct = Ft(...ft($t, ot));
            const Y = Ut - Ct[0], G = Gt - Ct[1];
            this.width = $t, this.height = ot, this.x = Y, this.y = G, this.setDims(h * $t, _ * ot), this.fixAndSetPosition();
          }, gt = new WeakSet(), Ge = async function() {
            var h;
            const s = t(this, g);
            if (!s)
              return;
            if (!t(this, B) && !t(this, F)) {
              s.classList.remove("done"), (h = t(this, L)) == null || h.remove();
              return;
            }
            i._l10nPromise.get("editor_alt_text_edit_button_label").then((_) => {
              s.setAttribute("aria-label", _);
            });
            let o = t(this, L);
            if (!o) {
              Z(this, L, o = document.createElement("span")), o.className = "tooltip", o.setAttribute("role", "tooltip");
              const _ = o.id = `alt-text-tooltip-${this.id}`;
              s.setAttribute("aria-describedby", _);
              const M = 100;
              s.addEventListener("mouseenter", () => {
                Z(this, O, setTimeout(() => {
                  Z(this, O, null), t(this, L).classList.add("show"), this._uiManager._eventBus.dispatch("reporttelemetry", {
                    source: this,
                    details: {
                      type: "editing",
                      subtype: this.editorType,
                      data: {
                        action: "alt_text_tooltip"
                      }
                    }
                  });
                }, M));
              }), s.addEventListener("mouseleave", () => {
                var N;
                clearTimeout(t(this, O)), Z(this, O, null), (N = t(this, L)) == null || N.classList.remove("show");
              });
            }
            s.classList.add("done"), o.innerText = t(this, F) ? await i._l10nPromise.get("editor_alt_text_decorative_tooltip") : t(this, B), o.parentNode || s.append(o);
          }, Pt = new WeakSet(), Ei = function(s) {
            if (!this._isDraggable)
              return;
            const o = this._uiManager.isSelected(this);
            this._uiManager.setUpDragSession();
            let h, _;
            o && (h = {
              passive: !0,
              capture: !0
            }, _ = (N) => {
              const [tt, Q] = this.screenToPageTranslation(N.movementX, N.movementY);
              this._uiManager.dragSelectedEditors(tt, Q);
            }, window.addEventListener("pointermove", _, h));
            const M = () => {
              if (window.removeEventListener("pointerup", M), window.removeEventListener("blur", M), o && window.removeEventListener("pointermove", _, h), Z(this, b, !1), !this._uiManager.endDragSession()) {
                const {
                  isMac: N
                } = P.FeatureTest.platform;
                s.ctrlKey && !N || s.shiftKey || s.metaKey && N ? this.parent.toggleSelected(this) : this.parent.setSelected(this);
              }
            };
            window.addEventListener("pointerup", M), window.addEventListener("blur", M);
          }, I(i, x), ee(i, "_borderLineWidth", -1), ee(i, "_colorManager", new c.ColorManager()), ee(i, "_zIndex", 1), ee(i, "SMALL_EDITOR_SIZE", 0);
          let X = i;
          d.AnnotationEditor = X;
          class pt extends X {
            constructor(s) {
              super(s), this.annotationElementId = s.annotationElementId, this.deleted = !0;
            }
            serialize() {
              return {
                id: this.annotationElementId,
                deleted: !0,
                pageIndex: this.pageIndex
              };
            }
          }
        },
        /* 5 */
        /***/
        (dt, d, et) => {
          var T, v, A, u, b, ze, y, a, l, k, p, wi, m, U, z, C, V, st, at, H, lt, gt, wt, Pt, S, i, n, s, o, h, _, M, N, tt, Q, nt, ct, yt, ut, Ft, Bt, St, Dt, ft, K, J, ht, Ci, Ct, Xe, Gt, Ve, Xt, Ce, Wt, qe, ot, $e, G, re, At, me, Zt, Ti, vt, xi, Tt, Ye, Nt, be, _t, Ke;
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.KeyboardManager = d.CommandManager = d.ColorManager = d.AnnotationEditorUIManager = void 0, d.bindEvents = rt, d.opacityToHex = X;
          var c = et(1), P = et(6);
          function rt(R, e, f) {
            for (const D of f)
              e.addEventListener(D, R[D].bind(R));
          }
          function X(R) {
            return Math.round(Math.min(255, Math.max(1, 255 * R))).toString(16).padStart(2, "0");
          }
          class pt {
            constructor() {
              I(this, T, 0);
            }
            getId() {
              return `${c.AnnotationEditorPrefix}${ge(this, T)._++}`;
            }
          }
          T = new WeakMap();
          const w = class w {
            constructor() {
              I(this, b);
              I(this, v, (0, c.getUuid)());
              I(this, A, 0);
              I(this, u, null);
            }
            static get _isSVGFittingCanvas() {
              const e = '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>', D = new OffscreenCanvas(1, 3).getContext("2d"), j = new Image();
              j.src = e;
              const q = j.decode().then(() => (D.drawImage(j, 0, 0, 1, 1, 0, 0, 1, 3), new Uint32Array(D.getImageData(0, 0, 1, 1).data.buffer)[0] === 0));
              return (0, c.shadow)(this, "_isSVGFittingCanvas", q);
            }
            async getFromFile(e) {
              const {
                lastModified: f,
                name: D,
                size: j,
                type: q
              } = e;
              return W(this, b, ze).call(this, `${f}_${D}_${j}_${q}`, e);
            }
            async getFromUrl(e) {
              return W(this, b, ze).call(this, e, e);
            }
            async getFromId(e) {
              t(this, u) || Z(this, u, /* @__PURE__ */ new Map());
              const f = t(this, u).get(e);
              return f ? f.bitmap ? (f.refCounter += 1, f) : f.file ? this.getFromFile(f.file) : this.getFromUrl(f.url) : null;
            }
            getSvgUrl(e) {
              const f = t(this, u).get(e);
              return f != null && f.isSvg ? f.svgUrl : null;
            }
            deleteId(e) {
              t(this, u) || Z(this, u, /* @__PURE__ */ new Map());
              const f = t(this, u).get(e);
              f && (f.refCounter -= 1, f.refCounter === 0 && (f.bitmap = null));
            }
            isValidId(e) {
              return e.startsWith(`image_${t(this, v)}_`);
            }
          };
          v = new WeakMap(), A = new WeakMap(), u = new WeakMap(), b = new WeakSet(), ze = async function(e, f) {
            t(this, u) || Z(this, u, /* @__PURE__ */ new Map());
            let D = t(this, u).get(e);
            if (D === null)
              return null;
            if (D != null && D.bitmap)
              return D.refCounter += 1, D;
            try {
              D || (D = {
                bitmap: null,
                id: `image_${t(this, v)}_${ge(this, A)._++}`,
                refCounter: 0,
                isSvg: !1
              });
              let j;
              if (typeof f == "string") {
                D.url = f;
                const q = await fetch(f);
                if (!q.ok)
                  throw new Error(q.statusText);
                j = await q.blob();
              } else
                j = D.file = f;
              if (j.type === "image/svg+xml") {
                const q = w._isSVGFittingCanvas, it = new FileReader(), mt = new Image(), kt = new Promise((xt, zt) => {
                  mt.onload = () => {
                    D.bitmap = mt, D.isSvg = !0, xt();
                  }, it.onload = async () => {
                    const Mt = D.svgUrl = it.result;
                    mt.src = await q ? `${Mt}#svgView(preserveAspectRatio(none))` : Mt;
                  }, mt.onerror = it.onerror = zt;
                });
                it.readAsDataURL(j), await kt;
              } else
                D.bitmap = await createImageBitmap(j);
              D.refCounter = 1;
            } catch (j) {
              console.error(j), D = null;
            }
            return t(this, u).set(e, D), D && t(this, u).set(D.id, D), D;
          };
          let B = w;
          class F {
            constructor(e = 128) {
              I(this, y, []);
              I(this, a, !1);
              I(this, l, void 0);
              I(this, k, -1);
              Z(this, l, e);
            }
            add({
              cmd: e,
              undo: f,
              mustExec: D,
              type: j = NaN,
              overwriteIfSameType: q = !1,
              keepUndo: it = !1
            }) {
              if (D && e(), t(this, a))
                return;
              const mt = {
                cmd: e,
                undo: f,
                type: j
              };
              if (t(this, k) === -1) {
                t(this, y).length > 0 && (t(this, y).length = 0), Z(this, k, 0), t(this, y).push(mt);
                return;
              }
              if (q && t(this, y)[t(this, k)].type === j) {
                it && (mt.undo = t(this, y)[t(this, k)].undo), t(this, y)[t(this, k)] = mt;
                return;
              }
              const kt = t(this, k) + 1;
              kt === t(this, l) ? t(this, y).splice(0, 1) : (Z(this, k, kt), kt < t(this, y).length && t(this, y).splice(kt)), t(this, y).push(mt);
            }
            undo() {
              t(this, k) !== -1 && (Z(this, a, !0), t(this, y)[t(this, k)].undo(), Z(this, a, !1), Z(this, k, t(this, k) - 1));
            }
            redo() {
              t(this, k) < t(this, y).length - 1 && (Z(this, k, t(this, k) + 1), Z(this, a, !0), t(this, y)[t(this, k)].cmd(), Z(this, a, !1));
            }
            hasSomethingToUndo() {
              return t(this, k) !== -1;
            }
            hasSomethingToRedo() {
              return t(this, k) < t(this, y).length - 1;
            }
            destroy() {
              Z(this, y, null);
            }
          }
          y = new WeakMap(), a = new WeakMap(), l = new WeakMap(), k = new WeakMap(), d.CommandManager = F;
          class g {
            constructor(e) {
              I(this, p);
              this.buffer = [], this.callbacks = /* @__PURE__ */ new Map(), this.allKeys = /* @__PURE__ */ new Set();
              const {
                isMac: f
              } = c.FeatureTest.platform;
              for (const [D, j, q = {}] of e)
                for (const it of D) {
                  const mt = it.startsWith("mac+");
                  f && mt ? (this.callbacks.set(it.slice(4), {
                    callback: j,
                    options: q
                  }), this.allKeys.add(it.split("+").at(-1))) : !f && !mt && (this.callbacks.set(it, {
                    callback: j,
                    options: q
                  }), this.allKeys.add(it.split("+").at(-1)));
                }
            }
            exec(e, f) {
              if (!this.allKeys.has(f.key))
                return;
              const D = this.callbacks.get(W(this, p, wi).call(this, f));
              if (!D)
                return;
              const {
                callback: j,
                options: {
                  bubbles: q = !1,
                  args: it = [],
                  checker: mt = null
                }
              } = D;
              mt && !mt(e, f) || (j.bind(e, ...it)(), q || (f.stopPropagation(), f.preventDefault()));
            }
          }
          p = new WeakSet(), wi = function(e) {
            e.altKey && this.buffer.push("alt"), e.ctrlKey && this.buffer.push("ctrl"), e.metaKey && this.buffer.push("meta"), e.shiftKey && this.buffer.push("shift"), this.buffer.push(e.key);
            const f = this.buffer.join("+");
            return this.buffer.length = 0, f;
          }, d.KeyboardManager = g;
          const x = class x {
            get _colors() {
              const e = /* @__PURE__ */ new Map([["CanvasText", null], ["Canvas", null]]);
              return (0, P.getColorValues)(e), (0, c.shadow)(this, "_colors", e);
            }
            convert(e) {
              const f = (0, P.getRGB)(e);
              if (!window.matchMedia("(forced-colors: active)").matches)
                return f;
              for (const [D, j] of this._colors)
                if (j.every((q, it) => q === f[it]))
                  return x._colorsMapping.get(D);
              return f;
            }
            getHexCode(e) {
              const f = this._colors.get(e);
              return f ? c.Util.makeHexColor(...f) : e;
            }
          };
          ee(x, "_colorsMapping", /* @__PURE__ */ new Map([["CanvasText", [0, 0, 0]], ["Canvas", [255, 255, 255]]]));
          let L = x;
          d.ColorManager = L;
          const It = class It {
            constructor(e, f, D, j, q, it) {
              I(this, ht);
              I(this, Ct);
              I(this, Gt);
              I(this, Xt);
              I(this, Wt);
              I(this, ot);
              I(this, G);
              I(this, At);
              I(this, Zt);
              I(this, vt);
              I(this, Tt);
              I(this, Nt);
              I(this, _t);
              I(this, m, null);
              I(this, U, /* @__PURE__ */ new Map());
              I(this, z, /* @__PURE__ */ new Map());
              I(this, C, null);
              I(this, V, null);
              I(this, st, new F());
              I(this, at, 0);
              I(this, H, /* @__PURE__ */ new Set());
              I(this, lt, null);
              I(this, gt, null);
              I(this, wt, /* @__PURE__ */ new Set());
              I(this, Pt, null);
              I(this, S, new pt());
              I(this, i, !1);
              I(this, n, !1);
              I(this, s, null);
              I(this, o, c.AnnotationEditorType.NONE);
              I(this, h, /* @__PURE__ */ new Set());
              I(this, _, null);
              I(this, M, this.blur.bind(this));
              I(this, N, this.focus.bind(this));
              I(this, tt, this.copy.bind(this));
              I(this, Q, this.cut.bind(this));
              I(this, nt, this.paste.bind(this));
              I(this, ct, this.keydown.bind(this));
              I(this, yt, this.onEditingAction.bind(this));
              I(this, ut, this.onPageChanging.bind(this));
              I(this, Ft, this.onScaleChanging.bind(this));
              I(this, Bt, this.onRotationChanging.bind(this));
              I(this, St, {
                isEditing: !1,
                isEmpty: !0,
                hasSomethingToUndo: !1,
                hasSomethingToRedo: !1,
                hasSelectedEditor: !1
              });
              I(this, Dt, [0, 0]);
              I(this, ft, null);
              I(this, K, null);
              I(this, J, null);
              Z(this, K, e), Z(this, J, f), Z(this, C, D), this._eventBus = j, this._eventBus._on("editingaction", t(this, yt)), this._eventBus._on("pagechanging", t(this, ut)), this._eventBus._on("scalechanging", t(this, Ft)), this._eventBus._on("rotationchanging", t(this, Bt)), Z(this, V, q.annotationStorage), Z(this, Pt, q.filterFactory), Z(this, _, it), this.viewParameters = {
                realScale: P.PixelsPerInch.PDF_TO_CSS_UNITS,
                rotation: 0
              };
            }
            static get _keyboardManager() {
              const e = It.prototype, f = (q) => {
                const {
                  activeElement: it
                } = document;
                return it && t(q, K).contains(it) && q.hasSomethingToControl();
              }, D = this.TRANSLATE_SMALL, j = this.TRANSLATE_BIG;
              return (0, c.shadow)(this, "_keyboardManager", new g([[["ctrl+a", "mac+meta+a"], e.selectAll], [["ctrl+z", "mac+meta+z"], e.undo], [["ctrl+y", "ctrl+shift+z", "mac+meta+shift+z", "ctrl+shift+Z", "mac+meta+shift+Z"], e.redo], [["Backspace", "alt+Backspace", "ctrl+Backspace", "shift+Backspace", "mac+Backspace", "mac+alt+Backspace", "mac+ctrl+Backspace", "Delete", "ctrl+Delete", "shift+Delete", "mac+Delete"], e.delete], [["Escape", "mac+Escape"], e.unselectAll], [["ArrowLeft", "mac+ArrowLeft"], e.translateSelectedEditors, {
                args: [-D, 0],
                checker: f
              }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], e.translateSelectedEditors, {
                args: [-j, 0],
                checker: f
              }], [["ArrowRight", "mac+ArrowRight"], e.translateSelectedEditors, {
                args: [D, 0],
                checker: f
              }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], e.translateSelectedEditors, {
                args: [j, 0],
                checker: f
              }], [["ArrowUp", "mac+ArrowUp"], e.translateSelectedEditors, {
                args: [0, -D],
                checker: f
              }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], e.translateSelectedEditors, {
                args: [0, -j],
                checker: f
              }], [["ArrowDown", "mac+ArrowDown"], e.translateSelectedEditors, {
                args: [0, D],
                checker: f
              }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], e.translateSelectedEditors, {
                args: [0, j],
                checker: f
              }]]));
            }
            destroy() {
              W(this, Xt, Ce).call(this), W(this, Ct, Xe).call(this), this._eventBus._off("editingaction", t(this, yt)), this._eventBus._off("pagechanging", t(this, ut)), this._eventBus._off("scalechanging", t(this, Ft)), this._eventBus._off("rotationchanging", t(this, Bt));
              for (const e of t(this, z).values())
                e.destroy();
              t(this, z).clear(), t(this, U).clear(), t(this, wt).clear(), Z(this, m, null), t(this, h).clear(), t(this, st).destroy(), t(this, C).destroy();
            }
            get hcmFilter() {
              return (0, c.shadow)(this, "hcmFilter", t(this, _) ? t(this, Pt).addHCMFilter(t(this, _).foreground, t(this, _).background) : "none");
            }
            get direction() {
              return (0, c.shadow)(this, "direction", getComputedStyle(t(this, K)).direction);
            }
            editAltText(e) {
              var f;
              (f = t(this, C)) == null || f.editAltText(this, e);
            }
            onPageChanging({
              pageNumber: e
            }) {
              Z(this, at, e - 1);
            }
            focusMainContainer() {
              t(this, K).focus();
            }
            findParent(e, f) {
              for (const D of t(this, z).values()) {
                const {
                  x: j,
                  y: q,
                  width: it,
                  height: mt
                } = D.div.getBoundingClientRect();
                if (e >= j && e <= j + it && f >= q && f <= q + mt)
                  return D;
              }
              return null;
            }
            disableUserSelect(e = !1) {
              t(this, J).classList.toggle("noUserSelect", e);
            }
            addShouldRescale(e) {
              t(this, wt).add(e);
            }
            removeShouldRescale(e) {
              t(this, wt).delete(e);
            }
            onScaleChanging({
              scale: e
            }) {
              this.commitOrRemove(), this.viewParameters.realScale = e * P.PixelsPerInch.PDF_TO_CSS_UNITS;
              for (const f of t(this, wt))
                f.onScaleChanging();
            }
            onRotationChanging({
              pagesRotation: e
            }) {
              this.commitOrRemove(), this.viewParameters.rotation = e;
            }
            addToAnnotationStorage(e) {
              !e.isEmpty() && t(this, V) && !t(this, V).has(e.id) && t(this, V).setValue(e.id, e);
            }
            blur() {
              if (!this.hasSelection)
                return;
              const {
                activeElement: e
              } = document;
              for (const f of t(this, h))
                if (f.div.contains(e)) {
                  Z(this, s, [f, e]), f._focusEventsAllowed = !1;
                  break;
                }
            }
            focus() {
              if (!t(this, s))
                return;
              const [e, f] = t(this, s);
              Z(this, s, null), f.addEventListener("focusin", () => {
                e._focusEventsAllowed = !0;
              }, {
                once: !0
              }), f.focus();
            }
            addEditListeners() {
              W(this, Gt, Ve).call(this), W(this, Wt, qe).call(this);
            }
            removeEditListeners() {
              W(this, Xt, Ce).call(this), W(this, ot, $e).call(this);
            }
            copy(e) {
              var D;
              if (e.preventDefault(), (D = t(this, m)) == null || D.commitOrRemove(), !this.hasSelection)
                return;
              const f = [];
              for (const j of t(this, h)) {
                const q = j.serialize(!0);
                q && f.push(q);
              }
              f.length !== 0 && e.clipboardData.setData("application/pdfjs", JSON.stringify(f));
            }
            cut(e) {
              this.copy(e), this.delete();
            }
            paste(e) {
              e.preventDefault();
              const {
                clipboardData: f
              } = e;
              for (const q of f.items)
                for (const it of t(this, gt))
                  if (it.isHandlingMimeForPasting(q.type)) {
                    it.paste(q, this.currentLayer);
                    return;
                  }
              let D = f.getData("application/pdfjs");
              if (!D)
                return;
              try {
                D = JSON.parse(D);
              } catch (q) {
                (0, c.warn)(`paste: "${q.message}".`);
                return;
              }
              if (!Array.isArray(D))
                return;
              this.unselectAll();
              const j = this.currentLayer;
              try {
                const q = [];
                for (const kt of D) {
                  const xt = j.deserialize(kt);
                  if (!xt)
                    return;
                  q.push(xt);
                }
                const it = () => {
                  for (const kt of q)
                    W(this, Tt, Ye).call(this, kt);
                  W(this, _t, Ke).call(this, q);
                }, mt = () => {
                  for (const kt of q)
                    kt.remove();
                };
                this.addCommands({
                  cmd: it,
                  undo: mt,
                  mustExec: !0
                });
              } catch (q) {
                (0, c.warn)(`paste: "${q.message}".`);
              }
            }
            keydown(e) {
              var f;
              (f = this.getActive()) != null && f.shouldGetKeyboardEvents() || It._keyboardManager.exec(this, e);
            }
            onEditingAction(e) {
              ["undo", "redo", "delete", "selectAll"].includes(e.name) && this[e.name]();
            }
            setEditingState(e) {
              e ? (W(this, ht, Ci).call(this), W(this, Gt, Ve).call(this), W(this, Wt, qe).call(this), W(this, G, re).call(this, {
                isEditing: t(this, o) !== c.AnnotationEditorType.NONE,
                isEmpty: W(this, Nt, be).call(this),
                hasSomethingToUndo: t(this, st).hasSomethingToUndo(),
                hasSomethingToRedo: t(this, st).hasSomethingToRedo(),
                hasSelectedEditor: !1
              })) : (W(this, Ct, Xe).call(this), W(this, Xt, Ce).call(this), W(this, ot, $e).call(this), W(this, G, re).call(this, {
                isEditing: !1
              }), this.disableUserSelect(!1));
            }
            registerEditorTypes(e) {
              if (!t(this, gt)) {
                Z(this, gt, e);
                for (const f of t(this, gt))
                  W(this, At, me).call(this, f.defaultPropertiesToUpdate);
              }
            }
            getId() {
              return t(this, S).getId();
            }
            get currentLayer() {
              return t(this, z).get(t(this, at));
            }
            getLayer(e) {
              return t(this, z).get(e);
            }
            get currentPageIndex() {
              return t(this, at);
            }
            addLayer(e) {
              t(this, z).set(e.pageIndex, e), t(this, i) ? e.enable() : e.disable();
            }
            removeLayer(e) {
              t(this, z).delete(e.pageIndex);
            }
            updateMode(e, f = null) {
              if (t(this, o) !== e) {
                if (Z(this, o, e), e === c.AnnotationEditorType.NONE) {
                  this.setEditingState(!1), W(this, vt, xi).call(this);
                  return;
                }
                this.setEditingState(!0), W(this, Zt, Ti).call(this), this.unselectAll();
                for (const D of t(this, z).values())
                  D.updateMode(e);
                if (f) {
                  for (const D of t(this, U).values())
                    if (D.annotationElementId === f) {
                      this.setSelected(D), D.enterInEditMode();
                      break;
                    }
                }
              }
            }
            updateToolbar(e) {
              e !== t(this, o) && this._eventBus.dispatch("switchannotationeditormode", {
                source: this,
                mode: e
              });
            }
            updateParams(e, f) {
              if (t(this, gt)) {
                if (e === c.AnnotationEditorParamsType.CREATE) {
                  this.currentLayer.addNewEditor(e);
                  return;
                }
                for (const D of t(this, h))
                  D.updateParams(e, f);
                for (const D of t(this, gt))
                  D.updateDefaultParams(e, f);
              }
            }
            enableWaiting(e = !1) {
              if (t(this, n) !== e) {
                Z(this, n, e);
                for (const f of t(this, z).values())
                  e ? f.disableClick() : f.enableClick(), f.div.classList.toggle("waiting", e);
              }
            }
            getEditors(e) {
              const f = [];
              for (const D of t(this, U).values())
                D.pageIndex === e && f.push(D);
              return f;
            }
            getEditor(e) {
              return t(this, U).get(e);
            }
            addEditor(e) {
              t(this, U).set(e.id, e);
            }
            removeEditor(e) {
              var f;
              t(this, U).delete(e.id), this.unselect(e), (!e.annotationElementId || !t(this, H).has(e.annotationElementId)) && ((f = t(this, V)) == null || f.remove(e.id));
            }
            addDeletedAnnotationElement(e) {
              t(this, H).add(e.annotationElementId), e.deleted = !0;
            }
            isDeletedAnnotationElement(e) {
              return t(this, H).has(e);
            }
            removeDeletedAnnotationElement(e) {
              t(this, H).delete(e.annotationElementId), e.deleted = !1;
            }
            setActiveEditor(e) {
              t(this, m) !== e && (Z(this, m, e), e && W(this, At, me).call(this, e.propertiesToUpdate));
            }
            toggleSelected(e) {
              if (t(this, h).has(e)) {
                t(this, h).delete(e), e.unselect(), W(this, G, re).call(this, {
                  hasSelectedEditor: this.hasSelection
                });
                return;
              }
              t(this, h).add(e), e.select(), W(this, At, me).call(this, e.propertiesToUpdate), W(this, G, re).call(this, {
                hasSelectedEditor: !0
              });
            }
            setSelected(e) {
              for (const f of t(this, h))
                f !== e && f.unselect();
              t(this, h).clear(), t(this, h).add(e), e.select(), W(this, At, me).call(this, e.propertiesToUpdate), W(this, G, re).call(this, {
                hasSelectedEditor: !0
              });
            }
            isSelected(e) {
              return t(this, h).has(e);
            }
            unselect(e) {
              e.unselect(), t(this, h).delete(e), W(this, G, re).call(this, {
                hasSelectedEditor: this.hasSelection
              });
            }
            get hasSelection() {
              return t(this, h).size !== 0;
            }
            undo() {
              t(this, st).undo(), W(this, G, re).call(this, {
                hasSomethingToUndo: t(this, st).hasSomethingToUndo(),
                hasSomethingToRedo: !0,
                isEmpty: W(this, Nt, be).call(this)
              });
            }
            redo() {
              t(this, st).redo(), W(this, G, re).call(this, {
                hasSomethingToUndo: !0,
                hasSomethingToRedo: t(this, st).hasSomethingToRedo(),
                isEmpty: W(this, Nt, be).call(this)
              });
            }
            addCommands(e) {
              t(this, st).add(e), W(this, G, re).call(this, {
                hasSomethingToUndo: !0,
                hasSomethingToRedo: !1,
                isEmpty: W(this, Nt, be).call(this)
              });
            }
            delete() {
              if (this.commitOrRemove(), !this.hasSelection)
                return;
              const e = [...t(this, h)], f = () => {
                for (const j of e)
                  j.remove();
              }, D = () => {
                for (const j of e)
                  W(this, Tt, Ye).call(this, j);
              };
              this.addCommands({
                cmd: f,
                undo: D,
                mustExec: !0
              });
            }
            commitOrRemove() {
              var e;
              (e = t(this, m)) == null || e.commitOrRemove();
            }
            hasSomethingToControl() {
              return t(this, m) || this.hasSelection;
            }
            selectAll() {
              for (const e of t(this, h))
                e.commit();
              W(this, _t, Ke).call(this, t(this, U).values());
            }
            unselectAll() {
              if (t(this, m)) {
                t(this, m).commitOrRemove();
                return;
              }
              if (this.hasSelection) {
                for (const e of t(this, h))
                  e.unselect();
                t(this, h).clear(), W(this, G, re).call(this, {
                  hasSelectedEditor: !1
                });
              }
            }
            translateSelectedEditors(e, f, D = !1) {
              if (D || this.commitOrRemove(), !this.hasSelection)
                return;
              t(this, Dt)[0] += e, t(this, Dt)[1] += f;
              const [j, q] = t(this, Dt), it = [...t(this, h)], mt = 1e3;
              t(this, ft) && clearTimeout(t(this, ft)), Z(this, ft, setTimeout(() => {
                Z(this, ft, null), t(this, Dt)[0] = t(this, Dt)[1] = 0, this.addCommands({
                  cmd: () => {
                    for (const kt of it)
                      t(this, U).has(kt.id) && kt.translateInPage(j, q);
                  },
                  undo: () => {
                    for (const kt of it)
                      t(this, U).has(kt.id) && kt.translateInPage(-j, -q);
                  },
                  mustExec: !1
                });
              }, mt));
              for (const kt of it)
                kt.translateInPage(e, f);
            }
            setUpDragSession() {
              if (this.hasSelection) {
                this.disableUserSelect(!0), Z(this, lt, /* @__PURE__ */ new Map());
                for (const e of t(this, h))
                  t(this, lt).set(e, {
                    savedX: e.x,
                    savedY: e.y,
                    savedPageIndex: e.pageIndex,
                    newX: 0,
                    newY: 0,
                    newPageIndex: -1
                  });
              }
            }
            endDragSession() {
              if (!t(this, lt))
                return !1;
              this.disableUserSelect(!1);
              const e = t(this, lt);
              Z(this, lt, null);
              let f = !1;
              for (const [{
                x: j,
                y: q,
                pageIndex: it
              }, mt] of e)
                mt.newX = j, mt.newY = q, mt.newPageIndex = it, f || (f = j !== mt.savedX || q !== mt.savedY || it !== mt.savedPageIndex);
              if (!f)
                return !1;
              const D = (j, q, it, mt) => {
                if (t(this, U).has(j.id)) {
                  const kt = t(this, z).get(mt);
                  kt ? j._setParentAndPosition(kt, q, it) : (j.pageIndex = mt, j.x = q, j.y = it);
                }
              };
              return this.addCommands({
                cmd: () => {
                  for (const [j, {
                    newX: q,
                    newY: it,
                    newPageIndex: mt
                  }] of e)
                    D(j, q, it, mt);
                },
                undo: () => {
                  for (const [j, {
                    savedX: q,
                    savedY: it,
                    savedPageIndex: mt
                  }] of e)
                    D(j, q, it, mt);
                },
                mustExec: !0
              }), !0;
            }
            dragSelectedEditors(e, f) {
              if (t(this, lt))
                for (const D of t(this, lt).keys())
                  D.drag(e, f);
            }
            rebuild(e) {
              if (e.parent === null) {
                const f = this.getLayer(e.pageIndex);
                f ? (f.changeParent(e), f.addOrRebuild(e)) : (this.addEditor(e), this.addToAnnotationStorage(e), e.rebuild());
              } else
                e.parent.addOrRebuild(e);
            }
            isActive(e) {
              return t(this, m) === e;
            }
            getActive() {
              return t(this, m);
            }
            getMode() {
              return t(this, o);
            }
            get imageManager() {
              return (0, c.shadow)(this, "imageManager", new B());
            }
          };
          m = new WeakMap(), U = new WeakMap(), z = new WeakMap(), C = new WeakMap(), V = new WeakMap(), st = new WeakMap(), at = new WeakMap(), H = new WeakMap(), lt = new WeakMap(), gt = new WeakMap(), wt = new WeakMap(), Pt = new WeakMap(), S = new WeakMap(), i = new WeakMap(), n = new WeakMap(), s = new WeakMap(), o = new WeakMap(), h = new WeakMap(), _ = new WeakMap(), M = new WeakMap(), N = new WeakMap(), tt = new WeakMap(), Q = new WeakMap(), nt = new WeakMap(), ct = new WeakMap(), yt = new WeakMap(), ut = new WeakMap(), Ft = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Dt = new WeakMap(), ft = new WeakMap(), K = new WeakMap(), J = new WeakMap(), ht = new WeakSet(), Ci = function() {
            window.addEventListener("focus", t(this, N)), window.addEventListener("blur", t(this, M));
          }, Ct = new WeakSet(), Xe = function() {
            window.removeEventListener("focus", t(this, N)), window.removeEventListener("blur", t(this, M));
          }, Gt = new WeakSet(), Ve = function() {
            window.addEventListener("keydown", t(this, ct), {
              capture: !0
            });
          }, Xt = new WeakSet(), Ce = function() {
            window.removeEventListener("keydown", t(this, ct), {
              capture: !0
            });
          }, Wt = new WeakSet(), qe = function() {
            document.addEventListener("copy", t(this, tt)), document.addEventListener("cut", t(this, Q)), document.addEventListener("paste", t(this, nt));
          }, ot = new WeakSet(), $e = function() {
            document.removeEventListener("copy", t(this, tt)), document.removeEventListener("cut", t(this, Q)), document.removeEventListener("paste", t(this, nt));
          }, G = new WeakSet(), re = function(e) {
            Object.entries(e).some(([D, j]) => t(this, St)[D] !== j) && this._eventBus.dispatch("annotationeditorstateschanged", {
              source: this,
              details: Object.assign(t(this, St), e)
            });
          }, At = new WeakSet(), me = function(e) {
            this._eventBus.dispatch("annotationeditorparamschanged", {
              source: this,
              details: e
            });
          }, Zt = new WeakSet(), Ti = function() {
            if (!t(this, i)) {
              Z(this, i, !0);
              for (const e of t(this, z).values())
                e.enable();
            }
          }, vt = new WeakSet(), xi = function() {
            if (this.unselectAll(), t(this, i)) {
              Z(this, i, !1);
              for (const e of t(this, z).values())
                e.disable();
            }
          }, Tt = new WeakSet(), Ye = function(e) {
            const f = t(this, z).get(e.pageIndex);
            f ? f.addOrRebuild(e) : this.addEditor(e);
          }, Nt = new WeakSet(), be = function() {
            if (t(this, U).size === 0)
              return !0;
            if (t(this, U).size === 1)
              for (const e of t(this, U).values())
                return e.isEmpty();
            return !1;
          }, _t = new WeakSet(), Ke = function(e) {
            t(this, h).clear();
            for (const f of e)
              f.isEmpty() || (t(this, h).add(f), f.select());
            W(this, G, re).call(this, {
              hasSelectedEditor: !0
            });
          }, ee(It, "TRANSLATE_SMALL", 1), ee(It, "TRANSLATE_BIG", 10);
          let O = It;
          d.AnnotationEditorUIManager = O;
        },
        /* 6 */
        /***/
        (dt, d, et) => {
          var at, H, lt, gt, wt, Pt, S, i, n, s, o, h, de, M, ue, tt, Je, nt, Te, yt, xe, Ft, _e, St, Ae;
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.StatTimer = d.RenderingCancelledException = d.PixelsPerInch = d.PageViewport = d.PDFDateString = d.DOMStandardFontDataFactory = d.DOMSVGFactory = d.DOMFilterFactory = d.DOMCanvasFactory = d.DOMCMapReaderFactory = void 0, d.deprecated = k, d.getColorValues = U, d.getCurrentTransform = z, d.getCurrentTransformInverse = C, d.getFilenameFromUrl = b, d.getPdfFilenameFromUrl = E, d.getRGB = m, d.getXfaPageViewport = x, d.isDataScheme = A, d.isPdfFile = u, d.isValidFetchUrl = y, d.loadScript = l, d.noContextMenu = a, d.setLayerDimensions = V;
          var c = et(7), P = et(1);
          const rt = "http://www.w3.org/2000/svg", st = class st {
          };
          ee(st, "CSS", 96), ee(st, "PDF", 72), ee(st, "PDF_TO_CSS_UNITS", st.CSS / st.PDF);
          let X = st;
          d.PixelsPerInch = X;
          class pt extends c.BaseFilterFactory {
            constructor({
              docId: J,
              ownerDocument: ht = globalThis.document
            } = {}) {
              super();
              I(this, h);
              I(this, M);
              I(this, tt);
              I(this, nt);
              I(this, yt);
              I(this, Ft);
              I(this, St);
              I(this, at, void 0);
              I(this, H, void 0);
              I(this, lt, void 0);
              I(this, gt, void 0);
              I(this, wt, void 0);
              I(this, Pt, void 0);
              I(this, S, void 0);
              I(this, i, void 0);
              I(this, n, void 0);
              I(this, s, void 0);
              I(this, o, 0);
              Z(this, lt, J), Z(this, gt, ht);
            }
            addFilter(J) {
              if (!J)
                return "none";
              let ht = t(this, h, de).get(J);
              if (ht)
                return ht;
              let Et, Ct, Ut, Gt;
              if (J.length === 1) {
                const Wt = J[0], $t = new Array(256);
                for (let ot = 0; ot < 256; ot++)
                  $t[ot] = Wt[ot] / 255;
                Gt = Et = Ct = Ut = $t.join(",");
              } else {
                const [Wt, $t, ot] = J, Y = new Array(256), G = new Array(256), bt = new Array(256);
                for (let At = 0; At < 256; At++)
                  Y[At] = Wt[At] / 255, G[At] = $t[At] / 255, bt[At] = ot[At] / 255;
                Et = Y.join(","), Ct = G.join(","), Ut = bt.join(","), Gt = `${Et}${Ct}${Ut}`;
              }
              if (ht = t(this, h, de).get(Gt), ht)
                return t(this, h, de).set(J, ht), ht;
              const Ht = `g_${t(this, lt)}_transfer_map_${ge(this, o)._++}`, Xt = `url(#${Ht})`;
              t(this, h, de).set(J, Xt), t(this, h, de).set(Gt, Xt);
              const Vt = W(this, nt, Te).call(this, Ht);
              return W(this, Ft, _e).call(this, Et, Ct, Ut, Vt), Xt;
            }
            addHCMFilter(J, ht) {
              var $t;
              const Et = `${J}-${ht}`;
              if (t(this, Pt) === Et)
                return t(this, S);
              if (Z(this, Pt, Et), Z(this, S, "none"), ($t = t(this, wt)) == null || $t.remove(), !J || !ht)
                return t(this, S);
              const Ct = W(this, St, Ae).call(this, J);
              J = P.Util.makeHexColor(...Ct);
              const Ut = W(this, St, Ae).call(this, ht);
              if (ht = P.Util.makeHexColor(...Ut), t(this, M, ue).style.color = "", J === "#000000" && ht === "#ffffff" || J === ht)
                return t(this, S);
              const Gt = new Array(256);
              for (let ot = 0; ot <= 255; ot++) {
                const Y = ot / 255;
                Gt[ot] = Y <= 0.03928 ? Y / 12.92 : ((Y + 0.055) / 1.055) ** 2.4;
              }
              const Ht = Gt.join(","), Xt = `g_${t(this, lt)}_hcm_filter`, Vt = Z(this, i, W(this, nt, Te).call(this, Xt));
              W(this, Ft, _e).call(this, Ht, Ht, Ht, Vt), W(this, tt, Je).call(this, Vt);
              const Wt = (ot, Y) => {
                const G = Ct[ot] / 255, bt = Ut[ot] / 255, At = new Array(Y + 1);
                for (let te = 0; te <= Y; te++)
                  At[te] = G + te / Y * (bt - G);
                return At.join(",");
              };
              return W(this, Ft, _e).call(this, Wt(0, 5), Wt(1, 5), Wt(2, 5), Vt), Z(this, S, `url(#${Xt})`), t(this, S);
            }
            addHighlightHCMFilter(J, ht, Et, Ct) {
              var bt;
              const Ut = `${J}-${ht}-${Et}-${Ct}`;
              if (t(this, n) === Ut)
                return t(this, s);
              if (Z(this, n, Ut), Z(this, s, "none"), (bt = t(this, i)) == null || bt.remove(), !J || !ht)
                return t(this, s);
              const [Gt, Ht] = [J, ht].map(W(this, St, Ae).bind(this));
              let Xt = Math.round(0.2126 * Gt[0] + 0.7152 * Gt[1] + 0.0722 * Gt[2]), Vt = Math.round(0.2126 * Ht[0] + 0.7152 * Ht[1] + 0.0722 * Ht[2]), [Wt, $t] = [Et, Ct].map(W(this, St, Ae).bind(this));
              Vt < Xt && ([Xt, Vt, Wt, $t] = [Vt, Xt, $t, Wt]), t(this, M, ue).style.color = "";
              const ot = (At, te, Zt) => {
                const $ = new Array(256), vt = (Vt - Xt) / Zt, Lt = At / 255, Tt = (te - At) / (255 * Zt);
                let Ot = 0;
                for (let Nt = 0; Nt <= Zt; Nt++) {
                  const Jt = Math.round(Xt + Nt * vt), _t = Lt + Nt * Tt;
                  for (let Yt = Ot; Yt <= Jt; Yt++)
                    $[Yt] = _t;
                  Ot = Jt + 1;
                }
                for (let Nt = Ot; Nt < 256; Nt++)
                  $[Nt] = $[Ot - 1];
                return $.join(",");
              }, Y = `g_${t(this, lt)}_hcm_highlight_filter`, G = Z(this, i, W(this, nt, Te).call(this, Y));
              return W(this, tt, Je).call(this, G), W(this, Ft, _e).call(this, ot(Wt[0], $t[0], 5), ot(Wt[1], $t[1], 5), ot(Wt[2], $t[2], 5), G), Z(this, s, `url(#${Y})`), t(this, s);
            }
            destroy(J = !1) {
              J && (t(this, S) || t(this, s)) || (t(this, H) && (t(this, H).parentNode.parentNode.remove(), Z(this, H, null)), t(this, at) && (t(this, at).clear(), Z(this, at, null)), Z(this, o, 0));
            }
          }
          at = new WeakMap(), H = new WeakMap(), lt = new WeakMap(), gt = new WeakMap(), wt = new WeakMap(), Pt = new WeakMap(), S = new WeakMap(), i = new WeakMap(), n = new WeakMap(), s = new WeakMap(), o = new WeakMap(), h = new WeakSet(), de = function() {
            return t(this, at) || Z(this, at, /* @__PURE__ */ new Map());
          }, M = new WeakSet(), ue = function() {
            if (!t(this, H)) {
              const J = t(this, gt).createElement("div"), {
                style: ht
              } = J;
              ht.visibility = "hidden", ht.contain = "strict", ht.width = ht.height = 0, ht.position = "absolute", ht.top = ht.left = 0, ht.zIndex = -1;
              const Et = t(this, gt).createElementNS(rt, "svg");
              Et.setAttribute("width", 0), Et.setAttribute("height", 0), Z(this, H, t(this, gt).createElementNS(rt, "defs")), J.append(Et), Et.append(t(this, H)), t(this, gt).body.append(J);
            }
            return t(this, H);
          }, tt = new WeakSet(), Je = function(J) {
            const ht = t(this, gt).createElementNS(rt, "feColorMatrix");
            ht.setAttribute("type", "matrix"), ht.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"), J.append(ht);
          }, nt = new WeakSet(), Te = function(J) {
            const ht = t(this, gt).createElementNS(rt, "filter");
            return ht.setAttribute("color-interpolation-filters", "sRGB"), ht.setAttribute("id", J), t(this, M, ue).append(ht), ht;
          }, yt = new WeakSet(), xe = function(J, ht, Et) {
            const Ct = t(this, gt).createElementNS(rt, ht);
            Ct.setAttribute("type", "discrete"), Ct.setAttribute("tableValues", Et), J.append(Ct);
          }, Ft = new WeakSet(), _e = function(J, ht, Et, Ct) {
            const Ut = t(this, gt).createElementNS(rt, "feComponentTransfer");
            Ct.append(Ut), W(this, yt, xe).call(this, Ut, "feFuncR", J), W(this, yt, xe).call(this, Ut, "feFuncG", ht), W(this, yt, xe).call(this, Ut, "feFuncB", Et);
          }, St = new WeakSet(), Ae = function(J) {
            return t(this, M, ue).style.color = J, m(getComputedStyle(t(this, M, ue)).getPropertyValue("color"));
          }, d.DOMFilterFactory = pt;
          class B extends c.BaseCanvasFactory {
            constructor({
              ownerDocument: K = globalThis.document
            } = {}) {
              super(), this._document = K;
            }
            _createCanvas(K, J) {
              const ht = this._document.createElement("canvas");
              return ht.width = K, ht.height = J, ht;
            }
          }
          d.DOMCanvasFactory = B;
          async function F(ft, K = !1) {
            if (y(ft, document.baseURI)) {
              const J = await fetch(ft);
              if (!J.ok)
                throw new Error(J.statusText);
              return K ? new Uint8Array(await J.arrayBuffer()) : (0, P.stringToBytes)(await J.text());
            }
            return new Promise((J, ht) => {
              const Et = new XMLHttpRequest();
              Et.open("GET", ft, !0), K && (Et.responseType = "arraybuffer"), Et.onreadystatechange = () => {
                if (Et.readyState === XMLHttpRequest.DONE) {
                  if (Et.status === 200 || Et.status === 0) {
                    let Ct;
                    if (K && Et.response ? Ct = new Uint8Array(Et.response) : !K && Et.responseText && (Ct = (0, P.stringToBytes)(Et.responseText)), Ct) {
                      J(Ct);
                      return;
                    }
                  }
                  ht(new Error(Et.statusText));
                }
              }, Et.send(null);
            });
          }
          class g extends c.BaseCMapReaderFactory {
            _fetchData(K, J) {
              return F(K, this.isCompressed).then((ht) => ({
                cMapData: ht,
                compressionType: J
              }));
            }
          }
          d.DOMCMapReaderFactory = g;
          class L extends c.BaseStandardFontDataFactory {
            _fetchData(K) {
              return F(K, !0);
            }
          }
          d.DOMStandardFontDataFactory = L;
          class O extends c.BaseSVGFactory {
            _createSVG(K) {
              return document.createElementNS(rt, K);
            }
          }
          d.DOMSVGFactory = O;
          class T {
            constructor({
              viewBox: K,
              scale: J,
              rotation: ht,
              offsetX: Et = 0,
              offsetY: Ct = 0,
              dontFlip: Ut = !1
            }) {
              this.viewBox = K, this.scale = J, this.rotation = ht, this.offsetX = Et, this.offsetY = Ct;
              const Gt = (K[2] + K[0]) / 2, Ht = (K[3] + K[1]) / 2;
              let Xt, Vt, Wt, $t;
              switch (ht %= 360, ht < 0 && (ht += 360), ht) {
                case 180:
                  Xt = -1, Vt = 0, Wt = 0, $t = 1;
                  break;
                case 90:
                  Xt = 0, Vt = 1, Wt = 1, $t = 0;
                  break;
                case 270:
                  Xt = 0, Vt = -1, Wt = -1, $t = 0;
                  break;
                case 0:
                  Xt = 1, Vt = 0, Wt = 0, $t = -1;
                  break;
                default:
                  throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.");
              }
              Ut && (Wt = -Wt, $t = -$t);
              let ot, Y, G, bt;
              Xt === 0 ? (ot = Math.abs(Ht - K[1]) * J + Et, Y = Math.abs(Gt - K[0]) * J + Ct, G = (K[3] - K[1]) * J, bt = (K[2] - K[0]) * J) : (ot = Math.abs(Gt - K[0]) * J + Et, Y = Math.abs(Ht - K[1]) * J + Ct, G = (K[2] - K[0]) * J, bt = (K[3] - K[1]) * J), this.transform = [Xt * J, Vt * J, Wt * J, $t * J, ot - Xt * J * Gt - Wt * J * Ht, Y - Vt * J * Gt - $t * J * Ht], this.width = G, this.height = bt;
            }
            get rawDims() {
              const {
                viewBox: K
              } = this;
              return (0, P.shadow)(this, "rawDims", {
                pageWidth: K[2] - K[0],
                pageHeight: K[3] - K[1],
                pageX: K[0],
                pageY: K[1]
              });
            }
            clone({
              scale: K = this.scale,
              rotation: J = this.rotation,
              offsetX: ht = this.offsetX,
              offsetY: Et = this.offsetY,
              dontFlip: Ct = !1
            } = {}) {
              return new T({
                viewBox: this.viewBox.slice(),
                scale: K,
                rotation: J,
                offsetX: ht,
                offsetY: Et,
                dontFlip: Ct
              });
            }
            convertToViewportPoint(K, J) {
              return P.Util.applyTransform([K, J], this.transform);
            }
            convertToViewportRectangle(K) {
              const J = P.Util.applyTransform([K[0], K[1]], this.transform), ht = P.Util.applyTransform([K[2], K[3]], this.transform);
              return [J[0], J[1], ht[0], ht[1]];
            }
            convertToPdfPoint(K, J) {
              return P.Util.applyInverseTransform([K, J], this.transform);
            }
          }
          d.PageViewport = T;
          class v extends P.BaseException {
            constructor(K, J = 0) {
              super(K, "RenderingCancelledException"), this.extraDelay = J;
            }
          }
          d.RenderingCancelledException = v;
          function A(ft) {
            const K = ft.length;
            let J = 0;
            for (; J < K && ft[J].trim() === ""; )
              J++;
            return ft.substring(J, J + 5).toLowerCase() === "data:";
          }
          function u(ft) {
            return typeof ft == "string" && /\.pdf$/i.test(ft);
          }
          function b(ft, K = !1) {
            return K || ([ft] = ft.split(/[#?]/, 1)), ft.substring(ft.lastIndexOf("/") + 1);
          }
          function E(ft, K = "document.pdf") {
            if (typeof ft != "string")
              return K;
            if (A(ft))
              return (0, P.warn)('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'), K;
            const J = /^(?:(?:[^:]+:)?\/\/[^/]+)?([^?#]*)(\?[^#]*)?(#.*)?$/, ht = /[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i, Et = J.exec(ft);
            let Ct = ht.exec(Et[1]) || ht.exec(Et[2]) || ht.exec(Et[3]);
            if (Ct && (Ct = Ct[0], Ct.includes("%")))
              try {
                Ct = ht.exec(decodeURIComponent(Ct))[0];
              } catch {
              }
            return Ct || K;
          }
          class w {
            constructor() {
              ee(this, "started", /* @__PURE__ */ Object.create(null));
              ee(this, "times", []);
            }
            time(K) {
              K in this.started && (0, P.warn)(`Timer is already running for ${K}`), this.started[K] = Date.now();
            }
            timeEnd(K) {
              K in this.started || (0, P.warn)(`Timer has not been started for ${K}`), this.times.push({
                name: K,
                start: this.started[K],
                end: Date.now()
              }), delete this.started[K];
            }
            toString() {
              const K = [];
              let J = 0;
              for (const {
                name: ht
              } of this.times)
                J = Math.max(ht.length, J);
              for (const {
                name: ht,
                start: Et,
                end: Ct
              } of this.times)
                K.push(`${ht.padEnd(J)} ${Ct - Et}ms
`);
              return K.join("");
            }
          }
          d.StatTimer = w;
          function y(ft, K) {
            try {
              const {
                protocol: J
              } = K ? new URL(ft, K) : new URL(ft);
              return J === "http:" || J === "https:";
            } catch {
              return !1;
            }
          }
          function a(ft) {
            ft.preventDefault();
          }
          function l(ft, K = !1) {
            return new Promise((J, ht) => {
              const Et = document.createElement("script");
              Et.src = ft, Et.onload = function(Ct) {
                K && Et.remove(), J(Ct);
              }, Et.onerror = function() {
                ht(new Error(`Cannot load script at: ${Et.src}`));
              }, (document.head || document.documentElement).append(Et);
            });
          }
          function k(ft) {
            console.log("Deprecated API usage: " + ft);
          }
          let p;
          class r {
            static toDateObject(K) {
              if (!K || typeof K != "string")
                return null;
              p || (p = new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?"));
              const J = p.exec(K);
              if (!J)
                return null;
              const ht = parseInt(J[1], 10);
              let Et = parseInt(J[2], 10);
              Et = Et >= 1 && Et <= 12 ? Et - 1 : 0;
              let Ct = parseInt(J[3], 10);
              Ct = Ct >= 1 && Ct <= 31 ? Ct : 1;
              let Ut = parseInt(J[4], 10);
              Ut = Ut >= 0 && Ut <= 23 ? Ut : 0;
              let Gt = parseInt(J[5], 10);
              Gt = Gt >= 0 && Gt <= 59 ? Gt : 0;
              let Ht = parseInt(J[6], 10);
              Ht = Ht >= 0 && Ht <= 59 ? Ht : 0;
              const Xt = J[7] || "Z";
              let Vt = parseInt(J[8], 10);
              Vt = Vt >= 0 && Vt <= 23 ? Vt : 0;
              let Wt = parseInt(J[9], 10) || 0;
              return Wt = Wt >= 0 && Wt <= 59 ? Wt : 0, Xt === "-" ? (Ut += Vt, Gt += Wt) : Xt === "+" && (Ut -= Vt, Gt -= Wt), new Date(Date.UTC(ht, Et, Ct, Ut, Gt, Ht));
            }
          }
          d.PDFDateString = r;
          function x(ft, {
            scale: K = 1,
            rotation: J = 0
          }) {
            const {
              width: ht,
              height: Et
            } = ft.attributes.style, Ct = [0, 0, parseInt(ht), parseInt(Et)];
            return new T({
              viewBox: Ct,
              scale: K,
              rotation: J
            });
          }
          function m(ft) {
            if (ft.startsWith("#")) {
              const K = parseInt(ft.slice(1), 16);
              return [(K & 16711680) >> 16, (K & 65280) >> 8, K & 255];
            }
            return ft.startsWith("rgb(") ? ft.slice(4, -1).split(",").map((K) => parseInt(K)) : ft.startsWith("rgba(") ? ft.slice(5, -1).split(",").map((K) => parseInt(K)).slice(0, 3) : ((0, P.warn)(`Not a valid color format: "${ft}"`), [0, 0, 0]);
          }
          function U(ft) {
            const K = document.createElement("span");
            K.style.visibility = "hidden", document.body.append(K);
            for (const J of ft.keys()) {
              K.style.color = J;
              const ht = window.getComputedStyle(K).color;
              ft.set(J, m(ht));
            }
            K.remove();
          }
          function z(ft) {
            const {
              a: K,
              b: J,
              c: ht,
              d: Et,
              e: Ct,
              f: Ut
            } = ft.getTransform();
            return [K, J, ht, Et, Ct, Ut];
          }
          function C(ft) {
            const {
              a: K,
              b: J,
              c: ht,
              d: Et,
              e: Ct,
              f: Ut
            } = ft.getTransform().invertSelf();
            return [K, J, ht, Et, Ct, Ut];
          }
          function V(ft, K, J = !1, ht = !0) {
            if (K instanceof T) {
              const {
                pageWidth: Et,
                pageHeight: Ct
              } = K.rawDims, {
                style: Ut
              } = ft, Gt = P.FeatureTest.isCSSRoundSupported, Ht = `var(--scale-factor) * ${Et}px`, Xt = `var(--scale-factor) * ${Ct}px`, Vt = Gt ? `round(${Ht}, 1px)` : `calc(${Ht})`, Wt = Gt ? `round(${Xt}, 1px)` : `calc(${Xt})`;
              !J || K.rotation % 180 === 0 ? (Ut.width = Vt, Ut.height = Wt) : (Ut.width = Wt, Ut.height = Vt);
            }
            ht && ft.setAttribute("data-main-rotation", K.rotation);
          }
        },
        /* 7 */
        /***/
        (dt, d, et) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.BaseStandardFontDataFactory = d.BaseSVGFactory = d.BaseFilterFactory = d.BaseCanvasFactory = d.BaseCMapReaderFactory = void 0;
          var c = et(1);
          class P {
            constructor() {
              this.constructor === P && (0, c.unreachable)("Cannot initialize BaseFilterFactory.");
            }
            addFilter(g) {
              return "none";
            }
            addHCMFilter(g, L) {
              return "none";
            }
            addHighlightHCMFilter(g, L, O, T) {
              return "none";
            }
            destroy(g = !1) {
            }
          }
          d.BaseFilterFactory = P;
          class rt {
            constructor() {
              this.constructor === rt && (0, c.unreachable)("Cannot initialize BaseCanvasFactory.");
            }
            create(g, L) {
              if (g <= 0 || L <= 0)
                throw new Error("Invalid canvas size");
              const O = this._createCanvas(g, L);
              return {
                canvas: O,
                context: O.getContext("2d")
              };
            }
            reset(g, L, O) {
              if (!g.canvas)
                throw new Error("Canvas is not specified");
              if (L <= 0 || O <= 0)
                throw new Error("Invalid canvas size");
              g.canvas.width = L, g.canvas.height = O;
            }
            destroy(g) {
              if (!g.canvas)
                throw new Error("Canvas is not specified");
              g.canvas.width = 0, g.canvas.height = 0, g.canvas = null, g.context = null;
            }
            _createCanvas(g, L) {
              (0, c.unreachable)("Abstract method `_createCanvas` called.");
            }
          }
          d.BaseCanvasFactory = rt;
          class X {
            constructor({
              baseUrl: g = null,
              isCompressed: L = !0
            }) {
              this.constructor === X && (0, c.unreachable)("Cannot initialize BaseCMapReaderFactory."), this.baseUrl = g, this.isCompressed = L;
            }
            async fetch({
              name: g
            }) {
              if (!this.baseUrl)
                throw new Error('The CMap "baseUrl" parameter must be specified, ensure that the "cMapUrl" and "cMapPacked" API parameters are provided.');
              if (!g)
                throw new Error("CMap name must be specified.");
              const L = this.baseUrl + g + (this.isCompressed ? ".bcmap" : ""), O = this.isCompressed ? c.CMapCompressionType.BINARY : c.CMapCompressionType.NONE;
              return this._fetchData(L, O).catch((T) => {
                throw new Error(`Unable to load ${this.isCompressed ? "binary " : ""}CMap at: ${L}`);
              });
            }
            _fetchData(g, L) {
              (0, c.unreachable)("Abstract method `_fetchData` called.");
            }
          }
          d.BaseCMapReaderFactory = X;
          class pt {
            constructor({
              baseUrl: g = null
            }) {
              this.constructor === pt && (0, c.unreachable)("Cannot initialize BaseStandardFontDataFactory."), this.baseUrl = g;
            }
            async fetch({
              filename: g
            }) {
              if (!this.baseUrl)
                throw new Error('The standard font "baseUrl" parameter must be specified, ensure that the "standardFontDataUrl" API parameter is provided.');
              if (!g)
                throw new Error("Font filename must be specified.");
              const L = `${this.baseUrl}${g}`;
              return this._fetchData(L).catch((O) => {
                throw new Error(`Unable to load font data at: ${L}`);
              });
            }
            _fetchData(g) {
              (0, c.unreachable)("Abstract method `_fetchData` called.");
            }
          }
          d.BaseStandardFontDataFactory = pt;
          class B {
            constructor() {
              this.constructor === B && (0, c.unreachable)("Cannot initialize BaseSVGFactory.");
            }
            create(g, L, O = !1) {
              if (g <= 0 || L <= 0)
                throw new Error("Invalid SVG dimensions");
              const T = this._createSVG("svg:svg");
              return T.setAttribute("version", "1.1"), O || (T.setAttribute("width", `${g}px`), T.setAttribute("height", `${L}px`)), T.setAttribute("preserveAspectRatio", "none"), T.setAttribute("viewBox", `0 0 ${g} ${L}`), T;
            }
            createElement(g) {
              if (typeof g != "string")
                throw new Error("Invalid SVG element type");
              return this._createSVG(g);
            }
            _createSVG(g) {
              (0, c.unreachable)("Abstract method `_createSVG` called.");
            }
          }
          d.BaseSVGFactory = B;
        },
        /* 8 */
        /***/
        (dt, d, et) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.MurmurHash3_64 = void 0;
          var c = et(1);
          const P = 3285377520, rt = 4294901760, X = 65535;
          class pt {
            constructor(F) {
              this.h1 = F ? F & 4294967295 : P, this.h2 = F ? F & 4294967295 : P;
            }
            update(F) {
              let g, L;
              if (typeof F == "string") {
                g = new Uint8Array(F.length * 2), L = 0;
                for (let k = 0, p = F.length; k < p; k++) {
                  const r = F.charCodeAt(k);
                  r <= 255 ? g[L++] = r : (g[L++] = r >>> 8, g[L++] = r & 255);
                }
              } else if ((0, c.isArrayBuffer)(F))
                g = F.slice(), L = g.byteLength;
              else
                throw new Error("Wrong data format in MurmurHash3_64_update. Input must be a string or array.");
              const O = L >> 2, T = L - O * 4, v = new Uint32Array(g.buffer, 0, O);
              let A = 0, u = 0, b = this.h1, E = this.h2;
              const w = 3432918353, y = 461845907, a = w & X, l = y & X;
              for (let k = 0; k < O; k++)
                k & 1 ? (A = v[k], A = A * w & rt | A * a & X, A = A << 15 | A >>> 17, A = A * y & rt | A * l & X, b ^= A, b = b << 13 | b >>> 19, b = b * 5 + 3864292196) : (u = v[k], u = u * w & rt | u * a & X, u = u << 15 | u >>> 17, u = u * y & rt | u * l & X, E ^= u, E = E << 13 | E >>> 19, E = E * 5 + 3864292196);
              switch (A = 0, T) {
                case 3:
                  A ^= g[O * 4 + 2] << 16;
                case 2:
                  A ^= g[O * 4 + 1] << 8;
                case 1:
                  A ^= g[O * 4], A = A * w & rt | A * a & X, A = A << 15 | A >>> 17, A = A * y & rt | A * l & X, O & 1 ? b ^= A : E ^= A;
              }
              this.h1 = b, this.h2 = E;
            }
            hexdigest() {
              let F = this.h1, g = this.h2;
              return F ^= g >>> 1, F = F * 3981806797 & rt | F * 36045 & X, g = g * 4283543511 & rt | ((g << 16 | F >>> 16) * 2950163797 & rt) >>> 16, F ^= g >>> 1, F = F * 444984403 & rt | F * 60499 & X, g = g * 3301882366 & rt | ((g << 16 | F >>> 16) * 3120437893 & rt) >>> 16, F ^= g >>> 1, (F >>> 0).toString(16).padStart(8, "0") + (g >>> 0).toString(16).padStart(8, "0");
            }
          }
          d.MurmurHash3_64 = pt;
        },
        /* 9 */
        /***/
        (dt, d, et) => {
          var X;
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.FontLoader = d.FontFaceObject = void 0;
          var c = et(1);
          class P {
            constructor({
              ownerDocument: B = globalThis.document,
              styleElement: F = null
            }) {
              I(this, X, /* @__PURE__ */ new Set());
              this._document = B, this.nativeFontFaces = /* @__PURE__ */ new Set(), this.styleElement = null, this.loadingRequests = [], this.loadTestFontId = 0;
            }
            addNativeFontFace(B) {
              this.nativeFontFaces.add(B), this._document.fonts.add(B);
            }
            removeNativeFontFace(B) {
              this.nativeFontFaces.delete(B), this._document.fonts.delete(B);
            }
            insertRule(B) {
              this.styleElement || (this.styleElement = this._document.createElement("style"), this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));
              const F = this.styleElement.sheet;
              F.insertRule(B, F.cssRules.length);
            }
            clear() {
              for (const B of this.nativeFontFaces)
                this._document.fonts.delete(B);
              this.nativeFontFaces.clear(), t(this, X).clear(), this.styleElement && (this.styleElement.remove(), this.styleElement = null);
            }
            async loadSystemFont(B) {
              if (!(!B || t(this, X).has(B.loadedName))) {
                if ((0, c.assert)(!this.disableFontFace, "loadSystemFont shouldn't be called when `disableFontFace` is set."), this.isFontLoadingAPISupported) {
                  const {
                    loadedName: F,
                    src: g,
                    style: L
                  } = B, O = new FontFace(F, g, L);
                  this.addNativeFontFace(O);
                  try {
                    await O.load(), t(this, X).add(F);
                  } catch {
                    (0, c.warn)(`Cannot load system font: ${B.baseFontName}, installing it could help to improve PDF rendering.`), this.removeNativeFontFace(O);
                  }
                  return;
                }
                (0, c.unreachable)("Not implemented: loadSystemFont without the Font Loading API.");
              }
            }
            async bind(B) {
              if (B.attached || B.missingFile && !B.systemFontInfo)
                return;
              if (B.attached = !0, B.systemFontInfo) {
                await this.loadSystemFont(B.systemFontInfo);
                return;
              }
              if (this.isFontLoadingAPISupported) {
                const g = B.createNativeFontFace();
                if (g) {
                  this.addNativeFontFace(g);
                  try {
                    await g.loaded;
                  } catch (L) {
                    throw (0, c.warn)(`Failed to load font '${g.family}': '${L}'.`), B.disableFontFace = !0, L;
                  }
                }
                return;
              }
              const F = B.createFontFaceRule();
              if (F) {
                if (this.insertRule(F), this.isSyncFontLoadingSupported)
                  return;
                await new Promise((g) => {
                  const L = this._queueLoadingCallback(g);
                  this._prepareFontLoadEvent(B, L);
                });
              }
            }
            get isFontLoadingAPISupported() {
              var F;
              const B = !!((F = this._document) != null && F.fonts);
              return (0, c.shadow)(this, "isFontLoadingAPISupported", B);
            }
            get isSyncFontLoadingSupported() {
              let B = !1;
              return (c.isNodeJS || typeof navigator < "u" && /Mozilla\/5.0.*?rv:\d+.*? Gecko/.test(navigator.userAgent)) && (B = !0), (0, c.shadow)(this, "isSyncFontLoadingSupported", B);
            }
            _queueLoadingCallback(B) {
              function F() {
                for ((0, c.assert)(!L.done, "completeRequest() cannot be called twice."), L.done = !0; g.length > 0 && g[0].done; ) {
                  const O = g.shift();
                  setTimeout(O.callback, 0);
                }
              }
              const {
                loadingRequests: g
              } = this, L = {
                done: !1,
                complete: F,
                callback: B
              };
              return g.push(L), L;
            }
            get _loadTestFont() {
              const B = atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");
              return (0, c.shadow)(this, "_loadTestFont", B);
            }
            _prepareFontLoadEvent(B, F) {
              function g(m, U) {
                return m.charCodeAt(U) << 24 | m.charCodeAt(U + 1) << 16 | m.charCodeAt(U + 2) << 8 | m.charCodeAt(U + 3) & 255;
              }
              function L(m, U, z, C) {
                const V = m.substring(0, U), st = m.substring(U + z);
                return V + C + st;
              }
              let O, T;
              const v = this._document.createElement("canvas");
              v.width = 1, v.height = 1;
              const A = v.getContext("2d");
              let u = 0;
              function b(m, U) {
                if (++u > 30) {
                  (0, c.warn)("Load test font never loaded."), U();
                  return;
                }
                if (A.font = "30px " + m, A.fillText(".", 0, 20), A.getImageData(0, 0, 1, 1).data[3] > 0) {
                  U();
                  return;
                }
                setTimeout(b.bind(null, m, U));
              }
              const E = `lt${Date.now()}${this.loadTestFontId++}`;
              let w = this._loadTestFont;
              w = L(w, 976, E.length, E);
              const a = 16, l = 1482184792;
              let k = g(w, a);
              for (O = 0, T = E.length - 3; O < T; O += 4)
                k = k - l + g(E, O) | 0;
              O < E.length && (k = k - l + g(E + "XXX", O) | 0), w = L(w, a, 4, (0, c.string32)(k));
              const p = `url(data:font/opentype;base64,${btoa(w)});`, r = `@font-face {font-family:"${E}";src:${p}}`;
              this.insertRule(r);
              const x = this._document.createElement("div");
              x.style.visibility = "hidden", x.style.width = x.style.height = "10px", x.style.position = "absolute", x.style.top = x.style.left = "0px";
              for (const m of [B.loadedName, E]) {
                const U = this._document.createElement("span");
                U.textContent = "Hi", U.style.fontFamily = m, x.append(U);
              }
              this._document.body.append(x), b(E, () => {
                x.remove(), F.complete();
              });
            }
          }
          X = new WeakMap(), d.FontLoader = P;
          class rt {
            constructor(B, {
              isEvalSupported: F = !0,
              disableFontFace: g = !1,
              ignoreErrors: L = !1,
              inspectFont: O = null
            }) {
              this.compiledGlyphs = /* @__PURE__ */ Object.create(null);
              for (const T in B)
                this[T] = B[T];
              this.isEvalSupported = F !== !1, this.disableFontFace = g === !0, this.ignoreErrors = L === !0, this._inspectFont = O;
            }
            createNativeFontFace() {
              var F;
              if (!this.data || this.disableFontFace)
                return null;
              let B;
              if (!this.cssFontInfo)
                B = new FontFace(this.loadedName, this.data, {});
              else {
                const g = {
                  weight: this.cssFontInfo.fontWeight
                };
                this.cssFontInfo.italicAngle && (g.style = `oblique ${this.cssFontInfo.italicAngle}deg`), B = new FontFace(this.cssFontInfo.fontFamily, this.data, g);
              }
              return (F = this._inspectFont) == null || F.call(this, this), B;
            }
            createFontFaceRule() {
              var L;
              if (!this.data || this.disableFontFace)
                return null;
              const B = (0, c.bytesToString)(this.data), F = `url(data:${this.mimetype};base64,${btoa(B)});`;
              let g;
              if (!this.cssFontInfo)
                g = `@font-face {font-family:"${this.loadedName}";src:${F}}`;
              else {
                let O = `font-weight: ${this.cssFontInfo.fontWeight};`;
                this.cssFontInfo.italicAngle && (O += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`), g = `@font-face {font-family:"${this.cssFontInfo.fontFamily}";${O}src:${F}}`;
              }
              return (L = this._inspectFont) == null || L.call(this, this, F), g;
            }
            getPathGenerator(B, F) {
              if (this.compiledGlyphs[F] !== void 0)
                return this.compiledGlyphs[F];
              let g;
              try {
                g = B.get(this.loadedName + "_path_" + F);
              } catch (L) {
                if (!this.ignoreErrors)
                  throw L;
                return (0, c.warn)(`getPathGenerator - ignoring character: "${L}".`), this.compiledGlyphs[F] = function(O, T) {
                };
              }
              if (this.isEvalSupported && c.FeatureTest.isEvalSupported) {
                const L = [];
                for (const O of g) {
                  const T = O.args !== void 0 ? O.args.join(",") : "";
                  L.push("c.", O.cmd, "(", T, `);
`);
                }
                return this.compiledGlyphs[F] = new Function("c", "size", L.join(""));
              }
              return this.compiledGlyphs[F] = function(L, O) {
                for (const T of g)
                  T.cmd === "scale" && (T.args = [O, -O]), L[T.cmd].apply(L, T.args);
              };
            }
          }
          d.FontFaceObject = rt;
        },
        /* 10 */
        /***/
        (dt, d, et) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.NodeStandardFontDataFactory = d.NodeFilterFactory = d.NodeCanvasFactory = d.NodeCMapReaderFactory = void 0;
          var c = et(7);
          et(1);
          const P = function(F) {
            return new Promise((g, L) => {
              require$$5.readFile(F, (T, v) => {
                if (T || !v) {
                  L(new Error(T));
                  return;
                }
                g(new Uint8Array(v));
              });
            });
          };
          class rt extends c.BaseFilterFactory {
          }
          d.NodeFilterFactory = rt;
          class X extends c.BaseCanvasFactory {
            _createCanvas(g, L) {
              return require$$5.createCanvas(g, L);
            }
          }
          d.NodeCanvasFactory = X;
          class pt extends c.BaseCMapReaderFactory {
            _fetchData(g, L) {
              return P(g).then((O) => ({
                cMapData: O,
                compressionType: L
              }));
            }
          }
          d.NodeCMapReaderFactory = pt;
          class B extends c.BaseStandardFontDataFactory {
            _fetchData(g) {
              return P(g);
            }
          }
          d.NodeStandardFontDataFactory = B;
        },
        /* 11 */
        /***/
        (dt, d, et) => {
          var H, Qe, gt, Ze;
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.CanvasGraphics = void 0;
          var c = et(1), P = et(6), rt = et(12), X = et(13);
          const pt = 16, B = 100, F = 4096, g = 15, L = 10, O = 1e3, T = 16;
          function v(S, i) {
            if (S._removeMirroring)
              throw new Error("Context is already forwarding operations.");
            S.__originalSave = S.save, S.__originalRestore = S.restore, S.__originalRotate = S.rotate, S.__originalScale = S.scale, S.__originalTranslate = S.translate, S.__originalTransform = S.transform, S.__originalSetTransform = S.setTransform, S.__originalResetTransform = S.resetTransform, S.__originalClip = S.clip, S.__originalMoveTo = S.moveTo, S.__originalLineTo = S.lineTo, S.__originalBezierCurveTo = S.bezierCurveTo, S.__originalRect = S.rect, S.__originalClosePath = S.closePath, S.__originalBeginPath = S.beginPath, S._removeMirroring = () => {
              S.save = S.__originalSave, S.restore = S.__originalRestore, S.rotate = S.__originalRotate, S.scale = S.__originalScale, S.translate = S.__originalTranslate, S.transform = S.__originalTransform, S.setTransform = S.__originalSetTransform, S.resetTransform = S.__originalResetTransform, S.clip = S.__originalClip, S.moveTo = S.__originalMoveTo, S.lineTo = S.__originalLineTo, S.bezierCurveTo = S.__originalBezierCurveTo, S.rect = S.__originalRect, S.closePath = S.__originalClosePath, S.beginPath = S.__originalBeginPath, delete S._removeMirroring;
            }, S.save = function() {
              i.save(), this.__originalSave();
            }, S.restore = function() {
              i.restore(), this.__originalRestore();
            }, S.translate = function(s, o) {
              i.translate(s, o), this.__originalTranslate(s, o);
            }, S.scale = function(s, o) {
              i.scale(s, o), this.__originalScale(s, o);
            }, S.transform = function(s, o, h, _, M, N) {
              i.transform(s, o, h, _, M, N), this.__originalTransform(s, o, h, _, M, N);
            }, S.setTransform = function(s, o, h, _, M, N) {
              i.setTransform(s, o, h, _, M, N), this.__originalSetTransform(s, o, h, _, M, N);
            }, S.resetTransform = function() {
              i.resetTransform(), this.__originalResetTransform();
            }, S.rotate = function(s) {
              i.rotate(s), this.__originalRotate(s);
            }, S.clip = function(s) {
              i.clip(s), this.__originalClip(s);
            }, S.moveTo = function(n, s) {
              i.moveTo(n, s), this.__originalMoveTo(n, s);
            }, S.lineTo = function(n, s) {
              i.lineTo(n, s), this.__originalLineTo(n, s);
            }, S.bezierCurveTo = function(n, s, o, h, _, M) {
              i.bezierCurveTo(n, s, o, h, _, M), this.__originalBezierCurveTo(n, s, o, h, _, M);
            }, S.rect = function(n, s, o, h) {
              i.rect(n, s, o, h), this.__originalRect(n, s, o, h);
            }, S.closePath = function() {
              i.closePath(), this.__originalClosePath();
            }, S.beginPath = function() {
              i.beginPath(), this.__originalBeginPath();
            };
          }
          class A {
            constructor(i) {
              this.canvasFactory = i, this.cache = /* @__PURE__ */ Object.create(null);
            }
            getCanvas(i, n, s) {
              let o;
              return this.cache[i] !== void 0 ? (o = this.cache[i], this.canvasFactory.reset(o, n, s)) : (o = this.canvasFactory.create(n, s), this.cache[i] = o), o;
            }
            delete(i) {
              delete this.cache[i];
            }
            clear() {
              for (const i in this.cache) {
                const n = this.cache[i];
                this.canvasFactory.destroy(n), delete this.cache[i];
              }
            }
          }
          function u(S, i, n, s, o, h, _, M, N, tt) {
            const [Q, nt, ct, yt, ut, Ft] = (0, P.getCurrentTransform)(S);
            if (nt === 0 && ct === 0) {
              const Dt = _ * Q + ut, ft = Math.round(Dt), K = M * yt + Ft, J = Math.round(K), ht = (_ + N) * Q + ut, Et = Math.abs(Math.round(ht) - ft) || 1, Ct = (M + tt) * yt + Ft, Ut = Math.abs(Math.round(Ct) - J) || 1;
              return S.setTransform(Math.sign(Q), 0, 0, Math.sign(yt), ft, J), S.drawImage(i, n, s, o, h, 0, 0, Et, Ut), S.setTransform(Q, nt, ct, yt, ut, Ft), [Et, Ut];
            }
            if (Q === 0 && yt === 0) {
              const Dt = M * ct + ut, ft = Math.round(Dt), K = _ * nt + Ft, J = Math.round(K), ht = (M + tt) * ct + ut, Et = Math.abs(Math.round(ht) - ft) || 1, Ct = (_ + N) * nt + Ft, Ut = Math.abs(Math.round(Ct) - J) || 1;
              return S.setTransform(0, Math.sign(nt), Math.sign(ct), 0, ft, J), S.drawImage(i, n, s, o, h, 0, 0, Ut, Et), S.setTransform(Q, nt, ct, yt, ut, Ft), [Ut, Et];
            }
            S.drawImage(i, n, s, o, h, _, M, N, tt);
            const Bt = Math.hypot(Q, nt), St = Math.hypot(ct, yt);
            return [Bt * N, St * tt];
          }
          function b(S) {
            const {
              width: i,
              height: n
            } = S;
            if (i > O || n > O)
              return null;
            const s = 1e3, o = new Uint8Array([0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0]), h = i + 1;
            let _ = new Uint8Array(h * (n + 1)), M, N, tt;
            const Q = i + 7 & -8;
            let nt = new Uint8Array(Q * n), ct = 0;
            for (const St of S.data) {
              let Dt = 128;
              for (; Dt > 0; )
                nt[ct++] = St & Dt ? 0 : 255, Dt >>= 1;
            }
            let yt = 0;
            for (ct = 0, nt[ct] !== 0 && (_[0] = 1, ++yt), N = 1; N < i; N++)
              nt[ct] !== nt[ct + 1] && (_[N] = nt[ct] ? 2 : 1, ++yt), ct++;
            for (nt[ct] !== 0 && (_[N] = 2, ++yt), M = 1; M < n; M++) {
              ct = M * Q, tt = M * h, nt[ct - Q] !== nt[ct] && (_[tt] = nt[ct] ? 1 : 8, ++yt);
              let St = (nt[ct] ? 4 : 0) + (nt[ct - Q] ? 8 : 0);
              for (N = 1; N < i; N++)
                St = (St >> 2) + (nt[ct + 1] ? 4 : 0) + (nt[ct - Q + 1] ? 8 : 0), o[St] && (_[tt + N] = o[St], ++yt), ct++;
              if (nt[ct - Q] !== nt[ct] && (_[tt + N] = nt[ct] ? 2 : 4, ++yt), yt > s)
                return null;
            }
            for (ct = Q * (n - 1), tt = M * h, nt[ct] !== 0 && (_[tt] = 8, ++yt), N = 1; N < i; N++)
              nt[ct] !== nt[ct + 1] && (_[tt + N] = nt[ct] ? 4 : 8, ++yt), ct++;
            if (nt[ct] !== 0 && (_[tt + N] = 4, ++yt), yt > s)
              return null;
            const ut = new Int32Array([0, h, -1, 0, -h, 0, 0, 0, 1]), Ft = new Path2D();
            for (M = 0; yt && M <= n; M++) {
              let St = M * h;
              const Dt = St + i;
              for (; St < Dt && !_[St]; )
                St++;
              if (St === Dt)
                continue;
              Ft.moveTo(St % h, M);
              const ft = St;
              let K = _[St];
              do {
                const J = ut[K];
                do
                  St += J;
                while (!_[St]);
                const ht = _[St];
                ht !== 5 && ht !== 10 ? (K = ht, _[St] = 0) : (K = ht & 51 * K >> 4, _[St] &= K >> 2 | K << 2), Ft.lineTo(St % h, St / h | 0), _[St] || --yt;
              } while (ft !== St);
              --M;
            }
            return nt = null, _ = null, function(St) {
              St.save(), St.scale(1 / i, -1 / n), St.translate(0, -n), St.fill(Ft), St.beginPath(), St.restore();
            };
          }
          class E {
            constructor(i, n) {
              this.alphaIsShape = !1, this.fontSize = 0, this.fontSizeScale = 1, this.textMatrix = c.IDENTITY_MATRIX, this.textMatrixScale = 1, this.fontMatrix = c.FONT_IDENTITY_MATRIX, this.leading = 0, this.x = 0, this.y = 0, this.lineX = 0, this.lineY = 0, this.charSpacing = 0, this.wordSpacing = 0, this.textHScale = 1, this.textRenderingMode = c.TextRenderingMode.FILL, this.textRise = 0, this.fillColor = "#000000", this.strokeColor = "#000000", this.patternFill = !1, this.fillAlpha = 1, this.strokeAlpha = 1, this.lineWidth = 1, this.activeSMask = null, this.transferMaps = "none", this.startNewPathAndClipBox([0, 0, i, n]);
            }
            clone() {
              const i = Object.create(this);
              return i.clipBox = this.clipBox.slice(), i;
            }
            setCurrentPoint(i, n) {
              this.x = i, this.y = n;
            }
            updatePathMinMax(i, n, s) {
              [n, s] = c.Util.applyTransform([n, s], i), this.minX = Math.min(this.minX, n), this.minY = Math.min(this.minY, s), this.maxX = Math.max(this.maxX, n), this.maxY = Math.max(this.maxY, s);
            }
            updateRectMinMax(i, n) {
              const s = c.Util.applyTransform(n, i), o = c.Util.applyTransform(n.slice(2), i);
              this.minX = Math.min(this.minX, s[0], o[0]), this.minY = Math.min(this.minY, s[1], o[1]), this.maxX = Math.max(this.maxX, s[0], o[0]), this.maxY = Math.max(this.maxY, s[1], o[1]);
            }
            updateScalingPathMinMax(i, n) {
              c.Util.scaleMinMax(i, n), this.minX = Math.min(this.minX, n[0]), this.maxX = Math.max(this.maxX, n[1]), this.minY = Math.min(this.minY, n[2]), this.maxY = Math.max(this.maxY, n[3]);
            }
            updateCurvePathMinMax(i, n, s, o, h, _, M, N, tt, Q) {
              const nt = c.Util.bezierBoundingBox(n, s, o, h, _, M, N, tt);
              if (Q) {
                Q[0] = Math.min(Q[0], nt[0], nt[2]), Q[1] = Math.max(Q[1], nt[0], nt[2]), Q[2] = Math.min(Q[2], nt[1], nt[3]), Q[3] = Math.max(Q[3], nt[1], nt[3]);
                return;
              }
              this.updateRectMinMax(i, nt);
            }
            getPathBoundingBox(i = rt.PathType.FILL, n = null) {
              const s = [this.minX, this.minY, this.maxX, this.maxY];
              if (i === rt.PathType.STROKE) {
                n || (0, c.unreachable)("Stroke bounding box must include transform.");
                const o = c.Util.singularValueDecompose2dScale(n), h = o[0] * this.lineWidth / 2, _ = o[1] * this.lineWidth / 2;
                s[0] -= h, s[1] -= _, s[2] += h, s[3] += _;
              }
              return s;
            }
            updateClipFromPath() {
              const i = c.Util.intersect(this.clipBox, this.getPathBoundingBox());
              this.startNewPathAndClipBox(i || [0, 0, 0, 0]);
            }
            isEmptyClip() {
              return this.minX === 1 / 0;
            }
            startNewPathAndClipBox(i) {
              this.clipBox = i, this.minX = 1 / 0, this.minY = 1 / 0, this.maxX = 0, this.maxY = 0;
            }
            getClippedPathBoundingBox(i = rt.PathType.FILL, n = null) {
              return c.Util.intersect(this.clipBox, this.getPathBoundingBox(i, n));
            }
          }
          function w(S, i) {
            if (typeof ImageData < "u" && i instanceof ImageData) {
              S.putImageData(i, 0, 0);
              return;
            }
            const n = i.height, s = i.width, o = n % T, h = (n - o) / T, _ = o === 0 ? h : h + 1, M = S.createImageData(s, T);
            let N = 0, tt;
            const Q = i.data, nt = M.data;
            let ct, yt, ut, Ft;
            if (i.kind === c.ImageKind.GRAYSCALE_1BPP) {
              const Bt = Q.byteLength, St = new Uint32Array(nt.buffer, 0, nt.byteLength >> 2), Dt = St.length, ft = s + 7 >> 3, K = 4294967295, J = c.FeatureTest.isLittleEndian ? 4278190080 : 255;
              for (ct = 0; ct < _; ct++) {
                for (ut = ct < h ? T : o, tt = 0, yt = 0; yt < ut; yt++) {
                  const ht = Bt - N;
                  let Et = 0;
                  const Ct = ht > ft ? s : ht * 8 - 7, Ut = Ct & -8;
                  let Gt = 0, Ht = 0;
                  for (; Et < Ut; Et += 8)
                    Ht = Q[N++], St[tt++] = Ht & 128 ? K : J, St[tt++] = Ht & 64 ? K : J, St[tt++] = Ht & 32 ? K : J, St[tt++] = Ht & 16 ? K : J, St[tt++] = Ht & 8 ? K : J, St[tt++] = Ht & 4 ? K : J, St[tt++] = Ht & 2 ? K : J, St[tt++] = Ht & 1 ? K : J;
                  for (; Et < Ct; Et++)
                    Gt === 0 && (Ht = Q[N++], Gt = 128), St[tt++] = Ht & Gt ? K : J, Gt >>= 1;
                }
                for (; tt < Dt; )
                  St[tt++] = 0;
                S.putImageData(M, 0, ct * T);
              }
            } else if (i.kind === c.ImageKind.RGBA_32BPP) {
              for (yt = 0, Ft = s * T * 4, ct = 0; ct < h; ct++)
                nt.set(Q.subarray(N, N + Ft)), N += Ft, S.putImageData(M, 0, yt), yt += T;
              ct < _ && (Ft = s * o * 4, nt.set(Q.subarray(N, N + Ft)), S.putImageData(M, 0, yt));
            } else if (i.kind === c.ImageKind.RGB_24BPP)
              for (ut = T, Ft = s * ut, ct = 0; ct < _; ct++) {
                for (ct >= h && (ut = o, Ft = s * ut), tt = 0, yt = Ft; yt--; )
                  nt[tt++] = Q[N++], nt[tt++] = Q[N++], nt[tt++] = Q[N++], nt[tt++] = 255;
                S.putImageData(M, 0, ct * T);
              }
            else
              throw new Error(`bad image kind: ${i.kind}`);
          }
          function y(S, i) {
            if (i.bitmap) {
              S.drawImage(i.bitmap, 0, 0);
              return;
            }
            const n = i.height, s = i.width, o = n % T, h = (n - o) / T, _ = o === 0 ? h : h + 1, M = S.createImageData(s, T);
            let N = 0;
            const tt = i.data, Q = M.data;
            for (let nt = 0; nt < _; nt++) {
              const ct = nt < h ? T : o;
              ({
                srcPos: N
              } = (0, X.convertBlackAndWhiteToRGBA)({
                src: tt,
                srcPos: N,
                dest: Q,
                width: s,
                height: ct,
                nonBlackColor: 0
              })), S.putImageData(M, 0, nt * T);
            }
          }
          function a(S, i) {
            const n = ["strokeStyle", "fillStyle", "fillRule", "globalAlpha", "lineWidth", "lineCap", "lineJoin", "miterLimit", "globalCompositeOperation", "font", "filter"];
            for (const s of n)
              S[s] !== void 0 && (i[s] = S[s]);
            S.setLineDash !== void 0 && (i.setLineDash(S.getLineDash()), i.lineDashOffset = S.lineDashOffset);
          }
          function l(S) {
            if (S.strokeStyle = S.fillStyle = "#000000", S.fillRule = "nonzero", S.globalAlpha = 1, S.lineWidth = 1, S.lineCap = "butt", S.lineJoin = "miter", S.miterLimit = 10, S.globalCompositeOperation = "source-over", S.font = "10px sans-serif", S.setLineDash !== void 0 && (S.setLineDash([]), S.lineDashOffset = 0), !c.isNodeJS) {
              const {
                filter: i
              } = S;
              i !== "none" && i !== "" && (S.filter = "none");
            }
          }
          function k(S, i, n, s) {
            const o = S.length;
            for (let h = 3; h < o; h += 4) {
              const _ = S[h];
              if (_ === 0)
                S[h - 3] = i, S[h - 2] = n, S[h - 1] = s;
              else if (_ < 255) {
                const M = 255 - _;
                S[h - 3] = S[h - 3] * _ + i * M >> 8, S[h - 2] = S[h - 2] * _ + n * M >> 8, S[h - 1] = S[h - 1] * _ + s * M >> 8;
              }
            }
          }
          function p(S, i, n) {
            const s = S.length, o = 1 / 255;
            for (let h = 3; h < s; h += 4) {
              const _ = n ? n[S[h]] : S[h];
              i[h] = i[h] * _ * o | 0;
            }
          }
          function r(S, i, n) {
            const s = S.length;
            for (let o = 3; o < s; o += 4) {
              const h = S[o - 3] * 77 + S[o - 2] * 152 + S[o - 1] * 28;
              i[o] = n ? i[o] * n[h >> 8] >> 8 : i[o] * h >> 16;
            }
          }
          function x(S, i, n, s, o, h, _, M, N, tt, Q) {
            const nt = !!h, ct = nt ? h[0] : 0, yt = nt ? h[1] : 0, ut = nt ? h[2] : 0, Ft = o === "Luminosity" ? r : p, St = Math.min(s, Math.ceil(1048576 / n));
            for (let Dt = 0; Dt < s; Dt += St) {
              const ft = Math.min(St, s - Dt), K = S.getImageData(M - tt, Dt + (N - Q), n, ft), J = i.getImageData(M, Dt + N, n, ft);
              nt && k(K.data, ct, yt, ut), Ft(K.data, J.data, _), i.putImageData(J, M, Dt + N);
            }
          }
          function m(S, i, n, s) {
            const o = s[0], h = s[1], _ = s[2] - o, M = s[3] - h;
            _ === 0 || M === 0 || (x(i.context, n, _, M, i.subtype, i.backdrop, i.transferMap, o, h, i.offsetX, i.offsetY), S.save(), S.globalAlpha = 1, S.globalCompositeOperation = "source-over", S.setTransform(1, 0, 0, 1, 0, 0), S.drawImage(n.canvas, 0, 0), S.restore());
          }
          function U(S, i) {
            const n = c.Util.singularValueDecompose2dScale(S);
            n[0] = Math.fround(n[0]), n[1] = Math.fround(n[1]);
            const s = Math.fround((globalThis.devicePixelRatio || 1) * P.PixelsPerInch.PDF_TO_CSS_UNITS);
            return i !== void 0 ? i : n[0] <= s || n[1] <= s;
          }
          const z = ["butt", "round", "square"], C = ["miter", "round", "bevel"], V = {}, st = {}, Pt = class Pt {
            constructor(i, n, s, o, h, {
              optionalContentConfig: _,
              markedContentStack: M = null
            }, N, tt) {
              I(this, H);
              I(this, gt);
              this.ctx = i, this.current = new E(this.ctx.canvas.width, this.ctx.canvas.height), this.stateStack = [], this.pendingClip = null, this.pendingEOFill = !1, this.res = null, this.xobjs = null, this.commonObjs = n, this.objs = s, this.canvasFactory = o, this.filterFactory = h, this.groupStack = [], this.processingType3 = null, this.baseTransform = null, this.baseTransformStack = [], this.groupLevel = 0, this.smaskStack = [], this.smaskCounter = 0, this.tempSMask = null, this.suspendedCtx = null, this.contentVisible = !0, this.markedContentStack = M || [], this.optionalContentConfig = _, this.cachedCanvases = new A(this.canvasFactory), this.cachedPatterns = /* @__PURE__ */ new Map(), this.annotationCanvasMap = N, this.viewportScale = 1, this.outputScaleX = 1, this.outputScaleY = 1, this.pageColors = tt, this._cachedScaleForStroking = [-1, 0], this._cachedGetSinglePixelWidth = null, this._cachedBitmapsMap = /* @__PURE__ */ new Map();
            }
            getObject(i, n = null) {
              return typeof i == "string" ? i.startsWith("g_") ? this.commonObjs.get(i) : this.objs.get(i) : n;
            }
            beginDrawing({
              transform: i,
              viewport: n,
              transparency: s = !1,
              background: o = null
            }) {
              const h = this.ctx.canvas.width, _ = this.ctx.canvas.height, M = this.ctx.fillStyle;
              if (this.ctx.fillStyle = o || "#ffffff", this.ctx.fillRect(0, 0, h, _), this.ctx.fillStyle = M, s) {
                const N = this.cachedCanvases.getCanvas("transparent", h, _);
                this.compositeCtx = this.ctx, this.transparentCanvas = N.canvas, this.ctx = N.context, this.ctx.save(), this.ctx.transform(...(0, P.getCurrentTransform)(this.compositeCtx));
              }
              this.ctx.save(), l(this.ctx), i && (this.ctx.transform(...i), this.outputScaleX = i[0], this.outputScaleY = i[0]), this.ctx.transform(...n.transform), this.viewportScale = n.scale, this.baseTransform = (0, P.getCurrentTransform)(this.ctx);
            }
            executeOperatorList(i, n, s, o) {
              const h = i.argsArray, _ = i.fnArray;
              let M = n || 0;
              const N = h.length;
              if (N === M)
                return M;
              const tt = N - M > L && typeof s == "function", Q = tt ? Date.now() + g : 0;
              let nt = 0;
              const ct = this.commonObjs, yt = this.objs;
              let ut;
              for (; ; ) {
                if (o !== void 0 && M === o.nextBreakPoint)
                  return o.breakIt(M, s), M;
                if (ut = _[M], ut !== c.OPS.dependency)
                  this[ut].apply(this, h[M]);
                else
                  for (const Ft of h[M]) {
                    const Bt = Ft.startsWith("g_") ? ct : yt;
                    if (!Bt.has(Ft))
                      return Bt.get(Ft, s), M;
                  }
                if (M++, M === N)
                  return M;
                if (tt && ++nt > L) {
                  if (Date.now() > Q)
                    return s(), M;
                  nt = 0;
                }
              }
            }
            endDrawing() {
              W(this, H, Qe).call(this), this.cachedCanvases.clear(), this.cachedPatterns.clear();
              for (const i of this._cachedBitmapsMap.values()) {
                for (const n of i.values())
                  typeof HTMLCanvasElement < "u" && n instanceof HTMLCanvasElement && (n.width = n.height = 0);
                i.clear();
              }
              this._cachedBitmapsMap.clear(), W(this, gt, Ze).call(this);
            }
            _scaleImage(i, n) {
              const s = i.width, o = i.height;
              let h = Math.max(Math.hypot(n[0], n[1]), 1), _ = Math.max(Math.hypot(n[2], n[3]), 1), M = s, N = o, tt = "prescale1", Q, nt;
              for (; h > 2 && M > 1 || _ > 2 && N > 1; ) {
                let ct = M, yt = N;
                h > 2 && M > 1 && (ct = M >= 16384 ? Math.floor(M / 2) - 1 || 1 : Math.ceil(M / 2), h /= M / ct), _ > 2 && N > 1 && (yt = N >= 16384 ? Math.floor(N / 2) - 1 || 1 : Math.ceil(N) / 2, _ /= N / yt), Q = this.cachedCanvases.getCanvas(tt, ct, yt), nt = Q.context, nt.clearRect(0, 0, ct, yt), nt.drawImage(i, 0, 0, M, N, 0, 0, ct, yt), i = Q.canvas, M = ct, N = yt, tt = tt === "prescale1" ? "prescale2" : "prescale1";
              }
              return {
                img: i,
                paintWidth: M,
                paintHeight: N
              };
            }
            _createMaskCanvas(i) {
              const n = this.ctx, {
                width: s,
                height: o
              } = i, h = this.current.fillColor, _ = this.current.patternFill, M = (0, P.getCurrentTransform)(n);
              let N, tt, Q, nt;
              if ((i.bitmap || i.data) && i.count > 1) {
                const Et = i.bitmap || i.data.buffer;
                tt = JSON.stringify(_ ? M : [M.slice(0, 4), h]), N = this._cachedBitmapsMap.get(Et), N || (N = /* @__PURE__ */ new Map(), this._cachedBitmapsMap.set(Et, N));
                const Ct = N.get(tt);
                if (Ct && !_) {
                  const Ut = Math.round(Math.min(M[0], M[2]) + M[4]), Gt = Math.round(Math.min(M[1], M[3]) + M[5]);
                  return {
                    canvas: Ct,
                    offsetX: Ut,
                    offsetY: Gt
                  };
                }
                Q = Ct;
              }
              Q || (nt = this.cachedCanvases.getCanvas("maskCanvas", s, o), y(nt.context, i));
              let ct = c.Util.transform(M, [1 / s, 0, 0, -1 / o, 0, 0]);
              ct = c.Util.transform(ct, [1, 0, 0, 1, 0, -o]);
              const yt = c.Util.applyTransform([0, 0], ct), ut = c.Util.applyTransform([s, o], ct), Ft = c.Util.normalizeRect([yt[0], yt[1], ut[0], ut[1]]), Bt = Math.round(Ft[2] - Ft[0]) || 1, St = Math.round(Ft[3] - Ft[1]) || 1, Dt = this.cachedCanvases.getCanvas("fillCanvas", Bt, St), ft = Dt.context, K = Math.min(yt[0], ut[0]), J = Math.min(yt[1], ut[1]);
              ft.translate(-K, -J), ft.transform(...ct), Q || (Q = this._scaleImage(nt.canvas, (0, P.getCurrentTransformInverse)(ft)), Q = Q.img, N && _ && N.set(tt, Q)), ft.imageSmoothingEnabled = U((0, P.getCurrentTransform)(ft), i.interpolate), u(ft, Q, 0, 0, Q.width, Q.height, 0, 0, s, o), ft.globalCompositeOperation = "source-in";
              const ht = c.Util.transform((0, P.getCurrentTransformInverse)(ft), [1, 0, 0, 1, -K, -J]);
              return ft.fillStyle = _ ? h.getPattern(n, this, ht, rt.PathType.FILL) : h, ft.fillRect(0, 0, s, o), N && !_ && (this.cachedCanvases.delete("fillCanvas"), N.set(tt, Dt.canvas)), {
                canvas: Dt.canvas,
                offsetX: Math.round(K),
                offsetY: Math.round(J)
              };
            }
            setLineWidth(i) {
              i !== this.current.lineWidth && (this._cachedScaleForStroking[0] = -1), this.current.lineWidth = i, this.ctx.lineWidth = i;
            }
            setLineCap(i) {
              this.ctx.lineCap = z[i];
            }
            setLineJoin(i) {
              this.ctx.lineJoin = C[i];
            }
            setMiterLimit(i) {
              this.ctx.miterLimit = i;
            }
            setDash(i, n) {
              const s = this.ctx;
              s.setLineDash !== void 0 && (s.setLineDash(i), s.lineDashOffset = n);
            }
            setRenderingIntent(i) {
            }
            setFlatness(i) {
            }
            setGState(i) {
              for (const [n, s] of i)
                switch (n) {
                  case "LW":
                    this.setLineWidth(s);
                    break;
                  case "LC":
                    this.setLineCap(s);
                    break;
                  case "LJ":
                    this.setLineJoin(s);
                    break;
                  case "ML":
                    this.setMiterLimit(s);
                    break;
                  case "D":
                    this.setDash(s[0], s[1]);
                    break;
                  case "RI":
                    this.setRenderingIntent(s);
                    break;
                  case "FL":
                    this.setFlatness(s);
                    break;
                  case "Font":
                    this.setFont(s[0], s[1]);
                    break;
                  case "CA":
                    this.current.strokeAlpha = s;
                    break;
                  case "ca":
                    this.current.fillAlpha = s, this.ctx.globalAlpha = s;
                    break;
                  case "BM":
                    this.ctx.globalCompositeOperation = s;
                    break;
                  case "SMask":
                    this.current.activeSMask = s ? this.tempSMask : null, this.tempSMask = null, this.checkSMaskState();
                    break;
                  case "TR":
                    this.ctx.filter = this.current.transferMaps = this.filterFactory.addFilter(s);
                    break;
                }
            }
            get inSMaskMode() {
              return !!this.suspendedCtx;
            }
            checkSMaskState() {
              const i = this.inSMaskMode;
              this.current.activeSMask && !i ? this.beginSMaskMode() : !this.current.activeSMask && i && this.endSMaskMode();
            }
            beginSMaskMode() {
              if (this.inSMaskMode)
                throw new Error("beginSMaskMode called while already in smask mode");
              const i = this.ctx.canvas.width, n = this.ctx.canvas.height, s = "smaskGroupAt" + this.groupLevel, o = this.cachedCanvases.getCanvas(s, i, n);
              this.suspendedCtx = this.ctx, this.ctx = o.context;
              const h = this.ctx;
              h.setTransform(...(0, P.getCurrentTransform)(this.suspendedCtx)), a(this.suspendedCtx, h), v(h, this.suspendedCtx), this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]);
            }
            endSMaskMode() {
              if (!this.inSMaskMode)
                throw new Error("endSMaskMode called while not in smask mode");
              this.ctx._removeMirroring(), a(this.ctx, this.suspendedCtx), this.ctx = this.suspendedCtx, this.suspendedCtx = null;
            }
            compose(i) {
              if (!this.current.activeSMask)
                return;
              i ? (i[0] = Math.floor(i[0]), i[1] = Math.floor(i[1]), i[2] = Math.ceil(i[2]), i[3] = Math.ceil(i[3])) : i = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];
              const n = this.current.activeSMask, s = this.suspendedCtx;
              m(s, n, this.ctx, i), this.ctx.save(), this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height), this.ctx.restore();
            }
            save() {
              this.inSMaskMode ? (a(this.ctx, this.suspendedCtx), this.suspendedCtx.save()) : this.ctx.save();
              const i = this.current;
              this.stateStack.push(i), this.current = i.clone();
            }
            restore() {
              this.stateStack.length === 0 && this.inSMaskMode && this.endSMaskMode(), this.stateStack.length !== 0 && (this.current = this.stateStack.pop(), this.inSMaskMode ? (this.suspendedCtx.restore(), a(this.suspendedCtx, this.ctx)) : this.ctx.restore(), this.checkSMaskState(), this.pendingClip = null, this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null);
            }
            transform(i, n, s, o, h, _) {
              this.ctx.transform(i, n, s, o, h, _), this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null;
            }
            constructPath(i, n, s) {
              const o = this.ctx, h = this.current;
              let _ = h.x, M = h.y, N, tt;
              const Q = (0, P.getCurrentTransform)(o), nt = Q[0] === 0 && Q[3] === 0 || Q[1] === 0 && Q[2] === 0, ct = nt ? s.slice(0) : null;
              for (let yt = 0, ut = 0, Ft = i.length; yt < Ft; yt++)
                switch (i[yt] | 0) {
                  case c.OPS.rectangle:
                    _ = n[ut++], M = n[ut++];
                    const Bt = n[ut++], St = n[ut++], Dt = _ + Bt, ft = M + St;
                    o.moveTo(_, M), Bt === 0 || St === 0 ? o.lineTo(Dt, ft) : (o.lineTo(Dt, M), o.lineTo(Dt, ft), o.lineTo(_, ft)), nt || h.updateRectMinMax(Q, [_, M, Dt, ft]), o.closePath();
                    break;
                  case c.OPS.moveTo:
                    _ = n[ut++], M = n[ut++], o.moveTo(_, M), nt || h.updatePathMinMax(Q, _, M);
                    break;
                  case c.OPS.lineTo:
                    _ = n[ut++], M = n[ut++], o.lineTo(_, M), nt || h.updatePathMinMax(Q, _, M);
                    break;
                  case c.OPS.curveTo:
                    N = _, tt = M, _ = n[ut + 4], M = n[ut + 5], o.bezierCurveTo(n[ut], n[ut + 1], n[ut + 2], n[ut + 3], _, M), h.updateCurvePathMinMax(Q, N, tt, n[ut], n[ut + 1], n[ut + 2], n[ut + 3], _, M, ct), ut += 6;
                    break;
                  case c.OPS.curveTo2:
                    N = _, tt = M, o.bezierCurveTo(_, M, n[ut], n[ut + 1], n[ut + 2], n[ut + 3]), h.updateCurvePathMinMax(Q, N, tt, _, M, n[ut], n[ut + 1], n[ut + 2], n[ut + 3], ct), _ = n[ut + 2], M = n[ut + 3], ut += 4;
                    break;
                  case c.OPS.curveTo3:
                    N = _, tt = M, _ = n[ut + 2], M = n[ut + 3], o.bezierCurveTo(n[ut], n[ut + 1], _, M, _, M), h.updateCurvePathMinMax(Q, N, tt, n[ut], n[ut + 1], _, M, _, M, ct), ut += 4;
                    break;
                  case c.OPS.closePath:
                    o.closePath();
                    break;
                }
              nt && h.updateScalingPathMinMax(Q, ct), h.setCurrentPoint(_, M);
            }
            closePath() {
              this.ctx.closePath();
            }
            stroke(i = !0) {
              const n = this.ctx, s = this.current.strokeColor;
              n.globalAlpha = this.current.strokeAlpha, this.contentVisible && (typeof s == "object" && (s != null && s.getPattern) ? (n.save(), n.strokeStyle = s.getPattern(n, this, (0, P.getCurrentTransformInverse)(n), rt.PathType.STROKE), this.rescaleAndStroke(!1), n.restore()) : this.rescaleAndStroke(!0)), i && this.consumePath(this.current.getClippedPathBoundingBox()), n.globalAlpha = this.current.fillAlpha;
            }
            closeStroke() {
              this.closePath(), this.stroke();
            }
            fill(i = !0) {
              const n = this.ctx, s = this.current.fillColor, o = this.current.patternFill;
              let h = !1;
              o && (n.save(), n.fillStyle = s.getPattern(n, this, (0, P.getCurrentTransformInverse)(n), rt.PathType.FILL), h = !0);
              const _ = this.current.getClippedPathBoundingBox();
              this.contentVisible && _ !== null && (this.pendingEOFill ? (n.fill("evenodd"), this.pendingEOFill = !1) : n.fill()), h && n.restore(), i && this.consumePath(_);
            }
            eoFill() {
              this.pendingEOFill = !0, this.fill();
            }
            fillStroke() {
              this.fill(!1), this.stroke(!1), this.consumePath();
            }
            eoFillStroke() {
              this.pendingEOFill = !0, this.fillStroke();
            }
            closeFillStroke() {
              this.closePath(), this.fillStroke();
            }
            closeEOFillStroke() {
              this.pendingEOFill = !0, this.closePath(), this.fillStroke();
            }
            endPath() {
              this.consumePath();
            }
            clip() {
              this.pendingClip = V;
            }
            eoClip() {
              this.pendingClip = st;
            }
            beginText() {
              this.current.textMatrix = c.IDENTITY_MATRIX, this.current.textMatrixScale = 1, this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
            }
            endText() {
              const i = this.pendingTextPaths, n = this.ctx;
              if (i === void 0) {
                n.beginPath();
                return;
              }
              n.save(), n.beginPath();
              for (const s of i)
                n.setTransform(...s.transform), n.translate(s.x, s.y), s.addToPath(n, s.fontSize);
              n.restore(), n.clip(), n.beginPath(), delete this.pendingTextPaths;
            }
            setCharSpacing(i) {
              this.current.charSpacing = i;
            }
            setWordSpacing(i) {
              this.current.wordSpacing = i;
            }
            setHScale(i) {
              this.current.textHScale = i / 100;
            }
            setLeading(i) {
              this.current.leading = -i;
            }
            setFont(i, n) {
              var Q;
              const s = this.commonObjs.get(i), o = this.current;
              if (!s)
                throw new Error(`Can't find font for ${i}`);
              if (o.fontMatrix = s.fontMatrix || c.FONT_IDENTITY_MATRIX, (o.fontMatrix[0] === 0 || o.fontMatrix[3] === 0) && (0, c.warn)("Invalid font matrix for font " + i), n < 0 ? (n = -n, o.fontDirection = -1) : o.fontDirection = 1, this.current.font = s, this.current.fontSize = n, s.isType3Font)
                return;
              const h = s.loadedName || "sans-serif", _ = ((Q = s.systemFontInfo) == null ? void 0 : Q.css) || `"${h}", ${s.fallbackName}`;
              let M = "normal";
              s.black ? M = "900" : s.bold && (M = "bold");
              const N = s.italic ? "italic" : "normal";
              let tt = n;
              n < pt ? tt = pt : n > B && (tt = B), this.current.fontSizeScale = n / tt, this.ctx.font = `${N} ${M} ${tt}px ${_}`;
            }
            setTextRenderingMode(i) {
              this.current.textRenderingMode = i;
            }
            setTextRise(i) {
              this.current.textRise = i;
            }
            moveText(i, n) {
              this.current.x = this.current.lineX += i, this.current.y = this.current.lineY += n;
            }
            setLeadingMoveText(i, n) {
              this.setLeading(-n), this.moveText(i, n);
            }
            setTextMatrix(i, n, s, o, h, _) {
              this.current.textMatrix = [i, n, s, o, h, _], this.current.textMatrixScale = Math.hypot(i, n), this.current.x = this.current.lineX = 0, this.current.y = this.current.lineY = 0;
            }
            nextLine() {
              this.moveText(0, this.current.leading);
            }
            paintChar(i, n, s, o) {
              const h = this.ctx, _ = this.current, M = _.font, N = _.textRenderingMode, tt = _.fontSize / _.fontSizeScale, Q = N & c.TextRenderingMode.FILL_STROKE_MASK, nt = !!(N & c.TextRenderingMode.ADD_TO_PATH_FLAG), ct = _.patternFill && !M.missingFile;
              let yt;
              (M.disableFontFace || nt || ct) && (yt = M.getPathGenerator(this.commonObjs, i)), M.disableFontFace || ct ? (h.save(), h.translate(n, s), h.beginPath(), yt(h, tt), o && h.setTransform(...o), (Q === c.TextRenderingMode.FILL || Q === c.TextRenderingMode.FILL_STROKE) && h.fill(), (Q === c.TextRenderingMode.STROKE || Q === c.TextRenderingMode.FILL_STROKE) && h.stroke(), h.restore()) : ((Q === c.TextRenderingMode.FILL || Q === c.TextRenderingMode.FILL_STROKE) && h.fillText(i, n, s), (Q === c.TextRenderingMode.STROKE || Q === c.TextRenderingMode.FILL_STROKE) && h.strokeText(i, n, s)), nt && (this.pendingTextPaths || (this.pendingTextPaths = [])).push({
                transform: (0, P.getCurrentTransform)(h),
                x: n,
                y: s,
                fontSize: tt,
                addToPath: yt
              });
            }
            get isFontSubpixelAAEnabled() {
              const {
                context: i
              } = this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled", 10, 10);
              i.scale(1.5, 1), i.fillText("I", 0, 10);
              const n = i.getImageData(0, 0, 10, 10).data;
              let s = !1;
              for (let o = 3; o < n.length; o += 4)
                if (n[o] > 0 && n[o] < 255) {
                  s = !0;
                  break;
                }
              return (0, c.shadow)(this, "isFontSubpixelAAEnabled", s);
            }
            showText(i) {
              const n = this.current, s = n.font;
              if (s.isType3Font)
                return this.showType3Text(i);
              const o = n.fontSize;
              if (o === 0)
                return;
              const h = this.ctx, _ = n.fontSizeScale, M = n.charSpacing, N = n.wordSpacing, tt = n.fontDirection, Q = n.textHScale * tt, nt = i.length, ct = s.vertical, yt = ct ? 1 : -1, ut = s.defaultVMetrics, Ft = o * n.fontMatrix[0], Bt = n.textRenderingMode === c.TextRenderingMode.FILL && !s.disableFontFace && !n.patternFill;
              h.save(), h.transform(...n.textMatrix), h.translate(n.x, n.y + n.textRise), tt > 0 ? h.scale(Q, -1) : h.scale(Q, 1);
              let St;
              if (n.patternFill) {
                h.save();
                const ht = n.fillColor.getPattern(h, this, (0, P.getCurrentTransformInverse)(h), rt.PathType.FILL);
                St = (0, P.getCurrentTransform)(h), h.restore(), h.fillStyle = ht;
              }
              let Dt = n.lineWidth;
              const ft = n.textMatrixScale;
              if (ft === 0 || Dt === 0) {
                const ht = n.textRenderingMode & c.TextRenderingMode.FILL_STROKE_MASK;
                (ht === c.TextRenderingMode.STROKE || ht === c.TextRenderingMode.FILL_STROKE) && (Dt = this.getSinglePixelWidth());
              } else
                Dt /= ft;
              if (_ !== 1 && (h.scale(_, _), Dt /= _), h.lineWidth = Dt, s.isInvalidPDFjsFont) {
                const ht = [];
                let Et = 0;
                for (const Ct of i)
                  ht.push(Ct.unicode), Et += Ct.width;
                h.fillText(ht.join(""), 0, 0), n.x += Et * Ft * Q, h.restore(), this.compose();
                return;
              }
              let K = 0, J;
              for (J = 0; J < nt; ++J) {
                const ht = i[J];
                if (typeof ht == "number") {
                  K += yt * ht * o / 1e3;
                  continue;
                }
                let Et = !1;
                const Ct = (ht.isSpace ? N : 0) + M, Ut = ht.fontChar, Gt = ht.accent;
                let Ht, Xt, Vt = ht.width;
                if (ct) {
                  const $t = ht.vmetric || ut, ot = -(ht.vmetric ? $t[1] : Vt * 0.5) * Ft, Y = $t[2] * Ft;
                  Vt = $t ? -$t[0] : Vt, Ht = ot / _, Xt = (K + Y) / _;
                } else
                  Ht = K / _, Xt = 0;
                if (s.remeasure && Vt > 0) {
                  const $t = h.measureText(Ut).width * 1e3 / o * _;
                  if (Vt < $t && this.isFontSubpixelAAEnabled) {
                    const ot = Vt / $t;
                    Et = !0, h.save(), h.scale(ot, 1), Ht /= ot;
                  } else
                    Vt !== $t && (Ht += (Vt - $t) / 2e3 * o / _);
                }
                if (this.contentVisible && (ht.isInFont || s.missingFile)) {
                  if (Bt && !Gt)
                    h.fillText(Ut, Ht, Xt);
                  else if (this.paintChar(Ut, Ht, Xt, St), Gt) {
                    const $t = Ht + o * Gt.offset.x / _, ot = Xt - o * Gt.offset.y / _;
                    this.paintChar(Gt.fontChar, $t, ot, St);
                  }
                }
                const Wt = ct ? Vt * Ft - Ct * tt : Vt * Ft + Ct * tt;
                K += Wt, Et && h.restore();
              }
              ct ? n.y -= K : n.x += K * Q, h.restore(), this.compose();
            }
            showType3Text(i) {
              const n = this.ctx, s = this.current, o = s.font, h = s.fontSize, _ = s.fontDirection, M = o.vertical ? 1 : -1, N = s.charSpacing, tt = s.wordSpacing, Q = s.textHScale * _, nt = s.fontMatrix || c.FONT_IDENTITY_MATRIX, ct = i.length, yt = s.textRenderingMode === c.TextRenderingMode.INVISIBLE;
              let ut, Ft, Bt, St;
              if (!(yt || h === 0)) {
                for (this._cachedScaleForStroking[0] = -1, this._cachedGetSinglePixelWidth = null, n.save(), n.transform(...s.textMatrix), n.translate(s.x, s.y), n.scale(Q, _), ut = 0; ut < ct; ++ut) {
                  if (Ft = i[ut], typeof Ft == "number") {
                    St = M * Ft * h / 1e3, this.ctx.translate(St, 0), s.x += St * Q;
                    continue;
                  }
                  const Dt = (Ft.isSpace ? tt : 0) + N, ft = o.charProcOperatorList[Ft.operatorListId];
                  if (!ft) {
                    (0, c.warn)(`Type3 character "${Ft.operatorListId}" is not available.`);
                    continue;
                  }
                  this.contentVisible && (this.processingType3 = Ft, this.save(), n.scale(h, h), n.transform(...nt), this.executeOperatorList(ft), this.restore()), Bt = c.Util.applyTransform([Ft.width, 0], nt)[0] * h + Dt, n.translate(Bt, 0), s.x += Bt * Q;
                }
                n.restore(), this.processingType3 = null;
              }
            }
            setCharWidth(i, n) {
            }
            setCharWidthAndBounds(i, n, s, o, h, _) {
              this.ctx.rect(s, o, h - s, _ - o), this.ctx.clip(), this.endPath();
            }
            getColorN_Pattern(i) {
              let n;
              if (i[0] === "TilingPattern") {
                const s = i[1], o = this.baseTransform || (0, P.getCurrentTransform)(this.ctx), h = {
                  createCanvasGraphics: (_) => new Pt(_, this.commonObjs, this.objs, this.canvasFactory, this.filterFactory, {
                    optionalContentConfig: this.optionalContentConfig,
                    markedContentStack: this.markedContentStack
                  })
                };
                n = new rt.TilingPattern(i, s, this.ctx, h, o);
              } else
                n = this._getPattern(i[1], i[2]);
              return n;
            }
            setStrokeColorN() {
              this.current.strokeColor = this.getColorN_Pattern(arguments);
            }
            setFillColorN() {
              this.current.fillColor = this.getColorN_Pattern(arguments), this.current.patternFill = !0;
            }
            setStrokeRGBColor(i, n, s) {
              const o = c.Util.makeHexColor(i, n, s);
              this.ctx.strokeStyle = o, this.current.strokeColor = o;
            }
            setFillRGBColor(i, n, s) {
              const o = c.Util.makeHexColor(i, n, s);
              this.ctx.fillStyle = o, this.current.fillColor = o, this.current.patternFill = !1;
            }
            _getPattern(i, n = null) {
              let s;
              return this.cachedPatterns.has(i) ? s = this.cachedPatterns.get(i) : (s = (0, rt.getShadingPattern)(this.getObject(i)), this.cachedPatterns.set(i, s)), n && (s.matrix = n), s;
            }
            shadingFill(i) {
              if (!this.contentVisible)
                return;
              const n = this.ctx;
              this.save();
              const s = this._getPattern(i);
              n.fillStyle = s.getPattern(n, this, (0, P.getCurrentTransformInverse)(n), rt.PathType.SHADING);
              const o = (0, P.getCurrentTransformInverse)(n);
              if (o) {
                const {
                  width: h,
                  height: _
                } = n.canvas, [M, N, tt, Q] = c.Util.getAxialAlignedBoundingBox([0, 0, h, _], o);
                this.ctx.fillRect(M, N, tt - M, Q - N);
              } else
                this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);
              this.compose(this.current.getClippedPathBoundingBox()), this.restore();
            }
            beginInlineImage() {
              (0, c.unreachable)("Should not call beginInlineImage");
            }
            beginImageData() {
              (0, c.unreachable)("Should not call beginImageData");
            }
            paintFormXObjectBegin(i, n) {
              if (this.contentVisible && (this.save(), this.baseTransformStack.push(this.baseTransform), Array.isArray(i) && i.length === 6 && this.transform(...i), this.baseTransform = (0, P.getCurrentTransform)(this.ctx), n)) {
                const s = n[2] - n[0], o = n[3] - n[1];
                this.ctx.rect(n[0], n[1], s, o), this.current.updateRectMinMax((0, P.getCurrentTransform)(this.ctx), n), this.clip(), this.endPath();
              }
            }
            paintFormXObjectEnd() {
              this.contentVisible && (this.restore(), this.baseTransform = this.baseTransformStack.pop());
            }
            beginGroup(i) {
              if (!this.contentVisible)
                return;
              this.save(), this.inSMaskMode && (this.endSMaskMode(), this.current.activeSMask = null);
              const n = this.ctx;
              i.isolated || (0, c.info)("TODO: Support non-isolated groups."), i.knockout && (0, c.warn)("Knockout groups not supported.");
              const s = (0, P.getCurrentTransform)(n);
              if (i.matrix && n.transform(...i.matrix), !i.bbox)
                throw new Error("Bounding box is required.");
              let o = c.Util.getAxialAlignedBoundingBox(i.bbox, (0, P.getCurrentTransform)(n));
              const h = [0, 0, n.canvas.width, n.canvas.height];
              o = c.Util.intersect(o, h) || [0, 0, 0, 0];
              const _ = Math.floor(o[0]), M = Math.floor(o[1]);
              let N = Math.max(Math.ceil(o[2]) - _, 1), tt = Math.max(Math.ceil(o[3]) - M, 1), Q = 1, nt = 1;
              N > F && (Q = N / F, N = F), tt > F && (nt = tt / F, tt = F), this.current.startNewPathAndClipBox([0, 0, N, tt]);
              let ct = "groupAt" + this.groupLevel;
              i.smask && (ct += "_smask_" + this.smaskCounter++ % 2);
              const yt = this.cachedCanvases.getCanvas(ct, N, tt), ut = yt.context;
              ut.scale(1 / Q, 1 / nt), ut.translate(-_, -M), ut.transform(...s), i.smask ? this.smaskStack.push({
                canvas: yt.canvas,
                context: ut,
                offsetX: _,
                offsetY: M,
                scaleX: Q,
                scaleY: nt,
                subtype: i.smask.subtype,
                backdrop: i.smask.backdrop,
                transferMap: i.smask.transferMap || null,
                startTransformInverse: null
              }) : (n.setTransform(1, 0, 0, 1, 0, 0), n.translate(_, M), n.scale(Q, nt), n.save()), a(n, ut), this.ctx = ut, this.setGState([["BM", "source-over"], ["ca", 1], ["CA", 1]]), this.groupStack.push(n), this.groupLevel++;
            }
            endGroup(i) {
              if (!this.contentVisible)
                return;
              this.groupLevel--;
              const n = this.ctx, s = this.groupStack.pop();
              if (this.ctx = s, this.ctx.imageSmoothingEnabled = !1, i.smask)
                this.tempSMask = this.smaskStack.pop(), this.restore();
              else {
                this.ctx.restore();
                const o = (0, P.getCurrentTransform)(this.ctx);
                this.restore(), this.ctx.save(), this.ctx.setTransform(...o);
                const h = c.Util.getAxialAlignedBoundingBox([0, 0, n.canvas.width, n.canvas.height], o);
                this.ctx.drawImage(n.canvas, 0, 0), this.ctx.restore(), this.compose(h);
              }
            }
            beginAnnotation(i, n, s, o, h) {
              if (W(this, H, Qe).call(this), l(this.ctx), this.ctx.save(), this.save(), this.baseTransform && this.ctx.setTransform(...this.baseTransform), Array.isArray(n) && n.length === 4) {
                const _ = n[2] - n[0], M = n[3] - n[1];
                if (h && this.annotationCanvasMap) {
                  s = s.slice(), s[4] -= n[0], s[5] -= n[1], n = n.slice(), n[0] = n[1] = 0, n[2] = _, n[3] = M;
                  const [N, tt] = c.Util.singularValueDecompose2dScale((0, P.getCurrentTransform)(this.ctx)), {
                    viewportScale: Q
                  } = this, nt = Math.ceil(_ * this.outputScaleX * Q), ct = Math.ceil(M * this.outputScaleY * Q);
                  this.annotationCanvas = this.canvasFactory.create(nt, ct);
                  const {
                    canvas: yt,
                    context: ut
                  } = this.annotationCanvas;
                  this.annotationCanvasMap.set(i, yt), this.annotationCanvas.savedCtx = this.ctx, this.ctx = ut, this.ctx.save(), this.ctx.setTransform(N, 0, 0, -tt, 0, M * tt), l(this.ctx);
                } else
                  l(this.ctx), this.ctx.rect(n[0], n[1], _, M), this.ctx.clip(), this.endPath();
              }
              this.current = new E(this.ctx.canvas.width, this.ctx.canvas.height), this.transform(...s), this.transform(...o);
            }
            endAnnotation() {
              this.annotationCanvas && (this.ctx.restore(), W(this, gt, Ze).call(this), this.ctx = this.annotationCanvas.savedCtx, delete this.annotationCanvas.savedCtx, delete this.annotationCanvas);
            }
            paintImageMaskXObject(i) {
              if (!this.contentVisible)
                return;
              const n = i.count;
              i = this.getObject(i.data, i), i.count = n;
              const s = this.ctx, o = this.processingType3;
              if (o && (o.compiled === void 0 && (o.compiled = b(i)), o.compiled)) {
                o.compiled(s);
                return;
              }
              const h = this._createMaskCanvas(i), _ = h.canvas;
              s.save(), s.setTransform(1, 0, 0, 1, 0, 0), s.drawImage(_, h.offsetX, h.offsetY), s.restore(), this.compose();
            }
            paintImageMaskXObjectRepeat(i, n, s = 0, o = 0, h, _) {
              if (!this.contentVisible)
                return;
              i = this.getObject(i.data, i);
              const M = this.ctx;
              M.save();
              const N = (0, P.getCurrentTransform)(M);
              M.transform(n, s, o, h, 0, 0);
              const tt = this._createMaskCanvas(i);
              M.setTransform(1, 0, 0, 1, tt.offsetX - N[4], tt.offsetY - N[5]);
              for (let Q = 0, nt = _.length; Q < nt; Q += 2) {
                const ct = c.Util.transform(N, [n, s, o, h, _[Q], _[Q + 1]]), [yt, ut] = c.Util.applyTransform([0, 0], ct);
                M.drawImage(tt.canvas, yt, ut);
              }
              M.restore(), this.compose();
            }
            paintImageMaskXObjectGroup(i) {
              if (!this.contentVisible)
                return;
              const n = this.ctx, s = this.current.fillColor, o = this.current.patternFill;
              for (const h of i) {
                const {
                  data: _,
                  width: M,
                  height: N,
                  transform: tt
                } = h, Q = this.cachedCanvases.getCanvas("maskCanvas", M, N), nt = Q.context;
                nt.save();
                const ct = this.getObject(_, h);
                y(nt, ct), nt.globalCompositeOperation = "source-in", nt.fillStyle = o ? s.getPattern(nt, this, (0, P.getCurrentTransformInverse)(n), rt.PathType.FILL) : s, nt.fillRect(0, 0, M, N), nt.restore(), n.save(), n.transform(...tt), n.scale(1, -1), u(n, Q.canvas, 0, 0, M, N, 0, -1, 1, 1), n.restore();
              }
              this.compose();
            }
            paintImageXObject(i) {
              if (!this.contentVisible)
                return;
              const n = this.getObject(i);
              if (!n) {
                (0, c.warn)("Dependent image isn't ready yet");
                return;
              }
              this.paintInlineImageXObject(n);
            }
            paintImageXObjectRepeat(i, n, s, o) {
              if (!this.contentVisible)
                return;
              const h = this.getObject(i);
              if (!h) {
                (0, c.warn)("Dependent image isn't ready yet");
                return;
              }
              const _ = h.width, M = h.height, N = [];
              for (let tt = 0, Q = o.length; tt < Q; tt += 2)
                N.push({
                  transform: [n, 0, 0, s, o[tt], o[tt + 1]],
                  x: 0,
                  y: 0,
                  w: _,
                  h: M
                });
              this.paintInlineImageXObjectGroup(h, N);
            }
            applyTransferMapsToCanvas(i) {
              return this.current.transferMaps !== "none" && (i.filter = this.current.transferMaps, i.drawImage(i.canvas, 0, 0), i.filter = "none"), i.canvas;
            }
            applyTransferMapsToBitmap(i) {
              if (this.current.transferMaps === "none")
                return i.bitmap;
              const {
                bitmap: n,
                width: s,
                height: o
              } = i, h = this.cachedCanvases.getCanvas("inlineImage", s, o), _ = h.context;
              return _.filter = this.current.transferMaps, _.drawImage(n, 0, 0), _.filter = "none", h.canvas;
            }
            paintInlineImageXObject(i) {
              if (!this.contentVisible)
                return;
              const n = i.width, s = i.height, o = this.ctx;
              if (this.save(), !c.isNodeJS) {
                const {
                  filter: M
                } = o;
                M !== "none" && M !== "" && (o.filter = "none");
              }
              o.scale(1 / n, -1 / s);
              let h;
              if (i.bitmap)
                h = this.applyTransferMapsToBitmap(i);
              else if (typeof HTMLElement == "function" && i instanceof HTMLElement || !i.data)
                h = i;
              else {
                const N = this.cachedCanvases.getCanvas("inlineImage", n, s).context;
                w(N, i), h = this.applyTransferMapsToCanvas(N);
              }
              const _ = this._scaleImage(h, (0, P.getCurrentTransformInverse)(o));
              o.imageSmoothingEnabled = U((0, P.getCurrentTransform)(o), i.interpolate), u(o, _.img, 0, 0, _.paintWidth, _.paintHeight, 0, -s, n, s), this.compose(), this.restore();
            }
            paintInlineImageXObjectGroup(i, n) {
              if (!this.contentVisible)
                return;
              const s = this.ctx;
              let o;
              if (i.bitmap)
                o = i.bitmap;
              else {
                const h = i.width, _ = i.height, N = this.cachedCanvases.getCanvas("inlineImage", h, _).context;
                w(N, i), o = this.applyTransferMapsToCanvas(N);
              }
              for (const h of n)
                s.save(), s.transform(...h.transform), s.scale(1, -1), u(s, o, h.x, h.y, h.w, h.h, 0, -1, 1, 1), s.restore();
              this.compose();
            }
            paintSolidColorImageMask() {
              this.contentVisible && (this.ctx.fillRect(0, 0, 1, 1), this.compose());
            }
            markPoint(i) {
            }
            markPointProps(i, n) {
            }
            beginMarkedContent(i) {
              this.markedContentStack.push({
                visible: !0
              });
            }
            beginMarkedContentProps(i, n) {
              i === "OC" ? this.markedContentStack.push({
                visible: this.optionalContentConfig.isVisible(n)
              }) : this.markedContentStack.push({
                visible: !0
              }), this.contentVisible = this.isContentVisible();
            }
            endMarkedContent() {
              this.markedContentStack.pop(), this.contentVisible = this.isContentVisible();
            }
            beginCompat() {
            }
            endCompat() {
            }
            consumePath(i) {
              const n = this.current.isEmptyClip();
              this.pendingClip && this.current.updateClipFromPath(), this.pendingClip || this.compose(i);
              const s = this.ctx;
              this.pendingClip && (n || (this.pendingClip === st ? s.clip("evenodd") : s.clip()), this.pendingClip = null), this.current.startNewPathAndClipBox(this.current.clipBox), s.beginPath();
            }
            getSinglePixelWidth() {
              if (!this._cachedGetSinglePixelWidth) {
                const i = (0, P.getCurrentTransform)(this.ctx);
                if (i[1] === 0 && i[2] === 0)
                  this._cachedGetSinglePixelWidth = 1 / Math.min(Math.abs(i[0]), Math.abs(i[3]));
                else {
                  const n = Math.abs(i[0] * i[3] - i[2] * i[1]), s = Math.hypot(i[0], i[2]), o = Math.hypot(i[1], i[3]);
                  this._cachedGetSinglePixelWidth = Math.max(s, o) / n;
                }
              }
              return this._cachedGetSinglePixelWidth;
            }
            getScaleForStroking() {
              if (this._cachedScaleForStroking[0] === -1) {
                const {
                  lineWidth: i
                } = this.current, {
                  a: n,
                  b: s,
                  c: o,
                  d: h
                } = this.ctx.getTransform();
                let _, M;
                if (s === 0 && o === 0) {
                  const N = Math.abs(n), tt = Math.abs(h);
                  if (N === tt)
                    if (i === 0)
                      _ = M = 1 / N;
                    else {
                      const Q = N * i;
                      _ = M = Q < 1 ? 1 / Q : 1;
                    }
                  else if (i === 0)
                    _ = 1 / N, M = 1 / tt;
                  else {
                    const Q = N * i, nt = tt * i;
                    _ = Q < 1 ? 1 / Q : 1, M = nt < 1 ? 1 / nt : 1;
                  }
                } else {
                  const N = Math.abs(n * h - s * o), tt = Math.hypot(n, s), Q = Math.hypot(o, h);
                  if (i === 0)
                    _ = Q / N, M = tt / N;
                  else {
                    const nt = i * N;
                    _ = Q > nt ? Q / nt : 1, M = tt > nt ? tt / nt : 1;
                  }
                }
                this._cachedScaleForStroking[0] = _, this._cachedScaleForStroking[1] = M;
              }
              return this._cachedScaleForStroking;
            }
            rescaleAndStroke(i) {
              const {
                ctx: n
              } = this, {
                lineWidth: s
              } = this.current, [o, h] = this.getScaleForStroking();
              if (n.lineWidth = s || 1, o === 1 && h === 1) {
                n.stroke();
                return;
              }
              const _ = n.getLineDash();
              if (i && n.save(), n.scale(o, h), _.length > 0) {
                const M = Math.max(o, h);
                n.setLineDash(_.map((N) => N / M)), n.lineDashOffset /= M;
              }
              n.stroke(), i && n.restore();
            }
            isContentVisible() {
              for (let i = this.markedContentStack.length - 1; i >= 0; i--)
                if (!this.markedContentStack[i].visible)
                  return !1;
              return !0;
            }
          };
          H = new WeakSet(), Qe = function() {
            for (; this.stateStack.length || this.inSMaskMode; )
              this.restore();
            this.ctx.restore(), this.transparentCanvas && (this.ctx = this.compositeCtx, this.ctx.save(), this.ctx.setTransform(1, 0, 0, 1, 0, 0), this.ctx.drawImage(this.transparentCanvas, 0, 0), this.ctx.restore(), this.transparentCanvas = null);
          }, gt = new WeakSet(), Ze = function() {
            if (this.pageColors) {
              const i = this.filterFactory.addHCMFilter(this.pageColors.foreground, this.pageColors.background);
              if (i !== "none") {
                const n = this.ctx.filter;
                this.ctx.filter = i, this.ctx.drawImage(this.ctx.canvas, 0, 0), this.ctx.filter = n;
              }
            }
          };
          let at = Pt;
          d.CanvasGraphics = at;
          for (const S in c.OPS)
            at.prototype[S] !== void 0 && (at.prototype[c.OPS[S]] = at.prototype[S]);
        },
        /* 12 */
        /***/
        (dt, d, et) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.TilingPattern = d.PathType = void 0, d.getShadingPattern = T;
          var c = et(1), P = et(6);
          const rt = {
            FILL: "Fill",
            STROKE: "Stroke",
            SHADING: "Shading"
          };
          d.PathType = rt;
          function X(b, E) {
            if (!E)
              return;
            const w = E[2] - E[0], y = E[3] - E[1], a = new Path2D();
            a.rect(E[0], E[1], w, y), b.clip(a);
          }
          class pt {
            constructor() {
              this.constructor === pt && (0, c.unreachable)("Cannot initialize BaseShadingPattern.");
            }
            getPattern() {
              (0, c.unreachable)("Abstract method `getPattern` called.");
            }
          }
          class B extends pt {
            constructor(E) {
              super(), this._type = E[1], this._bbox = E[2], this._colorStops = E[3], this._p0 = E[4], this._p1 = E[5], this._r0 = E[6], this._r1 = E[7], this.matrix = null;
            }
            _createGradient(E) {
              let w;
              this._type === "axial" ? w = E.createLinearGradient(this._p0[0], this._p0[1], this._p1[0], this._p1[1]) : this._type === "radial" && (w = E.createRadialGradient(this._p0[0], this._p0[1], this._r0, this._p1[0], this._p1[1], this._r1));
              for (const y of this._colorStops)
                w.addColorStop(y[0], y[1]);
              return w;
            }
            getPattern(E, w, y, a) {
              let l;
              if (a === rt.STROKE || a === rt.FILL) {
                const k = w.current.getClippedPathBoundingBox(a, (0, P.getCurrentTransform)(E)) || [0, 0, 0, 0], p = Math.ceil(k[2] - k[0]) || 1, r = Math.ceil(k[3] - k[1]) || 1, x = w.cachedCanvases.getCanvas("pattern", p, r, !0), m = x.context;
                m.clearRect(0, 0, m.canvas.width, m.canvas.height), m.beginPath(), m.rect(0, 0, m.canvas.width, m.canvas.height), m.translate(-k[0], -k[1]), y = c.Util.transform(y, [1, 0, 0, 1, k[0], k[1]]), m.transform(...w.baseTransform), this.matrix && m.transform(...this.matrix), X(m, this._bbox), m.fillStyle = this._createGradient(m), m.fill(), l = E.createPattern(x.canvas, "no-repeat");
                const U = new DOMMatrix(y);
                l.setTransform(U);
              } else
                X(E, this._bbox), l = this._createGradient(E);
              return l;
            }
          }
          function F(b, E, w, y, a, l, k, p) {
            const r = E.coords, x = E.colors, m = b.data, U = b.width * 4;
            let z;
            r[w + 1] > r[y + 1] && (z = w, w = y, y = z, z = l, l = k, k = z), r[y + 1] > r[a + 1] && (z = y, y = a, a = z, z = k, k = p, p = z), r[w + 1] > r[y + 1] && (z = w, w = y, y = z, z = l, l = k, k = z);
            const C = (r[w] + E.offsetX) * E.scaleX, V = (r[w + 1] + E.offsetY) * E.scaleY, st = (r[y] + E.offsetX) * E.scaleX, at = (r[y + 1] + E.offsetY) * E.scaleY, H = (r[a] + E.offsetX) * E.scaleX, lt = (r[a + 1] + E.offsetY) * E.scaleY;
            if (V >= lt)
              return;
            const gt = x[l], wt = x[l + 1], Pt = x[l + 2], S = x[k], i = x[k + 1], n = x[k + 2], s = x[p], o = x[p + 1], h = x[p + 2], _ = Math.round(V), M = Math.round(lt);
            let N, tt, Q, nt, ct, yt, ut, Ft;
            for (let Bt = _; Bt <= M; Bt++) {
              if (Bt < at) {
                const J = Bt < V ? 0 : (V - Bt) / (V - at);
                N = C - (C - st) * J, tt = gt - (gt - S) * J, Q = wt - (wt - i) * J, nt = Pt - (Pt - n) * J;
              } else {
                let J;
                Bt > lt ? J = 1 : at === lt ? J = 0 : J = (at - Bt) / (at - lt), N = st - (st - H) * J, tt = S - (S - s) * J, Q = i - (i - o) * J, nt = n - (n - h) * J;
              }
              let St;
              Bt < V ? St = 0 : Bt > lt ? St = 1 : St = (V - Bt) / (V - lt), ct = C - (C - H) * St, yt = gt - (gt - s) * St, ut = wt - (wt - o) * St, Ft = Pt - (Pt - h) * St;
              const Dt = Math.round(Math.min(N, ct)), ft = Math.round(Math.max(N, ct));
              let K = U * Bt + Dt * 4;
              for (let J = Dt; J <= ft; J++)
                St = (N - J) / (N - ct), St < 0 ? St = 0 : St > 1 && (St = 1), m[K++] = tt - (tt - yt) * St | 0, m[K++] = Q - (Q - ut) * St | 0, m[K++] = nt - (nt - Ft) * St | 0, m[K++] = 255;
            }
          }
          function g(b, E, w) {
            const y = E.coords, a = E.colors;
            let l, k;
            switch (E.type) {
              case "lattice":
                const p = E.verticesPerRow, r = Math.floor(y.length / p) - 1, x = p - 1;
                for (l = 0; l < r; l++) {
                  let m = l * p;
                  for (let U = 0; U < x; U++, m++)
                    F(b, w, y[m], y[m + 1], y[m + p], a[m], a[m + 1], a[m + p]), F(b, w, y[m + p + 1], y[m + 1], y[m + p], a[m + p + 1], a[m + 1], a[m + p]);
                }
                break;
              case "triangles":
                for (l = 0, k = y.length; l < k; l += 3)
                  F(b, w, y[l], y[l + 1], y[l + 2], a[l], a[l + 1], a[l + 2]);
                break;
              default:
                throw new Error("illegal figure");
            }
          }
          class L extends pt {
            constructor(E) {
              super(), this._coords = E[2], this._colors = E[3], this._figures = E[4], this._bounds = E[5], this._bbox = E[7], this._background = E[8], this.matrix = null;
            }
            _createMeshCanvas(E, w, y) {
              const p = Math.floor(this._bounds[0]), r = Math.floor(this._bounds[1]), x = Math.ceil(this._bounds[2]) - p, m = Math.ceil(this._bounds[3]) - r, U = Math.min(Math.ceil(Math.abs(x * E[0] * 1.1)), 3e3), z = Math.min(Math.ceil(Math.abs(m * E[1] * 1.1)), 3e3), C = x / U, V = m / z, st = {
                coords: this._coords,
                colors: this._colors,
                offsetX: -p,
                offsetY: -r,
                scaleX: 1 / C,
                scaleY: 1 / V
              }, at = U + 2 * 2, H = z + 2 * 2, lt = y.getCanvas("mesh", at, H, !1), gt = lt.context, wt = gt.createImageData(U, z);
              if (w) {
                const S = wt.data;
                for (let i = 0, n = S.length; i < n; i += 4)
                  S[i] = w[0], S[i + 1] = w[1], S[i + 2] = w[2], S[i + 3] = 255;
              }
              for (const S of this._figures)
                g(wt, S, st);
              return gt.putImageData(wt, 2, 2), {
                canvas: lt.canvas,
                offsetX: p - 2 * C,
                offsetY: r - 2 * V,
                scaleX: C,
                scaleY: V
              };
            }
            getPattern(E, w, y, a) {
              X(E, this._bbox);
              let l;
              if (a === rt.SHADING)
                l = c.Util.singularValueDecompose2dScale((0, P.getCurrentTransform)(E));
              else if (l = c.Util.singularValueDecompose2dScale(w.baseTransform), this.matrix) {
                const p = c.Util.singularValueDecompose2dScale(this.matrix);
                l = [l[0] * p[0], l[1] * p[1]];
              }
              const k = this._createMeshCanvas(l, a === rt.SHADING ? null : this._background, w.cachedCanvases);
              return a !== rt.SHADING && (E.setTransform(...w.baseTransform), this.matrix && E.transform(...this.matrix)), E.translate(k.offsetX, k.offsetY), E.scale(k.scaleX, k.scaleY), E.createPattern(k.canvas, "no-repeat");
            }
          }
          class O extends pt {
            getPattern() {
              return "hotpink";
            }
          }
          function T(b) {
            switch (b[0]) {
              case "RadialAxial":
                return new B(b);
              case "Mesh":
                return new L(b);
              case "Dummy":
                return new O();
            }
            throw new Error(`Unknown IR type: ${b[0]}`);
          }
          const v = {
            COLORED: 1,
            UNCOLORED: 2
          }, u = class u {
            constructor(E, w, y, a, l) {
              this.operatorList = E[2], this.matrix = E[3] || [1, 0, 0, 1, 0, 0], this.bbox = E[4], this.xstep = E[5], this.ystep = E[6], this.paintType = E[7], this.tilingType = E[8], this.color = w, this.ctx = y, this.canvasGraphicsFactory = a, this.baseTransform = l;
            }
            createPatternCanvas(E) {
              const w = this.operatorList, y = this.bbox, a = this.xstep, l = this.ystep, k = this.paintType, p = this.tilingType, r = this.color, x = this.canvasGraphicsFactory;
              (0, c.info)("TilingType: " + p);
              const m = y[0], U = y[1], z = y[2], C = y[3], V = c.Util.singularValueDecompose2dScale(this.matrix), st = c.Util.singularValueDecompose2dScale(this.baseTransform), at = [V[0] * st[0], V[1] * st[1]], H = this.getSizeAndScale(a, this.ctx.canvas.width, at[0]), lt = this.getSizeAndScale(l, this.ctx.canvas.height, at[1]), gt = E.cachedCanvases.getCanvas("pattern", H.size, lt.size, !0), wt = gt.context, Pt = x.createCanvasGraphics(wt);
              Pt.groupLevel = E.groupLevel, this.setFillAndStrokeStyleToContext(Pt, k, r);
              let S = m, i = U, n = z, s = C;
              return m < 0 && (S = 0, n += Math.abs(m)), U < 0 && (i = 0, s += Math.abs(U)), wt.translate(-(H.scale * S), -(lt.scale * i)), Pt.transform(H.scale, 0, 0, lt.scale, 0, 0), wt.save(), this.clipBbox(Pt, S, i, n, s), Pt.baseTransform = (0, P.getCurrentTransform)(Pt.ctx), Pt.executeOperatorList(w), Pt.endDrawing(), {
                canvas: gt.canvas,
                scaleX: H.scale,
                scaleY: lt.scale,
                offsetX: S,
                offsetY: i
              };
            }
            getSizeAndScale(E, w, y) {
              E = Math.abs(E);
              const a = Math.max(u.MAX_PATTERN_SIZE, w);
              let l = Math.ceil(E * y);
              return l >= a ? l = a : y = l / E, {
                scale: y,
                size: l
              };
            }
            clipBbox(E, w, y, a, l) {
              const k = a - w, p = l - y;
              E.ctx.rect(w, y, k, p), E.current.updateRectMinMax((0, P.getCurrentTransform)(E.ctx), [w, y, a, l]), E.clip(), E.endPath();
            }
            setFillAndStrokeStyleToContext(E, w, y) {
              const a = E.ctx, l = E.current;
              switch (w) {
                case v.COLORED:
                  const k = this.ctx;
                  a.fillStyle = k.fillStyle, a.strokeStyle = k.strokeStyle, l.fillColor = k.fillStyle, l.strokeColor = k.strokeStyle;
                  break;
                case v.UNCOLORED:
                  const p = c.Util.makeHexColor(y[0], y[1], y[2]);
                  a.fillStyle = p, a.strokeStyle = p, l.fillColor = p, l.strokeColor = p;
                  break;
                default:
                  throw new c.FormatError(`Unsupported paint type: ${w}`);
              }
            }
            getPattern(E, w, y, a) {
              let l = y;
              a !== rt.SHADING && (l = c.Util.transform(l, w.baseTransform), this.matrix && (l = c.Util.transform(l, this.matrix)));
              const k = this.createPatternCanvas(w);
              let p = new DOMMatrix(l);
              p = p.translate(k.offsetX, k.offsetY), p = p.scale(1 / k.scaleX, 1 / k.scaleY);
              const r = E.createPattern(k.canvas, "repeat");
              return r.setTransform(p), r;
            }
          };
          ee(u, "MAX_PATTERN_SIZE", 3e3);
          let A = u;
          d.TilingPattern = A;
        },
        /* 13 */
        /***/
        (dt, d, et) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.convertBlackAndWhiteToRGBA = rt, d.convertToRGBA = P, d.grayToRGBA = pt;
          var c = et(1);
          function P(B) {
            switch (B.kind) {
              case c.ImageKind.GRAYSCALE_1BPP:
                return rt(B);
              case c.ImageKind.RGB_24BPP:
                return X(B);
            }
            return null;
          }
          function rt({
            src: B,
            srcPos: F = 0,
            dest: g,
            width: L,
            height: O,
            nonBlackColor: T = 4294967295,
            inverseDecode: v = !1
          }) {
            const A = c.FeatureTest.isLittleEndian ? 4278190080 : 255, [u, b] = v ? [T, A] : [A, T], E = L >> 3, w = L & 7, y = B.length;
            g = new Uint32Array(g.buffer);
            let a = 0;
            for (let l = 0; l < O; l++) {
              for (const p = F + E; F < p; F++) {
                const r = F < y ? B[F] : 255;
                g[a++] = r & 128 ? b : u, g[a++] = r & 64 ? b : u, g[a++] = r & 32 ? b : u, g[a++] = r & 16 ? b : u, g[a++] = r & 8 ? b : u, g[a++] = r & 4 ? b : u, g[a++] = r & 2 ? b : u, g[a++] = r & 1 ? b : u;
              }
              if (w === 0)
                continue;
              const k = F < y ? B[F++] : 255;
              for (let p = 0; p < w; p++)
                g[a++] = k & 1 << 7 - p ? b : u;
            }
            return {
              srcPos: F,
              destPos: a
            };
          }
          function X({
            src: B,
            srcPos: F = 0,
            dest: g,
            destPos: L = 0,
            width: O,
            height: T
          }) {
            let v = 0;
            const A = B.length >> 2, u = new Uint32Array(B.buffer, F, A);
            if (c.FeatureTest.isLittleEndian) {
              for (; v < A - 2; v += 3, L += 4) {
                const b = u[v], E = u[v + 1], w = u[v + 2];
                g[L] = b | 4278190080, g[L + 1] = b >>> 24 | E << 8 | 4278190080, g[L + 2] = E >>> 16 | w << 16 | 4278190080, g[L + 3] = w >>> 8 | 4278190080;
              }
              for (let b = v * 4, E = B.length; b < E; b += 3)
                g[L++] = B[b] | B[b + 1] << 8 | B[b + 2] << 16 | 4278190080;
            } else {
              for (; v < A - 2; v += 3, L += 4) {
                const b = u[v], E = u[v + 1], w = u[v + 2];
                g[L] = b | 255, g[L + 1] = b << 24 | E >>> 8 | 255, g[L + 2] = E << 16 | w >>> 16 | 255, g[L + 3] = w << 8 | 255;
              }
              for (let b = v * 4, E = B.length; b < E; b += 3)
                g[L++] = B[b] << 24 | B[b + 1] << 16 | B[b + 2] << 8 | 255;
            }
            return {
              srcPos: F,
              destPos: L
            };
          }
          function pt(B, F) {
            if (c.FeatureTest.isLittleEndian)
              for (let g = 0, L = B.length; g < L; g++)
                F[g] = B[g] * 65793 | 4278190080;
            else
              for (let g = 0, L = B.length; g < L; g++)
                F[g] = B[g] * 16843008 | 255;
          }
        },
        /* 14 */
        /***/
        (dt, d) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.GlobalWorkerOptions = void 0;
          const et = /* @__PURE__ */ Object.create(null);
          d.GlobalWorkerOptions = et, et.workerPort = null, et.workerSrc = "";
        },
        /* 15 */
        /***/
        (dt, d, et) => {
          var B, Pi, g, ki, O, Pe;
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.MessageHandler = void 0;
          var c = et(1);
          const P = {
            UNKNOWN: 0,
            DATA: 1,
            ERROR: 2
          }, rt = {
            UNKNOWN: 0,
            CANCEL: 1,
            CANCEL_COMPLETE: 2,
            CLOSE: 3,
            ENQUEUE: 4,
            ERROR: 5,
            PULL: 6,
            PULL_COMPLETE: 7,
            START_COMPLETE: 8
          };
          function X(v) {
            switch (v instanceof Error || typeof v == "object" && v !== null || (0, c.unreachable)('wrapReason: Expected "reason" to be a (possibly cloned) Error.'), v.name) {
              case "AbortException":
                return new c.AbortException(v.message);
              case "MissingPDFException":
                return new c.MissingPDFException(v.message);
              case "PasswordException":
                return new c.PasswordException(v.message, v.code);
              case "UnexpectedResponseException":
                return new c.UnexpectedResponseException(v.message, v.status);
              case "UnknownErrorException":
                return new c.UnknownErrorException(v.message, v.details);
              default:
                return new c.UnknownErrorException(v.message, v.toString());
            }
          }
          class pt {
            constructor(A, u, b) {
              I(this, B);
              I(this, g);
              I(this, O);
              this.sourceName = A, this.targetName = u, this.comObj = b, this.callbackId = 1, this.streamId = 1, this.streamSinks = /* @__PURE__ */ Object.create(null), this.streamControllers = /* @__PURE__ */ Object.create(null), this.callbackCapabilities = /* @__PURE__ */ Object.create(null), this.actionHandler = /* @__PURE__ */ Object.create(null), this._onComObjOnMessage = (E) => {
                const w = E.data;
                if (w.targetName !== this.sourceName)
                  return;
                if (w.stream) {
                  W(this, g, ki).call(this, w);
                  return;
                }
                if (w.callback) {
                  const a = w.callbackId, l = this.callbackCapabilities[a];
                  if (!l)
                    throw new Error(`Cannot resolve callback ${a}`);
                  if (delete this.callbackCapabilities[a], w.callback === P.DATA)
                    l.resolve(w.data);
                  else if (w.callback === P.ERROR)
                    l.reject(X(w.reason));
                  else
                    throw new Error("Unexpected callback case");
                  return;
                }
                const y = this.actionHandler[w.action];
                if (!y)
                  throw new Error(`Unknown action from worker: ${w.action}`);
                if (w.callbackId) {
                  const a = this.sourceName, l = w.sourceName;
                  new Promise(function(k) {
                    k(y(w.data));
                  }).then(function(k) {
                    b.postMessage({
                      sourceName: a,
                      targetName: l,
                      callback: P.DATA,
                      callbackId: w.callbackId,
                      data: k
                    });
                  }, function(k) {
                    b.postMessage({
                      sourceName: a,
                      targetName: l,
                      callback: P.ERROR,
                      callbackId: w.callbackId,
                      reason: X(k)
                    });
                  });
                  return;
                }
                if (w.streamId) {
                  W(this, B, Pi).call(this, w);
                  return;
                }
                y(w.data);
              }, b.addEventListener("message", this._onComObjOnMessage);
            }
            on(A, u) {
              const b = this.actionHandler;
              if (b[A])
                throw new Error(`There is already an actionName called "${A}"`);
              b[A] = u;
            }
            send(A, u, b) {
              this.comObj.postMessage({
                sourceName: this.sourceName,
                targetName: this.targetName,
                action: A,
                data: u
              }, b);
            }
            sendWithPromise(A, u, b) {
              const E = this.callbackId++, w = new c.PromiseCapability();
              this.callbackCapabilities[E] = w;
              try {
                this.comObj.postMessage({
                  sourceName: this.sourceName,
                  targetName: this.targetName,
                  action: A,
                  callbackId: E,
                  data: u
                }, b);
              } catch (y) {
                w.reject(y);
              }
              return w.promise;
            }
            sendWithStream(A, u, b, E) {
              const w = this.streamId++, y = this.sourceName, a = this.targetName, l = this.comObj;
              return new ReadableStream({
                start: (k) => {
                  const p = new c.PromiseCapability();
                  return this.streamControllers[w] = {
                    controller: k,
                    startCall: p,
                    pullCall: null,
                    cancelCall: null,
                    isClosed: !1
                  }, l.postMessage({
                    sourceName: y,
                    targetName: a,
                    action: A,
                    streamId: w,
                    data: u,
                    desiredSize: k.desiredSize
                  }, E), p.promise;
                },
                pull: (k) => {
                  const p = new c.PromiseCapability();
                  return this.streamControllers[w].pullCall = p, l.postMessage({
                    sourceName: y,
                    targetName: a,
                    stream: rt.PULL,
                    streamId: w,
                    desiredSize: k.desiredSize
                  }), p.promise;
                },
                cancel: (k) => {
                  (0, c.assert)(k instanceof Error, "cancel must have a valid reason");
                  const p = new c.PromiseCapability();
                  return this.streamControllers[w].cancelCall = p, this.streamControllers[w].isClosed = !0, l.postMessage({
                    sourceName: y,
                    targetName: a,
                    stream: rt.CANCEL,
                    streamId: w,
                    reason: X(k)
                  }), p.promise;
                }
              }, b);
            }
            destroy() {
              this.comObj.removeEventListener("message", this._onComObjOnMessage);
            }
          }
          B = new WeakSet(), Pi = function(A) {
            const u = A.streamId, b = this.sourceName, E = A.sourceName, w = this.comObj, y = this, a = this.actionHandler[A.action], l = {
              enqueue(k, p = 1, r) {
                if (this.isCancelled)
                  return;
                const x = this.desiredSize;
                this.desiredSize -= p, x > 0 && this.desiredSize <= 0 && (this.sinkCapability = new c.PromiseCapability(), this.ready = this.sinkCapability.promise), w.postMessage({
                  sourceName: b,
                  targetName: E,
                  stream: rt.ENQUEUE,
                  streamId: u,
                  chunk: k
                }, r);
              },
              close() {
                this.isCancelled || (this.isCancelled = !0, w.postMessage({
                  sourceName: b,
                  targetName: E,
                  stream: rt.CLOSE,
                  streamId: u
                }), delete y.streamSinks[u]);
              },
              error(k) {
                (0, c.assert)(k instanceof Error, "error must have a valid reason"), !this.isCancelled && (this.isCancelled = !0, w.postMessage({
                  sourceName: b,
                  targetName: E,
                  stream: rt.ERROR,
                  streamId: u,
                  reason: X(k)
                }));
              },
              sinkCapability: new c.PromiseCapability(),
              onPull: null,
              onCancel: null,
              isCancelled: !1,
              desiredSize: A.desiredSize,
              ready: null
            };
            l.sinkCapability.resolve(), l.ready = l.sinkCapability.promise, this.streamSinks[u] = l, new Promise(function(k) {
              k(a(A.data, l));
            }).then(function() {
              w.postMessage({
                sourceName: b,
                targetName: E,
                stream: rt.START_COMPLETE,
                streamId: u,
                success: !0
              });
            }, function(k) {
              w.postMessage({
                sourceName: b,
                targetName: E,
                stream: rt.START_COMPLETE,
                streamId: u,
                reason: X(k)
              });
            });
          }, g = new WeakSet(), ki = function(A) {
            const u = A.streamId, b = this.sourceName, E = A.sourceName, w = this.comObj, y = this.streamControllers[u], a = this.streamSinks[u];
            switch (A.stream) {
              case rt.START_COMPLETE:
                A.success ? y.startCall.resolve() : y.startCall.reject(X(A.reason));
                break;
              case rt.PULL_COMPLETE:
                A.success ? y.pullCall.resolve() : y.pullCall.reject(X(A.reason));
                break;
              case rt.PULL:
                if (!a) {
                  w.postMessage({
                    sourceName: b,
                    targetName: E,
                    stream: rt.PULL_COMPLETE,
                    streamId: u,
                    success: !0
                  });
                  break;
                }
                a.desiredSize <= 0 && A.desiredSize > 0 && a.sinkCapability.resolve(), a.desiredSize = A.desiredSize, new Promise(function(l) {
                  var k;
                  l((k = a.onPull) == null ? void 0 : k.call(a));
                }).then(function() {
                  w.postMessage({
                    sourceName: b,
                    targetName: E,
                    stream: rt.PULL_COMPLETE,
                    streamId: u,
                    success: !0
                  });
                }, function(l) {
                  w.postMessage({
                    sourceName: b,
                    targetName: E,
                    stream: rt.PULL_COMPLETE,
                    streamId: u,
                    reason: X(l)
                  });
                });
                break;
              case rt.ENQUEUE:
                if ((0, c.assert)(y, "enqueue should have stream controller"), y.isClosed)
                  break;
                y.controller.enqueue(A.chunk);
                break;
              case rt.CLOSE:
                if ((0, c.assert)(y, "close should have stream controller"), y.isClosed)
                  break;
                y.isClosed = !0, y.controller.close(), W(this, O, Pe).call(this, y, u);
                break;
              case rt.ERROR:
                (0, c.assert)(y, "error should have stream controller"), y.controller.error(X(A.reason)), W(this, O, Pe).call(this, y, u);
                break;
              case rt.CANCEL_COMPLETE:
                A.success ? y.cancelCall.resolve() : y.cancelCall.reject(X(A.reason)), W(this, O, Pe).call(this, y, u);
                break;
              case rt.CANCEL:
                if (!a)
                  break;
                new Promise(function(l) {
                  var k;
                  l((k = a.onCancel) == null ? void 0 : k.call(a, X(A.reason)));
                }).then(function() {
                  w.postMessage({
                    sourceName: b,
                    targetName: E,
                    stream: rt.CANCEL_COMPLETE,
                    streamId: u,
                    success: !0
                  });
                }, function(l) {
                  w.postMessage({
                    sourceName: b,
                    targetName: E,
                    stream: rt.CANCEL_COMPLETE,
                    streamId: u,
                    reason: X(l)
                  });
                }), a.sinkCapability.reject(X(A.reason)), a.isCancelled = !0, delete this.streamSinks[u];
                break;
              default:
                throw new Error("Unexpected stream case");
            }
          }, O = new WeakSet(), Pe = async function(A, u) {
            var b, E, w;
            await Promise.allSettled([(b = A.startCall) == null ? void 0 : b.promise, (E = A.pullCall) == null ? void 0 : E.promise, (w = A.cancelCall) == null ? void 0 : w.promise]), delete this.streamControllers[u];
          }, d.MessageHandler = pt;
        },
        /* 16 */
        /***/
        (dt, d, et) => {
          var rt, X;
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.Metadata = void 0;
          var c = et(1);
          class P {
            constructor({
              parsedData: B,
              rawData: F
            }) {
              I(this, rt, void 0);
              I(this, X, void 0);
              Z(this, rt, B), Z(this, X, F);
            }
            getRaw() {
              return t(this, X);
            }
            get(B) {
              return t(this, rt).get(B) ?? null;
            }
            getAll() {
              return (0, c.objectFromMap)(t(this, rt));
            }
            has(B) {
              return t(this, rt).has(B);
            }
          }
          rt = new WeakMap(), X = new WeakMap(), d.Metadata = P;
        },
        /* 17 */
        /***/
        (dt, d, et) => {
          var B, F, g, L, O, T, ti;
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.OptionalContentConfig = void 0;
          var c = et(1), P = et(8);
          const rt = Symbol("INTERNAL");
          class X {
            constructor(u, b) {
              I(this, B, !0);
              this.name = u, this.intent = b;
            }
            get visible() {
              return t(this, B);
            }
            _setVisible(u, b) {
              u !== rt && (0, c.unreachable)("Internal method `_setVisible` called."), Z(this, B, b);
            }
          }
          B = new WeakMap();
          class pt {
            constructor(u) {
              I(this, T);
              I(this, F, null);
              I(this, g, /* @__PURE__ */ new Map());
              I(this, L, null);
              I(this, O, null);
              if (this.name = null, this.creator = null, u !== null) {
                this.name = u.name, this.creator = u.creator, Z(this, O, u.order);
                for (const b of u.groups)
                  t(this, g).set(b.id, new X(b.name, b.intent));
                if (u.baseState === "OFF")
                  for (const b of t(this, g).values())
                    b._setVisible(rt, !1);
                for (const b of u.on)
                  t(this, g).get(b)._setVisible(rt, !0);
                for (const b of u.off)
                  t(this, g).get(b)._setVisible(rt, !1);
                Z(this, L, this.getHash());
              }
            }
            isVisible(u) {
              if (t(this, g).size === 0)
                return !0;
              if (!u)
                return (0, c.warn)("Optional content group not defined."), !0;
              if (u.type === "OCG")
                return t(this, g).has(u.id) ? t(this, g).get(u.id).visible : ((0, c.warn)(`Optional content group not found: ${u.id}`), !0);
              if (u.type === "OCMD") {
                if (u.expression)
                  return W(this, T, ti).call(this, u.expression);
                if (!u.policy || u.policy === "AnyOn") {
                  for (const b of u.ids) {
                    if (!t(this, g).has(b))
                      return (0, c.warn)(`Optional content group not found: ${b}`), !0;
                    if (t(this, g).get(b).visible)
                      return !0;
                  }
                  return !1;
                } else if (u.policy === "AllOn") {
                  for (const b of u.ids) {
                    if (!t(this, g).has(b))
                      return (0, c.warn)(`Optional content group not found: ${b}`), !0;
                    if (!t(this, g).get(b).visible)
                      return !1;
                  }
                  return !0;
                } else if (u.policy === "AnyOff") {
                  for (const b of u.ids) {
                    if (!t(this, g).has(b))
                      return (0, c.warn)(`Optional content group not found: ${b}`), !0;
                    if (!t(this, g).get(b).visible)
                      return !0;
                  }
                  return !1;
                } else if (u.policy === "AllOff") {
                  for (const b of u.ids) {
                    if (!t(this, g).has(b))
                      return (0, c.warn)(`Optional content group not found: ${b}`), !0;
                    if (t(this, g).get(b).visible)
                      return !1;
                  }
                  return !0;
                }
                return (0, c.warn)(`Unknown optional content policy ${u.policy}.`), !0;
              }
              return (0, c.warn)(`Unknown group type ${u.type}.`), !0;
            }
            setVisibility(u, b = !0) {
              if (!t(this, g).has(u)) {
                (0, c.warn)(`Optional content group not found: ${u}`);
                return;
              }
              t(this, g).get(u)._setVisible(rt, !!b), Z(this, F, null);
            }
            get hasInitialVisibility() {
              return t(this, L) === null || this.getHash() === t(this, L);
            }
            getOrder() {
              return t(this, g).size ? t(this, O) ? t(this, O).slice() : [...t(this, g).keys()] : null;
            }
            getGroups() {
              return t(this, g).size > 0 ? (0, c.objectFromMap)(t(this, g)) : null;
            }
            getGroup(u) {
              return t(this, g).get(u) || null;
            }
            getHash() {
              if (t(this, F) !== null)
                return t(this, F);
              const u = new P.MurmurHash3_64();
              for (const [b, E] of t(this, g))
                u.update(`${b}:${E.visible}`);
              return Z(this, F, u.hexdigest());
            }
          }
          F = new WeakMap(), g = new WeakMap(), L = new WeakMap(), O = new WeakMap(), T = new WeakSet(), ti = function(u) {
            const b = u.length;
            if (b < 2)
              return !0;
            const E = u[0];
            for (let w = 1; w < b; w++) {
              const y = u[w];
              let a;
              if (Array.isArray(y))
                a = W(this, T, ti).call(this, y);
              else if (t(this, g).has(y))
                a = t(this, g).get(y).visible;
              else
                return (0, c.warn)(`Optional content group not found: ${y}`), !0;
              switch (E) {
                case "And":
                  if (!a)
                    return !1;
                  break;
                case "Or":
                  if (a)
                    return !0;
                  break;
                case "Not":
                  return !a;
                default:
                  return !0;
              }
            }
            return E === "And";
          }, d.OptionalContentConfig = pt;
        },
        /* 18 */
        /***/
        (dt, d, et) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.PDFDataTransportStream = void 0;
          var c = et(1), P = et(6);
          class rt {
            constructor({
              length: F,
              initialData: g,
              progressiveDone: L = !1,
              contentDispositionFilename: O = null,
              disableRange: T = !1,
              disableStream: v = !1
            }, A) {
              if ((0, c.assert)(A, 'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.'), this._queuedChunks = [], this._progressiveDone = L, this._contentDispositionFilename = O, (g == null ? void 0 : g.length) > 0) {
                const u = g instanceof Uint8Array && g.byteLength === g.buffer.byteLength ? g.buffer : new Uint8Array(g).buffer;
                this._queuedChunks.push(u);
              }
              this._pdfDataRangeTransport = A, this._isStreamingSupported = !v, this._isRangeSupported = !T, this._contentLength = F, this._fullRequestReader = null, this._rangeReaders = [], this._pdfDataRangeTransport.addRangeListener((u, b) => {
                this._onReceiveData({
                  begin: u,
                  chunk: b
                });
              }), this._pdfDataRangeTransport.addProgressListener((u, b) => {
                this._onProgress({
                  loaded: u,
                  total: b
                });
              }), this._pdfDataRangeTransport.addProgressiveReadListener((u) => {
                this._onReceiveData({
                  chunk: u
                });
              }), this._pdfDataRangeTransport.addProgressiveDoneListener(() => {
                this._onProgressiveDone();
              }), this._pdfDataRangeTransport.transportReady();
            }
            _onReceiveData({
              begin: F,
              chunk: g
            }) {
              const L = g instanceof Uint8Array && g.byteLength === g.buffer.byteLength ? g.buffer : new Uint8Array(g).buffer;
              if (F === void 0)
                this._fullRequestReader ? this._fullRequestReader._enqueue(L) : this._queuedChunks.push(L);
              else {
                const O = this._rangeReaders.some(function(T) {
                  return T._begin !== F ? !1 : (T._enqueue(L), !0);
                });
                (0, c.assert)(O, "_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.");
              }
            }
            get _progressiveDataLength() {
              var F;
              return ((F = this._fullRequestReader) == null ? void 0 : F._loaded) ?? 0;
            }
            _onProgress(F) {
              var g, L, O, T;
              F.total === void 0 ? (L = (g = this._rangeReaders[0]) == null ? void 0 : g.onProgress) == null || L.call(g, {
                loaded: F.loaded
              }) : (T = (O = this._fullRequestReader) == null ? void 0 : O.onProgress) == null || T.call(O, {
                loaded: F.loaded,
                total: F.total
              });
            }
            _onProgressiveDone() {
              var F;
              (F = this._fullRequestReader) == null || F.progressiveDone(), this._progressiveDone = !0;
            }
            _removeRangeReader(F) {
              const g = this._rangeReaders.indexOf(F);
              g >= 0 && this._rangeReaders.splice(g, 1);
            }
            getFullReader() {
              (0, c.assert)(!this._fullRequestReader, "PDFDataTransportStream.getFullReader can only be called once.");
              const F = this._queuedChunks;
              return this._queuedChunks = null, new X(this, F, this._progressiveDone, this._contentDispositionFilename);
            }
            getRangeReader(F, g) {
              if (g <= this._progressiveDataLength)
                return null;
              const L = new pt(this, F, g);
              return this._pdfDataRangeTransport.requestDataRange(F, g), this._rangeReaders.push(L), L;
            }
            cancelAllRequests(F) {
              var g;
              (g = this._fullRequestReader) == null || g.cancel(F);
              for (const L of this._rangeReaders.slice(0))
                L.cancel(F);
              this._pdfDataRangeTransport.abort();
            }
          }
          d.PDFDataTransportStream = rt;
          class X {
            constructor(F, g, L = !1, O = null) {
              this._stream = F, this._done = L || !1, this._filename = (0, P.isPdfFile)(O) ? O : null, this._queuedChunks = g || [], this._loaded = 0;
              for (const T of this._queuedChunks)
                this._loaded += T.byteLength;
              this._requests = [], this._headersReady = Promise.resolve(), F._fullRequestReader = this, this.onProgress = null;
            }
            _enqueue(F) {
              this._done || (this._requests.length > 0 ? this._requests.shift().resolve({
                value: F,
                done: !1
              }) : this._queuedChunks.push(F), this._loaded += F.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 F = new c.PromiseCapability();
              return this._requests.push(F), F.promise;
            }
            cancel(F) {
              this._done = !0;
              for (const g of this._requests)
                g.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0;
            }
            progressiveDone() {
              this._done || (this._done = !0);
            }
          }
          class pt {
            constructor(F, g, L) {
              this._stream = F, this._begin = g, this._end = L, this._queuedChunk = null, this._requests = [], this._done = !1, this.onProgress = null;
            }
            _enqueue(F) {
              if (!this._done) {
                if (this._requests.length === 0)
                  this._queuedChunk = F;
                else {
                  this._requests.shift().resolve({
                    value: F,
                    done: !1
                  });
                  for (const L of this._requests)
                    L.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 g = this._queuedChunk;
                return this._queuedChunk = null, {
                  value: g,
                  done: !1
                };
              }
              if (this._done)
                return {
                  value: void 0,
                  done: !0
                };
              const F = new c.PromiseCapability();
              return this._requests.push(F), F.promise;
            }
            cancel(F) {
              this._done = !0;
              for (const g of this._requests)
                g.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._stream._removeRangeReader(this);
            }
          }
        },
        /* 19 */
        /***/
        (dt, d, et) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.PDFFetchStream = void 0;
          var c = et(1), P = et(20);
          function rt(L, O, T) {
            return {
              method: "GET",
              headers: L,
              signal: T.signal,
              mode: "cors",
              credentials: O ? "include" : "same-origin",
              redirect: "follow"
            };
          }
          function X(L) {
            const O = new Headers();
            for (const T in L) {
              const v = L[T];
              v !== void 0 && O.append(T, v);
            }
            return O;
          }
          function pt(L) {
            return L instanceof Uint8Array ? L.buffer : L instanceof ArrayBuffer ? L : ((0, c.warn)(`getArrayBuffer - unexpected data format: ${L}`), new Uint8Array(L).buffer);
          }
          class B {
            constructor(O) {
              this.source = O, this.isHttp = /^https?:/i.test(O.url), this.httpHeaders = this.isHttp && O.httpHeaders || {}, this._fullRequestReader = null, this._rangeRequestReaders = [];
            }
            get _progressiveDataLength() {
              var O;
              return ((O = this._fullRequestReader) == null ? void 0 : O._loaded) ?? 0;
            }
            getFullReader() {
              return (0, c.assert)(!this._fullRequestReader, "PDFFetchStream.getFullReader can only be called once."), this._fullRequestReader = new F(this), this._fullRequestReader;
            }
            getRangeReader(O, T) {
              if (T <= this._progressiveDataLength)
                return null;
              const v = new g(this, O, T);
              return this._rangeRequestReaders.push(v), v;
            }
            cancelAllRequests(O) {
              var T;
              (T = this._fullRequestReader) == null || T.cancel(O);
              for (const v of this._rangeRequestReaders.slice(0))
                v.cancel(O);
            }
          }
          d.PDFFetchStream = B;
          class F {
            constructor(O) {
              this._stream = O, this._reader = null, this._loaded = 0, this._filename = null;
              const T = O.source;
              this._withCredentials = T.withCredentials || !1, this._contentLength = T.length, this._headersCapability = new c.PromiseCapability(), this._disableRange = T.disableRange || !1, this._rangeChunkSize = T.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._abortController = new AbortController(), this._isStreamingSupported = !T.disableStream, this._isRangeSupported = !T.disableRange, this._headers = X(this._stream.httpHeaders);
              const v = T.url;
              fetch(v, rt(this._headers, this._withCredentials, this._abortController)).then((A) => {
                if (!(0, P.validateResponseStatus)(A.status))
                  throw (0, P.createResponseStatusError)(A.status, v);
                this._reader = A.body.getReader(), this._headersCapability.resolve();
                const u = (w) => A.headers.get(w), {
                  allowRangeRequests: b,
                  suggestedLength: E
                } = (0, P.validateRangeRequestCapabilities)({
                  getResponseHeader: u,
                  isHttp: this._stream.isHttp,
                  rangeChunkSize: this._rangeChunkSize,
                  disableRange: this._disableRange
                });
                this._isRangeSupported = b, this._contentLength = E || this._contentLength, this._filename = (0, P.extractFilenameFromHeader)(u), !this._isStreamingSupported && this._isRangeSupported && this.cancel(new c.AbortException("Streaming is disabled."));
              }).catch(this._headersCapability.reject), this.onProgress = null;
            }
            get headersReady() {
              return this._headersCapability.promise;
            }
            get filename() {
              return this._filename;
            }
            get contentLength() {
              return this._contentLength;
            }
            get isRangeSupported() {
              return this._isRangeSupported;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              var v;
              await this._headersCapability.promise;
              const {
                value: O,
                done: T
              } = await this._reader.read();
              return T ? {
                value: O,
                done: T
              } : (this._loaded += O.byteLength, (v = this.onProgress) == null || v.call(this, {
                loaded: this._loaded,
                total: this._contentLength
              }), {
                value: pt(O),
                done: !1
              });
            }
            cancel(O) {
              var T;
              (T = this._reader) == null || T.cancel(O), this._abortController.abort();
            }
          }
          class g {
            constructor(O, T, v) {
              this._stream = O, this._reader = null, this._loaded = 0;
              const A = O.source;
              this._withCredentials = A.withCredentials || !1, this._readCapability = new c.PromiseCapability(), this._isStreamingSupported = !A.disableStream, this._abortController = new AbortController(), this._headers = X(this._stream.httpHeaders), this._headers.append("Range", `bytes=${T}-${v - 1}`);
              const u = A.url;
              fetch(u, rt(this._headers, this._withCredentials, this._abortController)).then((b) => {
                if (!(0, P.validateResponseStatus)(b.status))
                  throw (0, P.createResponseStatusError)(b.status, u);
                this._readCapability.resolve(), this._reader = b.body.getReader();
              }).catch(this._readCapability.reject), this.onProgress = null;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              var v;
              await this._readCapability.promise;
              const {
                value: O,
                done: T
              } = await this._reader.read();
              return T ? {
                value: O,
                done: T
              } : (this._loaded += O.byteLength, (v = this.onProgress) == null || v.call(this, {
                loaded: this._loaded
              }), {
                value: pt(O),
                done: !1
              });
            }
            cancel(O) {
              var T;
              (T = this._reader) == null || T.cancel(O), this._abortController.abort();
            }
          }
        },
        /* 20 */
        /***/
        (dt, d, et) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.createResponseStatusError = B, d.extractFilenameFromHeader = pt, d.validateRangeRequestCapabilities = X, d.validateResponseStatus = F;
          var c = et(1), P = et(21), rt = et(6);
          function X({
            getResponseHeader: g,
            isHttp: L,
            rangeChunkSize: O,
            disableRange: T
          }) {
            const v = {
              allowRangeRequests: !1,
              suggestedLength: void 0
            }, A = parseInt(g("Content-Length"), 10);
            return !Number.isInteger(A) || (v.suggestedLength = A, A <= 2 * O) || T || !L || g("Accept-Ranges") !== "bytes" || (g("Content-Encoding") || "identity") !== "identity" || (v.allowRangeRequests = !0), v;
          }
          function pt(g) {
            const L = g("Content-Disposition");
            if (L) {
              let O = (0, P.getFilenameFromContentDispositionHeader)(L);
              if (O.includes("%"))
                try {
                  O = decodeURIComponent(O);
                } catch {
                }
              if ((0, rt.isPdfFile)(O))
                return O;
            }
            return null;
          }
          function B(g, L) {
            return g === 404 || g === 0 && L.startsWith("file:") ? new c.MissingPDFException('Missing PDF "' + L + '".') : new c.UnexpectedResponseException(`Unexpected server response (${g}) while retrieving PDF "${L}".`, g);
          }
          function F(g) {
            return g === 200 || g === 206;
          }
        },
        /* 21 */
        /***/
        (dt, d, et) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.getFilenameFromContentDispositionHeader = P;
          var c = et(1);
          function P(rt) {
            let X = !0, pt = B("filename\\*", "i").exec(rt);
            if (pt) {
              pt = pt[1];
              let A = O(pt);
              return A = unescape(A), A = T(A), A = v(A), g(A);
            }
            if (pt = L(rt), pt) {
              const A = v(pt);
              return g(A);
            }
            if (pt = B("filename", "i").exec(rt), pt) {
              pt = pt[1];
              let A = O(pt);
              return A = v(A), g(A);
            }
            function B(A, u) {
              return new RegExp("(?:^|;)\\s*" + A + '\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)', u);
            }
            function F(A, u) {
              if (A) {
                if (!/^[\x00-\xFF]+$/.test(u))
                  return u;
                try {
                  const b = new TextDecoder(A, {
                    fatal: !0
                  }), E = (0, c.stringToBytes)(u);
                  u = b.decode(E), X = !1;
                } catch {
                }
              }
              return u;
            }
            function g(A) {
              return X && /[\x80-\xff]/.test(A) && (A = F("utf-8", A), X && (A = F("iso-8859-1", A))), A;
            }
            function L(A) {
              const u = [];
              let b;
              const E = B("filename\\*((?!0\\d)\\d+)(\\*?)", "ig");
              for (; (b = E.exec(A)) !== null; ) {
                let [, y, a, l] = b;
                if (y = parseInt(y, 10), y in u) {
                  if (y === 0)
                    break;
                  continue;
                }
                u[y] = [a, l];
              }
              const w = [];
              for (let y = 0; y < u.length && y in u; ++y) {
                let [a, l] = u[y];
                l = O(l), a && (l = unescape(l), y === 0 && (l = T(l))), w.push(l);
              }
              return w.join("");
            }
            function O(A) {
              if (A.startsWith('"')) {
                const u = A.slice(1).split('\\"');
                for (let b = 0; b < u.length; ++b) {
                  const E = u[b].indexOf('"');
                  E !== -1 && (u[b] = u[b].slice(0, E), u.length = b + 1), u[b] = u[b].replaceAll(/\\(.)/g, "$1");
                }
                A = u.join('"');
              }
              return A;
            }
            function T(A) {
              const u = A.indexOf("'");
              if (u === -1)
                return A;
              const b = A.slice(0, u), w = A.slice(u + 1).replace(/^[^']*'/, "");
              return F(b, w);
            }
            function v(A) {
              return !A.startsWith("=?") || /[\x00-\x19\x80-\xff]/.test(A) ? A : A.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g, function(u, b, E, w) {
                if (E === "q" || E === "Q")
                  return w = w.replaceAll("_", " "), w = w.replaceAll(/=([0-9a-fA-F]{2})/g, function(y, a) {
                    return String.fromCharCode(parseInt(a, 16));
                  }), F(b, w);
                try {
                  w = atob(w);
                } catch {
                }
                return F(b, w);
              });
            }
            return "";
          }
        },
        /* 22 */
        /***/
        (dt, d, et) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.PDFNetworkStream = void 0;
          var c = et(1), P = et(20);
          const rt = 200, X = 206;
          function pt(O) {
            const T = O.response;
            return typeof T != "string" ? T : (0, c.stringToBytes)(T).buffer;
          }
          class B {
            constructor(T, v = {}) {
              this.url = T, this.isHttp = /^https?:/i.test(T), this.httpHeaders = this.isHttp && v.httpHeaders || /* @__PURE__ */ Object.create(null), this.withCredentials = v.withCredentials || !1, this.currXhrId = 0, this.pendingRequests = /* @__PURE__ */ Object.create(null);
            }
            requestRange(T, v, A) {
              const u = {
                begin: T,
                end: v
              };
              for (const b in A)
                u[b] = A[b];
              return this.request(u);
            }
            requestFull(T) {
              return this.request(T);
            }
            request(T) {
              const v = new XMLHttpRequest(), A = this.currXhrId++, u = this.pendingRequests[A] = {
                xhr: v
              };
              v.open("GET", this.url), v.withCredentials = this.withCredentials;
              for (const b in this.httpHeaders) {
                const E = this.httpHeaders[b];
                E !== void 0 && v.setRequestHeader(b, E);
              }
              return this.isHttp && "begin" in T && "end" in T ? (v.setRequestHeader("Range", `bytes=${T.begin}-${T.end - 1}`), u.expectedStatus = X) : u.expectedStatus = rt, v.responseType = "arraybuffer", T.onError && (v.onerror = function(b) {
                T.onError(v.status);
              }), v.onreadystatechange = this.onStateChange.bind(this, A), v.onprogress = this.onProgress.bind(this, A), u.onHeadersReceived = T.onHeadersReceived, u.onDone = T.onDone, u.onError = T.onError, u.onProgress = T.onProgress, v.send(null), A;
            }
            onProgress(T, v) {
              var u;
              const A = this.pendingRequests[T];
              A && ((u = A.onProgress) == null || u.call(A, v));
            }
            onStateChange(T, v) {
              var y, a, l;
              const A = this.pendingRequests[T];
              if (!A)
                return;
              const u = A.xhr;
              if (u.readyState >= 2 && A.onHeadersReceived && (A.onHeadersReceived(), delete A.onHeadersReceived), u.readyState !== 4 || !(T in this.pendingRequests))
                return;
              if (delete this.pendingRequests[T], u.status === 0 && this.isHttp) {
                (y = A.onError) == null || y.call(A, u.status);
                return;
              }
              const b = u.status || rt;
              if (!(b === rt && A.expectedStatus === X) && b !== A.expectedStatus) {
                (a = A.onError) == null || a.call(A, u.status);
                return;
              }
              const w = pt(u);
              if (b === X) {
                const k = u.getResponseHeader("Content-Range"), p = /bytes (\d+)-(\d+)\/(\d+)/.exec(k);
                A.onDone({
                  begin: parseInt(p[1], 10),
                  chunk: w
                });
              } else
                w ? A.onDone({
                  begin: 0,
                  chunk: w
                }) : (l = A.onError) == null || l.call(A, u.status);
            }
            getRequestXhr(T) {
              return this.pendingRequests[T].xhr;
            }
            isPendingRequest(T) {
              return T in this.pendingRequests;
            }
            abortRequest(T) {
              const v = this.pendingRequests[T].xhr;
              delete this.pendingRequests[T], v.abort();
            }
          }
          class F {
            constructor(T) {
              this._source = T, this._manager = new B(T.url, {
                httpHeaders: T.httpHeaders,
                withCredentials: T.withCredentials
              }), this._rangeChunkSize = T.rangeChunkSize, this._fullRequestReader = null, this._rangeRequestReaders = [];
            }
            _onRangeRequestReaderClosed(T) {
              const v = this._rangeRequestReaders.indexOf(T);
              v >= 0 && this._rangeRequestReaders.splice(v, 1);
            }
            getFullReader() {
              return (0, c.assert)(!this._fullRequestReader, "PDFNetworkStream.getFullReader can only be called once."), this._fullRequestReader = new g(this._manager, this._source), this._fullRequestReader;
            }
            getRangeReader(T, v) {
              const A = new L(this._manager, T, v);
              return A.onClosed = this._onRangeRequestReaderClosed.bind(this), this._rangeRequestReaders.push(A), A;
            }
            cancelAllRequests(T) {
              var v;
              (v = this._fullRequestReader) == null || v.cancel(T);
              for (const A of this._rangeRequestReaders.slice(0))
                A.cancel(T);
            }
          }
          d.PDFNetworkStream = F;
          class g {
            constructor(T, v) {
              this._manager = T;
              const A = {
                onHeadersReceived: this._onHeadersReceived.bind(this),
                onDone: this._onDone.bind(this),
                onError: this._onError.bind(this),
                onProgress: this._onProgress.bind(this)
              };
              this._url = v.url, this._fullRequestId = T.requestFull(A), this._headersReceivedCapability = new c.PromiseCapability(), this._disableRange = v.disableRange || !1, this._contentLength = v.length, this._rangeChunkSize = v.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, v = this._manager.getRequestXhr(T), A = (E) => v.getResponseHeader(E), {
                allowRangeRequests: u,
                suggestedLength: b
              } = (0, P.validateRangeRequestCapabilities)({
                getResponseHeader: A,
                isHttp: this._manager.isHttp,
                rangeChunkSize: this._rangeChunkSize,
                disableRange: this._disableRange
              });
              u && (this._isRangeSupported = !0), this._contentLength = b || this._contentLength, this._filename = (0, P.extractFilenameFromHeader)(A), this._isRangeSupported && this._manager.abortRequest(T), this._headersReceivedCapability.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 v of this._requests)
                  v.resolve({
                    value: void 0,
                    done: !0
                  });
                this._requests.length = 0;
              }
            }
            _onError(T) {
              this._storedError = (0, P.createResponseStatusError)(T, this._url), this._headersReceivedCapability.reject(this._storedError);
              for (const v of this._requests)
                v.reject(this._storedError);
              this._requests.length = 0, this._cachedChunks.length = 0;
            }
            _onProgress(T) {
              var v;
              (v = this.onProgress) == null || v.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._headersReceivedCapability.promise;
            }
            async read() {
              if (this._storedError)
                throw this._storedError;
              if (this._cachedChunks.length > 0)
                return {
                  value: this._cachedChunks.shift(),
                  done: !1
                };
              if (this._done)
                return {
                  value: void 0,
                  done: !0
                };
              const T = new c.PromiseCapability();
              return this._requests.push(T), T.promise;
            }
            cancel(T) {
              this._done = !0, this._headersReceivedCapability.reject(T);
              for (const v of this._requests)
                v.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._manager.isPendingRequest(this._fullRequestId) && this._manager.abortRequest(this._fullRequestId), this._fullRequestReader = null;
            }
          }
          class L {
            constructor(T, v, A) {
              this._manager = T;
              const u = {
                onDone: this._onDone.bind(this),
                onError: this._onError.bind(this),
                onProgress: this._onProgress.bind(this)
              };
              this._url = T.url, this._requestId = T.requestRange(v, A, u), this._requests = [], this._queuedChunk = null, this._done = !1, this._storedError = void 0, this.onProgress = null, this.onClosed = null;
            }
            _close() {
              var T;
              (T = this.onClosed) == null || T.call(this, this);
            }
            _onDone(T) {
              const v = T.chunk;
              this._requests.length > 0 ? this._requests.shift().resolve({
                value: v,
                done: !1
              }) : this._queuedChunk = v, this._done = !0;
              for (const A of this._requests)
                A.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._close();
            }
            _onError(T) {
              this._storedError = (0, P.createResponseStatusError)(T, this._url);
              for (const v of this._requests)
                v.reject(this._storedError);
              this._requests.length = 0, this._queuedChunk = null;
            }
            _onProgress(T) {
              var v;
              this.isStreamingSupported || (v = this.onProgress) == null || v.call(this, {
                loaded: T.loaded
              });
            }
            get isStreamingSupported() {
              return !1;
            }
            async read() {
              if (this._storedError)
                throw this._storedError;
              if (this._queuedChunk !== null) {
                const v = this._queuedChunk;
                return this._queuedChunk = null, {
                  value: v,
                  done: !1
                };
              }
              if (this._done)
                return {
                  value: void 0,
                  done: !0
                };
              const T = new c.PromiseCapability();
              return this._requests.push(T), T.promise;
            }
            cancel(T) {
              this._done = !0;
              for (const v of this._requests)
                v.resolve({
                  value: void 0,
                  done: !0
                });
              this._requests.length = 0, this._manager.isPendingRequest(this._requestId) && this._manager.abortRequest(this._requestId), this._close();
            }
          }
        },
        /* 23 */
        /***/
        (dt, d, et) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.PDFNodeStream = void 0;
          var c = et(1), P = et(20);
          const rt = /^file:\/\/\/[a-zA-Z]:\//;
          function X(A) {
            const u = require$$5, b = u.parse(A);
            return b.protocol === "file:" || b.host ? b : /^[a-z]:[/\\]/i.test(A) ? u.parse(`file:///${A}`) : (b.host || (b.protocol = "file:"), b);
          }
          class pt {
            constructor(u) {
              this.source = u, this.url = X(u.url), this.isHttp = this.url.protocol === "http:" || this.url.protocol === "https:", this.isFsUrl = this.url.protocol === "file:", this.httpHeaders = this.isHttp && u.httpHeaders || {}, this._fullRequestReader = null, this._rangeRequestReaders = [];
            }
            get _progressiveDataLength() {
              var u;
              return ((u = this._fullRequestReader) == null ? void 0 : u._loaded) ?? 0;
            }
            getFullReader() {
              return (0, c.assert)(!this._fullRequestReader, "PDFNodeStream.getFullReader can only be called once."), this._fullRequestReader = this.isFsUrl ? new T(this) : new L(this), this._fullRequestReader;
            }
            getRangeReader(u, b) {
              if (b <= this._progressiveDataLength)
                return null;
              const E = this.isFsUrl ? new v(this, u, b) : new O(this, u, b);
              return this._rangeRequestReaders.push(E), E;
            }
            cancelAllRequests(u) {
              var b;
              (b = this._fullRequestReader) == null || b.cancel(u);
              for (const E of this._rangeRequestReaders.slice(0))
                E.cancel(u);
            }
          }
          d.PDFNodeStream = pt;
          class B {
            constructor(u) {
              this._url = u.url, this._done = !1, this._storedError = null, this.onProgress = null;
              const b = u.source;
              this._contentLength = b.length, this._loaded = 0, this._filename = null, this._disableRange = b.disableRange || !1, this._rangeChunkSize = b.rangeChunkSize, !this._rangeChunkSize && !this._disableRange && (this._disableRange = !0), this._isStreamingSupported = !b.disableStream, this._isRangeSupported = !b.disableRange, this._readableStream = null, this._readCapability = new c.PromiseCapability(), this._headersCapability = new c.PromiseCapability();
            }
            get headersReady() {
              return this._headersCapability.promise;
            }
            get filename() {
              return this._filename;
            }
            get contentLength() {
              return this._contentLength;
            }
            get isRangeSupported() {
              return this._isRangeSupported;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              var E;
              if (await this._readCapability.promise, this._done)
                return {
                  value: void 0,
                  done: !0
                };
              if (this._storedError)
                throw this._storedError;
              const u = this._readableStream.read();
              return u === null ? (this._readCapability = new c.PromiseCapability(), this.read()) : (this._loaded += u.length, (E = this.onProgress) == null || E.call(this, {
                loaded: this._loaded,
                total: this._contentLength
              }), {
                value: new Uint8Array(u).buffer,
                done: !1
              });
            }
            cancel(u) {
              if (!this._readableStream) {
                this._error(u);
                return;
              }
              this._readableStream.destroy(u);
            }
            _error(u) {
              this._storedError = u, this._readCapability.resolve();
            }
            _setReadableStream(u) {
              this._readableStream = u, u.on("readable", () => {
                this._readCapability.resolve();
              }), u.on("end", () => {
                u.destroy(), this._done = !0, this._readCapability.resolve();
              }), u.on("error", (b) => {
                this._error(b);
              }), !this._isStreamingSupported && this._isRangeSupported && this._error(new c.AbortException("streaming is disabled")), this._storedError && this._readableStream.destroy(this._storedError);
            }
          }
          class F {
            constructor(u) {
              this._url = u.url, this._done = !1, this._storedError = null, this.onProgress = null, this._loaded = 0, this._readableStream = null, this._readCapability = new c.PromiseCapability();
              const b = u.source;
              this._isStreamingSupported = !b.disableStream;
            }
            get isStreamingSupported() {
              return this._isStreamingSupported;
            }
            async read() {
              var E;
              if (await this._readCapability.promise, this._done)
                return {
                  value: void 0,
                  done: !0
                };
              if (this._storedError)
                throw this._storedError;
              const u = this._readableStream.read();
              return u === null ? (this._readCapability = new c.PromiseCapability(), this.read()) : (this._loaded += u.length, (E = this.onProgress) == null || E.call(this, {
                loaded: this._loaded
              }), {
                value: new Uint8Array(u).buffer,
                done: !1
              });
            }
            cancel(u) {
              if (!this._readableStream) {
                this._error(u);
                return;
              }
              this._readableStream.destroy(u);
            }
            _error(u) {
              this._storedError = u, this._readCapability.resolve();
            }
            _setReadableStream(u) {
              this._readableStream = u, u.on("readable", () => {
                this._readCapability.resolve();
              }), u.on("end", () => {
                u.destroy(), this._done = !0, this._readCapability.resolve();
              }), u.on("error", (b) => {
                this._error(b);
              }), this._storedError && this._readableStream.destroy(this._storedError);
            }
          }
          function g(A, u) {
            return {
              protocol: A.protocol,
              auth: A.auth,
              host: A.hostname,
              port: A.port,
              path: A.path,
              method: "GET",
              headers: u
            };
          }
          class L extends B {
            constructor(u) {
              super(u);
              const b = (E) => {
                if (E.statusCode === 404) {
                  const l = new c.MissingPDFException(`Missing PDF "${this._url}".`);
                  this._storedError = l, this._headersCapability.reject(l);
                  return;
                }
                this._headersCapability.resolve(), this._setReadableStream(E);
                const w = (l) => this._readableStream.headers[l.toLowerCase()], {
                  allowRangeRequests: y,
                  suggestedLength: a
                } = (0, P.validateRangeRequestCapabilities)({
                  getResponseHeader: w,
                  isHttp: u.isHttp,
                  rangeChunkSize: this._rangeChunkSize,
                  disableRange: this._disableRange
                });
                this._isRangeSupported = y, this._contentLength = a || this._contentLength, this._filename = (0, P.extractFilenameFromHeader)(w);
              };
              if (this._request = null, this._url.protocol === "http:") {
                const E = require$$5;
                this._request = E.request(g(this._url, u.httpHeaders), b);
              } else {
                const E = require$$5;
                this._request = E.request(g(this._url, u.httpHeaders), b);
              }
              this._request.on("error", (E) => {
                this._storedError = E, this._headersCapability.reject(E);
              }), this._request.end();
            }
          }
          class O extends F {
            constructor(u, b, E) {
              super(u), this._httpHeaders = {};
              for (const y in u.httpHeaders) {
                const a = u.httpHeaders[y];
                a !== void 0 && (this._httpHeaders[y] = a);
              }
              this._httpHeaders.Range = `bytes=${b}-${E - 1}`;
              const w = (y) => {
                if (y.statusCode === 404) {
                  const a = new c.MissingPDFException(`Missing PDF "${this._url}".`);
                  this._storedError = a;
                  return;
                }
                this._setReadableStream(y);
              };
              if (this._request = null, this._url.protocol === "http:") {
                const y = require$$5;
                this._request = y.request(g(this._url, this._httpHeaders), w);
              } else {
                const y = require$$5;
                this._request = y.request(g(this._url, this._httpHeaders), w);
              }
              this._request.on("error", (y) => {
                this._storedError = y;
              }), this._request.end();
            }
          }
          class T extends B {
            constructor(u) {
              super(u);
              let b = decodeURIComponent(this._url.path);
              rt.test(this._url.href) && (b = b.replace(/^\//, ""));
              const E = require$$5;
              E.lstat(b, (w, y) => {
                if (w) {
                  w.code === "ENOENT" && (w = new c.MissingPDFException(`Missing PDF "${b}".`)), this._storedError = w, this._headersCapability.reject(w);
                  return;
                }
                this._contentLength = y.size, this._setReadableStream(E.createReadStream(b)), this._headersCapability.resolve();
              });
            }
          }
          class v extends F {
            constructor(u, b, E) {
              super(u);
              let w = decodeURIComponent(this._url.path);
              rt.test(this._url.href) && (w = w.replace(/^\//, ""));
              const y = require$$5;
              this._setReadableStream(y.createReadStream(w, {
                start: b,
                end: E - 1
              }));
            }
          }
        },
        /* 24 */
        /***/
        (dt, d, et) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.SVGGraphics = void 0;
          var c = et(6), P = et(1);
          const rt = {
            fontStyle: "normal",
            fontWeight: "normal",
            fillColor: "#000000"
          }, X = "http://www.w3.org/XML/1998/namespace", pt = "http://www.w3.org/1999/xlink", B = ["butt", "round", "square"], F = ["miter", "round", "bevel"], g = function(y, a = "", l = !1) {
            if (URL.createObjectURL && typeof Blob < "u" && !l)
              return URL.createObjectURL(new Blob([y], {
                type: a
              }));
            const k = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
            let p = `data:${a};base64,`;
            for (let r = 0, x = y.length; r < x; r += 3) {
              const m = y[r] & 255, U = y[r + 1] & 255, z = y[r + 2] & 255, C = m >> 2, V = (m & 3) << 4 | U >> 4, st = r + 1 < x ? (U & 15) << 2 | z >> 6 : 64, at = r + 2 < x ? z & 63 : 64;
              p += k[C] + k[V] + k[st] + k[at];
            }
            return p;
          }, L = function() {
            const y = new Uint8Array([137, 80, 78, 71, 13, 10, 26, 10]), a = 12, l = new Int32Array(256);
            for (let z = 0; z < 256; z++) {
              let C = z;
              for (let V = 0; V < 8; V++)
                C = C & 1 ? 3988292384 ^ C >> 1 & 2147483647 : C >> 1 & 2147483647;
              l[z] = C;
            }
            function k(z, C, V) {
              let st = -1;
              for (let at = C; at < V; at++) {
                const H = (st ^ z[at]) & 255, lt = l[H];
                st = st >>> 8 ^ lt;
              }
              return st ^ -1;
            }
            function p(z, C, V, st) {
              let at = st;
              const H = C.length;
              V[at] = H >> 24 & 255, V[at + 1] = H >> 16 & 255, V[at + 2] = H >> 8 & 255, V[at + 3] = H & 255, at += 4, V[at] = z.charCodeAt(0) & 255, V[at + 1] = z.charCodeAt(1) & 255, V[at + 2] = z.charCodeAt(2) & 255, V[at + 3] = z.charCodeAt(3) & 255, at += 4, V.set(C, at), at += C.length;
              const lt = k(V, st + 4, at);
              V[at] = lt >> 24 & 255, V[at + 1] = lt >> 16 & 255, V[at + 2] = lt >> 8 & 255, V[at + 3] = lt & 255;
            }
            function r(z, C, V) {
              let st = 1, at = 0;
              for (let H = C; H < V; ++H)
                st = (st + (z[H] & 255)) % 65521, at = (at + st) % 65521;
              return at << 16 | st;
            }
            function x(z) {
              if (!P.isNodeJS)
                return m(z);
              try {
                const C = parseInt(process.versions.node) >= 8 ? z : Buffer.from(z), V = require$$5.deflateSync(C, {
                  level: 9
                });
                return V instanceof Uint8Array ? V : new Uint8Array(V);
              } catch (C) {
                (0, P.warn)("Not compressing PNG because zlib.deflateSync is unavailable: " + C);
              }
              return m(z);
            }
            function m(z) {
              let C = z.length;
              const V = 65535, st = Math.ceil(C / V), at = new Uint8Array(2 + C + st * 5 + 4);
              let H = 0;
              at[H++] = 120, at[H++] = 156;
              let lt = 0;
              for (; C > V; )
                at[H++] = 0, at[H++] = 255, at[H++] = 255, at[H++] = 0, at[H++] = 0, at.set(z.subarray(lt, lt + V), H), H += V, lt += V, C -= V;
              at[H++] = 1, at[H++] = C & 255, at[H++] = C >> 8 & 255, at[H++] = ~C & 65535 & 255, at[H++] = (~C & 65535) >> 8 & 255, at.set(z.subarray(lt), H), H += z.length - lt;
              const gt = r(z, 0, z.length);
              return at[H++] = gt >> 24 & 255, at[H++] = gt >> 16 & 255, at[H++] = gt >> 8 & 255, at[H++] = gt & 255, at;
            }
            function U(z, C, V, st) {
              const at = z.width, H = z.height;
              let lt, gt, wt;
              const Pt = z.data;
              switch (C) {
                case P.ImageKind.GRAYSCALE_1BPP:
                  gt = 0, lt = 1, wt = at + 7 >> 3;
                  break;
                case P.ImageKind.RGB_24BPP:
                  gt = 2, lt = 8, wt = at * 3;
                  break;
                case P.ImageKind.RGBA_32BPP:
                  gt = 6, lt = 8, wt = at * 4;
                  break;
                default:
                  throw new Error("invalid format");
              }
              const S = new Uint8Array((1 + wt) * H);
              let i = 0, n = 0;
              for (let N = 0; N < H; ++N)
                S[i++] = 0, S.set(Pt.subarray(n, n + wt), i), n += wt, i += wt;
              if (C === P.ImageKind.GRAYSCALE_1BPP && st) {
                i = 0;
                for (let N = 0; N < H; N++) {
                  i++;
                  for (let tt = 0; tt < wt; tt++)
                    S[i++] ^= 255;
                }
              }
              const s = new Uint8Array([at >> 24 & 255, at >> 16 & 255, at >> 8 & 255, at & 255, H >> 24 & 255, H >> 16 & 255, H >> 8 & 255, H & 255, lt, gt, 0, 0, 0]), o = x(S), h = y.length + a * 3 + s.length + o.length, _ = new Uint8Array(h);
              let M = 0;
              return _.set(y, M), M += y.length, p("IHDR", s, _, M), M += a + s.length, p("IDATA", o, _, M), M += a + o.length, p("IEND", new Uint8Array(0), _, M), g(_, "image/png", V);
            }
            return function(C, V, st) {
              const at = C.kind === void 0 ? P.ImageKind.GRAYSCALE_1BPP : C.kind;
              return U(C, at, V, st);
            };
          }();
          class O {
            constructor() {
              this.fontSizeScale = 1, this.fontWeight = rt.fontWeight, this.fontSize = 0, this.textMatrix = P.IDENTITY_MATRIX, this.fontMatrix = P.FONT_IDENTITY_MATRIX, this.leading = 0, this.textRenderingMode = P.TextRenderingMode.FILL, this.textMatrixScale = 1, this.x = 0, this.y = 0, this.lineX = 0, this.lineY = 0, this.charSpacing = 0, this.wordSpacing = 0, this.textHScale = 1, this.textRise = 0, this.fillColor = rt.fillColor, this.strokeColor = "#000000", this.fillAlpha = 1, this.strokeAlpha = 1, this.lineWidth = 1, this.lineJoin = "", this.lineCap = "", this.miterLimit = 0, this.dashArray = [], this.dashPhase = 0, this.dependencies = [], this.activeClipUrl = null, this.clipGroup = null, this.maskId = "";
            }
            clone() {
              return Object.create(this);
            }
            setCurrentPoint(a, l) {
              this.x = a, this.y = l;
            }
          }
          function T(y) {
            let a = [];
            const l = [];
            for (const k of y) {
              if (k.fn === "save") {
                a.push({
                  fnId: 92,
                  fn: "group",
                  items: []
                }), l.push(a), a = a.at(-1).items;
                continue;
              }
              k.fn === "restore" ? a = l.pop() : a.push(k);
            }
            return a;
          }
          function v(y) {
            if (Number.isInteger(y))
              return y.toString();
            const a = y.toFixed(10);
            let l = a.length - 1;
            if (a[l] !== "0")
              return a;
            do
              l--;
            while (a[l] === "0");
            return a.substring(0, a[l] === "." ? l : l + 1);
          }
          function A(y) {
            if (y[4] === 0 && y[5] === 0) {
              if (y[1] === 0 && y[2] === 0)
                return y[0] === 1 && y[3] === 1 ? "" : `scale(${v(y[0])} ${v(y[3])})`;
              if (y[0] === y[3] && y[1] === -y[2]) {
                const a = Math.acos(y[0]) * 180 / Math.PI;
                return `rotate(${v(a)})`;
              }
            } else if (y[0] === 1 && y[1] === 0 && y[2] === 0 && y[3] === 1)
              return `translate(${v(y[4])} ${v(y[5])})`;
            return `matrix(${v(y[0])} ${v(y[1])} ${v(y[2])} ${v(y[3])} ${v(y[4])} ${v(y[5])})`;
          }
          let u = 0, b = 0, E = 0;
          class w {
            constructor(a, l, k = !1) {
              (0, c.deprecated)("The SVG back-end is no longer maintained and *may* be removed in the future."), this.svgFactory = new c.DOMSVGFactory(), this.current = new O(), this.transformMatrix = P.IDENTITY_MATRIX, this.transformStack = [], this.extraStack = [], this.commonObjs = a, this.objs = l, this.pendingClip = null, this.pendingEOFill = !1, this.embedFonts = !1, this.embeddedFonts = /* @__PURE__ */ Object.create(null), this.cssStyle = null, this.forceDataSchema = !!k, this._operatorIdMapping = [];
              for (const p in P.OPS)
                this._operatorIdMapping[P.OPS[p]] = p;
            }
            getObject(a, l = null) {
              return typeof a == "string" ? a.startsWith("g_") ? this.commonObjs.get(a) : this.objs.get(a) : l;
            }
            save() {
              this.transformStack.push(this.transformMatrix);
              const a = this.current;
              this.extraStack.push(a), this.current = a.clone();
            }
            restore() {
              this.transformMatrix = this.transformStack.pop(), this.current = this.extraStack.pop(), this.pendingClip = null, this.tgrp = null;
            }
            group(a) {
              this.save(), this.executeOpTree(a), this.restore();
            }
            loadDependencies(a) {
              const l = a.fnArray, k = a.argsArray;
              for (let p = 0, r = l.length; p < r; p++)
                if (l[p] === P.OPS.dependency)
                  for (const x of k[p]) {
                    const m = x.startsWith("g_") ? this.commonObjs : this.objs, U = new Promise((z) => {
                      m.get(x, z);
                    });
                    this.current.dependencies.push(U);
                  }
              return Promise.all(this.current.dependencies);
            }
            transform(a, l, k, p, r, x) {
              const m = [a, l, k, p, r, x];
              this.transformMatrix = P.Util.transform(this.transformMatrix, m), this.tgrp = null;
            }
            getSVG(a, l) {
              this.viewport = l;
              const k = this._initialize(l);
              return this.loadDependencies(a).then(() => (this.transformMatrix = P.IDENTITY_MATRIX, this.executeOpTree(this.convertOpList(a)), k));
            }
            convertOpList(a) {
              const l = this._operatorIdMapping, k = a.argsArray, p = a.fnArray, r = [];
              for (let x = 0, m = p.length; x < m; x++) {
                const U = p[x];
                r.push({
                  fnId: U,
                  fn: l[U],
                  args: k[x]
                });
              }
              return T(r);
            }
            executeOpTree(a) {
              for (const l of a) {
                const k = l.fn, p = l.fnId, r = l.args;
                switch (p | 0) {
                  case P.OPS.beginText:
                    this.beginText();
                    break;
                  case P.OPS.dependency:
                    break;
                  case P.OPS.setLeading:
                    this.setLeading(r);
                    break;
                  case P.OPS.setLeadingMoveText:
                    this.setLeadingMoveText(r[0], r[1]);
                    break;
                  case P.OPS.setFont:
                    this.setFont(r);
                    break;
                  case P.OPS.showText:
                    this.showText(r[0]);
                    break;
                  case P.OPS.showSpacedText:
                    this.showText(r[0]);
                    break;
                  case P.OPS.endText:
                    this.endText();
                    break;
                  case P.OPS.moveText:
                    this.moveText(r[0], r[1]);
                    break;
                  case P.OPS.setCharSpacing:
                    this.setCharSpacing(r[0]);
                    break;
                  case P.OPS.setWordSpacing:
                    this.setWordSpacing(r[0]);
                    break;
                  case P.OPS.setHScale:
                    this.setHScale(r[0]);
                    break;
                  case P.OPS.setTextMatrix:
                    this.setTextMatrix(r[0], r[1], r[2], r[3], r[4], r[5]);
                    break;
                  case P.OPS.setTextRise:
                    this.setTextRise(r[0]);
                    break;
                  case P.OPS.setTextRenderingMode:
                    this.setTextRenderingMode(r[0]);
                    break;
                  case P.OPS.setLineWidth:
                    this.setLineWidth(r[0]);
                    break;
                  case P.OPS.setLineJoin:
                    this.setLineJoin(r[0]);
                    break;
                  case P.OPS.setLineCap:
                    this.setLineCap(r[0]);
                    break;
                  case P.OPS.setMiterLimit:
                    this.setMiterLimit(r[0]);
                    break;
                  case P.OPS.setFillRGBColor:
                    this.setFillRGBColor(r[0], r[1], r[2]);
                    break;
                  case P.OPS.setStrokeRGBColor:
                    this.setStrokeRGBColor(r[0], r[1], r[2]);
                    break;
                  case P.OPS.setStrokeColorN:
                    this.setStrokeColorN(r);
                    break;
                  case P.OPS.setFillColorN:
                    this.setFillColorN(r);
                    break;
                  case P.OPS.shadingFill:
                    this.shadingFill(r[0]);
                    break;
                  case P.OPS.setDash:
                    this.setDash(r[0], r[1]);
                    break;
                  case P.OPS.setRenderingIntent:
                    this.setRenderingIntent(r[0]);
                    break;
                  case P.OPS.setFlatness:
                    this.setFlatness(r[0]);
                    break;
                  case P.OPS.setGState:
                    this.setGState(r[0]);
                    break;
                  case P.OPS.fill:
                    this.fill();
                    break;
                  case P.OPS.eoFill:
                    this.eoFill();
                    break;
                  case P.OPS.stroke:
                    this.stroke();
                    break;
                  case P.OPS.fillStroke:
                    this.fillStroke();
                    break;
                  case P.OPS.eoFillStroke:
                    this.eoFillStroke();
                    break;
                  case P.OPS.clip:
                    this.clip("nonzero");
                    break;
                  case P.OPS.eoClip:
                    this.clip("evenodd");
                    break;
                  case P.OPS.paintSolidColorImageMask:
                    this.paintSolidColorImageMask();
                    break;
                  case P.OPS.paintImageXObject:
                    this.paintImageXObject(r[0]);
                    break;
                  case P.OPS.paintInlineImageXObject:
                    this.paintInlineImageXObject(r[0]);
                    break;
                  case P.OPS.paintImageMaskXObject:
                    this.paintImageMaskXObject(r[0]);
                    break;
                  case P.OPS.paintFormXObjectBegin:
                    this.paintFormXObjectBegin(r[0], r[1]);
                    break;
                  case P.OPS.paintFormXObjectEnd:
                    this.paintFormXObjectEnd();
                    break;
                  case P.OPS.closePath:
                    this.closePath();
                    break;
                  case P.OPS.closeStroke:
                    this.closeStroke();
                    break;
                  case P.OPS.closeFillStroke:
                    this.closeFillStroke();
                    break;
                  case P.OPS.closeEOFillStroke:
                    this.closeEOFillStroke();
                    break;
                  case P.OPS.nextLine:
                    this.nextLine();
                    break;
                  case P.OPS.transform:
                    this.transform(r[0], r[1], r[2], r[3], r[4], r[5]);
                    break;
                  case P.OPS.constructPath:
                    this.constructPath(r[0], r[1]);
                    break;
                  case P.OPS.endPath:
                    this.endPath();
                    break;
                  case 92:
                    this.group(l.items);
                    break;
                  default:
                    (0, P.warn)(`Unimplemented operator ${k}`);
                    break;
                }
              }
            }
            setWordSpacing(a) {
              this.current.wordSpacing = a;
            }
            setCharSpacing(a) {
              this.current.charSpacing = a;
            }
            nextLine() {
              this.moveText(0, this.current.leading);
            }
            setTextMatrix(a, l, k, p, r, x) {
              const m = this.current;
              m.textMatrix = m.lineMatrix = [a, l, k, p, r, x], m.textMatrixScale = Math.hypot(a, l), m.x = m.lineX = 0, m.y = m.lineY = 0, m.xcoords = [], m.ycoords = [], m.tspan = this.svgFactory.createElement("svg:tspan"), m.tspan.setAttributeNS(null, "font-family", m.fontFamily), m.tspan.setAttributeNS(null, "font-size", `${v(m.fontSize)}px`), m.tspan.setAttributeNS(null, "y", v(-m.y)), m.txtElement = this.svgFactory.createElement("svg:text"), m.txtElement.append(m.tspan);
            }
            beginText() {
              const a = this.current;
              a.x = a.lineX = 0, a.y = a.lineY = 0, a.textMatrix = P.IDENTITY_MATRIX, a.lineMatrix = P.IDENTITY_MATRIX, a.textMatrixScale = 1, a.tspan = this.svgFactory.createElement("svg:tspan"), a.txtElement = this.svgFactory.createElement("svg:text"), a.txtgrp = this.svgFactory.createElement("svg:g"), a.xcoords = [], a.ycoords = [];
            }
            moveText(a, l) {
              const k = this.current;
              k.x = k.lineX += a, k.y = k.lineY += l, k.xcoords = [], k.ycoords = [], k.tspan = this.svgFactory.createElement("svg:tspan"), k.tspan.setAttributeNS(null, "font-family", k.fontFamily), k.tspan.setAttributeNS(null, "font-size", `${v(k.fontSize)}px`), k.tspan.setAttributeNS(null, "y", v(-k.y));
            }
            showText(a) {
              const l = this.current, k = l.font, p = l.fontSize;
              if (p === 0)
                return;
              const r = l.fontSizeScale, x = l.charSpacing, m = l.wordSpacing, U = l.fontDirection, z = l.textHScale * U, C = k.vertical, V = C ? 1 : -1, st = k.defaultVMetrics, at = p * l.fontMatrix[0];
              let H = 0;
              for (const wt of a) {
                if (wt === null) {
                  H += U * m;
                  continue;
                } else if (typeof wt == "number") {
                  H += V * wt * p / 1e3;
                  continue;
                }
                const Pt = (wt.isSpace ? m : 0) + x, S = wt.fontChar;
                let i, n, s = wt.width;
                if (C) {
                  let h;
                  const _ = wt.vmetric || st;
                  h = wt.vmetric ? _[1] : s * 0.5, h = -h * at;
                  const M = _[2] * at;
                  s = _ ? -_[0] : s, i = h / r, n = (H + M) / r;
                } else
                  i = H / r, n = 0;
                (wt.isInFont || k.missingFile) && (l.xcoords.push(l.x + i), C && l.ycoords.push(-l.y + n), l.tspan.textContent += S);
                const o = C ? s * at - Pt * U : s * at + Pt * U;
                H += o;
              }
              l.tspan.setAttributeNS(null, "x", l.xcoords.map(v).join(" ")), C ? l.tspan.setAttributeNS(null, "y", l.ycoords.map(v).join(" ")) : l.tspan.setAttributeNS(null, "y", v(-l.y)), C ? l.y -= H : l.x += H * z, l.tspan.setAttributeNS(null, "font-family", l.fontFamily), l.tspan.setAttributeNS(null, "font-size", `${v(l.fontSize)}px`), l.fontStyle !== rt.fontStyle && l.tspan.setAttributeNS(null, "font-style", l.fontStyle), l.fontWeight !== rt.fontWeight && l.tspan.setAttributeNS(null, "font-weight", l.fontWeight);
              const lt = l.textRenderingMode & P.TextRenderingMode.FILL_STROKE_MASK;
              if (lt === P.TextRenderingMode.FILL || lt === P.TextRenderingMode.FILL_STROKE ? (l.fillColor !== rt.fillColor && l.tspan.setAttributeNS(null, "fill", l.fillColor), l.fillAlpha < 1 && l.tspan.setAttributeNS(null, "fill-opacity", l.fillAlpha)) : l.textRenderingMode === P.TextRenderingMode.ADD_TO_PATH ? l.tspan.setAttributeNS(null, "fill", "transparent") : l.tspan.setAttributeNS(null, "fill", "none"), lt === P.TextRenderingMode.STROKE || lt === P.TextRenderingMode.FILL_STROKE) {
                const wt = 1 / (l.textMatrixScale || 1);
                this._setStrokeAttributes(l.tspan, wt);
              }
              let gt = l.textMatrix;
              l.textRise !== 0 && (gt = gt.slice(), gt[5] += l.textRise), l.txtElement.setAttributeNS(null, "transform", `${A(gt)} scale(${v(z)}, -1)`), l.txtElement.setAttributeNS(X, "xml:space", "preserve"), l.txtElement.append(l.tspan), l.txtgrp.append(l.txtElement), this._ensureTransformGroup().append(l.txtElement);
            }
            setLeadingMoveText(a, l) {
              this.setLeading(-l), this.moveText(a, l);
            }
            addFontStyle(a) {
              if (!a.data)
                throw new Error('addFontStyle: No font data available, ensure that the "fontExtraProperties" API parameter is set.');
              this.cssStyle || (this.cssStyle = this.svgFactory.createElement("svg:style"), this.cssStyle.setAttributeNS(null, "type", "text/css"), this.defs.append(this.cssStyle));
              const l = g(a.data, a.mimetype, this.forceDataSchema);
              this.cssStyle.textContent += `@font-face { font-family: "${a.loadedName}"; src: url(${l}); }
`;
            }
            setFont(a) {
              const l = this.current, k = this.commonObjs.get(a[0]);
              let p = a[1];
              l.font = k, this.embedFonts && !k.missingFile && !this.embeddedFonts[k.loadedName] && (this.addFontStyle(k), this.embeddedFonts[k.loadedName] = k), l.fontMatrix = k.fontMatrix || P.FONT_IDENTITY_MATRIX;
              let r = "normal";
              k.black ? r = "900" : k.bold && (r = "bold");
              const x = k.italic ? "italic" : "normal";
              p < 0 ? (p = -p, l.fontDirection = -1) : l.fontDirection = 1, l.fontSize = p, l.fontFamily = k.loadedName, l.fontWeight = r, l.fontStyle = x, l.tspan = this.svgFactory.createElement("svg:tspan"), l.tspan.setAttributeNS(null, "y", v(-l.y)), l.xcoords = [], l.ycoords = [];
            }
            endText() {
              var l;
              const a = this.current;
              a.textRenderingMode & P.TextRenderingMode.ADD_TO_PATH_FLAG && ((l = a.txtElement) != null && l.hasChildNodes()) && (a.element = a.txtElement, this.clip("nonzero"), this.endPath());
            }
            setLineWidth(a) {
              a > 0 && (this.current.lineWidth = a);
            }
            setLineCap(a) {
              this.current.lineCap = B[a];
            }
            setLineJoin(a) {
              this.current.lineJoin = F[a];
            }
            setMiterLimit(a) {
              this.current.miterLimit = a;
            }
            setStrokeAlpha(a) {
              this.current.strokeAlpha = a;
            }
            setStrokeRGBColor(a, l, k) {
              this.current.strokeColor = P.Util.makeHexColor(a, l, k);
            }
            setFillAlpha(a) {
              this.current.fillAlpha = a;
            }
            setFillRGBColor(a, l, k) {
              this.current.fillColor = P.Util.makeHexColor(a, l, k), this.current.tspan = this.svgFactory.createElement("svg:tspan"), this.current.xcoords = [], this.current.ycoords = [];
            }
            setStrokeColorN(a) {
              this.current.strokeColor = this._makeColorN_Pattern(a);
            }
            setFillColorN(a) {
              this.current.fillColor = this._makeColorN_Pattern(a);
            }
            shadingFill(a) {
              const {
                width: l,
                height: k
              } = this.viewport, p = P.Util.inverseTransform(this.transformMatrix), [r, x, m, U] = P.Util.getAxialAlignedBoundingBox([0, 0, l, k], p), z = this.svgFactory.createElement("svg:rect");
              z.setAttributeNS(null, "x", r), z.setAttributeNS(null, "y", x), z.setAttributeNS(null, "width", m - r), z.setAttributeNS(null, "height", U - x), z.setAttributeNS(null, "fill", this._makeShadingPattern(a)), this.current.fillAlpha < 1 && z.setAttributeNS(null, "fill-opacity", this.current.fillAlpha), this._ensureTransformGroup().append(z);
            }
            _makeColorN_Pattern(a) {
              return a[0] === "TilingPattern" ? this._makeTilingPattern(a) : this._makeShadingPattern(a);
            }
            _makeTilingPattern(a) {
              const l = a[1], k = a[2], p = a[3] || P.IDENTITY_MATRIX, [r, x, m, U] = a[4], z = a[5], C = a[6], V = a[7], st = `shading${E++}`, [at, H, lt, gt] = P.Util.normalizeRect([...P.Util.applyTransform([r, x], p), ...P.Util.applyTransform([m, U], p)]), [wt, Pt] = P.Util.singularValueDecompose2dScale(p), S = z * wt, i = C * Pt, n = this.svgFactory.createElement("svg:pattern");
              n.setAttributeNS(null, "id", st), n.setAttributeNS(null, "patternUnits", "userSpaceOnUse"), n.setAttributeNS(null, "width", S), n.setAttributeNS(null, "height", i), n.setAttributeNS(null, "x", `${at}`), n.setAttributeNS(null, "y", `${H}`);
              const s = this.svg, o = this.transformMatrix, h = this.current.fillColor, _ = this.current.strokeColor, M = this.svgFactory.create(lt - at, gt - H);
              if (this.svg = M, this.transformMatrix = p, V === 2) {
                const N = P.Util.makeHexColor(...l);
                this.current.fillColor = N, this.current.strokeColor = N;
              }
              return this.executeOpTree(this.convertOpList(k)), this.svg = s, this.transformMatrix = o, this.current.fillColor = h, this.current.strokeColor = _, n.append(M.childNodes[0]), this.defs.append(n), `url(#${st})`;
            }
            _makeShadingPattern(a) {
              switch (typeof a == "string" && (a = this.objs.get(a)), a[0]) {
                case "RadialAxial":
                  const l = `shading${E++}`, k = a[3];
                  let p;
                  switch (a[1]) {
                    case "axial":
                      const r = a[4], x = a[5];
                      p = this.svgFactory.createElement("svg:linearGradient"), p.setAttributeNS(null, "id", l), p.setAttributeNS(null, "gradientUnits", "userSpaceOnUse"), p.setAttributeNS(null, "x1", r[0]), p.setAttributeNS(null, "y1", r[1]), p.setAttributeNS(null, "x2", x[0]), p.setAttributeNS(null, "y2", x[1]);
                      break;
                    case "radial":
                      const m = a[4], U = a[5], z = a[6], C = a[7];
                      p = this.svgFactory.createElement("svg:radialGradient"), p.setAttributeNS(null, "id", l), p.setAttributeNS(null, "gradientUnits", "userSpaceOnUse"), p.setAttributeNS(null, "cx", U[0]), p.setAttributeNS(null, "cy", U[1]), p.setAttributeNS(null, "r", C), p.setAttributeNS(null, "fx", m[0]), p.setAttributeNS(null, "fy", m[1]), p.setAttributeNS(null, "fr", z);
                      break;
                    default:
                      throw new Error(`Unknown RadialAxial type: ${a[1]}`);
                  }
                  for (const r of k) {
                    const x = this.svgFactory.createElement("svg:stop");
                    x.setAttributeNS(null, "offset", r[0]), x.setAttributeNS(null, "stop-color", r[1]), p.append(x);
                  }
                  return this.defs.append(p), `url(#${l})`;
                case "Mesh":
                  return (0, P.warn)("Unimplemented pattern Mesh"), null;
                case "Dummy":
                  return "hotpink";
                default:
                  throw new Error(`Unknown IR type: ${a[0]}`);
              }
            }
            setDash(a, l) {
              this.current.dashArray = a, this.current.dashPhase = l;
            }
            constructPath(a, l) {
              const k = this.current;
              let p = k.x, r = k.y, x = [], m = 0;
              for (const U of a)
                switch (U | 0) {
                  case P.OPS.rectangle:
                    p = l[m++], r = l[m++];
                    const z = l[m++], C = l[m++], V = p + z, st = r + C;
                    x.push("M", v(p), v(r), "L", v(V), v(r), "L", v(V), v(st), "L", v(p), v(st), "Z");
                    break;
                  case P.OPS.moveTo:
                    p = l[m++], r = l[m++], x.push("M", v(p), v(r));
                    break;
                  case P.OPS.lineTo:
                    p = l[m++], r = l[m++], x.push("L", v(p), v(r));
                    break;
                  case P.OPS.curveTo:
                    p = l[m + 4], r = l[m + 5], x.push("C", v(l[m]), v(l[m + 1]), v(l[m + 2]), v(l[m + 3]), v(p), v(r)), m += 6;
                    break;
                  case P.OPS.curveTo2:
                    x.push("C", v(p), v(r), v(l[m]), v(l[m + 1]), v(l[m + 2]), v(l[m + 3])), p = l[m + 2], r = l[m + 3], m += 4;
                    break;
                  case P.OPS.curveTo3:
                    p = l[m + 2], r = l[m + 3], x.push("C", v(l[m]), v(l[m + 1]), v(p), v(r), v(p), v(r)), m += 4;
                    break;
                  case P.OPS.closePath:
                    x.push("Z");
                    break;
                }
              x = x.join(" "), k.path && a.length > 0 && a[0] !== P.OPS.rectangle && a[0] !== P.OPS.moveTo ? x = k.path.getAttributeNS(null, "d") + x : (k.path = this.svgFactory.createElement("svg:path"), this._ensureTransformGroup().append(k.path)), k.path.setAttributeNS(null, "d", x), k.path.setAttributeNS(null, "fill", "none"), k.element = k.path, k.setCurrentPoint(p, r);
            }
            endPath() {
              const a = this.current;
              if (a.path = null, !this.pendingClip)
                return;
              if (!a.element) {
                this.pendingClip = null;
                return;
              }
              const l = `clippath${u++}`, k = this.svgFactory.createElement("svg:clipPath");
              k.setAttributeNS(null, "id", l), k.setAttributeNS(null, "transform", A(this.transformMatrix));
              const p = a.element.cloneNode(!0);
              if (this.pendingClip === "evenodd" ? p.setAttributeNS(null, "clip-rule", "evenodd") : p.setAttributeNS(null, "clip-rule", "nonzero"), this.pendingClip = null, k.append(p), this.defs.append(k), a.activeClipUrl) {
                a.clipGroup = null;
                for (const r of this.extraStack)
                  r.clipGroup = null;
                k.setAttributeNS(null, "clip-path", a.activeClipUrl);
              }
              a.activeClipUrl = `url(#${l})`, this.tgrp = null;
            }
            clip(a) {
              this.pendingClip = a;
            }
            closePath() {
              const a = this.current;
              if (a.path) {
                const l = `${a.path.getAttributeNS(null, "d")}Z`;
                a.path.setAttributeNS(null, "d", l);
              }
            }
            setLeading(a) {
              this.current.leading = -a;
            }
            setTextRise(a) {
              this.current.textRise = a;
            }
            setTextRenderingMode(a) {
              this.current.textRenderingMode = a;
            }
            setHScale(a) {
              this.current.textHScale = a / 100;
            }
            setRenderingIntent(a) {
            }
            setFlatness(a) {
            }
            setGState(a) {
              for (const [l, k] of a)
                switch (l) {
                  case "LW":
                    this.setLineWidth(k);
                    break;
                  case "LC":
                    this.setLineCap(k);
                    break;
                  case "LJ":
                    this.setLineJoin(k);
                    break;
                  case "ML":
                    this.setMiterLimit(k);
                    break;
                  case "D":
                    this.setDash(k[0], k[1]);
                    break;
                  case "RI":
                    this.setRenderingIntent(k);
                    break;
                  case "FL":
                    this.setFlatness(k);
                    break;
                  case "Font":
                    this.setFont(k);
                    break;
                  case "CA":
                    this.setStrokeAlpha(k);
                    break;
                  case "ca":
                    this.setFillAlpha(k);
                    break;
                  default:
                    (0, P.warn)(`Unimplemented graphic state operator ${l}`);
                    break;
                }
            }
            fill() {
              const a = this.current;
              a.element && (a.element.setAttributeNS(null, "fill", a.fillColor), a.element.setAttributeNS(null, "fill-opacity", a.fillAlpha), this.endPath());
            }
            stroke() {
              const a = this.current;
              a.element && (this._setStrokeAttributes(a.element), a.element.setAttributeNS(null, "fill", "none"), this.endPath());
            }
            _setStrokeAttributes(a, l = 1) {
              const k = this.current;
              let p = k.dashArray;
              l !== 1 && p.length > 0 && (p = p.map(function(r) {
                return l * r;
              })), a.setAttributeNS(null, "stroke", k.strokeColor), a.setAttributeNS(null, "stroke-opacity", k.strokeAlpha), a.setAttributeNS(null, "stroke-miterlimit", v(k.miterLimit)), a.setAttributeNS(null, "stroke-linecap", k.lineCap), a.setAttributeNS(null, "stroke-linejoin", k.lineJoin), a.setAttributeNS(null, "stroke-width", v(l * k.lineWidth) + "px"), a.setAttributeNS(null, "stroke-dasharray", p.map(v).join(" ")), a.setAttributeNS(null, "stroke-dashoffset", v(l * k.dashPhase) + "px");
            }
            eoFill() {
              var a;
              (a = this.current.element) == null || a.setAttributeNS(null, "fill-rule", "evenodd"), this.fill();
            }
            fillStroke() {
              this.stroke(), this.fill();
            }
            eoFillStroke() {
              var a;
              (a = this.current.element) == null || a.setAttributeNS(null, "fill-rule", "evenodd"), this.fillStroke();
            }
            closeStroke() {
              this.closePath(), this.stroke();
            }
            closeFillStroke() {
              this.closePath(), this.fillStroke();
            }
            closeEOFillStroke() {
              this.closePath(), this.eoFillStroke();
            }
            paintSolidColorImageMask() {
              const a = this.svgFactory.createElement("svg:rect");
              a.setAttributeNS(null, "x", "0"), a.setAttributeNS(null, "y", "0"), a.setAttributeNS(null, "width", "1px"), a.setAttributeNS(null, "height", "1px"), a.setAttributeNS(null, "fill", this.current.fillColor), this._ensureTransformGroup().append(a);
            }
            paintImageXObject(a) {
              const l = this.getObject(a);
              if (!l) {
                (0, P.warn)(`Dependent image with object ID ${a} is not ready yet`);
                return;
              }
              this.paintInlineImageXObject(l);
            }
            paintInlineImageXObject(a, l) {
              const k = a.width, p = a.height, r = L(a, this.forceDataSchema, !!l), x = this.svgFactory.createElement("svg:rect");
              x.setAttributeNS(null, "x", "0"), x.setAttributeNS(null, "y", "0"), x.setAttributeNS(null, "width", v(k)), x.setAttributeNS(null, "height", v(p)), this.current.element = x, this.clip("nonzero");
              const m = this.svgFactory.createElement("svg:image");
              m.setAttributeNS(pt, "xlink:href", r), m.setAttributeNS(null, "x", "0"), m.setAttributeNS(null, "y", v(-p)), m.setAttributeNS(null, "width", v(k) + "px"), m.setAttributeNS(null, "height", v(p) + "px"), m.setAttributeNS(null, "transform", `scale(${v(1 / k)} ${v(-1 / p)})`), l ? l.append(m) : this._ensureTransformGroup().append(m);
            }
            paintImageMaskXObject(a) {
              const l = this.getObject(a.data, a);
              if (l.bitmap) {
                (0, P.warn)("paintImageMaskXObject: ImageBitmap support is not implemented, ensure that the `isOffscreenCanvasSupported` API parameter is disabled.");
                return;
              }
              const k = this.current, p = l.width, r = l.height, x = k.fillColor;
              k.maskId = `mask${b++}`;
              const m = this.svgFactory.createElement("svg:mask");
              m.setAttributeNS(null, "id", k.maskId);
              const U = this.svgFactory.createElement("svg:rect");
              U.setAttributeNS(null, "x", "0"), U.setAttributeNS(null, "y", "0"), U.setAttributeNS(null, "width", v(p)), U.setAttributeNS(null, "height", v(r)), U.setAttributeNS(null, "fill", x), U.setAttributeNS(null, "mask", `url(#${k.maskId})`), this.defs.append(m), this._ensureTransformGroup().append(U), this.paintInlineImageXObject(l, m);
            }
            paintFormXObjectBegin(a, l) {
              if (Array.isArray(a) && a.length === 6 && this.transform(a[0], a[1], a[2], a[3], a[4], a[5]), l) {
                const k = l[2] - l[0], p = l[3] - l[1], r = this.svgFactory.createElement("svg:rect");
                r.setAttributeNS(null, "x", l[0]), r.setAttributeNS(null, "y", l[1]), r.setAttributeNS(null, "width", v(k)), r.setAttributeNS(null, "height", v(p)), this.current.element = r, this.clip("nonzero"), this.endPath();
              }
            }
            paintFormXObjectEnd() {
            }
            _initialize(a) {
              const l = this.svgFactory.create(a.width, a.height), k = this.svgFactory.createElement("svg:defs");
              l.append(k), this.defs = k;
              const p = this.svgFactory.createElement("svg:g");
              return p.setAttributeNS(null, "transform", A(a.transform)), l.append(p), this.svg = p, l;
            }
            _ensureClipGroup() {
              if (!this.current.clipGroup) {
                const a = this.svgFactory.createElement("svg:g");
                a.setAttributeNS(null, "clip-path", this.current.activeClipUrl), this.svg.append(a), this.current.clipGroup = a;
              }
              return this.current.clipGroup;
            }
            _ensureTransformGroup() {
              return this.tgrp || (this.tgrp = this.svgFactory.createElement("svg:g"), this.tgrp.setAttributeNS(null, "transform", A(this.transformMatrix)), this.current.activeClipUrl ? this._ensureClipGroup().append(this.tgrp) : this.svg.append(this.tgrp)), this.tgrp;
            }
          }
          d.SVGGraphics = w;
        },
        /* 25 */
        /***/
        (dt, d) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.XfaText = void 0;
          class et {
            static textContent(P) {
              const rt = [], X = {
                items: rt,
                styles: /* @__PURE__ */ Object.create(null)
              };
              function pt(B) {
                var L;
                if (!B)
                  return;
                let F = null;
                const g = B.name;
                if (g === "#text")
                  F = B.value;
                else if (et.shouldBuildText(g))
                  (L = B == null ? void 0 : B.attributes) != null && L.textContent ? F = B.attributes.textContent : B.value && (F = B.value);
                else
                  return;
                if (F !== null && rt.push({
                  str: F
                }), !!B.children)
                  for (const O of B.children)
                    pt(O);
              }
              return pt(P), X;
            }
            static shouldBuildText(P) {
              return !(P === "textarea" || P === "input" || P === "option" || P === "select");
            }
          }
          d.XfaText = et;
        },
        /* 26 */
        /***/
        (dt, d, et) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.TextLayerRenderTask = void 0, d.renderTextLayer = A, d.updateTextLayer = u;
          var c = et(1), P = et(6);
          const rt = 1e5, X = 30, pt = 0.8, B = /* @__PURE__ */ new Map();
          function F(b, E) {
            let w;
            if (E && c.FeatureTest.isOffscreenCanvasSupported)
              w = new OffscreenCanvas(b, b).getContext("2d", {
                alpha: !1
              });
            else {
              const y = document.createElement("canvas");
              y.width = y.height = b, w = y.getContext("2d", {
                alpha: !1
              });
            }
            return w;
          }
          function g(b, E) {
            const w = B.get(b);
            if (w)
              return w;
            const y = F(X, E);
            y.font = `${X}px ${b}`;
            const a = y.measureText("");
            let l = a.fontBoundingBoxAscent, k = Math.abs(a.fontBoundingBoxDescent);
            if (l) {
              const r = l / (l + k);
              return B.set(b, r), y.canvas.width = y.canvas.height = 0, r;
            }
            y.strokeStyle = "red", y.clearRect(0, 0, X, X), y.strokeText("g", 0, 0);
            let p = y.getImageData(0, 0, X, X).data;
            k = 0;
            for (let r = p.length - 1 - 3; r >= 0; r -= 4)
              if (p[r] > 0) {
                k = Math.ceil(r / 4 / X);
                break;
              }
            y.clearRect(0, 0, X, X), y.strokeText("A", 0, X), p = y.getImageData(0, 0, X, X).data, l = 0;
            for (let r = 0, x = p.length; r < x; r += 4)
              if (p[r] > 0) {
                l = X - Math.floor(r / 4 / X);
                break;
              }
            if (y.canvas.width = y.canvas.height = 0, l) {
              const r = l / (l + k);
              return B.set(b, r), r;
            }
            return B.set(b, pt), pt;
          }
          function L(b, E, w) {
            const y = document.createElement("span"), a = {
              angle: 0,
              canvasWidth: 0,
              hasText: E.str !== "",
              hasEOL: E.hasEOL,
              fontSize: 0
            };
            b._textDivs.push(y);
            const l = c.Util.transform(b._transform, E.transform);
            let k = Math.atan2(l[1], l[0]);
            const p = w[E.fontName];
            p.vertical && (k += Math.PI / 2);
            const r = Math.hypot(l[2], l[3]), x = r * g(p.fontFamily, b._isOffscreenCanvasSupported);
            let m, U;
            k === 0 ? (m = l[4], U = l[5] - x) : (m = l[4] + x * Math.sin(k), U = l[5] - x * Math.cos(k));
            const z = "calc(var(--scale-factor)*", C = y.style;
            b._container === b._rootContainer ? (C.left = `${(100 * m / b._pageWidth).toFixed(2)}%`, C.top = `${(100 * U / b._pageHeight).toFixed(2)}%`) : (C.left = `${z}${m.toFixed(2)}px)`, C.top = `${z}${U.toFixed(2)}px)`), C.fontSize = `${z}${r.toFixed(2)}px)`, C.fontFamily = p.fontFamily, a.fontSize = r, y.setAttribute("role", "presentation"), y.textContent = E.str, y.dir = E.dir, b._fontInspectorEnabled && (y.dataset.fontName = E.fontName), k !== 0 && (a.angle = k * (180 / Math.PI));
            let V = !1;
            if (E.str.length > 1)
              V = !0;
            else if (E.str !== " " && E.transform[0] !== E.transform[3]) {
              const st = Math.abs(E.transform[0]), at = Math.abs(E.transform[3]);
              st !== at && Math.max(st, at) / Math.min(st, at) > 1.5 && (V = !0);
            }
            V && (a.canvasWidth = p.vertical ? E.height : E.width), b._textDivProperties.set(y, a), b._isReadableStream && b._layoutText(y);
          }
          function O(b) {
            const {
              div: E,
              scale: w,
              properties: y,
              ctx: a,
              prevFontSize: l,
              prevFontFamily: k
            } = b, {
              style: p
            } = E;
            let r = "";
            if (y.canvasWidth !== 0 && y.hasText) {
              const {
                fontFamily: x
              } = p, {
                canvasWidth: m,
                fontSize: U
              } = y;
              (l !== U || k !== x) && (a.font = `${U * w}px ${x}`, b.prevFontSize = U, b.prevFontFamily = x);
              const {
                width: z
              } = a.measureText(E.textContent);
              z > 0 && (r = `scaleX(${m * w / z})`);
            }
            y.angle !== 0 && (r = `rotate(${y.angle}deg) ${r}`), r.length > 0 && (p.transform = r);
          }
          function T(b) {
            if (b._canceled)
              return;
            const E = b._textDivs, w = b._capability;
            if (E.length > rt) {
              w.resolve();
              return;
            }
            if (!b._isReadableStream)
              for (const a of E)
                b._layoutText(a);
            w.resolve();
          }
          class v {
            constructor({
              textContentSource: E,
              container: w,
              viewport: y,
              textDivs: a,
              textDivProperties: l,
              textContentItemsStr: k,
              isOffscreenCanvasSupported: p
            }) {
              var z;
              this._textContentSource = E, this._isReadableStream = E instanceof ReadableStream, this._container = this._rootContainer = w, this._textDivs = a || [], this._textContentItemsStr = k || [], this._isOffscreenCanvasSupported = p, this._fontInspectorEnabled = !!((z = globalThis.FontInspector) != null && z.enabled), this._reader = null, this._textDivProperties = l || /* @__PURE__ */ new WeakMap(), this._canceled = !1, this._capability = new c.PromiseCapability(), this._layoutTextParams = {
                prevFontSize: null,
                prevFontFamily: null,
                div: null,
                scale: y.scale * (globalThis.devicePixelRatio || 1),
                properties: null,
                ctx: F(0, p)
              };
              const {
                pageWidth: r,
                pageHeight: x,
                pageX: m,
                pageY: U
              } = y.rawDims;
              this._transform = [1, 0, 0, -1, -m, U + x], this._pageWidth = r, this._pageHeight = x, (0, P.setLayerDimensions)(w, y), this._capability.promise.finally(() => {
                this._layoutTextParams = null;
              }).catch(() => {
              });
            }
            get promise() {
              return this._capability.promise;
            }
            cancel() {
              this._canceled = !0, this._reader && (this._reader.cancel(new c.AbortException("TextLayer task cancelled.")).catch(() => {
              }), this._reader = null), this._capability.reject(new c.AbortException("TextLayer task cancelled."));
            }
            _processItems(E, w) {
              for (const y of E) {
                if (y.str === void 0) {
                  if (y.type === "beginMarkedContentProps" || y.type === "beginMarkedContent") {
                    const a = this._container;
                    this._container = document.createElement("span"), this._container.classList.add("markedContent"), y.id !== null && this._container.setAttribute("id", `${y.id}`), a.append(this._container);
                  } else
                    y.type === "endMarkedContent" && (this._container = this._container.parentNode);
                  continue;
                }
                this._textContentItemsStr.push(y.str), L(this, y, w);
              }
            }
            _layoutText(E) {
              const w = this._layoutTextParams.properties = this._textDivProperties.get(E);
              if (this._layoutTextParams.div = E, O(this._layoutTextParams), w.hasText && this._container.append(E), w.hasEOL) {
                const y = document.createElement("br");
                y.setAttribute("role", "presentation"), this._container.append(y);
              }
            }
            _render() {
              const E = new c.PromiseCapability();
              let w = /* @__PURE__ */ Object.create(null);
              if (this._isReadableStream) {
                const y = () => {
                  this._reader.read().then(({
                    value: a,
                    done: l
                  }) => {
                    if (l) {
                      E.resolve();
                      return;
                    }
                    Object.assign(w, a.styles), this._processItems(a.items, w), y();
                  }, E.reject);
                };
                this._reader = this._textContentSource.getReader(), y();
              } else if (this._textContentSource) {
                const {
                  items: y,
                  styles: a
                } = this._textContentSource;
                this._processItems(y, a), E.resolve();
              } else
                throw new Error('No "textContentSource" parameter specified.');
              E.promise.then(() => {
                w = null, T(this);
              }, this._capability.reject);
            }
          }
          d.TextLayerRenderTask = v;
          function A(b) {
            !b.textContentSource && (b.textContent || b.textContentStream) && ((0, P.deprecated)("The TextLayerRender `textContent`/`textContentStream` parameters will be removed in the future, please use `textContentSource` instead."), b.textContentSource = b.textContent || b.textContentStream);
            const {
              container: E,
              viewport: w
            } = b, y = getComputedStyle(E), a = y.getPropertyValue("visibility"), l = parseFloat(y.getPropertyValue("--scale-factor"));
            a === "visible" && (!l || Math.abs(l - w.scale) > 1e-5) && console.error("The `--scale-factor` CSS-variable must be set, to the same value as `viewport.scale`, either on the `container`-element itself or higher up in the DOM.");
            const k = new v(b);
            return k._render(), k;
          }
          function u({
            container: b,
            viewport: E,
            textDivs: w,
            textDivProperties: y,
            isOffscreenCanvasSupported: a,
            mustRotate: l = !0,
            mustRescale: k = !0
          }) {
            if (l && (0, P.setLayerDimensions)(b, {
              rotation: E.rotation
            }), k) {
              const p = F(0, a), x = {
                prevFontSize: null,
                prevFontFamily: null,
                div: null,
                scale: E.scale * (globalThis.devicePixelRatio || 1),
                properties: null,
                ctx: p
              };
              for (const m of w)
                x.properties = y.get(m), x.div = m, O(x);
            }
          }
        },
        /* 27 */
        /***/
        (dt, d, et) => {
          var g, L, O, T, v, A, u, b, E, w, y, ei, l, ke, p, ii, x, si;
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.AnnotationEditorLayer = void 0;
          var c = et(1), P = et(4), rt = et(28), X = et(33), pt = et(6), B = et(34);
          const U = class U {
            constructor({
              uiManager: C,
              pageIndex: V,
              div: st,
              accessibilityManager: at,
              annotationLayer: H,
              viewport: lt,
              l10n: gt
            }) {
              I(this, y);
              I(this, l);
              I(this, p);
              I(this, x);
              I(this, g, void 0);
              I(this, L, !1);
              I(this, O, null);
              I(this, T, this.pointerup.bind(this));
              I(this, v, this.pointerdown.bind(this));
              I(this, A, /* @__PURE__ */ new Map());
              I(this, u, !1);
              I(this, b, !1);
              I(this, E, !1);
              I(this, w, void 0);
              const wt = [rt.FreeTextEditor, X.InkEditor, B.StampEditor];
              if (!U._initialized) {
                U._initialized = !0;
                for (const Pt of wt)
                  Pt.initialize(gt);
              }
              C.registerEditorTypes(wt), Z(this, w, C), this.pageIndex = V, this.div = st, Z(this, g, at), Z(this, O, H), this.viewport = lt, t(this, w).addLayer(this);
            }
            get isEmpty() {
              return t(this, A).size === 0;
            }
            updateToolbar(C) {
              t(this, w).updateToolbar(C);
            }
            updateMode(C = t(this, w).getMode()) {
              W(this, x, si).call(this), C === c.AnnotationEditorType.INK ? (this.addInkEditorIfNeeded(!1), this.disableClick()) : this.enableClick(), C !== c.AnnotationEditorType.NONE && (this.div.classList.toggle("freeTextEditing", C === c.AnnotationEditorType.FREETEXT), this.div.classList.toggle("inkEditing", C === c.AnnotationEditorType.INK), this.div.classList.toggle("stampEditing", C === c.AnnotationEditorType.STAMP), this.div.hidden = !1);
            }
            addInkEditorIfNeeded(C) {
              if (!C && t(this, w).getMode() !== c.AnnotationEditorType.INK)
                return;
              if (!C) {
                for (const st of t(this, A).values())
                  if (st.isEmpty()) {
                    st.setInBackground();
                    return;
                  }
              }
              W(this, l, ke).call(this, {
                offsetX: 0,
                offsetY: 0
              }, !1).setInBackground();
            }
            setEditingState(C) {
              t(this, w).setEditingState(C);
            }
            addCommands(C) {
              t(this, w).addCommands(C);
            }
            enable() {
              this.div.style.pointerEvents = "auto";
              const C = /* @__PURE__ */ new Set();
              for (const st of t(this, A).values())
                st.enableEditing(), st.annotationElementId && C.add(st.annotationElementId);
              if (!t(this, O))
                return;
              const V = t(this, O).getEditableAnnotations();
              for (const st of V) {
                if (st.hide(), t(this, w).isDeletedAnnotationElement(st.data.id) || C.has(st.data.id))
                  continue;
                const at = this.deserialize(st);
                at && (this.addOrRebuild(at), at.enableEditing());
              }
            }
            disable() {
              var V;
              Z(this, E, !0), this.div.style.pointerEvents = "none";
              const C = /* @__PURE__ */ new Set();
              for (const st of t(this, A).values()) {
                if (st.disableEditing(), !st.annotationElementId || st.serialize() !== null) {
                  C.add(st.annotationElementId);
                  continue;
                }
                (V = this.getEditableAnnotation(st.annotationElementId)) == null || V.show(), st.remove();
              }
              if (t(this, O)) {
                const st = t(this, O).getEditableAnnotations();
                for (const at of st) {
                  const {
                    id: H
                  } = at.data;
                  C.has(H) || t(this, w).isDeletedAnnotationElement(H) || at.show();
                }
              }
              W(this, x, si).call(this), this.isEmpty && (this.div.hidden = !0), Z(this, E, !1);
            }
            getEditableAnnotation(C) {
              var V;
              return ((V = t(this, O)) == null ? void 0 : V.getEditableAnnotation(C)) || null;
            }
            setActiveEditor(C) {
              t(this, w).getActive() !== C && t(this, w).setActiveEditor(C);
            }
            enableClick() {
              this.div.addEventListener("pointerdown", t(this, v)), this.div.addEventListener("pointerup", t(this, T));
            }
            disableClick() {
              this.div.removeEventListener("pointerdown", t(this, v)), this.div.removeEventListener("pointerup", t(this, T));
            }
            attach(C) {
              t(this, A).set(C.id, C);
              const {
                annotationElementId: V
              } = C;
              V && t(this, w).isDeletedAnnotationElement(V) && t(this, w).removeDeletedAnnotationElement(C);
            }
            detach(C) {
              var V;
              t(this, A).delete(C.id), (V = t(this, g)) == null || V.removePointerInTextLayer(C.contentDiv), !t(this, E) && C.annotationElementId && t(this, w).addDeletedAnnotationElement(C);
            }
            remove(C) {
              this.detach(C), t(this, w).removeEditor(C), C.div.contains(document.activeElement) && setTimeout(() => {
                t(this, w).focusMainContainer();
              }, 0), C.div.remove(), C.isAttachedToDOM = !1, t(this, b) || this.addInkEditorIfNeeded(!1);
            }
            changeParent(C) {
              var V;
              C.parent !== this && (C.annotationElementId && (t(this, w).addDeletedAnnotationElement(C.annotationElementId), P.AnnotationEditor.deleteAnnotationElement(C), C.annotationElementId = null), this.attach(C), (V = C.parent) == null || V.detach(C), C.setParent(this), C.div && C.isAttachedToDOM && (C.div.remove(), this.div.append(C.div)));
            }
            add(C) {
              if (this.changeParent(C), t(this, w).addEditor(C), this.attach(C), !C.isAttachedToDOM) {
                const V = C.render();
                this.div.append(V), C.isAttachedToDOM = !0;
              }
              C.fixAndSetPosition(), C.onceAdded(), t(this, w).addToAnnotationStorage(C);
            }
            moveEditorInDOM(C) {
              var st;
              if (!C.isAttachedToDOM)
                return;
              const {
                activeElement: V
              } = document;
              C.div.contains(V) && (C._focusEventsAllowed = !1, setTimeout(() => {
                C.div.contains(document.activeElement) ? C._focusEventsAllowed = !0 : (C.div.addEventListener("focusin", () => {
                  C._focusEventsAllowed = !0;
                }, {
                  once: !0
                }), V.focus());
              }, 0)), C._structTreeParentId = (st = t(this, g)) == null ? void 0 : st.moveElementInDOM(this.div, C.div, C.contentDiv, !0);
            }
            addOrRebuild(C) {
              C.needsToBeRebuilt() ? C.rebuild() : this.add(C);
            }
            addUndoableEditor(C) {
              const V = () => C._uiManager.rebuild(C), st = () => {
                C.remove();
              };
              this.addCommands({
                cmd: V,
                undo: st,
                mustExec: !1
              });
            }
            getNextId() {
              return t(this, w).getId();
            }
            pasteEditor(C, V) {
              t(this, w).updateToolbar(C), t(this, w).updateMode(C);
              const {
                offsetX: st,
                offsetY: at
              } = W(this, p, ii).call(this), H = this.getNextId(), lt = W(this, y, ei).call(this, {
                parent: this,
                id: H,
                x: st,
                y: at,
                uiManager: t(this, w),
                isCentered: !0,
                ...V
              });
              lt && this.add(lt);
            }
            deserialize(C) {
              switch (C.annotationType ?? C.annotationEditorType) {
                case c.AnnotationEditorType.FREETEXT:
                  return rt.FreeTextEditor.deserialize(C, this, t(this, w));
                case c.AnnotationEditorType.INK:
                  return X.InkEditor.deserialize(C, this, t(this, w));
                case c.AnnotationEditorType.STAMP:
                  return B.StampEditor.deserialize(C, this, t(this, w));
              }
              return null;
            }
            addNewEditor() {
              W(this, l, ke).call(this, W(this, p, ii).call(this), !0);
            }
            setSelected(C) {
              t(this, w).setSelected(C);
            }
            toggleSelected(C) {
              t(this, w).toggleSelected(C);
            }
            isSelected(C) {
              return t(this, w).isSelected(C);
            }
            unselect(C) {
              t(this, w).unselect(C);
            }
            pointerup(C) {
              const {
                isMac: V
              } = c.FeatureTest.platform;
              if (!(C.button !== 0 || C.ctrlKey && V) && C.target === this.div && t(this, u)) {
                if (Z(this, u, !1), !t(this, L)) {
                  Z(this, L, !0);
                  return;
                }
                if (t(this, w).getMode() === c.AnnotationEditorType.STAMP) {
                  t(this, w).unselectAll();
                  return;
                }
                W(this, l, ke).call(this, C, !1);
              }
            }
            pointerdown(C) {
              if (t(this, u)) {
                Z(this, u, !1);
                return;
              }
              const {
                isMac: V
              } = c.FeatureTest.platform;
              if (C.button !== 0 || C.ctrlKey && V || C.target !== this.div)
                return;
              Z(this, u, !0);
              const st = t(this, w).getActive();
              Z(this, L, !st || st.isEmpty());
            }
            findNewParent(C, V, st) {
              const at = t(this, w).findParent(V, st);
              return at === null || at === this ? !1 : (at.changeParent(C), !0);
            }
            destroy() {
              var C, V;
              ((C = t(this, w).getActive()) == null ? void 0 : C.parent) === this && (t(this, w).commitOrRemove(), t(this, w).setActiveEditor(null));
              for (const st of t(this, A).values())
                (V = t(this, g)) == null || V.removePointerInTextLayer(st.contentDiv), st.setParent(null), st.isAttachedToDOM = !1, st.div.remove();
              this.div = null, t(this, A).clear(), t(this, w).removeLayer(this);
            }
            render({
              viewport: C
            }) {
              this.viewport = C, (0, pt.setLayerDimensions)(this.div, C);
              for (const V of t(this, w).getEditors(this.pageIndex))
                this.add(V);
              this.updateMode();
            }
            update({
              viewport: C
            }) {
              t(this, w).commitOrRemove(), this.viewport = C, (0, pt.setLayerDimensions)(this.div, {
                rotation: C.rotation
              }), this.updateMode();
            }
            get pageDimensions() {
              const {
                pageWidth: C,
                pageHeight: V
              } = this.viewport.rawDims;
              return [C, V];
            }
          };
          g = new WeakMap(), L = new WeakMap(), O = new WeakMap(), T = new WeakMap(), v = new WeakMap(), A = new WeakMap(), u = new WeakMap(), b = new WeakMap(), E = new WeakMap(), w = new WeakMap(), y = new WeakSet(), ei = function(C) {
            switch (t(this, w).getMode()) {
              case c.AnnotationEditorType.FREETEXT:
                return new rt.FreeTextEditor(C);
              case c.AnnotationEditorType.INK:
                return new X.InkEditor(C);
              case c.AnnotationEditorType.STAMP:
                return new B.StampEditor(C);
            }
            return null;
          }, l = new WeakSet(), ke = function(C, V) {
            const st = this.getNextId(), at = W(this, y, ei).call(this, {
              parent: this,
              id: st,
              x: C.offsetX,
              y: C.offsetY,
              uiManager: t(this, w),
              isCentered: V
            });
            return at && this.add(at), at;
          }, p = new WeakSet(), ii = function() {
            const {
              x: C,
              y: V,
              width: st,
              height: at
            } = this.div.getBoundingClientRect(), H = Math.max(0, C), lt = Math.max(0, V), gt = Math.min(window.innerWidth, C + st), wt = Math.min(window.innerHeight, V + at), Pt = (H + gt) / 2 - C, S = (lt + wt) / 2 - V, [i, n] = this.viewport.rotation % 180 === 0 ? [Pt, S] : [S, Pt];
            return {
              offsetX: i,
              offsetY: n
            };
          }, x = new WeakSet(), si = function() {
            Z(this, b, !0);
            for (const C of t(this, A).values())
              C.isEmpty() && C.remove();
            Z(this, b, !1);
          }, ee(U, "_initialized", !1);
          let F = U;
          d.AnnotationEditorLayer = F;
        },
        /* 28 */
        /***/
        (dt, d, et) => {
          var B, F, g, L, O, T, v, A, u, b, Fi, w, Mi, a, Ri, k, ye, r, ni, m, Di, z, ri;
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.FreeTextEditor = void 0;
          var c = et(1), P = et(5), rt = et(4), X = et(29);
          const V = class V extends rt.AnnotationEditor {
            constructor(H) {
              super({
                ...H,
                name: "freeTextEditor"
              });
              I(this, b);
              I(this, w);
              I(this, a);
              I(this, k);
              I(this, r);
              I(this, m);
              I(this, z);
              I(this, B, this.editorDivBlur.bind(this));
              I(this, F, this.editorDivFocus.bind(this));
              I(this, g, this.editorDivInput.bind(this));
              I(this, L, this.editorDivKeydown.bind(this));
              I(this, O, void 0);
              I(this, T, "");
              I(this, v, `${this.id}-editor`);
              I(this, A, void 0);
              I(this, u, null);
              Z(this, O, H.color || V._defaultColor || rt.AnnotationEditor._defaultLineColor), Z(this, A, H.fontSize || V._defaultFontSize);
            }
            static get _keyboardManager() {
              const H = V.prototype, lt = (Pt) => Pt.isEmpty(), gt = P.AnnotationEditorUIManager.TRANSLATE_SMALL, wt = P.AnnotationEditorUIManager.TRANSLATE_BIG;
              return (0, c.shadow)(this, "_keyboardManager", new P.KeyboardManager([[["ctrl+s", "mac+meta+s", "ctrl+p", "mac+meta+p"], H.commitOrRemove, {
                bubbles: !0
              }], [["ctrl+Enter", "mac+meta+Enter", "Escape", "mac+Escape"], H.commitOrRemove], [["ArrowLeft", "mac+ArrowLeft"], H._translateEmpty, {
                args: [-gt, 0],
                checker: lt
              }], [["ctrl+ArrowLeft", "mac+shift+ArrowLeft"], H._translateEmpty, {
                args: [-wt, 0],
                checker: lt
              }], [["ArrowRight", "mac+ArrowRight"], H._translateEmpty, {
                args: [gt, 0],
                checker: lt
              }], [["ctrl+ArrowRight", "mac+shift+ArrowRight"], H._translateEmpty, {
                args: [wt, 0],
                checker: lt
              }], [["ArrowUp", "mac+ArrowUp"], H._translateEmpty, {
                args: [0, -gt],
                checker: lt
              }], [["ctrl+ArrowUp", "mac+shift+ArrowUp"], H._translateEmpty, {
                args: [0, -wt],
                checker: lt
              }], [["ArrowDown", "mac+ArrowDown"], H._translateEmpty, {
                args: [0, gt],
                checker: lt
              }], [["ctrl+ArrowDown", "mac+shift+ArrowDown"], H._translateEmpty, {
                args: [0, wt],
                checker: lt
              }]]));
            }
            static initialize(H) {
              rt.AnnotationEditor.initialize(H, {
                strings: ["free_text2_default_content", "editor_free_text2_aria_label"]
              });
              const lt = getComputedStyle(document.documentElement);
              this._internalPadding = parseFloat(lt.getPropertyValue("--freetext-padding"));
            }
            static updateDefaultParams(H, lt) {
              switch (H) {
                case c.AnnotationEditorParamsType.FREETEXT_SIZE:
                  V._defaultFontSize = lt;
                  break;
                case c.AnnotationEditorParamsType.FREETEXT_COLOR:
                  V._defaultColor = lt;
                  break;
              }
            }
            updateParams(H, lt) {
              switch (H) {
                case c.AnnotationEditorParamsType.FREETEXT_SIZE:
                  W(this, b, Fi).call(this, lt);
                  break;
                case c.AnnotationEditorParamsType.FREETEXT_COLOR:
                  W(this, w, Mi).call(this, lt);
                  break;
              }
            }
            static get defaultPropertiesToUpdate() {
              return [[c.AnnotationEditorParamsType.FREETEXT_SIZE, V._defaultFontSize], [c.AnnotationEditorParamsType.FREETEXT_COLOR, V._defaultColor || rt.AnnotationEditor._defaultLineColor]];
            }
            get propertiesToUpdate() {
              return [[c.AnnotationEditorParamsType.FREETEXT_SIZE, t(this, A)], [c.AnnotationEditorParamsType.FREETEXT_COLOR, t(this, O)]];
            }
            _translateEmpty(H, lt) {
              this._uiManager.translateSelectedEditors(H, lt, !0);
            }
            getInitialTranslation() {
              const H = this.parentScale;
              return [-V._internalPadding * H, -(V._internalPadding + t(this, A)) * H];
            }
            rebuild() {
              this.parent && (super.rebuild(), this.div !== null && (this.isAttachedToDOM || this.parent.add(this)));
            }
            enableEditMode() {
              this.isInEditMode() || (this.parent.setEditingState(!1), this.parent.updateToolbar(c.AnnotationEditorType.FREETEXT), super.enableEditMode(), this.overlayDiv.classList.remove("enabled"), this.editorDiv.contentEditable = !0, this._isDraggable = !1, this.div.removeAttribute("aria-activedescendant"), this.editorDiv.addEventListener("keydown", t(this, L)), this.editorDiv.addEventListener("focus", t(this, F)), this.editorDiv.addEventListener("blur", t(this, B)), this.editorDiv.addEventListener("input", t(this, g)));
            }
            disableEditMode() {
              this.isInEditMode() && (this.parent.setEditingState(!0), super.disableEditMode(), this.overlayDiv.classList.add("enabled"), this.editorDiv.contentEditable = !1, this.div.setAttribute("aria-activedescendant", t(this, v)), this._isDraggable = !0, this.editorDiv.removeEventListener("keydown", t(this, L)), this.editorDiv.removeEventListener("focus", t(this, F)), this.editorDiv.removeEventListener("blur", t(this, B)), this.editorDiv.removeEventListener("input", t(this, g)), this.div.focus({
                preventScroll: !0
              }), this.isEditing = !1, this.parent.div.classList.add("freeTextEditing"));
            }
            focusin(H) {
              this._focusEventsAllowed && (super.focusin(H), H.target !== this.editorDiv && this.editorDiv.focus());
            }
            onceAdded() {
              var H;
              if (this.width) {
                W(this, z, ri).call(this);
                return;
              }
              this.enableEditMode(), this.editorDiv.focus(), (H = this._initialOptions) != null && H.isCentered && this.center(), this._initialOptions = null;
            }
            isEmpty() {
              return !this.editorDiv || this.editorDiv.innerText.trim() === "";
            }
            remove() {
              this.isEditing = !1, this.parent && (this.parent.setEditingState(!0), this.parent.div.classList.add("freeTextEditing")), super.remove();
            }
            commit() {
              if (!this.isInEditMode())
                return;
              super.commit(), this.disableEditMode();
              const H = t(this, T), lt = Z(this, T, W(this, a, Ri).call(this).trimEnd());
              if (H === lt)
                return;
              const gt = (wt) => {
                if (Z(this, T, wt), !wt) {
                  this.remove();
                  return;
                }
                W(this, r, ni).call(this), this._uiManager.rebuild(this), W(this, k, ye).call(this);
              };
              this.addCommands({
                cmd: () => {
                  gt(lt);
                },
                undo: () => {
                  gt(H);
                },
                mustExec: !1
              }), W(this, k, ye).call(this);
            }
            shouldGetKeyboardEvents() {
              return this.isInEditMode();
            }
            enterInEditMode() {
              this.enableEditMode(), this.editorDiv.focus();
            }
            dblclick(H) {
              this.enterInEditMode();
            }
            keydown(H) {
              H.target === this.div && H.key === "Enter" && (this.enterInEditMode(), H.preventDefault());
            }
            editorDivKeydown(H) {
              V._keyboardManager.exec(this, H);
            }
            editorDivFocus(H) {
              this.isEditing = !0;
            }
            editorDivBlur(H) {
              this.isEditing = !1;
            }
            editorDivInput(H) {
              this.parent.div.classList.toggle("freeTextEditing", this.isEmpty());
            }
            disableEditing() {
              this.editorDiv.setAttribute("role", "comment"), this.editorDiv.removeAttribute("aria-multiline");
            }
            enableEditing() {
              this.editorDiv.setAttribute("role", "textbox"), this.editorDiv.setAttribute("aria-multiline", !0);
            }
            render() {
              if (this.div)
                return this.div;
              let H, lt;
              this.width && (H = this.x, lt = this.y), super.render(), this.editorDiv = document.createElement("div"), this.editorDiv.className = "internal", this.editorDiv.setAttribute("id", t(this, v)), this.enableEditing(), rt.AnnotationEditor._l10nPromise.get("editor_free_text2_aria_label").then((wt) => {
                var Pt;
                return (Pt = this.editorDiv) == null ? void 0 : Pt.setAttribute("aria-label", wt);
              }), rt.AnnotationEditor._l10nPromise.get("free_text2_default_content").then((wt) => {
                var Pt;
                return (Pt = this.editorDiv) == null ? void 0 : Pt.setAttribute("default-content", wt);
              }), this.editorDiv.contentEditable = !0;
              const {
                style: gt
              } = this.editorDiv;
              if (gt.fontSize = `calc(${t(this, A)}px * var(--scale-factor))`, gt.color = t(this, O), this.div.append(this.editorDiv), this.overlayDiv = document.createElement("div"), this.overlayDiv.classList.add("overlay", "enabled"), this.div.append(this.overlayDiv), (0, P.bindEvents)(this, this.div, ["dblclick", "keydown"]), this.width) {
                const [wt, Pt] = this.parentDimensions;
                if (this.annotationElementId) {
                  const {
                    position: S
                  } = t(this, u);
                  let [i, n] = this.getInitialTranslation();
                  [i, n] = this.pageTranslationToScreen(i, n);
                  const [s, o] = this.pageDimensions, [h, _] = this.pageTranslation;
                  let M, N;
                  switch (this.rotation) {
                    case 0:
                      M = H + (S[0] - h) / s, N = lt + this.height - (S[1] - _) / o;
                      break;
                    case 90:
                      M = H + (S[0] - h) / s, N = lt - (S[1] - _) / o, [i, n] = [n, -i];
                      break;
                    case 180:
                      M = H - this.width + (S[0] - h) / s, N = lt - (S[1] - _) / o, [i, n] = [-i, -n];
                      break;
                    case 270:
                      M = H + (S[0] - h - this.height * o) / s, N = lt + (S[1] - _ - this.width * s) / o, [i, n] = [-n, i];
                      break;
                  }
                  this.setAt(M * wt, N * Pt, i, n);
                } else
                  this.setAt(H * wt, lt * Pt, this.width * wt, this.height * Pt);
                W(this, r, ni).call(this), this._isDraggable = !0, this.editorDiv.contentEditable = !1;
              } else
                this._isDraggable = !1, this.editorDiv.contentEditable = !0;
              return this.div;
            }
            get contentDiv() {
              return this.editorDiv;
            }
            static deserialize(H, lt, gt) {
              let wt = null;
              if (H instanceof X.FreeTextAnnotationElement) {
                const {
                  data: {
                    defaultAppearanceData: {
                      fontSize: S,
                      fontColor: i
                    },
                    rect: n,
                    rotation: s,
                    id: o
                  },
                  textContent: h,
                  textPosition: _,
                  parent: {
                    page: {
                      pageNumber: M
                    }
                  }
                } = H;
                if (!h || h.length === 0)
                  return null;
                wt = H = {
                  annotationType: c.AnnotationEditorType.FREETEXT,
                  color: Array.from(i),
                  fontSize: S,
                  value: h.join(`
`),
                  position: _,
                  pageIndex: M - 1,
                  rect: n,
                  rotation: s,
                  id: o,
                  deleted: !1
                };
              }
              const Pt = super.deserialize(H, lt, gt);
              return Z(Pt, A, H.fontSize), Z(Pt, O, c.Util.makeHexColor(...H.color)), Z(Pt, T, H.value), Pt.annotationElementId = H.id || null, Z(Pt, u, wt), Pt;
            }
            serialize(H = !1) {
              if (this.isEmpty())
                return null;
              if (this.deleted)
                return {
                  pageIndex: this.pageIndex,
                  id: this.annotationElementId,
                  deleted: !0
                };
              const lt = V._internalPadding * this.parentScale, gt = this.getRect(lt, lt), wt = rt.AnnotationEditor._colorManager.convert(this.isAttachedToDOM ? getComputedStyle(this.editorDiv).color : t(this, O)), Pt = {
                annotationType: c.AnnotationEditorType.FREETEXT,
                color: wt,
                fontSize: t(this, A),
                value: t(this, T),
                pageIndex: this.pageIndex,
                rect: gt,
                rotation: this.rotation,
                structTreeParentId: this._structTreeParentId
              };
              return H ? Pt : this.annotationElementId && !W(this, m, Di).call(this, Pt) ? null : (Pt.id = this.annotationElementId, Pt);
            }
          };
          B = new WeakMap(), F = new WeakMap(), g = new WeakMap(), L = new WeakMap(), O = new WeakMap(), T = new WeakMap(), v = new WeakMap(), A = new WeakMap(), u = new WeakMap(), b = new WeakSet(), Fi = function(H) {
            const lt = (wt) => {
              this.editorDiv.style.fontSize = `calc(${wt}px * var(--scale-factor))`, this.translate(0, -(wt - t(this, A)) * this.parentScale), Z(this, A, wt), W(this, k, ye).call(this);
            }, gt = t(this, A);
            this.addCommands({
              cmd: () => {
                lt(H);
              },
              undo: () => {
                lt(gt);
              },
              mustExec: !0,
              type: c.AnnotationEditorParamsType.FREETEXT_SIZE,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, w = new WeakSet(), Mi = function(H) {
            const lt = t(this, O);
            this.addCommands({
              cmd: () => {
                Z(this, O, this.editorDiv.style.color = H);
              },
              undo: () => {
                Z(this, O, this.editorDiv.style.color = lt);
              },
              mustExec: !0,
              type: c.AnnotationEditorParamsType.FREETEXT_COLOR,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, a = new WeakSet(), Ri = function() {
            const H = this.editorDiv.getElementsByTagName("div");
            if (H.length === 0)
              return this.editorDiv.innerText;
            const lt = [];
            for (const gt of H)
              lt.push(gt.innerText.replace(/\r\n?|\n/, ""));
            return lt.join(`
`);
          }, k = new WeakSet(), ye = function() {
            const [H, lt] = this.parentDimensions;
            let gt;
            if (this.isAttachedToDOM)
              gt = this.div.getBoundingClientRect();
            else {
              const {
                currentLayer: wt,
                div: Pt
              } = this, S = Pt.style.display;
              Pt.style.display = "hidden", wt.div.append(this.div), gt = Pt.getBoundingClientRect(), Pt.remove(), Pt.style.display = S;
            }
            this.rotation % 180 === this.parentRotation % 180 ? (this.width = gt.width / H, this.height = gt.height / lt) : (this.width = gt.height / H, this.height = gt.width / lt), this.fixAndSetPosition();
          }, r = new WeakSet(), ni = function() {
            if (this.editorDiv.replaceChildren(), !!t(this, T))
              for (const H of t(this, T).split(`
`)) {
                const lt = document.createElement("div");
                lt.append(H ? document.createTextNode(H) : document.createElement("br")), this.editorDiv.append(lt);
              }
          }, m = new WeakSet(), Di = function(H) {
            const {
              value: lt,
              fontSize: gt,
              color: wt,
              rect: Pt,
              pageIndex: S
            } = t(this, u);
            return H.value !== lt || H.fontSize !== gt || H.rect.some((i, n) => Math.abs(i - Pt[n]) >= 1) || H.color.some((i, n) => i !== wt[n]) || H.pageIndex !== S;
          }, z = new WeakSet(), ri = function(H = !1) {
            if (!this.annotationElementId)
              return;
            if (W(this, k, ye).call(this), !H && (this.width === 0 || this.height === 0)) {
              setTimeout(() => W(this, z, ri).call(this, !0), 0);
              return;
            }
            const lt = V._internalPadding * this.parentScale;
            t(this, u).rect = this.getRect(lt, lt);
          }, ee(V, "_freeTextDefaultContent", ""), ee(V, "_internalPadding", 0), ee(V, "_defaultColor", null), ee(V, "_defaultFontSize", 10), ee(V, "_type", "freetext");
          let pt = V;
          d.FreeTextEditor = pt;
        },
        /* 29 */
        /***/
        (dt, d, et) => {
          var n, o, ce, _, Ii, N, tt, Q, nt, ct, yt, ut, Ft, Bt, St, Dt, ft, K, J, ht, Et, Ct, Ut, Li, Ht, Fe, Vt, ai, $t, oi, Y, G, bt, At, te, Zt, $, li, Lt, Tt, Ot, Nt, Oi, _t, ci;
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.StampAnnotationElement = d.InkAnnotationElement = d.FreeTextAnnotationElement = d.AnnotationLayer = void 0;
          var c = et(1), P = et(6), rt = et(3), X = et(30), pt = et(31), B = et(32);
          const F = 1e3, g = 9, L = /* @__PURE__ */ new WeakSet();
          function O(It) {
            return {
              width: It[2] - It[0],
              height: It[3] - It[1]
            };
          }
          class T {
            static create(R) {
              switch (R.data.annotationType) {
                case c.AnnotationType.LINK:
                  return new A(R);
                case c.AnnotationType.TEXT:
                  return new u(R);
                case c.AnnotationType.WIDGET:
                  switch (R.data.fieldType) {
                    case "Tx":
                      return new E(R);
                    case "Btn":
                      return R.data.radioButton ? new a(R) : R.data.checkBox ? new y(R) : new l(R);
                    case "Ch":
                      return new k(R);
                    case "Sig":
                      return new w(R);
                  }
                  return new b(R);
                case c.AnnotationType.POPUP:
                  return new p(R);
                case c.AnnotationType.FREETEXT:
                  return new x(R);
                case c.AnnotationType.LINE:
                  return new m(R);
                case c.AnnotationType.SQUARE:
                  return new U(R);
                case c.AnnotationType.CIRCLE:
                  return new z(R);
                case c.AnnotationType.POLYLINE:
                  return new C(R);
                case c.AnnotationType.CARET:
                  return new st(R);
                case c.AnnotationType.INK:
                  return new at(R);
                case c.AnnotationType.POLYGON:
                  return new V(R);
                case c.AnnotationType.HIGHLIGHT:
                  return new H(R);
                case c.AnnotationType.UNDERLINE:
                  return new lt(R);
                case c.AnnotationType.SQUIGGLY:
                  return new gt(R);
                case c.AnnotationType.STRIKEOUT:
                  return new wt(R);
                case c.AnnotationType.STAMP:
                  return new Pt(R);
                case c.AnnotationType.FILEATTACHMENT:
                  return new S(R);
                default:
                  return new v(R);
              }
            }
          }
          const s = class s {
            constructor(R, {
              isRenderable: e = !1,
              ignoreBorder: f = !1,
              createQuadrilaterals: D = !1
            } = {}) {
              I(this, n, !1);
              this.isRenderable = e, this.data = R.data, this.layer = R.layer, this.linkService = R.linkService, this.downloadManager = R.downloadManager, this.imageResourcesPath = R.imageResourcesPath, this.renderForms = R.renderForms, this.svgFactory = R.svgFactory, this.annotationStorage = R.annotationStorage, this.enableScripting = R.enableScripting, this.hasJSActions = R.hasJSActions, this._fieldObjects = R.fieldObjects, this.parent = R.parent, e && (this.container = this._createContainer(f)), D && this._createQuadrilaterals();
            }
            static _hasPopupData({
              titleObj: R,
              contentsObj: e,
              richText: f
            }) {
              return !!(R != null && R.str || e != null && e.str || f != null && f.str);
            }
            get hasPopupData() {
              return s._hasPopupData(this.data);
            }
            _createContainer(R) {
              const {
                data: e,
                parent: {
                  page: f,
                  viewport: D
                }
              } = this, j = document.createElement("section");
              j.setAttribute("data-annotation-id", e.id), this instanceof b || (j.tabIndex = F), j.style.zIndex = this.parent.zIndex++, this.data.popupRef && j.setAttribute("aria-haspopup", "dialog"), e.noRotate && j.classList.add("norotate");
              const {
                pageWidth: q,
                pageHeight: it,
                pageX: mt,
                pageY: kt
              } = D.rawDims;
              if (!e.rect || this instanceof p) {
                const {
                  rotation: jt
                } = e;
                return !e.hasOwnCanvas && jt !== 0 && this.setRotation(jt, j), j;
              }
              const {
                width: xt,
                height: zt
              } = O(e.rect), Mt = c.Util.normalizeRect([e.rect[0], f.view[3] - e.rect[1] + f.view[1], e.rect[2], f.view[3] - e.rect[3] + f.view[1]]);
              if (!R && e.borderStyle.width > 0) {
                j.style.borderWidth = `${e.borderStyle.width}px`;
                const jt = e.borderStyle.horizontalCornerRadius, qt = e.borderStyle.verticalCornerRadius;
                if (jt > 0 || qt > 0) {
                  const Qt = `calc(${jt}px * var(--scale-factor)) / calc(${qt}px * var(--scale-factor))`;
                  j.style.borderRadius = Qt;
                } else if (this instanceof a) {
                  const Qt = `calc(${xt}px * var(--scale-factor)) / calc(${zt}px * var(--scale-factor))`;
                  j.style.borderRadius = Qt;
                }
                switch (e.borderStyle.style) {
                  case c.AnnotationBorderStyleType.SOLID:
                    j.style.borderStyle = "solid";
                    break;
                  case c.AnnotationBorderStyleType.DASHED:
                    j.style.borderStyle = "dashed";
                    break;
                  case c.AnnotationBorderStyleType.BEVELED:
                    (0, c.warn)("Unimplemented border style: beveled");
                    break;
                  case c.AnnotationBorderStyleType.INSET:
                    (0, c.warn)("Unimplemented border style: inset");
                    break;
                  case c.AnnotationBorderStyleType.UNDERLINE:
                    j.style.borderBottomStyle = "solid";
                    break;
                }
                const Kt = e.borderColor || null;
                Kt ? (Z(this, n, !0), j.style.borderColor = c.Util.makeHexColor(Kt[0] | 0, Kt[1] | 0, Kt[2] | 0)) : j.style.borderWidth = 0;
              }
              j.style.left = `${100 * (Mt[0] - mt) / q}%`, j.style.top = `${100 * (Mt[1] - kt) / it}%`;
              const {
                rotation: Rt
              } = e;
              return e.hasOwnCanvas || Rt === 0 ? (j.style.width = `${100 * xt / q}%`, j.style.height = `${100 * zt / it}%`) : this.setRotation(Rt, j), j;
            }
            setRotation(R, e = this.container) {
              if (!this.data.rect)
                return;
              const {
                pageWidth: f,
                pageHeight: D
              } = this.parent.viewport.rawDims, {
                width: j,
                height: q
              } = O(this.data.rect);
              let it, mt;
              R % 180 === 0 ? (it = 100 * j / f, mt = 100 * q / D) : (it = 100 * q / f, mt = 100 * j / D), e.style.width = `${it}%`, e.style.height = `${mt}%`, e.setAttribute("data-main-rotation", (360 - R) % 360);
            }
            get _commonActions() {
              const R = (e, f, D) => {
                const j = D.detail[e], q = j[0], it = j.slice(1);
                D.target.style[f] = X.ColorConverters[`${q}_HTML`](it), this.annotationStorage.setValue(this.data.id, {
                  [f]: X.ColorConverters[`${q}_rgb`](it)
                });
              };
              return (0, c.shadow)(this, "_commonActions", {
                display: (e) => {
                  const {
                    display: f
                  } = e.detail, D = f % 2 === 1;
                  this.container.style.visibility = D ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
                    noView: D,
                    noPrint: f === 1 || f === 2
                  });
                },
                print: (e) => {
                  this.annotationStorage.setValue(this.data.id, {
                    noPrint: !e.detail.print
                  });
                },
                hidden: (e) => {
                  const {
                    hidden: f
                  } = e.detail;
                  this.container.style.visibility = f ? "hidden" : "visible", this.annotationStorage.setValue(this.data.id, {
                    noPrint: f,
                    noView: f
                  });
                },
                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) => {
                  R("bgColor", "backgroundColor", e);
                },
                fillColor: (e) => {
                  R("fillColor", "backgroundColor", e);
                },
                fgColor: (e) => {
                  R("fgColor", "color", e);
                },
                textColor: (e) => {
                  R("textColor", "color", e);
                },
                borderColor: (e) => {
                  R("borderColor", "borderColor", e);
                },
                strokeColor: (e) => {
                  R("strokeColor", "borderColor", e);
                },
                rotation: (e) => {
                  const f = e.detail.rotation;
                  this.setRotation(f), this.annotationStorage.setValue(this.data.id, {
                    rotation: f
                  });
                }
              });
            }
            _dispatchEventFromSandbox(R, e) {
              const f = this._commonActions;
              for (const D of Object.keys(e.detail)) {
                const j = R[D] || f[D];
                j == null || j(e);
              }
            }
            _setDefaultPropertiesFromJS(R) {
              if (!this.enableScripting)
                return;
              const e = this.annotationStorage.getRawValue(this.data.id);
              if (!e)
                return;
              const f = this._commonActions;
              for (const [D, j] of Object.entries(e)) {
                const q = f[D];
                if (q) {
                  const it = {
                    detail: {
                      [D]: j
                    },
                    target: R
                  };
                  q(it), delete e[D];
                }
              }
            }
            _createQuadrilaterals() {
              if (!this.container)
                return;
              const {
                quadPoints: R
              } = this.data;
              if (!R)
                return;
              const [e, f, D, j] = this.data.rect;
              if (R.length === 1) {
                const [, {
                  x: qt,
                  y: Kt
                }, {
                  x: Qt,
                  y: se
                }] = R[0];
                if (D === qt && j === Kt && e === Qt && f === se)
                  return;
              }
              const {
                style: q
              } = this.container;
              let it;
              if (t(this, n)) {
                const {
                  borderColor: qt,
                  borderWidth: Kt
                } = q;
                q.borderWidth = 0, it = ["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="${qt}" stroke-width="${Kt}">`], this.container.classList.add("hasBorder");
              }
              const mt = D - e, kt = j - f, {
                svgFactory: xt
              } = this, zt = xt.createElement("svg");
              zt.classList.add("quadrilateralsContainer"), zt.setAttribute("width", 0), zt.setAttribute("height", 0);
              const Mt = xt.createElement("defs");
              zt.append(Mt);
              const Rt = xt.createElement("clipPath"), jt = `clippath_${this.data.id}`;
              Rt.setAttribute("id", jt), Rt.setAttribute("clipPathUnits", "objectBoundingBox"), Mt.append(Rt);
              for (const [, {
                x: qt,
                y: Kt
              }, {
                x: Qt,
                y: se
              }] of R) {
                const ie = xt.createElement("rect"), ne = (Qt - e) / mt, oe = (j - Kt) / kt, le = (qt - Qt) / mt, _i = (Kt - se) / kt;
                ie.setAttribute("x", ne), ie.setAttribute("y", oe), ie.setAttribute("width", le), ie.setAttribute("height", _i), Rt.append(ie), it == null || it.push(`<rect vector-effect="non-scaling-stroke" x="${ne}" y="${oe}" width="${le}" height="${_i}"/>`);
              }
              t(this, n) && (it.push("</g></svg>')"), q.backgroundImage = it.join("")), this.container.append(zt), this.container.style.clipPath = `url(#${jt})`;
            }
            _createPopup() {
              const {
                container: R,
                data: e
              } = this;
              R.setAttribute("aria-haspopup", "dialog");
              const f = new p({
                data: {
                  color: e.color,
                  titleObj: e.titleObj,
                  modificationDate: e.modificationDate,
                  contentsObj: e.contentsObj,
                  richText: e.richText,
                  parentRect: e.rect,
                  borderStyle: 0,
                  id: `popup_${e.id}`,
                  rotation: e.rotation
                },
                parent: this.parent,
                elements: [this]
              });
              this.parent.div.append(f.render());
            }
            render() {
              (0, c.unreachable)("Abstract method `AnnotationElement.render` called");
            }
            _getElementsByName(R, e = null) {
              const f = [];
              if (this._fieldObjects) {
                const D = this._fieldObjects[R];
                if (D)
                  for (const {
                    page: j,
                    id: q,
                    exportValues: it
                  } of D) {
                    if (j === -1 || q === e)
                      continue;
                    const mt = typeof it == "string" ? it : null, kt = document.querySelector(`[data-element-id="${q}"]`);
                    if (kt && !L.has(kt)) {
                      (0, c.warn)(`_getElementsByName - element not allowed: ${q}`);
                      continue;
                    }
                    f.push({
                      id: q,
                      exportValue: mt,
                      domElement: kt
                    });
                  }
                return f;
              }
              for (const D of document.getElementsByName(R)) {
                const {
                  exportValue: j
                } = D, q = D.getAttribute("data-element-id");
                q !== e && L.has(D) && f.push({
                  id: q,
                  exportValue: j,
                  domElement: D
                });
              }
              return f;
            }
            show() {
              var R;
              this.container && (this.container.hidden = !1), (R = this.popup) == null || R.maybeShow();
            }
            hide() {
              var R;
              this.container && (this.container.hidden = !0), (R = this.popup) == null || R.forceHide();
            }
            getElementsToTriggerPopup() {
              return this.container;
            }
            addHighlightArea() {
              const R = this.getElementsToTriggerPopup();
              if (Array.isArray(R))
                for (const e of R)
                  e.classList.add("highlightArea");
              else
                R.classList.add("highlightArea");
            }
            _editOnDoubleClick() {
              const {
                annotationEditorType: R,
                data: {
                  id: e
                }
              } = this;
              this.container.addEventListener("dblclick", () => {
                var f;
                (f = this.linkService.eventBus) == null || f.dispatch("switchannotationeditormode", {
                  source: this,
                  mode: R,
                  editId: e
                });
              });
            }
          };
          n = new WeakMap();
          let v = s;
          class A extends v {
            constructor(e, f = null) {
              super(e, {
                isRenderable: !0,
                ignoreBorder: !!(f != null && f.ignoreBorder),
                createQuadrilaterals: !0
              });
              I(this, o);
              I(this, _);
              this.isTooltipOnly = e.data.isTooltipOnly;
            }
            render() {
              const {
                data: e,
                linkService: f
              } = this, D = document.createElement("a");
              D.setAttribute("data-element-id", e.id);
              let j = !1;
              return e.url ? (f.addLinkAttributes(D, e.url, e.newWindow), j = !0) : e.action ? (this._bindNamedAction(D, e.action), j = !0) : e.attachment ? (this._bindAttachment(D, e.attachment), j = !0) : e.setOCGState ? (W(this, _, Ii).call(this, D, e.setOCGState), j = !0) : e.dest ? (this._bindLink(D, e.dest), j = !0) : (e.actions && (e.actions.Action || e.actions["Mouse Up"] || e.actions["Mouse Down"]) && this.enableScripting && this.hasJSActions && (this._bindJSAction(D, e), j = !0), e.resetForm ? (this._bindResetFormAction(D, e.resetForm), j = !0) : this.isTooltipOnly && !j && (this._bindLink(D, ""), j = !0)), this.container.classList.add("linkAnnotation"), j && this.container.append(D), this.container;
            }
            _bindLink(e, f) {
              e.href = this.linkService.getDestinationHash(f), e.onclick = () => (f && this.linkService.goToDestination(f), !1), (f || f === "") && W(this, o, ce).call(this);
            }
            _bindNamedAction(e, f) {
              e.href = this.linkService.getAnchorUrl(""), e.onclick = () => (this.linkService.executeNamedAction(f), !1), W(this, o, ce).call(this);
            }
            _bindAttachment(e, f) {
              e.href = this.linkService.getAnchorUrl(""), e.onclick = () => {
                var D;
                return (D = this.downloadManager) == null || D.openOrDownloadData(this.container, f.content, f.filename), !1;
              }, W(this, o, ce).call(this);
            }
            _bindJSAction(e, f) {
              e.href = this.linkService.getAnchorUrl("");
              const D = /* @__PURE__ */ new Map([["Action", "onclick"], ["Mouse Up", "onmouseup"], ["Mouse Down", "onmousedown"]]);
              for (const j of Object.keys(f.actions)) {
                const q = D.get(j);
                q && (e[q] = () => {
                  var it;
                  return (it = this.linkService.eventBus) == null || it.dispatch("dispatcheventinsandbox", {
                    source: this,
                    detail: {
                      id: f.id,
                      name: j
                    }
                  }), !1;
                });
              }
              e.onclick || (e.onclick = () => !1), W(this, o, ce).call(this);
            }
            _bindResetFormAction(e, f) {
              const D = e.onclick;
              if (D || (e.href = this.linkService.getAnchorUrl("")), W(this, o, ce).call(this), !this._fieldObjects) {
                (0, c.warn)('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'), D || (e.onclick = () => !1);
                return;
              }
              e.onclick = () => {
                var zt;
                D == null || D();
                const {
                  fields: j,
                  refs: q,
                  include: it
                } = f, mt = [];
                if (j.length !== 0 || q.length !== 0) {
                  const Mt = new Set(q);
                  for (const Rt of j) {
                    const jt = this._fieldObjects[Rt] || [];
                    for (const {
                      id: qt
                    } of jt)
                      Mt.add(qt);
                  }
                  for (const Rt of Object.values(this._fieldObjects))
                    for (const jt of Rt)
                      Mt.has(jt.id) === it && mt.push(jt);
                } else
                  for (const Mt of Object.values(this._fieldObjects))
                    mt.push(...Mt);
                const kt = this.annotationStorage, xt = [];
                for (const Mt of mt) {
                  const {
                    id: Rt
                  } = Mt;
                  switch (xt.push(Rt), Mt.type) {
                    case "text": {
                      const qt = Mt.defaultValue || "";
                      kt.setValue(Rt, {
                        value: qt
                      });
                      break;
                    }
                    case "checkbox":
                    case "radiobutton": {
                      const qt = Mt.defaultValue === Mt.exportValues;
                      kt.setValue(Rt, {
                        value: qt
                      });
                      break;
                    }
                    case "combobox":
                    case "listbox": {
                      const qt = Mt.defaultValue || "";
                      kt.setValue(Rt, {
                        value: qt
                      });
                      break;
                    }
                    default:
                      continue;
                  }
                  const jt = document.querySelector(`[data-element-id="${Rt}"]`);
                  if (jt) {
                    if (!L.has(jt)) {
                      (0, c.warn)(`_bindResetFormAction - element not allowed: ${Rt}`);
                      continue;
                    }
                  } else
                    continue;
                  jt.dispatchEvent(new Event("resetform"));
                }
                return this.enableScripting && ((zt = this.linkService.eventBus) == null || zt.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: "app",
                    ids: xt,
                    name: "ResetForm"
                  }
                })), !1;
              };
            }
          }
          o = new WeakSet(), ce = function() {
            this.container.setAttribute("data-internal-link", "");
          }, _ = new WeakSet(), Ii = function(e, f) {
            e.href = this.linkService.getAnchorUrl(""), e.onclick = () => (this.linkService.executeSetOCGState(f), !1), W(this, o, ce).call(this);
          };
          class u extends v {
            constructor(R) {
              super(R, {
                isRenderable: !0
              });
            }
            render() {
              this.container.classList.add("textAnnotation");
              const R = document.createElement("img");
              return R.src = this.imageResourcesPath + "annotation-" + this.data.name.toLowerCase() + ".svg", R.alt = "[{{type}} Annotation]", R.dataset.l10nId = "text_annotation_type", R.dataset.l10nArgs = JSON.stringify({
                type: this.data.name
              }), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.append(R), this.container;
            }
          }
          class b extends v {
            render() {
              return this.data.alternativeText && (this.container.title = this.data.alternativeText), this.container;
            }
            showElementAndHideCanvas(R) {
              var e;
              this.data.hasOwnCanvas && (((e = R.previousSibling) == null ? void 0 : e.nodeName) === "CANVAS" && (R.previousSibling.hidden = !0), R.hidden = !1);
            }
            _getKeyModifier(R) {
              const {
                isWin: e,
                isMac: f
              } = c.FeatureTest.platform;
              return e && R.ctrlKey || f && R.metaKey;
            }
            _setEventListener(R, e, f, D, j) {
              f.includes("mouse") ? R.addEventListener(f, (q) => {
                var it;
                (it = this.linkService.eventBus) == null || it.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: this.data.id,
                    name: D,
                    value: j(q),
                    shift: q.shiftKey,
                    modifier: this._getKeyModifier(q)
                  }
                });
              }) : R.addEventListener(f, (q) => {
                var it;
                if (f === "blur") {
                  if (!e.focused || !q.relatedTarget)
                    return;
                  e.focused = !1;
                } else if (f === "focus") {
                  if (e.focused)
                    return;
                  e.focused = !0;
                }
                j && ((it = this.linkService.eventBus) == null || it.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: this.data.id,
                    name: D,
                    value: j(q)
                  }
                }));
              });
            }
            _setEventListeners(R, e, f, D) {
              var j, q, it;
              for (const [mt, kt] of f)
                (kt === "Action" || (j = this.data.actions) != null && j[kt]) && ((kt === "Focus" || kt === "Blur") && (e || (e = {
                  focused: !1
                })), this._setEventListener(R, e, mt, kt, D), kt === "Focus" && !((q = this.data.actions) != null && q.Blur) ? this._setEventListener(R, e, "blur", "Blur", null) : kt === "Blur" && !((it = this.data.actions) != null && it.Focus) && this._setEventListener(R, e, "focus", "Focus", null));
            }
            _setBackgroundColor(R) {
              const e = this.data.backgroundColor || null;
              R.style.backgroundColor = e === null ? "transparent" : c.Util.makeHexColor(e[0], e[1], e[2]);
            }
            _setTextStyle(R) {
              const e = ["left", "center", "right"], {
                fontColor: f
              } = this.data.defaultAppearanceData, D = this.data.defaultAppearanceData.fontSize || g, j = R.style;
              let q;
              const it = 2, mt = (kt) => Math.round(10 * kt) / 10;
              if (this.data.multiLine) {
                const kt = Math.abs(this.data.rect[3] - this.data.rect[1] - it), xt = Math.round(kt / (c.LINE_FACTOR * D)) || 1, zt = kt / xt;
                q = Math.min(D, mt(zt / c.LINE_FACTOR));
              } else {
                const kt = Math.abs(this.data.rect[3] - this.data.rect[1] - it);
                q = Math.min(D, mt(kt / c.LINE_FACTOR));
              }
              j.fontSize = `calc(${q}px * var(--scale-factor))`, j.color = c.Util.makeHexColor(f[0], f[1], f[2]), this.data.textAlignment !== null && (j.textAlign = e[this.data.textAlignment]);
            }
            _setRequired(R, e) {
              e ? R.setAttribute("required", !0) : R.removeAttribute("required"), R.setAttribute("aria-required", e);
            }
          }
          class E extends b {
            constructor(R) {
              const e = R.renderForms || !R.data.hasAppearance && !!R.data.fieldValue;
              super(R, {
                isRenderable: e
              });
            }
            setPropertyOnSiblings(R, e, f, D) {
              const j = this.annotationStorage;
              for (const q of this._getElementsByName(R.name, R.id))
                q.domElement && (q.domElement[e] = f), j.setValue(q.id, {
                  [D]: f
                });
            }
            render() {
              var D, j;
              const R = this.annotationStorage, e = this.data.id;
              this.container.classList.add("textWidgetAnnotation");
              let f = null;
              if (this.renderForms) {
                const q = R.getValue(e, {
                  value: this.data.fieldValue
                });
                let it = q.value || "";
                const mt = R.getValue(e, {
                  charLimit: this.data.maxLen
                }).charLimit;
                mt && it.length > mt && (it = it.slice(0, mt));
                let kt = q.formattedValue || ((D = this.data.textContent) == null ? void 0 : D.join(`
`)) || null;
                kt && this.data.comb && (kt = kt.replaceAll(/\s+/g, ""));
                const xt = {
                  userValue: it,
                  formattedValue: kt,
                  lastCommittedValue: null,
                  commitKey: 1,
                  focused: !1
                };
                this.data.multiLine ? (f = document.createElement("textarea"), f.textContent = kt ?? it, this.data.doNotScroll && (f.style.overflowY = "hidden")) : (f = document.createElement("input"), f.type = "text", f.setAttribute("value", kt ?? it), this.data.doNotScroll && (f.style.overflowX = "hidden")), this.data.hasOwnCanvas && (f.hidden = !0), L.add(f), f.setAttribute("data-element-id", e), f.disabled = this.data.readOnly, f.name = this.data.fieldName, f.tabIndex = F, this._setRequired(f, this.data.required), mt && (f.maxLength = mt), f.addEventListener("input", (Mt) => {
                  R.setValue(e, {
                    value: Mt.target.value
                  }), this.setPropertyOnSiblings(f, "value", Mt.target.value, "value"), xt.formattedValue = null;
                }), f.addEventListener("resetform", (Mt) => {
                  const Rt = this.data.defaultFieldValue ?? "";
                  f.value = xt.userValue = Rt, xt.formattedValue = null;
                });
                let zt = (Mt) => {
                  const {
                    formattedValue: Rt
                  } = xt;
                  Rt != null && (Mt.target.value = Rt), Mt.target.scrollLeft = 0;
                };
                if (this.enableScripting && this.hasJSActions) {
                  f.addEventListener("focus", (Rt) => {
                    if (xt.focused)
                      return;
                    const {
                      target: jt
                    } = Rt;
                    xt.userValue && (jt.value = xt.userValue), xt.lastCommittedValue = jt.value, xt.commitKey = 1, xt.focused = !0;
                  }), f.addEventListener("updatefromsandbox", (Rt) => {
                    this.showElementAndHideCanvas(Rt.target);
                    const jt = {
                      value(qt) {
                        xt.userValue = qt.detail.value ?? "", R.setValue(e, {
                          value: xt.userValue.toString()
                        }), qt.target.value = xt.userValue;
                      },
                      formattedValue(qt) {
                        const {
                          formattedValue: Kt
                        } = qt.detail;
                        xt.formattedValue = Kt, Kt != null && qt.target !== document.activeElement && (qt.target.value = Kt), R.setValue(e, {
                          formattedValue: Kt
                        });
                      },
                      selRange(qt) {
                        qt.target.setSelectionRange(...qt.detail.selRange);
                      },
                      charLimit: (qt) => {
                        var ie;
                        const {
                          charLimit: Kt
                        } = qt.detail, {
                          target: Qt
                        } = qt;
                        if (Kt === 0) {
                          Qt.removeAttribute("maxLength");
                          return;
                        }
                        Qt.setAttribute("maxLength", Kt);
                        let se = xt.userValue;
                        !se || se.length <= Kt || (se = se.slice(0, Kt), Qt.value = xt.userValue = se, R.setValue(e, {
                          value: se
                        }), (ie = this.linkService.eventBus) == null || ie.dispatch("dispatcheventinsandbox", {
                          source: this,
                          detail: {
                            id: e,
                            name: "Keystroke",
                            value: se,
                            willCommit: !0,
                            commitKey: 1,
                            selStart: Qt.selectionStart,
                            selEnd: Qt.selectionEnd
                          }
                        }));
                      }
                    };
                    this._dispatchEventFromSandbox(jt, Rt);
                  }), f.addEventListener("keydown", (Rt) => {
                    var Kt;
                    xt.commitKey = 1;
                    let jt = -1;
                    if (Rt.key === "Escape" ? jt = 0 : Rt.key === "Enter" && !this.data.multiLine ? jt = 2 : Rt.key === "Tab" && (xt.commitKey = 3), jt === -1)
                      return;
                    const {
                      value: qt
                    } = Rt.target;
                    xt.lastCommittedValue !== qt && (xt.lastCommittedValue = qt, xt.userValue = qt, (Kt = this.linkService.eventBus) == null || Kt.dispatch("dispatcheventinsandbox", {
                      source: this,
                      detail: {
                        id: e,
                        name: "Keystroke",
                        value: qt,
                        willCommit: !0,
                        commitKey: jt,
                        selStart: Rt.target.selectionStart,
                        selEnd: Rt.target.selectionEnd
                      }
                    }));
                  });
                  const Mt = zt;
                  zt = null, f.addEventListener("blur", (Rt) => {
                    var qt;
                    if (!xt.focused || !Rt.relatedTarget)
                      return;
                    xt.focused = !1;
                    const {
                      value: jt
                    } = Rt.target;
                    xt.userValue = jt, xt.lastCommittedValue !== jt && ((qt = this.linkService.eventBus) == null || qt.dispatch("dispatcheventinsandbox", {
                      source: this,
                      detail: {
                        id: e,
                        name: "Keystroke",
                        value: jt,
                        willCommit: !0,
                        commitKey: xt.commitKey,
                        selStart: Rt.target.selectionStart,
                        selEnd: Rt.target.selectionEnd
                      }
                    })), Mt(Rt);
                  }), (j = this.data.actions) != null && j.Keystroke && f.addEventListener("beforeinput", (Rt) => {
                    var oe;
                    xt.lastCommittedValue = null;
                    const {
                      data: jt,
                      target: qt
                    } = Rt, {
                      value: Kt,
                      selectionStart: Qt,
                      selectionEnd: se
                    } = qt;
                    let ie = Qt, ne = se;
                    switch (Rt.inputType) {
                      case "deleteWordBackward": {
                        const le = Kt.substring(0, Qt).match(/\w*[^\w]*$/);
                        le && (ie -= le[0].length);
                        break;
                      }
                      case "deleteWordForward": {
                        const le = Kt.substring(Qt).match(/^[^\w]*\w*/);
                        le && (ne += le[0].length);
                        break;
                      }
                      case "deleteContentBackward":
                        Qt === se && (ie -= 1);
                        break;
                      case "deleteContentForward":
                        Qt === se && (ne += 1);
                        break;
                    }
                    Rt.preventDefault(), (oe = this.linkService.eventBus) == null || oe.dispatch("dispatcheventinsandbox", {
                      source: this,
                      detail: {
                        id: e,
                        name: "Keystroke",
                        value: Kt,
                        change: jt || "",
                        willCommit: !1,
                        selStart: ie,
                        selEnd: ne
                      }
                    });
                  }), this._setEventListeners(f, xt, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (Rt) => Rt.target.value);
                }
                if (zt && f.addEventListener("blur", zt), this.data.comb) {
                  const Rt = (this.data.rect[2] - this.data.rect[0]) / mt;
                  f.classList.add("comb"), f.style.letterSpacing = `calc(${Rt}px * var(--scale-factor) - 1ch)`;
                }
              } else
                f = document.createElement("div"), f.textContent = this.data.fieldValue, f.style.verticalAlign = "middle", f.style.display = "table-cell";
              return this._setTextStyle(f), this._setBackgroundColor(f), this._setDefaultPropertiesFromJS(f), this.container.append(f), this.container;
            }
          }
          class w extends b {
            constructor(R) {
              super(R, {
                isRenderable: !!R.data.hasOwnCanvas
              });
            }
          }
          class y extends b {
            constructor(R) {
              super(R, {
                isRenderable: R.renderForms
              });
            }
            render() {
              const R = this.annotationStorage, e = this.data, f = e.id;
              let D = R.getValue(f, {
                value: e.exportValue === e.fieldValue
              }).value;
              typeof D == "string" && (D = D !== "Off", R.setValue(f, {
                value: D
              })), this.container.classList.add("buttonWidgetAnnotation", "checkBox");
              const j = document.createElement("input");
              return L.add(j), j.setAttribute("data-element-id", f), j.disabled = e.readOnly, this._setRequired(j, this.data.required), j.type = "checkbox", j.name = e.fieldName, D && j.setAttribute("checked", !0), j.setAttribute("exportValue", e.exportValue), j.tabIndex = F, j.addEventListener("change", (q) => {
                const {
                  name: it,
                  checked: mt
                } = q.target;
                for (const kt of this._getElementsByName(it, f)) {
                  const xt = mt && kt.exportValue === e.exportValue;
                  kt.domElement && (kt.domElement.checked = xt), R.setValue(kt.id, {
                    value: xt
                  });
                }
                R.setValue(f, {
                  value: mt
                });
              }), j.addEventListener("resetform", (q) => {
                const it = e.defaultFieldValue || "Off";
                q.target.checked = it === e.exportValue;
              }), this.enableScripting && this.hasJSActions && (j.addEventListener("updatefromsandbox", (q) => {
                const it = {
                  value(mt) {
                    mt.target.checked = mt.detail.value !== "Off", R.setValue(f, {
                      value: mt.target.checked
                    });
                  }
                };
                this._dispatchEventFromSandbox(it, q);
              }), this._setEventListeners(j, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (q) => q.target.checked)), this._setBackgroundColor(j), this._setDefaultPropertiesFromJS(j), this.container.append(j), this.container;
            }
          }
          class a extends b {
            constructor(R) {
              super(R, {
                isRenderable: R.renderForms
              });
            }
            render() {
              this.container.classList.add("buttonWidgetAnnotation", "radioButton");
              const R = this.annotationStorage, e = this.data, f = e.id;
              let D = R.getValue(f, {
                value: e.fieldValue === e.buttonValue
              }).value;
              typeof D == "string" && (D = D !== e.buttonValue, R.setValue(f, {
                value: D
              }));
              const j = document.createElement("input");
              if (L.add(j), j.setAttribute("data-element-id", f), j.disabled = e.readOnly, this._setRequired(j, this.data.required), j.type = "radio", j.name = e.fieldName, D && j.setAttribute("checked", !0), j.tabIndex = F, j.addEventListener("change", (q) => {
                const {
                  name: it,
                  checked: mt
                } = q.target;
                for (const kt of this._getElementsByName(it, f))
                  R.setValue(kt.id, {
                    value: !1
                  });
                R.setValue(f, {
                  value: mt
                });
              }), j.addEventListener("resetform", (q) => {
                const it = e.defaultFieldValue;
                q.target.checked = it != null && it === e.buttonValue;
              }), this.enableScripting && this.hasJSActions) {
                const q = e.buttonValue;
                j.addEventListener("updatefromsandbox", (it) => {
                  const mt = {
                    value: (kt) => {
                      const xt = q === kt.detail.value;
                      for (const zt of this._getElementsByName(kt.target.name)) {
                        const Mt = xt && zt.id === f;
                        zt.domElement && (zt.domElement.checked = Mt), R.setValue(zt.id, {
                          value: Mt
                        });
                      }
                    }
                  };
                  this._dispatchEventFromSandbox(mt, it);
                }), this._setEventListeners(j, null, [["change", "Validate"], ["change", "Action"], ["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"]], (it) => it.target.checked);
              }
              return this._setBackgroundColor(j), this._setDefaultPropertiesFromJS(j), this.container.append(j), this.container;
            }
          }
          class l extends A {
            constructor(R) {
              super(R, {
                ignoreBorder: R.data.hasAppearance
              });
            }
            render() {
              const R = super.render();
              R.classList.add("buttonWidgetAnnotation", "pushButton"), this.data.alternativeText && (R.title = this.data.alternativeText);
              const e = R.lastChild;
              return this.enableScripting && this.hasJSActions && e && (this._setDefaultPropertiesFromJS(e), e.addEventListener("updatefromsandbox", (f) => {
                this._dispatchEventFromSandbox({}, f);
              })), R;
            }
          }
          class k extends b {
            constructor(R) {
              super(R, {
                isRenderable: R.renderForms
              });
            }
            render() {
              this.container.classList.add("choiceWidgetAnnotation");
              const R = this.annotationStorage, e = this.data.id, f = R.getValue(e, {
                value: this.data.fieldValue
              }), D = document.createElement("select");
              L.add(D), D.setAttribute("data-element-id", e), D.disabled = this.data.readOnly, this._setRequired(D, this.data.required), D.name = this.data.fieldName, D.tabIndex = F;
              let j = this.data.combo && this.data.options.length > 0;
              this.data.combo || (D.size = this.data.options.length, this.data.multiSelect && (D.multiple = !0)), D.addEventListener("resetform", (xt) => {
                const zt = this.data.defaultFieldValue;
                for (const Mt of D.options)
                  Mt.selected = Mt.value === zt;
              });
              for (const xt of this.data.options) {
                const zt = document.createElement("option");
                zt.textContent = xt.displayValue, zt.value = xt.exportValue, f.value.includes(xt.exportValue) && (zt.setAttribute("selected", !0), j = !1), D.append(zt);
              }
              let q = null;
              if (j) {
                const xt = document.createElement("option");
                xt.value = " ", xt.setAttribute("hidden", !0), xt.setAttribute("selected", !0), D.prepend(xt), q = () => {
                  xt.remove(), D.removeEventListener("input", q), q = null;
                }, D.addEventListener("input", q);
              }
              const it = (xt) => {
                const zt = xt ? "value" : "textContent", {
                  options: Mt,
                  multiple: Rt
                } = D;
                return Rt ? Array.prototype.filter.call(Mt, (jt) => jt.selected).map((jt) => jt[zt]) : Mt.selectedIndex === -1 ? null : Mt[Mt.selectedIndex][zt];
              };
              let mt = it(!1);
              const kt = (xt) => {
                const zt = xt.target.options;
                return Array.prototype.map.call(zt, (Mt) => ({
                  displayValue: Mt.textContent,
                  exportValue: Mt.value
                }));
              };
              return this.enableScripting && this.hasJSActions ? (D.addEventListener("updatefromsandbox", (xt) => {
                const zt = {
                  value(Mt) {
                    q == null || q();
                    const Rt = Mt.detail.value, jt = new Set(Array.isArray(Rt) ? Rt : [Rt]);
                    for (const qt of D.options)
                      qt.selected = jt.has(qt.value);
                    R.setValue(e, {
                      value: it(!0)
                    }), mt = it(!1);
                  },
                  multipleSelection(Mt) {
                    D.multiple = !0;
                  },
                  remove(Mt) {
                    const Rt = D.options, jt = Mt.detail.remove;
                    Rt[jt].selected = !1, D.remove(jt), Rt.length > 0 && Array.prototype.findIndex.call(Rt, (Kt) => Kt.selected) === -1 && (Rt[0].selected = !0), R.setValue(e, {
                      value: it(!0),
                      items: kt(Mt)
                    }), mt = it(!1);
                  },
                  clear(Mt) {
                    for (; D.length !== 0; )
                      D.remove(0);
                    R.setValue(e, {
                      value: null,
                      items: []
                    }), mt = it(!1);
                  },
                  insert(Mt) {
                    const {
                      index: Rt,
                      displayValue: jt,
                      exportValue: qt
                    } = Mt.detail.insert, Kt = D.children[Rt], Qt = document.createElement("option");
                    Qt.textContent = jt, Qt.value = qt, Kt ? Kt.before(Qt) : D.append(Qt), R.setValue(e, {
                      value: it(!0),
                      items: kt(Mt)
                    }), mt = it(!1);
                  },
                  items(Mt) {
                    const {
                      items: Rt
                    } = Mt.detail;
                    for (; D.length !== 0; )
                      D.remove(0);
                    for (const jt of Rt) {
                      const {
                        displayValue: qt,
                        exportValue: Kt
                      } = jt, Qt = document.createElement("option");
                      Qt.textContent = qt, Qt.value = Kt, D.append(Qt);
                    }
                    D.options.length > 0 && (D.options[0].selected = !0), R.setValue(e, {
                      value: it(!0),
                      items: kt(Mt)
                    }), mt = it(!1);
                  },
                  indices(Mt) {
                    const Rt = new Set(Mt.detail.indices);
                    for (const jt of Mt.target.options)
                      jt.selected = Rt.has(jt.index);
                    R.setValue(e, {
                      value: it(!0)
                    }), mt = it(!1);
                  },
                  editable(Mt) {
                    Mt.target.disabled = !Mt.detail.editable;
                  }
                };
                this._dispatchEventFromSandbox(zt, xt);
              }), D.addEventListener("input", (xt) => {
                var Mt;
                const zt = it(!0);
                R.setValue(e, {
                  value: zt
                }), xt.preventDefault(), (Mt = this.linkService.eventBus) == null || Mt.dispatch("dispatcheventinsandbox", {
                  source: this,
                  detail: {
                    id: e,
                    name: "Keystroke",
                    value: mt,
                    changeEx: zt,
                    willCommit: !1,
                    commitKey: 1,
                    keyDown: !1
                  }
                });
              }), this._setEventListeners(D, null, [["focus", "Focus"], ["blur", "Blur"], ["mousedown", "Mouse Down"], ["mouseenter", "Mouse Enter"], ["mouseleave", "Mouse Exit"], ["mouseup", "Mouse Up"], ["input", "Action"], ["input", "Validate"]], (xt) => xt.target.value)) : D.addEventListener("input", function(xt) {
                R.setValue(e, {
                  value: it(!0)
                });
              }), this.data.combo && this._setTextStyle(D), this._setBackgroundColor(D), this._setDefaultPropertiesFromJS(D), this.container.append(D), this.container;
            }
          }
          class p extends v {
            constructor(R) {
              const {
                data: e,
                elements: f
              } = R;
              super(R, {
                isRenderable: v._hasPopupData(e)
              }), this.elements = f;
            }
            render() {
              this.container.classList.add("popupAnnotation");
              const R = new r({
                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 f of this.elements)
                f.popup = R, e.push(f.data.id), f.addHighlightArea();
              return this.container.setAttribute("aria-controls", e.map((f) => `${c.AnnotationPrefix}${f}`).join(",")), this.container;
            }
          }
          class r {
            constructor({
              container: R,
              color: e,
              elements: f,
              titleObj: D,
              modificationDate: j,
              contentsObj: q,
              richText: it,
              parent: mt,
              rect: kt,
              parentRect: xt,
              open: zt
            }) {
              I(this, Ut);
              I(this, Ht);
              I(this, Vt);
              I(this, $t);
              I(this, N, null);
              I(this, tt, W(this, Ut, Li).bind(this));
              I(this, Q, W(this, $t, oi).bind(this));
              I(this, nt, W(this, Vt, ai).bind(this));
              I(this, ct, W(this, Ht, Fe).bind(this));
              I(this, yt, null);
              I(this, ut, null);
              I(this, Ft, null);
              I(this, Bt, null);
              I(this, St, null);
              I(this, Dt, null);
              I(this, ft, !1);
              I(this, K, null);
              I(this, J, null);
              I(this, ht, null);
              I(this, Et, null);
              I(this, Ct, !1);
              var Rt;
              Z(this, ut, R), Z(this, Et, D), Z(this, Ft, q), Z(this, ht, it), Z(this, St, mt), Z(this, yt, e), Z(this, J, kt), Z(this, Dt, xt), Z(this, Bt, f);
              const Mt = P.PDFDateString.toDateObject(j);
              Mt && Z(this, N, mt.l10n.get("annotation_date_string", {
                date: Mt.toLocaleDateString(),
                time: Mt.toLocaleTimeString()
              })), this.trigger = f.flatMap((jt) => jt.getElementsToTriggerPopup());
              for (const jt of this.trigger)
                jt.addEventListener("click", t(this, ct)), jt.addEventListener("mouseenter", t(this, nt)), jt.addEventListener("mouseleave", t(this, Q)), jt.classList.add("popupTriggerArea");
              for (const jt of f)
                (Rt = jt.container) == null || Rt.addEventListener("keydown", t(this, tt));
              t(this, ut).hidden = !0, zt && W(this, Ht, Fe).call(this);
            }
            render() {
              if (t(this, K))
                return;
              const {
                page: {
                  view: R
                },
                viewport: {
                  rawDims: {
                    pageWidth: e,
                    pageHeight: f,
                    pageX: D,
                    pageY: j
                  }
                }
              } = t(this, St), q = Z(this, K, document.createElement("div"));
              if (q.className = "popup", t(this, yt)) {
                const ie = q.style.outlineColor = c.Util.makeHexColor(...t(this, yt));
                CSS.supports("background-color", "color-mix(in srgb, red 30%, white)") ? q.style.backgroundColor = `color-mix(in srgb, ${ie} 30%, white)` : q.style.backgroundColor = c.Util.makeHexColor(...t(this, yt).map((oe) => Math.floor(0.7 * (255 - oe) + oe)));
              }
              const it = document.createElement("span");
              it.className = "header";
              const mt = document.createElement("h1");
              if (it.append(mt), {
                dir: mt.dir,
                str: mt.textContent
              } = t(this, Et), q.append(it), t(this, N)) {
                const ie = document.createElement("span");
                ie.classList.add("popupDate"), t(this, N).then((ne) => {
                  ie.textContent = ne;
                }), it.append(ie);
              }
              const kt = t(this, Ft), xt = t(this, ht);
              if (xt != null && xt.str && (!(kt != null && kt.str) || kt.str === xt.str))
                B.XfaLayer.render({
                  xfaHtml: xt.html,
                  intent: "richText",
                  div: q
                }), q.lastChild.classList.add("richText", "popupContent");
              else {
                const ie = this._formatContents(kt);
                q.append(ie);
              }
              let zt = !!t(this, Dt), Mt = zt ? t(this, Dt) : t(this, J);
              for (const ie of t(this, Bt))
                if (!Mt || c.Util.intersect(ie.data.rect, Mt) !== null) {
                  Mt = ie.data.rect, zt = !0;
                  break;
                }
              const Rt = c.Util.normalizeRect([Mt[0], R[3] - Mt[1] + R[1], Mt[2], R[3] - Mt[3] + R[1]]), qt = zt ? Mt[2] - Mt[0] + 5 : 0, Kt = Rt[0] + qt, Qt = Rt[1], {
                style: se
              } = t(this, ut);
              se.left = `${100 * (Kt - D) / e}%`, se.top = `${100 * (Qt - j) / f}%`, t(this, ut).append(q);
            }
            _formatContents({
              str: R,
              dir: e
            }) {
              const f = document.createElement("p");
              f.classList.add("popupContent"), f.dir = e;
              const D = R.split(/(?:\r\n?|\n)/);
              for (let j = 0, q = D.length; j < q; ++j) {
                const it = D[j];
                f.append(document.createTextNode(it)), j < q - 1 && f.append(document.createElement("br"));
              }
              return f;
            }
            forceHide() {
              Z(this, Ct, this.isVisible), t(this, Ct) && (t(this, ut).hidden = !0);
            }
            maybeShow() {
              t(this, Ct) && (Z(this, Ct, !1), t(this, ut).hidden = !1);
            }
            get isVisible() {
              return t(this, ut).hidden === !1;
            }
          }
          N = new WeakMap(), tt = new WeakMap(), Q = new WeakMap(), nt = new WeakMap(), ct = new WeakMap(), yt = new WeakMap(), ut = new WeakMap(), Ft = new WeakMap(), Bt = new WeakMap(), St = new WeakMap(), Dt = new WeakMap(), ft = new WeakMap(), K = new WeakMap(), J = new WeakMap(), ht = new WeakMap(), Et = new WeakMap(), Ct = new WeakMap(), Ut = new WeakSet(), Li = function(R) {
            R.altKey || R.shiftKey || R.ctrlKey || R.metaKey || (R.key === "Enter" || R.key === "Escape" && t(this, ft)) && W(this, Ht, Fe).call(this);
          }, Ht = new WeakSet(), Fe = function() {
            Z(this, ft, !t(this, ft)), t(this, ft) ? (W(this, Vt, ai).call(this), t(this, ut).addEventListener("click", t(this, ct)), t(this, ut).addEventListener("keydown", t(this, tt))) : (W(this, $t, oi).call(this), t(this, ut).removeEventListener("click", t(this, ct)), t(this, ut).removeEventListener("keydown", t(this, tt)));
          }, Vt = new WeakSet(), ai = function() {
            t(this, K) || this.render(), this.isVisible ? t(this, ft) && t(this, ut).classList.add("focused") : (t(this, ut).hidden = !1, t(this, ut).style.zIndex = parseInt(t(this, ut).style.zIndex) + 1e3);
          }, $t = new WeakSet(), oi = function() {
            t(this, ut).classList.remove("focused"), !(t(this, ft) || !this.isVisible) && (t(this, ut).hidden = !0, t(this, ut).style.zIndex = parseInt(t(this, ut).style.zIndex) - 1e3);
          };
          class x extends v {
            constructor(R) {
              super(R, {
                isRenderable: !0,
                ignoreBorder: !0
              }), this.textContent = R.data.textContent, this.textPosition = R.data.textPosition, this.annotationEditorType = c.AnnotationEditorType.FREETEXT;
            }
            render() {
              if (this.container.classList.add("freeTextAnnotation"), this.textContent) {
                const R = document.createElement("div");
                R.classList.add("annotationTextContent"), R.setAttribute("role", "comment");
                for (const e of this.textContent) {
                  const f = document.createElement("span");
                  f.textContent = e, R.append(f);
                }
                this.container.append(R);
              }
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this._editOnDoubleClick(), this.container;
            }
          }
          d.FreeTextAnnotationElement = x;
          class m extends v {
            constructor(e) {
              super(e, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              I(this, Y, null);
            }
            render() {
              this.container.classList.add("lineAnnotation");
              const e = this.data, {
                width: f,
                height: D
              } = O(e.rect), j = this.svgFactory.create(f, D, !0), q = Z(this, Y, this.svgFactory.createElement("svg:line"));
              return q.setAttribute("x1", e.rect[2] - e.lineCoordinates[0]), q.setAttribute("y1", e.rect[3] - e.lineCoordinates[1]), q.setAttribute("x2", e.rect[2] - e.lineCoordinates[2]), q.setAttribute("y2", e.rect[3] - e.lineCoordinates[3]), q.setAttribute("stroke-width", e.borderStyle.width || 1), q.setAttribute("stroke", "transparent"), q.setAttribute("fill", "transparent"), j.append(q), this.container.append(j), !e.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return t(this, Y);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          Y = new WeakMap();
          class U extends v {
            constructor(e) {
              super(e, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              I(this, G, null);
            }
            render() {
              this.container.classList.add("squareAnnotation");
              const e = this.data, {
                width: f,
                height: D
              } = O(e.rect), j = this.svgFactory.create(f, D, !0), q = e.borderStyle.width, it = Z(this, G, this.svgFactory.createElement("svg:rect"));
              return it.setAttribute("x", q / 2), it.setAttribute("y", q / 2), it.setAttribute("width", f - q), it.setAttribute("height", D - q), it.setAttribute("stroke-width", q || 1), it.setAttribute("stroke", "transparent"), it.setAttribute("fill", "transparent"), j.append(it), this.container.append(j), !e.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return t(this, G);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          G = new WeakMap();
          class z extends v {
            constructor(e) {
              super(e, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              I(this, bt, null);
            }
            render() {
              this.container.classList.add("circleAnnotation");
              const e = this.data, {
                width: f,
                height: D
              } = O(e.rect), j = this.svgFactory.create(f, D, !0), q = e.borderStyle.width, it = Z(this, bt, this.svgFactory.createElement("svg:ellipse"));
              return it.setAttribute("cx", f / 2), it.setAttribute("cy", D / 2), it.setAttribute("rx", f / 2 - q / 2), it.setAttribute("ry", D / 2 - q / 2), it.setAttribute("stroke-width", q || 1), it.setAttribute("stroke", "transparent"), it.setAttribute("fill", "transparent"), j.append(it), this.container.append(j), !e.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return t(this, bt);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          bt = new WeakMap();
          class C extends v {
            constructor(e) {
              super(e, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              I(this, At, null);
              this.containerClassName = "polylineAnnotation", this.svgElementName = "svg:polyline";
            }
            render() {
              this.container.classList.add(this.containerClassName);
              const e = this.data, {
                width: f,
                height: D
              } = O(e.rect), j = this.svgFactory.create(f, D, !0);
              let q = [];
              for (const mt of e.vertices) {
                const kt = mt.x - e.rect[0], xt = e.rect[3] - mt.y;
                q.push(kt + "," + xt);
              }
              q = q.join(" ");
              const it = Z(this, At, this.svgFactory.createElement(this.svgElementName));
              return it.setAttribute("points", q), it.setAttribute("stroke-width", e.borderStyle.width || 1), it.setAttribute("stroke", "transparent"), it.setAttribute("fill", "transparent"), j.append(it), this.container.append(j), !e.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
            getElementsToTriggerPopup() {
              return t(this, At);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          At = new WeakMap();
          class V extends C {
            constructor(R) {
              super(R), this.containerClassName = "polygonAnnotation", this.svgElementName = "svg:polygon";
            }
          }
          class st extends v {
            constructor(R) {
              super(R, {
                isRenderable: !0,
                ignoreBorder: !0
              });
            }
            render() {
              return this.container.classList.add("caretAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
          }
          class at extends v {
            constructor(e) {
              super(e, {
                isRenderable: !0,
                ignoreBorder: !0
              });
              I(this, te, []);
              this.containerClassName = "inkAnnotation", this.svgElementName = "svg:polyline", this.annotationEditorType = c.AnnotationEditorType.INK;
            }
            render() {
              this.container.classList.add(this.containerClassName);
              const e = this.data, {
                width: f,
                height: D
              } = O(e.rect), j = this.svgFactory.create(f, D, !0);
              for (const q of e.inkLists) {
                let it = [];
                for (const kt of q) {
                  const xt = kt.x - e.rect[0], zt = e.rect[3] - kt.y;
                  it.push(`${xt},${zt}`);
                }
                it = it.join(" ");
                const mt = this.svgFactory.createElement(this.svgElementName);
                t(this, te).push(mt), mt.setAttribute("points", it), mt.setAttribute("stroke-width", e.borderStyle.width || 1), mt.setAttribute("stroke", "transparent"), mt.setAttribute("fill", "transparent"), !e.popupRef && this.hasPopupData && this._createPopup(), j.append(mt);
              }
              return this.container.append(j), this.container;
            }
            getElementsToTriggerPopup() {
              return t(this, te);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          te = new WeakMap(), d.InkAnnotationElement = at;
          class H extends v {
            constructor(R) {
              super(R, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("highlightAnnotation"), this.container;
            }
          }
          class lt extends v {
            constructor(R) {
              super(R, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("underlineAnnotation"), this.container;
            }
          }
          class gt extends v {
            constructor(R) {
              super(R, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("squigglyAnnotation"), this.container;
            }
          }
          class wt extends v {
            constructor(R) {
              super(R, {
                isRenderable: !0,
                ignoreBorder: !0,
                createQuadrilaterals: !0
              });
            }
            render() {
              return !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container.classList.add("strikeoutAnnotation"), this.container;
            }
          }
          class Pt extends v {
            constructor(R) {
              super(R, {
                isRenderable: !0,
                ignoreBorder: !0
              });
            }
            render() {
              return this.container.classList.add("stampAnnotation"), !this.data.popupRef && this.hasPopupData && this._createPopup(), this.container;
            }
          }
          d.StampAnnotationElement = Pt;
          class S extends v {
            constructor(e) {
              var j;
              super(e, {
                isRenderable: !0
              });
              I(this, $);
              I(this, Zt, null);
              const {
                filename: f,
                content: D
              } = this.data.file;
              this.filename = (0, P.getFilenameFromUrl)(f, !0), this.content = D, (j = this.linkService.eventBus) == null || j.dispatch("fileattachmentannotation", {
                source: this,
                filename: f,
                content: D
              });
            }
            render() {
              this.container.classList.add("fileAttachmentAnnotation");
              const {
                container: e,
                data: f
              } = this;
              let D;
              f.hasAppearance || f.fillAlpha === 0 ? D = document.createElement("div") : (D = document.createElement("img"), D.src = `${this.imageResourcesPath}annotation-${/paperclip/i.test(f.name) ? "paperclip" : "pushpin"}.svg`, f.fillAlpha && f.fillAlpha < 1 && (D.style = `filter: opacity(${Math.round(f.fillAlpha * 100)}%);`)), D.addEventListener("dblclick", W(this, $, li).bind(this)), Z(this, Zt, D);
              const {
                isMac: j
              } = c.FeatureTest.platform;
              return e.addEventListener("keydown", (q) => {
                q.key === "Enter" && (j ? q.metaKey : q.ctrlKey) && W(this, $, li).call(this);
              }), !f.popupRef && this.hasPopupData ? this._createPopup() : D.classList.add("popupTriggerArea"), e.append(D), e;
            }
            getElementsToTriggerPopup() {
              return t(this, Zt);
            }
            addHighlightArea() {
              this.container.classList.add("highlightArea");
            }
          }
          Zt = new WeakMap(), $ = new WeakSet(), li = function() {
            var e;
            (e = this.downloadManager) == null || e.openOrDownloadData(this.container, this.content, this.filename);
          };
          class i {
            constructor({
              div: R,
              accessibilityManager: e,
              annotationCanvasMap: f,
              l10n: D,
              page: j,
              viewport: q
            }) {
              I(this, Nt);
              I(this, _t);
              I(this, Lt, null);
              I(this, Tt, null);
              I(this, Ot, /* @__PURE__ */ new Map());
              this.div = R, Z(this, Lt, e), Z(this, Tt, f), this.l10n = D, this.page = j, this.viewport = q, this.zIndex = 0, this.l10n || (this.l10n = pt.NullL10n);
            }
            async render(R) {
              const {
                annotations: e
              } = R, f = this.div;
              (0, P.setLayerDimensions)(f, this.viewport);
              const D = /* @__PURE__ */ new Map(), j = {
                data: null,
                layer: f,
                linkService: R.linkService,
                downloadManager: R.downloadManager,
                imageResourcesPath: R.imageResourcesPath || "",
                renderForms: R.renderForms !== !1,
                svgFactory: new P.DOMSVGFactory(),
                annotationStorage: R.annotationStorage || new rt.AnnotationStorage(),
                enableScripting: R.enableScripting === !0,
                hasJSActions: R.hasJSActions,
                fieldObjects: R.fieldObjects,
                parent: this,
                elements: null
              };
              for (const q of e) {
                if (q.noHTML)
                  continue;
                const it = q.annotationType === c.AnnotationType.POPUP;
                if (it) {
                  const xt = D.get(q.id);
                  if (!xt)
                    continue;
                  j.elements = xt;
                } else {
                  const {
                    width: xt,
                    height: zt
                  } = O(q.rect);
                  if (xt <= 0 || zt <= 0)
                    continue;
                }
                j.data = q;
                const mt = T.create(j);
                if (!mt.isRenderable)
                  continue;
                if (!it && q.popupRef) {
                  const xt = D.get(q.popupRef);
                  xt ? xt.push(mt) : D.set(q.popupRef, [mt]);
                }
                mt.annotationEditorType > 0 && t(this, Ot).set(mt.data.id, mt);
                const kt = mt.render();
                q.hidden && (kt.style.visibility = "hidden"), W(this, Nt, Oi).call(this, kt, q.id);
              }
              W(this, _t, ci).call(this), await this.l10n.translate(f);
            }
            update({
              viewport: R
            }) {
              const e = this.div;
              this.viewport = R, (0, P.setLayerDimensions)(e, {
                rotation: R.rotation
              }), W(this, _t, ci).call(this), e.hidden = !1;
            }
            getEditableAnnotations() {
              return Array.from(t(this, Ot).values());
            }
            getEditableAnnotation(R) {
              return t(this, Ot).get(R);
            }
          }
          Lt = new WeakMap(), Tt = new WeakMap(), Ot = new WeakMap(), Nt = new WeakSet(), Oi = function(R, e) {
            var D;
            const f = R.firstChild || R;
            f.id = `${c.AnnotationPrefix}${e}`, this.div.append(R), (D = t(this, Lt)) == null || D.moveElementInDOM(this.div, R, f, !1);
          }, _t = new WeakSet(), ci = function() {
            if (!t(this, Tt))
              return;
            const R = this.div;
            for (const [e, f] of t(this, Tt)) {
              const D = R.querySelector(`[data-annotation-id="${e}"]`);
              if (!D)
                continue;
              const {
                firstChild: j
              } = D;
              j ? j.nodeName === "CANVAS" ? j.replaceWith(f) : j.before(f) : D.append(f);
            }
            t(this, Tt).clear();
          }, d.AnnotationLayer = i;
        },
        /* 30 */
        /***/
        (dt, d) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.ColorConverters = void 0;
          function et(rt) {
            return Math.floor(Math.max(0, Math.min(1, rt)) * 255).toString(16).padStart(2, "0");
          }
          function c(rt) {
            return Math.max(0, Math.min(255, 255 * rt));
          }
          class P {
            static CMYK_G([X, pt, B, F]) {
              return ["G", 1 - Math.min(1, 0.3 * X + 0.59 * B + 0.11 * pt + F)];
            }
            static G_CMYK([X]) {
              return ["CMYK", 0, 0, 0, 1 - X];
            }
            static G_RGB([X]) {
              return ["RGB", X, X, X];
            }
            static G_rgb([X]) {
              return X = c(X), [X, X, X];
            }
            static G_HTML([X]) {
              const pt = et(X);
              return `#${pt}${pt}${pt}`;
            }
            static RGB_G([X, pt, B]) {
              return ["G", 0.3 * X + 0.59 * pt + 0.11 * B];
            }
            static RGB_rgb(X) {
              return X.map(c);
            }
            static RGB_HTML(X) {
              return `#${X.map(et).join("")}`;
            }
            static T_HTML() {
              return "#00000000";
            }
            static T_rgb() {
              return [null];
            }
            static CMYK_RGB([X, pt, B, F]) {
              return ["RGB", 1 - Math.min(1, X + F), 1 - Math.min(1, B + F), 1 - Math.min(1, pt + F)];
            }
            static CMYK_rgb([X, pt, B, F]) {
              return [c(1 - Math.min(1, X + F)), c(1 - Math.min(1, B + F)), c(1 - Math.min(1, pt + F))];
            }
            static CMYK_HTML(X) {
              const pt = this.CMYK_RGB(X).slice(1);
              return this.RGB_HTML(pt);
            }
            static RGB_CMYK([X, pt, B]) {
              const F = 1 - X, g = 1 - pt, L = 1 - B, O = Math.min(F, g, L);
              return ["CMYK", F, g, L, O];
            }
          }
          d.ColorConverters = P;
        },
        /* 31 */
        /***/
        (dt, d) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.NullL10n = void 0, d.getL10nFallback = c;
          const et = {
            of_pages: "of {{pagesCount}}",
            page_of_pages: "({{pageNumber}} of {{pagesCount}})",
            document_properties_kb: "{{size_kb}} KB ({{size_b}} bytes)",
            document_properties_mb: "{{size_mb}} MB ({{size_b}} bytes)",
            document_properties_date_string: "{{date}}, {{time}}",
            document_properties_page_size_unit_inches: "in",
            document_properties_page_size_unit_millimeters: "mm",
            document_properties_page_size_orientation_portrait: "portrait",
            document_properties_page_size_orientation_landscape: "landscape",
            document_properties_page_size_name_a3: "A3",
            document_properties_page_size_name_a4: "A4",
            document_properties_page_size_name_letter: "Letter",
            document_properties_page_size_name_legal: "Legal",
            document_properties_page_size_dimension_string: "{{width}} × {{height}} {{unit}} ({{orientation}})",
            document_properties_page_size_dimension_name_string: "{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})",
            document_properties_linearized_yes: "Yes",
            document_properties_linearized_no: "No",
            additional_layers: "Additional Layers",
            page_landmark: "Page {{page}}",
            thumb_page_title: "Page {{page}}",
            thumb_page_canvas: "Thumbnail of Page {{page}}",
            find_reached_top: "Reached top of document, continued from bottom",
            find_reached_bottom: "Reached end of document, continued from top",
            "find_match_count[one]": "{{current}} of {{total}} match",
            "find_match_count[other]": "{{current}} of {{total}} matches",
            "find_match_count_limit[one]": "More than {{limit}} match",
            "find_match_count_limit[other]": "More than {{limit}} matches",
            find_not_found: "Phrase not found",
            page_scale_width: "Page Width",
            page_scale_fit: "Page Fit",
            page_scale_auto: "Automatic Zoom",
            page_scale_actual: "Actual Size",
            page_scale_percent: "{{scale}}%",
            loading_error: "An error occurred while loading the PDF.",
            invalid_file_error: "Invalid or corrupted PDF file.",
            missing_file_error: "Missing PDF file.",
            unexpected_response_error: "Unexpected server response.",
            rendering_error: "An error occurred while rendering the page.",
            annotation_date_string: "{{date}}, {{time}}",
            printing_not_supported: "Warning: Printing is not fully supported by this browser.",
            printing_not_ready: "Warning: The PDF is not fully loaded for printing.",
            web_fonts_disabled: "Web fonts are disabled: unable to use embedded PDF fonts.",
            free_text2_default_content: "Start typing…",
            editor_free_text2_aria_label: "Text Editor",
            editor_ink2_aria_label: "Draw Editor",
            editor_ink_canvas_aria_label: "User-created image",
            editor_alt_text_button_label: "Alt text",
            editor_alt_text_edit_button_label: "Edit alt text",
            editor_alt_text_decorative_tooltip: "Marked as decorative"
          };
          et.print_progress_percent = "{{progress}}%";
          function c(X, pt) {
            switch (X) {
              case "find_match_count":
                X = `find_match_count[${pt.total === 1 ? "one" : "other"}]`;
                break;
              case "find_match_count_limit":
                X = `find_match_count_limit[${pt.limit === 1 ? "one" : "other"}]`;
                break;
            }
            return et[X] || "";
          }
          function P(X, pt) {
            return pt ? X.replaceAll(/\{\{\s*(\w+)\s*\}\}/g, (B, F) => F in pt ? pt[F] : "{{" + F + "}}") : X;
          }
          const rt = {
            async getLanguage() {
              return "en-us";
            },
            async getDirection() {
              return "ltr";
            },
            async get(X, pt = null, B = c(X, pt)) {
              return P(B, pt);
            },
            async translate(X) {
            }
          };
          d.NullL10n = rt;
        },
        /* 32 */
        /***/
        (dt, d, et) => {
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.XfaLayer = void 0;
          var c = et(25);
          class P {
            static setupStorage(X, pt, B, F, g) {
              const L = F.getValue(pt, {
                value: null
              });
              switch (B.name) {
                case "textarea":
                  if (L.value !== null && (X.textContent = L.value), g === "print")
                    break;
                  X.addEventListener("input", (O) => {
                    F.setValue(pt, {
                      value: O.target.value
                    });
                  });
                  break;
                case "input":
                  if (B.attributes.type === "radio" || B.attributes.type === "checkbox") {
                    if (L.value === B.attributes.xfaOn ? X.setAttribute("checked", !0) : L.value === B.attributes.xfaOff && X.removeAttribute("checked"), g === "print")
                      break;
                    X.addEventListener("change", (O) => {
                      F.setValue(pt, {
                        value: O.target.checked ? O.target.getAttribute("xfaOn") : O.target.getAttribute("xfaOff")
                      });
                    });
                  } else {
                    if (L.value !== null && X.setAttribute("value", L.value), g === "print")
                      break;
                    X.addEventListener("input", (O) => {
                      F.setValue(pt, {
                        value: O.target.value
                      });
                    });
                  }
                  break;
                case "select":
                  if (L.value !== null) {
                    X.setAttribute("value", L.value);
                    for (const O of B.children)
                      O.attributes.value === L.value ? O.attributes.selected = !0 : O.attributes.hasOwnProperty("selected") && delete O.attributes.selected;
                  }
                  X.addEventListener("input", (O) => {
                    const T = O.target.options, v = T.selectedIndex === -1 ? "" : T[T.selectedIndex].value;
                    F.setValue(pt, {
                      value: v
                    });
                  });
                  break;
              }
            }
            static setAttributes({
              html: X,
              element: pt,
              storage: B = null,
              intent: F,
              linkService: g
            }) {
              const {
                attributes: L
              } = pt, O = X instanceof HTMLAnchorElement;
              L.type === "radio" && (L.name = `${L.name}-${F}`);
              for (const [T, v] of Object.entries(L))
                if (v != null)
                  switch (T) {
                    case "class":
                      v.length && X.setAttribute(T, v.join(" "));
                      break;
                    case "dataId":
                      break;
                    case "id":
                      X.setAttribute("data-element-id", v);
                      break;
                    case "style":
                      Object.assign(X.style, v);
                      break;
                    case "textContent":
                      X.textContent = v;
                      break;
                    default:
                      (!O || T !== "href" && T !== "newWindow") && X.setAttribute(T, v);
                  }
              O && g.addLinkAttributes(X, L.href, L.newWindow), B && L.dataId && this.setupStorage(X, L.dataId, pt, B);
            }
            static render(X) {
              var A;
              const pt = X.annotationStorage, B = X.linkService, F = X.xfaHtml, g = X.intent || "display", L = document.createElement(F.name);
              F.attributes && this.setAttributes({
                html: L,
                element: F,
                intent: g,
                linkService: B
              });
              const O = [[F, -1, L]], T = X.div;
              if (T.append(L), X.viewport) {
                const u = `matrix(${X.viewport.transform.join(",")})`;
                T.style.transform = u;
              }
              g !== "richText" && T.setAttribute("class", "xfaLayer xfaFont");
              const v = [];
              for (; O.length > 0; ) {
                const [u, b, E] = O.at(-1);
                if (b + 1 === u.children.length) {
                  O.pop();
                  continue;
                }
                const w = u.children[++O.at(-1)[1]];
                if (w === null)
                  continue;
                const {
                  name: y
                } = w;
                if (y === "#text") {
                  const l = document.createTextNode(w.value);
                  v.push(l), E.append(l);
                  continue;
                }
                const a = (A = w == null ? void 0 : w.attributes) != null && A.xmlns ? document.createElementNS(w.attributes.xmlns, y) : document.createElement(y);
                if (E.append(a), w.attributes && this.setAttributes({
                  html: a,
                  element: w,
                  storage: pt,
                  intent: g,
                  linkService: B
                }), w.children && w.children.length > 0)
                  O.push([w, -1, a]);
                else if (w.value) {
                  const l = document.createTextNode(w.value);
                  c.XfaText.shouldBuildText(y) && v.push(l), a.append(l);
                }
              }
              for (const u of T.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))
                u.setAttribute("readOnly", !0);
              return {
                textDivs: v
              };
            }
            static update(X) {
              const pt = `matrix(${X.viewport.transform.join(",")})`;
              X.div.style.transform = pt, X.div.hidden = !1;
            }
          }
          d.XfaLayer = P;
        },
        /* 33 */
        /***/
        (dt, d, et) => {
          var F, g, L, O, T, v, A, u, b, E, w, y, a, l, k, Ni, r, Bi, m, Ui, z, ji, V, hi, at, Hi, lt, di, wt, Wi, S, Gi, n, zi, o, Xi, _, Vi, N, ae, Q, ui, ct, Me, ut, Re, Bt, fe, Dt, fi, K, De, ht, qi, Ct, pi, Gt, $i, Xt, Yi, Wt, gi, ot, Ie, G, pe;
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.InkEditor = void 0;
          var c = et(1), P = et(4), rt = et(29), X = et(6), pt = et(5);
          const At = class At extends P.AnnotationEditor {
            constructor($) {
              super({
                ...$,
                name: "inkEditor"
              });
              I(this, k);
              I(this, r);
              I(this, m);
              I(this, z);
              I(this, V);
              I(this, at);
              I(this, lt);
              I(this, wt);
              I(this, S);
              I(this, n);
              I(this, o);
              I(this, _);
              I(this, N);
              I(this, Q);
              I(this, ct);
              I(this, ut);
              I(this, Bt);
              I(this, Dt);
              I(this, K);
              I(this, Xt);
              I(this, Wt);
              I(this, ot);
              I(this, G);
              I(this, F, 0);
              I(this, g, 0);
              I(this, L, this.canvasPointermove.bind(this));
              I(this, O, this.canvasPointerleave.bind(this));
              I(this, T, this.canvasPointerup.bind(this));
              I(this, v, this.canvasPointerdown.bind(this));
              I(this, A, new Path2D());
              I(this, u, !1);
              I(this, b, !1);
              I(this, E, !1);
              I(this, w, null);
              I(this, y, 0);
              I(this, a, 0);
              I(this, l, null);
              this.color = $.color || null, this.thickness = $.thickness || null, this.opacity = $.opacity || null, this.paths = [], this.bezierPath2D = [], this.allRawPaths = [], this.currentPath = [], this.scaleFactor = 1, this.translationX = this.translationY = 0, this.x = 0, this.y = 0, this._willKeepAspectRatio = !0;
            }
            static initialize($) {
              P.AnnotationEditor.initialize($, {
                strings: ["editor_ink_canvas_aria_label", "editor_ink2_aria_label"]
              });
            }
            static updateDefaultParams($, vt) {
              switch ($) {
                case c.AnnotationEditorParamsType.INK_THICKNESS:
                  At._defaultThickness = vt;
                  break;
                case c.AnnotationEditorParamsType.INK_COLOR:
                  At._defaultColor = vt;
                  break;
                case c.AnnotationEditorParamsType.INK_OPACITY:
                  At._defaultOpacity = vt / 100;
                  break;
              }
            }
            updateParams($, vt) {
              switch ($) {
                case c.AnnotationEditorParamsType.INK_THICKNESS:
                  W(this, k, Ni).call(this, vt);
                  break;
                case c.AnnotationEditorParamsType.INK_COLOR:
                  W(this, r, Bi).call(this, vt);
                  break;
                case c.AnnotationEditorParamsType.INK_OPACITY:
                  W(this, m, Ui).call(this, vt);
                  break;
              }
            }
            static get defaultPropertiesToUpdate() {
              return [[c.AnnotationEditorParamsType.INK_THICKNESS, At._defaultThickness], [c.AnnotationEditorParamsType.INK_COLOR, At._defaultColor || P.AnnotationEditor._defaultLineColor], [c.AnnotationEditorParamsType.INK_OPACITY, Math.round(At._defaultOpacity * 100)]];
            }
            get propertiesToUpdate() {
              return [[c.AnnotationEditorParamsType.INK_THICKNESS, this.thickness || At._defaultThickness], [c.AnnotationEditorParamsType.INK_COLOR, this.color || At._defaultColor || P.AnnotationEditor._defaultLineColor], [c.AnnotationEditorParamsType.INK_OPACITY, Math.round(100 * (this.opacity ?? At._defaultOpacity))]];
            }
            rebuild() {
              this.parent && (super.rebuild(), this.div !== null && (this.canvas || (W(this, ct, Me).call(this), W(this, ut, Re).call(this)), this.isAttachedToDOM || (this.parent.add(this), W(this, Bt, fe).call(this)), W(this, G, pe).call(this)));
            }
            remove() {
              this.canvas !== null && (this.isEmpty() || this.commit(), this.canvas.width = this.canvas.height = 0, this.canvas.remove(), this.canvas = null, t(this, w).disconnect(), Z(this, w, null), super.remove());
            }
            setParent($) {
              !this.parent && $ ? this._uiManager.removeShouldRescale(this) : this.parent && $ === null && this._uiManager.addShouldRescale(this), super.setParent($);
            }
            onScaleChanging() {
              const [$, vt] = this.parentDimensions, Lt = this.width * $, Tt = this.height * vt;
              this.setDimensions(Lt, Tt);
            }
            enableEditMode() {
              t(this, u) || this.canvas === null || (super.enableEditMode(), this._isDraggable = !1, this.canvas.addEventListener("pointerdown", t(this, v)));
            }
            disableEditMode() {
              !this.isInEditMode() || this.canvas === null || (super.disableEditMode(), this._isDraggable = !this.isEmpty(), this.div.classList.remove("editing"), this.canvas.removeEventListener("pointerdown", t(this, v)));
            }
            onceAdded() {
              this._isDraggable = !this.isEmpty();
            }
            isEmpty() {
              return this.paths.length === 0 || this.paths.length === 1 && this.paths[0].length === 0;
            }
            commit() {
              t(this, u) || (super.commit(), this.isEditing = !1, this.disableEditMode(), this.setInForeground(), Z(this, u, !0), this.div.classList.add("disabled"), W(this, G, pe).call(this, !0), this.makeResizable(), this.parent.addInkEditorIfNeeded(!0), this.moveInDOM(), this.div.focus({
                preventScroll: !0
              }));
            }
            focusin($) {
              this._focusEventsAllowed && (super.focusin($), this.enableEditMode());
            }
            canvasPointerdown($) {
              $.button !== 0 || !this.isInEditMode() || t(this, u) || (this.setInForeground(), $.preventDefault(), $.type !== "mouse" && this.div.focus(), W(this, at, Hi).call(this, $.offsetX, $.offsetY));
            }
            canvasPointermove($) {
              $.preventDefault(), W(this, lt, di).call(this, $.offsetX, $.offsetY);
            }
            canvasPointerup($) {
              $.preventDefault(), W(this, Q, ui).call(this, $);
            }
            canvasPointerleave($) {
              W(this, Q, ui).call(this, $);
            }
            get isResizable() {
              return !this.isEmpty() && t(this, u);
            }
            render() {
              if (this.div)
                return this.div;
              let $, vt;
              this.width && ($ = this.x, vt = this.y), super.render(), P.AnnotationEditor._l10nPromise.get("editor_ink2_aria_label").then((Jt) => {
                var _t;
                return (_t = this.div) == null ? void 0 : _t.setAttribute("aria-label", Jt);
              });
              const [Lt, Tt, Ot, Nt] = W(this, z, ji).call(this);
              if (this.setAt(Lt, Tt, 0, 0), this.setDims(Ot, Nt), W(this, ct, Me).call(this), this.width) {
                const [Jt, _t] = this.parentDimensions;
                this.setAspectRatio(this.width * Jt, this.height * _t), this.setAt($ * Jt, vt * _t, this.width * Jt, this.height * _t), Z(this, E, !0), W(this, Bt, fe).call(this), this.setDims(this.width * Jt, this.height * _t), W(this, N, ae).call(this), this.div.classList.add("disabled");
              } else
                this.div.classList.add("editing"), this.enableEditMode();
              return W(this, ut, Re).call(this), this.div;
            }
            setDimensions($, vt) {
              const Lt = Math.round($), Tt = Math.round(vt);
              if (t(this, y) === Lt && t(this, a) === Tt)
                return;
              Z(this, y, Lt), Z(this, a, Tt), this.canvas.style.visibility = "hidden";
              const [Ot, Nt] = this.parentDimensions;
              this.width = $ / Ot, this.height = vt / Nt, this.fixAndSetPosition(), t(this, u) && W(this, Dt, fi).call(this, $, vt), W(this, Bt, fe).call(this), W(this, N, ae).call(this), this.canvas.style.visibility = "visible", this.fixDims();
            }
            static deserialize($, vt, Lt) {
              var j, q, it;
              if ($ instanceof rt.InkAnnotationElement)
                return null;
              const Tt = super.deserialize($, vt, Lt);
              Tt.thickness = $.thickness, Tt.color = c.Util.makeHexColor(...$.color), Tt.opacity = $.opacity;
              const [Ot, Nt] = Tt.pageDimensions, Jt = Tt.width * Ot, _t = Tt.height * Nt, Yt = Tt.parentScale, It = $.thickness / 2;
              Z(Tt, u, !0), Z(Tt, y, Math.round(Jt)), Z(Tt, a, Math.round(_t));
              const {
                paths: R,
                rect: e,
                rotation: f
              } = $;
              for (let {
                bezier: mt
              } of R) {
                mt = W(j = At, Gt, $i).call(j, mt, e, f);
                const kt = [];
                Tt.paths.push(kt);
                let xt = Yt * (mt[0] - It), zt = Yt * (mt[1] - It);
                for (let Rt = 2, jt = mt.length; Rt < jt; Rt += 6) {
                  const qt = Yt * (mt[Rt] - It), Kt = Yt * (mt[Rt + 1] - It), Qt = Yt * (mt[Rt + 2] - It), se = Yt * (mt[Rt + 3] - It), ie = Yt * (mt[Rt + 4] - It), ne = Yt * (mt[Rt + 5] - It);
                  kt.push([[xt, zt], [qt, Kt], [Qt, se], [ie, ne]]), xt = ie, zt = ne;
                }
                const Mt = W(this, ht, qi).call(this, kt);
                Tt.bezierPath2D.push(Mt);
              }
              const D = W(q = Tt, Wt, gi).call(q);
              return Z(Tt, g, Math.max(P.AnnotationEditor.MIN_SIZE, D[2] - D[0])), Z(Tt, F, Math.max(P.AnnotationEditor.MIN_SIZE, D[3] - D[1])), W(it = Tt, Dt, fi).call(it, Jt, _t), Tt;
            }
            serialize() {
              if (this.isEmpty())
                return null;
              const $ = this.getRect(0, 0), vt = P.AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);
              return {
                annotationType: c.AnnotationEditorType.INK,
                color: vt,
                thickness: this.thickness,
                opacity: this.opacity,
                paths: W(this, Xt, Yi).call(this, this.scaleFactor / this.parentScale, this.translationX, this.translationY, $),
                pageIndex: this.pageIndex,
                rect: $,
                rotation: this.rotation,
                structTreeParentId: this._structTreeParentId
              };
            }
          };
          F = new WeakMap(), g = new WeakMap(), L = new WeakMap(), O = new WeakMap(), T = new WeakMap(), v = new WeakMap(), A = new WeakMap(), u = new WeakMap(), b = new WeakMap(), E = new WeakMap(), w = new WeakMap(), y = new WeakMap(), a = new WeakMap(), l = new WeakMap(), k = new WeakSet(), Ni = function($) {
            const vt = this.thickness;
            this.addCommands({
              cmd: () => {
                this.thickness = $, W(this, G, pe).call(this);
              },
              undo: () => {
                this.thickness = vt, W(this, G, pe).call(this);
              },
              mustExec: !0,
              type: c.AnnotationEditorParamsType.INK_THICKNESS,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, r = new WeakSet(), Bi = function($) {
            const vt = this.color;
            this.addCommands({
              cmd: () => {
                this.color = $, W(this, N, ae).call(this);
              },
              undo: () => {
                this.color = vt, W(this, N, ae).call(this);
              },
              mustExec: !0,
              type: c.AnnotationEditorParamsType.INK_COLOR,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, m = new WeakSet(), Ui = function($) {
            $ /= 100;
            const vt = this.opacity;
            this.addCommands({
              cmd: () => {
                this.opacity = $, W(this, N, ae).call(this);
              },
              undo: () => {
                this.opacity = vt, W(this, N, ae).call(this);
              },
              mustExec: !0,
              type: c.AnnotationEditorParamsType.INK_OPACITY,
              overwriteIfSameType: !0,
              keepUndo: !0
            });
          }, z = new WeakSet(), ji = function() {
            const {
              parentRotation: $,
              parentDimensions: [vt, Lt]
            } = this;
            switch ($) {
              case 90:
                return [0, Lt, Lt, vt];
              case 180:
                return [vt, Lt, vt, Lt];
              case 270:
                return [vt, 0, Lt, vt];
              default:
                return [0, 0, vt, Lt];
            }
          }, V = new WeakSet(), hi = function() {
            const {
              ctx: $,
              color: vt,
              opacity: Lt,
              thickness: Tt,
              parentScale: Ot,
              scaleFactor: Nt
            } = this;
            $.lineWidth = Tt * Ot / Nt, $.lineCap = "round", $.lineJoin = "round", $.miterLimit = 10, $.strokeStyle = `${vt}${(0, pt.opacityToHex)(Lt)}`;
          }, at = new WeakSet(), Hi = function($, vt) {
            this.canvas.addEventListener("contextmenu", X.noContextMenu), this.canvas.addEventListener("pointerleave", t(this, O)), this.canvas.addEventListener("pointermove", t(this, L)), this.canvas.addEventListener("pointerup", t(this, T)), this.canvas.removeEventListener("pointerdown", t(this, v)), this.isEditing = !0, t(this, E) || (Z(this, E, !0), W(this, Bt, fe).call(this), this.thickness || (this.thickness = At._defaultThickness), this.color || (this.color = At._defaultColor || P.AnnotationEditor._defaultLineColor), this.opacity ?? (this.opacity = At._defaultOpacity)), this.currentPath.push([$, vt]), Z(this, b, !1), W(this, V, hi).call(this), Z(this, l, () => {
              W(this, n, zi).call(this), t(this, l) && window.requestAnimationFrame(t(this, l));
            }), window.requestAnimationFrame(t(this, l));
          }, lt = new WeakSet(), di = function($, vt) {
            const [Lt, Tt] = this.currentPath.at(-1);
            if (this.currentPath.length > 1 && $ === Lt && vt === Tt)
              return;
            const Ot = this.currentPath;
            let Nt = t(this, A);
            if (Ot.push([$, vt]), Z(this, b, !0), Ot.length <= 2) {
              Nt.moveTo(...Ot[0]), Nt.lineTo($, vt);
              return;
            }
            Ot.length === 3 && (Z(this, A, Nt = new Path2D()), Nt.moveTo(...Ot[0])), W(this, o, Xi).call(this, Nt, ...Ot.at(-3), ...Ot.at(-2), $, vt);
          }, wt = new WeakSet(), Wi = function() {
            if (this.currentPath.length === 0)
              return;
            const $ = this.currentPath.at(-1);
            t(this, A).lineTo(...$);
          }, S = new WeakSet(), Gi = function($, vt) {
            Z(this, l, null), $ = Math.min(Math.max($, 0), this.canvas.width), vt = Math.min(Math.max(vt, 0), this.canvas.height), W(this, lt, di).call(this, $, vt), W(this, wt, Wi).call(this);
            let Lt;
            if (this.currentPath.length !== 1)
              Lt = W(this, _, Vi).call(this);
            else {
              const _t = [$, vt];
              Lt = [[_t, _t.slice(), _t.slice(), _t]];
            }
            const Tt = t(this, A), Ot = this.currentPath;
            this.currentPath = [], Z(this, A, new Path2D());
            const Nt = () => {
              this.allRawPaths.push(Ot), this.paths.push(Lt), this.bezierPath2D.push(Tt), this.rebuild();
            }, Jt = () => {
              this.allRawPaths.pop(), this.paths.pop(), this.bezierPath2D.pop(), this.paths.length === 0 ? this.remove() : (this.canvas || (W(this, ct, Me).call(this), W(this, ut, Re).call(this)), W(this, G, pe).call(this));
            };
            this.addCommands({
              cmd: Nt,
              undo: Jt,
              mustExec: !0
            });
          }, n = new WeakSet(), zi = function() {
            if (!t(this, b))
              return;
            Z(this, b, !1);
            const $ = Math.ceil(this.thickness * this.parentScale), vt = this.currentPath.slice(-3), Lt = vt.map((Nt) => Nt[0]), Tt = vt.map((Nt) => Nt[1]);
            Math.min(...Lt) - $, Math.max(...Lt) + $, Math.min(...Tt) - $, Math.max(...Tt) + $;
            const {
              ctx: Ot
            } = this;
            Ot.save(), Ot.clearRect(0, 0, this.canvas.width, this.canvas.height);
            for (const Nt of this.bezierPath2D)
              Ot.stroke(Nt);
            Ot.stroke(t(this, A)), Ot.restore();
          }, o = new WeakSet(), Xi = function($, vt, Lt, Tt, Ot, Nt, Jt) {
            const _t = (vt + Tt) / 2, Yt = (Lt + Ot) / 2, It = (Tt + Nt) / 2, R = (Ot + Jt) / 2;
            $.bezierCurveTo(_t + 2 * (Tt - _t) / 3, Yt + 2 * (Ot - Yt) / 3, It + 2 * (Tt - It) / 3, R + 2 * (Ot - R) / 3, It, R);
          }, _ = new WeakSet(), Vi = function() {
            const $ = this.currentPath;
            if ($.length <= 2)
              return [[$[0], $[0], $.at(-1), $.at(-1)]];
            const vt = [];
            let Lt, [Tt, Ot] = $[0];
            for (Lt = 1; Lt < $.length - 2; Lt++) {
              const [e, f] = $[Lt], [D, j] = $[Lt + 1], q = (e + D) / 2, it = (f + j) / 2, mt = [Tt + 2 * (e - Tt) / 3, Ot + 2 * (f - Ot) / 3], kt = [q + 2 * (e - q) / 3, it + 2 * (f - it) / 3];
              vt.push([[Tt, Ot], mt, kt, [q, it]]), [Tt, Ot] = [q, it];
            }
            const [Nt, Jt] = $[Lt], [_t, Yt] = $[Lt + 1], It = [Tt + 2 * (Nt - Tt) / 3, Ot + 2 * (Jt - Ot) / 3], R = [_t + 2 * (Nt - _t) / 3, Yt + 2 * (Jt - Yt) / 3];
            return vt.push([[Tt, Ot], It, R, [_t, Yt]]), vt;
          }, N = new WeakSet(), ae = function() {
            if (this.isEmpty()) {
              W(this, K, De).call(this);
              return;
            }
            W(this, V, hi).call(this);
            const {
              canvas: $,
              ctx: vt
            } = this;
            vt.setTransform(1, 0, 0, 1, 0, 0), vt.clearRect(0, 0, $.width, $.height), W(this, K, De).call(this);
            for (const Lt of this.bezierPath2D)
              vt.stroke(Lt);
          }, Q = new WeakSet(), ui = function($) {
            this.canvas.removeEventListener("pointerleave", t(this, O)), this.canvas.removeEventListener("pointermove", t(this, L)), this.canvas.removeEventListener("pointerup", t(this, T)), this.canvas.addEventListener("pointerdown", t(this, v)), setTimeout(() => {
              this.canvas.removeEventListener("contextmenu", X.noContextMenu);
            }, 10), W(this, S, Gi).call(this, $.offsetX, $.offsetY), this.addToAnnotationStorage(), this.setInBackground();
          }, ct = new WeakSet(), Me = function() {
            this.canvas = document.createElement("canvas"), this.canvas.width = this.canvas.height = 0, this.canvas.className = "inkEditorCanvas", P.AnnotationEditor._l10nPromise.get("editor_ink_canvas_aria_label").then(($) => {
              var vt;
              return (vt = this.canvas) == null ? void 0 : vt.setAttribute("aria-label", $);
            }), this.div.append(this.canvas), this.ctx = this.canvas.getContext("2d");
          }, ut = new WeakSet(), Re = function() {
            Z(this, w, new ResizeObserver(($) => {
              const vt = $[0].contentRect;
              vt.width && vt.height && this.setDimensions(vt.width, vt.height);
            })), t(this, w).observe(this.div);
          }, Bt = new WeakSet(), fe = function() {
            if (!t(this, E))
              return;
            const [$, vt] = this.parentDimensions;
            this.canvas.width = Math.ceil(this.width * $), this.canvas.height = Math.ceil(this.height * vt), W(this, K, De).call(this);
          }, Dt = new WeakSet(), fi = function($, vt) {
            const Lt = W(this, ot, Ie).call(this), Tt = ($ - Lt) / t(this, g), Ot = (vt - Lt) / t(this, F);
            this.scaleFactor = Math.min(Tt, Ot);
          }, K = new WeakSet(), De = function() {
            const $ = W(this, ot, Ie).call(this) / 2;
            this.ctx.setTransform(this.scaleFactor, 0, 0, this.scaleFactor, this.translationX * this.scaleFactor + $, this.translationY * this.scaleFactor + $);
          }, ht = new WeakSet(), qi = function($) {
            const vt = new Path2D();
            for (let Lt = 0, Tt = $.length; Lt < Tt; Lt++) {
              const [Ot, Nt, Jt, _t] = $[Lt];
              Lt === 0 && vt.moveTo(...Ot), vt.bezierCurveTo(Nt[0], Nt[1], Jt[0], Jt[1], _t[0], _t[1]);
            }
            return vt;
          }, Ct = new WeakSet(), pi = function($, vt, Lt) {
            const [Tt, Ot, Nt, Jt] = vt;
            switch (Lt) {
              case 0:
                for (let _t = 0, Yt = $.length; _t < Yt; _t += 2)
                  $[_t] += Tt, $[_t + 1] = Jt - $[_t + 1];
                break;
              case 90:
                for (let _t = 0, Yt = $.length; _t < Yt; _t += 2) {
                  const It = $[_t];
                  $[_t] = $[_t + 1] + Tt, $[_t + 1] = It + Ot;
                }
                break;
              case 180:
                for (let _t = 0, Yt = $.length; _t < Yt; _t += 2)
                  $[_t] = Nt - $[_t], $[_t + 1] += Ot;
                break;
              case 270:
                for (let _t = 0, Yt = $.length; _t < Yt; _t += 2) {
                  const It = $[_t];
                  $[_t] = Nt - $[_t + 1], $[_t + 1] = Jt - It;
                }
                break;
              default:
                throw new Error("Invalid rotation");
            }
            return $;
          }, Gt = new WeakSet(), $i = function($, vt, Lt) {
            const [Tt, Ot, Nt, Jt] = vt;
            switch (Lt) {
              case 0:
                for (let _t = 0, Yt = $.length; _t < Yt; _t += 2)
                  $[_t] -= Tt, $[_t + 1] = Jt - $[_t + 1];
                break;
              case 90:
                for (let _t = 0, Yt = $.length; _t < Yt; _t += 2) {
                  const It = $[_t];
                  $[_t] = $[_t + 1] - Ot, $[_t + 1] = It - Tt;
                }
                break;
              case 180:
                for (let _t = 0, Yt = $.length; _t < Yt; _t += 2)
                  $[_t] = Nt - $[_t], $[_t + 1] -= Ot;
                break;
              case 270:
                for (let _t = 0, Yt = $.length; _t < Yt; _t += 2) {
                  const It = $[_t];
                  $[_t] = Jt - $[_t + 1], $[_t + 1] = Nt - It;
                }
                break;
              default:
                throw new Error("Invalid rotation");
            }
            return $;
          }, Xt = new WeakSet(), Yi = function($, vt, Lt, Tt) {
            var Yt, It;
            const Ot = [], Nt = this.thickness / 2, Jt = $ * vt + Nt, _t = $ * Lt + Nt;
            for (const R of this.paths) {
              const e = [], f = [];
              for (let D = 0, j = R.length; D < j; D++) {
                const [q, it, mt, kt] = R[D], xt = $ * q[0] + Jt, zt = $ * q[1] + _t, Mt = $ * it[0] + Jt, Rt = $ * it[1] + _t, jt = $ * mt[0] + Jt, qt = $ * mt[1] + _t, Kt = $ * kt[0] + Jt, Qt = $ * kt[1] + _t;
                D === 0 && (e.push(xt, zt), f.push(xt, zt)), e.push(Mt, Rt, jt, qt, Kt, Qt), f.push(Mt, Rt), D === j - 1 && f.push(Kt, Qt);
              }
              Ot.push({
                bezier: W(Yt = At, Ct, pi).call(Yt, e, Tt, this.rotation),
                points: W(It = At, Ct, pi).call(It, f, Tt, this.rotation)
              });
            }
            return Ot;
          }, Wt = new WeakSet(), gi = function() {
            let $ = 1 / 0, vt = -1 / 0, Lt = 1 / 0, Tt = -1 / 0;
            for (const Ot of this.paths)
              for (const [Nt, Jt, _t, Yt] of Ot) {
                const It = c.Util.bezierBoundingBox(...Nt, ...Jt, ..._t, ...Yt);
                $ = Math.min($, It[0]), Lt = Math.min(Lt, It[1]), vt = Math.max(vt, It[2]), Tt = Math.max(Tt, It[3]);
              }
            return [$, Lt, vt, Tt];
          }, ot = new WeakSet(), Ie = function() {
            return t(this, u) ? Math.ceil(this.thickness * this.parentScale) : 0;
          }, G = new WeakSet(), pe = function($ = !1) {
            if (this.isEmpty())
              return;
            if (!t(this, u)) {
              W(this, N, ae).call(this);
              return;
            }
            const vt = W(this, Wt, gi).call(this), Lt = W(this, ot, Ie).call(this);
            Z(this, g, Math.max(P.AnnotationEditor.MIN_SIZE, vt[2] - vt[0])), Z(this, F, Math.max(P.AnnotationEditor.MIN_SIZE, vt[3] - vt[1]));
            const Tt = Math.ceil(Lt + t(this, g) * this.scaleFactor), Ot = Math.ceil(Lt + t(this, F) * this.scaleFactor), [Nt, Jt] = this.parentDimensions;
            this.width = Tt / Nt, this.height = Ot / Jt, this.setAspectRatio(Tt, Ot);
            const _t = this.translationX, Yt = this.translationY;
            this.translationX = -vt[0], this.translationY = -vt[1], W(this, Bt, fe).call(this), W(this, N, ae).call(this), Z(this, y, Tt), Z(this, a, Ot), this.setDims(Tt, Ot);
            const It = $ ? Lt / this.scaleFactor / 2 : 0;
            this.translate(_t - this.translationX - It, Yt - this.translationY - It);
          }, I(At, ht), I(At, Ct), I(At, Gt), ee(At, "_defaultColor", null), ee(At, "_defaultOpacity", 1), ee(At, "_defaultThickness", 1), ee(At, "_type", "ink");
          let B = At;
          d.InkEditor = B;
        },
        /* 34 */
        /***/
        (dt, d, et) => {
          var B, F, g, L, O, T, v, A, u, b, E, ve, y, Se, l, Le, p, mi, x, Ki, U, Ji, C, bi, st, Oe, H, Qi;
          Object.defineProperty(d, "__esModule", {
            value: !0
          }), d.StampEditor = void 0;
          var c = et(1), P = et(4), rt = et(6), X = et(29);
          const gt = class gt extends P.AnnotationEditor {
            constructor(S) {
              super({
                ...S,
                name: "stampEditor"
              });
              I(this, E);
              I(this, y);
              I(this, l);
              I(this, p);
              I(this, x);
              I(this, U);
              I(this, C);
              I(this, st);
              I(this, H);
              I(this, B, null);
              I(this, F, null);
              I(this, g, null);
              I(this, L, null);
              I(this, O, null);
              I(this, T, null);
              I(this, v, null);
              I(this, A, null);
              I(this, u, !1);
              I(this, b, !1);
              Z(this, L, S.bitmapUrl), Z(this, O, S.bitmapFile);
            }
            static initialize(S) {
              P.AnnotationEditor.initialize(S);
            }
            static get supportedTypes() {
              const S = ["apng", "avif", "bmp", "gif", "jpeg", "png", "svg+xml", "webp", "x-icon"];
              return (0, c.shadow)(this, "supportedTypes", S.map((i) => `image/${i}`));
            }
            static get supportedTypesStr() {
              return (0, c.shadow)(this, "supportedTypesStr", this.supportedTypes.join(","));
            }
            static isHandlingMimeForPasting(S) {
              return this.supportedTypes.includes(S);
            }
            static paste(S, i) {
              i.pasteEditor(c.AnnotationEditorType.STAMP, {
                bitmapFile: S.getAsFile()
              });
            }
            remove() {
              var S, i;
              t(this, F) && (Z(this, B, null), this._uiManager.imageManager.deleteId(t(this, F)), (S = t(this, T)) == null || S.remove(), Z(this, T, null), (i = t(this, v)) == null || i.disconnect(), Z(this, v, null)), super.remove();
            }
            rebuild() {
              if (!this.parent) {
                t(this, F) && W(this, l, Le).call(this);
                return;
              }
              super.rebuild(), this.div !== null && (t(this, F) && W(this, l, Le).call(this), this.isAttachedToDOM || this.parent.add(this));
            }
            onceAdded() {
              this._isDraggable = !0, this.div.focus();
            }
            isEmpty() {
              return !(t(this, g) || t(this, B) || t(this, L) || t(this, O));
            }
            get isResizable() {
              return !0;
            }
            render() {
              if (this.div)
                return this.div;
              let S, i;
              if (this.width && (S = this.x, i = this.y), super.render(), this.div.hidden = !0, t(this, B) ? W(this, p, mi).call(this) : W(this, l, Le).call(this), this.width) {
                const [n, s] = this.parentDimensions;
                this.setAt(S * n, i * s, this.width * n, this.height * s);
              }
              return this.div;
            }
            static deserialize(S, i, n) {
              if (S instanceof X.StampAnnotationElement)
                return null;
              const s = super.deserialize(S, i, n), {
                rect: o,
                bitmapUrl: h,
                bitmapId: _,
                isSvg: M,
                accessibilityData: N
              } = S;
              _ && n.imageManager.isValidId(_) ? Z(s, F, _) : Z(s, L, h), Z(s, u, M);
              const [tt, Q] = s.pageDimensions;
              return s.width = (o[2] - o[0]) / tt, s.height = (o[3] - o[1]) / Q, N && (s.altTextData = N), s;
            }
            serialize(S = !1, i = null) {
              if (this.isEmpty())
                return null;
              const n = {
                annotationType: c.AnnotationEditorType.STAMP,
                bitmapId: t(this, F),
                pageIndex: this.pageIndex,
                rect: this.getRect(0, 0),
                rotation: this.rotation,
                isSvg: t(this, u),
                structTreeParentId: this._structTreeParentId
              };
              if (S)
                return n.bitmapUrl = W(this, st, Oe).call(this, !0), n.accessibilityData = this.altTextData, n;
              const {
                decorative: s,
                altText: o
              } = this.altTextData;
              if (!s && o && (n.accessibilityData = {
                type: "Figure",
                alt: o
              }), i === null)
                return n;
              i.stamps || (i.stamps = /* @__PURE__ */ new Map());
              const h = t(this, u) ? (n.rect[2] - n.rect[0]) * (n.rect[3] - n.rect[1]) : null;
              if (!i.stamps.has(t(this, F)))
                i.stamps.set(t(this, F), {
                  area: h,
                  serialized: n
                }), n.bitmap = W(this, st, Oe).call(this, !1);
              else if (t(this, u)) {
                const _ = i.stamps.get(t(this, F));
                h > _.area && (_.area = h, _.serialized.bitmap.close(), _.serialized.bitmap = W(this, st, Oe).call(this, !1));
              }
              return n;
            }
          };
          B = new WeakMap(), F = new WeakMap(), g = new WeakMap(), L = new WeakMap(), O = new WeakMap(), T = new WeakMap(), v = new WeakMap(), A = new WeakMap(), u = new WeakMap(), b = new WeakMap(), E = new WeakSet(), ve = function(S, i = !1) {
            if (!S) {
              this.remove();
              return;
            }
            Z(this, B, S.bitmap), i || (Z(this, F, S.id), Z(this, u, S.isSvg)), W(this, p, mi).call(this);
          }, y = new WeakSet(), Se = function() {
            Z(this, g, null), this._uiManager.enableWaiting(!1), t(this, T) && this.div.focus();
          }, l = new WeakSet(), Le = function() {
            if (t(this, F)) {
              this._uiManager.enableWaiting(!0), this._uiManager.imageManager.getFromId(t(this, F)).then((i) => W(this, E, ve).call(this, i, !0)).finally(() => W(this, y, Se).call(this));
              return;
            }
            if (t(this, L)) {
              const i = t(this, L);
              Z(this, L, null), this._uiManager.enableWaiting(!0), Z(this, g, this._uiManager.imageManager.getFromUrl(i).then((n) => W(this, E, ve).call(this, n)).finally(() => W(this, y, Se).call(this)));
              return;
            }
            if (t(this, O)) {
              const i = t(this, O);
              Z(this, O, null), this._uiManager.enableWaiting(!0), Z(this, g, this._uiManager.imageManager.getFromFile(i).then((n) => W(this, E, ve).call(this, n)).finally(() => W(this, y, Se).call(this)));
              return;
            }
            const S = document.createElement("input");
            S.type = "file", S.accept = gt.supportedTypesStr, Z(this, g, new Promise((i) => {
              S.addEventListener("change", async () => {
                if (!S.files || S.files.length === 0)
                  this.remove();
                else {
                  this._uiManager.enableWaiting(!0);
                  const n = await this._uiManager.imageManager.getFromFile(S.files[0]);
                  W(this, E, ve).call(this, n);
                }
                i();
              }), S.addEventListener("cancel", () => {
                this.remove(), i();
              });
            }).finally(() => W(this, y, Se).call(this))), S.click();
          }, p = new WeakSet(), mi = function() {
            const {
              div: S
            } = this;
            let {
              width: i,
              height: n
            } = t(this, B);
            const [s, o] = this.pageDimensions, h = 0.75;
            if (this.width)
              i = this.width * s, n = this.height * o;
            else if (i > h * s || n > h * o) {
              const tt = Math.min(h * s / i, h * o / n);
              i *= tt, n *= tt;
            }
            const [_, M] = this.parentDimensions;
            this.setDims(i * _ / s, n * M / o), this._uiManager.enableWaiting(!1);
            const N = Z(this, T, document.createElement("canvas"));
            S.append(N), S.hidden = !1, W(this, C, bi).call(this, i, n), W(this, H, Qi).call(this), t(this, b) || (this.parent.addUndoableEditor(this), Z(this, b, !0)), this._uiManager._eventBus.dispatch("reporttelemetry", {
              source: this,
              details: {
                type: "editing",
                subtype: this.editorType,
                data: {
                  action: "inserted_image"
                }
              }
            }), this.addAltTextButton();
          }, x = new WeakSet(), Ki = function(S, i) {
            var h;
            const [n, s] = this.parentDimensions;
            this.width = S / n, this.height = i / s, this.setDims(S, i), (h = this._initialOptions) != null && h.isCentered ? this.center() : this.fixAndSetPosition(), this._initialOptions = null, t(this, A) !== null && clearTimeout(t(this, A)), Z(this, A, setTimeout(() => {
              Z(this, A, null), W(this, C, bi).call(this, S, i);
            }, 200));
          }, U = new WeakSet(), Ji = function(S, i) {
            const {
              width: n,
              height: s
            } = t(this, B);
            let o = n, h = s, _ = t(this, B);
            for (; o > 2 * S || h > 2 * i; ) {
              const M = o, N = h;
              o > 2 * S && (o = o >= 16384 ? Math.floor(o / 2) - 1 : Math.ceil(o / 2)), h > 2 * i && (h = h >= 16384 ? Math.floor(h / 2) - 1 : Math.ceil(h / 2));
              const tt = new OffscreenCanvas(o, h);
              tt.getContext("2d").drawImage(_, 0, 0, M, N, 0, 0, o, h), _ = tt.transferToImageBitmap();
            }
            return _;
          }, C = new WeakSet(), bi = function(S, i) {
            S = Math.ceil(S), i = Math.ceil(i);
            const n = t(this, T);
            if (!n || n.width === S && n.height === i)
              return;
            n.width = S, n.height = i;
            const s = t(this, u) ? t(this, B) : W(this, U, Ji).call(this, S, i), o = n.getContext("2d");
            o.filter = this._uiManager.hcmFilter, o.drawImage(s, 0, 0, s.width, s.height, 0, 0, S, i);
          }, st = new WeakSet(), Oe = function(S) {
            if (S) {
              if (t(this, u)) {
                const s = this._uiManager.imageManager.getSvgUrl(t(this, F));
                if (s)
                  return s;
              }
              const i = document.createElement("canvas");
              return {
                width: i.width,
                height: i.height
              } = t(this, B), i.getContext("2d").drawImage(t(this, B), 0, 0), i.toDataURL();
            }
            if (t(this, u)) {
              const [i, n] = this.pageDimensions, s = Math.round(this.width * i * rt.PixelsPerInch.PDF_TO_CSS_UNITS), o = Math.round(this.height * n * rt.PixelsPerInch.PDF_TO_CSS_UNITS), h = new OffscreenCanvas(s, o);
              return h.getContext("2d").drawImage(t(this, B), 0, 0, t(this, B).width, t(this, B).height, 0, 0, s, o), h.transferToImageBitmap();
            }
            return structuredClone(t(this, B));
          }, H = new WeakSet(), Qi = function() {
            Z(this, v, new ResizeObserver((S) => {
              const i = S[0].contentRect;
              i.width && i.height && W(this, x, Ki).call(this, i.width, i.height);
            })), t(this, v).observe(this.div);
          }, ee(gt, "_type", "stamp");
          let pt = gt;
          d.StampEditor = pt;
        }
        /******/
      ], __webpack_module_cache__ = {};
      function __w_pdfjs_require__(dt) {
        var d = __webpack_module_cache__[dt];
        if (d !== void 0)
          return d.exports;
        var et = __webpack_module_cache__[dt] = {
          /******/
          // no module.id needed
          /******/
          // no module.loaded needed
          /******/
          exports: {}
          /******/
        };
        return __webpack_modules__[dt](et, et.exports, __w_pdfjs_require__), et.exports;
      }
      var __webpack_exports__ = {};
      return (() => {
        var dt = __webpack_exports__;
        Object.defineProperty(dt, "__esModule", {
          value: !0
        }), Object.defineProperty(dt, "AbortException", {
          enumerable: !0,
          get: function() {
            return d.AbortException;
          }
        }), Object.defineProperty(dt, "AnnotationEditorLayer", {
          enumerable: !0,
          get: function() {
            return rt.AnnotationEditorLayer;
          }
        }), Object.defineProperty(dt, "AnnotationEditorParamsType", {
          enumerable: !0,
          get: function() {
            return d.AnnotationEditorParamsType;
          }
        }), Object.defineProperty(dt, "AnnotationEditorType", {
          enumerable: !0,
          get: function() {
            return d.AnnotationEditorType;
          }
        }), Object.defineProperty(dt, "AnnotationEditorUIManager", {
          enumerable: !0,
          get: function() {
            return X.AnnotationEditorUIManager;
          }
        }), Object.defineProperty(dt, "AnnotationLayer", {
          enumerable: !0,
          get: function() {
            return pt.AnnotationLayer;
          }
        }), Object.defineProperty(dt, "AnnotationMode", {
          enumerable: !0,
          get: function() {
            return d.AnnotationMode;
          }
        }), Object.defineProperty(dt, "CMapCompressionType", {
          enumerable: !0,
          get: function() {
            return d.CMapCompressionType;
          }
        }), Object.defineProperty(dt, "DOMSVGFactory", {
          enumerable: !0,
          get: function() {
            return c.DOMSVGFactory;
          }
        }), Object.defineProperty(dt, "FeatureTest", {
          enumerable: !0,
          get: function() {
            return d.FeatureTest;
          }
        }), Object.defineProperty(dt, "GlobalWorkerOptions", {
          enumerable: !0,
          get: function() {
            return B.GlobalWorkerOptions;
          }
        }), Object.defineProperty(dt, "ImageKind", {
          enumerable: !0,
          get: function() {
            return d.ImageKind;
          }
        }), Object.defineProperty(dt, "InvalidPDFException", {
          enumerable: !0,
          get: function() {
            return d.InvalidPDFException;
          }
        }), Object.defineProperty(dt, "MissingPDFException", {
          enumerable: !0,
          get: function() {
            return d.MissingPDFException;
          }
        }), Object.defineProperty(dt, "OPS", {
          enumerable: !0,
          get: function() {
            return d.OPS;
          }
        }), Object.defineProperty(dt, "PDFDataRangeTransport", {
          enumerable: !0,
          get: function() {
            return et.PDFDataRangeTransport;
          }
        }), Object.defineProperty(dt, "PDFDateString", {
          enumerable: !0,
          get: function() {
            return c.PDFDateString;
          }
        }), Object.defineProperty(dt, "PDFWorker", {
          enumerable: !0,
          get: function() {
            return et.PDFWorker;
          }
        }), Object.defineProperty(dt, "PasswordResponses", {
          enumerable: !0,
          get: function() {
            return d.PasswordResponses;
          }
        }), Object.defineProperty(dt, "PermissionFlag", {
          enumerable: !0,
          get: function() {
            return d.PermissionFlag;
          }
        }), Object.defineProperty(dt, "PixelsPerInch", {
          enumerable: !0,
          get: function() {
            return c.PixelsPerInch;
          }
        }), Object.defineProperty(dt, "PromiseCapability", {
          enumerable: !0,
          get: function() {
            return d.PromiseCapability;
          }
        }), Object.defineProperty(dt, "RenderingCancelledException", {
          enumerable: !0,
          get: function() {
            return c.RenderingCancelledException;
          }
        }), Object.defineProperty(dt, "SVGGraphics", {
          enumerable: !0,
          get: function() {
            return et.SVGGraphics;
          }
        }), Object.defineProperty(dt, "UnexpectedResponseException", {
          enumerable: !0,
          get: function() {
            return d.UnexpectedResponseException;
          }
        }), Object.defineProperty(dt, "Util", {
          enumerable: !0,
          get: function() {
            return d.Util;
          }
        }), Object.defineProperty(dt, "VerbosityLevel", {
          enumerable: !0,
          get: function() {
            return d.VerbosityLevel;
          }
        }), Object.defineProperty(dt, "XfaLayer", {
          enumerable: !0,
          get: function() {
            return F.XfaLayer;
          }
        }), Object.defineProperty(dt, "build", {
          enumerable: !0,
          get: function() {
            return et.build;
          }
        }), Object.defineProperty(dt, "createValidAbsoluteUrl", {
          enumerable: !0,
          get: function() {
            return d.createValidAbsoluteUrl;
          }
        }), Object.defineProperty(dt, "getDocument", {
          enumerable: !0,
          get: function() {
            return et.getDocument;
          }
        }), Object.defineProperty(dt, "getFilenameFromUrl", {
          enumerable: !0,
          get: function() {
            return c.getFilenameFromUrl;
          }
        }), Object.defineProperty(dt, "getPdfFilenameFromUrl", {
          enumerable: !0,
          get: function() {
            return c.getPdfFilenameFromUrl;
          }
        }), Object.defineProperty(dt, "getXfaPageViewport", {
          enumerable: !0,
          get: function() {
            return c.getXfaPageViewport;
          }
        }), Object.defineProperty(dt, "isDataScheme", {
          enumerable: !0,
          get: function() {
            return c.isDataScheme;
          }
        }), Object.defineProperty(dt, "isPdfFile", {
          enumerable: !0,
          get: function() {
            return c.isPdfFile;
          }
        }), Object.defineProperty(dt, "loadScript", {
          enumerable: !0,
          get: function() {
            return c.loadScript;
          }
        }), Object.defineProperty(dt, "noContextMenu", {
          enumerable: !0,
          get: function() {
            return c.noContextMenu;
          }
        }), Object.defineProperty(dt, "normalizeUnicode", {
          enumerable: !0,
          get: function() {
            return d.normalizeUnicode;
          }
        }), Object.defineProperty(dt, "renderTextLayer", {
          enumerable: !0,
          get: function() {
            return P.renderTextLayer;
          }
        }), Object.defineProperty(dt, "setLayerDimensions", {
          enumerable: !0,
          get: function() {
            return c.setLayerDimensions;
          }
        }), Object.defineProperty(dt, "shadow", {
          enumerable: !0,
          get: function() {
            return d.shadow;
          }
        }), Object.defineProperty(dt, "updateTextLayer", {
          enumerable: !0,
          get: function() {
            return P.updateTextLayer;
          }
        }), Object.defineProperty(dt, "version", {
          enumerable: !0,
          get: function() {
            return et.version;
          }
        });
        var d = __w_pdfjs_require__(1), et = __w_pdfjs_require__(2), c = __w_pdfjs_require__(6), P = __w_pdfjs_require__(26), rt = __w_pdfjs_require__(27), X = __w_pdfjs_require__(5), pt = __w_pdfjs_require__(29), B = __w_pdfjs_require__(14), F = __w_pdfjs_require__(32);
      })(), __webpack_exports__;
    })()
  ));
})(pdf);
var pdfExports = pdf.exports;
const pdfjsLib = /* @__PURE__ */ getDefaultExportFromCjs(pdfExports), {
  SvelteComponent,
  append,
  attr,
  binding_callbacks,
  detach,
  element,
  init,
  insert,
  noop,
  safe_not_equal,
  set_style,
  toggle_class
} = window.__gradio__svelte__internal;
function create_fragment(dt) {
  let d, et;
  return {
    c() {
      d = element("div"), et = element("canvas"), set_style(d, "justify-content", "center"), set_style(d, "align-items", "center"), set_style(d, "display", "flex"), set_style(d, "flex-direction", "column"), attr(d, "class", "svelte-1gecy8w"), toggle_class(
        d,
        "table",
        /*type*/
        dt[0] === "table"
      ), toggle_class(
        d,
        "gallery",
        /*type*/
        dt[0] === "gallery"
      ), toggle_class(
        d,
        "selected",
        /*selected*/
        dt[1]
      );
    },
    m(c, P) {
      insert(c, d, P), append(d, et), dt[5](et);
    },
    p(c, [P]) {
      P & /*type*/
      1 && toggle_class(
        d,
        "table",
        /*type*/
        c[0] === "table"
      ), P & /*type*/
      1 && toggle_class(
        d,
        "gallery",
        /*type*/
        c[0] === "gallery"
      ), P & /*selected*/
      2 && toggle_class(
        d,
        "selected",
        /*selected*/
        c[1]
      );
    },
    i: noop,
    o: noop,
    d(c) {
      c && detach(d), dt[5](null);
    }
  };
}
function instance(dt, d, et) {
  var c = this && this.__awaiter || function(T, v, A, u) {
    function b(E) {
      return E instanceof A ? E : new A(function(w) {
        w(E);
      });
    }
    return new (A || (A = Promise))(function(E, w) {
      function y(k) {
        try {
          l(u.next(k));
        } catch (p) {
          w(p);
        }
      }
      function a(k) {
        try {
          l(u.throw(k));
        } catch (p) {
          w(p);
        }
      }
      function l(k) {
        k.done ? E(k.value) : b(k.value).then(y, a);
      }
      l((u = u.apply(T, v || [])).next());
    });
  };
  let { value: P } = d, { samples_dir: rt } = d, { type: X } = d, { selected: pt = !1 } = d;
  pdfjsLib.GlobalWorkerOptions.workerSrc = "https://cdn.bootcss.com/pdf.js/3.11.174/pdf.worker.js";
  let B, F;
  function g(T) {
    return c(this, void 0, void 0, function* () {
      B = yield pdfjsLib.getDocument(T).promise, L();
    });
  }
  function L() {
    B.getPage(1).then((T) => {
      const v = F.getContext("2d");
      v.clearRect(0, 0, F.width, F.height);
      const A = T.getViewport({ scale: 0.2 }), u = { canvasContext: v, viewport: A };
      et(2, F.width = A.width, F), et(2, F.height = A.height, F), T.render(u);
    });
  }
  function O(T) {
    binding_callbacks[T ? "unshift" : "push"](() => {
      F = T, et(2, F);
    });
  }
  return dt.$$set = (T) => {
    "value" in T && et(3, P = T.value), "samples_dir" in T && et(4, rt = T.samples_dir), "type" in T && et(0, X = T.type), "selected" in T && et(1, pt = T.selected);
  }, dt.$$.update = () => {
    dt.$$.dirty & /*samples_dir, value*/
    24 && g(rt + P);
  }, [X, pt, F, P, rt, O];
}
class Example extends SvelteComponent {
  constructor(d) {
    super(), init(this, d, instance, create_fragment, safe_not_equal, {
      value: 3,
      samples_dir: 4,
      type: 0,
      selected: 1
    });
  }
}
export {
  Example as default
};
