{"version":3,"sources":["jsdelivr-header.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/shared/scripting_utils.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/annotation_layer.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/annotation_storage.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/api.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/base_factory.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/pattern_helper.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/shared/image_utils.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/canvas.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/display_utils.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/draw_layer.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/editor/freetext.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/editor/ink.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/editor/stamp.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/editor/annotation_editor_layer.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/editor/toolbar.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/editor/editor.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/editor/outliner.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/editor/tools.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/fetch_stream.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/font_loader.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/metadata.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/network.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/content_disposition.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/network_utils.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/node_stream.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/node_utils.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/optional_content_config.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/text_layer.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/transport_stream.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/worker_options.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/xfa_layer.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/display/xfa_text.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/pdf.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/shared/message_handler.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/shared/murmurhash3.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/src/shared/util.js","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/webpack/bootstrap","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/webpack/runtime/async%20module","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/webpack/runtime/define%20property%20getters","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/webpack/runtime/hasOwnProperty%20shorthand","/npm/pdfjs-dist@4.0.269/build/webpack:/pdf.js/webpack/startup"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA,2kwBCgBA,SAAS,EAAc,EAAG,CACxB,OAAO,KAAK,MAAM,KAAK,IAAI,EAAG,KAAK,IAAI,EAAG,CAAZ,CAAZ,EAA8B,GAAzC,EACJ,SAAS,EADL,EAEJ,SAAS,EAAG,GAFR,CADiB,CAM1B,SAAS,EAAc,EAAG,CACxB,OAAO,KAAK,IA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A,GAAA,IAAA,GAAA,CAAA,EAAA,IAAA,CAAA,IAAA,EAAA,IAAA,CAAA,EAAA,GAAA,CAAA,EAAA,IAAA,EAAA,IAAA,EAAA,KAAA,CAAA,IACA,EAAA,IAAA,GAAA,EAAA,CAAA,EAAA,CAAA,CAAA,CACA,CAAG,EACH,OAAA,EAAA,EAAA,EAAA,EAAA,CACA,EAAE,IAAA,EAAA,EAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA,EAAA,EAAA,CAAA,EAAA,EACF,GAAA,EAAA,EAAA,IAAA,EAAA,EAAA,EACA,MC/DA,GAAA,EAAA,CAAA,EAAA,IAAA,CACA,QAAA,KAAA,EACA,GAAA,EAAA,EAAA,CAAA,GAAA,CAAA,GAAA,EAAA,EAAA,CAAA,GACA,OAAA,eAAA,EAAA,EAAA,CAAyC,WAAA,GAAA,IAAA,EAAA,CAAA,CAAA,CAAwC,CAGjF,ECPA,GAAA,EAAA,CAAA,EAAA,IAAA,OAAA,UAAA,eAAA,KAAA,EAAA,CAAA,ECGA,IAAA,GAAA,GAAA,GAAA","file":"/npm/pdfjs-dist@4.0.269/build/pdf.mjs/+esm","sourceRoot":"","sourcesContent":["/**\n * Bundled by jsDelivr using Rollup v4.62.2 and esbuild v0.28.1.\n * Original file: /npm/pdfjs-dist@4.0.269/build/pdf.mjs\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * PLEASE NOTE: This file is currently imported in both the `../display/` and\n *              `../scripting_api/` folders, hence be EXTREMELY careful about\n *              introducing any dependencies here since that can lead to an\n *              unexpected/unnecessary size increase of the *built* files.\n */\n\nfunction makeColorComp(n) {\n  return Math.floor(Math.max(0, Math.min(1, n)) * 255)\n    .toString(16)\n    .padStart(2, \"0\");\n}\n\nfunction scaleAndClamp(x) {\n  return Math.max(0, Math.min(255, 255 * x));\n}\n\n// PDF specifications section 10.3\nclass ColorConverters {\n  static CMYK_G([c, y, m, k]) {\n    return [\"G\", 1 - Math.min(1, 0.3 * c + 0.59 * m + 0.11 * y + k)];\n  }\n\n  static G_CMYK([g]) {\n    return [\"CMYK\", 0, 0, 0, 1 - g];\n  }\n\n  static G_RGB([g]) {\n    return [\"RGB\", g, g, g];\n  }\n\n  static G_rgb([g]) {\n    g = scaleAndClamp(g);\n    return [g, g, g];\n  }\n\n  static G_HTML([g]) {\n    const G = makeColorComp(g);\n    return `#${G}${G}${G}`;\n  }\n\n  static RGB_G([r, g, b]) {\n    return [\"G\", 0.3 * r + 0.59 * g + 0.11 * b];\n  }\n\n  static RGB_rgb(color) {\n    return color.map(scaleAndClamp);\n  }\n\n  static RGB_HTML(color) {\n    return `#${color.map(makeColorComp).join(\"\")}`;\n  }\n\n  static T_HTML() {\n    return \"#00000000\";\n  }\n\n  static T_rgb() {\n    return [null];\n  }\n\n  static CMYK_RGB([c, y, m, k]) {\n    return [\n      \"RGB\",\n      1 - Math.min(1, c + k),\n      1 - Math.min(1, m + k),\n      1 - Math.min(1, y + k),\n    ];\n  }\n\n  static CMYK_rgb([c, y, m, k]) {\n    return [\n      scaleAndClamp(1 - Math.min(1, c + k)),\n      scaleAndClamp(1 - Math.min(1, m + k)),\n      scaleAndClamp(1 - Math.min(1, y + k)),\n    ];\n  }\n\n  static CMYK_HTML(components) {\n    const rgb = this.CMYK_RGB(components).slice(1);\n    return this.RGB_HTML(rgb);\n  }\n\n  static RGB_CMYK([r, g, b]) {\n    const c = 1 - r;\n    const m = 1 - g;\n    const y = 1 - b;\n    const k = Math.min(c, m, y);\n    return [\"CMYK\", c, m, y, k];\n  }\n}\n\nexport { ColorConverters };\n","/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./api\").PDFPageProxy} PDFPageProxy */\n/** @typedef {import(\"./display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../../web/text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../../web/interfaces\").IDownloadManager} IDownloadManager */\n/** @typedef {import(\"../../web/interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport {\n  AnnotationBorderStyleType,\n  AnnotationEditorType,\n  AnnotationPrefix,\n  AnnotationType,\n  FeatureTest,\n  LINE_FACTOR,\n  shadow,\n  unreachable,\n  Util,\n  warn,\n} from \"../shared/util.js\";\nimport {\n  DOMSVGFactory,\n  getFilenameFromUrl,\n  PDFDateString,\n  setLayerDimensions,\n} from \"./display_utils.js\";\nimport { AnnotationStorage } from \"./annotation_storage.js\";\nimport { ColorConverters } from \"../shared/scripting_utils.js\";\nimport { XfaLayer } from \"./xfa_layer.js\";\n\nconst DEFAULT_TAB_INDEX = 1000;\nconst DEFAULT_FONT_SIZE = 9;\nconst GetElementsByNameSet = new WeakSet();\n\nfunction getRectDims(rect) {\n  return {\n    width: rect[2] - rect[0],\n    height: rect[3] - rect[1],\n  };\n}\n\n/**\n * @typedef {Object} AnnotationElementParameters\n * @property {Object} data\n * @property {HTMLDivElement} layer\n * @property {IPDFLinkService} linkService\n * @property {IDownloadManager} [downloadManager]\n * @property {AnnotationStorage} [annotationStorage]\n * @property {string} [imageResourcesPath] - Path for image resources, mainly\n *   for annotation icons. Include trailing slash.\n * @property {boolean} renderForms\n * @property {Object} svgFactory\n * @property {boolean} [enableScripting]\n * @property {boolean} [hasJSActions]\n * @property {Object} [fieldObjects]\n */\n\nclass AnnotationElementFactory {\n  /**\n   * @param {AnnotationElementParameters} parameters\n   * @returns {AnnotationElement}\n   */\n  static create(parameters) {\n    const subtype = parameters.data.annotationType;\n\n    switch (subtype) {\n      case AnnotationType.LINK:\n        return new LinkAnnotationElement(parameters);\n\n      case AnnotationType.TEXT:\n        return new TextAnnotationElement(parameters);\n\n      case AnnotationType.WIDGET:\n        const fieldType = parameters.data.fieldType;\n\n        switch (fieldType) {\n          case \"Tx\":\n            return new TextWidgetAnnotationElement(parameters);\n          case \"Btn\":\n            if (parameters.data.radioButton) {\n              return new RadioButtonWidgetAnnotationElement(parameters);\n            } else if (parameters.data.checkBox) {\n              return new CheckboxWidgetAnnotationElement(parameters);\n            }\n            return new PushButtonWidgetAnnotationElement(parameters);\n          case \"Ch\":\n            return new ChoiceWidgetAnnotationElement(parameters);\n          case \"Sig\":\n            return new SignatureWidgetAnnotationElement(parameters);\n        }\n        return new WidgetAnnotationElement(parameters);\n\n      case AnnotationType.POPUP:\n        return new PopupAnnotationElement(parameters);\n\n      case AnnotationType.FREETEXT:\n        return new FreeTextAnnotationElement(parameters);\n\n      case AnnotationType.LINE:\n        return new LineAnnotationElement(parameters);\n\n      case AnnotationType.SQUARE:\n        return new SquareAnnotationElement(parameters);\n\n      case AnnotationType.CIRCLE:\n        return new CircleAnnotationElement(parameters);\n\n      case AnnotationType.POLYLINE:\n        return new PolylineAnnotationElement(parameters);\n\n      case AnnotationType.CARET:\n        return new CaretAnnotationElement(parameters);\n\n      case AnnotationType.INK:\n        return new InkAnnotationElement(parameters);\n\n      case AnnotationType.POLYGON:\n        return new PolygonAnnotationElement(parameters);\n\n      case AnnotationType.HIGHLIGHT:\n        return new HighlightAnnotationElement(parameters);\n\n      case AnnotationType.UNDERLINE:\n        return new UnderlineAnnotationElement(parameters);\n\n      case AnnotationType.SQUIGGLY:\n        return new SquigglyAnnotationElement(parameters);\n\n      case AnnotationType.STRIKEOUT:\n        return new StrikeOutAnnotationElement(parameters);\n\n      case AnnotationType.STAMP:\n        return new StampAnnotationElement(parameters);\n\n      case AnnotationType.FILEATTACHMENT:\n        return new FileAttachmentAnnotationElement(parameters);\n\n      default:\n        return new AnnotationElement(parameters);\n    }\n  }\n}\n\nclass AnnotationElement {\n  #hasBorder = false;\n\n  constructor(\n    parameters,\n    {\n      isRenderable = false,\n      ignoreBorder = false,\n      createQuadrilaterals = false,\n    } = {}\n  ) {\n    this.isRenderable = isRenderable;\n    this.data = parameters.data;\n    this.layer = parameters.layer;\n    this.linkService = parameters.linkService;\n    this.downloadManager = parameters.downloadManager;\n    this.imageResourcesPath = parameters.imageResourcesPath;\n    this.renderForms = parameters.renderForms;\n    this.svgFactory = parameters.svgFactory;\n    this.annotationStorage = parameters.annotationStorage;\n    this.enableScripting = parameters.enableScripting;\n    this.hasJSActions = parameters.hasJSActions;\n    this._fieldObjects = parameters.fieldObjects;\n    this.parent = parameters.parent;\n\n    if (isRenderable) {\n      this.container = this._createContainer(ignoreBorder);\n    }\n    if (createQuadrilaterals) {\n      this._createQuadrilaterals();\n    }\n  }\n\n  static _hasPopupData({ titleObj, contentsObj, richText }) {\n    return !!(titleObj?.str || contentsObj?.str || richText?.str);\n  }\n\n  get hasPopupData() {\n    return AnnotationElement._hasPopupData(this.data);\n  }\n\n  /**\n   * Create an empty container for the annotation's HTML element.\n   *\n   * @private\n   * @param {boolean} ignoreBorder\n   * @memberof AnnotationElement\n   * @returns {HTMLElement} A section element.\n   */\n  _createContainer(ignoreBorder) {\n    const {\n      data,\n      parent: { page, viewport },\n    } = this;\n\n    const container = document.createElement(\"section\");\n    container.setAttribute(\"data-annotation-id\", data.id);\n    if (!(this instanceof WidgetAnnotationElement)) {\n      container.tabIndex = DEFAULT_TAB_INDEX;\n    }\n\n    // The accessibility manager will move the annotation in the DOM in\n    // order to match the visual ordering.\n    // But if an annotation is above an other one, then we must draw it\n    // after the other one whatever the order is in the DOM, hence the\n    // use of the z-index.\n    container.style.zIndex = this.parent.zIndex++;\n\n    if (this.data.popupRef) {\n      container.setAttribute(\"aria-haspopup\", \"dialog\");\n    }\n\n    if (data.noRotate) {\n      container.classList.add(\"norotate\");\n    }\n\n    const { pageWidth, pageHeight, pageX, pageY } = viewport.rawDims;\n\n    if (!data.rect || this instanceof PopupAnnotationElement) {\n      const { rotation } = data;\n      if (!data.hasOwnCanvas && rotation !== 0) {\n        this.setRotation(rotation, container);\n      }\n      return container;\n    }\n\n    const { width, height } = getRectDims(data.rect);\n\n    // Do *not* modify `data.rect`, since that will corrupt the annotation\n    // position on subsequent calls to `_createContainer` (see issue 6804).\n    const rect = Util.normalizeRect([\n      data.rect[0],\n      page.view[3] - data.rect[1] + page.view[1],\n      data.rect[2],\n      page.view[3] - data.rect[3] + page.view[1],\n    ]);\n\n    if (!ignoreBorder && data.borderStyle.width > 0) {\n      container.style.borderWidth = `${data.borderStyle.width}px`;\n\n      const horizontalRadius = data.borderStyle.horizontalCornerRadius;\n      const verticalRadius = data.borderStyle.verticalCornerRadius;\n      if (horizontalRadius > 0 || verticalRadius > 0) {\n        const radius = `calc(${horizontalRadius}px * var(--scale-factor)) / calc(${verticalRadius}px * var(--scale-factor))`;\n        container.style.borderRadius = radius;\n      } else if (this instanceof RadioButtonWidgetAnnotationElement) {\n        const radius = `calc(${width}px * var(--scale-factor)) / calc(${height}px * var(--scale-factor))`;\n        container.style.borderRadius = radius;\n      }\n\n      switch (data.borderStyle.style) {\n        case AnnotationBorderStyleType.SOLID:\n          container.style.borderStyle = \"solid\";\n          break;\n\n        case AnnotationBorderStyleType.DASHED:\n          container.style.borderStyle = \"dashed\";\n          break;\n\n        case AnnotationBorderStyleType.BEVELED:\n          warn(\"Unimplemented border style: beveled\");\n          break;\n\n        case AnnotationBorderStyleType.INSET:\n          warn(\"Unimplemented border style: inset\");\n          break;\n\n        case AnnotationBorderStyleType.UNDERLINE:\n          container.style.borderBottomStyle = \"solid\";\n          break;\n\n        default:\n          break;\n      }\n\n      const borderColor = data.borderColor || null;\n      if (borderColor) {\n        this.#hasBorder = true;\n        container.style.borderColor = Util.makeHexColor(\n          borderColor[0] | 0,\n          borderColor[1] | 0,\n          borderColor[2] | 0\n        );\n      } else {\n        // Transparent (invisible) border, so do not draw it at all.\n        container.style.borderWidth = 0;\n      }\n    }\n\n    container.style.left = `${(100 * (rect[0] - pageX)) / pageWidth}%`;\n    container.style.top = `${(100 * (rect[1] - pageY)) / pageHeight}%`;\n\n    const { rotation } = data;\n    if (data.hasOwnCanvas || rotation === 0) {\n      container.style.width = `${(100 * width) / pageWidth}%`;\n      container.style.height = `${(100 * height) / pageHeight}%`;\n    } else {\n      this.setRotation(rotation, container);\n    }\n\n    return container;\n  }\n\n  setRotation(angle, container = this.container) {\n    if (!this.data.rect) {\n      return;\n    }\n    const { pageWidth, pageHeight } = this.parent.viewport.rawDims;\n    const { width, height } = getRectDims(this.data.rect);\n\n    let elementWidth, elementHeight;\n    if (angle % 180 === 0) {\n      elementWidth = (100 * width) / pageWidth;\n      elementHeight = (100 * height) / pageHeight;\n    } else {\n      elementWidth = (100 * height) / pageWidth;\n      elementHeight = (100 * width) / pageHeight;\n    }\n\n    container.style.width = `${elementWidth}%`;\n    container.style.height = `${elementHeight}%`;\n\n    container.setAttribute(\"data-main-rotation\", (360 - angle) % 360);\n  }\n\n  get _commonActions() {\n    const setColor = (jsName, styleName, event) => {\n      const color = event.detail[jsName];\n      const colorType = color[0];\n      const colorArray = color.slice(1);\n      event.target.style[styleName] =\n        ColorConverters[`${colorType}_HTML`](colorArray);\n      this.annotationStorage.setValue(this.data.id, {\n        [styleName]: ColorConverters[`${colorType}_rgb`](colorArray),\n      });\n    };\n\n    return shadow(this, \"_commonActions\", {\n      display: event => {\n        const { display } = event.detail;\n        // See scripting/constants.js for the values of `Display`.\n        // 0 = visible, 1 = hidden, 2 = noPrint and 3 = noView.\n        const hidden = display % 2 === 1;\n        this.container.style.visibility = hidden ? \"hidden\" : \"visible\";\n        this.annotationStorage.setValue(this.data.id, {\n          noView: hidden,\n          noPrint: display === 1 || display === 2,\n        });\n      },\n      print: event => {\n        this.annotationStorage.setValue(this.data.id, {\n          noPrint: !event.detail.print,\n        });\n      },\n      hidden: event => {\n        const { hidden } = event.detail;\n        this.container.style.visibility = hidden ? \"hidden\" : \"visible\";\n        this.annotationStorage.setValue(this.data.id, {\n          noPrint: hidden,\n          noView: hidden,\n        });\n      },\n      focus: event => {\n        setTimeout(() => event.target.focus({ preventScroll: false }), 0);\n      },\n      userName: event => {\n        // tooltip\n        event.target.title = event.detail.userName;\n      },\n      readonly: event => {\n        event.target.disabled = event.detail.readonly;\n      },\n      required: event => {\n        this._setRequired(event.target, event.detail.required);\n      },\n      bgColor: event => {\n        setColor(\"bgColor\", \"backgroundColor\", event);\n      },\n      fillColor: event => {\n        setColor(\"fillColor\", \"backgroundColor\", event);\n      },\n      fgColor: event => {\n        setColor(\"fgColor\", \"color\", event);\n      },\n      textColor: event => {\n        setColor(\"textColor\", \"color\", event);\n      },\n      borderColor: event => {\n        setColor(\"borderColor\", \"borderColor\", event);\n      },\n      strokeColor: event => {\n        setColor(\"strokeColor\", \"borderColor\", event);\n      },\n      rotation: event => {\n        const angle = event.detail.rotation;\n        this.setRotation(angle);\n        this.annotationStorage.setValue(this.data.id, {\n          rotation: angle,\n        });\n      },\n    });\n  }\n\n  _dispatchEventFromSandbox(actions, jsEvent) {\n    const commonActions = this._commonActions;\n    for (const name of Object.keys(jsEvent.detail)) {\n      const action = actions[name] || commonActions[name];\n      action?.(jsEvent);\n    }\n  }\n\n  _setDefaultPropertiesFromJS(element) {\n    if (!this.enableScripting) {\n      return;\n    }\n\n    // Some properties may have been updated thanks to JS.\n    const storedData = this.annotationStorage.getRawValue(this.data.id);\n    if (!storedData) {\n      return;\n    }\n\n    const commonActions = this._commonActions;\n    for (const [actionName, detail] of Object.entries(storedData)) {\n      const action = commonActions[actionName];\n      if (action) {\n        const eventProxy = {\n          detail: {\n            [actionName]: detail,\n          },\n          target: element,\n        };\n        action(eventProxy);\n        // The action has been consumed: no need to keep it.\n        delete storedData[actionName];\n      }\n    }\n  }\n\n  /**\n   * Create quadrilaterals from the annotation's quadpoints.\n   *\n   * @private\n   * @memberof AnnotationElement\n   */\n  _createQuadrilaterals() {\n    if (!this.container) {\n      return;\n    }\n    const { quadPoints } = this.data;\n    if (!quadPoints) {\n      return;\n    }\n\n    const [rectBlX, rectBlY, rectTrX, rectTrY] = this.data.rect;\n\n    if (quadPoints.length === 1) {\n      const [, { x: trX, y: trY }, { x: blX, y: blY }] = quadPoints[0];\n      if (\n        rectTrX === trX &&\n        rectTrY === trY &&\n        rectBlX === blX &&\n        rectBlY === blY\n      ) {\n        // The quadpoints cover the whole annotation rectangle, so no need to\n        // create a quadrilateral.\n        return;\n      }\n    }\n\n    const { style } = this.container;\n    let svgBuffer;\n    if (this.#hasBorder) {\n      const { borderColor, borderWidth } = style;\n      style.borderWidth = 0;\n      svgBuffer = [\n        \"url('data:image/svg+xml;utf8,\",\n        `<svg xmlns=\"http://www.w3.org/2000/svg\"`,\n        ` preserveAspectRatio=\"none\" viewBox=\"0 0 1 1\">`,\n        `<g fill=\"transparent\" stroke=\"${borderColor}\" stroke-width=\"${borderWidth}\">`,\n      ];\n      this.container.classList.add(\"hasBorder\");\n    }\n\n    if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n      this.container.classList.add(\"hasClipPath\");\n    }\n\n    const width = rectTrX - rectBlX;\n    const height = rectTrY - rectBlY;\n\n    const { svgFactory } = this;\n    const svg = svgFactory.createElement(\"svg\");\n    svg.classList.add(\"quadrilateralsContainer\");\n    svg.setAttribute(\"width\", 0);\n    svg.setAttribute(\"height\", 0);\n    const defs = svgFactory.createElement(\"defs\");\n    svg.append(defs);\n    const clipPath = svgFactory.createElement(\"clipPath\");\n    const id = `clippath_${this.data.id}`;\n    clipPath.setAttribute(\"id\", id);\n    clipPath.setAttribute(\"clipPathUnits\", \"objectBoundingBox\");\n    defs.append(clipPath);\n\n    for (const [, { x: trX, y: trY }, { x: blX, y: blY }] of quadPoints) {\n      const rect = svgFactory.createElement(\"rect\");\n      const x = (blX - rectBlX) / width;\n      const y = (rectTrY - trY) / height;\n      const rectWidth = (trX - blX) / width;\n      const rectHeight = (trY - blY) / height;\n      rect.setAttribute(\"x\", x);\n      rect.setAttribute(\"y\", y);\n      rect.setAttribute(\"width\", rectWidth);\n      rect.setAttribute(\"height\", rectHeight);\n      clipPath.append(rect);\n      svgBuffer?.push(\n        `<rect vector-effect=\"non-scaling-stroke\" x=\"${x}\" y=\"${y}\" width=\"${rectWidth}\" height=\"${rectHeight}\"/>`\n      );\n    }\n\n    if (this.#hasBorder) {\n      svgBuffer.push(`</g></svg>')`);\n      style.backgroundImage = svgBuffer.join(\"\");\n    }\n\n    this.container.append(svg);\n    this.container.style.clipPath = `url(#${id})`;\n  }\n\n  /**\n   * Create a popup for the annotation's HTML element. This is used for\n   * annotations that do not have a Popup entry in the dictionary, but\n   * are of a type that works with popups (such as Highlight annotations).\n   *\n   * @private\n   * @memberof AnnotationElement\n   */\n  _createPopup() {\n    const { container, data } = this;\n    container.setAttribute(\"aria-haspopup\", \"dialog\");\n\n    const popup = new PopupAnnotationElement({\n      data: {\n        color: data.color,\n        titleObj: data.titleObj,\n        modificationDate: data.modificationDate,\n        contentsObj: data.contentsObj,\n        richText: data.richText,\n        parentRect: data.rect,\n        borderStyle: 0,\n        id: `popup_${data.id}`,\n        rotation: data.rotation,\n      },\n      parent: this.parent,\n      elements: [this],\n    });\n    this.parent.div.append(popup.render());\n  }\n\n  /**\n   * Render the annotation's HTML element(s).\n   *\n   * @public\n   * @memberof AnnotationElement\n   */\n  render() {\n    unreachable(\"Abstract method `AnnotationElement.render` called\");\n  }\n\n  /**\n   * @private\n   * @returns {Array}\n   */\n  _getElementsByName(name, skipId = null) {\n    const fields = [];\n\n    if (this._fieldObjects) {\n      const fieldObj = this._fieldObjects[name];\n      if (fieldObj) {\n        for (const { page, id, exportValues } of fieldObj) {\n          if (page === -1) {\n            continue;\n          }\n          if (id === skipId) {\n            continue;\n          }\n          const exportValue =\n            typeof exportValues === \"string\" ? exportValues : null;\n\n          const domElement = document.querySelector(\n            `[data-element-id=\"${id}\"]`\n          );\n          if (domElement && !GetElementsByNameSet.has(domElement)) {\n            warn(`_getElementsByName - element not allowed: ${id}`);\n            continue;\n          }\n          fields.push({ id, exportValue, domElement });\n        }\n      }\n      return fields;\n    }\n    // Fallback to a regular DOM lookup, to ensure that the standalone\n    // viewer components won't break.\n    for (const domElement of document.getElementsByName(name)) {\n      const { exportValue } = domElement;\n      const id = domElement.getAttribute(\"data-element-id\");\n      if (id === skipId) {\n        continue;\n      }\n      if (!GetElementsByNameSet.has(domElement)) {\n        continue;\n      }\n      fields.push({ id, exportValue, domElement });\n    }\n    return fields;\n  }\n\n  show() {\n    if (this.container) {\n      this.container.hidden = false;\n    }\n    this.popup?.maybeShow();\n  }\n\n  hide() {\n    if (this.container) {\n      this.container.hidden = true;\n    }\n    this.popup?.forceHide();\n  }\n\n  /**\n   * Get the HTML element(s) which can trigger a popup when clicked or hovered.\n   *\n   * @public\n   * @memberof AnnotationElement\n   * @returns {Array<HTMLElement>|HTMLElement} An array of elements or an\n   *          element.\n   */\n  getElementsToTriggerPopup() {\n    return this.container;\n  }\n\n  addHighlightArea() {\n    const triggers = this.getElementsToTriggerPopup();\n    if (Array.isArray(triggers)) {\n      for (const element of triggers) {\n        element.classList.add(\"highlightArea\");\n      }\n    } else {\n      triggers.classList.add(\"highlightArea\");\n    }\n  }\n\n  get _isEditable() {\n    return false;\n  }\n\n  _editOnDoubleClick() {\n    if (!this._isEditable) {\n      return;\n    }\n    const {\n      annotationEditorType: mode,\n      data: { id: editId },\n    } = this;\n    this.container.addEventListener(\"dblclick\", () => {\n      this.linkService.eventBus?.dispatch(\"switchannotationeditormode\", {\n        source: this,\n        mode,\n        editId,\n      });\n    });\n  }\n}\n\nclass LinkAnnotationElement extends AnnotationElement {\n  constructor(parameters, options = null) {\n    super(parameters, {\n      isRenderable: true,\n      ignoreBorder: !!options?.ignoreBorder,\n      createQuadrilaterals: true,\n    });\n    this.isTooltipOnly = parameters.data.isTooltipOnly;\n  }\n\n  render() {\n    const { data, linkService } = this;\n    const link = document.createElement(\"a\");\n    link.setAttribute(\"data-element-id\", data.id);\n    let isBound = false;\n\n    if (data.url) {\n      linkService.addLinkAttributes(link, data.url, data.newWindow);\n      isBound = true;\n    } else if (data.action) {\n      this._bindNamedAction(link, data.action);\n      isBound = true;\n    } else if (data.attachment) {\n      this.#bindAttachment(link, data.attachment, data.attachmentDest);\n      isBound = true;\n    } else if (data.setOCGState) {\n      this.#bindSetOCGState(link, data.setOCGState);\n      isBound = true;\n    } else if (data.dest) {\n      this._bindLink(link, data.dest);\n      isBound = true;\n    } else {\n      if (\n        data.actions &&\n        (data.actions.Action ||\n          data.actions[\"Mouse Up\"] ||\n          data.actions[\"Mouse Down\"]) &&\n        this.enableScripting &&\n        this.hasJSActions\n      ) {\n        this._bindJSAction(link, data);\n        isBound = true;\n      }\n\n      if (data.resetForm) {\n        this._bindResetFormAction(link, data.resetForm);\n        isBound = true;\n      } else if (this.isTooltipOnly && !isBound) {\n        this._bindLink(link, \"\");\n        isBound = true;\n      }\n    }\n\n    this.container.classList.add(\"linkAnnotation\");\n    if (isBound) {\n      this.container.append(link);\n    }\n\n    return this.container;\n  }\n\n  #setInternalLink() {\n    this.container.setAttribute(\"data-internal-link\", \"\");\n  }\n\n  /**\n   * Bind internal links to the link element.\n   *\n   * @private\n   * @param {Object} link\n   * @param {Object} destination\n   * @memberof LinkAnnotationElement\n   */\n  _bindLink(link, destination) {\n    link.href = this.linkService.getDestinationHash(destination);\n    link.onclick = () => {\n      if (destination) {\n        this.linkService.goToDestination(destination);\n      }\n      return false;\n    };\n    if (destination || destination === /* isTooltipOnly = */ \"\") {\n      this.#setInternalLink();\n    }\n  }\n\n  /**\n   * Bind named actions to the link element.\n   *\n   * @private\n   * @param {Object} link\n   * @param {Object} action\n   * @memberof LinkAnnotationElement\n   */\n  _bindNamedAction(link, action) {\n    link.href = this.linkService.getAnchorUrl(\"\");\n    link.onclick = () => {\n      this.linkService.executeNamedAction(action);\n      return false;\n    };\n    this.#setInternalLink();\n  }\n\n  /**\n   * Bind attachments to the link element.\n   * @param {Object} link\n   * @param {Object} attachment\n   * @param {str} [dest]\n   */\n  #bindAttachment(link, attachment, dest = null) {\n    link.href = this.linkService.getAnchorUrl(\"\");\n    link.onclick = () => {\n      this.downloadManager?.openOrDownloadData(\n        attachment.content,\n        attachment.filename,\n        dest\n      );\n      return false;\n    };\n    this.#setInternalLink();\n  }\n\n  /**\n   * Bind SetOCGState actions to the link element.\n   * @param {Object} link\n   * @param {Object} action\n   */\n  #bindSetOCGState(link, action) {\n    link.href = this.linkService.getAnchorUrl(\"\");\n    link.onclick = () => {\n      this.linkService.executeSetOCGState(action);\n      return false;\n    };\n    this.#setInternalLink();\n  }\n\n  /**\n   * Bind JS actions to the link element.\n   *\n   * @private\n   * @param {Object} link\n   * @param {Object} data\n   * @memberof LinkAnnotationElement\n   */\n  _bindJSAction(link, data) {\n    link.href = this.linkService.getAnchorUrl(\"\");\n    const map = new Map([\n      [\"Action\", \"onclick\"],\n      [\"Mouse Up\", \"onmouseup\"],\n      [\"Mouse Down\", \"onmousedown\"],\n    ]);\n    for (const name of Object.keys(data.actions)) {\n      const jsName = map.get(name);\n      if (!jsName) {\n        continue;\n      }\n      link[jsName] = () => {\n        this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n          source: this,\n          detail: {\n            id: data.id,\n            name,\n          },\n        });\n        return false;\n      };\n    }\n\n    if (!link.onclick) {\n      link.onclick = () => false;\n    }\n    this.#setInternalLink();\n  }\n\n  _bindResetFormAction(link, resetForm) {\n    const otherClickAction = link.onclick;\n    if (!otherClickAction) {\n      link.href = this.linkService.getAnchorUrl(\"\");\n    }\n    this.#setInternalLink();\n\n    if (!this._fieldObjects) {\n      warn(\n        `_bindResetFormAction - \"resetForm\" action not supported, ` +\n          \"ensure that the `fieldObjects` parameter is provided.\"\n      );\n      if (!otherClickAction) {\n        link.onclick = () => false;\n      }\n      return;\n    }\n\n    link.onclick = () => {\n      otherClickAction?.();\n\n      const {\n        fields: resetFormFields,\n        refs: resetFormRefs,\n        include,\n      } = resetForm;\n\n      const allFields = [];\n      if (resetFormFields.length !== 0 || resetFormRefs.length !== 0) {\n        const fieldIds = new Set(resetFormRefs);\n        for (const fieldName of resetFormFields) {\n          const fields = this._fieldObjects[fieldName] || [];\n          for (const { id } of fields) {\n            fieldIds.add(id);\n          }\n        }\n        for (const fields of Object.values(this._fieldObjects)) {\n          for (const field of fields) {\n            if (fieldIds.has(field.id) === include) {\n              allFields.push(field);\n            }\n          }\n        }\n      } else {\n        for (const fields of Object.values(this._fieldObjects)) {\n          allFields.push(...fields);\n        }\n      }\n\n      const storage = this.annotationStorage;\n      const allIds = [];\n      for (const field of allFields) {\n        const { id } = field;\n        allIds.push(id);\n        switch (field.type) {\n          case \"text\": {\n            const value = field.defaultValue || \"\";\n            storage.setValue(id, { value });\n            break;\n          }\n          case \"checkbox\":\n          case \"radiobutton\": {\n            const value = field.defaultValue === field.exportValues;\n            storage.setValue(id, { value });\n            break;\n          }\n          case \"combobox\":\n          case \"listbox\": {\n            const value = field.defaultValue || \"\";\n            storage.setValue(id, { value });\n            break;\n          }\n          default:\n            continue;\n        }\n\n        const domElement = document.querySelector(`[data-element-id=\"${id}\"]`);\n        if (!domElement) {\n          continue;\n        } else if (!GetElementsByNameSet.has(domElement)) {\n          warn(`_bindResetFormAction - element not allowed: ${id}`);\n          continue;\n        }\n        domElement.dispatchEvent(new Event(\"resetform\"));\n      }\n\n      if (this.enableScripting) {\n        // Update the values in the sandbox.\n        this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n          source: this,\n          detail: {\n            id: \"app\",\n            ids: allIds,\n            name: \"ResetForm\",\n          },\n        });\n      }\n\n      return false;\n    };\n  }\n}\n\nclass TextAnnotationElement extends AnnotationElement {\n  constructor(parameters) {\n    super(parameters, { isRenderable: true });\n  }\n\n  render() {\n    this.container.classList.add(\"textAnnotation\");\n\n    const image = document.createElement(\"img\");\n    image.src =\n      this.imageResourcesPath +\n      \"annotation-\" +\n      this.data.name.toLowerCase() +\n      \".svg\";\n    image.setAttribute(\"data-l10n-id\", \"pdfjs-text-annotation-type\");\n    image.setAttribute(\n      \"data-l10n-args\",\n      JSON.stringify({ type: this.data.name })\n    );\n\n    if (!this.data.popupRef && this.hasPopupData) {\n      this._createPopup();\n    }\n\n    this.container.append(image);\n    return this.container;\n  }\n}\n\nclass WidgetAnnotationElement extends AnnotationElement {\n  render() {\n    // Show only the container for unsupported field types.\n    if (this.data.alternativeText) {\n      this.container.title = this.data.alternativeText;\n    }\n\n    return this.container;\n  }\n\n  showElementAndHideCanvas(element) {\n    if (this.data.hasOwnCanvas) {\n      if (element.previousSibling?.nodeName === \"CANVAS\") {\n        element.previousSibling.hidden = true;\n      }\n      element.hidden = false;\n    }\n  }\n\n  _getKeyModifier(event) {\n    return FeatureTest.platform.isMac ? event.metaKey : event.ctrlKey;\n  }\n\n  _setEventListener(element, elementData, baseName, eventName, valueGetter) {\n    if (baseName.includes(\"mouse\")) {\n      // Mouse events\n      element.addEventListener(baseName, event => {\n        this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n          source: this,\n          detail: {\n            id: this.data.id,\n            name: eventName,\n            value: valueGetter(event),\n            shift: event.shiftKey,\n            modifier: this._getKeyModifier(event),\n          },\n        });\n      });\n    } else {\n      // Non-mouse events\n      element.addEventListener(baseName, event => {\n        if (baseName === \"blur\") {\n          if (!elementData.focused || !event.relatedTarget) {\n            return;\n          }\n          elementData.focused = false;\n        } else if (baseName === \"focus\") {\n          if (elementData.focused) {\n            return;\n          }\n          elementData.focused = true;\n        }\n\n        if (!valueGetter) {\n          return;\n        }\n\n        this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n          source: this,\n          detail: {\n            id: this.data.id,\n            name: eventName,\n            value: valueGetter(event),\n          },\n        });\n      });\n    }\n  }\n\n  _setEventListeners(element, elementData, names, getter) {\n    for (const [baseName, eventName] of names) {\n      if (eventName === \"Action\" || this.data.actions?.[eventName]) {\n        if (eventName === \"Focus\" || eventName === \"Blur\") {\n          elementData ||= { focused: false };\n        }\n        this._setEventListener(\n          element,\n          elementData,\n          baseName,\n          eventName,\n          getter\n        );\n        if (eventName === \"Focus\" && !this.data.actions?.Blur) {\n          // Ensure that elementData will have the correct value.\n          this._setEventListener(element, elementData, \"blur\", \"Blur\", null);\n        } else if (eventName === \"Blur\" && !this.data.actions?.Focus) {\n          this._setEventListener(element, elementData, \"focus\", \"Focus\", null);\n        }\n      }\n    }\n  }\n\n  _setBackgroundColor(element) {\n    const color = this.data.backgroundColor || null;\n    element.style.backgroundColor =\n      color === null\n        ? \"transparent\"\n        : Util.makeHexColor(color[0], color[1], color[2]);\n  }\n\n  /**\n   * Apply text styles to the text in the element.\n   *\n   * @private\n   * @param {HTMLDivElement} element\n   * @memberof TextWidgetAnnotationElement\n   */\n  _setTextStyle(element) {\n    const TEXT_ALIGNMENT = [\"left\", \"center\", \"right\"];\n    const { fontColor } = this.data.defaultAppearanceData;\n    const fontSize =\n      this.data.defaultAppearanceData.fontSize || DEFAULT_FONT_SIZE;\n\n    const style = element.style;\n\n    // TODO: If the font-size is zero, calculate it based on the height and\n    //       width of the element.\n    // Not setting `style.fontSize` will use the default font-size for now.\n\n    // We don't use the font, as specified in the PDF document, for the <input>\n    // element. Hence using the original `fontSize` could look bad, which is why\n    // it's instead based on the field height.\n    // If the height is \"big\" then it could lead to a too big font size\n    // so in this case use the one we've in the pdf (hence the min).\n    let computedFontSize;\n    const BORDER_SIZE = 2;\n    const roundToOneDecimal = x => Math.round(10 * x) / 10;\n    if (this.data.multiLine) {\n      const height = Math.abs(\n        this.data.rect[3] - this.data.rect[1] - BORDER_SIZE\n      );\n      const numberOfLines = Math.round(height / (LINE_FACTOR * fontSize)) || 1;\n      const lineHeight = height / numberOfLines;\n      computedFontSize = Math.min(\n        fontSize,\n        roundToOneDecimal(lineHeight / LINE_FACTOR)\n      );\n    } else {\n      const height = Math.abs(\n        this.data.rect[3] - this.data.rect[1] - BORDER_SIZE\n      );\n      computedFontSize = Math.min(\n        fontSize,\n        roundToOneDecimal(height / LINE_FACTOR)\n      );\n    }\n    style.fontSize = `calc(${computedFontSize}px * var(--scale-factor))`;\n\n    style.color = Util.makeHexColor(fontColor[0], fontColor[1], fontColor[2]);\n\n    if (this.data.textAlignment !== null) {\n      style.textAlign = TEXT_ALIGNMENT[this.data.textAlignment];\n    }\n  }\n\n  _setRequired(element, isRequired) {\n    if (isRequired) {\n      element.setAttribute(\"required\", true);\n    } else {\n      element.removeAttribute(\"required\");\n    }\n    element.setAttribute(\"aria-required\", isRequired);\n  }\n}\n\nclass TextWidgetAnnotationElement extends WidgetAnnotationElement {\n  constructor(parameters) {\n    const isRenderable =\n      parameters.renderForms ||\n      parameters.data.hasOwnCanvas ||\n      (!parameters.data.hasAppearance && !!parameters.data.fieldValue);\n    super(parameters, { isRenderable });\n  }\n\n  setPropertyOnSiblings(base, key, value, keyInStorage) {\n    const storage = this.annotationStorage;\n    for (const element of this._getElementsByName(\n      base.name,\n      /* skipId = */ base.id\n    )) {\n      if (element.domElement) {\n        element.domElement[key] = value;\n      }\n      storage.setValue(element.id, { [keyInStorage]: value });\n    }\n  }\n\n  render() {\n    const storage = this.annotationStorage;\n    const id = this.data.id;\n\n    this.container.classList.add(\"textWidgetAnnotation\");\n\n    let element = null;\n    if (this.renderForms) {\n      // NOTE: We cannot set the values using `element.value` below, since it\n      //       prevents the AnnotationLayer rasterizer in `test/driver.js`\n      //       from parsing the elements correctly for the reference tests.\n      const storedData = storage.getValue(id, {\n        value: this.data.fieldValue,\n      });\n      let textContent = storedData.value || \"\";\n      const maxLen = storage.getValue(id, {\n        charLimit: this.data.maxLen,\n      }).charLimit;\n      if (maxLen && textContent.length > maxLen) {\n        textContent = textContent.slice(0, maxLen);\n      }\n\n      let fieldFormattedValues =\n        storedData.formattedValue || this.data.textContent?.join(\"\\n\") || null;\n      if (fieldFormattedValues && this.data.comb) {\n        fieldFormattedValues = fieldFormattedValues.replaceAll(/\\s+/g, \"\");\n      }\n\n      const elementData = {\n        userValue: textContent,\n        formattedValue: fieldFormattedValues,\n        lastCommittedValue: null,\n        commitKey: 1,\n        focused: false,\n      };\n\n      if (this.data.multiLine) {\n        element = document.createElement(\"textarea\");\n        element.textContent = fieldFormattedValues ?? textContent;\n        if (this.data.doNotScroll) {\n          element.style.overflowY = \"hidden\";\n        }\n      } else {\n        element = document.createElement(\"input\");\n        element.type = \"text\";\n        element.setAttribute(\"value\", fieldFormattedValues ?? textContent);\n        if (this.data.doNotScroll) {\n          element.style.overflowX = \"hidden\";\n        }\n      }\n      if (this.data.hasOwnCanvas) {\n        element.hidden = true;\n      }\n      GetElementsByNameSet.add(element);\n      element.setAttribute(\"data-element-id\", id);\n\n      element.disabled = this.data.readOnly;\n      element.name = this.data.fieldName;\n      element.tabIndex = DEFAULT_TAB_INDEX;\n\n      this._setRequired(element, this.data.required);\n\n      if (maxLen) {\n        element.maxLength = maxLen;\n      }\n\n      element.addEventListener(\"input\", event => {\n        storage.setValue(id, { value: event.target.value });\n        this.setPropertyOnSiblings(\n          element,\n          \"value\",\n          event.target.value,\n          \"value\"\n        );\n        elementData.formattedValue = null;\n      });\n\n      element.addEventListener(\"resetform\", event => {\n        const defaultValue = this.data.defaultFieldValue ?? \"\";\n        element.value = elementData.userValue = defaultValue;\n        elementData.formattedValue = null;\n      });\n\n      let blurListener = event => {\n        const { formattedValue } = elementData;\n        if (formattedValue !== null && formattedValue !== undefined) {\n          event.target.value = formattedValue;\n        }\n        // Reset the cursor position to the start of the field (issue 12359).\n        event.target.scrollLeft = 0;\n      };\n\n      if (this.enableScripting && this.hasJSActions) {\n        element.addEventListener(\"focus\", event => {\n          if (elementData.focused) {\n            return;\n          }\n          const { target } = event;\n          if (elementData.userValue) {\n            target.value = elementData.userValue;\n          }\n          elementData.lastCommittedValue = target.value;\n          elementData.commitKey = 1;\n          if (!this.data.actions?.Focus) {\n            elementData.focused = true;\n          }\n        });\n\n        element.addEventListener(\"updatefromsandbox\", jsEvent => {\n          this.showElementAndHideCanvas(jsEvent.target);\n          const actions = {\n            value(event) {\n              elementData.userValue = event.detail.value ?? \"\";\n              storage.setValue(id, { value: elementData.userValue.toString() });\n              event.target.value = elementData.userValue;\n            },\n            formattedValue(event) {\n              const { formattedValue } = event.detail;\n              elementData.formattedValue = formattedValue;\n              if (\n                formattedValue !== null &&\n                formattedValue !== undefined &&\n                event.target !== document.activeElement\n              ) {\n                // Input hasn't the focus so display formatted string\n                event.target.value = formattedValue;\n              }\n              storage.setValue(id, {\n                formattedValue,\n              });\n            },\n            selRange(event) {\n              event.target.setSelectionRange(...event.detail.selRange);\n            },\n            charLimit: event => {\n              const { charLimit } = event.detail;\n              const { target } = event;\n              if (charLimit === 0) {\n                target.removeAttribute(\"maxLength\");\n                return;\n              }\n\n              target.setAttribute(\"maxLength\", charLimit);\n              let value = elementData.userValue;\n              if (!value || value.length <= charLimit) {\n                return;\n              }\n              value = value.slice(0, charLimit);\n              target.value = elementData.userValue = value;\n              storage.setValue(id, { value });\n\n              this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n                source: this,\n                detail: {\n                  id,\n                  name: \"Keystroke\",\n                  value,\n                  willCommit: true,\n                  commitKey: 1,\n                  selStart: target.selectionStart,\n                  selEnd: target.selectionEnd,\n                },\n              });\n            },\n          };\n          this._dispatchEventFromSandbox(actions, jsEvent);\n        });\n\n        // Even if the field hasn't any actions\n        // leaving it can still trigger some actions with Calculate\n        element.addEventListener(\"keydown\", event => {\n          elementData.commitKey = 1;\n          // If the key is one of Escape, Enter then the data are committed.\n          // If we've a Tab then data will be committed on blur.\n          let commitKey = -1;\n          if (event.key === \"Escape\") {\n            commitKey = 0;\n          } else if (event.key === \"Enter\" && !this.data.multiLine) {\n            // When we've a multiline field, \"Enter\" key is a key as the other\n            // hence we don't commit the data (Acrobat behaves the same way)\n            // (see issue #15627).\n            commitKey = 2;\n          } else if (event.key === \"Tab\") {\n            elementData.commitKey = 3;\n          }\n          if (commitKey === -1) {\n            return;\n          }\n          const { value } = event.target;\n          if (elementData.lastCommittedValue === value) {\n            return;\n          }\n          elementData.lastCommittedValue = value;\n          // Save the entered value\n          elementData.userValue = value;\n          this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n            source: this,\n            detail: {\n              id,\n              name: \"Keystroke\",\n              value,\n              willCommit: true,\n              commitKey,\n              selStart: event.target.selectionStart,\n              selEnd: event.target.selectionEnd,\n            },\n          });\n        });\n        const _blurListener = blurListener;\n        blurListener = null;\n        element.addEventListener(\"blur\", event => {\n          if (!elementData.focused || !event.relatedTarget) {\n            return;\n          }\n          if (!this.data.actions?.Blur) {\n            elementData.focused = false;\n          }\n          const { value } = event.target;\n          elementData.userValue = value;\n          if (elementData.lastCommittedValue !== value) {\n            this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n              source: this,\n              detail: {\n                id,\n                name: \"Keystroke\",\n                value,\n                willCommit: true,\n                commitKey: elementData.commitKey,\n                selStart: event.target.selectionStart,\n                selEnd: event.target.selectionEnd,\n              },\n            });\n          }\n          _blurListener(event);\n        });\n\n        if (this.data.actions?.Keystroke) {\n          element.addEventListener(\"beforeinput\", event => {\n            elementData.lastCommittedValue = null;\n            const { data, target } = event;\n            const { value, selectionStart, selectionEnd } = target;\n\n            let selStart = selectionStart,\n              selEnd = selectionEnd;\n\n            switch (event.inputType) {\n              // https://rawgit.com/w3c/input-events/v1/index.html#interface-InputEvent-Attributes\n              case \"deleteWordBackward\": {\n                const match = value\n                  .substring(0, selectionStart)\n                  .match(/\\w*[^\\w]*$/);\n                if (match) {\n                  selStart -= match[0].length;\n                }\n                break;\n              }\n              case \"deleteWordForward\": {\n                const match = value\n                  .substring(selectionStart)\n                  .match(/^[^\\w]*\\w*/);\n                if (match) {\n                  selEnd += match[0].length;\n                }\n                break;\n              }\n              case \"deleteContentBackward\":\n                if (selectionStart === selectionEnd) {\n                  selStart -= 1;\n                }\n                break;\n              case \"deleteContentForward\":\n                if (selectionStart === selectionEnd) {\n                  selEnd += 1;\n                }\n                break;\n            }\n\n            // We handle the event ourselves.\n            event.preventDefault();\n            this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n              source: this,\n              detail: {\n                id,\n                name: \"Keystroke\",\n                value,\n                change: data || \"\",\n                willCommit: false,\n                selStart,\n                selEnd,\n              },\n            });\n          });\n        }\n\n        this._setEventListeners(\n          element,\n          elementData,\n          [\n            [\"focus\", \"Focus\"],\n            [\"blur\", \"Blur\"],\n            [\"mousedown\", \"Mouse Down\"],\n            [\"mouseenter\", \"Mouse Enter\"],\n            [\"mouseleave\", \"Mouse Exit\"],\n            [\"mouseup\", \"Mouse Up\"],\n          ],\n          event => event.target.value\n        );\n      }\n\n      if (blurListener) {\n        element.addEventListener(\"blur\", blurListener);\n      }\n\n      if (this.data.comb) {\n        const fieldWidth = this.data.rect[2] - this.data.rect[0];\n        const combWidth = fieldWidth / maxLen;\n\n        element.classList.add(\"comb\");\n        element.style.letterSpacing = `calc(${combWidth}px * var(--scale-factor) - 1ch)`;\n      }\n    } else {\n      element = document.createElement(\"div\");\n      element.textContent = this.data.fieldValue;\n      element.style.verticalAlign = \"middle\";\n      element.style.display = \"table-cell\";\n\n      if (this.data.hasOwnCanvas) {\n        element.hidden = true;\n      }\n    }\n\n    this._setTextStyle(element);\n    this._setBackgroundColor(element);\n    this._setDefaultPropertiesFromJS(element);\n\n    this.container.append(element);\n    return this.container;\n  }\n}\n\nclass SignatureWidgetAnnotationElement extends WidgetAnnotationElement {\n  constructor(parameters) {\n    super(parameters, { isRenderable: !!parameters.data.hasOwnCanvas });\n  }\n}\n\nclass CheckboxWidgetAnnotationElement extends WidgetAnnotationElement {\n  constructor(parameters) {\n    super(parameters, { isRenderable: parameters.renderForms });\n  }\n\n  render() {\n    const storage = this.annotationStorage;\n    const data = this.data;\n    const id = data.id;\n    let value = storage.getValue(id, {\n      value: data.exportValue === data.fieldValue,\n    }).value;\n    if (typeof value === \"string\") {\n      // The value has been changed through js and set in annotationStorage.\n      value = value !== \"Off\";\n      storage.setValue(id, { value });\n    }\n\n    this.container.classList.add(\"buttonWidgetAnnotation\", \"checkBox\");\n\n    const element = document.createElement(\"input\");\n    GetElementsByNameSet.add(element);\n    element.setAttribute(\"data-element-id\", id);\n\n    element.disabled = data.readOnly;\n    this._setRequired(element, this.data.required);\n    element.type = \"checkbox\";\n    element.name = data.fieldName;\n    if (value) {\n      element.setAttribute(\"checked\", true);\n    }\n    element.setAttribute(\"exportValue\", data.exportValue);\n    element.tabIndex = DEFAULT_TAB_INDEX;\n\n    element.addEventListener(\"change\", event => {\n      const { name, checked } = event.target;\n      for (const checkbox of this._getElementsByName(name, /* skipId = */ id)) {\n        const curChecked = checked && checkbox.exportValue === data.exportValue;\n        if (checkbox.domElement) {\n          checkbox.domElement.checked = curChecked;\n        }\n        storage.setValue(checkbox.id, { value: curChecked });\n      }\n      storage.setValue(id, { value: checked });\n    });\n\n    element.addEventListener(\"resetform\", event => {\n      const defaultValue = data.defaultFieldValue || \"Off\";\n      event.target.checked = defaultValue === data.exportValue;\n    });\n\n    if (this.enableScripting && this.hasJSActions) {\n      element.addEventListener(\"updatefromsandbox\", jsEvent => {\n        const actions = {\n          value(event) {\n            event.target.checked = event.detail.value !== \"Off\";\n            storage.setValue(id, { value: event.target.checked });\n          },\n        };\n        this._dispatchEventFromSandbox(actions, jsEvent);\n      });\n\n      this._setEventListeners(\n        element,\n        null,\n        [\n          [\"change\", \"Validate\"],\n          [\"change\", \"Action\"],\n          [\"focus\", \"Focus\"],\n          [\"blur\", \"Blur\"],\n          [\"mousedown\", \"Mouse Down\"],\n          [\"mouseenter\", \"Mouse Enter\"],\n          [\"mouseleave\", \"Mouse Exit\"],\n          [\"mouseup\", \"Mouse Up\"],\n        ],\n        event => event.target.checked\n      );\n    }\n\n    this._setBackgroundColor(element);\n    this._setDefaultPropertiesFromJS(element);\n\n    this.container.append(element);\n    return this.container;\n  }\n}\n\nclass RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement {\n  constructor(parameters) {\n    super(parameters, { isRenderable: parameters.renderForms });\n  }\n\n  render() {\n    this.container.classList.add(\"buttonWidgetAnnotation\", \"radioButton\");\n    const storage = this.annotationStorage;\n    const data = this.data;\n    const id = data.id;\n    let value = storage.getValue(id, {\n      value: data.fieldValue === data.buttonValue,\n    }).value;\n    if (typeof value === \"string\") {\n      // The value has been changed through js and set in annotationStorage.\n      value = value !== data.buttonValue;\n      storage.setValue(id, { value });\n    }\n\n    if (value) {\n      // It's possible that multiple radio buttons are checked.\n      // So if this one is checked we just reset the other ones.\n      // (see bug 1864136). Then when the other ones will be rendered they will\n      // unchecked (because of their value in the storage).\n      // Consequently, the first checked radio button will be the only checked\n      // one.\n      for (const radio of this._getElementsByName(\n        data.fieldName,\n        /* skipId = */ id\n      )) {\n        storage.setValue(radio.id, { value: false });\n      }\n    }\n\n    const element = document.createElement(\"input\");\n    GetElementsByNameSet.add(element);\n    element.setAttribute(\"data-element-id\", id);\n\n    element.disabled = data.readOnly;\n    this._setRequired(element, this.data.required);\n    element.type = \"radio\";\n    element.name = data.fieldName;\n    if (value) {\n      element.setAttribute(\"checked\", true);\n    }\n    element.tabIndex = DEFAULT_TAB_INDEX;\n\n    element.addEventListener(\"change\", event => {\n      const { name, checked } = event.target;\n      for (const radio of this._getElementsByName(name, /* skipId = */ id)) {\n        storage.setValue(radio.id, { value: false });\n      }\n      storage.setValue(id, { value: checked });\n    });\n\n    element.addEventListener(\"resetform\", event => {\n      const defaultValue = data.defaultFieldValue;\n      event.target.checked =\n        defaultValue !== null &&\n        defaultValue !== undefined &&\n        defaultValue === data.buttonValue;\n    });\n\n    if (this.enableScripting && this.hasJSActions) {\n      const pdfButtonValue = data.buttonValue;\n      element.addEventListener(\"updatefromsandbox\", jsEvent => {\n        const actions = {\n          value: event => {\n            const checked = pdfButtonValue === event.detail.value;\n            for (const radio of this._getElementsByName(event.target.name)) {\n              const curChecked = checked && radio.id === id;\n              if (radio.domElement) {\n                radio.domElement.checked = curChecked;\n              }\n              storage.setValue(radio.id, { value: curChecked });\n            }\n          },\n        };\n        this._dispatchEventFromSandbox(actions, jsEvent);\n      });\n\n      this._setEventListeners(\n        element,\n        null,\n        [\n          [\"change\", \"Validate\"],\n          [\"change\", \"Action\"],\n          [\"focus\", \"Focus\"],\n          [\"blur\", \"Blur\"],\n          [\"mousedown\", \"Mouse Down\"],\n          [\"mouseenter\", \"Mouse Enter\"],\n          [\"mouseleave\", \"Mouse Exit\"],\n          [\"mouseup\", \"Mouse Up\"],\n        ],\n        event => event.target.checked\n      );\n    }\n\n    this._setBackgroundColor(element);\n    this._setDefaultPropertiesFromJS(element);\n\n    this.container.append(element);\n    return this.container;\n  }\n}\n\nclass PushButtonWidgetAnnotationElement extends LinkAnnotationElement {\n  constructor(parameters) {\n    super(parameters, { ignoreBorder: parameters.data.hasAppearance });\n  }\n\n  render() {\n    // The rendering and functionality of a push button widget annotation is\n    // equal to that of a link annotation, but may have more functionality, such\n    // as performing actions on form fields (resetting, submitting, et cetera).\n    const container = super.render();\n    container.classList.add(\"buttonWidgetAnnotation\", \"pushButton\");\n\n    if (this.data.alternativeText) {\n      container.title = this.data.alternativeText;\n    }\n\n    const linkElement = container.lastChild;\n    if (this.enableScripting && this.hasJSActions && linkElement) {\n      this._setDefaultPropertiesFromJS(linkElement);\n\n      linkElement.addEventListener(\"updatefromsandbox\", jsEvent => {\n        this._dispatchEventFromSandbox({}, jsEvent);\n      });\n    }\n\n    return container;\n  }\n}\n\nclass ChoiceWidgetAnnotationElement extends WidgetAnnotationElement {\n  constructor(parameters) {\n    super(parameters, { isRenderable: parameters.renderForms });\n  }\n\n  render() {\n    this.container.classList.add(\"choiceWidgetAnnotation\");\n    const storage = this.annotationStorage;\n    const id = this.data.id;\n\n    const storedData = storage.getValue(id, {\n      value: this.data.fieldValue,\n    });\n\n    const selectElement = document.createElement(\"select\");\n    GetElementsByNameSet.add(selectElement);\n    selectElement.setAttribute(\"data-element-id\", id);\n\n    selectElement.disabled = this.data.readOnly;\n    this._setRequired(selectElement, this.data.required);\n    selectElement.name = this.data.fieldName;\n    selectElement.tabIndex = DEFAULT_TAB_INDEX;\n\n    let addAnEmptyEntry = this.data.combo && this.data.options.length > 0;\n\n    if (!this.data.combo) {\n      // List boxes have a size and (optionally) multiple selection.\n      selectElement.size = this.data.options.length;\n      if (this.data.multiSelect) {\n        selectElement.multiple = true;\n      }\n    }\n\n    selectElement.addEventListener(\"resetform\", event => {\n      const defaultValue = this.data.defaultFieldValue;\n      for (const option of selectElement.options) {\n        option.selected = option.value === defaultValue;\n      }\n    });\n\n    // Insert the options into the choice field.\n    for (const option of this.data.options) {\n      const optionElement = document.createElement(\"option\");\n      optionElement.textContent = option.displayValue;\n      optionElement.value = option.exportValue;\n      if (storedData.value.includes(option.exportValue)) {\n        optionElement.setAttribute(\"selected\", true);\n        addAnEmptyEntry = false;\n      }\n      selectElement.append(optionElement);\n    }\n\n    let removeEmptyEntry = null;\n    if (addAnEmptyEntry) {\n      const noneOptionElement = document.createElement(\"option\");\n      noneOptionElement.value = \" \";\n      noneOptionElement.setAttribute(\"hidden\", true);\n      noneOptionElement.setAttribute(\"selected\", true);\n      selectElement.prepend(noneOptionElement);\n\n      removeEmptyEntry = () => {\n        noneOptionElement.remove();\n        selectElement.removeEventListener(\"input\", removeEmptyEntry);\n        removeEmptyEntry = null;\n      };\n      selectElement.addEventListener(\"input\", removeEmptyEntry);\n    }\n\n    const getValue = isExport => {\n      const name = isExport ? \"value\" : \"textContent\";\n      const { options, multiple } = selectElement;\n      if (!multiple) {\n        return options.selectedIndex === -1\n          ? null\n          : options[options.selectedIndex][name];\n      }\n      return Array.prototype.filter\n        .call(options, option => option.selected)\n        .map(option => option[name]);\n    };\n\n    let selectedValues = getValue(/* isExport */ false);\n\n    const getItems = event => {\n      const options = event.target.options;\n      return Array.prototype.map.call(options, option => {\n        return { displayValue: option.textContent, exportValue: option.value };\n      });\n    };\n\n    if (this.enableScripting && this.hasJSActions) {\n      selectElement.addEventListener(\"updatefromsandbox\", jsEvent => {\n        const actions = {\n          value(event) {\n            removeEmptyEntry?.();\n            const value = event.detail.value;\n            const values = new Set(Array.isArray(value) ? value : [value]);\n            for (const option of selectElement.options) {\n              option.selected = values.has(option.value);\n            }\n            storage.setValue(id, {\n              value: getValue(/* isExport */ true),\n            });\n            selectedValues = getValue(/* isExport */ false);\n          },\n          multipleSelection(event) {\n            selectElement.multiple = true;\n          },\n          remove(event) {\n            const options = selectElement.options;\n            const index = event.detail.remove;\n            options[index].selected = false;\n            selectElement.remove(index);\n            if (options.length > 0) {\n              const i = Array.prototype.findIndex.call(\n                options,\n                option => option.selected\n              );\n              if (i === -1) {\n                options[0].selected = true;\n              }\n            }\n            storage.setValue(id, {\n              value: getValue(/* isExport */ true),\n              items: getItems(event),\n            });\n            selectedValues = getValue(/* isExport */ false);\n          },\n          clear(event) {\n            while (selectElement.length !== 0) {\n              selectElement.remove(0);\n            }\n            storage.setValue(id, { value: null, items: [] });\n            selectedValues = getValue(/* isExport */ false);\n          },\n          insert(event) {\n            const { index, displayValue, exportValue } = event.detail.insert;\n            const selectChild = selectElement.children[index];\n            const optionElement = document.createElement(\"option\");\n            optionElement.textContent = displayValue;\n            optionElement.value = exportValue;\n\n            if (selectChild) {\n              selectChild.before(optionElement);\n            } else {\n              selectElement.append(optionElement);\n            }\n            storage.setValue(id, {\n              value: getValue(/* isExport */ true),\n              items: getItems(event),\n            });\n            selectedValues = getValue(/* isExport */ false);\n          },\n          items(event) {\n            const { items } = event.detail;\n            while (selectElement.length !== 0) {\n              selectElement.remove(0);\n            }\n            for (const item of items) {\n              const { displayValue, exportValue } = item;\n              const optionElement = document.createElement(\"option\");\n              optionElement.textContent = displayValue;\n              optionElement.value = exportValue;\n              selectElement.append(optionElement);\n            }\n            if (selectElement.options.length > 0) {\n              selectElement.options[0].selected = true;\n            }\n            storage.setValue(id, {\n              value: getValue(/* isExport */ true),\n              items: getItems(event),\n            });\n            selectedValues = getValue(/* isExport */ false);\n          },\n          indices(event) {\n            const indices = new Set(event.detail.indices);\n            for (const option of event.target.options) {\n              option.selected = indices.has(option.index);\n            }\n            storage.setValue(id, {\n              value: getValue(/* isExport */ true),\n            });\n            selectedValues = getValue(/* isExport */ false);\n          },\n          editable(event) {\n            event.target.disabled = !event.detail.editable;\n          },\n        };\n        this._dispatchEventFromSandbox(actions, jsEvent);\n      });\n\n      selectElement.addEventListener(\"input\", event => {\n        const exportValue = getValue(/* isExport */ true);\n        storage.setValue(id, { value: exportValue });\n\n        event.preventDefault();\n\n        this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n          source: this,\n          detail: {\n            id,\n            name: \"Keystroke\",\n            value: selectedValues,\n            changeEx: exportValue,\n            willCommit: false,\n            commitKey: 1,\n            keyDown: false,\n          },\n        });\n      });\n\n      this._setEventListeners(\n        selectElement,\n        null,\n        [\n          [\"focus\", \"Focus\"],\n          [\"blur\", \"Blur\"],\n          [\"mousedown\", \"Mouse Down\"],\n          [\"mouseenter\", \"Mouse Enter\"],\n          [\"mouseleave\", \"Mouse Exit\"],\n          [\"mouseup\", \"Mouse Up\"],\n          [\"input\", \"Action\"],\n          [\"input\", \"Validate\"],\n        ],\n        event => event.target.value\n      );\n    } else {\n      selectElement.addEventListener(\"input\", function (event) {\n        storage.setValue(id, { value: getValue(/* isExport */ true) });\n      });\n    }\n\n    if (this.data.combo) {\n      this._setTextStyle(selectElement);\n    } else {\n      // Just use the default font size...\n      // it's a bit hard to guess what is a good size.\n    }\n    this._setBackgroundColor(selectElement);\n    this._setDefaultPropertiesFromJS(selectElement);\n\n    this.container.append(selectElement);\n    return this.container;\n  }\n}\n\nclass PopupAnnotationElement extends AnnotationElement {\n  constructor(parameters) {\n    const { data, elements } = parameters;\n    super(parameters, { isRenderable: AnnotationElement._hasPopupData(data) });\n    this.elements = elements;\n  }\n\n  render() {\n    this.container.classList.add(\"popupAnnotation\");\n\n    const popup = new PopupElement({\n      container: this.container,\n      color: this.data.color,\n      titleObj: this.data.titleObj,\n      modificationDate: this.data.modificationDate,\n      contentsObj: this.data.contentsObj,\n      richText: this.data.richText,\n      rect: this.data.rect,\n      parentRect: this.data.parentRect || null,\n      parent: this.parent,\n      elements: this.elements,\n      open: this.data.open,\n    });\n\n    const elementIds = [];\n    for (const element of this.elements) {\n      element.popup = popup;\n      elementIds.push(element.data.id);\n      element.addHighlightArea();\n    }\n\n    this.container.setAttribute(\n      \"aria-controls\",\n      elementIds.map(id => `${AnnotationPrefix}${id}`).join(\",\")\n    );\n\n    return this.container;\n  }\n}\n\nclass PopupElement {\n  #boundKeyDown = this.#keyDown.bind(this);\n\n  #boundHide = this.#hide.bind(this);\n\n  #boundShow = this.#show.bind(this);\n\n  #boundToggle = this.#toggle.bind(this);\n\n  #color = null;\n\n  #container = null;\n\n  #contentsObj = null;\n\n  #dateObj = null;\n\n  #elements = null;\n\n  #parent = null;\n\n  #parentRect = null;\n\n  #pinned = false;\n\n  #popup = null;\n\n  #rect = null;\n\n  #richText = null;\n\n  #titleObj = null;\n\n  #wasVisible = false;\n\n  constructor({\n    container,\n    color,\n    elements,\n    titleObj,\n    modificationDate,\n    contentsObj,\n    richText,\n    parent,\n    rect,\n    parentRect,\n    open,\n  }) {\n    this.#container = container;\n    this.#titleObj = titleObj;\n    this.#contentsObj = contentsObj;\n    this.#richText = richText;\n    this.#parent = parent;\n    this.#color = color;\n    this.#rect = rect;\n    this.#parentRect = parentRect;\n    this.#elements = elements;\n\n    // The modification date is shown in the popup instead of the creation\n    // date if it is available and can be parsed correctly, which is\n    // consistent with other viewers such as Adobe Acrobat.\n    this.#dateObj = PDFDateString.toDateObject(modificationDate);\n\n    this.trigger = elements.flatMap(e => e.getElementsToTriggerPopup());\n    // Attach the event listeners to the trigger element.\n    for (const element of this.trigger) {\n      element.addEventListener(\"click\", this.#boundToggle);\n      element.addEventListener(\"mouseenter\", this.#boundShow);\n      element.addEventListener(\"mouseleave\", this.#boundHide);\n      element.classList.add(\"popupTriggerArea\");\n    }\n\n    // Attach the event listener to toggle the popup with the keyboard.\n    for (const element of elements) {\n      element.container?.addEventListener(\"keydown\", this.#boundKeyDown);\n    }\n\n    this.#container.hidden = true;\n    if (open) {\n      this.#toggle();\n    }\n\n    if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n      // Since the popup is lazily created, we need to ensure that it'll be\n      // created and displayed during reference tests.\n      this.#parent.popupShow.push(async () => {\n        if (this.#container.hidden) {\n          this.#show();\n        }\n      });\n    }\n  }\n\n  render() {\n    if (this.#popup) {\n      return;\n    }\n\n    const {\n      page: { view },\n      viewport: {\n        rawDims: { pageWidth, pageHeight, pageX, pageY },\n      },\n    } = this.#parent;\n    const popup = (this.#popup = document.createElement(\"div\"));\n    popup.className = \"popup\";\n\n    if (this.#color) {\n      const baseColor = (popup.style.outlineColor = Util.makeHexColor(\n        ...this.#color\n      ));\n      if (\n        (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n        CSS.supports(\"background-color\", \"color-mix(in srgb, red 30%, white)\")\n      ) {\n        popup.style.backgroundColor = `color-mix(in srgb, ${baseColor} 30%, white)`;\n      } else {\n        // color-mix isn't supported in some browsers hence this version.\n        // See https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/color-mix#browser_compatibility\n        // TODO: Use color-mix when it's supported everywhere.\n        // Enlighten the color.\n        const BACKGROUND_ENLIGHT = 0.7;\n        popup.style.backgroundColor = Util.makeHexColor(\n          ...this.#color.map(c =>\n            Math.floor(BACKGROUND_ENLIGHT * (255 - c) + c)\n          )\n        );\n      }\n    }\n\n    const header = document.createElement(\"span\");\n    header.className = \"header\";\n    const title = document.createElement(\"h1\");\n    header.append(title);\n    ({ dir: title.dir, str: title.textContent } = this.#titleObj);\n    popup.append(header);\n\n    if (this.#dateObj) {\n      const modificationDate = document.createElement(\"span\");\n      modificationDate.classList.add(\"popupDate\");\n      modificationDate.setAttribute(\n        \"data-l10n-id\",\n        \"pdfjs-annotation-date-string\"\n      );\n      modificationDate.setAttribute(\n        \"data-l10n-args\",\n        JSON.stringify({\n          date: this.#dateObj.toLocaleDateString(),\n          time: this.#dateObj.toLocaleTimeString(),\n        })\n      );\n      header.append(modificationDate);\n    }\n\n    const contentsObj = this.#contentsObj;\n    const richText = this.#richText;\n    if (\n      richText?.str &&\n      (!contentsObj?.str || contentsObj.str === richText.str)\n    ) {\n      XfaLayer.render({\n        xfaHtml: richText.html,\n        intent: \"richText\",\n        div: popup,\n      });\n      popup.lastChild.classList.add(\"richText\", \"popupContent\");\n    } else {\n      const contents = this._formatContents(contentsObj);\n      popup.append(contents);\n    }\n\n    let useParentRect = !!this.#parentRect;\n    let rect = useParentRect ? this.#parentRect : this.#rect;\n    for (const element of this.#elements) {\n      if (!rect || Util.intersect(element.data.rect, rect) !== null) {\n        rect = element.data.rect;\n        useParentRect = true;\n        break;\n      }\n    }\n\n    const normalizedRect = Util.normalizeRect([\n      rect[0],\n      view[3] - rect[1] + view[1],\n      rect[2],\n      view[3] - rect[3] + view[1],\n    ]);\n\n    const HORIZONTAL_SPACE_AFTER_ANNOTATION = 5;\n    const parentWidth = useParentRect\n      ? rect[2] - rect[0] + HORIZONTAL_SPACE_AFTER_ANNOTATION\n      : 0;\n    const popupLeft = normalizedRect[0] + parentWidth;\n    const popupTop = normalizedRect[1];\n\n    const { style } = this.#container;\n    style.left = `${(100 * (popupLeft - pageX)) / pageWidth}%`;\n    style.top = `${(100 * (popupTop - pageY)) / pageHeight}%`;\n\n    this.#container.append(popup);\n  }\n\n  /**\n   * Format the contents of the popup by adding newlines where necessary.\n   *\n   * @private\n   * @param {Object<string, string>} contentsObj\n   * @memberof PopupElement\n   * @returns {HTMLParagraphElement}\n   */\n  _formatContents({ str, dir }) {\n    const p = document.createElement(\"p\");\n    p.classList.add(\"popupContent\");\n    p.dir = dir;\n    const lines = str.split(/(?:\\r\\n?|\\n)/);\n    for (let i = 0, ii = lines.length; i < ii; ++i) {\n      const line = lines[i];\n      p.append(document.createTextNode(line));\n      if (i < ii - 1) {\n        p.append(document.createElement(\"br\"));\n      }\n    }\n    return p;\n  }\n\n  #keyDown(event) {\n    if (event.altKey || event.shiftKey || event.ctrlKey || event.metaKey) {\n      return;\n    }\n\n    if (event.key === \"Enter\" || (event.key === \"Escape\" && this.#pinned)) {\n      this.#toggle();\n    }\n  }\n\n  /**\n   * Toggle the visibility of the popup.\n   */\n  #toggle() {\n    this.#pinned = !this.#pinned;\n    if (this.#pinned) {\n      this.#show();\n      this.#container.addEventListener(\"click\", this.#boundToggle);\n      this.#container.addEventListener(\"keydown\", this.#boundKeyDown);\n    } else {\n      this.#hide();\n      this.#container.removeEventListener(\"click\", this.#boundToggle);\n      this.#container.removeEventListener(\"keydown\", this.#boundKeyDown);\n    }\n  }\n\n  /**\n   * Show the popup.\n   */\n  #show() {\n    if (!this.#popup) {\n      this.render();\n    }\n    if (!this.isVisible) {\n      this.#container.hidden = false;\n      this.#container.style.zIndex =\n        parseInt(this.#container.style.zIndex) + 1000;\n    } else if (this.#pinned) {\n      this.#container.classList.add(\"focused\");\n    }\n  }\n\n  /**\n   * Hide the popup.\n   */\n  #hide() {\n    this.#container.classList.remove(\"focused\");\n    if (this.#pinned || !this.isVisible) {\n      return;\n    }\n    this.#container.hidden = true;\n    this.#container.style.zIndex =\n      parseInt(this.#container.style.zIndex) - 1000;\n  }\n\n  forceHide() {\n    this.#wasVisible = this.isVisible;\n    if (!this.#wasVisible) {\n      return;\n    }\n    this.#container.hidden = true;\n  }\n\n  maybeShow() {\n    if (!this.#wasVisible) {\n      return;\n    }\n    this.#wasVisible = false;\n    this.#container.hidden = false;\n  }\n\n  get isVisible() {\n    return this.#container.hidden === false;\n  }\n}\n\nclass FreeTextAnnotationElement extends AnnotationElement {\n  constructor(parameters) {\n    super(parameters, { isRenderable: true, ignoreBorder: true });\n    this.textContent = parameters.data.textContent;\n    this.textPosition = parameters.data.textPosition;\n    this.annotationEditorType = AnnotationEditorType.FREETEXT;\n  }\n\n  render() {\n    this.container.classList.add(\"freeTextAnnotation\");\n\n    if (this.textContent) {\n      const content = document.createElement(\"div\");\n      content.classList.add(\"annotationTextContent\");\n      content.setAttribute(\"role\", \"comment\");\n      for (const line of this.textContent) {\n        const lineSpan = document.createElement(\"span\");\n        lineSpan.textContent = line;\n        content.append(lineSpan);\n      }\n      this.container.append(content);\n    }\n\n    if (!this.data.popupRef && this.hasPopupData) {\n      this._createPopup();\n    }\n\n    this._editOnDoubleClick();\n\n    return this.container;\n  }\n\n  get _isEditable() {\n    return this.data.hasOwnCanvas;\n  }\n}\n\nclass LineAnnotationElement extends AnnotationElement {\n  #line = null;\n\n  constructor(parameters) {\n    super(parameters, { isRenderable: true, ignoreBorder: true });\n  }\n\n  render() {\n    this.container.classList.add(\"lineAnnotation\");\n\n    // Create an invisible line with the same starting and ending coordinates\n    // that acts as the trigger for the popup. Only the line itself should\n    // trigger the popup, not the entire container.\n    const data = this.data;\n    const { width, height } = getRectDims(data.rect);\n    const svg = this.svgFactory.create(\n      width,\n      height,\n      /* skipDimensions = */ true\n    );\n\n    // PDF coordinates are calculated from a bottom left origin, so transform\n    // the line coordinates to a top left origin for the SVG element.\n    const line = (this.#line = this.svgFactory.createElement(\"svg:line\"));\n    line.setAttribute(\"x1\", data.rect[2] - data.lineCoordinates[0]);\n    line.setAttribute(\"y1\", data.rect[3] - data.lineCoordinates[1]);\n    line.setAttribute(\"x2\", data.rect[2] - data.lineCoordinates[2]);\n    line.setAttribute(\"y2\", data.rect[3] - data.lineCoordinates[3]);\n    // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n    // won't be possible to open/close the popup (note e.g. issue 11122).\n    line.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n    line.setAttribute(\"stroke\", \"transparent\");\n    line.setAttribute(\"fill\", \"transparent\");\n\n    svg.append(line);\n    this.container.append(svg);\n\n    // Create the popup ourselves so that we can bind it to the line instead\n    // of to the entire container (which is the default).\n    if (!data.popupRef && this.hasPopupData) {\n      this._createPopup();\n    }\n\n    return this.container;\n  }\n\n  getElementsToTriggerPopup() {\n    return this.#line;\n  }\n\n  addHighlightArea() {\n    this.container.classList.add(\"highlightArea\");\n  }\n}\n\nclass SquareAnnotationElement extends AnnotationElement {\n  #square = null;\n\n  constructor(parameters) {\n    super(parameters, { isRenderable: true, ignoreBorder: true });\n  }\n\n  render() {\n    this.container.classList.add(\"squareAnnotation\");\n\n    // Create an invisible square with the same rectangle that acts as the\n    // trigger for the popup. Only the square itself should trigger the\n    // popup, not the entire container.\n    const data = this.data;\n    const { width, height } = getRectDims(data.rect);\n    const svg = this.svgFactory.create(\n      width,\n      height,\n      /* skipDimensions = */ true\n    );\n\n    // The browser draws half of the borders inside the square and half of\n    // the borders outside the square by default. This behavior cannot be\n    // changed programmatically, so correct for that here.\n    const borderWidth = data.borderStyle.width;\n    const square = (this.#square = this.svgFactory.createElement(\"svg:rect\"));\n    square.setAttribute(\"x\", borderWidth / 2);\n    square.setAttribute(\"y\", borderWidth / 2);\n    square.setAttribute(\"width\", width - borderWidth);\n    square.setAttribute(\"height\", height - borderWidth);\n    // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n    // won't be possible to open/close the popup (note e.g. issue 11122).\n    square.setAttribute(\"stroke-width\", borderWidth || 1);\n    square.setAttribute(\"stroke\", \"transparent\");\n    square.setAttribute(\"fill\", \"transparent\");\n\n    svg.append(square);\n    this.container.append(svg);\n\n    // Create the popup ourselves so that we can bind it to the square instead\n    // of to the entire container (which is the default).\n    if (!data.popupRef && this.hasPopupData) {\n      this._createPopup();\n    }\n\n    return this.container;\n  }\n\n  getElementsToTriggerPopup() {\n    return this.#square;\n  }\n\n  addHighlightArea() {\n    this.container.classList.add(\"highlightArea\");\n  }\n}\n\nclass CircleAnnotationElement extends AnnotationElement {\n  #circle = null;\n\n  constructor(parameters) {\n    super(parameters, { isRenderable: true, ignoreBorder: true });\n  }\n\n  render() {\n    this.container.classList.add(\"circleAnnotation\");\n\n    // Create an invisible circle with the same ellipse that acts as the\n    // trigger for the popup. Only the circle itself should trigger the\n    // popup, not the entire container.\n    const data = this.data;\n    const { width, height } = getRectDims(data.rect);\n    const svg = this.svgFactory.create(\n      width,\n      height,\n      /* skipDimensions = */ true\n    );\n\n    // The browser draws half of the borders inside the circle and half of\n    // the borders outside the circle by default. This behavior cannot be\n    // changed programmatically, so correct for that here.\n    const borderWidth = data.borderStyle.width;\n    const circle = (this.#circle =\n      this.svgFactory.createElement(\"svg:ellipse\"));\n    circle.setAttribute(\"cx\", width / 2);\n    circle.setAttribute(\"cy\", height / 2);\n    circle.setAttribute(\"rx\", width / 2 - borderWidth / 2);\n    circle.setAttribute(\"ry\", height / 2 - borderWidth / 2);\n    // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n    // won't be possible to open/close the popup (note e.g. issue 11122).\n    circle.setAttribute(\"stroke-width\", borderWidth || 1);\n    circle.setAttribute(\"stroke\", \"transparent\");\n    circle.setAttribute(\"fill\", \"transparent\");\n\n    svg.append(circle);\n    this.container.append(svg);\n\n    // Create the popup ourselves so that we can bind it to the circle instead\n    // of to the entire container (which is the default).\n    if (!data.popupRef && this.hasPopupData) {\n      this._createPopup();\n    }\n\n    return this.container;\n  }\n\n  getElementsToTriggerPopup() {\n    return this.#circle;\n  }\n\n  addHighlightArea() {\n    this.container.classList.add(\"highlightArea\");\n  }\n}\n\nclass PolylineAnnotationElement extends AnnotationElement {\n  #polyline = null;\n\n  constructor(parameters) {\n    super(parameters, { isRenderable: true, ignoreBorder: true });\n\n    this.containerClassName = \"polylineAnnotation\";\n    this.svgElementName = \"svg:polyline\";\n  }\n\n  render() {\n    this.container.classList.add(this.containerClassName);\n\n    // Create an invisible polyline with the same points that acts as the\n    // trigger for the popup. Only the polyline itself should trigger the\n    // popup, not the entire container.\n    const data = this.data;\n    const { width, height } = getRectDims(data.rect);\n    const svg = this.svgFactory.create(\n      width,\n      height,\n      /* skipDimensions = */ true\n    );\n\n    // Convert the vertices array to a single points string that the SVG\n    // polyline element expects (\"x1,y1 x2,y2 ...\"). PDF coordinates are\n    // calculated from a bottom left origin, so transform the polyline\n    // coordinates to a top left origin for the SVG element.\n    let points = [];\n    for (const coordinate of data.vertices) {\n      const x = coordinate.x - data.rect[0];\n      const y = data.rect[3] - coordinate.y;\n      points.push(x + \",\" + y);\n    }\n    points = points.join(\" \");\n\n    const polyline = (this.#polyline = this.svgFactory.createElement(\n      this.svgElementName\n    ));\n    polyline.setAttribute(\"points\", points);\n    // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n    // won't be possible to open/close the popup (note e.g. issue 11122).\n    polyline.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n    polyline.setAttribute(\"stroke\", \"transparent\");\n    polyline.setAttribute(\"fill\", \"transparent\");\n\n    svg.append(polyline);\n    this.container.append(svg);\n\n    // Create the popup ourselves so that we can bind it to the polyline\n    // instead of to the entire container (which is the default).\n    if (!data.popupRef && this.hasPopupData) {\n      this._createPopup();\n    }\n\n    return this.container;\n  }\n\n  getElementsToTriggerPopup() {\n    return this.#polyline;\n  }\n\n  addHighlightArea() {\n    this.container.classList.add(\"highlightArea\");\n  }\n}\n\nclass PolygonAnnotationElement extends PolylineAnnotationElement {\n  constructor(parameters) {\n    // Polygons are specific forms of polylines, so reuse their logic.\n    super(parameters);\n\n    this.containerClassName = \"polygonAnnotation\";\n    this.svgElementName = \"svg:polygon\";\n  }\n}\n\nclass CaretAnnotationElement extends AnnotationElement {\n  constructor(parameters) {\n    super(parameters, { isRenderable: true, ignoreBorder: true });\n  }\n\n  render() {\n    this.container.classList.add(\"caretAnnotation\");\n\n    if (!this.data.popupRef && this.hasPopupData) {\n      this._createPopup();\n    }\n    return this.container;\n  }\n}\n\nclass InkAnnotationElement extends AnnotationElement {\n  #polylines = [];\n\n  constructor(parameters) {\n    super(parameters, { isRenderable: true, ignoreBorder: true });\n\n    this.containerClassName = \"inkAnnotation\";\n\n    // Use the polyline SVG element since it allows us to use coordinates\n    // directly and to draw both straight lines and curves.\n    this.svgElementName = \"svg:polyline\";\n    this.annotationEditorType = AnnotationEditorType.INK;\n  }\n\n  render() {\n    this.container.classList.add(this.containerClassName);\n\n    // Create an invisible polyline with the same points that acts as the\n    // trigger for the popup.\n    const data = this.data;\n    const { width, height } = getRectDims(data.rect);\n    const svg = this.svgFactory.create(\n      width,\n      height,\n      /* skipDimensions = */ true\n    );\n\n    for (const inkList of data.inkLists) {\n      // Convert the ink list to a single points string that the SVG\n      // polyline element expects (\"x1,y1 x2,y2 ...\"). PDF coordinates are\n      // calculated from a bottom left origin, so transform the polyline\n      // coordinates to a top left origin for the SVG element.\n      let points = [];\n      for (const coordinate of inkList) {\n        const x = coordinate.x - data.rect[0];\n        const y = data.rect[3] - coordinate.y;\n        points.push(`${x},${y}`);\n      }\n      points = points.join(\" \");\n\n      const polyline = this.svgFactory.createElement(this.svgElementName);\n      this.#polylines.push(polyline);\n      polyline.setAttribute(\"points\", points);\n      // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n      // won't be possible to open/close the popup (note e.g. issue 11122).\n      polyline.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n      polyline.setAttribute(\"stroke\", \"transparent\");\n      polyline.setAttribute(\"fill\", \"transparent\");\n\n      // Create the popup ourselves so that we can bind it to the polyline\n      // instead of to the entire container (which is the default).\n      if (!data.popupRef && this.hasPopupData) {\n        this._createPopup();\n      }\n\n      svg.append(polyline);\n    }\n\n    this.container.append(svg);\n    return this.container;\n  }\n\n  getElementsToTriggerPopup() {\n    return this.#polylines;\n  }\n\n  addHighlightArea() {\n    this.container.classList.add(\"highlightArea\");\n  }\n}\n\nclass HighlightAnnotationElement extends AnnotationElement {\n  constructor(parameters) {\n    super(parameters, {\n      isRenderable: true,\n      ignoreBorder: true,\n      createQuadrilaterals: true,\n    });\n  }\n\n  render() {\n    if (!this.data.popupRef && this.hasPopupData) {\n      this._createPopup();\n    }\n\n    this.container.classList.add(\"highlightAnnotation\");\n    return this.container;\n  }\n}\n\nclass UnderlineAnnotationElement extends AnnotationElement {\n  constructor(parameters) {\n    super(parameters, {\n      isRenderable: true,\n      ignoreBorder: true,\n      createQuadrilaterals: true,\n    });\n  }\n\n  render() {\n    if (!this.data.popupRef && this.hasPopupData) {\n      this._createPopup();\n    }\n\n    this.container.classList.add(\"underlineAnnotation\");\n    return this.container;\n  }\n}\n\nclass SquigglyAnnotationElement extends AnnotationElement {\n  constructor(parameters) {\n    super(parameters, {\n      isRenderable: true,\n      ignoreBorder: true,\n      createQuadrilaterals: true,\n    });\n  }\n\n  render() {\n    if (!this.data.popupRef && this.hasPopupData) {\n      this._createPopup();\n    }\n\n    this.container.classList.add(\"squigglyAnnotation\");\n    return this.container;\n  }\n}\n\nclass StrikeOutAnnotationElement extends AnnotationElement {\n  constructor(parameters) {\n    super(parameters, {\n      isRenderable: true,\n      ignoreBorder: true,\n      createQuadrilaterals: true,\n    });\n  }\n\n  render() {\n    if (!this.data.popupRef && this.hasPopupData) {\n      this._createPopup();\n    }\n\n    this.container.classList.add(\"strikeoutAnnotation\");\n    return this.container;\n  }\n}\n\nclass StampAnnotationElement extends AnnotationElement {\n  constructor(parameters) {\n    super(parameters, { isRenderable: true, ignoreBorder: true });\n  }\n\n  render() {\n    this.container.classList.add(\"stampAnnotation\");\n\n    if (!this.data.popupRef && this.hasPopupData) {\n      this._createPopup();\n    }\n    return this.container;\n  }\n}\n\nclass FileAttachmentAnnotationElement extends AnnotationElement {\n  #trigger = null;\n\n  constructor(parameters) {\n    super(parameters, { isRenderable: true });\n\n    const { filename, content } = this.data.file;\n    this.filename = getFilenameFromUrl(filename, /* onlyStripPath = */ true);\n    this.content = content;\n\n    this.linkService.eventBus?.dispatch(\"fileattachmentannotation\", {\n      source: this,\n      filename,\n      content,\n    });\n  }\n\n  render() {\n    this.container.classList.add(\"fileAttachmentAnnotation\");\n\n    const { container, data } = this;\n    let trigger;\n    if (data.hasAppearance || data.fillAlpha === 0) {\n      trigger = document.createElement(\"div\");\n    } else {\n      // Unfortunately it seems that it's not clearly specified exactly what\n      // names are actually valid, since Table 184 contains:\n      //   Conforming readers shall provide predefined icon appearances for at\n      //   least the following standard names: GraphPushPin, PaperclipTag.\n      //   Additional names may be supported as well. Default value: PushPin.\n      trigger = document.createElement(\"img\");\n      trigger.src = `${this.imageResourcesPath}annotation-${\n        /paperclip/i.test(data.name) ? \"paperclip\" : \"pushpin\"\n      }.svg`;\n\n      if (data.fillAlpha && data.fillAlpha < 1) {\n        trigger.style = `filter: opacity(${Math.round(\n          data.fillAlpha * 100\n        )}%);`;\n\n        if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n          this.container.classList.add(\"hasFillAlpha\");\n        }\n      }\n    }\n    trigger.addEventListener(\"dblclick\", this.#download.bind(this));\n    this.#trigger = trigger;\n\n    const { isMac } = FeatureTest.platform;\n    container.addEventListener(\"keydown\", evt => {\n      if (evt.key === \"Enter\" && (isMac ? evt.metaKey : evt.ctrlKey)) {\n        this.#download();\n      }\n    });\n\n    if (!data.popupRef && this.hasPopupData) {\n      this._createPopup();\n    } else {\n      trigger.classList.add(\"popupTriggerArea\");\n    }\n\n    container.append(trigger);\n    return container;\n  }\n\n  getElementsToTriggerPopup() {\n    return this.#trigger;\n  }\n\n  addHighlightArea() {\n    this.container.classList.add(\"highlightArea\");\n  }\n\n  /**\n   * Download the file attachment associated with this annotation.\n   */\n  #download() {\n    this.downloadManager?.openOrDownloadData(this.content, this.filename);\n  }\n}\n\n/**\n * @typedef {Object} AnnotationLayerParameters\n * @property {PageViewport} viewport\n * @property {HTMLDivElement} div\n * @property {Array} annotations\n * @property {PDFPageProxy} page\n * @property {IPDFLinkService} linkService\n * @property {IDownloadManager} downloadManager\n * @property {AnnotationStorage} [annotationStorage]\n * @property {string} [imageResourcesPath] - Path for image resources, mainly\n *   for annotation icons. Include trailing slash.\n * @property {boolean} renderForms\n * @property {boolean} [enableScripting] - Enable embedded script execution.\n * @property {boolean} [hasJSActions] - Some fields have JS actions.\n *   The default value is `false`.\n * @property {Object<string, Array<Object>> | null} [fieldObjects]\n * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap]\n * @property {TextAccessibilityManager} [accessibilityManager]\n */\n\n/**\n * Manage the layer containing all the annotations.\n */\nclass AnnotationLayer {\n  #accessibilityManager = null;\n\n  #annotationCanvasMap = null;\n\n  #editableAnnotations = new Map();\n\n  constructor({\n    div,\n    accessibilityManager,\n    annotationCanvasMap,\n    page,\n    viewport,\n  }) {\n    this.div = div;\n    this.#accessibilityManager = accessibilityManager;\n    this.#annotationCanvasMap = annotationCanvasMap;\n    this.page = page;\n    this.viewport = viewport;\n    this.zIndex = 0;\n\n    if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n      // For testing purposes.\n      Object.defineProperty(this, \"showPopups\", {\n        value: async () => {\n          for (const show of this.popupShow) {\n            await show();\n          }\n        },\n      });\n      this.popupShow = [];\n    }\n  }\n\n  #appendElement(element, id) {\n    const contentElement = element.firstChild || element;\n    contentElement.id = `${AnnotationPrefix}${id}`;\n\n    this.div.append(element);\n    this.#accessibilityManager?.moveElementInDOM(\n      this.div,\n      element,\n      contentElement,\n      /* isRemovable = */ false\n    );\n  }\n\n  /**\n   * Render a new annotation layer with all annotation elements.\n   *\n   * @param {AnnotationLayerParameters} params\n   * @memberof AnnotationLayer\n   */\n  async render(params) {\n    const { annotations } = params;\n    const layer = this.div;\n    setLayerDimensions(layer, this.viewport);\n\n    const popupToElements = new Map();\n    const elementParams = {\n      data: null,\n      layer,\n      linkService: params.linkService,\n      downloadManager: params.downloadManager,\n      imageResourcesPath: params.imageResourcesPath || \"\",\n      renderForms: params.renderForms !== false,\n      svgFactory: new DOMSVGFactory(),\n      annotationStorage: params.annotationStorage || new AnnotationStorage(),\n      enableScripting: params.enableScripting === true,\n      hasJSActions: params.hasJSActions,\n      fieldObjects: params.fieldObjects,\n      parent: this,\n      elements: null,\n    };\n\n    for (const data of annotations) {\n      if (data.noHTML) {\n        continue;\n      }\n      const isPopupAnnotation = data.annotationType === AnnotationType.POPUP;\n      if (!isPopupAnnotation) {\n        const { width, height } = getRectDims(data.rect);\n        if (width <= 0 || height <= 0) {\n          continue; // Ignore empty annotations.\n        }\n      } else {\n        const elements = popupToElements.get(data.id);\n        if (!elements) {\n          // Ignore popup annotations without a corresponding annotation.\n          continue;\n        }\n        elementParams.elements = elements;\n      }\n      elementParams.data = data;\n      const element = AnnotationElementFactory.create(elementParams);\n\n      if (!element.isRenderable) {\n        continue;\n      }\n\n      if (!isPopupAnnotation && data.popupRef) {\n        const elements = popupToElements.get(data.popupRef);\n        if (!elements) {\n          popupToElements.set(data.popupRef, [element]);\n        } else {\n          elements.push(element);\n        }\n      }\n\n      if (element.annotationEditorType > 0) {\n        this.#editableAnnotations.set(element.data.id, element);\n      }\n\n      const rendered = element.render();\n      if (data.hidden) {\n        rendered.style.visibility = \"hidden\";\n      }\n      this.#appendElement(rendered, data.id);\n    }\n\n    this.#setAnnotationCanvasMap();\n  }\n\n  /**\n   * Update the annotation elements on existing annotation layer.\n   *\n   * @param {AnnotationLayerParameters} viewport\n   * @memberof AnnotationLayer\n   */\n  update({ viewport }) {\n    const layer = this.div;\n    this.viewport = viewport;\n    setLayerDimensions(layer, { rotation: viewport.rotation });\n\n    this.#setAnnotationCanvasMap();\n    layer.hidden = false;\n  }\n\n  #setAnnotationCanvasMap() {\n    if (!this.#annotationCanvasMap) {\n      return;\n    }\n    const layer = this.div;\n    for (const [id, canvas] of this.#annotationCanvasMap) {\n      const element = layer.querySelector(`[data-annotation-id=\"${id}\"]`);\n      if (!element) {\n        continue;\n      }\n\n      const { firstChild } = element;\n      if (!firstChild) {\n        element.append(canvas);\n      } else if (firstChild.nodeName === \"CANVAS\") {\n        firstChild.replaceWith(canvas);\n      } else {\n        firstChild.before(canvas);\n      }\n    }\n    this.#annotationCanvasMap.clear();\n  }\n\n  getEditableAnnotations() {\n    return Array.from(this.#editableAnnotations.values());\n  }\n\n  getEditableAnnotation(id) {\n    return this.#editableAnnotations.get(id);\n  }\n}\n\nexport {\n  AnnotationLayer,\n  FreeTextAnnotationElement,\n  InkAnnotationElement,\n  StampAnnotationElement,\n};\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { objectFromMap, unreachable } from \"../shared/util.js\";\nimport { AnnotationEditor } from \"./editor/editor.js\";\nimport { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\n\nconst SerializableEmpty = Object.freeze({\n  map: null,\n  hash: \"\",\n  transfer: undefined,\n});\n\n/**\n * Key/value storage for annotation data in forms.\n */\nclass AnnotationStorage {\n  #modified = false;\n\n  #storage = new Map();\n\n  constructor() {\n    // Callbacks to signal when the modification state is set or reset.\n    // This is used by the viewer to only bind on `beforeunload` if forms\n    // are actually edited to prevent doing so unconditionally since that\n    // can have undesirable effects.\n    this.onSetModified = null;\n    this.onResetModified = null;\n    this.onAnnotationEditor = null;\n  }\n\n  /**\n   * Get the value for a given key if it exists, or return the default value.\n   * @param {string} key\n   * @param {Object} defaultValue\n   * @returns {Object}\n   */\n  getValue(key, defaultValue) {\n    const value = this.#storage.get(key);\n    if (value === undefined) {\n      return defaultValue;\n    }\n\n    return Object.assign(defaultValue, value);\n  }\n\n  /**\n   * Get the value for a given key.\n   * @param {string} key\n   * @returns {Object}\n   */\n  getRawValue(key) {\n    return this.#storage.get(key);\n  }\n\n  /**\n   * Remove a value from the storage.\n   * @param {string} key\n   */\n  remove(key) {\n    this.#storage.delete(key);\n\n    if (this.#storage.size === 0) {\n      this.resetModified();\n    }\n\n    if (typeof this.onAnnotationEditor === \"function\") {\n      for (const value of this.#storage.values()) {\n        if (value instanceof AnnotationEditor) {\n          return;\n        }\n      }\n      this.onAnnotationEditor(null);\n    }\n  }\n\n  /**\n   * Set the value for a given key\n   * @param {string} key\n   * @param {Object} value\n   */\n  setValue(key, value) {\n    const obj = this.#storage.get(key);\n    let modified = false;\n    if (obj !== undefined) {\n      for (const [entry, val] of Object.entries(value)) {\n        if (obj[entry] !== val) {\n          modified = true;\n          obj[entry] = val;\n        }\n      }\n    } else {\n      modified = true;\n      this.#storage.set(key, value);\n    }\n    if (modified) {\n      this.#setModified();\n    }\n\n    if (\n      value instanceof AnnotationEditor &&\n      typeof this.onAnnotationEditor === \"function\"\n    ) {\n      this.onAnnotationEditor(value.constructor._type);\n    }\n  }\n\n  /**\n   * Check if the storage contains the given key.\n   * @param {string} key\n   * @returns {boolean}\n   */\n  has(key) {\n    return this.#storage.has(key);\n  }\n\n  /**\n   * @returns {Object | null}\n   */\n  getAll() {\n    return this.#storage.size > 0 ? objectFromMap(this.#storage) : null;\n  }\n\n  /**\n   * @param {Object} obj\n   */\n  setAll(obj) {\n    for (const [key, val] of Object.entries(obj)) {\n      this.setValue(key, val);\n    }\n  }\n\n  get size() {\n    return this.#storage.size;\n  }\n\n  #setModified() {\n    if (!this.#modified) {\n      this.#modified = true;\n      if (typeof this.onSetModified === \"function\") {\n        this.onSetModified();\n      }\n    }\n  }\n\n  resetModified() {\n    if (this.#modified) {\n      this.#modified = false;\n      if (typeof this.onResetModified === \"function\") {\n        this.onResetModified();\n      }\n    }\n  }\n\n  /**\n   * @returns {PrintAnnotationStorage}\n   */\n  get print() {\n    return new PrintAnnotationStorage(this);\n  }\n\n  /**\n   * PLEASE NOTE: Only intended for usage within the API itself.\n   * @ignore\n   */\n  get serializable() {\n    if (this.#storage.size === 0) {\n      return SerializableEmpty;\n    }\n    const map = new Map(),\n      hash = new MurmurHash3_64(),\n      transfer = [];\n    const context = Object.create(null);\n    let hasBitmap = false;\n\n    for (const [key, val] of this.#storage) {\n      const serialized =\n        val instanceof AnnotationEditor\n          ? val.serialize(/* isForCopying = */ false, context)\n          : val;\n      if (serialized) {\n        map.set(key, serialized);\n\n        hash.update(`${key}:${JSON.stringify(serialized)}`);\n        hasBitmap ||= !!serialized.bitmap;\n      }\n    }\n\n    if (hasBitmap) {\n      // We must transfer the bitmap data separately, since it can be changed\n      // during serialization with SVG images.\n      for (const value of map.values()) {\n        if (value.bitmap) {\n          transfer.push(value.bitmap);\n        }\n      }\n    }\n\n    return map.size > 0\n      ? { map, hash: hash.hexdigest(), transfer }\n      : SerializableEmpty;\n  }\n}\n\n/**\n * A special `AnnotationStorage` for use during printing, where the serializable\n * data is *frozen* upon initialization, to prevent scripting from modifying its\n * contents. (Necessary since printing is triggered synchronously in browsers.)\n */\nclass PrintAnnotationStorage extends AnnotationStorage {\n  #serializable;\n\n  constructor(parent) {\n    super();\n    const { map, hash, transfer } = parent.serializable;\n    // Create a *copy* of the data, since Objects are passed by reference in JS.\n    const clone = structuredClone(map, transfer ? { transfer } : null);\n\n    this.#serializable = { map: clone, hash, transfer };\n  }\n\n  /**\n   * @returns {PrintAnnotationStorage}\n   */\n  // eslint-disable-next-line getter-return\n  get print() {\n    unreachable(\"Should not call PrintAnnotationStorage.print\");\n  }\n\n  /**\n   * PLEASE NOTE: Only intended for usage within the API itself.\n   * @ignore\n   */\n  get serializable() {\n    return this.#serializable;\n  }\n}\n\nexport { AnnotationStorage, PrintAnnotationStorage, SerializableEmpty };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @module pdfjsLib\n */\n\nimport {\n  AbortException,\n  AnnotationMode,\n  assert,\n  getVerbosityLevel,\n  info,\n  InvalidPDFException,\n  isArrayBuffer,\n  isNodeJS,\n  MAX_IMAGE_SIZE_TO_CACHE,\n  MissingPDFException,\n  PasswordException,\n  PromiseCapability,\n  RenderingIntentFlag,\n  setVerbosityLevel,\n  shadow,\n  stringToBytes,\n  UnexpectedResponseException,\n  UnknownErrorException,\n  unreachable,\n  warn,\n} from \"../shared/util.js\";\nimport {\n  AnnotationStorage,\n  PrintAnnotationStorage,\n  SerializableEmpty,\n} from \"./annotation_storage.js\";\nimport {\n  DOMCanvasFactory,\n  DOMCMapReaderFactory,\n  DOMFilterFactory,\n  DOMStandardFontDataFactory,\n  isDataScheme,\n  isValidFetchUrl,\n  PageViewport,\n  RenderingCancelledException,\n  StatTimer,\n} from \"./display_utils.js\";\nimport { FontFaceObject, FontLoader } from \"./font_loader.js\";\nimport {\n  NodeCanvasFactory,\n  NodeCMapReaderFactory,\n  NodeFilterFactory,\n  NodeStandardFontDataFactory,\n} from \"display-node_utils\";\nimport { CanvasGraphics } from \"./canvas.js\";\nimport { GlobalWorkerOptions } from \"./worker_options.js\";\nimport { MessageHandler } from \"../shared/message_handler.js\";\nimport { Metadata } from \"./metadata.js\";\nimport { OptionalContentConfig } from \"./optional_content_config.js\";\nimport { PDFDataTransportStream } from \"./transport_stream.js\";\nimport { PDFFetchStream } from \"display-fetch_stream\";\nimport { PDFNetworkStream } from \"display-network\";\nimport { PDFNodeStream } from \"display-node_stream\";\nimport { XfaText } from \"./xfa_text.js\";\n\nconst DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536\nconst RENDERING_CANCELLED_TIMEOUT = 100; // ms\nconst DELAYED_CLEANUP_TIMEOUT = 5000; // ms\n\nconst DefaultCanvasFactory =\n  typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n    ? NodeCanvasFactory\n    : DOMCanvasFactory;\nconst DefaultCMapReaderFactory =\n  typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n    ? NodeCMapReaderFactory\n    : DOMCMapReaderFactory;\nconst DefaultFilterFactory =\n  typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n    ? NodeFilterFactory\n    : DOMFilterFactory;\nconst DefaultStandardFontDataFactory =\n  typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n    ? NodeStandardFontDataFactory\n    : DOMStandardFontDataFactory;\n\n/**\n * @typedef { Int8Array | Uint8Array | Uint8ClampedArray |\n *            Int16Array | Uint16Array |\n *            Int32Array | Uint32Array | Float32Array |\n *            Float64Array\n * } TypedArray\n */\n\n/**\n * @typedef { TypedArray | ArrayBuffer | Array<number> | string } BinaryData\n */\n\n/**\n * @typedef {Object} RefProxy\n * @property {number} num\n * @property {number} gen\n */\n\n/**\n * Document initialization / loading parameters object.\n *\n * @typedef {Object} DocumentInitParameters\n * @property {string | URL} [url] - The URL of the PDF.\n * @property {BinaryData} [data] - Binary PDF data.\n *   Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is\n *   BASE64-encoded, use `atob()` to convert it to a binary string first.\n *\n *   NOTE: If TypedArrays are used they will generally be transferred to the\n *   worker-thread. This will help reduce main-thread memory usage, however\n *   it will take ownership of the TypedArrays.\n * @property {Object} [httpHeaders] - Basic authentication headers.\n * @property {boolean} [withCredentials] - Indicates whether or not\n *   cross-site Access-Control requests should be made using credentials such\n *   as cookies or authorization headers. The default is `false`.\n * @property {string} [password] - For decrypting password-protected PDFs.\n * @property {number} [length] - The PDF file length. It's used for progress\n *   reports and range requests operations.\n * @property {PDFDataRangeTransport} [range] - Allows for using a custom range\n *   transport implementation.\n * @property {number} [rangeChunkSize] - Specify maximum number of bytes fetched\n *   per range request. The default value is {@link DEFAULT_RANGE_CHUNK_SIZE}.\n * @property {PDFWorker} [worker] - The worker that will be used for loading and\n *   parsing the PDF data.\n * @property {number} [verbosity] - Controls the logging level; the constants\n *   from {@link VerbosityLevel} should be used.\n * @property {string} [docBaseUrl] - The base URL of the document, used when\n *   attempting to recover valid absolute URLs for annotations, and outline\n *   items, that (incorrectly) only specify relative URLs.\n * @property {string} [cMapUrl] - The URL where the predefined Adobe CMaps are\n *   located. Include the trailing slash.\n * @property {boolean} [cMapPacked] - Specifies if the Adobe CMaps are binary\n *   packed or not. The default value is `true`.\n * @property {Object} [CMapReaderFactory] - The factory that will be used when\n *   reading built-in CMap files. Providing a custom factory is useful for\n *   environments without Fetch API or `XMLHttpRequest` support, such as\n *   Node.js. The default value is {DOMCMapReaderFactory}.\n * @property {boolean} [useSystemFonts] - When `true`, fonts that aren't\n *   embedded in the PDF document will fallback to a system font.\n *   The default value is `true` in web environments and `false` in Node.js;\n *   unless `disableFontFace === true` in which case this defaults to `false`\n *   regardless of the environment (to prevent completely broken fonts).\n * @property {string} [standardFontDataUrl] - The URL where the standard font\n *   files are located. Include the trailing slash.\n * @property {Object} [StandardFontDataFactory] - The factory that will be used\n *   when reading the standard font files. Providing a custom factory is useful\n *   for environments without Fetch API or `XMLHttpRequest` support, such as\n *   Node.js. The default value is {DOMStandardFontDataFactory}.\n * @property {boolean} [useWorkerFetch] - Enable using the Fetch API in the\n *   worker-thread when reading CMap and standard font files. When `true`,\n *   the `CMapReaderFactory` and `StandardFontDataFactory` options are ignored.\n *   The default value is `true` in web environments and `false` in Node.js.\n * @property {boolean} [stopAtErrors] - Reject certain promises, e.g.\n *   `getOperatorList`, `getTextContent`, and `RenderTask`, when the associated\n *   PDF data cannot be successfully parsed, instead of attempting to recover\n *   whatever possible of the data. The default value is `false`.\n * @property {number} [maxImageSize] - The maximum allowed image size in total\n *   pixels, i.e. width * height. Images above this value will not be rendered.\n *   Use -1 for no limit, which is also the default value.\n * @property {boolean} [isEvalSupported] - Determines if we can evaluate strings\n *   as JavaScript. Primarily used to improve performance of font rendering, and\n *   when parsing PDF functions. The default value is `true`.\n * @property {boolean} [isOffscreenCanvasSupported] - Determines if we can use\n *   `OffscreenCanvas` in the worker. Primarily used to improve performance of\n *   image conversion/rendering.\n *   The default value is `true` in web environments and `false` in Node.js.\n * @property {number} [canvasMaxAreaInBytes] - The integer value is used to\n *   know when an image must be resized (uses `OffscreenCanvas` in the worker).\n *   If it's -1 then a possibly slow algorithm is used to guess the max value.\n * @property {boolean} [disableFontFace] - By default fonts are converted to\n *   OpenType fonts and loaded via the Font Loading API or `@font-face` rules.\n *   If disabled, fonts will be rendered using a built-in font renderer that\n *   constructs the glyphs with primitive path commands.\n *   The default value is `false` in web environments and `true` in Node.js.\n * @property {boolean} [fontExtraProperties] - Include additional properties,\n *   which are unused during rendering of PDF documents, when exporting the\n *   parsed font data from the worker-thread. This may be useful for debugging\n *   purposes (and backwards compatibility), but note that it will lead to\n *   increased memory usage. The default value is `false`.\n * @property {boolean} [enableXfa] - Render Xfa forms if any.\n *   The default value is `false`.\n * @property {HTMLDocument} [ownerDocument] - Specify an explicit document\n *   context to create elements with and to load resources, such as fonts,\n *   into. Defaults to the current document.\n * @property {boolean} [disableRange] - Disable range request loading of PDF\n *   files. When enabled, and if the server supports partial content requests,\n *   then the PDF will be fetched in chunks. The default value is `false`.\n * @property {boolean} [disableStream] - Disable streaming of PDF file data.\n *   By default PDF.js attempts to load PDF files in chunks. The default value\n *   is `false`.\n * @property {boolean} [disableAutoFetch] - Disable pre-fetching of PDF file\n *   data. When range requests are enabled PDF.js will automatically keep\n *   fetching more data even if it isn't needed to display the current page.\n *   The default value is `false`.\n *\n *   NOTE: It is also necessary to disable streaming, see above, in order for\n *   disabling of pre-fetching to work correctly.\n * @property {boolean} [pdfBug] - Enables special hooks for debugging PDF.js\n *   (see `web/debugger.js`). The default value is `false`.\n * @property {Object} [canvasFactory] - The factory instance that will be used\n *   when creating canvases. The default value is {new DOMCanvasFactory()}.\n * @property {Object} [filterFactory] - A factory instance that will be used\n *   to create SVG filters when rendering some images on the main canvas.\n */\n\n/**\n * This is the main entry point for loading a PDF and interacting with it.\n *\n * NOTE: If a URL is used to fetch the PDF data a standard Fetch API call (or\n * XHR as fallback) is used, which means it must follow same origin rules,\n * e.g. no cross-domain requests without CORS.\n *\n * @param {string | URL | TypedArray | ArrayBuffer | DocumentInitParameters}\n *   src - Can be a URL where a PDF file is located, a typed array (Uint8Array)\n *         already populated with data, or a parameter object.\n * @returns {PDFDocumentLoadingTask}\n */\nfunction getDocument(src) {\n  if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n    if (typeof src === \"string\" || src instanceof URL) {\n      src = { url: src };\n    } else if (isArrayBuffer(src)) {\n      src = { data: src };\n    }\n  }\n  if (typeof src !== \"object\") {\n    throw new Error(\"Invalid parameter in getDocument, need parameter object.\");\n  }\n  if (!src.url && !src.data && !src.range) {\n    throw new Error(\n      \"Invalid parameter object: need either .data, .range or .url\"\n    );\n  }\n  const task = new PDFDocumentLoadingTask();\n  const { docId } = task;\n\n  const url = src.url ? getUrlProp(src.url) : null;\n  const data = src.data ? getDataProp(src.data) : null;\n  const httpHeaders = src.httpHeaders || null;\n  const withCredentials = src.withCredentials === true;\n  const password = src.password ?? null;\n  const rangeTransport =\n    src.range instanceof PDFDataRangeTransport ? src.range : null;\n  const rangeChunkSize =\n    Number.isInteger(src.rangeChunkSize) && src.rangeChunkSize > 0\n      ? src.rangeChunkSize\n      : DEFAULT_RANGE_CHUNK_SIZE;\n  let worker = src.worker instanceof PDFWorker ? src.worker : null;\n  const verbosity = src.verbosity;\n  // Ignore \"data:\"-URLs, since they can't be used to recover valid absolute\n  // URLs anyway. We want to avoid sending them to the worker-thread, since\n  // they contain the *entire* PDF document and can thus be arbitrarily long.\n  const docBaseUrl =\n    typeof src.docBaseUrl === \"string\" && !isDataScheme(src.docBaseUrl)\n      ? src.docBaseUrl\n      : null;\n  const cMapUrl = typeof src.cMapUrl === \"string\" ? src.cMapUrl : null;\n  const cMapPacked = src.cMapPacked !== false;\n  const CMapReaderFactory = src.CMapReaderFactory || DefaultCMapReaderFactory;\n  const standardFontDataUrl =\n    typeof src.standardFontDataUrl === \"string\"\n      ? src.standardFontDataUrl\n      : null;\n  const StandardFontDataFactory =\n    src.StandardFontDataFactory || DefaultStandardFontDataFactory;\n  const ignoreErrors = src.stopAtErrors !== true;\n  const maxImageSize =\n    Number.isInteger(src.maxImageSize) && src.maxImageSize > -1\n      ? src.maxImageSize\n      : -1;\n  const isEvalSupported = src.isEvalSupported !== false;\n  const isOffscreenCanvasSupported =\n    typeof src.isOffscreenCanvasSupported === \"boolean\"\n      ? src.isOffscreenCanvasSupported\n      : !isNodeJS;\n  const canvasMaxAreaInBytes = Number.isInteger(src.canvasMaxAreaInBytes)\n    ? src.canvasMaxAreaInBytes\n    : -1;\n  const disableFontFace =\n    typeof src.disableFontFace === \"boolean\" ? src.disableFontFace : isNodeJS;\n  const fontExtraProperties = src.fontExtraProperties === true;\n  const enableXfa = src.enableXfa === true;\n  const ownerDocument = src.ownerDocument || globalThis.document;\n  const disableRange = src.disableRange === true;\n  const disableStream = src.disableStream === true;\n  const disableAutoFetch = src.disableAutoFetch === true;\n  const pdfBug = src.pdfBug === true;\n\n  // Parameters whose default values depend on other parameters.\n  const length = rangeTransport ? rangeTransport.length : src.length ?? NaN;\n  const useSystemFonts =\n    typeof src.useSystemFonts === \"boolean\"\n      ? src.useSystemFonts\n      : !isNodeJS && !disableFontFace;\n  const useWorkerFetch =\n    typeof src.useWorkerFetch === \"boolean\"\n      ? src.useWorkerFetch\n      : (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n        (CMapReaderFactory === DOMCMapReaderFactory &&\n          StandardFontDataFactory === DOMStandardFontDataFactory &&\n          cMapUrl &&\n          standardFontDataUrl &&\n          isValidFetchUrl(cMapUrl, document.baseURI) &&\n          isValidFetchUrl(standardFontDataUrl, document.baseURI));\n  const canvasFactory =\n    src.canvasFactory || new DefaultCanvasFactory({ ownerDocument });\n  const filterFactory =\n    src.filterFactory || new DefaultFilterFactory({ docId, ownerDocument });\n\n  // Parameters only intended for development/testing purposes.\n  const styleElement =\n    typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")\n      ? src.styleElement\n      : null;\n\n  // Set the main-thread verbosity level.\n  setVerbosityLevel(verbosity);\n\n  // Ensure that the various factories can be initialized, when necessary,\n  // since the user may provide *custom* ones.\n  const transportFactory = {\n    canvasFactory,\n    filterFactory,\n  };\n  if (!useWorkerFetch) {\n    transportFactory.cMapReaderFactory = new CMapReaderFactory({\n      baseUrl: cMapUrl,\n      isCompressed: cMapPacked,\n    });\n    transportFactory.standardFontDataFactory = new StandardFontDataFactory({\n      baseUrl: standardFontDataUrl,\n    });\n  }\n\n  if (!worker) {\n    const workerParams = {\n      verbosity,\n      port: GlobalWorkerOptions.workerPort,\n    };\n    // Worker was not provided -- creating and owning our own. If message port\n    // is specified in global worker options, using it.\n    worker = workerParams.port\n      ? PDFWorker.fromPort(workerParams)\n      : new PDFWorker(workerParams);\n    task._worker = worker;\n  }\n\n  const fetchDocParams = {\n    docId,\n    apiVersion:\n      typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"TESTING\")\n        ? PDFJSDev.eval(\"BUNDLE_VERSION\")\n        : null,\n    data,\n    password,\n    disableAutoFetch,\n    rangeChunkSize,\n    length,\n    docBaseUrl,\n    enableXfa,\n    evaluatorOptions: {\n      maxImageSize,\n      disableFontFace,\n      ignoreErrors,\n      isEvalSupported,\n      isOffscreenCanvasSupported,\n      canvasMaxAreaInBytes,\n      fontExtraProperties,\n      useSystemFonts,\n      cMapUrl: useWorkerFetch ? cMapUrl : null,\n      standardFontDataUrl: useWorkerFetch ? standardFontDataUrl : null,\n    },\n  };\n  const transportParams = {\n    ignoreErrors,\n    isEvalSupported,\n    disableFontFace,\n    fontExtraProperties,\n    enableXfa,\n    ownerDocument,\n    disableAutoFetch,\n    pdfBug,\n    styleElement,\n  };\n\n  worker.promise\n    .then(function () {\n      if (task.destroyed) {\n        throw new Error(\"Loading aborted\");\n      }\n\n      const workerIdPromise = _fetchDocument(worker, fetchDocParams);\n      const networkStreamPromise = new Promise(function (resolve) {\n        let networkStream;\n        if (rangeTransport) {\n          networkStream = new PDFDataTransportStream(\n            {\n              length,\n              initialData: rangeTransport.initialData,\n              progressiveDone: rangeTransport.progressiveDone,\n              contentDispositionFilename:\n                rangeTransport.contentDispositionFilename,\n              disableRange,\n              disableStream,\n            },\n            rangeTransport\n          );\n        } else if (!data) {\n          if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n            throw new Error(\"Not implemented: createPDFNetworkStream\");\n          }\n          const createPDFNetworkStream = params => {\n            if (\n              typeof PDFJSDev !== \"undefined\" &&\n              PDFJSDev.test(\"GENERIC\") &&\n              isNodeJS\n            ) {\n              return new PDFNodeStream(params);\n            }\n            return isValidFetchUrl(params.url)\n              ? new PDFFetchStream(params)\n              : new PDFNetworkStream(params);\n          };\n\n          networkStream = createPDFNetworkStream({\n            url,\n            length,\n            httpHeaders,\n            withCredentials,\n            rangeChunkSize,\n            disableRange,\n            disableStream,\n          });\n        }\n        resolve(networkStream);\n      });\n\n      return Promise.all([workerIdPromise, networkStreamPromise]).then(\n        function ([workerId, networkStream]) {\n          if (task.destroyed) {\n            throw new Error(\"Loading aborted\");\n          }\n\n          const messageHandler = new MessageHandler(\n            docId,\n            workerId,\n            worker.port\n          );\n          const transport = new WorkerTransport(\n            messageHandler,\n            task,\n            networkStream,\n            transportParams,\n            transportFactory\n          );\n          task._transport = transport;\n          messageHandler.send(\"Ready\", null);\n        }\n      );\n    })\n    .catch(task._capability.reject);\n\n  return task;\n}\n\n/**\n * Starts fetching of specified PDF document/data.\n *\n * @param {PDFWorker} worker\n * @param {Object} source\n * @returns {Promise<string>} A promise that is resolved when the worker ID of\n *   the `MessageHandler` is known.\n * @private\n */\nasync function _fetchDocument(worker, source) {\n  if (worker.destroyed) {\n    throw new Error(\"Worker was destroyed\");\n  }\n  const workerId = await worker.messageHandler.sendWithPromise(\n    \"GetDocRequest\",\n    source,\n    source.data ? [source.data.buffer] : null\n  );\n\n  if (worker.destroyed) {\n    throw new Error(\"Worker was destroyed\");\n  }\n  return workerId;\n}\n\nfunction getUrlProp(val) {\n  if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n    return null; // The 'url' is unused with `PDFDataRangeTransport`.\n  }\n  if (val instanceof URL) {\n    return val.href;\n  }\n  try {\n    // The full path is required in the 'url' field.\n    return new URL(val, window.location).href;\n  } catch {\n    if (\n      typeof PDFJSDev !== \"undefined\" &&\n      PDFJSDev.test(\"GENERIC\") &&\n      isNodeJS &&\n      typeof val === \"string\"\n    ) {\n      return val; // Use the url as-is in Node.js environments.\n    }\n  }\n  throw new Error(\n    \"Invalid PDF url data: \" +\n      \"either string or URL-object is expected in the url property.\"\n  );\n}\n\nfunction getDataProp(val) {\n  // Converting string or array-like data to Uint8Array.\n  if (\n    typeof PDFJSDev !== \"undefined\" &&\n    PDFJSDev.test(\"GENERIC\") &&\n    isNodeJS &&\n    typeof Buffer !== \"undefined\" && // eslint-disable-line no-undef\n    val instanceof Buffer // eslint-disable-line no-undef\n  ) {\n    throw new Error(\n      \"Please provide binary data as `Uint8Array`, rather than `Buffer`.\"\n    );\n  }\n  if (val instanceof Uint8Array && val.byteLength === val.buffer.byteLength) {\n    // Use the data as-is when it's already a Uint8Array that completely\n    // \"utilizes\" its underlying ArrayBuffer, to prevent any possible\n    // issues when transferring it to the worker-thread.\n    return val;\n  }\n  if (typeof val === \"string\") {\n    return stringToBytes(val);\n  }\n  if ((typeof val === \"object\" && !isNaN(val?.length)) || isArrayBuffer(val)) {\n    return new Uint8Array(val);\n  }\n  throw new Error(\n    \"Invalid PDF binary data: either TypedArray, \" +\n      \"string, or array-like object is expected in the data property.\"\n  );\n}\n\n/**\n * @typedef {Object} OnProgressParameters\n * @property {number} loaded - Currently loaded number of bytes.\n * @property {number} total - Total number of bytes in the PDF file.\n */\n\n/**\n * The loading task controls the operations required to load a PDF document\n * (such as network requests) and provides a way to listen for completion,\n * after which individual pages can be rendered.\n */\nclass PDFDocumentLoadingTask {\n  static #docId = 0;\n\n  constructor() {\n    this._capability = new PromiseCapability();\n    this._transport = null;\n    this._worker = null;\n\n    /**\n     * Unique identifier for the document loading task.\n     * @type {string}\n     */\n    this.docId = `d${PDFDocumentLoadingTask.#docId++}`;\n\n    /**\n     * Whether the loading task is destroyed or not.\n     * @type {boolean}\n     */\n    this.destroyed = false;\n\n    /**\n     * Callback to request a password if a wrong or no password was provided.\n     * The callback receives two parameters: a function that should be called\n     * with the new password, and a reason (see {@link PasswordResponses}).\n     * @type {function}\n     */\n    this.onPassword = null;\n\n    /**\n     * Callback to be able to monitor the loading progress of the PDF file\n     * (necessary to implement e.g. a loading bar).\n     * The callback receives an {@link OnProgressParameters} argument.\n     * @type {function}\n     */\n    this.onProgress = null;\n  }\n\n  /**\n   * Promise for document loading task completion.\n   * @type {Promise<PDFDocumentProxy>}\n   */\n  get promise() {\n    return this._capability.promise;\n  }\n\n  /**\n   * Abort all network requests and destroy the worker.\n   * @returns {Promise<void>} A promise that is resolved when destruction is\n   *   completed.\n   */\n  async destroy() {\n    this.destroyed = true;\n    try {\n      if (this._worker?.port) {\n        this._worker._pendingDestroy = true;\n      }\n      await this._transport?.destroy();\n    } catch (ex) {\n      if (this._worker?.port) {\n        delete this._worker._pendingDestroy;\n      }\n      throw ex;\n    }\n\n    this._transport = null;\n    if (this._worker) {\n      this._worker.destroy();\n      this._worker = null;\n    }\n  }\n}\n\n/**\n * Abstract class to support range requests file loading.\n *\n * NOTE: The TypedArrays passed to the constructor and relevant methods below\n * will generally be transferred to the worker-thread. This will help reduce\n * main-thread memory usage, however it will take ownership of the TypedArrays.\n */\nclass PDFDataRangeTransport {\n  /**\n   * @param {number} length\n   * @param {Uint8Array|null} initialData\n   * @param {boolean} [progressiveDone]\n   * @param {string} [contentDispositionFilename]\n   */\n  constructor(\n    length,\n    initialData,\n    progressiveDone = false,\n    contentDispositionFilename = null\n  ) {\n    this.length = length;\n    this.initialData = initialData;\n    this.progressiveDone = progressiveDone;\n    this.contentDispositionFilename = contentDispositionFilename;\n\n    this._rangeListeners = [];\n    this._progressListeners = [];\n    this._progressiveReadListeners = [];\n    this._progressiveDoneListeners = [];\n    this._readyCapability = new PromiseCapability();\n  }\n\n  /**\n   * @param {function} listener\n   */\n  addRangeListener(listener) {\n    this._rangeListeners.push(listener);\n  }\n\n  /**\n   * @param {function} listener\n   */\n  addProgressListener(listener) {\n    this._progressListeners.push(listener);\n  }\n\n  /**\n   * @param {function} listener\n   */\n  addProgressiveReadListener(listener) {\n    this._progressiveReadListeners.push(listener);\n  }\n\n  /**\n   * @param {function} listener\n   */\n  addProgressiveDoneListener(listener) {\n    this._progressiveDoneListeners.push(listener);\n  }\n\n  /**\n   * @param {number} begin\n   * @param {Uint8Array|null} chunk\n   */\n  onDataRange(begin, chunk) {\n    for (const listener of this._rangeListeners) {\n      listener(begin, chunk);\n    }\n  }\n\n  /**\n   * @param {number} loaded\n   * @param {number|undefined} total\n   */\n  onDataProgress(loaded, total) {\n    this._readyCapability.promise.then(() => {\n      for (const listener of this._progressListeners) {\n        listener(loaded, total);\n      }\n    });\n  }\n\n  /**\n   * @param {Uint8Array|null} chunk\n   */\n  onDataProgressiveRead(chunk) {\n    this._readyCapability.promise.then(() => {\n      for (const listener of this._progressiveReadListeners) {\n        listener(chunk);\n      }\n    });\n  }\n\n  onDataProgressiveDone() {\n    this._readyCapability.promise.then(() => {\n      for (const listener of this._progressiveDoneListeners) {\n        listener();\n      }\n    });\n  }\n\n  transportReady() {\n    this._readyCapability.resolve();\n  }\n\n  /**\n   * @param {number} begin\n   * @param {number} end\n   */\n  requestDataRange(begin, end) {\n    unreachable(\"Abstract method PDFDataRangeTransport.requestDataRange\");\n  }\n\n  abort() {}\n}\n\n/**\n * Proxy to a `PDFDocument` in the worker thread.\n */\nclass PDFDocumentProxy {\n  constructor(pdfInfo, transport) {\n    this._pdfInfo = pdfInfo;\n    this._transport = transport;\n\n    if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n      // For testing purposes.\n      Object.defineProperty(this, \"getXFADatasets\", {\n        value: () => {\n          return this._transport.getXFADatasets();\n        },\n      });\n      Object.defineProperty(this, \"getXRefPrevValue\", {\n        value: () => {\n          return this._transport.getXRefPrevValue();\n        },\n      });\n      Object.defineProperty(this, \"getAnnotArray\", {\n        value: pageIndex => {\n          return this._transport.getAnnotArray(pageIndex);\n        },\n      });\n    }\n  }\n\n  /**\n   * @type {AnnotationStorage} Storage for annotation data in forms.\n   */\n  get annotationStorage() {\n    return this._transport.annotationStorage;\n  }\n\n  /**\n   * @type {Object} The filter factory instance.\n   */\n  get filterFactory() {\n    return this._transport.filterFactory;\n  }\n\n  /**\n   * @type {number} Total number of pages in the PDF file.\n   */\n  get numPages() {\n    return this._pdfInfo.numPages;\n  }\n\n  /**\n   * @type {Array<string, string|null>} A (not guaranteed to be) unique ID to\n   *   identify the PDF document.\n   *   NOTE: The first element will always be defined for all PDF documents,\n   *   whereas the second element is only defined for *modified* PDF documents.\n   */\n  get fingerprints() {\n    return this._pdfInfo.fingerprints;\n  }\n\n  /**\n   * @type {boolean} True if only XFA form.\n   */\n  get isPureXfa() {\n    return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n  }\n\n  /**\n   * NOTE: This is (mostly) intended to support printing of XFA forms.\n   *\n   * @type {Object | null} An object representing a HTML tree structure\n   *   to render the XFA, or `null` when no XFA form exists.\n   */\n  get allXfaHtml() {\n    return this._transport._htmlForXfa;\n  }\n\n  /**\n   * @param {number} pageNumber - The page number to get. The first page is 1.\n   * @returns {Promise<PDFPageProxy>} A promise that is resolved with\n   *   a {@link PDFPageProxy} object.\n   */\n  getPage(pageNumber) {\n    return this._transport.getPage(pageNumber);\n  }\n\n  /**\n   * @param {RefProxy} ref - The page reference.\n   * @returns {Promise<number>} A promise that is resolved with the page index,\n   *   starting from zero, that is associated with the reference.\n   */\n  getPageIndex(ref) {\n    return this._transport.getPageIndex(ref);\n  }\n\n  /**\n   * @returns {Promise<Object<string, Array<any>>>} A promise that is resolved\n   *   with a mapping from named destinations to references.\n   *\n   * This can be slow for large documents. Use `getDestination` instead.\n   */\n  getDestinations() {\n    return this._transport.getDestinations();\n  }\n\n  /**\n   * @param {string} id - The named destination to get.\n   * @returns {Promise<Array<any> | null>} A promise that is resolved with all\n   *   information of the given named destination, or `null` when the named\n   *   destination is not present in the PDF file.\n   */\n  getDestination(id) {\n    return this._transport.getDestination(id);\n  }\n\n  /**\n   * @returns {Promise<Array<string> | null>} A promise that is resolved with\n   *   an {Array} containing the page labels that correspond to the page\n   *   indexes, or `null` when no page labels are present in the PDF file.\n   */\n  getPageLabels() {\n    return this._transport.getPageLabels();\n  }\n\n  /**\n   * @returns {Promise<string>} A promise that is resolved with a {string}\n   *   containing the page layout name.\n   */\n  getPageLayout() {\n    return this._transport.getPageLayout();\n  }\n\n  /**\n   * @returns {Promise<string>} A promise that is resolved with a {string}\n   *   containing the page mode name.\n   */\n  getPageMode() {\n    return this._transport.getPageMode();\n  }\n\n  /**\n   * @returns {Promise<Object | null>} A promise that is resolved with an\n   *   {Object} containing the viewer preferences, or `null` when no viewer\n   *   preferences are present in the PDF file.\n   */\n  getViewerPreferences() {\n    return this._transport.getViewerPreferences();\n  }\n\n  /**\n   * @returns {Promise<any | null>} A promise that is resolved with an {Array}\n   *   containing the destination, or `null` when no open action is present\n   *   in the PDF.\n   */\n  getOpenAction() {\n    return this._transport.getOpenAction();\n  }\n\n  /**\n   * @returns {Promise<any>} A promise that is resolved with a lookup table\n   *   for mapping named attachments to their content.\n   */\n  getAttachments() {\n    return this._transport.getAttachments();\n  }\n\n  /**\n   * @returns {Promise<Object | null>} A promise that is resolved with\n   *   an {Object} with the JavaScript actions:\n   *     - from the name tree.\n   *     - from A or AA entries in the catalog dictionary.\n   *   , or `null` if no JavaScript exists.\n   */\n  getJSActions() {\n    return this._transport.getDocJSActions();\n  }\n\n  /**\n   * @typedef {Object} OutlineNode\n   * @property {string} title\n   * @property {boolean} bold\n   * @property {boolean} italic\n   * @property {Uint8ClampedArray} color - The color in RGB format to use for\n   *   display purposes.\n   * @property {string | Array<any> | null} dest\n   * @property {string | null} url\n   * @property {string | undefined} unsafeUrl\n   * @property {boolean | undefined} newWindow\n   * @property {number | undefined} count\n   * @property {Array<OutlineNode>} items\n   */\n\n  /**\n   * @returns {Promise<Array<OutlineNode>>} A promise that is resolved with an\n   *   {Array} that is a tree outline (if it has one) of the PDF file.\n   */\n  getOutline() {\n    return this._transport.getOutline();\n  }\n\n  /**\n   * @returns {Promise<OptionalContentConfig>} A promise that is resolved with\n   *   an {@link OptionalContentConfig} that contains all the optional content\n   *   groups (assuming that the document has any).\n   */\n  getOptionalContentConfig() {\n    return this._transport.getOptionalContentConfig();\n  }\n\n  /**\n   * @returns {Promise<Array<number> | null>} A promise that is resolved with\n   *   an {Array} that contains the permission flags for the PDF document, or\n   *   `null` when no permissions are present in the PDF file.\n   */\n  getPermissions() {\n    return this._transport.getPermissions();\n  }\n\n  /**\n   * @returns {Promise<{ info: Object, metadata: Metadata }>} A promise that is\n   *   resolved with an {Object} that has `info` and `metadata` properties.\n   *   `info` is an {Object} filled with anything available in the information\n   *   dictionary and similarly `metadata` is a {Metadata} object with\n   *   information from the metadata section of the PDF.\n   */\n  getMetadata() {\n    return this._transport.getMetadata();\n  }\n\n  /**\n   * @typedef {Object} MarkInfo\n   * Properties correspond to Table 321 of the PDF 32000-1:2008 spec.\n   * @property {boolean} Marked\n   * @property {boolean} UserProperties\n   * @property {boolean} Suspects\n   */\n\n  /**\n   * @returns {Promise<MarkInfo | null>} A promise that is resolved with\n   *   a {MarkInfo} object that contains the MarkInfo flags for the PDF\n   *   document, or `null` when no MarkInfo values are present in the PDF file.\n   */\n  getMarkInfo() {\n    return this._transport.getMarkInfo();\n  }\n\n  /**\n   * @returns {Promise<Uint8Array>} A promise that is resolved with a\n   *   {Uint8Array} containing the raw data of the PDF document.\n   */\n  getData() {\n    return this._transport.getData();\n  }\n\n  /**\n   * @returns {Promise<Uint8Array>} A promise that is resolved with a\n   *   {Uint8Array} containing the full data of the saved document.\n   */\n  saveDocument() {\n    return this._transport.saveDocument();\n  }\n\n  /**\n   * @returns {Promise<{ length: number }>} A promise that is resolved when the\n   *   document's data is loaded. It is resolved with an {Object} that contains\n   *   the `length` property that indicates size of the PDF data in bytes.\n   */\n  getDownloadInfo() {\n    return this._transport.downloadInfoCapability.promise;\n  }\n\n  /**\n   * Cleans up resources allocated by the document on both the main and worker\n   * threads.\n   *\n   * NOTE: Do not, under any circumstances, call this method when rendering is\n   * currently ongoing since that may lead to rendering errors.\n   *\n   * @param {boolean} [keepLoadedFonts] - Let fonts remain attached to the DOM.\n   *   NOTE: This will increase persistent memory usage, hence don't use this\n   *   option unless absolutely necessary. The default value is `false`.\n   * @returns {Promise} A promise that is resolved when clean-up has finished.\n   */\n  cleanup(keepLoadedFonts = false) {\n    return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa);\n  }\n\n  /**\n   * Destroys the current document instance and terminates the worker.\n   */\n  destroy() {\n    return this.loadingTask.destroy();\n  }\n\n  /**\n   * @type {DocumentInitParameters} A subset of the current\n   *   {DocumentInitParameters}, which are needed in the viewer.\n   */\n  get loadingParams() {\n    return this._transport.loadingParams;\n  }\n\n  /**\n   * @type {PDFDocumentLoadingTask} The loadingTask for the current document.\n   */\n  get loadingTask() {\n    return this._transport.loadingTask;\n  }\n\n  /**\n   * @returns {Promise<Object<string, Array<Object>> | null>} A promise that is\n   *   resolved with an {Object} containing /AcroForm field data for the JS\n   *   sandbox, or `null` when no field data is present in the PDF file.\n   */\n  getFieldObjects() {\n    return this._transport.getFieldObjects();\n  }\n\n  /**\n   * @returns {Promise<boolean>} A promise that is resolved with `true`\n   *   if some /AcroForm fields have JavaScript actions.\n   */\n  hasJSActions() {\n    return this._transport.hasJSActions();\n  }\n\n  /**\n   * @returns {Promise<Array<string> | null>} A promise that is resolved with an\n   *   {Array<string>} containing IDs of annotations that have a calculation\n   *   action, or `null` when no such annotations are present in the PDF file.\n   */\n  getCalculationOrderIds() {\n    return this._transport.getCalculationOrderIds();\n  }\n}\n\n/**\n * Page getViewport parameters.\n *\n * @typedef {Object} GetViewportParameters\n * @property {number} scale - The desired scale of the viewport.\n * @property {number} [rotation] - The desired rotation, in degrees, of\n *   the viewport. If omitted it defaults to the page rotation.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.\n *   The default value is `0`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.\n *   The default value is `0`.\n * @property {boolean} [dontFlip] - If true, the y-axis will not be\n *   flipped. The default value is `false`.\n */\n\n/**\n * Page getTextContent parameters.\n *\n * @typedef {Object} getTextContentParameters\n * @property {boolean} [includeMarkedContent] - When true include marked\n *   content items in the items array of TextContent. The default is `false`.\n * @property {boolean} [disableNormalization] - When true the text is *not*\n *   normalized in the worker-thread. The default is `false`.\n */\n\n/**\n * Page text content.\n *\n * @typedef {Object} TextContent\n * @property {Array<TextItem | TextMarkedContent>} items - Array of\n *   {@link TextItem} and {@link TextMarkedContent} objects. TextMarkedContent\n *   items are included when includeMarkedContent is true.\n * @property {Object<string, TextStyle>} styles - {@link TextStyle} objects,\n *   indexed by font name.\n */\n\n/**\n * Page text content part.\n *\n * @typedef {Object} TextItem\n * @property {string} str - Text content.\n * @property {string} dir - Text direction: 'ttb', 'ltr' or 'rtl'.\n * @property {Array<any>} transform - Transformation matrix.\n * @property {number} width - Width in device space.\n * @property {number} height - Height in device space.\n * @property {string} fontName - Font name used by PDF.js for converted font.\n * @property {boolean} hasEOL - Indicating if the text content is followed by a\n *   line-break.\n */\n\n/**\n * Page text marked content part.\n *\n * @typedef {Object} TextMarkedContent\n * @property {string} type - Either 'beginMarkedContent',\n *   'beginMarkedContentProps', or 'endMarkedContent'.\n * @property {string} id - The marked content identifier. Only used for type\n *   'beginMarkedContentProps'.\n */\n\n/**\n * Text style.\n *\n * @typedef {Object} TextStyle\n * @property {number} ascent - Font ascent.\n * @property {number} descent - Font descent.\n * @property {boolean} vertical - Whether or not the text is in vertical mode.\n * @property {string} fontFamily - The possible font family.\n */\n\n/**\n * Page annotation parameters.\n *\n * @typedef {Object} GetAnnotationsParameters\n * @property {string} [intent] - Determines the annotations that are fetched,\n *   can be 'display' (viewable annotations), 'print' (printable annotations),\n *   or 'any' (all annotations). The default value is 'display'.\n */\n\n/**\n * Page render parameters.\n *\n * @typedef {Object} RenderParameters\n * @property {CanvasRenderingContext2D} canvasContext - A 2D context of a DOM\n *   Canvas object.\n * @property {PageViewport} viewport - Rendering viewport obtained by calling\n *   the `PDFPageProxy.getViewport` method.\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n *   or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are rendered\n *   onto the canvas, for annotations with appearance-data; the values from\n *   {@link AnnotationMode} should be used. The following values are supported:\n *    - `AnnotationMode.DISABLE`, which disables all annotations.\n *    - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n *      it also depends on the `intent`-option, see above).\n *    - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n *      interactive form elements (those will be rendered in the display layer).\n *    - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n *      (as above) but where interactive form elements are updated with data\n *      from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n *   The default value is `AnnotationMode.ENABLE`.\n * @property {Array<any>} [transform] - Additional transform, applied just\n *   before viewport transform.\n * @property {CanvasGradient | CanvasPattern | string} [background] - Background\n *   to use for the canvas.\n *   Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS\n *   <color> value, a `CanvasGradient` object (a linear or radial gradient) or\n *   a `CanvasPattern` object (a repetitive image). The default value is\n *   'rgb(255,255,255)'.\n *\n *   NOTE: This option may be partially, or completely, ignored when the\n *   `pageColors`-option is used.\n * @property {Object} [pageColors] - Overwrites background and foreground colors\n *   with user defined ones in order to improve readability in high contrast\n *   mode.\n * @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise] -\n *   A promise that should resolve with an {@link OptionalContentConfig}\n *   created from `PDFDocumentProxy.getOptionalContentConfig`. If `null`,\n *   the configuration will be fetched automatically with the default visibility\n *   states set.\n * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap] - Map some\n *   annotation ids with canvases used to render them.\n * @property {PrintAnnotationStorage} [printAnnotationStorage]\n */\n\n/**\n * Page getOperatorList parameters.\n *\n * @typedef {Object} GetOperatorListParameters\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n *   or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are included\n *   in the operatorList, for annotations with appearance-data; the values from\n *   {@link AnnotationMode} should be used. The following values are supported:\n *    - `AnnotationMode.DISABLE`, which disables all annotations.\n *    - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n *      it also depends on the `intent`-option, see above).\n *    - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n *      interactive form elements (those will be rendered in the display layer).\n *    - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n *      (as above) but where interactive form elements are updated with data\n *      from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n *   The default value is `AnnotationMode.ENABLE`.\n * @property {PrintAnnotationStorage} [printAnnotationStorage]\n */\n\n/**\n * Structure tree node. The root node will have a role \"Root\".\n *\n * @typedef {Object} StructTreeNode\n * @property {Array<StructTreeNode | StructTreeContent>} children - Array of\n *   {@link StructTreeNode} and {@link StructTreeContent} objects.\n * @property {string} role - element's role, already mapped if a role map exists\n * in the PDF.\n */\n\n/**\n * Structure tree content.\n *\n * @typedef {Object} StructTreeContent\n * @property {string} type - either \"content\" for page and stream structure\n *   elements or \"object\" for object references.\n * @property {string} id - unique id that will map to the text layer.\n */\n\n/**\n * PDF page operator list.\n *\n * @typedef {Object} PDFOperatorList\n * @property {Array<number>} fnArray - Array containing the operator functions.\n * @property {Array<any>} argsArray - Array containing the arguments of the\n *   functions.\n */\n\n/**\n * Proxy to a `PDFPage` in the worker thread.\n */\nclass PDFPageProxy {\n  #delayedCleanupTimeout = null;\n\n  #pendingCleanup = false;\n\n  constructor(pageIndex, pageInfo, transport, pdfBug = false) {\n    this._pageIndex = pageIndex;\n    this._pageInfo = pageInfo;\n    this._transport = transport;\n    this._stats = pdfBug ? new StatTimer() : null;\n    this._pdfBug = pdfBug;\n    /** @type {PDFObjects} */\n    this.commonObjs = transport.commonObjs;\n    this.objs = new PDFObjects();\n\n    this._maybeCleanupAfterRender = false;\n    this._intentStates = new Map();\n    this.destroyed = false;\n  }\n\n  /**\n   * @type {number} Page number of the page. First page is 1.\n   */\n  get pageNumber() {\n    return this._pageIndex + 1;\n  }\n\n  /**\n   * @type {number} The number of degrees the page is rotated clockwise.\n   */\n  get rotate() {\n    return this._pageInfo.rotate;\n  }\n\n  /**\n   * @type {RefProxy | null} The reference that points to this page.\n   */\n  get ref() {\n    return this._pageInfo.ref;\n  }\n\n  /**\n   * @type {number} The default size of units in 1/72nds of an inch.\n   */\n  get userUnit() {\n    return this._pageInfo.userUnit;\n  }\n\n  /**\n   * @type {Array<number>} An array of the visible portion of the PDF page in\n   *   user space units [x1, y1, x2, y2].\n   */\n  get view() {\n    return this._pageInfo.view;\n  }\n\n  /**\n   * @param {GetViewportParameters} params - Viewport parameters.\n   * @returns {PageViewport} Contains 'width' and 'height' properties\n   *   along with transforms required for rendering.\n   */\n  getViewport({\n    scale,\n    rotation = this.rotate,\n    offsetX = 0,\n    offsetY = 0,\n    dontFlip = false,\n  } = {}) {\n    return new PageViewport({\n      viewBox: this.view,\n      scale,\n      rotation,\n      offsetX,\n      offsetY,\n      dontFlip,\n    });\n  }\n\n  /**\n   * @param {GetAnnotationsParameters} params - Annotation parameters.\n   * @returns {Promise<Array<any>>} A promise that is resolved with an\n   *   {Array} of the annotation objects.\n   */\n  getAnnotations({ intent = \"display\" } = {}) {\n    const intentArgs = this._transport.getRenderingIntent(intent);\n\n    return this._transport.getAnnotations(\n      this._pageIndex,\n      intentArgs.renderingIntent\n    );\n  }\n\n  /**\n   * @returns {Promise<Object>} A promise that is resolved with an\n   *   {Object} with JS actions.\n   */\n  getJSActions() {\n    return this._transport.getPageJSActions(this._pageIndex);\n  }\n\n  /**\n   * @type {Object} The filter factory instance.\n   */\n  get filterFactory() {\n    return this._transport.filterFactory;\n  }\n\n  /**\n   * @type {boolean} True if only XFA form.\n   */\n  get isPureXfa() {\n    return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n  }\n\n  /**\n   * @returns {Promise<Object | null>} A promise that is resolved with\n   *   an {Object} with a fake DOM object (a tree structure where elements\n   *   are {Object} with a name, attributes (class, style, ...), value and\n   *   children, very similar to a HTML DOM tree), or `null` if no XFA exists.\n   */\n  async getXfa() {\n    return this._transport._htmlForXfa?.children[this._pageIndex] || null;\n  }\n\n  /**\n   * Begins the process of rendering a page to the desired context.\n   *\n   * @param {RenderParameters} params - Page render parameters.\n   * @returns {RenderTask} An object that contains a promise that is\n   *   resolved when the page finishes rendering.\n   */\n  render({\n    canvasContext,\n    viewport,\n    intent = \"display\",\n    annotationMode = AnnotationMode.ENABLE,\n    transform = null,\n    background = null,\n    optionalContentConfigPromise = null,\n    annotationCanvasMap = null,\n    pageColors = null,\n    printAnnotationStorage = null,\n  }) {\n    this._stats?.time(\"Overall\");\n\n    const intentArgs = this._transport.getRenderingIntent(\n      intent,\n      annotationMode,\n      printAnnotationStorage\n    );\n    // If there was a pending destroy, cancel it so no cleanup happens during\n    // this call to render...\n    this.#pendingCleanup = false;\n    // ... and ensure that a delayed cleanup is always aborted.\n    this.#abortDelayedCleanup();\n\n    if (!optionalContentConfigPromise) {\n      optionalContentConfigPromise = this._transport.getOptionalContentConfig();\n    }\n\n    let intentState = this._intentStates.get(intentArgs.cacheKey);\n    if (!intentState) {\n      intentState = Object.create(null);\n      this._intentStates.set(intentArgs.cacheKey, intentState);\n    }\n\n    // Ensure that a pending `streamReader` cancel timeout is always aborted.\n    if (intentState.streamReaderCancelTimeout) {\n      clearTimeout(intentState.streamReaderCancelTimeout);\n      intentState.streamReaderCancelTimeout = null;\n    }\n\n    const intentPrint = !!(\n      intentArgs.renderingIntent & RenderingIntentFlag.PRINT\n    );\n\n    // If there's no displayReadyCapability yet, then the operatorList\n    // was never requested before. Make the request and create the promise.\n    if (!intentState.displayReadyCapability) {\n      intentState.displayReadyCapability = new PromiseCapability();\n      intentState.operatorList = {\n        fnArray: [],\n        argsArray: [],\n        lastChunk: false,\n        separateAnnots: null,\n      };\n\n      this._stats?.time(\"Page Request\");\n      this._pumpOperatorList(intentArgs);\n    }\n\n    const complete = error => {\n      intentState.renderTasks.delete(internalRenderTask);\n\n      // Attempt to reduce memory usage during *printing*, by always running\n      // cleanup immediately once rendering has finished.\n      if (this._maybeCleanupAfterRender || intentPrint) {\n        this.#pendingCleanup = true;\n      }\n      this.#tryCleanup(/* delayed = */ !intentPrint);\n\n      if (error) {\n        internalRenderTask.capability.reject(error);\n\n        this._abortOperatorList({\n          intentState,\n          reason: error instanceof Error ? error : new Error(error),\n        });\n      } else {\n        internalRenderTask.capability.resolve();\n      }\n\n      this._stats?.timeEnd(\"Rendering\");\n      this._stats?.timeEnd(\"Overall\");\n    };\n\n    const internalRenderTask = new InternalRenderTask({\n      callback: complete,\n      // Only include the required properties, and *not* the entire object.\n      params: {\n        canvasContext,\n        viewport,\n        transform,\n        background,\n      },\n      objs: this.objs,\n      commonObjs: this.commonObjs,\n      annotationCanvasMap,\n      operatorList: intentState.operatorList,\n      pageIndex: this._pageIndex,\n      canvasFactory: this._transport.canvasFactory,\n      filterFactory: this._transport.filterFactory,\n      useRequestAnimationFrame: !intentPrint,\n      pdfBug: this._pdfBug,\n      pageColors,\n    });\n\n    (intentState.renderTasks ||= new Set()).add(internalRenderTask);\n    const renderTask = internalRenderTask.task;\n\n    Promise.all([\n      intentState.displayReadyCapability.promise,\n      optionalContentConfigPromise,\n    ])\n      .then(([transparency, optionalContentConfig]) => {\n        if (this.destroyed) {\n          complete();\n          return;\n        }\n        this._stats?.time(\"Rendering\");\n\n        internalRenderTask.initializeGraphics({\n          transparency,\n          optionalContentConfig,\n        });\n        internalRenderTask.operatorListChanged();\n      })\n      .catch(complete);\n\n    return renderTask;\n  }\n\n  /**\n   * @param {GetOperatorListParameters} params - Page getOperatorList\n   *   parameters.\n   * @returns {Promise<PDFOperatorList>} A promise resolved with an\n   *   {@link PDFOperatorList} object that represents the page's operator list.\n   */\n  getOperatorList({\n    intent = \"display\",\n    annotationMode = AnnotationMode.ENABLE,\n    printAnnotationStorage = null,\n  } = {}) {\n    if (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"GENERIC\")) {\n      throw new Error(\"Not implemented: getOperatorList\");\n    }\n    function operatorListChanged() {\n      if (intentState.operatorList.lastChunk) {\n        intentState.opListReadCapability.resolve(intentState.operatorList);\n\n        intentState.renderTasks.delete(opListTask);\n      }\n    }\n\n    const intentArgs = this._transport.getRenderingIntent(\n      intent,\n      annotationMode,\n      printAnnotationStorage,\n      /* isOpList = */ true\n    );\n    let intentState = this._intentStates.get(intentArgs.cacheKey);\n    if (!intentState) {\n      intentState = Object.create(null);\n      this._intentStates.set(intentArgs.cacheKey, intentState);\n    }\n    let opListTask;\n\n    if (!intentState.opListReadCapability) {\n      opListTask = Object.create(null);\n      opListTask.operatorListChanged = operatorListChanged;\n      intentState.opListReadCapability = new PromiseCapability();\n      (intentState.renderTasks ||= new Set()).add(opListTask);\n      intentState.operatorList = {\n        fnArray: [],\n        argsArray: [],\n        lastChunk: false,\n        separateAnnots: null,\n      };\n\n      this._stats?.time(\"Page Request\");\n      this._pumpOperatorList(intentArgs);\n    }\n    return intentState.opListReadCapability.promise;\n  }\n\n  /**\n   * NOTE: All occurrences of whitespace will be replaced by\n   * standard spaces (0x20).\n   *\n   * @param {getTextContentParameters} params - getTextContent parameters.\n   * @returns {ReadableStream} Stream for reading text content chunks.\n   */\n  streamTextContent({\n    includeMarkedContent = false,\n    disableNormalization = false,\n  } = {}) {\n    const TEXT_CONTENT_CHUNK_SIZE = 100;\n\n    return this._transport.messageHandler.sendWithStream(\n      \"GetTextContent\",\n      {\n        pageIndex: this._pageIndex,\n        includeMarkedContent: includeMarkedContent === true,\n        disableNormalization: disableNormalization === true,\n      },\n      {\n        highWaterMark: TEXT_CONTENT_CHUNK_SIZE,\n        size(textContent) {\n          return textContent.items.length;\n        },\n      }\n    );\n  }\n\n  /**\n   * NOTE: All occurrences of whitespace will be replaced by\n   * standard spaces (0x20).\n   *\n   * @param {getTextContentParameters} params - getTextContent parameters.\n   * @returns {Promise<TextContent>} A promise that is resolved with a\n   *   {@link TextContent} object that represents the page's text content.\n   */\n  getTextContent(params = {}) {\n    if (this._transport._htmlForXfa) {\n      // TODO: We need to revisit this once the XFA foreground patch lands and\n      // only do this for non-foreground XFA.\n      return this.getXfa().then(xfa => {\n        return XfaText.textContent(xfa);\n      });\n    }\n    const readableStream = this.streamTextContent(params);\n\n    return new Promise(function (resolve, reject) {\n      function pump() {\n        reader.read().then(function ({ value, done }) {\n          if (done) {\n            resolve(textContent);\n            return;\n          }\n          Object.assign(textContent.styles, value.styles);\n          textContent.items.push(...value.items);\n          pump();\n        }, reject);\n      }\n\n      const reader = readableStream.getReader();\n      const textContent = {\n        items: [],\n        styles: Object.create(null),\n      };\n      pump();\n    });\n  }\n\n  /**\n   * @returns {Promise<StructTreeNode>} A promise that is resolved with a\n   *   {@link StructTreeNode} object that represents the page's structure tree,\n   *   or `null` when no structure tree is present for the current page.\n   */\n  getStructTree() {\n    return this._transport.getStructTree(this._pageIndex);\n  }\n\n  /**\n   * Destroys the page object.\n   * @private\n   */\n  _destroy() {\n    this.destroyed = true;\n\n    const waitOn = [];\n    for (const intentState of this._intentStates.values()) {\n      this._abortOperatorList({\n        intentState,\n        reason: new Error(\"Page was destroyed.\"),\n        force: true,\n      });\n\n      if (intentState.opListReadCapability) {\n        // Avoid errors below, since the renderTasks are just stubs.\n        continue;\n      }\n      for (const internalRenderTask of intentState.renderTasks) {\n        waitOn.push(internalRenderTask.completed);\n        internalRenderTask.cancel();\n      }\n    }\n    this.objs.clear();\n    this.#pendingCleanup = false;\n    this.#abortDelayedCleanup();\n\n    return Promise.all(waitOn);\n  }\n\n  /**\n   * Cleans up resources allocated by the page.\n   *\n   * @param {boolean} [resetStats] - Reset page stats, if enabled.\n   *   The default value is `false`.\n   * @returns {boolean} Indicates if clean-up was successfully run.\n   */\n  cleanup(resetStats = false) {\n    this.#pendingCleanup = true;\n    const success = this.#tryCleanup(/* delayed = */ false);\n\n    if (resetStats && success) {\n      this._stats &&= new StatTimer();\n    }\n    return success;\n  }\n\n  /**\n   * Attempts to clean up if rendering is in a state where that's possible.\n   * @param {boolean} [delayed] - Delay the cleanup, to e.g. improve zooming\n   *   performance in documents with large images.\n   *   The default value is `false`.\n   * @returns {boolean} Indicates if clean-up was successfully run.\n   */\n  #tryCleanup(delayed = false) {\n    this.#abortDelayedCleanup();\n\n    if (!this.#pendingCleanup || this.destroyed) {\n      return false;\n    }\n    if (delayed) {\n      this.#delayedCleanupTimeout = setTimeout(() => {\n        this.#delayedCleanupTimeout = null;\n        this.#tryCleanup(/* delayed = */ false);\n      }, DELAYED_CLEANUP_TIMEOUT);\n\n      return false;\n    }\n    for (const { renderTasks, operatorList } of this._intentStates.values()) {\n      if (renderTasks.size > 0 || !operatorList.lastChunk) {\n        return false;\n      }\n    }\n    this._intentStates.clear();\n    this.objs.clear();\n    this.#pendingCleanup = false;\n    return true;\n  }\n\n  #abortDelayedCleanup() {\n    if (this.#delayedCleanupTimeout) {\n      clearTimeout(this.#delayedCleanupTimeout);\n      this.#delayedCleanupTimeout = null;\n    }\n  }\n\n  /**\n   * @private\n   */\n  _startRenderPage(transparency, cacheKey) {\n    const intentState = this._intentStates.get(cacheKey);\n    if (!intentState) {\n      return; // Rendering was cancelled.\n    }\n    this._stats?.timeEnd(\"Page Request\");\n\n    // TODO Refactor RenderPageRequest to separate rendering\n    // and operator list logic\n    intentState.displayReadyCapability?.resolve(transparency);\n  }\n\n  /**\n   * @private\n   */\n  _renderPageChunk(operatorListChunk, intentState) {\n    // Add the new chunk to the current operator list.\n    for (let i = 0, ii = operatorListChunk.length; i < ii; i++) {\n      intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]);\n      intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]);\n    }\n    intentState.operatorList.lastChunk = operatorListChunk.lastChunk;\n    intentState.operatorList.separateAnnots = operatorListChunk.separateAnnots;\n\n    // Notify all the rendering tasks there are more operators to be consumed.\n    for (const internalRenderTask of intentState.renderTasks) {\n      internalRenderTask.operatorListChanged();\n    }\n\n    if (operatorListChunk.lastChunk) {\n      this.#tryCleanup(/* delayed = */ true);\n    }\n  }\n\n  /**\n   * @private\n   */\n  _pumpOperatorList({\n    renderingIntent,\n    cacheKey,\n    annotationStorageSerializable,\n  }) {\n    if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n      assert(\n        Number.isInteger(renderingIntent) && renderingIntent > 0,\n        '_pumpOperatorList: Expected valid \"renderingIntent\" argument.'\n      );\n    }\n    const { map, transfer } = annotationStorageSerializable;\n\n    const readableStream = this._transport.messageHandler.sendWithStream(\n      \"GetOperatorList\",\n      {\n        pageIndex: this._pageIndex,\n        intent: renderingIntent,\n        cacheKey,\n        annotationStorage: map,\n      },\n      transfer\n    );\n    const reader = readableStream.getReader();\n\n    const intentState = this._intentStates.get(cacheKey);\n    intentState.streamReader = reader;\n\n    const pump = () => {\n      reader.read().then(\n        ({ value, done }) => {\n          if (done) {\n            intentState.streamReader = null;\n            return;\n          }\n          if (this._transport.destroyed) {\n            return; // Ignore any pending requests if the worker was terminated.\n          }\n          this._renderPageChunk(value, intentState);\n          pump();\n        },\n        reason => {\n          intentState.streamReader = null;\n\n          if (this._transport.destroyed) {\n            return; // Ignore any pending requests if the worker was terminated.\n          }\n          if (intentState.operatorList) {\n            // Mark operator list as complete.\n            intentState.operatorList.lastChunk = true;\n\n            for (const internalRenderTask of intentState.renderTasks) {\n              internalRenderTask.operatorListChanged();\n            }\n            this.#tryCleanup(/* delayed = */ true);\n          }\n\n          if (intentState.displayReadyCapability) {\n            intentState.displayReadyCapability.reject(reason);\n          } else if (intentState.opListReadCapability) {\n            intentState.opListReadCapability.reject(reason);\n          } else {\n            throw reason;\n          }\n        }\n      );\n    };\n    pump();\n  }\n\n  /**\n   * @private\n   */\n  _abortOperatorList({ intentState, reason, force = false }) {\n    if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n      assert(\n        reason instanceof Error,\n        '_abortOperatorList: Expected valid \"reason\" argument.'\n      );\n    }\n\n    if (!intentState.streamReader) {\n      return;\n    }\n    // Ensure that a pending `streamReader` cancel timeout is always aborted.\n    if (intentState.streamReaderCancelTimeout) {\n      clearTimeout(intentState.streamReaderCancelTimeout);\n      intentState.streamReaderCancelTimeout = null;\n    }\n\n    if (!force) {\n      // Ensure that an Error occurring in *only* one `InternalRenderTask`, e.g.\n      // multiple render() calls on the same canvas, won't break all rendering.\n      if (intentState.renderTasks.size > 0) {\n        return;\n      }\n      // Don't immediately abort parsing on the worker-thread when rendering is\n      // cancelled, since that will unnecessarily delay re-rendering when (for\n      // partially parsed pages) e.g. zooming/rotation occurs in the viewer.\n      if (reason instanceof RenderingCancelledException) {\n        let delay = RENDERING_CANCELLED_TIMEOUT;\n        if (reason.extraDelay > 0 && reason.extraDelay < /* ms = */ 1000) {\n          // Above, we prevent the total delay from becoming arbitrarily large.\n          delay += reason.extraDelay;\n        }\n\n        intentState.streamReaderCancelTimeout = setTimeout(() => {\n          intentState.streamReaderCancelTimeout = null;\n          this._abortOperatorList({ intentState, reason, force: true });\n        }, delay);\n        return;\n      }\n    }\n    intentState.streamReader\n      .cancel(new AbortException(reason.message))\n      .catch(() => {\n        // Avoid \"Uncaught promise\" messages in the console.\n      });\n    intentState.streamReader = null;\n\n    if (this._transport.destroyed) {\n      return; // Ignore any pending requests if the worker was terminated.\n    }\n    // Remove the current `intentState`, since a cancelled `getOperatorList`\n    // call on the worker-thread cannot be re-started...\n    for (const [curCacheKey, curIntentState] of this._intentStates) {\n      if (curIntentState === intentState) {\n        this._intentStates.delete(curCacheKey);\n        break;\n      }\n    }\n    // ... and force clean-up to ensure that any old state is always removed.\n    this.cleanup();\n  }\n\n  /**\n   * @type {StatTimer | null} Returns page stats, if enabled; returns `null`\n   *   otherwise.\n   */\n  get stats() {\n    return this._stats;\n  }\n}\n\nclass LoopbackPort {\n  #listeners = new Set();\n\n  #deferred = Promise.resolve();\n\n  postMessage(obj, transfer) {\n    const event = {\n      data: structuredClone(obj, transfer ? { transfer } : null),\n    };\n\n    this.#deferred.then(() => {\n      for (const listener of this.#listeners) {\n        listener.call(this, event);\n      }\n    });\n  }\n\n  addEventListener(name, listener) {\n    this.#listeners.add(listener);\n  }\n\n  removeEventListener(name, listener) {\n    this.#listeners.delete(listener);\n  }\n\n  terminate() {\n    this.#listeners.clear();\n  }\n}\n\n/**\n * @typedef {Object} PDFWorkerParameters\n * @property {string} [name] - The name of the worker.\n * @property {Worker} [port] - The `workerPort` object.\n * @property {number} [verbosity] - Controls the logging level;\n *   the constants from {@link VerbosityLevel} should be used.\n */\n\nconst PDFWorkerUtil = {\n  isWorkerDisabled: false,\n  fakeWorkerId: 0,\n};\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n  if (isNodeJS) {\n    // Workers aren't supported in Node.js, force-disabling them there.\n    PDFWorkerUtil.isWorkerDisabled = true;\n\n    GlobalWorkerOptions.workerSrc ||= PDFJSDev.test(\"LIB\")\n      ? \"../pdf.worker.js\"\n      : \"./pdf.worker.mjs\";\n  }\n\n  // Check if URLs have the same origin. For non-HTTP based URLs, returns false.\n  PDFWorkerUtil.isSameOrigin = function (baseUrl, otherUrl) {\n    let base;\n    try {\n      base = new URL(baseUrl);\n      if (!base.origin || base.origin === \"null\") {\n        return false; // non-HTTP url\n      }\n    } catch {\n      return false;\n    }\n\n    const other = new URL(otherUrl, base);\n    return base.origin === other.origin;\n  };\n\n  PDFWorkerUtil.createCDNWrapper = function (url) {\n    // We will rely on blob URL's property to specify origin.\n    // We want this function to fail in case if createObjectURL or Blob do not\n    // exist or fail for some reason -- our Worker creation will fail anyway.\n    const wrapper = `await import(\"${url}\");`;\n    return URL.createObjectURL(\n      new Blob([wrapper], { type: \"text/javascript\" })\n    );\n  };\n}\n\n/**\n * PDF.js web worker abstraction that controls the instantiation of PDF\n * documents. Message handlers are used to pass information from the main\n * thread to the worker thread and vice versa. If the creation of a web\n * worker is not possible, a \"fake\" worker will be used instead.\n *\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n */\nclass PDFWorker {\n  static #workerPorts;\n\n  constructor({\n    name = null,\n    port = null,\n    verbosity = getVerbosityLevel(),\n  } = {}) {\n    this.name = name;\n    this.destroyed = false;\n    this.verbosity = verbosity;\n\n    this._readyCapability = new PromiseCapability();\n    this._port = null;\n    this._webWorker = null;\n    this._messageHandler = null;\n\n    if (\n      (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) &&\n      port\n    ) {\n      if (PDFWorker.#workerPorts?.has(port)) {\n        throw new Error(\"Cannot use more than one PDFWorker per port.\");\n      }\n      (PDFWorker.#workerPorts ||= new WeakMap()).set(port, this);\n      this._initializeFromPort(port);\n      return;\n    }\n    this._initialize();\n  }\n\n  /**\n   * Promise for worker initialization completion.\n   * @type {Promise<void>}\n   */\n  get promise() {\n    return this._readyCapability.promise;\n  }\n\n  /**\n   * The current `workerPort`, when it exists.\n   * @type {Worker}\n   */\n  get port() {\n    return this._port;\n  }\n\n  /**\n   * The current MessageHandler-instance.\n   * @type {MessageHandler}\n   */\n  get messageHandler() {\n    return this._messageHandler;\n  }\n\n  _initializeFromPort(port) {\n    if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n      throw new Error(\"Not implemented: _initializeFromPort\");\n    }\n    this._port = port;\n    this._messageHandler = new MessageHandler(\"main\", \"worker\", port);\n    this._messageHandler.on(\"ready\", function () {\n      // Ignoring \"ready\" event -- MessageHandler should already be initialized\n      // and ready to accept messages.\n    });\n    this._readyCapability.resolve();\n    // Send global setting, e.g. verbosity level.\n    this._messageHandler.send(\"configure\", {\n      verbosity: this.verbosity,\n    });\n  }\n\n  _initialize() {\n    // If worker support isn't disabled explicit and the browser has worker\n    // support, create a new web worker and test if it/the browser fulfills\n    // all requirements to run parts of pdf.js in a web worker.\n    // Right now, the requirement is, that an Uint8Array is still an\n    // Uint8Array as it arrives on the worker. (Chrome added this with v.15.)\n    if (\n      !PDFWorkerUtil.isWorkerDisabled &&\n      !PDFWorker.#mainThreadWorkerMessageHandler\n    ) {\n      let { workerSrc } = PDFWorker;\n\n      try {\n        // Wraps workerSrc path into blob URL, if the former does not belong\n        // to the same origin.\n        if (\n          typeof PDFJSDev !== \"undefined\" &&\n          PDFJSDev.test(\"GENERIC\") &&\n          !PDFWorkerUtil.isSameOrigin(window.location.href, workerSrc)\n        ) {\n          workerSrc = PDFWorkerUtil.createCDNWrapper(\n            new URL(workerSrc, window.location).href\n          );\n        }\n\n        const worker = new Worker(workerSrc, { type: \"module\" });\n        const messageHandler = new MessageHandler(\"main\", \"worker\", worker);\n        const terminateEarly = () => {\n          worker.removeEventListener(\"error\", onWorkerError);\n          messageHandler.destroy();\n          worker.terminate();\n          if (this.destroyed) {\n            this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n          } else {\n            // Fall back to fake worker if the termination is caused by an\n            // error (e.g. NetworkError / SecurityError).\n            this._setupFakeWorker();\n          }\n        };\n\n        const onWorkerError = () => {\n          if (!this._webWorker) {\n            // Worker failed to initialize due to an error. Clean up and fall\n            // back to the fake worker.\n            terminateEarly();\n          }\n        };\n        worker.addEventListener(\"error\", onWorkerError);\n\n        messageHandler.on(\"test\", data => {\n          worker.removeEventListener(\"error\", onWorkerError);\n          if (this.destroyed) {\n            terminateEarly();\n            return; // worker was destroyed\n          }\n          if (data) {\n            this._messageHandler = messageHandler;\n            this._port = worker;\n            this._webWorker = worker;\n\n            this._readyCapability.resolve();\n            // Send global setting, e.g. verbosity level.\n            messageHandler.send(\"configure\", {\n              verbosity: this.verbosity,\n            });\n          } else {\n            this._setupFakeWorker();\n            messageHandler.destroy();\n            worker.terminate();\n          }\n        });\n\n        messageHandler.on(\"ready\", data => {\n          worker.removeEventListener(\"error\", onWorkerError);\n          if (this.destroyed) {\n            terminateEarly();\n            return; // worker was destroyed\n          }\n          try {\n            sendTest();\n          } catch {\n            // We need fallback to a faked worker.\n            this._setupFakeWorker();\n          }\n        });\n\n        const sendTest = () => {\n          const testObj = new Uint8Array();\n          // Ensure that we can use `postMessage` transfers.\n          messageHandler.send(\"test\", testObj, [testObj.buffer]);\n        };\n\n        // It might take time for the worker to initialize. We will try to send\n        // the \"test\" message immediately, and once the \"ready\" message arrives.\n        // The worker shall process only the first received \"test\" message.\n        sendTest();\n        return;\n      } catch {\n        info(\"The worker has been disabled.\");\n      }\n    }\n    // Either workers are disabled, not supported or have thrown an exception.\n    // Thus, we fallback to a faked worker.\n    this._setupFakeWorker();\n  }\n\n  _setupFakeWorker() {\n    if (!PDFWorkerUtil.isWorkerDisabled) {\n      warn(\"Setting up fake worker.\");\n      PDFWorkerUtil.isWorkerDisabled = true;\n    }\n\n    PDFWorker._setupFakeWorkerGlobal\n      .then(WorkerMessageHandler => {\n        if (this.destroyed) {\n          this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n          return;\n        }\n        const port = new LoopbackPort();\n        this._port = port;\n\n        // All fake workers use the same port, making id unique.\n        const id = `fake${PDFWorkerUtil.fakeWorkerId++}`;\n\n        // If the main thread is our worker, setup the handling for the\n        // messages -- the main thread sends to it self.\n        const workerHandler = new MessageHandler(id + \"_worker\", id, port);\n        WorkerMessageHandler.setup(workerHandler, port);\n\n        const messageHandler = new MessageHandler(id, id + \"_worker\", port);\n        this._messageHandler = messageHandler;\n        this._readyCapability.resolve();\n        // Send global setting, e.g. verbosity level.\n        messageHandler.send(\"configure\", {\n          verbosity: this.verbosity,\n        });\n      })\n      .catch(reason => {\n        this._readyCapability.reject(\n          new Error(`Setting up fake worker failed: \"${reason.message}\".`)\n        );\n      });\n  }\n\n  /**\n   * Destroys the worker instance.\n   */\n  destroy() {\n    this.destroyed = true;\n    if (this._webWorker) {\n      // We need to terminate only web worker created resource.\n      this._webWorker.terminate();\n      this._webWorker = null;\n    }\n    PDFWorker.#workerPorts?.delete(this._port);\n    this._port = null;\n    if (this._messageHandler) {\n      this._messageHandler.destroy();\n      this._messageHandler = null;\n    }\n  }\n\n  /**\n   * @param {PDFWorkerParameters} params - The worker initialization parameters.\n   */\n  static fromPort(params) {\n    if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n      throw new Error(\"Not implemented: fromPort\");\n    }\n    if (!params?.port) {\n      throw new Error(\"PDFWorker.fromPort - invalid method signature.\");\n    }\n    const cachedPort = this.#workerPorts?.get(params.port);\n    if (cachedPort) {\n      if (cachedPort._pendingDestroy) {\n        throw new Error(\n          \"PDFWorker.fromPort - the worker is being destroyed.\\n\" +\n            \"Please remember to await `PDFDocumentLoadingTask.destroy()`-calls.\"\n        );\n      }\n      return cachedPort;\n    }\n    return new PDFWorker(params);\n  }\n\n  /**\n   * The current `workerSrc`, when it exists.\n   * @type {string}\n   */\n  static get workerSrc() {\n    if (GlobalWorkerOptions.workerSrc) {\n      return GlobalWorkerOptions.workerSrc;\n    }\n    throw new Error('No \"GlobalWorkerOptions.workerSrc\" specified.');\n  }\n\n  static get #mainThreadWorkerMessageHandler() {\n    try {\n      return globalThis.pdfjsWorker?.WorkerMessageHandler || null;\n    } catch {\n      return null;\n    }\n  }\n\n  // Loads worker code into the main-thread.\n  static get _setupFakeWorkerGlobal() {\n    const loader = async () => {\n      if (this.#mainThreadWorkerMessageHandler) {\n        // The worker was already loaded using e.g. a `<script>` tag.\n        return this.#mainThreadWorkerMessageHandler;\n      }\n      const worker =\n        typeof PDFJSDev === \"undefined\"\n          ? await import(\"pdfjs/pdf.worker.js\")\n          : await import(/* webpackIgnore: true */ this.workerSrc);\n      return worker.WorkerMessageHandler;\n    };\n\n    return shadow(this, \"_setupFakeWorkerGlobal\", loader());\n  }\n}\n\n/**\n * For internal use only.\n * @ignore\n */\nclass WorkerTransport {\n  #methodPromises = new Map();\n\n  #pageCache = new Map();\n\n  #pagePromises = new Map();\n\n  #passwordCapability = null;\n\n  constructor(messageHandler, loadingTask, networkStream, params, factory) {\n    this.messageHandler = messageHandler;\n    this.loadingTask = loadingTask;\n    this.commonObjs = new PDFObjects();\n    this.fontLoader = new FontLoader({\n      ownerDocument: params.ownerDocument,\n      styleElement: params.styleElement,\n    });\n    this._params = params;\n\n    this.canvasFactory = factory.canvasFactory;\n    this.filterFactory = factory.filterFactory;\n    this.cMapReaderFactory = factory.cMapReaderFactory;\n    this.standardFontDataFactory = factory.standardFontDataFactory;\n\n    this.destroyed = false;\n    this.destroyCapability = null;\n\n    this._networkStream = networkStream;\n    this._fullReader = null;\n    this._lastProgress = null;\n    this.downloadInfoCapability = new PromiseCapability();\n\n    this.setupMessageHandler();\n\n    if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n      // For testing purposes.\n      Object.defineProperty(this, \"getXFADatasets\", {\n        value: () => {\n          return this.messageHandler.sendWithPromise(\"GetXFADatasets\", null);\n        },\n      });\n      Object.defineProperty(this, \"getXRefPrevValue\", {\n        value: () => {\n          return this.messageHandler.sendWithPromise(\"GetXRefPrevValue\", null);\n        },\n      });\n      Object.defineProperty(this, \"getAnnotArray\", {\n        value: pageIndex => {\n          return this.messageHandler.sendWithPromise(\"GetAnnotArray\", {\n            pageIndex,\n          });\n        },\n      });\n    }\n  }\n\n  #cacheSimpleMethod(name, data = null) {\n    const cachedPromise = this.#methodPromises.get(name);\n    if (cachedPromise) {\n      return cachedPromise;\n    }\n    const promise = this.messageHandler.sendWithPromise(name, data);\n\n    this.#methodPromises.set(name, promise);\n    return promise;\n  }\n\n  get annotationStorage() {\n    return shadow(this, \"annotationStorage\", new AnnotationStorage());\n  }\n\n  getRenderingIntent(\n    intent,\n    annotationMode = AnnotationMode.ENABLE,\n    printAnnotationStorage = null,\n    isOpList = false\n  ) {\n    let renderingIntent = RenderingIntentFlag.DISPLAY; // Default value.\n    let annotationStorageSerializable = SerializableEmpty;\n\n    switch (intent) {\n      case \"any\":\n        renderingIntent = RenderingIntentFlag.ANY;\n        break;\n      case \"display\":\n        break;\n      case \"print\":\n        renderingIntent = RenderingIntentFlag.PRINT;\n        break;\n      default:\n        warn(`getRenderingIntent - invalid intent: ${intent}`);\n    }\n\n    switch (annotationMode) {\n      case AnnotationMode.DISABLE:\n        renderingIntent += RenderingIntentFlag.ANNOTATIONS_DISABLE;\n        break;\n      case AnnotationMode.ENABLE:\n        break;\n      case AnnotationMode.ENABLE_FORMS:\n        renderingIntent += RenderingIntentFlag.ANNOTATIONS_FORMS;\n        break;\n      case AnnotationMode.ENABLE_STORAGE:\n        renderingIntent += RenderingIntentFlag.ANNOTATIONS_STORAGE;\n\n        const annotationStorage =\n          renderingIntent & RenderingIntentFlag.PRINT &&\n          printAnnotationStorage instanceof PrintAnnotationStorage\n            ? printAnnotationStorage\n            : this.annotationStorage;\n\n        annotationStorageSerializable = annotationStorage.serializable;\n        break;\n      default:\n        warn(`getRenderingIntent - invalid annotationMode: ${annotationMode}`);\n    }\n\n    if (isOpList) {\n      renderingIntent += RenderingIntentFlag.OPLIST;\n    }\n\n    return {\n      renderingIntent,\n      cacheKey: `${renderingIntent}_${annotationStorageSerializable.hash}`,\n      annotationStorageSerializable,\n    };\n  }\n\n  destroy() {\n    if (this.destroyCapability) {\n      return this.destroyCapability.promise;\n    }\n\n    this.destroyed = true;\n    this.destroyCapability = new PromiseCapability();\n\n    this.#passwordCapability?.reject(\n      new Error(\"Worker was destroyed during onPassword callback\")\n    );\n\n    const waitOn = [];\n    // We need to wait for all renderings to be completed, e.g.\n    // timeout/rAF can take a long time.\n    for (const page of this.#pageCache.values()) {\n      waitOn.push(page._destroy());\n    }\n    this.#pageCache.clear();\n    this.#pagePromises.clear();\n    // Allow `AnnotationStorage`-related clean-up when destroying the document.\n    if (this.hasOwnProperty(\"annotationStorage\")) {\n      this.annotationStorage.resetModified();\n    }\n    // We also need to wait for the worker to finish its long running tasks.\n    const terminated = this.messageHandler.sendWithPromise(\"Terminate\", null);\n    waitOn.push(terminated);\n\n    Promise.all(waitOn).then(() => {\n      this.commonObjs.clear();\n      this.fontLoader.clear();\n      this.#methodPromises.clear();\n      this.filterFactory.destroy();\n\n      this._networkStream?.cancelAllRequests(\n        new AbortException(\"Worker was terminated.\")\n      );\n\n      if (this.messageHandler) {\n        this.messageHandler.destroy();\n        this.messageHandler = null;\n      }\n      this.destroyCapability.resolve();\n    }, this.destroyCapability.reject);\n    return this.destroyCapability.promise;\n  }\n\n  setupMessageHandler() {\n    const { messageHandler, loadingTask } = this;\n\n    messageHandler.on(\"GetReader\", (data, sink) => {\n      assert(\n        this._networkStream,\n        \"GetReader - no `IPDFStream` instance available.\"\n      );\n      this._fullReader = this._networkStream.getFullReader();\n      this._fullReader.onProgress = evt => {\n        this._lastProgress = {\n          loaded: evt.loaded,\n          total: evt.total,\n        };\n      };\n      sink.onPull = () => {\n        this._fullReader\n          .read()\n          .then(function ({ value, done }) {\n            if (done) {\n              sink.close();\n              return;\n            }\n            assert(\n              value instanceof ArrayBuffer,\n              \"GetReader - expected an ArrayBuffer.\"\n            );\n            // Enqueue data chunk into sink, and transfer it\n            // to other side as `Transferable` object.\n            sink.enqueue(new Uint8Array(value), 1, [value]);\n          })\n          .catch(reason => {\n            sink.error(reason);\n          });\n      };\n\n      sink.onCancel = reason => {\n        this._fullReader.cancel(reason);\n\n        sink.ready.catch(readyReason => {\n          if (this.destroyed) {\n            return; // Ignore any pending requests if the worker was terminated.\n          }\n          throw readyReason;\n        });\n      };\n    });\n\n    messageHandler.on(\"ReaderHeadersReady\", data => {\n      const headersCapability = new PromiseCapability();\n      const fullReader = this._fullReader;\n      fullReader.headersReady.then(() => {\n        // If stream or range are disabled, it's our only way to report\n        // loading progress.\n        if (!fullReader.isStreamingSupported || !fullReader.isRangeSupported) {\n          if (this._lastProgress) {\n            loadingTask.onProgress?.(this._lastProgress);\n          }\n          fullReader.onProgress = evt => {\n            loadingTask.onProgress?.({\n              loaded: evt.loaded,\n              total: evt.total,\n            });\n          };\n        }\n\n        headersCapability.resolve({\n          isStreamingSupported: fullReader.isStreamingSupported,\n          isRangeSupported: fullReader.isRangeSupported,\n          contentLength: fullReader.contentLength,\n        });\n      }, headersCapability.reject);\n\n      return headersCapability.promise;\n    });\n\n    messageHandler.on(\"GetRangeReader\", (data, sink) => {\n      assert(\n        this._networkStream,\n        \"GetRangeReader - no `IPDFStream` instance available.\"\n      );\n      const rangeReader = this._networkStream.getRangeReader(\n        data.begin,\n        data.end\n      );\n\n      // When streaming is enabled, it's possible that the data requested here\n      // has already been fetched via the `_fullRequestReader` implementation.\n      // However, given that the PDF data is loaded asynchronously on the\n      // main-thread and then sent via `postMessage` to the worker-thread,\n      // it may not have been available during parsing (hence the attempt to\n      // use range requests here).\n      //\n      // To avoid wasting time and resources here, we'll thus *not* dispatch\n      // range requests if the data was already loaded but has not been sent to\n      // the worker-thread yet (which will happen via the `_fullRequestReader`).\n      if (!rangeReader) {\n        sink.close();\n        return;\n      }\n\n      sink.onPull = () => {\n        rangeReader\n          .read()\n          .then(function ({ value, done }) {\n            if (done) {\n              sink.close();\n              return;\n            }\n            assert(\n              value instanceof ArrayBuffer,\n              \"GetRangeReader - expected an ArrayBuffer.\"\n            );\n            sink.enqueue(new Uint8Array(value), 1, [value]);\n          })\n          .catch(reason => {\n            sink.error(reason);\n          });\n      };\n\n      sink.onCancel = reason => {\n        rangeReader.cancel(reason);\n\n        sink.ready.catch(readyReason => {\n          if (this.destroyed) {\n            return; // Ignore any pending requests if the worker was terminated.\n          }\n          throw readyReason;\n        });\n      };\n    });\n\n    messageHandler.on(\"GetDoc\", ({ pdfInfo }) => {\n      this._numPages = pdfInfo.numPages;\n      this._htmlForXfa = pdfInfo.htmlForXfa;\n      delete pdfInfo.htmlForXfa;\n      loadingTask._capability.resolve(new PDFDocumentProxy(pdfInfo, this));\n    });\n\n    messageHandler.on(\"DocException\", function (ex) {\n      let reason;\n      switch (ex.name) {\n        case \"PasswordException\":\n          reason = new PasswordException(ex.message, ex.code);\n          break;\n        case \"InvalidPDFException\":\n          reason = new InvalidPDFException(ex.message);\n          break;\n        case \"MissingPDFException\":\n          reason = new MissingPDFException(ex.message);\n          break;\n        case \"UnexpectedResponseException\":\n          reason = new UnexpectedResponseException(ex.message, ex.status);\n          break;\n        case \"UnknownErrorException\":\n          reason = new UnknownErrorException(ex.message, ex.details);\n          break;\n        default:\n          unreachable(\"DocException - expected a valid Error.\");\n      }\n      loadingTask._capability.reject(reason);\n    });\n\n    messageHandler.on(\"PasswordRequest\", exception => {\n      this.#passwordCapability = new PromiseCapability();\n\n      if (loadingTask.onPassword) {\n        const updatePassword = password => {\n          if (password instanceof Error) {\n            this.#passwordCapability.reject(password);\n          } else {\n            this.#passwordCapability.resolve({ password });\n          }\n        };\n        try {\n          loadingTask.onPassword(updatePassword, exception.code);\n        } catch (ex) {\n          this.#passwordCapability.reject(ex);\n        }\n      } else {\n        this.#passwordCapability.reject(\n          new PasswordException(exception.message, exception.code)\n        );\n      }\n      return this.#passwordCapability.promise;\n    });\n\n    messageHandler.on(\"DataLoaded\", data => {\n      // For consistency: Ensure that progress is always reported when the\n      // entire PDF file has been loaded, regardless of how it was fetched.\n      loadingTask.onProgress?.({\n        loaded: data.length,\n        total: data.length,\n      });\n\n      this.downloadInfoCapability.resolve(data);\n    });\n\n    messageHandler.on(\"StartRenderPage\", data => {\n      if (this.destroyed) {\n        return; // Ignore any pending requests if the worker was terminated.\n      }\n\n      const page = this.#pageCache.get(data.pageIndex);\n      page._startRenderPage(data.transparency, data.cacheKey);\n    });\n\n    messageHandler.on(\"commonobj\", ([id, type, exportedData]) => {\n      if (this.destroyed) {\n        return; // Ignore any pending requests if the worker was terminated.\n      }\n\n      if (this.commonObjs.has(id)) {\n        return;\n      }\n\n      switch (type) {\n        case \"Font\":\n          const params = this._params;\n\n          if (\"error\" in exportedData) {\n            const exportedError = exportedData.error;\n            warn(`Error during font loading: ${exportedError}`);\n            this.commonObjs.resolve(id, exportedError);\n            break;\n          }\n\n          const inspectFont =\n            params.pdfBug && globalThis.FontInspector?.enabled\n              ? (font, url) => globalThis.FontInspector.fontAdded(font, url)\n              : null;\n          const font = new FontFaceObject(exportedData, {\n            isEvalSupported: params.isEvalSupported,\n            disableFontFace: params.disableFontFace,\n            ignoreErrors: params.ignoreErrors,\n            inspectFont,\n          });\n\n          this.fontLoader\n            .bind(font)\n            .catch(reason => {\n              return messageHandler.sendWithPromise(\"FontFallback\", { id });\n            })\n            .finally(() => {\n              if (!params.fontExtraProperties && font.data) {\n                // Immediately release the `font.data` property once the font\n                // has been attached to the DOM, since it's no longer needed,\n                // rather than waiting for a `PDFDocumentProxy.cleanup` call.\n                // Since `font.data` could be very large, e.g. in some cases\n                // multiple megabytes, this will help reduce memory usage.\n                font.data = null;\n              }\n              this.commonObjs.resolve(id, font);\n            });\n          break;\n        case \"FontPath\":\n        case \"Image\":\n        case \"Pattern\":\n          this.commonObjs.resolve(id, exportedData);\n          break;\n        default:\n          throw new Error(`Got unknown common object type ${type}`);\n      }\n    });\n\n    messageHandler.on(\"obj\", ([id, pageIndex, type, imageData]) => {\n      if (this.destroyed) {\n        // Ignore any pending requests if the worker was terminated.\n        return;\n      }\n\n      const pageProxy = this.#pageCache.get(pageIndex);\n      if (pageProxy.objs.has(id)) {\n        return;\n      }\n      // Don't store data *after* cleanup has successfully run, see bug 1854145.\n      if (pageProxy._intentStates.size === 0) {\n        imageData?.bitmap?.close(); // Release any `ImageBitmap` data.\n        return;\n      }\n\n      switch (type) {\n        case \"Image\":\n          pageProxy.objs.resolve(id, imageData);\n\n          // Heuristic that will allow us not to store large data.\n          if (imageData) {\n            let length;\n            if (imageData.bitmap) {\n              const { width, height } = imageData;\n              length = width * height * 4;\n            } else {\n              length = imageData.data?.length || 0;\n            }\n\n            if (length > MAX_IMAGE_SIZE_TO_CACHE) {\n              pageProxy._maybeCleanupAfterRender = true;\n            }\n          }\n          break;\n        case \"Pattern\":\n          pageProxy.objs.resolve(id, imageData);\n          break;\n        default:\n          throw new Error(`Got unknown object type ${type}`);\n      }\n    });\n\n    messageHandler.on(\"DocProgress\", data => {\n      if (this.destroyed) {\n        return; // Ignore any pending requests if the worker was terminated.\n      }\n      loadingTask.onProgress?.({\n        loaded: data.loaded,\n        total: data.total,\n      });\n    });\n\n    messageHandler.on(\"FetchBuiltInCMap\", data => {\n      if (this.destroyed) {\n        return Promise.reject(new Error(\"Worker was destroyed.\"));\n      }\n      if (!this.cMapReaderFactory) {\n        return Promise.reject(\n          new Error(\n            \"CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.\"\n          )\n        );\n      }\n      return this.cMapReaderFactory.fetch(data);\n    });\n\n    messageHandler.on(\"FetchStandardFontData\", data => {\n      if (this.destroyed) {\n        return Promise.reject(new Error(\"Worker was destroyed.\"));\n      }\n      if (!this.standardFontDataFactory) {\n        return Promise.reject(\n          new Error(\n            \"StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.\"\n          )\n        );\n      }\n      return this.standardFontDataFactory.fetch(data);\n    });\n  }\n\n  getData() {\n    return this.messageHandler.sendWithPromise(\"GetData\", null);\n  }\n\n  saveDocument() {\n    if (this.annotationStorage.size <= 0) {\n      warn(\n        \"saveDocument called while `annotationStorage` is empty, \" +\n          \"please use the getData-method instead.\"\n      );\n    }\n    const { map, transfer } = this.annotationStorage.serializable;\n\n    return this.messageHandler\n      .sendWithPromise(\n        \"SaveDocument\",\n        {\n          isPureXfa: !!this._htmlForXfa,\n          numPages: this._numPages,\n          annotationStorage: map,\n          filename: this._fullReader?.filename ?? null,\n        },\n        transfer\n      )\n      .finally(() => {\n        this.annotationStorage.resetModified();\n      });\n  }\n\n  getPage(pageNumber) {\n    if (\n      !Number.isInteger(pageNumber) ||\n      pageNumber <= 0 ||\n      pageNumber > this._numPages\n    ) {\n      return Promise.reject(new Error(\"Invalid page request.\"));\n    }\n\n    const pageIndex = pageNumber - 1,\n      cachedPromise = this.#pagePromises.get(pageIndex);\n    if (cachedPromise) {\n      return cachedPromise;\n    }\n    const promise = this.messageHandler\n      .sendWithPromise(\"GetPage\", {\n        pageIndex,\n      })\n      .then(pageInfo => {\n        if (this.destroyed) {\n          throw new Error(\"Transport destroyed\");\n        }\n        const page = new PDFPageProxy(\n          pageIndex,\n          pageInfo,\n          this,\n          this._params.pdfBug\n        );\n        this.#pageCache.set(pageIndex, page);\n        return page;\n      });\n    this.#pagePromises.set(pageIndex, promise);\n    return promise;\n  }\n\n  getPageIndex(ref) {\n    if (\n      typeof ref !== \"object\" ||\n      ref === null ||\n      !Number.isInteger(ref.num) ||\n      ref.num < 0 ||\n      !Number.isInteger(ref.gen) ||\n      ref.gen < 0\n    ) {\n      return Promise.reject(new Error(\"Invalid pageIndex request.\"));\n    }\n    return this.messageHandler.sendWithPromise(\"GetPageIndex\", {\n      num: ref.num,\n      gen: ref.gen,\n    });\n  }\n\n  getAnnotations(pageIndex, intent) {\n    return this.messageHandler.sendWithPromise(\"GetAnnotations\", {\n      pageIndex,\n      intent,\n    });\n  }\n\n  getFieldObjects() {\n    return this.#cacheSimpleMethod(\"GetFieldObjects\");\n  }\n\n  hasJSActions() {\n    return this.#cacheSimpleMethod(\"HasJSActions\");\n  }\n\n  getCalculationOrderIds() {\n    return this.messageHandler.sendWithPromise(\"GetCalculationOrderIds\", null);\n  }\n\n  getDestinations() {\n    return this.messageHandler.sendWithPromise(\"GetDestinations\", null);\n  }\n\n  getDestination(id) {\n    if (typeof id !== \"string\") {\n      return Promise.reject(new Error(\"Invalid destination request.\"));\n    }\n    return this.messageHandler.sendWithPromise(\"GetDestination\", {\n      id,\n    });\n  }\n\n  getPageLabels() {\n    return this.messageHandler.sendWithPromise(\"GetPageLabels\", null);\n  }\n\n  getPageLayout() {\n    return this.messageHandler.sendWithPromise(\"GetPageLayout\", null);\n  }\n\n  getPageMode() {\n    return this.messageHandler.sendWithPromise(\"GetPageMode\", null);\n  }\n\n  getViewerPreferences() {\n    return this.messageHandler.sendWithPromise(\"GetViewerPreferences\", null);\n  }\n\n  getOpenAction() {\n    return this.messageHandler.sendWithPromise(\"GetOpenAction\", null);\n  }\n\n  getAttachments() {\n    return this.messageHandler.sendWithPromise(\"GetAttachments\", null);\n  }\n\n  getDocJSActions() {\n    return this.#cacheSimpleMethod(\"GetDocJSActions\");\n  }\n\n  getPageJSActions(pageIndex) {\n    return this.messageHandler.sendWithPromise(\"GetPageJSActions\", {\n      pageIndex,\n    });\n  }\n\n  getStructTree(pageIndex) {\n    return this.messageHandler.sendWithPromise(\"GetStructTree\", {\n      pageIndex,\n    });\n  }\n\n  getOutline() {\n    return this.messageHandler.sendWithPromise(\"GetOutline\", null);\n  }\n\n  getOptionalContentConfig() {\n    return this.messageHandler\n      .sendWithPromise(\"GetOptionalContentConfig\", null)\n      .then(results => {\n        return new OptionalContentConfig(results);\n      });\n  }\n\n  getPermissions() {\n    return this.messageHandler.sendWithPromise(\"GetPermissions\", null);\n  }\n\n  getMetadata() {\n    const name = \"GetMetadata\",\n      cachedPromise = this.#methodPromises.get(name);\n    if (cachedPromise) {\n      return cachedPromise;\n    }\n    const promise = this.messageHandler\n      .sendWithPromise(name, null)\n      .then(results => {\n        return {\n          info: results[0],\n          metadata: results[1] ? new Metadata(results[1]) : null,\n          contentDispositionFilename: this._fullReader?.filename ?? null,\n          contentLength: this._fullReader?.contentLength ?? null,\n        };\n      });\n    this.#methodPromises.set(name, promise);\n    return promise;\n  }\n\n  getMarkInfo() {\n    return this.messageHandler.sendWithPromise(\"GetMarkInfo\", null);\n  }\n\n  async startCleanup(keepLoadedFonts = false) {\n    if (this.destroyed) {\n      return; // No need to manually clean-up when destruction has started.\n    }\n    await this.messageHandler.sendWithPromise(\"Cleanup\", null);\n\n    for (const page of this.#pageCache.values()) {\n      const cleanupSuccessful = page.cleanup();\n\n      if (!cleanupSuccessful) {\n        throw new Error(\n          `startCleanup: Page ${page.pageNumber} is currently rendering.`\n        );\n      }\n    }\n    this.commonObjs.clear();\n    if (!keepLoadedFonts) {\n      this.fontLoader.clear();\n    }\n    this.#methodPromises.clear();\n    this.filterFactory.destroy(/* keepHCM = */ true);\n  }\n\n  get loadingParams() {\n    const { disableAutoFetch, enableXfa } = this._params;\n    return shadow(this, \"loadingParams\", {\n      disableAutoFetch,\n      enableXfa,\n    });\n  }\n}\n\n/**\n * A PDF document and page is built of many objects. E.g. there are objects for\n * fonts, images, rendering code, etc. These objects may get processed inside of\n * a worker. This class implements some basic methods to manage these objects.\n */\nclass PDFObjects {\n  #objs = Object.create(null);\n\n  /**\n   * Ensures there is an object defined for `objId`.\n   *\n   * @param {string} objId\n   * @returns {Object}\n   */\n  #ensureObj(objId) {\n    return (this.#objs[objId] ||= {\n      capability: new PromiseCapability(),\n      data: null,\n    });\n  }\n\n  /**\n   * If called *without* callback, this returns the data of `objId` but the\n   * object needs to be resolved. If it isn't, this method throws.\n   *\n   * If called *with* a callback, the callback is called with the data of the\n   * object once the object is resolved. That means, if you call this method\n   * and the object is already resolved, the callback gets called right away.\n   *\n   * @param {string} objId\n   * @param {function} [callback]\n   * @returns {any}\n   */\n  get(objId, callback = null) {\n    // If there is a callback, then the get can be async and the object is\n    // not required to be resolved right now.\n    if (callback) {\n      const obj = this.#ensureObj(objId);\n      obj.capability.promise.then(() => callback(obj.data));\n      return null;\n    }\n    // If there isn't a callback, the user expects to get the resolved data\n    // directly.\n    const obj = this.#objs[objId];\n    // If there isn't an object yet or the object isn't resolved, then the\n    // data isn't ready yet!\n    if (!obj?.capability.settled) {\n      throw new Error(`Requesting object that isn't resolved yet ${objId}.`);\n    }\n    return obj.data;\n  }\n\n  /**\n   * @param {string} objId\n   * @returns {boolean}\n   */\n  has(objId) {\n    const obj = this.#objs[objId];\n    return obj?.capability.settled || false;\n  }\n\n  /**\n   * Resolves the object `objId` with optional `data`.\n   *\n   * @param {string} objId\n   * @param {any} [data]\n   */\n  resolve(objId, data = null) {\n    const obj = this.#ensureObj(objId);\n    obj.data = data;\n    obj.capability.resolve();\n  }\n\n  clear() {\n    for (const objId in this.#objs) {\n      const { data } = this.#objs[objId];\n      data?.bitmap?.close(); // Release any `ImageBitmap` data.\n    }\n    this.#objs = Object.create(null);\n  }\n}\n\n/**\n * Allows controlling of the rendering tasks.\n */\nclass RenderTask {\n  #internalRenderTask = null;\n\n  constructor(internalRenderTask) {\n    this.#internalRenderTask = internalRenderTask;\n\n    /**\n     * Callback for incremental rendering -- a function that will be called\n     * each time the rendering is paused.  To continue rendering call the\n     * function that is the first argument to the callback.\n     * @type {function}\n     */\n    this.onContinue = null;\n  }\n\n  /**\n   * Promise for rendering task completion.\n   * @type {Promise<void>}\n   */\n  get promise() {\n    return this.#internalRenderTask.capability.promise;\n  }\n\n  /**\n   * Cancels the rendering task. If the task is currently rendering it will\n   * not be cancelled until graphics pauses with a timeout. The promise that\n   * this object extends will be rejected when cancelled.\n   *\n   * @param {number} [extraDelay]\n   */\n  cancel(extraDelay = 0) {\n    this.#internalRenderTask.cancel(/* error = */ null, extraDelay);\n  }\n\n  /**\n   * Whether form fields are rendered separately from the main operatorList.\n   * @type {boolean}\n   */\n  get separateAnnots() {\n    const { separateAnnots } = this.#internalRenderTask.operatorList;\n    if (!separateAnnots) {\n      return false;\n    }\n    const { annotationCanvasMap } = this.#internalRenderTask;\n    return (\n      separateAnnots.form ||\n      (separateAnnots.canvas && annotationCanvasMap?.size > 0)\n    );\n  }\n}\n\n/**\n * For internal use only.\n * @ignore\n */\nclass InternalRenderTask {\n  static #canvasInUse = new WeakSet();\n\n  constructor({\n    callback,\n    params,\n    objs,\n    commonObjs,\n    annotationCanvasMap,\n    operatorList,\n    pageIndex,\n    canvasFactory,\n    filterFactory,\n    useRequestAnimationFrame = false,\n    pdfBug = false,\n    pageColors = null,\n  }) {\n    this.callback = callback;\n    this.params = params;\n    this.objs = objs;\n    this.commonObjs = commonObjs;\n    this.annotationCanvasMap = annotationCanvasMap;\n    this.operatorListIdx = null;\n    this.operatorList = operatorList;\n    this._pageIndex = pageIndex;\n    this.canvasFactory = canvasFactory;\n    this.filterFactory = filterFactory;\n    this._pdfBug = pdfBug;\n    this.pageColors = pageColors;\n\n    this.running = false;\n    this.graphicsReadyCallback = null;\n    this.graphicsReady = false;\n    this._useRequestAnimationFrame =\n      useRequestAnimationFrame === true && typeof window !== \"undefined\";\n    this.cancelled = false;\n    this.capability = new PromiseCapability();\n    this.task = new RenderTask(this);\n    // caching this-bound methods\n    this._cancelBound = this.cancel.bind(this);\n    this._continueBound = this._continue.bind(this);\n    this._scheduleNextBound = this._scheduleNext.bind(this);\n    this._nextBound = this._next.bind(this);\n    this._canvas = params.canvasContext.canvas;\n  }\n\n  get completed() {\n    return this.capability.promise.catch(function () {\n      // Ignoring errors, since we only want to know when rendering is\n      // no longer pending.\n    });\n  }\n\n  initializeGraphics({ transparency = false, optionalContentConfig }) {\n    if (this.cancelled) {\n      return;\n    }\n    if (this._canvas) {\n      if (InternalRenderTask.#canvasInUse.has(this._canvas)) {\n        throw new Error(\n          \"Cannot use the same canvas during multiple render() operations. \" +\n            \"Use different canvas or ensure previous operations were \" +\n            \"cancelled or completed.\"\n        );\n      }\n      InternalRenderTask.#canvasInUse.add(this._canvas);\n    }\n\n    if (this._pdfBug && globalThis.StepperManager?.enabled) {\n      this.stepper = globalThis.StepperManager.create(this._pageIndex);\n      this.stepper.init(this.operatorList);\n      this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint();\n    }\n    const { canvasContext, viewport, transform, background } = this.params;\n\n    this.gfx = new CanvasGraphics(\n      canvasContext,\n      this.commonObjs,\n      this.objs,\n      this.canvasFactory,\n      this.filterFactory,\n      { optionalContentConfig },\n      this.annotationCanvasMap,\n      this.pageColors\n    );\n    this.gfx.beginDrawing({\n      transform,\n      viewport,\n      transparency,\n      background,\n    });\n    this.operatorListIdx = 0;\n    this.graphicsReady = true;\n    this.graphicsReadyCallback?.();\n  }\n\n  cancel(error = null, extraDelay = 0) {\n    this.running = false;\n    this.cancelled = true;\n    this.gfx?.endDrawing();\n    InternalRenderTask.#canvasInUse.delete(this._canvas);\n\n    this.callback(\n      error ||\n        new RenderingCancelledException(\n          `Rendering cancelled, page ${this._pageIndex + 1}`,\n          extraDelay\n        )\n    );\n  }\n\n  operatorListChanged() {\n    if (!this.graphicsReady) {\n      this.graphicsReadyCallback ||= this._continueBound;\n      return;\n    }\n    this.stepper?.updateOperatorList(this.operatorList);\n\n    if (this.running) {\n      return;\n    }\n    this._continue();\n  }\n\n  _continue() {\n    this.running = true;\n    if (this.cancelled) {\n      return;\n    }\n    if (this.task.onContinue) {\n      this.task.onContinue(this._scheduleNextBound);\n    } else {\n      this._scheduleNext();\n    }\n  }\n\n  _scheduleNext() {\n    if (this._useRequestAnimationFrame) {\n      window.requestAnimationFrame(() => {\n        this._nextBound().catch(this._cancelBound);\n      });\n    } else {\n      Promise.resolve().then(this._nextBound).catch(this._cancelBound);\n    }\n  }\n\n  async _next() {\n    if (this.cancelled) {\n      return;\n    }\n    this.operatorListIdx = this.gfx.executeOperatorList(\n      this.operatorList,\n      this.operatorListIdx,\n      this._continueBound,\n      this.stepper\n    );\n    if (this.operatorListIdx === this.operatorList.argsArray.length) {\n      this.running = false;\n      if (this.operatorList.lastChunk) {\n        this.gfx.endDrawing();\n        InternalRenderTask.#canvasInUse.delete(this._canvas);\n\n        this.callback();\n      }\n    }\n  }\n}\n\n/** @type {string} */\nconst version =\n  typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_VERSION\") : null;\n/** @type {string} */\nconst build =\n  typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_BUILD\") : null;\n\nexport {\n  build,\n  DefaultCanvasFactory,\n  DefaultCMapReaderFactory,\n  DefaultFilterFactory,\n  DefaultStandardFontDataFactory,\n  getDocument,\n  LoopbackPort,\n  PDFDataRangeTransport,\n  PDFDocumentLoadingTask,\n  PDFDocumentProxy,\n  PDFPageProxy,\n  PDFWorker,\n  PDFWorkerUtil,\n  RenderTask,\n  version,\n};\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CMapCompressionType, unreachable } from \"../shared/util.js\";\n\nclass BaseFilterFactory {\n  constructor() {\n    if (this.constructor === BaseFilterFactory) {\n      unreachable(\"Cannot initialize BaseFilterFactory.\");\n    }\n  }\n\n  addFilter(maps) {\n    return \"none\";\n  }\n\n  addHCMFilter(fgColor, bgColor) {\n    return \"none\";\n  }\n\n  addHighlightHCMFilter(fgColor, bgColor, newFgColor, newBgColor) {\n    return \"none\";\n  }\n\n  destroy(keepHCM = false) {}\n}\n\nclass BaseCanvasFactory {\n  constructor() {\n    if (this.constructor === BaseCanvasFactory) {\n      unreachable(\"Cannot initialize BaseCanvasFactory.\");\n    }\n  }\n\n  create(width, height) {\n    if (width <= 0 || height <= 0) {\n      throw new Error(\"Invalid canvas size\");\n    }\n    const canvas = this._createCanvas(width, height);\n    return {\n      canvas,\n      context: canvas.getContext(\"2d\"),\n    };\n  }\n\n  reset(canvasAndContext, width, height) {\n    if (!canvasAndContext.canvas) {\n      throw new Error(\"Canvas is not specified\");\n    }\n    if (width <= 0 || height <= 0) {\n      throw new Error(\"Invalid canvas size\");\n    }\n    canvasAndContext.canvas.width = width;\n    canvasAndContext.canvas.height = height;\n  }\n\n  destroy(canvasAndContext) {\n    if (!canvasAndContext.canvas) {\n      throw new Error(\"Canvas is not specified\");\n    }\n    // Zeroing the width and height cause Firefox to release graphics\n    // resources immediately, which can greatly reduce memory consumption.\n    canvasAndContext.canvas.width = 0;\n    canvasAndContext.canvas.height = 0;\n    canvasAndContext.canvas = null;\n    canvasAndContext.context = null;\n  }\n\n  /**\n   * @ignore\n   */\n  _createCanvas(width, height) {\n    unreachable(\"Abstract method `_createCanvas` called.\");\n  }\n}\n\nclass BaseCMapReaderFactory {\n  constructor({ baseUrl = null, isCompressed = true }) {\n    if (this.constructor === BaseCMapReaderFactory) {\n      unreachable(\"Cannot initialize BaseCMapReaderFactory.\");\n    }\n    this.baseUrl = baseUrl;\n    this.isCompressed = isCompressed;\n  }\n\n  async fetch({ name }) {\n    if (!this.baseUrl) {\n      throw new Error(\n        'The CMap \"baseUrl\" parameter must be specified, ensure that ' +\n          'the \"cMapUrl\" and \"cMapPacked\" API parameters are provided.'\n      );\n    }\n    if (!name) {\n      throw new Error(\"CMap name must be specified.\");\n    }\n    const url = this.baseUrl + name + (this.isCompressed ? \".bcmap\" : \"\");\n    const compressionType = this.isCompressed\n      ? CMapCompressionType.BINARY\n      : CMapCompressionType.NONE;\n\n    return this._fetchData(url, compressionType).catch(reason => {\n      throw new Error(\n        `Unable to load ${this.isCompressed ? \"binary \" : \"\"}CMap at: ${url}`\n      );\n    });\n  }\n\n  /**\n   * @ignore\n   */\n  _fetchData(url, compressionType) {\n    unreachable(\"Abstract method `_fetchData` called.\");\n  }\n}\n\nclass BaseStandardFontDataFactory {\n  constructor({ baseUrl = null }) {\n    if (this.constructor === BaseStandardFontDataFactory) {\n      unreachable(\"Cannot initialize BaseStandardFontDataFactory.\");\n    }\n    this.baseUrl = baseUrl;\n  }\n\n  async fetch({ filename }) {\n    if (!this.baseUrl) {\n      throw new Error(\n        'The standard font \"baseUrl\" parameter must be specified, ensure that ' +\n          'the \"standardFontDataUrl\" API parameter is provided.'\n      );\n    }\n    if (!filename) {\n      throw new Error(\"Font filename must be specified.\");\n    }\n    const url = `${this.baseUrl}${filename}`;\n\n    return this._fetchData(url).catch(reason => {\n      throw new Error(`Unable to load font data at: ${url}`);\n    });\n  }\n\n  /**\n   * @ignore\n   */\n  _fetchData(url) {\n    unreachable(\"Abstract method `_fetchData` called.\");\n  }\n}\n\nclass BaseSVGFactory {\n  constructor() {\n    if (this.constructor === BaseSVGFactory) {\n      unreachable(\"Cannot initialize BaseSVGFactory.\");\n    }\n  }\n\n  create(width, height, skipDimensions = false) {\n    if (width <= 0 || height <= 0) {\n      throw new Error(\"Invalid SVG dimensions\");\n    }\n    const svg = this._createSVG(\"svg:svg\");\n    svg.setAttribute(\"version\", \"1.1\");\n\n    if (!skipDimensions) {\n      svg.setAttribute(\"width\", `${width}px`);\n      svg.setAttribute(\"height\", `${height}px`);\n    }\n\n    svg.setAttribute(\"preserveAspectRatio\", \"none\");\n    svg.setAttribute(\"viewBox\", `0 0 ${width} ${height}`);\n\n    return svg;\n  }\n\n  createElement(type) {\n    if (typeof type !== \"string\") {\n      throw new Error(\"Invalid SVG element type\");\n    }\n    return this._createSVG(type);\n  }\n\n  /**\n   * @ignore\n   */\n  _createSVG(type) {\n    unreachable(\"Abstract method `_createSVG` called.\");\n  }\n}\n\nexport {\n  BaseCanvasFactory,\n  BaseCMapReaderFactory,\n  BaseFilterFactory,\n  BaseStandardFontDataFactory,\n  BaseSVGFactory,\n};\n","/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FormatError, info, unreachable, Util } from \"../shared/util.js\";\nimport { getCurrentTransform } from \"./display_utils.js\";\n\nconst PathType = {\n  FILL: \"Fill\",\n  STROKE: \"Stroke\",\n  SHADING: \"Shading\",\n};\n\nfunction applyBoundingBox(ctx, bbox) {\n  if (!bbox) {\n    return;\n  }\n  const width = bbox[2] - bbox[0];\n  const height = bbox[3] - bbox[1];\n  const region = new Path2D();\n  region.rect(bbox[0], bbox[1], width, height);\n  ctx.clip(region);\n}\n\nclass BaseShadingPattern {\n  constructor() {\n    if (this.constructor === BaseShadingPattern) {\n      unreachable(\"Cannot initialize BaseShadingPattern.\");\n    }\n  }\n\n  getPattern() {\n    unreachable(\"Abstract method `getPattern` called.\");\n  }\n}\n\nclass RadialAxialShadingPattern extends BaseShadingPattern {\n  constructor(IR) {\n    super();\n    this._type = IR[1];\n    this._bbox = IR[2];\n    this._colorStops = IR[3];\n    this._p0 = IR[4];\n    this._p1 = IR[5];\n    this._r0 = IR[6];\n    this._r1 = IR[7];\n    this.matrix = null;\n  }\n\n  _createGradient(ctx) {\n    let grad;\n    if (this._type === \"axial\") {\n      grad = ctx.createLinearGradient(\n        this._p0[0],\n        this._p0[1],\n        this._p1[0],\n        this._p1[1]\n      );\n    } else if (this._type === \"radial\") {\n      grad = ctx.createRadialGradient(\n        this._p0[0],\n        this._p0[1],\n        this._r0,\n        this._p1[0],\n        this._p1[1],\n        this._r1\n      );\n    }\n\n    for (const colorStop of this._colorStops) {\n      grad.addColorStop(colorStop[0], colorStop[1]);\n    }\n    return grad;\n  }\n\n  getPattern(ctx, owner, inverse, pathType) {\n    let pattern;\n    if (pathType === PathType.STROKE || pathType === PathType.FILL) {\n      const ownerBBox = owner.current.getClippedPathBoundingBox(\n        pathType,\n        getCurrentTransform(ctx)\n      ) || [0, 0, 0, 0];\n      // Create a canvas that is only as big as the current path. This doesn't\n      // allow us to cache the pattern, but it generally creates much smaller\n      // canvases and saves memory use. See bug 1722807 for an example.\n      const width = Math.ceil(ownerBBox[2] - ownerBBox[0]) || 1;\n      const height = Math.ceil(ownerBBox[3] - ownerBBox[1]) || 1;\n\n      const tmpCanvas = owner.cachedCanvases.getCanvas(\n        \"pattern\",\n        width,\n        height,\n        true\n      );\n\n      const tmpCtx = tmpCanvas.context;\n      tmpCtx.clearRect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n      tmpCtx.beginPath();\n      tmpCtx.rect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n      // Non shading fill patterns are positioned relative to the base transform\n      // (usually the page's initial transform), but we may have created a\n      // smaller canvas based on the path, so we must account for the shift.\n      tmpCtx.translate(-ownerBBox[0], -ownerBBox[1]);\n      inverse = Util.transform(inverse, [\n        1,\n        0,\n        0,\n        1,\n        ownerBBox[0],\n        ownerBBox[1],\n      ]);\n\n      tmpCtx.transform(...owner.baseTransform);\n      if (this.matrix) {\n        tmpCtx.transform(...this.matrix);\n      }\n      applyBoundingBox(tmpCtx, this._bbox);\n\n      tmpCtx.fillStyle = this._createGradient(tmpCtx);\n      tmpCtx.fill();\n\n      pattern = ctx.createPattern(tmpCanvas.canvas, \"no-repeat\");\n      const domMatrix = new DOMMatrix(inverse);\n      pattern.setTransform(domMatrix);\n    } else {\n      // Shading fills are applied relative to the current matrix which is also\n      // how canvas gradients work, so there's no need to do anything special\n      // here.\n      applyBoundingBox(ctx, this._bbox);\n      pattern = this._createGradient(ctx);\n    }\n    return pattern;\n  }\n}\n\nfunction drawTriangle(data, context, p1, p2, p3, c1, c2, c3) {\n  // Very basic Gouraud-shaded triangle rasterization algorithm.\n  const coords = context.coords,\n    colors = context.colors;\n  const bytes = data.data,\n    rowSize = data.width * 4;\n  let tmp;\n  if (coords[p1 + 1] > coords[p2 + 1]) {\n    tmp = p1;\n    p1 = p2;\n    p2 = tmp;\n    tmp = c1;\n    c1 = c2;\n    c2 = tmp;\n  }\n  if (coords[p2 + 1] > coords[p3 + 1]) {\n    tmp = p2;\n    p2 = p3;\n    p3 = tmp;\n    tmp = c2;\n    c2 = c3;\n    c3 = tmp;\n  }\n  if (coords[p1 + 1] > coords[p2 + 1]) {\n    tmp = p1;\n    p1 = p2;\n    p2 = tmp;\n    tmp = c1;\n    c1 = c2;\n    c2 = tmp;\n  }\n  const x1 = (coords[p1] + context.offsetX) * context.scaleX;\n  const y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY;\n  const x2 = (coords[p2] + context.offsetX) * context.scaleX;\n  const y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY;\n  const x3 = (coords[p3] + context.offsetX) * context.scaleX;\n  const y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY;\n  if (y1 >= y3) {\n    return;\n  }\n  const c1r = colors[c1],\n    c1g = colors[c1 + 1],\n    c1b = colors[c1 + 2];\n  const c2r = colors[c2],\n    c2g = colors[c2 + 1],\n    c2b = colors[c2 + 2];\n  const c3r = colors[c3],\n    c3g = colors[c3 + 1],\n    c3b = colors[c3 + 2];\n\n  const minY = Math.round(y1),\n    maxY = Math.round(y3);\n  let xa, car, cag, cab;\n  let xb, cbr, cbg, cbb;\n  for (let y = minY; y <= maxY; y++) {\n    if (y < y2) {\n      const k = y < y1 ? 0 : (y1 - y) / (y1 - y2);\n      xa = x1 - (x1 - x2) * k;\n      car = c1r - (c1r - c2r) * k;\n      cag = c1g - (c1g - c2g) * k;\n      cab = c1b - (c1b - c2b) * k;\n    } else {\n      let k;\n      if (y > y3) {\n        k = 1;\n      } else if (y2 === y3) {\n        k = 0;\n      } else {\n        k = (y2 - y) / (y2 - y3);\n      }\n      xa = x2 - (x2 - x3) * k;\n      car = c2r - (c2r - c3r) * k;\n      cag = c2g - (c2g - c3g) * k;\n      cab = c2b - (c2b - c3b) * k;\n    }\n\n    let k;\n    if (y < y1) {\n      k = 0;\n    } else if (y > y3) {\n      k = 1;\n    } else {\n      k = (y1 - y) / (y1 - y3);\n    }\n    xb = x1 - (x1 - x3) * k;\n    cbr = c1r - (c1r - c3r) * k;\n    cbg = c1g - (c1g - c3g) * k;\n    cbb = c1b - (c1b - c3b) * k;\n    const x1_ = Math.round(Math.min(xa, xb));\n    const x2_ = Math.round(Math.max(xa, xb));\n    let j = rowSize * y + x1_ * 4;\n    for (let x = x1_; x <= x2_; x++) {\n      k = (xa - x) / (xa - xb);\n      if (k < 0) {\n        k = 0;\n      } else if (k > 1) {\n        k = 1;\n      }\n      bytes[j++] = (car - (car - cbr) * k) | 0;\n      bytes[j++] = (cag - (cag - cbg) * k) | 0;\n      bytes[j++] = (cab - (cab - cbb) * k) | 0;\n      bytes[j++] = 255;\n    }\n  }\n}\n\nfunction drawFigure(data, figure, context) {\n  const ps = figure.coords;\n  const cs = figure.colors;\n  let i, ii;\n  switch (figure.type) {\n    case \"lattice\":\n      const verticesPerRow = figure.verticesPerRow;\n      const rows = Math.floor(ps.length / verticesPerRow) - 1;\n      const cols = verticesPerRow - 1;\n      for (i = 0; i < rows; i++) {\n        let q = i * verticesPerRow;\n        for (let j = 0; j < cols; j++, q++) {\n          drawTriangle(\n            data,\n            context,\n            ps[q],\n            ps[q + 1],\n            ps[q + verticesPerRow],\n            cs[q],\n            cs[q + 1],\n            cs[q + verticesPerRow]\n          );\n          drawTriangle(\n            data,\n            context,\n            ps[q + verticesPerRow + 1],\n            ps[q + 1],\n            ps[q + verticesPerRow],\n            cs[q + verticesPerRow + 1],\n            cs[q + 1],\n            cs[q + verticesPerRow]\n          );\n        }\n      }\n      break;\n    case \"triangles\":\n      for (i = 0, ii = ps.length; i < ii; i += 3) {\n        drawTriangle(\n          data,\n          context,\n          ps[i],\n          ps[i + 1],\n          ps[i + 2],\n          cs[i],\n          cs[i + 1],\n          cs[i + 2]\n        );\n      }\n      break;\n    default:\n      throw new Error(\"illegal figure\");\n  }\n}\n\nclass MeshShadingPattern extends BaseShadingPattern {\n  constructor(IR) {\n    super();\n    this._coords = IR[2];\n    this._colors = IR[3];\n    this._figures = IR[4];\n    this._bounds = IR[5];\n    this._bbox = IR[7];\n    this._background = IR[8];\n    this.matrix = null;\n  }\n\n  _createMeshCanvas(combinedScale, backgroundColor, cachedCanvases) {\n    // we will increase scale on some weird factor to let antialiasing take\n    // care of \"rough\" edges\n    const EXPECTED_SCALE = 1.1;\n    // MAX_PATTERN_SIZE is used to avoid OOM situation.\n    const MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough\n    // We need to keep transparent border around our pattern for fill():\n    // createPattern with 'no-repeat' will bleed edges across entire area.\n    const BORDER_SIZE = 2;\n\n    const offsetX = Math.floor(this._bounds[0]);\n    const offsetY = Math.floor(this._bounds[1]);\n    const boundsWidth = Math.ceil(this._bounds[2]) - offsetX;\n    const boundsHeight = Math.ceil(this._bounds[3]) - offsetY;\n\n    const width = Math.min(\n      Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)),\n      MAX_PATTERN_SIZE\n    );\n    const height = Math.min(\n      Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)),\n      MAX_PATTERN_SIZE\n    );\n    const scaleX = boundsWidth / width;\n    const scaleY = boundsHeight / height;\n\n    const context = {\n      coords: this._coords,\n      colors: this._colors,\n      offsetX: -offsetX,\n      offsetY: -offsetY,\n      scaleX: 1 / scaleX,\n      scaleY: 1 / scaleY,\n    };\n\n    const paddedWidth = width + BORDER_SIZE * 2;\n    const paddedHeight = height + BORDER_SIZE * 2;\n\n    const tmpCanvas = cachedCanvases.getCanvas(\n      \"mesh\",\n      paddedWidth,\n      paddedHeight,\n      false\n    );\n    const tmpCtx = tmpCanvas.context;\n\n    const data = tmpCtx.createImageData(width, height);\n    if (backgroundColor) {\n      const bytes = data.data;\n      for (let i = 0, ii = bytes.length; i < ii; i += 4) {\n        bytes[i] = backgroundColor[0];\n        bytes[i + 1] = backgroundColor[1];\n        bytes[i + 2] = backgroundColor[2];\n        bytes[i + 3] = 255;\n      }\n    }\n    for (const figure of this._figures) {\n      drawFigure(data, figure, context);\n    }\n    tmpCtx.putImageData(data, BORDER_SIZE, BORDER_SIZE);\n    const canvas = tmpCanvas.canvas;\n\n    return {\n      canvas,\n      offsetX: offsetX - BORDER_SIZE * scaleX,\n      offsetY: offsetY - BORDER_SIZE * scaleY,\n      scaleX,\n      scaleY,\n    };\n  }\n\n  getPattern(ctx, owner, inverse, pathType) {\n    applyBoundingBox(ctx, this._bbox);\n    let scale;\n    if (pathType === PathType.SHADING) {\n      scale = Util.singularValueDecompose2dScale(getCurrentTransform(ctx));\n    } else {\n      // Obtain scale from matrix and current transformation matrix.\n      scale = Util.singularValueDecompose2dScale(owner.baseTransform);\n      if (this.matrix) {\n        const matrixScale = Util.singularValueDecompose2dScale(this.matrix);\n        scale = [scale[0] * matrixScale[0], scale[1] * matrixScale[1]];\n      }\n    }\n\n    // Rasterizing on the main thread since sending/queue large canvases\n    // might cause OOM.\n    const temporaryPatternCanvas = this._createMeshCanvas(\n      scale,\n      pathType === PathType.SHADING ? null : this._background,\n      owner.cachedCanvases\n    );\n\n    if (pathType !== PathType.SHADING) {\n      ctx.setTransform(...owner.baseTransform);\n      if (this.matrix) {\n        ctx.transform(...this.matrix);\n      }\n    }\n\n    ctx.translate(\n      temporaryPatternCanvas.offsetX,\n      temporaryPatternCanvas.offsetY\n    );\n    ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY);\n\n    return ctx.createPattern(temporaryPatternCanvas.canvas, \"no-repeat\");\n  }\n}\n\nclass DummyShadingPattern extends BaseShadingPattern {\n  getPattern() {\n    return \"hotpink\";\n  }\n}\n\nfunction getShadingPattern(IR) {\n  switch (IR[0]) {\n    case \"RadialAxial\":\n      return new RadialAxialShadingPattern(IR);\n    case \"Mesh\":\n      return new MeshShadingPattern(IR);\n    case \"Dummy\":\n      return new DummyShadingPattern();\n  }\n  throw new Error(`Unknown IR type: ${IR[0]}`);\n}\n\nconst PaintType = {\n  COLORED: 1,\n  UNCOLORED: 2,\n};\n\nclass TilingPattern {\n  // 10in @ 300dpi shall be enough.\n  static MAX_PATTERN_SIZE = 3000;\n\n  constructor(IR, color, ctx, canvasGraphicsFactory, baseTransform) {\n    this.operatorList = IR[2];\n    this.matrix = IR[3] || [1, 0, 0, 1, 0, 0];\n    this.bbox = IR[4];\n    this.xstep = IR[5];\n    this.ystep = IR[6];\n    this.paintType = IR[7];\n    this.tilingType = IR[8];\n    this.color = color;\n    this.ctx = ctx;\n    this.canvasGraphicsFactory = canvasGraphicsFactory;\n    this.baseTransform = baseTransform;\n  }\n\n  createPatternCanvas(owner) {\n    const operatorList = this.operatorList;\n    const bbox = this.bbox;\n    const xstep = this.xstep;\n    const ystep = this.ystep;\n    const paintType = this.paintType;\n    const tilingType = this.tilingType;\n    const color = this.color;\n    const canvasGraphicsFactory = this.canvasGraphicsFactory;\n\n    info(\"TilingType: \" + tilingType);\n\n    // A tiling pattern as defined by PDF spec 8.7.2 is a cell whose size is\n    // described by bbox, and may repeat regularly by shifting the cell by\n    // xstep and ystep.\n    // Because the HTML5 canvas API does not support pattern repetition with\n    // gaps in between, we use the xstep/ystep instead of the bbox's size.\n    //\n    // This has the following consequences (similarly for ystep):\n    //\n    // - If xstep is the same as bbox, then there is no observable difference.\n    //\n    // - If xstep is larger than bbox, then the pattern canvas is partially\n    //   empty: the area bounded by bbox is painted, the outside area is void.\n    //\n    // - If xstep is smaller than bbox, then the pixels between xstep and the\n    //   bbox boundary will be missing. This is INCORRECT behavior.\n    //   \"Figures on adjacent tiles should not overlap\" (PDF spec 8.7.3.1),\n    //   but overlapping cells without common pixels are still valid.\n    //   TODO: Fix the implementation, to allow this scenario to be painted\n    //   correctly.\n\n    const x0 = bbox[0],\n      y0 = bbox[1],\n      x1 = bbox[2],\n      y1 = bbox[3];\n\n    // Obtain scale from matrix and current transformation matrix.\n    const matrixScale = Util.singularValueDecompose2dScale(this.matrix);\n    const curMatrixScale = Util.singularValueDecompose2dScale(\n      this.baseTransform\n    );\n    const combinedScale = [\n      matrixScale[0] * curMatrixScale[0],\n      matrixScale[1] * curMatrixScale[1],\n    ];\n\n    // Use width and height values that are as close as possible to the end\n    // result when the pattern is used. Too low value makes the pattern look\n    // blurry. Too large value makes it look too crispy.\n    const dimx = this.getSizeAndScale(\n      xstep,\n      this.ctx.canvas.width,\n      combinedScale[0]\n    );\n    const dimy = this.getSizeAndScale(\n      ystep,\n      this.ctx.canvas.height,\n      combinedScale[1]\n    );\n\n    const tmpCanvas = owner.cachedCanvases.getCanvas(\n      \"pattern\",\n      dimx.size,\n      dimy.size,\n      true\n    );\n    const tmpCtx = tmpCanvas.context;\n    const graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx);\n    graphics.groupLevel = owner.groupLevel;\n\n    this.setFillAndStrokeStyleToContext(graphics, paintType, color);\n\n    let adjustedX0 = x0;\n    let adjustedY0 = y0;\n    let adjustedX1 = x1;\n    let adjustedY1 = y1;\n    // Some bounding boxes have negative x0/y0 coordinates which will cause the\n    // some of the drawing to be off of the canvas. To avoid this shift the\n    // bounding box over.\n    if (x0 < 0) {\n      adjustedX0 = 0;\n      adjustedX1 += Math.abs(x0);\n    }\n    if (y0 < 0) {\n      adjustedY0 = 0;\n      adjustedY1 += Math.abs(y0);\n    }\n    tmpCtx.translate(-(dimx.scale * adjustedX0), -(dimy.scale * adjustedY0));\n    graphics.transform(dimx.scale, 0, 0, dimy.scale, 0, 0);\n\n    // To match CanvasGraphics beginDrawing we must save the context here or\n    // else we end up with unbalanced save/restores.\n    tmpCtx.save();\n\n    this.clipBbox(graphics, adjustedX0, adjustedY0, adjustedX1, adjustedY1);\n\n    graphics.baseTransform = getCurrentTransform(graphics.ctx);\n\n    graphics.executeOperatorList(operatorList);\n\n    graphics.endDrawing();\n\n    return {\n      canvas: tmpCanvas.canvas,\n      scaleX: dimx.scale,\n      scaleY: dimy.scale,\n      offsetX: adjustedX0,\n      offsetY: adjustedY0,\n    };\n  }\n\n  getSizeAndScale(step, realOutputSize, scale) {\n    // xstep / ystep may be negative -- normalize.\n    step = Math.abs(step);\n    // MAX_PATTERN_SIZE is used to avoid OOM situation.\n    // Use the destination canvas's size if it is bigger than the hard-coded\n    // limit of MAX_PATTERN_SIZE to avoid clipping patterns that cover the\n    // whole canvas.\n    const maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize);\n    let size = Math.ceil(step * scale);\n    if (size >= maxSize) {\n      size = maxSize;\n    } else {\n      scale = size / step;\n    }\n    return { scale, size };\n  }\n\n  clipBbox(graphics, x0, y0, x1, y1) {\n    const bboxWidth = x1 - x0;\n    const bboxHeight = y1 - y0;\n    graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight);\n    graphics.current.updateRectMinMax(getCurrentTransform(graphics.ctx), [\n      x0,\n      y0,\n      x1,\n      y1,\n    ]);\n    graphics.clip();\n    graphics.endPath();\n  }\n\n  setFillAndStrokeStyleToContext(graphics, paintType, color) {\n    const context = graphics.ctx,\n      current = graphics.current;\n    switch (paintType) {\n      case PaintType.COLORED:\n        const ctx = this.ctx;\n        context.fillStyle = ctx.fillStyle;\n        context.strokeStyle = ctx.strokeStyle;\n        current.fillColor = ctx.fillStyle;\n        current.strokeColor = ctx.strokeStyle;\n        break;\n      case PaintType.UNCOLORED:\n        const cssColor = Util.makeHexColor(color[0], color[1], color[2]);\n        context.fillStyle = cssColor;\n        context.strokeStyle = cssColor;\n        // Set color needed by image masks (fixes issues 3226 and 8741).\n        current.fillColor = cssColor;\n        current.strokeColor = cssColor;\n        break;\n      default:\n        throw new FormatError(`Unsupported paint type: ${paintType}`);\n    }\n  }\n\n  getPattern(ctx, owner, inverse, pathType) {\n    // PDF spec 8.7.2 NOTE 1: pattern's matrix is relative to initial matrix.\n    let matrix = inverse;\n    if (pathType !== PathType.SHADING) {\n      matrix = Util.transform(matrix, owner.baseTransform);\n      if (this.matrix) {\n        matrix = Util.transform(matrix, this.matrix);\n      }\n    }\n\n    const temporaryPatternCanvas = this.createPatternCanvas(owner);\n\n    let domMatrix = new DOMMatrix(matrix);\n    // Rescale and so that the ctx.createPattern call generates a pattern with\n    // the desired size.\n    domMatrix = domMatrix.translate(\n      temporaryPatternCanvas.offsetX,\n      temporaryPatternCanvas.offsetY\n    );\n    domMatrix = domMatrix.scale(\n      1 / temporaryPatternCanvas.scaleX,\n      1 / temporaryPatternCanvas.scaleY\n    );\n\n    const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, \"repeat\");\n    pattern.setTransform(domMatrix);\n\n    return pattern;\n  }\n}\n\nexport { getShadingPattern, PathType, TilingPattern };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FeatureTest, ImageKind } from \"./util.js\";\n\nfunction convertToRGBA(params) {\n  switch (params.kind) {\n    case ImageKind.GRAYSCALE_1BPP:\n      return convertBlackAndWhiteToRGBA(params);\n    case ImageKind.RGB_24BPP:\n      return convertRGBToRGBA(params);\n  }\n\n  return null;\n}\n\nfunction convertBlackAndWhiteToRGBA({\n  src,\n  srcPos = 0,\n  dest,\n  width,\n  height,\n  nonBlackColor = 0xffffffff,\n  inverseDecode = false,\n}) {\n  const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n  const [zeroMapping, oneMapping] = inverseDecode\n    ? [nonBlackColor, black]\n    : [black, nonBlackColor];\n  const widthInSource = width >> 3;\n  const widthRemainder = width & 7;\n  const srcLength = src.length;\n  dest = new Uint32Array(dest.buffer);\n  let destPos = 0;\n\n  for (let i = 0; i < height; i++) {\n    for (const max = srcPos + widthInSource; srcPos < max; srcPos++) {\n      const elem = srcPos < srcLength ? src[srcPos] : 255;\n      dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping;\n      dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping;\n      dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping;\n      dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping;\n      dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping;\n      dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping;\n      dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping;\n      dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping;\n    }\n    if (widthRemainder === 0) {\n      continue;\n    }\n    const elem = srcPos < srcLength ? src[srcPos++] : 255;\n    for (let j = 0; j < widthRemainder; j++) {\n      dest[destPos++] = elem & (1 << (7 - j)) ? oneMapping : zeroMapping;\n    }\n  }\n  return { srcPos, destPos };\n}\n\nfunction convertRGBToRGBA({\n  src,\n  srcPos = 0,\n  dest,\n  destPos = 0,\n  width,\n  height,\n}) {\n  let i = 0;\n  const len32 = src.length >> 2;\n  const src32 = new Uint32Array(src.buffer, srcPos, len32);\n\n  if (FeatureTest.isLittleEndian) {\n    // It's a way faster to do the shuffle manually instead of working\n    // component by component with some Uint8 arrays.\n    for (; i < len32 - 2; i += 3, destPos += 4) {\n      const s1 = src32[i]; // R2B1G1R1\n      const s2 = src32[i + 1]; // G3R3B2G2\n      const s3 = src32[i + 2]; // B4G4R4B3\n\n      dest[destPos] = s1 | 0xff000000;\n      dest[destPos + 1] = (s1 >>> 24) | (s2 << 8) | 0xff000000;\n      dest[destPos + 2] = (s2 >>> 16) | (s3 << 16) | 0xff000000;\n      dest[destPos + 3] = (s3 >>> 8) | 0xff000000;\n    }\n\n    for (let j = i * 4, jj = src.length; j < jj; j += 3) {\n      dest[destPos++] =\n        src[j] | (src[j + 1] << 8) | (src[j + 2] << 16) | 0xff000000;\n    }\n  } else {\n    for (; i < len32 - 2; i += 3, destPos += 4) {\n      const s1 = src32[i]; // R1G1B1R2\n      const s2 = src32[i + 1]; // G2B2R3G3\n      const s3 = src32[i + 2]; // B3R4G4B4\n\n      dest[destPos] = s1 | 0xff;\n      dest[destPos + 1] = (s1 << 24) | (s2 >>> 8) | 0xff;\n      dest[destPos + 2] = (s2 << 16) | (s3 >>> 16) | 0xff;\n      dest[destPos + 3] = (s3 << 8) | 0xff;\n    }\n\n    for (let j = i * 4, jj = src.length; j < jj; j += 3) {\n      dest[destPos++] =\n        (src[j] << 24) | (src[j + 1] << 16) | (src[j + 2] << 8) | 0xff;\n    }\n  }\n\n  return { srcPos, destPos };\n}\n\nfunction grayToRGBA(src, dest) {\n  if (FeatureTest.isLittleEndian) {\n    for (let i = 0, ii = src.length; i < ii; i++) {\n      dest[i] = (src[i] * 0x10101) | 0xff000000;\n    }\n  } else {\n    for (let i = 0, ii = src.length; i < ii; i++) {\n      dest[i] = (src[i] * 0x1010100) | 0x000000ff;\n    }\n  }\n}\n\nexport { convertBlackAndWhiteToRGBA, convertToRGBA, grayToRGBA };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  FeatureTest,\n  FONT_IDENTITY_MATRIX,\n  IDENTITY_MATRIX,\n  ImageKind,\n  info,\n  isNodeJS,\n  OPS,\n  shadow,\n  TextRenderingMode,\n  unreachable,\n  Util,\n  warn,\n} from \"../shared/util.js\";\nimport {\n  getCurrentTransform,\n  getCurrentTransformInverse,\n  PixelsPerInch,\n} from \"./display_utils.js\";\nimport {\n  getShadingPattern,\n  PathType,\n  TilingPattern,\n} from \"./pattern_helper.js\";\nimport { convertBlackAndWhiteToRGBA } from \"../shared/image_utils.js\";\n\n// <canvas> contexts store most of the state we need natively.\n// However, PDF needs a bit more state, which we store here.\n// Minimal font size that would be used during canvas fillText operations.\nconst MIN_FONT_SIZE = 16;\n// Maximum font size that would be used during canvas fillText operations.\nconst MAX_FONT_SIZE = 100;\nconst MAX_GROUP_SIZE = 4096;\n\n// Defines the time the `executeOperatorList`-method is going to be executing\n// before it stops and schedules a continue of execution.\nconst EXECUTION_TIME = 15; // ms\n// Defines the number of steps before checking the execution time.\nconst EXECUTION_STEPS = 10;\n\n// To disable Type3 compilation, set the value to `-1`.\nconst MAX_SIZE_TO_COMPILE = 1000;\n\nconst FULL_CHUNK_HEIGHT = 16;\n\n/**\n * Overrides certain methods on a 2d ctx so that when they are called they\n * will also call the same method on the destCtx. The methods that are\n * overridden are all the transformation state modifiers, path creation, and\n * save/restore. We only forward these specific methods because they are the\n * only state modifiers that we cannot copy over when we switch contexts.\n *\n * To remove mirroring call `ctx._removeMirroring()`.\n *\n * @param {Object} ctx - The 2d canvas context that will duplicate its calls on\n *   the destCtx.\n * @param {Object} destCtx - The 2d canvas context that will receive the\n *   forwarded calls.\n */\nfunction mirrorContextOperations(ctx, destCtx) {\n  if (ctx._removeMirroring) {\n    throw new Error(\"Context is already forwarding operations.\");\n  }\n  ctx.__originalSave = ctx.save;\n  ctx.__originalRestore = ctx.restore;\n  ctx.__originalRotate = ctx.rotate;\n  ctx.__originalScale = ctx.scale;\n  ctx.__originalTranslate = ctx.translate;\n  ctx.__originalTransform = ctx.transform;\n  ctx.__originalSetTransform = ctx.setTransform;\n  ctx.__originalResetTransform = ctx.resetTransform;\n  ctx.__originalClip = ctx.clip;\n  ctx.__originalMoveTo = ctx.moveTo;\n  ctx.__originalLineTo = ctx.lineTo;\n  ctx.__originalBezierCurveTo = ctx.bezierCurveTo;\n  ctx.__originalRect = ctx.rect;\n  ctx.__originalClosePath = ctx.closePath;\n  ctx.__originalBeginPath = ctx.beginPath;\n\n  ctx._removeMirroring = () => {\n    ctx.save = ctx.__originalSave;\n    ctx.restore = ctx.__originalRestore;\n    ctx.rotate = ctx.__originalRotate;\n    ctx.scale = ctx.__originalScale;\n    ctx.translate = ctx.__originalTranslate;\n    ctx.transform = ctx.__originalTransform;\n    ctx.setTransform = ctx.__originalSetTransform;\n    ctx.resetTransform = ctx.__originalResetTransform;\n\n    ctx.clip = ctx.__originalClip;\n    ctx.moveTo = ctx.__originalMoveTo;\n    ctx.lineTo = ctx.__originalLineTo;\n    ctx.bezierCurveTo = ctx.__originalBezierCurveTo;\n    ctx.rect = ctx.__originalRect;\n    ctx.closePath = ctx.__originalClosePath;\n    ctx.beginPath = ctx.__originalBeginPath;\n    delete ctx._removeMirroring;\n  };\n\n  ctx.save = function ctxSave() {\n    destCtx.save();\n    this.__originalSave();\n  };\n\n  ctx.restore = function ctxRestore() {\n    destCtx.restore();\n    this.__originalRestore();\n  };\n\n  ctx.translate = function ctxTranslate(x, y) {\n    destCtx.translate(x, y);\n    this.__originalTranslate(x, y);\n  };\n\n  ctx.scale = function ctxScale(x, y) {\n    destCtx.scale(x, y);\n    this.__originalScale(x, y);\n  };\n\n  ctx.transform = function ctxTransform(a, b, c, d, e, f) {\n    destCtx.transform(a, b, c, d, e, f);\n    this.__originalTransform(a, b, c, d, e, f);\n  };\n\n  ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) {\n    destCtx.setTransform(a, b, c, d, e, f);\n    this.__originalSetTransform(a, b, c, d, e, f);\n  };\n\n  ctx.resetTransform = function ctxResetTransform() {\n    destCtx.resetTransform();\n    this.__originalResetTransform();\n  };\n\n  ctx.rotate = function ctxRotate(angle) {\n    destCtx.rotate(angle);\n    this.__originalRotate(angle);\n  };\n\n  ctx.clip = function ctxRotate(rule) {\n    destCtx.clip(rule);\n    this.__originalClip(rule);\n  };\n\n  ctx.moveTo = function (x, y) {\n    destCtx.moveTo(x, y);\n    this.__originalMoveTo(x, y);\n  };\n\n  ctx.lineTo = function (x, y) {\n    destCtx.lineTo(x, y);\n    this.__originalLineTo(x, y);\n  };\n\n  ctx.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) {\n    destCtx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n    this.__originalBezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n  };\n\n  ctx.rect = function (x, y, width, height) {\n    destCtx.rect(x, y, width, height);\n    this.__originalRect(x, y, width, height);\n  };\n\n  ctx.closePath = function () {\n    destCtx.closePath();\n    this.__originalClosePath();\n  };\n\n  ctx.beginPath = function () {\n    destCtx.beginPath();\n    this.__originalBeginPath();\n  };\n}\n\nclass CachedCanvases {\n  constructor(canvasFactory) {\n    this.canvasFactory = canvasFactory;\n    this.cache = Object.create(null);\n  }\n\n  getCanvas(id, width, height) {\n    let canvasEntry;\n    if (this.cache[id] !== undefined) {\n      canvasEntry = this.cache[id];\n      this.canvasFactory.reset(canvasEntry, width, height);\n    } else {\n      canvasEntry = this.canvasFactory.create(width, height);\n      this.cache[id] = canvasEntry;\n    }\n    return canvasEntry;\n  }\n\n  delete(id) {\n    delete this.cache[id];\n  }\n\n  clear() {\n    for (const id in this.cache) {\n      const canvasEntry = this.cache[id];\n      this.canvasFactory.destroy(canvasEntry);\n      delete this.cache[id];\n    }\n  }\n}\n\nfunction drawImageAtIntegerCoords(\n  ctx,\n  srcImg,\n  srcX,\n  srcY,\n  srcW,\n  srcH,\n  destX,\n  destY,\n  destW,\n  destH\n) {\n  const [a, b, c, d, tx, ty] = getCurrentTransform(ctx);\n  if (b === 0 && c === 0) {\n    // top-left corner is at (X, Y) and\n    // bottom-right one is at (X + width, Y + height).\n\n    // If leftX is 4.321 then it's rounded to 4.\n    // If width is 10.432 then it's rounded to 11 because\n    // rightX = leftX + width = 14.753 which is rounded to 15\n    // so after rounding the total width is 11 (15 - 4).\n    // It's why we can't just floor/ceil uniformly, it just depends\n    // on the values we've.\n\n    const tlX = destX * a + tx;\n    const rTlX = Math.round(tlX);\n    const tlY = destY * d + ty;\n    const rTlY = Math.round(tlY);\n    const brX = (destX + destW) * a + tx;\n\n    // Some pdf contains images with 1x1 images so in case of 0-width after\n    // scaling we must fallback on 1 to be sure there is something.\n    const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n    const brY = (destY + destH) * d + ty;\n    const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n\n    // We must apply a transformation in order to apply it on the image itself.\n    // For example if a == 1 && d == -1, it means that the image itself is\n    // mirrored w.r.t. the x-axis.\n    ctx.setTransform(Math.sign(a), 0, 0, Math.sign(d), rTlX, rTlY);\n    ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight);\n    ctx.setTransform(a, b, c, d, tx, ty);\n\n    return [rWidth, rHeight];\n  }\n\n  if (a === 0 && d === 0) {\n    // This path is taken in issue9462.pdf (page 3).\n    const tlX = destY * c + tx;\n    const rTlX = Math.round(tlX);\n    const tlY = destX * b + ty;\n    const rTlY = Math.round(tlY);\n    const brX = (destY + destH) * c + tx;\n    const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n    const brY = (destX + destW) * b + ty;\n    const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n\n    ctx.setTransform(0, Math.sign(b), Math.sign(c), 0, rTlX, rTlY);\n    ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth);\n    ctx.setTransform(a, b, c, d, tx, ty);\n\n    return [rHeight, rWidth];\n  }\n\n  // Not a scale matrix so let the render handle the case without rounding.\n  ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH);\n\n  const scaleX = Math.hypot(a, b);\n  const scaleY = Math.hypot(c, d);\n  return [scaleX * destW, scaleY * destH];\n}\n\nfunction compileType3Glyph(imgData) {\n  const { width, height } = imgData;\n  if (width > MAX_SIZE_TO_COMPILE || height > MAX_SIZE_TO_COMPILE) {\n    return null;\n  }\n\n  const POINT_TO_PROCESS_LIMIT = 1000;\n  const POINT_TYPES = new Uint8Array([\n    0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0,\n  ]);\n\n  const width1 = width + 1;\n  let points = new Uint8Array(width1 * (height + 1));\n  let i, j, j0;\n\n  // decodes bit-packed mask data\n  const lineSize = (width + 7) & ~7;\n  let data = new Uint8Array(lineSize * height),\n    pos = 0;\n  for (const elem of imgData.data) {\n    let mask = 128;\n    while (mask > 0) {\n      data[pos++] = elem & mask ? 0 : 255;\n      mask >>= 1;\n    }\n  }\n\n  // finding interesting points: every point is located between mask pixels,\n  // so there will be points of the (width + 1)x(height + 1) grid. Every point\n  // will have flags assigned based on neighboring mask pixels:\n  //   4 | 8\n  //   --P--\n  //   2 | 1\n  // We are interested only in points with the flags:\n  //   - outside corners: 1, 2, 4, 8;\n  //   - inside corners: 7, 11, 13, 14;\n  //   - and, intersections: 5, 10.\n  let count = 0;\n  pos = 0;\n  if (data[pos] !== 0) {\n    points[0] = 1;\n    ++count;\n  }\n  for (j = 1; j < width; j++) {\n    if (data[pos] !== data[pos + 1]) {\n      points[j] = data[pos] ? 2 : 1;\n      ++count;\n    }\n    pos++;\n  }\n  if (data[pos] !== 0) {\n    points[j] = 2;\n    ++count;\n  }\n  for (i = 1; i < height; i++) {\n    pos = i * lineSize;\n    j0 = i * width1;\n    if (data[pos - lineSize] !== data[pos]) {\n      points[j0] = data[pos] ? 1 : 8;\n      ++count;\n    }\n    // 'sum' is the position of the current pixel configuration in the 'TYPES'\n    // array (in order 8-1-2-4, so we can use '>>2' to shift the column).\n    let sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0);\n    for (j = 1; j < width; j++) {\n      sum =\n        (sum >> 2) +\n        (data[pos + 1] ? 4 : 0) +\n        (data[pos - lineSize + 1] ? 8 : 0);\n      if (POINT_TYPES[sum]) {\n        points[j0 + j] = POINT_TYPES[sum];\n        ++count;\n      }\n      pos++;\n    }\n    if (data[pos - lineSize] !== data[pos]) {\n      points[j0 + j] = data[pos] ? 2 : 4;\n      ++count;\n    }\n\n    if (count > POINT_TO_PROCESS_LIMIT) {\n      return null;\n    }\n  }\n\n  pos = lineSize * (height - 1);\n  j0 = i * width1;\n  if (data[pos] !== 0) {\n    points[j0] = 8;\n    ++count;\n  }\n  for (j = 1; j < width; j++) {\n    if (data[pos] !== data[pos + 1]) {\n      points[j0 + j] = data[pos] ? 4 : 8;\n      ++count;\n    }\n    pos++;\n  }\n  if (data[pos] !== 0) {\n    points[j0 + j] = 4;\n    ++count;\n  }\n  if (count > POINT_TO_PROCESS_LIMIT) {\n    return null;\n  }\n\n  // building outlines\n  const steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]);\n  const path = new Path2D();\n\n  for (i = 0; count && i <= height; i++) {\n    let p = i * width1;\n    const end = p + width;\n    while (p < end && !points[p]) {\n      p++;\n    }\n    if (p === end) {\n      continue;\n    }\n    path.moveTo(p % width1, i);\n\n    const p0 = p;\n    let type = points[p];\n    do {\n      const step = steps[type];\n      do {\n        p += step;\n      } while (!points[p]);\n\n      const pp = points[p];\n      if (pp !== 5 && pp !== 10) {\n        // set new direction\n        type = pp;\n        // delete mark\n        points[p] = 0;\n      } else {\n        // type is 5 or 10, ie, a crossing\n        // set new direction\n        type = pp & ((0x33 * type) >> 4);\n        // set new type for \"future hit\"\n        points[p] &= (type >> 2) | (type << 2);\n      }\n      path.lineTo(p % width1, (p / width1) | 0);\n\n      if (!points[p]) {\n        --count;\n      }\n    } while (p0 !== p);\n    --i;\n  }\n\n  // Immediately release the, potentially large, `Uint8Array`s after parsing.\n  data = null;\n  points = null;\n\n  const drawOutline = function (c) {\n    c.save();\n    // the path shall be painted in [0..1]x[0..1] space\n    c.scale(1 / width, -1 / height);\n    c.translate(0, -height);\n    c.fill(path);\n    c.beginPath();\n    c.restore();\n  };\n\n  return drawOutline;\n}\n\nclass CanvasExtraState {\n  constructor(width, height) {\n    // Are soft masks and alpha values shapes or opacities?\n    this.alphaIsShape = false;\n    this.fontSize = 0;\n    this.fontSizeScale = 1;\n    this.textMatrix = IDENTITY_MATRIX;\n    this.textMatrixScale = 1;\n    this.fontMatrix = FONT_IDENTITY_MATRIX;\n    this.leading = 0;\n    // Current point (in user coordinates)\n    this.x = 0;\n    this.y = 0;\n    // Start of text line (in text coordinates)\n    this.lineX = 0;\n    this.lineY = 0;\n    // Character and word spacing\n    this.charSpacing = 0;\n    this.wordSpacing = 0;\n    this.textHScale = 1;\n    this.textRenderingMode = TextRenderingMode.FILL;\n    this.textRise = 0;\n    // Default fore and background colors\n    this.fillColor = \"#000000\";\n    this.strokeColor = \"#000000\";\n    this.patternFill = false;\n    // Note: fill alpha applies to all non-stroking operations\n    this.fillAlpha = 1;\n    this.strokeAlpha = 1;\n    this.lineWidth = 1;\n    this.activeSMask = null;\n    this.transferMaps = \"none\";\n\n    this.startNewPathAndClipBox([0, 0, width, height]);\n  }\n\n  clone() {\n    const clone = Object.create(this);\n    clone.clipBox = this.clipBox.slice();\n    return clone;\n  }\n\n  setCurrentPoint(x, y) {\n    this.x = x;\n    this.y = y;\n  }\n\n  updatePathMinMax(transform, x, y) {\n    [x, y] = Util.applyTransform([x, y], transform);\n    this.minX = Math.min(this.minX, x);\n    this.minY = Math.min(this.minY, y);\n    this.maxX = Math.max(this.maxX, x);\n    this.maxY = Math.max(this.maxY, y);\n  }\n\n  updateRectMinMax(transform, rect) {\n    const p1 = Util.applyTransform(rect, transform);\n    const p2 = Util.applyTransform(rect.slice(2), transform);\n    const p3 = Util.applyTransform([rect[0], rect[3]], transform);\n    const p4 = Util.applyTransform([rect[2], rect[1]], transform);\n\n    this.minX = Math.min(this.minX, p1[0], p2[0], p3[0], p4[0]);\n    this.minY = Math.min(this.minY, p1[1], p2[1], p3[1], p4[1]);\n    this.maxX = Math.max(this.maxX, p1[0], p2[0], p3[0], p4[0]);\n    this.maxY = Math.max(this.maxY, p1[1], p2[1], p3[1], p4[1]);\n  }\n\n  updateScalingPathMinMax(transform, minMax) {\n    Util.scaleMinMax(transform, minMax);\n    this.minX = Math.min(this.minX, minMax[0]);\n    this.maxX = Math.max(this.maxX, minMax[1]);\n    this.minY = Math.min(this.minY, minMax[2]);\n    this.maxY = Math.max(this.maxY, minMax[3]);\n  }\n\n  updateCurvePathMinMax(transform, x0, y0, x1, y1, x2, y2, x3, y3, minMax) {\n    const box = Util.bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3);\n    if (minMax) {\n      minMax[0] = Math.min(minMax[0], box[0], box[2]);\n      minMax[1] = Math.max(minMax[1], box[0], box[2]);\n      minMax[2] = Math.min(minMax[2], box[1], box[3]);\n      minMax[3] = Math.max(minMax[3], box[1], box[3]);\n      return;\n    }\n    this.updateRectMinMax(transform, box);\n  }\n\n  getPathBoundingBox(pathType = PathType.FILL, transform = null) {\n    const box = [this.minX, this.minY, this.maxX, this.maxY];\n    if (pathType === PathType.STROKE) {\n      if (!transform) {\n        unreachable(\"Stroke bounding box must include transform.\");\n      }\n      // Stroked paths can be outside of the path bounding box by 1/2 the line\n      // width.\n      const scale = Util.singularValueDecompose2dScale(transform);\n      const xStrokePad = (scale[0] * this.lineWidth) / 2;\n      const yStrokePad = (scale[1] * this.lineWidth) / 2;\n      box[0] -= xStrokePad;\n      box[1] -= yStrokePad;\n      box[2] += xStrokePad;\n      box[3] += yStrokePad;\n    }\n    return box;\n  }\n\n  updateClipFromPath() {\n    const intersect = Util.intersect(this.clipBox, this.getPathBoundingBox());\n    this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]);\n  }\n\n  isEmptyClip() {\n    return this.minX === Infinity;\n  }\n\n  startNewPathAndClipBox(box) {\n    this.clipBox = box;\n    this.minX = Infinity;\n    this.minY = Infinity;\n    this.maxX = 0;\n    this.maxY = 0;\n  }\n\n  getClippedPathBoundingBox(pathType = PathType.FILL, transform = null) {\n    return Util.intersect(\n      this.clipBox,\n      this.getPathBoundingBox(pathType, transform)\n    );\n  }\n}\n\nfunction putBinaryImageData(ctx, imgData) {\n  if (typeof ImageData !== \"undefined\" && imgData instanceof ImageData) {\n    ctx.putImageData(imgData, 0, 0);\n    return;\n  }\n\n  // Put the image data to the canvas in chunks, rather than putting the\n  // whole image at once.  This saves JS memory, because the ImageData object\n  // is smaller. It also possibly saves C++ memory within the implementation\n  // of putImageData(). (E.g. in Firefox we make two short-lived copies of\n  // the data passed to putImageData()). |n| shouldn't be too small, however,\n  // because too many putImageData() calls will slow things down.\n  //\n  // Note: as written, if the last chunk is partial, the putImageData() call\n  // will (conceptually) put pixels past the bounds of the canvas.  But\n  // that's ok; any such pixels are ignored.\n\n  const height = imgData.height,\n    width = imgData.width;\n  const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n  const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n  const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n\n  const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n  let srcPos = 0,\n    destPos;\n  const src = imgData.data;\n  const dest = chunkImgData.data;\n  let i, j, thisChunkHeight, elemsInThisChunk;\n\n  // There are multiple forms in which the pixel data can be passed, and\n  // imgData.kind tells us which one this is.\n  if (imgData.kind === ImageKind.GRAYSCALE_1BPP) {\n    // Grayscale, 1 bit per pixel (i.e. black-and-white).\n    const srcLength = src.byteLength;\n    const dest32 = new Uint32Array(dest.buffer, 0, dest.byteLength >> 2);\n    const dest32DataLength = dest32.length;\n    const fullSrcDiff = (width + 7) >> 3;\n    const white = 0xffffffff;\n    const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n\n    for (i = 0; i < totalChunks; i++) {\n      thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n      destPos = 0;\n      for (j = 0; j < thisChunkHeight; j++) {\n        const srcDiff = srcLength - srcPos;\n        let k = 0;\n        const kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7;\n        const kEndUnrolled = kEnd & ~7;\n        let mask = 0;\n        let srcByte = 0;\n        for (; k < kEndUnrolled; k += 8) {\n          srcByte = src[srcPos++];\n          dest32[destPos++] = srcByte & 128 ? white : black;\n          dest32[destPos++] = srcByte & 64 ? white : black;\n          dest32[destPos++] = srcByte & 32 ? white : black;\n          dest32[destPos++] = srcByte & 16 ? white : black;\n          dest32[destPos++] = srcByte & 8 ? white : black;\n          dest32[destPos++] = srcByte & 4 ? white : black;\n          dest32[destPos++] = srcByte & 2 ? white : black;\n          dest32[destPos++] = srcByte & 1 ? white : black;\n        }\n        for (; k < kEnd; k++) {\n          if (mask === 0) {\n            srcByte = src[srcPos++];\n            mask = 128;\n          }\n\n          dest32[destPos++] = srcByte & mask ? white : black;\n          mask >>= 1;\n        }\n      }\n      // We ran out of input. Make all remaining pixels transparent.\n      while (destPos < dest32DataLength) {\n        dest32[destPos++] = 0;\n      }\n\n      ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n    }\n  } else if (imgData.kind === ImageKind.RGBA_32BPP) {\n    // RGBA, 32-bits per pixel.\n    j = 0;\n    elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4;\n    for (i = 0; i < fullChunks; i++) {\n      dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n      srcPos += elemsInThisChunk;\n\n      ctx.putImageData(chunkImgData, 0, j);\n      j += FULL_CHUNK_HEIGHT;\n    }\n    if (i < totalChunks) {\n      elemsInThisChunk = width * partialChunkHeight * 4;\n      dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n\n      ctx.putImageData(chunkImgData, 0, j);\n    }\n  } else if (imgData.kind === ImageKind.RGB_24BPP) {\n    // RGB, 24-bits per pixel.\n    thisChunkHeight = FULL_CHUNK_HEIGHT;\n    elemsInThisChunk = width * thisChunkHeight;\n    for (i = 0; i < totalChunks; i++) {\n      if (i >= fullChunks) {\n        thisChunkHeight = partialChunkHeight;\n        elemsInThisChunk = width * thisChunkHeight;\n      }\n\n      destPos = 0;\n      for (j = elemsInThisChunk; j--; ) {\n        dest[destPos++] = src[srcPos++];\n        dest[destPos++] = src[srcPos++];\n        dest[destPos++] = src[srcPos++];\n        dest[destPos++] = 255;\n      }\n\n      ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n    }\n  } else {\n    throw new Error(`bad image kind: ${imgData.kind}`);\n  }\n}\n\nfunction putBinaryImageMask(ctx, imgData) {\n  if (imgData.bitmap) {\n    // The bitmap has been created in the worker.\n    ctx.drawImage(imgData.bitmap, 0, 0);\n    return;\n  }\n\n  // Slow path: OffscreenCanvas isn't available in the worker.\n  const height = imgData.height,\n    width = imgData.width;\n  const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n  const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n  const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n\n  const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n  let srcPos = 0;\n  const src = imgData.data;\n  const dest = chunkImgData.data;\n\n  for (let i = 0; i < totalChunks; i++) {\n    const thisChunkHeight =\n      i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n\n    // Expand the mask so it can be used by the canvas.  Any required\n    // inversion has already been handled.\n\n    ({ srcPos } = convertBlackAndWhiteToRGBA({\n      src,\n      srcPos,\n      dest,\n      width,\n      height: thisChunkHeight,\n      nonBlackColor: 0,\n    }));\n\n    ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n  }\n}\n\nfunction copyCtxState(sourceCtx, destCtx) {\n  const properties = [\n    \"strokeStyle\",\n    \"fillStyle\",\n    \"fillRule\",\n    \"globalAlpha\",\n    \"lineWidth\",\n    \"lineCap\",\n    \"lineJoin\",\n    \"miterLimit\",\n    \"globalCompositeOperation\",\n    \"font\",\n    \"filter\",\n  ];\n  for (const property of properties) {\n    if (sourceCtx[property] !== undefined) {\n      destCtx[property] = sourceCtx[property];\n    }\n  }\n  if (sourceCtx.setLineDash !== undefined) {\n    destCtx.setLineDash(sourceCtx.getLineDash());\n    destCtx.lineDashOffset = sourceCtx.lineDashOffset;\n  }\n}\n\nfunction resetCtxToDefault(ctx) {\n  ctx.strokeStyle = ctx.fillStyle = \"#000000\";\n  ctx.fillRule = \"nonzero\";\n  ctx.globalAlpha = 1;\n  ctx.lineWidth = 1;\n  ctx.lineCap = \"butt\";\n  ctx.lineJoin = \"miter\";\n  ctx.miterLimit = 10;\n  ctx.globalCompositeOperation = \"source-over\";\n  ctx.font = \"10px sans-serif\";\n  if (ctx.setLineDash !== undefined) {\n    ctx.setLineDash([]);\n    ctx.lineDashOffset = 0;\n  }\n  if (\n    (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n    !isNodeJS\n  ) {\n    const { filter } = ctx;\n    if (filter !== \"none\" && filter !== \"\") {\n      ctx.filter = \"none\";\n    }\n  }\n}\n\nfunction composeSMaskBackdrop(bytes, r0, g0, b0) {\n  const length = bytes.length;\n  for (let i = 3; i < length; i += 4) {\n    const alpha = bytes[i];\n    if (alpha === 0) {\n      bytes[i - 3] = r0;\n      bytes[i - 2] = g0;\n      bytes[i - 1] = b0;\n    } else if (alpha < 255) {\n      const alpha_ = 255 - alpha;\n      bytes[i - 3] = (bytes[i - 3] * alpha + r0 * alpha_) >> 8;\n      bytes[i - 2] = (bytes[i - 2] * alpha + g0 * alpha_) >> 8;\n      bytes[i - 1] = (bytes[i - 1] * alpha + b0 * alpha_) >> 8;\n    }\n  }\n}\n\nfunction composeSMaskAlpha(maskData, layerData, transferMap) {\n  const length = maskData.length;\n  const scale = 1 / 255;\n  for (let i = 3; i < length; i += 4) {\n    const alpha = transferMap ? transferMap[maskData[i]] : maskData[i];\n    layerData[i] = (layerData[i] * alpha * scale) | 0;\n  }\n}\n\nfunction composeSMaskLuminosity(maskData, layerData, transferMap) {\n  const length = maskData.length;\n  for (let i = 3; i < length; i += 4) {\n    const y =\n      maskData[i - 3] * 77 + // * 0.3 / 255 * 0x10000\n      maskData[i - 2] * 152 + // * 0.59 ....\n      maskData[i - 1] * 28; // * 0.11 ....\n    layerData[i] = transferMap\n      ? (layerData[i] * transferMap[y >> 8]) >> 8\n      : (layerData[i] * y) >> 16;\n  }\n}\n\nfunction genericComposeSMask(\n  maskCtx,\n  layerCtx,\n  width,\n  height,\n  subtype,\n  backdrop,\n  transferMap,\n  layerOffsetX,\n  layerOffsetY,\n  maskOffsetX,\n  maskOffsetY\n) {\n  const hasBackdrop = !!backdrop;\n  const r0 = hasBackdrop ? backdrop[0] : 0;\n  const g0 = hasBackdrop ? backdrop[1] : 0;\n  const b0 = hasBackdrop ? backdrop[2] : 0;\n\n  const composeFn =\n    subtype === \"Luminosity\" ? composeSMaskLuminosity : composeSMaskAlpha;\n\n  // processing image in chunks to save memory\n  const PIXELS_TO_PROCESS = 1048576;\n  const chunkSize = Math.min(height, Math.ceil(PIXELS_TO_PROCESS / width));\n  for (let row = 0; row < height; row += chunkSize) {\n    const chunkHeight = Math.min(chunkSize, height - row);\n    const maskData = maskCtx.getImageData(\n      layerOffsetX - maskOffsetX,\n      row + (layerOffsetY - maskOffsetY),\n      width,\n      chunkHeight\n    );\n    const layerData = layerCtx.getImageData(\n      layerOffsetX,\n      row + layerOffsetY,\n      width,\n      chunkHeight\n    );\n\n    if (hasBackdrop) {\n      composeSMaskBackdrop(maskData.data, r0, g0, b0);\n    }\n    composeFn(maskData.data, layerData.data, transferMap);\n\n    layerCtx.putImageData(layerData, layerOffsetX, row + layerOffsetY);\n  }\n}\n\nfunction composeSMask(ctx, smask, layerCtx, layerBox) {\n  const layerOffsetX = layerBox[0];\n  const layerOffsetY = layerBox[1];\n  const layerWidth = layerBox[2] - layerOffsetX;\n  const layerHeight = layerBox[3] - layerOffsetY;\n  if (layerWidth === 0 || layerHeight === 0) {\n    return;\n  }\n  genericComposeSMask(\n    smask.context,\n    layerCtx,\n    layerWidth,\n    layerHeight,\n    smask.subtype,\n    smask.backdrop,\n    smask.transferMap,\n    layerOffsetX,\n    layerOffsetY,\n    smask.offsetX,\n    smask.offsetY\n  );\n  ctx.save();\n  ctx.globalAlpha = 1;\n  ctx.globalCompositeOperation = \"source-over\";\n  ctx.setTransform(1, 0, 0, 1, 0, 0);\n  ctx.drawImage(layerCtx.canvas, 0, 0);\n  ctx.restore();\n}\n\nfunction getImageSmoothingEnabled(transform, interpolate) {\n  const scale = Util.singularValueDecompose2dScale(transform);\n  // Round to a 32bit float so that `<=` check below will pass for numbers that\n  // are very close, but not exactly the same 64bit floats.\n  scale[0] = Math.fround(scale[0]);\n  scale[1] = Math.fround(scale[1]);\n  const actualScale = Math.fround(\n    (globalThis.devicePixelRatio || 1) * PixelsPerInch.PDF_TO_CSS_UNITS\n  );\n  if (interpolate !== undefined) {\n    // If the value is explicitly set use it.\n    return interpolate;\n  } else if (scale[0] <= actualScale || scale[1] <= actualScale) {\n    // Smooth when downscaling.\n    return true;\n  }\n  // Don't smooth when upscaling.\n  return false;\n}\n\nconst LINE_CAP_STYLES = [\"butt\", \"round\", \"square\"];\nconst LINE_JOIN_STYLES = [\"miter\", \"round\", \"bevel\"];\nconst NORMAL_CLIP = {};\nconst EO_CLIP = {};\n\nclass CanvasGraphics {\n  constructor(\n    canvasCtx,\n    commonObjs,\n    objs,\n    canvasFactory,\n    filterFactory,\n    { optionalContentConfig, markedContentStack = null },\n    annotationCanvasMap,\n    pageColors\n  ) {\n    this.ctx = canvasCtx;\n    this.current = new CanvasExtraState(\n      this.ctx.canvas.width,\n      this.ctx.canvas.height\n    );\n    this.stateStack = [];\n    this.pendingClip = null;\n    this.pendingEOFill = false;\n    this.res = null;\n    this.xobjs = null;\n    this.commonObjs = commonObjs;\n    this.objs = objs;\n    this.canvasFactory = canvasFactory;\n    this.filterFactory = filterFactory;\n    this.groupStack = [];\n    this.processingType3 = null;\n    // Patterns are painted relative to the initial page/form transform, see\n    // PDF spec 8.7.2 NOTE 1.\n    this.baseTransform = null;\n    this.baseTransformStack = [];\n    this.groupLevel = 0;\n    this.smaskStack = [];\n    this.smaskCounter = 0;\n    this.tempSMask = null;\n    this.suspendedCtx = null;\n    this.contentVisible = true;\n    this.markedContentStack = markedContentStack || [];\n    this.optionalContentConfig = optionalContentConfig;\n    this.cachedCanvases = new CachedCanvases(this.canvasFactory);\n    this.cachedPatterns = new Map();\n    this.annotationCanvasMap = annotationCanvasMap;\n    this.viewportScale = 1;\n    this.outputScaleX = 1;\n    this.outputScaleY = 1;\n    this.pageColors = pageColors;\n\n    this._cachedScaleForStroking = [-1, 0];\n    this._cachedGetSinglePixelWidth = null;\n    this._cachedBitmapsMap = new Map();\n  }\n\n  getObject(data, fallback = null) {\n    if (typeof data === \"string\") {\n      return data.startsWith(\"g_\")\n        ? this.commonObjs.get(data)\n        : this.objs.get(data);\n    }\n    return fallback;\n  }\n\n  beginDrawing({\n    transform,\n    viewport,\n    transparency = false,\n    background = null,\n  }) {\n    // For pdfs that use blend modes we have to clear the canvas else certain\n    // blend modes can look wrong since we'd be blending with a white\n    // backdrop. The problem with a transparent backdrop though is we then\n    // don't get sub pixel anti aliasing on text, creating temporary\n    // transparent canvas when we have blend modes.\n    const width = this.ctx.canvas.width;\n    const height = this.ctx.canvas.height;\n\n    const savedFillStyle = this.ctx.fillStyle;\n    this.ctx.fillStyle = background || \"#ffffff\";\n    this.ctx.fillRect(0, 0, width, height);\n    this.ctx.fillStyle = savedFillStyle;\n\n    if (transparency) {\n      const transparentCanvas = this.cachedCanvases.getCanvas(\n        \"transparent\",\n        width,\n        height\n      );\n      this.compositeCtx = this.ctx;\n      this.transparentCanvas = transparentCanvas.canvas;\n      this.ctx = transparentCanvas.context;\n      this.ctx.save();\n      // The transform can be applied before rendering, transferring it to\n      // the new canvas.\n      this.ctx.transform(...getCurrentTransform(this.compositeCtx));\n    }\n\n    this.ctx.save();\n    resetCtxToDefault(this.ctx);\n    if (transform) {\n      this.ctx.transform(...transform);\n      this.outputScaleX = transform[0];\n      this.outputScaleY = transform[0];\n    }\n    this.ctx.transform(...viewport.transform);\n    this.viewportScale = viewport.scale;\n\n    this.baseTransform = getCurrentTransform(this.ctx);\n  }\n\n  executeOperatorList(\n    operatorList,\n    executionStartIdx,\n    continueCallback,\n    stepper\n  ) {\n    const argsArray = operatorList.argsArray;\n    const fnArray = operatorList.fnArray;\n    let i = executionStartIdx || 0;\n    const argsArrayLen = argsArray.length;\n\n    // Sometimes the OperatorList to execute is empty.\n    if (argsArrayLen === i) {\n      return i;\n    }\n\n    const chunkOperations =\n      argsArrayLen - i > EXECUTION_STEPS &&\n      typeof continueCallback === \"function\";\n    const endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0;\n    let steps = 0;\n\n    const commonObjs = this.commonObjs;\n    const objs = this.objs;\n    let fnId;\n\n    while (true) {\n      if (stepper !== undefined && i === stepper.nextBreakPoint) {\n        stepper.breakIt(i, continueCallback);\n        return i;\n      }\n\n      fnId = fnArray[i];\n\n      if (fnId !== OPS.dependency) {\n        // eslint-disable-next-line prefer-spread\n        this[fnId].apply(this, argsArray[i]);\n      } else {\n        for (const depObjId of argsArray[i]) {\n          const objsPool = depObjId.startsWith(\"g_\") ? commonObjs : objs;\n\n          // If the promise isn't resolved yet, add the continueCallback\n          // to the promise and bail out.\n          if (!objsPool.has(depObjId)) {\n            objsPool.get(depObjId, continueCallback);\n            return i;\n          }\n        }\n      }\n\n      i++;\n\n      // If the entire operatorList was executed, stop as were done.\n      if (i === argsArrayLen) {\n        return i;\n      }\n\n      // If the execution took longer then a certain amount of time and\n      // `continueCallback` is specified, interrupt the execution.\n      if (chunkOperations && ++steps > EXECUTION_STEPS) {\n        if (Date.now() > endTime) {\n          continueCallback();\n          return i;\n        }\n        steps = 0;\n      }\n\n      // If the operatorList isn't executed completely yet OR the execution\n      // time was short enough, do another execution round.\n    }\n  }\n\n  #restoreInitialState() {\n    // Finishing all opened operations such as SMask group painting.\n    while (this.stateStack.length || this.inSMaskMode) {\n      this.restore();\n    }\n\n    this.ctx.restore();\n\n    if (this.transparentCanvas) {\n      this.ctx = this.compositeCtx;\n      this.ctx.save();\n      this.ctx.setTransform(1, 0, 0, 1, 0, 0); // Avoid apply transform twice\n      this.ctx.drawImage(this.transparentCanvas, 0, 0);\n      this.ctx.restore();\n      this.transparentCanvas = null;\n    }\n  }\n\n  endDrawing() {\n    this.#restoreInitialState();\n\n    this.cachedCanvases.clear();\n    this.cachedPatterns.clear();\n\n    for (const cache of this._cachedBitmapsMap.values()) {\n      for (const canvas of cache.values()) {\n        if (\n          typeof HTMLCanvasElement !== \"undefined\" &&\n          canvas instanceof HTMLCanvasElement\n        ) {\n          canvas.width = canvas.height = 0;\n        }\n      }\n      cache.clear();\n    }\n    this._cachedBitmapsMap.clear();\n    this.#drawFilter();\n  }\n\n  #drawFilter() {\n    if (this.pageColors) {\n      const hcmFilterId = this.filterFactory.addHCMFilter(\n        this.pageColors.foreground,\n        this.pageColors.background\n      );\n      if (hcmFilterId !== \"none\") {\n        const savedFilter = this.ctx.filter;\n        this.ctx.filter = hcmFilterId;\n        this.ctx.drawImage(this.ctx.canvas, 0, 0);\n        this.ctx.filter = savedFilter;\n      }\n    }\n  }\n\n  _scaleImage(img, inverseTransform) {\n    // Vertical or horizontal scaling shall not be more than 2 to not lose the\n    // pixels during drawImage operation, painting on the temporary canvas(es)\n    // that are twice smaller in size.\n    const width = img.width;\n    const height = img.height;\n    let widthScale = Math.max(\n      Math.hypot(inverseTransform[0], inverseTransform[1]),\n      1\n    );\n    let heightScale = Math.max(\n      Math.hypot(inverseTransform[2], inverseTransform[3]),\n      1\n    );\n\n    let paintWidth = width,\n      paintHeight = height;\n    let tmpCanvasId = \"prescale1\";\n    let tmpCanvas, tmpCtx;\n    while (\n      (widthScale > 2 && paintWidth > 1) ||\n      (heightScale > 2 && paintHeight > 1)\n    ) {\n      let newWidth = paintWidth,\n        newHeight = paintHeight;\n      if (widthScale > 2 && paintWidth > 1) {\n        // See bug 1820511 (Windows specific bug).\n        // TODO: once the above bug is fixed we could revert to:\n        // newWidth = Math.ceil(paintWidth / 2);\n        newWidth =\n          paintWidth >= 16384\n            ? Math.floor(paintWidth / 2) - 1 || 1\n            : Math.ceil(paintWidth / 2);\n        widthScale /= paintWidth / newWidth;\n      }\n      if (heightScale > 2 && paintHeight > 1) {\n        // TODO: see the comment above.\n        newHeight =\n          paintHeight >= 16384\n            ? Math.floor(paintHeight / 2) - 1 || 1\n            : Math.ceil(paintHeight) / 2;\n        heightScale /= paintHeight / newHeight;\n      }\n      tmpCanvas = this.cachedCanvases.getCanvas(\n        tmpCanvasId,\n        newWidth,\n        newHeight\n      );\n      tmpCtx = tmpCanvas.context;\n      tmpCtx.clearRect(0, 0, newWidth, newHeight);\n      tmpCtx.drawImage(\n        img,\n        0,\n        0,\n        paintWidth,\n        paintHeight,\n        0,\n        0,\n        newWidth,\n        newHeight\n      );\n      img = tmpCanvas.canvas;\n      paintWidth = newWidth;\n      paintHeight = newHeight;\n      tmpCanvasId = tmpCanvasId === \"prescale1\" ? \"prescale2\" : \"prescale1\";\n    }\n    return {\n      img,\n      paintWidth,\n      paintHeight,\n    };\n  }\n\n  _createMaskCanvas(img) {\n    const ctx = this.ctx;\n    const { width, height } = img;\n    const fillColor = this.current.fillColor;\n    const isPatternFill = this.current.patternFill;\n    const currentTransform = getCurrentTransform(ctx);\n\n    let cache, cacheKey, scaled, maskCanvas;\n    if ((img.bitmap || img.data) && img.count > 1) {\n      const mainKey = img.bitmap || img.data.buffer;\n      // We're reusing the same image several times, so we can cache it.\n      // In case we've a pattern fill we just keep the scaled version of\n      // the image.\n      // Only the scaling part matters, the translation part is just used\n      // to compute offsets (but not when filling patterns see #15573).\n      // TODO: handle the case of a pattern fill if it's possible.\n      cacheKey = JSON.stringify(\n        isPatternFill\n          ? currentTransform\n          : [currentTransform.slice(0, 4), fillColor]\n      );\n\n      cache = this._cachedBitmapsMap.get(mainKey);\n      if (!cache) {\n        cache = new Map();\n        this._cachedBitmapsMap.set(mainKey, cache);\n      }\n      const cachedImage = cache.get(cacheKey);\n      if (cachedImage && !isPatternFill) {\n        const offsetX = Math.round(\n          Math.min(currentTransform[0], currentTransform[2]) +\n            currentTransform[4]\n        );\n        const offsetY = Math.round(\n          Math.min(currentTransform[1], currentTransform[3]) +\n            currentTransform[5]\n        );\n        return {\n          canvas: cachedImage,\n          offsetX,\n          offsetY,\n        };\n      }\n      scaled = cachedImage;\n    }\n\n    if (!scaled) {\n      maskCanvas = this.cachedCanvases.getCanvas(\"maskCanvas\", width, height);\n      putBinaryImageMask(maskCanvas.context, img);\n    }\n\n    // Create the mask canvas at the size it will be drawn at and also set\n    // its transform to match the current transform so if there are any\n    // patterns applied they will be applied relative to the correct\n    // transform.\n\n    let maskToCanvas = Util.transform(currentTransform, [\n      1 / width,\n      0,\n      0,\n      -1 / height,\n      0,\n      0,\n    ]);\n    maskToCanvas = Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]);\n    const [minX, minY, maxX, maxY] = Util.getAxialAlignedBoundingBox(\n      [0, 0, width, height],\n      maskToCanvas\n    );\n    const drawnWidth = Math.round(maxX - minX) || 1;\n    const drawnHeight = Math.round(maxY - minY) || 1;\n    const fillCanvas = this.cachedCanvases.getCanvas(\n      \"fillCanvas\",\n      drawnWidth,\n      drawnHeight\n    );\n    const fillCtx = fillCanvas.context;\n\n    // The offset will be the top-left cordinate mask.\n    // If objToCanvas is [a,b,c,d,e,f] then:\n    //   - offsetX = min(a, c) + e\n    //   - offsetY = min(b, d) + f\n    const offsetX = minX;\n    const offsetY = minY;\n    fillCtx.translate(-offsetX, -offsetY);\n    fillCtx.transform(...maskToCanvas);\n\n    if (!scaled) {\n      // Pre-scale if needed to improve image smoothing.\n      scaled = this._scaleImage(\n        maskCanvas.canvas,\n        getCurrentTransformInverse(fillCtx)\n      );\n      scaled = scaled.img;\n      if (cache && isPatternFill) {\n        cache.set(cacheKey, scaled);\n      }\n    }\n\n    fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(\n      getCurrentTransform(fillCtx),\n      img.interpolate\n    );\n\n    drawImageAtIntegerCoords(\n      fillCtx,\n      scaled,\n      0,\n      0,\n      scaled.width,\n      scaled.height,\n      0,\n      0,\n      width,\n      height\n    );\n    fillCtx.globalCompositeOperation = \"source-in\";\n\n    const inverse = Util.transform(getCurrentTransformInverse(fillCtx), [\n      1,\n      0,\n      0,\n      1,\n      -offsetX,\n      -offsetY,\n    ]);\n    fillCtx.fillStyle = isPatternFill\n      ? fillColor.getPattern(ctx, this, inverse, PathType.FILL)\n      : fillColor;\n\n    fillCtx.fillRect(0, 0, width, height);\n\n    if (cache && !isPatternFill) {\n      // The fill canvas is put in the cache associated to the mask image\n      // so we must remove from the cached canvas: it mustn't be used again.\n      this.cachedCanvases.delete(\"fillCanvas\");\n      cache.set(cacheKey, fillCanvas.canvas);\n    }\n\n    // Round the offsets to avoid drawing fractional pixels.\n    return {\n      canvas: fillCanvas.canvas,\n      offsetX: Math.round(offsetX),\n      offsetY: Math.round(offsetY),\n    };\n  }\n\n  // Graphics state\n  setLineWidth(width) {\n    if (width !== this.current.lineWidth) {\n      this._cachedScaleForStroking[0] = -1;\n    }\n    this.current.lineWidth = width;\n    this.ctx.lineWidth = width;\n  }\n\n  setLineCap(style) {\n    this.ctx.lineCap = LINE_CAP_STYLES[style];\n  }\n\n  setLineJoin(style) {\n    this.ctx.lineJoin = LINE_JOIN_STYLES[style];\n  }\n\n  setMiterLimit(limit) {\n    this.ctx.miterLimit = limit;\n  }\n\n  setDash(dashArray, dashPhase) {\n    const ctx = this.ctx;\n    if (ctx.setLineDash !== undefined) {\n      ctx.setLineDash(dashArray);\n      ctx.lineDashOffset = dashPhase;\n    }\n  }\n\n  setRenderingIntent(intent) {\n    // This operation is ignored since we haven't found a use case for it yet.\n  }\n\n  setFlatness(flatness) {\n    // This operation is ignored since we haven't found a use case for it yet.\n  }\n\n  setGState(states) {\n    for (const [key, value] of states) {\n      switch (key) {\n        case \"LW\":\n          this.setLineWidth(value);\n          break;\n        case \"LC\":\n          this.setLineCap(value);\n          break;\n        case \"LJ\":\n          this.setLineJoin(value);\n          break;\n        case \"ML\":\n          this.setMiterLimit(value);\n          break;\n        case \"D\":\n          this.setDash(value[0], value[1]);\n          break;\n        case \"RI\":\n          this.setRenderingIntent(value);\n          break;\n        case \"FL\":\n          this.setFlatness(value);\n          break;\n        case \"Font\":\n          this.setFont(value[0], value[1]);\n          break;\n        case \"CA\":\n          this.current.strokeAlpha = value;\n          break;\n        case \"ca\":\n          this.current.fillAlpha = value;\n          this.ctx.globalAlpha = value;\n          break;\n        case \"BM\":\n          this.ctx.globalCompositeOperation = value;\n          break;\n        case \"SMask\":\n          this.current.activeSMask = value ? this.tempSMask : null;\n          this.tempSMask = null;\n          this.checkSMaskState();\n          break;\n        case \"TR\":\n          this.ctx.filter = this.current.transferMaps =\n            this.filterFactory.addFilter(value);\n          break;\n      }\n    }\n  }\n\n  get inSMaskMode() {\n    return !!this.suspendedCtx;\n  }\n\n  checkSMaskState() {\n    const inSMaskMode = this.inSMaskMode;\n    if (this.current.activeSMask && !inSMaskMode) {\n      this.beginSMaskMode();\n    } else if (!this.current.activeSMask && inSMaskMode) {\n      this.endSMaskMode();\n    }\n    // Else, the state is okay and nothing needs to be done.\n  }\n\n  /**\n   * Soft mask mode takes the current main drawing canvas and replaces it with\n   * a temporary canvas. Any drawing operations that happen on the temporary\n   * canvas need to be composed with the main canvas that was suspended (see\n   * `compose()`). The temporary canvas also duplicates many of its operations\n   * on the suspended canvas to keep them in sync, so that when the soft mask\n   * mode ends any clipping paths or transformations will still be active and in\n   * the right order on the canvas' graphics state stack.\n   */\n  beginSMaskMode() {\n    if (this.inSMaskMode) {\n      throw new Error(\"beginSMaskMode called while already in smask mode\");\n    }\n    const drawnWidth = this.ctx.canvas.width;\n    const drawnHeight = this.ctx.canvas.height;\n    const cacheId = \"smaskGroupAt\" + this.groupLevel;\n    const scratchCanvas = this.cachedCanvases.getCanvas(\n      cacheId,\n      drawnWidth,\n      drawnHeight\n    );\n    this.suspendedCtx = this.ctx;\n    this.ctx = scratchCanvas.context;\n    const ctx = this.ctx;\n    ctx.setTransform(...getCurrentTransform(this.suspendedCtx));\n    copyCtxState(this.suspendedCtx, ctx);\n    mirrorContextOperations(ctx, this.suspendedCtx);\n\n    this.setGState([\n      [\"BM\", \"source-over\"],\n      [\"ca\", 1],\n      [\"CA\", 1],\n    ]);\n  }\n\n  endSMaskMode() {\n    if (!this.inSMaskMode) {\n      throw new Error(\"endSMaskMode called while not in smask mode\");\n    }\n    // The soft mask is done, now restore the suspended canvas as the main\n    // drawing canvas.\n    this.ctx._removeMirroring();\n    copyCtxState(this.ctx, this.suspendedCtx);\n    this.ctx = this.suspendedCtx;\n\n    this.suspendedCtx = null;\n  }\n\n  compose(dirtyBox) {\n    if (!this.current.activeSMask) {\n      return;\n    }\n\n    if (!dirtyBox) {\n      dirtyBox = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];\n    } else {\n      dirtyBox[0] = Math.floor(dirtyBox[0]);\n      dirtyBox[1] = Math.floor(dirtyBox[1]);\n      dirtyBox[2] = Math.ceil(dirtyBox[2]);\n      dirtyBox[3] = Math.ceil(dirtyBox[3]);\n    }\n    const smask = this.current.activeSMask;\n    const suspendedCtx = this.suspendedCtx;\n\n    composeSMask(suspendedCtx, smask, this.ctx, dirtyBox);\n    // Whatever was drawn has been moved to the suspended canvas, now clear it\n    // out of the current canvas.\n    this.ctx.save();\n    this.ctx.setTransform(1, 0, 0, 1, 0, 0);\n    this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);\n    this.ctx.restore();\n  }\n\n  save() {\n    if (this.inSMaskMode) {\n      // SMask mode may be turned on/off causing us to lose graphics state.\n      // Copy the temporary canvas state to the main(suspended) canvas to keep\n      // it in sync.\n      copyCtxState(this.ctx, this.suspendedCtx);\n      // Don't bother calling save on the temporary canvas since state is not\n      // saved there.\n      this.suspendedCtx.save();\n    } else {\n      this.ctx.save();\n    }\n    const old = this.current;\n    this.stateStack.push(old);\n    this.current = old.clone();\n  }\n\n  restore() {\n    if (this.stateStack.length === 0 && this.inSMaskMode) {\n      this.endSMaskMode();\n    }\n    if (this.stateStack.length !== 0) {\n      this.current = this.stateStack.pop();\n      if (this.inSMaskMode) {\n        // Graphics state is stored on the main(suspended) canvas. Restore its\n        // state then copy it over to the temporary canvas.\n        this.suspendedCtx.restore();\n        copyCtxState(this.suspendedCtx, this.ctx);\n      } else {\n        this.ctx.restore();\n      }\n      this.checkSMaskState();\n\n      // Ensure that the clipping path is reset (fixes issue6413.pdf).\n      this.pendingClip = null;\n\n      this._cachedScaleForStroking[0] = -1;\n      this._cachedGetSinglePixelWidth = null;\n    }\n  }\n\n  transform(a, b, c, d, e, f) {\n    this.ctx.transform(a, b, c, d, e, f);\n\n    this._cachedScaleForStroking[0] = -1;\n    this._cachedGetSinglePixelWidth = null;\n  }\n\n  // Path\n  constructPath(ops, args, minMax) {\n    const ctx = this.ctx;\n    const current = this.current;\n    let x = current.x,\n      y = current.y;\n    let startX, startY;\n    const currentTransform = getCurrentTransform(ctx);\n\n    // Most of the time the current transform is a scaling matrix\n    // so we don't need to transform points before computing min/max:\n    // we can compute min/max first and then smartly \"apply\" the\n    // transform (see Util.scaleMinMax).\n    // For rectangle, moveTo and lineTo, min/max are computed in the\n    // worker (see evaluator.js).\n    const isScalingMatrix =\n      (currentTransform[0] === 0 && currentTransform[3] === 0) ||\n      (currentTransform[1] === 0 && currentTransform[2] === 0);\n    const minMaxForBezier = isScalingMatrix ? minMax.slice(0) : null;\n\n    for (let i = 0, j = 0, ii = ops.length; i < ii; i++) {\n      switch (ops[i] | 0) {\n        case OPS.rectangle:\n          x = args[j++];\n          y = args[j++];\n          const width = args[j++];\n          const height = args[j++];\n\n          const xw = x + width;\n          const yh = y + height;\n          ctx.moveTo(x, y);\n          if (width === 0 || height === 0) {\n            ctx.lineTo(xw, yh);\n          } else {\n            ctx.lineTo(xw, y);\n            ctx.lineTo(xw, yh);\n            ctx.lineTo(x, yh);\n          }\n          if (!isScalingMatrix) {\n            current.updateRectMinMax(currentTransform, [x, y, xw, yh]);\n          }\n          ctx.closePath();\n          break;\n        case OPS.moveTo:\n          x = args[j++];\n          y = args[j++];\n          ctx.moveTo(x, y);\n          if (!isScalingMatrix) {\n            current.updatePathMinMax(currentTransform, x, y);\n          }\n          break;\n        case OPS.lineTo:\n          x = args[j++];\n          y = args[j++];\n          ctx.lineTo(x, y);\n          if (!isScalingMatrix) {\n            current.updatePathMinMax(currentTransform, x, y);\n          }\n          break;\n        case OPS.curveTo:\n          startX = x;\n          startY = y;\n          x = args[j + 4];\n          y = args[j + 5];\n          ctx.bezierCurveTo(\n            args[j],\n            args[j + 1],\n            args[j + 2],\n            args[j + 3],\n            x,\n            y\n          );\n          current.updateCurvePathMinMax(\n            currentTransform,\n            startX,\n            startY,\n            args[j],\n            args[j + 1],\n            args[j + 2],\n            args[j + 3],\n            x,\n            y,\n            minMaxForBezier\n          );\n          j += 6;\n          break;\n        case OPS.curveTo2:\n          startX = x;\n          startY = y;\n          ctx.bezierCurveTo(\n            x,\n            y,\n            args[j],\n            args[j + 1],\n            args[j + 2],\n            args[j + 3]\n          );\n          current.updateCurvePathMinMax(\n            currentTransform,\n            startX,\n            startY,\n            x,\n            y,\n            args[j],\n            args[j + 1],\n            args[j + 2],\n            args[j + 3],\n            minMaxForBezier\n          );\n          x = args[j + 2];\n          y = args[j + 3];\n          j += 4;\n          break;\n        case OPS.curveTo3:\n          startX = x;\n          startY = y;\n          x = args[j + 2];\n          y = args[j + 3];\n          ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y);\n          current.updateCurvePathMinMax(\n            currentTransform,\n            startX,\n            startY,\n            args[j],\n            args[j + 1],\n            x,\n            y,\n            x,\n            y,\n            minMaxForBezier\n          );\n          j += 4;\n          break;\n        case OPS.closePath:\n          ctx.closePath();\n          break;\n      }\n    }\n\n    if (isScalingMatrix) {\n      current.updateScalingPathMinMax(currentTransform, minMaxForBezier);\n    }\n\n    current.setCurrentPoint(x, y);\n  }\n\n  closePath() {\n    this.ctx.closePath();\n  }\n\n  stroke(consumePath = true) {\n    const ctx = this.ctx;\n    const strokeColor = this.current.strokeColor;\n    // For stroke we want to temporarily change the global alpha to the\n    // stroking alpha.\n    ctx.globalAlpha = this.current.strokeAlpha;\n    if (this.contentVisible) {\n      if (typeof strokeColor === \"object\" && strokeColor?.getPattern) {\n        ctx.save();\n        ctx.strokeStyle = strokeColor.getPattern(\n          ctx,\n          this,\n          getCurrentTransformInverse(ctx),\n          PathType.STROKE\n        );\n        this.rescaleAndStroke(/* saveRestore */ false);\n        ctx.restore();\n      } else {\n        this.rescaleAndStroke(/* saveRestore */ true);\n      }\n    }\n    if (consumePath) {\n      this.consumePath(this.current.getClippedPathBoundingBox());\n    }\n    // Restore the global alpha to the fill alpha\n    ctx.globalAlpha = this.current.fillAlpha;\n  }\n\n  closeStroke() {\n    this.closePath();\n    this.stroke();\n  }\n\n  fill(consumePath = true) {\n    const ctx = this.ctx;\n    const fillColor = this.current.fillColor;\n    const isPatternFill = this.current.patternFill;\n    let needRestore = false;\n\n    if (isPatternFill) {\n      ctx.save();\n      ctx.fillStyle = fillColor.getPattern(\n        ctx,\n        this,\n        getCurrentTransformInverse(ctx),\n        PathType.FILL\n      );\n      needRestore = true;\n    }\n\n    const intersect = this.current.getClippedPathBoundingBox();\n    if (this.contentVisible && intersect !== null) {\n      if (this.pendingEOFill) {\n        ctx.fill(\"evenodd\");\n        this.pendingEOFill = false;\n      } else {\n        ctx.fill();\n      }\n    }\n\n    if (needRestore) {\n      ctx.restore();\n    }\n    if (consumePath) {\n      this.consumePath(intersect);\n    }\n  }\n\n  eoFill() {\n    this.pendingEOFill = true;\n    this.fill();\n  }\n\n  fillStroke() {\n    this.fill(false);\n    this.stroke(false);\n\n    this.consumePath();\n  }\n\n  eoFillStroke() {\n    this.pendingEOFill = true;\n    this.fillStroke();\n  }\n\n  closeFillStroke() {\n    this.closePath();\n    this.fillStroke();\n  }\n\n  closeEOFillStroke() {\n    this.pendingEOFill = true;\n    this.closePath();\n    this.fillStroke();\n  }\n\n  endPath() {\n    this.consumePath();\n  }\n\n  // Clipping\n  clip() {\n    this.pendingClip = NORMAL_CLIP;\n  }\n\n  eoClip() {\n    this.pendingClip = EO_CLIP;\n  }\n\n  // Text\n  beginText() {\n    this.current.textMatrix = IDENTITY_MATRIX;\n    this.current.textMatrixScale = 1;\n    this.current.x = this.current.lineX = 0;\n    this.current.y = this.current.lineY = 0;\n  }\n\n  endText() {\n    const paths = this.pendingTextPaths;\n    const ctx = this.ctx;\n    if (paths === undefined) {\n      ctx.beginPath();\n      return;\n    }\n\n    ctx.save();\n    ctx.beginPath();\n    for (const path of paths) {\n      ctx.setTransform(...path.transform);\n      ctx.translate(path.x, path.y);\n      path.addToPath(ctx, path.fontSize);\n    }\n    ctx.restore();\n    ctx.clip();\n    ctx.beginPath();\n    delete this.pendingTextPaths;\n  }\n\n  setCharSpacing(spacing) {\n    this.current.charSpacing = spacing;\n  }\n\n  setWordSpacing(spacing) {\n    this.current.wordSpacing = spacing;\n  }\n\n  setHScale(scale) {\n    this.current.textHScale = scale / 100;\n  }\n\n  setLeading(leading) {\n    this.current.leading = -leading;\n  }\n\n  setFont(fontRefName, size) {\n    const fontObj = this.commonObjs.get(fontRefName);\n    const current = this.current;\n\n    if (!fontObj) {\n      throw new Error(`Can't find font for ${fontRefName}`);\n    }\n    current.fontMatrix = fontObj.fontMatrix || FONT_IDENTITY_MATRIX;\n\n    // A valid matrix needs all main diagonal elements to be non-zero\n    // This also ensures we bypass FF bugzilla bug #719844.\n    if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) {\n      warn(\"Invalid font matrix for font \" + fontRefName);\n    }\n\n    // The spec for Tf (setFont) says that 'size' specifies the font 'scale',\n    // and in some docs this can be negative (inverted x-y axes).\n    if (size < 0) {\n      size = -size;\n      current.fontDirection = -1;\n    } else {\n      current.fontDirection = 1;\n    }\n\n    this.current.font = fontObj;\n    this.current.fontSize = size;\n\n    if (fontObj.isType3Font) {\n      return; // we don't need ctx.font for Type3 fonts\n    }\n\n    const name = fontObj.loadedName || \"sans-serif\";\n    const typeface =\n      fontObj.systemFontInfo?.css || `\"${name}\", ${fontObj.fallbackName}`;\n\n    let bold = \"normal\";\n    if (fontObj.black) {\n      bold = \"900\";\n    } else if (fontObj.bold) {\n      bold = \"bold\";\n    }\n    const italic = fontObj.italic ? \"italic\" : \"normal\";\n\n    // Some font backends cannot handle fonts below certain size.\n    // Keeping the font at minimal size and using the fontSizeScale to change\n    // the current transformation matrix before the fillText/strokeText.\n    // See https://bugzilla.mozilla.org/show_bug.cgi?id=726227\n    let browserFontSize = size;\n    if (size < MIN_FONT_SIZE) {\n      browserFontSize = MIN_FONT_SIZE;\n    } else if (size > MAX_FONT_SIZE) {\n      browserFontSize = MAX_FONT_SIZE;\n    }\n    this.current.fontSizeScale = size / browserFontSize;\n\n    this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`;\n  }\n\n  setTextRenderingMode(mode) {\n    this.current.textRenderingMode = mode;\n  }\n\n  setTextRise(rise) {\n    this.current.textRise = rise;\n  }\n\n  moveText(x, y) {\n    this.current.x = this.current.lineX += x;\n    this.current.y = this.current.lineY += y;\n  }\n\n  setLeadingMoveText(x, y) {\n    this.setLeading(-y);\n    this.moveText(x, y);\n  }\n\n  setTextMatrix(a, b, c, d, e, f) {\n    this.current.textMatrix = [a, b, c, d, e, f];\n    this.current.textMatrixScale = Math.hypot(a, b);\n\n    this.current.x = this.current.lineX = 0;\n    this.current.y = this.current.lineY = 0;\n  }\n\n  nextLine() {\n    this.moveText(0, this.current.leading);\n  }\n\n  paintChar(character, x, y, patternTransform) {\n    const ctx = this.ctx;\n    const current = this.current;\n    const font = current.font;\n    const textRenderingMode = current.textRenderingMode;\n    const fontSize = current.fontSize / current.fontSizeScale;\n    const fillStrokeMode =\n      textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;\n    const isAddToPathSet = !!(\n      textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG\n    );\n    const patternFill = current.patternFill && !font.missingFile;\n\n    let addToPath;\n    if (font.disableFontFace || isAddToPathSet || patternFill) {\n      addToPath = font.getPathGenerator(this.commonObjs, character);\n    }\n\n    if (font.disableFontFace || patternFill) {\n      ctx.save();\n      ctx.translate(x, y);\n      ctx.beginPath();\n      addToPath(ctx, fontSize);\n      if (patternTransform) {\n        ctx.setTransform(...patternTransform);\n      }\n      if (\n        fillStrokeMode === TextRenderingMode.FILL ||\n        fillStrokeMode === TextRenderingMode.FILL_STROKE\n      ) {\n        ctx.fill();\n      }\n      if (\n        fillStrokeMode === TextRenderingMode.STROKE ||\n        fillStrokeMode === TextRenderingMode.FILL_STROKE\n      ) {\n        ctx.stroke();\n      }\n      ctx.restore();\n    } else {\n      if (\n        fillStrokeMode === TextRenderingMode.FILL ||\n        fillStrokeMode === TextRenderingMode.FILL_STROKE\n      ) {\n        ctx.fillText(character, x, y);\n      }\n      if (\n        fillStrokeMode === TextRenderingMode.STROKE ||\n        fillStrokeMode === TextRenderingMode.FILL_STROKE\n      ) {\n        ctx.strokeText(character, x, y);\n      }\n    }\n\n    if (isAddToPathSet) {\n      const paths = (this.pendingTextPaths ||= []);\n      paths.push({\n        transform: getCurrentTransform(ctx),\n        x,\n        y,\n        fontSize,\n        addToPath,\n      });\n    }\n  }\n\n  get isFontSubpixelAAEnabled() {\n    // Checks if anti-aliasing is enabled when scaled text is painted.\n    // On Windows GDI scaled fonts looks bad.\n    const { context: ctx } = this.cachedCanvases.getCanvas(\n      \"isFontSubpixelAAEnabled\",\n      10,\n      10\n    );\n    ctx.scale(1.5, 1);\n    ctx.fillText(\"I\", 0, 10);\n    const data = ctx.getImageData(0, 0, 10, 10).data;\n    let enabled = false;\n    for (let i = 3; i < data.length; i += 4) {\n      if (data[i] > 0 && data[i] < 255) {\n        enabled = true;\n        break;\n      }\n    }\n    return shadow(this, \"isFontSubpixelAAEnabled\", enabled);\n  }\n\n  showText(glyphs) {\n    const current = this.current;\n    const font = current.font;\n    if (font.isType3Font) {\n      return this.showType3Text(glyphs);\n    }\n\n    const fontSize = current.fontSize;\n    if (fontSize === 0) {\n      return undefined;\n    }\n\n    const ctx = this.ctx;\n    const fontSizeScale = current.fontSizeScale;\n    const charSpacing = current.charSpacing;\n    const wordSpacing = current.wordSpacing;\n    const fontDirection = current.fontDirection;\n    const textHScale = current.textHScale * fontDirection;\n    const glyphsLength = glyphs.length;\n    const vertical = font.vertical;\n    const spacingDir = vertical ? 1 : -1;\n    const defaultVMetrics = font.defaultVMetrics;\n    const widthAdvanceScale = fontSize * current.fontMatrix[0];\n\n    const simpleFillText =\n      current.textRenderingMode === TextRenderingMode.FILL &&\n      !font.disableFontFace &&\n      !current.patternFill;\n\n    ctx.save();\n    ctx.transform(...current.textMatrix);\n    ctx.translate(current.x, current.y + current.textRise);\n\n    if (fontDirection > 0) {\n      ctx.scale(textHScale, -1);\n    } else {\n      ctx.scale(textHScale, 1);\n    }\n\n    let patternTransform;\n    if (current.patternFill) {\n      ctx.save();\n      const pattern = current.fillColor.getPattern(\n        ctx,\n        this,\n        getCurrentTransformInverse(ctx),\n        PathType.FILL\n      );\n      patternTransform = getCurrentTransform(ctx);\n      ctx.restore();\n      ctx.fillStyle = pattern;\n    }\n\n    let lineWidth = current.lineWidth;\n    const scale = current.textMatrixScale;\n    if (scale === 0 || lineWidth === 0) {\n      const fillStrokeMode =\n        current.textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;\n      if (\n        fillStrokeMode === TextRenderingMode.STROKE ||\n        fillStrokeMode === TextRenderingMode.FILL_STROKE\n      ) {\n        lineWidth = this.getSinglePixelWidth();\n      }\n    } else {\n      lineWidth /= scale;\n    }\n\n    if (fontSizeScale !== 1.0) {\n      ctx.scale(fontSizeScale, fontSizeScale);\n      lineWidth /= fontSizeScale;\n    }\n\n    ctx.lineWidth = lineWidth;\n\n    if (font.isInvalidPDFjsFont) {\n      const chars = [];\n      let width = 0;\n      for (const glyph of glyphs) {\n        chars.push(glyph.unicode);\n        width += glyph.width;\n      }\n      ctx.fillText(chars.join(\"\"), 0, 0);\n      current.x += width * widthAdvanceScale * textHScale;\n      ctx.restore();\n      this.compose();\n\n      return undefined;\n    }\n\n    let x = 0,\n      i;\n    for (i = 0; i < glyphsLength; ++i) {\n      const glyph = glyphs[i];\n      if (typeof glyph === \"number\") {\n        x += (spacingDir * glyph * fontSize) / 1000;\n        continue;\n      }\n\n      let restoreNeeded = false;\n      const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n      const character = glyph.fontChar;\n      const accent = glyph.accent;\n      let scaledX, scaledY;\n      let width = glyph.width;\n      if (vertical) {\n        const vmetric = glyph.vmetric || defaultVMetrics;\n        const vx =\n          -(glyph.vmetric ? vmetric[1] : width * 0.5) * widthAdvanceScale;\n        const vy = vmetric[2] * widthAdvanceScale;\n\n        width = vmetric ? -vmetric[0] : width;\n        scaledX = vx / fontSizeScale;\n        scaledY = (x + vy) / fontSizeScale;\n      } else {\n        scaledX = x / fontSizeScale;\n        scaledY = 0;\n      }\n\n      if (font.remeasure && width > 0) {\n        // Some standard fonts may not have the exact width: rescale per\n        // character if measured width is greater than expected glyph width\n        // and subpixel-aa is enabled, otherwise just center the glyph.\n        const measuredWidth =\n          ((ctx.measureText(character).width * 1000) / fontSize) *\n          fontSizeScale;\n        if (width < measuredWidth && this.isFontSubpixelAAEnabled) {\n          const characterScaleX = width / measuredWidth;\n          restoreNeeded = true;\n          ctx.save();\n          ctx.scale(characterScaleX, 1);\n          scaledX /= characterScaleX;\n        } else if (width !== measuredWidth) {\n          scaledX +=\n            (((width - measuredWidth) / 2000) * fontSize) / fontSizeScale;\n        }\n      }\n\n      // Only attempt to draw the glyph if it is actually in the embedded font\n      // file or if there isn't a font file so the fallback font is shown.\n      if (this.contentVisible && (glyph.isInFont || font.missingFile)) {\n        if (simpleFillText && !accent) {\n          // common case\n          ctx.fillText(character, scaledX, scaledY);\n        } else {\n          this.paintChar(character, scaledX, scaledY, patternTransform);\n          if (accent) {\n            const scaledAccentX =\n              scaledX + (fontSize * accent.offset.x) / fontSizeScale;\n            const scaledAccentY =\n              scaledY - (fontSize * accent.offset.y) / fontSizeScale;\n            this.paintChar(\n              accent.fontChar,\n              scaledAccentX,\n              scaledAccentY,\n              patternTransform\n            );\n          }\n        }\n      }\n\n      const charWidth = vertical\n        ? width * widthAdvanceScale - spacing * fontDirection\n        : width * widthAdvanceScale + spacing * fontDirection;\n      x += charWidth;\n\n      if (restoreNeeded) {\n        ctx.restore();\n      }\n    }\n    if (vertical) {\n      current.y -= x;\n    } else {\n      current.x += x * textHScale;\n    }\n    ctx.restore();\n    this.compose();\n\n    return undefined;\n  }\n\n  showType3Text(glyphs) {\n    // Type3 fonts - each glyph is a \"mini-PDF\"\n    const ctx = this.ctx;\n    const current = this.current;\n    const font = current.font;\n    const fontSize = current.fontSize;\n    const fontDirection = current.fontDirection;\n    const spacingDir = font.vertical ? 1 : -1;\n    const charSpacing = current.charSpacing;\n    const wordSpacing = current.wordSpacing;\n    const textHScale = current.textHScale * fontDirection;\n    const fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX;\n    const glyphsLength = glyphs.length;\n    const isTextInvisible =\n      current.textRenderingMode === TextRenderingMode.INVISIBLE;\n    let i, glyph, width, spacingLength;\n\n    if (isTextInvisible || fontSize === 0) {\n      return;\n    }\n    this._cachedScaleForStroking[0] = -1;\n    this._cachedGetSinglePixelWidth = null;\n\n    ctx.save();\n    ctx.transform(...current.textMatrix);\n    ctx.translate(current.x, current.y);\n\n    ctx.scale(textHScale, fontDirection);\n\n    for (i = 0; i < glyphsLength; ++i) {\n      glyph = glyphs[i];\n      if (typeof glyph === \"number\") {\n        spacingLength = (spacingDir * glyph * fontSize) / 1000;\n        this.ctx.translate(spacingLength, 0);\n        current.x += spacingLength * textHScale;\n        continue;\n      }\n\n      const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n      const operatorList = font.charProcOperatorList[glyph.operatorListId];\n      if (!operatorList) {\n        warn(`Type3 character \"${glyph.operatorListId}\" is not available.`);\n        continue;\n      }\n      if (this.contentVisible) {\n        this.processingType3 = glyph;\n        this.save();\n        ctx.scale(fontSize, fontSize);\n        ctx.transform(...fontMatrix);\n        this.executeOperatorList(operatorList);\n        this.restore();\n      }\n\n      const transformed = Util.applyTransform([glyph.width, 0], fontMatrix);\n      width = transformed[0] * fontSize + spacing;\n\n      ctx.translate(width, 0);\n      current.x += width * textHScale;\n    }\n    ctx.restore();\n    this.processingType3 = null;\n  }\n\n  // Type3 fonts\n  setCharWidth(xWidth, yWidth) {\n    // We can safely ignore this since the width should be the same\n    // as the width in the Widths array.\n  }\n\n  setCharWidthAndBounds(xWidth, yWidth, llx, lly, urx, ury) {\n    this.ctx.rect(llx, lly, urx - llx, ury - lly);\n    this.ctx.clip();\n    this.endPath();\n  }\n\n  // Color\n  getColorN_Pattern(IR) {\n    let pattern;\n    if (IR[0] === \"TilingPattern\") {\n      const color = IR[1];\n      const baseTransform = this.baseTransform || getCurrentTransform(this.ctx);\n      const canvasGraphicsFactory = {\n        createCanvasGraphics: ctx => {\n          return new CanvasGraphics(\n            ctx,\n            this.commonObjs,\n            this.objs,\n            this.canvasFactory,\n            this.filterFactory,\n            {\n              optionalContentConfig: this.optionalContentConfig,\n              markedContentStack: this.markedContentStack,\n            }\n          );\n        },\n      };\n      pattern = new TilingPattern(\n        IR,\n        color,\n        this.ctx,\n        canvasGraphicsFactory,\n        baseTransform\n      );\n    } else {\n      pattern = this._getPattern(IR[1], IR[2]);\n    }\n    return pattern;\n  }\n\n  setStrokeColorN() {\n    this.current.strokeColor = this.getColorN_Pattern(arguments);\n  }\n\n  setFillColorN() {\n    this.current.fillColor = this.getColorN_Pattern(arguments);\n    this.current.patternFill = true;\n  }\n\n  setStrokeRGBColor(r, g, b) {\n    const color = Util.makeHexColor(r, g, b);\n    this.ctx.strokeStyle = color;\n    this.current.strokeColor = color;\n  }\n\n  setFillRGBColor(r, g, b) {\n    const color = Util.makeHexColor(r, g, b);\n    this.ctx.fillStyle = color;\n    this.current.fillColor = color;\n    this.current.patternFill = false;\n  }\n\n  _getPattern(objId, matrix = null) {\n    let pattern;\n    if (this.cachedPatterns.has(objId)) {\n      pattern = this.cachedPatterns.get(objId);\n    } else {\n      pattern = getShadingPattern(this.getObject(objId));\n      this.cachedPatterns.set(objId, pattern);\n    }\n    if (matrix) {\n      pattern.matrix = matrix;\n    }\n    return pattern;\n  }\n\n  shadingFill(objId) {\n    if (!this.contentVisible) {\n      return;\n    }\n    const ctx = this.ctx;\n\n    this.save();\n    const pattern = this._getPattern(objId);\n    ctx.fillStyle = pattern.getPattern(\n      ctx,\n      this,\n      getCurrentTransformInverse(ctx),\n      PathType.SHADING\n    );\n\n    const inv = getCurrentTransformInverse(ctx);\n    if (inv) {\n      const { width, height } = ctx.canvas;\n      const [x0, y0, x1, y1] = Util.getAxialAlignedBoundingBox(\n        [0, 0, width, height],\n        inv\n      );\n\n      this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0);\n    } else {\n      // HACK to draw the gradient onto an infinite rectangle.\n      // PDF gradients are drawn across the entire image while\n      // Canvas only allows gradients to be drawn in a rectangle\n      // The following bug should allow us to remove this.\n      // https://bugzilla.mozilla.org/show_bug.cgi?id=664884\n\n      this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);\n    }\n\n    this.compose(this.current.getClippedPathBoundingBox());\n    this.restore();\n  }\n\n  // Images\n  beginInlineImage() {\n    unreachable(\"Should not call beginInlineImage\");\n  }\n\n  beginImageData() {\n    unreachable(\"Should not call beginImageData\");\n  }\n\n  paintFormXObjectBegin(matrix, bbox) {\n    if (!this.contentVisible) {\n      return;\n    }\n    this.save();\n    this.baseTransformStack.push(this.baseTransform);\n\n    if (Array.isArray(matrix) && matrix.length === 6) {\n      this.transform(...matrix);\n    }\n\n    this.baseTransform = getCurrentTransform(this.ctx);\n\n    if (bbox) {\n      const width = bbox[2] - bbox[0];\n      const height = bbox[3] - bbox[1];\n      this.ctx.rect(bbox[0], bbox[1], width, height);\n      this.current.updateRectMinMax(getCurrentTransform(this.ctx), bbox);\n      this.clip();\n      this.endPath();\n    }\n  }\n\n  paintFormXObjectEnd() {\n    if (!this.contentVisible) {\n      return;\n    }\n    this.restore();\n    this.baseTransform = this.baseTransformStack.pop();\n  }\n\n  beginGroup(group) {\n    if (!this.contentVisible) {\n      return;\n    }\n\n    this.save();\n    // If there's an active soft mask we don't want it enabled for the group, so\n    // clear it out. The mask and suspended canvas will be restored in endGroup.\n    if (this.inSMaskMode) {\n      this.endSMaskMode();\n      this.current.activeSMask = null;\n    }\n\n    const currentCtx = this.ctx;\n    // TODO non-isolated groups - according to Rik at adobe non-isolated\n    // group results aren't usually that different and they even have tools\n    // that ignore this setting. Notes from Rik on implementing:\n    // - When you encounter an transparency group, create a new canvas with\n    // the dimensions of the bbox\n    // - copy the content from the previous canvas to the new canvas\n    // - draw as usual\n    // - remove the backdrop alpha:\n    // alphaNew = 1 - (1 - alpha)/(1 - alphaBackdrop) with 'alpha' the alpha\n    // value of your transparency group and 'alphaBackdrop' the alpha of the\n    // backdrop\n    // - remove background color:\n    // colorNew = color - alphaNew *colorBackdrop /(1 - alphaNew)\n    if (!group.isolated) {\n      info(\"TODO: Support non-isolated groups.\");\n    }\n\n    // TODO knockout - supposedly possible with the clever use of compositing\n    // modes.\n    if (group.knockout) {\n      warn(\"Knockout groups not supported.\");\n    }\n\n    const currentTransform = getCurrentTransform(currentCtx);\n    if (group.matrix) {\n      currentCtx.transform(...group.matrix);\n    }\n    if (!group.bbox) {\n      throw new Error(\"Bounding box is required.\");\n    }\n\n    // Based on the current transform figure out how big the bounding box\n    // will actually be.\n    let bounds = Util.getAxialAlignedBoundingBox(\n      group.bbox,\n      getCurrentTransform(currentCtx)\n    );\n    // Clip the bounding box to the current canvas.\n    const canvasBounds = [\n      0,\n      0,\n      currentCtx.canvas.width,\n      currentCtx.canvas.height,\n    ];\n    bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0];\n    // Use ceil in case we're between sizes so we don't create canvas that is\n    // too small and make the canvas at least 1x1 pixels.\n    const offsetX = Math.floor(bounds[0]);\n    const offsetY = Math.floor(bounds[1]);\n    let drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1);\n    let drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1);\n    let scaleX = 1,\n      scaleY = 1;\n    if (drawnWidth > MAX_GROUP_SIZE) {\n      scaleX = drawnWidth / MAX_GROUP_SIZE;\n      drawnWidth = MAX_GROUP_SIZE;\n    }\n    if (drawnHeight > MAX_GROUP_SIZE) {\n      scaleY = drawnHeight / MAX_GROUP_SIZE;\n      drawnHeight = MAX_GROUP_SIZE;\n    }\n\n    this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]);\n\n    let cacheId = \"groupAt\" + this.groupLevel;\n    if (group.smask) {\n      // Using two cache entries is case if masks are used one after another.\n      cacheId += \"_smask_\" + (this.smaskCounter++ % 2);\n    }\n    const scratchCanvas = this.cachedCanvases.getCanvas(\n      cacheId,\n      drawnWidth,\n      drawnHeight\n    );\n    const groupCtx = scratchCanvas.context;\n\n    // Since we created a new canvas that is just the size of the bounding box\n    // we have to translate the group ctx.\n    groupCtx.scale(1 / scaleX, 1 / scaleY);\n    groupCtx.translate(-offsetX, -offsetY);\n    groupCtx.transform(...currentTransform);\n\n    if (group.smask) {\n      // Saving state and cached mask to be used in setGState.\n      this.smaskStack.push({\n        canvas: scratchCanvas.canvas,\n        context: groupCtx,\n        offsetX,\n        offsetY,\n        scaleX,\n        scaleY,\n        subtype: group.smask.subtype,\n        backdrop: group.smask.backdrop,\n        transferMap: group.smask.transferMap || null,\n        startTransformInverse: null, // used during suspend operation\n      });\n    } else {\n      // Setup the current ctx so when the group is popped we draw it at the\n      // right location.\n      currentCtx.setTransform(1, 0, 0, 1, 0, 0);\n      currentCtx.translate(offsetX, offsetY);\n      currentCtx.scale(scaleX, scaleY);\n      currentCtx.save();\n    }\n    // The transparency group inherits all off the current graphics state\n    // except the blend mode, soft mask, and alpha constants.\n    copyCtxState(currentCtx, groupCtx);\n    this.ctx = groupCtx;\n    this.setGState([\n      [\"BM\", \"source-over\"],\n      [\"ca\", 1],\n      [\"CA\", 1],\n    ]);\n    this.groupStack.push(currentCtx);\n    this.groupLevel++;\n  }\n\n  endGroup(group) {\n    if (!this.contentVisible) {\n      return;\n    }\n    this.groupLevel--;\n    const groupCtx = this.ctx;\n    const ctx = this.groupStack.pop();\n    this.ctx = ctx;\n    // Turn off image smoothing to avoid sub pixel interpolation which can\n    // look kind of blurry for some pdfs.\n    this.ctx.imageSmoothingEnabled = false;\n\n    if (group.smask) {\n      this.tempSMask = this.smaskStack.pop();\n      this.restore();\n    } else {\n      this.ctx.restore();\n      const currentMtx = getCurrentTransform(this.ctx);\n      this.restore();\n      this.ctx.save();\n      this.ctx.setTransform(...currentMtx);\n      const dirtyBox = Util.getAxialAlignedBoundingBox(\n        [0, 0, groupCtx.canvas.width, groupCtx.canvas.height],\n        currentMtx\n      );\n      this.ctx.drawImage(groupCtx.canvas, 0, 0);\n      this.ctx.restore();\n      this.compose(dirtyBox);\n    }\n  }\n\n  beginAnnotation(id, rect, transform, matrix, hasOwnCanvas) {\n    // The annotations are drawn just after the page content.\n    // The page content drawing can potentially have set a transform,\n    // a clipping path, whatever...\n    // So in order to have something clean, we restore the initial state.\n    this.#restoreInitialState();\n    resetCtxToDefault(this.ctx);\n\n    this.ctx.save();\n    this.save();\n\n    if (this.baseTransform) {\n      this.ctx.setTransform(...this.baseTransform);\n    }\n\n    if (Array.isArray(rect) && rect.length === 4) {\n      const width = rect[2] - rect[0];\n      const height = rect[3] - rect[1];\n\n      if (hasOwnCanvas && this.annotationCanvasMap) {\n        transform = transform.slice();\n        transform[4] -= rect[0];\n        transform[5] -= rect[1];\n\n        rect = rect.slice();\n        rect[0] = rect[1] = 0;\n        rect[2] = width;\n        rect[3] = height;\n\n        const [scaleX, scaleY] = Util.singularValueDecompose2dScale(\n          getCurrentTransform(this.ctx)\n        );\n        const { viewportScale } = this;\n        const canvasWidth = Math.ceil(\n          width * this.outputScaleX * viewportScale\n        );\n        const canvasHeight = Math.ceil(\n          height * this.outputScaleY * viewportScale\n        );\n\n        this.annotationCanvas = this.canvasFactory.create(\n          canvasWidth,\n          canvasHeight\n        );\n        const { canvas, context } = this.annotationCanvas;\n        this.annotationCanvasMap.set(id, canvas);\n        this.annotationCanvas.savedCtx = this.ctx;\n        this.ctx = context;\n        this.ctx.save();\n        this.ctx.setTransform(scaleX, 0, 0, -scaleY, 0, height * scaleY);\n\n        resetCtxToDefault(this.ctx);\n      } else {\n        resetCtxToDefault(this.ctx);\n\n        this.ctx.rect(rect[0], rect[1], width, height);\n        this.ctx.clip();\n        this.endPath();\n      }\n    }\n\n    this.current = new CanvasExtraState(\n      this.ctx.canvas.width,\n      this.ctx.canvas.height\n    );\n\n    this.transform(...transform);\n    this.transform(...matrix);\n  }\n\n  endAnnotation() {\n    if (this.annotationCanvas) {\n      this.ctx.restore();\n      this.#drawFilter();\n\n      this.ctx = this.annotationCanvas.savedCtx;\n      delete this.annotationCanvas.savedCtx;\n      delete this.annotationCanvas;\n    }\n  }\n\n  paintImageMaskXObject(img) {\n    if (!this.contentVisible) {\n      return;\n    }\n    const count = img.count;\n    img = this.getObject(img.data, img);\n    img.count = count;\n\n    const ctx = this.ctx;\n    const glyph = this.processingType3;\n\n    if (glyph) {\n      if (glyph.compiled === undefined) {\n        glyph.compiled = compileType3Glyph(img);\n      }\n\n      if (glyph.compiled) {\n        glyph.compiled(ctx);\n        return;\n      }\n    }\n    const mask = this._createMaskCanvas(img);\n    const maskCanvas = mask.canvas;\n\n    ctx.save();\n    // The mask is drawn with the transform applied. Reset the current\n    // transform to draw to the identity.\n    ctx.setTransform(1, 0, 0, 1, 0, 0);\n    ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY);\n    ctx.restore();\n    this.compose();\n  }\n\n  paintImageMaskXObjectRepeat(\n    img,\n    scaleX,\n    skewX = 0,\n    skewY = 0,\n    scaleY,\n    positions\n  ) {\n    if (!this.contentVisible) {\n      return;\n    }\n\n    img = this.getObject(img.data, img);\n\n    const ctx = this.ctx;\n    ctx.save();\n    const currentTransform = getCurrentTransform(ctx);\n    ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0);\n    const mask = this._createMaskCanvas(img);\n\n    ctx.setTransform(\n      1,\n      0,\n      0,\n      1,\n      mask.offsetX - currentTransform[4],\n      mask.offsetY - currentTransform[5]\n    );\n    for (let i = 0, ii = positions.length; i < ii; i += 2) {\n      const trans = Util.transform(currentTransform, [\n        scaleX,\n        skewX,\n        skewY,\n        scaleY,\n        positions[i],\n        positions[i + 1],\n      ]);\n\n      const [x, y] = Util.applyTransform([0, 0], trans);\n      ctx.drawImage(mask.canvas, x, y);\n    }\n    ctx.restore();\n    this.compose();\n  }\n\n  paintImageMaskXObjectGroup(images) {\n    if (!this.contentVisible) {\n      return;\n    }\n    const ctx = this.ctx;\n\n    const fillColor = this.current.fillColor;\n    const isPatternFill = this.current.patternFill;\n\n    for (const image of images) {\n      const { data, width, height, transform } = image;\n\n      const maskCanvas = this.cachedCanvases.getCanvas(\n        \"maskCanvas\",\n        width,\n        height\n      );\n      const maskCtx = maskCanvas.context;\n      maskCtx.save();\n\n      const img = this.getObject(data, image);\n      putBinaryImageMask(maskCtx, img);\n\n      maskCtx.globalCompositeOperation = \"source-in\";\n\n      maskCtx.fillStyle = isPatternFill\n        ? fillColor.getPattern(\n            maskCtx,\n            this,\n            getCurrentTransformInverse(ctx),\n            PathType.FILL\n          )\n        : fillColor;\n      maskCtx.fillRect(0, 0, width, height);\n\n      maskCtx.restore();\n\n      ctx.save();\n      ctx.transform(...transform);\n      ctx.scale(1, -1);\n      drawImageAtIntegerCoords(\n        ctx,\n        maskCanvas.canvas,\n        0,\n        0,\n        width,\n        height,\n        0,\n        -1,\n        1,\n        1\n      );\n      ctx.restore();\n    }\n    this.compose();\n  }\n\n  paintImageXObject(objId) {\n    if (!this.contentVisible) {\n      return;\n    }\n    const imgData = this.getObject(objId);\n    if (!imgData) {\n      warn(\"Dependent image isn't ready yet\");\n      return;\n    }\n\n    this.paintInlineImageXObject(imgData);\n  }\n\n  paintImageXObjectRepeat(objId, scaleX, scaleY, positions) {\n    if (!this.contentVisible) {\n      return;\n    }\n    const imgData = this.getObject(objId);\n    if (!imgData) {\n      warn(\"Dependent image isn't ready yet\");\n      return;\n    }\n\n    const width = imgData.width;\n    const height = imgData.height;\n    const map = [];\n    for (let i = 0, ii = positions.length; i < ii; i += 2) {\n      map.push({\n        transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]],\n        x: 0,\n        y: 0,\n        w: width,\n        h: height,\n      });\n    }\n    this.paintInlineImageXObjectGroup(imgData, map);\n  }\n\n  applyTransferMapsToCanvas(ctx) {\n    if (this.current.transferMaps !== \"none\") {\n      ctx.filter = this.current.transferMaps;\n      ctx.drawImage(ctx.canvas, 0, 0);\n      ctx.filter = \"none\";\n    }\n    return ctx.canvas;\n  }\n\n  applyTransferMapsToBitmap(imgData) {\n    if (this.current.transferMaps === \"none\") {\n      return imgData.bitmap;\n    }\n    const { bitmap, width, height } = imgData;\n    const tmpCanvas = this.cachedCanvases.getCanvas(\n      \"inlineImage\",\n      width,\n      height\n    );\n    const tmpCtx = tmpCanvas.context;\n    tmpCtx.filter = this.current.transferMaps;\n    tmpCtx.drawImage(bitmap, 0, 0);\n    tmpCtx.filter = \"none\";\n\n    return tmpCanvas.canvas;\n  }\n\n  paintInlineImageXObject(imgData) {\n    if (!this.contentVisible) {\n      return;\n    }\n    const width = imgData.width;\n    const height = imgData.height;\n    const ctx = this.ctx;\n\n    this.save();\n\n    if (\n      (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n      !isNodeJS\n    ) {\n      // The filter, if any, will be applied in applyTransferMapsToBitmap.\n      // It must be applied to the image before rescaling else some artifacts\n      // could appear.\n      // The final restore will reset it to its value.\n      const { filter } = ctx;\n      if (filter !== \"none\" && filter !== \"\") {\n        ctx.filter = \"none\";\n      }\n    }\n\n    // scale the image to the unit square\n    ctx.scale(1 / width, -1 / height);\n\n    let imgToPaint;\n    if (imgData.bitmap) {\n      imgToPaint = this.applyTransferMapsToBitmap(imgData);\n    } else if (\n      (typeof HTMLElement === \"function\" && imgData instanceof HTMLElement) ||\n      !imgData.data\n    ) {\n      // typeof check is needed due to node.js support, see issue #8489\n      imgToPaint = imgData;\n    } else {\n      const tmpCanvas = this.cachedCanvases.getCanvas(\n        \"inlineImage\",\n        width,\n        height\n      );\n      const tmpCtx = tmpCanvas.context;\n      putBinaryImageData(tmpCtx, imgData);\n      imgToPaint = this.applyTransferMapsToCanvas(tmpCtx);\n    }\n\n    const scaled = this._scaleImage(\n      imgToPaint,\n      getCurrentTransformInverse(ctx)\n    );\n    ctx.imageSmoothingEnabled = getImageSmoothingEnabled(\n      getCurrentTransform(ctx),\n      imgData.interpolate\n    );\n\n    drawImageAtIntegerCoords(\n      ctx,\n      scaled.img,\n      0,\n      0,\n      scaled.paintWidth,\n      scaled.paintHeight,\n      0,\n      -height,\n      width,\n      height\n    );\n    this.compose();\n    this.restore();\n  }\n\n  paintInlineImageXObjectGroup(imgData, map) {\n    if (!this.contentVisible) {\n      return;\n    }\n    const ctx = this.ctx;\n    let imgToPaint;\n    if (imgData.bitmap) {\n      imgToPaint = imgData.bitmap;\n    } else {\n      const w = imgData.width;\n      const h = imgData.height;\n\n      const tmpCanvas = this.cachedCanvases.getCanvas(\"inlineImage\", w, h);\n      const tmpCtx = tmpCanvas.context;\n      putBinaryImageData(tmpCtx, imgData);\n      imgToPaint = this.applyTransferMapsToCanvas(tmpCtx);\n    }\n\n    for (const entry of map) {\n      ctx.save();\n      ctx.transform(...entry.transform);\n      ctx.scale(1, -1);\n      drawImageAtIntegerCoords(\n        ctx,\n        imgToPaint,\n        entry.x,\n        entry.y,\n        entry.w,\n        entry.h,\n        0,\n        -1,\n        1,\n        1\n      );\n      ctx.restore();\n    }\n    this.compose();\n  }\n\n  paintSolidColorImageMask() {\n    if (!this.contentVisible) {\n      return;\n    }\n    this.ctx.fillRect(0, 0, 1, 1);\n    this.compose();\n  }\n\n  // Marked content\n\n  markPoint(tag) {\n    // TODO Marked content.\n  }\n\n  markPointProps(tag, properties) {\n    // TODO Marked content.\n  }\n\n  beginMarkedContent(tag) {\n    this.markedContentStack.push({\n      visible: true,\n    });\n  }\n\n  beginMarkedContentProps(tag, properties) {\n    if (tag === \"OC\") {\n      this.markedContentStack.push({\n        visible: this.optionalContentConfig.isVisible(properties),\n      });\n    } else {\n      this.markedContentStack.push({\n        visible: true,\n      });\n    }\n    this.contentVisible = this.isContentVisible();\n  }\n\n  endMarkedContent() {\n    this.markedContentStack.pop();\n    this.contentVisible = this.isContentVisible();\n  }\n\n  // Compatibility\n\n  beginCompat() {\n    // TODO ignore undefined operators (should we do that anyway?)\n  }\n\n  endCompat() {\n    // TODO stop ignoring undefined operators\n  }\n\n  // Helper functions\n\n  consumePath(clipBox) {\n    const isEmpty = this.current.isEmptyClip();\n    if (this.pendingClip) {\n      this.current.updateClipFromPath();\n    }\n    if (!this.pendingClip) {\n      this.compose(clipBox);\n    }\n    const ctx = this.ctx;\n    if (this.pendingClip) {\n      if (!isEmpty) {\n        if (this.pendingClip === EO_CLIP) {\n          ctx.clip(\"evenodd\");\n        } else {\n          ctx.clip();\n        }\n      }\n      this.pendingClip = null;\n    }\n    this.current.startNewPathAndClipBox(this.current.clipBox);\n    ctx.beginPath();\n  }\n\n  getSinglePixelWidth() {\n    if (!this._cachedGetSinglePixelWidth) {\n      const m = getCurrentTransform(this.ctx);\n      if (m[1] === 0 && m[2] === 0) {\n        // Fast path\n        this._cachedGetSinglePixelWidth =\n          1 / Math.min(Math.abs(m[0]), Math.abs(m[3]));\n      } else {\n        const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]);\n        const normX = Math.hypot(m[0], m[2]);\n        const normY = Math.hypot(m[1], m[3]);\n        this._cachedGetSinglePixelWidth = Math.max(normX, normY) / absDet;\n      }\n    }\n    return this._cachedGetSinglePixelWidth;\n  }\n\n  getScaleForStroking() {\n    // A pixel has thicknessX = thicknessY = 1;\n    // A transformed pixel is a parallelogram and the thicknesses\n    // corresponds to the heights.\n    // The goal of this function is to rescale before setting the\n    // lineWidth in order to have both thicknesses greater or equal\n    // to 1 after transform.\n    if (this._cachedScaleForStroking[0] === -1) {\n      const { lineWidth } = this.current;\n      const { a, b, c, d } = this.ctx.getTransform();\n      let scaleX, scaleY;\n\n      if (b === 0 && c === 0) {\n        // Fast path\n        const normX = Math.abs(a);\n        const normY = Math.abs(d);\n        if (normX === normY) {\n          if (lineWidth === 0) {\n            scaleX = scaleY = 1 / normX;\n          } else {\n            const scaledLineWidth = normX * lineWidth;\n            scaleX = scaleY = scaledLineWidth < 1 ? 1 / scaledLineWidth : 1;\n          }\n        } else if (lineWidth === 0) {\n          scaleX = 1 / normX;\n          scaleY = 1 / normY;\n        } else {\n          const scaledXLineWidth = normX * lineWidth;\n          const scaledYLineWidth = normY * lineWidth;\n          scaleX = scaledXLineWidth < 1 ? 1 / scaledXLineWidth : 1;\n          scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1;\n        }\n      } else {\n        // A pixel (base (x, y)) is transformed by M into a parallelogram:\n        //  - its area is |det(M)|;\n        //  - heightY (orthogonal to Mx) has a length: |det(M)| / norm(Mx);\n        //  - heightX (orthogonal to My) has a length: |det(M)| / norm(My).\n        // heightX and heightY are the thicknesses of the transformed pixel\n        // and they must be both greater or equal to 1.\n        const absDet = Math.abs(a * d - b * c);\n        const normX = Math.hypot(a, b);\n        const normY = Math.hypot(c, d);\n        if (lineWidth === 0) {\n          scaleX = normY / absDet;\n          scaleY = normX / absDet;\n        } else {\n          const baseArea = lineWidth * absDet;\n          scaleX = normY > baseArea ? normY / baseArea : 1;\n          scaleY = normX > baseArea ? normX / baseArea : 1;\n        }\n      }\n      this._cachedScaleForStroking[0] = scaleX;\n      this._cachedScaleForStroking[1] = scaleY;\n    }\n    return this._cachedScaleForStroking;\n  }\n\n  // Rescale before stroking in order to have a final lineWidth\n  // with both thicknesses greater or equal to 1.\n  rescaleAndStroke(saveRestore) {\n    const { ctx } = this;\n    const { lineWidth } = this.current;\n    const [scaleX, scaleY] = this.getScaleForStroking();\n\n    ctx.lineWidth = lineWidth || 1;\n\n    if (scaleX === 1 && scaleY === 1) {\n      ctx.stroke();\n      return;\n    }\n\n    const dashes = ctx.getLineDash();\n    if (saveRestore) {\n      ctx.save();\n    }\n\n    ctx.scale(scaleX, scaleY);\n\n    // How the dashed line is rendered depends on the current transform...\n    // so we added a rescale to handle too thin lines and consequently\n    // the way the line is dashed will be modified.\n    // If scaleX === scaleY, the dashed lines will be rendered correctly\n    // else we'll have some bugs (but only with too thin lines).\n    // Here we take the max... why not taking the min... or something else.\n    // Anyway, as said it's buggy when scaleX !== scaleY.\n    if (dashes.length > 0) {\n      const scale = Math.max(scaleX, scaleY);\n      ctx.setLineDash(dashes.map(x => x / scale));\n      ctx.lineDashOffset /= scale;\n    }\n\n    ctx.stroke();\n\n    if (saveRestore) {\n      ctx.restore();\n    }\n  }\n\n  isContentVisible() {\n    for (let i = this.markedContentStack.length - 1; i >= 0; i--) {\n      if (!this.markedContentStack[i].visible) {\n        return false;\n      }\n    }\n    return true;\n  }\n}\n\nfor (const op in OPS) {\n  if (CanvasGraphics.prototype[op] !== undefined) {\n    CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op];\n  }\n}\n\nexport { CanvasGraphics };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  BaseCanvasFactory,\n  BaseCMapReaderFactory,\n  BaseFilterFactory,\n  BaseStandardFontDataFactory,\n  BaseSVGFactory,\n} from \"./base_factory.js\";\nimport {\n  BaseException,\n  FeatureTest,\n  shadow,\n  stringToBytes,\n  Util,\n  warn,\n} from \"../shared/util.js\";\n\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\n\nclass PixelsPerInch {\n  static CSS = 96.0;\n\n  static PDF = 72.0;\n\n  static PDF_TO_CSS_UNITS = this.CSS / this.PDF;\n}\n\n/**\n * FilterFactory aims to create some SVG filters we can use when drawing an\n * image (or whatever) on a canvas.\n * Filters aren't applied with ctx.putImageData because it just overwrites the\n * underlying pixels.\n * With these filters, it's possible for example to apply some transfer maps on\n * an image without the need to apply them on the pixel arrays: the renderer\n * does the magic for us.\n */\nclass DOMFilterFactory extends BaseFilterFactory {\n  #_cache;\n\n  #_defs;\n\n  #docId;\n\n  #document;\n\n  #hcmFilter;\n\n  #hcmKey;\n\n  #hcmUrl;\n\n  #hcmHighlightFilter;\n\n  #hcmHighlightKey;\n\n  #hcmHighlightUrl;\n\n  #id = 0;\n\n  constructor({ docId, ownerDocument = globalThis.document } = {}) {\n    super();\n    this.#docId = docId;\n    this.#document = ownerDocument;\n  }\n\n  get #cache() {\n    return (this.#_cache ||= new Map());\n  }\n\n  get #defs() {\n    if (!this.#_defs) {\n      const div = this.#document.createElement(\"div\");\n      const { style } = div;\n      style.visibility = \"hidden\";\n      style.contain = \"strict\";\n      style.width = style.height = 0;\n      style.position = \"absolute\";\n      style.top = style.left = 0;\n      style.zIndex = -1;\n\n      const svg = this.#document.createElementNS(SVG_NS, \"svg\");\n      svg.setAttribute(\"width\", 0);\n      svg.setAttribute(\"height\", 0);\n      this.#_defs = this.#document.createElementNS(SVG_NS, \"defs\");\n      div.append(svg);\n      svg.append(this.#_defs);\n      this.#document.body.append(div);\n    }\n    return this.#_defs;\n  }\n\n  addFilter(maps) {\n    if (!maps) {\n      return \"none\";\n    }\n\n    // When a page is zoomed the page is re-drawn but the maps are likely\n    // the same.\n    let value = this.#cache.get(maps);\n    if (value) {\n      return value;\n    }\n\n    let tableR, tableG, tableB, key;\n    if (maps.length === 1) {\n      const mapR = maps[0];\n      const buffer = new Array(256);\n      for (let i = 0; i < 256; i++) {\n        buffer[i] = mapR[i] / 255;\n      }\n      key = tableR = tableG = tableB = buffer.join(\",\");\n    } else {\n      const [mapR, mapG, mapB] = maps;\n      const bufferR = new Array(256);\n      const bufferG = new Array(256);\n      const bufferB = new Array(256);\n      for (let i = 0; i < 256; i++) {\n        bufferR[i] = mapR[i] / 255;\n        bufferG[i] = mapG[i] / 255;\n        bufferB[i] = mapB[i] / 255;\n      }\n      tableR = bufferR.join(\",\");\n      tableG = bufferG.join(\",\");\n      tableB = bufferB.join(\",\");\n      key = `${tableR}${tableG}${tableB}`;\n    }\n\n    value = this.#cache.get(key);\n    if (value) {\n      this.#cache.set(maps, value);\n      return value;\n    }\n\n    // We create a SVG filter: feComponentTransferElement\n    //  https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement\n\n    const id = `g_${this.#docId}_transfer_map_${this.#id++}`;\n    const url = `url(#${id})`;\n    this.#cache.set(maps, url);\n    this.#cache.set(key, url);\n\n    const filter = this.#createFilter(id);\n    this.#addTransferMapConversion(tableR, tableG, tableB, filter);\n\n    return url;\n  }\n\n  addHCMFilter(fgColor, bgColor) {\n    const key = `${fgColor}-${bgColor}`;\n    if (this.#hcmKey === key) {\n      return this.#hcmUrl;\n    }\n\n    this.#hcmKey = key;\n    this.#hcmUrl = \"none\";\n    this.#hcmFilter?.remove();\n\n    if (!fgColor || !bgColor) {\n      return this.#hcmUrl;\n    }\n\n    const fgRGB = this.#getRGB(fgColor);\n    fgColor = Util.makeHexColor(...fgRGB);\n    const bgRGB = this.#getRGB(bgColor);\n    bgColor = Util.makeHexColor(...bgRGB);\n    this.#defs.style.color = \"\";\n\n    if (\n      (fgColor === \"#000000\" && bgColor === \"#ffffff\") ||\n      fgColor === bgColor\n    ) {\n      return this.#hcmUrl;\n    }\n\n    // https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_Colors_and_Luminance\n    //\n    // Relative luminance:\n    // https://www.w3.org/TR/WCAG20/#relativeluminancedef\n    //\n    // We compute the rounded luminance of the default background color.\n    // Then for every color in the pdf, if its rounded luminance is the\n    // same as the background one then it's replaced by the new\n    // background color else by the foreground one.\n    const map = new Array(256);\n    for (let i = 0; i <= 255; i++) {\n      const x = i / 255;\n      map[i] = x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4;\n    }\n    const table = map.join(\",\");\n\n    const id = `g_${this.#docId}_hcm_filter`;\n    const filter = (this.#hcmHighlightFilter = this.#createFilter(id));\n    this.#addTransferMapConversion(table, table, table, filter);\n    this.#addGrayConversion(filter);\n\n    const getSteps = (c, n) => {\n      const start = fgRGB[c] / 255;\n      const end = bgRGB[c] / 255;\n      const arr = new Array(n + 1);\n      for (let i = 0; i <= n; i++) {\n        arr[i] = start + (i / n) * (end - start);\n      }\n      return arr.join(\",\");\n    };\n    this.#addTransferMapConversion(\n      getSteps(0, 5),\n      getSteps(1, 5),\n      getSteps(2, 5),\n      filter\n    );\n\n    this.#hcmUrl = `url(#${id})`;\n    return this.#hcmUrl;\n  }\n\n  addHighlightHCMFilter(fgColor, bgColor, newFgColor, newBgColor) {\n    const key = `${fgColor}-${bgColor}-${newFgColor}-${newBgColor}`;\n    if (this.#hcmHighlightKey === key) {\n      return this.#hcmHighlightUrl;\n    }\n\n    this.#hcmHighlightKey = key;\n    this.#hcmHighlightUrl = \"none\";\n    this.#hcmHighlightFilter?.remove();\n\n    if (!fgColor || !bgColor) {\n      return this.#hcmHighlightUrl;\n    }\n\n    const [fgRGB, bgRGB] = [fgColor, bgColor].map(this.#getRGB.bind(this));\n    let fgGray = Math.round(\n      0.2126 * fgRGB[0] + 0.7152 * fgRGB[1] + 0.0722 * fgRGB[2]\n    );\n    let bgGray = Math.round(\n      0.2126 * bgRGB[0] + 0.7152 * bgRGB[1] + 0.0722 * bgRGB[2]\n    );\n    let [newFgRGB, newBgRGB] = [newFgColor, newBgColor].map(\n      this.#getRGB.bind(this)\n    );\n    if (bgGray < fgGray) {\n      [fgGray, bgGray, newFgRGB, newBgRGB] = [\n        bgGray,\n        fgGray,\n        newBgRGB,\n        newFgRGB,\n      ];\n    }\n    this.#defs.style.color = \"\";\n\n    // Now we can create the filters to highlight some canvas parts.\n    // The colors in the pdf will almost be Canvas and CanvasText, hence we\n    // want to filter them to finally get Highlight and HighlightText.\n    // Since we're in HCM the background color and the foreground color should\n    // be really different when converted to grayscale (if they're not then it\n    // means that we've a poor contrast). Once the canvas colors are converted\n    // to grayscale we can easily map them on their new colors.\n    // The grayscale step is important because if we've something like:\n    //   fgColor = #FF....\n    //   bgColor = #FF....\n    //   then we are enable to map the red component on the new red components\n    //   which can be different.\n\n    const getSteps = (fg, bg, n) => {\n      const arr = new Array(256);\n      const step = (bgGray - fgGray) / n;\n      const newStart = fg / 255;\n      const newStep = (bg - fg) / (255 * n);\n      let prev = 0;\n      for (let i = 0; i <= n; i++) {\n        const k = Math.round(fgGray + i * step);\n        const value = newStart + i * newStep;\n        for (let j = prev; j <= k; j++) {\n          arr[j] = value;\n        }\n        prev = k + 1;\n      }\n      for (let i = prev; i < 256; i++) {\n        arr[i] = arr[prev - 1];\n      }\n      return arr.join(\",\");\n    };\n\n    const id = `g_${this.#docId}_hcm_highlight_filter`;\n    const filter = (this.#hcmHighlightFilter = this.#createFilter(id));\n\n    this.#addGrayConversion(filter);\n    this.#addTransferMapConversion(\n      getSteps(newFgRGB[0], newBgRGB[0], 5),\n      getSteps(newFgRGB[1], newBgRGB[1], 5),\n      getSteps(newFgRGB[2], newBgRGB[2], 5),\n      filter\n    );\n\n    this.#hcmHighlightUrl = `url(#${id})`;\n    return this.#hcmHighlightUrl;\n  }\n\n  destroy(keepHCM = false) {\n    if (keepHCM && (this.#hcmUrl || this.#hcmHighlightUrl)) {\n      return;\n    }\n    if (this.#_defs) {\n      this.#_defs.parentNode.parentNode.remove();\n      this.#_defs = null;\n    }\n    if (this.#_cache) {\n      this.#_cache.clear();\n      this.#_cache = null;\n    }\n    this.#id = 0;\n  }\n\n  #addGrayConversion(filter) {\n    const feColorMatrix = this.#document.createElementNS(\n      SVG_NS,\n      \"feColorMatrix\"\n    );\n    feColorMatrix.setAttribute(\"type\", \"matrix\");\n    feColorMatrix.setAttribute(\n      \"values\",\n      \"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\"\n    );\n    filter.append(feColorMatrix);\n  }\n\n  #createFilter(id) {\n    const filter = this.#document.createElementNS(SVG_NS, \"filter\");\n    filter.setAttribute(\"color-interpolation-filters\", \"sRGB\");\n    filter.setAttribute(\"id\", id);\n    this.#defs.append(filter);\n\n    return filter;\n  }\n\n  #appendFeFunc(feComponentTransfer, func, table) {\n    const feFunc = this.#document.createElementNS(SVG_NS, func);\n    feFunc.setAttribute(\"type\", \"discrete\");\n    feFunc.setAttribute(\"tableValues\", table);\n    feComponentTransfer.append(feFunc);\n  }\n\n  #addTransferMapConversion(rTable, gTable, bTable, filter) {\n    const feComponentTransfer = this.#document.createElementNS(\n      SVG_NS,\n      \"feComponentTransfer\"\n    );\n    filter.append(feComponentTransfer);\n    this.#appendFeFunc(feComponentTransfer, \"feFuncR\", rTable);\n    this.#appendFeFunc(feComponentTransfer, \"feFuncG\", gTable);\n    this.#appendFeFunc(feComponentTransfer, \"feFuncB\", bTable);\n  }\n\n  #getRGB(color) {\n    this.#defs.style.color = color;\n    return getRGB(getComputedStyle(this.#defs).getPropertyValue(\"color\"));\n  }\n}\n\nclass DOMCanvasFactory extends BaseCanvasFactory {\n  constructor({ ownerDocument = globalThis.document } = {}) {\n    super();\n    this._document = ownerDocument;\n  }\n\n  /**\n   * @ignore\n   */\n  _createCanvas(width, height) {\n    const canvas = this._document.createElement(\"canvas\");\n    canvas.width = width;\n    canvas.height = height;\n    return canvas;\n  }\n}\n\nasync function fetchData(url, type = \"text\") {\n  if (\n    (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n    isValidFetchUrl(url, document.baseURI)\n  ) {\n    const response = await fetch(url);\n    if (!response.ok) {\n      throw new Error(response.statusText);\n    }\n    switch (type) {\n      case \"arraybuffer\":\n        return response.arrayBuffer();\n      case \"blob\":\n        return response.blob();\n      case \"json\":\n        return response.json();\n    }\n    return response.text();\n  }\n\n  // The Fetch API is not supported.\n  return new Promise((resolve, reject) => {\n    const request = new XMLHttpRequest();\n    request.open(\"GET\", url, /* async = */ true);\n    request.responseType = type;\n\n    request.onreadystatechange = () => {\n      if (request.readyState !== XMLHttpRequest.DONE) {\n        return;\n      }\n      if (request.status === 200 || request.status === 0) {\n        let data;\n        switch (type) {\n          case \"arraybuffer\":\n          case \"blob\":\n          case \"json\":\n            data = request.response;\n            break;\n          default:\n            data = request.responseText;\n            break;\n        }\n        if (data) {\n          resolve(data);\n          return;\n        }\n      }\n      reject(new Error(request.statusText));\n    };\n\n    request.send(null);\n  });\n}\n\nclass DOMCMapReaderFactory extends BaseCMapReaderFactory {\n  /**\n   * @ignore\n   */\n  _fetchData(url, compressionType) {\n    return fetchData(\n      url,\n      /* type = */ this.isCompressed ? \"arraybuffer\" : \"text\"\n    ).then(data => {\n      return {\n        cMapData:\n          data instanceof ArrayBuffer\n            ? new Uint8Array(data)\n            : stringToBytes(data),\n        compressionType,\n      };\n    });\n  }\n}\n\nclass DOMStandardFontDataFactory extends BaseStandardFontDataFactory {\n  /**\n   * @ignore\n   */\n  _fetchData(url) {\n    return fetchData(url, /* type = */ \"arraybuffer\").then(data => {\n      return new Uint8Array(data);\n    });\n  }\n}\n\nclass DOMSVGFactory extends BaseSVGFactory {\n  /**\n   * @ignore\n   */\n  _createSVG(type) {\n    return document.createElementNS(SVG_NS, type);\n  }\n}\n\n/**\n * @typedef {Object} PageViewportParameters\n * @property {Array<number>} viewBox - The xMin, yMin, xMax and\n *   yMax coordinates.\n * @property {number} scale - The scale of the viewport.\n * @property {number} rotation - The rotation, in degrees, of the viewport.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset. The\n *   default value is `0`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset. The\n *   default value is `0`.\n * @property {boolean} [dontFlip] - If true, the y-axis will not be flipped.\n *   The default value is `false`.\n */\n\n/**\n * @typedef {Object} PageViewportCloneParameters\n * @property {number} [scale] - The scale, overriding the one in the cloned\n *   viewport. The default value is `this.scale`.\n * @property {number} [rotation] - The rotation, in degrees, overriding the one\n *   in the cloned viewport. The default value is `this.rotation`.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.\n *   The default value is `this.offsetX`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.\n *   The default value is `this.offsetY`.\n * @property {boolean} [dontFlip] - If true, the x-axis will not be flipped.\n *   The default value is `false`.\n */\n\n/**\n * PDF page viewport created based on scale, rotation and offset.\n */\nclass PageViewport {\n  /**\n   * @param {PageViewportParameters}\n   */\n  constructor({\n    viewBox,\n    scale,\n    rotation,\n    offsetX = 0,\n    offsetY = 0,\n    dontFlip = false,\n  }) {\n    this.viewBox = viewBox;\n    this.scale = scale;\n    this.rotation = rotation;\n    this.offsetX = offsetX;\n    this.offsetY = offsetY;\n\n    // creating transform to convert pdf coordinate system to the normal\n    // canvas like coordinates taking in account scale and rotation\n    const centerX = (viewBox[2] + viewBox[0]) / 2;\n    const centerY = (viewBox[3] + viewBox[1]) / 2;\n    let rotateA, rotateB, rotateC, rotateD;\n    // Normalize the rotation, by clamping it to the [0, 360) range.\n    rotation %= 360;\n    if (rotation < 0) {\n      rotation += 360;\n    }\n    switch (rotation) {\n      case 180:\n        rotateA = -1;\n        rotateB = 0;\n        rotateC = 0;\n        rotateD = 1;\n        break;\n      case 90:\n        rotateA = 0;\n        rotateB = 1;\n        rotateC = 1;\n        rotateD = 0;\n        break;\n      case 270:\n        rotateA = 0;\n        rotateB = -1;\n        rotateC = -1;\n        rotateD = 0;\n        break;\n      case 0:\n        rotateA = 1;\n        rotateB = 0;\n        rotateC = 0;\n        rotateD = -1;\n        break;\n      default:\n        throw new Error(\n          \"PageViewport: Invalid rotation, must be a multiple of 90 degrees.\"\n        );\n    }\n\n    if (dontFlip) {\n      rotateC = -rotateC;\n      rotateD = -rotateD;\n    }\n\n    let offsetCanvasX, offsetCanvasY;\n    let width, height;\n    if (rotateA === 0) {\n      offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX;\n      offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY;\n      width = (viewBox[3] - viewBox[1]) * scale;\n      height = (viewBox[2] - viewBox[0]) * scale;\n    } else {\n      offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX;\n      offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY;\n      width = (viewBox[2] - viewBox[0]) * scale;\n      height = (viewBox[3] - viewBox[1]) * scale;\n    }\n    // creating transform for the following operations:\n    // translate(-centerX, -centerY), rotate and flip vertically,\n    // scale, and translate(offsetCanvasX, offsetCanvasY)\n    this.transform = [\n      rotateA * scale,\n      rotateB * scale,\n      rotateC * scale,\n      rotateD * scale,\n      offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY,\n      offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY,\n    ];\n\n    this.width = width;\n    this.height = height;\n  }\n\n  /**\n   * The original, un-scaled, viewport dimensions.\n   * @type {Object}\n   */\n  get rawDims() {\n    const { viewBox } = this;\n    return shadow(this, \"rawDims\", {\n      pageWidth: viewBox[2] - viewBox[0],\n      pageHeight: viewBox[3] - viewBox[1],\n      pageX: viewBox[0],\n      pageY: viewBox[1],\n    });\n  }\n\n  /**\n   * Clones viewport, with optional additional properties.\n   * @param {PageViewportCloneParameters} [params]\n   * @returns {PageViewport} Cloned viewport.\n   */\n  clone({\n    scale = this.scale,\n    rotation = this.rotation,\n    offsetX = this.offsetX,\n    offsetY = this.offsetY,\n    dontFlip = false,\n  } = {}) {\n    return new PageViewport({\n      viewBox: this.viewBox.slice(),\n      scale,\n      rotation,\n      offsetX,\n      offsetY,\n      dontFlip,\n    });\n  }\n\n  /**\n   * Converts PDF point to the viewport coordinates. For examples, useful for\n   * converting PDF location into canvas pixel coordinates.\n   * @param {number} x - The x-coordinate.\n   * @param {number} y - The y-coordinate.\n   * @returns {Array} Array containing `x`- and `y`-coordinates of the\n   *   point in the viewport coordinate space.\n   * @see {@link convertToPdfPoint}\n   * @see {@link convertToViewportRectangle}\n   */\n  convertToViewportPoint(x, y) {\n    return Util.applyTransform([x, y], this.transform);\n  }\n\n  /**\n   * Converts PDF rectangle to the viewport coordinates.\n   * @param {Array} rect - The xMin, yMin, xMax and yMax coordinates.\n   * @returns {Array} Array containing corresponding coordinates of the\n   *   rectangle in the viewport coordinate space.\n   * @see {@link convertToViewportPoint}\n   */\n  convertToViewportRectangle(rect) {\n    const topLeft = Util.applyTransform([rect[0], rect[1]], this.transform);\n    const bottomRight = Util.applyTransform([rect[2], rect[3]], this.transform);\n    return [topLeft[0], topLeft[1], bottomRight[0], bottomRight[1]];\n  }\n\n  /**\n   * Converts viewport coordinates to the PDF location. For examples, useful\n   * for converting canvas pixel location into PDF one.\n   * @param {number} x - The x-coordinate.\n   * @param {number} y - The y-coordinate.\n   * @returns {Array} Array containing `x`- and `y`-coordinates of the\n   *   point in the PDF coordinate space.\n   * @see {@link convertToViewportPoint}\n   */\n  convertToPdfPoint(x, y) {\n    return Util.applyInverseTransform([x, y], this.transform);\n  }\n}\n\nclass RenderingCancelledException extends BaseException {\n  constructor(msg, extraDelay = 0) {\n    super(msg, \"RenderingCancelledException\");\n    this.extraDelay = extraDelay;\n  }\n}\n\nfunction isDataScheme(url) {\n  const ii = url.length;\n  let i = 0;\n  while (i < ii && url[i].trim() === \"\") {\n    i++;\n  }\n  return url.substring(i, i + 5).toLowerCase() === \"data:\";\n}\n\nfunction isPdfFile(filename) {\n  return typeof filename === \"string\" && /\\.pdf$/i.test(filename);\n}\n\n/**\n * Gets the filename from a given URL.\n * @param {string} url\n * @param {boolean} [onlyStripPath]\n * @returns {string}\n */\nfunction getFilenameFromUrl(url, onlyStripPath = false) {\n  if (!onlyStripPath) {\n    [url] = url.split(/[#?]/, 1);\n  }\n  return url.substring(url.lastIndexOf(\"/\") + 1);\n}\n\n/**\n * Returns the filename or guessed filename from the url (see issue 3455).\n * @param {string} url - The original PDF location.\n * @param {string} defaultFilename - The value returned if the filename is\n *   unknown, or the protocol is unsupported.\n * @returns {string} Guessed PDF filename.\n */\nfunction getPdfFilenameFromUrl(url, defaultFilename = \"document.pdf\") {\n  if (typeof url !== \"string\") {\n    return defaultFilename;\n  }\n  if (isDataScheme(url)) {\n    warn('getPdfFilenameFromUrl: ignore \"data:\"-URL for performance reasons.');\n    return defaultFilename;\n  }\n  const reURI = /^(?:(?:[^:]+:)?\\/\\/[^/]+)?([^?#]*)(\\?[^#]*)?(#.*)?$/;\n  //              SCHEME        HOST        1.PATH  2.QUERY   3.REF\n  // Pattern to get last matching NAME.pdf\n  const reFilename = /[^/?#=]+\\.pdf\\b(?!.*\\.pdf\\b)/i;\n  const splitURI = reURI.exec(url);\n  let suggestedFilename =\n    reFilename.exec(splitURI[1]) ||\n    reFilename.exec(splitURI[2]) ||\n    reFilename.exec(splitURI[3]);\n  if (suggestedFilename) {\n    suggestedFilename = suggestedFilename[0];\n    if (suggestedFilename.includes(\"%\")) {\n      // URL-encoded %2Fpath%2Fto%2Ffile.pdf should be file.pdf\n      try {\n        suggestedFilename = reFilename.exec(\n          decodeURIComponent(suggestedFilename)\n        )[0];\n      } catch {\n        // Possible (extremely rare) errors:\n        // URIError \"Malformed URI\", e.g. for \"%AA.pdf\"\n        // TypeError \"null has no properties\", e.g. for \"%2F.pdf\"\n      }\n    }\n  }\n  return suggestedFilename || defaultFilename;\n}\n\nclass StatTimer {\n  started = Object.create(null);\n\n  times = [];\n\n  time(name) {\n    if (name in this.started) {\n      warn(`Timer is already running for ${name}`);\n    }\n    this.started[name] = Date.now();\n  }\n\n  timeEnd(name) {\n    if (!(name in this.started)) {\n      warn(`Timer has not been started for ${name}`);\n    }\n    this.times.push({\n      name,\n      start: this.started[name],\n      end: Date.now(),\n    });\n    // Remove timer from started so it can be called again.\n    delete this.started[name];\n  }\n\n  toString() {\n    // Find the longest name for padding purposes.\n    const outBuf = [];\n    let longest = 0;\n    for (const { name } of this.times) {\n      longest = Math.max(name.length, longest);\n    }\n    for (const { name, start, end } of this.times) {\n      outBuf.push(`${name.padEnd(longest)} ${end - start}ms\\n`);\n    }\n    return outBuf.join(\"\");\n  }\n}\n\nfunction isValidFetchUrl(url, baseUrl) {\n  if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n    throw new Error(\"Not implemented: isValidFetchUrl\");\n  }\n  try {\n    const { protocol } = baseUrl ? new URL(url, baseUrl) : new URL(url);\n    // The Fetch API only supports the http/https protocols, and not file/ftp.\n    return protocol === \"http:\" || protocol === \"https:\";\n  } catch {\n    return false; // `new URL()` will throw on incorrect data.\n  }\n}\n\n/**\n * Event handler to suppress context menu.\n */\nfunction noContextMenu(e) {\n  e.preventDefault();\n}\n\n// Deprecated API function -- display regardless of the `verbosity` setting.\nfunction deprecated(details) {\n  console.log(\"Deprecated API usage: \" + details);\n}\n\nlet pdfDateStringRegex;\n\nclass PDFDateString {\n  /**\n   * Convert a PDF date string to a JavaScript `Date` object.\n   *\n   * The PDF date string format is described in section 7.9.4 of the official\n   * PDF 32000-1:2008 specification. However, in the PDF 1.7 reference (sixth\n   * edition) Adobe describes the same format including a trailing apostrophe.\n   * This syntax in incorrect, but Adobe Acrobat creates PDF files that contain\n   * them. We ignore all apostrophes as they are not necessary for date parsing.\n   *\n   * Moreover, Adobe Acrobat doesn't handle changing the date to universal time\n   * and doesn't use the user's time zone (effectively ignoring the HH' and mm'\n   * parts of the date string).\n   *\n   * @param {string} input\n   * @returns {Date|null}\n   */\n  static toDateObject(input) {\n    if (!input || typeof input !== \"string\") {\n      return null;\n    }\n\n    // Lazily initialize the regular expression.\n    pdfDateStringRegex ||= new RegExp(\n      \"^D:\" + // Prefix (required)\n        \"(\\\\d{4})\" + // Year (required)\n        \"(\\\\d{2})?\" + // Month (optional)\n        \"(\\\\d{2})?\" + // Day (optional)\n        \"(\\\\d{2})?\" + // Hour (optional)\n        \"(\\\\d{2})?\" + // Minute (optional)\n        \"(\\\\d{2})?\" + // Second (optional)\n        \"([Z|+|-])?\" + // Universal time relation (optional)\n        \"(\\\\d{2})?\" + // Offset hour (optional)\n        \"'?\" + // Splitting apostrophe (optional)\n        \"(\\\\d{2})?\" + // Offset minute (optional)\n        \"'?\" // Trailing apostrophe (optional)\n    );\n\n    // Optional fields that don't satisfy the requirements from the regular\n    // expression (such as incorrect digit counts or numbers that are out of\n    // range) will fall back the defaults from the specification.\n    const matches = pdfDateStringRegex.exec(input);\n    if (!matches) {\n      return null;\n    }\n\n    // JavaScript's `Date` object expects the month to be between 0 and 11\n    // instead of 1 and 12, so we have to correct for that.\n    const year = parseInt(matches[1], 10);\n    let month = parseInt(matches[2], 10);\n    month = month >= 1 && month <= 12 ? month - 1 : 0;\n    let day = parseInt(matches[3], 10);\n    day = day >= 1 && day <= 31 ? day : 1;\n    let hour = parseInt(matches[4], 10);\n    hour = hour >= 0 && hour <= 23 ? hour : 0;\n    let minute = parseInt(matches[5], 10);\n    minute = minute >= 0 && minute <= 59 ? minute : 0;\n    let second = parseInt(matches[6], 10);\n    second = second >= 0 && second <= 59 ? second : 0;\n    const universalTimeRelation = matches[7] || \"Z\";\n    let offsetHour = parseInt(matches[8], 10);\n    offsetHour = offsetHour >= 0 && offsetHour <= 23 ? offsetHour : 0;\n    let offsetMinute = parseInt(matches[9], 10) || 0;\n    offsetMinute = offsetMinute >= 0 && offsetMinute <= 59 ? offsetMinute : 0;\n\n    // Universal time relation 'Z' means that the local time is equal to the\n    // universal time, whereas the relations '+'/'-' indicate that the local\n    // time is later respectively earlier than the universal time. Every date\n    // is normalized to universal time.\n    if (universalTimeRelation === \"-\") {\n      hour += offsetHour;\n      minute += offsetMinute;\n    } else if (universalTimeRelation === \"+\") {\n      hour -= offsetHour;\n      minute -= offsetMinute;\n    }\n\n    return new Date(Date.UTC(year, month, day, hour, minute, second));\n  }\n}\n\n/**\n * NOTE: This is (mostly) intended to support printing of XFA forms.\n */\nfunction getXfaPageViewport(xfaPage, { scale = 1, rotation = 0 }) {\n  const { width, height } = xfaPage.attributes.style;\n  const viewBox = [0, 0, parseInt(width), parseInt(height)];\n\n  return new PageViewport({\n    viewBox,\n    scale,\n    rotation,\n  });\n}\n\nfunction getRGB(color) {\n  if (color.startsWith(\"#\")) {\n    const colorRGB = parseInt(color.slice(1), 16);\n    return [\n      (colorRGB & 0xff0000) >> 16,\n      (colorRGB & 0x00ff00) >> 8,\n      colorRGB & 0x0000ff,\n    ];\n  }\n\n  if (color.startsWith(\"rgb(\")) {\n    // getComputedStyle(...).color returns a `rgb(R, G, B)` color.\n    return color\n      .slice(/* \"rgb(\".length */ 4, -1) // Strip out \"rgb(\" and \")\".\n      .split(\",\")\n      .map(x => parseInt(x));\n  }\n\n  if (color.startsWith(\"rgba(\")) {\n    return color\n      .slice(/* \"rgba(\".length */ 5, -1) // Strip out \"rgba(\" and \")\".\n      .split(\",\")\n      .map(x => parseInt(x))\n      .slice(0, 3);\n  }\n\n  warn(`Not a valid color format: \"${color}\"`);\n  return [0, 0, 0];\n}\n\nfunction getColorValues(colors) {\n  const span = document.createElement(\"span\");\n  span.style.visibility = \"hidden\";\n  document.body.append(span);\n  for (const name of colors.keys()) {\n    span.style.color = name;\n    const computedColor = window.getComputedStyle(span).color;\n    colors.set(name, getRGB(computedColor));\n  }\n  span.remove();\n}\n\nfunction getCurrentTransform(ctx) {\n  const { a, b, c, d, e, f } = ctx.getTransform();\n  return [a, b, c, d, e, f];\n}\n\nfunction getCurrentTransformInverse(ctx) {\n  const { a, b, c, d, e, f } = ctx.getTransform().invertSelf();\n  return [a, b, c, d, e, f];\n}\n\n/**\n * @param {HTMLDivElement} div\n * @param {PageViewport} viewport\n * @param {boolean} mustFlip\n * @param {boolean} mustRotate\n */\nfunction setLayerDimensions(\n  div,\n  viewport,\n  mustFlip = false,\n  mustRotate = true\n) {\n  if (viewport instanceof PageViewport) {\n    const { pageWidth, pageHeight } = viewport.rawDims;\n    const { style } = div;\n    const useRound = FeatureTest.isCSSRoundSupported;\n\n    const w = `var(--scale-factor) * ${pageWidth}px`,\n      h = `var(--scale-factor) * ${pageHeight}px`;\n    const widthStr = useRound ? `round(${w}, 1px)` : `calc(${w})`,\n      heightStr = useRound ? `round(${h}, 1px)` : `calc(${h})`;\n\n    if (!mustFlip || viewport.rotation % 180 === 0) {\n      style.width = widthStr;\n      style.height = heightStr;\n    } else {\n      style.width = heightStr;\n      style.height = widthStr;\n    }\n  }\n\n  if (mustRotate) {\n    div.setAttribute(\"data-main-rotation\", viewport.rotation);\n  }\n}\n\nexport {\n  deprecated,\n  DOMCanvasFactory,\n  DOMCMapReaderFactory,\n  DOMFilterFactory,\n  DOMStandardFontDataFactory,\n  DOMSVGFactory,\n  fetchData,\n  getColorValues,\n  getCurrentTransform,\n  getCurrentTransformInverse,\n  getFilenameFromUrl,\n  getPdfFilenameFromUrl,\n  getRGB,\n  getXfaPageViewport,\n  isDataScheme,\n  isPdfFile,\n  isValidFetchUrl,\n  noContextMenu,\n  PageViewport,\n  PDFDateString,\n  PixelsPerInch,\n  RenderingCancelledException,\n  setLayerDimensions,\n  StatTimer,\n};\n","/* Copyright 2023 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DOMSVGFactory } from \"./display_utils.js\";\nimport { shadow } from \"../shared/util.js\";\n\n/**\n * Manage the SVGs drawn on top of the page canvas.\n * It's important to have them directly on top of the canvas because we want to\n * be able to use mix-blend-mode for some of them.\n */\nclass DrawLayer {\n  #parent = null;\n\n  #id = 0;\n\n  #mapping = new Map();\n\n  constructor({ pageIndex }) {\n    this.pageIndex = pageIndex;\n  }\n\n  setParent(parent) {\n    if (!this.#parent) {\n      this.#parent = parent;\n      return;\n    }\n\n    if (this.#parent !== parent) {\n      if (this.#mapping.size > 0) {\n        for (const root of this.#mapping.values()) {\n          root.remove();\n          parent.append(root);\n        }\n      }\n      this.#parent = parent;\n    }\n  }\n\n  static get _svgFactory() {\n    return shadow(this, \"_svgFactory\", new DOMSVGFactory());\n  }\n\n  static #setBox(element, { x, y, width, height }) {\n    const { style } = element;\n    style.top = `${100 * y}%`;\n    style.left = `${100 * x}%`;\n    style.width = `${100 * width}%`;\n    style.height = `${100 * height}%`;\n  }\n\n  #createSVG(box) {\n    const svg = DrawLayer._svgFactory.create(1, 1, /* skipDimensions = */ true);\n    this.#parent.append(svg);\n    DrawLayer.#setBox(svg, box);\n\n    return svg;\n  }\n\n  highlight({ outlines, box }, color, opacity) {\n    const id = this.#id++;\n    const root = this.#createSVG(box);\n    root.classList.add(\"highlight\");\n    const defs = DrawLayer._svgFactory.createElement(\"defs\");\n    root.append(defs);\n    const path = DrawLayer._svgFactory.createElement(\"path\");\n    defs.append(path);\n    const pathId = `path_p${this.pageIndex}_${id}`;\n    path.setAttribute(\"id\", pathId);\n    path.setAttribute(\n      \"d\",\n      DrawLayer.#extractPathFromHighlightOutlines(outlines)\n    );\n\n    // Create the clipping path for the editor div.\n    const clipPath = DrawLayer._svgFactory.createElement(\"clipPath\");\n    defs.append(clipPath);\n    const clipPathId = `clip_${pathId}`;\n    clipPath.setAttribute(\"id\", clipPathId);\n    clipPath.setAttribute(\"clipPathUnits\", \"objectBoundingBox\");\n    const clipPathUse = DrawLayer._svgFactory.createElement(\"use\");\n    clipPath.append(clipPathUse);\n    clipPathUse.setAttribute(\"href\", `#${pathId}`);\n    clipPathUse.classList.add(\"clip\");\n\n    const use = DrawLayer._svgFactory.createElement(\"use\");\n    root.append(use);\n    root.setAttribute(\"fill\", color);\n    root.setAttribute(\"fill-opacity\", opacity);\n    use.setAttribute(\"href\", `#${pathId}`);\n\n    this.#mapping.set(id, root);\n\n    return { id, clipPathId: `url(#${clipPathId})` };\n  }\n\n  highlightOutline({ outlines, box }) {\n    // We cannot draw the outline directly in the SVG for highlights because\n    // it composes with its parent with mix-blend-mode: multiply.\n    // But the outline has a different mix-blend-mode, so we need to draw it in\n    // its own SVG.\n    const id = this.#id++;\n    const root = this.#createSVG(box);\n    root.classList.add(\"highlightOutline\");\n    const defs = DrawLayer._svgFactory.createElement(\"defs\");\n    root.append(defs);\n    const path = DrawLayer._svgFactory.createElement(\"path\");\n    defs.append(path);\n    const pathId = `path_p${this.pageIndex}_${id}`;\n    path.setAttribute(\"id\", pathId);\n    path.setAttribute(\n      \"d\",\n      DrawLayer.#extractPathFromHighlightOutlines(outlines)\n    );\n    path.setAttribute(\"vector-effect\", \"non-scaling-stroke\");\n\n    const use1 = DrawLayer._svgFactory.createElement(\"use\");\n    root.append(use1);\n    use1.setAttribute(\"href\", `#${pathId}`);\n    const use2 = use1.cloneNode();\n    root.append(use2);\n    use1.classList.add(\"mainOutline\");\n    use2.classList.add(\"secondaryOutline\");\n\n    this.#mapping.set(id, root);\n\n    return id;\n  }\n\n  static #extractPathFromHighlightOutlines(polygons) {\n    const buffer = [];\n    for (const polygon of polygons) {\n      let [prevX, prevY] = polygon;\n      buffer.push(`M${prevX} ${prevY}`);\n      for (let i = 2; i < polygon.length; i += 2) {\n        const x = polygon[i];\n        const y = polygon[i + 1];\n        if (x === prevX) {\n          buffer.push(`V${y}`);\n          prevY = y;\n        } else if (y === prevY) {\n          buffer.push(`H${x}`);\n          prevX = x;\n        }\n      }\n      buffer.push(\"Z\");\n    }\n    return buffer.join(\" \");\n  }\n\n  updateBox(id, box) {\n    DrawLayer.#setBox(this.#mapping.get(id), box);\n  }\n\n  rotate(id, angle) {\n    this.#mapping.get(id).setAttribute(\"data-main-rotation\", angle);\n  }\n\n  changeColor(id, color) {\n    this.#mapping.get(id).setAttribute(\"fill\", color);\n  }\n\n  changeOpacity(id, opacity) {\n    this.#mapping.get(id).setAttribute(\"fill-opacity\", opacity);\n  }\n\n  addClass(id, className) {\n    this.#mapping.get(id).classList.add(className);\n  }\n\n  removeClass(id, className) {\n    this.#mapping.get(id).classList.remove(className);\n  }\n\n  remove(id) {\n    this.#mapping.get(id).remove();\n    this.#mapping.delete(id);\n  }\n\n  destroy() {\n    this.#parent = null;\n    for (const root of this.#mapping.values()) {\n      root.remove();\n    }\n    this.#mapping.clear();\n  }\n}\n\nexport { DrawLayer };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n  AnnotationEditorParamsType,\n  AnnotationEditorType,\n  assert,\n  LINE_FACTOR,\n  shadow,\n  Util,\n} from \"../../shared/util.js\";\nimport {\n  AnnotationEditorUIManager,\n  bindEvents,\n  KeyboardManager,\n} from \"./tools.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { FreeTextAnnotationElement } from \"../annotation_layer.js\";\n\n/**\n * Basic text editor in order to create a FreeTex annotation.\n */\nclass FreeTextEditor extends AnnotationEditor {\n  #boundEditorDivBlur = this.editorDivBlur.bind(this);\n\n  #boundEditorDivFocus = this.editorDivFocus.bind(this);\n\n  #boundEditorDivInput = this.editorDivInput.bind(this);\n\n  #boundEditorDivKeydown = this.editorDivKeydown.bind(this);\n\n  #color;\n\n  #content = \"\";\n\n  #editorDivId = `${this.id}-editor`;\n\n  #fontSize;\n\n  #initialData = null;\n\n  static _freeTextDefaultContent = \"\";\n\n  static _internalPadding = 0;\n\n  static _defaultColor = null;\n\n  static _defaultFontSize = 10;\n\n  static get _keyboardManager() {\n    const proto = FreeTextEditor.prototype;\n\n    const arrowChecker = self => self.isEmpty();\n\n    const small = AnnotationEditorUIManager.TRANSLATE_SMALL;\n    const big = AnnotationEditorUIManager.TRANSLATE_BIG;\n\n    return shadow(\n      this,\n      \"_keyboardManager\",\n      new KeyboardManager([\n        [\n          // Commit the text in case the user use ctrl+s to save the document.\n          // The event must bubble in order to be caught by the viewer.\n          // See bug 1831574.\n          [\"ctrl+s\", \"mac+meta+s\", \"ctrl+p\", \"mac+meta+p\"],\n          proto.commitOrRemove,\n          { bubbles: true },\n        ],\n        [\n          [\"ctrl+Enter\", \"mac+meta+Enter\", \"Escape\", \"mac+Escape\"],\n          proto.commitOrRemove,\n        ],\n        [\n          [\"ArrowLeft\", \"mac+ArrowLeft\"],\n          proto._translateEmpty,\n          { args: [-small, 0], checker: arrowChecker },\n        ],\n        [\n          [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n          proto._translateEmpty,\n          { args: [-big, 0], checker: arrowChecker },\n        ],\n        [\n          [\"ArrowRight\", \"mac+ArrowRight\"],\n          proto._translateEmpty,\n          { args: [small, 0], checker: arrowChecker },\n        ],\n        [\n          [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n          proto._translateEmpty,\n          { args: [big, 0], checker: arrowChecker },\n        ],\n        [\n          [\"ArrowUp\", \"mac+ArrowUp\"],\n          proto._translateEmpty,\n          { args: [0, -small], checker: arrowChecker },\n        ],\n        [\n          [\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"],\n          proto._translateEmpty,\n          { args: [0, -big], checker: arrowChecker },\n        ],\n        [\n          [\"ArrowDown\", \"mac+ArrowDown\"],\n          proto._translateEmpty,\n          { args: [0, small], checker: arrowChecker },\n        ],\n        [\n          [\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"],\n          proto._translateEmpty,\n          { args: [0, big], checker: arrowChecker },\n        ],\n      ])\n    );\n  }\n\n  static _type = \"freetext\";\n\n  static _editorType = AnnotationEditorType.FREETEXT;\n\n  constructor(params) {\n    super({ ...params, name: \"freeTextEditor\" });\n    this.#color =\n      params.color ||\n      FreeTextEditor._defaultColor ||\n      AnnotationEditor._defaultLineColor;\n    this.#fontSize = params.fontSize || FreeTextEditor._defaultFontSize;\n  }\n\n  /** @inheritdoc */\n  static initialize(l10n) {\n    AnnotationEditor.initialize(l10n, {\n      strings: [\"pdfjs-free-text-default-content\"],\n    });\n    const style = getComputedStyle(document.documentElement);\n\n    if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n      const lineHeight = parseFloat(\n        style.getPropertyValue(\"--freetext-line-height\")\n      );\n      assert(\n        lineHeight === LINE_FACTOR,\n        \"Update the CSS variable to agree with the constant.\"\n      );\n    }\n\n    this._internalPadding = parseFloat(\n      style.getPropertyValue(\"--freetext-padding\")\n    );\n  }\n\n  /** @inheritdoc */\n  static updateDefaultParams(type, value) {\n    switch (type) {\n      case AnnotationEditorParamsType.FREETEXT_SIZE:\n        FreeTextEditor._defaultFontSize = value;\n        break;\n      case AnnotationEditorParamsType.FREETEXT_COLOR:\n        FreeTextEditor._defaultColor = value;\n        break;\n    }\n  }\n\n  /** @inheritdoc */\n  updateParams(type, value) {\n    switch (type) {\n      case AnnotationEditorParamsType.FREETEXT_SIZE:\n        this.#updateFontSize(value);\n        break;\n      case AnnotationEditorParamsType.FREETEXT_COLOR:\n        this.#updateColor(value);\n        break;\n    }\n  }\n\n  /** @inheritdoc */\n  static get defaultPropertiesToUpdate() {\n    return [\n      [\n        AnnotationEditorParamsType.FREETEXT_SIZE,\n        FreeTextEditor._defaultFontSize,\n      ],\n      [\n        AnnotationEditorParamsType.FREETEXT_COLOR,\n        FreeTextEditor._defaultColor || AnnotationEditor._defaultLineColor,\n      ],\n    ];\n  }\n\n  /** @inheritdoc */\n  get propertiesToUpdate() {\n    return [\n      [AnnotationEditorParamsType.FREETEXT_SIZE, this.#fontSize],\n      [AnnotationEditorParamsType.FREETEXT_COLOR, this.#color],\n    ];\n  }\n\n  /**\n   * Update the font size and make this action as undoable.\n   * @param {number} fontSize\n   */\n  #updateFontSize(fontSize) {\n    const setFontsize = size => {\n      this.editorDiv.style.fontSize = `calc(${size}px * var(--scale-factor))`;\n      this.translate(0, -(size - this.#fontSize) * this.parentScale);\n      this.#fontSize = size;\n      this.#setEditorDimensions();\n    };\n    const savedFontsize = this.#fontSize;\n    this.addCommands({\n      cmd: () => {\n        setFontsize(fontSize);\n      },\n      undo: () => {\n        setFontsize(savedFontsize);\n      },\n      mustExec: true,\n      type: AnnotationEditorParamsType.FREETEXT_SIZE,\n      overwriteIfSameType: true,\n      keepUndo: true,\n    });\n  }\n\n  /**\n   * Update the color and make this action undoable.\n   * @param {string} color\n   */\n  #updateColor(color) {\n    const savedColor = this.#color;\n    this.addCommands({\n      cmd: () => {\n        this.#color = this.editorDiv.style.color = color;\n      },\n      undo: () => {\n        this.#color = this.editorDiv.style.color = savedColor;\n      },\n      mustExec: true,\n      type: AnnotationEditorParamsType.FREETEXT_COLOR,\n      overwriteIfSameType: true,\n      keepUndo: true,\n    });\n  }\n\n  /**\n   * Helper to translate the editor with the keyboard when it's empty.\n   * @param {number} x in page units.\n   * @param {number} y in page units.\n   */\n  _translateEmpty(x, y) {\n    this._uiManager.translateSelectedEditors(x, y, /* noCommit = */ true);\n  }\n\n  /** @inheritdoc */\n  getInitialTranslation() {\n    // The start of the base line is where the user clicked.\n    const scale = this.parentScale;\n    return [\n      -FreeTextEditor._internalPadding * scale,\n      -(FreeTextEditor._internalPadding + this.#fontSize) * scale,\n    ];\n  }\n\n  /** @inheritdoc */\n  rebuild() {\n    if (!this.parent) {\n      return;\n    }\n    super.rebuild();\n    if (this.div === null) {\n      return;\n    }\n\n    if (!this.isAttachedToDOM) {\n      // At some point this editor was removed and we're rebuilting it,\n      // hence we must add it to its parent.\n      this.parent.add(this);\n    }\n  }\n\n  /** @inheritdoc */\n  enableEditMode() {\n    if (this.isInEditMode()) {\n      return;\n    }\n\n    this.parent.setEditingState(false);\n    this.parent.updateToolbar(AnnotationEditorType.FREETEXT);\n    super.enableEditMode();\n    this.overlayDiv.classList.remove(\"enabled\");\n    this.editorDiv.contentEditable = true;\n    this._isDraggable = false;\n    this.div.removeAttribute(\"aria-activedescendant\");\n    this.editorDiv.addEventListener(\"keydown\", this.#boundEditorDivKeydown);\n    this.editorDiv.addEventListener(\"focus\", this.#boundEditorDivFocus);\n    this.editorDiv.addEventListener(\"blur\", this.#boundEditorDivBlur);\n    this.editorDiv.addEventListener(\"input\", this.#boundEditorDivInput);\n  }\n\n  /** @inheritdoc */\n  disableEditMode() {\n    if (!this.isInEditMode()) {\n      return;\n    }\n\n    this.parent.setEditingState(true);\n    super.disableEditMode();\n    this.overlayDiv.classList.add(\"enabled\");\n    this.editorDiv.contentEditable = false;\n    this.div.setAttribute(\"aria-activedescendant\", this.#editorDivId);\n    this._isDraggable = true;\n    this.editorDiv.removeEventListener(\"keydown\", this.#boundEditorDivKeydown);\n    this.editorDiv.removeEventListener(\"focus\", this.#boundEditorDivFocus);\n    this.editorDiv.removeEventListener(\"blur\", this.#boundEditorDivBlur);\n    this.editorDiv.removeEventListener(\"input\", this.#boundEditorDivInput);\n\n    // On Chrome, the focus is given to <body> when contentEditable is set to\n    // false, hence we focus the div.\n    this.div.focus({\n      preventScroll: true /* See issue #15744 */,\n    });\n\n    // In case the blur callback hasn't been called.\n    this.isEditing = false;\n    this.parent.div.classList.add(\"freetextEditing\");\n  }\n\n  /** @inheritdoc */\n  focusin(event) {\n    if (!this._focusEventsAllowed) {\n      return;\n    }\n    super.focusin(event);\n    if (event.target !== this.editorDiv) {\n      this.editorDiv.focus();\n    }\n  }\n\n  /** @inheritdoc */\n  onceAdded() {\n    if (this.width) {\n      this.#cheatInitialRect();\n      // The editor was created in using ctrl+c.\n      return;\n    }\n    this.enableEditMode();\n    this.editorDiv.focus();\n    if (this._initialOptions?.isCentered) {\n      this.center();\n    }\n    this._initialOptions = null;\n  }\n\n  /** @inheritdoc */\n  isEmpty() {\n    return !this.editorDiv || this.editorDiv.innerText.trim() === \"\";\n  }\n\n  /** @inheritdoc */\n  remove() {\n    this.isEditing = false;\n    if (this.parent) {\n      this.parent.setEditingState(true);\n      this.parent.div.classList.add(\"freetextEditing\");\n    }\n    super.remove();\n  }\n\n  /**\n   * Extract the text from this editor.\n   * @returns {string}\n   */\n  #extractText() {\n    const divs = this.editorDiv.getElementsByTagName(\"div\");\n    if (divs.length === 0) {\n      return this.editorDiv.innerText;\n    }\n    const buffer = [];\n    for (const div of divs) {\n      buffer.push(div.innerText.replace(/\\r\\n?|\\n/, \"\"));\n    }\n    return buffer.join(\"\\n\");\n  }\n\n  #setEditorDimensions() {\n    const [parentWidth, parentHeight] = this.parentDimensions;\n\n    let rect;\n    if (this.isAttachedToDOM) {\n      rect = this.div.getBoundingClientRect();\n    } else {\n      // This editor isn't on screen but we need to get its dimensions, so\n      // we just insert it in the DOM, get its bounding box and then remove it.\n      const { currentLayer, div } = this;\n      const savedDisplay = div.style.display;\n      div.style.display = \"hidden\";\n      currentLayer.div.append(this.div);\n      rect = div.getBoundingClientRect();\n      div.remove();\n      div.style.display = savedDisplay;\n    }\n\n    // The dimensions are relative to the rotation of the page, hence we need to\n    // take that into account (see issue #16636).\n    if (this.rotation % 180 === this.parentRotation % 180) {\n      this.width = rect.width / parentWidth;\n      this.height = rect.height / parentHeight;\n    } else {\n      this.width = rect.height / parentWidth;\n      this.height = rect.width / parentHeight;\n    }\n    this.fixAndSetPosition();\n  }\n\n  /**\n   * Commit the content we have in this editor.\n   * @returns {undefined}\n   */\n  commit() {\n    if (!this.isInEditMode()) {\n      return;\n    }\n\n    super.commit();\n    this.disableEditMode();\n    const savedText = this.#content;\n    const newText = (this.#content = this.#extractText().trimEnd());\n    if (savedText === newText) {\n      return;\n    }\n\n    const setText = text => {\n      this.#content = text;\n      if (!text) {\n        this.remove();\n        return;\n      }\n      this.#setContent();\n      this._uiManager.rebuild(this);\n      this.#setEditorDimensions();\n    };\n    this.addCommands({\n      cmd: () => {\n        setText(newText);\n      },\n      undo: () => {\n        setText(savedText);\n      },\n      mustExec: false,\n    });\n    this.#setEditorDimensions();\n  }\n\n  /** @inheritdoc */\n  shouldGetKeyboardEvents() {\n    return this.isInEditMode();\n  }\n\n  /** @inheritdoc */\n  enterInEditMode() {\n    this.enableEditMode();\n    this.editorDiv.focus();\n  }\n\n  /**\n   * ondblclick callback.\n   * @param {MouseEvent} event\n   */\n  dblclick(event) {\n    this.enterInEditMode();\n  }\n\n  /**\n   * onkeydown callback.\n   * @param {KeyboardEvent} event\n   */\n  keydown(event) {\n    if (event.target === this.div && event.key === \"Enter\") {\n      this.enterInEditMode();\n      // Avoid to add an unwanted new line.\n      event.preventDefault();\n    }\n  }\n\n  editorDivKeydown(event) {\n    FreeTextEditor._keyboardManager.exec(this, event);\n  }\n\n  editorDivFocus(event) {\n    this.isEditing = true;\n  }\n\n  editorDivBlur(event) {\n    this.isEditing = false;\n  }\n\n  editorDivInput(event) {\n    this.parent.div.classList.toggle(\"freetextEditing\", this.isEmpty());\n  }\n\n  /** @inheritdoc */\n  disableEditing() {\n    this.editorDiv.setAttribute(\"role\", \"comment\");\n    this.editorDiv.removeAttribute(\"aria-multiline\");\n  }\n\n  /** @inheritdoc */\n  enableEditing() {\n    this.editorDiv.setAttribute(\"role\", \"textbox\");\n    this.editorDiv.setAttribute(\"aria-multiline\", true);\n  }\n\n  /** @inheritdoc */\n  render() {\n    if (this.div) {\n      return this.div;\n    }\n\n    let baseX, baseY;\n    if (this.width) {\n      baseX = this.x;\n      baseY = this.y;\n    }\n\n    super.render();\n    this.editorDiv = document.createElement(\"div\");\n    this.editorDiv.className = \"internal\";\n\n    this.editorDiv.setAttribute(\"id\", this.#editorDivId);\n    this.editorDiv.setAttribute(\"data-l10n-id\", \"pdfjs-free-text\");\n    this.enableEditing();\n\n    AnnotationEditor._l10nPromise\n      .get(\"pdfjs-free-text-default-content\")\n      .then(msg => this.editorDiv?.setAttribute(\"default-content\", msg));\n    this.editorDiv.contentEditable = true;\n\n    const { style } = this.editorDiv;\n    style.fontSize = `calc(${this.#fontSize}px * var(--scale-factor))`;\n    style.color = this.#color;\n\n    this.div.append(this.editorDiv);\n\n    this.overlayDiv = document.createElement(\"div\");\n    this.overlayDiv.classList.add(\"overlay\", \"enabled\");\n    this.div.append(this.overlayDiv);\n\n    // TODO: implement paste callback.\n    // The goal is to sanitize and have something suitable for this\n    // editor.\n    bindEvents(this, this.div, [\"dblclick\", \"keydown\"]);\n\n    if (this.width) {\n      // This editor was created in using copy (ctrl+c).\n      const [parentWidth, parentHeight] = this.parentDimensions;\n      if (this.annotationElementId) {\n        // This stuff is hard to test: if something is changed here, please\n        // test with the following PDF file:\n        //  - freetexts.pdf\n        //  - rotated_freetexts.pdf\n        // Only small variations between the original annotation and its editor\n        // are allowed.\n\n        // position is the position of the first glyph in the annotation\n        // and it's relative to its container.\n        const { position } = this.#initialData;\n        let [tx, ty] = this.getInitialTranslation();\n        [tx, ty] = this.pageTranslationToScreen(tx, ty);\n        const [pageWidth, pageHeight] = this.pageDimensions;\n        const [pageX, pageY] = this.pageTranslation;\n        let posX, posY;\n        switch (this.rotation) {\n          case 0:\n            posX = baseX + (position[0] - pageX) / pageWidth;\n            posY = baseY + this.height - (position[1] - pageY) / pageHeight;\n            break;\n          case 90:\n            posX = baseX + (position[0] - pageX) / pageWidth;\n            posY = baseY - (position[1] - pageY) / pageHeight;\n            [tx, ty] = [ty, -tx];\n            break;\n          case 180:\n            posX = baseX - this.width + (position[0] - pageX) / pageWidth;\n            posY = baseY - (position[1] - pageY) / pageHeight;\n            [tx, ty] = [-tx, -ty];\n            break;\n          case 270:\n            posX =\n              baseX +\n              (position[0] - pageX - this.height * pageHeight) / pageWidth;\n            posY =\n              baseY +\n              (position[1] - pageY - this.width * pageWidth) / pageHeight;\n            [tx, ty] = [-ty, tx];\n            break;\n        }\n        this.setAt(posX * parentWidth, posY * parentHeight, tx, ty);\n      } else {\n        this.setAt(\n          baseX * parentWidth,\n          baseY * parentHeight,\n          this.width * parentWidth,\n          this.height * parentHeight\n        );\n      }\n\n      this.#setContent();\n      this._isDraggable = true;\n      this.editorDiv.contentEditable = false;\n    } else {\n      this._isDraggable = false;\n      this.editorDiv.contentEditable = true;\n    }\n\n    if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n      this.div.setAttribute(\"annotation-id\", this.annotationElementId);\n    }\n\n    return this.div;\n  }\n\n  #setContent() {\n    this.editorDiv.replaceChildren();\n    if (!this.#content) {\n      return;\n    }\n    for (const line of this.#content.split(\"\\n\")) {\n      const div = document.createElement(\"div\");\n      div.append(\n        line ? document.createTextNode(line) : document.createElement(\"br\")\n      );\n      this.editorDiv.append(div);\n    }\n  }\n\n  /** @inheritdoc */\n  get contentDiv() {\n    return this.editorDiv;\n  }\n\n  /** @inheritdoc */\n  static deserialize(data, parent, uiManager) {\n    let initialData = null;\n    if (data instanceof FreeTextAnnotationElement) {\n      const {\n        data: {\n          defaultAppearanceData: { fontSize, fontColor },\n          rect,\n          rotation,\n          id,\n        },\n        textContent,\n        textPosition,\n        parent: {\n          page: { pageNumber },\n        },\n      } = data;\n      // textContent is supposed to be an array of strings containing each line\n      // of text. However, it can be null or empty.\n      if (!textContent || textContent.length === 0) {\n        // Empty annotation.\n        return null;\n      }\n      initialData = data = {\n        annotationType: AnnotationEditorType.FREETEXT,\n        color: Array.from(fontColor),\n        fontSize,\n        value: textContent.join(\"\\n\"),\n        position: textPosition,\n        pageIndex: pageNumber - 1,\n        rect,\n        rotation,\n        id,\n        deleted: false,\n      };\n    }\n    const editor = super.deserialize(data, parent, uiManager);\n\n    editor.#fontSize = data.fontSize;\n    editor.#color = Util.makeHexColor(...data.color);\n    editor.#content = data.value;\n    editor.annotationElementId = data.id || null;\n    editor.#initialData = initialData;\n\n    return editor;\n  }\n\n  /** @inheritdoc */\n  serialize(isForCopying = false) {\n    if (this.isEmpty()) {\n      return null;\n    }\n\n    if (this.deleted) {\n      return {\n        pageIndex: this.pageIndex,\n        id: this.annotationElementId,\n        deleted: true,\n      };\n    }\n\n    const padding = FreeTextEditor._internalPadding * this.parentScale;\n    const rect = this.getRect(padding, padding);\n    const color = AnnotationEditor._colorManager.convert(\n      this.isAttachedToDOM\n        ? getComputedStyle(this.editorDiv).color\n        : this.#color\n    );\n\n    const serialized = {\n      annotationType: AnnotationEditorType.FREETEXT,\n      color,\n      fontSize: this.#fontSize,\n      value: this.#content,\n      pageIndex: this.pageIndex,\n      rect,\n      rotation: this.rotation,\n      structTreeParentId: this._structTreeParentId,\n    };\n\n    if (isForCopying) {\n      // Don't add the id when copying because the pasted editor mustn't be\n      // linked to an existing annotation.\n      return serialized;\n    }\n\n    if (this.annotationElementId && !this.#hasElementChanged(serialized)) {\n      return null;\n    }\n\n    serialized.id = this.annotationElementId;\n\n    return serialized;\n  }\n\n  #hasElementChanged(serialized) {\n    const { value, fontSize, color, rect, pageIndex } = this.#initialData;\n\n    return (\n      serialized.value !== value ||\n      serialized.fontSize !== fontSize ||\n      serialized.rect.some((x, i) => Math.abs(x - rect[i]) >= 1) ||\n      serialized.color.some((c, i) => c !== color[i]) ||\n      serialized.pageIndex !== pageIndex\n    );\n  }\n\n  #cheatInitialRect(delayed = false) {\n    // The annotation has a rect but the editor has an other one.\n    // When we want to know if the annotation has changed (e.g. has been moved)\n    // we must compare the editor initial rect with the current one.\n    // So this method is a hack to have a way to compare the real rects.\n    if (!this.annotationElementId) {\n      return;\n    }\n\n    this.#setEditorDimensions();\n    if (!delayed && (this.width === 0 || this.height === 0)) {\n      setTimeout(() => this.#cheatInitialRect(/* delayed = */ true), 0);\n      return;\n    }\n\n    const padding = FreeTextEditor._internalPadding * this.parentScale;\n    this.#initialData.rect = this.getRect(padding, padding);\n  }\n}\n\nexport { FreeTextEditor };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  AnnotationEditorParamsType,\n  AnnotationEditorType,\n  Util,\n} from \"../../shared/util.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { InkAnnotationElement } from \"../annotation_layer.js\";\nimport { noContextMenu } from \"../display_utils.js\";\nimport { opacityToHex } from \"./tools.js\";\n\n/**\n * Basic draw editor in order to generate an Ink annotation.\n */\nclass InkEditor extends AnnotationEditor {\n  #baseHeight = 0;\n\n  #baseWidth = 0;\n\n  #boundCanvasPointermove = this.canvasPointermove.bind(this);\n\n  #boundCanvasPointerleave = this.canvasPointerleave.bind(this);\n\n  #boundCanvasPointerup = this.canvasPointerup.bind(this);\n\n  #boundCanvasPointerdown = this.canvasPointerdown.bind(this);\n\n  #canvasContextMenuTimeoutId = null;\n\n  #currentPath2D = new Path2D();\n\n  #disableEditing = false;\n\n  #hasSomethingToDraw = false;\n\n  #isCanvasInitialized = false;\n\n  #observer = null;\n\n  #realWidth = 0;\n\n  #realHeight = 0;\n\n  #requestFrameCallback = null;\n\n  static _defaultColor = null;\n\n  static _defaultOpacity = 1;\n\n  static _defaultThickness = 1;\n\n  static _type = \"ink\";\n\n  static _editorType = AnnotationEditorType.INK;\n\n  constructor(params) {\n    super({ ...params, name: \"inkEditor\" });\n    this.color = params.color || null;\n    this.thickness = params.thickness || null;\n    this.opacity = params.opacity || null;\n    this.paths = [];\n    this.bezierPath2D = [];\n    this.allRawPaths = [];\n    this.currentPath = [];\n    this.scaleFactor = 1;\n    this.translationX = this.translationY = 0;\n    this.x = 0;\n    this.y = 0;\n    this._willKeepAspectRatio = true;\n  }\n\n  /** @inheritdoc */\n  static initialize(l10n) {\n    AnnotationEditor.initialize(l10n);\n  }\n\n  /** @inheritdoc */\n  static updateDefaultParams(type, value) {\n    switch (type) {\n      case AnnotationEditorParamsType.INK_THICKNESS:\n        InkEditor._defaultThickness = value;\n        break;\n      case AnnotationEditorParamsType.INK_COLOR:\n        InkEditor._defaultColor = value;\n        break;\n      case AnnotationEditorParamsType.INK_OPACITY:\n        InkEditor._defaultOpacity = value / 100;\n        break;\n    }\n  }\n\n  /** @inheritdoc */\n  updateParams(type, value) {\n    switch (type) {\n      case AnnotationEditorParamsType.INK_THICKNESS:\n        this.#updateThickness(value);\n        break;\n      case AnnotationEditorParamsType.INK_COLOR:\n        this.#updateColor(value);\n        break;\n      case AnnotationEditorParamsType.INK_OPACITY:\n        this.#updateOpacity(value);\n        break;\n    }\n  }\n\n  /** @inheritdoc */\n  static get defaultPropertiesToUpdate() {\n    return [\n      [AnnotationEditorParamsType.INK_THICKNESS, InkEditor._defaultThickness],\n      [\n        AnnotationEditorParamsType.INK_COLOR,\n        InkEditor._defaultColor || AnnotationEditor._defaultLineColor,\n      ],\n      [\n        AnnotationEditorParamsType.INK_OPACITY,\n        Math.round(InkEditor._defaultOpacity * 100),\n      ],\n    ];\n  }\n\n  /** @inheritdoc */\n  get propertiesToUpdate() {\n    return [\n      [\n        AnnotationEditorParamsType.INK_THICKNESS,\n        this.thickness || InkEditor._defaultThickness,\n      ],\n      [\n        AnnotationEditorParamsType.INK_COLOR,\n        this.color ||\n          InkEditor._defaultColor ||\n          AnnotationEditor._defaultLineColor,\n      ],\n      [\n        AnnotationEditorParamsType.INK_OPACITY,\n        Math.round(100 * (this.opacity ?? InkEditor._defaultOpacity)),\n      ],\n    ];\n  }\n\n  /**\n   * Update the thickness and make this action undoable.\n   * @param {number} thickness\n   */\n  #updateThickness(thickness) {\n    const savedThickness = this.thickness;\n    this.addCommands({\n      cmd: () => {\n        this.thickness = thickness;\n        this.#fitToContent();\n      },\n      undo: () => {\n        this.thickness = savedThickness;\n        this.#fitToContent();\n      },\n      mustExec: true,\n      type: AnnotationEditorParamsType.INK_THICKNESS,\n      overwriteIfSameType: true,\n      keepUndo: true,\n    });\n  }\n\n  /**\n   * Update the color and make this action undoable.\n   * @param {string} color\n   */\n  #updateColor(color) {\n    const savedColor = this.color;\n    this.addCommands({\n      cmd: () => {\n        this.color = color;\n        this.#redraw();\n      },\n      undo: () => {\n        this.color = savedColor;\n        this.#redraw();\n      },\n      mustExec: true,\n      type: AnnotationEditorParamsType.INK_COLOR,\n      overwriteIfSameType: true,\n      keepUndo: true,\n    });\n  }\n\n  /**\n   * Update the opacity and make this action undoable.\n   * @param {number} opacity\n   */\n  #updateOpacity(opacity) {\n    opacity /= 100;\n    const savedOpacity = this.opacity;\n    this.addCommands({\n      cmd: () => {\n        this.opacity = opacity;\n        this.#redraw();\n      },\n      undo: () => {\n        this.opacity = savedOpacity;\n        this.#redraw();\n      },\n      mustExec: true,\n      type: AnnotationEditorParamsType.INK_OPACITY,\n      overwriteIfSameType: true,\n      keepUndo: true,\n    });\n  }\n\n  /** @inheritdoc */\n  rebuild() {\n    if (!this.parent) {\n      return;\n    }\n    super.rebuild();\n    if (this.div === null) {\n      return;\n    }\n\n    if (!this.canvas) {\n      this.#createCanvas();\n      this.#createObserver();\n    }\n\n    if (!this.isAttachedToDOM) {\n      // At some point this editor was removed and we're rebuilding it,\n      // hence we must add it to its parent.\n      this.parent.add(this);\n      this.#setCanvasDims();\n    }\n    this.#fitToContent();\n  }\n\n  /** @inheritdoc */\n  remove() {\n    if (this.canvas === null) {\n      return;\n    }\n\n    if (!this.isEmpty()) {\n      this.commit();\n    }\n\n    // Destroy the canvas.\n    this.canvas.width = this.canvas.height = 0;\n    this.canvas.remove();\n    this.canvas = null;\n\n    if (this.#canvasContextMenuTimeoutId) {\n      clearTimeout(this.#canvasContextMenuTimeoutId);\n      this.#canvasContextMenuTimeoutId = null;\n    }\n\n    this.#observer.disconnect();\n    this.#observer = null;\n\n    super.remove();\n  }\n\n  setParent(parent) {\n    if (!this.parent && parent) {\n      // We've a parent hence the rescale will be handled thanks to the\n      // ResizeObserver.\n      this._uiManager.removeShouldRescale(this);\n    } else if (this.parent && parent === null) {\n      // The editor is removed from the DOM, hence we handle the rescale thanks\n      // to the onScaleChanging callback.\n      // This way, it'll be saved/printed correctly.\n      this._uiManager.addShouldRescale(this);\n    }\n    super.setParent(parent);\n  }\n\n  onScaleChanging() {\n    const [parentWidth, parentHeight] = this.parentDimensions;\n    const width = this.width * parentWidth;\n    const height = this.height * parentHeight;\n    this.setDimensions(width, height);\n  }\n\n  /** @inheritdoc */\n  enableEditMode() {\n    if (this.#disableEditing || this.canvas === null) {\n      return;\n    }\n\n    super.enableEditMode();\n    this._isDraggable = false;\n    this.canvas.addEventListener(\"pointerdown\", this.#boundCanvasPointerdown);\n  }\n\n  /** @inheritdoc */\n  disableEditMode() {\n    if (!this.isInEditMode() || this.canvas === null) {\n      return;\n    }\n\n    super.disableEditMode();\n    this._isDraggable = !this.isEmpty();\n    this.div.classList.remove(\"editing\");\n\n    this.canvas.removeEventListener(\n      \"pointerdown\",\n      this.#boundCanvasPointerdown\n    );\n  }\n\n  /** @inheritdoc */\n  onceAdded() {\n    this._isDraggable = !this.isEmpty();\n  }\n\n  /** @inheritdoc */\n  isEmpty() {\n    return (\n      this.paths.length === 0 ||\n      (this.paths.length === 1 && this.paths[0].length === 0)\n    );\n  }\n\n  #getInitialBBox() {\n    const {\n      parentRotation,\n      parentDimensions: [width, height],\n    } = this;\n    switch (parentRotation) {\n      case 90:\n        return [0, height, height, width];\n      case 180:\n        return [width, height, width, height];\n      case 270:\n        return [width, 0, height, width];\n      default:\n        return [0, 0, width, height];\n    }\n  }\n\n  /**\n   * Set line styles.\n   */\n  #setStroke() {\n    const { ctx, color, opacity, thickness, parentScale, scaleFactor } = this;\n    ctx.lineWidth = (thickness * parentScale) / scaleFactor;\n    ctx.lineCap = \"round\";\n    ctx.lineJoin = \"round\";\n    ctx.miterLimit = 10;\n    ctx.strokeStyle = `${color}${opacityToHex(opacity)}`;\n  }\n\n  /**\n   * Start to draw on the canvas.\n   * @param {number} x\n   * @param {number} y\n   */\n  #startDrawing(x, y) {\n    this.canvas.addEventListener(\"contextmenu\", noContextMenu);\n    this.canvas.addEventListener(\"pointerleave\", this.#boundCanvasPointerleave);\n    this.canvas.addEventListener(\"pointermove\", this.#boundCanvasPointermove);\n    this.canvas.addEventListener(\"pointerup\", this.#boundCanvasPointerup);\n    this.canvas.removeEventListener(\n      \"pointerdown\",\n      this.#boundCanvasPointerdown\n    );\n\n    this.isEditing = true;\n    if (!this.#isCanvasInitialized) {\n      this.#isCanvasInitialized = true;\n      this.#setCanvasDims();\n      this.thickness ||= InkEditor._defaultThickness;\n      this.color ||=\n        InkEditor._defaultColor || AnnotationEditor._defaultLineColor;\n      this.opacity ??= InkEditor._defaultOpacity;\n    }\n    this.currentPath.push([x, y]);\n    this.#hasSomethingToDraw = false;\n    this.#setStroke();\n\n    this.#requestFrameCallback = () => {\n      this.#drawPoints();\n      if (this.#requestFrameCallback) {\n        window.requestAnimationFrame(this.#requestFrameCallback);\n      }\n    };\n    window.requestAnimationFrame(this.#requestFrameCallback);\n  }\n\n  /**\n   * Draw on the canvas.\n   * @param {number} x\n   * @param {number} y\n   */\n  #draw(x, y) {\n    const [lastX, lastY] = this.currentPath.at(-1);\n    if (this.currentPath.length > 1 && x === lastX && y === lastY) {\n      return;\n    }\n    const currentPath = this.currentPath;\n    let path2D = this.#currentPath2D;\n    currentPath.push([x, y]);\n    this.#hasSomethingToDraw = true;\n\n    if (currentPath.length <= 2) {\n      path2D.moveTo(...currentPath[0]);\n      path2D.lineTo(x, y);\n      return;\n    }\n\n    if (currentPath.length === 3) {\n      this.#currentPath2D = path2D = new Path2D();\n      path2D.moveTo(...currentPath[0]);\n    }\n\n    this.#makeBezierCurve(\n      path2D,\n      ...currentPath.at(-3),\n      ...currentPath.at(-2),\n      x,\n      y\n    );\n  }\n\n  #endPath() {\n    if (this.currentPath.length === 0) {\n      return;\n    }\n    const lastPoint = this.currentPath.at(-1);\n    this.#currentPath2D.lineTo(...lastPoint);\n  }\n\n  /**\n   * Stop to draw on the canvas.\n   * @param {number} x\n   * @param {number} y\n   */\n  #stopDrawing(x, y) {\n    this.#requestFrameCallback = null;\n\n    x = Math.min(Math.max(x, 0), this.canvas.width);\n    y = Math.min(Math.max(y, 0), this.canvas.height);\n\n    this.#draw(x, y);\n    this.#endPath();\n\n    // Interpolate the path entered by the user with some\n    // Bezier's curves in order to have a smoother path and\n    // to reduce the data size used to draw it in the PDF.\n    let bezier;\n    if (this.currentPath.length !== 1) {\n      bezier = this.#generateBezierPoints();\n    } else {\n      // We have only one point finally.\n      const xy = [x, y];\n      bezier = [[xy, xy.slice(), xy.slice(), xy]];\n    }\n    const path2D = this.#currentPath2D;\n    const currentPath = this.currentPath;\n    this.currentPath = [];\n    this.#currentPath2D = new Path2D();\n\n    const cmd = () => {\n      this.allRawPaths.push(currentPath);\n      this.paths.push(bezier);\n      this.bezierPath2D.push(path2D);\n      this.rebuild();\n    };\n\n    const undo = () => {\n      this.allRawPaths.pop();\n      this.paths.pop();\n      this.bezierPath2D.pop();\n      if (this.paths.length === 0) {\n        this.remove();\n      } else {\n        if (!this.canvas) {\n          this.#createCanvas();\n          this.#createObserver();\n        }\n        this.#fitToContent();\n      }\n    };\n\n    this.addCommands({ cmd, undo, mustExec: true });\n  }\n\n  #drawPoints() {\n    if (!this.#hasSomethingToDraw) {\n      return;\n    }\n    this.#hasSomethingToDraw = false;\n\n    const thickness = Math.ceil(this.thickness * this.parentScale);\n    const lastPoints = this.currentPath.slice(-3);\n    const x = lastPoints.map(xy => xy[0]);\n    const y = lastPoints.map(xy => xy[1]);\n    const xMin = Math.min(...x) - thickness;\n    const xMax = Math.max(...x) + thickness;\n    const yMin = Math.min(...y) - thickness;\n    const yMax = Math.max(...y) + thickness;\n\n    const { ctx } = this;\n    ctx.save();\n\n    if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n      // In Chrome, the clip() method doesn't work as expected.\n      ctx.clearRect(xMin, yMin, xMax - xMin, yMax - yMin);\n      ctx.beginPath();\n      ctx.rect(xMin, yMin, xMax - xMin, yMax - yMin);\n      ctx.clip();\n    } else {\n      ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n    }\n\n    for (const path of this.bezierPath2D) {\n      ctx.stroke(path);\n    }\n    ctx.stroke(this.#currentPath2D);\n\n    ctx.restore();\n  }\n\n  #makeBezierCurve(path2D, x0, y0, x1, y1, x2, y2) {\n    const prevX = (x0 + x1) / 2;\n    const prevY = (y0 + y1) / 2;\n    const x3 = (x1 + x2) / 2;\n    const y3 = (y1 + y2) / 2;\n\n    path2D.bezierCurveTo(\n      prevX + (2 * (x1 - prevX)) / 3,\n      prevY + (2 * (y1 - prevY)) / 3,\n      x3 + (2 * (x1 - x3)) / 3,\n      y3 + (2 * (y1 - y3)) / 3,\n      x3,\n      y3\n    );\n  }\n\n  #generateBezierPoints() {\n    const path = this.currentPath;\n    if (path.length <= 2) {\n      return [[path[0], path[0], path.at(-1), path.at(-1)]];\n    }\n\n    const bezierPoints = [];\n    let i;\n    let [x0, y0] = path[0];\n    for (i = 1; i < path.length - 2; i++) {\n      const [x1, y1] = path[i];\n      const [x2, y2] = path[i + 1];\n      const x3 = (x1 + x2) / 2;\n      const y3 = (y1 + y2) / 2;\n\n      // The quadratic is: [[x0, y0], [x1, y1], [x3, y3]].\n      // Convert the quadratic to a cubic\n      // (see https://fontforge.org/docs/techref/bezier.html#converting-truetype-to-postscript)\n      const control1 = [x0 + (2 * (x1 - x0)) / 3, y0 + (2 * (y1 - y0)) / 3];\n      const control2 = [x3 + (2 * (x1 - x3)) / 3, y3 + (2 * (y1 - y3)) / 3];\n\n      bezierPoints.push([[x0, y0], control1, control2, [x3, y3]]);\n\n      [x0, y0] = [x3, y3];\n    }\n\n    const [x1, y1] = path[i];\n    const [x2, y2] = path[i + 1];\n\n    // The quadratic is: [[x0, y0], [x1, y1], [x2, y2]].\n    const control1 = [x0 + (2 * (x1 - x0)) / 3, y0 + (2 * (y1 - y0)) / 3];\n    const control2 = [x2 + (2 * (x1 - x2)) / 3, y2 + (2 * (y1 - y2)) / 3];\n\n    bezierPoints.push([[x0, y0], control1, control2, [x2, y2]]);\n    return bezierPoints;\n  }\n\n  /**\n   * Redraw all the paths.\n   */\n  #redraw() {\n    if (this.isEmpty()) {\n      this.#updateTransform();\n      return;\n    }\n    this.#setStroke();\n\n    const { canvas, ctx } = this;\n    ctx.setTransform(1, 0, 0, 1, 0, 0);\n    ctx.clearRect(0, 0, canvas.width, canvas.height);\n    this.#updateTransform();\n\n    for (const path of this.bezierPath2D) {\n      ctx.stroke(path);\n    }\n  }\n\n  /**\n   * Commit the curves we have in this editor.\n   */\n  commit() {\n    if (this.#disableEditing) {\n      return;\n    }\n\n    super.commit();\n\n    this.isEditing = false;\n    this.disableEditMode();\n\n    // This editor must be on top of the main ink editor.\n    this.setInForeground();\n\n    this.#disableEditing = true;\n    this.div.classList.add(\"disabled\");\n\n    this.#fitToContent(/* firstTime = */ true);\n    this.select();\n\n    this.parent.addInkEditorIfNeeded(/* isCommitting = */ true);\n\n    // When commiting, the position of this editor is changed, hence we must\n    // move it to the right position in the DOM.\n    this.moveInDOM();\n    this.div.focus({\n      preventScroll: true /* See issue #15744 */,\n    });\n  }\n\n  /** @inheritdoc */\n  focusin(event) {\n    if (!this._focusEventsAllowed) {\n      return;\n    }\n    super.focusin(event);\n    this.enableEditMode();\n  }\n\n  /**\n   * onpointerdown callback for the canvas we're drawing on.\n   * @param {PointerEvent} event\n   */\n  canvasPointerdown(event) {\n    if (event.button !== 0 || !this.isInEditMode() || this.#disableEditing) {\n      return;\n    }\n\n    // We want to draw on top of any other editors.\n    // Since it's the last child, there's no need to give it a higher z-index.\n    this.setInForeground();\n\n    event.preventDefault();\n\n    if (\n      event.pointerType !== \"mouse\" &&\n      !this.div.contains(document.activeElement)\n    ) {\n      this.div.focus({\n        preventScroll: true /* See issue #17327 */,\n      });\n    }\n\n    this.#startDrawing(event.offsetX, event.offsetY);\n  }\n\n  /**\n   * onpointermove callback for the canvas we're drawing on.\n   * @param {PointerEvent} event\n   */\n  canvasPointermove(event) {\n    event.preventDefault();\n    this.#draw(event.offsetX, event.offsetY);\n  }\n\n  /**\n   * onpointerup callback for the canvas we're drawing on.\n   * @param {PointerEvent} event\n   */\n  canvasPointerup(event) {\n    event.preventDefault();\n    this.#endDrawing(event);\n  }\n\n  /**\n   * onpointerleave callback for the canvas we're drawing on.\n   * @param {PointerEvent} event\n   */\n  canvasPointerleave(event) {\n    this.#endDrawing(event);\n  }\n\n  /**\n   * End the drawing.\n   * @param {PointerEvent} event\n   */\n  #endDrawing(event) {\n    this.canvas.removeEventListener(\n      \"pointerleave\",\n      this.#boundCanvasPointerleave\n    );\n    this.canvas.removeEventListener(\n      \"pointermove\",\n      this.#boundCanvasPointermove\n    );\n    this.canvas.removeEventListener(\"pointerup\", this.#boundCanvasPointerup);\n    this.canvas.addEventListener(\"pointerdown\", this.#boundCanvasPointerdown);\n\n    // Slight delay to avoid the context menu to appear (it can happen on a long\n    // tap with a pen).\n    if (this.#canvasContextMenuTimeoutId) {\n      clearTimeout(this.#canvasContextMenuTimeoutId);\n    }\n    this.#canvasContextMenuTimeoutId = setTimeout(() => {\n      this.#canvasContextMenuTimeoutId = null;\n      this.canvas.removeEventListener(\"contextmenu\", noContextMenu);\n    }, 10);\n\n    this.#stopDrawing(event.offsetX, event.offsetY);\n\n    this.addToAnnotationStorage();\n\n    // Since the ink editor covers all of the page and we want to be able\n    // to select another editor, we just put this one in the background.\n    this.setInBackground();\n  }\n\n  /**\n   * Create the canvas element.\n   */\n  #createCanvas() {\n    this.canvas = document.createElement(\"canvas\");\n    this.canvas.width = this.canvas.height = 0;\n    this.canvas.className = \"inkEditorCanvas\";\n    this.canvas.setAttribute(\"data-l10n-id\", \"pdfjs-ink-canvas\");\n\n    this.div.append(this.canvas);\n    this.ctx = this.canvas.getContext(\"2d\");\n  }\n\n  /**\n   * Create the resize observer.\n   */\n  #createObserver() {\n    this.#observer = new ResizeObserver(entries => {\n      const rect = entries[0].contentRect;\n      if (rect.width && rect.height) {\n        this.setDimensions(rect.width, rect.height);\n      }\n    });\n    this.#observer.observe(this.div);\n  }\n\n  /** @inheritdoc */\n  get isResizable() {\n    return !this.isEmpty() && this.#disableEditing;\n  }\n\n  /** @inheritdoc */\n  render() {\n    if (this.div) {\n      return this.div;\n    }\n\n    let baseX, baseY;\n    if (this.width) {\n      baseX = this.x;\n      baseY = this.y;\n    }\n\n    super.render();\n\n    this.div.setAttribute(\"data-l10n-id\", \"pdfjs-ink\");\n\n    const [x, y, w, h] = this.#getInitialBBox();\n    this.setAt(x, y, 0, 0);\n    this.setDims(w, h);\n\n    this.#createCanvas();\n\n    if (this.width) {\n      // This editor was created in using copy (ctrl+c).\n      const [parentWidth, parentHeight] = this.parentDimensions;\n      this.setAspectRatio(this.width * parentWidth, this.height * parentHeight);\n      this.setAt(\n        baseX * parentWidth,\n        baseY * parentHeight,\n        this.width * parentWidth,\n        this.height * parentHeight\n      );\n      this.#isCanvasInitialized = true;\n      this.#setCanvasDims();\n      this.setDims(this.width * parentWidth, this.height * parentHeight);\n      this.#redraw();\n      this.div.classList.add(\"disabled\");\n    } else {\n      this.div.classList.add(\"editing\");\n      this.enableEditMode();\n    }\n\n    this.#createObserver();\n\n    return this.div;\n  }\n\n  #setCanvasDims() {\n    if (!this.#isCanvasInitialized) {\n      return;\n    }\n    const [parentWidth, parentHeight] = this.parentDimensions;\n    this.canvas.width = Math.ceil(this.width * parentWidth);\n    this.canvas.height = Math.ceil(this.height * parentHeight);\n    this.#updateTransform();\n  }\n\n  /**\n   * When the dimensions of the div change the inner canvas must\n   * renew its dimensions, hence it must redraw its own contents.\n   * @param {number} width - the new width of the div\n   * @param {number} height - the new height of the div\n   * @returns\n   */\n  setDimensions(width, height) {\n    const roundedWidth = Math.round(width);\n    const roundedHeight = Math.round(height);\n    if (\n      this.#realWidth === roundedWidth &&\n      this.#realHeight === roundedHeight\n    ) {\n      return;\n    }\n\n    this.#realWidth = roundedWidth;\n    this.#realHeight = roundedHeight;\n\n    this.canvas.style.visibility = \"hidden\";\n\n    const [parentWidth, parentHeight] = this.parentDimensions;\n    this.width = width / parentWidth;\n    this.height = height / parentHeight;\n    this.fixAndSetPosition();\n\n    if (this.#disableEditing) {\n      this.#setScaleFactor(width, height);\n    }\n\n    this.#setCanvasDims();\n    this.#redraw();\n\n    this.canvas.style.visibility = \"visible\";\n\n    // For any reason the dimensions couldn't be in percent but in pixels, hence\n    // we must fix them.\n    this.fixDims();\n  }\n\n  #setScaleFactor(width, height) {\n    const padding = this.#getPadding();\n    const scaleFactorW = (width - padding) / this.#baseWidth;\n    const scaleFactorH = (height - padding) / this.#baseHeight;\n    this.scaleFactor = Math.min(scaleFactorW, scaleFactorH);\n  }\n\n  /**\n   * Update the canvas transform.\n   */\n  #updateTransform() {\n    const padding = this.#getPadding() / 2;\n    this.ctx.setTransform(\n      this.scaleFactor,\n      0,\n      0,\n      this.scaleFactor,\n      this.translationX * this.scaleFactor + padding,\n      this.translationY * this.scaleFactor + padding\n    );\n  }\n\n  /**\n   * Convert into a Path2D.\n   * @param {Array<Array<number>>} bezier\n   * @returns {Path2D}\n   */\n  static #buildPath2D(bezier) {\n    const path2D = new Path2D();\n    for (let i = 0, ii = bezier.length; i < ii; i++) {\n      const [first, control1, control2, second] = bezier[i];\n      if (i === 0) {\n        path2D.moveTo(...first);\n      }\n      path2D.bezierCurveTo(\n        control1[0],\n        control1[1],\n        control2[0],\n        control2[1],\n        second[0],\n        second[1]\n      );\n    }\n    return path2D;\n  }\n\n  static #toPDFCoordinates(points, rect, rotation) {\n    const [blX, blY, trX, trY] = rect;\n\n    switch (rotation) {\n      case 0:\n        for (let i = 0, ii = points.length; i < ii; i += 2) {\n          points[i] += blX;\n          points[i + 1] = trY - points[i + 1];\n        }\n        break;\n      case 90:\n        for (let i = 0, ii = points.length; i < ii; i += 2) {\n          const x = points[i];\n          points[i] = points[i + 1] + blX;\n          points[i + 1] = x + blY;\n        }\n        break;\n      case 180:\n        for (let i = 0, ii = points.length; i < ii; i += 2) {\n          points[i] = trX - points[i];\n          points[i + 1] += blY;\n        }\n        break;\n      case 270:\n        for (let i = 0, ii = points.length; i < ii; i += 2) {\n          const x = points[i];\n          points[i] = trX - points[i + 1];\n          points[i + 1] = trY - x;\n        }\n        break;\n      default:\n        throw new Error(\"Invalid rotation\");\n    }\n    return points;\n  }\n\n  static #fromPDFCoordinates(points, rect, rotation) {\n    const [blX, blY, trX, trY] = rect;\n\n    switch (rotation) {\n      case 0:\n        for (let i = 0, ii = points.length; i < ii; i += 2) {\n          points[i] -= blX;\n          points[i + 1] = trY - points[i + 1];\n        }\n        break;\n      case 90:\n        for (let i = 0, ii = points.length; i < ii; i += 2) {\n          const x = points[i];\n          points[i] = points[i + 1] - blY;\n          points[i + 1] = x - blX;\n        }\n        break;\n      case 180:\n        for (let i = 0, ii = points.length; i < ii; i += 2) {\n          points[i] = trX - points[i];\n          points[i + 1] -= blY;\n        }\n        break;\n      case 270:\n        for (let i = 0, ii = points.length; i < ii; i += 2) {\n          const x = points[i];\n          points[i] = trY - points[i + 1];\n          points[i + 1] = trX - x;\n        }\n        break;\n      default:\n        throw new Error(\"Invalid rotation\");\n    }\n    return points;\n  }\n\n  /**\n   * Transform and serialize the paths.\n   * @param {number} s - scale factor\n   * @param {number} tx - abscissa of the translation\n   * @param {number} ty - ordinate of the translation\n   * @param {Array<number>} rect - the bounding box of the annotation\n   */\n  #serializePaths(s, tx, ty, rect) {\n    const paths = [];\n    const padding = this.thickness / 2;\n    const shiftX = s * tx + padding;\n    const shiftY = s * ty + padding;\n    for (const bezier of this.paths) {\n      const buffer = [];\n      const points = [];\n      for (let j = 0, jj = bezier.length; j < jj; j++) {\n        const [first, control1, control2, second] = bezier[j];\n        const p10 = s * first[0] + shiftX;\n        const p11 = s * first[1] + shiftY;\n        const p20 = s * control1[0] + shiftX;\n        const p21 = s * control1[1] + shiftY;\n        const p30 = s * control2[0] + shiftX;\n        const p31 = s * control2[1] + shiftY;\n        const p40 = s * second[0] + shiftX;\n        const p41 = s * second[1] + shiftY;\n\n        if (j === 0) {\n          buffer.push(p10, p11);\n          points.push(p10, p11);\n        }\n        buffer.push(p20, p21, p30, p31, p40, p41);\n        points.push(p20, p21);\n        if (j === jj - 1) {\n          points.push(p40, p41);\n        }\n      }\n      paths.push({\n        bezier: InkEditor.#toPDFCoordinates(buffer, rect, this.rotation),\n        points: InkEditor.#toPDFCoordinates(points, rect, this.rotation),\n      });\n    }\n\n    return paths;\n  }\n\n  /**\n   * Get the bounding box containing all the paths.\n   * @returns {Array<number>}\n   */\n  #getBbox() {\n    let xMin = Infinity;\n    let xMax = -Infinity;\n    let yMin = Infinity;\n    let yMax = -Infinity;\n\n    for (const path of this.paths) {\n      for (const [first, control1, control2, second] of path) {\n        const bbox = Util.bezierBoundingBox(\n          ...first,\n          ...control1,\n          ...control2,\n          ...second\n        );\n        xMin = Math.min(xMin, bbox[0]);\n        yMin = Math.min(yMin, bbox[1]);\n        xMax = Math.max(xMax, bbox[2]);\n        yMax = Math.max(yMax, bbox[3]);\n      }\n    }\n\n    return [xMin, yMin, xMax, yMax];\n  }\n\n  /**\n   * The bounding box is computed with null thickness, so we must take\n   * it into account for the display.\n   * It corresponds to the total padding, hence it should be divided by 2\n   * in order to have left/right paddings.\n   * @returns {number}\n   */\n  #getPadding() {\n    return this.#disableEditing\n      ? Math.ceil(this.thickness * this.parentScale)\n      : 0;\n  }\n\n  /**\n   * Set the div position and dimensions in order to fit to\n   * the bounding box of the contents.\n   * @returns {undefined}\n   */\n  #fitToContent(firstTime = false) {\n    if (this.isEmpty()) {\n      return;\n    }\n\n    if (!this.#disableEditing) {\n      this.#redraw();\n      return;\n    }\n\n    const bbox = this.#getBbox();\n    const padding = this.#getPadding();\n    this.#baseWidth = Math.max(AnnotationEditor.MIN_SIZE, bbox[2] - bbox[0]);\n    this.#baseHeight = Math.max(AnnotationEditor.MIN_SIZE, bbox[3] - bbox[1]);\n\n    const width = Math.ceil(padding + this.#baseWidth * this.scaleFactor);\n    const height = Math.ceil(padding + this.#baseHeight * this.scaleFactor);\n\n    const [parentWidth, parentHeight] = this.parentDimensions;\n    this.width = width / parentWidth;\n    this.height = height / parentHeight;\n\n    this.setAspectRatio(width, height);\n\n    const prevTranslationX = this.translationX;\n    const prevTranslationY = this.translationY;\n\n    this.translationX = -bbox[0];\n    this.translationY = -bbox[1];\n    this.#setCanvasDims();\n    this.#redraw();\n\n    this.#realWidth = width;\n    this.#realHeight = height;\n\n    this.setDims(width, height);\n    const unscaledPadding = firstTime ? padding / this.scaleFactor / 2 : 0;\n    this.translate(\n      prevTranslationX - this.translationX - unscaledPadding,\n      prevTranslationY - this.translationY - unscaledPadding\n    );\n  }\n\n  /** @inheritdoc */\n  static deserialize(data, parent, uiManager) {\n    if (data instanceof InkAnnotationElement) {\n      return null;\n    }\n    const editor = super.deserialize(data, parent, uiManager);\n\n    editor.thickness = data.thickness;\n    editor.color = Util.makeHexColor(...data.color);\n    editor.opacity = data.opacity;\n\n    const [pageWidth, pageHeight] = editor.pageDimensions;\n    const width = editor.width * pageWidth;\n    const height = editor.height * pageHeight;\n    const scaleFactor = editor.parentScale;\n    const padding = data.thickness / 2;\n\n    editor.#disableEditing = true;\n    editor.#realWidth = Math.round(width);\n    editor.#realHeight = Math.round(height);\n\n    const { paths, rect, rotation } = data;\n\n    for (let { bezier } of paths) {\n      bezier = InkEditor.#fromPDFCoordinates(bezier, rect, rotation);\n      const path = [];\n      editor.paths.push(path);\n      let p0 = scaleFactor * (bezier[0] - padding);\n      let p1 = scaleFactor * (bezier[1] - padding);\n      for (let i = 2, ii = bezier.length; i < ii; i += 6) {\n        const p10 = scaleFactor * (bezier[i] - padding);\n        const p11 = scaleFactor * (bezier[i + 1] - padding);\n        const p20 = scaleFactor * (bezier[i + 2] - padding);\n        const p21 = scaleFactor * (bezier[i + 3] - padding);\n        const p30 = scaleFactor * (bezier[i + 4] - padding);\n        const p31 = scaleFactor * (bezier[i + 5] - padding);\n        path.push([\n          [p0, p1],\n          [p10, p11],\n          [p20, p21],\n          [p30, p31],\n        ]);\n        p0 = p30;\n        p1 = p31;\n      }\n      const path2D = this.#buildPath2D(path);\n      editor.bezierPath2D.push(path2D);\n    }\n\n    const bbox = editor.#getBbox();\n    editor.#baseWidth = Math.max(AnnotationEditor.MIN_SIZE, bbox[2] - bbox[0]);\n    editor.#baseHeight = Math.max(AnnotationEditor.MIN_SIZE, bbox[3] - bbox[1]);\n    editor.#setScaleFactor(width, height);\n\n    return editor;\n  }\n\n  /** @inheritdoc */\n  serialize() {\n    if (this.isEmpty()) {\n      return null;\n    }\n\n    const rect = this.getRect(0, 0);\n    const color = AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);\n\n    return {\n      annotationType: AnnotationEditorType.INK,\n      color,\n      thickness: this.thickness,\n      opacity: this.opacity,\n      paths: this.#serializePaths(\n        this.scaleFactor / this.parentScale,\n        this.translationX,\n        this.translationY,\n        rect\n      ),\n      pageIndex: this.pageIndex,\n      rect,\n      rotation: this.rotation,\n      structTreeParentId: this._structTreeParentId,\n    };\n  }\n}\n\nexport { InkEditor };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AnnotationEditorType, shadow } from \"../../shared/util.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { PixelsPerInch } from \"../display_utils.js\";\nimport { StampAnnotationElement } from \"../annotation_layer.js\";\n\n/**\n * Basic text editor in order to create a FreeTex annotation.\n */\nclass StampEditor extends AnnotationEditor {\n  #bitmap = null;\n\n  #bitmapId = null;\n\n  #bitmapPromise = null;\n\n  #bitmapUrl = null;\n\n  #bitmapFile = null;\n\n  #bitmapFileName = \"\";\n\n  #canvas = null;\n\n  #observer = null;\n\n  #resizeTimeoutId = null;\n\n  #isSvg = false;\n\n  #hasBeenAddedInUndoStack = false;\n\n  static _type = \"stamp\";\n\n  static _editorType = AnnotationEditorType.STAMP;\n\n  constructor(params) {\n    super({ ...params, name: \"stampEditor\" });\n    this.#bitmapUrl = params.bitmapUrl;\n    this.#bitmapFile = params.bitmapFile;\n  }\n\n  /** @inheritdoc */\n  static initialize(l10n) {\n    AnnotationEditor.initialize(l10n);\n  }\n\n  static get supportedTypes() {\n    // See https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types\n    // to know which types are supported by the browser.\n    const types = [\n      \"apng\",\n      \"avif\",\n      \"bmp\",\n      \"gif\",\n      \"jpeg\",\n      \"png\",\n      \"svg+xml\",\n      \"webp\",\n      \"x-icon\",\n    ];\n    return shadow(\n      this,\n      \"supportedTypes\",\n      types.map(type => `image/${type}`)\n    );\n  }\n\n  static get supportedTypesStr() {\n    return shadow(this, \"supportedTypesStr\", this.supportedTypes.join(\",\"));\n  }\n\n  /** @inheritdoc */\n  static isHandlingMimeForPasting(mime) {\n    return this.supportedTypes.includes(mime);\n  }\n\n  /** @inheritdoc */\n  static paste(item, parent) {\n    parent.pasteEditor(AnnotationEditorType.STAMP, {\n      bitmapFile: item.getAsFile(),\n    });\n  }\n\n  #getBitmapFetched(data, fromId = false) {\n    if (!data) {\n      this.remove();\n      return;\n    }\n    this.#bitmap = data.bitmap;\n    if (!fromId) {\n      this.#bitmapId = data.id;\n      this.#isSvg = data.isSvg;\n    }\n    if (data.file) {\n      this.#bitmapFileName = data.file.name;\n    }\n    this.#createCanvas();\n  }\n\n  #getBitmapDone() {\n    this.#bitmapPromise = null;\n    this._uiManager.enableWaiting(false);\n    if (this.#canvas) {\n      this.div.focus();\n    }\n  }\n\n  #getBitmap() {\n    if (this.#bitmapId) {\n      this._uiManager.enableWaiting(true);\n      this._uiManager.imageManager\n        .getFromId(this.#bitmapId)\n        .then(data => this.#getBitmapFetched(data, /* fromId = */ true))\n        .finally(() => this.#getBitmapDone());\n      return;\n    }\n\n    if (this.#bitmapUrl) {\n      const url = this.#bitmapUrl;\n      this.#bitmapUrl = null;\n      this._uiManager.enableWaiting(true);\n      this.#bitmapPromise = this._uiManager.imageManager\n        .getFromUrl(url)\n        .then(data => this.#getBitmapFetched(data))\n        .finally(() => this.#getBitmapDone());\n      return;\n    }\n\n    if (this.#bitmapFile) {\n      const file = this.#bitmapFile;\n      this.#bitmapFile = null;\n      this._uiManager.enableWaiting(true);\n      this.#bitmapPromise = this._uiManager.imageManager\n        .getFromFile(file)\n        .then(data => this.#getBitmapFetched(data))\n        .finally(() => this.#getBitmapDone());\n      return;\n    }\n\n    const input = document.createElement(\"input\");\n    if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n      input.hidden = true;\n      input.id = \"stampEditorFileInput\";\n      document.body.append(input);\n    }\n    input.type = \"file\";\n    input.accept = StampEditor.supportedTypesStr;\n    this.#bitmapPromise = new Promise(resolve => {\n      input.addEventListener(\"change\", async () => {\n        if (!input.files || input.files.length === 0) {\n          this.remove();\n        } else {\n          this._uiManager.enableWaiting(true);\n          const data = await this._uiManager.imageManager.getFromFile(\n            input.files[0]\n          );\n          this.#getBitmapFetched(data);\n        }\n        if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n          input.remove();\n        }\n        resolve();\n      });\n      input.addEventListener(\"cancel\", () => {\n        this.remove();\n        resolve();\n      });\n    }).finally(() => this.#getBitmapDone());\n    if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"TESTING\")) {\n      input.click();\n    }\n  }\n\n  /** @inheritdoc */\n  remove() {\n    if (this.#bitmapId) {\n      this.#bitmap = null;\n      this._uiManager.imageManager.deleteId(this.#bitmapId);\n      this.#canvas?.remove();\n      this.#canvas = null;\n      this.#observer?.disconnect();\n      this.#observer = null;\n      if (this.#resizeTimeoutId) {\n        clearTimeout(this.#resizeTimeoutId);\n        this.#resizeTimeoutId = null;\n      }\n    }\n    super.remove();\n  }\n\n  /** @inheritdoc */\n  rebuild() {\n    if (!this.parent) {\n      // It's possible to have to rebuild an editor which is not on a visible\n      // page.\n      if (this.#bitmapId) {\n        this.#getBitmap();\n      }\n      return;\n    }\n    super.rebuild();\n    if (this.div === null) {\n      return;\n    }\n\n    if (this.#bitmapId) {\n      this.#getBitmap();\n    }\n\n    if (!this.isAttachedToDOM) {\n      // At some point this editor was removed and we're rebuilting it,\n      // hence we must add it to its parent.\n      this.parent.add(this);\n    }\n  }\n\n  /** @inheritdoc */\n  onceAdded() {\n    this._isDraggable = true;\n    this.div.focus();\n  }\n\n  /** @inheritdoc */\n  isEmpty() {\n    return !(\n      this.#bitmapPromise ||\n      this.#bitmap ||\n      this.#bitmapUrl ||\n      this.#bitmapFile\n    );\n  }\n\n  /** @inheritdoc */\n  get isResizable() {\n    return true;\n  }\n\n  /** @inheritdoc */\n  render() {\n    if (this.div) {\n      return this.div;\n    }\n\n    let baseX, baseY;\n    if (this.width) {\n      baseX = this.x;\n      baseY = this.y;\n    }\n\n    super.render();\n    this.div.hidden = true;\n\n    if (this.#bitmap) {\n      this.#createCanvas();\n    } else {\n      this.#getBitmap();\n    }\n\n    if (this.width) {\n      // This editor was created in using copy (ctrl+c).\n      const [parentWidth, parentHeight] = this.parentDimensions;\n      this.setAt(\n        baseX * parentWidth,\n        baseY * parentHeight,\n        this.width * parentWidth,\n        this.height * parentHeight\n      );\n    }\n\n    return this.div;\n  }\n\n  #createCanvas() {\n    const { div } = this;\n    let { width, height } = this.#bitmap;\n    const [pageWidth, pageHeight] = this.pageDimensions;\n    const MAX_RATIO = 0.75;\n    if (this.width) {\n      width = this.width * pageWidth;\n      height = this.height * pageHeight;\n    } else if (\n      width > MAX_RATIO * pageWidth ||\n      height > MAX_RATIO * pageHeight\n    ) {\n      // If the the image is too big compared to the page dimensions\n      // (more than MAX_RATIO) then we scale it down.\n      const factor = Math.min(\n        (MAX_RATIO * pageWidth) / width,\n        (MAX_RATIO * pageHeight) / height\n      );\n      width *= factor;\n      height *= factor;\n    }\n    const [parentWidth, parentHeight] = this.parentDimensions;\n    this.setDims(\n      (width * parentWidth) / pageWidth,\n      (height * parentHeight) / pageHeight\n    );\n\n    this._uiManager.enableWaiting(false);\n    const canvas = (this.#canvas = document.createElement(\"canvas\"));\n    div.append(canvas);\n    div.hidden = false;\n    this.#drawBitmap(width, height);\n    this.#createObserver();\n    if (!this.#hasBeenAddedInUndoStack) {\n      this.parent.addUndoableEditor(this);\n      this.#hasBeenAddedInUndoStack = true;\n    }\n\n    // There are multiple ways to add an image to the page, so here we just\n    // count the number of times an image is added to the page whatever the way\n    // is.\n    this._uiManager._eventBus.dispatch(\"reporttelemetry\", {\n      source: this,\n      details: {\n        type: \"editing\",\n        subtype: this.editorType,\n        data: {\n          action: \"inserted_image\",\n        },\n      },\n    });\n    this.addAltTextButton();\n    if (this.#bitmapFileName) {\n      canvas.setAttribute(\"aria-label\", this.#bitmapFileName);\n    }\n  }\n\n  /**\n   * When the dimensions of the div change the inner canvas must\n   * renew its dimensions, hence it must redraw its own contents.\n   * @param {number} width - the new width of the div\n   * @param {number} height - the new height of the div\n   * @returns\n   */\n  #setDimensions(width, height) {\n    const [parentWidth, parentHeight] = this.parentDimensions;\n    this.width = width / parentWidth;\n    this.height = height / parentHeight;\n    this.setDims(width, height);\n    if (this._initialOptions?.isCentered) {\n      this.center();\n    } else {\n      this.fixAndSetPosition();\n    }\n    this._initialOptions = null;\n    if (this.#resizeTimeoutId !== null) {\n      clearTimeout(this.#resizeTimeoutId);\n    }\n    // When the user is resizing the editor we just use CSS to scale the image\n    // to avoid redrawing it too often.\n    // And once the user stops resizing the editor we redraw the image in\n    // rescaling it correctly (see this.#scaleBitmap).\n    const TIME_TO_WAIT = 200;\n    this.#resizeTimeoutId = setTimeout(() => {\n      this.#resizeTimeoutId = null;\n      this.#drawBitmap(width, height);\n    }, TIME_TO_WAIT);\n  }\n\n  #scaleBitmap(width, height) {\n    const { width: bitmapWidth, height: bitmapHeight } = this.#bitmap;\n\n    let newWidth = bitmapWidth;\n    let newHeight = bitmapHeight;\n    let bitmap = this.#bitmap;\n    while (newWidth > 2 * width || newHeight > 2 * height) {\n      const prevWidth = newWidth;\n      const prevHeight = newHeight;\n\n      if (newWidth > 2 * width) {\n        // See bug 1820511 (Windows specific bug).\n        // TODO: once the above bug is fixed we could revert to:\n        // newWidth = Math.ceil(newWidth / 2);\n        newWidth =\n          newWidth >= 16384\n            ? Math.floor(newWidth / 2) - 1\n            : Math.ceil(newWidth / 2);\n      }\n      if (newHeight > 2 * height) {\n        newHeight =\n          newHeight >= 16384\n            ? Math.floor(newHeight / 2) - 1\n            : Math.ceil(newHeight / 2);\n      }\n\n      const offscreen = new OffscreenCanvas(newWidth, newHeight);\n      const ctx = offscreen.getContext(\"2d\");\n      ctx.drawImage(\n        bitmap,\n        0,\n        0,\n        prevWidth,\n        prevHeight,\n        0,\n        0,\n        newWidth,\n        newHeight\n      );\n      bitmap = offscreen.transferToImageBitmap();\n    }\n\n    return bitmap;\n  }\n\n  #drawBitmap(width, height) {\n    width = Math.ceil(width);\n    height = Math.ceil(height);\n    const canvas = this.#canvas;\n    if (!canvas || (canvas.width === width && canvas.height === height)) {\n      return;\n    }\n    canvas.width = width;\n    canvas.height = height;\n    const bitmap = this.#isSvg\n      ? this.#bitmap\n      : this.#scaleBitmap(width, height);\n    const ctx = canvas.getContext(\"2d\");\n    ctx.filter = this._uiManager.hcmFilter;\n    ctx.drawImage(\n      bitmap,\n      0,\n      0,\n      bitmap.width,\n      bitmap.height,\n      0,\n      0,\n      width,\n      height\n    );\n  }\n\n  /** @inheritdoc */\n  getImageForAltText() {\n    return this.#canvas;\n  }\n\n  #serializeBitmap(toUrl) {\n    if (toUrl) {\n      if (this.#isSvg) {\n        const url = this._uiManager.imageManager.getSvgUrl(this.#bitmapId);\n        if (url) {\n          return url;\n        }\n      }\n      // We convert to a data url because it's sync and the url can live in the\n      // clipboard.\n      const canvas = document.createElement(\"canvas\");\n      ({ width: canvas.width, height: canvas.height } = this.#bitmap);\n      const ctx = canvas.getContext(\"2d\");\n      ctx.drawImage(this.#bitmap, 0, 0);\n\n      return canvas.toDataURL();\n    }\n\n    if (this.#isSvg) {\n      const [pageWidth, pageHeight] = this.pageDimensions;\n      // Multiply by PixelsPerInch.PDF_TO_CSS_UNITS in order to increase the\n      // image resolution when rasterizing it.\n      const width = Math.round(\n        this.width * pageWidth * PixelsPerInch.PDF_TO_CSS_UNITS\n      );\n      const height = Math.round(\n        this.height * pageHeight * PixelsPerInch.PDF_TO_CSS_UNITS\n      );\n      const offscreen = new OffscreenCanvas(width, height);\n      const ctx = offscreen.getContext(\"2d\");\n      ctx.drawImage(\n        this.#bitmap,\n        0,\n        0,\n        this.#bitmap.width,\n        this.#bitmap.height,\n        0,\n        0,\n        width,\n        height\n      );\n      return offscreen.transferToImageBitmap();\n    }\n\n    return structuredClone(this.#bitmap);\n  }\n\n  /**\n   * Create the resize observer.\n   */\n  #createObserver() {\n    this.#observer = new ResizeObserver(entries => {\n      const rect = entries[0].contentRect;\n      if (rect.width && rect.height) {\n        this.#setDimensions(rect.width, rect.height);\n      }\n    });\n    this.#observer.observe(this.div);\n  }\n\n  /** @inheritdoc */\n  static deserialize(data, parent, uiManager) {\n    if (data instanceof StampAnnotationElement) {\n      return null;\n    }\n    const editor = super.deserialize(data, parent, uiManager);\n    const { rect, bitmapUrl, bitmapId, isSvg, accessibilityData } = data;\n    if (bitmapId && uiManager.imageManager.isValidId(bitmapId)) {\n      editor.#bitmapId = bitmapId;\n    } else {\n      editor.#bitmapUrl = bitmapUrl;\n    }\n    editor.#isSvg = isSvg;\n\n    const [parentWidth, parentHeight] = editor.pageDimensions;\n    editor.width = (rect[2] - rect[0]) / parentWidth;\n    editor.height = (rect[3] - rect[1]) / parentHeight;\n\n    if (accessibilityData) {\n      editor.altTextData = accessibilityData;\n    }\n\n    return editor;\n  }\n\n  /** @inheritdoc */\n  serialize(isForCopying = false, context = null) {\n    if (this.isEmpty()) {\n      return null;\n    }\n\n    const serialized = {\n      annotationType: AnnotationEditorType.STAMP,\n      bitmapId: this.#bitmapId,\n      pageIndex: this.pageIndex,\n      rect: this.getRect(0, 0),\n      rotation: this.rotation,\n      isSvg: this.#isSvg,\n      structTreeParentId: this._structTreeParentId,\n    };\n\n    if (isForCopying) {\n      // We don't know what's the final destination (this pdf or another one)\n      // of this annotation and the clipboard doesn't support ImageBitmaps,\n      // hence we serialize the bitmap to a data url.\n      serialized.bitmapUrl = this.#serializeBitmap(/* toUrl = */ true);\n      serialized.accessibilityData = this.altTextData;\n      return serialized;\n    }\n\n    const { decorative, altText } = this.altTextData;\n    if (!decorative && altText) {\n      serialized.accessibilityData = { type: \"Figure\", alt: altText };\n    }\n\n    if (context === null) {\n      return serialized;\n    }\n\n    context.stamps ||= new Map();\n    const area = this.#isSvg\n      ? (serialized.rect[2] - serialized.rect[0]) *\n        (serialized.rect[3] - serialized.rect[1])\n      : null;\n    if (!context.stamps.has(this.#bitmapId)) {\n      // We don't want to have multiple copies of the same bitmap in the\n      // annotationMap, hence we only add the bitmap the first time we meet it.\n      context.stamps.set(this.#bitmapId, { area, serialized });\n      serialized.bitmap = this.#serializeBitmap(/* toUrl = */ false);\n    } else if (this.#isSvg) {\n      // If we have multiple copies of the same svg but with different sizes,\n      // then we want to keep the biggest one.\n      const prevData = context.stamps.get(this.#bitmapId);\n      if (area > prevData.area) {\n        prevData.area = area;\n        prevData.serialized.bitmap.close();\n        prevData.serialized.bitmap = this.#serializeBitmap(/* toUrl = */ false);\n      }\n    }\n    return serialized;\n  }\n}\n\nexport { StampEditor };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./tools.js\").AnnotationEditorUIManager} AnnotationEditorUIManager */\n/** @typedef {import(\"../display_utils.js\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../../../web/text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n/** @typedef {import(\"../../../web/interfaces\").IL10n} IL10n */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../annotation_layer.js\").AnnotationLayer} AnnotationLayer */\n\nimport { AnnotationEditorType, FeatureTest } from \"../../shared/util.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { FreeTextEditor } from \"./freetext.js\";\nimport { InkEditor } from \"./ink.js\";\nimport { setLayerDimensions } from \"../display_utils.js\";\nimport { StampEditor } from \"./stamp.js\";\n\n/**\n * @typedef {Object} AnnotationEditorLayerOptions\n * @property {Object} mode\n * @property {HTMLDivElement} div\n * @property {AnnotationEditorUIManager} uiManager\n * @property {boolean} enabled\n * @property {TextAccessibilityManager} [accessibilityManager]\n * @property {number} pageIndex\n * @property {IL10n} l10n\n * @property {AnnotationLayer} [annotationLayer]\n * @property {PageViewport} viewport\n */\n\n/**\n * @typedef {Object} RenderEditorLayerOptions\n * @property {PageViewport} viewport\n */\n\n/**\n * Manage all the different editors on a page.\n */\nclass AnnotationEditorLayer {\n  #accessibilityManager;\n\n  #allowClick = false;\n\n  #annotationLayer = null;\n\n  #boundPointerup = this.pointerup.bind(this);\n\n  #boundPointerdown = this.pointerdown.bind(this);\n\n  #editorFocusTimeoutId = null;\n\n  #editors = new Map();\n\n  #hadPointerDown = false;\n\n  #isCleaningUp = false;\n\n  #isDisabling = false;\n\n  #uiManager;\n\n  static _initialized = false;\n\n  static #editorTypes = new Map(\n    [FreeTextEditor, InkEditor, StampEditor].map(type => [\n      type._editorType,\n      type,\n    ])\n  );\n\n  /**\n   * @param {AnnotationEditorLayerOptions} options\n   */\n  constructor({\n    uiManager,\n    pageIndex,\n    div,\n    accessibilityManager,\n    annotationLayer,\n    viewport,\n    l10n,\n  }) {\n    const editorTypes = [...AnnotationEditorLayer.#editorTypes.values()];\n    if (!AnnotationEditorLayer._initialized) {\n      AnnotationEditorLayer._initialized = true;\n      for (const editorType of editorTypes) {\n        editorType.initialize(l10n);\n      }\n    }\n    uiManager.registerEditorTypes(editorTypes);\n\n    this.#uiManager = uiManager;\n    this.pageIndex = pageIndex;\n    this.div = div;\n    this.#accessibilityManager = accessibilityManager;\n    this.#annotationLayer = annotationLayer;\n    this.viewport = viewport;\n\n    this.#uiManager.addLayer(this);\n  }\n\n  get isEmpty() {\n    return this.#editors.size === 0;\n  }\n\n  /**\n   * Update the toolbar if it's required to reflect the tool currently used.\n   * @param {number} mode\n   */\n  updateToolbar(mode) {\n    this.#uiManager.updateToolbar(mode);\n  }\n\n  /**\n   * The mode has changed: it must be updated.\n   * @param {number} mode\n   */\n  updateMode(mode = this.#uiManager.getMode()) {\n    this.#cleanup();\n    if (mode === AnnotationEditorType.INK) {\n      // We always want to an ink editor ready to draw in.\n      this.addInkEditorIfNeeded(false);\n      this.disableClick();\n    } else {\n      this.enableClick();\n    }\n\n    if (mode !== AnnotationEditorType.NONE) {\n      const { classList } = this.div;\n      for (const editorType of AnnotationEditorLayer.#editorTypes.values()) {\n        classList.toggle(\n          `${editorType._type}Editing`,\n          mode === editorType._editorType\n        );\n      }\n      this.div.hidden = false;\n    }\n  }\n\n  addInkEditorIfNeeded(isCommitting) {\n    if (\n      !isCommitting &&\n      this.#uiManager.getMode() !== AnnotationEditorType.INK\n    ) {\n      return;\n    }\n\n    if (!isCommitting) {\n      // We're removing an editor but an empty one can already exist so in this\n      // case we don't need to create a new one.\n      for (const editor of this.#editors.values()) {\n        if (editor.isEmpty()) {\n          editor.setInBackground();\n          return;\n        }\n      }\n    }\n\n    const editor = this.#createAndAddNewEditor(\n      { offsetX: 0, offsetY: 0 },\n      /* isCentered = */ false\n    );\n    editor.setInBackground();\n  }\n\n  /**\n   * Set the editing state.\n   * @param {boolean} isEditing\n   */\n  setEditingState(isEditing) {\n    this.#uiManager.setEditingState(isEditing);\n  }\n\n  /**\n   * Add some commands into the CommandManager (undo/redo stuff).\n   * @param {Object} params\n   */\n  addCommands(params) {\n    this.#uiManager.addCommands(params);\n  }\n\n  togglePointerEvents(enabled = false) {\n    this.div.classList.toggle(\"disabled\", !enabled);\n  }\n\n  /**\n   * Enable pointer events on the main div in order to enable\n   * editor creation.\n   */\n  enable() {\n    this.togglePointerEvents(true);\n    const annotationElementIds = new Set();\n    for (const editor of this.#editors.values()) {\n      editor.enableEditing();\n      if (editor.annotationElementId) {\n        annotationElementIds.add(editor.annotationElementId);\n      }\n    }\n\n    if (!this.#annotationLayer) {\n      return;\n    }\n\n    const editables = this.#annotationLayer.getEditableAnnotations();\n    for (const editable of editables) {\n      // The element must be hidden whatever its state is.\n      editable.hide();\n      if (this.#uiManager.isDeletedAnnotationElement(editable.data.id)) {\n        continue;\n      }\n      if (annotationElementIds.has(editable.data.id)) {\n        continue;\n      }\n      const editor = this.deserialize(editable);\n      if (!editor) {\n        continue;\n      }\n      this.addOrRebuild(editor);\n      editor.enableEditing();\n    }\n  }\n\n  /**\n   * Disable editor creation.\n   */\n  disable() {\n    this.#isDisabling = true;\n    this.togglePointerEvents(false);\n    const hiddenAnnotationIds = new Set();\n    for (const editor of this.#editors.values()) {\n      editor.disableEditing();\n      if (!editor.annotationElementId || editor.serialize() !== null) {\n        hiddenAnnotationIds.add(editor.annotationElementId);\n        continue;\n      }\n      this.getEditableAnnotation(editor.annotationElementId)?.show();\n      editor.remove();\n    }\n\n    if (this.#annotationLayer) {\n      // Show the annotations that were hidden in enable().\n      const editables = this.#annotationLayer.getEditableAnnotations();\n      for (const editable of editables) {\n        const { id } = editable.data;\n        if (\n          hiddenAnnotationIds.has(id) ||\n          this.#uiManager.isDeletedAnnotationElement(id)\n        ) {\n          continue;\n        }\n        editable.show();\n      }\n    }\n\n    this.#cleanup();\n    if (this.isEmpty) {\n      this.div.hidden = true;\n    }\n    const { classList } = this.div;\n    for (const editorType of AnnotationEditorLayer.#editorTypes.values()) {\n      classList.remove(`${editorType._type}Editing`);\n    }\n\n    this.#isDisabling = false;\n  }\n\n  getEditableAnnotation(id) {\n    return this.#annotationLayer?.getEditableAnnotation(id) || null;\n  }\n\n  /**\n   * Set the current editor.\n   * @param {AnnotationEditor} editor\n   */\n  setActiveEditor(editor) {\n    const currentActive = this.#uiManager.getActive();\n    if (currentActive === editor) {\n      return;\n    }\n\n    this.#uiManager.setActiveEditor(editor);\n  }\n\n  enableClick() {\n    this.div.addEventListener(\"pointerdown\", this.#boundPointerdown);\n    this.div.addEventListener(\"pointerup\", this.#boundPointerup);\n  }\n\n  disableClick() {\n    this.div.removeEventListener(\"pointerdown\", this.#boundPointerdown);\n    this.div.removeEventListener(\"pointerup\", this.#boundPointerup);\n  }\n\n  attach(editor) {\n    this.#editors.set(editor.id, editor);\n    const { annotationElementId } = editor;\n    if (\n      annotationElementId &&\n      this.#uiManager.isDeletedAnnotationElement(annotationElementId)\n    ) {\n      this.#uiManager.removeDeletedAnnotationElement(editor);\n    }\n  }\n\n  detach(editor) {\n    this.#editors.delete(editor.id);\n    this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv);\n\n    if (!this.#isDisabling && editor.annotationElementId) {\n      this.#uiManager.addDeletedAnnotationElement(editor);\n    }\n  }\n\n  /**\n   * Remove an editor.\n   * @param {AnnotationEditor} editor\n   */\n  remove(editor) {\n    // Since we can undo a removal we need to keep the\n    // parent property as it is, so don't null it!\n\n    this.detach(editor);\n    this.#uiManager.removeEditor(editor);\n    editor.div.remove();\n    editor.isAttachedToDOM = false;\n\n    if (!this.#isCleaningUp) {\n      this.addInkEditorIfNeeded(/* isCommitting = */ false);\n    }\n  }\n\n  /**\n   * An editor can have a different parent, for example after having\n   * being dragged and droped from a page to another.\n   * @param {AnnotationEditor} editor\n   */\n  changeParent(editor) {\n    if (editor.parent === this) {\n      return;\n    }\n\n    if (editor.annotationElementId) {\n      this.#uiManager.addDeletedAnnotationElement(editor.annotationElementId);\n      AnnotationEditor.deleteAnnotationElement(editor);\n      editor.annotationElementId = null;\n    }\n\n    this.attach(editor);\n    editor.parent?.detach(editor);\n    editor.setParent(this);\n    if (editor.div && editor.isAttachedToDOM) {\n      editor.div.remove();\n      this.div.append(editor.div);\n    }\n  }\n\n  /**\n   * Add a new editor in the current view.\n   * @param {AnnotationEditor} editor\n   */\n  add(editor) {\n    this.changeParent(editor);\n    this.#uiManager.addEditor(editor);\n    this.attach(editor);\n\n    if (!editor.isAttachedToDOM) {\n      const div = editor.render();\n      this.div.append(div);\n      editor.isAttachedToDOM = true;\n    }\n\n    // The editor will be correctly moved into the DOM (see fixAndSetPosition).\n    editor.fixAndSetPosition();\n    editor.onceAdded();\n    this.#uiManager.addToAnnotationStorage(editor);\n  }\n\n  moveEditorInDOM(editor) {\n    if (!editor.isAttachedToDOM) {\n      return;\n    }\n\n    const { activeElement } = document;\n    if (editor.div.contains(activeElement) && !this.#editorFocusTimeoutId) {\n      // When the div is moved in the DOM the focus can move somewhere else,\n      // so we want to be sure that the focus will stay on the editor but we\n      // don't want to call any focus callbacks, hence we disable them and only\n      // re-enable them when the editor has the focus.\n      editor._focusEventsAllowed = false;\n      this.#editorFocusTimeoutId = setTimeout(() => {\n        this.#editorFocusTimeoutId = null;\n        if (!editor.div.contains(document.activeElement)) {\n          editor.div.addEventListener(\n            \"focusin\",\n            () => {\n              editor._focusEventsAllowed = true;\n            },\n            { once: true }\n          );\n          activeElement.focus();\n        } else {\n          editor._focusEventsAllowed = true;\n        }\n      }, 0);\n    }\n\n    editor._structTreeParentId = this.#accessibilityManager?.moveElementInDOM(\n      this.div,\n      editor.div,\n      editor.contentDiv,\n      /* isRemovable = */ true\n    );\n  }\n\n  /**\n   * Add or rebuild depending if it has been removed or not.\n   * @param {AnnotationEditor} editor\n   */\n  addOrRebuild(editor) {\n    if (editor.needsToBeRebuilt()) {\n      editor.parent ||= this;\n      editor.rebuild();\n    } else {\n      this.add(editor);\n    }\n  }\n\n  /**\n   * Add a new editor and make this addition undoable.\n   * @param {AnnotationEditor} editor\n   */\n  addUndoableEditor(editor) {\n    const cmd = () => editor._uiManager.rebuild(editor);\n    const undo = () => {\n      editor.remove();\n    };\n\n    this.addCommands({ cmd, undo, mustExec: false });\n  }\n\n  /**\n   * Get an id for an editor.\n   * @returns {string}\n   */\n  getNextId() {\n    return this.#uiManager.getId();\n  }\n\n  /**\n   * Create a new editor\n   * @param {Object} params\n   * @returns {AnnotationEditor}\n   */\n  #createNewEditor(params) {\n    const editorType = AnnotationEditorLayer.#editorTypes.get(\n      this.#uiManager.getMode()\n    );\n    return editorType ? new editorType.prototype.constructor(params) : null;\n  }\n\n  /**\n   * Paste some content into a new editor.\n   * @param {number} mode\n   * @param {Object} params\n   */\n  pasteEditor(mode, params) {\n    this.#uiManager.updateToolbar(mode);\n    this.#uiManager.updateMode(mode);\n\n    const { offsetX, offsetY } = this.#getCenterPoint();\n    const id = this.getNextId();\n    const editor = this.#createNewEditor({\n      parent: this,\n      id,\n      x: offsetX,\n      y: offsetY,\n      uiManager: this.#uiManager,\n      isCentered: true,\n      ...params,\n    });\n    if (editor) {\n      this.add(editor);\n    }\n  }\n\n  /**\n   * Create a new editor\n   * @param {Object} data\n   * @returns {AnnotationEditor | null}\n   */\n  deserialize(data) {\n    return (\n      AnnotationEditorLayer.#editorTypes\n        .get(data.annotationType ?? data.annotationEditorType)\n        ?.deserialize(data, this, this.#uiManager) || null\n    );\n  }\n\n  /**\n   * Create and add a new editor.\n   * @param {PointerEvent} event\n   * @param {boolean} isCentered\n   * @returns {AnnotationEditor}\n   */\n  #createAndAddNewEditor(event, isCentered) {\n    const id = this.getNextId();\n    const editor = this.#createNewEditor({\n      parent: this,\n      id,\n      x: event.offsetX,\n      y: event.offsetY,\n      uiManager: this.#uiManager,\n      isCentered,\n    });\n    if (editor) {\n      this.add(editor);\n    }\n\n    return editor;\n  }\n\n  #getCenterPoint() {\n    const { x, y, width, height } = this.div.getBoundingClientRect();\n    const tlX = Math.max(0, x);\n    const tlY = Math.max(0, y);\n    const brX = Math.min(window.innerWidth, x + width);\n    const brY = Math.min(window.innerHeight, y + height);\n    const centerX = (tlX + brX) / 2 - x;\n    const centerY = (tlY + brY) / 2 - y;\n    const [offsetX, offsetY] =\n      this.viewport.rotation % 180 === 0\n        ? [centerX, centerY]\n        : [centerY, centerX];\n\n    return { offsetX, offsetY };\n  }\n\n  /**\n   * Create and add a new editor.\n   */\n  addNewEditor() {\n    this.#createAndAddNewEditor(\n      this.#getCenterPoint(),\n      /* isCentered = */ true\n    );\n  }\n\n  /**\n   * Set the last selected editor.\n   * @param {AnnotationEditor} editor\n   */\n  setSelected(editor) {\n    this.#uiManager.setSelected(editor);\n  }\n\n  /**\n   * Add or remove an editor the current selection.\n   * @param {AnnotationEditor} editor\n   */\n  toggleSelected(editor) {\n    this.#uiManager.toggleSelected(editor);\n  }\n\n  /**\n   * Check if the editor is selected.\n   * @param {AnnotationEditor} editor\n   */\n  isSelected(editor) {\n    return this.#uiManager.isSelected(editor);\n  }\n\n  /**\n   * Unselect an editor.\n   * @param {AnnotationEditor} editor\n   */\n  unselect(editor) {\n    this.#uiManager.unselect(editor);\n  }\n\n  /**\n   * Pointerup callback.\n   * @param {PointerEvent} event\n   */\n  pointerup(event) {\n    const { isMac } = FeatureTest.platform;\n    if (event.button !== 0 || (event.ctrlKey && isMac)) {\n      // Don't create an editor on right click.\n      return;\n    }\n\n    if (event.target !== this.div) {\n      return;\n    }\n\n    if (!this.#hadPointerDown) {\n      // It can happen when the user starts a drag inside a text editor\n      // and then releases the mouse button outside of it. In such a case\n      // we don't want to create a new editor, hence we check that a pointerdown\n      // occurred on this div previously.\n      return;\n    }\n    this.#hadPointerDown = false;\n\n    if (!this.#allowClick) {\n      this.#allowClick = true;\n      return;\n    }\n\n    if (this.#uiManager.getMode() === AnnotationEditorType.STAMP) {\n      this.#uiManager.unselectAll();\n      return;\n    }\n\n    this.#createAndAddNewEditor(event, /* isCentered = */ false);\n  }\n\n  /**\n   * Pointerdown callback.\n   * @param {PointerEvent} event\n   */\n  pointerdown(event) {\n    if (this.#hadPointerDown) {\n      // It's possible to have a second pointerdown event before a pointerup one\n      // when the user puts a finger on a touchscreen and then add a second one\n      // to start a pinch-to-zoom gesture.\n      // That said, in case it's possible to have two pointerdown events with\n      // a mouse, we don't want to create a new editor in such a case either.\n      this.#hadPointerDown = false;\n      return;\n    }\n    const { isMac } = FeatureTest.platform;\n    if (event.button !== 0 || (event.ctrlKey && isMac)) {\n      // Do nothing on right click.\n      return;\n    }\n\n    if (event.target !== this.div) {\n      return;\n    }\n\n    this.#hadPointerDown = true;\n\n    const editor = this.#uiManager.getActive();\n    this.#allowClick = !editor || editor.isEmpty();\n  }\n\n  /**\n   *\n   * @param {AnnotationEditor} editor\n   * @param {number} x\n   * @param {number} y\n   * @returns\n   */\n  findNewParent(editor, x, y) {\n    const layer = this.#uiManager.findParent(x, y);\n    if (layer === null || layer === this) {\n      return false;\n    }\n    layer.changeParent(editor);\n    return true;\n  }\n\n  /**\n   * Destroy the main editor.\n   */\n  destroy() {\n    if (this.#uiManager.getActive()?.parent === this) {\n      // We need to commit the current editor before destroying the layer.\n      this.#uiManager.commitOrRemove();\n      this.#uiManager.setActiveEditor(null);\n    }\n\n    if (this.#editorFocusTimeoutId) {\n      clearTimeout(this.#editorFocusTimeoutId);\n      this.#editorFocusTimeoutId = null;\n    }\n\n    for (const editor of this.#editors.values()) {\n      this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv);\n      editor.setParent(null);\n      editor.isAttachedToDOM = false;\n      editor.div.remove();\n    }\n    this.div = null;\n    this.#editors.clear();\n    this.#uiManager.removeLayer(this);\n  }\n\n  #cleanup() {\n    // When we're cleaning up, some editors are removed but we don't want\n    // to add a new one which will induce an addition in this.#editors, hence\n    // an infinite loop.\n    this.#isCleaningUp = true;\n    for (const editor of this.#editors.values()) {\n      if (editor.isEmpty()) {\n        editor.remove();\n      }\n    }\n    this.#isCleaningUp = false;\n  }\n\n  /**\n   * Render the main editor.\n   * @param {RenderEditorLayerOptions} parameters\n   */\n  render({ viewport }) {\n    this.viewport = viewport;\n    setLayerDimensions(this.div, viewport);\n    for (const editor of this.#uiManager.getEditors(this.pageIndex)) {\n      this.add(editor);\n    }\n    this.updateMode();\n  }\n\n  /**\n   * Update the main editor.\n   * @param {RenderEditorLayerOptions} parameters\n   */\n  update({ viewport }) {\n    // Editors have their dimensions/positions in percent so to avoid any\n    // issues (see #15582), we must commit the current one before changing\n    // the viewport.\n    this.#uiManager.commitOrRemove();\n\n    this.viewport = viewport;\n    setLayerDimensions(this.div, { rotation: viewport.rotation });\n    this.updateMode();\n  }\n\n  /**\n   * Get page dimensions.\n   * @returns {Object} dimensions.\n   */\n  get pageDimensions() {\n    const { pageWidth, pageHeight } = this.viewport.rawDims;\n    return [pageWidth, pageHeight];\n  }\n}\n\nexport { AnnotationEditorLayer };\n","/* Copyright 2023 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { noContextMenu } from \"../display_utils.js\";\n\nclass EditorToolbar {\n  #toolbar = null;\n\n  #editor;\n\n  #buttons = null;\n\n  constructor(editor) {\n    this.#editor = editor;\n  }\n\n  render() {\n    const editToolbar = (this.#toolbar = document.createElement(\"div\"));\n    editToolbar.className = \"editToolbar\";\n    editToolbar.addEventListener(\"contextmenu\", noContextMenu);\n    editToolbar.addEventListener(\"pointerdown\", EditorToolbar.#pointerDown);\n\n    const buttons = (this.#buttons = document.createElement(\"div\"));\n    buttons.className = \"buttons\";\n    editToolbar.append(buttons);\n\n    this.#addDeleteButton();\n\n    return editToolbar;\n  }\n\n  static #pointerDown(e) {\n    e.stopPropagation();\n  }\n\n  #focusIn(e) {\n    this.#editor._focusEventsAllowed = false;\n    e.preventDefault();\n    e.stopPropagation();\n  }\n\n  #focusOut(e) {\n    this.#editor._focusEventsAllowed = true;\n    e.preventDefault();\n    e.stopPropagation();\n  }\n\n  #addListenersToElement(element) {\n    // If we're clicking on a button with the keyboard or with\n    // the mouse, we don't want to trigger any focus events on\n    // the editor.\n    element.addEventListener(\"focusin\", this.#focusIn.bind(this), {\n      capture: true,\n    });\n    element.addEventListener(\"focusout\", this.#focusOut.bind(this), {\n      capture: true,\n    });\n    element.addEventListener(\"contextmenu\", noContextMenu);\n  }\n\n  hide() {\n    this.#toolbar.classList.add(\"hidden\");\n  }\n\n  show() {\n    this.#toolbar.classList.remove(\"hidden\");\n  }\n\n  #addDeleteButton() {\n    const button = document.createElement(\"button\");\n    button.className = \"delete\";\n    button.tabIndex = 0;\n    button.setAttribute(\"data-l10n-id\", \"pdfjs-editor-remove-button\");\n    this.#addListenersToElement(button);\n    button.addEventListener(\"click\", e => {\n      this.#editor._uiManager.delete();\n    });\n    this.#buttons.append(button);\n  }\n\n  remove() {\n    this.#toolbar.remove();\n  }\n}\n\nexport { EditorToolbar };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n  AnnotationEditorUIManager,\n  bindEvents,\n  ColorManager,\n  KeyboardManager,\n} from \"./tools.js\";\nimport { FeatureTest, shadow, unreachable } from \"../../shared/util.js\";\nimport { EditorToolbar } from \"./toolbar.js\";\nimport { noContextMenu } from \"../display_utils.js\";\n\n/**\n * @typedef {Object} AnnotationEditorParameters\n * @property {AnnotationEditorUIManager} uiManager - the global manager\n * @property {AnnotationEditorLayer} parent - the layer containing this editor\n * @property {string} id - editor id\n * @property {number} x - x-coordinate\n * @property {number} y - y-coordinate\n */\n\n/**\n * Base class for editors.\n */\nclass AnnotationEditor {\n  #allResizerDivs = null;\n\n  #altText = \"\";\n\n  #altTextDecorative = false;\n\n  #altTextButton = null;\n\n  #altTextTooltip = null;\n\n  #altTextTooltipTimeout = null;\n\n  #altTextWasFromKeyBoard = false;\n\n  #keepAspectRatio = false;\n\n  #resizersDiv = null;\n\n  #savedDimensions = null;\n\n  #boundFocusin = this.focusin.bind(this);\n\n  #boundFocusout = this.focusout.bind(this);\n\n  #editToolbar = null;\n\n  #focusedResizerName = \"\";\n\n  #hasBeenClicked = false;\n\n  #isEditing = false;\n\n  #isInEditMode = false;\n\n  #isResizerEnabledForKeyboard = false;\n\n  #moveInDOMTimeout = null;\n\n  _initialOptions = Object.create(null);\n\n  _uiManager = null;\n\n  _focusEventsAllowed = true;\n\n  _l10nPromise = null;\n\n  #isDraggable = false;\n\n  #zIndex = AnnotationEditor._zIndex++;\n\n  static _borderLineWidth = -1;\n\n  static _colorManager = new ColorManager();\n\n  static _zIndex = 1;\n\n  // When one of the dimensions of an editor is smaller than this value, the\n  // button to edit the alt text is visually moved outside of the editor.\n  static SMALL_EDITOR_SIZE = 0;\n\n  static get _resizerKeyboardManager() {\n    const resize = AnnotationEditor.prototype._resizeWithKeyboard;\n    const small = AnnotationEditorUIManager.TRANSLATE_SMALL;\n    const big = AnnotationEditorUIManager.TRANSLATE_BIG;\n\n    return shadow(\n      this,\n      \"_resizerKeyboardManager\",\n      new KeyboardManager([\n        [[\"ArrowLeft\", \"mac+ArrowLeft\"], resize, { args: [-small, 0] }],\n        [\n          [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n          resize,\n          { args: [-big, 0] },\n        ],\n        [[\"ArrowRight\", \"mac+ArrowRight\"], resize, { args: [small, 0] }],\n        [\n          [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n          resize,\n          { args: [big, 0] },\n        ],\n        [[\"ArrowUp\", \"mac+ArrowUp\"], resize, { args: [0, -small] }],\n        [[\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"], resize, { args: [0, -big] }],\n        [[\"ArrowDown\", \"mac+ArrowDown\"], resize, { args: [0, small] }],\n        [[\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"], resize, { args: [0, big] }],\n        [\n          [\"Escape\", \"mac+Escape\"],\n          AnnotationEditor.prototype._stopResizingWithKeyboard,\n        ],\n      ])\n    );\n  }\n\n  /**\n   * @param {AnnotationEditorParameters} parameters\n   */\n  constructor(parameters) {\n    if (this.constructor === AnnotationEditor) {\n      unreachable(\"Cannot initialize AnnotationEditor.\");\n    }\n\n    this.parent = parameters.parent;\n    this.id = parameters.id;\n    this.width = this.height = null;\n    this.pageIndex = parameters.parent.pageIndex;\n    this.name = parameters.name;\n    this.div = null;\n    this._uiManager = parameters.uiManager;\n    this.annotationElementId = null;\n    this._willKeepAspectRatio = false;\n    this._initialOptions.isCentered = parameters.isCentered;\n    this._structTreeParentId = null;\n\n    const {\n      rotation,\n      rawDims: { pageWidth, pageHeight, pageX, pageY },\n    } = this.parent.viewport;\n\n    this.rotation = rotation;\n    this.pageRotation =\n      (360 + rotation - this._uiManager.viewParameters.rotation) % 360;\n    this.pageDimensions = [pageWidth, pageHeight];\n    this.pageTranslation = [pageX, pageY];\n\n    const [width, height] = this.parentDimensions;\n    this.x = parameters.x / width;\n    this.y = parameters.y / height;\n\n    this.isAttachedToDOM = false;\n    this.deleted = false;\n  }\n\n  get editorType() {\n    return Object.getPrototypeOf(this).constructor._type;\n  }\n\n  static get _defaultLineColor() {\n    return shadow(\n      this,\n      \"_defaultLineColor\",\n      this._colorManager.getHexCode(\"CanvasText\")\n    );\n  }\n\n  static deleteAnnotationElement(editor) {\n    const fakeEditor = new FakeEditor({\n      id: editor.parent.getNextId(),\n      parent: editor.parent,\n      uiManager: editor._uiManager,\n    });\n    fakeEditor.annotationElementId = editor.annotationElementId;\n    fakeEditor.deleted = true;\n    fakeEditor._uiManager.addToAnnotationStorage(fakeEditor);\n  }\n\n  /**\n   * Initialize the l10n stuff for this type of editor.\n   * @param {Object} l10n\n   */\n  static initialize(l10n, options = null) {\n    AnnotationEditor._l10nPromise ||= new Map(\n      [\n        \"pdfjs-editor-alt-text-button-label\",\n        \"pdfjs-editor-alt-text-edit-button-label\",\n        \"pdfjs-editor-alt-text-decorative-tooltip\",\n        \"pdfjs-editor-resizer-label-topLeft\",\n        \"pdfjs-editor-resizer-label-topMiddle\",\n        \"pdfjs-editor-resizer-label-topRight\",\n        \"pdfjs-editor-resizer-label-middleRight\",\n        \"pdfjs-editor-resizer-label-bottomRight\",\n        \"pdfjs-editor-resizer-label-bottomMiddle\",\n        \"pdfjs-editor-resizer-label-bottomLeft\",\n        \"pdfjs-editor-resizer-label-middleLeft\",\n      ].map(str => [\n        str,\n        l10n.get(str.replaceAll(/([A-Z])/g, c => `-${c.toLowerCase()}`)),\n      ])\n    );\n    if (options?.strings) {\n      for (const str of options.strings) {\n        AnnotationEditor._l10nPromise.set(str, l10n.get(str));\n      }\n    }\n    if (AnnotationEditor._borderLineWidth !== -1) {\n      return;\n    }\n    const style = getComputedStyle(document.documentElement);\n    AnnotationEditor._borderLineWidth =\n      parseFloat(style.getPropertyValue(\"--outline-width\")) || 0;\n  }\n\n  /**\n   * Update the default parameters for this type of editor.\n   * @param {number} _type\n   * @param {*} _value\n   */\n  static updateDefaultParams(_type, _value) {}\n\n  /**\n   * Get the default properties to set in the UI for this type of editor.\n   * @returns {Array}\n   */\n  static get defaultPropertiesToUpdate() {\n    return [];\n  }\n\n  /**\n   * Check if this kind of editor is able to handle the given mime type for\n   * pasting.\n   * @param {string} mime\n   * @returns {boolean}\n   */\n  static isHandlingMimeForPasting(mime) {\n    return false;\n  }\n\n  /**\n   * Extract the data from the clipboard item and delegate the creation of the\n   * editor to the parent.\n   * @param {DataTransferItem} item\n   * @param {AnnotationEditorLayer} parent\n   */\n  static paste(item, parent) {\n    unreachable(\"Not implemented\");\n  }\n\n  /**\n   * Get the properties to update in the UI for this editor.\n   * @returns {Array}\n   */\n  get propertiesToUpdate() {\n    return [];\n  }\n\n  get _isDraggable() {\n    return this.#isDraggable;\n  }\n\n  set _isDraggable(value) {\n    this.#isDraggable = value;\n    this.div?.classList.toggle(\"draggable\", value);\n  }\n\n  /**\n   * @returns {boolean} true if the editor handles the Enter key itself.\n   */\n  get isEnterHandled() {\n    return true;\n  }\n\n  center() {\n    const [pageWidth, pageHeight] = this.pageDimensions;\n    switch (this.parentRotation) {\n      case 90:\n        this.x -= (this.height * pageHeight) / (pageWidth * 2);\n        this.y += (this.width * pageWidth) / (pageHeight * 2);\n        break;\n      case 180:\n        this.x += this.width / 2;\n        this.y += this.height / 2;\n        break;\n      case 270:\n        this.x += (this.height * pageHeight) / (pageWidth * 2);\n        this.y -= (this.width * pageWidth) / (pageHeight * 2);\n        break;\n      default:\n        this.x -= this.width / 2;\n        this.y -= this.height / 2;\n        break;\n    }\n    this.fixAndSetPosition();\n  }\n\n  /**\n   * Add some commands into the CommandManager (undo/redo stuff).\n   * @param {Object} params\n   */\n  addCommands(params) {\n    this._uiManager.addCommands(params);\n  }\n\n  get currentLayer() {\n    return this._uiManager.currentLayer;\n  }\n\n  /**\n   * This editor will be behind the others.\n   */\n  setInBackground() {\n    this.div.style.zIndex = 0;\n  }\n\n  /**\n   * This editor will be in the foreground.\n   */\n  setInForeground() {\n    this.div.style.zIndex = this.#zIndex;\n  }\n\n  setParent(parent) {\n    if (parent !== null) {\n      this.pageIndex = parent.pageIndex;\n      this.pageDimensions = parent.pageDimensions;\n    } else {\n      // The editor is being removed from the DOM, so we need to stop resizing.\n      this.#stopResizing();\n    }\n    this.parent = parent;\n  }\n\n  /**\n   * onfocus callback.\n   */\n  focusin(event) {\n    if (!this._focusEventsAllowed) {\n      return;\n    }\n    if (!this.#hasBeenClicked) {\n      this.parent.setSelected(this);\n    } else {\n      this.#hasBeenClicked = false;\n    }\n  }\n\n  /**\n   * onblur callback.\n   * @param {FocusEvent} event\n   */\n  focusout(event) {\n    if (!this._focusEventsAllowed) {\n      return;\n    }\n\n    if (!this.isAttachedToDOM) {\n      return;\n    }\n\n    // In case of focusout, the relatedTarget is the element which\n    // is grabbing the focus.\n    // So if the related target is an element under the div for this\n    // editor, then the editor isn't unactive.\n    const target = event.relatedTarget;\n    if (target?.closest(`#${this.id}`)) {\n      return;\n    }\n\n    event.preventDefault();\n\n    if (!this.parent?.isMultipleSelection) {\n      this.commitOrRemove();\n    }\n  }\n\n  commitOrRemove() {\n    if (this.isEmpty()) {\n      this.remove();\n    } else {\n      this.commit();\n    }\n  }\n\n  /**\n   * Commit the data contained in this editor.\n   */\n  commit() {\n    this.addToAnnotationStorage();\n  }\n\n  addToAnnotationStorage() {\n    this._uiManager.addToAnnotationStorage(this);\n  }\n\n  /**\n   * Set the editor position within its parent.\n   * @param {number} x\n   * @param {number} y\n   * @param {number} tx - x-translation in screen coordinates.\n   * @param {number} ty - y-translation in screen coordinates.\n   */\n  setAt(x, y, tx, ty) {\n    const [width, height] = this.parentDimensions;\n    [tx, ty] = this.screenToPageTranslation(tx, ty);\n\n    this.x = (x + tx) / width;\n    this.y = (y + ty) / height;\n\n    this.fixAndSetPosition();\n  }\n\n  #translate([width, height], x, y) {\n    [x, y] = this.screenToPageTranslation(x, y);\n\n    this.x += x / width;\n    this.y += y / height;\n\n    this.fixAndSetPosition();\n  }\n\n  /**\n   * Translate the editor position within its parent.\n   * @param {number} x - x-translation in screen coordinates.\n   * @param {number} y - y-translation in screen coordinates.\n   */\n  translate(x, y) {\n    this.#translate(this.parentDimensions, x, y);\n  }\n\n  /**\n   * Translate the editor position within its page and adjust the scroll\n   * in order to have the editor in the view.\n   * @param {number} x - x-translation in page coordinates.\n   * @param {number} y - y-translation in page coordinates.\n   */\n  translateInPage(x, y) {\n    this.#translate(this.pageDimensions, x, y);\n    this.div.scrollIntoView({ block: \"nearest\" });\n  }\n\n  drag(tx, ty) {\n    const [parentWidth, parentHeight] = this.parentDimensions;\n    this.x += tx / parentWidth;\n    this.y += ty / parentHeight;\n    if (this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {\n      // It's possible to not have a parent: for example, when the user is\n      // dragging all the selected editors but this one on a page which has been\n      // destroyed.\n      // It's why we need to check for it. In such a situation, it isn't really\n      // a problem to not find a new parent: it's something which is related to\n      // what the user is seeing, hence it depends on how pages are layed out.\n\n      // The element will be outside of its parent so change the parent.\n      const { x, y } = this.div.getBoundingClientRect();\n      if (this.parent.findNewParent(this, x, y)) {\n        this.x -= Math.floor(this.x);\n        this.y -= Math.floor(this.y);\n      }\n    }\n\n    // The editor can be moved wherever the user wants, so we don't need to fix\n    // the position: it'll be done when the user will release the mouse button.\n\n    let { x, y } = this;\n    const [bx, by] = this.#getBaseTranslation();\n    x += bx;\n    y += by;\n\n    this.div.style.left = `${(100 * x).toFixed(2)}%`;\n    this.div.style.top = `${(100 * y).toFixed(2)}%`;\n    this.div.scrollIntoView({ block: \"nearest\" });\n  }\n\n  #getBaseTranslation() {\n    const [parentWidth, parentHeight] = this.parentDimensions;\n    const { _borderLineWidth } = AnnotationEditor;\n    const x = _borderLineWidth / parentWidth;\n    const y = _borderLineWidth / parentHeight;\n    switch (this.rotation) {\n      case 90:\n        return [-x, y];\n      case 180:\n        return [x, y];\n      case 270:\n        return [x, -y];\n      default:\n        return [-x, -y];\n    }\n  }\n\n  fixAndSetPosition() {\n    const [pageWidth, pageHeight] = this.pageDimensions;\n    let { x, y, width, height } = this;\n    width *= pageWidth;\n    height *= pageHeight;\n    x *= pageWidth;\n    y *= pageHeight;\n\n    switch (this.rotation) {\n      case 0:\n        x = Math.max(0, Math.min(pageWidth - width, x));\n        y = Math.max(0, Math.min(pageHeight - height, y));\n        break;\n      case 90:\n        x = Math.max(0, Math.min(pageWidth - height, x));\n        y = Math.min(pageHeight, Math.max(width, y));\n        break;\n      case 180:\n        x = Math.min(pageWidth, Math.max(width, x));\n        y = Math.min(pageHeight, Math.max(height, y));\n        break;\n      case 270:\n        x = Math.min(pageWidth, Math.max(height, x));\n        y = Math.max(0, Math.min(pageHeight - width, y));\n        break;\n    }\n\n    this.x = x /= pageWidth;\n    this.y = y /= pageHeight;\n\n    const [bx, by] = this.#getBaseTranslation();\n    x += bx;\n    y += by;\n\n    const { style } = this.div;\n    style.left = `${(100 * x).toFixed(2)}%`;\n    style.top = `${(100 * y).toFixed(2)}%`;\n\n    this.moveInDOM();\n  }\n\n  static #rotatePoint(x, y, angle) {\n    switch (angle) {\n      case 90:\n        return [y, -x];\n      case 180:\n        return [-x, -y];\n      case 270:\n        return [-y, x];\n      default:\n        return [x, y];\n    }\n  }\n\n  /**\n   * Convert a screen translation into a page one.\n   * @param {number} x\n   * @param {number} y\n   */\n  screenToPageTranslation(x, y) {\n    return AnnotationEditor.#rotatePoint(x, y, this.parentRotation);\n  }\n\n  /**\n   * Convert a page translation into a screen one.\n   * @param {number} x\n   * @param {number} y\n   */\n  pageTranslationToScreen(x, y) {\n    return AnnotationEditor.#rotatePoint(x, y, 360 - this.parentRotation);\n  }\n\n  #getRotationMatrix(rotation) {\n    switch (rotation) {\n      case 90: {\n        const [pageWidth, pageHeight] = this.pageDimensions;\n        return [0, -pageWidth / pageHeight, pageHeight / pageWidth, 0];\n      }\n      case 180:\n        return [-1, 0, 0, -1];\n      case 270: {\n        const [pageWidth, pageHeight] = this.pageDimensions;\n        return [0, pageWidth / pageHeight, -pageHeight / pageWidth, 0];\n      }\n      default:\n        return [1, 0, 0, 1];\n    }\n  }\n\n  get parentScale() {\n    return this._uiManager.viewParameters.realScale;\n  }\n\n  get parentRotation() {\n    return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360;\n  }\n\n  get parentDimensions() {\n    const {\n      parentScale,\n      pageDimensions: [pageWidth, pageHeight],\n    } = this;\n    const scaledWidth = pageWidth * parentScale;\n    const scaledHeight = pageHeight * parentScale;\n    return FeatureTest.isCSSRoundSupported\n      ? [Math.round(scaledWidth), Math.round(scaledHeight)]\n      : [scaledWidth, scaledHeight];\n  }\n\n  /**\n   * Set the dimensions of this editor.\n   * @param {number} width\n   * @param {number} height\n   */\n  setDims(width, height) {\n    const [parentWidth, parentHeight] = this.parentDimensions;\n    this.div.style.width = `${((100 * width) / parentWidth).toFixed(2)}%`;\n    if (!this.#keepAspectRatio) {\n      this.div.style.height = `${((100 * height) / parentHeight).toFixed(2)}%`;\n    }\n    this.#altTextButton?.classList.toggle(\n      \"small\",\n      width < AnnotationEditor.SMALL_EDITOR_SIZE ||\n        height < AnnotationEditor.SMALL_EDITOR_SIZE\n    );\n  }\n\n  fixDims() {\n    const { style } = this.div;\n    const { height, width } = style;\n    const widthPercent = width.endsWith(\"%\");\n    const heightPercent = !this.#keepAspectRatio && height.endsWith(\"%\");\n    if (widthPercent && heightPercent) {\n      return;\n    }\n\n    const [parentWidth, parentHeight] = this.parentDimensions;\n    if (!widthPercent) {\n      style.width = `${((100 * parseFloat(width)) / parentWidth).toFixed(2)}%`;\n    }\n    if (!this.#keepAspectRatio && !heightPercent) {\n      style.height = `${((100 * parseFloat(height)) / parentHeight).toFixed(\n        2\n      )}%`;\n    }\n  }\n\n  /**\n   * Get the translation used to position this editor when it's created.\n   * @returns {Array<number>}\n   */\n  getInitialTranslation() {\n    return [0, 0];\n  }\n\n  #createResizers() {\n    if (this.#resizersDiv) {\n      return;\n    }\n    this.#resizersDiv = document.createElement(\"div\");\n    this.#resizersDiv.classList.add(\"resizers\");\n    // When the resizers are used with the keyboard, they're focusable, hence\n    // we want to have them in this order (top left, top middle, top right, ...)\n    // in the DOM to have the focus order correct.\n    const classes = this._willKeepAspectRatio\n      ? [\"topLeft\", \"topRight\", \"bottomRight\", \"bottomLeft\"]\n      : [\n          \"topLeft\",\n          \"topMiddle\",\n          \"topRight\",\n          \"middleRight\",\n          \"bottomRight\",\n          \"bottomMiddle\",\n          \"bottomLeft\",\n          \"middleLeft\",\n        ];\n    for (const name of classes) {\n      const div = document.createElement(\"div\");\n      this.#resizersDiv.append(div);\n      div.classList.add(\"resizer\", name);\n      div.setAttribute(\"data-resizer-name\", name);\n      div.addEventListener(\n        \"pointerdown\",\n        this.#resizerPointerdown.bind(this, name)\n      );\n      div.addEventListener(\"contextmenu\", noContextMenu);\n      div.tabIndex = -1;\n    }\n    this.div.prepend(this.#resizersDiv);\n  }\n\n  #resizerPointerdown(name, event) {\n    event.preventDefault();\n    const { isMac } = FeatureTest.platform;\n    if (event.button !== 0 || (event.ctrlKey && isMac)) {\n      return;\n    }\n\n    this.#toggleAltTextButton(false);\n\n    const boundResizerPointermove = this.#resizerPointermove.bind(this, name);\n    const savedDraggable = this._isDraggable;\n    this._isDraggable = false;\n    const pointerMoveOptions = { passive: true, capture: true };\n    this.parent.togglePointerEvents(false);\n    window.addEventListener(\n      \"pointermove\",\n      boundResizerPointermove,\n      pointerMoveOptions\n    );\n    const savedX = this.x;\n    const savedY = this.y;\n    const savedWidth = this.width;\n    const savedHeight = this.height;\n    const savedParentCursor = this.parent.div.style.cursor;\n    const savedCursor = this.div.style.cursor;\n    this.div.style.cursor = this.parent.div.style.cursor =\n      window.getComputedStyle(event.target).cursor;\n\n    const pointerUpCallback = () => {\n      this.parent.togglePointerEvents(true);\n      this.#toggleAltTextButton(true);\n      this._isDraggable = savedDraggable;\n      window.removeEventListener(\"pointerup\", pointerUpCallback);\n      window.removeEventListener(\"blur\", pointerUpCallback);\n      window.removeEventListener(\n        \"pointermove\",\n        boundResizerPointermove,\n        pointerMoveOptions\n      );\n      this.parent.div.style.cursor = savedParentCursor;\n      this.div.style.cursor = savedCursor;\n\n      this.#addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight);\n    };\n    window.addEventListener(\"pointerup\", pointerUpCallback);\n    // If the user switches to another window (with alt+tab), then we end the\n    // resize session.\n    window.addEventListener(\"blur\", pointerUpCallback);\n  }\n\n  #addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight) {\n    const newX = this.x;\n    const newY = this.y;\n    const newWidth = this.width;\n    const newHeight = this.height;\n    if (\n      newX === savedX &&\n      newY === savedY &&\n      newWidth === savedWidth &&\n      newHeight === savedHeight\n    ) {\n      return;\n    }\n\n    this.addCommands({\n      cmd: () => {\n        this.width = newWidth;\n        this.height = newHeight;\n        this.x = newX;\n        this.y = newY;\n        const [parentWidth, parentHeight] = this.parentDimensions;\n        this.setDims(parentWidth * newWidth, parentHeight * newHeight);\n        this.fixAndSetPosition();\n      },\n      undo: () => {\n        this.width = savedWidth;\n        this.height = savedHeight;\n        this.x = savedX;\n        this.y = savedY;\n        const [parentWidth, parentHeight] = this.parentDimensions;\n        this.setDims(parentWidth * savedWidth, parentHeight * savedHeight);\n        this.fixAndSetPosition();\n      },\n      mustExec: true,\n    });\n  }\n\n  #resizerPointermove(name, event) {\n    const [parentWidth, parentHeight] = this.parentDimensions;\n    const savedX = this.x;\n    const savedY = this.y;\n    const savedWidth = this.width;\n    const savedHeight = this.height;\n    const minWidth = AnnotationEditor.MIN_SIZE / parentWidth;\n    const minHeight = AnnotationEditor.MIN_SIZE / parentHeight;\n\n    // 10000 because we multiply by 100 and use toFixed(2) in fixAndSetPosition.\n    // Without rounding, the positions of the corners other than the top left\n    // one can be slightly wrong.\n    const round = x => Math.round(x * 10000) / 10000;\n    const rotationMatrix = this.#getRotationMatrix(this.rotation);\n    const transf = (x, y) => [\n      rotationMatrix[0] * x + rotationMatrix[2] * y,\n      rotationMatrix[1] * x + rotationMatrix[3] * y,\n    ];\n    const invRotationMatrix = this.#getRotationMatrix(360 - this.rotation);\n    const invTransf = (x, y) => [\n      invRotationMatrix[0] * x + invRotationMatrix[2] * y,\n      invRotationMatrix[1] * x + invRotationMatrix[3] * y,\n    ];\n    let getPoint;\n    let getOpposite;\n    let isDiagonal = false;\n    let isHorizontal = false;\n\n    switch (name) {\n      case \"topLeft\":\n        isDiagonal = true;\n        getPoint = (w, h) => [0, 0];\n        getOpposite = (w, h) => [w, h];\n        break;\n      case \"topMiddle\":\n        getPoint = (w, h) => [w / 2, 0];\n        getOpposite = (w, h) => [w / 2, h];\n        break;\n      case \"topRight\":\n        isDiagonal = true;\n        getPoint = (w, h) => [w, 0];\n        getOpposite = (w, h) => [0, h];\n        break;\n      case \"middleRight\":\n        isHorizontal = true;\n        getPoint = (w, h) => [w, h / 2];\n        getOpposite = (w, h) => [0, h / 2];\n        break;\n      case \"bottomRight\":\n        isDiagonal = true;\n        getPoint = (w, h) => [w, h];\n        getOpposite = (w, h) => [0, 0];\n        break;\n      case \"bottomMiddle\":\n        getPoint = (w, h) => [w / 2, h];\n        getOpposite = (w, h) => [w / 2, 0];\n        break;\n      case \"bottomLeft\":\n        isDiagonal = true;\n        getPoint = (w, h) => [0, h];\n        getOpposite = (w, h) => [w, 0];\n        break;\n      case \"middleLeft\":\n        isHorizontal = true;\n        getPoint = (w, h) => [0, h / 2];\n        getOpposite = (w, h) => [w, h / 2];\n        break;\n    }\n\n    const point = getPoint(savedWidth, savedHeight);\n    const oppositePoint = getOpposite(savedWidth, savedHeight);\n    let transfOppositePoint = transf(...oppositePoint);\n    const oppositeX = round(savedX + transfOppositePoint[0]);\n    const oppositeY = round(savedY + transfOppositePoint[1]);\n    let ratioX = 1;\n    let ratioY = 1;\n\n    let [deltaX, deltaY] = this.screenToPageTranslation(\n      event.movementX,\n      event.movementY\n    );\n    [deltaX, deltaY] = invTransf(deltaX / parentWidth, deltaY / parentHeight);\n\n    if (isDiagonal) {\n      const oldDiag = Math.hypot(savedWidth, savedHeight);\n      ratioX = ratioY = Math.max(\n        Math.min(\n          Math.hypot(\n            oppositePoint[0] - point[0] - deltaX,\n            oppositePoint[1] - point[1] - deltaY\n          ) / oldDiag,\n          // Avoid the editor to be larger than the page.\n          1 / savedWidth,\n          1 / savedHeight\n        ),\n        // Avoid the editor to be smaller than the minimum size.\n        minWidth / savedWidth,\n        minHeight / savedHeight\n      );\n    } else if (isHorizontal) {\n      ratioX =\n        Math.max(\n          minWidth,\n          Math.min(1, Math.abs(oppositePoint[0] - point[0] - deltaX))\n        ) / savedWidth;\n    } else {\n      ratioY =\n        Math.max(\n          minHeight,\n          Math.min(1, Math.abs(oppositePoint[1] - point[1] - deltaY))\n        ) / savedHeight;\n    }\n\n    const newWidth = round(savedWidth * ratioX);\n    const newHeight = round(savedHeight * ratioY);\n    transfOppositePoint = transf(...getOpposite(newWidth, newHeight));\n    const newX = oppositeX - transfOppositePoint[0];\n    const newY = oppositeY - transfOppositePoint[1];\n\n    this.width = newWidth;\n    this.height = newHeight;\n    this.x = newX;\n    this.y = newY;\n\n    this.setDims(parentWidth * newWidth, parentHeight * newHeight);\n    this.fixAndSetPosition();\n  }\n\n  async addAltTextButton() {\n    if (this.#altTextButton) {\n      return;\n    }\n    const altText = (this.#altTextButton = document.createElement(\"button\"));\n    altText.className = \"altText\";\n    const msg = await AnnotationEditor._l10nPromise.get(\n      \"pdfjs-editor-alt-text-button-label\"\n    );\n    altText.textContent = msg;\n    altText.setAttribute(\"aria-label\", msg);\n    altText.tabIndex = \"0\";\n    altText.addEventListener(\"contextmenu\", noContextMenu);\n    altText.addEventListener(\"pointerdown\", event => event.stopPropagation());\n\n    const onClick = event => {\n      this.#altTextButton.hidden = true;\n      event.preventDefault();\n      this._uiManager.editAltText(this);\n    };\n    altText.addEventListener(\"click\", onClick, { capture: true });\n    altText.addEventListener(\"keydown\", event => {\n      if (event.target === altText && event.key === \"Enter\") {\n        this.#altTextWasFromKeyBoard = true;\n        onClick(event);\n      }\n    });\n    this.#setAltTextButtonState();\n    this.div.append(altText);\n    if (!AnnotationEditor.SMALL_EDITOR_SIZE) {\n      // We take the width of the alt text button and we add 40% to it to be\n      // sure to have enough space for it.\n      const PERCENT = 40;\n      AnnotationEditor.SMALL_EDITOR_SIZE = Math.min(\n        128,\n        Math.round(altText.getBoundingClientRect().width * (1 + PERCENT / 100))\n      );\n    }\n  }\n\n  async #setAltTextButtonState() {\n    const button = this.#altTextButton;\n    if (!button) {\n      return;\n    }\n    if (!this.#altText && !this.#altTextDecorative) {\n      button.classList.remove(\"done\");\n      this.#altTextTooltip?.remove();\n      return;\n    }\n    button.classList.add(\"done\");\n\n    AnnotationEditor._l10nPromise\n      .get(\"pdfjs-editor-alt-text-edit-button-label\")\n      .then(msg => {\n        button.setAttribute(\"aria-label\", msg);\n      });\n    let tooltip = this.#altTextTooltip;\n    if (!tooltip) {\n      this.#altTextTooltip = tooltip = document.createElement(\"span\");\n      tooltip.className = \"tooltip\";\n      tooltip.setAttribute(\"role\", \"tooltip\");\n      const id = (tooltip.id = `alt-text-tooltip-${this.id}`);\n      button.setAttribute(\"aria-describedby\", id);\n\n      const DELAY_TO_SHOW_TOOLTIP = 100;\n      button.addEventListener(\"mouseenter\", () => {\n        this.#altTextTooltipTimeout = setTimeout(() => {\n          this.#altTextTooltipTimeout = null;\n          this.#altTextTooltip.classList.add(\"show\");\n          this._uiManager._eventBus.dispatch(\"reporttelemetry\", {\n            source: this,\n            details: {\n              type: \"editing\",\n              subtype: this.editorType,\n              data: {\n                action: \"alt_text_tooltip\",\n              },\n            },\n          });\n        }, DELAY_TO_SHOW_TOOLTIP);\n      });\n      button.addEventListener(\"mouseleave\", () => {\n        if (this.#altTextTooltipTimeout) {\n          clearTimeout(this.#altTextTooltipTimeout);\n          this.#altTextTooltipTimeout = null;\n        }\n        this.#altTextTooltip?.classList.remove(\"show\");\n      });\n    }\n    tooltip.innerText = this.#altTextDecorative\n      ? await AnnotationEditor._l10nPromise.get(\n          \"pdfjs-editor-alt-text-decorative-tooltip\"\n        )\n      : this.#altText;\n\n    if (!tooltip.parentNode) {\n      button.append(tooltip);\n    }\n\n    const element = this.getImageForAltText();\n    element?.setAttribute(\"aria-describedby\", tooltip.id);\n  }\n\n  #toggleAltTextButton(enabled = false) {\n    if (!this.#altTextButton) {\n      return;\n    }\n    if (!enabled && this.#altTextTooltipTimeout) {\n      clearTimeout(this.#altTextTooltipTimeout);\n      this.#altTextTooltipTimeout = null;\n    }\n    this.#altTextButton.disabled = !enabled;\n  }\n\n  altTextFinish() {\n    if (!this.#altTextButton) {\n      return;\n    }\n    this.#altTextButton.hidden = false;\n    this.#altTextButton.focus({ focusVisible: this.#altTextWasFromKeyBoard });\n    this.#altTextWasFromKeyBoard = false;\n  }\n\n  addEditToolbar() {\n    if (this.#editToolbar || this.#isInEditMode) {\n      return;\n    }\n    this.#editToolbar = new EditorToolbar(this);\n    this.div.append(this.#editToolbar.render());\n  }\n\n  removeEditToolbar() {\n    if (!this.#editToolbar) {\n      return;\n    }\n    this.#editToolbar.remove();\n    this.#editToolbar = null;\n  }\n\n  getClientDimensions() {\n    return this.div.getBoundingClientRect();\n  }\n\n  get altTextData() {\n    return {\n      altText: this.#altText,\n      decorative: this.#altTextDecorative,\n    };\n  }\n\n  /**\n   * Set the alt text data.\n   */\n  set altTextData({ altText, decorative }) {\n    if (this.#altText === altText && this.#altTextDecorative === decorative) {\n      return;\n    }\n    this.#altText = altText;\n    this.#altTextDecorative = decorative;\n    this.#setAltTextButtonState();\n  }\n\n  /**\n   * Render this editor in a div.\n   * @returns {HTMLDivElement | null}\n   */\n  render() {\n    this.div = document.createElement(\"div\");\n    this.div.setAttribute(\"data-editor-rotation\", (360 - this.rotation) % 360);\n    this.div.className = this.name;\n    this.div.setAttribute(\"id\", this.id);\n    this.div.setAttribute(\"tabIndex\", 0);\n\n    this.setInForeground();\n\n    this.div.addEventListener(\"focusin\", this.#boundFocusin);\n    this.div.addEventListener(\"focusout\", this.#boundFocusout);\n\n    const [parentWidth, parentHeight] = this.parentDimensions;\n    if (this.parentRotation % 180 !== 0) {\n      this.div.style.maxWidth = `${((100 * parentHeight) / parentWidth).toFixed(\n        2\n      )}%`;\n      this.div.style.maxHeight = `${(\n        (100 * parentWidth) /\n        parentHeight\n      ).toFixed(2)}%`;\n    }\n\n    const [tx, ty] = this.getInitialTranslation();\n    this.translate(tx, ty);\n\n    bindEvents(this, this.div, [\"pointerdown\"]);\n\n    return this.div;\n  }\n\n  /**\n   * Onpointerdown callback.\n   * @param {PointerEvent} event\n   */\n  pointerdown(event) {\n    const { isMac } = FeatureTest.platform;\n    if (event.button !== 0 || (event.ctrlKey && isMac)) {\n      // Avoid to focus this editor because of a non-left click.\n      event.preventDefault();\n      return;\n    }\n\n    this.#hasBeenClicked = true;\n\n    this.#setUpDragSession(event);\n  }\n\n  #setUpDragSession(event) {\n    if (!this._isDraggable) {\n      return;\n    }\n\n    const isSelected = this._uiManager.isSelected(this);\n    this._uiManager.setUpDragSession();\n\n    let pointerMoveOptions, pointerMoveCallback;\n    if (isSelected) {\n      pointerMoveOptions = { passive: true, capture: true };\n      pointerMoveCallback = e => {\n        const [tx, ty] = this.screenToPageTranslation(e.movementX, e.movementY);\n        this._uiManager.dragSelectedEditors(tx, ty);\n      };\n      window.addEventListener(\n        \"pointermove\",\n        pointerMoveCallback,\n        pointerMoveOptions\n      );\n    }\n\n    const pointerUpCallback = () => {\n      window.removeEventListener(\"pointerup\", pointerUpCallback);\n      window.removeEventListener(\"blur\", pointerUpCallback);\n      if (isSelected) {\n        window.removeEventListener(\n          \"pointermove\",\n          pointerMoveCallback,\n          pointerMoveOptions\n        );\n      }\n\n      this.#hasBeenClicked = false;\n      if (!this._uiManager.endDragSession()) {\n        const { isMac } = FeatureTest.platform;\n        if (\n          (event.ctrlKey && !isMac) ||\n          event.shiftKey ||\n          (event.metaKey && isMac)\n        ) {\n          this.parent.toggleSelected(this);\n        } else {\n          this.parent.setSelected(this);\n        }\n      }\n    };\n    window.addEventListener(\"pointerup\", pointerUpCallback);\n    // If the user is using alt+tab during the dragging session, the pointerup\n    // event could be not fired, but a blur event is fired so we can use it in\n    // order to interrupt the dragging session.\n    window.addEventListener(\"blur\", pointerUpCallback);\n  }\n\n  moveInDOM() {\n    // Moving the editor in the DOM can be expensive, so we wait a bit before.\n    // It's important to not block the UI (for example when changing the font\n    // size in a FreeText).\n    if (this.#moveInDOMTimeout) {\n      clearTimeout(this.#moveInDOMTimeout);\n    }\n    this.#moveInDOMTimeout = setTimeout(() => {\n      this.#moveInDOMTimeout = null;\n      this.parent?.moveEditorInDOM(this);\n    }, 0);\n  }\n\n  _setParentAndPosition(parent, x, y) {\n    parent.changeParent(this);\n    this.x = x;\n    this.y = y;\n    this.fixAndSetPosition();\n  }\n\n  /**\n   * Convert the current rect into a page one.\n   */\n  getRect(tx, ty) {\n    const scale = this.parentScale;\n    const [pageWidth, pageHeight] = this.pageDimensions;\n    const [pageX, pageY] = this.pageTranslation;\n    const shiftX = tx / scale;\n    const shiftY = ty / scale;\n    const x = this.x * pageWidth;\n    const y = this.y * pageHeight;\n    const width = this.width * pageWidth;\n    const height = this.height * pageHeight;\n\n    switch (this.rotation) {\n      case 0:\n        return [\n          x + shiftX + pageX,\n          pageHeight - y - shiftY - height + pageY,\n          x + shiftX + width + pageX,\n          pageHeight - y - shiftY + pageY,\n        ];\n      case 90:\n        return [\n          x + shiftY + pageX,\n          pageHeight - y + shiftX + pageY,\n          x + shiftY + height + pageX,\n          pageHeight - y + shiftX + width + pageY,\n        ];\n      case 180:\n        return [\n          x - shiftX - width + pageX,\n          pageHeight - y + shiftY + pageY,\n          x - shiftX + pageX,\n          pageHeight - y + shiftY + height + pageY,\n        ];\n      case 270:\n        return [\n          x - shiftY - height + pageX,\n          pageHeight - y - shiftX - width + pageY,\n          x - shiftY + pageX,\n          pageHeight - y - shiftX + pageY,\n        ];\n      default:\n        throw new Error(\"Invalid rotation\");\n    }\n  }\n\n  getRectInCurrentCoords(rect, pageHeight) {\n    const [x1, y1, x2, y2] = rect;\n\n    const width = x2 - x1;\n    const height = y2 - y1;\n\n    switch (this.rotation) {\n      case 0:\n        return [x1, pageHeight - y2, width, height];\n      case 90:\n        return [x1, pageHeight - y1, height, width];\n      case 180:\n        return [x2, pageHeight - y1, width, height];\n      case 270:\n        return [x2, pageHeight - y2, height, width];\n      default:\n        throw new Error(\"Invalid rotation\");\n    }\n  }\n\n  /**\n   * Executed once this editor has been rendered.\n   */\n  onceAdded() {}\n\n  /**\n   * Check if the editor contains something.\n   * @returns {boolean}\n   */\n  isEmpty() {\n    return false;\n  }\n\n  /**\n   * Enable edit mode.\n   */\n  enableEditMode() {\n    this.#isInEditMode = true;\n  }\n\n  /**\n   * Disable edit mode.\n   */\n  disableEditMode() {\n    this.#isInEditMode = false;\n  }\n\n  /**\n   * Check if the editor is edited.\n   * @returns {boolean}\n   */\n  isInEditMode() {\n    return this.#isInEditMode;\n  }\n\n  /**\n   * If it returns true, then this editor handles the keyboard\n   * events itself.\n   * @returns {boolean}\n   */\n  shouldGetKeyboardEvents() {\n    return this.#isResizerEnabledForKeyboard;\n  }\n\n  /**\n   * Check if this editor needs to be rebuilt or not.\n   * @returns {boolean}\n   */\n  needsToBeRebuilt() {\n    return this.div && !this.isAttachedToDOM;\n  }\n\n  /**\n   * Rebuild the editor in case it has been removed on undo.\n   *\n   * To implement in subclasses.\n   */\n  rebuild() {\n    this.div?.addEventListener(\"focusin\", this.#boundFocusin);\n    this.div?.addEventListener(\"focusout\", this.#boundFocusout);\n  }\n\n  /**\n   * Serialize the editor.\n   * The result of the serialization will be used to construct a\n   * new annotation to add to the pdf document.\n   *\n   * To implement in subclasses.\n   * @param {boolean} [isForCopying]\n   * @param {Object | null} [context]\n   * @returns {Object | null}\n   */\n  serialize(isForCopying = false, context = null) {\n    unreachable(\"An editor must be serializable\");\n  }\n\n  /**\n   * Deserialize the editor.\n   * The result of the deserialization is a new editor.\n   *\n   * @param {Object} data\n   * @param {AnnotationEditorLayer} parent\n   * @param {AnnotationEditorUIManager} uiManager\n   * @returns {AnnotationEditor | null}\n   */\n  static deserialize(data, parent, uiManager) {\n    const editor = new this.prototype.constructor({\n      parent,\n      id: parent.getNextId(),\n      uiManager,\n    });\n    editor.rotation = data.rotation;\n\n    const [pageWidth, pageHeight] = editor.pageDimensions;\n    const [x, y, width, height] = editor.getRectInCurrentCoords(\n      data.rect,\n      pageHeight\n    );\n    editor.x = x / pageWidth;\n    editor.y = y / pageHeight;\n    editor.width = width / pageWidth;\n    editor.height = height / pageHeight;\n\n    return editor;\n  }\n\n  /**\n   * Remove this editor.\n   * It's used on ctrl+backspace action.\n   */\n  remove() {\n    this.div.removeEventListener(\"focusin\", this.#boundFocusin);\n    this.div.removeEventListener(\"focusout\", this.#boundFocusout);\n\n    if (!this.isEmpty()) {\n      // The editor is removed but it can be back at some point thanks to\n      // undo/redo so we must commit it before.\n      this.commit();\n    }\n    if (this.parent) {\n      this.parent.remove(this);\n    } else {\n      this._uiManager.removeEditor(this);\n    }\n\n    // The editor is removed so we can remove the alt text button and if it's\n    // restored then it's up to the subclass to add it back.\n    this.#altTextButton?.remove();\n    this.#altTextButton = null;\n    this.#altTextTooltip = null;\n    if (this.#moveInDOMTimeout) {\n      clearTimeout(this.#moveInDOMTimeout);\n      this.#moveInDOMTimeout = null;\n    }\n    this.#stopResizing();\n    this.removeEditToolbar();\n  }\n\n  /**\n   * @returns {boolean} true if this editor can be resized.\n   */\n  get isResizable() {\n    return false;\n  }\n\n  /**\n   * Add the resizers to this editor.\n   */\n  makeResizable() {\n    if (this.isResizable) {\n      this.#createResizers();\n      this.#resizersDiv.classList.remove(\"hidden\");\n      bindEvents(this, this.div, [\"keydown\"]);\n    }\n  }\n\n  /**\n   * onkeydown callback.\n   * @param {KeyboardEvent} event\n   */\n  keydown(event) {\n    if (\n      !this.isResizable ||\n      event.target !== this.div ||\n      event.key !== \"Enter\"\n    ) {\n      return;\n    }\n    this._uiManager.setSelected(this);\n    this.#savedDimensions = {\n      savedX: this.x,\n      savedY: this.y,\n      savedWidth: this.width,\n      savedHeight: this.height,\n    };\n    const children = this.#resizersDiv.children;\n    if (!this.#allResizerDivs) {\n      this.#allResizerDivs = Array.from(children);\n      const boundResizerKeydown = this.#resizerKeydown.bind(this);\n      const boundResizerBlur = this.#resizerBlur.bind(this);\n      for (const div of this.#allResizerDivs) {\n        const name = div.getAttribute(\"data-resizer-name\");\n        div.setAttribute(\"role\", \"spinbutton\");\n        div.addEventListener(\"keydown\", boundResizerKeydown);\n        div.addEventListener(\"blur\", boundResizerBlur);\n        div.addEventListener(\"focus\", this.#resizerFocus.bind(this, name));\n        AnnotationEditor._l10nPromise\n          .get(`pdfjs-editor-resizer-label-${name}`)\n          .then(msg => div.setAttribute(\"aria-label\", msg));\n      }\n    }\n\n    // We want to have the resizers in the visual order, so we move the first\n    // (top-left) to the right place.\n    const first = this.#allResizerDivs[0];\n    let firstPosition = 0;\n    for (const div of children) {\n      if (div === first) {\n        break;\n      }\n      firstPosition++;\n    }\n    const nextFirstPosition =\n      (((360 - this.rotation + this.parentRotation) % 360) / 90) *\n      (this.#allResizerDivs.length / 4);\n\n    if (nextFirstPosition !== firstPosition) {\n      // We need to reorder the resizers in the DOM in order to have the focus\n      // on the top-left one.\n      if (nextFirstPosition < firstPosition) {\n        for (let i = 0; i < firstPosition - nextFirstPosition; i++) {\n          this.#resizersDiv.append(this.#resizersDiv.firstChild);\n        }\n      } else if (nextFirstPosition > firstPosition) {\n        for (let i = 0; i < nextFirstPosition - firstPosition; i++) {\n          this.#resizersDiv.firstChild.before(this.#resizersDiv.lastChild);\n        }\n      }\n\n      let i = 0;\n      for (const child of children) {\n        const div = this.#allResizerDivs[i++];\n        const name = div.getAttribute(\"data-resizer-name\");\n        AnnotationEditor._l10nPromise\n          .get(`pdfjs-editor-resizer-label-${name}`)\n          .then(msg => child.setAttribute(\"aria-label\", msg));\n      }\n    }\n\n    this.#setResizerTabIndex(0);\n    this.#isResizerEnabledForKeyboard = true;\n    this.#resizersDiv.firstChild.focus({ focusVisible: true });\n    event.preventDefault();\n    event.stopImmediatePropagation();\n  }\n\n  #resizerKeydown(event) {\n    AnnotationEditor._resizerKeyboardManager.exec(this, event);\n  }\n\n  #resizerBlur(event) {\n    if (\n      this.#isResizerEnabledForKeyboard &&\n      event.relatedTarget?.parentNode !== this.#resizersDiv\n    ) {\n      this.#stopResizing();\n    }\n  }\n\n  #resizerFocus(name) {\n    this.#focusedResizerName = this.#isResizerEnabledForKeyboard ? name : \"\";\n  }\n\n  #setResizerTabIndex(value) {\n    if (!this.#allResizerDivs) {\n      return;\n    }\n    for (const div of this.#allResizerDivs) {\n      div.tabIndex = value;\n    }\n  }\n\n  _resizeWithKeyboard(x, y) {\n    if (!this.#isResizerEnabledForKeyboard) {\n      return;\n    }\n    this.#resizerPointermove(this.#focusedResizerName, {\n      movementX: x,\n      movementY: y,\n    });\n  }\n\n  #stopResizing() {\n    this.#isResizerEnabledForKeyboard = false;\n    this.#setResizerTabIndex(-1);\n    if (this.#savedDimensions) {\n      const { savedX, savedY, savedWidth, savedHeight } = this.#savedDimensions;\n      this.#addResizeToUndoStack(savedX, savedY, savedWidth, savedHeight);\n      this.#savedDimensions = null;\n    }\n  }\n\n  _stopResizingWithKeyboard() {\n    this.#stopResizing();\n    this.div.focus();\n  }\n\n  /**\n   * Select this editor.\n   */\n  select() {\n    this.makeResizable();\n    this.div?.classList.add(\"selectedEditor\");\n    this.addEditToolbar();\n    this.#editToolbar?.show();\n  }\n\n  /**\n   * Unselect this editor.\n   */\n  unselect() {\n    this.#resizersDiv?.classList.add(\"hidden\");\n    this.div?.classList.remove(\"selectedEditor\");\n    if (this.div?.contains(document.activeElement)) {\n      // Don't use this.div.blur() because we don't know where the focus will\n      // go.\n      this._uiManager.currentLayer.div.focus();\n    }\n    this.#editToolbar?.hide();\n  }\n\n  /**\n   * Update some parameters which have been changed through the UI.\n   * @param {number} type\n   * @param {*} value\n   */\n  updateParams(type, value) {}\n\n  /**\n   * When the user disables the editing mode some editors can change some of\n   * their properties.\n   */\n  disableEditing() {\n    if (this.#altTextButton) {\n      this.#altTextButton.hidden = true;\n    }\n  }\n\n  /**\n   * When the user enables the editing mode some editors can change some of\n   * their properties.\n   */\n  enableEditing() {\n    if (this.#altTextButton) {\n      this.#altTextButton.hidden = false;\n    }\n  }\n\n  /**\n   * The editor is about to be edited.\n   */\n  enterInEditMode() {}\n\n  /**\n   * @returns {HTMLElement | null} the element requiring an alt text.\n   */\n  getImageForAltText() {\n    return null;\n  }\n\n  /**\n   * Get the div which really contains the displayed content.\n   * @returns {HTMLDivElement | undefined}\n   */\n  get contentDiv() {\n    return this.div;\n  }\n\n  /**\n   * If true then the editor is currently edited.\n   * @type {boolean}\n   */\n  get isEditing() {\n    return this.#isEditing;\n  }\n\n  /**\n   * When set to true, it means that this editor is currently edited.\n   * @param {boolean} value\n   */\n  set isEditing(value) {\n    this.#isEditing = value;\n    if (!this.parent) {\n      return;\n    }\n    if (value) {\n      this.parent.setSelected(this);\n      this.parent.setActiveEditor(this);\n    } else {\n      this.parent.setActiveEditor(null);\n    }\n  }\n\n  /**\n   * Set the aspect ratio to use when resizing.\n   * @param {number} width\n   * @param {number} height\n   */\n  setAspectRatio(width, height) {\n    this.#keepAspectRatio = true;\n    const aspectRatio = width / height;\n    const { style } = this.div;\n    style.aspectRatio = aspectRatio;\n    style.height = \"auto\";\n  }\n\n  static get MIN_SIZE() {\n    return 16;\n  }\n}\n\n// This class is used to fake an editor which has been deleted.\nclass FakeEditor extends AnnotationEditor {\n  constructor(params) {\n    super(params);\n    this.annotationElementId = params.annotationElementId;\n    this.deleted = true;\n  }\n\n  serialize() {\n    return {\n      id: this.annotationElementId,\n      deleted: true,\n      pageIndex: this.pageIndex,\n    };\n  }\n}\n\nexport { AnnotationEditor };\n","/* Copyright 2023 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nclass Outliner {\n  #box;\n\n  #verticalEdges = [];\n\n  #intervals = [];\n\n  /**\n   * Construct an outliner.\n   * @param {Array<Object>} boxes - An array of axis-aligned rectangles.\n   * @param {number} borderWidth - The width of the border of the boxes, it\n   *   allows to make the boxes bigger (or smaller).\n   * @param {number} innerMargin - The margin between the boxes and the\n   *   outlines. It's important to not have a null innerMargin when we want to\n   *   draw the outline else the stroked outline could be clipped because of its\n   *   width.\n   * @param {boolean} isLTR - true if we're in LTR mode. It's used to determine\n   *   the last point of the boxes.\n   */\n  constructor(boxes, borderWidth = 0, innerMargin = 0, isLTR = true) {\n    let minX = Infinity;\n    let maxX = -Infinity;\n    let minY = Infinity;\n    let maxY = -Infinity;\n\n    // We round the coordinates to slightly reduce the number of edges in the\n    // final outlines.\n    const NUMBER_OF_DIGITS = 4;\n    const EPSILON = 10 ** -NUMBER_OF_DIGITS;\n\n    // The coordinates of the boxes are in the page coordinate system.\n    for (const { x, y, width, height } of boxes) {\n      const x1 = Math.floor((x - borderWidth) / EPSILON) * EPSILON;\n      const x2 = Math.ceil((x + width + borderWidth) / EPSILON) * EPSILON;\n      const y1 = Math.floor((y - borderWidth) / EPSILON) * EPSILON;\n      const y2 = Math.ceil((y + height + borderWidth) / EPSILON) * EPSILON;\n      const left = [x1, y1, y2, true];\n      const right = [x2, y1, y2, false];\n      this.#verticalEdges.push(left, right);\n\n      minX = Math.min(minX, x1);\n      maxX = Math.max(maxX, x2);\n      minY = Math.min(minY, y1);\n      maxY = Math.max(maxY, y2);\n    }\n\n    const bboxWidth = maxX - minX + 2 * innerMargin;\n    const bboxHeight = maxY - minY + 2 * innerMargin;\n    const shiftedMinX = minX - innerMargin;\n    const shiftedMinY = minY - innerMargin;\n    const lastEdge = this.#verticalEdges.at(isLTR ? -1 : -2);\n    const lastPoint = [lastEdge[0], lastEdge[2]];\n\n    // Convert the coordinates of the edges into box coordinates.\n    for (const edge of this.#verticalEdges) {\n      const [x, y1, y2] = edge;\n      edge[0] = (x - shiftedMinX) / bboxWidth;\n      edge[1] = (y1 - shiftedMinY) / bboxHeight;\n      edge[2] = (y2 - shiftedMinY) / bboxHeight;\n    }\n\n    this.#box = {\n      x: shiftedMinX,\n      y: shiftedMinY,\n      width: bboxWidth,\n      height: bboxHeight,\n      lastPoint,\n    };\n  }\n\n  getOutlines() {\n    // We begin to sort lexicographically the vertical edges by their abscissa,\n    // and then by their ordinate.\n    this.#verticalEdges.sort(\n      (a, b) => a[0] - b[0] || a[1] - b[1] || a[2] - b[2]\n    );\n\n    // We're now using a sweep line algorithm to find the outlines.\n    // We start with the leftmost vertical edge, and we're going to iterate\n    // over all the vertical edges from left to right.\n    // Each time we encounter a left edge, we're going to insert the interval\n    // [y1, y2] in the set of intervals.\n    // This set of intervals is used to break the vertical edges into chunks:\n    // we only take the part of the vertical edge that isn't in the union of\n    // the intervals.\n    const outlineVerticalEdges = [];\n    for (const edge of this.#verticalEdges) {\n      if (edge[3]) {\n        // Left edge.\n        outlineVerticalEdges.push(...this.#breakEdge(edge));\n        this.#insert(edge);\n      } else {\n        // Right edge.\n        this.#remove(edge);\n        outlineVerticalEdges.push(...this.#breakEdge(edge));\n      }\n    }\n    return this.#getOutlines(outlineVerticalEdges);\n  }\n\n  #getOutlines(outlineVerticalEdges) {\n    const edges = [];\n    const allEdges = new Set();\n\n    for (const edge of outlineVerticalEdges) {\n      const [x, y1, y2] = edge;\n      edges.push([x, y1, edge], [x, y2, edge]);\n    }\n\n    // We sort lexicographically the vertices of each edge by their ordinate and\n    // by their abscissa.\n    // Every pair (v_2i, v_{2i + 1}) of vertices defines a horizontal edge.\n    // So for every vertical edge, we're going to add the two vertical edges\n    // which are connected to it through a horizontal edge.\n    edges.sort((a, b) => a[1] - b[1] || a[0] - b[0]);\n    for (let i = 0, ii = edges.length; i < ii; i += 2) {\n      const edge1 = edges[i][2];\n      const edge2 = edges[i + 1][2];\n      edge1.push(edge2);\n      edge2.push(edge1);\n      allEdges.add(edge1);\n      allEdges.add(edge2);\n    }\n    const outlines = [];\n    let outline;\n\n    while (allEdges.size > 0) {\n      const edge = allEdges.values().next().value;\n      let [x, y1, y2, edge1, edge2] = edge;\n      allEdges.delete(edge);\n      let lastPointX = x;\n      let lastPointY = y1;\n\n      outline = [x, y2];\n      outlines.push(outline);\n\n      while (true) {\n        let e;\n        if (allEdges.has(edge1)) {\n          e = edge1;\n        } else if (allEdges.has(edge2)) {\n          e = edge2;\n        } else {\n          break;\n        }\n\n        allEdges.delete(e);\n        [x, y1, y2, edge1, edge2] = e;\n\n        if (lastPointX !== x) {\n          outline.push(lastPointX, lastPointY, x, lastPointY === y1 ? y1 : y2);\n          lastPointX = x;\n        }\n        lastPointY = lastPointY === y1 ? y2 : y1;\n      }\n      outline.push(lastPointX, lastPointY);\n    }\n    return { outlines, box: this.#box };\n  }\n\n  #binarySearch(y) {\n    const array = this.#intervals;\n    let start = 0;\n    let end = array.length - 1;\n\n    while (start <= end) {\n      const middle = (start + end) >> 1;\n      const y1 = array[middle][0];\n      if (y1 === y) {\n        return middle;\n      }\n      if (y1 < y) {\n        start = middle + 1;\n      } else {\n        end = middle - 1;\n      }\n    }\n    return end + 1;\n  }\n\n  #insert([, y1, y2]) {\n    const index = this.#binarySearch(y1);\n    this.#intervals.splice(index, 0, [y1, y2]);\n  }\n\n  #remove([, y1, y2]) {\n    const index = this.#binarySearch(y1);\n    for (let i = index; i < this.#intervals.length; i++) {\n      const [start, end] = this.#intervals[i];\n      if (start !== y1) {\n        break;\n      }\n      if (start === y1 && end === y2) {\n        this.#intervals.splice(i, 1);\n        return;\n      }\n    }\n    for (let i = index - 1; i >= 0; i--) {\n      const [start, end] = this.#intervals[i];\n      if (start !== y1) {\n        break;\n      }\n      if (start === y1 && end === y2) {\n        this.#intervals.splice(i, 1);\n        return;\n      }\n    }\n  }\n\n  #breakEdge(edge) {\n    const [x, y1, y2] = edge;\n    const results = [[x, y1, y2]];\n    const index = this.#binarySearch(y2);\n    for (let i = 0; i < index; i++) {\n      const [start, end] = this.#intervals[i];\n      for (let j = 0, jj = results.length; j < jj; j++) {\n        const [, y3, y4] = results[j];\n        if (end <= y3 || y4 <= start) {\n          // There is no intersection between the interval and the edge, hence\n          // we keep it as is.\n          continue;\n        }\n        if (y3 >= start) {\n          if (y4 > end) {\n            results[j][1] = end;\n          } else {\n            if (jj === 1) {\n              return [];\n            }\n            // The edge is included in the interval, hence we remove it.\n            results.splice(j, 1);\n            j--;\n            jj--;\n          }\n          continue;\n        }\n        results[j][2] = start;\n        if (y4 > end) {\n          results.push([x, end, y4]);\n        }\n      }\n    }\n    return results;\n  }\n}\n\nexport { Outliner };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./editor.js\").AnnotationEditor} AnnotationEditor */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n  AnnotationEditorParamsType,\n  AnnotationEditorPrefix,\n  AnnotationEditorType,\n  FeatureTest,\n  getUuid,\n  shadow,\n  Util,\n  warn,\n} from \"../../shared/util.js\";\nimport {\n  fetchData,\n  getColorValues,\n  getRGB,\n  PixelsPerInch,\n} from \"../display_utils.js\";\n\nfunction bindEvents(obj, element, names) {\n  for (const name of names) {\n    element.addEventListener(name, obj[name].bind(obj));\n  }\n}\n\n/**\n * Convert a number between 0 and 100 into an hex number between 0 and 255.\n * @param {number} opacity\n * @return {string}\n */\nfunction opacityToHex(opacity) {\n  return Math.round(Math.min(255, Math.max(1, 255 * opacity)))\n    .toString(16)\n    .padStart(2, \"0\");\n}\n\n/**\n * Class to create some unique ids for the different editors.\n */\nclass IdManager {\n  #id = 0;\n\n  /**\n   * Get a unique id.\n   * @returns {string}\n   */\n  getId() {\n    return `${AnnotationEditorPrefix}${this.#id++}`;\n  }\n}\n\n/**\n * Class to manage the images used by the editors.\n * The main idea is to try to minimize the memory used by the images.\n * The images are cached and reused when possible\n * We use a refCounter to know when an image is not used anymore but we need to\n * be able to restore an image after a remove+undo, so we keep a file reference\n * or an url one.\n */\nclass ImageManager {\n  #baseId = getUuid();\n\n  #id = 0;\n\n  #cache = null;\n\n  static get _isSVGFittingCanvas() {\n    // By default, Firefox doesn't rescale without preserving the aspect ratio\n    // when drawing an SVG image on a canvas, see https://bugzilla.mozilla.org/1547776.\n    // The \"workaround\" is to append \"svgView(preserveAspectRatio(none))\" to the\n    // url, but according to comment #15, it seems that it leads to unexpected\n    // behavior in Safari.\n    const svg = `data:image/svg+xml;charset=UTF-8,<svg viewBox=\"0 0 1 1\" width=\"1\" height=\"1\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"1\" height=\"1\" style=\"fill:red;\"/></svg>`;\n    const canvas = new OffscreenCanvas(1, 3);\n    const ctx = canvas.getContext(\"2d\");\n    const image = new Image();\n    image.src = svg;\n    const promise = image.decode().then(() => {\n      ctx.drawImage(image, 0, 0, 1, 1, 0, 0, 1, 3);\n      return new Uint32Array(ctx.getImageData(0, 0, 1, 1).data.buffer)[0] === 0;\n    });\n\n    return shadow(this, \"_isSVGFittingCanvas\", promise);\n  }\n\n  async #get(key, rawData) {\n    this.#cache ||= new Map();\n    let data = this.#cache.get(key);\n    if (data === null) {\n      // We already tried to load the image but it failed.\n      return null;\n    }\n    if (data?.bitmap) {\n      data.refCounter += 1;\n      return data;\n    }\n    try {\n      data ||= {\n        bitmap: null,\n        id: `image_${this.#baseId}_${this.#id++}`,\n        refCounter: 0,\n        isSvg: false,\n      };\n      let image;\n      if (typeof rawData === \"string\") {\n        data.url = rawData;\n        image = await fetchData(rawData, \"blob\");\n      } else {\n        image = data.file = rawData;\n      }\n\n      if (image.type === \"image/svg+xml\") {\n        // Unfortunately, createImageBitmap doesn't work with SVG images.\n        // (see https://bugzilla.mozilla.org/1841972).\n        const mustRemoveAspectRatioPromise = ImageManager._isSVGFittingCanvas;\n        const fileReader = new FileReader();\n        const imageElement = new Image();\n        const imagePromise = new Promise((resolve, reject) => {\n          imageElement.onload = () => {\n            data.bitmap = imageElement;\n            data.isSvg = true;\n            resolve();\n          };\n          fileReader.onload = async () => {\n            const url = (data.svgUrl = fileReader.result);\n            // We need to set the preserveAspectRatio to none in order to let\n            // the image fits the canvas when resizing.\n            imageElement.src = (await mustRemoveAspectRatioPromise)\n              ? `${url}#svgView(preserveAspectRatio(none))`\n              : url;\n          };\n          imageElement.onerror = fileReader.onerror = reject;\n        });\n        fileReader.readAsDataURL(image);\n        await imagePromise;\n      } else {\n        data.bitmap = await createImageBitmap(image);\n      }\n      data.refCounter = 1;\n    } catch (e) {\n      console.error(e);\n      data = null;\n    }\n    this.#cache.set(key, data);\n    if (data) {\n      this.#cache.set(data.id, data);\n    }\n    return data;\n  }\n\n  async getFromFile(file) {\n    const { lastModified, name, size, type } = file;\n    return this.#get(`${lastModified}_${name}_${size}_${type}`, file);\n  }\n\n  async getFromUrl(url) {\n    return this.#get(url, url);\n  }\n\n  async getFromId(id) {\n    this.#cache ||= new Map();\n    const data = this.#cache.get(id);\n    if (!data) {\n      return null;\n    }\n    if (data.bitmap) {\n      data.refCounter += 1;\n      return data;\n    }\n\n    if (data.file) {\n      return this.getFromFile(data.file);\n    }\n    return this.getFromUrl(data.url);\n  }\n\n  getSvgUrl(id) {\n    const data = this.#cache.get(id);\n    if (!data?.isSvg) {\n      return null;\n    }\n    return data.svgUrl;\n  }\n\n  deleteId(id) {\n    this.#cache ||= new Map();\n    const data = this.#cache.get(id);\n    if (!data) {\n      return;\n    }\n    data.refCounter -= 1;\n    if (data.refCounter !== 0) {\n      return;\n    }\n    data.bitmap = null;\n  }\n\n  // We can use the id only if it belongs this manager.\n  // We must take care of having the right manager because we can copy/paste\n  // some images from other documents, hence it'd be a pity to use an id from an\n  // other manager.\n  isValidId(id) {\n    return id.startsWith(`image_${this.#baseId}_`);\n  }\n}\n\n/**\n * Class to handle undo/redo.\n * Commands are just saved in a buffer.\n * If we hit some memory issues we could likely use a circular buffer.\n * It has to be used as a singleton.\n */\nclass CommandManager {\n  #commands = [];\n\n  #locked = false;\n\n  #maxSize;\n\n  #position = -1;\n\n  constructor(maxSize = 128) {\n    this.#maxSize = maxSize;\n  }\n\n  /**\n   * @typedef {Object} addOptions\n   * @property {function} cmd\n   * @property {function} undo\n   * @property {boolean} mustExec\n   * @property {number} type\n   * @property {boolean} overwriteIfSameType\n   * @property {boolean} keepUndo\n   */\n\n  /**\n   * Add a new couple of commands to be used in case of redo/undo.\n   * @param {addOptions} options\n   */\n  add({\n    cmd,\n    undo,\n    mustExec,\n    type = NaN,\n    overwriteIfSameType = false,\n    keepUndo = false,\n  }) {\n    if (mustExec) {\n      cmd();\n    }\n\n    if (this.#locked) {\n      return;\n    }\n\n    const save = { cmd, undo, type };\n    if (this.#position === -1) {\n      if (this.#commands.length > 0) {\n        // All the commands have been undone and then a new one is added\n        // hence we clear the queue.\n        this.#commands.length = 0;\n      }\n      this.#position = 0;\n      this.#commands.push(save);\n      return;\n    }\n\n    if (overwriteIfSameType && this.#commands[this.#position].type === type) {\n      // For example when we change a color we don't want to\n      // be able to undo all the steps, hence we only want to\n      // keep the last undoable action in this sequence of actions.\n      if (keepUndo) {\n        save.undo = this.#commands[this.#position].undo;\n      }\n      this.#commands[this.#position] = save;\n      return;\n    }\n\n    const next = this.#position + 1;\n    if (next === this.#maxSize) {\n      this.#commands.splice(0, 1);\n    } else {\n      this.#position = next;\n      if (next < this.#commands.length) {\n        this.#commands.splice(next);\n      }\n    }\n\n    this.#commands.push(save);\n  }\n\n  /**\n   * Undo the last command.\n   */\n  undo() {\n    if (this.#position === -1) {\n      // Nothing to undo.\n      return;\n    }\n\n    // Avoid to insert something during the undo execution.\n    this.#locked = true;\n    this.#commands[this.#position].undo();\n    this.#locked = false;\n\n    this.#position -= 1;\n  }\n\n  /**\n   * Redo the last command.\n   */\n  redo() {\n    if (this.#position < this.#commands.length - 1) {\n      this.#position += 1;\n\n      // Avoid to insert something during the redo execution.\n      this.#locked = true;\n      this.#commands[this.#position].cmd();\n      this.#locked = false;\n    }\n  }\n\n  /**\n   * Check if there is something to undo.\n   * @returns {boolean}\n   */\n  hasSomethingToUndo() {\n    return this.#position !== -1;\n  }\n\n  /**\n   * Check if there is something to redo.\n   * @returns {boolean}\n   */\n  hasSomethingToRedo() {\n    return this.#position < this.#commands.length - 1;\n  }\n\n  destroy() {\n    this.#commands = null;\n  }\n}\n\n/**\n * Class to handle the different keyboards shortcuts we can have on mac or\n * non-mac OSes.\n */\nclass KeyboardManager {\n  /**\n   * Create a new keyboard manager class.\n   * @param {Array<Array>} callbacks - an array containing an array of shortcuts\n   * and a callback to call.\n   * A shortcut is a string like `ctrl+c` or `mac+ctrl+c` for mac OS.\n   */\n  constructor(callbacks) {\n    this.buffer = [];\n    this.callbacks = new Map();\n    this.allKeys = new Set();\n\n    const { isMac } = FeatureTest.platform;\n    for (const [keys, callback, options = {}] of callbacks) {\n      for (const key of keys) {\n        const isMacKey = key.startsWith(\"mac+\");\n        if (isMac && isMacKey) {\n          this.callbacks.set(key.slice(4), { callback, options });\n          this.allKeys.add(key.split(\"+\").at(-1));\n        } else if (!isMac && !isMacKey) {\n          this.callbacks.set(key, { callback, options });\n          this.allKeys.add(key.split(\"+\").at(-1));\n        }\n      }\n    }\n  }\n\n  /**\n   * Serialize an event into a string in order to match a\n   * potential key for a callback.\n   * @param {KeyboardEvent} event\n   * @returns {string}\n   */\n  #serialize(event) {\n    if (event.altKey) {\n      this.buffer.push(\"alt\");\n    }\n    if (event.ctrlKey) {\n      this.buffer.push(\"ctrl\");\n    }\n    if (event.metaKey) {\n      this.buffer.push(\"meta\");\n    }\n    if (event.shiftKey) {\n      this.buffer.push(\"shift\");\n    }\n    this.buffer.push(event.key);\n    const str = this.buffer.join(\"+\");\n    this.buffer.length = 0;\n\n    return str;\n  }\n\n  /**\n   * Execute a callback, if any, for a given keyboard event.\n   * The self is used as `this` in the callback.\n   * @param {Object} self\n   * @param {KeyboardEvent} event\n   * @returns\n   */\n  exec(self, event) {\n    if (!this.allKeys.has(event.key)) {\n      return;\n    }\n    const info = this.callbacks.get(this.#serialize(event));\n    if (!info) {\n      return;\n    }\n    const {\n      callback,\n      options: { bubbles = false, args = [], checker = null },\n    } = info;\n\n    if (checker && !checker(self, event)) {\n      return;\n    }\n    callback.bind(self, ...args)();\n\n    // For example, ctrl+s in a FreeText must be handled by the viewer, hence\n    // the event must bubble.\n    if (!bubbles) {\n      event.stopPropagation();\n      event.preventDefault();\n    }\n  }\n}\n\nclass ColorManager {\n  static _colorsMapping = new Map([\n    [\"CanvasText\", [0, 0, 0]],\n    [\"Canvas\", [255, 255, 255]],\n  ]);\n\n  get _colors() {\n    if (\n      typeof PDFJSDev !== \"undefined\" &&\n      PDFJSDev.test(\"LIB\") &&\n      typeof document === \"undefined\"\n    ) {\n      return shadow(this, \"_colors\", ColorManager._colorsMapping);\n    }\n\n    const colors = new Map([\n      [\"CanvasText\", null],\n      [\"Canvas\", null],\n    ]);\n    getColorValues(colors);\n    return shadow(this, \"_colors\", colors);\n  }\n\n  /**\n   * In High Contrast Mode, the color on the screen is not always the\n   * real color used in the pdf.\n   * For example in some cases white can appear to be black but when saving\n   * we want to have white.\n   * @param {string} color\n   * @returns {Array<number>}\n   */\n  convert(color) {\n    const rgb = getRGB(color);\n    if (!window.matchMedia(\"(forced-colors: active)\").matches) {\n      return rgb;\n    }\n\n    for (const [name, RGB] of this._colors) {\n      if (RGB.every((x, i) => x === rgb[i])) {\n        return ColorManager._colorsMapping.get(name);\n      }\n    }\n    return rgb;\n  }\n\n  /**\n   * An input element must have its color value as a hex string\n   * and not as color name.\n   * So this function converts a name into an hex string.\n   * @param {string} name\n   * @returns {string}\n   */\n  getHexCode(name) {\n    const rgb = this._colors.get(name);\n    if (!rgb) {\n      return name;\n    }\n    return Util.makeHexColor(...rgb);\n  }\n}\n\n/**\n * A pdf has several pages and each of them when it will rendered\n * will have an AnnotationEditorLayer which will contain the some\n * new Annotations associated to an editor in order to modify them.\n *\n * This class is used to manage all the different layers, editors and\n * some action like copy/paste, undo/redo, ...\n */\nclass AnnotationEditorUIManager {\n  #activeEditor = null;\n\n  #allEditors = new Map();\n\n  #allLayers = new Map();\n\n  #altTextManager = null;\n\n  #annotationStorage = null;\n\n  #commandManager = new CommandManager();\n\n  #currentPageIndex = 0;\n\n  #deletedAnnotationsElementIds = new Set();\n\n  #draggingEditors = null;\n\n  #editorTypes = null;\n\n  #editorsToRescale = new Set();\n\n  #filterFactory = null;\n\n  #focusMainContainerTimeoutId = null;\n\n  #idManager = new IdManager();\n\n  #isEnabled = false;\n\n  #isWaiting = false;\n\n  #lastActiveElement = null;\n\n  #mode = AnnotationEditorType.NONE;\n\n  #selectedEditors = new Set();\n\n  #pageColors = null;\n\n  #boundBlur = this.blur.bind(this);\n\n  #boundFocus = this.focus.bind(this);\n\n  #boundCopy = this.copy.bind(this);\n\n  #boundCut = this.cut.bind(this);\n\n  #boundPaste = this.paste.bind(this);\n\n  #boundKeydown = this.keydown.bind(this);\n\n  #boundOnEditingAction = this.onEditingAction.bind(this);\n\n  #boundOnPageChanging = this.onPageChanging.bind(this);\n\n  #boundOnScaleChanging = this.onScaleChanging.bind(this);\n\n  #boundOnRotationChanging = this.onRotationChanging.bind(this);\n\n  #previousStates = {\n    isEditing: false,\n    isEmpty: true,\n    hasSomethingToUndo: false,\n    hasSomethingToRedo: false,\n    hasSelectedEditor: false,\n  };\n\n  #translation = [0, 0];\n\n  #translationTimeoutId = null;\n\n  #container = null;\n\n  #viewer = null;\n\n  static TRANSLATE_SMALL = 1; // page units.\n\n  static TRANSLATE_BIG = 10; // page units.\n\n  static get _keyboardManager() {\n    const proto = AnnotationEditorUIManager.prototype;\n\n    const arrowChecker = self => {\n      // If the focused element is an input, we don't want to handle the arrow.\n      // For example, sliders can be controlled with the arrow keys.\n      return (\n        self.#container.contains(document.activeElement) &&\n        self.hasSomethingToControl()\n      );\n    };\n\n    const textInputChecker = (_self, { target: el }) => {\n      if (el instanceof HTMLInputElement) {\n        const { type } = el;\n        return type !== \"text\" && type !== \"number\";\n      }\n      return true;\n    };\n\n    const small = this.TRANSLATE_SMALL;\n    const big = this.TRANSLATE_BIG;\n\n    return shadow(\n      this,\n      \"_keyboardManager\",\n      new KeyboardManager([\n        [\n          [\"ctrl+a\", \"mac+meta+a\"],\n          proto.selectAll,\n          { checker: textInputChecker },\n        ],\n        [[\"ctrl+z\", \"mac+meta+z\"], proto.undo, { checker: textInputChecker }],\n        [\n          // On mac, depending of the OS version, the event.key is either \"z\" or\n          // \"Z\" when the user presses \"meta+shift+z\".\n          [\n            \"ctrl+y\",\n            \"ctrl+shift+z\",\n            \"mac+meta+shift+z\",\n            \"ctrl+shift+Z\",\n            \"mac+meta+shift+Z\",\n          ],\n          proto.redo,\n          { checker: textInputChecker },\n        ],\n        [\n          [\n            \"Backspace\",\n            \"alt+Backspace\",\n            \"ctrl+Backspace\",\n            \"shift+Backspace\",\n            \"mac+Backspace\",\n            \"mac+alt+Backspace\",\n            \"mac+ctrl+Backspace\",\n            \"Delete\",\n            \"ctrl+Delete\",\n            \"shift+Delete\",\n            \"mac+Delete\",\n          ],\n          proto.delete,\n          { checker: textInputChecker },\n        ],\n        [\n          [\"Enter\", \"mac+Enter\"],\n          proto.addNewEditorFromKeyboard,\n          {\n            // Those shortcuts can be used in the toolbar for some other actions\n            // like zooming, hence we need to check if the container has the\n            // focus.\n            checker: (self, { target: el }) =>\n              !(el instanceof HTMLButtonElement) &&\n              self.#container.contains(el) &&\n              !self.isEnterHandled,\n          },\n        ],\n        [\n          [\" \", \"mac+ \"],\n          proto.addNewEditorFromKeyboard,\n          {\n            // Those shortcuts can be used in the toolbar for some other actions\n            // like zooming, hence we need to check if the container has the\n            // focus.\n            checker: self => self.#container.contains(document.activeElement),\n          },\n        ],\n        [[\"Escape\", \"mac+Escape\"], proto.unselectAll],\n        [\n          [\"ArrowLeft\", \"mac+ArrowLeft\"],\n          proto.translateSelectedEditors,\n          { args: [-small, 0], checker: arrowChecker },\n        ],\n        [\n          [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n          proto.translateSelectedEditors,\n          { args: [-big, 0], checker: arrowChecker },\n        ],\n        [\n          [\"ArrowRight\", \"mac+ArrowRight\"],\n          proto.translateSelectedEditors,\n          { args: [small, 0], checker: arrowChecker },\n        ],\n        [\n          [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n          proto.translateSelectedEditors,\n          { args: [big, 0], checker: arrowChecker },\n        ],\n        [\n          [\"ArrowUp\", \"mac+ArrowUp\"],\n          proto.translateSelectedEditors,\n          { args: [0, -small], checker: arrowChecker },\n        ],\n        [\n          [\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"],\n          proto.translateSelectedEditors,\n          { args: [0, -big], checker: arrowChecker },\n        ],\n        [\n          [\"ArrowDown\", \"mac+ArrowDown\"],\n          proto.translateSelectedEditors,\n          { args: [0, small], checker: arrowChecker },\n        ],\n        [\n          [\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"],\n          proto.translateSelectedEditors,\n          { args: [0, big], checker: arrowChecker },\n        ],\n      ])\n    );\n  }\n\n  constructor(\n    container,\n    viewer,\n    altTextManager,\n    eventBus,\n    pdfDocument,\n    pageColors\n  ) {\n    this.#container = container;\n    this.#viewer = viewer;\n    this.#altTextManager = altTextManager;\n    this._eventBus = eventBus;\n    this._eventBus._on(\"editingaction\", this.#boundOnEditingAction);\n    this._eventBus._on(\"pagechanging\", this.#boundOnPageChanging);\n    this._eventBus._on(\"scalechanging\", this.#boundOnScaleChanging);\n    this._eventBus._on(\"rotationchanging\", this.#boundOnRotationChanging);\n    this.#annotationStorage = pdfDocument.annotationStorage;\n    this.#filterFactory = pdfDocument.filterFactory;\n    this.#pageColors = pageColors;\n    this.viewParameters = {\n      realScale: PixelsPerInch.PDF_TO_CSS_UNITS,\n      rotation: 0,\n    };\n  }\n\n  destroy() {\n    this.#removeKeyboardManager();\n    this.#removeFocusManager();\n    this._eventBus._off(\"editingaction\", this.#boundOnEditingAction);\n    this._eventBus._off(\"pagechanging\", this.#boundOnPageChanging);\n    this._eventBus._off(\"scalechanging\", this.#boundOnScaleChanging);\n    this._eventBus._off(\"rotationchanging\", this.#boundOnRotationChanging);\n    for (const layer of this.#allLayers.values()) {\n      layer.destroy();\n    }\n    this.#allLayers.clear();\n    this.#allEditors.clear();\n    this.#editorsToRescale.clear();\n    this.#activeEditor = null;\n    this.#selectedEditors.clear();\n    this.#commandManager.destroy();\n    this.#altTextManager.destroy();\n    if (this.#focusMainContainerTimeoutId) {\n      clearTimeout(this.#focusMainContainerTimeoutId);\n      this.#focusMainContainerTimeoutId = null;\n    }\n    if (this.#translationTimeoutId) {\n      clearTimeout(this.#translationTimeoutId);\n      this.#translationTimeoutId = null;\n    }\n  }\n\n  get hcmFilter() {\n    return shadow(\n      this,\n      \"hcmFilter\",\n      this.#pageColors\n        ? this.#filterFactory.addHCMFilter(\n            this.#pageColors.foreground,\n            this.#pageColors.background\n          )\n        : \"none\"\n    );\n  }\n\n  get direction() {\n    return shadow(\n      this,\n      \"direction\",\n      getComputedStyle(this.#container).direction\n    );\n  }\n\n  editAltText(editor) {\n    this.#altTextManager?.editAltText(this, editor);\n  }\n\n  onPageChanging({ pageNumber }) {\n    this.#currentPageIndex = pageNumber - 1;\n  }\n\n  focusMainContainer() {\n    this.#container.focus();\n  }\n\n  findParent(x, y) {\n    for (const layer of this.#allLayers.values()) {\n      const {\n        x: layerX,\n        y: layerY,\n        width,\n        height,\n      } = layer.div.getBoundingClientRect();\n      if (\n        x >= layerX &&\n        x <= layerX + width &&\n        y >= layerY &&\n        y <= layerY + height\n      ) {\n        return layer;\n      }\n    }\n    return null;\n  }\n\n  disableUserSelect(value = false) {\n    this.#viewer.classList.toggle(\"noUserSelect\", value);\n  }\n\n  addShouldRescale(editor) {\n    this.#editorsToRescale.add(editor);\n  }\n\n  removeShouldRescale(editor) {\n    this.#editorsToRescale.delete(editor);\n  }\n\n  onScaleChanging({ scale }) {\n    this.commitOrRemove();\n    this.viewParameters.realScale = scale * PixelsPerInch.PDF_TO_CSS_UNITS;\n    for (const editor of this.#editorsToRescale) {\n      editor.onScaleChanging();\n    }\n  }\n\n  onRotationChanging({ pagesRotation }) {\n    this.commitOrRemove();\n    this.viewParameters.rotation = pagesRotation;\n  }\n\n  /**\n   * Add an editor in the annotation storage.\n   * @param {AnnotationEditor} editor\n   */\n  addToAnnotationStorage(editor) {\n    if (\n      !editor.isEmpty() &&\n      this.#annotationStorage &&\n      !this.#annotationStorage.has(editor.id)\n    ) {\n      this.#annotationStorage.setValue(editor.id, editor);\n    }\n  }\n\n  #addFocusManager() {\n    window.addEventListener(\"focus\", this.#boundFocus);\n    window.addEventListener(\"blur\", this.#boundBlur);\n  }\n\n  #removeFocusManager() {\n    window.removeEventListener(\"focus\", this.#boundFocus);\n    window.removeEventListener(\"blur\", this.#boundBlur);\n  }\n\n  blur() {\n    if (!this.hasSelection) {\n      return;\n    }\n    // When several editors are selected and the window loses focus, we want to\n    // keep the last active element in order to be able to focus it again when\n    // the window gets the focus back but we don't want to trigger any focus\n    // callbacks else only one editor will be selected.\n    const { activeElement } = document;\n    for (const editor of this.#selectedEditors) {\n      if (editor.div.contains(activeElement)) {\n        this.#lastActiveElement = [editor, activeElement];\n        editor._focusEventsAllowed = false;\n        break;\n      }\n    }\n  }\n\n  focus() {\n    if (!this.#lastActiveElement) {\n      return;\n    }\n    const [lastEditor, lastActiveElement] = this.#lastActiveElement;\n    this.#lastActiveElement = null;\n    lastActiveElement.addEventListener(\n      \"focusin\",\n      () => {\n        lastEditor._focusEventsAllowed = true;\n      },\n      { once: true }\n    );\n    lastActiveElement.focus();\n  }\n\n  #addKeyboardManager() {\n    // The keyboard events are caught at the container level in order to be able\n    // to execute some callbacks even if the current page doesn't have focus.\n    window.addEventListener(\"keydown\", this.#boundKeydown);\n  }\n\n  #removeKeyboardManager() {\n    window.removeEventListener(\"keydown\", this.#boundKeydown);\n  }\n\n  #addCopyPasteListeners() {\n    document.addEventListener(\"copy\", this.#boundCopy);\n    document.addEventListener(\"cut\", this.#boundCut);\n    document.addEventListener(\"paste\", this.#boundPaste);\n  }\n\n  #removeCopyPasteListeners() {\n    document.removeEventListener(\"copy\", this.#boundCopy);\n    document.removeEventListener(\"cut\", this.#boundCut);\n    document.removeEventListener(\"paste\", this.#boundPaste);\n  }\n\n  addEditListeners() {\n    this.#addKeyboardManager();\n    this.#addCopyPasteListeners();\n  }\n\n  removeEditListeners() {\n    this.#removeKeyboardManager();\n    this.#removeCopyPasteListeners();\n  }\n\n  /**\n   * Copy callback.\n   * @param {ClipboardEvent} event\n   */\n  copy(event) {\n    event.preventDefault();\n\n    // An editor is being edited so just commit it.\n    this.#activeEditor?.commitOrRemove();\n\n    if (!this.hasSelection) {\n      return;\n    }\n\n    const editors = [];\n    for (const editor of this.#selectedEditors) {\n      const serialized = editor.serialize(/* isForCopying = */ true);\n      if (serialized) {\n        editors.push(serialized);\n      }\n    }\n    if (editors.length === 0) {\n      return;\n    }\n\n    event.clipboardData.setData(\"application/pdfjs\", JSON.stringify(editors));\n  }\n\n  /**\n   * Cut callback.\n   * @param {ClipboardEvent} event\n   */\n  cut(event) {\n    this.copy(event);\n    this.delete();\n  }\n\n  /**\n   * Paste callback.\n   * @param {ClipboardEvent} event\n   */\n  paste(event) {\n    event.preventDefault();\n    const { clipboardData } = event;\n    for (const item of clipboardData.items) {\n      for (const editorType of this.#editorTypes) {\n        if (editorType.isHandlingMimeForPasting(item.type)) {\n          editorType.paste(item, this.currentLayer);\n          return;\n        }\n      }\n    }\n\n    let data = clipboardData.getData(\"application/pdfjs\");\n    if (!data) {\n      return;\n    }\n\n    try {\n      data = JSON.parse(data);\n    } catch (ex) {\n      warn(`paste: \"${ex.message}\".`);\n      return;\n    }\n\n    if (!Array.isArray(data)) {\n      return;\n    }\n\n    this.unselectAll();\n    const layer = this.currentLayer;\n\n    try {\n      const newEditors = [];\n      for (const editor of data) {\n        const deserializedEditor = layer.deserialize(editor);\n        if (!deserializedEditor) {\n          return;\n        }\n        newEditors.push(deserializedEditor);\n      }\n\n      const cmd = () => {\n        for (const editor of newEditors) {\n          this.#addEditorToLayer(editor);\n        }\n        this.#selectEditors(newEditors);\n      };\n      const undo = () => {\n        for (const editor of newEditors) {\n          editor.remove();\n        }\n      };\n      this.addCommands({ cmd, undo, mustExec: true });\n    } catch (ex) {\n      warn(`paste: \"${ex.message}\".`);\n    }\n  }\n\n  /**\n   * Keydown callback.\n   * @param {KeyboardEvent} event\n   */\n  keydown(event) {\n    if (!this.isEditorHandlingKeyboard) {\n      AnnotationEditorUIManager._keyboardManager.exec(this, event);\n    }\n  }\n\n  /**\n   * Execute an action for a given name.\n   * For example, the user can click on the \"Undo\" entry in the context menu\n   * and it'll trigger the undo action.\n   * @param {Object} details\n   */\n  onEditingAction(details) {\n    if ([\"undo\", \"redo\", \"delete\", \"selectAll\"].includes(details.name)) {\n      this[details.name]();\n    }\n  }\n\n  /**\n   * Update the different possible states of this manager, e.g. is there\n   * something to undo, redo, ...\n   * @param {Object} details\n   */\n  #dispatchUpdateStates(details) {\n    const hasChanged = Object.entries(details).some(\n      ([key, value]) => this.#previousStates[key] !== value\n    );\n\n    if (hasChanged) {\n      this._eventBus.dispatch(\"annotationeditorstateschanged\", {\n        source: this,\n        details: Object.assign(this.#previousStates, details),\n      });\n    }\n  }\n\n  #dispatchUpdateUI(details) {\n    this._eventBus.dispatch(\"annotationeditorparamschanged\", {\n      source: this,\n      details,\n    });\n  }\n\n  /**\n   * Set the editing state.\n   * It can be useful to temporarily disable it when the user is editing a\n   * FreeText annotation.\n   * @param {boolean} isEditing\n   */\n  setEditingState(isEditing) {\n    if (isEditing) {\n      this.#addFocusManager();\n      this.#addKeyboardManager();\n      this.#addCopyPasteListeners();\n      this.#dispatchUpdateStates({\n        isEditing: this.#mode !== AnnotationEditorType.NONE,\n        isEmpty: this.#isEmpty(),\n        hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n        hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n        hasSelectedEditor: false,\n      });\n    } else {\n      this.#removeFocusManager();\n      this.#removeKeyboardManager();\n      this.#removeCopyPasteListeners();\n      this.#dispatchUpdateStates({\n        isEditing: false,\n      });\n      this.disableUserSelect(false);\n    }\n  }\n\n  registerEditorTypes(types) {\n    if (this.#editorTypes) {\n      return;\n    }\n    this.#editorTypes = types;\n    for (const editorType of this.#editorTypes) {\n      this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate);\n    }\n  }\n\n  /**\n   * Get an id.\n   * @returns {string}\n   */\n  getId() {\n    return this.#idManager.getId();\n  }\n\n  get currentLayer() {\n    return this.#allLayers.get(this.#currentPageIndex);\n  }\n\n  getLayer(pageIndex) {\n    return this.#allLayers.get(pageIndex);\n  }\n\n  get currentPageIndex() {\n    return this.#currentPageIndex;\n  }\n\n  /**\n   * Add a new layer for a page which will contains the editors.\n   * @param {AnnotationEditorLayer} layer\n   */\n  addLayer(layer) {\n    this.#allLayers.set(layer.pageIndex, layer);\n    if (this.#isEnabled) {\n      layer.enable();\n    } else {\n      layer.disable();\n    }\n  }\n\n  /**\n   * Remove a layer.\n   * @param {AnnotationEditorLayer} layer\n   */\n  removeLayer(layer) {\n    this.#allLayers.delete(layer.pageIndex);\n  }\n\n  /**\n   * Change the editor mode (None, FreeText, Ink, ...)\n   * @param {number} mode\n   * @param {string|null} editId\n   * @param {boolean} [isFromKeyboard] - true if the mode change is due to a\n   *   keyboard action.\n   */\n  updateMode(mode, editId = null, isFromKeyboard = false) {\n    if (this.#mode === mode) {\n      return;\n    }\n    this.#mode = mode;\n    if (mode === AnnotationEditorType.NONE) {\n      this.setEditingState(false);\n      this.#disableAll();\n      return;\n    }\n    this.setEditingState(true);\n    this.#enableAll();\n    this.unselectAll();\n    for (const layer of this.#allLayers.values()) {\n      layer.updateMode(mode);\n    }\n    if (!editId && isFromKeyboard) {\n      this.addNewEditorFromKeyboard();\n      return;\n    }\n\n    if (!editId) {\n      return;\n    }\n    for (const editor of this.#allEditors.values()) {\n      if (editor.annotationElementId === editId) {\n        this.setSelected(editor);\n        editor.enterInEditMode();\n        break;\n      }\n    }\n  }\n\n  addNewEditorFromKeyboard() {\n    this.currentLayer.addNewEditor();\n  }\n\n  /**\n   * Update the toolbar if it's required to reflect the tool currently used.\n   * @param {number} mode\n   * @returns {undefined}\n   */\n  updateToolbar(mode) {\n    if (mode === this.#mode) {\n      return;\n    }\n    this._eventBus.dispatch(\"switchannotationeditormode\", {\n      source: this,\n      mode,\n    });\n  }\n\n  /**\n   * Update a parameter in the current editor or globally.\n   * @param {number} type\n   * @param {*} value\n   */\n  updateParams(type, value) {\n    if (!this.#editorTypes) {\n      return;\n    }\n    if (type === AnnotationEditorParamsType.CREATE) {\n      this.currentLayer.addNewEditor();\n      return;\n    }\n\n    for (const editor of this.#selectedEditors) {\n      editor.updateParams(type, value);\n    }\n\n    for (const editorType of this.#editorTypes) {\n      editorType.updateDefaultParams(type, value);\n    }\n  }\n\n  enableWaiting(mustWait = false) {\n    if (this.#isWaiting === mustWait) {\n      return;\n    }\n    this.#isWaiting = mustWait;\n    for (const layer of this.#allLayers.values()) {\n      if (mustWait) {\n        layer.disableClick();\n      } else {\n        layer.enableClick();\n      }\n      layer.div.classList.toggle(\"waiting\", mustWait);\n    }\n  }\n\n  /**\n   * Enable all the layers.\n   */\n  #enableAll() {\n    if (!this.#isEnabled) {\n      this.#isEnabled = true;\n      for (const layer of this.#allLayers.values()) {\n        layer.enable();\n      }\n    }\n  }\n\n  /**\n   * Disable all the layers.\n   */\n  #disableAll() {\n    this.unselectAll();\n    if (this.#isEnabled) {\n      this.#isEnabled = false;\n      for (const layer of this.#allLayers.values()) {\n        layer.disable();\n      }\n    }\n  }\n\n  /**\n   * Get all the editors belonging to a given page.\n   * @param {number} pageIndex\n   * @returns {Array<AnnotationEditor>}\n   */\n  getEditors(pageIndex) {\n    const editors = [];\n    for (const editor of this.#allEditors.values()) {\n      if (editor.pageIndex === pageIndex) {\n        editors.push(editor);\n      }\n    }\n    return editors;\n  }\n\n  /**\n   * Get an editor with the given id.\n   * @param {string} id\n   * @returns {AnnotationEditor}\n   */\n  getEditor(id) {\n    return this.#allEditors.get(id);\n  }\n\n  /**\n   * Add a new editor.\n   * @param {AnnotationEditor} editor\n   */\n  addEditor(editor) {\n    this.#allEditors.set(editor.id, editor);\n  }\n\n  /**\n   * Remove an editor.\n   * @param {AnnotationEditor} editor\n   */\n  removeEditor(editor) {\n    if (editor.div.contains(document.activeElement)) {\n      if (this.#focusMainContainerTimeoutId) {\n        clearTimeout(this.#focusMainContainerTimeoutId);\n      }\n      this.#focusMainContainerTimeoutId = setTimeout(() => {\n        // When the div is removed from DOM the focus can move on the\n        // document.body, so we need to move it back to the main container.\n        this.focusMainContainer();\n        this.#focusMainContainerTimeoutId = null;\n      }, 0);\n    }\n    this.#allEditors.delete(editor.id);\n    this.unselect(editor);\n    if (\n      !editor.annotationElementId ||\n      !this.#deletedAnnotationsElementIds.has(editor.annotationElementId)\n    ) {\n      this.#annotationStorage?.remove(editor.id);\n    }\n  }\n\n  /**\n   * The annotation element with the given id has been deleted.\n   * @param {AnnotationEditor} editor\n   */\n  addDeletedAnnotationElement(editor) {\n    this.#deletedAnnotationsElementIds.add(editor.annotationElementId);\n    editor.deleted = true;\n  }\n\n  /**\n   * Check if the annotation element with the given id has been deleted.\n   * @param {string} annotationElementId\n   * @returns {boolean}\n   */\n  isDeletedAnnotationElement(annotationElementId) {\n    return this.#deletedAnnotationsElementIds.has(annotationElementId);\n  }\n\n  /**\n   * The annotation element with the given id have been restored.\n   * @param {AnnotationEditor} editor\n   */\n  removeDeletedAnnotationElement(editor) {\n    this.#deletedAnnotationsElementIds.delete(editor.annotationElementId);\n    editor.deleted = false;\n  }\n\n  /**\n   * Add an editor to the layer it belongs to or add it to the global map.\n   * @param {AnnotationEditor} editor\n   */\n  #addEditorToLayer(editor) {\n    const layer = this.#allLayers.get(editor.pageIndex);\n    if (layer) {\n      layer.addOrRebuild(editor);\n    } else {\n      this.addEditor(editor);\n    }\n  }\n\n  /**\n   * Set the given editor as the active one.\n   * @param {AnnotationEditor} editor\n   */\n  setActiveEditor(editor) {\n    if (this.#activeEditor === editor) {\n      return;\n    }\n\n    this.#activeEditor = editor;\n    if (editor) {\n      this.#dispatchUpdateUI(editor.propertiesToUpdate);\n    }\n  }\n\n  /**\n   * Add or remove an editor the current selection.\n   * @param {AnnotationEditor} editor\n   */\n  toggleSelected(editor) {\n    if (this.#selectedEditors.has(editor)) {\n      this.#selectedEditors.delete(editor);\n      editor.unselect();\n      this.#dispatchUpdateStates({\n        hasSelectedEditor: this.hasSelection,\n      });\n      return;\n    }\n    this.#selectedEditors.add(editor);\n    editor.select();\n    this.#dispatchUpdateUI(editor.propertiesToUpdate);\n    this.#dispatchUpdateStates({\n      hasSelectedEditor: true,\n    });\n  }\n\n  /**\n   * Set the last selected editor.\n   * @param {AnnotationEditor} editor\n   */\n  setSelected(editor) {\n    for (const ed of this.#selectedEditors) {\n      if (ed !== editor) {\n        ed.unselect();\n      }\n    }\n    this.#selectedEditors.clear();\n\n    this.#selectedEditors.add(editor);\n    editor.select();\n    this.#dispatchUpdateUI(editor.propertiesToUpdate);\n    this.#dispatchUpdateStates({\n      hasSelectedEditor: true,\n    });\n  }\n\n  /**\n   * Check if the editor is selected.\n   * @param {AnnotationEditor} editor\n   */\n  isSelected(editor) {\n    return this.#selectedEditors.has(editor);\n  }\n\n  get firstSelectedEditor() {\n    return this.#selectedEditors.values().next().value;\n  }\n\n  /**\n   * Unselect an editor.\n   * @param {AnnotationEditor} editor\n   */\n  unselect(editor) {\n    editor.unselect();\n    this.#selectedEditors.delete(editor);\n    this.#dispatchUpdateStates({\n      hasSelectedEditor: this.hasSelection,\n    });\n  }\n\n  get hasSelection() {\n    return this.#selectedEditors.size !== 0;\n  }\n\n  get isEnterHandled() {\n    return (\n      this.#selectedEditors.size === 1 &&\n      this.firstSelectedEditor.isEnterHandled\n    );\n  }\n\n  /**\n   * Undo the last command.\n   */\n  undo() {\n    this.#commandManager.undo();\n    this.#dispatchUpdateStates({\n      hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n      hasSomethingToRedo: true,\n      isEmpty: this.#isEmpty(),\n    });\n  }\n\n  /**\n   * Redo the last undoed command.\n   */\n  redo() {\n    this.#commandManager.redo();\n    this.#dispatchUpdateStates({\n      hasSomethingToUndo: true,\n      hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n      isEmpty: this.#isEmpty(),\n    });\n  }\n\n  /**\n   * Add a command to execute (cmd) and another one to undo it.\n   * @param {Object} params\n   */\n  addCommands(params) {\n    this.#commandManager.add(params);\n    this.#dispatchUpdateStates({\n      hasSomethingToUndo: true,\n      hasSomethingToRedo: false,\n      isEmpty: this.#isEmpty(),\n    });\n  }\n\n  #isEmpty() {\n    if (this.#allEditors.size === 0) {\n      return true;\n    }\n\n    if (this.#allEditors.size === 1) {\n      for (const editor of this.#allEditors.values()) {\n        return editor.isEmpty();\n      }\n    }\n\n    return false;\n  }\n\n  /**\n   * Delete the current editor or all.\n   */\n  delete() {\n    this.commitOrRemove();\n    if (!this.hasSelection) {\n      return;\n    }\n\n    const editors = [...this.#selectedEditors];\n    const cmd = () => {\n      for (const editor of editors) {\n        editor.remove();\n      }\n    };\n    const undo = () => {\n      for (const editor of editors) {\n        this.#addEditorToLayer(editor);\n      }\n    };\n\n    this.addCommands({ cmd, undo, mustExec: true });\n  }\n\n  commitOrRemove() {\n    // An editor is being edited so just commit it.\n    this.#activeEditor?.commitOrRemove();\n  }\n\n  hasSomethingToControl() {\n    return this.#activeEditor || this.hasSelection;\n  }\n\n  /**\n   * Select the editors.\n   * @param {Array<AnnotationEditor>} editors\n   */\n  #selectEditors(editors) {\n    this.#selectedEditors.clear();\n    for (const editor of editors) {\n      if (editor.isEmpty()) {\n        continue;\n      }\n      this.#selectedEditors.add(editor);\n      editor.select();\n    }\n    this.#dispatchUpdateStates({ hasSelectedEditor: true });\n  }\n\n  /**\n   * Select all the editors.\n   */\n  selectAll() {\n    for (const editor of this.#selectedEditors) {\n      editor.commit();\n    }\n    this.#selectEditors(this.#allEditors.values());\n  }\n\n  /**\n   * Unselect all the selected editors.\n   */\n  unselectAll() {\n    if (this.#activeEditor) {\n      // An editor is being edited so just commit it.\n      this.#activeEditor.commitOrRemove();\n      return;\n    }\n\n    if (!this.hasSelection) {\n      return;\n    }\n    for (const editor of this.#selectedEditors) {\n      editor.unselect();\n    }\n    this.#selectedEditors.clear();\n    this.#dispatchUpdateStates({\n      hasSelectedEditor: false,\n    });\n  }\n\n  translateSelectedEditors(x, y, noCommit = false) {\n    if (!noCommit) {\n      this.commitOrRemove();\n    }\n    if (!this.hasSelection) {\n      return;\n    }\n\n    this.#translation[0] += x;\n    this.#translation[1] += y;\n    const [totalX, totalY] = this.#translation;\n    const editors = [...this.#selectedEditors];\n\n    // We don't want to have an undo/redo for each translation so we wait a bit\n    // before adding the command to the command manager.\n    const TIME_TO_WAIT = 1000;\n\n    if (this.#translationTimeoutId) {\n      clearTimeout(this.#translationTimeoutId);\n    }\n\n    this.#translationTimeoutId = setTimeout(() => {\n      this.#translationTimeoutId = null;\n      this.#translation[0] = this.#translation[1] = 0;\n\n      this.addCommands({\n        cmd: () => {\n          for (const editor of editors) {\n            if (this.#allEditors.has(editor.id)) {\n              editor.translateInPage(totalX, totalY);\n            }\n          }\n        },\n        undo: () => {\n          for (const editor of editors) {\n            if (this.#allEditors.has(editor.id)) {\n              editor.translateInPage(-totalX, -totalY);\n            }\n          }\n        },\n        mustExec: false,\n      });\n    }, TIME_TO_WAIT);\n\n    for (const editor of editors) {\n      editor.translateInPage(x, y);\n    }\n  }\n\n  /**\n   * Set up the drag session for moving the selected editors.\n   */\n  setUpDragSession() {\n    // Note: don't use any references to the editor's parent which can be null\n    // if the editor belongs to a destroyed page.\n    if (!this.hasSelection) {\n      return;\n    }\n    // Avoid to have spurious text selection in the text layer when dragging.\n    this.disableUserSelect(true);\n    this.#draggingEditors = new Map();\n    for (const editor of this.#selectedEditors) {\n      this.#draggingEditors.set(editor, {\n        savedX: editor.x,\n        savedY: editor.y,\n        savedPageIndex: editor.pageIndex,\n        newX: 0,\n        newY: 0,\n        newPageIndex: -1,\n      });\n    }\n  }\n\n  /**\n   * Ends the drag session.\n   * @returns {boolean} true if at least one editor has been moved.\n   */\n  endDragSession() {\n    if (!this.#draggingEditors) {\n      return false;\n    }\n    this.disableUserSelect(false);\n    const map = this.#draggingEditors;\n    this.#draggingEditors = null;\n    let mustBeAddedInUndoStack = false;\n\n    for (const [{ x, y, pageIndex }, value] of map) {\n      value.newX = x;\n      value.newY = y;\n      value.newPageIndex = pageIndex;\n      mustBeAddedInUndoStack ||=\n        x !== value.savedX ||\n        y !== value.savedY ||\n        pageIndex !== value.savedPageIndex;\n    }\n\n    if (!mustBeAddedInUndoStack) {\n      return false;\n    }\n\n    const move = (editor, x, y, pageIndex) => {\n      if (this.#allEditors.has(editor.id)) {\n        // The editor can be undone/redone on a page which is not visible (and\n        // which potentially has no annotation editor layer), hence we need to\n        // use the pageIndex instead of the parent.\n        const parent = this.#allLayers.get(pageIndex);\n        if (parent) {\n          editor._setParentAndPosition(parent, x, y);\n        } else {\n          editor.pageIndex = pageIndex;\n          editor.x = x;\n          editor.y = y;\n        }\n      }\n    };\n\n    this.addCommands({\n      cmd: () => {\n        for (const [editor, { newX, newY, newPageIndex }] of map) {\n          move(editor, newX, newY, newPageIndex);\n        }\n      },\n      undo: () => {\n        for (const [editor, { savedX, savedY, savedPageIndex }] of map) {\n          move(editor, savedX, savedY, savedPageIndex);\n        }\n      },\n      mustExec: true,\n    });\n\n    return true;\n  }\n\n  /**\n   * Drag the set of selected editors.\n   * @param {number} tx\n   * @param {number} ty\n   */\n  dragSelectedEditors(tx, ty) {\n    if (!this.#draggingEditors) {\n      return;\n    }\n    for (const editor of this.#draggingEditors.keys()) {\n      editor.drag(tx, ty);\n    }\n  }\n\n  /**\n   * Rebuild the editor (usually on undo/redo actions) on a potentially\n   * non-rendered page.\n   * @param {AnnotationEditor} editor\n   */\n  rebuild(editor) {\n    if (editor.parent === null) {\n      const parent = this.getLayer(editor.pageIndex);\n      if (parent) {\n        parent.changeParent(editor);\n        parent.addOrRebuild(editor);\n      } else {\n        this.addEditor(editor);\n        this.addToAnnotationStorage(editor);\n        editor.rebuild();\n      }\n    } else {\n      editor.parent.addOrRebuild(editor);\n    }\n  }\n\n  get isEditorHandlingKeyboard() {\n    return (\n      this.getActive()?.shouldGetKeyboardEvents() ||\n      (this.#selectedEditors.size === 1 &&\n        this.firstSelectedEditor.shouldGetKeyboardEvents())\n    );\n  }\n\n  /**\n   * Is the current editor the one passed as argument?\n   * @param {AnnotationEditor} editor\n   * @returns\n   */\n  isActive(editor) {\n    return this.#activeEditor === editor;\n  }\n\n  /**\n   * Get the current active editor.\n   * @returns {AnnotationEditor|null}\n   */\n  getActive() {\n    return this.#activeEditor;\n  }\n\n  /**\n   * Get the current editor mode.\n   * @returns {number}\n   */\n  getMode() {\n    return this.#mode;\n  }\n\n  get imageManager() {\n    return shadow(this, \"imageManager\", new ImageManager());\n  }\n}\n\nexport {\n  AnnotationEditorUIManager,\n  bindEvents,\n  ColorManager,\n  CommandManager,\n  KeyboardManager,\n  opacityToHex,\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  AbortException,\n  assert,\n  PromiseCapability,\n  warn,\n} from \"../shared/util.js\";\nimport {\n  createResponseStatusError,\n  extractFilenameFromHeader,\n  validateRangeRequestCapabilities,\n  validateResponseStatus,\n} from \"./network_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n  throw new Error(\n    'Module \"./fetch_stream.js\" shall not be used with MOZCENTRAL builds.'\n  );\n}\n\nfunction createFetchOptions(headers, withCredentials, abortController) {\n  return {\n    method: \"GET\",\n    headers,\n    signal: abortController.signal,\n    mode: \"cors\",\n    credentials: withCredentials ? \"include\" : \"same-origin\",\n    redirect: \"follow\",\n  };\n}\n\nfunction createHeaders(httpHeaders) {\n  const headers = new Headers();\n  for (const property in httpHeaders) {\n    const value = httpHeaders[property];\n    if (value === undefined) {\n      continue;\n    }\n    headers.append(property, value);\n  }\n  return headers;\n}\n\nfunction getArrayBuffer(val) {\n  if (val instanceof Uint8Array) {\n    return val.buffer;\n  }\n  if (val instanceof ArrayBuffer) {\n    return val;\n  }\n  warn(`getArrayBuffer - unexpected data format: ${val}`);\n  return new Uint8Array(val).buffer;\n}\n\n/** @implements {IPDFStream} */\nclass PDFFetchStream {\n  constructor(source) {\n    this.source = source;\n    this.isHttp = /^https?:/i.test(source.url);\n    this.httpHeaders = (this.isHttp && source.httpHeaders) || {};\n\n    this._fullRequestReader = null;\n    this._rangeRequestReaders = [];\n  }\n\n  get _progressiveDataLength() {\n    return this._fullRequestReader?._loaded ?? 0;\n  }\n\n  getFullReader() {\n    assert(\n      !this._fullRequestReader,\n      \"PDFFetchStream.getFullReader can only be called once.\"\n    );\n    this._fullRequestReader = new PDFFetchStreamReader(this);\n    return this._fullRequestReader;\n  }\n\n  getRangeReader(begin, end) {\n    if (end <= this._progressiveDataLength) {\n      return null;\n    }\n    const reader = new PDFFetchStreamRangeReader(this, begin, end);\n    this._rangeRequestReaders.push(reader);\n    return reader;\n  }\n\n  cancelAllRequests(reason) {\n    this._fullRequestReader?.cancel(reason);\n\n    for (const reader of this._rangeRequestReaders.slice(0)) {\n      reader.cancel(reason);\n    }\n  }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFFetchStreamReader {\n  constructor(stream) {\n    this._stream = stream;\n    this._reader = null;\n    this._loaded = 0;\n    this._filename = null;\n    const source = stream.source;\n    this._withCredentials = source.withCredentials || false;\n    this._contentLength = source.length;\n    this._headersCapability = new PromiseCapability();\n    this._disableRange = source.disableRange || false;\n    this._rangeChunkSize = source.rangeChunkSize;\n    if (!this._rangeChunkSize && !this._disableRange) {\n      this._disableRange = true;\n    }\n\n    this._abortController = new AbortController();\n    this._isStreamingSupported = !source.disableStream;\n    this._isRangeSupported = !source.disableRange;\n\n    this._headers = createHeaders(this._stream.httpHeaders);\n\n    const url = source.url;\n    fetch(\n      url,\n      createFetchOptions(\n        this._headers,\n        this._withCredentials,\n        this._abortController\n      )\n    )\n      .then(response => {\n        if (!validateResponseStatus(response.status)) {\n          throw createResponseStatusError(response.status, url);\n        }\n        this._reader = response.body.getReader();\n        this._headersCapability.resolve();\n\n        const getResponseHeader = name => {\n          return response.headers.get(name);\n        };\n        const { allowRangeRequests, suggestedLength } =\n          validateRangeRequestCapabilities({\n            getResponseHeader,\n            isHttp: this._stream.isHttp,\n            rangeChunkSize: this._rangeChunkSize,\n            disableRange: this._disableRange,\n          });\n\n        this._isRangeSupported = allowRangeRequests;\n        // Setting right content length.\n        this._contentLength = suggestedLength || this._contentLength;\n\n        this._filename = extractFilenameFromHeader(getResponseHeader);\n\n        // We need to stop reading when range is supported and streaming is\n        // disabled.\n        if (!this._isStreamingSupported && this._isRangeSupported) {\n          this.cancel(new AbortException(\"Streaming is disabled.\"));\n        }\n      })\n      .catch(this._headersCapability.reject);\n\n    this.onProgress = null;\n  }\n\n  get headersReady() {\n    return this._headersCapability.promise;\n  }\n\n  get filename() {\n    return this._filename;\n  }\n\n  get contentLength() {\n    return this._contentLength;\n  }\n\n  get isRangeSupported() {\n    return this._isRangeSupported;\n  }\n\n  get isStreamingSupported() {\n    return this._isStreamingSupported;\n  }\n\n  async read() {\n    await this._headersCapability.promise;\n    const { value, done } = await this._reader.read();\n    if (done) {\n      return { value, done };\n    }\n    this._loaded += value.byteLength;\n    this.onProgress?.({\n      loaded: this._loaded,\n      total: this._contentLength,\n    });\n\n    return { value: getArrayBuffer(value), done: false };\n  }\n\n  cancel(reason) {\n    this._reader?.cancel(reason);\n    this._abortController.abort();\n  }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFFetchStreamRangeReader {\n  constructor(stream, begin, end) {\n    this._stream = stream;\n    this._reader = null;\n    this._loaded = 0;\n    const source = stream.source;\n    this._withCredentials = source.withCredentials || false;\n    this._readCapability = new PromiseCapability();\n    this._isStreamingSupported = !source.disableStream;\n\n    this._abortController = new AbortController();\n    this._headers = createHeaders(this._stream.httpHeaders);\n    this._headers.append(\"Range\", `bytes=${begin}-${end - 1}`);\n\n    const url = source.url;\n    fetch(\n      url,\n      createFetchOptions(\n        this._headers,\n        this._withCredentials,\n        this._abortController\n      )\n    )\n      .then(response => {\n        if (!validateResponseStatus(response.status)) {\n          throw createResponseStatusError(response.status, url);\n        }\n        this._readCapability.resolve();\n        this._reader = response.body.getReader();\n      })\n      .catch(this._readCapability.reject);\n\n    this.onProgress = null;\n  }\n\n  get isStreamingSupported() {\n    return this._isStreamingSupported;\n  }\n\n  async read() {\n    await this._readCapability.promise;\n    const { value, done } = await this._reader.read();\n    if (done) {\n      return { value, done };\n    }\n    this._loaded += value.byteLength;\n    this.onProgress?.({ loaded: this._loaded });\n\n    return { value: getArrayBuffer(value), done: false };\n  }\n\n  cancel(reason) {\n    this._reader?.cancel(reason);\n    this._abortController.abort();\n  }\n}\n\nexport { PDFFetchStream };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  assert,\n  bytesToString,\n  FeatureTest,\n  isNodeJS,\n  shadow,\n  string32,\n  unreachable,\n  warn,\n} from \"../shared/util.js\";\n\nclass FontLoader {\n  #systemFonts = new Set();\n\n  constructor({\n    ownerDocument = globalThis.document,\n    styleElement = null, // For testing only.\n  }) {\n    this._document = ownerDocument;\n\n    this.nativeFontFaces = new Set();\n    this.styleElement =\n      typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")\n        ? styleElement\n        : null;\n\n    if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n      this.loadingRequests = [];\n      this.loadTestFontId = 0;\n    }\n  }\n\n  addNativeFontFace(nativeFontFace) {\n    this.nativeFontFaces.add(nativeFontFace);\n    this._document.fonts.add(nativeFontFace);\n  }\n\n  removeNativeFontFace(nativeFontFace) {\n    this.nativeFontFaces.delete(nativeFontFace);\n    this._document.fonts.delete(nativeFontFace);\n  }\n\n  insertRule(rule) {\n    if (!this.styleElement) {\n      this.styleElement = this._document.createElement(\"style\");\n      this._document.documentElement\n        .getElementsByTagName(\"head\")[0]\n        .append(this.styleElement);\n    }\n    const styleSheet = this.styleElement.sheet;\n    styleSheet.insertRule(rule, styleSheet.cssRules.length);\n  }\n\n  clear() {\n    for (const nativeFontFace of this.nativeFontFaces) {\n      this._document.fonts.delete(nativeFontFace);\n    }\n    this.nativeFontFaces.clear();\n    this.#systemFonts.clear();\n\n    if (this.styleElement) {\n      // Note: ChildNode.remove doesn't throw if the parentNode is undefined.\n      this.styleElement.remove();\n      this.styleElement = null;\n    }\n  }\n\n  async loadSystemFont({ systemFontInfo: info, _inspectFont }) {\n    if (!info || this.#systemFonts.has(info.loadedName)) {\n      return;\n    }\n    assert(\n      !this.disableFontFace,\n      \"loadSystemFont shouldn't be called when `disableFontFace` is set.\"\n    );\n\n    if (this.isFontLoadingAPISupported) {\n      const { loadedName, src, style } = info;\n      const fontFace = new FontFace(loadedName, src, style);\n      this.addNativeFontFace(fontFace);\n      try {\n        await fontFace.load();\n        this.#systemFonts.add(loadedName);\n        _inspectFont?.(info);\n      } catch {\n        warn(\n          `Cannot load system font: ${info.baseFontName}, installing it could help to improve PDF rendering.`\n        );\n\n        this.removeNativeFontFace(fontFace);\n      }\n      return;\n    }\n\n    unreachable(\n      \"Not implemented: loadSystemFont without the Font Loading API.\"\n    );\n  }\n\n  async bind(font) {\n    // Add the font to the DOM only once; skip if the font is already loaded.\n    if (font.attached || (font.missingFile && !font.systemFontInfo)) {\n      return;\n    }\n    font.attached = true;\n\n    if (font.systemFontInfo) {\n      await this.loadSystemFont(font);\n      return;\n    }\n\n    if (this.isFontLoadingAPISupported) {\n      const nativeFontFace = font.createNativeFontFace();\n      if (nativeFontFace) {\n        this.addNativeFontFace(nativeFontFace);\n        try {\n          await nativeFontFace.loaded;\n        } catch (ex) {\n          warn(`Failed to load font '${nativeFontFace.family}': '${ex}'.`);\n\n          // When font loading failed, fall back to the built-in font renderer.\n          font.disableFontFace = true;\n          throw ex;\n        }\n      }\n      return; // The font was, asynchronously, loaded.\n    }\n\n    // !this.isFontLoadingAPISupported\n    const rule = font.createFontFaceRule();\n    if (rule) {\n      this.insertRule(rule);\n\n      if (this.isSyncFontLoadingSupported) {\n        return; // The font was, synchronously, loaded.\n      }\n      if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n        throw new Error(\"Not implemented: async font loading\");\n      }\n      await new Promise(resolve => {\n        const request = this._queueLoadingCallback(resolve);\n        this._prepareFontLoadEvent(font, request);\n      });\n      // The font was, asynchronously, loaded.\n    }\n  }\n\n  get isFontLoadingAPISupported() {\n    const hasFonts = !!this._document?.fonts;\n    if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n      return shadow(\n        this,\n        \"isFontLoadingAPISupported\",\n        hasFonts && !this.styleElement\n      );\n    }\n    return shadow(this, \"isFontLoadingAPISupported\", hasFonts);\n  }\n\n  get isSyncFontLoadingSupported() {\n    if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n      return shadow(this, \"isSyncFontLoadingSupported\", true);\n    }\n\n    let supported = false;\n    if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"CHROME\")) {\n      if (isNodeJS) {\n        // Node.js - we can pretend that sync font loading is supported.\n        supported = true;\n      } else if (\n        typeof navigator !== \"undefined\" &&\n        typeof navigator?.userAgent === \"string\" &&\n        // User agent string sniffing is bad, but there is no reliable way to\n        // tell if the font is fully loaded and ready to be used with canvas.\n        /Mozilla\\/5.0.*?rv:\\d+.*? Gecko/.test(navigator.userAgent)\n      ) {\n        // Firefox, from version 14, supports synchronous font loading.\n        supported = true;\n      }\n    }\n    return shadow(this, \"isSyncFontLoadingSupported\", supported);\n  }\n\n  _queueLoadingCallback(callback) {\n    if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n      throw new Error(\"Not implemented: _queueLoadingCallback\");\n    }\n\n    function completeRequest() {\n      assert(!request.done, \"completeRequest() cannot be called twice.\");\n      request.done = true;\n\n      // Sending all completed requests in order of how they were queued.\n      while (loadingRequests.length > 0 && loadingRequests[0].done) {\n        const otherRequest = loadingRequests.shift();\n        setTimeout(otherRequest.callback, 0);\n      }\n    }\n\n    const { loadingRequests } = this;\n    const request = {\n      done: false,\n      complete: completeRequest,\n      callback,\n    };\n    loadingRequests.push(request);\n    return request;\n  }\n\n  get _loadTestFont() {\n    if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n      throw new Error(\"Not implemented: _loadTestFont\");\n    }\n\n    // This is a CFF font with 1 glyph for '.' that fills its entire width\n    // and height.\n    const testFont = atob(\n      \"T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA\" +\n        \"FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA\" +\n        \"ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA\" +\n        \"AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1\" +\n        \"AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD\" +\n        \"6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACM\" +\n        \"AooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4D\" +\n        \"IP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAA\" +\n        \"AAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUA\" +\n        \"AQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgAB\" +\n        \"AAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABY\" +\n        \"AAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAA\" +\n        \"AC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n        \"AAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n        \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n        \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n        \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n        \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAA\" +\n        \"AAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQAC\" +\n        \"AQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3\" +\n        \"Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj\" +\n        \"FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==\"\n    );\n    return shadow(this, \"_loadTestFont\", testFont);\n  }\n\n  _prepareFontLoadEvent(font, request) {\n    if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n      throw new Error(\"Not implemented: _prepareFontLoadEvent\");\n    }\n\n    /** Hack begin */\n    // There's currently no event when a font has finished downloading so the\n    // following code is a dirty hack to 'guess' when a font is ready.\n    // It's assumed fonts are loaded in order, so add a known test font after\n    // the desired fonts and then test for the loading of that test font.\n\n    function int32(data, offset) {\n      return (\n        (data.charCodeAt(offset) << 24) |\n        (data.charCodeAt(offset + 1) << 16) |\n        (data.charCodeAt(offset + 2) << 8) |\n        (data.charCodeAt(offset + 3) & 0xff)\n      );\n    }\n    function spliceString(s, offset, remove, insert) {\n      const chunk1 = s.substring(0, offset);\n      const chunk2 = s.substring(offset + remove);\n      return chunk1 + insert + chunk2;\n    }\n    let i, ii;\n\n    // The temporary canvas is used to determine if fonts are loaded.\n    const canvas = this._document.createElement(\"canvas\");\n    canvas.width = 1;\n    canvas.height = 1;\n    const ctx = canvas.getContext(\"2d\");\n\n    let called = 0;\n    function isFontReady(name, callback) {\n      // With setTimeout clamping this gives the font ~100ms to load.\n      if (++called > 30) {\n        warn(\"Load test font never loaded.\");\n        callback();\n        return;\n      }\n      ctx.font = \"30px \" + name;\n      ctx.fillText(\".\", 0, 20);\n      const imageData = ctx.getImageData(0, 0, 1, 1);\n      if (imageData.data[3] > 0) {\n        callback();\n        return;\n      }\n      setTimeout(isFontReady.bind(null, name, callback));\n    }\n\n    const loadTestFontId = `lt${Date.now()}${this.loadTestFontId++}`;\n    // Chromium seems to cache fonts based on a hash of the actual font data,\n    // so the font must be modified for each load test else it will appear to\n    // be loaded already.\n    // TODO: This could maybe be made faster by avoiding the btoa of the full\n    // font by splitting it in chunks before hand and padding the font id.\n    let data = this._loadTestFont;\n    const COMMENT_OFFSET = 976; // has to be on 4 byte boundary (for checksum)\n    data = spliceString(\n      data,\n      COMMENT_OFFSET,\n      loadTestFontId.length,\n      loadTestFontId\n    );\n    // CFF checksum is important for IE, adjusting it\n    const CFF_CHECKSUM_OFFSET = 16;\n    const XXXX_VALUE = 0x58585858; // the \"comment\" filled with 'X'\n    let checksum = int32(data, CFF_CHECKSUM_OFFSET);\n    for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) {\n      checksum = (checksum - XXXX_VALUE + int32(loadTestFontId, i)) | 0;\n    }\n    if (i < loadTestFontId.length) {\n      // align to 4 bytes boundary\n      checksum = (checksum - XXXX_VALUE + int32(loadTestFontId + \"XXX\", i)) | 0;\n    }\n    data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, string32(checksum));\n\n    const url = `url(data:font/opentype;base64,${btoa(data)});`;\n    const rule = `@font-face {font-family:\"${loadTestFontId}\";src:${url}}`;\n    this.insertRule(rule);\n\n    const div = this._document.createElement(\"div\");\n    div.style.visibility = \"hidden\";\n    div.style.width = div.style.height = \"10px\";\n    div.style.position = \"absolute\";\n    div.style.top = div.style.left = \"0px\";\n\n    for (const name of [font.loadedName, loadTestFontId]) {\n      const span = this._document.createElement(\"span\");\n      span.textContent = \"Hi\";\n      span.style.fontFamily = name;\n      div.append(span);\n    }\n    this._document.body.append(div);\n\n    isFontReady(loadTestFontId, () => {\n      div.remove();\n      request.complete();\n    });\n    /** Hack end */\n  }\n}\n\nclass FontFaceObject {\n  constructor(\n    translatedData,\n    {\n      isEvalSupported = true,\n      disableFontFace = false,\n      ignoreErrors = false,\n      inspectFont = null,\n    }\n  ) {\n    this.compiledGlyphs = Object.create(null);\n    // importing translated data\n    for (const i in translatedData) {\n      this[i] = translatedData[i];\n    }\n    this.isEvalSupported = isEvalSupported !== false;\n    this.disableFontFace = disableFontFace === true;\n    this.ignoreErrors = ignoreErrors === true;\n    this._inspectFont = inspectFont;\n  }\n\n  createNativeFontFace() {\n    if (!this.data || this.disableFontFace) {\n      return null;\n    }\n    let nativeFontFace;\n    if (!this.cssFontInfo) {\n      nativeFontFace = new FontFace(this.loadedName, this.data, {});\n    } else {\n      const css = {\n        weight: this.cssFontInfo.fontWeight,\n      };\n      if (this.cssFontInfo.italicAngle) {\n        css.style = `oblique ${this.cssFontInfo.italicAngle}deg`;\n      }\n      nativeFontFace = new FontFace(\n        this.cssFontInfo.fontFamily,\n        this.data,\n        css\n      );\n    }\n\n    this._inspectFont?.(this);\n    return nativeFontFace;\n  }\n\n  createFontFaceRule() {\n    if (!this.data || this.disableFontFace) {\n      return null;\n    }\n    const data = bytesToString(this.data);\n    // Add the @font-face rule to the document.\n    const url = `url(data:${this.mimetype};base64,${btoa(data)});`;\n    let rule;\n    if (!this.cssFontInfo) {\n      rule = `@font-face {font-family:\"${this.loadedName}\";src:${url}}`;\n    } else {\n      let css = `font-weight: ${this.cssFontInfo.fontWeight};`;\n      if (this.cssFontInfo.italicAngle) {\n        css += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`;\n      }\n      rule = `@font-face {font-family:\"${this.cssFontInfo.fontFamily}\";${css}src:${url}}`;\n    }\n\n    this._inspectFont?.(this, url);\n    return rule;\n  }\n\n  getPathGenerator(objs, character) {\n    if (this.compiledGlyphs[character] !== undefined) {\n      return this.compiledGlyphs[character];\n    }\n\n    let cmds;\n    try {\n      cmds = objs.get(this.loadedName + \"_path_\" + character);\n    } catch (ex) {\n      if (!this.ignoreErrors) {\n        throw ex;\n      }\n      warn(`getPathGenerator - ignoring character: \"${ex}\".`);\n\n      return (this.compiledGlyphs[character] = function (c, size) {\n        // No-op function, to allow rendering to continue.\n      });\n    }\n\n    // If we can, compile cmds into JS for MAXIMUM SPEED...\n    if (this.isEvalSupported && FeatureTest.isEvalSupported) {\n      const jsBuf = [];\n      for (const current of cmds) {\n        const args = current.args !== undefined ? current.args.join(\",\") : \"\";\n        jsBuf.push(\"c.\", current.cmd, \"(\", args, \");\\n\");\n      }\n      // eslint-disable-next-line no-new-func\n      return (this.compiledGlyphs[character] = new Function(\n        \"c\",\n        \"size\",\n        jsBuf.join(\"\")\n      ));\n    }\n    // ... but fall back on using Function.prototype.apply() if we're\n    // blocked from using eval() for whatever reason (like CSP policies).\n    return (this.compiledGlyphs[character] = function (c, size) {\n      for (const current of cmds) {\n        if (current.cmd === \"scale\") {\n          current.args = [size, -size];\n        }\n        // eslint-disable-next-line prefer-spread\n        c[current.cmd].apply(c, current.args);\n      }\n    });\n  }\n}\n\nexport { FontFaceObject, FontLoader };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { objectFromMap } from \"../shared/util.js\";\n\nclass Metadata {\n  #metadataMap;\n\n  #data;\n\n  constructor({ parsedData, rawData }) {\n    this.#metadataMap = parsedData;\n    this.#data = rawData;\n  }\n\n  getRaw() {\n    return this.#data;\n  }\n\n  get(name) {\n    return this.#metadataMap.get(name) ?? null;\n  }\n\n  getAll() {\n    return objectFromMap(this.#metadataMap);\n  }\n\n  has(name) {\n    return this.#metadataMap.has(name);\n  }\n}\n\nexport { Metadata };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { assert, PromiseCapability, stringToBytes } from \"../shared/util.js\";\nimport {\n  createResponseStatusError,\n  extractFilenameFromHeader,\n  validateRangeRequestCapabilities,\n} from \"./network_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n  throw new Error(\n    'Module \"./network.js\" shall not be used with MOZCENTRAL builds.'\n  );\n}\n\nconst OK_RESPONSE = 200;\nconst PARTIAL_CONTENT_RESPONSE = 206;\n\nfunction getArrayBuffer(xhr) {\n  const data = xhr.response;\n  if (typeof data !== \"string\") {\n    return data;\n  }\n  return stringToBytes(data).buffer;\n}\n\nclass NetworkManager {\n  constructor(url, args = {}) {\n    this.url = url;\n    this.isHttp = /^https?:/i.test(url);\n    this.httpHeaders = (this.isHttp && args.httpHeaders) || Object.create(null);\n    this.withCredentials = args.withCredentials || false;\n\n    this.currXhrId = 0;\n    this.pendingRequests = Object.create(null);\n  }\n\n  requestRange(begin, end, listeners) {\n    const args = {\n      begin,\n      end,\n    };\n    for (const prop in listeners) {\n      args[prop] = listeners[prop];\n    }\n    return this.request(args);\n  }\n\n  requestFull(listeners) {\n    return this.request(listeners);\n  }\n\n  request(args) {\n    const xhr = new XMLHttpRequest();\n    const xhrId = this.currXhrId++;\n    const pendingRequest = (this.pendingRequests[xhrId] = { xhr });\n\n    xhr.open(\"GET\", this.url);\n    xhr.withCredentials = this.withCredentials;\n    for (const property in this.httpHeaders) {\n      const value = this.httpHeaders[property];\n      if (value === undefined) {\n        continue;\n      }\n      xhr.setRequestHeader(property, value);\n    }\n    if (this.isHttp && \"begin\" in args && \"end\" in args) {\n      xhr.setRequestHeader(\"Range\", `bytes=${args.begin}-${args.end - 1}`);\n      pendingRequest.expectedStatus = PARTIAL_CONTENT_RESPONSE;\n    } else {\n      pendingRequest.expectedStatus = OK_RESPONSE;\n    }\n    xhr.responseType = \"arraybuffer\";\n\n    if (args.onError) {\n      xhr.onerror = function (evt) {\n        args.onError(xhr.status);\n      };\n    }\n    xhr.onreadystatechange = this.onStateChange.bind(this, xhrId);\n    xhr.onprogress = this.onProgress.bind(this, xhrId);\n\n    pendingRequest.onHeadersReceived = args.onHeadersReceived;\n    pendingRequest.onDone = args.onDone;\n    pendingRequest.onError = args.onError;\n    pendingRequest.onProgress = args.onProgress;\n\n    xhr.send(null);\n\n    return xhrId;\n  }\n\n  onProgress(xhrId, evt) {\n    const pendingRequest = this.pendingRequests[xhrId];\n    if (!pendingRequest) {\n      return; // Maybe abortRequest was called...\n    }\n    pendingRequest.onProgress?.(evt);\n  }\n\n  onStateChange(xhrId, evt) {\n    const pendingRequest = this.pendingRequests[xhrId];\n    if (!pendingRequest) {\n      return; // Maybe abortRequest was called...\n    }\n\n    const xhr = pendingRequest.xhr;\n    if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) {\n      pendingRequest.onHeadersReceived();\n      delete pendingRequest.onHeadersReceived;\n    }\n\n    if (xhr.readyState !== 4) {\n      return;\n    }\n\n    if (!(xhrId in this.pendingRequests)) {\n      // The XHR request might have been aborted in onHeadersReceived()\n      // callback, in which case we should abort request.\n      return;\n    }\n\n    delete this.pendingRequests[xhrId];\n\n    // Success status == 0 can be on ftp, file and other protocols.\n    if (xhr.status === 0 && this.isHttp) {\n      pendingRequest.onError?.(xhr.status);\n      return;\n    }\n    const xhrStatus = xhr.status || OK_RESPONSE;\n\n    // From http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.2:\n    // \"A server MAY ignore the Range header\". This means it's possible to\n    // get a 200 rather than a 206 response from a range request.\n    const ok_response_on_range_request =\n      xhrStatus === OK_RESPONSE &&\n      pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE;\n\n    if (\n      !ok_response_on_range_request &&\n      xhrStatus !== pendingRequest.expectedStatus\n    ) {\n      pendingRequest.onError?.(xhr.status);\n      return;\n    }\n\n    const chunk = getArrayBuffer(xhr);\n    if (xhrStatus === PARTIAL_CONTENT_RESPONSE) {\n      const rangeHeader = xhr.getResponseHeader(\"Content-Range\");\n      const matches = /bytes (\\d+)-(\\d+)\\/(\\d+)/.exec(rangeHeader);\n      pendingRequest.onDone({\n        begin: parseInt(matches[1], 10),\n        chunk,\n      });\n    } else if (chunk) {\n      pendingRequest.onDone({\n        begin: 0,\n        chunk,\n      });\n    } else {\n      pendingRequest.onError?.(xhr.status);\n    }\n  }\n\n  getRequestXhr(xhrId) {\n    return this.pendingRequests[xhrId].xhr;\n  }\n\n  isPendingRequest(xhrId) {\n    return xhrId in this.pendingRequests;\n  }\n\n  abortRequest(xhrId) {\n    const xhr = this.pendingRequests[xhrId].xhr;\n    delete this.pendingRequests[xhrId];\n    xhr.abort();\n  }\n}\n\n/** @implements {IPDFStream} */\nclass PDFNetworkStream {\n  constructor(source) {\n    this._source = source;\n    this._manager = new NetworkManager(source.url, {\n      httpHeaders: source.httpHeaders,\n      withCredentials: source.withCredentials,\n    });\n    this._rangeChunkSize = source.rangeChunkSize;\n    this._fullRequestReader = null;\n    this._rangeRequestReaders = [];\n  }\n\n  _onRangeRequestReaderClosed(reader) {\n    const i = this._rangeRequestReaders.indexOf(reader);\n    if (i >= 0) {\n      this._rangeRequestReaders.splice(i, 1);\n    }\n  }\n\n  getFullReader() {\n    assert(\n      !this._fullRequestReader,\n      \"PDFNetworkStream.getFullReader can only be called once.\"\n    );\n    this._fullRequestReader = new PDFNetworkStreamFullRequestReader(\n      this._manager,\n      this._source\n    );\n    return this._fullRequestReader;\n  }\n\n  getRangeReader(begin, end) {\n    const reader = new PDFNetworkStreamRangeRequestReader(\n      this._manager,\n      begin,\n      end\n    );\n    reader.onClosed = this._onRangeRequestReaderClosed.bind(this);\n    this._rangeRequestReaders.push(reader);\n    return reader;\n  }\n\n  cancelAllRequests(reason) {\n    this._fullRequestReader?.cancel(reason);\n\n    for (const reader of this._rangeRequestReaders.slice(0)) {\n      reader.cancel(reason);\n    }\n  }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFNetworkStreamFullRequestReader {\n  constructor(manager, source) {\n    this._manager = manager;\n\n    const args = {\n      onHeadersReceived: this._onHeadersReceived.bind(this),\n      onDone: this._onDone.bind(this),\n      onError: this._onError.bind(this),\n      onProgress: this._onProgress.bind(this),\n    };\n    this._url = source.url;\n    this._fullRequestId = manager.requestFull(args);\n    this._headersReceivedCapability = new PromiseCapability();\n    this._disableRange = source.disableRange || false;\n    this._contentLength = source.length; // Optional\n    this._rangeChunkSize = source.rangeChunkSize;\n    if (!this._rangeChunkSize && !this._disableRange) {\n      this._disableRange = true;\n    }\n\n    this._isStreamingSupported = false;\n    this._isRangeSupported = false;\n\n    this._cachedChunks = [];\n    this._requests = [];\n    this._done = false;\n    this._storedError = undefined;\n    this._filename = null;\n\n    this.onProgress = null;\n  }\n\n  _onHeadersReceived() {\n    const fullRequestXhrId = this._fullRequestId;\n    const fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId);\n\n    const getResponseHeader = name => {\n      return fullRequestXhr.getResponseHeader(name);\n    };\n    const { allowRangeRequests, suggestedLength } =\n      validateRangeRequestCapabilities({\n        getResponseHeader,\n        isHttp: this._manager.isHttp,\n        rangeChunkSize: this._rangeChunkSize,\n        disableRange: this._disableRange,\n      });\n\n    if (allowRangeRequests) {\n      this._isRangeSupported = true;\n    }\n    // Setting right content length.\n    this._contentLength = suggestedLength || this._contentLength;\n\n    this._filename = extractFilenameFromHeader(getResponseHeader);\n\n    if (this._isRangeSupported) {\n      // NOTE: by cancelling the full request, and then issuing range\n      // requests, there will be an issue for sites where you can only\n      // request the pdf once. However, if this is the case, then the\n      // server should not be returning that it can support range requests.\n      this._manager.abortRequest(fullRequestXhrId);\n    }\n\n    this._headersReceivedCapability.resolve();\n  }\n\n  _onDone(data) {\n    if (data) {\n      if (this._requests.length > 0) {\n        const requestCapability = this._requests.shift();\n        requestCapability.resolve({ value: data.chunk, done: false });\n      } else {\n        this._cachedChunks.push(data.chunk);\n      }\n    }\n    this._done = true;\n    if (this._cachedChunks.length > 0) {\n      return;\n    }\n    for (const requestCapability of this._requests) {\n      requestCapability.resolve({ value: undefined, done: true });\n    }\n    this._requests.length = 0;\n  }\n\n  _onError(status) {\n    this._storedError = createResponseStatusError(status, this._url);\n    this._headersReceivedCapability.reject(this._storedError);\n    for (const requestCapability of this._requests) {\n      requestCapability.reject(this._storedError);\n    }\n    this._requests.length = 0;\n    this._cachedChunks.length = 0;\n  }\n\n  _onProgress(evt) {\n    this.onProgress?.({\n      loaded: evt.loaded,\n      total: evt.lengthComputable ? evt.total : this._contentLength,\n    });\n  }\n\n  get filename() {\n    return this._filename;\n  }\n\n  get isRangeSupported() {\n    return this._isRangeSupported;\n  }\n\n  get isStreamingSupported() {\n    return this._isStreamingSupported;\n  }\n\n  get contentLength() {\n    return this._contentLength;\n  }\n\n  get headersReady() {\n    return this._headersReceivedCapability.promise;\n  }\n\n  async read() {\n    if (this._storedError) {\n      throw this._storedError;\n    }\n    if (this._cachedChunks.length > 0) {\n      const chunk = this._cachedChunks.shift();\n      return { value: chunk, done: false };\n    }\n    if (this._done) {\n      return { value: undefined, done: true };\n    }\n    const requestCapability = new PromiseCapability();\n    this._requests.push(requestCapability);\n    return requestCapability.promise;\n  }\n\n  cancel(reason) {\n    this._done = true;\n    this._headersReceivedCapability.reject(reason);\n    for (const requestCapability of this._requests) {\n      requestCapability.resolve({ value: undefined, done: true });\n    }\n    this._requests.length = 0;\n    if (this._manager.isPendingRequest(this._fullRequestId)) {\n      this._manager.abortRequest(this._fullRequestId);\n    }\n    this._fullRequestReader = null;\n  }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFNetworkStreamRangeRequestReader {\n  constructor(manager, begin, end) {\n    this._manager = manager;\n\n    const args = {\n      onDone: this._onDone.bind(this),\n      onError: this._onError.bind(this),\n      onProgress: this._onProgress.bind(this),\n    };\n    this._url = manager.url;\n    this._requestId = manager.requestRange(begin, end, args);\n    this._requests = [];\n    this._queuedChunk = null;\n    this._done = false;\n    this._storedError = undefined;\n\n    this.onProgress = null;\n    this.onClosed = null;\n  }\n\n  _close() {\n    this.onClosed?.(this);\n  }\n\n  _onDone(data) {\n    const chunk = data.chunk;\n    if (this._requests.length > 0) {\n      const requestCapability = this._requests.shift();\n      requestCapability.resolve({ value: chunk, done: false });\n    } else {\n      this._queuedChunk = chunk;\n    }\n    this._done = true;\n    for (const requestCapability of this._requests) {\n      requestCapability.resolve({ value: undefined, done: true });\n    }\n    this._requests.length = 0;\n    this._close();\n  }\n\n  _onError(status) {\n    this._storedError = createResponseStatusError(status, this._url);\n    for (const requestCapability of this._requests) {\n      requestCapability.reject(this._storedError);\n    }\n    this._requests.length = 0;\n    this._queuedChunk = null;\n  }\n\n  _onProgress(evt) {\n    if (!this.isStreamingSupported) {\n      this.onProgress?.({ loaded: evt.loaded });\n    }\n  }\n\n  get isStreamingSupported() {\n    return false;\n  }\n\n  async read() {\n    if (this._storedError) {\n      throw this._storedError;\n    }\n    if (this._queuedChunk !== null) {\n      const chunk = this._queuedChunk;\n      this._queuedChunk = null;\n      return { value: chunk, done: false };\n    }\n    if (this._done) {\n      return { value: undefined, done: true };\n    }\n    const requestCapability = new PromiseCapability();\n    this._requests.push(requestCapability);\n    return requestCapability.promise;\n  }\n\n  cancel(reason) {\n    this._done = true;\n    for (const requestCapability of this._requests) {\n      requestCapability.resolve({ value: undefined, done: true });\n    }\n    this._requests.length = 0;\n    if (this._manager.isPendingRequest(this._requestId)) {\n      this._manager.abortRequest(this._requestId);\n    }\n    this._close();\n  }\n}\n\nexport { PDFNetworkStream };\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { stringToBytes } from \"../shared/util.js\";\n\n// This getFilenameFromContentDispositionHeader function is adapted from\n// https://github.com/Rob--W/open-in-browser/blob/7e2e35a38b8b4e981b11da7b2f01df0149049e92/extension/content-disposition.js\n// with the following changes:\n// - Modified to conform to PDF.js's coding style.\n// - Move return to the end of the function to prevent Babel from dropping the\n//   function declarations.\n\n/**\n * Extract file name from the Content-Disposition HTTP response header.\n *\n * @param {string} contentDisposition\n * @returns {string} Filename, if found in the Content-Disposition header.\n */\nfunction getFilenameFromContentDispositionHeader(contentDisposition) {\n  let needsEncodingFixup = true;\n\n  // filename*=ext-value (\"ext-value\" from RFC 5987, referenced by RFC 6266).\n  let tmp = toParamRegExp(\"filename\\\\*\", \"i\").exec(contentDisposition);\n  if (tmp) {\n    tmp = tmp[1];\n    let filename = rfc2616unquote(tmp);\n    filename = unescape(filename);\n    filename = rfc5987decode(filename);\n    filename = rfc2047decode(filename);\n    return fixupEncoding(filename);\n  }\n\n  // Continuations (RFC 2231 section 3, referenced by RFC 5987 section 3.1).\n  // filename*n*=part\n  // filename*n=part\n  tmp = rfc2231getparam(contentDisposition);\n  if (tmp) {\n    // RFC 2047, section\n    const filename = rfc2047decode(tmp);\n    return fixupEncoding(filename);\n  }\n\n  // filename=value (RFC 5987, section 4.1).\n  tmp = toParamRegExp(\"filename\", \"i\").exec(contentDisposition);\n  if (tmp) {\n    tmp = tmp[1];\n    let filename = rfc2616unquote(tmp);\n    filename = rfc2047decode(filename);\n    return fixupEncoding(filename);\n  }\n\n  // After this line there are only function declarations. We cannot put\n  // \"return\" here for readability because babel would then drop the function\n  // declarations...\n  function toParamRegExp(attributePattern, flags) {\n    return new RegExp(\n      \"(?:^|;)\\\\s*\" +\n        attributePattern +\n        \"\\\\s*=\\\\s*\" +\n        // Captures: value = token | quoted-string\n        // (RFC 2616, section 3.6 and referenced by RFC 6266 4.1)\n        \"(\" +\n        '[^\";\\\\s][^;\\\\s]*' +\n        \"|\" +\n        '\"(?:[^\"\\\\\\\\]|\\\\\\\\\"?)+\"?' +\n        \")\",\n      flags\n    );\n  }\n  function textdecode(encoding, value) {\n    if (encoding) {\n      if (!/^[\\x00-\\xFF]+$/.test(value)) {\n        return value;\n      }\n      try {\n        const decoder = new TextDecoder(encoding, { fatal: true });\n        const buffer = stringToBytes(value);\n        value = decoder.decode(buffer);\n        needsEncodingFixup = false;\n      } catch {\n        // TextDecoder constructor threw - unrecognized encoding.\n      }\n    }\n    return value;\n  }\n  function fixupEncoding(value) {\n    if (needsEncodingFixup && /[\\x80-\\xff]/.test(value)) {\n      // Maybe multi-byte UTF-8.\n      value = textdecode(\"utf-8\", value);\n      if (needsEncodingFixup) {\n        // Try iso-8859-1 encoding.\n        value = textdecode(\"iso-8859-1\", value);\n      }\n    }\n    return value;\n  }\n  function rfc2231getparam(contentDispositionStr) {\n    const matches = [];\n    let match;\n    // Iterate over all filename*n= and filename*n*= with n being an integer\n    // of at least zero. Any non-zero number must not start with '0'.\n    const iter = toParamRegExp(\"filename\\\\*((?!0\\\\d)\\\\d+)(\\\\*?)\", \"ig\");\n    while ((match = iter.exec(contentDispositionStr)) !== null) {\n      let [, n, quot, part] = match; // eslint-disable-line prefer-const\n      n = parseInt(n, 10);\n      if (n in matches) {\n        // Ignore anything after the invalid second filename*0.\n        if (n === 0) {\n          break;\n        }\n        continue;\n      }\n      matches[n] = [quot, part];\n    }\n    const parts = [];\n    for (let n = 0; n < matches.length; ++n) {\n      if (!(n in matches)) {\n        // Numbers must be consecutive. Truncate when there is a hole.\n        break;\n      }\n      let [quot, part] = matches[n]; // eslint-disable-line prefer-const\n      part = rfc2616unquote(part);\n      if (quot) {\n        part = unescape(part);\n        if (n === 0) {\n          part = rfc5987decode(part);\n        }\n      }\n      parts.push(part);\n    }\n    return parts.join(\"\");\n  }\n  function rfc2616unquote(value) {\n    if (value.startsWith('\"')) {\n      const parts = value.slice(1).split('\\\\\"');\n      // Find the first unescaped \" and terminate there.\n      for (let i = 0; i < parts.length; ++i) {\n        const quotindex = parts[i].indexOf('\"');\n        if (quotindex !== -1) {\n          parts[i] = parts[i].slice(0, quotindex);\n          parts.length = i + 1; // Truncates and stop the iteration.\n        }\n        parts[i] = parts[i].replaceAll(/\\\\(.)/g, \"$1\");\n      }\n      value = parts.join('\"');\n    }\n    return value;\n  }\n  function rfc5987decode(extvalue) {\n    // Decodes \"ext-value\" from RFC 5987.\n    const encodingend = extvalue.indexOf(\"'\");\n    if (encodingend === -1) {\n      // Some servers send \"filename*=\" without encoding 'language' prefix,\n      // e.g. in https://github.com/Rob--W/open-in-browser/issues/26\n      // Let's accept the value like Firefox (57) (Chrome 62 rejects it).\n      return extvalue;\n    }\n    const encoding = extvalue.slice(0, encodingend);\n    const langvalue = extvalue.slice(encodingend + 1);\n    // Ignore language (RFC 5987 section 3.2.1, and RFC 6266 section 4.1 ).\n    const value = langvalue.replace(/^[^']*'/, \"\");\n    return textdecode(encoding, value);\n  }\n  function rfc2047decode(value) {\n    // RFC 2047-decode the result. Firefox tried to drop support for it, but\n    // backed out because some servers use it - https://bugzil.la/875615\n    // Firefox's condition for decoding is here: https://searchfox.org/mozilla-central/rev/4a590a5a15e35d88a3b23dd6ac3c471cf85b04a8/netwerk/mime/nsMIMEHeaderParamImpl.cpp#742-748\n\n    // We are more strict and only recognize RFC 2047-encoding if the value\n    // starts with \"=?\", since then it is likely that the full value is\n    // RFC 2047-encoded.\n\n    // Firefox also decodes words even where RFC 2047 section 5 states:\n    // \"An 'encoded-word' MUST NOT appear within a 'quoted-string'.\"\n    if (!value.startsWith(\"=?\") || /[\\x00-\\x19\\x80-\\xff]/.test(value)) {\n      return value;\n    }\n    // RFC 2047, section 2.4\n    // encoded-word = \"=?\" charset \"?\" encoding \"?\" encoded-text \"?=\"\n    // charset = token (but let's restrict to characters that denote a\n    //       possibly valid encoding).\n    // encoding = q or b\n    // encoded-text = any printable ASCII character other than ? or space.\n    //        ... but Firefox permits ? and space.\n    return value.replaceAll(\n      /=\\?([\\w-]*)\\?([QqBb])\\?((?:[^?]|\\?(?!=))*)\\?=/g,\n      function (matches, charset, encoding, text) {\n        if (encoding === \"q\" || encoding === \"Q\") {\n          // RFC 2047 section 4.2.\n          text = text.replaceAll(\"_\", \" \");\n          text = text.replaceAll(/=([0-9a-fA-F]{2})/g, function (match, hex) {\n            return String.fromCharCode(parseInt(hex, 16));\n          });\n          return textdecode(charset, text);\n        } // else encoding is b or B - base64 (RFC 2047 section 4.1)\n        try {\n          text = atob(text);\n        } catch {}\n        return textdecode(charset, text);\n      }\n    );\n  }\n\n  return \"\";\n}\n\nexport { getFilenameFromContentDispositionHeader };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  assert,\n  MissingPDFException,\n  UnexpectedResponseException,\n} from \"../shared/util.js\";\nimport { getFilenameFromContentDispositionHeader } from \"./content_disposition.js\";\nimport { isPdfFile } from \"./display_utils.js\";\n\nfunction validateRangeRequestCapabilities({\n  getResponseHeader,\n  isHttp,\n  rangeChunkSize,\n  disableRange,\n}) {\n  if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n    assert(\n      Number.isInteger(rangeChunkSize) && rangeChunkSize > 0,\n      \"rangeChunkSize must be an integer larger than zero.\"\n    );\n  }\n  const returnValues = {\n    allowRangeRequests: false,\n    suggestedLength: undefined,\n  };\n\n  const length = parseInt(getResponseHeader(\"Content-Length\"), 10);\n  if (!Number.isInteger(length)) {\n    return returnValues;\n  }\n\n  returnValues.suggestedLength = length;\n\n  if (length <= 2 * rangeChunkSize) {\n    // The file size is smaller than the size of two chunks, so it does not\n    // make any sense to abort the request and retry with a range request.\n    return returnValues;\n  }\n\n  if (disableRange || !isHttp) {\n    return returnValues;\n  }\n  if (getResponseHeader(\"Accept-Ranges\") !== \"bytes\") {\n    return returnValues;\n  }\n\n  const contentEncoding = getResponseHeader(\"Content-Encoding\") || \"identity\";\n  if (contentEncoding !== \"identity\") {\n    return returnValues;\n  }\n\n  returnValues.allowRangeRequests = true;\n  return returnValues;\n}\n\nfunction extractFilenameFromHeader(getResponseHeader) {\n  const contentDisposition = getResponseHeader(\"Content-Disposition\");\n  if (contentDisposition) {\n    let filename = getFilenameFromContentDispositionHeader(contentDisposition);\n    if (filename.includes(\"%\")) {\n      try {\n        filename = decodeURIComponent(filename);\n      } catch {}\n    }\n    if (isPdfFile(filename)) {\n      return filename;\n    }\n  }\n  return null;\n}\n\nfunction createResponseStatusError(status, url) {\n  if (status === 404 || (status === 0 && url.startsWith(\"file:\"))) {\n    return new MissingPDFException('Missing PDF \"' + url + '\".');\n  }\n  return new UnexpectedResponseException(\n    `Unexpected server response (${status}) while retrieving PDF \"${url}\".`,\n    status\n  );\n}\n\nfunction validateResponseStatus(status) {\n  return status === 200 || status === 206;\n}\n\nexport {\n  createResponseStatusError,\n  extractFilenameFromHeader,\n  validateRangeRequestCapabilities,\n  validateResponseStatus,\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  AbortException,\n  assert,\n  isNodeJS,\n  MissingPDFException,\n  PromiseCapability,\n} from \"../shared/util.js\";\nimport {\n  extractFilenameFromHeader,\n  validateRangeRequestCapabilities,\n} from \"./network_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n  throw new Error(\n    'Module \"./node_stream.js\" shall not be used with MOZCENTRAL builds.'\n  );\n}\n\nlet fs, http, https, url;\nif (isNodeJS) {\n  // Native packages.\n  fs = await import(/* webpackIgnore: true */ \"fs\");\n  http = await import(/* webpackIgnore: true */ \"http\");\n  https = await import(/* webpackIgnore: true */ \"https\");\n  url = await import(/* webpackIgnore: true */ \"url\");\n}\n\nconst fileUriRegex = /^file:\\/\\/\\/[a-zA-Z]:\\//;\n\nfunction parseUrl(sourceUrl) {\n  const parsedUrl = url.parse(sourceUrl);\n  if (parsedUrl.protocol === \"file:\" || parsedUrl.host) {\n    return parsedUrl;\n  }\n  // Prepending 'file:///' to Windows absolute path.\n  if (/^[a-z]:[/\\\\]/i.test(sourceUrl)) {\n    return url.parse(`file:///${sourceUrl}`);\n  }\n  // Changes protocol to 'file:' if url refers to filesystem.\n  if (!parsedUrl.host) {\n    parsedUrl.protocol = \"file:\";\n  }\n  return parsedUrl;\n}\n\nclass PDFNodeStream {\n  constructor(source) {\n    this.source = source;\n    this.url = parseUrl(source.url);\n    this.isHttp =\n      this.url.protocol === \"http:\" || this.url.protocol === \"https:\";\n    // Check if url refers to filesystem.\n    this.isFsUrl = this.url.protocol === \"file:\";\n    this.httpHeaders = (this.isHttp && source.httpHeaders) || {};\n\n    this._fullRequestReader = null;\n    this._rangeRequestReaders = [];\n  }\n\n  get _progressiveDataLength() {\n    return this._fullRequestReader?._loaded ?? 0;\n  }\n\n  getFullReader() {\n    assert(\n      !this._fullRequestReader,\n      \"PDFNodeStream.getFullReader can only be called once.\"\n    );\n    this._fullRequestReader = this.isFsUrl\n      ? new PDFNodeStreamFsFullReader(this)\n      : new PDFNodeStreamFullReader(this);\n    return this._fullRequestReader;\n  }\n\n  getRangeReader(start, end) {\n    if (end <= this._progressiveDataLength) {\n      return null;\n    }\n    const rangeReader = this.isFsUrl\n      ? new PDFNodeStreamFsRangeReader(this, start, end)\n      : new PDFNodeStreamRangeReader(this, start, end);\n    this._rangeRequestReaders.push(rangeReader);\n    return rangeReader;\n  }\n\n  cancelAllRequests(reason) {\n    this._fullRequestReader?.cancel(reason);\n\n    for (const reader of this._rangeRequestReaders.slice(0)) {\n      reader.cancel(reason);\n    }\n  }\n}\n\nclass BaseFullReader {\n  constructor(stream) {\n    this._url = stream.url;\n    this._done = false;\n    this._storedError = null;\n    this.onProgress = null;\n    const source = stream.source;\n    this._contentLength = source.length; // optional\n    this._loaded = 0;\n    this._filename = null;\n\n    this._disableRange = source.disableRange || false;\n    this._rangeChunkSize = source.rangeChunkSize;\n    if (!this._rangeChunkSize && !this._disableRange) {\n      this._disableRange = true;\n    }\n\n    this._isStreamingSupported = !source.disableStream;\n    this._isRangeSupported = !source.disableRange;\n\n    this._readableStream = null;\n    this._readCapability = new PromiseCapability();\n    this._headersCapability = new PromiseCapability();\n  }\n\n  get headersReady() {\n    return this._headersCapability.promise;\n  }\n\n  get filename() {\n    return this._filename;\n  }\n\n  get contentLength() {\n    return this._contentLength;\n  }\n\n  get isRangeSupported() {\n    return this._isRangeSupported;\n  }\n\n  get isStreamingSupported() {\n    return this._isStreamingSupported;\n  }\n\n  async read() {\n    await this._readCapability.promise;\n    if (this._done) {\n      return { value: undefined, done: true };\n    }\n    if (this._storedError) {\n      throw this._storedError;\n    }\n\n    const chunk = this._readableStream.read();\n    if (chunk === null) {\n      this._readCapability = new PromiseCapability();\n      return this.read();\n    }\n    this._loaded += chunk.length;\n    this.onProgress?.({\n      loaded: this._loaded,\n      total: this._contentLength,\n    });\n\n    // Ensure that `read()` method returns ArrayBuffer.\n    const buffer = new Uint8Array(chunk).buffer;\n    return { value: buffer, done: false };\n  }\n\n  cancel(reason) {\n    // Call `this._error()` method when cancel is called\n    // before _readableStream is set.\n    if (!this._readableStream) {\n      this._error(reason);\n      return;\n    }\n    this._readableStream.destroy(reason);\n  }\n\n  _error(reason) {\n    this._storedError = reason;\n    this._readCapability.resolve();\n  }\n\n  _setReadableStream(readableStream) {\n    this._readableStream = readableStream;\n    readableStream.on(\"readable\", () => {\n      this._readCapability.resolve();\n    });\n\n    readableStream.on(\"end\", () => {\n      // Destroy readable to minimize resource usage.\n      readableStream.destroy();\n      this._done = true;\n      this._readCapability.resolve();\n    });\n\n    readableStream.on(\"error\", reason => {\n      this._error(reason);\n    });\n\n    // We need to stop reading when range is supported and streaming is\n    // disabled.\n    if (!this._isStreamingSupported && this._isRangeSupported) {\n      this._error(new AbortException(\"streaming is disabled\"));\n    }\n\n    // Destroy ReadableStream if already in errored state.\n    if (this._storedError) {\n      this._readableStream.destroy(this._storedError);\n    }\n  }\n}\n\nclass BaseRangeReader {\n  constructor(stream) {\n    this._url = stream.url;\n    this._done = false;\n    this._storedError = null;\n    this.onProgress = null;\n    this._loaded = 0;\n    this._readableStream = null;\n    this._readCapability = new PromiseCapability();\n    const source = stream.source;\n    this._isStreamingSupported = !source.disableStream;\n  }\n\n  get isStreamingSupported() {\n    return this._isStreamingSupported;\n  }\n\n  async read() {\n    await this._readCapability.promise;\n    if (this._done) {\n      return { value: undefined, done: true };\n    }\n    if (this._storedError) {\n      throw this._storedError;\n    }\n\n    const chunk = this._readableStream.read();\n    if (chunk === null) {\n      this._readCapability = new PromiseCapability();\n      return this.read();\n    }\n    this._loaded += chunk.length;\n    this.onProgress?.({ loaded: this._loaded });\n\n    // Ensure that `read()` method returns ArrayBuffer.\n    const buffer = new Uint8Array(chunk).buffer;\n    return { value: buffer, done: false };\n  }\n\n  cancel(reason) {\n    // Call `this._error()` method when cancel is called\n    // before _readableStream is set.\n    if (!this._readableStream) {\n      this._error(reason);\n      return;\n    }\n    this._readableStream.destroy(reason);\n  }\n\n  _error(reason) {\n    this._storedError = reason;\n    this._readCapability.resolve();\n  }\n\n  _setReadableStream(readableStream) {\n    this._readableStream = readableStream;\n    readableStream.on(\"readable\", () => {\n      this._readCapability.resolve();\n    });\n\n    readableStream.on(\"end\", () => {\n      // Destroy readableStream to minimize resource usage.\n      readableStream.destroy();\n      this._done = true;\n      this._readCapability.resolve();\n    });\n\n    readableStream.on(\"error\", reason => {\n      this._error(reason);\n    });\n\n    // Destroy readableStream if already in errored state.\n    if (this._storedError) {\n      this._readableStream.destroy(this._storedError);\n    }\n  }\n}\n\nfunction createRequestOptions(parsedUrl, headers) {\n  return {\n    protocol: parsedUrl.protocol,\n    auth: parsedUrl.auth,\n    host: parsedUrl.hostname,\n    port: parsedUrl.port,\n    path: parsedUrl.path,\n    method: \"GET\",\n    headers,\n  };\n}\n\nclass PDFNodeStreamFullReader extends BaseFullReader {\n  constructor(stream) {\n    super(stream);\n\n    const handleResponse = response => {\n      if (response.statusCode === 404) {\n        const error = new MissingPDFException(`Missing PDF \"${this._url}\".`);\n        this._storedError = error;\n        this._headersCapability.reject(error);\n        return;\n      }\n      this._headersCapability.resolve();\n      this._setReadableStream(response);\n\n      const getResponseHeader = name => {\n        // Make sure that headers name are in lower case, as mentioned\n        // here: https://nodejs.org/api/http.html#http_message_headers.\n        return this._readableStream.headers[name.toLowerCase()];\n      };\n      const { allowRangeRequests, suggestedLength } =\n        validateRangeRequestCapabilities({\n          getResponseHeader,\n          isHttp: stream.isHttp,\n          rangeChunkSize: this._rangeChunkSize,\n          disableRange: this._disableRange,\n        });\n\n      this._isRangeSupported = allowRangeRequests;\n      // Setting right content length.\n      this._contentLength = suggestedLength || this._contentLength;\n\n      this._filename = extractFilenameFromHeader(getResponseHeader);\n    };\n\n    this._request = null;\n    if (this._url.protocol === \"http:\") {\n      this._request = http.request(\n        createRequestOptions(this._url, stream.httpHeaders),\n        handleResponse\n      );\n    } else {\n      this._request = https.request(\n        createRequestOptions(this._url, stream.httpHeaders),\n        handleResponse\n      );\n    }\n\n    this._request.on(\"error\", reason => {\n      this._storedError = reason;\n      this._headersCapability.reject(reason);\n    });\n    // Note: `request.end(data)` is used to write `data` to request body\n    // and notify end of request. But one should always call `request.end()`\n    // even if there is no data to write -- (to notify the end of request).\n    this._request.end();\n  }\n}\n\nclass PDFNodeStreamRangeReader extends BaseRangeReader {\n  constructor(stream, start, end) {\n    super(stream);\n\n    this._httpHeaders = {};\n    for (const property in stream.httpHeaders) {\n      const value = stream.httpHeaders[property];\n      if (value === undefined) {\n        continue;\n      }\n      this._httpHeaders[property] = value;\n    }\n    this._httpHeaders.Range = `bytes=${start}-${end - 1}`;\n\n    const handleResponse = response => {\n      if (response.statusCode === 404) {\n        const error = new MissingPDFException(`Missing PDF \"${this._url}\".`);\n        this._storedError = error;\n        return;\n      }\n      this._setReadableStream(response);\n    };\n\n    this._request = null;\n    if (this._url.protocol === \"http:\") {\n      this._request = http.request(\n        createRequestOptions(this._url, this._httpHeaders),\n        handleResponse\n      );\n    } else {\n      this._request = https.request(\n        createRequestOptions(this._url, this._httpHeaders),\n        handleResponse\n      );\n    }\n\n    this._request.on(\"error\", reason => {\n      this._storedError = reason;\n    });\n    this._request.end();\n  }\n}\n\nclass PDFNodeStreamFsFullReader extends BaseFullReader {\n  constructor(stream) {\n    super(stream);\n\n    let path = decodeURIComponent(this._url.path);\n\n    // Remove the extra slash to get right path from url like `file:///C:/`\n    if (fileUriRegex.test(this._url.href)) {\n      path = path.replace(/^\\//, \"\");\n    }\n\n    fs.lstat(path, (error, stat) => {\n      if (error) {\n        if (error.code === \"ENOENT\") {\n          error = new MissingPDFException(`Missing PDF \"${path}\".`);\n        }\n        this._storedError = error;\n        this._headersCapability.reject(error);\n        return;\n      }\n      // Setting right content length.\n      this._contentLength = stat.size;\n\n      this._setReadableStream(fs.createReadStream(path));\n      this._headersCapability.resolve();\n    });\n  }\n}\n\nclass PDFNodeStreamFsRangeReader extends BaseRangeReader {\n  constructor(stream, start, end) {\n    super(stream);\n\n    let path = decodeURIComponent(this._url.path);\n\n    // Remove the extra slash to get right path from url like `file:///C:/`\n    if (fileUriRegex.test(this._url.href)) {\n      path = path.replace(/^\\//, \"\");\n    }\n\n    this._setReadableStream(fs.createReadStream(path, { start, end: end - 1 }));\n  }\n}\n\nexport { PDFNodeStream };\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  BaseCanvasFactory,\n  BaseCMapReaderFactory,\n  BaseFilterFactory,\n  BaseStandardFontDataFactory,\n} from \"./base_factory.js\";\nimport { isNodeJS, warn } from \"../shared/util.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n  throw new Error(\n    'Module \"./node_utils.js\" shall not be used with MOZCENTRAL builds.'\n  );\n}\n\nlet fs, canvas, path2d_polyfill;\nif (isNodeJS) {\n  // Native packages.\n  fs = await import(/* webpackIgnore: true */ \"fs\");\n  // Optional, third-party, packages.\n  try {\n    canvas = await import(/* webpackIgnore: true */ \"canvas\");\n  } catch {}\n  try {\n    path2d_polyfill = await import(/* webpackIgnore: true */ \"path2d-polyfill\");\n  } catch {}\n}\n\nif (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"SKIP_BABEL\")) {\n  (function checkDOMMatrix() {\n    if (globalThis.DOMMatrix || !isNodeJS) {\n      return;\n    }\n    const DOMMatrix = canvas?.DOMMatrix;\n\n    if (DOMMatrix) {\n      globalThis.DOMMatrix = DOMMatrix;\n    } else {\n      warn(\"Cannot polyfill `DOMMatrix`, rendering may be broken.\");\n    }\n  })();\n\n  (function checkPath2D() {\n    if (globalThis.Path2D || !isNodeJS) {\n      return;\n    }\n    const CanvasRenderingContext2D = canvas?.CanvasRenderingContext2D;\n    const polyfillPath2D = path2d_polyfill?.polyfillPath2D;\n\n    if (CanvasRenderingContext2D && polyfillPath2D) {\n      globalThis.CanvasRenderingContext2D = CanvasRenderingContext2D;\n      polyfillPath2D(globalThis);\n    } else {\n      warn(\"Cannot polyfill `Path2D`, rendering may be broken.\");\n    }\n  })();\n}\n\nconst fetchData = function (url) {\n  return new Promise((resolve, reject) => {\n    fs.readFile(url, (error, data) => {\n      if (error || !data) {\n        reject(new Error(error));\n        return;\n      }\n      resolve(new Uint8Array(data));\n    });\n  });\n};\n\nclass NodeFilterFactory extends BaseFilterFactory {}\n\nclass NodeCanvasFactory extends BaseCanvasFactory {\n  /**\n   * @ignore\n   */\n  _createCanvas(width, height) {\n    return canvas.createCanvas(width, height);\n  }\n}\n\nclass NodeCMapReaderFactory extends BaseCMapReaderFactory {\n  /**\n   * @ignore\n   */\n  _fetchData(url, compressionType) {\n    return fetchData(url).then(data => {\n      return { cMapData: data, compressionType };\n    });\n  }\n}\n\nclass NodeStandardFontDataFactory extends BaseStandardFontDataFactory {\n  /**\n   * @ignore\n   */\n  _fetchData(url) {\n    return fetchData(url);\n  }\n}\n\nexport {\n  NodeCanvasFactory,\n  NodeCMapReaderFactory,\n  NodeFilterFactory,\n  NodeStandardFontDataFactory,\n};\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { objectFromMap, unreachable, warn } from \"../shared/util.js\";\nimport { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\n\nconst INTERNAL = Symbol(\"INTERNAL\");\n\nclass OptionalContentGroup {\n  #visible = true;\n\n  constructor(name, intent) {\n    this.name = name;\n    this.intent = intent;\n  }\n\n  /**\n   * @type {boolean}\n   */\n  get visible() {\n    return this.#visible;\n  }\n\n  /**\n   * @ignore\n   */\n  _setVisible(internal, visible) {\n    if (internal !== INTERNAL) {\n      unreachable(\"Internal method `_setVisible` called.\");\n    }\n    this.#visible = visible;\n  }\n}\n\nclass OptionalContentConfig {\n  #cachedGetHash = null;\n\n  #groups = new Map();\n\n  #initialHash = null;\n\n  #order = null;\n\n  constructor(data) {\n    this.name = null;\n    this.creator = null;\n\n    if (data === null) {\n      return;\n    }\n    this.name = data.name;\n    this.creator = data.creator;\n    this.#order = data.order;\n    for (const group of data.groups) {\n      this.#groups.set(\n        group.id,\n        new OptionalContentGroup(group.name, group.intent)\n      );\n    }\n\n    if (data.baseState === \"OFF\") {\n      for (const group of this.#groups.values()) {\n        group._setVisible(INTERNAL, false);\n      }\n    }\n\n    for (const on of data.on) {\n      this.#groups.get(on)._setVisible(INTERNAL, true);\n    }\n\n    for (const off of data.off) {\n      this.#groups.get(off)._setVisible(INTERNAL, false);\n    }\n\n    // The following code must always run *last* in the constructor.\n    this.#initialHash = this.getHash();\n  }\n\n  #evaluateVisibilityExpression(array) {\n    const length = array.length;\n    if (length < 2) {\n      return true;\n    }\n    const operator = array[0];\n    for (let i = 1; i < length; i++) {\n      const element = array[i];\n      let state;\n      if (Array.isArray(element)) {\n        state = this.#evaluateVisibilityExpression(element);\n      } else if (this.#groups.has(element)) {\n        state = this.#groups.get(element).visible;\n      } else {\n        warn(`Optional content group not found: ${element}`);\n        return true;\n      }\n      switch (operator) {\n        case \"And\":\n          if (!state) {\n            return false;\n          }\n          break;\n        case \"Or\":\n          if (state) {\n            return true;\n          }\n          break;\n        case \"Not\":\n          return !state;\n        default:\n          return true;\n      }\n    }\n    return operator === \"And\";\n  }\n\n  isVisible(group) {\n    if (this.#groups.size === 0) {\n      return true;\n    }\n    if (!group) {\n      warn(\"Optional content group not defined.\");\n      return true;\n    }\n    if (group.type === \"OCG\") {\n      if (!this.#groups.has(group.id)) {\n        warn(`Optional content group not found: ${group.id}`);\n        return true;\n      }\n      return this.#groups.get(group.id).visible;\n    } else if (group.type === \"OCMD\") {\n      // Per the spec, the expression should be preferred if available.\n      if (group.expression) {\n        return this.#evaluateVisibilityExpression(group.expression);\n      }\n      if (!group.policy || group.policy === \"AnyOn\") {\n        // Default\n        for (const id of group.ids) {\n          if (!this.#groups.has(id)) {\n            warn(`Optional content group not found: ${id}`);\n            return true;\n          }\n          if (this.#groups.get(id).visible) {\n            return true;\n          }\n        }\n        return false;\n      } else if (group.policy === \"AllOn\") {\n        for (const id of group.ids) {\n          if (!this.#groups.has(id)) {\n            warn(`Optional content group not found: ${id}`);\n            return true;\n          }\n          if (!this.#groups.get(id).visible) {\n            return false;\n          }\n        }\n        return true;\n      } else if (group.policy === \"AnyOff\") {\n        for (const id of group.ids) {\n          if (!this.#groups.has(id)) {\n            warn(`Optional content group not found: ${id}`);\n            return true;\n          }\n          if (!this.#groups.get(id).visible) {\n            return true;\n          }\n        }\n        return false;\n      } else if (group.policy === \"AllOff\") {\n        for (const id of group.ids) {\n          if (!this.#groups.has(id)) {\n            warn(`Optional content group not found: ${id}`);\n            return true;\n          }\n          if (this.#groups.get(id).visible) {\n            return false;\n          }\n        }\n        return true;\n      }\n      warn(`Unknown optional content policy ${group.policy}.`);\n      return true;\n    }\n    warn(`Unknown group type ${group.type}.`);\n    return true;\n  }\n\n  setVisibility(id, visible = true) {\n    if (!this.#groups.has(id)) {\n      warn(`Optional content group not found: ${id}`);\n      return;\n    }\n    this.#groups.get(id)._setVisible(INTERNAL, !!visible);\n\n    this.#cachedGetHash = null;\n  }\n\n  get hasInitialVisibility() {\n    return this.#initialHash === null || this.getHash() === this.#initialHash;\n  }\n\n  getOrder() {\n    if (!this.#groups.size) {\n      return null;\n    }\n    if (this.#order) {\n      return this.#order.slice();\n    }\n    return [...this.#groups.keys()];\n  }\n\n  getGroups() {\n    return this.#groups.size > 0 ? objectFromMap(this.#groups) : null;\n  }\n\n  getGroup(id) {\n    return this.#groups.get(id) || null;\n  }\n\n  getHash() {\n    if (this.#cachedGetHash !== null) {\n      return this.#cachedGetHash;\n    }\n    const hash = new MurmurHash3_64();\n\n    for (const [id, group] of this.#groups) {\n      hash.update(`${id}:${group.visible}`);\n    }\n    return (this.#cachedGetHash = hash.hexdigest());\n  }\n}\n\nexport { OptionalContentConfig };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"./api\").TextContent} TextContent */\n\nimport {\n  AbortException,\n  FeatureTest,\n  PromiseCapability,\n  Util,\n} from \"../shared/util.js\";\nimport { setLayerDimensions } from \"./display_utils.js\";\n\n/**\n * Text layer render parameters.\n *\n * @typedef {Object} TextLayerRenderParameters\n * @property {ReadableStream | TextContent} textContentSource - Text content to\n *   render, i.e. the value returned by the page's `streamTextContent` or\n *   `getTextContent` method.\n * @property {HTMLElement} container - The DOM node that will contain the text\n *   runs.\n * @property {PageViewport} viewport - The target viewport to properly layout\n *   the text runs.\n * @property {Array<HTMLElement>} [textDivs] - HTML elements that correspond to\n *   the text items of the textContent input.\n *   This is output and shall initially be set to an empty array.\n * @property {WeakMap<HTMLElement,Object>} [textDivProperties] - Some properties\n *   weakly mapped to the HTML elements used to render the text.\n * @property {Array<string>} [textContentItemsStr] - Strings that correspond to\n *   the `str` property of the text items of the textContent input.\n *   This is output and shall initially be set to an empty array.\n * @property {boolean} [isOffscreenCanvasSupported] true if we can use\n *   OffscreenCanvas to measure string widths.\n */\n\n/**\n * Text layer update parameters.\n *\n * @typedef {Object} TextLayerUpdateParameters\n * @property {HTMLElement} container - The DOM node that will contain the text\n *   runs.\n * @property {PageViewport} viewport - The target viewport to properly layout\n *   the text runs.\n * @property {Array<HTMLElement>} [textDivs] - HTML elements that correspond to\n *   the text items of the textContent input.\n *   This is output and shall initially be set to an empty array.\n * @property {WeakMap<HTMLElement,Object>} [textDivProperties] - Some properties\n *   weakly mapped to the HTML elements used to render the text.\n * @property {boolean} [isOffscreenCanvasSupported] true if we can use\n *   OffscreenCanvas to measure string widths.\n * @property {boolean} [mustRotate] true if the text layer must be rotated.\n * @property {boolean} [mustRescale] true if the text layer contents must be\n *   rescaled.\n */\n\nconst MAX_TEXT_DIVS_TO_RENDER = 100000;\nconst DEFAULT_FONT_SIZE = 30;\nconst DEFAULT_FONT_ASCENT = 0.8;\nconst ascentCache = new Map();\n\nfunction getCtx(size, isOffscreenCanvasSupported) {\n  let ctx;\n  if (isOffscreenCanvasSupported && FeatureTest.isOffscreenCanvasSupported) {\n    ctx = new OffscreenCanvas(size, size).getContext(\"2d\", { alpha: false });\n  } else {\n    const canvas = document.createElement(\"canvas\");\n    canvas.width = canvas.height = size;\n    ctx = canvas.getContext(\"2d\", { alpha: false });\n  }\n\n  return ctx;\n}\n\nfunction getAscent(fontFamily, isOffscreenCanvasSupported) {\n  const cachedAscent = ascentCache.get(fontFamily);\n  if (cachedAscent) {\n    return cachedAscent;\n  }\n\n  const ctx = getCtx(DEFAULT_FONT_SIZE, isOffscreenCanvasSupported);\n\n  ctx.font = `${DEFAULT_FONT_SIZE}px ${fontFamily}`;\n  const metrics = ctx.measureText(\"\");\n\n  // Both properties aren't available by default in Firefox.\n  let ascent = metrics.fontBoundingBoxAscent;\n  let descent = Math.abs(metrics.fontBoundingBoxDescent);\n  if (ascent) {\n    const ratio = ascent / (ascent + descent);\n    ascentCache.set(fontFamily, ratio);\n\n    ctx.canvas.width = ctx.canvas.height = 0;\n    return ratio;\n  }\n\n  // Try basic heuristic to guess ascent/descent.\n  // Draw a g with baseline at 0,0 and then get the line\n  // number where a pixel has non-null red component (starting\n  // from bottom).\n  ctx.strokeStyle = \"red\";\n  ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);\n  ctx.strokeText(\"g\", 0, 0);\n  let pixels = ctx.getImageData(\n    0,\n    0,\n    DEFAULT_FONT_SIZE,\n    DEFAULT_FONT_SIZE\n  ).data;\n  descent = 0;\n  for (let i = pixels.length - 1 - 3; i >= 0; i -= 4) {\n    if (pixels[i] > 0) {\n      descent = Math.ceil(i / 4 / DEFAULT_FONT_SIZE);\n      break;\n    }\n  }\n\n  // Draw an A with baseline at 0,DEFAULT_FONT_SIZE and then get the line\n  // number where a pixel has non-null red component (starting\n  // from top).\n  ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);\n  ctx.strokeText(\"A\", 0, DEFAULT_FONT_SIZE);\n  pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data;\n  ascent = 0;\n  for (let i = 0, ii = pixels.length; i < ii; i += 4) {\n    if (pixels[i] > 0) {\n      ascent = DEFAULT_FONT_SIZE - Math.floor(i / 4 / DEFAULT_FONT_SIZE);\n      break;\n    }\n  }\n\n  ctx.canvas.width = ctx.canvas.height = 0;\n\n  if (ascent) {\n    const ratio = ascent / (ascent + descent);\n    ascentCache.set(fontFamily, ratio);\n    return ratio;\n  }\n\n  ascentCache.set(fontFamily, DEFAULT_FONT_ASCENT);\n  return DEFAULT_FONT_ASCENT;\n}\n\nfunction appendText(task, geom, styles) {\n  // Initialize all used properties to keep the caches monomorphic.\n  const textDiv = document.createElement(\"span\");\n  const textDivProperties = {\n    angle: 0,\n    canvasWidth: 0,\n    hasText: geom.str !== \"\",\n    hasEOL: geom.hasEOL,\n    fontSize: 0,\n  };\n  task._textDivs.push(textDiv);\n\n  const tx = Util.transform(task._transform, geom.transform);\n  let angle = Math.atan2(tx[1], tx[0]);\n  const style = styles[geom.fontName];\n  if (style.vertical) {\n    angle += Math.PI / 2;\n  }\n\n  const fontFamily =\n    (task._fontInspectorEnabled && style.fontSubstitution) || style.fontFamily;\n  const fontHeight = Math.hypot(tx[2], tx[3]);\n  const fontAscent =\n    fontHeight * getAscent(fontFamily, task._isOffscreenCanvasSupported);\n\n  let left, top;\n  if (angle === 0) {\n    left = tx[4];\n    top = tx[5] - fontAscent;\n  } else {\n    left = tx[4] + fontAscent * Math.sin(angle);\n    top = tx[5] - fontAscent * Math.cos(angle);\n  }\n\n  const scaleFactorStr = \"calc(var(--scale-factor)*\";\n  const divStyle = textDiv.style;\n  // Setting the style properties individually, rather than all at once,\n  // should be OK since the `textDiv` isn't appended to the document yet.\n  if (task._container === task._rootContainer) {\n    divStyle.left = `${((100 * left) / task._pageWidth).toFixed(2)}%`;\n    divStyle.top = `${((100 * top) / task._pageHeight).toFixed(2)}%`;\n  } else {\n    // We're in a marked content span, hence we can't use percents.\n    divStyle.left = `${scaleFactorStr}${left.toFixed(2)}px)`;\n    divStyle.top = `${scaleFactorStr}${top.toFixed(2)}px)`;\n  }\n  divStyle.fontSize = `${scaleFactorStr}${fontHeight.toFixed(2)}px)`;\n  divStyle.fontFamily = fontFamily;\n\n  textDivProperties.fontSize = fontHeight;\n\n  // Keeps screen readers from pausing on every new text span.\n  textDiv.setAttribute(\"role\", \"presentation\");\n\n  textDiv.textContent = geom.str;\n  // geom.dir may be 'ttb' for vertical texts.\n  textDiv.dir = geom.dir;\n\n  // `fontName` is only used by the FontInspector, and we only use `dataset`\n  // here to make the font name available in the debugger.\n  if (task._fontInspectorEnabled) {\n    textDiv.dataset.fontName =\n      style.fontSubstitutionLoadedName || geom.fontName;\n  }\n  if (angle !== 0) {\n    textDivProperties.angle = angle * (180 / Math.PI);\n  }\n  // We don't bother scaling single-char text divs, because it has very\n  // little effect on text highlighting. This makes scrolling on docs with\n  // lots of such divs a lot faster.\n  let shouldScaleText = false;\n  if (geom.str.length > 1) {\n    shouldScaleText = true;\n  } else if (geom.str !== \" \" && geom.transform[0] !== geom.transform[3]) {\n    const absScaleX = Math.abs(geom.transform[0]),\n      absScaleY = Math.abs(geom.transform[3]);\n    // When the horizontal/vertical scaling differs significantly, also scale\n    // even single-char text to improve highlighting (fixes issue11713.pdf).\n    if (\n      absScaleX !== absScaleY &&\n      Math.max(absScaleX, absScaleY) / Math.min(absScaleX, absScaleY) > 1.5\n    ) {\n      shouldScaleText = true;\n    }\n  }\n  if (shouldScaleText) {\n    textDivProperties.canvasWidth = style.vertical ? geom.height : geom.width;\n  }\n  task._textDivProperties.set(textDiv, textDivProperties);\n  if (task._isReadableStream) {\n    task._layoutText(textDiv);\n  }\n}\n\nfunction layout(params) {\n  const { div, scale, properties, ctx, prevFontSize, prevFontFamily } = params;\n  const { style } = div;\n  let transform = \"\";\n  if (properties.canvasWidth !== 0 && properties.hasText) {\n    const { fontFamily } = style;\n    const { canvasWidth, fontSize } = properties;\n\n    if (prevFontSize !== fontSize || prevFontFamily !== fontFamily) {\n      ctx.font = `${fontSize * scale}px ${fontFamily}`;\n      params.prevFontSize = fontSize;\n      params.prevFontFamily = fontFamily;\n    }\n\n    // Only measure the width for multi-char text divs, see `appendText`.\n    const { width } = ctx.measureText(div.textContent);\n\n    if (width > 0) {\n      transform = `scaleX(${(canvasWidth * scale) / width})`;\n    }\n  }\n  if (properties.angle !== 0) {\n    transform = `rotate(${properties.angle}deg) ${transform}`;\n  }\n  if (transform.length > 0) {\n    style.transform = transform;\n  }\n}\n\nfunction render(task) {\n  if (task._canceled) {\n    return;\n  }\n  const textDivs = task._textDivs;\n  const capability = task._capability;\n  const textDivsLength = textDivs.length;\n\n  // No point in rendering many divs as it would make the browser\n  // unusable even after the divs are rendered.\n  if (textDivsLength > MAX_TEXT_DIVS_TO_RENDER) {\n    capability.resolve();\n    return;\n  }\n\n  if (!task._isReadableStream) {\n    for (const textDiv of textDivs) {\n      task._layoutText(textDiv);\n    }\n  }\n  capability.resolve();\n}\n\nclass TextLayerRenderTask {\n  constructor({\n    textContentSource,\n    container,\n    viewport,\n    textDivs,\n    textDivProperties,\n    textContentItemsStr,\n    isOffscreenCanvasSupported,\n  }) {\n    this._textContentSource = textContentSource;\n    this._isReadableStream = textContentSource instanceof ReadableStream;\n    this._container = this._rootContainer = container;\n    this._textDivs = textDivs || [];\n    this._textContentItemsStr = textContentItemsStr || [];\n    this._isOffscreenCanvasSupported = isOffscreenCanvasSupported;\n    this._fontInspectorEnabled = !!globalThis.FontInspector?.enabled;\n\n    this._reader = null;\n    this._textDivProperties = textDivProperties || new WeakMap();\n    this._canceled = false;\n    this._capability = new PromiseCapability();\n    this._layoutTextParams = {\n      prevFontSize: null,\n      prevFontFamily: null,\n      div: null,\n      scale: viewport.scale * (globalThis.devicePixelRatio || 1),\n      properties: null,\n      ctx: getCtx(0, isOffscreenCanvasSupported),\n    };\n    const { pageWidth, pageHeight, pageX, pageY } = viewport.rawDims;\n    this._transform = [1, 0, 0, -1, -pageX, pageY + pageHeight];\n    this._pageWidth = pageWidth;\n    this._pageHeight = pageHeight;\n\n    setLayerDimensions(container, viewport);\n\n    // Always clean-up the temporary canvas once rendering is no longer pending.\n    this._capability.promise\n      .finally(() => {\n        this._layoutTextParams = null;\n      })\n      .catch(() => {\n        // Avoid \"Uncaught promise\" messages in the console.\n      });\n  }\n\n  /**\n   * Promise for textLayer rendering task completion.\n   * @type {Promise<void>}\n   */\n  get promise() {\n    return this._capability.promise;\n  }\n\n  /**\n   * Cancel rendering of the textLayer.\n   */\n  cancel() {\n    this._canceled = true;\n    if (this._reader) {\n      this._reader\n        .cancel(new AbortException(\"TextLayer task cancelled.\"))\n        .catch(() => {\n          // Avoid \"Uncaught promise\" messages in the console.\n        });\n      this._reader = null;\n    }\n    this._capability.reject(new AbortException(\"TextLayer task cancelled.\"));\n  }\n\n  /**\n   * @private\n   */\n  _processItems(items, styleCache) {\n    for (const item of items) {\n      if (item.str === undefined) {\n        if (\n          item.type === \"beginMarkedContentProps\" ||\n          item.type === \"beginMarkedContent\"\n        ) {\n          const parent = this._container;\n          this._container = document.createElement(\"span\");\n          this._container.classList.add(\"markedContent\");\n          if (item.id !== null) {\n            this._container.setAttribute(\"id\", `${item.id}`);\n          }\n          parent.append(this._container);\n        } else if (item.type === \"endMarkedContent\") {\n          this._container = this._container.parentNode;\n        }\n        continue;\n      }\n      this._textContentItemsStr.push(item.str);\n      appendText(this, item, styleCache);\n    }\n  }\n\n  /**\n   * @private\n   */\n  _layoutText(textDiv) {\n    const textDivProperties = (this._layoutTextParams.properties =\n      this._textDivProperties.get(textDiv));\n    this._layoutTextParams.div = textDiv;\n    layout(this._layoutTextParams);\n\n    if (textDivProperties.hasText) {\n      this._container.append(textDiv);\n    }\n    if (textDivProperties.hasEOL) {\n      const br = document.createElement(\"br\");\n      br.setAttribute(\"role\", \"presentation\");\n      this._container.append(br);\n    }\n  }\n\n  /**\n   * @private\n   */\n  _render() {\n    const capability = new PromiseCapability();\n    let styleCache = Object.create(null);\n\n    if (this._isReadableStream) {\n      const pump = () => {\n        this._reader.read().then(({ value, done }) => {\n          if (done) {\n            capability.resolve();\n            return;\n          }\n\n          Object.assign(styleCache, value.styles);\n          this._processItems(value.items, styleCache);\n          pump();\n        }, capability.reject);\n      };\n\n      this._reader = this._textContentSource.getReader();\n      pump();\n    } else if (this._textContentSource) {\n      const { items, styles } = this._textContentSource;\n      this._processItems(items, styles);\n      capability.resolve();\n    } else {\n      throw new Error('No \"textContentSource\" parameter specified.');\n    }\n\n    capability.promise.then(() => {\n      styleCache = null;\n      render(this);\n    }, this._capability.reject);\n  }\n}\n\n/**\n * @param {TextLayerRenderParameters} params\n * @returns {TextLayerRenderTask}\n */\nfunction renderTextLayer(params) {\n  const task = new TextLayerRenderTask(params);\n  task._render();\n  return task;\n}\n\n/**\n * @param {TextLayerUpdateParameters} params\n * @returns {undefined}\n */\nfunction updateTextLayer({\n  container,\n  viewport,\n  textDivs,\n  textDivProperties,\n  isOffscreenCanvasSupported,\n  mustRotate = true,\n  mustRescale = true,\n}) {\n  if (mustRotate) {\n    setLayerDimensions(container, { rotation: viewport.rotation });\n  }\n\n  if (mustRescale) {\n    const ctx = getCtx(0, isOffscreenCanvasSupported);\n    const scale = viewport.scale * (globalThis.devicePixelRatio || 1);\n    const params = {\n      prevFontSize: null,\n      prevFontFamily: null,\n      div: null,\n      scale,\n      properties: null,\n      ctx,\n    };\n    for (const div of textDivs) {\n      params.properties = textDivProperties.get(div);\n      params.div = div;\n      layout(params);\n    }\n  }\n}\n\nexport { renderTextLayer, TextLayerRenderTask, updateTextLayer };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../interfaces\").IPDFStream} IPDFStream */\n/** @typedef {import(\"../interfaces\").IPDFStreamReader} IPDFStreamReader */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../interfaces\").IPDFStreamRangeReader} IPDFStreamRangeReader */\n\nimport { assert, PromiseCapability } from \"../shared/util.js\";\nimport { isPdfFile } from \"./display_utils.js\";\n\n/** @implements {IPDFStream} */\nclass PDFDataTransportStream {\n  constructor(\n    {\n      length,\n      initialData,\n      progressiveDone = false,\n      contentDispositionFilename = null,\n      disableRange = false,\n      disableStream = false,\n    },\n    pdfDataRangeTransport\n  ) {\n    assert(\n      pdfDataRangeTransport,\n      'PDFDataTransportStream - missing required \"pdfDataRangeTransport\" argument.'\n    );\n\n    this._queuedChunks = [];\n    this._progressiveDone = progressiveDone;\n    this._contentDispositionFilename = contentDispositionFilename;\n\n    if (initialData?.length > 0) {\n      // Prevent any possible issues by only transferring a Uint8Array that\n      // completely \"utilizes\" its underlying ArrayBuffer.\n      const buffer =\n        initialData instanceof Uint8Array &&\n        initialData.byteLength === initialData.buffer.byteLength\n          ? initialData.buffer\n          : new Uint8Array(initialData).buffer;\n      this._queuedChunks.push(buffer);\n    }\n\n    this._pdfDataRangeTransport = pdfDataRangeTransport;\n    this._isStreamingSupported = !disableStream;\n    this._isRangeSupported = !disableRange;\n    this._contentLength = length;\n\n    this._fullRequestReader = null;\n    this._rangeReaders = [];\n\n    this._pdfDataRangeTransport.addRangeListener((begin, chunk) => {\n      this._onReceiveData({ begin, chunk });\n    });\n\n    this._pdfDataRangeTransport.addProgressListener((loaded, total) => {\n      this._onProgress({ loaded, total });\n    });\n\n    this._pdfDataRangeTransport.addProgressiveReadListener(chunk => {\n      this._onReceiveData({ chunk });\n    });\n\n    this._pdfDataRangeTransport.addProgressiveDoneListener(() => {\n      this._onProgressiveDone();\n    });\n\n    this._pdfDataRangeTransport.transportReady();\n  }\n\n  _onReceiveData({ begin, chunk }) {\n    // Prevent any possible issues by only transferring a Uint8Array that\n    // completely \"utilizes\" its underlying ArrayBuffer.\n    const buffer =\n      chunk instanceof Uint8Array &&\n      chunk.byteLength === chunk.buffer.byteLength\n        ? chunk.buffer\n        : new Uint8Array(chunk).buffer;\n\n    if (begin === undefined) {\n      if (this._fullRequestReader) {\n        this._fullRequestReader._enqueue(buffer);\n      } else {\n        this._queuedChunks.push(buffer);\n      }\n    } else {\n      const found = this._rangeReaders.some(function (rangeReader) {\n        if (rangeReader._begin !== begin) {\n          return false;\n        }\n        rangeReader._enqueue(buffer);\n        return true;\n      });\n      assert(\n        found,\n        \"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.\"\n      );\n    }\n  }\n\n  get _progressiveDataLength() {\n    return this._fullRequestReader?._loaded ?? 0;\n  }\n\n  _onProgress(evt) {\n    if (evt.total === undefined) {\n      // Reporting to first range reader, if it exists.\n      this._rangeReaders[0]?.onProgress?.({ loaded: evt.loaded });\n    } else {\n      this._fullRequestReader?.onProgress?.({\n        loaded: evt.loaded,\n        total: evt.total,\n      });\n    }\n  }\n\n  _onProgressiveDone() {\n    this._fullRequestReader?.progressiveDone();\n    this._progressiveDone = true;\n  }\n\n  _removeRangeReader(reader) {\n    const i = this._rangeReaders.indexOf(reader);\n    if (i >= 0) {\n      this._rangeReaders.splice(i, 1);\n    }\n  }\n\n  getFullReader() {\n    assert(\n      !this._fullRequestReader,\n      \"PDFDataTransportStream.getFullReader can only be called once.\"\n    );\n    const queuedChunks = this._queuedChunks;\n    this._queuedChunks = null;\n    return new PDFDataTransportStreamReader(\n      this,\n      queuedChunks,\n      this._progressiveDone,\n      this._contentDispositionFilename\n    );\n  }\n\n  getRangeReader(begin, end) {\n    if (end <= this._progressiveDataLength) {\n      return null;\n    }\n    const reader = new PDFDataTransportStreamRangeReader(this, begin, end);\n    this._pdfDataRangeTransport.requestDataRange(begin, end);\n    this._rangeReaders.push(reader);\n    return reader;\n  }\n\n  cancelAllRequests(reason) {\n    this._fullRequestReader?.cancel(reason);\n\n    for (const reader of this._rangeReaders.slice(0)) {\n      reader.cancel(reason);\n    }\n    this._pdfDataRangeTransport.abort();\n  }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFDataTransportStreamReader {\n  constructor(\n    stream,\n    queuedChunks,\n    progressiveDone = false,\n    contentDispositionFilename = null\n  ) {\n    this._stream = stream;\n    this._done = progressiveDone || false;\n    this._filename = isPdfFile(contentDispositionFilename)\n      ? contentDispositionFilename\n      : null;\n    this._queuedChunks = queuedChunks || [];\n    this._loaded = 0;\n    for (const chunk of this._queuedChunks) {\n      this._loaded += chunk.byteLength;\n    }\n    this._requests = [];\n    this._headersReady = Promise.resolve();\n    stream._fullRequestReader = this;\n\n    this.onProgress = null;\n  }\n\n  _enqueue(chunk) {\n    if (this._done) {\n      return; // Ignore new data.\n    }\n    if (this._requests.length > 0) {\n      const requestCapability = this._requests.shift();\n      requestCapability.resolve({ value: chunk, done: false });\n    } else {\n      this._queuedChunks.push(chunk);\n    }\n    this._loaded += chunk.byteLength;\n  }\n\n  get headersReady() {\n    return this._headersReady;\n  }\n\n  get filename() {\n    return this._filename;\n  }\n\n  get isRangeSupported() {\n    return this._stream._isRangeSupported;\n  }\n\n  get isStreamingSupported() {\n    return this._stream._isStreamingSupported;\n  }\n\n  get contentLength() {\n    return this._stream._contentLength;\n  }\n\n  async read() {\n    if (this._queuedChunks.length > 0) {\n      const chunk = this._queuedChunks.shift();\n      return { value: chunk, done: false };\n    }\n    if (this._done) {\n      return { value: undefined, done: true };\n    }\n    const requestCapability = new PromiseCapability();\n    this._requests.push(requestCapability);\n    return requestCapability.promise;\n  }\n\n  cancel(reason) {\n    this._done = true;\n    for (const requestCapability of this._requests) {\n      requestCapability.resolve({ value: undefined, done: true });\n    }\n    this._requests.length = 0;\n  }\n\n  progressiveDone() {\n    if (this._done) {\n      return;\n    }\n    this._done = true;\n  }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFDataTransportStreamRangeReader {\n  constructor(stream, begin, end) {\n    this._stream = stream;\n    this._begin = begin;\n    this._end = end;\n    this._queuedChunk = null;\n    this._requests = [];\n    this._done = false;\n\n    this.onProgress = null;\n  }\n\n  _enqueue(chunk) {\n    if (this._done) {\n      return; // ignore new data\n    }\n    if (this._requests.length === 0) {\n      this._queuedChunk = chunk;\n    } else {\n      const requestsCapability = this._requests.shift();\n      requestsCapability.resolve({ value: chunk, done: false });\n      for (const requestCapability of this._requests) {\n        requestCapability.resolve({ value: undefined, done: true });\n      }\n      this._requests.length = 0;\n    }\n    this._done = true;\n    this._stream._removeRangeReader(this);\n  }\n\n  get isStreamingSupported() {\n    return false;\n  }\n\n  async read() {\n    if (this._queuedChunk) {\n      const chunk = this._queuedChunk;\n      this._queuedChunk = null;\n      return { value: chunk, done: false };\n    }\n    if (this._done) {\n      return { value: undefined, done: true };\n    }\n    const requestCapability = new PromiseCapability();\n    this._requests.push(requestCapability);\n    return requestCapability.promise;\n  }\n\n  cancel(reason) {\n    this._done = true;\n    for (const requestCapability of this._requests) {\n      requestCapability.resolve({ value: undefined, done: true });\n    }\n    this._requests.length = 0;\n    this._stream._removeRangeReader(this);\n  }\n}\n\nexport { PDFDataTransportStream };\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @typedef {Object} GlobalWorkerOptionsType\n * @property {Worker | null} workerPort - Defines global port for worker\n *   process. Overrides the `workerSrc` option.\n * @property {string} workerSrc - A string containing the path and filename\n *   of the worker file.\n *\n *   NOTE: The `workerSrc` option should always be set, in order to prevent any\n *         issues when using the PDF.js library.\n */\n\n/** @type {GlobalWorkerOptionsType} */\nconst GlobalWorkerOptions = Object.create(null);\n\nGlobalWorkerOptions.workerPort = null;\nGlobalWorkerOptions.workerSrc = \"\";\n\nexport { GlobalWorkerOptions };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_storage\").AnnotationStorage} AnnotationStorage */\n/** @typedef {import(\"./display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"../../web/interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { XfaText } from \"./xfa_text.js\";\n\n/**\n * @typedef {Object} XfaLayerParameters\n * @property {PageViewport} viewport\n * @property {HTMLDivElement} div\n * @property {Object} xfaHtml\n * @property {AnnotationStorage} [annotationStorage]\n * @property {IPDFLinkService} linkService\n * @property {string} [intent] - (default value is 'display').\n */\n\nclass XfaLayer {\n  static setupStorage(html, id, element, storage, intent) {\n    const storedData = storage.getValue(id, { value: null });\n    switch (element.name) {\n      case \"textarea\":\n        if (storedData.value !== null) {\n          html.textContent = storedData.value;\n        }\n        if (intent === \"print\") {\n          break;\n        }\n        html.addEventListener(\"input\", event => {\n          storage.setValue(id, { value: event.target.value });\n        });\n        break;\n      case \"input\":\n        if (\n          element.attributes.type === \"radio\" ||\n          element.attributes.type === \"checkbox\"\n        ) {\n          if (storedData.value === element.attributes.xfaOn) {\n            html.setAttribute(\"checked\", true);\n          } else if (storedData.value === element.attributes.xfaOff) {\n            // The checked attribute may have been set when opening the file,\n            // unset through the UI and we're here because of printing.\n            html.removeAttribute(\"checked\");\n          }\n          if (intent === \"print\") {\n            break;\n          }\n          html.addEventListener(\"change\", event => {\n            storage.setValue(id, {\n              value: event.target.checked\n                ? event.target.getAttribute(\"xfaOn\")\n                : event.target.getAttribute(\"xfaOff\"),\n            });\n          });\n        } else {\n          if (storedData.value !== null) {\n            html.setAttribute(\"value\", storedData.value);\n          }\n          if (intent === \"print\") {\n            break;\n          }\n          html.addEventListener(\"input\", event => {\n            storage.setValue(id, { value: event.target.value });\n          });\n        }\n        break;\n      case \"select\":\n        if (storedData.value !== null) {\n          html.setAttribute(\"value\", storedData.value);\n          for (const option of element.children) {\n            if (option.attributes.value === storedData.value) {\n              option.attributes.selected = true;\n            } else if (option.attributes.hasOwnProperty(\"selected\")) {\n              delete option.attributes.selected;\n            }\n          }\n        }\n        html.addEventListener(\"input\", event => {\n          const options = event.target.options;\n          const value =\n            options.selectedIndex === -1\n              ? \"\"\n              : options[options.selectedIndex].value;\n          storage.setValue(id, { value });\n        });\n        break;\n    }\n  }\n\n  static setAttributes({ html, element, storage = null, intent, linkService }) {\n    const { attributes } = element;\n    const isHTMLAnchorElement = html instanceof HTMLAnchorElement;\n\n    if (attributes.type === \"radio\") {\n      // Avoid to have a radio group when printing with the same as one\n      // already displayed.\n      attributes.name = `${attributes.name}-${intent}`;\n    }\n    for (const [key, value] of Object.entries(attributes)) {\n      if (value === null || value === undefined) {\n        continue;\n      }\n\n      switch (key) {\n        case \"class\":\n          if (value.length) {\n            html.setAttribute(key, value.join(\" \"));\n          }\n          break;\n        case \"dataId\":\n          // We don't need to add dataId in the html object but it can\n          // be useful to know its value when writing printing tests:\n          // in this case, don't skip dataId to have its value.\n          break;\n        case \"id\":\n          html.setAttribute(\"data-element-id\", value);\n          break;\n        case \"style\":\n          Object.assign(html.style, value);\n          break;\n        case \"textContent\":\n          html.textContent = value;\n          break;\n        default:\n          if (!isHTMLAnchorElement || (key !== \"href\" && key !== \"newWindow\")) {\n            html.setAttribute(key, value);\n          }\n      }\n    }\n\n    if (isHTMLAnchorElement) {\n      linkService.addLinkAttributes(\n        html,\n        attributes.href,\n        attributes.newWindow\n      );\n    }\n\n    // Set the value after the others to be sure to overwrite any other values.\n    if (storage && attributes.dataId) {\n      this.setupStorage(html, attributes.dataId, element, storage);\n    }\n  }\n\n  /**\n   * Render the XFA layer.\n   *\n   * @param {XfaLayerParameters} parameters\n   */\n  static render(parameters) {\n    const storage = parameters.annotationStorage;\n    const linkService = parameters.linkService;\n    const root = parameters.xfaHtml;\n    const intent = parameters.intent || \"display\";\n    const rootHtml = document.createElement(root.name);\n    if (root.attributes) {\n      this.setAttributes({\n        html: rootHtml,\n        element: root,\n        intent,\n        linkService,\n      });\n    }\n\n    const isNotForRichText = intent !== \"richText\";\n    const rootDiv = parameters.div;\n    rootDiv.append(rootHtml);\n\n    if (parameters.viewport) {\n      const transform = `matrix(${parameters.viewport.transform.join(\",\")})`;\n      rootDiv.style.transform = transform;\n    }\n\n    // Set defaults.\n    if (isNotForRichText) {\n      rootDiv.setAttribute(\"class\", \"xfaLayer xfaFont\");\n    }\n\n    // Text nodes used for the text highlighter.\n    const textDivs = [];\n\n    // In the rich text context, it's possible to just have a text node without\n    // a root element, so we handle this case here (see issue 17215).\n    if (root.children.length === 0) {\n      if (root.value) {\n        const node = document.createTextNode(root.value);\n        rootHtml.append(node);\n        if (isNotForRichText && XfaText.shouldBuildText(root.name)) {\n          textDivs.push(node);\n        }\n      }\n      return { textDivs };\n    }\n\n    const stack = [[root, -1, rootHtml]];\n\n    while (stack.length > 0) {\n      const [parent, i, html] = stack.at(-1);\n      if (i + 1 === parent.children.length) {\n        stack.pop();\n        continue;\n      }\n\n      const child = parent.children[++stack.at(-1)[1]];\n      if (child === null) {\n        continue;\n      }\n\n      const { name } = child;\n      if (name === \"#text\") {\n        const node = document.createTextNode(child.value);\n        textDivs.push(node);\n        html.append(node);\n        continue;\n      }\n\n      const childHtml = child?.attributes?.xmlns\n        ? document.createElementNS(child.attributes.xmlns, name)\n        : document.createElement(name);\n\n      html.append(childHtml);\n      if (child.attributes) {\n        this.setAttributes({\n          html: childHtml,\n          element: child,\n          storage,\n          intent,\n          linkService,\n        });\n      }\n\n      if (child.children?.length > 0) {\n        stack.push([child, -1, childHtml]);\n      } else if (child.value) {\n        const node = document.createTextNode(child.value);\n        if (isNotForRichText && XfaText.shouldBuildText(name)) {\n          textDivs.push(node);\n        }\n        childHtml.append(node);\n      }\n    }\n\n    /**\n     * TODO: re-enable that stuff once we've JS implementation.\n     * See https://bugzilla.mozilla.org/show_bug.cgi?id=1719465.\n     *\n     * for (const el of rootDiv.querySelectorAll(\n     * \".xfaDisabled input, .xfaDisabled textarea\"\n     * )) {\n     * el.setAttribute(\"disabled\", true);\n     * }\n     * for (const el of rootDiv.querySelectorAll(\n     * \".xfaReadOnly input, .xfaReadOnly textarea\"\n     * )) {\n     * el.setAttribute(\"readOnly\", true);\n     * }\n     */\n\n    for (const el of rootDiv.querySelectorAll(\n      \".xfaNonInteractive input, .xfaNonInteractive textarea\"\n    )) {\n      el.setAttribute(\"readOnly\", true);\n    }\n\n    return {\n      textDivs,\n    };\n  }\n\n  /**\n   * Update the XFA layer.\n   *\n   * @param {XfaLayerParameters} parameters\n   */\n  static update(parameters) {\n    const transform = `matrix(${parameters.viewport.transform.join(\",\")})`;\n    parameters.div.style.transform = transform;\n    parameters.div.hidden = false;\n  }\n}\n\nexport { XfaLayer };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./api\").TextContent} TextContent */\n\nclass XfaText {\n  /**\n   * Walk an XFA tree and create an array of text nodes that is compatible\n   * with a regular PDFs TextContent. Currently, only TextItem.str is supported,\n   * all other fields and styles haven't been implemented.\n   *\n   * @param {Object} xfa - An XFA fake DOM object.\n   *\n   * @returns {TextContent}\n   */\n  static textContent(xfa) {\n    const items = [];\n    const output = {\n      items,\n      styles: Object.create(null),\n    };\n    function walk(node) {\n      if (!node) {\n        return;\n      }\n      let str = null;\n      const name = node.name;\n      if (name === \"#text\") {\n        str = node.value;\n      } else if (!XfaText.shouldBuildText(name)) {\n        return;\n      } else if (node?.attributes?.textContent) {\n        str = node.attributes.textContent;\n      } else if (node.value) {\n        str = node.value;\n      }\n      if (str !== null) {\n        items.push({\n          str,\n        });\n      }\n      if (!node.children) {\n        return;\n      }\n      for (const child of node.children) {\n        walk(child);\n      }\n    }\n    walk(xfa);\n    return output;\n  }\n\n  /**\n   * @param {string} name - DOM node name. (lower case)\n   *\n   * @returns {boolean} true if the DOM node should have a corresponding text\n   * node.\n   */\n  static shouldBuildText(name) {\n    return !(\n      name === \"textarea\" ||\n      name === \"input\" ||\n      name === \"option\" ||\n      name === \"select\"\n    );\n  }\n}\n\nexport { XfaText };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./display/api\").OnProgressParameters} OnProgressParameters */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./display/api\").PDFDocumentLoadingTask} PDFDocumentLoadingTask */\n/** @typedef {import(\"./display/api\").PDFDocumentProxy} PDFDocumentProxy */\n/** @typedef {import(\"./display/api\").PDFPageProxy} PDFPageProxy */\n/** @typedef {import(\"./display/api\").RenderTask} RenderTask */\n/** @typedef {import(\"./display/display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./display/text_layer\").TextLayerRenderTask} TextLayerRenderTask */\n\nimport {\n  AbortException,\n  AnnotationEditorParamsType,\n  AnnotationEditorType,\n  AnnotationMode,\n  CMapCompressionType,\n  createValidAbsoluteUrl,\n  FeatureTest,\n  ImageKind,\n  InvalidPDFException,\n  MissingPDFException,\n  normalizeUnicode,\n  OPS,\n  PasswordResponses,\n  PermissionFlag,\n  PromiseCapability,\n  shadow,\n  UnexpectedResponseException,\n  Util,\n  VerbosityLevel,\n} from \"./shared/util.js\";\nimport {\n  build,\n  getDocument,\n  PDFDataRangeTransport,\n  PDFWorker,\n  version,\n} from \"./display/api.js\";\nimport {\n  DOMSVGFactory,\n  fetchData,\n  getFilenameFromUrl,\n  getPdfFilenameFromUrl,\n  getXfaPageViewport,\n  isDataScheme,\n  isPdfFile,\n  noContextMenu,\n  PDFDateString,\n  PixelsPerInch,\n  RenderingCancelledException,\n  setLayerDimensions,\n} from \"./display/display_utils.js\";\nimport { renderTextLayer, updateTextLayer } from \"./display/text_layer.js\";\nimport { AnnotationEditorLayer } from \"./display/editor/annotation_editor_layer.js\";\nimport { AnnotationEditorUIManager } from \"./display/editor/tools.js\";\nimport { AnnotationLayer } from \"./display/annotation_layer.js\";\nimport { DrawLayer } from \"./display/draw_layer.js\";\nimport { GlobalWorkerOptions } from \"./display/worker_options.js\";\nimport { Outliner } from \"./display/editor/outliner.js\";\nimport { XfaLayer } from \"./display/xfa_layer.js\";\n\n/* eslint-disable-next-line no-unused-vars */\nconst pdfjsVersion =\n  typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_VERSION\") : void 0;\n/* eslint-disable-next-line no-unused-vars */\nconst pdfjsBuild =\n  typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_BUILD\") : void 0;\n\nexport {\n  AbortException,\n  AnnotationEditorLayer,\n  AnnotationEditorParamsType,\n  AnnotationEditorType,\n  AnnotationEditorUIManager,\n  AnnotationLayer,\n  AnnotationMode,\n  build,\n  CMapCompressionType,\n  createValidAbsoluteUrl,\n  DOMSVGFactory,\n  DrawLayer,\n  FeatureTest,\n  fetchData,\n  getDocument,\n  getFilenameFromUrl,\n  getPdfFilenameFromUrl,\n  getXfaPageViewport,\n  GlobalWorkerOptions,\n  ImageKind,\n  InvalidPDFException,\n  isDataScheme,\n  isPdfFile,\n  MissingPDFException,\n  noContextMenu,\n  normalizeUnicode,\n  OPS,\n  Outliner,\n  PasswordResponses,\n  PDFDataRangeTransport,\n  PDFDateString,\n  PDFWorker,\n  PermissionFlag,\n  PixelsPerInch,\n  PromiseCapability,\n  RenderingCancelledException,\n  renderTextLayer,\n  setLayerDimensions,\n  shadow,\n  UnexpectedResponseException,\n  updateTextLayer,\n  Util,\n  VerbosityLevel,\n  version,\n  XfaLayer,\n};\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n  AbortException,\n  assert,\n  MissingPDFException,\n  PasswordException,\n  PromiseCapability,\n  UnexpectedResponseException,\n  UnknownErrorException,\n  unreachable,\n} from \"./util.js\";\n\nconst CallbackKind = {\n  UNKNOWN: 0,\n  DATA: 1,\n  ERROR: 2,\n};\n\nconst StreamKind = {\n  UNKNOWN: 0,\n  CANCEL: 1,\n  CANCEL_COMPLETE: 2,\n  CLOSE: 3,\n  ENQUEUE: 4,\n  ERROR: 5,\n  PULL: 6,\n  PULL_COMPLETE: 7,\n  START_COMPLETE: 8,\n};\n\nfunction wrapReason(reason) {\n  if (\n    !(\n      reason instanceof Error ||\n      (typeof reason === \"object\" && reason !== null)\n    )\n  ) {\n    unreachable(\n      'wrapReason: Expected \"reason\" to be a (possibly cloned) Error.'\n    );\n  }\n  switch (reason.name) {\n    case \"AbortException\":\n      return new AbortException(reason.message);\n    case \"MissingPDFException\":\n      return new MissingPDFException(reason.message);\n    case \"PasswordException\":\n      return new PasswordException(reason.message, reason.code);\n    case \"UnexpectedResponseException\":\n      return new UnexpectedResponseException(reason.message, reason.status);\n    case \"UnknownErrorException\":\n      return new UnknownErrorException(reason.message, reason.details);\n    default:\n      return new UnknownErrorException(reason.message, reason.toString());\n  }\n}\n\nclass MessageHandler {\n  constructor(sourceName, targetName, comObj) {\n    this.sourceName = sourceName;\n    this.targetName = targetName;\n    this.comObj = comObj;\n    this.callbackId = 1;\n    this.streamId = 1;\n    this.streamSinks = Object.create(null);\n    this.streamControllers = Object.create(null);\n    this.callbackCapabilities = Object.create(null);\n    this.actionHandler = Object.create(null);\n\n    this._onComObjOnMessage = event => {\n      const data = event.data;\n      if (data.targetName !== this.sourceName) {\n        return;\n      }\n      if (data.stream) {\n        this.#processStreamMessage(data);\n        return;\n      }\n      if (data.callback) {\n        const callbackId = data.callbackId;\n        const capability = this.callbackCapabilities[callbackId];\n        if (!capability) {\n          throw new Error(`Cannot resolve callback ${callbackId}`);\n        }\n        delete this.callbackCapabilities[callbackId];\n\n        if (data.callback === CallbackKind.DATA) {\n          capability.resolve(data.data);\n        } else if (data.callback === CallbackKind.ERROR) {\n          capability.reject(wrapReason(data.reason));\n        } else {\n          throw new Error(\"Unexpected callback case\");\n        }\n        return;\n      }\n      const action = this.actionHandler[data.action];\n      if (!action) {\n        throw new Error(`Unknown action from worker: ${data.action}`);\n      }\n      if (data.callbackId) {\n        const cbSourceName = this.sourceName;\n        const cbTargetName = data.sourceName;\n\n        new Promise(function (resolve) {\n          resolve(action(data.data));\n        }).then(\n          function (result) {\n            comObj.postMessage({\n              sourceName: cbSourceName,\n              targetName: cbTargetName,\n              callback: CallbackKind.DATA,\n              callbackId: data.callbackId,\n              data: result,\n            });\n          },\n          function (reason) {\n            comObj.postMessage({\n              sourceName: cbSourceName,\n              targetName: cbTargetName,\n              callback: CallbackKind.ERROR,\n              callbackId: data.callbackId,\n              reason: wrapReason(reason),\n            });\n          }\n        );\n        return;\n      }\n      if (data.streamId) {\n        this.#createStreamSink(data);\n        return;\n      }\n      action(data.data);\n    };\n    comObj.addEventListener(\"message\", this._onComObjOnMessage);\n  }\n\n  on(actionName, handler) {\n    if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n      assert(\n        typeof handler === \"function\",\n        'MessageHandler.on: Expected \"handler\" to be a function.'\n      );\n    }\n    const ah = this.actionHandler;\n    if (ah[actionName]) {\n      throw new Error(`There is already an actionName called \"${actionName}\"`);\n    }\n    ah[actionName] = handler;\n  }\n\n  /**\n   * Sends a message to the comObj to invoke the action with the supplied data.\n   * @param {string} actionName - Action to call.\n   * @param {JSON} data - JSON data to send.\n   * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n   */\n  send(actionName, data, transfers) {\n    this.comObj.postMessage(\n      {\n        sourceName: this.sourceName,\n        targetName: this.targetName,\n        action: actionName,\n        data,\n      },\n      transfers\n    );\n  }\n\n  /**\n   * Sends a message to the comObj to invoke the action with the supplied data.\n   * Expects that the other side will callback with the response.\n   * @param {string} actionName - Action to call.\n   * @param {JSON} data - JSON data to send.\n   * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n   * @returns {Promise} Promise to be resolved with response data.\n   */\n  sendWithPromise(actionName, data, transfers) {\n    const callbackId = this.callbackId++;\n    const capability = new PromiseCapability();\n    this.callbackCapabilities[callbackId] = capability;\n    try {\n      this.comObj.postMessage(\n        {\n          sourceName: this.sourceName,\n          targetName: this.targetName,\n          action: actionName,\n          callbackId,\n          data,\n        },\n        transfers\n      );\n    } catch (ex) {\n      capability.reject(ex);\n    }\n    return capability.promise;\n  }\n\n  /**\n   * Sends a message to the comObj to invoke the action with the supplied data.\n   * Expect that the other side will callback to signal 'start_complete'.\n   * @param {string} actionName - Action to call.\n   * @param {JSON} data - JSON data to send.\n   * @param {Object} queueingStrategy - Strategy to signal backpressure based on\n   *                 internal queue.\n   * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n   * @returns {ReadableStream} ReadableStream to read data in chunks.\n   */\n  sendWithStream(actionName, data, queueingStrategy, transfers) {\n    const streamId = this.streamId++,\n      sourceName = this.sourceName,\n      targetName = this.targetName,\n      comObj = this.comObj;\n\n    return new ReadableStream(\n      {\n        start: controller => {\n          const startCapability = new PromiseCapability();\n          this.streamControllers[streamId] = {\n            controller,\n            startCall: startCapability,\n            pullCall: null,\n            cancelCall: null,\n            isClosed: false,\n          };\n          comObj.postMessage(\n            {\n              sourceName,\n              targetName,\n              action: actionName,\n              streamId,\n              data,\n              desiredSize: controller.desiredSize,\n            },\n            transfers\n          );\n          // Return Promise for Async process, to signal success/failure.\n          return startCapability.promise;\n        },\n\n        pull: controller => {\n          const pullCapability = new PromiseCapability();\n          this.streamControllers[streamId].pullCall = pullCapability;\n          comObj.postMessage({\n            sourceName,\n            targetName,\n            stream: StreamKind.PULL,\n            streamId,\n            desiredSize: controller.desiredSize,\n          });\n          // Returning Promise will not call \"pull\"\n          // again until current pull is resolved.\n          return pullCapability.promise;\n        },\n\n        cancel: reason => {\n          assert(reason instanceof Error, \"cancel must have a valid reason\");\n          const cancelCapability = new PromiseCapability();\n          this.streamControllers[streamId].cancelCall = cancelCapability;\n          this.streamControllers[streamId].isClosed = true;\n          comObj.postMessage({\n            sourceName,\n            targetName,\n            stream: StreamKind.CANCEL,\n            streamId,\n            reason: wrapReason(reason),\n          });\n          // Return Promise to signal success or failure.\n          return cancelCapability.promise;\n        },\n      },\n      queueingStrategy\n    );\n  }\n\n  #createStreamSink(data) {\n    const streamId = data.streamId,\n      sourceName = this.sourceName,\n      targetName = data.sourceName,\n      comObj = this.comObj;\n    const self = this,\n      action = this.actionHandler[data.action];\n\n    const streamSink = {\n      enqueue(chunk, size = 1, transfers) {\n        if (this.isCancelled) {\n          return;\n        }\n        const lastDesiredSize = this.desiredSize;\n        this.desiredSize -= size;\n        // Enqueue decreases the desiredSize property of sink,\n        // so when it changes from positive to negative,\n        // set ready as unresolved promise.\n        if (lastDesiredSize > 0 && this.desiredSize <= 0) {\n          this.sinkCapability = new PromiseCapability();\n          this.ready = this.sinkCapability.promise;\n        }\n        comObj.postMessage(\n          {\n            sourceName,\n            targetName,\n            stream: StreamKind.ENQUEUE,\n            streamId,\n            chunk,\n          },\n          transfers\n        );\n      },\n\n      close() {\n        if (this.isCancelled) {\n          return;\n        }\n        this.isCancelled = true;\n        comObj.postMessage({\n          sourceName,\n          targetName,\n          stream: StreamKind.CLOSE,\n          streamId,\n        });\n        delete self.streamSinks[streamId];\n      },\n\n      error(reason) {\n        assert(reason instanceof Error, \"error must have a valid reason\");\n        if (this.isCancelled) {\n          return;\n        }\n        this.isCancelled = true;\n        comObj.postMessage({\n          sourceName,\n          targetName,\n          stream: StreamKind.ERROR,\n          streamId,\n          reason: wrapReason(reason),\n        });\n      },\n\n      sinkCapability: new PromiseCapability(),\n      onPull: null,\n      onCancel: null,\n      isCancelled: false,\n      desiredSize: data.desiredSize,\n      ready: null,\n    };\n\n    streamSink.sinkCapability.resolve();\n    streamSink.ready = streamSink.sinkCapability.promise;\n    this.streamSinks[streamId] = streamSink;\n\n    new Promise(function (resolve) {\n      resolve(action(data.data, streamSink));\n    }).then(\n      function () {\n        comObj.postMessage({\n          sourceName,\n          targetName,\n          stream: StreamKind.START_COMPLETE,\n          streamId,\n          success: true,\n        });\n      },\n      function (reason) {\n        comObj.postMessage({\n          sourceName,\n          targetName,\n          stream: StreamKind.START_COMPLETE,\n          streamId,\n          reason: wrapReason(reason),\n        });\n      }\n    );\n  }\n\n  #processStreamMessage(data) {\n    const streamId = data.streamId,\n      sourceName = this.sourceName,\n      targetName = data.sourceName,\n      comObj = this.comObj;\n    const streamController = this.streamControllers[streamId],\n      streamSink = this.streamSinks[streamId];\n\n    switch (data.stream) {\n      case StreamKind.START_COMPLETE:\n        if (data.success) {\n          streamController.startCall.resolve();\n        } else {\n          streamController.startCall.reject(wrapReason(data.reason));\n        }\n        break;\n      case StreamKind.PULL_COMPLETE:\n        if (data.success) {\n          streamController.pullCall.resolve();\n        } else {\n          streamController.pullCall.reject(wrapReason(data.reason));\n        }\n        break;\n      case StreamKind.PULL:\n        // Ignore any pull after close is called.\n        if (!streamSink) {\n          comObj.postMessage({\n            sourceName,\n            targetName,\n            stream: StreamKind.PULL_COMPLETE,\n            streamId,\n            success: true,\n          });\n          break;\n        }\n        // Pull increases the desiredSize property of sink, so when it changes\n        // from negative to positive, set ready property as resolved promise.\n        if (streamSink.desiredSize <= 0 && data.desiredSize > 0) {\n          streamSink.sinkCapability.resolve();\n        }\n        // Reset desiredSize property of sink on every pull.\n        streamSink.desiredSize = data.desiredSize;\n\n        new Promise(function (resolve) {\n          resolve(streamSink.onPull?.());\n        }).then(\n          function () {\n            comObj.postMessage({\n              sourceName,\n              targetName,\n              stream: StreamKind.PULL_COMPLETE,\n              streamId,\n              success: true,\n            });\n          },\n          function (reason) {\n            comObj.postMessage({\n              sourceName,\n              targetName,\n              stream: StreamKind.PULL_COMPLETE,\n              streamId,\n              reason: wrapReason(reason),\n            });\n          }\n        );\n        break;\n      case StreamKind.ENQUEUE:\n        assert(streamController, \"enqueue should have stream controller\");\n        if (streamController.isClosed) {\n          break;\n        }\n        streamController.controller.enqueue(data.chunk);\n        break;\n      case StreamKind.CLOSE:\n        assert(streamController, \"close should have stream controller\");\n        if (streamController.isClosed) {\n          break;\n        }\n        streamController.isClosed = true;\n        streamController.controller.close();\n        this.#deleteStreamController(streamController, streamId);\n        break;\n      case StreamKind.ERROR:\n        assert(streamController, \"error should have stream controller\");\n        streamController.controller.error(wrapReason(data.reason));\n        this.#deleteStreamController(streamController, streamId);\n        break;\n      case StreamKind.CANCEL_COMPLETE:\n        if (data.success) {\n          streamController.cancelCall.resolve();\n        } else {\n          streamController.cancelCall.reject(wrapReason(data.reason));\n        }\n        this.#deleteStreamController(streamController, streamId);\n        break;\n      case StreamKind.CANCEL:\n        if (!streamSink) {\n          break;\n        }\n\n        new Promise(function (resolve) {\n          resolve(streamSink.onCancel?.(wrapReason(data.reason)));\n        }).then(\n          function () {\n            comObj.postMessage({\n              sourceName,\n              targetName,\n              stream: StreamKind.CANCEL_COMPLETE,\n              streamId,\n              success: true,\n            });\n          },\n          function (reason) {\n            comObj.postMessage({\n              sourceName,\n              targetName,\n              stream: StreamKind.CANCEL_COMPLETE,\n              streamId,\n              reason: wrapReason(reason),\n            });\n          }\n        );\n        streamSink.sinkCapability.reject(wrapReason(data.reason));\n        streamSink.isCancelled = true;\n        delete this.streamSinks[streamId];\n        break;\n      default:\n        throw new Error(\"Unexpected stream case\");\n    }\n  }\n\n  async #deleteStreamController(streamController, streamId) {\n    // Delete the `streamController` only when the start, pull, and cancel\n    // capabilities have settled, to prevent `TypeError`s.\n    await Promise.allSettled([\n      streamController.startCall?.promise,\n      streamController.pullCall?.promise,\n      streamController.cancelCall?.promise,\n    ]);\n    delete this.streamControllers[streamId];\n  }\n\n  destroy() {\n    this.comObj.removeEventListener(\"message\", this._onComObjOnMessage);\n  }\n}\n\nexport { MessageHandler };\n","/* Copyright 2014 Opera Software ASA\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *\n * Based on https://code.google.com/p/smhasher/wiki/MurmurHash3.\n * Hashes roughly 100 KB per millisecond on i7 3.4 GHz.\n */\n\nimport { isArrayBuffer } from \"./util.js\";\n\nconst SEED = 0xc3d2e1f0;\n// Workaround for missing math precision in JS.\nconst MASK_HIGH = 0xffff0000;\nconst MASK_LOW = 0xffff;\n\nclass MurmurHash3_64 {\n  constructor(seed) {\n    this.h1 = seed ? seed & 0xffffffff : SEED;\n    this.h2 = seed ? seed & 0xffffffff : SEED;\n  }\n\n  update(input) {\n    let data, length;\n    if (typeof input === \"string\") {\n      data = new Uint8Array(input.length * 2);\n      length = 0;\n      for (let i = 0, ii = input.length; i < ii; i++) {\n        const code = input.charCodeAt(i);\n        if (code <= 0xff) {\n          data[length++] = code;\n        } else {\n          data[length++] = code >>> 8;\n          data[length++] = code & 0xff;\n        }\n      }\n    } else if (isArrayBuffer(input)) {\n      data = input.slice();\n      length = data.byteLength;\n    } else {\n      throw new Error(\n        \"Wrong data format in MurmurHash3_64_update. \" +\n          \"Input must be a string or array.\"\n      );\n    }\n\n    const blockCounts = length >> 2;\n    const tailLength = length - blockCounts * 4;\n    // We don't care about endianness here.\n    const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts);\n    let k1 = 0,\n      k2 = 0;\n    let h1 = this.h1,\n      h2 = this.h2;\n    const C1 = 0xcc9e2d51,\n      C2 = 0x1b873593;\n    const C1_LOW = C1 & MASK_LOW,\n      C2_LOW = C2 & MASK_LOW;\n\n    for (let i = 0; i < blockCounts; i++) {\n      if (i & 1) {\n        k1 = dataUint32[i];\n        k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW);\n        k1 = (k1 << 15) | (k1 >>> 17);\n        k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW);\n        h1 ^= k1;\n        h1 = (h1 << 13) | (h1 >>> 19);\n        h1 = h1 * 5 + 0xe6546b64;\n      } else {\n        k2 = dataUint32[i];\n        k2 = ((k2 * C1) & MASK_HIGH) | ((k2 * C1_LOW) & MASK_LOW);\n        k2 = (k2 << 15) | (k2 >>> 17);\n        k2 = ((k2 * C2) & MASK_HIGH) | ((k2 * C2_LOW) & MASK_LOW);\n        h2 ^= k2;\n        h2 = (h2 << 13) | (h2 >>> 19);\n        h2 = h2 * 5 + 0xe6546b64;\n      }\n    }\n\n    k1 = 0;\n\n    switch (tailLength) {\n      case 3:\n        k1 ^= data[blockCounts * 4 + 2] << 16;\n      /* falls through */\n      case 2:\n        k1 ^= data[blockCounts * 4 + 1] << 8;\n      /* falls through */\n      case 1:\n        k1 ^= data[blockCounts * 4];\n        /* falls through */\n\n        k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW);\n        k1 = (k1 << 15) | (k1 >>> 17);\n        k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW);\n        if (blockCounts & 1) {\n          h1 ^= k1;\n        } else {\n          h2 ^= k1;\n        }\n    }\n\n    this.h1 = h1;\n    this.h2 = h2;\n  }\n\n  hexdigest() {\n    let h1 = this.h1,\n      h2 = this.h2;\n\n    h1 ^= h2 >>> 1;\n    h1 = ((h1 * 0xed558ccd) & MASK_HIGH) | ((h1 * 0x8ccd) & MASK_LOW);\n    h2 =\n      ((h2 * 0xff51afd7) & MASK_HIGH) |\n      (((((h2 << 16) | (h1 >>> 16)) * 0xafd7ed55) & MASK_HIGH) >>> 16);\n    h1 ^= h2 >>> 1;\n    h1 = ((h1 * 0x1a85ec53) & MASK_HIGH) | ((h1 * 0xec53) & MASK_LOW);\n    h2 =\n      ((h2 * 0xc4ceb9fe) & MASK_HIGH) |\n      (((((h2 << 16) | (h1 >>> 16)) * 0xb9fe1a85) & MASK_HIGH) >>> 16);\n    h1 ^= h2 >>> 1;\n\n    return (\n      (h1 >>> 0).toString(16).padStart(8, \"0\") +\n      (h2 >>> 0).toString(16).padStart(8, \"0\")\n    );\n  }\n}\n\nexport { MurmurHash3_64 };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals process */\n\n// NW.js / Electron is a browser context, but copies some Node.js objects; see\n// http://docs.nwjs.io/en/latest/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/#access-nodejs-and-nwjs-api-in-browser-context\n// https://www.electronjs.org/docs/api/process#processversionselectron-readonly\n// https://www.electronjs.org/docs/api/process#processtype-readonly\nconst isNodeJS =\n  (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n  typeof process === \"object\" &&\n  process + \"\" === \"[object process]\" &&\n  !process.versions.nw &&\n  !(process.versions.electron && process.type && process.type !== \"browser\");\n\nconst IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];\nconst FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];\n\nconst MAX_IMAGE_SIZE_TO_CACHE = 10e6; // Ten megabytes.\n\n// Represent the percentage of the height of a single-line field over\n// the font size. Acrobat seems to use this value.\nconst LINE_FACTOR = 1.35;\nconst LINE_DESCENT_FACTOR = 0.35;\nconst BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR;\n\n/**\n * Refer to the `WorkerTransport.getRenderingIntent`-method in the API, to see\n * how these flags are being used:\n *  - ANY, DISPLAY, and PRINT are the normal rendering intents, note the\n *    `PDFPageProxy.{render, getOperatorList, getAnnotations}`-methods.\n *  - ANNOTATIONS_FORMS, ANNOTATIONS_STORAGE, ANNOTATIONS_DISABLE control which\n *    annotations are rendered onto the canvas (i.e. by being included in the\n *    operatorList), note the `PDFPageProxy.{render, getOperatorList}`-methods\n *    and their `annotationMode`-option.\n *  - OPLIST is used with the `PDFPageProxy.getOperatorList`-method, note the\n *    `OperatorList`-constructor (on the worker-thread).\n */\nconst RenderingIntentFlag = {\n  ANY: 0x01,\n  DISPLAY: 0x02,\n  PRINT: 0x04,\n  SAVE: 0x08,\n  ANNOTATIONS_FORMS: 0x10,\n  ANNOTATIONS_STORAGE: 0x20,\n  ANNOTATIONS_DISABLE: 0x40,\n  OPLIST: 0x100,\n};\n\nconst AnnotationMode = {\n  DISABLE: 0,\n  ENABLE: 1,\n  ENABLE_FORMS: 2,\n  ENABLE_STORAGE: 3,\n};\n\nconst AnnotationEditorPrefix = \"pdfjs_internal_editor_\";\n\nconst AnnotationEditorType = {\n  DISABLE: -1,\n  NONE: 0,\n  FREETEXT: 3,\n  HIGHLIGHT: 9,\n  STAMP: 13,\n  INK: 15,\n};\n\nconst AnnotationEditorParamsType = {\n  RESIZE: 1,\n  CREATE: 2,\n  FREETEXT_SIZE: 11,\n  FREETEXT_COLOR: 12,\n  FREETEXT_OPACITY: 13,\n  INK_COLOR: 21,\n  INK_THICKNESS: 22,\n  INK_OPACITY: 23,\n};\n\n// Permission flags from Table 22, Section 7.6.3.2 of the PDF specification.\nconst PermissionFlag = {\n  PRINT: 0x04,\n  MODIFY_CONTENTS: 0x08,\n  COPY: 0x10,\n  MODIFY_ANNOTATIONS: 0x20,\n  FILL_INTERACTIVE_FORMS: 0x100,\n  COPY_FOR_ACCESSIBILITY: 0x200,\n  ASSEMBLE: 0x400,\n  PRINT_HIGH_QUALITY: 0x800,\n};\n\nconst TextRenderingMode = {\n  FILL: 0,\n  STROKE: 1,\n  FILL_STROKE: 2,\n  INVISIBLE: 3,\n  FILL_ADD_TO_PATH: 4,\n  STROKE_ADD_TO_PATH: 5,\n  FILL_STROKE_ADD_TO_PATH: 6,\n  ADD_TO_PATH: 7,\n  FILL_STROKE_MASK: 3,\n  ADD_TO_PATH_FLAG: 4,\n};\n\nconst ImageKind = {\n  GRAYSCALE_1BPP: 1,\n  RGB_24BPP: 2,\n  RGBA_32BPP: 3,\n};\n\nconst AnnotationType = {\n  TEXT: 1,\n  LINK: 2,\n  FREETEXT: 3,\n  LINE: 4,\n  SQUARE: 5,\n  CIRCLE: 6,\n  POLYGON: 7,\n  POLYLINE: 8,\n  HIGHLIGHT: 9,\n  UNDERLINE: 10,\n  SQUIGGLY: 11,\n  STRIKEOUT: 12,\n  STAMP: 13,\n  CARET: 14,\n  INK: 15,\n  POPUP: 16,\n  FILEATTACHMENT: 17,\n  SOUND: 18,\n  MOVIE: 19,\n  WIDGET: 20,\n  SCREEN: 21,\n  PRINTERMARK: 22,\n  TRAPNET: 23,\n  WATERMARK: 24,\n  THREED: 25,\n  REDACT: 26,\n};\n\nconst AnnotationReplyType = {\n  GROUP: \"Group\",\n  REPLY: \"R\",\n};\n\nconst AnnotationFlag = {\n  INVISIBLE: 0x01,\n  HIDDEN: 0x02,\n  PRINT: 0x04,\n  NOZOOM: 0x08,\n  NOROTATE: 0x10,\n  NOVIEW: 0x20,\n  READONLY: 0x40,\n  LOCKED: 0x80,\n  TOGGLENOVIEW: 0x100,\n  LOCKEDCONTENTS: 0x200,\n};\n\nconst AnnotationFieldFlag = {\n  READONLY: 0x0000001,\n  REQUIRED: 0x0000002,\n  NOEXPORT: 0x0000004,\n  MULTILINE: 0x0001000,\n  PASSWORD: 0x0002000,\n  NOTOGGLETOOFF: 0x0004000,\n  RADIO: 0x0008000,\n  PUSHBUTTON: 0x0010000,\n  COMBO: 0x0020000,\n  EDIT: 0x0040000,\n  SORT: 0x0080000,\n  FILESELECT: 0x0100000,\n  MULTISELECT: 0x0200000,\n  DONOTSPELLCHECK: 0x0400000,\n  DONOTSCROLL: 0x0800000,\n  COMB: 0x1000000,\n  RICHTEXT: 0x2000000,\n  RADIOSINUNISON: 0x2000000,\n  COMMITONSELCHANGE: 0x4000000,\n};\n\nconst AnnotationBorderStyleType = {\n  SOLID: 1,\n  DASHED: 2,\n  BEVELED: 3,\n  INSET: 4,\n  UNDERLINE: 5,\n};\n\nconst AnnotationActionEventType = {\n  E: \"Mouse Enter\",\n  X: \"Mouse Exit\",\n  D: \"Mouse Down\",\n  U: \"Mouse Up\",\n  Fo: \"Focus\",\n  Bl: \"Blur\",\n  PO: \"PageOpen\",\n  PC: \"PageClose\",\n  PV: \"PageVisible\",\n  PI: \"PageInvisible\",\n  K: \"Keystroke\",\n  F: \"Format\",\n  V: \"Validate\",\n  C: \"Calculate\",\n};\n\nconst DocumentActionEventType = {\n  WC: \"WillClose\",\n  WS: \"WillSave\",\n  DS: \"DidSave\",\n  WP: \"WillPrint\",\n  DP: \"DidPrint\",\n};\n\nconst PageActionEventType = {\n  O: \"PageOpen\",\n  C: \"PageClose\",\n};\n\nconst VerbosityLevel = {\n  ERRORS: 0,\n  WARNINGS: 1,\n  INFOS: 5,\n};\n\nconst CMapCompressionType = {\n  NONE: 0,\n  BINARY: 1,\n};\n\n// All the possible operations for an operator list.\nconst OPS = {\n  // Intentionally start from 1 so it is easy to spot bad operators that will be\n  // 0's.\n  // PLEASE NOTE: We purposely keep any removed operators commented out, since\n  //              re-numbering the list would risk breaking third-party users.\n  dependency: 1,\n  setLineWidth: 2,\n  setLineCap: 3,\n  setLineJoin: 4,\n  setMiterLimit: 5,\n  setDash: 6,\n  setRenderingIntent: 7,\n  setFlatness: 8,\n  setGState: 9,\n  save: 10,\n  restore: 11,\n  transform: 12,\n  moveTo: 13,\n  lineTo: 14,\n  curveTo: 15,\n  curveTo2: 16,\n  curveTo3: 17,\n  closePath: 18,\n  rectangle: 19,\n  stroke: 20,\n  closeStroke: 21,\n  fill: 22,\n  eoFill: 23,\n  fillStroke: 24,\n  eoFillStroke: 25,\n  closeFillStroke: 26,\n  closeEOFillStroke: 27,\n  endPath: 28,\n  clip: 29,\n  eoClip: 30,\n  beginText: 31,\n  endText: 32,\n  setCharSpacing: 33,\n  setWordSpacing: 34,\n  setHScale: 35,\n  setLeading: 36,\n  setFont: 37,\n  setTextRenderingMode: 38,\n  setTextRise: 39,\n  moveText: 40,\n  setLeadingMoveText: 41,\n  setTextMatrix: 42,\n  nextLine: 43,\n  showText: 44,\n  showSpacedText: 45,\n  nextLineShowText: 46,\n  nextLineSetSpacingShowText: 47,\n  setCharWidth: 48,\n  setCharWidthAndBounds: 49,\n  setStrokeColorSpace: 50,\n  setFillColorSpace: 51,\n  setStrokeColor: 52,\n  setStrokeColorN: 53,\n  setFillColor: 54,\n  setFillColorN: 55,\n  setStrokeGray: 56,\n  setFillGray: 57,\n  setStrokeRGBColor: 58,\n  setFillRGBColor: 59,\n  setStrokeCMYKColor: 60,\n  setFillCMYKColor: 61,\n  shadingFill: 62,\n  beginInlineImage: 63,\n  beginImageData: 64,\n  endInlineImage: 65,\n  paintXObject: 66,\n  markPoint: 67,\n  markPointProps: 68,\n  beginMarkedContent: 69,\n  beginMarkedContentProps: 70,\n  endMarkedContent: 71,\n  beginCompat: 72,\n  endCompat: 73,\n  paintFormXObjectBegin: 74,\n  paintFormXObjectEnd: 75,\n  beginGroup: 76,\n  endGroup: 77,\n  // beginAnnotations: 78,\n  // endAnnotations: 79,\n  beginAnnotation: 80,\n  endAnnotation: 81,\n  // paintJpegXObject: 82,\n  paintImageMaskXObject: 83,\n  paintImageMaskXObjectGroup: 84,\n  paintImageXObject: 85,\n  paintInlineImageXObject: 86,\n  paintInlineImageXObjectGroup: 87,\n  paintImageXObjectRepeat: 88,\n  paintImageMaskXObjectRepeat: 89,\n  paintSolidColorImageMask: 90,\n  constructPath: 91,\n};\n\nconst PasswordResponses = {\n  NEED_PASSWORD: 1,\n  INCORRECT_PASSWORD: 2,\n};\n\nlet verbosity = VerbosityLevel.WARNINGS;\n\nfunction setVerbosityLevel(level) {\n  if (Number.isInteger(level)) {\n    verbosity = level;\n  }\n}\n\nfunction getVerbosityLevel() {\n  return verbosity;\n}\n\n// A notice for devs. These are good for things that are helpful to devs, such\n// as warning that Workers were disabled, which is important to devs but not\n// end users.\nfunction info(msg) {\n  if (verbosity >= VerbosityLevel.INFOS) {\n    console.log(`Info: ${msg}`);\n  }\n}\n\n// Non-fatal warnings.\nfunction warn(msg) {\n  if (verbosity >= VerbosityLevel.WARNINGS) {\n    console.log(`Warning: ${msg}`);\n  }\n}\n\nfunction unreachable(msg) {\n  throw new Error(msg);\n}\n\nfunction assert(cond, msg) {\n  if (!cond) {\n    unreachable(msg);\n  }\n}\n\n// Checks if URLs use one of the allowed protocols, e.g. to avoid XSS.\nfunction _isValidProtocol(url) {\n  switch (url?.protocol) {\n    case \"http:\":\n    case \"https:\":\n    case \"ftp:\":\n    case \"mailto:\":\n    case \"tel:\":\n      return true;\n    default:\n      return false;\n  }\n}\n\n/**\n * Attempts to create a valid absolute URL.\n *\n * @param {URL|string} url - An absolute, or relative, URL.\n * @param {URL|string} [baseUrl] - An absolute URL.\n * @param {Object} [options]\n * @returns Either a valid {URL}, or `null` otherwise.\n */\nfunction createValidAbsoluteUrl(url, baseUrl = null, options = null) {\n  if (!url) {\n    return null;\n  }\n  try {\n    if (options && typeof url === \"string\") {\n      // Let URLs beginning with \"www.\" default to using the \"http://\" protocol.\n      if (options.addDefaultProtocol && url.startsWith(\"www.\")) {\n        const dots = url.match(/\\./g);\n        // Avoid accidentally matching a *relative* URL pointing to a file named\n        // e.g. \"www.pdf\" or similar.\n        if (dots?.length >= 2) {\n          url = `http://${url}`;\n        }\n      }\n\n      // According to ISO 32000-1:2008, section 12.6.4.7, URIs should be encoded\n      // in 7-bit ASCII. Some bad PDFs use UTF-8 encoding; see bug 1122280.\n      if (options.tryConvertEncoding) {\n        try {\n          url = stringToUTF8String(url);\n        } catch {}\n      }\n    }\n\n    const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url);\n    if (_isValidProtocol(absoluteUrl)) {\n      return absoluteUrl;\n    }\n  } catch {\n    /* `new URL()` will throw on incorrect data. */\n  }\n  return null;\n}\n\nfunction shadow(obj, prop, value, nonSerializable = false) {\n  if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n    assert(\n      prop in obj,\n      `shadow: Property \"${prop && prop.toString()}\" not found in object.`\n    );\n  }\n  Object.defineProperty(obj, prop, {\n    value,\n    enumerable: !nonSerializable,\n    configurable: true,\n    writable: false,\n  });\n  return value;\n}\n\n/**\n * @type {any}\n */\nconst BaseException = (function BaseExceptionClosure() {\n  // eslint-disable-next-line no-shadow\n  function BaseException(message, name) {\n    if (this.constructor === BaseException) {\n      unreachable(\"Cannot initialize BaseException.\");\n    }\n    this.message = message;\n    this.name = name;\n  }\n  BaseException.prototype = new Error();\n  BaseException.constructor = BaseException;\n\n  return BaseException;\n})();\n\nclass PasswordException extends BaseException {\n  constructor(msg, code) {\n    super(msg, \"PasswordException\");\n    this.code = code;\n  }\n}\n\nclass UnknownErrorException extends BaseException {\n  constructor(msg, details) {\n    super(msg, \"UnknownErrorException\");\n    this.details = details;\n  }\n}\n\nclass InvalidPDFException extends BaseException {\n  constructor(msg) {\n    super(msg, \"InvalidPDFException\");\n  }\n}\n\nclass MissingPDFException extends BaseException {\n  constructor(msg) {\n    super(msg, \"MissingPDFException\");\n  }\n}\n\nclass UnexpectedResponseException extends BaseException {\n  constructor(msg, status) {\n    super(msg, \"UnexpectedResponseException\");\n    this.status = status;\n  }\n}\n\n/**\n * Error caused during parsing PDF data.\n */\nclass FormatError extends BaseException {\n  constructor(msg) {\n    super(msg, \"FormatError\");\n  }\n}\n\n/**\n * Error used to indicate task cancellation.\n */\nclass AbortException extends BaseException {\n  constructor(msg) {\n    super(msg, \"AbortException\");\n  }\n}\n\nfunction bytesToString(bytes) {\n  if (typeof bytes !== \"object\" || bytes?.length === undefined) {\n    unreachable(\"Invalid argument for bytesToString\");\n  }\n  const length = bytes.length;\n  const MAX_ARGUMENT_COUNT = 8192;\n  if (length < MAX_ARGUMENT_COUNT) {\n    return String.fromCharCode.apply(null, bytes);\n  }\n  const strBuf = [];\n  for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) {\n    const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);\n    const chunk = bytes.subarray(i, chunkEnd);\n    strBuf.push(String.fromCharCode.apply(null, chunk));\n  }\n  return strBuf.join(\"\");\n}\n\nfunction stringToBytes(str) {\n  if (typeof str !== \"string\") {\n    unreachable(\"Invalid argument for stringToBytes\");\n  }\n  const length = str.length;\n  const bytes = new Uint8Array(length);\n  for (let i = 0; i < length; ++i) {\n    bytes[i] = str.charCodeAt(i) & 0xff;\n  }\n  return bytes;\n}\n\nfunction string32(value) {\n  if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n    assert(\n      typeof value === \"number\" && Math.abs(value) < 2 ** 32,\n      `string32: Unexpected input \"${value}\".`\n    );\n  }\n  return String.fromCharCode(\n    (value >> 24) & 0xff,\n    (value >> 16) & 0xff,\n    (value >> 8) & 0xff,\n    value & 0xff\n  );\n}\n\nfunction objectSize(obj) {\n  return Object.keys(obj).length;\n}\n\n// Ensure that the returned Object has a `null` prototype; hence why\n// `Object.fromEntries(...)` is not used.\nfunction objectFromMap(map) {\n  const obj = Object.create(null);\n  for (const [key, value] of map) {\n    obj[key] = value;\n  }\n  return obj;\n}\n\n// Checks the endianness of the platform.\nfunction isLittleEndian() {\n  const buffer8 = new Uint8Array(4);\n  buffer8[0] = 1;\n  const view32 = new Uint32Array(buffer8.buffer, 0, 1);\n  return view32[0] === 1;\n}\n\n// Checks if it's possible to eval JS expressions.\nfunction isEvalSupported() {\n  try {\n    new Function(\"\"); // eslint-disable-line no-new, no-new-func\n    return true;\n  } catch {\n    return false;\n  }\n}\n\nclass FeatureTest {\n  static get isLittleEndian() {\n    return shadow(this, \"isLittleEndian\", isLittleEndian());\n  }\n\n  static get isEvalSupported() {\n    return shadow(this, \"isEvalSupported\", isEvalSupported());\n  }\n\n  static get isOffscreenCanvasSupported() {\n    return shadow(\n      this,\n      \"isOffscreenCanvasSupported\",\n      typeof OffscreenCanvas !== \"undefined\"\n    );\n  }\n\n  static get platform() {\n    if (\n      (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n      (typeof navigator !== \"undefined\" &&\n        typeof navigator?.platform === \"string\")\n    ) {\n      return shadow(this, \"platform\", {\n        isMac: navigator.platform.includes(\"Mac\"),\n      });\n    }\n    return shadow(this, \"platform\", { isMac: false });\n  }\n\n  static get isCSSRoundSupported() {\n    return shadow(\n      this,\n      \"isCSSRoundSupported\",\n      globalThis.CSS?.supports?.(\"width: round(1.5px, 1px)\")\n    );\n  }\n}\n\nconst hexNumbers = [...Array(256).keys()].map(n =>\n  n.toString(16).padStart(2, \"0\")\n);\n\nclass Util {\n  static makeHexColor(r, g, b) {\n    return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`;\n  }\n\n  // Apply a scaling matrix to some min/max values.\n  // If a scaling factor is negative then min and max must be\n  // swaped.\n  static scaleMinMax(transform, minMax) {\n    let temp;\n    if (transform[0]) {\n      if (transform[0] < 0) {\n        temp = minMax[0];\n        minMax[0] = minMax[1];\n        minMax[1] = temp;\n      }\n      minMax[0] *= transform[0];\n      minMax[1] *= transform[0];\n\n      if (transform[3] < 0) {\n        temp = minMax[2];\n        minMax[2] = minMax[3];\n        minMax[3] = temp;\n      }\n      minMax[2] *= transform[3];\n      minMax[3] *= transform[3];\n    } else {\n      temp = minMax[0];\n      minMax[0] = minMax[2];\n      minMax[2] = temp;\n      temp = minMax[1];\n      minMax[1] = minMax[3];\n      minMax[3] = temp;\n\n      if (transform[1] < 0) {\n        temp = minMax[2];\n        minMax[2] = minMax[3];\n        minMax[3] = temp;\n      }\n      minMax[2] *= transform[1];\n      minMax[3] *= transform[1];\n\n      if (transform[2] < 0) {\n        temp = minMax[0];\n        minMax[0] = minMax[1];\n        minMax[1] = temp;\n      }\n      minMax[0] *= transform[2];\n      minMax[1] *= transform[2];\n    }\n    minMax[0] += transform[4];\n    minMax[1] += transform[4];\n    minMax[2] += transform[5];\n    minMax[3] += transform[5];\n  }\n\n  // Concatenates two transformation matrices together and returns the result.\n  static transform(m1, m2) {\n    return [\n      m1[0] * m2[0] + m1[2] * m2[1],\n      m1[1] * m2[0] + m1[3] * m2[1],\n      m1[0] * m2[2] + m1[2] * m2[3],\n      m1[1] * m2[2] + m1[3] * m2[3],\n      m1[0] * m2[4] + m1[2] * m2[5] + m1[4],\n      m1[1] * m2[4] + m1[3] * m2[5] + m1[5],\n    ];\n  }\n\n  // For 2d affine transforms\n  static applyTransform(p, m) {\n    const xt = p[0] * m[0] + p[1] * m[2] + m[4];\n    const yt = p[0] * m[1] + p[1] * m[3] + m[5];\n    return [xt, yt];\n  }\n\n  static applyInverseTransform(p, m) {\n    const d = m[0] * m[3] - m[1] * m[2];\n    const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;\n    const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;\n    return [xt, yt];\n  }\n\n  // Applies the transform to the rectangle and finds the minimum axially\n  // aligned bounding box.\n  static getAxialAlignedBoundingBox(r, m) {\n    const p1 = this.applyTransform(r, m);\n    const p2 = this.applyTransform(r.slice(2, 4), m);\n    const p3 = this.applyTransform([r[0], r[3]], m);\n    const p4 = this.applyTransform([r[2], r[1]], m);\n    return [\n      Math.min(p1[0], p2[0], p3[0], p4[0]),\n      Math.min(p1[1], p2[1], p3[1], p4[1]),\n      Math.max(p1[0], p2[0], p3[0], p4[0]),\n      Math.max(p1[1], p2[1], p3[1], p4[1]),\n    ];\n  }\n\n  static inverseTransform(m) {\n    const d = m[0] * m[3] - m[1] * m[2];\n    return [\n      m[3] / d,\n      -m[1] / d,\n      -m[2] / d,\n      m[0] / d,\n      (m[2] * m[5] - m[4] * m[3]) / d,\n      (m[4] * m[1] - m[5] * m[0]) / d,\n    ];\n  }\n\n  // This calculation uses Singular Value Decomposition.\n  // The SVD can be represented with formula A = USV. We are interested in the\n  // matrix S here because it represents the scale values.\n  static singularValueDecompose2dScale(m) {\n    const transpose = [m[0], m[2], m[1], m[3]];\n\n    // Multiply matrix m with its transpose.\n    const a = m[0] * transpose[0] + m[1] * transpose[2];\n    const b = m[0] * transpose[1] + m[1] * transpose[3];\n    const c = m[2] * transpose[0] + m[3] * transpose[2];\n    const d = m[2] * transpose[1] + m[3] * transpose[3];\n\n    // Solve the second degree polynomial to get roots.\n    const first = (a + d) / 2;\n    const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2;\n    const sx = first + second || 1;\n    const sy = first - second || 1;\n\n    // Scale values are the square roots of the eigenvalues.\n    return [Math.sqrt(sx), Math.sqrt(sy)];\n  }\n\n  // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2)\n  // For coordinate systems whose origin lies in the bottom-left, this\n  // means normalization to (BL,TR) ordering. For systems with origin in the\n  // top-left, this means (TL,BR) ordering.\n  static normalizeRect(rect) {\n    const r = rect.slice(0); // clone rect\n    if (rect[0] > rect[2]) {\n      r[0] = rect[2];\n      r[2] = rect[0];\n    }\n    if (rect[1] > rect[3]) {\n      r[1] = rect[3];\n      r[3] = rect[1];\n    }\n    return r;\n  }\n\n  // Returns a rectangle [x1, y1, x2, y2] corresponding to the\n  // intersection of rect1 and rect2. If no intersection, returns 'null'\n  // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2]\n  static intersect(rect1, rect2) {\n    const xLow = Math.max(\n      Math.min(rect1[0], rect1[2]),\n      Math.min(rect2[0], rect2[2])\n    );\n    const xHigh = Math.min(\n      Math.max(rect1[0], rect1[2]),\n      Math.max(rect2[0], rect2[2])\n    );\n    if (xLow > xHigh) {\n      return null;\n    }\n    const yLow = Math.max(\n      Math.min(rect1[1], rect1[3]),\n      Math.min(rect2[1], rect2[3])\n    );\n    const yHigh = Math.min(\n      Math.max(rect1[1], rect1[3]),\n      Math.max(rect2[1], rect2[3])\n    );\n    if (yLow > yHigh) {\n      return null;\n    }\n\n    return [xLow, yLow, xHigh, yHigh];\n  }\n\n  // From https://github.com/adobe-webplatform/Snap.svg/blob/b365287722a72526000ac4bfcf0ce4cac2faa015/src/path.js#L852\n  static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3) {\n    const tvalues = [],\n      bounds = [[], []];\n    let a, b, c, t, t1, t2, b2ac, sqrtb2ac;\n    for (let i = 0; i < 2; ++i) {\n      if (i === 0) {\n        b = 6 * x0 - 12 * x1 + 6 * x2;\n        a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n        c = 3 * x1 - 3 * x0;\n      } else {\n        b = 6 * y0 - 12 * y1 + 6 * y2;\n        a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n        c = 3 * y1 - 3 * y0;\n      }\n      if (Math.abs(a) < 1e-12) {\n        if (Math.abs(b) < 1e-12) {\n          continue;\n        }\n        t = -c / b;\n        if (0 < t && t < 1) {\n          tvalues.push(t);\n        }\n        continue;\n      }\n      b2ac = b * b - 4 * c * a;\n      sqrtb2ac = Math.sqrt(b2ac);\n      if (b2ac < 0) {\n        continue;\n      }\n      t1 = (-b + sqrtb2ac) / (2 * a);\n      if (0 < t1 && t1 < 1) {\n        tvalues.push(t1);\n      }\n      t2 = (-b - sqrtb2ac) / (2 * a);\n      if (0 < t2 && t2 < 1) {\n        tvalues.push(t2);\n      }\n    }\n\n    let j = tvalues.length,\n      mt;\n    const jlen = j;\n    while (j--) {\n      t = tvalues[j];\n      mt = 1 - t;\n      bounds[0][j] =\n        mt * mt * mt * x0 +\n        3 * mt * mt * t * x1 +\n        3 * mt * t * t * x2 +\n        t * t * t * x3;\n      bounds[1][j] =\n        mt * mt * mt * y0 +\n        3 * mt * mt * t * y1 +\n        3 * mt * t * t * y2 +\n        t * t * t * y3;\n    }\n\n    bounds[0][jlen] = x0;\n    bounds[1][jlen] = y0;\n    bounds[0][jlen + 1] = x3;\n    bounds[1][jlen + 1] = y3;\n    bounds[0].length = bounds[1].length = jlen + 2;\n\n    return [\n      Math.min(...bounds[0]),\n      Math.min(...bounds[1]),\n      Math.max(...bounds[0]),\n      Math.max(...bounds[1]),\n    ];\n  }\n}\n\nconst PDFStringTranslateTable = [\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8,\n  0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n  0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192,\n  0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018,\n  0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d,\n  0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac,\n];\n\nfunction stringToPDFString(str) {\n  // See section 7.9.2.2 Text String Type.\n  // The string can contain some language codes bracketed with 0x0b,\n  // so we must remove them.\n  if (str[0] >= \"\\xEF\") {\n    let encoding;\n    if (str[0] === \"\\xFE\" && str[1] === \"\\xFF\") {\n      encoding = \"utf-16be\";\n      if (str.length % 2 === 1) {\n        str = str.slice(0, -1);\n      }\n    } else if (str[0] === \"\\xFF\" && str[1] === \"\\xFE\") {\n      encoding = \"utf-16le\";\n      if (str.length % 2 === 1) {\n        str = str.slice(0, -1);\n      }\n    } else if (str[0] === \"\\xEF\" && str[1] === \"\\xBB\" && str[2] === \"\\xBF\") {\n      encoding = \"utf-8\";\n    }\n\n    if (encoding) {\n      try {\n        const decoder = new TextDecoder(encoding, { fatal: true });\n        const buffer = stringToBytes(str);\n        const decoded = decoder.decode(buffer);\n        if (!decoded.includes(\"\\x1b\")) {\n          return decoded;\n        }\n        return decoded.replaceAll(/\\x1b[^\\x1b]*(?:\\x1b|$)/g, \"\");\n      } catch (ex) {\n        warn(`stringToPDFString: \"${ex}\".`);\n      }\n    }\n  }\n  // ISO Latin 1\n  const strBuf = [];\n  for (let i = 0, ii = str.length; i < ii; i++) {\n    const charCode = str.charCodeAt(i);\n    if (charCode === 0x1b) {\n      // eslint-disable-next-line no-empty\n      while (++i < ii && str.charCodeAt(i) !== 0x1b) {}\n      continue;\n    }\n    const code = PDFStringTranslateTable[charCode];\n    strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));\n  }\n  return strBuf.join(\"\");\n}\n\nfunction stringToUTF8String(str) {\n  return decodeURIComponent(escape(str));\n}\n\nfunction utf8StringToString(str) {\n  return unescape(encodeURIComponent(str));\n}\n\nfunction isArrayBuffer(v) {\n  return typeof v === \"object\" && v?.byteLength !== undefined;\n}\n\nfunction isArrayEqual(arr1, arr2) {\n  if (arr1.length !== arr2.length) {\n    return false;\n  }\n  for (let i = 0, ii = arr1.length; i < ii; i++) {\n    if (arr1[i] !== arr2[i]) {\n      return false;\n    }\n  }\n  return true;\n}\n\nfunction getModificationDate(date = new Date()) {\n  const buffer = [\n    date.getUTCFullYear().toString(),\n    (date.getUTCMonth() + 1).toString().padStart(2, \"0\"),\n    date.getUTCDate().toString().padStart(2, \"0\"),\n    date.getUTCHours().toString().padStart(2, \"0\"),\n    date.getUTCMinutes().toString().padStart(2, \"0\"),\n    date.getUTCSeconds().toString().padStart(2, \"0\"),\n  ];\n\n  return buffer.join(\"\");\n}\n\nclass PromiseCapability {\n  #settled = false;\n\n  constructor() {\n    /**\n     * @type {Promise<any>} The Promise object.\n     */\n    this.promise = new Promise((resolve, reject) => {\n      /**\n       * @type {function} Fulfills the Promise.\n       */\n      this.resolve = data => {\n        this.#settled = true;\n        resolve(data);\n      };\n\n      /**\n       * @type {function} Rejects the Promise.\n       */\n      this.reject = reason => {\n        if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n          assert(reason instanceof Error, 'Expected valid \"reason\" argument.');\n        }\n        this.#settled = true;\n        reject(reason);\n      };\n    });\n  }\n\n  /**\n   * @type {boolean} If the Promise has been fulfilled/rejected.\n   */\n  get settled() {\n    return this.#settled;\n  }\n}\n\nlet NormalizeRegex = null;\nlet NormalizationMap = null;\nfunction normalizeUnicode(str) {\n  if (!NormalizeRegex) {\n    // In order to generate the following regex:\n    //  - create a PDF containing all the chars in the range 0000-FFFF with\n    //    a NFKC which is different of the char.\n    //  - copy and paste all those chars and get the ones where NFKC is\n    //    required.\n    // It appears that most the chars here contain some ligatures.\n    NormalizeRegex =\n      /([\\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;\n    NormalizationMap = new Map([[\"ﬅ\", \"ſt\"]]);\n  }\n  return str.replaceAll(NormalizeRegex, (_, p1, p2) => {\n    return p1 ? p1.normalize(\"NFKC\") : NormalizationMap.get(p2);\n  });\n}\n\nfunction getUuid() {\n  if (\n    (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n    (typeof crypto !== \"undefined\" && typeof crypto?.randomUUID === \"function\")\n  ) {\n    return crypto.randomUUID();\n  }\n  const buf = new Uint8Array(32);\n  if (\n    typeof crypto !== \"undefined\" &&\n    typeof crypto?.getRandomValues === \"function\"\n  ) {\n    crypto.getRandomValues(buf);\n  } else {\n    for (let i = 0; i < 32; i++) {\n      buf[i] = Math.floor(Math.random() * 255);\n    }\n  }\n  return bytesToString(buf);\n}\n\nconst AnnotationPrefix = \"pdfjs_internal_id_\";\n\nexport {\n  AbortException,\n  AnnotationActionEventType,\n  AnnotationBorderStyleType,\n  AnnotationEditorParamsType,\n  AnnotationEditorPrefix,\n  AnnotationEditorType,\n  AnnotationFieldFlag,\n  AnnotationFlag,\n  AnnotationMode,\n  AnnotationPrefix,\n  AnnotationReplyType,\n  AnnotationType,\n  assert,\n  BaseException,\n  BASELINE_FACTOR,\n  bytesToString,\n  CMapCompressionType,\n  createValidAbsoluteUrl,\n  DocumentActionEventType,\n  FeatureTest,\n  FONT_IDENTITY_MATRIX,\n  FormatError,\n  getModificationDate,\n  getUuid,\n  getVerbosityLevel,\n  IDENTITY_MATRIX,\n  ImageKind,\n  info,\n  InvalidPDFException,\n  isArrayBuffer,\n  isArrayEqual,\n  isNodeJS,\n  LINE_DESCENT_FACTOR,\n  LINE_FACTOR,\n  MAX_IMAGE_SIZE_TO_CACHE,\n  MissingPDFException,\n  normalizeUnicode,\n  objectFromMap,\n  objectSize,\n  OPS,\n  PageActionEventType,\n  PasswordException,\n  PasswordResponses,\n  PermissionFlag,\n  PromiseCapability,\n  RenderingIntentFlag,\n  setVerbosityLevel,\n  shadow,\n  string32,\n  stringToBytes,\n  stringToPDFString,\n  stringToUTF8String,\n  TextRenderingMode,\n  UnexpectedResponseException,\n  UnknownErrorException,\n  unreachable,\n  utf8StringToString,\n  Util,\n  VerbosityLevel,\n  warn,\n};\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __webpack_require__(moduleId) {\n\t// Check if module is in cache\n\tvar cachedModule = __webpack_module_cache__[moduleId];\n\tif (cachedModule !== undefined) {\n\t\treturn cachedModule.exports;\n\t}\n\t// Create a new module (and put it into the cache)\n\tvar module = __webpack_module_cache__[moduleId] = {\n\t\t// no module.id needed\n\t\t// no module.loaded needed\n\t\texports: {}\n\t};\n\n\t// Execute the module function\n\t__webpack_modules__[moduleId](module, module.exports, __webpack_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\n\n","var webpackQueues = typeof Symbol === \"function\" ? Symbol(\"webpack queues\") : \"__webpack_queues__\";\nvar webpackExports = typeof Symbol === \"function\" ? Symbol(\"webpack exports\") : \"__webpack_exports__\";\nvar webpackError = typeof Symbol === \"function\" ? Symbol(\"webpack error\") : \"__webpack_error__\";\nvar resolveQueue = (queue) => {\n\tif(queue && queue.d < 1) {\n\t\tqueue.d = 1;\n\t\tqueue.forEach((fn) => (fn.r--));\n\t\tqueue.forEach((fn) => (fn.r-- ? fn.r++ : fn()));\n\t}\n}\nvar wrapDeps = (deps) => (deps.map((dep) => {\n\tif(dep !== null && typeof dep === \"object\") {\n\t\tif(dep[webpackQueues]) return dep;\n\t\tif(dep.then) {\n\t\t\tvar queue = [];\n\t\t\tqueue.d = 0;\n\t\t\tdep.then((r) => {\n\t\t\t\tobj[webpackExports] = r;\n\t\t\t\tresolveQueue(queue);\n\t\t\t}, (e) => {\n\t\t\t\tobj[webpackError] = e;\n\t\t\t\tresolveQueue(queue);\n\t\t\t});\n\t\t\tvar obj = {};\n\t\t\tobj[webpackQueues] = (fn) => (fn(queue));\n\t\t\treturn obj;\n\t\t}\n\t}\n\tvar ret = {};\n\tret[webpackQueues] = x => {};\n\tret[webpackExports] = dep;\n\treturn ret;\n}));\n__webpack_require__.a = (module, body, hasAwait) => {\n\tvar queue;\n\thasAwait && ((queue = []).d = -1);\n\tvar depQueues = new Set();\n\tvar exports = module.exports;\n\tvar currentDeps;\n\tvar outerResolve;\n\tvar reject;\n\tvar promise = new Promise((resolve, rej) => {\n\t\treject = rej;\n\t\touterResolve = resolve;\n\t});\n\tpromise[webpackExports] = exports;\n\tpromise[webpackQueues] = (fn) => (queue && fn(queue), depQueues.forEach(fn), promise[\"catch\"](x => {}));\n\tmodule.exports = promise;\n\tbody((deps) => {\n\t\tcurrentDeps = wrapDeps(deps);\n\t\tvar fn;\n\t\tvar getResult = () => (currentDeps.map((d) => {\n\t\t\tif(d[webpackError]) throw d[webpackError];\n\t\t\treturn d[webpackExports];\n\t\t}))\n\t\tvar promise = new Promise((resolve) => {\n\t\t\tfn = () => (resolve(getResult));\n\t\t\tfn.r = 0;\n\t\t\tvar fnQueue = (q) => (q !== queue && !depQueues.has(q) && (depQueues.add(q), q && !q.d && (fn.r++, q.push(fn))));\n\t\t\tcurrentDeps.map((dep) => (dep[webpackQueues](fnQueue)));\n\t\t});\n\t\treturn fn.r ? promise : getResult();\n\t}, (err) => ((err ? reject(promise[webpackError] = err) : outerResolve(exports)), resolveQueue(queue)));\n\tqueue && queue.d < 0 && (queue.d = 0);\n};","// define getter functions for harmony exports\n__webpack_require__.d = (exports, definition) => {\n\tfor(var key in definition) {\n\t\tif(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {\n\t\t\tObject.defineProperty(exports, key, { enumerable: true, get: definition[key] });\n\t\t}\n\t}\n};","__webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))","// startup\n// Load entry module and return exports\n// This entry module used 'module' so it can't be inlined\nvar __webpack_exports__ = __webpack_require__(907);\n"]}