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5pD,YAAA,EAAc;IACZ,MAAM,IAAIV,KAAJ,CACJ,2DACE,2DADF,GAEE,kEAHE,CAAN;EADY;AADoB;AA/CpCV,qCAAA,GAAAgrD,6BAAA;AAyDA,MAAMC,6BAAN,CAAoC;EAClC7pD,YAAA,EAAc;IACZ,MAAM,IAAIV,KAAJ,CACJ,2DACE,yEAFE,CAAN;EADY;AADoB;AAzDpCV,qCAAA,GAAAirD,6BAAA;AAkEA,MAAMC,uBAAN,CAA8B;EAC5B9pD,YAAA,EAAc;IACZ,MAAM,IAAIV,KAAJ,CACJ,qDACE,0DADF,GAEE,4DAHE,CAAN;EADY;AADc;AAlE9BV,+BAAA,GAAAkrD,uBAAA;AA4EA,MAAMC,sBAAN,CAA6B;EAC3B/pD,YAAA,EAAc;IACZ,MAAM,IAAIV,KAAJ,CACJ,oDACE,iDADF,GAEE,2DAHE,CAAN;EADY;AADa;AA5E7BV,8BAAA,GAAAmrD,sBAAA","sources":["webpack://pdfjs-dist/web/pdf_viewer/webpack/universalModuleDefinition","webpack://pdfjs-dist/web/pdf_viewer/web/pdf_link_service.js","webpack://pdfjs-dist/web/pdf_viewer/web/ui_utils.js","webpack://pdfjs-dist/web/pdf_viewer/web/annotation_layer_builder.js","webpack://pdfjs-dist/web/pdf_viewer/web/pdfjs.js","webpack://pdfjs-dist/web/pdf_viewer/web/l10n_utils.js","webpack://pdfjs-dist/web/pdf_viewer/web/download_manager.js","webpack://pdfjs-dist/web/pdf_viewer/web/event_utils.js","webpack://pdfjs-dist/web/pdf_viewer/web/genericl10n.js","webpack://pdfjs-dist/web/pdf_viewer/external/webL10n/l10n.js","webpack://pdfjs-dist/web/pdf_viewer/web/pdf_find_controller.js","webpack://pdfjs-dist/web/pdf_viewer/web/pdf_find_utils.js","webpack://pdfjs-dist/web/pdf_viewer/web/pdf_history.js","webpack://pdfjs-dist/web/pdf_viewer/web/pdf_page_view.js","webpack://pdfjs-dist/web/pdf_viewer/web/annotation_editor_layer_builder.js","webpack://pdfjs-dist/web/pdf_viewer/web/app_options.js","webpack://pdfjs-dist/web/pdf_viewer/web/struct_tree_layer_builder.js","webpack://pdfjs-dist/web/pdf_viewer/web/text_accessibility.js","webpack://pdfjs-dist/web/pdf_viewer/web/text_highlighter.js","webpack://pdfjs-dist/web/pdf_viewer/web/text_layer_builder.js","webpack://pdfjs-dist/web/pdf_viewer/web/xfa_layer_builder.js","webpack://pdfjs-dist/web/pdf_viewer/web/pdf_scripting_manager.js","webpack://pdfjs-dist/web/pdf_viewer/web/generic_scripting.js","webpack://pdfjs-dist/web/pdf_viewer/web/pdf_single_page_viewer.js","webpack://pdfjs-dist/web/pdf_viewer/web/pdf_viewer.js","webpack://pdfjs-dist/web/pdf_viewer/web/pdf_rendering_queue.js","webpack://pdfjs-dist/web/pdf_viewer/webpack/bootstrap","webpack://pdfjs-dist/web/pdf_viewer/web/pdf_viewer.component.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"pdfjs-dist/web/pdf_viewer\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"pdfjs-dist/web/pdf_viewer\"] = factory();\n\telse\n\t\troot[\"pdfjs-dist/web/pdf_viewer\"] = factory();\n})(globalThis, () => {\nreturn ","/* 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(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { parseQueryString, removeNullCharacters } from \"./ui_utils.js\";\n\nconst DEFAULT_LINK_REL = \"noopener noreferrer nofollow\";\n\nconst LinkTarget = {\n NONE: 0, // Default value.\n SELF: 1,\n BLANK: 2,\n PARENT: 3,\n TOP: 4,\n};\n\n/**\n * @typedef {Object} ExternalLinkParameters\n * @property {string} url - An absolute URL.\n * @property {LinkTarget} [target] - The link target. The default value is\n * `LinkTarget.NONE`.\n * @property {string} [rel] - The link relationship. The default value is\n * `DEFAULT_LINK_REL`.\n * @property {boolean} [enabled] - Whether the link should be enabled. The\n * default value is true.\n */\n\n/**\n * Adds various attributes (href, title, target, rel) to hyperlinks.\n * @param {HTMLAnchorElement} link - The link element.\n * @param {ExternalLinkParameters} params\n */\nfunction addLinkAttributes(link, { url, target, rel, enabled = true } = {}) {\n if (!url || typeof url !== \"string\") {\n throw new Error('A valid \"url\" parameter must provided.');\n }\n\n const urlNullRemoved = removeNullCharacters(url);\n if (enabled) {\n link.href = link.title = urlNullRemoved;\n } else {\n link.href = \"\";\n link.title = `Disabled: ${urlNullRemoved}`;\n link.onclick = () => {\n return false;\n };\n }\n\n let targetStr = \"\"; // LinkTarget.NONE\n switch (target) {\n case LinkTarget.NONE:\n break;\n case LinkTarget.SELF:\n targetStr = \"_self\";\n break;\n case LinkTarget.BLANK:\n targetStr = \"_blank\";\n break;\n case LinkTarget.PARENT:\n targetStr = \"_parent\";\n break;\n case LinkTarget.TOP:\n targetStr = \"_top\";\n break;\n }\n link.target = targetStr;\n\n link.rel = typeof rel === \"string\" ? rel : DEFAULT_LINK_REL;\n}\n\n/**\n * @typedef {Object} PDFLinkServiceOptions\n * @property {EventBus} eventBus - The application event bus.\n * @property {number} [externalLinkTarget] - Specifies the `target` attribute\n * for external links. Must use one of the values from {LinkTarget}.\n * Defaults to using no target.\n * @property {string} [externalLinkRel] - Specifies the `rel` attribute for\n * external links. Defaults to stripping the referrer.\n * @property {boolean} [ignoreDestinationZoom] - Ignores the zoom argument,\n * thus preserving the current zoom level in the viewer, when navigating\n * to internal destinations. The default value is `false`.\n */\n\n/**\n * Performs navigation functions inside PDF, such as opening specified page,\n * or destination.\n * @implements {IPDFLinkService}\n */\nclass PDFLinkService {\n #pagesRefCache = new Map();\n\n /**\n * @param {PDFLinkServiceOptions} options\n */\n constructor({\n eventBus,\n externalLinkTarget = null,\n externalLinkRel = null,\n ignoreDestinationZoom = false,\n } = {}) {\n this.eventBus = eventBus;\n this.externalLinkTarget = externalLinkTarget;\n this.externalLinkRel = externalLinkRel;\n this.externalLinkEnabled = true;\n this._ignoreDestinationZoom = ignoreDestinationZoom;\n\n this.baseUrl = null;\n this.pdfDocument = null;\n this.pdfViewer = null;\n this.pdfHistory = null;\n }\n\n setDocument(pdfDocument, baseUrl = null) {\n this.baseUrl = baseUrl;\n this.pdfDocument = pdfDocument;\n this.#pagesRefCache.clear();\n }\n\n setViewer(pdfViewer) {\n this.pdfViewer = pdfViewer;\n }\n\n setHistory(pdfHistory) {\n this.pdfHistory = pdfHistory;\n }\n\n /**\n * @type {number}\n */\n get pagesCount() {\n return this.pdfDocument ? this.pdfDocument.numPages : 0;\n }\n\n /**\n * @type {number}\n */\n get page() {\n return this.pdfViewer.currentPageNumber;\n }\n\n /**\n * @param {number} value\n */\n set page(value) {\n this.pdfViewer.currentPageNumber = value;\n }\n\n /**\n * @type {number}\n */\n get rotation() {\n return this.pdfViewer.pagesRotation;\n }\n\n /**\n * @param {number} value\n */\n set rotation(value) {\n this.pdfViewer.pagesRotation = value;\n }\n\n /**\n * @type {boolean}\n */\n get isInPresentationMode() {\n return this.pdfViewer.isInPresentationMode;\n }\n\n #goToDestinationHelper(rawDest, namedDest = null, explicitDest) {\n // Dest array looks like that: <page-ref> </XYZ|/FitXXX> <args..>\n const destRef = explicitDest[0];\n let pageNumber;\n\n if (typeof destRef === \"object\" && destRef !== null) {\n pageNumber = this._cachedPageNumber(destRef);\n\n if (!pageNumber) {\n // Fetch the page reference if it's not yet available. This could\n // only occur during loading, before all pages have been resolved.\n this.pdfDocument\n .getPageIndex(destRef)\n .then(pageIndex => {\n this.cachePageRef(pageIndex + 1, destRef);\n this.#goToDestinationHelper(rawDest, namedDest, explicitDest);\n })\n .catch(() => {\n console.error(\n `PDFLinkService.#goToDestinationHelper: \"${destRef}\" is not ` +\n `a valid page reference, for dest=\"${rawDest}\".`\n );\n });\n return;\n }\n } else if (Number.isInteger(destRef)) {\n pageNumber = destRef + 1;\n } else {\n console.error(\n `PDFLinkService.#goToDestinationHelper: \"${destRef}\" is not ` +\n `a valid destination reference, for dest=\"${rawDest}\".`\n );\n return;\n }\n if (!pageNumber || pageNumber < 1 || pageNumber > this.pagesCount) {\n console.error(\n `PDFLinkService.#goToDestinationHelper: \"${pageNumber}\" is not ` +\n `a valid page number, for dest=\"${rawDest}\".`\n );\n return;\n }\n\n if (this.pdfHistory) {\n // Update the browser history before scrolling the new destination into\n // view, to be able to accurately capture the current document position.\n this.pdfHistory.pushCurrentPosition();\n this.pdfHistory.push({ namedDest, explicitDest, pageNumber });\n }\n\n this.pdfViewer.scrollPageIntoView({\n pageNumber,\n destArray: explicitDest,\n ignoreDestinationZoom: this._ignoreDestinationZoom,\n });\n }\n\n /**\n * This method will, when available, also update the browser history.\n *\n * @param {string|Array} dest - The named, or explicit, PDF destination.\n */\n async goToDestination(dest) {\n if (!this.pdfDocument) {\n return;\n }\n let namedDest, explicitDest;\n if (typeof dest === \"string\") {\n namedDest = dest;\n explicitDest = await this.pdfDocument.getDestination(dest);\n } else {\n namedDest = null;\n explicitDest = await dest;\n }\n if (!Array.isArray(explicitDest)) {\n console.error(\n `PDFLinkService.goToDestination: \"${explicitDest}\" is not ` +\n `a valid destination array, for dest=\"${dest}\".`\n );\n return;\n }\n this.#goToDestinationHelper(dest, namedDest, explicitDest);\n }\n\n /**\n * This method will, when available, also update the browser history.\n *\n * @param {number|string} val - The page number, or page label.\n */\n goToPage(val) {\n if (!this.pdfDocument) {\n return;\n }\n const pageNumber =\n (typeof val === \"string\" && this.pdfViewer.pageLabelToPageNumber(val)) ||\n val | 0;\n if (\n !(\n Number.isInteger(pageNumber) &&\n pageNumber > 0 &&\n pageNumber <= this.pagesCount\n )\n ) {\n console.error(`PDFLinkService.goToPage: \"${val}\" is not a valid page.`);\n return;\n }\n\n if (this.pdfHistory) {\n // Update the browser history before scrolling the new page into view,\n // to be able to accurately capture the current document position.\n this.pdfHistory.pushCurrentPosition();\n this.pdfHistory.pushPage(pageNumber);\n }\n\n this.pdfViewer.scrollPageIntoView({ pageNumber });\n }\n\n /**\n * Wrapper around the `addLinkAttributes` helper function.\n * @param {HTMLAnchorElement} link\n * @param {string} url\n * @param {boolean} [newWindow]\n */\n addLinkAttributes(link, url, newWindow = false) {\n addLinkAttributes(link, {\n url,\n target: newWindow ? LinkTarget.BLANK : this.externalLinkTarget,\n rel: this.externalLinkRel,\n enabled: this.externalLinkEnabled,\n });\n }\n\n /**\n * @param {string|Array} dest - The PDF destination object.\n * @returns {string} The hyperlink to the PDF object.\n */\n getDestinationHash(dest) {\n if (typeof dest === \"string\") {\n if (dest.length > 0) {\n return this.getAnchorUrl(\"#\" + escape(dest));\n }\n } else if (Array.isArray(dest)) {\n const str = JSON.stringify(dest);\n if (str.length > 0) {\n return this.getAnchorUrl(\"#\" + escape(str));\n }\n }\n return this.getAnchorUrl(\"\");\n }\n\n /**\n * Prefix the full url on anchor links to make sure that links are resolved\n * relative to the current URL instead of the one defined in <base href>.\n * @param {string} anchor - The anchor hash, including the #.\n * @returns {string} The hyperlink to the PDF object.\n */\n getAnchorUrl(anchor) {\n return this.baseUrl ? this.baseUrl + anchor : anchor;\n }\n\n /**\n * @param {string} hash\n */\n setHash(hash) {\n if (!this.pdfDocument) {\n return;\n }\n let pageNumber, dest;\n if (hash.includes(\"=\")) {\n const params = parseQueryString(hash);\n if (params.has(\"search\")) {\n const query = params.get(\"search\").replaceAll('\"', \"\"),\n phrase = params.get(\"phrase\") === \"true\";\n\n this.eventBus.dispatch(\"findfromurlhash\", {\n source: this,\n query: phrase ? query : query.match(/\\S+/g),\n });\n }\n // borrowing syntax from \"Parameters for Opening PDF Files\"\n if (params.has(\"page\")) {\n pageNumber = params.get(\"page\") | 0 || 1;\n }\n if (params.has(\"zoom\")) {\n // Build the destination array.\n const zoomArgs = params.get(\"zoom\").split(\",\"); // scale,left,top\n const zoomArg = zoomArgs[0];\n const zoomArgNumber = parseFloat(zoomArg);\n\n if (!zoomArg.includes(\"Fit\")) {\n // If the zoomArg is a number, it has to get divided by 100. If it's\n // a string, it should stay as it is.\n dest = [\n null,\n { name: \"XYZ\" },\n zoomArgs.length > 1 ? zoomArgs[1] | 0 : null,\n zoomArgs.length > 2 ? zoomArgs[2] | 0 : null,\n zoomArgNumber ? zoomArgNumber / 100 : zoomArg,\n ];\n } else {\n if (zoomArg === \"Fit\" || zoomArg === \"FitB\") {\n dest = [null, { name: zoomArg }];\n } else if (\n zoomArg === \"FitH\" ||\n zoomArg === \"FitBH\" ||\n zoomArg === \"FitV\" ||\n zoomArg === \"FitBV\"\n ) {\n dest = [\n null,\n { name: zoomArg },\n zoomArgs.length > 1 ? zoomArgs[1] | 0 : null,\n ];\n } else if (zoomArg === \"FitR\") {\n if (zoomArgs.length !== 5) {\n console.error(\n 'PDFLinkService.setHash: Not enough parameters for \"FitR\".'\n );\n } else {\n dest = [\n null,\n { name: zoomArg },\n zoomArgs[1] | 0,\n zoomArgs[2] | 0,\n zoomArgs[3] | 0,\n zoomArgs[4] | 0,\n ];\n }\n } else {\n console.error(\n `PDFLinkService.setHash: \"${zoomArg}\" is not a valid zoom value.`\n );\n }\n }\n }\n if (dest) {\n this.pdfViewer.scrollPageIntoView({\n pageNumber: pageNumber || this.page,\n destArray: dest,\n allowNegativeOffset: true,\n });\n } else if (pageNumber) {\n this.page = pageNumber; // simple page\n }\n if (params.has(\"pagemode\")) {\n this.eventBus.dispatch(\"pagemode\", {\n source: this,\n mode: params.get(\"pagemode\"),\n });\n }\n // Ensure that this parameter is *always* handled last, in order to\n // guarantee that it won't be overridden (e.g. by the \"page\" parameter).\n if (params.has(\"nameddest\")) {\n this.goToDestination(params.get(\"nameddest\"));\n }\n } else {\n // Named (or explicit) destination.\n dest = unescape(hash);\n try {\n dest = JSON.parse(dest);\n\n if (!Array.isArray(dest)) {\n // Avoid incorrectly rejecting a valid named destination, such as\n // e.g. \"4.3\" or \"true\", because `JSON.parse` converted its type.\n dest = dest.toString();\n }\n } catch (ex) {}\n\n if (\n typeof dest === \"string\" ||\n PDFLinkService.#isValidExplicitDestination(dest)\n ) {\n this.goToDestination(dest);\n return;\n }\n console.error(\n `PDFLinkService.setHash: \"${unescape(\n hash\n )}\" is not a valid destination.`\n );\n }\n }\n\n /**\n * @param {string} action\n */\n executeNamedAction(action) {\n // See PDF reference, table 8.45 - Named action\n switch (action) {\n case \"GoBack\":\n this.pdfHistory?.back();\n break;\n\n case \"GoForward\":\n this.pdfHistory?.forward();\n break;\n\n case \"NextPage\":\n this.pdfViewer.nextPage();\n break;\n\n case \"PrevPage\":\n this.pdfViewer.previousPage();\n break;\n\n case \"LastPage\":\n this.page = this.pagesCount;\n break;\n\n case \"FirstPage\":\n this.page = 1;\n break;\n\n default:\n break; // No action according to spec\n }\n\n this.eventBus.dispatch(\"namedaction\", {\n source: this,\n action,\n });\n }\n\n /**\n * @param {Object} action\n */\n async executeSetOCGState(action) {\n const pdfDocument = this.pdfDocument;\n const optionalContentConfig = await this.pdfViewer\n .optionalContentConfigPromise;\n\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the optional content resolved.\n }\n let operator;\n\n for (const elem of action.state) {\n switch (elem) {\n case \"ON\":\n case \"OFF\":\n case \"Toggle\":\n operator = elem;\n continue;\n }\n switch (operator) {\n case \"ON\":\n optionalContentConfig.setVisibility(elem, true);\n break;\n case \"OFF\":\n optionalContentConfig.setVisibility(elem, false);\n break;\n case \"Toggle\":\n const group = optionalContentConfig.getGroup(elem);\n if (group) {\n optionalContentConfig.setVisibility(elem, !group.visible);\n }\n break;\n }\n }\n\n this.pdfViewer.optionalContentConfigPromise = Promise.resolve(\n optionalContentConfig\n );\n }\n\n /**\n * @param {number} pageNum - page number.\n * @param {Object} pageRef - reference to the page.\n */\n cachePageRef(pageNum, pageRef) {\n if (!pageRef) {\n return;\n }\n const refStr =\n pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`;\n this.#pagesRefCache.set(refStr, pageNum);\n }\n\n /**\n * @ignore\n */\n _cachedPageNumber(pageRef) {\n if (!pageRef) {\n return null;\n }\n const refStr =\n pageRef.gen === 0 ? `${pageRef.num}R` : `${pageRef.num}R${pageRef.gen}`;\n return this.#pagesRefCache.get(refStr) || null;\n }\n\n static #isValidExplicitDestination(dest) {\n if (!Array.isArray(dest)) {\n return false;\n }\n const destLength = dest.length;\n if (destLength < 2) {\n return false;\n }\n const page = dest[0];\n if (\n !(\n typeof page === \"object\" &&\n Number.isInteger(page.num) &&\n Number.isInteger(page.gen)\n ) &&\n !(Number.isInteger(page) && page >= 0)\n ) {\n return false;\n }\n const zoom = dest[1];\n if (!(typeof zoom === \"object\" && typeof zoom.name === \"string\")) {\n return false;\n }\n let allowNull = true;\n switch (zoom.name) {\n case \"XYZ\":\n if (destLength !== 5) {\n return false;\n }\n break;\n case \"Fit\":\n case \"FitB\":\n return destLength === 2;\n case \"FitH\":\n case \"FitBH\":\n case \"FitV\":\n case \"FitBV\":\n if (destLength !== 3) {\n return false;\n }\n break;\n case \"FitR\":\n if (destLength !== 6) {\n return false;\n }\n allowNull = false;\n break;\n default:\n return false;\n }\n for (let i = 2; i < destLength; i++) {\n const param = dest[i];\n if (!(typeof param === \"number\" || (allowNull && param === null))) {\n return false;\n }\n }\n return true;\n }\n}\n\n/**\n * @implements {IPDFLinkService}\n */\nclass SimpleLinkService {\n constructor() {\n this.externalLinkEnabled = true;\n }\n\n /**\n * @type {number}\n */\n get pagesCount() {\n return 0;\n }\n\n /**\n * @type {number}\n */\n get page() {\n return 0;\n }\n\n /**\n * @param {number} value\n */\n set page(value) {}\n\n /**\n * @type {number}\n */\n get rotation() {\n return 0;\n }\n\n /**\n * @param {number} value\n */\n set rotation(value) {}\n\n /**\n * @type {boolean}\n */\n get isInPresentationMode() {\n return false;\n }\n\n /**\n * @param {string|Array} dest - The named, or explicit, PDF destination.\n */\n async goToDestination(dest) {}\n\n /**\n * @param {number|string} val - The page number, or page label.\n */\n goToPage(val) {}\n\n /**\n * @param {HTMLAnchorElement} link\n * @param {string} url\n * @param {boolean} [newWindow]\n */\n addLinkAttributes(link, url, newWindow = false) {\n addLinkAttributes(link, { url, enabled: this.externalLinkEnabled });\n }\n\n /**\n * @param dest - The PDF destination object.\n * @returns {string} The hyperlink to the PDF object.\n */\n getDestinationHash(dest) {\n return \"#\";\n }\n\n /**\n * @param hash - The PDF parameters/hash.\n * @returns {string} The hyperlink to the PDF object.\n */\n getAnchorUrl(hash) {\n return \"#\";\n }\n\n /**\n * @param {string} hash\n */\n setHash(hash) {}\n\n /**\n * @param {string} action\n */\n executeNamedAction(action) {}\n\n /**\n * @param {Object} action\n */\n executeSetOCGState(action) {}\n\n /**\n * @param {number} pageNum - page number.\n * @param {Object} pageRef - reference to the page.\n */\n cachePageRef(pageNum, pageRef) {}\n}\n\nexport { LinkTarget, PDFLinkService, SimpleLinkService };\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\nconst DEFAULT_SCALE_VALUE = \"auto\";\nconst DEFAULT_SCALE = 1.0;\nconst DEFAULT_SCALE_DELTA = 1.1;\nconst MIN_SCALE = 0.1;\nconst MAX_SCALE = 10.0;\nconst UNKNOWN_SCALE = 0;\nconst MAX_AUTO_SCALE = 1.25;\nconst SCROLLBAR_PADDING = 40;\nconst VERTICAL_PADDING = 5;\n\nconst RenderingStates = {\n INITIAL: 0,\n RUNNING: 1,\n PAUSED: 2,\n FINISHED: 3,\n};\n\nconst PresentationModeState = {\n UNKNOWN: 0,\n NORMAL: 1,\n CHANGING: 2,\n FULLSCREEN: 3,\n};\n\nconst SidebarView = {\n UNKNOWN: -1,\n NONE: 0,\n THUMBS: 1, // Default value.\n OUTLINE: 2,\n ATTACHMENTS: 3,\n LAYERS: 4,\n};\n\nconst TextLayerMode = {\n DISABLE: 0,\n ENABLE: 1,\n ENABLE_PERMISSIONS: 2,\n};\n\nconst ScrollMode = {\n UNKNOWN: -1,\n VERTICAL: 0, // Default value.\n HORIZONTAL: 1,\n WRAPPED: 2,\n PAGE: 3,\n};\n\nconst SpreadMode = {\n UNKNOWN: -1,\n NONE: 0, // Default value.\n ODD: 1,\n EVEN: 2,\n};\n\nconst CursorTool = {\n SELECT: 0, // The default value.\n HAND: 1,\n ZOOM: 2,\n};\n\n// Used by `PDFViewerApplication`, and by the API unit-tests.\nconst AutoPrintRegExp = /\\bprint\\s*\\(/;\n\n/**\n * Scale factors for the canvas, necessary with HiDPI displays.\n */\nclass OutputScale {\n constructor() {\n const pixelRatio = window.devicePixelRatio || 1;\n\n /**\n * @type {number} Horizontal scale.\n */\n this.sx = pixelRatio;\n\n /**\n * @type {number} Vertical scale.\n */\n this.sy = pixelRatio;\n }\n\n /**\n * @type {boolean} Returns `true` when scaling is required, `false` otherwise.\n */\n get scaled() {\n return this.sx !== 1 || this.sy !== 1;\n }\n}\n\n/**\n * Scrolls specified element into view of its parent.\n * @param {HTMLElement} element - The element to be visible.\n * @param {Object} [spot] - An object with optional top and left properties,\n * specifying the offset from the top left edge.\n * @param {number} [spot.left]\n * @param {number} [spot.top]\n * @param {boolean} [scrollMatches] - When scrolling search results into view,\n * ignore elements that either: Contains marked content identifiers,\n * or have the CSS-rule `overflow: hidden;` set. The default value is `false`.\n */\nfunction scrollIntoView(element, spot, scrollMatches = false) {\n // Assuming offsetParent is available (it's not available when viewer is in\n // hidden iframe or object). We have to scroll: if the offsetParent is not set\n // producing the error. See also animationStarted.\n let parent = element.offsetParent;\n if (!parent) {\n console.error(\"offsetParent is not set -- cannot scroll\");\n return;\n }\n let offsetY = element.offsetTop + element.clientTop;\n let offsetX = element.offsetLeft + element.clientLeft;\n while (\n (parent.clientHeight === parent.scrollHeight &&\n parent.clientWidth === parent.scrollWidth) ||\n (scrollMatches &&\n (parent.classList.contains(\"markedContent\") ||\n getComputedStyle(parent).overflow === \"hidden\"))\n ) {\n offsetY += parent.offsetTop;\n offsetX += parent.offsetLeft;\n\n parent = parent.offsetParent;\n if (!parent) {\n return; // no need to scroll\n }\n }\n if (spot) {\n if (spot.top !== undefined) {\n offsetY += spot.top;\n }\n if (spot.left !== undefined) {\n offsetX += spot.left;\n parent.scrollLeft = offsetX;\n }\n }\n parent.scrollTop = offsetY;\n}\n\n/**\n * Helper function to start monitoring the scroll event and converting them into\n * PDF.js friendly one: with scroll debounce and scroll direction.\n */\nfunction watchScroll(viewAreaElement, callback) {\n const debounceScroll = function (evt) {\n if (rAF) {\n return;\n }\n // schedule an invocation of scroll for next animation frame.\n rAF = window.requestAnimationFrame(function viewAreaElementScrolled() {\n rAF = null;\n\n const currentX = viewAreaElement.scrollLeft;\n const lastX = state.lastX;\n if (currentX !== lastX) {\n state.right = currentX > lastX;\n }\n state.lastX = currentX;\n const currentY = viewAreaElement.scrollTop;\n const lastY = state.lastY;\n if (currentY !== lastY) {\n state.down = currentY > lastY;\n }\n state.lastY = currentY;\n callback(state);\n });\n };\n\n const state = {\n right: true,\n down: true,\n lastX: viewAreaElement.scrollLeft,\n lastY: viewAreaElement.scrollTop,\n _eventHandler: debounceScroll,\n };\n\n let rAF = null;\n viewAreaElement.addEventListener(\"scroll\", debounceScroll, true);\n return state;\n}\n\n/**\n * Helper function to parse query string (e.g. ?param1=value&param2=...).\n * @param {string}\n * @returns {Map}\n */\nfunction parseQueryString(query) {\n const params = new Map();\n for (const [key, value] of new URLSearchParams(query)) {\n params.set(key.toLowerCase(), value);\n }\n return params;\n}\n\nconst InvisibleCharactersRegExp = /[\\x01-\\x1F]/g;\n\n/**\n * @param {string} str\n * @param {boolean} [replaceInvisible]\n */\nfunction removeNullCharacters(str, replaceInvisible = false) {\n if (typeof str !== \"string\") {\n console.error(`The argument must be a string.`);\n return str;\n }\n if (replaceInvisible) {\n str = str.replaceAll(InvisibleCharactersRegExp, \" \");\n }\n return str.replaceAll(\"\\x00\", \"\");\n}\n\n/**\n * Use binary search to find the index of the first item in a given array which\n * passes a given condition. The items are expected to be sorted in the sense\n * that if the condition is true for one item in the array, then it is also true\n * for all following items.\n *\n * @returns {number} Index of the first array element to pass the test,\n * or |items.length| if no such element exists.\n */\nfunction binarySearchFirstItem(items, condition, start = 0) {\n let minIndex = start;\n let maxIndex = items.length - 1;\n\n if (maxIndex < 0 || !condition(items[maxIndex])) {\n return items.length;\n }\n if (condition(items[minIndex])) {\n return minIndex;\n }\n\n while (minIndex < maxIndex) {\n const currentIndex = (minIndex + maxIndex) >> 1;\n const currentItem = items[currentIndex];\n if (condition(currentItem)) {\n maxIndex = currentIndex;\n } else {\n minIndex = currentIndex + 1;\n }\n }\n return minIndex; /* === maxIndex */\n}\n\n/**\n * Approximates float number as a fraction using Farey sequence (max order\n * of 8).\n * @param {number} x - Positive float number.\n * @returns {Array} Estimated fraction: the first array item is a numerator,\n * the second one is a denominator.\n */\nfunction approximateFraction(x) {\n // Fast paths for int numbers or their inversions.\n if (Math.floor(x) === x) {\n return [x, 1];\n }\n const xinv = 1 / x;\n const limit = 8;\n if (xinv > limit) {\n return [1, limit];\n } else if (Math.floor(xinv) === xinv) {\n return [1, xinv];\n }\n\n const x_ = x > 1 ? xinv : x;\n // a/b and c/d are neighbours in Farey sequence.\n let a = 0,\n b = 1,\n c = 1,\n d = 1;\n // Limiting search to order 8.\n while (true) {\n // Generating next term in sequence (order of q).\n const p = a + c,\n q = b + d;\n if (q > limit) {\n break;\n }\n if (x_ <= p / q) {\n c = p;\n d = q;\n } else {\n a = p;\n b = q;\n }\n }\n let result;\n // Select closest of the neighbours to x.\n if (x_ - a / b < c / d - x_) {\n result = x_ === x ? [a, b] : [b, a];\n } else {\n result = x_ === x ? [c, d] : [d, c];\n }\n return result;\n}\n\nfunction roundToDivide(x, div) {\n const r = x % div;\n return r === 0 ? x : Math.round(x - r + div);\n}\n\n/**\n * @typedef {Object} GetPageSizeInchesParameters\n * @property {number[]} view\n * @property {number} userUnit\n * @property {number} rotate\n */\n\n/**\n * @typedef {Object} PageSize\n * @property {number} width - In inches.\n * @property {number} height - In inches.\n */\n\n/**\n * Gets the size of the specified page, converted from PDF units to inches.\n * @param {GetPageSizeInchesParameters} params\n * @returns {PageSize}\n */\nfunction getPageSizeInches({ view, userUnit, rotate }) {\n const [x1, y1, x2, y2] = view;\n // We need to take the page rotation into account as well.\n const changeOrientation = rotate % 180 !== 0;\n\n const width = ((x2 - x1) / 72) * userUnit;\n const height = ((y2 - y1) / 72) * userUnit;\n\n return {\n width: changeOrientation ? height : width,\n height: changeOrientation ? width : height,\n };\n}\n\n/**\n * Helper function for getVisibleElements.\n *\n * @param {number} index - initial guess at the first visible element\n * @param {Array} views - array of pages, into which `index` is an index\n * @param {number} top - the top of the scroll pane\n * @returns {number} less than or equal to `index` that is definitely at or\n * before the first visible element in `views`, but not by too much. (Usually,\n * this will be the first element in the first partially visible row in\n * `views`, although sometimes it goes back one row further.)\n */\nfunction backtrackBeforeAllVisibleElements(index, views, top) {\n // binarySearchFirstItem's assumption is that the input is ordered, with only\n // one index where the conditions flips from false to true: [false ...,\n // true...]. With vertical scrolling and spreads, it is possible to have\n // [false ..., true, false, true ...]. With wrapped scrolling we can have a\n // similar sequence, with many more mixed true and false in the middle.\n //\n // So there is no guarantee that the binary search yields the index of the\n // first visible element. It could have been any of the other visible elements\n // that were preceded by a hidden element.\n\n // Of course, if either this element or the previous (hidden) element is also\n // the first element, there's nothing to worry about.\n if (index < 2) {\n return index;\n }\n\n // That aside, the possible cases are represented below.\n //\n // **** = fully hidden\n // A*B* = mix of partially visible and/or hidden pages\n // CDEF = fully visible\n //\n // (1) Binary search could have returned A, in which case we can stop.\n // (2) Binary search could also have returned B, in which case we need to\n // check the whole row.\n // (3) Binary search could also have returned C, in which case we need to\n // check the whole previous row.\n //\n // There's one other possibility:\n //\n // **** = fully hidden\n // ABCD = mix of fully and/or partially visible pages\n //\n // (4) Binary search could only have returned A.\n\n // Initially assume that we need to find the beginning of the current row\n // (case 1, 2, or 4), which means finding a page that is above the current\n // page's top. If the found page is partially visible, we're definitely not in\n // case 3, and this assumption is correct.\n let elt = views[index].div;\n let pageTop = elt.offsetTop + elt.clientTop;\n\n if (pageTop >= top) {\n // The found page is fully visible, so we're actually either in case 3 or 4,\n // and unfortunately we can't tell the difference between them without\n // scanning the entire previous row, so we just conservatively assume that\n // we do need to backtrack to that row. In both cases, the previous page is\n // in the previous row, so use its top instead.\n elt = views[index - 1].div;\n pageTop = elt.offsetTop + elt.clientTop;\n }\n\n // Now we backtrack to the first page that still has its bottom below\n // `pageTop`, which is the top of a page in the first visible row (unless\n // we're in case 4, in which case it's the row before that).\n // `index` is found by binary search, so the page at `index - 1` is\n // invisible and we can start looking for potentially visible pages from\n // `index - 2`. (However, if this loop terminates on its first iteration,\n // which is the case when pages are stacked vertically, `index` should remain\n // unchanged, so we use a distinct loop variable.)\n for (let i = index - 2; i >= 0; --i) {\n elt = views[i].div;\n if (elt.offsetTop + elt.clientTop + elt.clientHeight <= pageTop) {\n // We have reached the previous row, so stop now.\n // This loop is expected to terminate relatively quickly because the\n // number of pages per row is expected to be small.\n break;\n }\n index = i;\n }\n return index;\n}\n\n/**\n * @typedef {Object} GetVisibleElementsParameters\n * @property {HTMLElement} scrollEl - A container that can possibly scroll.\n * @property {Array} views - Objects with a `div` property that contains an\n * HTMLElement, which should all be descendants of `scrollEl` satisfying the\n * relevant layout assumptions.\n * @property {boolean} sortByVisibility - If `true`, the returned elements are\n * sorted in descending order of the percent of their padding box that is\n * visible. The default value is `false`.\n * @property {boolean} horizontal - If `true`, the elements are assumed to be\n * laid out horizontally instead of vertically. The default value is `false`.\n * @property {boolean} rtl - If `true`, the `scrollEl` container is assumed to\n * be in right-to-left mode. The default value is `false`.\n */\n\n/**\n * Generic helper to find out what elements are visible within a scroll pane.\n *\n * Well, pretty generic. There are some assumptions placed on the elements\n * referenced by `views`:\n * - If `horizontal`, no left of any earlier element is to the right of the\n * left of any later element.\n * - Otherwise, `views` can be split into contiguous rows where, within a row,\n * no top of any element is below the bottom of any other element, and\n * between rows, no bottom of any element in an earlier row is below the\n * top of any element in a later row.\n *\n * (Here, top, left, etc. all refer to the padding edge of the element in\n * question. For pages, that ends up being equivalent to the bounding box of the\n * rendering canvas. Earlier and later refer to index in `views`, not page\n * layout.)\n *\n * @param {GetVisibleElementsParameters}\n * @returns {Object} `{ first, last, views: [{ id, x, y, view, percent }] }`\n */\nfunction getVisibleElements({\n scrollEl,\n views,\n sortByVisibility = false,\n horizontal = false,\n rtl = false,\n}) {\n const top = scrollEl.scrollTop,\n bottom = top + scrollEl.clientHeight;\n const left = scrollEl.scrollLeft,\n right = left + scrollEl.clientWidth;\n\n // Throughout this \"generic\" function, comments will assume we're working with\n // PDF document pages, which is the most important and complex case. In this\n // case, the visible elements we're actually interested is the page canvas,\n // which is contained in a wrapper which adds no padding/border/margin, which\n // is itself contained in `view.div` which adds no padding (but does add a\n // border). So, as specified in this function's doc comment, this function\n // does all of its work on the padding edge of the provided views, starting at\n // offsetLeft/Top (which includes margin) and adding clientLeft/Top (which is\n // the border). Adding clientWidth/Height gets us the bottom-right corner of\n // the padding edge.\n function isElementBottomAfterViewTop(view) {\n const element = view.div;\n const elementBottom =\n element.offsetTop + element.clientTop + element.clientHeight;\n return elementBottom > top;\n }\n function isElementNextAfterViewHorizontally(view) {\n const element = view.div;\n const elementLeft = element.offsetLeft + element.clientLeft;\n const elementRight = elementLeft + element.clientWidth;\n return rtl ? elementLeft < right : elementRight > left;\n }\n\n const visible = [],\n ids = new Set(),\n numViews = views.length;\n let firstVisibleElementInd = binarySearchFirstItem(\n views,\n horizontal\n ? isElementNextAfterViewHorizontally\n : isElementBottomAfterViewTop\n );\n\n // Please note the return value of the `binarySearchFirstItem` function when\n // no valid element is found (hence the `firstVisibleElementInd` check below).\n if (\n firstVisibleElementInd > 0 &&\n firstVisibleElementInd < numViews &&\n !horizontal\n ) {\n // In wrapped scrolling (or vertical scrolling with spreads), with some page\n // sizes, isElementBottomAfterViewTop doesn't satisfy the binary search\n // condition: there can be pages with bottoms above the view top between\n // pages with bottoms below. This function detects and corrects that error;\n // see it for more comments.\n firstVisibleElementInd = backtrackBeforeAllVisibleElements(\n firstVisibleElementInd,\n views,\n top\n );\n }\n\n // lastEdge acts as a cutoff for us to stop looping, because we know all\n // subsequent pages will be hidden.\n //\n // When using wrapped scrolling or vertical scrolling with spreads, we can't\n // simply stop the first time we reach a page below the bottom of the view;\n // the tops of subsequent pages on the same row could still be visible. In\n // horizontal scrolling, we don't have that issue, so we can stop as soon as\n // we pass `right`, without needing the code below that handles the -1 case.\n let lastEdge = horizontal ? right : -1;\n\n for (let i = firstVisibleElementInd; i < numViews; i++) {\n const view = views[i],\n element = view.div;\n const currentWidth = element.offsetLeft + element.clientLeft;\n const currentHeight = element.offsetTop + element.clientTop;\n const viewWidth = element.clientWidth,\n viewHeight = element.clientHeight;\n const viewRight = currentWidth + viewWidth;\n const viewBottom = currentHeight + viewHeight;\n\n if (lastEdge === -1) {\n // As commented above, this is only needed in non-horizontal cases.\n // Setting lastEdge to the bottom of the first page that is partially\n // visible ensures that the next page fully below lastEdge is on the\n // next row, which has to be fully hidden along with all subsequent rows.\n if (viewBottom >= bottom) {\n lastEdge = viewBottom;\n }\n } else if ((horizontal ? currentWidth : currentHeight) > lastEdge) {\n break;\n }\n\n if (\n viewBottom <= top ||\n currentHeight >= bottom ||\n viewRight <= left ||\n currentWidth >= right\n ) {\n continue;\n }\n\n const hiddenHeight =\n Math.max(0, top - currentHeight) + Math.max(0, viewBottom - bottom);\n const hiddenWidth =\n Math.max(0, left - currentWidth) + Math.max(0, viewRight - right);\n\n const fractionHeight = (viewHeight - hiddenHeight) / viewHeight,\n fractionWidth = (viewWidth - hiddenWidth) / viewWidth;\n const percent = (fractionHeight * fractionWidth * 100) | 0;\n\n visible.push({\n id: view.id,\n x: currentWidth,\n y: currentHeight,\n view,\n percent,\n widthPercent: (fractionWidth * 100) | 0,\n });\n ids.add(view.id);\n }\n\n const first = visible[0],\n last = visible.at(-1);\n\n if (sortByVisibility) {\n visible.sort(function (a, b) {\n const pc = a.percent - b.percent;\n if (Math.abs(pc) > 0.001) {\n return -pc;\n }\n return a.id - b.id; // ensure stability\n });\n }\n return { first, last, views: visible, ids };\n}\n\n/**\n * Event handler to suppress context menu.\n */\nfunction noContextMenuHandler(evt) {\n evt.preventDefault();\n}\n\nfunction normalizeWheelEventDirection(evt) {\n let delta = Math.hypot(evt.deltaX, evt.deltaY);\n const angle = Math.atan2(evt.deltaY, evt.deltaX);\n if (-0.25 * Math.PI < angle && angle < 0.75 * Math.PI) {\n // All that is left-up oriented has to change the sign.\n delta = -delta;\n }\n return delta;\n}\n\nfunction normalizeWheelEventDelta(evt) {\n const deltaMode = evt.deltaMode; // Avoid being affected by bug 1392460.\n let delta = normalizeWheelEventDirection(evt);\n\n const MOUSE_PIXELS_PER_LINE = 30;\n const MOUSE_LINES_PER_PAGE = 30;\n\n // Converts delta to per-page units\n if (deltaMode === WheelEvent.DOM_DELTA_PIXEL) {\n delta /= MOUSE_PIXELS_PER_LINE * MOUSE_LINES_PER_PAGE;\n } else if (deltaMode === WheelEvent.DOM_DELTA_LINE) {\n delta /= MOUSE_LINES_PER_PAGE;\n }\n return delta;\n}\n\nfunction isValidRotation(angle) {\n return Number.isInteger(angle) && angle % 90 === 0;\n}\n\nfunction isValidScrollMode(mode) {\n return (\n Number.isInteger(mode) &&\n Object.values(ScrollMode).includes(mode) &&\n mode !== ScrollMode.UNKNOWN\n );\n}\n\nfunction isValidSpreadMode(mode) {\n return (\n Number.isInteger(mode) &&\n Object.values(SpreadMode).includes(mode) &&\n mode !== SpreadMode.UNKNOWN\n );\n}\n\nfunction isPortraitOrientation(size) {\n return size.width <= size.height;\n}\n\n/**\n * Promise that is resolved when DOM window becomes visible.\n */\nconst animationStarted = new Promise(function (resolve) {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof window === \"undefined\"\n ) {\n // Prevent \"ReferenceError: window is not defined\" errors when running the\n // unit-tests in Node.js environments.\n setTimeout(resolve, 20);\n return;\n }\n window.requestAnimationFrame(resolve);\n});\n\nconst docStyle =\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof document === \"undefined\"\n ? null\n : document.documentElement.style;\n\nfunction clamp(v, min, max) {\n return Math.min(Math.max(v, min), max);\n}\n\nclass ProgressBar {\n #classList = null;\n\n #disableAutoFetchTimeout = null;\n\n #percent = 0;\n\n #style = null;\n\n #visible = true;\n\n constructor(bar) {\n this.#classList = bar.classList;\n this.#style = bar.style;\n }\n\n get percent() {\n return this.#percent;\n }\n\n set percent(val) {\n this.#percent = clamp(val, 0, 100);\n\n if (isNaN(val)) {\n this.#classList.add(\"indeterminate\");\n return;\n }\n this.#classList.remove(\"indeterminate\");\n\n this.#style.setProperty(\"--progressBar-percent\", `${this.#percent}%`);\n }\n\n setWidth(viewer) {\n if (!viewer) {\n return;\n }\n const container = viewer.parentNode;\n const scrollbarWidth = container.offsetWidth - viewer.offsetWidth;\n if (scrollbarWidth > 0) {\n this.#style.setProperty(\n \"--progressBar-end-offset\",\n `${scrollbarWidth}px`\n );\n }\n }\n\n setDisableAutoFetch(delay = /* ms = */ 5000) {\n if (isNaN(this.#percent)) {\n return;\n }\n if (this.#disableAutoFetchTimeout) {\n clearTimeout(this.#disableAutoFetchTimeout);\n }\n this.show();\n\n this.#disableAutoFetchTimeout = setTimeout(() => {\n this.#disableAutoFetchTimeout = null;\n this.hide();\n }, delay);\n }\n\n hide() {\n if (!this.#visible) {\n return;\n }\n this.#visible = false;\n this.#classList.add(\"hidden\");\n }\n\n show() {\n if (this.#visible) {\n return;\n }\n this.#visible = true;\n this.#classList.remove(\"hidden\");\n }\n}\n\n/**\n * Get the active or focused element in current DOM.\n *\n * Recursively search for the truly active or focused element in case there are\n * shadow DOMs.\n *\n * @returns {Element} the truly active or focused element.\n */\nfunction getActiveOrFocusedElement() {\n let curRoot = document;\n let curActiveOrFocused =\n curRoot.activeElement || curRoot.querySelector(\":focus\");\n\n while (curActiveOrFocused?.shadowRoot) {\n curRoot = curActiveOrFocused.shadowRoot;\n curActiveOrFocused =\n curRoot.activeElement || curRoot.querySelector(\":focus\");\n }\n\n return curActiveOrFocused;\n}\n\n/**\n * Converts API PageLayout values to the format used by `BaseViewer`.\n * @param {string} mode - The API PageLayout value.\n * @returns {Object}\n */\nfunction apiPageLayoutToViewerModes(layout) {\n let scrollMode = ScrollMode.VERTICAL,\n spreadMode = SpreadMode.NONE;\n\n switch (layout) {\n case \"SinglePage\":\n scrollMode = ScrollMode.PAGE;\n break;\n case \"OneColumn\":\n break;\n case \"TwoPageLeft\":\n scrollMode = ScrollMode.PAGE;\n /* falls through */\n case \"TwoColumnLeft\":\n spreadMode = SpreadMode.ODD;\n break;\n case \"TwoPageRight\":\n scrollMode = ScrollMode.PAGE;\n /* falls through */\n case \"TwoColumnRight\":\n spreadMode = SpreadMode.EVEN;\n break;\n }\n return { scrollMode, spreadMode };\n}\n\n/**\n * Converts API PageMode values to the format used by `PDFSidebar`.\n * NOTE: There's also a \"FullScreen\" parameter which is not possible to support,\n * since the Fullscreen API used in browsers requires that entering\n * fullscreen mode only occurs as a result of a user-initiated event.\n * @param {string} mode - The API PageMode value.\n * @returns {number} A value from {SidebarView}.\n */\nfunction apiPageModeToSidebarView(mode) {\n switch (mode) {\n case \"UseNone\":\n return SidebarView.NONE;\n case \"UseThumbs\":\n return SidebarView.THUMBS;\n case \"UseOutlines\":\n return SidebarView.OUTLINE;\n case \"UseAttachments\":\n return SidebarView.ATTACHMENTS;\n case \"UseOC\":\n return SidebarView.LAYERS;\n }\n return SidebarView.NONE; // Default value.\n}\n\nfunction toggleCheckedBtn(button, toggle, view = null) {\n button.classList.toggle(\"toggled\", toggle);\n button.setAttribute(\"aria-checked\", toggle);\n\n view?.classList.toggle(\"hidden\", !toggle);\n}\n\nfunction toggleExpandedBtn(button, toggle, view = null) {\n button.classList.toggle(\"toggled\", toggle);\n button.setAttribute(\"aria-expanded\", toggle);\n\n view?.classList.toggle(\"hidden\", !toggle);\n}\n\nexport {\n animationStarted,\n apiPageLayoutToViewerModes,\n apiPageModeToSidebarView,\n approximateFraction,\n AutoPrintRegExp,\n backtrackBeforeAllVisibleElements, // only exported for testing\n binarySearchFirstItem,\n CursorTool,\n DEFAULT_SCALE,\n DEFAULT_SCALE_DELTA,\n DEFAULT_SCALE_VALUE,\n docStyle,\n getActiveOrFocusedElement,\n getPageSizeInches,\n getVisibleElements,\n isPortraitOrientation,\n isValidRotation,\n isValidScrollMode,\n isValidSpreadMode,\n MAX_AUTO_SCALE,\n MAX_SCALE,\n MIN_SCALE,\n noContextMenuHandler,\n normalizeWheelEventDelta,\n normalizeWheelEventDirection,\n OutputScale,\n parseQueryString,\n PresentationModeState,\n ProgressBar,\n removeNullCharacters,\n RenderingStates,\n roundToDivide,\n SCROLLBAR_PADDING,\n scrollIntoView,\n ScrollMode,\n SidebarView,\n SpreadMode,\n TextLayerMode,\n toggleCheckedBtn,\n toggleExpandedBtn,\n UNKNOWN_SCALE,\n VERTICAL_PADDING,\n watchScroll,\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\n/** @typedef {import(\"../src/display/api\").PDFPageProxy} PDFPageProxy */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"./interfaces\").IDownloadManager} IDownloadManager */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./textaccessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n\nimport { AnnotationLayer } from \"pdfjs-lib\";\nimport { NullL10n } from \"./l10n_utils.js\";\nimport { PresentationModeState } from \"./ui_utils.js\";\n\n/**\n * @typedef {Object} AnnotationLayerBuilderOptions\n * @property {HTMLDivElement} pageDiv\n * @property {PDFPageProxy} pdfPage\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 {IPDFLinkService} linkService\n * @property {IDownloadManager} downloadManager\n * @property {IL10n} l10n - Localization service.\n * @property {boolean} [enableScripting]\n * @property {Promise<boolean>} [hasJSActionsPromise]\n * @property {Promise<Object<string, Array<Object>> | null>}\n * [fieldObjectsPromise]\n * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap]\n * @property {TextAccessibilityManager} [accessibilityManager]\n */\n\nclass AnnotationLayerBuilder {\n #numAnnotations = 0;\n\n #onPresentationModeChanged = null;\n\n /**\n * @param {AnnotationLayerBuilderOptions} options\n */\n constructor({\n pageDiv,\n pdfPage,\n linkService,\n downloadManager,\n annotationStorage = null,\n imageResourcesPath = \"\",\n renderForms = true,\n l10n = NullL10n,\n enableScripting = false,\n hasJSActionsPromise = null,\n fieldObjectsPromise = null,\n annotationCanvasMap = null,\n accessibilityManager = null,\n }) {\n this.pageDiv = pageDiv;\n this.pdfPage = pdfPage;\n this.linkService = linkService;\n this.downloadManager = downloadManager;\n this.imageResourcesPath = imageResourcesPath;\n this.renderForms = renderForms;\n this.l10n = l10n;\n this.annotationStorage = annotationStorage;\n this.enableScripting = enableScripting;\n this._hasJSActionsPromise = hasJSActionsPromise || Promise.resolve(false);\n this._fieldObjectsPromise = fieldObjectsPromise || Promise.resolve(null);\n this._annotationCanvasMap = annotationCanvasMap;\n this._accessibilityManager = accessibilityManager;\n\n this.div = null;\n this._cancelled = false;\n this._eventBus = linkService.eventBus;\n }\n\n /**\n * @param {PageViewport} viewport\n * @param {string} intent (default value is 'display')\n * @returns {Promise<void>} A promise that is resolved when rendering of the\n * annotations is complete.\n */\n async render(viewport, intent = \"display\") {\n if (this.div) {\n if (this._cancelled || this.#numAnnotations === 0) {\n return;\n }\n // If an annotationLayer already exists, refresh its children's\n // transformation matrices.\n AnnotationLayer.update({\n viewport: viewport.clone({ dontFlip: true }),\n div: this.div,\n annotationCanvasMap: this._annotationCanvasMap,\n });\n return;\n }\n\n const [annotations, hasJSActions, fieldObjects] = await Promise.all([\n this.pdfPage.getAnnotations({ intent }),\n this._hasJSActionsPromise,\n this._fieldObjectsPromise,\n ]);\n if (this._cancelled) {\n return;\n }\n this.#numAnnotations = annotations.length;\n\n // Create an annotation layer div and render the annotations\n // if there is at least one annotation.\n this.div = document.createElement(\"div\");\n this.div.className = \"annotationLayer\";\n this.pageDiv.append(this.div);\n\n if (this.#numAnnotations === 0) {\n this.hide();\n return;\n }\n AnnotationLayer.render({\n viewport: viewport.clone({ dontFlip: true }),\n div: this.div,\n annotations,\n page: this.pdfPage,\n imageResourcesPath: this.imageResourcesPath,\n renderForms: this.renderForms,\n linkService: this.linkService,\n downloadManager: this.downloadManager,\n annotationStorage: this.annotationStorage,\n enableScripting: this.enableScripting,\n hasJSActions,\n fieldObjects,\n annotationCanvasMap: this._annotationCanvasMap,\n accessibilityManager: this._accessibilityManager,\n });\n this.l10n.translate(this.div);\n\n // Ensure that interactive form elements in the annotationLayer are\n // disabled while PresentationMode is active (see issue 12232).\n if (this.linkService.isInPresentationMode) {\n this.#updatePresentationModeState(PresentationModeState.FULLSCREEN);\n }\n if (!this.#onPresentationModeChanged) {\n this.#onPresentationModeChanged = evt => {\n this.#updatePresentationModeState(evt.state);\n };\n this._eventBus?._on(\n \"presentationmodechanged\",\n this.#onPresentationModeChanged\n );\n }\n }\n\n cancel() {\n this._cancelled = true;\n\n if (this.#onPresentationModeChanged) {\n this._eventBus?._off(\n \"presentationmodechanged\",\n this.#onPresentationModeChanged\n );\n this.#onPresentationModeChanged = null;\n }\n }\n\n hide() {\n if (!this.div) {\n return;\n }\n this.div.hidden = true;\n }\n\n #updatePresentationModeState(state) {\n if (!this.div) {\n return;\n }\n let disableFormElements = false;\n\n switch (state) {\n case PresentationModeState.FULLSCREEN:\n disableFormElements = true;\n break;\n case PresentationModeState.NORMAL:\n break;\n default:\n return;\n }\n for (const section of this.div.childNodes) {\n if (section.hasAttribute(\"data-internal-link\")) {\n continue;\n }\n section.inert = disableFormElements;\n }\n }\n}\n\nexport { AnnotationLayerBuilder };\n","/* Copyright 2016 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 module, __non_webpack_require__ */\n\n\"use strict\";\n\nlet pdfjsLib;\nif (typeof window !== \"undefined\" && window[\"pdfjs-dist/build/pdf\"]) {\n pdfjsLib = window[\"pdfjs-dist/build/pdf\"];\n} else {\n pdfjsLib = __non_webpack_require__(\"../build/pdf.js\");\n}\nmodule.exports = pdfjsLib;\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/**\n * A subset of the l10n strings in the `l10n/en-US/viewer.properties` file.\n */\nconst DEFAULT_L10N_STRINGS = {\n of_pages: \"of {{pagesCount}}\",\n page_of_pages: \"({{pageNumber}} of {{pagesCount}})\",\n\n document_properties_kb: \"{{size_kb}} KB ({{size_b}} bytes)\",\n document_properties_mb: \"{{size_mb}} MB ({{size_b}} bytes)\",\n document_properties_date_string: \"{{date}}, {{time}}\",\n document_properties_page_size_unit_inches: \"in\",\n document_properties_page_size_unit_millimeters: \"mm\",\n document_properties_page_size_orientation_portrait: \"portrait\",\n document_properties_page_size_orientation_landscape: \"landscape\",\n document_properties_page_size_name_a3: \"A3\",\n document_properties_page_size_name_a4: \"A4\",\n document_properties_page_size_name_letter: \"Letter\",\n document_properties_page_size_name_legal: \"Legal\",\n document_properties_page_size_dimension_string:\n \"{{width}} × {{height}} {{unit}} ({{orientation}})\",\n document_properties_page_size_dimension_name_string:\n \"{{width}} × {{height}} {{unit}} ({{name}}, {{orientation}})\",\n document_properties_linearized_yes: \"Yes\",\n document_properties_linearized_no: \"No\",\n\n additional_layers: \"Additional Layers\",\n page_landmark: \"Page {{page}}\",\n thumb_page_title: \"Page {{page}}\",\n thumb_page_canvas: \"Thumbnail of Page {{page}}\",\n\n find_reached_top: \"Reached top of document, continued from bottom\",\n find_reached_bottom: \"Reached end of document, continued from top\",\n \"find_match_count[one]\": \"{{current}} of {{total}} match\",\n \"find_match_count[other]\": \"{{current}} of {{total}} matches\",\n \"find_match_count_limit[one]\": \"More than {{limit}} match\",\n \"find_match_count_limit[other]\": \"More than {{limit}} matches\",\n find_not_found: \"Phrase not found\",\n\n page_scale_width: \"Page Width\",\n page_scale_fit: \"Page Fit\",\n page_scale_auto: \"Automatic Zoom\",\n page_scale_actual: \"Actual Size\",\n page_scale_percent: \"{{scale}}%\",\n\n loading_error: \"An error occurred while loading the PDF.\",\n invalid_file_error: \"Invalid or corrupted PDF file.\",\n missing_file_error: \"Missing PDF file.\",\n unexpected_response_error: \"Unexpected server response.\",\n rendering_error: \"An error occurred while rendering the page.\",\n\n printing_not_supported:\n \"Warning: Printing is not fully supported by this browser.\",\n printing_not_ready: \"Warning: The PDF is not fully loaded for printing.\",\n web_fonts_disabled:\n \"Web fonts are disabled: unable to use embedded PDF fonts.\",\n\n free_text2_default_content: \"Start typing…\",\n editor_free_text2_aria_label: \"Text Editor\",\n editor_ink2_aria_label: \"Draw Editor\",\n editor_ink_canvas_aria_label: \"User-created image\",\n};\nif (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n DEFAULT_L10N_STRINGS.print_progress_percent = \"{{progress}}%\";\n}\n\nfunction getL10nFallback(key, args) {\n switch (key) {\n case \"find_match_count\":\n key = `find_match_count[${args.total === 1 ? \"one\" : \"other\"}]`;\n break;\n case \"find_match_count_limit\":\n key = `find_match_count_limit[${args.limit === 1 ? \"one\" : \"other\"}]`;\n break;\n }\n return DEFAULT_L10N_STRINGS[key] || \"\";\n}\n\nconst PARTIAL_LANG_CODES = {\n en: \"en-US\",\n es: \"es-ES\",\n fy: \"fy-NL\",\n ga: \"ga-IE\",\n gu: \"gu-IN\",\n hi: \"hi-IN\",\n hy: \"hy-AM\",\n nb: \"nb-NO\",\n ne: \"ne-NP\",\n nn: \"nn-NO\",\n pa: \"pa-IN\",\n pt: \"pt-PT\",\n sv: \"sv-SE\",\n zh: \"zh-CN\",\n};\n\n// Try to support \"incompletely\" specified language codes (see issue 13689).\nfunction fixupLangCode(langCode) {\n return PARTIAL_LANG_CODES[langCode?.toLowerCase()] || langCode;\n}\n\n// Replaces {{arguments}} with their values.\nfunction formatL10nValue(text, args) {\n if (!args) {\n return text;\n }\n return text.replaceAll(/\\{\\{\\s*(\\w+)\\s*\\}\\}/g, (all, name) => {\n return name in args ? args[name] : \"{{\" + name + \"}}\";\n });\n}\n\n/**\n * No-op implementation of the localization service.\n * @implements {IL10n}\n */\nconst NullL10n = {\n async getLanguage() {\n return \"en-us\";\n },\n\n async getDirection() {\n return \"ltr\";\n },\n\n async get(key, args = null, fallback = getL10nFallback(key, args)) {\n return formatL10nValue(fallback, args);\n },\n\n async translate(element) {},\n};\n\nexport { fixupLangCode, getL10nFallback, NullL10n };\n","/* Copyright 2013 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\").IDownloadManager} IDownloadManager */\n\nimport { createValidAbsoluteUrl, isPdfFile } from \"pdfjs-lib\";\n\nif (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"CHROME || GENERIC\")) {\n throw new Error(\n 'Module \"pdfjs-web/download_manager\" shall not be used ' +\n \"outside CHROME and GENERIC builds.\"\n );\n}\n\nfunction download(blobUrl, filename) {\n const a = document.createElement(\"a\");\n if (!a.click) {\n throw new Error('DownloadManager: \"a.click()\" is not supported.');\n }\n a.href = blobUrl;\n a.target = \"_parent\";\n // Use a.download if available. This increases the likelihood that\n // the file is downloaded instead of opened by another PDF plugin.\n if (\"download\" in a) {\n a.download = filename;\n }\n // <a> must be in the document for recent Firefox versions,\n // otherwise .click() is ignored.\n (document.body || document.documentElement).append(a);\n a.click();\n a.remove();\n}\n\n/**\n * @implements {IDownloadManager}\n */\nclass DownloadManager {\n #openBlobUrls = new WeakMap();\n\n downloadUrl(url, filename, _options) {\n if (!createValidAbsoluteUrl(url, \"http://example.com\")) {\n console.error(`downloadUrl - not a valid URL: ${url}`);\n return; // restricted/invalid URL\n }\n download(url + \"#pdfjs.action=download\", filename);\n }\n\n downloadData(data, filename, contentType) {\n const blobUrl = URL.createObjectURL(\n new Blob([data], { type: contentType })\n );\n download(blobUrl, filename);\n }\n\n /**\n * @returns {boolean} Indicating if the data was opened.\n */\n openOrDownloadData(element, data, filename) {\n const isPdfData = isPdfFile(filename);\n const contentType = isPdfData ? \"application/pdf\" : \"\";\n\n if (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"COMPONENTS\")) &&\n isPdfData\n ) {\n let blobUrl = this.#openBlobUrls.get(element);\n if (!blobUrl) {\n blobUrl = URL.createObjectURL(new Blob([data], { type: contentType }));\n this.#openBlobUrls.set(element, blobUrl);\n }\n let viewerUrl;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n // The current URL is the viewer, let's use it and append the file.\n viewerUrl = \"?file=\" + encodeURIComponent(blobUrl + \"#\" + filename);\n } else if (PDFJSDev.test(\"CHROME\")) {\n // In the Chrome extension, the URL is rewritten using the history API\n // in viewer.js, so an absolute URL must be generated.\n viewerUrl =\n // eslint-disable-next-line no-undef\n chrome.runtime.getURL(\"/content/web/viewer.html\") +\n \"?file=\" +\n encodeURIComponent(blobUrl + \"#\" + filename);\n }\n\n try {\n window.open(viewerUrl);\n return true;\n } catch (ex) {\n console.error(`openOrDownloadData: ${ex}`);\n // Release the `blobUrl`, since opening it failed, and fallback to\n // downloading the PDF file.\n URL.revokeObjectURL(blobUrl);\n this.#openBlobUrls.delete(element);\n }\n }\n\n this.downloadData(data, filename, contentType);\n return false;\n }\n\n download(blob, url, filename, _options) {\n const blobUrl = URL.createObjectURL(blob);\n download(blobUrl, filename);\n }\n}\n\nexport { DownloadManager };\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\nconst WaitOnType = {\n EVENT: \"event\",\n TIMEOUT: \"timeout\",\n};\n\n/**\n * @typedef {Object} WaitOnEventOrTimeoutParameters\n * @property {Object} target - The event target, can for example be:\n * `window`, `document`, a DOM element, or an {EventBus} instance.\n * @property {string} name - The name of the event.\n * @property {number} delay - The delay, in milliseconds, after which the\n * timeout occurs (if the event wasn't already dispatched).\n */\n\n/**\n * Allows waiting for an event or a timeout, whichever occurs first.\n * Can be used to ensure that an action always occurs, even when an event\n * arrives late or not at all.\n *\n * @param {WaitOnEventOrTimeoutParameters}\n * @returns {Promise} A promise that is resolved with a {WaitOnType} value.\n */\nfunction waitOnEventOrTimeout({ target, name, delay = 0 }) {\n return new Promise(function (resolve, reject) {\n if (\n typeof target !== \"object\" ||\n !(name && typeof name === \"string\") ||\n !(Number.isInteger(delay) && delay >= 0)\n ) {\n throw new Error(\"waitOnEventOrTimeout - invalid parameters.\");\n }\n\n function handler(type) {\n if (target instanceof EventBus) {\n target._off(name, eventHandler);\n } else {\n target.removeEventListener(name, eventHandler);\n }\n\n if (timeout) {\n clearTimeout(timeout);\n }\n resolve(type);\n }\n\n const eventHandler = handler.bind(null, WaitOnType.EVENT);\n if (target instanceof EventBus) {\n target._on(name, eventHandler);\n } else {\n target.addEventListener(name, eventHandler);\n }\n\n const timeoutHandler = handler.bind(null, WaitOnType.TIMEOUT);\n const timeout = setTimeout(timeoutHandler, delay);\n });\n}\n\n/**\n * Simple event bus for an application. Listeners are attached using the `on`\n * and `off` methods. To raise an event, the `dispatch` method shall be used.\n */\nclass EventBus {\n #listeners = Object.create(null);\n\n /**\n * @param {string} eventName\n * @param {function} listener\n * @param {Object} [options]\n */\n on(eventName, listener, options = null) {\n this._on(eventName, listener, {\n external: true,\n once: options?.once,\n });\n }\n\n /**\n * @param {string} eventName\n * @param {function} listener\n * @param {Object} [options]\n */\n off(eventName, listener, options = null) {\n this._off(eventName, listener, {\n external: true,\n once: options?.once,\n });\n }\n\n /**\n * @param {string} eventName\n * @param {Object} data\n */\n dispatch(eventName, data) {\n const eventListeners = this.#listeners[eventName];\n if (!eventListeners || eventListeners.length === 0) {\n return;\n }\n let externalListeners;\n // Making copy of the listeners array in case if it will be modified\n // during dispatch.\n for (const { listener, external, once } of eventListeners.slice(0)) {\n if (once) {\n this._off(eventName, listener);\n }\n if (external) {\n (externalListeners ||= []).push(listener);\n continue;\n }\n listener(data);\n }\n // Dispatch any \"external\" listeners *after* the internal ones, to give the\n // viewer components time to handle events and update their state first.\n if (externalListeners) {\n for (const listener of externalListeners) {\n listener(data);\n }\n externalListeners = null;\n }\n }\n\n /**\n * @ignore\n */\n _on(eventName, listener, options = null) {\n const eventListeners = (this.#listeners[eventName] ||= []);\n eventListeners.push({\n listener,\n external: options?.external === true,\n once: options?.once === true,\n });\n }\n\n /**\n * @ignore\n */\n _off(eventName, listener, options = null) {\n const eventListeners = this.#listeners[eventName];\n if (!eventListeners) {\n return;\n }\n for (let i = 0, ii = eventListeners.length; i < ii; i++) {\n if (eventListeners[i].listener === listener) {\n eventListeners.splice(i, 1);\n return;\n }\n }\n }\n}\n\n/**\n * NOTE: Only used to support various PDF viewer tests in `mozilla-central`.\n */\nclass AutomationEventBus extends EventBus {\n dispatch(eventName, data) {\n if (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: AutomationEventBus.dispatch\");\n }\n super.dispatch(eventName, data);\n\n const detail = Object.create(null);\n if (data) {\n for (const key in data) {\n const value = data[key];\n if (key === \"source\") {\n if (value === window || value === document) {\n return; // No need to re-dispatch (already) global events.\n }\n continue; // Ignore the `source` property.\n }\n detail[key] = value;\n }\n }\n const event = new CustomEvent(eventName, {\n bubbles: true,\n cancelable: true,\n detail,\n });\n document.dispatchEvent(event);\n }\n}\n\nexport { AutomationEventBus, EventBus, waitOnEventOrTimeout, WaitOnType };\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\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n\nimport \"../external/webL10n/l10n.js\";\nimport { fixupLangCode, getL10nFallback } from \"./l10n_utils.js\";\n\nconst webL10n = document.webL10n;\n\n/**\n * @implements {IL10n}\n */\nclass GenericL10n {\n constructor(lang) {\n this._lang = lang;\n this._ready = new Promise((resolve, reject) => {\n webL10n.setLanguage(fixupLangCode(lang), () => {\n resolve(webL10n);\n });\n });\n }\n\n async getLanguage() {\n const l10n = await this._ready;\n return l10n.getLanguage();\n }\n\n async getDirection() {\n const l10n = await this._ready;\n return l10n.getDirection();\n }\n\n async get(key, args = null, fallback = getL10nFallback(key, args)) {\n const l10n = await this._ready;\n return l10n.get(key, args, fallback);\n }\n\n async translate(element) {\n const l10n = await this._ready;\n return l10n.translate(element);\n }\n}\n\nexport { GenericL10n };\n","/**\n * Copyright (c) 2011-2013 Fabien Cazenave, Mozilla.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a copy\n * of this software and associated documentation files (the \"Software\"), to\n * deal in the Software without restriction, including without limitation the\n * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or\n * sell copies of the Software, and to permit persons to whom the Software is\n * furnished to do so, subject to the following conditions:\n *\n * The above copyright notice and this permission notice shall be included in\n * all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\n * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\n * IN THE SOFTWARE.\n */\n/*\n Additional modifications for PDF.js project:\n - Disables language initialization on page loading.\n - Disables document translation on page loading.\n - Removes consoleWarn and consoleLog and use console.log/warn directly.\n - Removes window._ assignment.\n - Remove compatibility code for OldIE.\n - Replaces `String.prototype.substr()` with `String.prototype.substring()`.\n - Replaces one `Node.insertBefore()` with `Element.prepend()`.\n - Removes `fireL10nReadyEvent` since the \"localized\" event it dispatches\n is unused and may clash with an identically named event in the viewer.\n*/\n\n/*jshint browser: true, devel: true, es5: true, globalstrict: true */\n'use strict';\n\ndocument.webL10n = (function(window, document, undefined) {\n var gL10nData = {};\n var gTextData = '';\n var gTextProp = 'textContent';\n var gLanguage = '';\n var gMacros = {};\n var gReadyState = 'loading';\n\n\n /**\n * Synchronously loading l10n resources significantly minimizes flickering\n * from displaying the app with non-localized strings and then updating the\n * strings. Although this will block all script execution on this page, we\n * expect that the l10n resources are available locally on flash-storage.\n *\n * As synchronous XHR is generally considered as a bad idea, we're still\n * loading l10n resources asynchronously -- but we keep this in a setting,\n * just in case... and applications using this library should hide their\n * content until the `localized' event happens.\n */\n\n var gAsyncResourceLoading = true; // read-only\n\n\n /**\n * DOM helpers for the so-called \"HTML API\".\n *\n * These functions are written for modern browsers. For old versions of IE,\n * they're overridden in the 'startup' section at the end of this file.\n */\n\n function getL10nResourceLinks() {\n return document.querySelectorAll('link[type=\"application/l10n\"]');\n }\n\n function getL10nDictionary() {\n var script = document.querySelector('script[type=\"application/l10n\"]');\n // TODO: support multiple and external JSON dictionaries\n return script ? JSON.parse(script.innerHTML) : null;\n }\n\n function getTranslatableChildren(element) {\n return element ? element.querySelectorAll('*[data-l10n-id]') : [];\n }\n\n function getL10nAttributes(element) {\n if (!element)\n return {};\n\n var l10nId = element.getAttribute('data-l10n-id');\n var l10nArgs = element.getAttribute('data-l10n-args');\n var args = {};\n if (l10nArgs) {\n try {\n args = JSON.parse(l10nArgs);\n } catch (e) {\n console.warn('could not parse arguments for #' + l10nId);\n }\n }\n return { id: l10nId, args: args };\n }\n\n function xhrLoadText(url, onSuccess, onFailure) {\n onSuccess = onSuccess || function _onSuccess(data) {};\n onFailure = onFailure || function _onFailure() {};\n\n var xhr = new XMLHttpRequest();\n xhr.open('GET', url, gAsyncResourceLoading);\n if (xhr.overrideMimeType) {\n xhr.overrideMimeType('text/plain; charset=utf-8');\n }\n xhr.onreadystatechange = function() {\n if (xhr.readyState == 4) {\n if (xhr.status == 200 || xhr.status === 0) {\n onSuccess(xhr.responseText);\n } else {\n onFailure();\n }\n }\n };\n xhr.onerror = onFailure;\n xhr.ontimeout = onFailure;\n\n // in Firefox OS with the app:// protocol, trying to XHR a non-existing\n // URL will raise an exception here -- hence this ugly try...catch.\n try {\n xhr.send(null);\n } catch (e) {\n onFailure();\n }\n }\n\n\n /**\n * l10n resource parser:\n * - reads (async XHR) the l10n resource matching `lang';\n * - imports linked resources (synchronously) when specified;\n * - parses the text data (fills `gL10nData' and `gTextData');\n * - triggers success/failure callbacks when done.\n *\n * @param {string} href\n * URL of the l10n resource to parse.\n *\n * @param {string} lang\n * locale (language) to parse. Must be a lowercase string.\n *\n * @param {Function} successCallback\n * triggered when the l10n resource has been successfully parsed.\n *\n * @param {Function} failureCallback\n * triggered when the an error has occurred.\n *\n * @return {void}\n * uses the following global variables: gL10nData, gTextData, gTextProp.\n */\n\n function parseResource(href, lang, successCallback, failureCallback) {\n var baseURL = href.replace(/[^\\/]*$/, '') || './';\n\n // handle escaped characters (backslashes) in a string\n function evalString(text) {\n if (text.lastIndexOf('\\\\') < 0)\n return text;\n return text.replace(/\\\\\\\\/g, '\\\\')\n .replace(/\\\\n/g, '\\n')\n .replace(/\\\\r/g, '\\r')\n .replace(/\\\\t/g, '\\t')\n .replace(/\\\\b/g, '\\b')\n .replace(/\\\\f/g, '\\f')\n .replace(/\\\\{/g, '{')\n .replace(/\\\\}/g, '}')\n .replace(/\\\\\"/g, '\"')\n .replace(/\\\\'/g, \"'\");\n }\n\n // parse *.properties text data into an l10n dictionary\n // If gAsyncResourceLoading is false, then the callback will be called\n // synchronously. Otherwise it is called asynchronously.\n function parseProperties(text, parsedPropertiesCallback) {\n var dictionary = {};\n\n // token expressions\n var reBlank = /^\\s*|\\s*$/;\n var reComment = /^\\s*#|^\\s*$/;\n var reSection = /^\\s*\\[(.*)\\]\\s*$/;\n var reImport = /^\\s*@import\\s+url\\((.*)\\)\\s*$/i;\n var reSplit = /^([^=\\s]*)\\s*=\\s*(.+)$/; // TODO: escape EOLs with '\\'\n\n // parse the *.properties file into an associative array\n function parseRawLines(rawText, extendedSyntax, parsedRawLinesCallback) {\n var entries = rawText.replace(reBlank, '').split(/[\\r\\n]+/);\n var currentLang = '*';\n var genericLang = lang.split('-', 1)[0];\n var skipLang = false;\n var match = '';\n\n function nextEntry() {\n // Use infinite loop instead of recursion to avoid reaching the\n // maximum recursion limit for content with many lines.\n while (true) {\n if (!entries.length) {\n parsedRawLinesCallback();\n return;\n }\n var line = entries.shift();\n\n // comment or blank line?\n if (reComment.test(line))\n continue;\n\n // the extended syntax supports [lang] sections and @import rules\n if (extendedSyntax) {\n match = reSection.exec(line);\n if (match) { // section start?\n // RFC 4646, section 4.4, \"All comparisons MUST be performed\n // in a case-insensitive manner.\"\n\n currentLang = match[1].toLowerCase();\n skipLang = (currentLang !== '*') &&\n (currentLang !== lang) && (currentLang !== genericLang);\n continue;\n } else if (skipLang) {\n continue;\n }\n match = reImport.exec(line);\n if (match) { // @import rule?\n loadImport(baseURL + match[1], nextEntry);\n return;\n }\n }\n\n // key-value pair\n var tmp = line.match(reSplit);\n if (tmp && tmp.length == 3) {\n dictionary[tmp[1]] = evalString(tmp[2]);\n }\n }\n }\n nextEntry();\n }\n\n // import another *.properties file\n function loadImport(url, callback) {\n xhrLoadText(url, function(content) {\n parseRawLines(content, false, callback); // don't allow recursive imports\n }, function () {\n console.warn(url + ' not found.');\n callback();\n });\n }\n\n // fill the dictionary\n parseRawLines(text, true, function() {\n parsedPropertiesCallback(dictionary);\n });\n }\n\n // load and parse l10n data (warning: global variables are used here)\n xhrLoadText(href, function(response) {\n gTextData += response; // mostly for debug\n\n // parse *.properties text data into an l10n dictionary\n parseProperties(response, function(data) {\n\n // find attribute descriptions, if any\n for (var key in data) {\n var id, prop, index = key.lastIndexOf('.');\n if (index > 0) { // an attribute has been specified\n id = key.substring(0, index);\n prop = key.substring(index + 1);\n } else { // no attribute: assuming text content by default\n id = key;\n prop = gTextProp;\n }\n if (!gL10nData[id]) {\n gL10nData[id] = {};\n }\n gL10nData[id][prop] = data[key];\n }\n\n // trigger callback\n if (successCallback) {\n successCallback();\n }\n });\n }, failureCallback);\n }\n\n // load and parse all resources for the specified locale\n function loadLocale(lang, callback) {\n // RFC 4646, section 2.1 states that language tags have to be treated as\n // case-insensitive. Convert to lowercase for case-insensitive comparisons.\n if (lang) {\n lang = lang.toLowerCase();\n }\n\n callback = callback || function _callback() {};\n\n clear();\n gLanguage = lang;\n\n // check all <link type=\"application/l10n\" href=\"...\" /> nodes\n // and load the resource files\n var langLinks = getL10nResourceLinks();\n var langCount = langLinks.length;\n if (langCount === 0) {\n // we might have a pre-compiled dictionary instead\n var dict = getL10nDictionary();\n if (dict && dict.locales && dict.default_locale) {\n console.log('using the embedded JSON directory, early way out');\n gL10nData = dict.locales[lang];\n if (!gL10nData) {\n var defaultLocale = dict.default_locale.toLowerCase();\n for (var anyCaseLang in dict.locales) {\n anyCaseLang = anyCaseLang.toLowerCase();\n if (anyCaseLang === lang) {\n gL10nData = dict.locales[lang];\n break;\n } else if (anyCaseLang === defaultLocale) {\n gL10nData = dict.locales[defaultLocale];\n }\n }\n }\n callback();\n } else {\n console.log('no resource to load, early way out');\n }\n // early way out\n gReadyState = 'complete';\n return;\n }\n\n // start the callback when all resources are loaded\n var onResourceLoaded = null;\n var gResourceCount = 0;\n onResourceLoaded = function() {\n gResourceCount++;\n if (gResourceCount >= langCount) {\n callback();\n gReadyState = 'complete';\n }\n };\n\n // load all resource files\n function L10nResourceLink(link) {\n var href = link.href;\n // Note: If |gAsyncResourceLoading| is false, then the following callbacks\n // are synchronously called.\n this.load = function(lang, callback) {\n parseResource(href, lang, callback, function() {\n console.warn(href + ' not found.');\n // lang not found, used default resource instead\n console.warn('\"' + lang + '\" resource not found');\n gLanguage = '';\n // Resource not loaded, but we still need to call the callback.\n callback();\n });\n };\n }\n\n for (var i = 0; i < langCount; i++) {\n var resource = new L10nResourceLink(langLinks[i]);\n resource.load(lang, onResourceLoaded);\n }\n }\n\n // clear all l10n data\n function clear() {\n gL10nData = {};\n gTextData = '';\n gLanguage = '';\n // TODO: clear all non predefined macros.\n // There's no such macro /yet/ but we're planning to have some...\n }\n\n\n /**\n * Get rules for plural forms (shared with JetPack), see:\n * http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html\n * https://github.com/mozilla/addon-sdk/blob/master/python-lib/plural-rules-generator.p\n *\n * @param {string} lang\n * locale (language) used.\n *\n * @return {Function}\n * returns a function that gives the plural form name for a given integer:\n * var fun = getPluralRules('en');\n * fun(1) -> 'one'\n * fun(0) -> 'other'\n * fun(1000) -> 'other'.\n */\n\n function getPluralRules(lang) {\n var locales2rules = {\n 'af': 3,\n 'ak': 4,\n 'am': 4,\n 'ar': 1,\n 'asa': 3,\n 'az': 0,\n 'be': 11,\n 'bem': 3,\n 'bez': 3,\n 'bg': 3,\n 'bh': 4,\n 'bm': 0,\n 'bn': 3,\n 'bo': 0,\n 'br': 20,\n 'brx': 3,\n 'bs': 11,\n 'ca': 3,\n 'cgg': 3,\n 'chr': 3,\n 'cs': 12,\n 'cy': 17,\n 'da': 3,\n 'de': 3,\n 'dv': 3,\n 'dz': 0,\n 'ee': 3,\n 'el': 3,\n 'en': 3,\n 'eo': 3,\n 'es': 3,\n 'et': 3,\n 'eu': 3,\n 'fa': 0,\n 'ff': 5,\n 'fi': 3,\n 'fil': 4,\n 'fo': 3,\n 'fr': 5,\n 'fur': 3,\n 'fy': 3,\n 'ga': 8,\n 'gd': 24,\n 'gl': 3,\n 'gsw': 3,\n 'gu': 3,\n 'guw': 4,\n 'gv': 23,\n 'ha': 3,\n 'haw': 3,\n 'he': 2,\n 'hi': 4,\n 'hr': 11,\n 'hu': 0,\n 'id': 0,\n 'ig': 0,\n 'ii': 0,\n 'is': 3,\n 'it': 3,\n 'iu': 7,\n 'ja': 0,\n 'jmc': 3,\n 'jv': 0,\n 'ka': 0,\n 'kab': 5,\n 'kaj': 3,\n 'kcg': 3,\n 'kde': 0,\n 'kea': 0,\n 'kk': 3,\n 'kl': 3,\n 'km': 0,\n 'kn': 0,\n 'ko': 0,\n 'ksb': 3,\n 'ksh': 21,\n 'ku': 3,\n 'kw': 7,\n 'lag': 18,\n 'lb': 3,\n 'lg': 3,\n 'ln': 4,\n 'lo': 0,\n 'lt': 10,\n 'lv': 6,\n 'mas': 3,\n 'mg': 4,\n 'mk': 16,\n 'ml': 3,\n 'mn': 3,\n 'mo': 9,\n 'mr': 3,\n 'ms': 0,\n 'mt': 15,\n 'my': 0,\n 'nah': 3,\n 'naq': 7,\n 'nb': 3,\n 'nd': 3,\n 'ne': 3,\n 'nl': 3,\n 'nn': 3,\n 'no': 3,\n 'nr': 3,\n 'nso': 4,\n 'ny': 3,\n 'nyn': 3,\n 'om': 3,\n 'or': 3,\n 'pa': 3,\n 'pap': 3,\n 'pl': 13,\n 'ps': 3,\n 'pt': 3,\n 'rm': 3,\n 'ro': 9,\n 'rof': 3,\n 'ru': 11,\n 'rwk': 3,\n 'sah': 0,\n 'saq': 3,\n 'se': 7,\n 'seh': 3,\n 'ses': 0,\n 'sg': 0,\n 'sh': 11,\n 'shi': 19,\n 'sk': 12,\n 'sl': 14,\n 'sma': 7,\n 'smi': 7,\n 'smj': 7,\n 'smn': 7,\n 'sms': 7,\n 'sn': 3,\n 'so': 3,\n 'sq': 3,\n 'sr': 11,\n 'ss': 3,\n 'ssy': 3,\n 'st': 3,\n 'sv': 3,\n 'sw': 3,\n 'syr': 3,\n 'ta': 3,\n 'te': 3,\n 'teo': 3,\n 'th': 0,\n 'ti': 4,\n 'tig': 3,\n 'tk': 3,\n 'tl': 4,\n 'tn': 3,\n 'to': 0,\n 'tr': 0,\n 'ts': 3,\n 'tzm': 22,\n 'uk': 11,\n 'ur': 3,\n 've': 3,\n 'vi': 0,\n 'vun': 3,\n 'wa': 4,\n 'wae': 3,\n 'wo': 0,\n 'xh': 3,\n 'xog': 3,\n 'yo': 0,\n 'zh': 0,\n 'zu': 3\n };\n\n // utility functions for plural rules methods\n function isIn(n, list) {\n return list.indexOf(n) !== -1;\n }\n function isBetween(n, start, end) {\n return start <= n && n <= end;\n }\n\n // list of all plural rules methods:\n // map an integer to the plural form name to use\n var pluralRules = {\n '0': function(n) {\n return 'other';\n },\n '1': function(n) {\n if ((isBetween((n % 100), 3, 10)))\n return 'few';\n if (n === 0)\n return 'zero';\n if ((isBetween((n % 100), 11, 99)))\n return 'many';\n if (n == 2)\n return 'two';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '2': function(n) {\n if (n !== 0 && (n % 10) === 0)\n return 'many';\n if (n == 2)\n return 'two';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '3': function(n) {\n if (n == 1)\n return 'one';\n return 'other';\n },\n '4': function(n) {\n if ((isBetween(n, 0, 1)))\n return 'one';\n return 'other';\n },\n '5': function(n) {\n if ((isBetween(n, 0, 2)) && n != 2)\n return 'one';\n return 'other';\n },\n '6': function(n) {\n if (n === 0)\n return 'zero';\n if ((n % 10) == 1 && (n % 100) != 11)\n return 'one';\n return 'other';\n },\n '7': function(n) {\n if (n == 2)\n return 'two';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '8': function(n) {\n if ((isBetween(n, 3, 6)))\n return 'few';\n if ((isBetween(n, 7, 10)))\n return 'many';\n if (n == 2)\n return 'two';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '9': function(n) {\n if (n === 0 || n != 1 && (isBetween((n % 100), 1, 19)))\n return 'few';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '10': function(n) {\n if ((isBetween((n % 10), 2, 9)) && !(isBetween((n % 100), 11, 19)))\n return 'few';\n if ((n % 10) == 1 && !(isBetween((n % 100), 11, 19)))\n return 'one';\n return 'other';\n },\n '11': function(n) {\n if ((isBetween((n % 10), 2, 4)) && !(isBetween((n % 100), 12, 14)))\n return 'few';\n if ((n % 10) === 0 ||\n (isBetween((n % 10), 5, 9)) ||\n (isBetween((n % 100), 11, 14)))\n return 'many';\n if ((n % 10) == 1 && (n % 100) != 11)\n return 'one';\n return 'other';\n },\n '12': function(n) {\n if ((isBetween(n, 2, 4)))\n return 'few';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '13': function(n) {\n if ((isBetween((n % 10), 2, 4)) && !(isBetween((n % 100), 12, 14)))\n return 'few';\n if (n != 1 && (isBetween((n % 10), 0, 1)) ||\n (isBetween((n % 10), 5, 9)) ||\n (isBetween((n % 100), 12, 14)))\n return 'many';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '14': function(n) {\n if ((isBetween((n % 100), 3, 4)))\n return 'few';\n if ((n % 100) == 2)\n return 'two';\n if ((n % 100) == 1)\n return 'one';\n return 'other';\n },\n '15': function(n) {\n if (n === 0 || (isBetween((n % 100), 2, 10)))\n return 'few';\n if ((isBetween((n % 100), 11, 19)))\n return 'many';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '16': function(n) {\n if ((n % 10) == 1 && n != 11)\n return 'one';\n return 'other';\n },\n '17': function(n) {\n if (n == 3)\n return 'few';\n if (n === 0)\n return 'zero';\n if (n == 6)\n return 'many';\n if (n == 2)\n return 'two';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '18': function(n) {\n if (n === 0)\n return 'zero';\n if ((isBetween(n, 0, 2)) && n !== 0 && n != 2)\n return 'one';\n return 'other';\n },\n '19': function(n) {\n if ((isBetween(n, 2, 10)))\n return 'few';\n if ((isBetween(n, 0, 1)))\n return 'one';\n return 'other';\n },\n '20': function(n) {\n if ((isBetween((n % 10), 3, 4) || ((n % 10) == 9)) && !(\n isBetween((n % 100), 10, 19) ||\n isBetween((n % 100), 70, 79) ||\n isBetween((n % 100), 90, 99)\n ))\n return 'few';\n if ((n % 1000000) === 0 && n !== 0)\n return 'many';\n if ((n % 10) == 2 && !isIn((n % 100), [12, 72, 92]))\n return 'two';\n if ((n % 10) == 1 && !isIn((n % 100), [11, 71, 91]))\n return 'one';\n return 'other';\n },\n '21': function(n) {\n if (n === 0)\n return 'zero';\n if (n == 1)\n return 'one';\n return 'other';\n },\n '22': function(n) {\n if ((isBetween(n, 0, 1)) || (isBetween(n, 11, 99)))\n return 'one';\n return 'other';\n },\n '23': function(n) {\n if ((isBetween((n % 10), 1, 2)) || (n % 20) === 0)\n return 'one';\n return 'other';\n },\n '24': function(n) {\n if ((isBetween(n, 3, 10) || isBetween(n, 13, 19)))\n return 'few';\n if (isIn(n, [2, 12]))\n return 'two';\n if (isIn(n, [1, 11]))\n return 'one';\n return 'other';\n }\n };\n\n // return a function that gives the plural form name for a given integer\n var index = locales2rules[lang.replace(/-.*$/, '')];\n if (!(index in pluralRules)) {\n console.warn('plural form unknown for [' + lang + ']');\n return function() { return 'other'; };\n }\n return pluralRules[index];\n }\n\n // pre-defined 'plural' macro\n gMacros.plural = function(str, param, key, prop) {\n var n = parseFloat(param);\n if (isNaN(n))\n return str;\n\n // TODO: support other properties (l20n still doesn't...)\n if (prop != gTextProp)\n return str;\n\n // initialize _pluralRules\n if (!gMacros._pluralRules) {\n gMacros._pluralRules = getPluralRules(gLanguage);\n }\n var index = '[' + gMacros._pluralRules(n) + ']';\n\n // try to find a [zero|one|two] key if it's defined\n if (n === 0 && (key + '[zero]') in gL10nData) {\n str = gL10nData[key + '[zero]'][prop];\n } else if (n == 1 && (key + '[one]') in gL10nData) {\n str = gL10nData[key + '[one]'][prop];\n } else if (n == 2 && (key + '[two]') in gL10nData) {\n str = gL10nData[key + '[two]'][prop];\n } else if ((key + index) in gL10nData) {\n str = gL10nData[key + index][prop];\n } else if ((key + '[other]') in gL10nData) {\n str = gL10nData[key + '[other]'][prop];\n }\n\n return str;\n };\n\n\n /**\n * l10n dictionary functions\n */\n\n // fetch an l10n object, warn if not found, apply `args' if possible\n function getL10nData(key, args, fallback) {\n var data = gL10nData[key];\n if (!data) {\n console.warn('#' + key + ' is undefined.');\n if (!fallback) {\n return null;\n }\n data = fallback;\n }\n\n /** This is where l10n expressions should be processed.\n * The plan is to support C-style expressions from the l20n project;\n * until then, only two kinds of simple expressions are supported:\n * {[ index ]} and {{ arguments }}.\n */\n var rv = {};\n for (var prop in data) {\n var str = data[prop];\n str = substIndexes(str, args, key, prop);\n str = substArguments(str, args, key);\n rv[prop] = str;\n }\n return rv;\n }\n\n // replace {[macros]} with their values\n function substIndexes(str, args, key, prop) {\n var reIndex = /\\{\\[\\s*([a-zA-Z]+)\\(([a-zA-Z]+)\\)\\s*\\]\\}/;\n var reMatch = reIndex.exec(str);\n if (!reMatch || !reMatch.length)\n return str;\n\n // an index/macro has been found\n // Note: at the moment, only one parameter is supported\n var macroName = reMatch[1];\n var paramName = reMatch[2];\n var param;\n if (args && paramName in args) {\n param = args[paramName];\n } else if (paramName in gL10nData) {\n param = gL10nData[paramName];\n }\n\n // there's no macro parser yet: it has to be defined in gMacros\n if (macroName in gMacros) {\n var macro = gMacros[macroName];\n str = macro(str, param, key, prop);\n }\n return str;\n }\n\n // replace {{arguments}} with their values\n function substArguments(str, args, key) {\n var reArgs = /\\{\\{\\s*(.+?)\\s*\\}\\}/g;\n return str.replace(reArgs, function(matched_text, arg) {\n if (args && arg in args) {\n return args[arg];\n }\n if (arg in gL10nData) {\n return gL10nData[arg];\n }\n console.log('argument {{' + arg + '}} for #' + key + ' is undefined.');\n return matched_text;\n });\n }\n\n // translate an HTML element\n function translateElement(element) {\n var l10n = getL10nAttributes(element);\n if (!l10n.id)\n return;\n\n // get the related l10n object\n var data = getL10nData(l10n.id, l10n.args);\n if (!data) {\n console.warn('#' + l10n.id + ' is undefined.');\n return;\n }\n\n // translate element (TODO: security checks?)\n if (data[gTextProp]) { // XXX\n if (getChildElementCount(element) === 0) {\n element[gTextProp] = data[gTextProp];\n } else {\n // this element has element children: replace the content of the first\n // (non-empty) child textNode and clear other child textNodes\n var children = element.childNodes;\n var found = false;\n for (var i = 0, l = children.length; i < l; i++) {\n if (children[i].nodeType === 3 && /\\S/.test(children[i].nodeValue)) {\n if (found) {\n children[i].nodeValue = '';\n } else {\n children[i].nodeValue = data[gTextProp];\n found = true;\n }\n }\n }\n // if no (non-empty) textNode is found, insert a textNode before the\n // first element child.\n if (!found) {\n var textNode = document.createTextNode(data[gTextProp]);\n element.prepend(textNode);\n }\n }\n delete data[gTextProp];\n }\n\n for (var k in data) {\n element[k] = data[k];\n }\n }\n\n // webkit browsers don't currently support 'children' on SVG elements...\n function getChildElementCount(element) {\n if (element.children) {\n return element.children.length;\n }\n if (typeof element.childElementCount !== 'undefined') {\n return element.childElementCount;\n }\n var count = 0;\n for (var i = 0; i < element.childNodes.length; i++) {\n count += element.nodeType === 1 ? 1 : 0;\n }\n return count;\n }\n\n // translate an HTML subtree\n function translateFragment(element) {\n element = element || document.documentElement;\n\n // check all translatable children (= w/ a `data-l10n-id' attribute)\n var children = getTranslatableChildren(element);\n var elementCount = children.length;\n for (var i = 0; i < elementCount; i++) {\n translateElement(children[i]);\n }\n\n // translate element itself if necessary\n translateElement(element);\n }\n\n return {\n // get a localized string\n get: function(key, args, fallbackString) {\n var index = key.lastIndexOf('.');\n var prop = gTextProp;\n if (index > 0) { // An attribute has been specified\n prop = key.substring(index + 1);\n key = key.substring(0, index);\n }\n var fallback;\n if (fallbackString) {\n fallback = {};\n fallback[prop] = fallbackString;\n }\n var data = getL10nData(key, args, fallback);\n if (data && prop in data) {\n return data[prop];\n }\n return '{{' + key + '}}';\n },\n\n // debug\n getData: function() { return gL10nData; },\n getText: function() { return gTextData; },\n\n // get|set the document language\n getLanguage: function() { return gLanguage; },\n setLanguage: function(lang, callback) {\n loadLocale(lang, function() {\n if (callback)\n callback();\n });\n },\n\n // get the direction (ltr|rtl) of the current language\n getDirection: function() {\n // http://www.w3.org/International/questions/qa-scripts\n // Arabic, Hebrew, Farsi, Pashto, Urdu\n var rtlList = ['ar', 'he', 'fa', 'ps', 'ur'];\n var shortCode = gLanguage.split('-', 1)[0];\n return (rtlList.indexOf(shortCode) >= 0) ? 'rtl' : 'ltr';\n },\n\n // translate an element or document fragment\n translate: translateFragment,\n\n // this can be used to prevent race conditions\n getReadyState: function() { return gReadyState; },\n ready: function(callback) {\n if (!callback) {\n return;\n } else if (gReadyState == 'complete' || gReadyState == 'interactive') {\n window.setTimeout(function() {\n callback();\n });\n } else if (document.addEventListener) {\n document.addEventListener('localized', function once() {\n document.removeEventListener('localized', once);\n callback();\n });\n }\n }\n };\n}) (window, document);\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(\"../src/display/api\").PDFDocumentProxy} PDFDocumentProxy */\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { binarySearchFirstItem, scrollIntoView } from \"./ui_utils.js\";\nimport { getCharacterType, getNormalizeWithNFKC } from \"./pdf_find_utils.js\";\nimport { PromiseCapability } from \"pdfjs-lib\";\n\nconst FindState = {\n FOUND: 0,\n NOT_FOUND: 1,\n WRAPPED: 2,\n PENDING: 3,\n};\n\nconst FIND_TIMEOUT = 250; // ms\nconst MATCH_SCROLL_OFFSET_TOP = -50; // px\nconst MATCH_SCROLL_OFFSET_LEFT = -400; // px\n\nconst CHARACTERS_TO_NORMALIZE = {\n \"\\u2010\": \"-\", // Hyphen\n \"\\u2018\": \"'\", // Left single quotation mark\n \"\\u2019\": \"'\", // Right single quotation mark\n \"\\u201A\": \"'\", // Single low-9 quotation mark\n \"\\u201B\": \"'\", // Single high-reversed-9 quotation mark\n \"\\u201C\": '\"', // Left double quotation mark\n \"\\u201D\": '\"', // Right double quotation mark\n \"\\u201E\": '\"', // Double low-9 quotation mark\n \"\\u201F\": '\"', // Double high-reversed-9 quotation mark\n \"\\u00BC\": \"1/4\", // Vulgar fraction one quarter\n \"\\u00BD\": \"1/2\", // Vulgar fraction one half\n \"\\u00BE\": \"3/4\", // Vulgar fraction three quarters\n};\n\n// These diacritics aren't considered as combining diacritics\n// when searching in a document:\n// https://searchfox.org/mozilla-central/source/intl/unicharutil/util/is_combining_diacritic.py.\n// The combining class definitions can be found:\n// https://www.unicode.org/reports/tr44/#Canonical_Combining_Class_Values\n// Category 0 corresponds to [^\\p{Mn}].\nconst DIACRITICS_EXCEPTION = new Set([\n // UNICODE_COMBINING_CLASS_KANA_VOICING\n // https://www.compart.com/fr/unicode/combining/8\n 0x3099, 0x309a,\n // UNICODE_COMBINING_CLASS_VIRAMA (under 0xFFFF)\n // https://www.compart.com/fr/unicode/combining/9\n 0x094d, 0x09cd, 0x0a4d, 0x0acd, 0x0b4d, 0x0bcd, 0x0c4d, 0x0ccd, 0x0d3b,\n 0x0d3c, 0x0d4d, 0x0dca, 0x0e3a, 0x0eba, 0x0f84, 0x1039, 0x103a, 0x1714,\n 0x1734, 0x17d2, 0x1a60, 0x1b44, 0x1baa, 0x1bab, 0x1bf2, 0x1bf3, 0x2d7f,\n 0xa806, 0xa82c, 0xa8c4, 0xa953, 0xa9c0, 0xaaf6, 0xabed,\n // 91\n // https://www.compart.com/fr/unicode/combining/91\n 0x0c56,\n // 129\n // https://www.compart.com/fr/unicode/combining/129\n 0x0f71,\n // 130\n // https://www.compart.com/fr/unicode/combining/130\n 0x0f72, 0x0f7a, 0x0f7b, 0x0f7c, 0x0f7d, 0x0f80,\n // 132\n // https://www.compart.com/fr/unicode/combining/132\n 0x0f74,\n]);\nlet DIACRITICS_EXCEPTION_STR; // Lazily initialized, see below.\n\nconst DIACRITICS_REG_EXP = /\\p{M}+/gu;\nconst SPECIAL_CHARS_REG_EXP =\n /([.*+?^${}()|[\\]\\\\])|(\\p{P})|(\\s+)|(\\p{M})|(\\p{L})/gu;\nconst NOT_DIACRITIC_FROM_END_REG_EXP = /([^\\p{M}])\\p{M}*$/u;\nconst NOT_DIACRITIC_FROM_START_REG_EXP = /^\\p{M}*([^\\p{M}])/u;\n\n// The range [AC00-D7AF] corresponds to the Hangul syllables.\n// The few other chars are some CJK Compatibility Ideographs.\nconst SYLLABLES_REG_EXP = /[\\uAC00-\\uD7AF\\uFA6C\\uFACF-\\uFAD1\\uFAD5-\\uFAD7]+/g;\nconst SYLLABLES_LENGTHS = new Map();\n// When decomposed (in using NFD) the above syllables will start\n// with one of the chars in this regexp.\nconst FIRST_CHAR_SYLLABLES_REG_EXP =\n \"[\\\\u1100-\\\\u1112\\\\ud7a4-\\\\ud7af\\\\ud84a\\\\ud84c\\\\ud850\\\\ud854\\\\ud857\\\\ud85f]\";\n\nconst NFKC_CHARS_TO_NORMALIZE = new Map();\n\nlet noSyllablesRegExp = null;\nlet withSyllablesRegExp = null;\n\nfunction normalize(text) {\n // The diacritics in the text or in the query can be composed or not.\n // So we use a decomposed text using NFD (and the same for the query)\n // in order to be sure that diacritics are in the same order.\n\n // Collect syllables length and positions.\n const syllablePositions = [];\n let m;\n while ((m = SYLLABLES_REG_EXP.exec(text)) !== null) {\n let { index } = m;\n for (const char of m[0]) {\n let len = SYLLABLES_LENGTHS.get(char);\n if (!len) {\n len = char.normalize(\"NFD\").length;\n SYLLABLES_LENGTHS.set(char, len);\n }\n syllablePositions.push([len, index++]);\n }\n }\n\n let normalizationRegex;\n if (syllablePositions.length === 0 && noSyllablesRegExp) {\n normalizationRegex = noSyllablesRegExp;\n } else if (syllablePositions.length > 0 && withSyllablesRegExp) {\n normalizationRegex = withSyllablesRegExp;\n } else {\n // Compile the regular expression for text normalization once.\n const replace = Object.keys(CHARACTERS_TO_NORMALIZE).join(\"\");\n const toNormalizeWithNFKC = getNormalizeWithNFKC();\n\n // 3040-309F: Hiragana\n // 30A0-30FF: Katakana\n const CJK = \"(?:\\\\p{Ideographic}|[\\u3040-\\u30FF])\";\n const HKDiacritics = \"(?:\\u3099|\\u309A)\";\n const regexp = `([${replace}])|([${toNormalizeWithNFKC}])|(${HKDiacritics}\\\\n)|(\\\\p{M}+(?:-\\\\n)?)|(\\\\S-\\\\n)|(${CJK}\\\\n)|(\\\\n)`;\n\n if (syllablePositions.length === 0) {\n // Most of the syllables belong to Hangul so there are no need\n // to search for them in a non-Hangul document.\n // We use the \\0 in order to have the same number of groups.\n normalizationRegex = noSyllablesRegExp = new RegExp(\n regexp + \"|(\\\\u0000)\",\n \"gum\"\n );\n } else {\n normalizationRegex = withSyllablesRegExp = new RegExp(\n regexp + `|(${FIRST_CHAR_SYLLABLES_REG_EXP})`,\n \"gum\"\n );\n }\n }\n\n // The goal of this function is to normalize the string and\n // be able to get from an index in the new string the\n // corresponding index in the old string.\n // For example if we have: abCd12ef456gh where C is replaced by ccc\n // and numbers replaced by nothing (it's the case for diacritics), then\n // we'll obtain the normalized string: abcccdefgh.\n // So here the reverse map is: [0,1,2,2,2,3,6,7,11,12].\n\n // The goal is to obtain the array: [[0, 0], [3, -1], [4, -2],\n // [6, 0], [8, 3]].\n // which can be used like this:\n // - let say that i is the index in new string and j the index\n // the old string.\n // - if i is in [0; 3[ then j = i + 0\n // - if i is in [3; 4[ then j = i - 1\n // - if i is in [4; 6[ then j = i - 2\n // ...\n // Thanks to a binary search it's easy to know where is i and what's the\n // shift.\n // Let say that the last entry in the array is [x, s] and we have a\n // substitution at index y (old string) which will replace o chars by n chars.\n // Firstly, if o === n, then no need to add a new entry: the shift is\n // the same.\n // Secondly, if o < n, then we push the n - o elements:\n // [y - (s - 1), s - 1], [y - (s - 2), s - 2], ...\n // Thirdly, if o > n, then we push the element: [y - (s - n), o + s - n]\n\n // Collect diacritics length and positions.\n const rawDiacriticsPositions = [];\n while ((m = DIACRITICS_REG_EXP.exec(text)) !== null) {\n rawDiacriticsPositions.push([m[0].length, m.index]);\n }\n\n let normalized = text.normalize(\"NFD\");\n const positions = [[0, 0]];\n let rawDiacriticsIndex = 0;\n let syllableIndex = 0;\n let shift = 0;\n let shiftOrigin = 0;\n let eol = 0;\n let hasDiacritics = false;\n\n normalized = normalized.replace(\n normalizationRegex,\n (match, p1, p2, p3, p4, p5, p6, p7, p8, i) => {\n i -= shiftOrigin;\n if (p1) {\n // Maybe fractions or quotations mark...\n const replacement = CHARACTERS_TO_NORMALIZE[p1];\n const jj = replacement.length;\n for (let j = 1; j < jj; j++) {\n positions.push([i - shift + j, shift - j]);\n }\n shift -= jj - 1;\n return replacement;\n }\n\n if (p2) {\n // Use the NFKC representation to normalize the char.\n let replacement = NFKC_CHARS_TO_NORMALIZE.get(p2);\n if (!replacement) {\n replacement = p2.normalize(\"NFKC\");\n NFKC_CHARS_TO_NORMALIZE.set(p2, replacement);\n }\n const jj = replacement.length;\n for (let j = 1; j < jj; j++) {\n positions.push([i - shift + j, shift - j]);\n }\n shift -= jj - 1;\n return replacement;\n }\n\n if (p3) {\n // We've a Katakana-Hiragana diacritic followed by a \\n so don't replace\n // the \\n by a whitespace.\n hasDiacritics = true;\n\n // Diacritic.\n if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) {\n ++rawDiacriticsIndex;\n } else {\n // i is the position of the first diacritic\n // so (i - 1) is the position for the letter before.\n positions.push([i - 1 - shift + 1, shift - 1]);\n shift -= 1;\n shiftOrigin += 1;\n }\n\n // End-of-line.\n positions.push([i - shift + 1, shift]);\n shiftOrigin += 1;\n eol += 1;\n\n return p3.charAt(0);\n }\n\n if (p4) {\n const hasTrailingDashEOL = p4.endsWith(\"\\n\");\n const len = hasTrailingDashEOL ? p4.length - 2 : p4.length;\n\n // Diacritics.\n hasDiacritics = true;\n let jj = len;\n if (i + eol === rawDiacriticsPositions[rawDiacriticsIndex]?.[1]) {\n jj -= rawDiacriticsPositions[rawDiacriticsIndex][0];\n ++rawDiacriticsIndex;\n }\n\n for (let j = 1; j <= jj; j++) {\n // i is the position of the first diacritic\n // so (i - 1) is the position for the letter before.\n positions.push([i - 1 - shift + j, shift - j]);\n }\n shift -= jj;\n shiftOrigin += jj;\n\n if (hasTrailingDashEOL) {\n // Diacritics are followed by a -\\n.\n // See comments in `if (p5)` block.\n i += len - 1;\n positions.push([i - shift + 1, 1 + shift]);\n shift += 1;\n shiftOrigin += 1;\n eol += 1;\n return p4.slice(0, len);\n }\n\n return p4;\n }\n\n if (p5) {\n // \"X-\\n\" is removed because an hyphen at the end of a line\n // with not a space before is likely here to mark a break\n // in a word.\n // If X is encoded with UTF-32 then it can have a length greater than 1.\n // The \\n isn't in the original text so here y = i, n = X.len - 2 and\n // o = X.len - 1.\n const len = p5.length - 2;\n positions.push([i - shift + len, 1 + shift]);\n shift += 1;\n shiftOrigin += 1;\n eol += 1;\n return p5.slice(0, -2);\n }\n\n if (p6) {\n // An ideographic at the end of a line doesn't imply adding an extra\n // white space.\n // A CJK can be encoded in UTF-32, hence their length isn't always 1.\n const len = p6.length - 1;\n positions.push([i - shift + len, shift]);\n shiftOrigin += 1;\n eol += 1;\n return p6.slice(0, -1);\n }\n\n if (p7) {\n // eol is replaced by space: \"foo\\nbar\" is likely equivalent to\n // \"foo bar\".\n positions.push([i - shift + 1, shift - 1]);\n shift -= 1;\n shiftOrigin += 1;\n eol += 1;\n return \" \";\n }\n\n // p8\n if (i + eol === syllablePositions[syllableIndex]?.[1]) {\n // A syllable (1 char) is replaced with several chars (n) so\n // newCharsLen = n - 1.\n const newCharLen = syllablePositions[syllableIndex][0] - 1;\n ++syllableIndex;\n for (let j = 1; j <= newCharLen; j++) {\n positions.push([i - (shift - j), shift - j]);\n }\n shift -= newCharLen;\n shiftOrigin += newCharLen;\n }\n return p8;\n }\n );\n\n positions.push([normalized.length, shift]);\n\n return [normalized, positions, hasDiacritics];\n}\n\n// Determine the original, non-normalized, match index such that highlighting of\n// search results is correct in the `textLayer` for strings containing e.g. \"½\"\n// characters; essentially \"inverting\" the result of the `normalize` function.\nfunction getOriginalIndex(diffs, pos, len) {\n if (!diffs) {\n return [pos, len];\n }\n\n // First char in the new string.\n const start = pos;\n // Last char in the new string.\n const end = pos + len - 1;\n let i = binarySearchFirstItem(diffs, x => x[0] >= start);\n if (diffs[i][0] > start) {\n --i;\n }\n\n let j = binarySearchFirstItem(diffs, x => x[0] >= end, i);\n if (diffs[j][0] > end) {\n --j;\n }\n\n // First char in the old string.\n const oldStart = start + diffs[i][1];\n\n // Last char in the old string.\n const oldEnd = end + diffs[j][1];\n const oldLen = oldEnd + 1 - oldStart;\n\n return [oldStart, oldLen];\n}\n\n/**\n * @typedef {Object} PDFFindControllerOptions\n * @property {IPDFLinkService} linkService - The navigation/linking service.\n * @property {EventBus} eventBus - The application event bus.\n * @property {boolean} [updateMatchesCountOnProgress] - True if the matches\n * count must be updated on progress or only when the last page is reached.\n * The default value is `true`.\n */\n\n/**\n * Provides search functionality to find a given string in a PDF document.\n */\nclass PDFFindController {\n #state = null;\n\n #updateMatchesCountOnProgress = true;\n\n #visitedPagesCount = 0;\n\n /**\n * @param {PDFFindControllerOptions} options\n */\n constructor({ linkService, eventBus, updateMatchesCountOnProgress = true }) {\n this._linkService = linkService;\n this._eventBus = eventBus;\n this.#updateMatchesCountOnProgress = updateMatchesCountOnProgress;\n\n /**\n * Callback used to check if a `pageNumber` is currently visible.\n * @type {function}\n */\n this.onIsPageVisible = null;\n\n this.#reset();\n eventBus._on(\"find\", this.#onFind.bind(this));\n eventBus._on(\"findbarclose\", this.#onFindBarClose.bind(this));\n }\n\n get highlightMatches() {\n return this._highlightMatches;\n }\n\n get pageMatches() {\n return this._pageMatches;\n }\n\n get pageMatchesLength() {\n return this._pageMatchesLength;\n }\n\n get selected() {\n return this._selected;\n }\n\n get state() {\n return this.#state;\n }\n\n /**\n * Set a reference to the PDF document in order to search it.\n * Note that searching is not possible if this method is not called.\n *\n * @param {PDFDocumentProxy} pdfDocument - The PDF document to search.\n */\n setDocument(pdfDocument) {\n if (this._pdfDocument) {\n this.#reset();\n }\n if (!pdfDocument) {\n return;\n }\n this._pdfDocument = pdfDocument;\n this._firstPageCapability.resolve();\n }\n\n #onFind(state) {\n if (!state) {\n return;\n }\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n state.phraseSearch === false\n ) {\n console.error(\n \"The `phraseSearch`-parameter was removed, please provide \" +\n \"an Array of strings in the `query`-parameter instead.\"\n );\n if (typeof state.query === \"string\") {\n state.query = state.query.match(/\\S+/g);\n }\n }\n const pdfDocument = this._pdfDocument;\n const { type } = state;\n\n if (this.#state === null || this.#shouldDirtyMatch(state)) {\n this._dirtyMatch = true;\n }\n this.#state = state;\n if (type !== \"highlightallchange\") {\n this.#updateUIState(FindState.PENDING);\n }\n\n this._firstPageCapability.promise.then(() => {\n // If the document was closed before searching began, or if the search\n // operation was relevant for a previously opened document, do nothing.\n if (\n !this._pdfDocument ||\n (pdfDocument && this._pdfDocument !== pdfDocument)\n ) {\n return;\n }\n this.#extractText();\n\n const findbarClosed = !this._highlightMatches;\n const pendingTimeout = !!this._findTimeout;\n\n if (this._findTimeout) {\n clearTimeout(this._findTimeout);\n this._findTimeout = null;\n }\n if (!type) {\n // Trigger the find action with a small delay to avoid starting the\n // search when the user is still typing (saving resources).\n this._findTimeout = setTimeout(() => {\n this.#nextMatch();\n this._findTimeout = null;\n }, FIND_TIMEOUT);\n } else if (this._dirtyMatch) {\n // Immediately trigger searching for non-'find' operations, when the\n // current state needs to be reset and matches re-calculated.\n this.#nextMatch();\n } else if (type === \"again\") {\n this.#nextMatch();\n\n // When the findbar was previously closed, and `highlightAll` is set,\n // ensure that the matches on all active pages are highlighted again.\n if (findbarClosed && this.#state.highlightAll) {\n this.#updateAllPages();\n }\n } else if (type === \"highlightallchange\") {\n // If there was a pending search operation, synchronously trigger a new\n // search *first* to ensure that the correct matches are highlighted.\n if (pendingTimeout) {\n this.#nextMatch();\n } else {\n this._highlightMatches = true;\n }\n this.#updateAllPages(); // Update the highlighting on all active pages.\n } else {\n this.#nextMatch();\n }\n });\n }\n\n /**\n * @typedef {Object} PDFFindControllerScrollMatchIntoViewParams\n * @property {HTMLElement} element\n * @property {number} selectedLeft\n * @property {number} pageIndex\n * @property {number} matchIndex\n */\n\n /**\n * Scroll the current match into view.\n * @param {PDFFindControllerScrollMatchIntoViewParams}\n */\n scrollMatchIntoView({\n element = null,\n selectedLeft = 0,\n pageIndex = -1,\n matchIndex = -1,\n }) {\n if (!this._scrollMatches || !element) {\n return;\n } else if (matchIndex === -1 || matchIndex !== this._selected.matchIdx) {\n return;\n } else if (pageIndex === -1 || pageIndex !== this._selected.pageIdx) {\n return;\n }\n this._scrollMatches = false; // Ensure that scrolling only happens once.\n\n const spot = {\n top: MATCH_SCROLL_OFFSET_TOP,\n left: selectedLeft + MATCH_SCROLL_OFFSET_LEFT,\n };\n scrollIntoView(element, spot, /* scrollMatches = */ true);\n }\n\n #reset() {\n this._highlightMatches = false;\n this._scrollMatches = false;\n this._pdfDocument = null;\n this._pageMatches = [];\n this._pageMatchesLength = [];\n this.#visitedPagesCount = 0;\n this.#state = null;\n // Currently selected match.\n this._selected = {\n pageIdx: -1,\n matchIdx: -1,\n };\n // Where the find algorithm currently is in the document.\n this._offset = {\n pageIdx: null,\n matchIdx: null,\n wrapped: false,\n };\n this._extractTextPromises = [];\n this._pageContents = []; // Stores the normalized text for each page.\n this._pageDiffs = [];\n this._hasDiacritics = [];\n this._matchesCountTotal = 0;\n this._pagesToSearch = null;\n this._pendingFindMatches = new Set();\n this._resumePageIdx = null;\n this._dirtyMatch = false;\n clearTimeout(this._findTimeout);\n this._findTimeout = null;\n\n this._firstPageCapability = new PromiseCapability();\n }\n\n /**\n * @type {string|Array} The (current) normalized search query.\n */\n get #query() {\n const { query } = this.#state;\n if (typeof query === \"string\") {\n if (query !== this._rawQuery) {\n this._rawQuery = query;\n [this._normalizedQuery] = normalize(query);\n }\n return this._normalizedQuery;\n }\n // We don't bother caching the normalized search query in the Array-case,\n // since this code-path is *essentially* unused in the default viewer.\n return (query || []).filter(q => !!q).map(q => normalize(q)[0]);\n }\n\n #shouldDirtyMatch(state) {\n // When the search query changes, regardless of the actual search command\n // used, always re-calculate matches to avoid errors (fixes bug 1030622).\n const newQuery = state.query,\n prevQuery = this.#state.query;\n const newType = typeof newQuery,\n prevType = typeof prevQuery;\n\n if (newType !== prevType) {\n return true;\n }\n if (newType === \"string\") {\n if (newQuery !== prevQuery) {\n return true;\n }\n } else {\n // Array\n if (JSON.stringify(newQuery) !== JSON.stringify(prevQuery)) {\n return true;\n }\n }\n\n switch (state.type) {\n case \"again\":\n const pageNumber = this._selected.pageIdx + 1;\n const linkService = this._linkService;\n // Only treat a 'findagain' event as a new search operation when it's\n // *absolutely* certain that the currently selected match is no longer\n // visible, e.g. as a result of the user scrolling in the document.\n //\n // NOTE: If only a simple `this._linkService.page` check was used here,\n // there's a risk that consecutive 'findagain' operations could \"skip\"\n // over matches at the top/bottom of pages thus making them completely\n // inaccessible when there's multiple pages visible in the viewer.\n return (\n pageNumber >= 1 &&\n pageNumber <= linkService.pagesCount &&\n pageNumber !== linkService.page &&\n !(this.onIsPageVisible?.(pageNumber) ?? true)\n );\n case \"highlightallchange\":\n return false;\n }\n return true;\n }\n\n /**\n * Determine if the search query constitutes a \"whole word\", by comparing the\n * first/last character type with the preceding/following character type.\n */\n #isEntireWord(content, startIdx, length) {\n let match = content\n .slice(0, startIdx)\n .match(NOT_DIACRITIC_FROM_END_REG_EXP);\n if (match) {\n const first = content.charCodeAt(startIdx);\n const limit = match[1].charCodeAt(0);\n if (getCharacterType(first) === getCharacterType(limit)) {\n return false;\n }\n }\n\n match = content\n .slice(startIdx + length)\n .match(NOT_DIACRITIC_FROM_START_REG_EXP);\n if (match) {\n const last = content.charCodeAt(startIdx + length - 1);\n const limit = match[1].charCodeAt(0);\n if (getCharacterType(last) === getCharacterType(limit)) {\n return false;\n }\n }\n\n return true;\n }\n\n #calculateRegExpMatch(query, entireWord, pageIndex, pageContent) {\n const matches = (this._pageMatches[pageIndex] = []);\n const matchesLength = (this._pageMatchesLength[pageIndex] = []);\n if (!query) {\n // The query can be empty because some chars like diacritics could have\n // been stripped out.\n return;\n }\n const diffs = this._pageDiffs[pageIndex];\n let match;\n while ((match = query.exec(pageContent)) !== null) {\n if (\n entireWord &&\n !this.#isEntireWord(pageContent, match.index, match[0].length)\n ) {\n continue;\n }\n\n const [matchPos, matchLen] = getOriginalIndex(\n diffs,\n match.index,\n match[0].length\n );\n\n if (matchLen) {\n matches.push(matchPos);\n matchesLength.push(matchLen);\n }\n }\n }\n\n #convertToRegExpString(query, hasDiacritics) {\n const { matchDiacritics } = this.#state;\n let isUnicode = false;\n query = query.replaceAll(\n SPECIAL_CHARS_REG_EXP,\n (\n match,\n p1 /* to escape */,\n p2 /* punctuation */,\n p3 /* whitespaces */,\n p4 /* diacritics */,\n p5 /* letters */\n ) => {\n // We don't need to use a \\s for whitespaces since all the different\n // kind of whitespaces are replaced by a single \" \".\n\n if (p1) {\n // Escape characters like *+?... to not interfer with regexp syntax.\n return `[ ]*\\\\${p1}[ ]*`;\n }\n if (p2) {\n // Allow whitespaces around punctuation signs.\n return `[ ]*${p2}[ ]*`;\n }\n if (p3) {\n // Replace spaces by \\s+ to be sure to match any spaces.\n return \"[ ]+\";\n }\n if (matchDiacritics) {\n return p4 || p5;\n }\n\n if (p4) {\n // Diacritics are removed with few exceptions.\n return DIACRITICS_EXCEPTION.has(p4.charCodeAt(0)) ? p4 : \"\";\n }\n\n // A letter has been matched and it can be followed by any diacritics\n // in normalized text.\n if (hasDiacritics) {\n isUnicode = true;\n return `${p5}\\\\p{M}*`;\n }\n return p5;\n }\n );\n\n const trailingSpaces = \"[ ]*\";\n if (query.endsWith(trailingSpaces)) {\n // The [ ]* has been added in order to help to match \"foo . bar\" but\n // it doesn't make sense to match some whitespaces after the dot\n // when it's the last character.\n query = query.slice(0, query.length - trailingSpaces.length);\n }\n\n if (matchDiacritics) {\n // aX must not match aXY.\n if (hasDiacritics) {\n DIACRITICS_EXCEPTION_STR ||= String.fromCharCode(\n ...DIACRITICS_EXCEPTION\n );\n\n isUnicode = true;\n query = `${query}(?=[${DIACRITICS_EXCEPTION_STR}]|[^\\\\p{M}]|$)`;\n }\n }\n\n return [isUnicode, query];\n }\n\n #calculateMatch(pageIndex) {\n let query = this.#query;\n if (query.length === 0) {\n return; // Do nothing: the matches should be wiped out already.\n }\n const { caseSensitive, entireWord } = this.#state;\n const pageContent = this._pageContents[pageIndex];\n const hasDiacritics = this._hasDiacritics[pageIndex];\n\n let isUnicode = false;\n if (typeof query === \"string\") {\n [isUnicode, query] = this.#convertToRegExpString(query, hasDiacritics);\n } else {\n // Words are sorted in reverse order to be sure that \"foobar\" is matched\n // before \"foo\" in case the query is \"foobar foo\".\n query = query\n .sort()\n .reverse()\n .map(q => {\n const [isUnicodePart, queryPart] = this.#convertToRegExpString(\n q,\n hasDiacritics\n );\n isUnicode ||= isUnicodePart;\n return `(${queryPart})`;\n })\n .join(\"|\");\n }\n\n const flags = `g${isUnicode ? \"u\" : \"\"}${caseSensitive ? \"\" : \"i\"}`;\n query = query ? new RegExp(query, flags) : null;\n\n this.#calculateRegExpMatch(query, entireWord, pageIndex, pageContent);\n\n // When `highlightAll` is set, ensure that the matches on previously\n // rendered (and still active) pages are correctly highlighted.\n if (this.#state.highlightAll) {\n this.#updatePage(pageIndex);\n }\n if (this._resumePageIdx === pageIndex) {\n this._resumePageIdx = null;\n this.#nextPageMatch();\n }\n\n // Update the match count.\n const pageMatchesCount = this._pageMatches[pageIndex].length;\n this._matchesCountTotal += pageMatchesCount;\n if (this.#updateMatchesCountOnProgress) {\n if (pageMatchesCount > 0) {\n this.#updateUIResultsCount();\n }\n } else if (++this.#visitedPagesCount === this._linkService.pagesCount) {\n // For example, in GeckoView we want to have only the final update because\n // the Java side provides only one object to update the counts.\n this.#updateUIResultsCount();\n }\n }\n\n #extractText() {\n // Perform text extraction once if this method is called multiple times.\n if (this._extractTextPromises.length > 0) {\n return;\n }\n\n let promise = Promise.resolve();\n const textOptions = { disableNormalization: true };\n for (let i = 0, ii = this._linkService.pagesCount; i < ii; i++) {\n const extractTextCapability = new PromiseCapability();\n this._extractTextPromises[i] = extractTextCapability.promise;\n\n promise = promise.then(() => {\n return this._pdfDocument\n .getPage(i + 1)\n .then(pdfPage => {\n return pdfPage.getTextContent(textOptions);\n })\n .then(\n textContent => {\n const strBuf = [];\n\n for (const textItem of textContent.items) {\n strBuf.push(textItem.str);\n if (textItem.hasEOL) {\n strBuf.push(\"\\n\");\n }\n }\n\n // Store the normalized page content (text items) as one string.\n [\n this._pageContents[i],\n this._pageDiffs[i],\n this._hasDiacritics[i],\n ] = normalize(strBuf.join(\"\"));\n extractTextCapability.resolve();\n },\n reason => {\n console.error(\n `Unable to get text content for page ${i + 1}`,\n reason\n );\n // Page error -- assuming no text content.\n this._pageContents[i] = \"\";\n this._pageDiffs[i] = null;\n this._hasDiacritics[i] = false;\n extractTextCapability.resolve();\n }\n );\n });\n }\n }\n\n #updatePage(index) {\n if (this._scrollMatches && this._selected.pageIdx === index) {\n // If the page is selected, scroll the page into view, which triggers\n // rendering the page, which adds the text layer. Once the text layer\n // is built, it will attempt to scroll the selected match into view.\n this._linkService.page = index + 1;\n }\n\n this._eventBus.dispatch(\"updatetextlayermatches\", {\n source: this,\n pageIndex: index,\n });\n }\n\n #updateAllPages() {\n this._eventBus.dispatch(\"updatetextlayermatches\", {\n source: this,\n pageIndex: -1,\n });\n }\n\n #nextMatch() {\n const previous = this.#state.findPrevious;\n const currentPageIndex = this._linkService.page - 1;\n const numPages = this._linkService.pagesCount;\n\n this._highlightMatches = true;\n\n if (this._dirtyMatch) {\n // Need to recalculate the matches, reset everything.\n this._dirtyMatch = false;\n this._selected.pageIdx = this._selected.matchIdx = -1;\n this._offset.pageIdx = currentPageIndex;\n this._offset.matchIdx = null;\n this._offset.wrapped = false;\n this._resumePageIdx = null;\n this._pageMatches.length = 0;\n this._pageMatchesLength.length = 0;\n this.#visitedPagesCount = 0;\n this._matchesCountTotal = 0;\n\n this.#updateAllPages(); // Wipe out any previously highlighted matches.\n\n for (let i = 0; i < numPages; i++) {\n // Start finding the matches as soon as the text is extracted.\n if (this._pendingFindMatches.has(i)) {\n continue;\n }\n this._pendingFindMatches.add(i);\n this._extractTextPromises[i].then(() => {\n this._pendingFindMatches.delete(i);\n this.#calculateMatch(i);\n });\n }\n }\n\n // If there's no query there's no point in searching.\n const query = this.#query;\n if (query.length === 0) {\n this.#updateUIState(FindState.FOUND);\n return;\n }\n // If we're waiting on a page, we return since we can't do anything else.\n if (this._resumePageIdx) {\n return;\n }\n\n const offset = this._offset;\n // Keep track of how many pages we should maximally iterate through.\n this._pagesToSearch = numPages;\n // If there's already a `matchIdx` that means we are iterating through a\n // page's matches.\n if (offset.matchIdx !== null) {\n const numPageMatches = this._pageMatches[offset.pageIdx].length;\n if (\n (!previous && offset.matchIdx + 1 < numPageMatches) ||\n (previous && offset.matchIdx > 0)\n ) {\n // The simple case; we just have advance the matchIdx to select\n // the next match on the page.\n offset.matchIdx = previous ? offset.matchIdx - 1 : offset.matchIdx + 1;\n this.#updateMatch(/* found = */ true);\n return;\n }\n // We went beyond the current page's matches, so we advance to\n // the next page.\n this.#advanceOffsetPage(previous);\n }\n // Start searching through the page.\n this.#nextPageMatch();\n }\n\n #matchesReady(matches) {\n const offset = this._offset;\n const numMatches = matches.length;\n const previous = this.#state.findPrevious;\n\n if (numMatches) {\n // There were matches for the page, so initialize `matchIdx`.\n offset.matchIdx = previous ? numMatches - 1 : 0;\n this.#updateMatch(/* found = */ true);\n return true;\n }\n // No matches, so attempt to search the next page.\n this.#advanceOffsetPage(previous);\n if (offset.wrapped) {\n offset.matchIdx = null;\n if (this._pagesToSearch < 0) {\n // No point in wrapping again, there were no matches.\n this.#updateMatch(/* found = */ false);\n // While matches were not found, searching for a page\n // with matches should nevertheless halt.\n return true;\n }\n }\n // Matches were not found (and searching is not done).\n return false;\n }\n\n #nextPageMatch() {\n if (this._resumePageIdx !== null) {\n console.error(\"There can only be one pending page.\");\n }\n\n let matches = null;\n do {\n const pageIdx = this._offset.pageIdx;\n matches = this._pageMatches[pageIdx];\n if (!matches) {\n // The matches don't exist yet for processing by `_matchesReady`,\n // so set a resume point for when they do exist.\n this._resumePageIdx = pageIdx;\n break;\n }\n } while (!this.#matchesReady(matches));\n }\n\n #advanceOffsetPage(previous) {\n const offset = this._offset;\n const numPages = this._linkService.pagesCount;\n offset.pageIdx = previous ? offset.pageIdx - 1 : offset.pageIdx + 1;\n offset.matchIdx = null;\n\n this._pagesToSearch--;\n\n if (offset.pageIdx >= numPages || offset.pageIdx < 0) {\n offset.pageIdx = previous ? numPages - 1 : 0;\n offset.wrapped = true;\n }\n }\n\n #updateMatch(found = false) {\n let state = FindState.NOT_FOUND;\n const wrapped = this._offset.wrapped;\n this._offset.wrapped = false;\n\n if (found) {\n const previousPage = this._selected.pageIdx;\n this._selected.pageIdx = this._offset.pageIdx;\n this._selected.matchIdx = this._offset.matchIdx;\n state = wrapped ? FindState.WRAPPED : FindState.FOUND;\n\n // Update the currently selected page to wipe out any selected matches.\n if (previousPage !== -1 && previousPage !== this._selected.pageIdx) {\n this.#updatePage(previousPage);\n }\n }\n\n this.#updateUIState(state, this.#state.findPrevious);\n if (this._selected.pageIdx !== -1) {\n // Ensure that the match will be scrolled into view.\n this._scrollMatches = true;\n\n this.#updatePage(this._selected.pageIdx);\n }\n }\n\n #onFindBarClose(evt) {\n const pdfDocument = this._pdfDocument;\n // Since searching is asynchronous, ensure that the removal of highlighted\n // matches (from the UI) is async too such that the 'updatetextlayermatches'\n // events will always be dispatched in the expected order.\n this._firstPageCapability.promise.then(() => {\n // Only update the UI if the document is open, and is the current one.\n if (\n !this._pdfDocument ||\n (pdfDocument && this._pdfDocument !== pdfDocument)\n ) {\n return;\n }\n // Ensure that a pending, not yet started, search operation is aborted.\n if (this._findTimeout) {\n clearTimeout(this._findTimeout);\n this._findTimeout = null;\n }\n // Abort any long running searches, to avoid a match being scrolled into\n // view *after* the findbar has been closed. In this case `this._offset`\n // will most likely differ from `this._selected`, hence we also ensure\n // that any new search operation will always start with a clean slate.\n if (this._resumePageIdx) {\n this._resumePageIdx = null;\n this._dirtyMatch = true;\n }\n // Avoid the UI being in a pending state when the findbar is re-opened.\n this.#updateUIState(FindState.FOUND);\n\n this._highlightMatches = false;\n this.#updateAllPages(); // Wipe out any previously highlighted matches.\n });\n }\n\n #requestMatchesCount() {\n const { pageIdx, matchIdx } = this._selected;\n let current = 0,\n total = this._matchesCountTotal;\n if (matchIdx !== -1) {\n for (let i = 0; i < pageIdx; i++) {\n current += this._pageMatches[i]?.length || 0;\n }\n current += matchIdx + 1;\n }\n // When searching starts, this method may be called before the `pageMatches`\n // have been counted (in `_calculateMatch`). Ensure that the UI won't show\n // temporarily broken state when the active find result doesn't make sense.\n if (current < 1 || current > total) {\n current = total = 0;\n }\n return { current, total };\n }\n\n #updateUIResultsCount() {\n this._eventBus.dispatch(\"updatefindmatchescount\", {\n source: this,\n matchesCount: this.#requestMatchesCount(),\n });\n }\n\n #updateUIState(state, previous = false) {\n if (\n !this.#updateMatchesCountOnProgress &&\n (this.#visitedPagesCount !== this._linkService.pagesCount ||\n state === FindState.PENDING)\n ) {\n // When this.#updateMatchesCountOnProgress is false we only send an update\n // when everything is ready.\n return;\n }\n\n this._eventBus.dispatch(\"updatefindcontrolstate\", {\n source: this,\n state,\n previous,\n matchesCount: this.#requestMatchesCount(),\n rawQuery: this.#state?.query ?? null,\n });\n }\n}\n\nexport { FindState, PDFFindController };\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\nconst CharacterType = {\n SPACE: 0,\n ALPHA_LETTER: 1,\n PUNCT: 2,\n HAN_LETTER: 3,\n KATAKANA_LETTER: 4,\n HIRAGANA_LETTER: 5,\n HALFWIDTH_KATAKANA_LETTER: 6,\n THAI_LETTER: 7,\n};\n\nfunction isAlphabeticalScript(charCode) {\n return charCode < 0x2e80;\n}\n\nfunction isAscii(charCode) {\n return (charCode & 0xff80) === 0;\n}\n\nfunction isAsciiAlpha(charCode) {\n return (\n (charCode >= /* a = */ 0x61 && charCode <= /* z = */ 0x7a) ||\n (charCode >= /* A = */ 0x41 && charCode <= /* Z = */ 0x5a)\n );\n}\n\nfunction isAsciiDigit(charCode) {\n return charCode >= /* 0 = */ 0x30 && charCode <= /* 9 = */ 0x39;\n}\n\nfunction isAsciiSpace(charCode) {\n return (\n charCode === /* SPACE = */ 0x20 ||\n charCode === /* TAB = */ 0x09 ||\n charCode === /* CR = */ 0x0d ||\n charCode === /* LF = */ 0x0a\n );\n}\n\nfunction isHan(charCode) {\n return (\n (charCode >= 0x3400 && charCode <= 0x9fff) ||\n (charCode >= 0xf900 && charCode <= 0xfaff)\n );\n}\n\nfunction isKatakana(charCode) {\n return charCode >= 0x30a0 && charCode <= 0x30ff;\n}\n\nfunction isHiragana(charCode) {\n return charCode >= 0x3040 && charCode <= 0x309f;\n}\n\nfunction isHalfwidthKatakana(charCode) {\n return charCode >= 0xff60 && charCode <= 0xff9f;\n}\n\nfunction isThai(charCode) {\n return (charCode & 0xff80) === 0x0e00;\n}\n\n/**\n * This function is based on the word-break detection implemented in:\n * https://hg.mozilla.org/mozilla-central/file/tip/intl/lwbrk/WordBreaker.cpp\n */\nfunction getCharacterType(charCode) {\n if (isAlphabeticalScript(charCode)) {\n if (isAscii(charCode)) {\n if (isAsciiSpace(charCode)) {\n return CharacterType.SPACE;\n } else if (\n isAsciiAlpha(charCode) ||\n isAsciiDigit(charCode) ||\n charCode === /* UNDERSCORE = */ 0x5f\n ) {\n return CharacterType.ALPHA_LETTER;\n }\n return CharacterType.PUNCT;\n } else if (isThai(charCode)) {\n return CharacterType.THAI_LETTER;\n } else if (charCode === /* NBSP = */ 0xa0) {\n return CharacterType.SPACE;\n }\n return CharacterType.ALPHA_LETTER;\n }\n\n if (isHan(charCode)) {\n return CharacterType.HAN_LETTER;\n } else if (isKatakana(charCode)) {\n return CharacterType.KATAKANA_LETTER;\n } else if (isHiragana(charCode)) {\n return CharacterType.HIRAGANA_LETTER;\n } else if (isHalfwidthKatakana(charCode)) {\n return CharacterType.HALFWIDTH_KATAKANA_LETTER;\n }\n return CharacterType.ALPHA_LETTER;\n}\n\nlet NormalizeWithNFKC;\nfunction getNormalizeWithNFKC() {\n /* eslint-disable no-irregular-whitespace */\n NormalizeWithNFKC ||= ` ¨ª¯²-µ¸-º¼-¾IJ-ijĿ-ŀʼnſDŽ-njDZ-dzʰ-ʸ˘-˝ˠ-ˤʹͺ;΄-΅·ϐ-ϖϰ-ϲϴ-ϵϹևٵ-ٸक़-य़ড়-ঢ়য়ਲ਼ਸ਼ਖ਼-ਜ਼ਫ਼ଡ଼-ଢ଼ำຳໜ-ໝ༌གྷཌྷདྷབྷཛྷཀྵჼᴬ-ᴮᴰ-ᴺᴼ-ᵍᵏ-ᵪᵸᶛ-ᶿẚ-ẛάέήίόύώΆ᾽-῁ΈΉ῍-῏ΐΊ῝-῟ΰΎ῭-`ΌΏ´-῾ - ‑‗․-… ″-‴‶-‷‼‾⁇-⁉⁗ ⁰-ⁱ⁴-₎ₐ-ₜ₨℀-℃℅-ℇ℉-ℓℕ-№ℙ-ℝ℠-™ℤΩℨK-ℭℯ-ℱℳ-ℹ℻-⅀ⅅ-ⅉ⅐-ⅿ↉∬-∭∯-∰〈-〉①-⓪⨌⩴-⩶⫝̸ⱼ-ⱽⵯ⺟⻳⼀-⿕ 〶〸-〺゛-゜ゟヿㄱ-ㆎ㆒-㆟㈀-㈞㈠-㉇㉐-㉾㊀-㏿ꚜ-ꚝꝰꟲ-ꟴꟸ-ꟹꭜ-ꭟꭩ豈-嗀塚晴凞-羽蘒諸逸-都飯-舘並-龎ff-stﬓ-ﬗיִײַ-זּטּ-לּמּנּ-סּףּ-פּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-﷼︐-︙︰-﹄﹇-﹒﹔-﹦﹨-﹫ﹰ-ﹲﹴﹶ-ﻼ!-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ¢-₩`;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n const ranges = [];\n const range = [];\n const diacriticsRegex = /^\\p{M}$/u;\n // Some chars must be replaced by their NFKC counterpart during a search.\n for (let i = 0; i < 65536; i++) {\n const c = String.fromCharCode(i);\n if (c.normalize(\"NFKC\") !== c && !diacriticsRegex.test(c)) {\n if (range.length !== 2) {\n range[0] = range[1] = i;\n continue;\n }\n if (range[1] + 1 !== i) {\n if (range[0] === range[1]) {\n ranges.push(String.fromCharCode(range[0]));\n } else {\n ranges.push(\n `${String.fromCharCode(range[0])}-${String.fromCharCode(\n range[1]\n )}`\n );\n }\n range[0] = range[1] = i;\n } else {\n range[1] = i;\n }\n }\n }\n if (ranges.join(\"\") !== NormalizeWithNFKC) {\n throw new Error(\n \"getNormalizeWithNFKC - update the `NormalizeWithNFKC` string.\"\n );\n }\n }\n return NormalizeWithNFKC;\n}\n\nexport { CharacterType, getCharacterType, getNormalizeWithNFKC };\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\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { isValidRotation, parseQueryString } from \"./ui_utils.js\";\nimport { waitOnEventOrTimeout } from \"./event_utils.js\";\n\n// Heuristic value used when force-resetting `this._blockHashChange`.\nconst HASH_CHANGE_TIMEOUT = 1000; // milliseconds\n// Heuristic value used when adding the current position to the browser history.\nconst POSITION_UPDATED_THRESHOLD = 50;\n// Heuristic value used when adding a temporary position to the browser history.\nconst UPDATE_VIEWAREA_TIMEOUT = 1000; // milliseconds\n\n/**\n * @typedef {Object} PDFHistoryOptions\n * @property {IPDFLinkService} linkService - The navigation/linking service.\n * @property {EventBus} eventBus - The application event bus.\n */\n\n/**\n * @typedef {Object} InitializeParameters\n * @property {string} fingerprint - The PDF document's unique fingerprint.\n * @property {boolean} [resetHistory] - Reset the browsing history.\n * @property {boolean} [updateUrl] - Attempt to update the document URL, with\n * the current hash, when pushing/replacing browser history entries.\n */\n\n/**\n * @typedef {Object} PushParameters\n * @property {string} [namedDest] - The named destination. If absent, a\n * stringified version of `explicitDest` is used.\n * @property {Array} explicitDest - The explicit destination array.\n * @property {number} pageNumber - The page to which the destination points.\n */\n\nfunction getCurrentHash() {\n return document.location.hash;\n}\n\nclass PDFHistory {\n /**\n * @param {PDFHistoryOptions} options\n */\n constructor({ linkService, eventBus }) {\n this.linkService = linkService;\n this.eventBus = eventBus;\n\n this._initialized = false;\n this._fingerprint = \"\";\n this.reset();\n\n this._boundEvents = null;\n // Ensure that we don't miss a \"pagesinit\" event,\n // by registering the listener immediately.\n this.eventBus._on(\"pagesinit\", () => {\n this._isPagesLoaded = false;\n\n this.eventBus._on(\n \"pagesloaded\",\n evt => {\n this._isPagesLoaded = !!evt.pagesCount;\n },\n { once: true }\n );\n });\n }\n\n /**\n * Initialize the history for the PDF document, using either the current\n * browser history entry or the document hash, whichever is present.\n * @param {InitializeParameters} params\n */\n initialize({ fingerprint, resetHistory = false, updateUrl = false }) {\n if (!fingerprint || typeof fingerprint !== \"string\") {\n console.error(\n 'PDFHistory.initialize: The \"fingerprint\" must be a non-empty string.'\n );\n return;\n }\n // Ensure that any old state is always reset upon initialization.\n if (this._initialized) {\n this.reset();\n }\n const reInitialized =\n this._fingerprint !== \"\" && this._fingerprint !== fingerprint;\n this._fingerprint = fingerprint;\n this._updateUrl = updateUrl === true;\n\n this._initialized = true;\n this._bindEvents();\n const state = window.history.state;\n\n this._popStateInProgress = false;\n this._blockHashChange = 0;\n this._currentHash = getCurrentHash();\n this._numPositionUpdates = 0;\n\n this._uid = this._maxUid = 0;\n this._destination = null;\n this._position = null;\n\n if (!this._isValidState(state, /* checkReload = */ true) || resetHistory) {\n const { hash, page, rotation } = this._parseCurrentHash(\n /* checkNameddest = */ true\n );\n\n if (!hash || reInitialized || resetHistory) {\n // Ensure that the browser history is reset on PDF document load.\n this._pushOrReplaceState(null, /* forceReplace = */ true);\n return;\n }\n // Ensure that the browser history is initialized correctly when\n // the document hash is present on PDF document load.\n this._pushOrReplaceState(\n { hash, page, rotation },\n /* forceReplace = */ true\n );\n return;\n }\n\n // The browser history contains a valid entry, ensure that the history is\n // initialized correctly on PDF document load.\n const destination = state.destination;\n this._updateInternalState(\n destination,\n state.uid,\n /* removeTemporary = */ true\n );\n\n if (destination.rotation !== undefined) {\n this._initialRotation = destination.rotation;\n }\n if (destination.dest) {\n this._initialBookmark = JSON.stringify(destination.dest);\n\n // If the history is updated, e.g. through the user changing the hash,\n // before the initial destination has become visible, then we do *not*\n // want to potentially add `this._position` to the browser history.\n this._destination.page = null;\n } else if (destination.hash) {\n this._initialBookmark = destination.hash;\n } else if (destination.page) {\n // Fallback case; shouldn't be necessary, but better safe than sorry.\n this._initialBookmark = `page=${destination.page}`;\n }\n }\n\n /**\n * Reset the current `PDFHistory` instance, and consequently prevent any\n * further updates and/or navigation of the browser history.\n */\n reset() {\n if (this._initialized) {\n this._pageHide(); // Simulate a 'pagehide' event when resetting.\n\n this._initialized = false;\n this._unbindEvents();\n }\n if (this._updateViewareaTimeout) {\n clearTimeout(this._updateViewareaTimeout);\n this._updateViewareaTimeout = null;\n }\n this._initialBookmark = null;\n this._initialRotation = null;\n }\n\n /**\n * Push an internal destination to the browser history.\n * @param {PushParameters}\n */\n push({ namedDest = null, explicitDest, pageNumber }) {\n if (!this._initialized) {\n return;\n }\n if (namedDest && typeof namedDest !== \"string\") {\n console.error(\n \"PDFHistory.push: \" +\n `\"${namedDest}\" is not a valid namedDest parameter.`\n );\n return;\n } else if (!Array.isArray(explicitDest)) {\n console.error(\n \"PDFHistory.push: \" +\n `\"${explicitDest}\" is not a valid explicitDest parameter.`\n );\n return;\n } else if (!this._isValidPage(pageNumber)) {\n // Allow an unset `pageNumber` if and only if the history is still empty;\n // please refer to the `this._destination.page = null;` comment above.\n if (pageNumber !== null || this._destination) {\n console.error(\n \"PDFHistory.push: \" +\n `\"${pageNumber}\" is not a valid pageNumber parameter.`\n );\n return;\n }\n }\n\n const hash = namedDest || JSON.stringify(explicitDest);\n if (!hash) {\n // The hash *should* never be undefined, but if that were to occur,\n // avoid any possible issues by not updating the browser history.\n return;\n }\n\n let forceReplace = false;\n if (\n this._destination &&\n (isDestHashesEqual(this._destination.hash, hash) ||\n isDestArraysEqual(this._destination.dest, explicitDest))\n ) {\n // When the new destination is identical to `this._destination`, and\n // its `page` is undefined, replace the current browser history entry.\n // NOTE: This can only occur if `this._destination` was set either:\n // - through the document hash being specified on load.\n // - through the user changing the hash of the document.\n if (this._destination.page) {\n return;\n }\n forceReplace = true;\n }\n if (this._popStateInProgress && !forceReplace) {\n return;\n }\n\n this._pushOrReplaceState(\n {\n dest: explicitDest,\n hash,\n page: pageNumber,\n rotation: this.linkService.rotation,\n },\n forceReplace\n );\n\n if (!this._popStateInProgress) {\n // Prevent the browser history from updating while the new destination is\n // being scrolled into view, to avoid potentially inconsistent state.\n this._popStateInProgress = true;\n // We defer the resetting of `this._popStateInProgress`, to account for\n // e.g. zooming occurring when the new destination is being navigated to.\n Promise.resolve().then(() => {\n this._popStateInProgress = false;\n });\n }\n }\n\n /**\n * Push a page to the browser history; generally the `push` method should be\n * used instead.\n * @param {number} pageNumber\n */\n pushPage(pageNumber) {\n if (!this._initialized) {\n return;\n }\n if (!this._isValidPage(pageNumber)) {\n console.error(\n `PDFHistory.pushPage: \"${pageNumber}\" is not a valid page number.`\n );\n return;\n }\n\n if (this._destination?.page === pageNumber) {\n // When the new page is identical to the one in `this._destination`, we\n // don't want to add a potential duplicate entry in the browser history.\n return;\n }\n if (this._popStateInProgress) {\n return;\n }\n\n this._pushOrReplaceState({\n // Simulate an internal destination, for `this._tryPushCurrentPosition`:\n dest: null,\n hash: `page=${pageNumber}`,\n page: pageNumber,\n rotation: this.linkService.rotation,\n });\n\n if (!this._popStateInProgress) {\n // Prevent the browser history from updating while the new page is\n // being scrolled into view, to avoid potentially inconsistent state.\n this._popStateInProgress = true;\n // We defer the resetting of `this._popStateInProgress`, to account for\n // e.g. zooming occurring when the new page is being navigated to.\n Promise.resolve().then(() => {\n this._popStateInProgress = false;\n });\n }\n }\n\n /**\n * Push the current position to the browser history.\n */\n pushCurrentPosition() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n this._tryPushCurrentPosition();\n }\n\n /**\n * Go back one step in the browser history.\n * NOTE: Avoids navigating away from the document, useful for \"named actions\".\n */\n back() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n const state = window.history.state;\n if (this._isValidState(state) && state.uid > 0) {\n window.history.back();\n }\n }\n\n /**\n * Go forward one step in the browser history.\n * NOTE: Avoids navigating away from the document, useful for \"named actions\".\n */\n forward() {\n if (!this._initialized || this._popStateInProgress) {\n return;\n }\n const state = window.history.state;\n if (this._isValidState(state) && state.uid < this._maxUid) {\n window.history.forward();\n }\n }\n\n /**\n * @type {boolean} Indicating if the user is currently moving through the\n * browser history, useful e.g. for skipping the next 'hashchange' event.\n */\n get popStateInProgress() {\n return (\n this._initialized &&\n (this._popStateInProgress || this._blockHashChange > 0)\n );\n }\n\n get initialBookmark() {\n return this._initialized ? this._initialBookmark : null;\n }\n\n get initialRotation() {\n return this._initialized ? this._initialRotation : null;\n }\n\n /**\n * @private\n */\n _pushOrReplaceState(destination, forceReplace = false) {\n const shouldReplace = forceReplace || !this._destination;\n const newState = {\n fingerprint: this._fingerprint,\n uid: shouldReplace ? this._uid : this._uid + 1,\n destination,\n };\n\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"CHROME\") &&\n window.history.state?.chromecomState\n ) {\n // history.state.chromecomState is managed by chromecom.js.\n newState.chromecomState = window.history.state.chromecomState;\n }\n this._updateInternalState(destination, newState.uid);\n\n let newUrl;\n if (this._updateUrl && destination?.hash) {\n const baseUrl = document.location.href.split(\"#\")[0];\n // Prevent errors in Firefox.\n if (!baseUrl.startsWith(\"file://\")) {\n newUrl = `${baseUrl}#${destination.hash}`;\n }\n }\n if (shouldReplace) {\n window.history.replaceState(newState, \"\", newUrl);\n } else {\n window.history.pushState(newState, \"\", newUrl);\n }\n\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"CHROME\") &&\n top === window\n ) {\n // eslint-disable-next-line no-undef\n chrome.runtime.sendMessage(\"showPageAction\");\n }\n }\n\n /**\n * @private\n */\n _tryPushCurrentPosition(temporary = false) {\n if (!this._position) {\n return;\n }\n let position = this._position;\n if (temporary) {\n position = Object.assign(Object.create(null), this._position);\n position.temporary = true;\n }\n\n if (!this._destination) {\n this._pushOrReplaceState(position);\n return;\n }\n if (this._destination.temporary) {\n // Always replace a previous *temporary* position.\n this._pushOrReplaceState(position, /* forceReplace = */ true);\n return;\n }\n if (this._destination.hash === position.hash) {\n return; // The current document position has not changed.\n }\n if (\n !this._destination.page &&\n (POSITION_UPDATED_THRESHOLD <= 0 ||\n this._numPositionUpdates <= POSITION_UPDATED_THRESHOLD)\n ) {\n // `this._destination` was set through the user changing the hash of\n // the document. Do not add `this._position` to the browser history,\n // to avoid \"flooding\" it with lots of (nearly) identical entries,\n // since we cannot ensure that the document position has changed.\n return;\n }\n\n let forceReplace = false;\n if (\n this._destination.page >= position.first &&\n this._destination.page <= position.page\n ) {\n // When the `page` of `this._destination` is still visible, do not\n // update the browsing history when `this._destination` either:\n // - contains an internal destination, since in this case we\n // cannot ensure that the document position has actually changed.\n // - was set through the user changing the hash of the document.\n if (this._destination.dest !== undefined || !this._destination.first) {\n return;\n }\n // To avoid \"flooding\" the browser history, replace the current entry.\n forceReplace = true;\n }\n this._pushOrReplaceState(position, forceReplace);\n }\n\n /**\n * @private\n */\n _isValidPage(val) {\n return (\n Number.isInteger(val) && val > 0 && val <= this.linkService.pagesCount\n );\n }\n\n /**\n * @private\n */\n _isValidState(state, checkReload = false) {\n if (!state) {\n return false;\n }\n if (state.fingerprint !== this._fingerprint) {\n if (checkReload) {\n // Potentially accept the history entry, even if the fingerprints don't\n // match, when the viewer was reloaded (see issue 6847).\n if (\n typeof state.fingerprint !== \"string\" ||\n state.fingerprint.length !== this._fingerprint.length\n ) {\n return false;\n }\n const [perfEntry] = performance.getEntriesByType(\"navigation\");\n if (perfEntry?.type !== \"reload\") {\n return false;\n }\n } else {\n // This should only occur in viewers with support for opening more than\n // one PDF document, e.g. the GENERIC viewer.\n return false;\n }\n }\n if (!Number.isInteger(state.uid) || state.uid < 0) {\n return false;\n }\n if (state.destination === null || typeof state.destination !== \"object\") {\n return false;\n }\n return true;\n }\n\n /**\n * @private\n */\n _updateInternalState(destination, uid, removeTemporary = false) {\n if (this._updateViewareaTimeout) {\n // When updating `this._destination`, make sure that we always wait for\n // the next 'updateviewarea' event before (potentially) attempting to\n // push the current position to the browser history.\n clearTimeout(this._updateViewareaTimeout);\n this._updateViewareaTimeout = null;\n }\n if (removeTemporary && destination?.temporary) {\n // When the `destination` comes from the browser history,\n // we no longer treat it as a *temporary* position.\n delete destination.temporary;\n }\n this._destination = destination;\n this._uid = uid;\n this._maxUid = Math.max(this._maxUid, uid);\n // This should always be reset when `this._destination` is updated.\n this._numPositionUpdates = 0;\n }\n\n /**\n * @private\n */\n _parseCurrentHash(checkNameddest = false) {\n const hash = unescape(getCurrentHash()).substring(1);\n const params = parseQueryString(hash);\n\n const nameddest = params.get(\"nameddest\") || \"\";\n let page = params.get(\"page\") | 0;\n\n if (!this._isValidPage(page) || (checkNameddest && nameddest.length > 0)) {\n page = null;\n }\n return { hash, page, rotation: this.linkService.rotation };\n }\n\n /**\n * @private\n */\n _updateViewarea({ location }) {\n if (this._updateViewareaTimeout) {\n clearTimeout(this._updateViewareaTimeout);\n this._updateViewareaTimeout = null;\n }\n\n this._position = {\n hash: location.pdfOpenParams.substring(1),\n page: this.linkService.page,\n first: location.pageNumber,\n rotation: location.rotation,\n };\n\n if (this._popStateInProgress) {\n return;\n }\n\n if (\n POSITION_UPDATED_THRESHOLD > 0 &&\n this._isPagesLoaded &&\n this._destination &&\n !this._destination.page\n ) {\n // If the current destination was set through the user changing the hash\n // of the document, we will usually not try to push the current position\n // to the browser history; see `this._tryPushCurrentPosition()`.\n //\n // To prevent `this._tryPushCurrentPosition()` from effectively being\n // reduced to a no-op in this case, we will assume that the position\n // *did* in fact change if the 'updateviewarea' event was dispatched\n // more than `POSITION_UPDATED_THRESHOLD` times.\n this._numPositionUpdates++;\n }\n\n if (UPDATE_VIEWAREA_TIMEOUT > 0) {\n // When closing the browser, a 'pagehide' event will be dispatched which\n // *should* allow us to push the current position to the browser history.\n // In practice, it seems that the event is arriving too late in order for\n // the session history to be successfully updated.\n // (For additional details, please refer to the discussion in\n // https://bugzilla.mozilla.org/show_bug.cgi?id=1153393.)\n //\n // To workaround this we attempt to *temporarily* add the current position\n // to the browser history only when the viewer is *idle*,\n // i.e. when scrolling and/or zooming does not occur.\n //\n // PLEASE NOTE: It's absolutely imperative that the browser history is\n // *not* updated too often, since that would render the viewer more or\n // less unusable. Hence the use of a timeout to delay the update until\n // the viewer has been idle for `UPDATE_VIEWAREA_TIMEOUT` milliseconds.\n this._updateViewareaTimeout = setTimeout(() => {\n if (!this._popStateInProgress) {\n this._tryPushCurrentPosition(/* temporary = */ true);\n }\n this._updateViewareaTimeout = null;\n }, UPDATE_VIEWAREA_TIMEOUT);\n }\n }\n\n /**\n * @private\n */\n _popState({ state }) {\n const newHash = getCurrentHash(),\n hashChanged = this._currentHash !== newHash;\n this._currentHash = newHash;\n\n if (\n (typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"CHROME\") &&\n state?.chromecomState &&\n !this._isValidState(state)) ||\n !state\n ) {\n // This case corresponds to the user changing the hash of the document.\n this._uid++;\n\n const { hash, page, rotation } = this._parseCurrentHash();\n this._pushOrReplaceState(\n { hash, page, rotation },\n /* forceReplace = */ true\n );\n return;\n }\n if (!this._isValidState(state)) {\n // This should only occur in viewers with support for opening more than\n // one PDF document, e.g. the GENERIC viewer.\n return;\n }\n\n // Prevent the browser history from updating until the new destination,\n // as stored in the browser history, has been scrolled into view.\n this._popStateInProgress = true;\n\n if (hashChanged) {\n // When the hash changed, implying that the 'popstate' event will be\n // followed by a 'hashchange' event, then we do *not* want to update the\n // browser history when handling the 'hashchange' event (in web/app.js)\n // since that would *overwrite* the new destination navigated to below.\n //\n // To avoid accidentally disabling all future user-initiated hash changes,\n // if there's e.g. another 'hashchange' listener that stops the event\n // propagation, we make sure to always force-reset `this._blockHashChange`\n // after `HASH_CHANGE_TIMEOUT` milliseconds have passed.\n this._blockHashChange++;\n waitOnEventOrTimeout({\n target: window,\n name: \"hashchange\",\n delay: HASH_CHANGE_TIMEOUT,\n }).then(() => {\n this._blockHashChange--;\n });\n }\n\n // Navigate to the new destination.\n const destination = state.destination;\n this._updateInternalState(\n destination,\n state.uid,\n /* removeTemporary = */ true\n );\n\n if (isValidRotation(destination.rotation)) {\n this.linkService.rotation = destination.rotation;\n }\n if (destination.dest) {\n this.linkService.goToDestination(destination.dest);\n } else if (destination.hash) {\n this.linkService.setHash(destination.hash);\n } else if (destination.page) {\n // Fallback case; shouldn't be necessary, but better safe than sorry.\n this.linkService.page = destination.page;\n }\n\n // Since `PDFLinkService.goToDestination` is asynchronous, we thus defer the\n // resetting of `this._popStateInProgress` slightly.\n Promise.resolve().then(() => {\n this._popStateInProgress = false;\n });\n }\n\n /**\n * @private\n */\n _pageHide() {\n // Attempt to push the `this._position` into the browser history when\n // navigating away from the document. This is *only* done if the history\n // is empty/temporary, since otherwise an existing browser history entry\n // will end up being overwritten (given that new entries cannot be pushed\n // into the browser history when the 'unload' event has already fired).\n if (!this._destination || this._destination.temporary) {\n this._tryPushCurrentPosition();\n }\n }\n\n /**\n * @private\n */\n _bindEvents() {\n if (this._boundEvents) {\n return; // The event listeners were already added.\n }\n this._boundEvents = {\n updateViewarea: this._updateViewarea.bind(this),\n popState: this._popState.bind(this),\n pageHide: this._pageHide.bind(this),\n };\n\n this.eventBus._on(\"updateviewarea\", this._boundEvents.updateViewarea);\n window.addEventListener(\"popstate\", this._boundEvents.popState);\n window.addEventListener(\"pagehide\", this._boundEvents.pageHide);\n }\n\n /**\n * @private\n */\n _unbindEvents() {\n if (!this._boundEvents) {\n return; // The event listeners were already removed.\n }\n this.eventBus._off(\"updateviewarea\", this._boundEvents.updateViewarea);\n window.removeEventListener(\"popstate\", this._boundEvents.popState);\n window.removeEventListener(\"pagehide\", this._boundEvents.pageHide);\n\n this._boundEvents = null;\n }\n}\n\nfunction isDestHashesEqual(destHash, pushHash) {\n if (typeof destHash !== \"string\" || typeof pushHash !== \"string\") {\n return false;\n }\n if (destHash === pushHash) {\n return true;\n }\n const nameddest = parseQueryString(destHash).get(\"nameddest\");\n if (nameddest === pushHash) {\n return true;\n }\n return false;\n}\n\nfunction isDestArraysEqual(firstDest, secondDest) {\n function isEntryEqual(first, second) {\n if (typeof first !== typeof second) {\n return false;\n }\n if (Array.isArray(first) || Array.isArray(second)) {\n return false;\n }\n if (first !== null && typeof first === \"object\" && second !== null) {\n if (Object.keys(first).length !== Object.keys(second).length) {\n return false;\n }\n for (const key in first) {\n if (!isEntryEqual(first[key], second[key])) {\n return false;\n }\n }\n return true;\n }\n return first === second || (Number.isNaN(first) && Number.isNaN(second));\n }\n\n if (!(Array.isArray(firstDest) && Array.isArray(secondDest))) {\n return false;\n }\n if (firstDest.length !== secondDest.length) {\n return false;\n }\n for (let i = 0, ii = firstDest.length; i < ii; i++) {\n if (!isEntryEqual(firstDest[i], secondDest[i])) {\n return false;\n }\n }\n return true;\n}\n\nexport { isDestArraysEqual, isDestHashesEqual, PDFHistory };\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(\"../src/display/display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/optional_content_config\").OptionalContentConfig} OptionalContentConfig */\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n/** @typedef {import(\"./interfaces\").IRenderableView} IRenderableView */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_rendering_queue\").PDFRenderingQueue} PDFRenderingQueue */\n\nimport {\n AbortException,\n AnnotationMode,\n PixelsPerInch,\n RenderingCancelledException,\n setLayerDimensions,\n shadow,\n} from \"pdfjs-lib\";\nimport {\n approximateFraction,\n DEFAULT_SCALE,\n OutputScale,\n RenderingStates,\n roundToDivide,\n TextLayerMode,\n} from \"./ui_utils.js\";\nimport { AnnotationEditorLayerBuilder } from \"./annotation_editor_layer_builder.js\";\nimport { AnnotationLayerBuilder } from \"./annotation_layer_builder.js\";\nimport { compatibilityParams } from \"./app_options.js\";\nimport { NullL10n } from \"./l10n_utils.js\";\nimport { SimpleLinkService } from \"./pdf_link_service.js\";\nimport { StructTreeLayerBuilder } from \"./struct_tree_layer_builder.js\";\nimport { TextAccessibilityManager } from \"./text_accessibility.js\";\nimport { TextHighlighter } from \"./text_highlighter.js\";\nimport { TextLayerBuilder } from \"./text_layer_builder.js\";\nimport { XfaLayerBuilder } from \"./xfa_layer_builder.js\";\n\n/**\n * @typedef {Object} PDFPageViewOptions\n * @property {HTMLDivElement} [container] - The viewer element.\n * @property {EventBus} eventBus - The application event bus.\n * @property {number} id - The page unique ID (normally its number).\n * @property {number} [scale] - The page scale display.\n * @property {PageViewport} defaultViewport - The page viewport.\n * @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise] -\n * A promise that is resolved with an {@link OptionalContentConfig} instance.\n * The default value is `null`.\n * @property {PDFRenderingQueue} [renderingQueue] - The rendering queue object.\n * @property {number} [textLayerMode] - Controls if the text layer used for\n * selection and searching is created. The constants from {TextLayerMode}\n * should be used. The default value is `TextLayerMode.ENABLE`.\n * @property {number} [annotationMode] - Controls if the annotation layer is\n * created, and if interactive form elements or `AnnotationStorage`-data are\n * being rendered. The constants from {@link AnnotationMode} should be used;\n * see also {@link RenderParameters} and {@link GetOperatorListParameters}.\n * The default value is `AnnotationMode.ENABLE_FORMS`.\n * @property {string} [imageResourcesPath] - Path for image resources, mainly\n * for annotation icons. Include trailing slash.\n * @property {boolean} [useOnlyCssZoom] - Enables CSS only zooming. The default\n * value is `false`.\n * @property {boolean} [isOffscreenCanvasSupported] - Allows to use an\n * OffscreenCanvas if needed.\n * @property {number} [maxCanvasPixels] - The maximum supported canvas size in\n * total pixels, i.e. width * height. Use -1 for no limit. The default value\n * is 4096 * 4096 (16 mega-pixels).\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 {IL10n} [l10n] - Localization service.\n * @property {function} [layerProperties] - The function that is used to lookup\n * the necessary layer-properties.\n */\n\nconst MAX_CANVAS_PIXELS = compatibilityParams.maxCanvasPixels || 16777216;\n\nconst DEFAULT_LAYER_PROPERTIES = () => {\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"COMPONENTS\")) {\n return null;\n }\n return {\n annotationEditorUIManager: null,\n annotationStorage: null,\n downloadManager: null,\n enableScripting: false,\n fieldObjectsPromise: null,\n findController: null,\n hasJSActionsPromise: null,\n get linkService() {\n return new SimpleLinkService();\n },\n };\n};\n\n/**\n * @implements {IRenderableView}\n */\nclass PDFPageView {\n #annotationMode = AnnotationMode.ENABLE_FORMS;\n\n #layerProperties = null;\n\n #loadingId = null;\n\n #previousRotation = null;\n\n #renderError = null;\n\n #renderingState = RenderingStates.INITIAL;\n\n #textLayerMode = TextLayerMode.ENABLE;\n\n #useThumbnailCanvas = {\n initialOptionalContent: true,\n regularAnnotations: true,\n };\n\n #viewportMap = new WeakMap();\n\n /**\n * @param {PDFPageViewOptions} options\n */\n constructor(options) {\n const container = options.container;\n const defaultViewport = options.defaultViewport;\n\n this.id = options.id;\n this.renderingId = \"page\" + this.id;\n this.#layerProperties = options.layerProperties || DEFAULT_LAYER_PROPERTIES;\n\n this.pdfPage = null;\n this.pageLabel = null;\n this.rotation = 0;\n this.scale = options.scale || DEFAULT_SCALE;\n this.viewport = defaultViewport;\n this.pdfPageRotate = defaultViewport.rotation;\n this._optionalContentConfigPromise =\n options.optionalContentConfigPromise || null;\n this.hasRestrictedScaling = false;\n this.#textLayerMode = options.textLayerMode ?? TextLayerMode.ENABLE;\n this.#annotationMode =\n options.annotationMode ?? AnnotationMode.ENABLE_FORMS;\n this.imageResourcesPath = options.imageResourcesPath || \"\";\n this.useOnlyCssZoom = options.useOnlyCssZoom || false;\n this.isOffscreenCanvasSupported =\n options.isOffscreenCanvasSupported ?? true;\n this.maxCanvasPixels = options.maxCanvasPixels || MAX_CANVAS_PIXELS;\n this.pageColors = options.pageColors || null;\n\n this.eventBus = options.eventBus;\n this.renderingQueue = options.renderingQueue;\n this.l10n = options.l10n || NullL10n;\n\n this.renderTask = null;\n this.resume = null;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this._isStandalone = !this.renderingQueue?.hasViewer();\n }\n\n this._annotationCanvasMap = null;\n\n this.annotationLayer = null;\n this.annotationEditorLayer = null;\n this.textLayer = null;\n this.zoomLayer = null;\n this.xfaLayer = null;\n this.structTreeLayer = null;\n\n const div = document.createElement(\"div\");\n div.className = \"page\";\n div.setAttribute(\"data-page-number\", this.id);\n div.setAttribute(\"role\", \"region\");\n this.l10n.get(\"page_landmark\", { page: this.id }).then(msg => {\n div.setAttribute(\"aria-label\", msg);\n });\n this.div = div;\n\n this.#setDimensions();\n container?.append(div);\n\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this._isStandalone\n ) {\n // Ensure that the various layers always get the correct initial size,\n // see issue 15795.\n container?.style.setProperty(\n \"--scale-factor\",\n this.scale * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n\n const { optionalContentConfigPromise } = options;\n if (optionalContentConfigPromise) {\n // Ensure that the thumbnails always display the *initial* document\n // state, for documents with optional content.\n optionalContentConfigPromise.then(optionalContentConfig => {\n if (\n optionalContentConfigPromise !== this._optionalContentConfigPromise\n ) {\n return;\n }\n this.#useThumbnailCanvas.initialOptionalContent =\n optionalContentConfig.hasInitialVisibility;\n });\n }\n }\n }\n\n get renderingState() {\n return this.#renderingState;\n }\n\n set renderingState(state) {\n if (state === this.#renderingState) {\n return;\n }\n this.#renderingState = state;\n\n if (this.#loadingId) {\n clearTimeout(this.#loadingId);\n this.#loadingId = null;\n }\n\n switch (state) {\n case RenderingStates.PAUSED:\n this.div.classList.remove(\"loading\");\n break;\n case RenderingStates.RUNNING:\n this.div.classList.add(\"loadingIcon\");\n this.#loadingId = setTimeout(() => {\n // Adding the loading class is slightly postponed in order to not have\n // it with loadingIcon.\n // If we don't do that the visibility of the background is changed but\n // the transition isn't triggered.\n this.div.classList.add(\"loading\");\n this.#loadingId = null;\n }, 0);\n break;\n case RenderingStates.INITIAL:\n case RenderingStates.FINISHED:\n this.div.classList.remove(\"loadingIcon\", \"loading\");\n break;\n }\n }\n\n #setDimensions() {\n const { viewport } = this;\n if (this.pdfPage) {\n if (this.#previousRotation === viewport.rotation) {\n return;\n }\n this.#previousRotation = viewport.rotation;\n }\n\n setLayerDimensions(\n this.div,\n viewport,\n /* mustFlip = */ true,\n /* mustRotate = */ false\n );\n }\n\n setPdfPage(pdfPage) {\n this.pdfPage = pdfPage;\n this.pdfPageRotate = pdfPage.rotate;\n\n const totalRotation = (this.rotation + this.pdfPageRotate) % 360;\n this.viewport = pdfPage.getViewport({\n scale: this.scale * PixelsPerInch.PDF_TO_CSS_UNITS,\n rotation: totalRotation,\n });\n this.#setDimensions();\n this.reset();\n }\n\n destroy() {\n this.reset();\n this.pdfPage?.cleanup();\n }\n\n get _textHighlighter() {\n return shadow(\n this,\n \"_textHighlighter\",\n new TextHighlighter({\n pageIndex: this.id - 1,\n eventBus: this.eventBus,\n findController: this.#layerProperties().findController,\n })\n );\n }\n\n async #renderAnnotationLayer() {\n let error = null;\n try {\n await this.annotationLayer.render(this.viewport, \"display\");\n } catch (ex) {\n console.error(`#renderAnnotationLayer: \"${ex}\".`);\n error = ex;\n } finally {\n this.eventBus.dispatch(\"annotationlayerrendered\", {\n source: this,\n pageNumber: this.id,\n error,\n });\n }\n }\n\n async #renderAnnotationEditorLayer() {\n let error = null;\n try {\n await this.annotationEditorLayer.render(this.viewport, \"display\");\n } catch (ex) {\n console.error(`#renderAnnotationEditorLayer: \"${ex}\".`);\n error = ex;\n } finally {\n this.eventBus.dispatch(\"annotationeditorlayerrendered\", {\n source: this,\n pageNumber: this.id,\n error,\n });\n }\n }\n\n async #renderXfaLayer() {\n let error = null;\n try {\n const result = await this.xfaLayer.render(this.viewport, \"display\");\n if (result?.textDivs && this._textHighlighter) {\n this.#buildXfaTextContentItems(result.textDivs);\n }\n } catch (ex) {\n console.error(`#renderXfaLayer: \"${ex}\".`);\n error = ex;\n } finally {\n this.eventBus.dispatch(\"xfalayerrendered\", {\n source: this,\n pageNumber: this.id,\n error,\n });\n }\n }\n\n async #renderTextLayer() {\n const { pdfPage, textLayer, viewport } = this;\n if (!textLayer) {\n return;\n }\n\n let error = null;\n try {\n if (!textLayer.renderingDone) {\n const readableStream = pdfPage.streamTextContent({\n includeMarkedContent: true,\n disableNormalization: true,\n });\n textLayer.setTextContentSource(readableStream);\n }\n await textLayer.render(viewport);\n } catch (ex) {\n if (ex instanceof AbortException) {\n return;\n }\n console.error(`#renderTextLayer: \"${ex}\".`);\n error = ex;\n }\n\n this.eventBus.dispatch(\"textlayerrendered\", {\n source: this,\n pageNumber: this.id,\n numTextDivs: textLayer.numTextDivs,\n error,\n });\n\n this.#renderStructTreeLayer();\n }\n\n /**\n * The structure tree is currently only supported when the text layer is\n * enabled and a canvas is used for rendering.\n *\n * The structure tree must be generated after the text layer for the\n * aria-owns to work.\n */\n async #renderStructTreeLayer() {\n if (!this.textLayer) {\n return;\n }\n this.structTreeLayer ||= new StructTreeLayerBuilder();\n\n const tree = await (!this.structTreeLayer.renderingDone\n ? this.pdfPage.getStructTree()\n : null);\n const treeDom = this.structTreeLayer?.render(tree);\n if (treeDom) {\n this.canvas?.append(treeDom);\n }\n this.structTreeLayer?.show();\n }\n\n async #buildXfaTextContentItems(textDivs) {\n const text = await this.pdfPage.getTextContent();\n const items = [];\n for (const item of text.items) {\n items.push(item.str);\n }\n this._textHighlighter.setTextMapping(textDivs, items);\n this._textHighlighter.enable();\n }\n\n /**\n * @private\n */\n _resetZoomLayer(removeFromDOM = false) {\n if (!this.zoomLayer) {\n return;\n }\n const zoomLayerCanvas = this.zoomLayer.firstChild;\n this.#viewportMap.delete(zoomLayerCanvas);\n // Zeroing the width and height causes Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n zoomLayerCanvas.width = 0;\n zoomLayerCanvas.height = 0;\n\n if (removeFromDOM) {\n // Note: `ChildNode.remove` doesn't throw if the parent node is undefined.\n this.zoomLayer.remove();\n }\n this.zoomLayer = null;\n }\n\n reset({\n keepZoomLayer = false,\n keepAnnotationLayer = false,\n keepAnnotationEditorLayer = false,\n keepXfaLayer = false,\n keepTextLayer = false,\n } = {}) {\n this.cancelRendering({\n keepAnnotationLayer,\n keepAnnotationEditorLayer,\n keepXfaLayer,\n keepTextLayer,\n });\n this.renderingState = RenderingStates.INITIAL;\n\n const div = this.div;\n\n const childNodes = div.childNodes,\n zoomLayerNode = (keepZoomLayer && this.zoomLayer) || null,\n annotationLayerNode =\n (keepAnnotationLayer && this.annotationLayer?.div) || null,\n annotationEditorLayerNode =\n (keepAnnotationEditorLayer && this.annotationEditorLayer?.div) || null,\n xfaLayerNode = (keepXfaLayer && this.xfaLayer?.div) || null,\n textLayerNode = (keepTextLayer && this.textLayer?.div) || null;\n for (let i = childNodes.length - 1; i >= 0; i--) {\n const node = childNodes[i];\n switch (node) {\n case zoomLayerNode:\n case annotationLayerNode:\n case annotationEditorLayerNode:\n case xfaLayerNode:\n case textLayerNode:\n continue;\n }\n node.remove();\n }\n div.removeAttribute(\"data-loaded\");\n\n if (annotationLayerNode) {\n // Hide the annotation layer until all elements are resized\n // so they are not displayed on the already resized page.\n this.annotationLayer.hide();\n }\n if (annotationEditorLayerNode) {\n this.annotationEditorLayer.hide();\n }\n if (xfaLayerNode) {\n // Hide the XFA layer until all elements are resized\n // so they are not displayed on the already resized page.\n this.xfaLayer.hide();\n }\n if (textLayerNode) {\n this.textLayer.hide();\n }\n this.structTreeLayer?.hide();\n\n if (!zoomLayerNode) {\n if (this.canvas) {\n this.#viewportMap.delete(this.canvas);\n // Zeroing the width and height causes Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n this.canvas.width = 0;\n this.canvas.height = 0;\n delete this.canvas;\n }\n this._resetZoomLayer();\n }\n }\n\n /**\n * @typedef {Object} PDFPageViewUpdateParameters\n * @property {number} [scale] The new scale, if specified.\n * @property {number} [rotation] The new rotation, if specified.\n * @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise]\n * A promise that is resolved with an {@link OptionalContentConfig}\n * instance. The default value is `null`.\n * @property {number} [drawingDelay]\n */\n\n /**\n * Update e.g. the scale and/or rotation of the page.\n * @param {PDFPageViewUpdateParameters}\n */\n update({\n scale = 0,\n rotation = null,\n optionalContentConfigPromise = null,\n drawingDelay = -1,\n }) {\n this.scale = scale || this.scale;\n if (typeof rotation === \"number\") {\n this.rotation = rotation; // The rotation may be zero.\n }\n if (optionalContentConfigPromise instanceof Promise) {\n this._optionalContentConfigPromise = optionalContentConfigPromise;\n\n // Ensure that the thumbnails always display the *initial* document state,\n // for documents with optional content.\n optionalContentConfigPromise.then(optionalContentConfig => {\n if (\n optionalContentConfigPromise !== this._optionalContentConfigPromise\n ) {\n return;\n }\n this.#useThumbnailCanvas.initialOptionalContent =\n optionalContentConfig.hasInitialVisibility;\n });\n }\n\n const totalRotation = (this.rotation + this.pdfPageRotate) % 360;\n this.viewport = this.viewport.clone({\n scale: this.scale * PixelsPerInch.PDF_TO_CSS_UNITS,\n rotation: totalRotation,\n });\n this.#setDimensions();\n\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this._isStandalone\n ) {\n this.div.parentNode?.style.setProperty(\n \"--scale-factor\",\n this.viewport.scale\n );\n }\n\n let isScalingRestricted = false;\n if (this.canvas && this.maxCanvasPixels > 0) {\n const { width, height } = this.viewport;\n const { sx, sy } = this.outputScale;\n if (\n ((Math.floor(width) * sx) | 0) * ((Math.floor(height) * sy) | 0) >\n this.maxCanvasPixels\n ) {\n isScalingRestricted = true;\n }\n }\n const onlyCssZoom =\n this.useOnlyCssZoom || (this.hasRestrictedScaling && isScalingRestricted);\n const postponeDrawing =\n !onlyCssZoom && drawingDelay >= 0 && drawingDelay < 1000;\n\n if (this.canvas) {\n if (postponeDrawing || onlyCssZoom) {\n if (\n postponeDrawing &&\n this.renderingState !== RenderingStates.FINISHED\n ) {\n this.cancelRendering({\n keepZoomLayer: true,\n keepAnnotationLayer: true,\n keepAnnotationEditorLayer: true,\n keepXfaLayer: true,\n keepTextLayer: true,\n cancelExtraDelay: drawingDelay,\n });\n // It isn't really finished, but once we have finished\n // to postpone, we'll call this.reset(...) which will set\n // the rendering state to INITIAL, hence the next call to\n // PDFViewer.update() will trigger a redraw (if it's mandatory).\n this.renderingState = RenderingStates.FINISHED;\n }\n\n this.cssTransform({\n target: this.canvas,\n redrawAnnotationLayer: true,\n redrawAnnotationEditorLayer: true,\n redrawXfaLayer: true,\n redrawTextLayer: !postponeDrawing,\n hideTextLayer: postponeDrawing,\n });\n\n this.eventBus.dispatch(\"pagerendered\", {\n source: this,\n pageNumber: this.id,\n cssTransform: true,\n timestamp: performance.now(),\n error: this.#renderError,\n });\n return;\n }\n if (!this.zoomLayer && !this.canvas.hidden) {\n this.zoomLayer = this.canvas.parentNode;\n this.zoomLayer.style.position = \"absolute\";\n }\n }\n if (this.zoomLayer) {\n this.cssTransform({ target: this.zoomLayer.firstChild });\n }\n this.reset({\n keepZoomLayer: true,\n keepAnnotationLayer: true,\n keepAnnotationEditorLayer: true,\n keepXfaLayer: true,\n keepTextLayer: true,\n });\n }\n\n /**\n * PLEASE NOTE: Most likely you want to use the `this.reset()` method,\n * rather than calling this one directly.\n */\n cancelRendering({\n keepAnnotationLayer = false,\n keepAnnotationEditorLayer = false,\n keepXfaLayer = false,\n keepTextLayer = false,\n cancelExtraDelay = 0,\n } = {}) {\n if (this.renderTask) {\n this.renderTask.cancel(cancelExtraDelay);\n this.renderTask = null;\n }\n this.resume = null;\n\n if (this.textLayer && (!keepTextLayer || !this.textLayer.div)) {\n this.textLayer.cancel();\n this.textLayer = null;\n }\n if (this.structTreeLayer && !this.textLayer) {\n this.structTreeLayer = null;\n }\n if (\n this.annotationLayer &&\n (!keepAnnotationLayer || !this.annotationLayer.div)\n ) {\n this.annotationLayer.cancel();\n this.annotationLayer = null;\n this._annotationCanvasMap = null;\n }\n if (\n this.annotationEditorLayer &&\n (!keepAnnotationEditorLayer || !this.annotationEditorLayer.div)\n ) {\n this.annotationEditorLayer.cancel();\n this.annotationEditorLayer = null;\n }\n if (this.xfaLayer && (!keepXfaLayer || !this.xfaLayer.div)) {\n this.xfaLayer.cancel();\n this.xfaLayer = null;\n this._textHighlighter?.disable();\n }\n }\n\n cssTransform({\n target,\n redrawAnnotationLayer = false,\n redrawAnnotationEditorLayer = false,\n redrawXfaLayer = false,\n redrawTextLayer = false,\n hideTextLayer = false,\n }) {\n // Scale target (canvas), its wrapper and page container.\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) &&\n !(target instanceof HTMLCanvasElement)\n ) {\n throw new Error(\"Expected `target` to be a canvas.\");\n }\n if (!target.hasAttribute(\"zooming\")) {\n target.setAttribute(\"zooming\", true);\n const { style } = target;\n style.width = style.height = \"\";\n }\n\n const originalViewport = this.#viewportMap.get(target);\n if (this.viewport !== originalViewport) {\n // The canvas may have been originally rotated; rotate relative to that.\n const relativeRotation =\n this.viewport.rotation - originalViewport.rotation;\n const absRotation = Math.abs(relativeRotation);\n let scaleX = 1,\n scaleY = 1;\n if (absRotation === 90 || absRotation === 270) {\n const { width, height } = this.viewport;\n // Scale x and y because of the rotation.\n scaleX = height / width;\n scaleY = width / height;\n }\n target.style.transform = `rotate(${relativeRotation}deg) scale(${scaleX}, ${scaleY})`;\n }\n\n if (redrawAnnotationLayer && this.annotationLayer) {\n this.#renderAnnotationLayer();\n }\n if (redrawAnnotationEditorLayer && this.annotationEditorLayer) {\n this.#renderAnnotationEditorLayer();\n }\n if (redrawXfaLayer && this.xfaLayer) {\n this.#renderXfaLayer();\n }\n\n if (this.textLayer) {\n if (hideTextLayer) {\n this.textLayer.hide();\n this.structTreeLayer?.hide();\n } else if (redrawTextLayer) {\n this.#renderTextLayer();\n }\n }\n }\n\n get width() {\n return this.viewport.width;\n }\n\n get height() {\n return this.viewport.height;\n }\n\n getPagePoint(x, y) {\n return this.viewport.convertToPdfPoint(x, y);\n }\n\n async #finishRenderTask(renderTask, error = null) {\n // The renderTask may have been replaced by a new one, so only remove\n // the reference to the renderTask if it matches the one that is\n // triggering this callback.\n if (renderTask === this.renderTask) {\n this.renderTask = null;\n }\n\n if (error instanceof RenderingCancelledException) {\n this.#renderError = null;\n return;\n }\n this.#renderError = error;\n\n this.renderingState = RenderingStates.FINISHED;\n this._resetZoomLayer(/* removeFromDOM = */ true);\n\n // Ensure that the thumbnails won't become partially (or fully) blank,\n // for documents that contain interactive form elements.\n this.#useThumbnailCanvas.regularAnnotations = !renderTask.separateAnnots;\n\n this.eventBus.dispatch(\"pagerendered\", {\n source: this,\n pageNumber: this.id,\n cssTransform: false,\n timestamp: performance.now(),\n error: this.#renderError,\n });\n\n if (error) {\n throw error;\n }\n }\n\n async draw() {\n if (this.renderingState !== RenderingStates.INITIAL) {\n console.error(\"Must be in new state before drawing\");\n this.reset(); // Ensure that we reset all state to prevent issues.\n }\n const { div, l10n, pageColors, pdfPage, viewport } = this;\n\n if (!pdfPage) {\n this.renderingState = RenderingStates.FINISHED;\n throw new Error(\"pdfPage is not loaded\");\n }\n\n this.renderingState = RenderingStates.RUNNING;\n\n // Wrap the canvas so that if it has a CSS transform for high DPI the\n // overflow will be hidden in Firefox.\n const canvasWrapper = document.createElement(\"div\");\n canvasWrapper.classList.add(\"canvasWrapper\");\n div.append(canvasWrapper);\n\n if (\n !this.textLayer &&\n this.#textLayerMode !== TextLayerMode.DISABLE &&\n !pdfPage.isPureXfa\n ) {\n this._accessibilityManager ||= new TextAccessibilityManager();\n\n this.textLayer = new TextLayerBuilder({\n highlighter: this._textHighlighter,\n accessibilityManager: this._accessibilityManager,\n isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,\n enablePermissions:\n this.#textLayerMode === TextLayerMode.ENABLE_PERMISSIONS,\n });\n div.append(this.textLayer.div);\n }\n\n if (\n !this.annotationLayer &&\n this.#annotationMode !== AnnotationMode.DISABLE\n ) {\n const {\n annotationStorage,\n downloadManager,\n enableScripting,\n fieldObjectsPromise,\n hasJSActionsPromise,\n linkService,\n } = this.#layerProperties();\n\n this._annotationCanvasMap ||= new Map();\n this.annotationLayer = new AnnotationLayerBuilder({\n pageDiv: div,\n pdfPage,\n annotationStorage,\n imageResourcesPath: this.imageResourcesPath,\n renderForms: this.#annotationMode === AnnotationMode.ENABLE_FORMS,\n linkService,\n downloadManager,\n l10n,\n enableScripting,\n hasJSActionsPromise,\n fieldObjectsPromise,\n annotationCanvasMap: this._annotationCanvasMap,\n accessibilityManager: this._accessibilityManager,\n });\n }\n\n const renderContinueCallback = cont => {\n showCanvas?.(false);\n if (this.renderingQueue && !this.renderingQueue.isHighestPriority(this)) {\n this.renderingState = RenderingStates.PAUSED;\n this.resume = () => {\n this.renderingState = RenderingStates.RUNNING;\n cont();\n };\n return;\n }\n cont();\n };\n\n const { width, height } = viewport;\n const canvas = document.createElement(\"canvas\");\n canvas.setAttribute(\"role\", \"presentation\");\n\n // Keep the canvas hidden until the first draw callback, or until drawing\n // is complete when `!this.renderingQueue`, to prevent black flickering.\n canvas.hidden = true;\n const hasHCM = !!(pageColors?.background && pageColors?.foreground);\n\n let showCanvas = isLastShow => {\n // In HCM, a final filter is applied on the canvas which means that\n // before it's applied we've normal colors. Consequently, to avoid to have\n // a final flash we just display it once all the drawing is done.\n if (!hasHCM || isLastShow) {\n canvas.hidden = false;\n showCanvas = null; // Only invoke the function once.\n }\n };\n canvasWrapper.append(canvas);\n this.canvas = canvas;\n\n const ctx = canvas.getContext(\"2d\", { alpha: false });\n const outputScale = (this.outputScale = new OutputScale());\n\n if (this.useOnlyCssZoom) {\n const actualSizeViewport = viewport.clone({\n scale: PixelsPerInch.PDF_TO_CSS_UNITS,\n });\n // Use a scale that makes the canvas have the originally intended size\n // of the page.\n outputScale.sx *= actualSizeViewport.width / width;\n outputScale.sy *= actualSizeViewport.height / height;\n }\n\n if (this.maxCanvasPixels > 0) {\n const pixelsInViewport = width * height;\n const maxScale = Math.sqrt(this.maxCanvasPixels / pixelsInViewport);\n if (outputScale.sx > maxScale || outputScale.sy > maxScale) {\n outputScale.sx = maxScale;\n outputScale.sy = maxScale;\n this.hasRestrictedScaling = true;\n } else {\n this.hasRestrictedScaling = false;\n }\n }\n const sfx = approximateFraction(outputScale.sx);\n const sfy = approximateFraction(outputScale.sy);\n\n canvas.width = roundToDivide(width * outputScale.sx, sfx[0]);\n canvas.height = roundToDivide(height * outputScale.sy, sfy[0]);\n const { style } = canvas;\n style.width = roundToDivide(width, sfx[1]) + \"px\";\n style.height = roundToDivide(height, sfy[1]) + \"px\";\n\n // Add the viewport so it's known what it was originally drawn with.\n this.#viewportMap.set(canvas, viewport);\n\n // Rendering area\n const transform = outputScale.scaled\n ? [outputScale.sx, 0, 0, outputScale.sy, 0, 0]\n : null;\n const renderContext = {\n canvasContext: ctx,\n transform,\n viewport,\n annotationMode: this.#annotationMode,\n optionalContentConfigPromise: this._optionalContentConfigPromise,\n annotationCanvasMap: this._annotationCanvasMap,\n pageColors,\n };\n const renderTask = (this.renderTask = this.pdfPage.render(renderContext));\n renderTask.onContinue = renderContinueCallback;\n\n const resultPromise = renderTask.promise.then(\n async () => {\n showCanvas?.(true);\n await this.#finishRenderTask(renderTask);\n\n this.#renderTextLayer();\n\n if (this.annotationLayer) {\n await this.#renderAnnotationLayer();\n }\n\n if (!this.annotationEditorLayer) {\n const { annotationEditorUIManager } = this.#layerProperties();\n\n if (!annotationEditorUIManager) {\n return;\n }\n this.annotationEditorLayer = new AnnotationEditorLayerBuilder({\n uiManager: annotationEditorUIManager,\n pageDiv: div,\n pdfPage,\n l10n,\n accessibilityManager: this._accessibilityManager,\n });\n }\n this.#renderAnnotationEditorLayer();\n },\n error => {\n // When zooming with a `drawingDelay` set, avoid temporarily showing\n // a black canvas if rendering was cancelled before the `onContinue`-\n // callback had been invoked at least once.\n if (!(error instanceof RenderingCancelledException)) {\n showCanvas?.(true);\n }\n return this.#finishRenderTask(renderTask, error);\n }\n );\n\n if (pdfPage.isPureXfa) {\n if (!this.xfaLayer) {\n const { annotationStorage, linkService } = this.#layerProperties();\n\n this.xfaLayer = new XfaLayerBuilder({\n pageDiv: div,\n pdfPage,\n annotationStorage,\n linkService,\n });\n } else if (this.xfaLayer.div) {\n // The xfa layer needs to stay on top.\n div.append(this.xfaLayer.div);\n }\n this.#renderXfaLayer();\n }\n\n div.setAttribute(\"data-loaded\", true);\n\n this.eventBus.dispatch(\"pagerender\", {\n source: this,\n pageNumber: this.id,\n });\n return resultPromise;\n }\n\n /**\n * @param {string|null} label\n */\n setPageLabel(label) {\n this.pageLabel = typeof label === \"string\" ? label : null;\n\n if (this.pageLabel !== null) {\n this.div.setAttribute(\"data-page-label\", this.pageLabel);\n } else {\n this.div.removeAttribute(\"data-page-label\");\n }\n }\n\n /**\n * For use by the `PDFThumbnailView.setImage`-method.\n * @ignore\n */\n get thumbnailCanvas() {\n const { initialOptionalContent, regularAnnotations } =\n this.#useThumbnailCanvas;\n return initialOptionalContent && regularAnnotations ? this.canvas : null;\n }\n}\n\nexport { PDFPageView };\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(\"../src/display/api\").PDFPageProxy} PDFPageProxy */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/editor/tools.js\").AnnotationEditorUIManager} AnnotationEditorUIManager */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n\nimport { AnnotationEditorLayer } from \"pdfjs-lib\";\nimport { NullL10n } from \"./l10n_utils.js\";\n\n/**\n * @typedef {Object} AnnotationEditorLayerBuilderOptions\n * @property {AnnotationEditorUIManager} [uiManager]\n * @property {HTMLDivElement} pageDiv\n * @property {PDFPageProxy} pdfPage\n * @property {IL10n} [l10n]\n * @property {TextAccessibilityManager} [accessibilityManager]\n */\n\nclass AnnotationEditorLayerBuilder {\n #uiManager;\n\n /**\n * @param {AnnotationEditorLayerBuilderOptions} options\n */\n constructor(options) {\n this.pageDiv = options.pageDiv;\n this.pdfPage = options.pdfPage;\n this.accessibilityManager = options.accessibilityManager;\n this.l10n = options.l10n || NullL10n;\n this.annotationEditorLayer = null;\n this.div = null;\n this._cancelled = false;\n this.#uiManager = options.uiManager;\n }\n\n /**\n * @param {PageViewport} viewport\n * @param {string} intent (default value is 'display')\n */\n async render(viewport, intent = \"display\") {\n if (intent !== \"display\") {\n return;\n }\n\n if (this._cancelled) {\n return;\n }\n\n const clonedViewport = viewport.clone({ dontFlip: true });\n if (this.div) {\n this.annotationEditorLayer.update({ viewport: clonedViewport });\n this.show();\n return;\n }\n\n // Create an AnnotationEditor layer div\n const div = (this.div = document.createElement(\"div\"));\n div.className = \"annotationEditorLayer\";\n div.tabIndex = 0;\n div.hidden = true;\n this.pageDiv.append(div);\n\n this.annotationEditorLayer = new AnnotationEditorLayer({\n uiManager: this.#uiManager,\n div,\n accessibilityManager: this.accessibilityManager,\n pageIndex: this.pdfPage.pageNumber - 1,\n l10n: this.l10n,\n viewport: clonedViewport,\n });\n\n const parameters = {\n viewport: clonedViewport,\n div,\n annotations: null,\n intent,\n };\n\n this.annotationEditorLayer.render(parameters);\n this.show();\n }\n\n cancel() {\n this._cancelled = true;\n\n if (!this.div) {\n return;\n }\n this.pageDiv = null;\n this.annotationEditorLayer.destroy();\n this.div.remove();\n }\n\n hide() {\n if (!this.div) {\n return;\n }\n this.div.hidden = true;\n }\n\n show() {\n if (!this.div || this.annotationEditorLayer.isEmpty) {\n return;\n }\n this.div.hidden = false;\n }\n}\n\nexport { AnnotationEditorLayerBuilder };\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\nconst compatibilityParams = Object.create(null);\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof navigator === \"undefined\"\n ) {\n globalThis.navigator = Object.create(null);\n }\n const userAgent = navigator.userAgent || \"\";\n const platform = navigator.platform || \"\";\n const maxTouchPoints = navigator.maxTouchPoints || 1;\n\n const isAndroid = /Android/.test(userAgent);\n const isIOS =\n /\\b(iPad|iPhone|iPod)(?=;)/.test(userAgent) ||\n (platform === \"MacIntel\" && maxTouchPoints > 1);\n\n // Limit canvas size to 5 mega-pixels on mobile.\n // Support: Android, iOS\n (function checkCanvasSizeLimitation() {\n if (isIOS || isAndroid) {\n compatibilityParams.maxCanvasPixels = 5242880;\n }\n })();\n}\n\nconst OptionKind = {\n VIEWER: 0x02,\n API: 0x04,\n WORKER: 0x08,\n PREFERENCE: 0x80,\n};\n\n/**\n * NOTE: These options are used to generate the `default_preferences.json` file,\n * see `OptionKind.PREFERENCE`, hence the values below must use only\n * primitive types and cannot rely on any imported types.\n */\nconst defaultOptions = {\n annotationEditorMode: {\n /** @type {number} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n annotationMode: {\n /** @type {number} */\n value: 2,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n cursorToolOnLoad: {\n /** @type {number} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n defaultZoomDelay: {\n /** @type {number} */\n value: 400,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n defaultZoomValue: {\n /** @type {string} */\n value: \"\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n disableHistory: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER,\n },\n disablePageLabels: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n enableFloatingToolbar: {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n enablePermissions: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n enablePrintAutoRotate: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n enableScripting: {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"CHROME\"),\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n externalLinkRel: {\n /** @type {string} */\n value: \"noopener noreferrer nofollow\",\n kind: OptionKind.VIEWER,\n },\n externalLinkTarget: {\n /** @type {number} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n historyUpdateUrl: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n ignoreDestinationZoom: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n imageResourcesPath: {\n /** @type {string} */\n value:\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")\n ? \"resource://pdf.js/web/images/\"\n : \"./images/\",\n kind: OptionKind.VIEWER,\n },\n maxCanvasPixels: {\n /** @type {number} */\n value: 16777216,\n kind: OptionKind.VIEWER,\n },\n forcePageColors: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n pageColorsBackground: {\n /** @type {string} */\n value: \"Canvas\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n pageColorsForeground: {\n /** @type {string} */\n value: \"CanvasText\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n pdfBugEnabled: {\n /** @type {boolean} */\n value: typeof PDFJSDev === \"undefined\",\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n printResolution: {\n /** @type {number} */\n value: 150,\n kind: OptionKind.VIEWER,\n },\n sidebarViewOnLoad: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n scrollModeOnLoad: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n spreadModeOnLoad: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n textLayerMode: {\n /** @type {number} */\n value: 1,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n useOnlyCssZoom: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n viewerCssTheme: {\n /** @type {number} */\n value: typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"CHROME\") ? 2 : 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n viewOnLoad: {\n /** @type {boolean} */\n value: 0,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n },\n\n cMapPacked: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API,\n },\n cMapUrl: {\n /** @type {string} */\n value:\n // eslint-disable-next-line no-nested-ternary\n typeof PDFJSDev === \"undefined\"\n ? \"../external/bcmaps/\"\n : PDFJSDev.test(\"MOZCENTRAL\")\n ? \"resource://pdf.js/web/cmaps/\"\n : \"../web/cmaps/\",\n kind: OptionKind.API,\n },\n disableAutoFetch: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n disableFontFace: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n disableRange: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n disableStream: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n docBaseUrl: {\n /** @type {string} */\n value: \"\",\n kind: OptionKind.API,\n },\n enableXfa: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API + OptionKind.PREFERENCE,\n },\n fontExtraProperties: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API,\n },\n isEvalSupported: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API,\n },\n isOffscreenCanvasSupported: {\n /** @type {boolean} */\n value: true,\n kind: OptionKind.API,\n },\n maxImageSize: {\n /** @type {number} */\n value: -1,\n kind: OptionKind.API,\n },\n pdfBug: {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.API,\n },\n standardFontDataUrl: {\n /** @type {string} */\n value:\n // eslint-disable-next-line no-nested-ternary\n typeof PDFJSDev === \"undefined\"\n ? \"../external/standard_fonts/\"\n : PDFJSDev.test(\"MOZCENTRAL\")\n ? \"resource://pdf.js/web/standard_fonts/\"\n : \"../web/standard_fonts/\",\n kind: OptionKind.API,\n },\n verbosity: {\n /** @type {number} */\n value: 1,\n kind: OptionKind.API,\n },\n\n workerPort: {\n /** @type {Object} */\n value: null,\n kind: OptionKind.WORKER,\n },\n workerSrc: {\n /** @type {string} */\n value:\n // eslint-disable-next-line no-nested-ternary\n typeof PDFJSDev === \"undefined\"\n ? \"../src/pdf.worker.js\"\n : PDFJSDev.test(\"MOZCENTRAL\")\n ? \"resource://pdf.js/build/pdf.worker.js\"\n : \"../build/pdf.worker.js\",\n kind: OptionKind.WORKER,\n },\n};\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n defaultOptions.defaultUrl = {\n /** @type {string} */\n value: \"compressed.tracemonkey-pldi-09.pdf\",\n kind: OptionKind.VIEWER,\n };\n defaultOptions.disablePreferences = {\n /** @type {boolean} */\n value: typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\"),\n kind: OptionKind.VIEWER,\n };\n defaultOptions.locale = {\n /** @type {string} */\n value: navigator.language || \"en-US\",\n kind: OptionKind.VIEWER,\n };\n defaultOptions.sandboxBundleSrc = {\n /** @type {string} */\n value:\n typeof PDFJSDev === \"undefined\"\n ? \"../build/dev-sandbox/pdf.sandbox.js\"\n : \"../build/pdf.sandbox.js\",\n kind: OptionKind.VIEWER,\n };\n} else if (PDFJSDev.test(\"CHROME\")) {\n defaultOptions.defaultUrl = {\n /** @type {string} */\n value: \"\",\n kind: OptionKind.VIEWER,\n };\n defaultOptions.disableTelemetry = {\n /** @type {boolean} */\n value: false,\n kind: OptionKind.VIEWER + OptionKind.PREFERENCE,\n };\n defaultOptions.sandboxBundleSrc = {\n /** @type {string} */\n value: \"../build/pdf.sandbox.js\",\n kind: OptionKind.VIEWER,\n };\n}\n\nconst userOptions = Object.create(null);\n\nclass AppOptions {\n constructor() {\n throw new Error(\"Cannot initialize AppOptions.\");\n }\n\n static get(name) {\n const userOption = userOptions[name];\n if (userOption !== undefined) {\n return userOption;\n }\n const defaultOption = defaultOptions[name];\n if (defaultOption !== undefined) {\n return compatibilityParams[name] ?? defaultOption.value;\n }\n return undefined;\n }\n\n static getAll(kind = null) {\n const options = Object.create(null);\n for (const name in defaultOptions) {\n const defaultOption = defaultOptions[name];\n if (kind) {\n if ((kind & defaultOption.kind) === 0) {\n continue;\n }\n if (kind === OptionKind.PREFERENCE) {\n const value = defaultOption.value,\n valueType = typeof value;\n\n if (\n valueType === \"boolean\" ||\n valueType === \"string\" ||\n (valueType === \"number\" && Number.isInteger(value))\n ) {\n options[name] = value;\n continue;\n }\n throw new Error(`Invalid type for preference: ${name}`);\n }\n }\n const userOption = userOptions[name];\n options[name] =\n userOption !== undefined\n ? userOption\n : compatibilityParams[name] ?? defaultOption.value;\n }\n return options;\n }\n\n static set(name, value) {\n userOptions[name] = value;\n }\n\n static setAll(options) {\n for (const name in options) {\n userOptions[name] = options[name];\n }\n }\n\n static remove(name) {\n delete userOptions[name];\n }\n}\n\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n AppOptions._hasUserOptions = function () {\n return Object.keys(userOptions).length > 0;\n };\n}\n\nexport { AppOptions, compatibilityParams, OptionKind };\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\nconst PDF_ROLE_TO_HTML_ROLE = {\n // Document level structure types\n Document: null, // There's a \"document\" role, but it doesn't make sense here.\n DocumentFragment: null,\n // Grouping level structure types\n Part: \"group\",\n Sect: \"group\", // XXX: There's a \"section\" role, but it's abstract.\n Div: \"group\",\n Aside: \"note\",\n NonStruct: \"none\",\n // Block level structure types\n P: null,\n // H<n>,\n H: \"heading\",\n Title: null,\n FENote: \"note\",\n // Sub-block level structure type\n Sub: \"group\",\n // General inline level structure types\n Lbl: null,\n Span: null,\n Em: null,\n Strong: null,\n Link: \"link\",\n Annot: \"note\",\n Form: \"form\",\n // Ruby and Warichu structure types\n Ruby: null,\n RB: null,\n RT: null,\n RP: null,\n Warichu: null,\n WT: null,\n WP: null,\n // List standard structure types\n L: \"list\",\n LI: \"listitem\",\n LBody: null,\n // Table standard structure types\n Table: \"table\",\n TR: \"row\",\n TH: \"columnheader\",\n TD: \"cell\",\n THead: \"columnheader\",\n TBody: null,\n TFoot: null,\n // Standard structure type Caption\n Caption: null,\n // Standard structure type Figure\n Figure: \"figure\",\n // Standard structure type Formula\n Formula: null,\n // standard structure type Artifact\n Artifact: null,\n};\n\nconst HEADING_PATTERN = /^H(\\d+)$/;\n\nclass StructTreeLayerBuilder {\n #treeDom = undefined;\n\n get renderingDone() {\n return this.#treeDom !== undefined;\n }\n\n render(structTree) {\n if (this.#treeDom !== undefined) {\n return this.#treeDom;\n }\n const treeDom = this.#walk(structTree);\n treeDom?.classList.add(\"structTree\");\n return (this.#treeDom = treeDom);\n }\n\n hide() {\n if (this.#treeDom && !this.#treeDom.hidden) {\n this.#treeDom.hidden = true;\n }\n }\n\n show() {\n if (this.#treeDom?.hidden) {\n this.#treeDom.hidden = false;\n }\n }\n\n #setAttributes(structElement, htmlElement) {\n if (structElement.alt !== undefined) {\n htmlElement.setAttribute(\"aria-label\", structElement.alt);\n }\n if (structElement.id !== undefined) {\n htmlElement.setAttribute(\"aria-owns\", structElement.id);\n }\n if (structElement.lang !== undefined) {\n htmlElement.setAttribute(\"lang\", structElement.lang);\n }\n }\n\n #walk(node) {\n if (!node) {\n return null;\n }\n\n const element = document.createElement(\"span\");\n if (\"role\" in node) {\n const { role } = node;\n const match = role.match(HEADING_PATTERN);\n if (match) {\n element.setAttribute(\"role\", \"heading\");\n element.setAttribute(\"aria-level\", match[1]);\n } else if (PDF_ROLE_TO_HTML_ROLE[role]) {\n element.setAttribute(\"role\", PDF_ROLE_TO_HTML_ROLE[role]);\n }\n }\n\n this.#setAttributes(node, element);\n\n if (node.children) {\n if (node.children.length === 1 && \"id\" in node.children[0]) {\n // Often there is only one content node so just set the values on the\n // parent node to avoid creating an extra span.\n this.#setAttributes(node.children[0], element);\n } else {\n for (const kid of node.children) {\n element.append(this.#walk(kid));\n }\n }\n }\n return element;\n }\n}\n\nexport { StructTreeLayerBuilder };\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 { binarySearchFirstItem } from \"./ui_utils.js\";\n\n/**\n * This class aims to provide some methods:\n * - to reorder elements in the DOM with respect to the visual order;\n * - to create a link, using aria-owns, between spans in the textLayer and\n * annotations in the annotationLayer. The goal is to help to know\n * where the annotations are in the text flow.\n */\nclass TextAccessibilityManager {\n #enabled = false;\n\n #textChildren = null;\n\n #textNodes = new Map();\n\n #waitingElements = new Map();\n\n setTextMapping(textDivs) {\n this.#textChildren = textDivs;\n }\n\n /**\n * Compare the positions of two elements, it must correspond to\n * the visual ordering.\n *\n * @param {HTMLElement} e1\n * @param {HTMLElement} e2\n * @returns {number}\n */\n static #compareElementPositions(e1, e2) {\n const rect1 = e1.getBoundingClientRect();\n const rect2 = e2.getBoundingClientRect();\n\n if (rect1.width === 0 && rect1.height === 0) {\n return +1;\n }\n\n if (rect2.width === 0 && rect2.height === 0) {\n return -1;\n }\n\n const top1 = rect1.y;\n const bot1 = rect1.y + rect1.height;\n const mid1 = rect1.y + rect1.height / 2;\n\n const top2 = rect2.y;\n const bot2 = rect2.y + rect2.height;\n const mid2 = rect2.y + rect2.height / 2;\n\n if (mid1 <= top2 && mid2 >= bot1) {\n return -1;\n }\n\n if (mid2 <= top1 && mid1 >= bot2) {\n return +1;\n }\n\n const centerX1 = rect1.x + rect1.width / 2;\n const centerX2 = rect2.x + rect2.width / 2;\n\n return centerX1 - centerX2;\n }\n\n /**\n * Function called when the text layer has finished rendering.\n */\n enable() {\n if (this.#enabled) {\n throw new Error(\"TextAccessibilityManager is already enabled.\");\n }\n if (!this.#textChildren) {\n throw new Error(\"Text divs and strings have not been set.\");\n }\n\n this.#enabled = true;\n this.#textChildren = this.#textChildren.slice();\n this.#textChildren.sort(TextAccessibilityManager.#compareElementPositions);\n\n if (this.#textNodes.size > 0) {\n // Some links have been made before this manager has been disabled, hence\n // we restore them.\n const textChildren = this.#textChildren;\n for (const [id, nodeIndex] of this.#textNodes) {\n const element = document.getElementById(id);\n if (!element) {\n // If the page was *fully* reset the element no longer exists, and it\n // will be re-inserted later (i.e. when the annotationLayer renders).\n this.#textNodes.delete(id);\n continue;\n }\n this.#addIdToAriaOwns(id, textChildren[nodeIndex]);\n }\n }\n\n for (const [element, isRemovable] of this.#waitingElements) {\n this.addPointerInTextLayer(element, isRemovable);\n }\n this.#waitingElements.clear();\n }\n\n disable() {\n if (!this.#enabled) {\n return;\n }\n\n // Don't clear this.#textNodes which is used to rebuild the aria-owns\n // in case it's re-enabled at some point.\n\n this.#waitingElements.clear();\n this.#textChildren = null;\n this.#enabled = false;\n }\n\n /**\n * Remove an aria-owns id from a node in the text layer.\n * @param {HTMLElement} element\n */\n removePointerInTextLayer(element) {\n if (!this.#enabled) {\n this.#waitingElements.delete(element);\n return;\n }\n\n const children = this.#textChildren;\n if (!children || children.length === 0) {\n return;\n }\n\n const { id } = element;\n const nodeIndex = this.#textNodes.get(id);\n if (nodeIndex === undefined) {\n return;\n }\n\n const node = children[nodeIndex];\n\n this.#textNodes.delete(id);\n let owns = node.getAttribute(\"aria-owns\");\n if (owns?.includes(id)) {\n owns = owns\n .split(\" \")\n .filter(x => x !== id)\n .join(\" \");\n if (owns) {\n node.setAttribute(\"aria-owns\", owns);\n } else {\n node.removeAttribute(\"aria-owns\");\n node.setAttribute(\"role\", \"presentation\");\n }\n }\n }\n\n #addIdToAriaOwns(id, node) {\n const owns = node.getAttribute(\"aria-owns\");\n if (!owns?.includes(id)) {\n node.setAttribute(\"aria-owns\", owns ? `${owns} ${id}` : id);\n }\n node.removeAttribute(\"role\");\n }\n\n /**\n * Find the text node which is the nearest and add an aria-owns attribute\n * in order to correctly position this editor in the text flow.\n * @param {HTMLElement} element\n * @param {boolean} isRemovable\n */\n addPointerInTextLayer(element, isRemovable) {\n const { id } = element;\n if (!id) {\n return;\n }\n\n if (!this.#enabled) {\n // The text layer needs to be there, so we postpone the association.\n this.#waitingElements.set(element, isRemovable);\n return;\n }\n\n if (isRemovable) {\n this.removePointerInTextLayer(element);\n }\n\n const children = this.#textChildren;\n if (!children || children.length === 0) {\n return;\n }\n\n const index = binarySearchFirstItem(\n children,\n node =>\n TextAccessibilityManager.#compareElementPositions(element, node) < 0\n );\n\n const nodeIndex = Math.max(0, index - 1);\n this.#addIdToAriaOwns(id, children[nodeIndex]);\n this.#textNodes.set(id, nodeIndex);\n }\n\n /**\n * Move a div in the DOM in order to respect the visual order.\n * @param {HTMLDivElement} element\n */\n moveElementInDOM(container, element, contentElement, isRemovable) {\n this.addPointerInTextLayer(contentElement, isRemovable);\n\n if (!container.hasChildNodes()) {\n container.append(element);\n return;\n }\n\n const children = Array.from(container.childNodes).filter(\n node => node !== element\n );\n\n if (children.length === 0) {\n return;\n }\n\n const elementToCompare = contentElement || element;\n const index = binarySearchFirstItem(\n children,\n node =>\n TextAccessibilityManager.#compareElementPositions(\n elementToCompare,\n node\n ) < 0\n );\n\n if (index === 0) {\n children[0].before(element);\n } else {\n children[index - 1].after(element);\n }\n }\n}\n\nexport { TextAccessibilityManager };\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(\"./event_utils\").EventBus} EventBus */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_find_controller\").PDFFindController} PDFFindController */\n\n/**\n * @typedef {Object} TextHighlighterOptions\n * @property {PDFFindController} findController\n * @property {EventBus} eventBus - The application event bus.\n * @property {number} pageIndex - The page index.\n */\n\n/**\n * TextHighlighter handles highlighting matches from the FindController in\n * either the text layer or XFA layer depending on the type of document.\n */\nclass TextHighlighter {\n /**\n * @param {TextHighlighterOptions} options\n */\n constructor({ findController, eventBus, pageIndex }) {\n this.findController = findController;\n this.matches = [];\n this.eventBus = eventBus;\n this.pageIdx = pageIndex;\n this._onUpdateTextLayerMatches = null;\n this.textDivs = null;\n this.textContentItemsStr = null;\n this.enabled = false;\n }\n\n /**\n * Store two arrays that will map DOM nodes to text they should contain.\n * The arrays should be of equal length and the array element at each index\n * should correspond to the other. e.g.\n * `items[0] = \"<span>Item 0</span>\" and texts[0] = \"Item 0\";\n *\n * @param {Array<Node>} divs\n * @param {Array<string>} texts\n */\n setTextMapping(divs, texts) {\n this.textDivs = divs;\n this.textContentItemsStr = texts;\n }\n\n /**\n * Start listening for events to update the highlighter and check if there are\n * any current matches that need be highlighted.\n */\n enable() {\n if (!this.textDivs || !this.textContentItemsStr) {\n throw new Error(\"Text divs and strings have not been set.\");\n }\n if (this.enabled) {\n throw new Error(\"TextHighlighter is already enabled.\");\n }\n this.enabled = true;\n if (!this._onUpdateTextLayerMatches) {\n this._onUpdateTextLayerMatches = evt => {\n if (evt.pageIndex === this.pageIdx || evt.pageIndex === -1) {\n this._updateMatches();\n }\n };\n this.eventBus._on(\n \"updatetextlayermatches\",\n this._onUpdateTextLayerMatches\n );\n }\n this._updateMatches();\n }\n\n disable() {\n if (!this.enabled) {\n return;\n }\n this.enabled = false;\n if (this._onUpdateTextLayerMatches) {\n this.eventBus._off(\n \"updatetextlayermatches\",\n this._onUpdateTextLayerMatches\n );\n this._onUpdateTextLayerMatches = null;\n }\n this._updateMatches(/* reset = */ true);\n }\n\n _convertMatches(matches, matchesLength) {\n // Early exit if there is nothing to convert.\n if (!matches) {\n return [];\n }\n const { textContentItemsStr } = this;\n\n let i = 0,\n iIndex = 0;\n const end = textContentItemsStr.length - 1;\n const result = [];\n\n for (let m = 0, mm = matches.length; m < mm; m++) {\n // Calculate the start position.\n let matchIdx = matches[m];\n\n // Loop over the divIdxs.\n while (i !== end && matchIdx >= iIndex + textContentItemsStr[i].length) {\n iIndex += textContentItemsStr[i].length;\n i++;\n }\n\n if (i === textContentItemsStr.length) {\n console.error(\"Could not find a matching mapping\");\n }\n\n const match = {\n begin: {\n divIdx: i,\n offset: matchIdx - iIndex,\n },\n };\n\n // Calculate the end position.\n matchIdx += matchesLength[m];\n\n // Somewhat the same array as above, but use > instead of >= to get\n // the end position right.\n while (i !== end && matchIdx > iIndex + textContentItemsStr[i].length) {\n iIndex += textContentItemsStr[i].length;\n i++;\n }\n\n match.end = {\n divIdx: i,\n offset: matchIdx - iIndex,\n };\n result.push(match);\n }\n return result;\n }\n\n _renderMatches(matches) {\n // Early exit if there is nothing to render.\n if (matches.length === 0) {\n return;\n }\n const { findController, pageIdx } = this;\n const { textContentItemsStr, textDivs } = this;\n\n const isSelectedPage = pageIdx === findController.selected.pageIdx;\n const selectedMatchIdx = findController.selected.matchIdx;\n const highlightAll = findController.state.highlightAll;\n let prevEnd = null;\n const infinity = {\n divIdx: -1,\n offset: undefined,\n };\n\n function beginText(begin, className) {\n const divIdx = begin.divIdx;\n textDivs[divIdx].textContent = \"\";\n return appendTextToDiv(divIdx, 0, begin.offset, className);\n }\n\n function appendTextToDiv(divIdx, fromOffset, toOffset, className) {\n let div = textDivs[divIdx];\n if (div.nodeType === Node.TEXT_NODE) {\n const span = document.createElement(\"span\");\n div.before(span);\n span.append(div);\n textDivs[divIdx] = span;\n div = span;\n }\n const content = textContentItemsStr[divIdx].substring(\n fromOffset,\n toOffset\n );\n const node = document.createTextNode(content);\n if (className) {\n const span = document.createElement(\"span\");\n span.className = `${className} appended`;\n span.append(node);\n div.append(span);\n return className.includes(\"selected\") ? span.offsetLeft : 0;\n }\n div.append(node);\n return 0;\n }\n\n let i0 = selectedMatchIdx,\n i1 = i0 + 1;\n if (highlightAll) {\n i0 = 0;\n i1 = matches.length;\n } else if (!isSelectedPage) {\n // Not highlighting all and this isn't the selected page, so do nothing.\n return;\n }\n\n let lastDivIdx = -1;\n let lastOffset = -1;\n for (let i = i0; i < i1; i++) {\n const match = matches[i];\n const begin = match.begin;\n if (begin.divIdx === lastDivIdx && begin.offset === lastOffset) {\n // It's possible to be in this situation if we searched for a 'f' and we\n // have a ligature 'ff' in the text. The 'ff' has to be highlighted two\n // times.\n continue;\n }\n lastDivIdx = begin.divIdx;\n lastOffset = begin.offset;\n\n const end = match.end;\n const isSelected = isSelectedPage && i === selectedMatchIdx;\n const highlightSuffix = isSelected ? \" selected\" : \"\";\n let selectedLeft = 0;\n\n // Match inside new div.\n if (!prevEnd || begin.divIdx !== prevEnd.divIdx) {\n // If there was a previous div, then add the text at the end.\n if (prevEnd !== null) {\n appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);\n }\n // Clear the divs and set the content until the starting point.\n beginText(begin);\n } else {\n appendTextToDiv(prevEnd.divIdx, prevEnd.offset, begin.offset);\n }\n\n if (begin.divIdx === end.divIdx) {\n selectedLeft = appendTextToDiv(\n begin.divIdx,\n begin.offset,\n end.offset,\n \"highlight\" + highlightSuffix\n );\n } else {\n selectedLeft = appendTextToDiv(\n begin.divIdx,\n begin.offset,\n infinity.offset,\n \"highlight begin\" + highlightSuffix\n );\n for (let n0 = begin.divIdx + 1, n1 = end.divIdx; n0 < n1; n0++) {\n textDivs[n0].className = \"highlight middle\" + highlightSuffix;\n }\n beginText(end, \"highlight end\" + highlightSuffix);\n }\n prevEnd = end;\n\n if (isSelected) {\n // Attempt to scroll the selected match into view.\n findController.scrollMatchIntoView({\n element: textDivs[begin.divIdx],\n selectedLeft,\n pageIndex: pageIdx,\n matchIndex: selectedMatchIdx,\n });\n }\n }\n\n if (prevEnd) {\n appendTextToDiv(prevEnd.divIdx, prevEnd.offset, infinity.offset);\n }\n }\n\n _updateMatches(reset = false) {\n if (!this.enabled && !reset) {\n return;\n }\n const { findController, matches, pageIdx } = this;\n const { textContentItemsStr, textDivs } = this;\n let clearedUntilDivIdx = -1;\n\n // Clear all current matches.\n for (const match of matches) {\n const begin = Math.max(clearedUntilDivIdx, match.begin.divIdx);\n for (let n = begin, end = match.end.divIdx; n <= end; n++) {\n const div = textDivs[n];\n div.textContent = textContentItemsStr[n];\n div.className = \"\";\n }\n clearedUntilDivIdx = match.end.divIdx + 1;\n }\n\n if (!findController?.highlightMatches || reset) {\n return;\n }\n // Convert the matches on the `findController` into the match format\n // used for the textLayer.\n const pageMatches = findController.pageMatches[pageIdx] || null;\n const pageMatchesLength = findController.pageMatchesLength[pageIdx] || null;\n\n this.matches = this._convertMatches(pageMatches, pageMatchesLength);\n this._renderMatches(this.matches);\n }\n}\n\nexport { TextHighlighter };\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(\"../src/display/display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"../src/display/api\").TextContent} TextContent */\n/** @typedef {import(\"./text_highlighter\").TextHighlighter} TextHighlighter */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n\nimport { normalizeUnicode, renderTextLayer, updateTextLayer } from \"pdfjs-lib\";\nimport { removeNullCharacters } from \"./ui_utils.js\";\n\n/**\n * @typedef {Object} TextLayerBuilderOptions\n * @property {TextHighlighter} highlighter - Optional object that will handle\n * highlighting text from the find controller.\n * @property {TextAccessibilityManager} [accessibilityManager]\n * @property {boolean} [isOffscreenCanvasSupported] - Allows to use an\n * OffscreenCanvas if needed.\n */\n\n/**\n * The text layer builder provides text selection functionality for the PDF.\n * It does this by creating overlay divs over the PDF's text. These divs\n * contain text that matches the PDF text they are overlaying.\n */\nclass TextLayerBuilder {\n #enablePermissions = false;\n\n #rotation = 0;\n\n #scale = 0;\n\n #textContentSource = null;\n\n constructor({\n highlighter = null,\n accessibilityManager = null,\n isOffscreenCanvasSupported = true,\n enablePermissions = false,\n }) {\n this.textContentItemsStr = [];\n this.renderingDone = false;\n this.textDivs = [];\n this.textDivProperties = new WeakMap();\n this.textLayerRenderTask = null;\n this.highlighter = highlighter;\n this.accessibilityManager = accessibilityManager;\n this.isOffscreenCanvasSupported = isOffscreenCanvasSupported;\n this.#enablePermissions = enablePermissions === true;\n\n this.div = document.createElement(\"div\");\n this.div.className = \"textLayer\";\n this.hide();\n }\n\n #finishRendering() {\n this.renderingDone = true;\n\n const endOfContent = document.createElement(\"div\");\n endOfContent.className = \"endOfContent\";\n this.div.append(endOfContent);\n\n this.#bindMouse();\n }\n\n get numTextDivs() {\n return this.textDivs.length;\n }\n\n /**\n * Renders the text layer.\n * @param {PageViewport} viewport\n */\n async render(viewport) {\n if (!this.#textContentSource) {\n throw new Error('No \"textContentSource\" parameter specified.');\n }\n\n const scale = viewport.scale * (globalThis.devicePixelRatio || 1);\n const { rotation } = viewport;\n if (this.renderingDone) {\n const mustRotate = rotation !== this.#rotation;\n const mustRescale = scale !== this.#scale;\n if (mustRotate || mustRescale) {\n this.hide();\n updateTextLayer({\n container: this.div,\n viewport,\n textDivs: this.textDivs,\n textDivProperties: this.textDivProperties,\n isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,\n mustRescale,\n mustRotate,\n });\n this.#scale = scale;\n this.#rotation = rotation;\n }\n this.show();\n return;\n }\n\n this.cancel();\n this.highlighter?.setTextMapping(this.textDivs, this.textContentItemsStr);\n this.accessibilityManager?.setTextMapping(this.textDivs);\n\n this.textLayerRenderTask = renderTextLayer({\n textContentSource: this.#textContentSource,\n container: this.div,\n viewport,\n textDivs: this.textDivs,\n textDivProperties: this.textDivProperties,\n textContentItemsStr: this.textContentItemsStr,\n isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,\n });\n\n await this.textLayerRenderTask.promise;\n this.#finishRendering();\n this.#scale = scale;\n this.#rotation = rotation;\n this.show();\n this.accessibilityManager?.enable();\n }\n\n hide() {\n if (!this.div.hidden) {\n // We turn off the highlighter in order to avoid to scroll into view an\n // element of the text layer which could be hidden.\n this.highlighter?.disable();\n this.div.hidden = true;\n }\n }\n\n show() {\n if (this.div.hidden && this.renderingDone) {\n this.div.hidden = false;\n this.highlighter?.enable();\n }\n }\n\n /**\n * Cancel rendering of the text layer.\n */\n cancel() {\n if (this.textLayerRenderTask) {\n this.textLayerRenderTask.cancel();\n this.textLayerRenderTask = null;\n }\n this.highlighter?.disable();\n this.accessibilityManager?.disable();\n this.textContentItemsStr.length = 0;\n this.textDivs.length = 0;\n this.textDivProperties = new WeakMap();\n }\n\n /**\n * @param {ReadableStream | TextContent} source\n */\n setTextContentSource(source) {\n this.cancel();\n this.#textContentSource = source;\n }\n\n /**\n * Improves text selection by adding an additional div where the mouse was\n * clicked. This reduces flickering of the content if the mouse is slowly\n * dragged up or down.\n */\n #bindMouse() {\n const { div } = this;\n\n div.addEventListener(\"mousedown\", evt => {\n const end = div.querySelector(\".endOfContent\");\n if (!end) {\n return;\n }\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n // On non-Firefox browsers, the selection will feel better if the height\n // of the `endOfContent` div is adjusted to start at mouse click\n // location. This avoids flickering when the selection moves up.\n // However it does not work when selection is started on empty space.\n let adjustTop = evt.target !== div;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n adjustTop &&=\n getComputedStyle(end).getPropertyValue(\"-moz-user-select\") !==\n \"none\";\n }\n if (adjustTop) {\n const divBounds = div.getBoundingClientRect();\n const r = Math.max(0, (evt.pageY - divBounds.top) / divBounds.height);\n end.style.top = (r * 100).toFixed(2) + \"%\";\n }\n }\n end.classList.add(\"active\");\n });\n\n div.addEventListener(\"mouseup\", () => {\n const end = div.querySelector(\".endOfContent\");\n if (!end) {\n return;\n }\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n end.style.top = \"\";\n }\n end.classList.remove(\"active\");\n });\n\n div.addEventListener(\"copy\", event => {\n if (!this.#enablePermissions) {\n const selection = document.getSelection();\n event.clipboardData.setData(\n \"text/plain\",\n removeNullCharacters(normalizeUnicode(selection.toString()))\n );\n }\n event.preventDefault();\n event.stopPropagation();\n });\n }\n}\n\nexport { TextLayerBuilder };\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(\"../src/display/api\").PDFPageProxy} PDFPageProxy */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { XfaLayer } from \"pdfjs-lib\";\n\n/**\n * @typedef {Object} XfaLayerBuilderOptions\n * @property {HTMLDivElement} pageDiv\n * @property {PDFPageProxy} pdfPage\n * @property {AnnotationStorage} [annotationStorage]\n * @property {IPDFLinkService} linkService\n * @property {Object} [xfaHtml]\n */\n\nclass XfaLayerBuilder {\n /**\n * @param {XfaLayerBuilderOptions} options\n */\n constructor({\n pageDiv,\n pdfPage,\n annotationStorage = null,\n linkService,\n xfaHtml = null,\n }) {\n this.pageDiv = pageDiv;\n this.pdfPage = pdfPage;\n this.annotationStorage = annotationStorage;\n this.linkService = linkService;\n this.xfaHtml = xfaHtml;\n\n this.div = null;\n this._cancelled = false;\n }\n\n /**\n * @param {PageViewport} viewport\n * @param {string} intent (default value is 'display')\n * @returns {Promise<Object | void>} A promise that is resolved when rendering\n * of the XFA layer is complete. The first rendering will return an object\n * with a `textDivs` property that can be used with the TextHighlighter.\n */\n async render(viewport, intent = \"display\") {\n if (intent === \"print\") {\n const parameters = {\n viewport: viewport.clone({ dontFlip: true }),\n div: this.div,\n xfaHtml: this.xfaHtml,\n annotationStorage: this.annotationStorage,\n linkService: this.linkService,\n intent,\n };\n\n // Create an xfa layer div and render the form\n const div = document.createElement(\"div\");\n this.pageDiv.append(div);\n parameters.div = div;\n\n return XfaLayer.render(parameters);\n }\n\n // intent === \"display\"\n const xfaHtml = await this.pdfPage.getXfa();\n if (this._cancelled || !xfaHtml) {\n return { textDivs: [] };\n }\n\n const parameters = {\n viewport: viewport.clone({ dontFlip: true }),\n div: this.div,\n xfaHtml,\n annotationStorage: this.annotationStorage,\n linkService: this.linkService,\n intent,\n };\n\n if (this.div) {\n return XfaLayer.update(parameters);\n }\n // Create an xfa layer div and render the form\n this.div = document.createElement(\"div\");\n this.pageDiv.append(this.div);\n parameters.div = this.div;\n\n return XfaLayer.render(parameters);\n }\n\n cancel() {\n this._cancelled = true;\n }\n\n hide() {\n if (!this.div) {\n return;\n }\n this.div.hidden = true;\n }\n}\n\nexport { XfaLayerBuilder };\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(\"./event_utils\").EventBus} EventBus */\n\nimport { apiPageLayoutToViewerModes, RenderingStates } from \"./ui_utils.js\";\nimport { PromiseCapability, shadow } from \"pdfjs-lib\";\n\n/**\n * @typedef {Object} PDFScriptingManagerOptions\n * @property {EventBus} eventBus - The application event bus.\n * @property {string} sandboxBundleSrc - The path and filename of the scripting\n * bundle.\n * @property {Object} [scriptingFactory] - The factory that is used when\n * initializing scripting; must contain a `createScripting` method.\n * PLEASE NOTE: Primarily intended for the default viewer use-case.\n * @property {function} [docPropertiesLookup] - The function that is used to\n * lookup the necessary document properties.\n */\n\nclass PDFScriptingManager {\n /**\n * @param {PDFScriptingManagerOptions} options\n */\n constructor({\n eventBus,\n sandboxBundleSrc = null,\n scriptingFactory = null,\n docPropertiesLookup = null,\n }) {\n this._pdfDocument = null;\n this._pdfViewer = null;\n this._closeCapability = null;\n this._destroyCapability = null;\n\n this._scripting = null;\n this._ready = false;\n\n this._eventBus = eventBus;\n this._sandboxBundleSrc = sandboxBundleSrc;\n this._scriptingFactory = scriptingFactory;\n this._docPropertiesLookup = docPropertiesLookup;\n\n // The default viewer already handles adding/removing of DOM events,\n // hence limit this to only the viewer components.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"COMPONENTS\") &&\n !this._scriptingFactory\n ) {\n window.addEventListener(\"updatefromsandbox\", event => {\n this._eventBus.dispatch(\"updatefromsandbox\", {\n source: window,\n detail: event.detail,\n });\n });\n }\n }\n\n setViewer(pdfViewer) {\n this._pdfViewer = pdfViewer;\n }\n\n async setDocument(pdfDocument) {\n if (this._pdfDocument) {\n await this._destroyScripting();\n }\n this._pdfDocument = pdfDocument;\n\n if (!pdfDocument) {\n return;\n }\n const [objects, calculationOrder, docActions] = await Promise.all([\n pdfDocument.getFieldObjects(),\n pdfDocument.getCalculationOrderIds(),\n pdfDocument.getJSActions(),\n ]);\n\n if (!objects && !docActions) {\n // No FieldObjects or JavaScript actions were found in the document.\n await this._destroyScripting();\n return;\n }\n if (pdfDocument !== this._pdfDocument) {\n return; // The document was closed while the data resolved.\n }\n try {\n this._scripting = this._createScripting();\n } catch (error) {\n console.error(`PDFScriptingManager.setDocument: \"${error?.message}\".`);\n\n await this._destroyScripting();\n return;\n }\n\n this._internalEvents.set(\"updatefromsandbox\", event => {\n if (event?.source !== window) {\n return;\n }\n this._updateFromSandbox(event.detail);\n });\n this._internalEvents.set(\"dispatcheventinsandbox\", event => {\n this._scripting?.dispatchEventInSandbox(event.detail);\n });\n\n this._internalEvents.set(\"pagechanging\", ({ pageNumber, previous }) => {\n if (pageNumber === previous) {\n return; // The current page didn't change.\n }\n this._dispatchPageClose(previous);\n this._dispatchPageOpen(pageNumber);\n });\n this._internalEvents.set(\"pagerendered\", ({ pageNumber }) => {\n if (!this._pageOpenPending.has(pageNumber)) {\n return; // No pending \"PageOpen\" event for the newly rendered page.\n }\n if (pageNumber !== this._pdfViewer.currentPageNumber) {\n return; // The newly rendered page is no longer the current one.\n }\n this._dispatchPageOpen(pageNumber);\n });\n this._internalEvents.set(\"pagesdestroy\", async event => {\n await this._dispatchPageClose(this._pdfViewer.currentPageNumber);\n\n await this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"WillClose\",\n });\n\n this._closeCapability?.resolve();\n });\n\n for (const [name, listener] of this._internalEvents) {\n this._eventBus._on(name, listener);\n }\n\n try {\n const docProperties = await this._getDocProperties();\n if (pdfDocument !== this._pdfDocument) {\n return; // The document was closed while the properties resolved.\n }\n\n await this._scripting.createSandbox({\n objects,\n calculationOrder,\n appInfo: {\n platform: navigator.platform,\n language: navigator.language,\n },\n docInfo: {\n ...docProperties,\n actions: docActions,\n },\n });\n\n this._eventBus.dispatch(\"sandboxcreated\", { source: this });\n } catch (error) {\n console.error(`PDFScriptingManager.setDocument: \"${error?.message}\".`);\n\n await this._destroyScripting();\n return;\n }\n\n await this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"Open\",\n });\n await this._dispatchPageOpen(\n this._pdfViewer.currentPageNumber,\n /* initialize = */ true\n );\n\n // Defer this slightly, to ensure that scripting is *fully* initialized.\n Promise.resolve().then(() => {\n if (pdfDocument === this._pdfDocument) {\n this._ready = true;\n }\n });\n }\n\n async dispatchWillSave(detail) {\n return this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"WillSave\",\n });\n }\n\n async dispatchDidSave(detail) {\n return this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"DidSave\",\n });\n }\n\n async dispatchWillPrint(detail) {\n return this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"WillPrint\",\n });\n }\n\n async dispatchDidPrint(detail) {\n return this._scripting?.dispatchEventInSandbox({\n id: \"doc\",\n name: \"DidPrint\",\n });\n }\n\n get destroyPromise() {\n return this._destroyCapability?.promise || null;\n }\n\n get ready() {\n return this._ready;\n }\n\n /**\n * @private\n */\n get _internalEvents() {\n return shadow(this, \"_internalEvents\", new Map());\n }\n\n /**\n * @private\n */\n get _pageOpenPending() {\n return shadow(this, \"_pageOpenPending\", new Set());\n }\n\n /**\n * @private\n */\n get _visitedPages() {\n return shadow(this, \"_visitedPages\", new Map());\n }\n\n /**\n * @private\n */\n async _updateFromSandbox(detail) {\n // Ignore some events, see below, that don't make sense in PresentationMode.\n const isInPresentationMode =\n this._pdfViewer.isInPresentationMode ||\n this._pdfViewer.isChangingPresentationMode;\n\n const { id, siblings, command, value } = detail;\n if (!id) {\n switch (command) {\n case \"clear\":\n console.clear();\n break;\n case \"error\":\n console.error(value);\n break;\n case \"layout\": {\n // NOTE: Always ignore the pageLayout in GeckoView since there's\n // no UI available to change Scroll/Spread modes for the user.\n if (\n (typeof PDFJSDev === \"undefined\"\n ? window.isGECKOVIEW\n : PDFJSDev.test(\"GECKOVIEW\")) ||\n isInPresentationMode\n ) {\n return;\n }\n const modes = apiPageLayoutToViewerModes(value);\n this._pdfViewer.spreadMode = modes.spreadMode;\n break;\n }\n case \"page-num\":\n this._pdfViewer.currentPageNumber = value + 1;\n break;\n case \"print\":\n await this._pdfViewer.pagesPromise;\n this._eventBus.dispatch(\"print\", { source: this });\n break;\n case \"println\":\n console.log(value);\n break;\n case \"zoom\":\n if (isInPresentationMode) {\n return;\n }\n this._pdfViewer.currentScaleValue = value;\n break;\n case \"SaveAs\":\n this._eventBus.dispatch(\"download\", { source: this });\n break;\n case \"FirstPage\":\n this._pdfViewer.currentPageNumber = 1;\n break;\n case \"LastPage\":\n this._pdfViewer.currentPageNumber = this._pdfViewer.pagesCount;\n break;\n case \"NextPage\":\n this._pdfViewer.nextPage();\n break;\n case \"PrevPage\":\n this._pdfViewer.previousPage();\n break;\n case \"ZoomViewIn\":\n if (isInPresentationMode) {\n return;\n }\n this._pdfViewer.increaseScale();\n break;\n case \"ZoomViewOut\":\n if (isInPresentationMode) {\n return;\n }\n this._pdfViewer.decreaseScale();\n break;\n }\n return;\n }\n\n if (isInPresentationMode) {\n if (detail.focus) {\n return;\n }\n }\n delete detail.id;\n delete detail.siblings;\n\n const ids = siblings ? [id, ...siblings] : [id];\n for (const elementId of ids) {\n const element = document.querySelector(\n `[data-element-id=\"${elementId}\"]`\n );\n if (element) {\n element.dispatchEvent(new CustomEvent(\"updatefromsandbox\", { detail }));\n } else {\n // The element hasn't been rendered yet, use the AnnotationStorage.\n this._pdfDocument?.annotationStorage.setValue(elementId, detail);\n }\n }\n }\n\n /**\n * @private\n */\n async _dispatchPageOpen(pageNumber, initialize = false) {\n const pdfDocument = this._pdfDocument,\n visitedPages = this._visitedPages;\n\n if (initialize) {\n this._closeCapability = new PromiseCapability();\n }\n if (!this._closeCapability) {\n return; // Scripting isn't fully initialized yet.\n }\n const pageView = this._pdfViewer.getPageView(/* index = */ pageNumber - 1);\n\n if (pageView?.renderingState !== RenderingStates.FINISHED) {\n this._pageOpenPending.add(pageNumber);\n return; // Wait for the page to finish rendering.\n }\n this._pageOpenPending.delete(pageNumber);\n\n const actionsPromise = (async () => {\n // Avoid sending, and thus serializing, the `actions` data more than once.\n const actions = await (!visitedPages.has(pageNumber)\n ? pageView.pdfPage?.getJSActions()\n : null);\n if (pdfDocument !== this._pdfDocument) {\n return; // The document was closed while the actions resolved.\n }\n\n await this._scripting?.dispatchEventInSandbox({\n id: \"page\",\n name: \"PageOpen\",\n pageNumber,\n actions,\n });\n })();\n visitedPages.set(pageNumber, actionsPromise);\n }\n\n /**\n * @private\n */\n async _dispatchPageClose(pageNumber) {\n const pdfDocument = this._pdfDocument,\n visitedPages = this._visitedPages;\n\n if (!this._closeCapability) {\n return; // Scripting isn't fully initialized yet.\n }\n if (this._pageOpenPending.has(pageNumber)) {\n return; // The page is still rendering; no \"PageOpen\" event dispatched.\n }\n const actionsPromise = visitedPages.get(pageNumber);\n if (!actionsPromise) {\n return; // The \"PageClose\" event must be preceded by a \"PageOpen\" event.\n }\n visitedPages.set(pageNumber, null);\n\n // Ensure that the \"PageOpen\" event is dispatched first.\n await actionsPromise;\n if (pdfDocument !== this._pdfDocument) {\n return; // The document was closed while the actions resolved.\n }\n\n await this._scripting?.dispatchEventInSandbox({\n id: \"page\",\n name: \"PageClose\",\n pageNumber,\n });\n }\n\n /**\n * @returns {Promise<Object>} A promise that is resolved with an {Object}\n * containing the necessary document properties; please find the expected\n * format in `PDFViewerApplication._scriptingDocProperties`.\n * @private\n */\n async _getDocProperties() {\n if (this._docPropertiesLookup) {\n return this._docPropertiesLookup(this._pdfDocument);\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"COMPONENTS\")) {\n const { docPropertiesLookup } = require(\"./generic_scripting.js\");\n\n return docPropertiesLookup(this._pdfDocument);\n }\n throw new Error(\"_getDocProperties: Unable to lookup properties.\");\n }\n\n /**\n * @private\n */\n _createScripting() {\n this._destroyCapability = new PromiseCapability();\n\n if (this._scripting) {\n throw new Error(\"_createScripting: Scripting already exists.\");\n }\n if (this._scriptingFactory) {\n return this._scriptingFactory.createScripting({\n sandboxBundleSrc: this._sandboxBundleSrc,\n });\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"COMPONENTS\")) {\n const { GenericScripting } = require(\"./generic_scripting.js\");\n\n return new GenericScripting(this._sandboxBundleSrc);\n }\n throw new Error(\"_createScripting: Cannot create scripting.\");\n }\n\n /**\n * @private\n */\n async _destroyScripting() {\n if (!this._scripting) {\n this._pdfDocument = null;\n\n this._destroyCapability?.resolve();\n return;\n }\n if (this._closeCapability) {\n await Promise.race([\n this._closeCapability.promise,\n new Promise(resolve => {\n // Avoid the scripting/sandbox-destruction hanging indefinitely.\n setTimeout(resolve, 1000);\n }),\n ]).catch(reason => {\n // Ignore any errors, to ensure that the sandbox is always destroyed.\n });\n this._closeCapability = null;\n }\n this._pdfDocument = null;\n\n try {\n await this._scripting.destroySandbox();\n } catch (ex) {}\n\n for (const [name, listener] of this._internalEvents) {\n this._eventBus._off(name, listener);\n }\n this._internalEvents.clear();\n\n this._pageOpenPending.clear();\n this._visitedPages.clear();\n\n this._scripting = null;\n this._ready = false;\n\n this._destroyCapability?.resolve();\n }\n}\n\nexport { PDFScriptingManager };\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 { getPdfFilenameFromUrl, loadScript } from \"pdfjs-lib\";\n\nasync function docPropertiesLookup(pdfDocument) {\n const url = \"\",\n baseUrl = url.split(\"#\")[0];\n // eslint-disable-next-line prefer-const\n let { info, metadata, contentDispositionFilename, contentLength } =\n await pdfDocument.getMetadata();\n\n if (!contentLength) {\n const { length } = await pdfDocument.getDownloadInfo();\n contentLength = length;\n }\n\n return {\n ...info,\n baseURL: baseUrl,\n filesize: contentLength,\n filename: contentDispositionFilename || getPdfFilenameFromUrl(url),\n metadata: metadata?.getRaw(),\n authors: metadata?.get(\"dc:creator\"),\n numPages: pdfDocument.numPages,\n URL: url,\n };\n}\n\nclass GenericScripting {\n constructor(sandboxBundleSrc) {\n this._ready = loadScript(\n sandboxBundleSrc,\n /* removeScriptElement = */ true\n ).then(() => {\n return window.pdfjsSandbox.QuickJSSandbox();\n });\n }\n\n async createSandbox(data) {\n const sandbox = await this._ready;\n sandbox.create(data);\n }\n\n async dispatchEventInSandbox(event) {\n const sandbox = await this._ready;\n setTimeout(() => sandbox.dispatchEvent(event), 0);\n }\n\n async destroySandbox() {\n const sandbox = await this._ready;\n sandbox.nukeSandbox();\n }\n}\n\nexport { docPropertiesLookup, GenericScripting };\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 { ScrollMode, SpreadMode } from \"./ui_utils.js\";\nimport { PDFViewer } from \"./pdf_viewer.js\";\n\nclass PDFSinglePageViewer extends PDFViewer {\n _resetView() {\n super._resetView();\n this._scrollMode = ScrollMode.PAGE;\n this._spreadMode = SpreadMode.NONE;\n }\n\n // eslint-disable-next-line accessor-pairs\n set scrollMode(mode) {}\n\n _updateScrollMode() {}\n\n // eslint-disable-next-line accessor-pairs\n set spreadMode(mode) {}\n\n _updateSpreadMode() {}\n}\n\nexport { PDFSinglePageViewer };\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(\"../src/display/api\").PDFDocumentProxy} PDFDocumentProxy */\n/** @typedef {import(\"../src/display/api\").PDFPageProxy} PDFPageProxy */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../src/display/optional_content_config\").OptionalContentConfig} OptionalContentConfig */\n/** @typedef {import(\"./event_utils\").EventBus} EventBus */\n/** @typedef {import(\"./interfaces\").IDownloadManager} IDownloadManager */\n/** @typedef {import(\"./interfaces\").IL10n} IL10n */\n/** @typedef {import(\"./interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport {\n AnnotationEditorType,\n AnnotationEditorUIManager,\n AnnotationMode,\n PermissionFlag,\n PixelsPerInch,\n PromiseCapability,\n version,\n} from \"pdfjs-lib\";\nimport {\n DEFAULT_SCALE,\n DEFAULT_SCALE_DELTA,\n DEFAULT_SCALE_VALUE,\n docStyle,\n getVisibleElements,\n isPortraitOrientation,\n isValidRotation,\n isValidScrollMode,\n isValidSpreadMode,\n MAX_AUTO_SCALE,\n MAX_SCALE,\n MIN_SCALE,\n PresentationModeState,\n removeNullCharacters,\n RenderingStates,\n SCROLLBAR_PADDING,\n scrollIntoView,\n ScrollMode,\n SpreadMode,\n TextLayerMode,\n UNKNOWN_SCALE,\n VERTICAL_PADDING,\n watchScroll,\n} from \"./ui_utils.js\";\nimport { NullL10n } from \"./l10n_utils.js\";\nimport { PDFPageView } from \"./pdf_page_view.js\";\nimport { PDFRenderingQueue } from \"./pdf_rendering_queue.js\";\nimport { SimpleLinkService } from \"./pdf_link_service.js\";\n\nconst DEFAULT_CACHE_SIZE = 10;\n\nconst PagesCountLimit = {\n FORCE_SCROLL_MODE_PAGE: 15000,\n FORCE_LAZY_PAGE_INIT: 7500,\n PAUSE_EAGER_PAGE_INIT: 250,\n};\n\nfunction isValidAnnotationEditorMode(mode) {\n return (\n Object.values(AnnotationEditorType).includes(mode) &&\n mode !== AnnotationEditorType.DISABLE\n );\n}\n\n/**\n * @typedef {Object} PDFViewerOptions\n * @property {HTMLDivElement} container - The container for the viewer element.\n * @property {HTMLDivElement} [viewer] - The viewer element.\n * @property {EventBus} eventBus - The application event bus.\n * @property {IPDFLinkService} [linkService] - The navigation/linking service.\n * @property {IDownloadManager} [downloadManager] - The download manager\n * component.\n * @property {PDFFindController} [findController] - The find controller\n * component.\n * @property {PDFScriptingManager} [scriptingManager] - The scripting manager\n * component.\n * @property {PDFRenderingQueue} [renderingQueue] - The rendering queue object.\n * @property {boolean} [removePageBorders] - Removes the border shadow around\n * the pages. The default value is `false`.\n * @property {number} [textLayerMode] - Controls if the text layer used for\n * selection and searching is created. The constants from {TextLayerMode}\n * should be used. The default value is `TextLayerMode.ENABLE`.\n * @property {number} [annotationMode] - Controls if the annotation layer is\n * created, and if interactive form elements or `AnnotationStorage`-data are\n * being rendered. The constants from {@link AnnotationMode} should be used;\n * see also {@link RenderParameters} and {@link GetOperatorListParameters}.\n * The default value is `AnnotationMode.ENABLE_FORMS`.\n * @property {number} [annotationEditorMode] - Enables the creation and editing\n * of new Annotations. The constants from {@link AnnotationEditorType} should\n * be used. The default value is `AnnotationEditorType.NONE`.\n * @property {string} [imageResourcesPath] - Path for image resources, mainly\n * mainly for annotation icons. Include trailing slash.\n * @property {boolean} [enablePrintAutoRotate] - Enables automatic rotation of\n * landscape pages upon printing. The default is `false`.\n * @property {boolean} [useOnlyCssZoom] - Enables CSS only zooming. The default\n * value is `false`.\n * @property {boolean} [isOffscreenCanvasSupported] - Allows to use an\n * OffscreenCanvas if needed.\n * @property {number} [maxCanvasPixels] - The maximum supported canvas size in\n * total pixels, i.e. width * height. Use -1 for no limit. The default value\n * is 4096 * 4096 (16 mega-pixels).\n * @property {IL10n} [l10n] - Localization service.\n * @property {boolean} [enablePermissions] - Enables PDF document permissions,\n * when they exist. The default value is `false`.\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 */\n\nclass PDFPageViewBuffer {\n // Here we rely on the fact that `Set`s preserve the insertion order.\n #buf = new Set();\n\n #size = 0;\n\n constructor(size) {\n this.#size = size;\n }\n\n push(view) {\n const buf = this.#buf;\n if (buf.has(view)) {\n buf.delete(view); // Move the view to the \"end\" of the buffer.\n }\n buf.add(view);\n\n if (buf.size > this.#size) {\n this.#destroyFirstView();\n }\n }\n\n /**\n * After calling resize, the size of the buffer will be `newSize`.\n * The optional parameter `idsToKeep` is, if present, a Set of page-ids to\n * push to the back of the buffer, delaying their destruction. The size of\n * `idsToKeep` has no impact on the final size of the buffer; if `idsToKeep`\n * is larger than `newSize`, some of those pages will be destroyed anyway.\n */\n resize(newSize, idsToKeep = null) {\n this.#size = newSize;\n\n const buf = this.#buf;\n if (idsToKeep) {\n const ii = buf.size;\n let i = 1;\n for (const view of buf) {\n if (idsToKeep.has(view.id)) {\n buf.delete(view); // Move the view to the \"end\" of the buffer.\n buf.add(view);\n }\n if (++i > ii) {\n break;\n }\n }\n }\n\n while (buf.size > this.#size) {\n this.#destroyFirstView();\n }\n }\n\n has(view) {\n return this.#buf.has(view);\n }\n\n [Symbol.iterator]() {\n return this.#buf.keys();\n }\n\n #destroyFirstView() {\n const firstView = this.#buf.keys().next().value;\n\n firstView?.destroy();\n this.#buf.delete(firstView);\n }\n}\n\n/**\n * Simple viewer control to display PDF content/pages.\n */\nclass PDFViewer {\n #buffer = null;\n\n #annotationEditorMode = AnnotationEditorType.NONE;\n\n #annotationEditorUIManager = null;\n\n #annotationMode = AnnotationMode.ENABLE_FORMS;\n\n #containerTopLeft = null;\n\n #copyCallbackBound = null;\n\n #enablePermissions = false;\n\n #getAllTextInProgress = false;\n\n #hiddenCopyElement = null;\n\n #interruptCopyCondition = false;\n\n #previousContainerHeight = 0;\n\n #resizeObserver = new ResizeObserver(this.#resizeObserverCallback.bind(this));\n\n #scrollModePageState = null;\n\n #onVisibilityChange = null;\n\n #scaleTimeoutId = null;\n\n #textLayerMode = TextLayerMode.ENABLE;\n\n /**\n * @param {PDFViewerOptions} options\n */\n constructor(options) {\n const viewerVersion =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_VERSION\") : null;\n if (version !== viewerVersion) {\n throw new Error(\n `The API version \"${version}\" does not match the Viewer version \"${viewerVersion}\".`\n );\n }\n this.container = options.container;\n this.viewer = options.viewer || options.container.firstElementChild;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (this.container?.tagName !== \"DIV\" || this.viewer?.tagName !== \"DIV\") {\n throw new Error(\"Invalid `container` and/or `viewer` option.\");\n }\n\n if (\n this.container.offsetParent &&\n getComputedStyle(this.container).position !== \"absolute\"\n ) {\n throw new Error(\"The `container` must be absolutely positioned.\");\n }\n }\n this.#resizeObserver.observe(this.container);\n\n this.eventBus = options.eventBus;\n this.linkService = options.linkService || new SimpleLinkService();\n this.downloadManager = options.downloadManager || null;\n this.findController = options.findController || null;\n\n if (this.findController) {\n this.findController.onIsPageVisible = pageNumber =>\n this._getVisiblePages().ids.has(pageNumber);\n }\n this._scriptingManager = options.scriptingManager || null;\n this.#textLayerMode = options.textLayerMode ?? TextLayerMode.ENABLE;\n this.#annotationMode =\n options.annotationMode ?? AnnotationMode.ENABLE_FORMS;\n this.#annotationEditorMode =\n options.annotationEditorMode ?? AnnotationEditorType.NONE;\n this.imageResourcesPath = options.imageResourcesPath || \"\";\n this.enablePrintAutoRotate = options.enablePrintAutoRotate || false;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n this.removePageBorders = options.removePageBorders || false;\n }\n this.useOnlyCssZoom = options.useOnlyCssZoom || false;\n this.isOffscreenCanvasSupported =\n options.isOffscreenCanvasSupported ?? true;\n this.maxCanvasPixels = options.maxCanvasPixels;\n this.l10n = options.l10n || NullL10n;\n this.#enablePermissions = options.enablePermissions || false;\n this.pageColors = options.pageColors || null;\n\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n if (\n this.pageColors &&\n !(\n CSS.supports(\"color\", this.pageColors.background) &&\n CSS.supports(\"color\", this.pageColors.foreground)\n )\n ) {\n if (this.pageColors.background || this.pageColors.foreground) {\n console.warn(\n \"PDFViewer: Ignoring `pageColors`-option, since the browser doesn't support the values used.\"\n );\n }\n this.pageColors = null;\n }\n }\n\n this.defaultRenderingQueue = !options.renderingQueue;\n if (this.defaultRenderingQueue) {\n // Custom rendering queue is not specified, using default one\n this.renderingQueue = new PDFRenderingQueue();\n this.renderingQueue.setViewer(this);\n } else {\n this.renderingQueue = options.renderingQueue;\n }\n\n this.scroll = watchScroll(this.container, this._scrollUpdate.bind(this));\n this.presentationModeState = PresentationModeState.UNKNOWN;\n this._onBeforeDraw = this._onAfterDraw = null;\n this._resetView();\n\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this.removePageBorders\n ) {\n this.viewer.classList.add(\"removePageBorders\");\n }\n\n this.#updateContainerHeightCss();\n\n // Trigger API-cleanup, once thumbnail rendering has finished,\n // if the relevant pageView is *not* cached in the buffer.\n this.eventBus._on(\"thumbnailrendered\", ({ pageNumber, pdfPage }) => {\n const pageView = this._pages[pageNumber - 1];\n if (!this.#buffer.has(pageView)) {\n pdfPage?.cleanup();\n }\n });\n }\n\n get pagesCount() {\n return this._pages.length;\n }\n\n getPageView(index) {\n return this._pages[index];\n }\n\n getCachedPageViews() {\n return new Set(this.#buffer);\n }\n\n /**\n * @type {boolean} - True if all {PDFPageView} objects are initialized.\n */\n get pageViewsReady() {\n // Prevent printing errors when 'disableAutoFetch' is set, by ensuring\n // that *all* pages have in fact been completely loaded.\n return (\n this._pagesCapability.settled &&\n this._pages.every(pageView => pageView?.pdfPage)\n );\n }\n\n /**\n * @type {boolean}\n */\n get renderForms() {\n return this.#annotationMode === AnnotationMode.ENABLE_FORMS;\n }\n\n /**\n * @type {boolean}\n */\n get enableScripting() {\n return !!this._scriptingManager;\n }\n\n /**\n * @type {number}\n */\n get currentPageNumber() {\n return this._currentPageNumber;\n }\n\n /**\n * @param {number} val - The page number.\n */\n set currentPageNumber(val) {\n if (!Number.isInteger(val)) {\n throw new Error(\"Invalid page number.\");\n }\n if (!this.pdfDocument) {\n return;\n }\n // The intent can be to just reset a scroll position and/or scale.\n if (!this._setCurrentPageNumber(val, /* resetCurrentPageView = */ true)) {\n console.error(`currentPageNumber: \"${val}\" is not a valid page.`);\n }\n }\n\n /**\n * @returns {boolean} Whether the pageNumber is valid (within bounds).\n * @private\n */\n _setCurrentPageNumber(val, resetCurrentPageView = false) {\n if (this._currentPageNumber === val) {\n if (resetCurrentPageView) {\n this.#resetCurrentPageView();\n }\n return true;\n }\n\n if (!(0 < val && val <= this.pagesCount)) {\n return false;\n }\n const previous = this._currentPageNumber;\n this._currentPageNumber = val;\n\n this.eventBus.dispatch(\"pagechanging\", {\n source: this,\n pageNumber: val,\n pageLabel: this._pageLabels?.[val - 1] ?? null,\n previous,\n });\n\n if (resetCurrentPageView) {\n this.#resetCurrentPageView();\n }\n return true;\n }\n\n /**\n * @type {string|null} Returns the current page label, or `null` if no page\n * labels exist.\n */\n get currentPageLabel() {\n return this._pageLabels?.[this._currentPageNumber - 1] ?? null;\n }\n\n /**\n * @param {string} val - The page label.\n */\n set currentPageLabel(val) {\n if (!this.pdfDocument) {\n return;\n }\n let page = val | 0; // Fallback page number.\n if (this._pageLabels) {\n const i = this._pageLabels.indexOf(val);\n if (i >= 0) {\n page = i + 1;\n }\n }\n // The intent can be to just reset a scroll position and/or scale.\n if (!this._setCurrentPageNumber(page, /* resetCurrentPageView = */ true)) {\n console.error(`currentPageLabel: \"${val}\" is not a valid page.`);\n }\n }\n\n /**\n * @type {number}\n */\n get currentScale() {\n return this._currentScale !== UNKNOWN_SCALE\n ? this._currentScale\n : DEFAULT_SCALE;\n }\n\n /**\n * @param {number} val - Scale of the pages in percents.\n */\n set currentScale(val) {\n if (isNaN(val)) {\n throw new Error(\"Invalid numeric scale.\");\n }\n if (!this.pdfDocument) {\n return;\n }\n this.#setScale(val, { noScroll: false });\n }\n\n /**\n * @type {string}\n */\n get currentScaleValue() {\n return this._currentScaleValue;\n }\n\n /**\n * @param val - The scale of the pages (in percent or predefined value).\n */\n set currentScaleValue(val) {\n if (!this.pdfDocument) {\n return;\n }\n this.#setScale(val, { noScroll: false });\n }\n\n /**\n * @type {number}\n */\n get pagesRotation() {\n return this._pagesRotation;\n }\n\n /**\n * @param {number} rotation - The rotation of the pages (0, 90, 180, 270).\n */\n set pagesRotation(rotation) {\n if (!isValidRotation(rotation)) {\n throw new Error(\"Invalid pages rotation angle.\");\n }\n if (!this.pdfDocument) {\n return;\n }\n // Normalize the rotation, by clamping it to the [0, 360) range.\n rotation %= 360;\n if (rotation < 0) {\n rotation += 360;\n }\n if (this._pagesRotation === rotation) {\n return; // The rotation didn't change.\n }\n this._pagesRotation = rotation;\n\n const pageNumber = this._currentPageNumber;\n\n this.refresh(true, { rotation });\n\n // Prevent errors in case the rotation changes *before* the scale has been\n // set to a non-default value.\n if (this._currentScaleValue) {\n this.#setScale(this._currentScaleValue, { noScroll: true });\n }\n\n this.eventBus.dispatch(\"rotationchanging\", {\n source: this,\n pagesRotation: rotation,\n pageNumber,\n });\n\n if (this.defaultRenderingQueue) {\n this.update();\n }\n }\n\n get firstPagePromise() {\n return this.pdfDocument ? this._firstPageCapability.promise : null;\n }\n\n get onePageRendered() {\n return this.pdfDocument ? this._onePageRenderedCapability.promise : null;\n }\n\n get pagesPromise() {\n return this.pdfDocument ? this._pagesCapability.promise : null;\n }\n\n #layerProperties() {\n const self = this;\n return {\n get annotationEditorUIManager() {\n return self.#annotationEditorUIManager;\n },\n get annotationStorage() {\n return self.pdfDocument?.annotationStorage;\n },\n get downloadManager() {\n return self.downloadManager;\n },\n get enableScripting() {\n return !!self._scriptingManager;\n },\n get fieldObjectsPromise() {\n return self.pdfDocument?.getFieldObjects();\n },\n get findController() {\n return self.findController;\n },\n get hasJSActionsPromise() {\n return self.pdfDocument?.hasJSActions();\n },\n get linkService() {\n return self.linkService;\n },\n };\n }\n\n /**\n * Currently only *some* permissions are supported.\n * @returns {Object}\n */\n #initializePermissions(permissions) {\n const params = {\n annotationEditorMode: this.#annotationEditorMode,\n annotationMode: this.#annotationMode,\n textLayerMode: this.#textLayerMode,\n };\n if (!permissions) {\n return params;\n }\n\n if (\n !permissions.includes(PermissionFlag.COPY) &&\n this.#textLayerMode === TextLayerMode.ENABLE\n ) {\n params.textLayerMode = TextLayerMode.ENABLE_PERMISSIONS;\n }\n\n if (!permissions.includes(PermissionFlag.MODIFY_CONTENTS)) {\n params.annotationEditorMode = AnnotationEditorType.DISABLE;\n }\n\n if (\n !permissions.includes(PermissionFlag.MODIFY_ANNOTATIONS) &&\n !permissions.includes(PermissionFlag.FILL_INTERACTIVE_FORMS) &&\n this.#annotationMode === AnnotationMode.ENABLE_FORMS\n ) {\n params.annotationMode = AnnotationMode.ENABLE;\n }\n\n return params;\n }\n\n #onePageRenderedOrForceFetch() {\n // Unless the viewer *and* its pages are visible, rendering won't start and\n // `this._onePageRenderedCapability` thus won't be resolved.\n // To ensure that automatic printing, on document load, still works even in\n // those cases we force-allow fetching of all pages when:\n // - The current window/tab is inactive, which will prevent rendering since\n // `requestAnimationFrame` is being used; fixes bug 1746213.\n // - The viewer is hidden in the DOM, e.g. in a `display: none` <iframe>\n // element; fixes bug 1618621.\n // - The viewer is visible, but none of the pages are (e.g. if the\n // viewer is very small); fixes bug 1618955.\n if (\n document.visibilityState === \"hidden\" ||\n !this.container.offsetParent ||\n this._getVisiblePages().views.length === 0\n ) {\n return Promise.resolve();\n }\n\n // Handle the window/tab becoming inactive *after* rendering has started;\n // fixes (another part of) bug 1746213.\n const visibilityChangePromise = new Promise(resolve => {\n this.#onVisibilityChange = () => {\n if (document.visibilityState !== \"hidden\") {\n return;\n }\n resolve();\n\n document.removeEventListener(\n \"visibilitychange\",\n this.#onVisibilityChange\n );\n this.#onVisibilityChange = null;\n };\n document.addEventListener(\"visibilitychange\", this.#onVisibilityChange);\n });\n\n return Promise.race([\n this._onePageRenderedCapability.promise,\n visibilityChangePromise,\n ]);\n }\n\n async getAllText() {\n const texts = [];\n const buffer = [];\n for (\n let pageNum = 1, pagesCount = this.pdfDocument.numPages;\n pageNum <= pagesCount;\n ++pageNum\n ) {\n if (this.#interruptCopyCondition) {\n return null;\n }\n buffer.length = 0;\n const page = await this.pdfDocument.getPage(pageNum);\n // By default getTextContent pass disableNormalization equals to false\n // which is fine because we want a normalized string.\n const { items } = await page.getTextContent();\n for (const item of items) {\n if (item.str) {\n buffer.push(item.str);\n }\n if (item.hasEOL) {\n buffer.push(\"\\n\");\n }\n }\n texts.push(removeNullCharacters(buffer.join(\"\")));\n }\n\n return texts.join(\"\\n\");\n }\n\n #copyCallback(textLayerMode, event) {\n const selection = document.getSelection();\n const { focusNode, anchorNode } = selection;\n if (\n anchorNode &&\n focusNode &&\n selection.containsNode(this.#hiddenCopyElement)\n ) {\n // About the condition above:\n // - having non-null anchorNode and focusNode are here to guaranty that\n // we have at least a kind of selection.\n // - this.#hiddenCopyElement is an invisible element which is impossible\n // to select manually (its display is none) but ctrl+A will select all\n // including this element so having it in the selection means that all\n // has been selected.\n\n if (\n this.#getAllTextInProgress ||\n textLayerMode === TextLayerMode.ENABLE_PERMISSIONS\n ) {\n event.preventDefault();\n event.stopPropagation();\n return;\n }\n this.#getAllTextInProgress = true;\n\n // TODO: if all the pages are rendered we don't need to wait for\n // getAllText and we could just get text from the Selection object.\n\n // Select all the document.\n const savedCursor = this.container.style.cursor;\n this.container.style.cursor = \"wait\";\n\n const interruptCopy = ev =>\n (this.#interruptCopyCondition = ev.key === \"Escape\");\n window.addEventListener(\"keydown\", interruptCopy);\n\n this.getAllText()\n .then(async text => {\n if (text !== null) {\n await navigator.clipboard.writeText(text);\n }\n })\n .catch(reason => {\n console.warn(\n `Something goes wrong when extracting the text: ${reason.message}`\n );\n })\n .finally(() => {\n this.#getAllTextInProgress = false;\n this.#interruptCopyCondition = false;\n window.removeEventListener(\"keydown\", interruptCopy);\n this.container.style.cursor = savedCursor;\n });\n\n event.preventDefault();\n event.stopPropagation();\n }\n }\n\n /**\n * @param {PDFDocumentProxy} pdfDocument\n */\n setDocument(pdfDocument) {\n if (this.pdfDocument) {\n this.eventBus.dispatch(\"pagesdestroy\", { source: this });\n\n this._cancelRendering();\n this._resetView();\n\n this.findController?.setDocument(null);\n this._scriptingManager?.setDocument(null);\n\n if (this.#annotationEditorUIManager) {\n this.#annotationEditorUIManager.destroy();\n this.#annotationEditorUIManager = null;\n }\n }\n\n this.pdfDocument = pdfDocument;\n if (!pdfDocument) {\n return;\n }\n const pagesCount = pdfDocument.numPages;\n const firstPagePromise = pdfDocument.getPage(1);\n // Rendering (potentially) depends on this, hence fetching it immediately.\n const optionalContentConfigPromise = pdfDocument.getOptionalContentConfig();\n const permissionsPromise = this.#enablePermissions\n ? pdfDocument.getPermissions()\n : Promise.resolve();\n\n // Given that browsers don't handle huge amounts of DOM-elements very well,\n // enforce usage of PAGE-scrolling when loading *very* long/large documents.\n if (pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {\n console.warn(\n \"Forcing PAGE-scrolling for performance reasons, given the length of the document.\"\n );\n const mode = (this._scrollMode = ScrollMode.PAGE);\n this.eventBus.dispatch(\"scrollmodechanged\", { source: this, mode });\n }\n\n this._pagesCapability.promise.then(\n () => {\n this.eventBus.dispatch(\"pagesloaded\", { source: this, pagesCount });\n },\n () => {\n /* Prevent \"Uncaught (in promise)\"-messages in the console. */\n }\n );\n\n this._onBeforeDraw = evt => {\n const pageView = this._pages[evt.pageNumber - 1];\n if (!pageView) {\n return;\n }\n // Add the page to the buffer at the start of drawing. That way it can be\n // evicted from the buffer and destroyed even if we pause its rendering.\n this.#buffer.push(pageView);\n };\n this.eventBus._on(\"pagerender\", this._onBeforeDraw);\n\n this._onAfterDraw = evt => {\n if (evt.cssTransform || this._onePageRenderedCapability.settled) {\n return;\n }\n this._onePageRenderedCapability.resolve({ timestamp: evt.timestamp });\n\n this.eventBus._off(\"pagerendered\", this._onAfterDraw);\n this._onAfterDraw = null;\n\n if (this.#onVisibilityChange) {\n document.removeEventListener(\n \"visibilitychange\",\n this.#onVisibilityChange\n );\n this.#onVisibilityChange = null;\n }\n };\n this.eventBus._on(\"pagerendered\", this._onAfterDraw);\n\n // Fetch a single page so we can get a viewport that will be the default\n // viewport for all pages\n Promise.all([firstPagePromise, permissionsPromise])\n .then(([firstPdfPage, permissions]) => {\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the first page resolved.\n }\n this._firstPageCapability.resolve(firstPdfPage);\n this._optionalContentConfigPromise = optionalContentConfigPromise;\n\n const { annotationEditorMode, annotationMode, textLayerMode } =\n this.#initializePermissions(permissions);\n\n if (textLayerMode !== TextLayerMode.DISABLE) {\n const element = (this.#hiddenCopyElement =\n document.createElement(\"div\"));\n element.id = \"hiddenCopyElement\";\n this.viewer.before(element);\n }\n\n if (annotationEditorMode !== AnnotationEditorType.DISABLE) {\n const mode = annotationEditorMode;\n\n if (pdfDocument.isPureXfa) {\n console.warn(\"Warning: XFA-editing is not implemented.\");\n } else if (isValidAnnotationEditorMode(mode)) {\n this.#annotationEditorUIManager = new AnnotationEditorUIManager(\n this.container,\n this.eventBus,\n pdfDocument?.annotationStorage\n );\n if (mode !== AnnotationEditorType.NONE) {\n this.#annotationEditorUIManager.updateMode(mode);\n }\n } else {\n console.error(`Invalid AnnotationEditor mode: ${mode}`);\n }\n }\n\n const layerProperties = this.#layerProperties.bind(this);\n const viewerElement =\n this._scrollMode === ScrollMode.PAGE ? null : this.viewer;\n const scale = this.currentScale;\n const viewport = firstPdfPage.getViewport({\n scale: scale * PixelsPerInch.PDF_TO_CSS_UNITS,\n });\n // Ensure that the various layers always get the correct initial size,\n // see issue 15795.\n this.viewer.style.setProperty(\"--scale-factor\", viewport.scale);\n\n for (let pageNum = 1; pageNum <= pagesCount; ++pageNum) {\n const pageView = new PDFPageView({\n container: viewerElement,\n eventBus: this.eventBus,\n id: pageNum,\n scale,\n defaultViewport: viewport.clone(),\n optionalContentConfigPromise,\n renderingQueue: this.renderingQueue,\n textLayerMode,\n annotationMode,\n imageResourcesPath: this.imageResourcesPath,\n useOnlyCssZoom: this.useOnlyCssZoom,\n isOffscreenCanvasSupported: this.isOffscreenCanvasSupported,\n maxCanvasPixels: this.maxCanvasPixels,\n pageColors: this.pageColors,\n l10n: this.l10n,\n layerProperties,\n });\n this._pages.push(pageView);\n }\n // Set the first `pdfPage` immediately, since it's already loaded,\n // rather than having to repeat the `PDFDocumentProxy.getPage` call in\n // the `this.#ensurePdfPageLoaded` method before rendering can start.\n const firstPageView = this._pages[0];\n if (firstPageView) {\n firstPageView.setPdfPage(firstPdfPage);\n this.linkService.cachePageRef(1, firstPdfPage.ref);\n }\n\n if (this._scrollMode === ScrollMode.PAGE) {\n // Ensure that the current page becomes visible on document load.\n this.#ensurePageViewVisible();\n } else if (this._spreadMode !== SpreadMode.NONE) {\n this._updateSpreadMode();\n }\n\n // Fetch all the pages since the viewport is needed before printing\n // starts to create the correct size canvas. Wait until one page is\n // rendered so we don't tie up too many resources early on.\n this.#onePageRenderedOrForceFetch().then(async () => {\n this.findController?.setDocument(pdfDocument); // Enable searching.\n this._scriptingManager?.setDocument(pdfDocument); // Enable scripting.\n\n if (this.#hiddenCopyElement) {\n this.#copyCallbackBound = this.#copyCallback.bind(\n this,\n textLayerMode\n );\n document.addEventListener(\"copy\", this.#copyCallbackBound);\n }\n\n if (this.#annotationEditorUIManager) {\n // Ensure that the Editor buttons, in the toolbar, are updated.\n this.eventBus.dispatch(\"annotationeditormodechanged\", {\n source: this,\n mode: this.#annotationEditorMode,\n });\n }\n\n // In addition to 'disableAutoFetch' being set, also attempt to reduce\n // resource usage when loading *very* long/large documents.\n if (\n pdfDocument.loadingParams.disableAutoFetch ||\n pagesCount > PagesCountLimit.FORCE_LAZY_PAGE_INIT\n ) {\n // XXX: Printing is semi-broken with auto fetch disabled.\n this._pagesCapability.resolve();\n return;\n }\n let getPagesLeft = pagesCount - 1; // The first page was already loaded.\n\n if (getPagesLeft <= 0) {\n this._pagesCapability.resolve();\n return;\n }\n for (let pageNum = 2; pageNum <= pagesCount; ++pageNum) {\n const promise = pdfDocument.getPage(pageNum).then(\n pdfPage => {\n const pageView = this._pages[pageNum - 1];\n if (!pageView.pdfPage) {\n pageView.setPdfPage(pdfPage);\n }\n this.linkService.cachePageRef(pageNum, pdfPage.ref);\n if (--getPagesLeft === 0) {\n this._pagesCapability.resolve();\n }\n },\n reason => {\n console.error(\n `Unable to get page ${pageNum} to initialize viewer`,\n reason\n );\n if (--getPagesLeft === 0) {\n this._pagesCapability.resolve();\n }\n }\n );\n\n if (pageNum % PagesCountLimit.PAUSE_EAGER_PAGE_INIT === 0) {\n await promise;\n }\n }\n });\n\n this.eventBus.dispatch(\"pagesinit\", { source: this });\n\n pdfDocument.getMetadata().then(({ info }) => {\n if (pdfDocument !== this.pdfDocument) {\n return; // The document was closed while the metadata resolved.\n }\n if (info.Language) {\n this.viewer.lang = info.Language;\n }\n });\n\n if (this.defaultRenderingQueue) {\n this.update();\n }\n })\n .catch(reason => {\n console.error(\"Unable to initialize viewer\", reason);\n\n this._pagesCapability.reject(reason);\n });\n }\n\n /**\n * @param {Array|null} labels\n */\n setPageLabels(labels) {\n if (!this.pdfDocument) {\n return;\n }\n if (!labels) {\n this._pageLabels = null;\n } else if (\n !(Array.isArray(labels) && this.pdfDocument.numPages === labels.length)\n ) {\n this._pageLabels = null;\n console.error(`setPageLabels: Invalid page labels.`);\n } else {\n this._pageLabels = labels;\n }\n // Update all the `PDFPageView` instances.\n for (let i = 0, ii = this._pages.length; i < ii; i++) {\n this._pages[i].setPageLabel(this._pageLabels?.[i] ?? null);\n }\n }\n\n _resetView() {\n this._pages = [];\n this._currentPageNumber = 1;\n this._currentScale = UNKNOWN_SCALE;\n this._currentScaleValue = null;\n this._pageLabels = null;\n this.#buffer = new PDFPageViewBuffer(DEFAULT_CACHE_SIZE);\n this._location = null;\n this._pagesRotation = 0;\n this._optionalContentConfigPromise = null;\n this._firstPageCapability = new PromiseCapability();\n this._onePageRenderedCapability = new PromiseCapability();\n this._pagesCapability = new PromiseCapability();\n this._scrollMode = ScrollMode.VERTICAL;\n this._previousScrollMode = ScrollMode.UNKNOWN;\n this._spreadMode = SpreadMode.NONE;\n\n this.#scrollModePageState = {\n previousPageNumber: 1,\n scrollDown: true,\n pages: [],\n };\n\n if (this._onBeforeDraw) {\n this.eventBus._off(\"pagerender\", this._onBeforeDraw);\n this._onBeforeDraw = null;\n }\n if (this._onAfterDraw) {\n this.eventBus._off(\"pagerendered\", this._onAfterDraw);\n this._onAfterDraw = null;\n }\n if (this.#onVisibilityChange) {\n document.removeEventListener(\n \"visibilitychange\",\n this.#onVisibilityChange\n );\n this.#onVisibilityChange = null;\n }\n // Remove the pages from the DOM...\n this.viewer.textContent = \"\";\n // ... and reset the Scroll mode CSS class(es) afterwards.\n this._updateScrollMode();\n\n this.viewer.removeAttribute(\"lang\");\n\n if (this.#hiddenCopyElement) {\n document.removeEventListener(\"copy\", this.#copyCallbackBound);\n this.#copyCallbackBound = null;\n\n this.#hiddenCopyElement.remove();\n this.#hiddenCopyElement = null;\n }\n }\n\n #ensurePageViewVisible() {\n if (this._scrollMode !== ScrollMode.PAGE) {\n throw new Error(\"#ensurePageViewVisible: Invalid scrollMode value.\");\n }\n const pageNumber = this._currentPageNumber,\n state = this.#scrollModePageState,\n viewer = this.viewer;\n\n // Temporarily remove all the pages from the DOM...\n viewer.textContent = \"\";\n // ... and clear out the active ones.\n state.pages.length = 0;\n\n if (this._spreadMode === SpreadMode.NONE && !this.isInPresentationMode) {\n // Finally, append the new page to the viewer.\n const pageView = this._pages[pageNumber - 1];\n viewer.append(pageView.div);\n\n state.pages.push(pageView);\n } else {\n const pageIndexSet = new Set(),\n parity = this._spreadMode - 1;\n\n // Determine the pageIndices in the new spread.\n if (parity === -1) {\n // PresentationMode is active, with `SpreadMode.NONE` set.\n pageIndexSet.add(pageNumber - 1);\n } else if (pageNumber % 2 !== parity) {\n // Left-hand side page.\n pageIndexSet.add(pageNumber - 1);\n pageIndexSet.add(pageNumber);\n } else {\n // Right-hand side page.\n pageIndexSet.add(pageNumber - 2);\n pageIndexSet.add(pageNumber - 1);\n }\n\n // Finally, append the new pages to the viewer and apply the spreadMode.\n const spread = document.createElement(\"div\");\n spread.className = \"spread\";\n\n if (this.isInPresentationMode) {\n const dummyPage = document.createElement(\"div\");\n dummyPage.className = \"dummyPage\";\n spread.append(dummyPage);\n }\n\n for (const i of pageIndexSet) {\n const pageView = this._pages[i];\n if (!pageView) {\n continue;\n }\n spread.append(pageView.div);\n\n state.pages.push(pageView);\n }\n viewer.append(spread);\n }\n\n state.scrollDown = pageNumber >= state.previousPageNumber;\n state.previousPageNumber = pageNumber;\n }\n\n _scrollUpdate() {\n if (this.pagesCount === 0) {\n return;\n }\n this.update();\n }\n\n #scrollIntoView(pageView, pageSpot = null) {\n const { div, id } = pageView;\n\n // Ensure that `this._currentPageNumber` is correct, when `#scrollIntoView`\n // is called directly (and not from `#resetCurrentPageView`).\n if (this._currentPageNumber !== id) {\n this._setCurrentPageNumber(id);\n }\n if (this._scrollMode === ScrollMode.PAGE) {\n this.#ensurePageViewVisible();\n // Ensure that rendering always occurs, to avoid showing a blank page,\n // even if the current position doesn't change when the page is scrolled.\n this.update();\n }\n\n if (!pageSpot && !this.isInPresentationMode) {\n const left = div.offsetLeft + div.clientLeft,\n right = left + div.clientWidth;\n const { scrollLeft, clientWidth } = this.container;\n if (\n this._scrollMode === ScrollMode.HORIZONTAL ||\n left < scrollLeft ||\n right > scrollLeft + clientWidth\n ) {\n pageSpot = { left: 0, top: 0 };\n }\n }\n scrollIntoView(div, pageSpot);\n\n // Ensure that the correct *initial* document position is set, when any\n // OpenParameters are used, for documents with non-default Scroll/Spread\n // modes (fixes issue 15695). This is necessary since the scroll-handler\n // invokes the `update`-method asynchronously, and `this._location` could\n // thus be wrong when the initial zooming occurs in the default viewer.\n if (!this._currentScaleValue && this._location) {\n this._location = null;\n }\n }\n\n /**\n * Prevent unnecessary re-rendering of all pages when the scale changes\n * only because of limited numerical precision.\n */\n #isSameScale(newScale) {\n return (\n newScale === this._currentScale ||\n Math.abs(newScale - this._currentScale) < 1e-15\n );\n }\n\n #setScaleUpdatePages(\n newScale,\n newValue,\n { noScroll = false, preset = false, drawingDelay = -1 }\n ) {\n this._currentScaleValue = newValue.toString();\n\n if (this.#isSameScale(newScale)) {\n if (preset) {\n this.eventBus.dispatch(\"scalechanging\", {\n source: this,\n scale: newScale,\n presetValue: newValue,\n });\n }\n return;\n }\n\n this.viewer.style.setProperty(\n \"--scale-factor\",\n newScale * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n\n const postponeDrawing = drawingDelay >= 0 && drawingDelay < 1000;\n this.refresh(true, {\n scale: newScale,\n drawingDelay: postponeDrawing ? drawingDelay : -1,\n });\n\n if (postponeDrawing) {\n this.#scaleTimeoutId = setTimeout(() => {\n this.#scaleTimeoutId = null;\n this.refresh();\n }, drawingDelay);\n }\n\n this._currentScale = newScale;\n\n if (!noScroll) {\n let page = this._currentPageNumber,\n dest;\n if (\n this._location &&\n !(this.isInPresentationMode || this.isChangingPresentationMode)\n ) {\n page = this._location.pageNumber;\n dest = [\n null,\n { name: \"XYZ\" },\n this._location.left,\n this._location.top,\n null,\n ];\n }\n this.scrollPageIntoView({\n pageNumber: page,\n destArray: dest,\n allowNegativeOffset: true,\n });\n }\n\n this.eventBus.dispatch(\"scalechanging\", {\n source: this,\n scale: newScale,\n presetValue: preset ? newValue : undefined,\n });\n\n if (this.defaultRenderingQueue) {\n this.update();\n }\n }\n\n get #pageWidthScaleFactor() {\n if (\n this._spreadMode !== SpreadMode.NONE &&\n this._scrollMode !== ScrollMode.HORIZONTAL\n ) {\n return 2;\n }\n return 1;\n }\n\n #setScale(value, options) {\n let scale = parseFloat(value);\n\n if (scale > 0) {\n options.preset = false;\n this.#setScaleUpdatePages(scale, value, options);\n } else {\n const currentPage = this._pages[this._currentPageNumber - 1];\n if (!currentPage) {\n return;\n }\n let hPadding = SCROLLBAR_PADDING,\n vPadding = VERTICAL_PADDING;\n\n if (this.isInPresentationMode) {\n // Pages have a 2px (transparent) border in PresentationMode, see\n // the `web/pdf_viewer.css` file.\n hPadding = vPadding = 4; // 2 * 2px\n if (this._spreadMode !== SpreadMode.NONE) {\n // Account for two pages being visible in PresentationMode, thus\n // \"doubling\" the total border width.\n hPadding *= 2;\n }\n } else if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this.removePageBorders\n ) {\n hPadding = vPadding = 0;\n } else if (this._scrollMode === ScrollMode.HORIZONTAL) {\n [hPadding, vPadding] = [vPadding, hPadding]; // Swap the padding values.\n }\n const pageWidthScale =\n (((this.container.clientWidth - hPadding) / currentPage.width) *\n currentPage.scale) /\n this.#pageWidthScaleFactor;\n const pageHeightScale =\n ((this.container.clientHeight - vPadding) / currentPage.height) *\n currentPage.scale;\n switch (value) {\n case \"page-actual\":\n scale = 1;\n break;\n case \"page-width\":\n scale = pageWidthScale;\n break;\n case \"page-height\":\n scale = pageHeightScale;\n break;\n case \"page-fit\":\n scale = Math.min(pageWidthScale, pageHeightScale);\n break;\n case \"auto\":\n // For pages in landscape mode, fit the page height to the viewer\n // *unless* the page would thus become too wide to fit horizontally.\n const horizontalScale = isPortraitOrientation(currentPage)\n ? pageWidthScale\n : Math.min(pageHeightScale, pageWidthScale);\n scale = Math.min(MAX_AUTO_SCALE, horizontalScale);\n break;\n default:\n console.error(`#setScale: \"${value}\" is an unknown zoom value.`);\n return;\n }\n options.preset = true;\n this.#setScaleUpdatePages(scale, value, options);\n }\n }\n\n /**\n * Refreshes page view: scrolls to the current page and updates the scale.\n */\n #resetCurrentPageView() {\n const pageView = this._pages[this._currentPageNumber - 1];\n\n if (this.isInPresentationMode) {\n // Fixes the case when PDF has different page sizes.\n this.#setScale(this._currentScaleValue, { noScroll: true });\n }\n this.#scrollIntoView(pageView);\n }\n\n /**\n * @param {string} label - The page label.\n * @returns {number|null} The page number corresponding to the page label,\n * or `null` when no page labels exist and/or the input is invalid.\n */\n pageLabelToPageNumber(label) {\n if (!this._pageLabels) {\n return null;\n }\n const i = this._pageLabels.indexOf(label);\n if (i < 0) {\n return null;\n }\n return i + 1;\n }\n\n /**\n * @typedef {Object} ScrollPageIntoViewParameters\n * @property {number} pageNumber - The page number.\n * @property {Array} [destArray] - The original PDF destination array, in the\n * format: <page-ref> </XYZ|/FitXXX> <args..>\n * @property {boolean} [allowNegativeOffset] - Allow negative page offsets.\n * The default value is `false`.\n * @property {boolean} [ignoreDestinationZoom] - Ignore the zoom argument in\n * the destination array. The default value is `false`.\n */\n\n /**\n * Scrolls page into view.\n * @param {ScrollPageIntoViewParameters} params\n */\n scrollPageIntoView({\n pageNumber,\n destArray = null,\n allowNegativeOffset = false,\n ignoreDestinationZoom = false,\n }) {\n if (!this.pdfDocument) {\n return;\n }\n const pageView =\n Number.isInteger(pageNumber) && this._pages[pageNumber - 1];\n if (!pageView) {\n console.error(\n `scrollPageIntoView: \"${pageNumber}\" is not a valid pageNumber parameter.`\n );\n return;\n }\n\n if (this.isInPresentationMode || !destArray) {\n this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);\n return;\n }\n let x = 0,\n y = 0;\n let width = 0,\n height = 0,\n widthScale,\n heightScale;\n const changeOrientation = pageView.rotation % 180 !== 0;\n const pageWidth =\n (changeOrientation ? pageView.height : pageView.width) /\n pageView.scale /\n PixelsPerInch.PDF_TO_CSS_UNITS;\n const pageHeight =\n (changeOrientation ? pageView.width : pageView.height) /\n pageView.scale /\n PixelsPerInch.PDF_TO_CSS_UNITS;\n let scale = 0;\n switch (destArray[1].name) {\n case \"XYZ\":\n x = destArray[2];\n y = destArray[3];\n scale = destArray[4];\n // If x and/or y coordinates are not supplied, default to\n // _top_ left of the page (not the obvious bottom left,\n // since aligning the bottom of the intended page with the\n // top of the window is rarely helpful).\n x = x !== null ? x : 0;\n y = y !== null ? y : pageHeight;\n break;\n case \"Fit\":\n case \"FitB\":\n scale = \"page-fit\";\n break;\n case \"FitH\":\n case \"FitBH\":\n y = destArray[2];\n scale = \"page-width\";\n // According to the PDF spec, section 12.3.2.2, a `null` value in the\n // parameter should maintain the position relative to the new page.\n if (y === null && this._location) {\n x = this._location.left;\n y = this._location.top;\n } else if (typeof y !== \"number\" || y < 0) {\n // The \"top\" value isn't optional, according to the spec, however some\n // bad PDF generators will pretend that it is (fixes bug 1663390).\n y = pageHeight;\n }\n break;\n case \"FitV\":\n case \"FitBV\":\n x = destArray[2];\n width = pageWidth;\n height = pageHeight;\n scale = \"page-height\";\n break;\n case \"FitR\":\n x = destArray[2];\n y = destArray[3];\n width = destArray[4] - x;\n height = destArray[5] - y;\n let hPadding = SCROLLBAR_PADDING,\n vPadding = VERTICAL_PADDING;\n\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n this.removePageBorders\n ) {\n hPadding = vPadding = 0;\n }\n widthScale =\n (this.container.clientWidth - hPadding) /\n width /\n PixelsPerInch.PDF_TO_CSS_UNITS;\n heightScale =\n (this.container.clientHeight - vPadding) /\n height /\n PixelsPerInch.PDF_TO_CSS_UNITS;\n scale = Math.min(Math.abs(widthScale), Math.abs(heightScale));\n break;\n default:\n console.error(\n `scrollPageIntoView: \"${destArray[1].name}\" is not a valid destination type.`\n );\n return;\n }\n\n if (!ignoreDestinationZoom) {\n if (scale && scale !== this._currentScale) {\n this.currentScaleValue = scale;\n } else if (this._currentScale === UNKNOWN_SCALE) {\n this.currentScaleValue = DEFAULT_SCALE_VALUE;\n }\n }\n\n if (scale === \"page-fit\" && !destArray[4]) {\n this.#scrollIntoView(pageView);\n return;\n }\n\n const boundingRect = [\n pageView.viewport.convertToViewportPoint(x, y),\n pageView.viewport.convertToViewportPoint(x + width, y + height),\n ];\n let left = Math.min(boundingRect[0][0], boundingRect[1][0]);\n let top = Math.min(boundingRect[0][1], boundingRect[1][1]);\n\n if (!allowNegativeOffset) {\n // Some bad PDF generators will create destinations with e.g. top values\n // that exceeds the page height. Ensure that offsets are not negative,\n // to prevent a previous page from becoming visible (fixes bug 874482).\n left = Math.max(left, 0);\n top = Math.max(top, 0);\n }\n this.#scrollIntoView(pageView, /* pageSpot = */ { left, top });\n }\n\n _updateLocation(firstPage) {\n const currentScale = this._currentScale;\n const currentScaleValue = this._currentScaleValue;\n const normalizedScaleValue =\n parseFloat(currentScaleValue) === currentScale\n ? Math.round(currentScale * 10000) / 100\n : currentScaleValue;\n\n const pageNumber = firstPage.id;\n const currentPageView = this._pages[pageNumber - 1];\n const container = this.container;\n const topLeft = currentPageView.getPagePoint(\n container.scrollLeft - firstPage.x,\n container.scrollTop - firstPage.y\n );\n const intLeft = Math.round(topLeft[0]);\n const intTop = Math.round(topLeft[1]);\n\n let pdfOpenParams = `#page=${pageNumber}`;\n if (!this.isInPresentationMode) {\n pdfOpenParams += `&zoom=${normalizedScaleValue},${intLeft},${intTop}`;\n }\n\n this._location = {\n pageNumber,\n scale: normalizedScaleValue,\n top: intTop,\n left: intLeft,\n rotation: this._pagesRotation,\n pdfOpenParams,\n };\n }\n\n update() {\n const visible = this._getVisiblePages();\n const visiblePages = visible.views,\n numVisiblePages = visiblePages.length;\n\n if (numVisiblePages === 0) {\n return;\n }\n const newCacheSize = Math.max(DEFAULT_CACHE_SIZE, 2 * numVisiblePages + 1);\n this.#buffer.resize(newCacheSize, visible.ids);\n\n this.renderingQueue.renderHighestPriority(visible);\n\n const isSimpleLayout =\n this._spreadMode === SpreadMode.NONE &&\n (this._scrollMode === ScrollMode.PAGE ||\n this._scrollMode === ScrollMode.VERTICAL);\n const currentId = this._currentPageNumber;\n let stillFullyVisible = false;\n\n for (const page of visiblePages) {\n if (page.percent < 100) {\n break;\n }\n if (page.id === currentId && isSimpleLayout) {\n stillFullyVisible = true;\n break;\n }\n }\n this._setCurrentPageNumber(\n stillFullyVisible ? currentId : visiblePages[0].id\n );\n\n this._updateLocation(visible.first);\n this.eventBus.dispatch(\"updateviewarea\", {\n source: this,\n location: this._location,\n });\n }\n\n containsElement(element) {\n return this.container.contains(element);\n }\n\n focus() {\n this.container.focus();\n }\n\n get _isContainerRtl() {\n return getComputedStyle(this.container).direction === \"rtl\";\n }\n\n get isInPresentationMode() {\n return this.presentationModeState === PresentationModeState.FULLSCREEN;\n }\n\n get isChangingPresentationMode() {\n return this.presentationModeState === PresentationModeState.CHANGING;\n }\n\n get isHorizontalScrollbarEnabled() {\n return this.isInPresentationMode\n ? false\n : this.container.scrollWidth > this.container.clientWidth;\n }\n\n get isVerticalScrollbarEnabled() {\n return this.isInPresentationMode\n ? false\n : this.container.scrollHeight > this.container.clientHeight;\n }\n\n _getVisiblePages() {\n const views =\n this._scrollMode === ScrollMode.PAGE\n ? this.#scrollModePageState.pages\n : this._pages,\n horizontal = this._scrollMode === ScrollMode.HORIZONTAL,\n rtl = horizontal && this._isContainerRtl;\n\n return getVisibleElements({\n scrollEl: this.container,\n views,\n sortByVisibility: true,\n horizontal,\n rtl,\n });\n }\n\n cleanup() {\n for (const pageView of this._pages) {\n if (pageView.renderingState !== RenderingStates.FINISHED) {\n pageView.reset();\n }\n }\n }\n\n /**\n * @private\n */\n _cancelRendering() {\n for (const pageView of this._pages) {\n pageView.cancelRendering();\n }\n }\n\n /**\n * @param {PDFPageView} pageView\n * @returns {Promise<PDFPageProxy | null>}\n */\n async #ensurePdfPageLoaded(pageView) {\n if (pageView.pdfPage) {\n return pageView.pdfPage;\n }\n try {\n const pdfPage = await this.pdfDocument.getPage(pageView.id);\n if (!pageView.pdfPage) {\n pageView.setPdfPage(pdfPage);\n }\n if (!this.linkService._cachedPageNumber?.(pdfPage.ref)) {\n this.linkService.cachePageRef(pageView.id, pdfPage.ref);\n }\n return pdfPage;\n } catch (reason) {\n console.error(\"Unable to get page for page view\", reason);\n return null; // Page error -- there is nothing that can be done.\n }\n }\n\n #getScrollAhead(visible) {\n if (visible.first?.id === 1) {\n return true;\n } else if (visible.last?.id === this.pagesCount) {\n return false;\n }\n switch (this._scrollMode) {\n case ScrollMode.PAGE:\n return this.#scrollModePageState.scrollDown;\n case ScrollMode.HORIZONTAL:\n return this.scroll.right;\n }\n return this.scroll.down;\n }\n\n forceRendering(currentlyVisiblePages) {\n const visiblePages = currentlyVisiblePages || this._getVisiblePages();\n const scrollAhead = this.#getScrollAhead(visiblePages);\n const preRenderExtra =\n this._spreadMode !== SpreadMode.NONE &&\n this._scrollMode !== ScrollMode.HORIZONTAL;\n\n const pageView = this.renderingQueue.getHighestPriority(\n visiblePages,\n this._pages,\n scrollAhead,\n preRenderExtra\n );\n\n if (pageView) {\n this.#ensurePdfPageLoaded(pageView).then(() => {\n this.renderingQueue.renderView(pageView);\n });\n return true;\n }\n return false;\n }\n\n /**\n * @type {boolean} Whether all pages of the PDF document have identical\n * widths and heights.\n */\n get hasEqualPageSizes() {\n const firstPageView = this._pages[0];\n for (let i = 1, ii = this._pages.length; i < ii; ++i) {\n const pageView = this._pages[i];\n if (\n pageView.width !== firstPageView.width ||\n pageView.height !== firstPageView.height\n ) {\n return false;\n }\n }\n return true;\n }\n\n /**\n * Returns sizes of the pages.\n * @returns {Array} Array of objects with width/height/rotation fields.\n */\n getPagesOverview() {\n let initialOrientation;\n return this._pages.map(pageView => {\n const viewport = pageView.pdfPage.getViewport({ scale: 1 });\n const orientation = isPortraitOrientation(viewport);\n if (initialOrientation === undefined) {\n initialOrientation = orientation;\n } else if (\n this.enablePrintAutoRotate &&\n orientation !== initialOrientation\n ) {\n // Rotate to fit the initial orientation.\n return {\n width: viewport.height,\n height: viewport.width,\n rotation: (viewport.rotation - 90) % 360,\n };\n }\n return {\n width: viewport.width,\n height: viewport.height,\n rotation: viewport.rotation,\n };\n });\n }\n\n /**\n * @type {Promise<OptionalContentConfig | null>}\n */\n get optionalContentConfigPromise() {\n if (!this.pdfDocument) {\n return Promise.resolve(null);\n }\n if (!this._optionalContentConfigPromise) {\n console.error(\"optionalContentConfigPromise: Not initialized yet.\");\n // Prevent issues if the getter is accessed *before* the `onePageRendered`\n // promise has resolved; won't (normally) happen in the default viewer.\n return this.pdfDocument.getOptionalContentConfig();\n }\n return this._optionalContentConfigPromise;\n }\n\n /**\n * @param {Promise<OptionalContentConfig>} promise - A promise that is\n * resolved with an {@link OptionalContentConfig} instance.\n */\n set optionalContentConfigPromise(promise) {\n if (!(promise instanceof Promise)) {\n throw new Error(`Invalid optionalContentConfigPromise: ${promise}`);\n }\n if (!this.pdfDocument) {\n return;\n }\n if (!this._optionalContentConfigPromise) {\n // Ignore the setter *before* the `onePageRendered` promise has resolved,\n // since it'll be overwritten anyway; won't happen in the default viewer.\n return;\n }\n this._optionalContentConfigPromise = promise;\n\n this.refresh(false, { optionalContentConfigPromise: promise });\n\n this.eventBus.dispatch(\"optionalcontentconfigchanged\", {\n source: this,\n promise,\n });\n }\n\n /**\n * @type {number} One of the values in {ScrollMode}.\n */\n get scrollMode() {\n return this._scrollMode;\n }\n\n /**\n * @param {number} mode - The direction in which the document pages should be\n * laid out within the scrolling container.\n * The constants from {ScrollMode} should be used.\n */\n set scrollMode(mode) {\n if (this._scrollMode === mode) {\n return; // The Scroll mode didn't change.\n }\n if (!isValidScrollMode(mode)) {\n throw new Error(`Invalid scroll mode: ${mode}`);\n }\n if (this.pagesCount > PagesCountLimit.FORCE_SCROLL_MODE_PAGE) {\n return; // Disabled for performance reasons.\n }\n this._previousScrollMode = this._scrollMode;\n\n this._scrollMode = mode;\n this.eventBus.dispatch(\"scrollmodechanged\", { source: this, mode });\n\n this._updateScrollMode(/* pageNumber = */ this._currentPageNumber);\n }\n\n _updateScrollMode(pageNumber = null) {\n const scrollMode = this._scrollMode,\n viewer = this.viewer;\n\n viewer.classList.toggle(\n \"scrollHorizontal\",\n scrollMode === ScrollMode.HORIZONTAL\n );\n viewer.classList.toggle(\"scrollWrapped\", scrollMode === ScrollMode.WRAPPED);\n\n if (!this.pdfDocument || !pageNumber) {\n return;\n }\n\n if (scrollMode === ScrollMode.PAGE) {\n this.#ensurePageViewVisible();\n } else if (this._previousScrollMode === ScrollMode.PAGE) {\n // Ensure that the current spreadMode is still applied correctly when\n // the *previous* scrollMode was `ScrollMode.PAGE`.\n this._updateSpreadMode();\n }\n // Non-numeric scale values can be sensitive to the scroll orientation.\n // Call this before re-scrolling to the current page, to ensure that any\n // changes in scale don't move the current page.\n if (this._currentScaleValue && isNaN(this._currentScaleValue)) {\n this.#setScale(this._currentScaleValue, { noScroll: true });\n }\n this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);\n this.update();\n }\n\n /**\n * @type {number} One of the values in {SpreadMode}.\n */\n get spreadMode() {\n return this._spreadMode;\n }\n\n /**\n * @param {number} mode - Group the pages in spreads, starting with odd- or\n * even-number pages (unless `SpreadMode.NONE` is used).\n * The constants from {SpreadMode} should be used.\n */\n set spreadMode(mode) {\n if (this._spreadMode === mode) {\n return; // The Spread mode didn't change.\n }\n if (!isValidSpreadMode(mode)) {\n throw new Error(`Invalid spread mode: ${mode}`);\n }\n this._spreadMode = mode;\n this.eventBus.dispatch(\"spreadmodechanged\", { source: this, mode });\n\n this._updateSpreadMode(/* pageNumber = */ this._currentPageNumber);\n }\n\n _updateSpreadMode(pageNumber = null) {\n if (!this.pdfDocument) {\n return;\n }\n const viewer = this.viewer,\n pages = this._pages;\n\n if (this._scrollMode === ScrollMode.PAGE) {\n this.#ensurePageViewVisible();\n } else {\n // Temporarily remove all the pages from the DOM.\n viewer.textContent = \"\";\n\n if (this._spreadMode === SpreadMode.NONE) {\n for (const pageView of this._pages) {\n viewer.append(pageView.div);\n }\n } else {\n const parity = this._spreadMode - 1;\n let spread = null;\n for (let i = 0, ii = pages.length; i < ii; ++i) {\n if (spread === null) {\n spread = document.createElement(\"div\");\n spread.className = \"spread\";\n viewer.append(spread);\n } else if (i % 2 === parity) {\n spread = spread.cloneNode(false);\n viewer.append(spread);\n }\n spread.append(pages[i].div);\n }\n }\n }\n\n if (!pageNumber) {\n return;\n }\n // Non-numeric scale values can be sensitive to the scroll orientation.\n // Call this before re-scrolling to the current page, to ensure that any\n // changes in scale don't move the current page.\n if (this._currentScaleValue && isNaN(this._currentScaleValue)) {\n this.#setScale(this._currentScaleValue, { noScroll: true });\n }\n this._setCurrentPageNumber(pageNumber, /* resetCurrentPageView = */ true);\n this.update();\n }\n\n /**\n * @private\n */\n _getPageAdvance(currentPageNumber, previous = false) {\n switch (this._scrollMode) {\n case ScrollMode.WRAPPED: {\n const { views } = this._getVisiblePages(),\n pageLayout = new Map();\n\n // Determine the current (visible) page layout.\n for (const { id, y, percent, widthPercent } of views) {\n if (percent === 0 || widthPercent < 100) {\n continue;\n }\n let yArray = pageLayout.get(y);\n if (!yArray) {\n pageLayout.set(y, (yArray ||= []));\n }\n yArray.push(id);\n }\n // Find the row of the current page.\n for (const yArray of pageLayout.values()) {\n const currentIndex = yArray.indexOf(currentPageNumber);\n if (currentIndex === -1) {\n continue;\n }\n const numPages = yArray.length;\n if (numPages === 1) {\n break;\n }\n // Handle documents with varying page sizes.\n if (previous) {\n for (let i = currentIndex - 1, ii = 0; i >= ii; i--) {\n const currentId = yArray[i],\n expectedId = yArray[i + 1] - 1;\n if (currentId < expectedId) {\n return currentPageNumber - expectedId;\n }\n }\n } else {\n for (let i = currentIndex + 1, ii = numPages; i < ii; i++) {\n const currentId = yArray[i],\n expectedId = yArray[i - 1] + 1;\n if (currentId > expectedId) {\n return expectedId - currentPageNumber;\n }\n }\n }\n // The current row is \"complete\", advance to the previous/next one.\n if (previous) {\n const firstId = yArray[0];\n if (firstId < currentPageNumber) {\n return currentPageNumber - firstId + 1;\n }\n } else {\n const lastId = yArray[numPages - 1];\n if (lastId > currentPageNumber) {\n return lastId - currentPageNumber + 1;\n }\n }\n break;\n }\n break;\n }\n case ScrollMode.HORIZONTAL: {\n break;\n }\n case ScrollMode.PAGE:\n case ScrollMode.VERTICAL: {\n if (this._spreadMode === SpreadMode.NONE) {\n break; // Normal vertical scrolling.\n }\n const parity = this._spreadMode - 1;\n\n if (previous && currentPageNumber % 2 !== parity) {\n break; // Left-hand side page.\n } else if (!previous && currentPageNumber % 2 === parity) {\n break; // Right-hand side page.\n }\n const { views } = this._getVisiblePages(),\n expectedId = previous ? currentPageNumber - 1 : currentPageNumber + 1;\n\n for (const { id, percent, widthPercent } of views) {\n if (id !== expectedId) {\n continue;\n }\n if (percent > 0 && widthPercent === 100) {\n return 2;\n }\n break;\n }\n break;\n }\n }\n return 1;\n }\n\n /**\n * Go to the next page, taking scroll/spread-modes into account.\n * @returns {boolean} Whether navigation occurred.\n */\n nextPage() {\n const currentPageNumber = this._currentPageNumber,\n pagesCount = this.pagesCount;\n\n if (currentPageNumber >= pagesCount) {\n return false;\n }\n const advance =\n this._getPageAdvance(currentPageNumber, /* previous = */ false) || 1;\n\n this.currentPageNumber = Math.min(currentPageNumber + advance, pagesCount);\n return true;\n }\n\n /**\n * Go to the previous page, taking scroll/spread-modes into account.\n * @returns {boolean} Whether navigation occurred.\n */\n previousPage() {\n const currentPageNumber = this._currentPageNumber;\n\n if (currentPageNumber <= 1) {\n return false;\n }\n const advance =\n this._getPageAdvance(currentPageNumber, /* previous = */ true) || 1;\n\n this.currentPageNumber = Math.max(currentPageNumber - advance, 1);\n return true;\n }\n\n /**\n * @typedef {Object} ChangeScaleOptions\n * @property {number} [drawingDelay]\n * @property {number} [scaleFactor]\n * @property {number} [steps]\n */\n\n /**\n * Increase the current zoom level one, or more, times.\n * @param {ChangeScaleOptions} [options]\n */\n increaseScale({ drawingDelay, scaleFactor, steps } = {}) {\n if (!this.pdfDocument) {\n return;\n }\n let newScale = this._currentScale;\n if (scaleFactor > 1) {\n newScale = Math.round(newScale * scaleFactor * 100) / 100;\n } else {\n steps ??= 1;\n do {\n newScale =\n Math.ceil((newScale * DEFAULT_SCALE_DELTA).toFixed(2) * 10) / 10;\n } while (--steps > 0 && newScale < MAX_SCALE);\n }\n this.#setScale(Math.min(MAX_SCALE, newScale), {\n noScroll: false,\n drawingDelay,\n });\n }\n\n /**\n * Decrease the current zoom level one, or more, times.\n * @param {ChangeScaleOptions} [options]\n */\n decreaseScale({ drawingDelay, scaleFactor, steps } = {}) {\n if (!this.pdfDocument) {\n return;\n }\n let newScale = this._currentScale;\n if (scaleFactor > 0 && scaleFactor < 1) {\n newScale = Math.round(newScale * scaleFactor * 100) / 100;\n } else {\n steps ??= 1;\n do {\n newScale =\n Math.floor((newScale / DEFAULT_SCALE_DELTA).toFixed(2) * 10) / 10;\n } while (--steps > 0 && newScale > MIN_SCALE);\n }\n this.#setScale(Math.max(MIN_SCALE, newScale), {\n noScroll: false,\n drawingDelay,\n });\n }\n\n #updateContainerHeightCss(height = this.container.clientHeight) {\n if (height !== this.#previousContainerHeight) {\n this.#previousContainerHeight = height;\n docStyle.setProperty(\"--viewer-container-height\", `${height}px`);\n }\n }\n\n #resizeObserverCallback(entries) {\n for (const entry of entries) {\n if (entry.target === this.container) {\n this.#updateContainerHeightCss(\n Math.floor(entry.borderBoxSize[0].blockSize)\n );\n this.#containerTopLeft = null;\n break;\n }\n }\n }\n\n get containerTopLeft() {\n return (this.#containerTopLeft ||= [\n this.container.offsetTop,\n this.container.offsetLeft,\n ]);\n }\n\n /**\n * @type {number}\n */\n get annotationEditorMode() {\n return this.#annotationEditorUIManager\n ? this.#annotationEditorMode\n : AnnotationEditorType.DISABLE;\n }\n\n /**\n * @param {number} mode - AnnotationEditor mode (None, FreeText, Ink, ...)\n */\n set annotationEditorMode(mode) {\n if (!this.#annotationEditorUIManager) {\n throw new Error(`The AnnotationEditor is not enabled.`);\n }\n if (this.#annotationEditorMode === mode) {\n return; // The AnnotationEditor mode didn't change.\n }\n if (!isValidAnnotationEditorMode(mode)) {\n throw new Error(`Invalid AnnotationEditor mode: ${mode}`);\n }\n if (!this.pdfDocument) {\n return;\n }\n this.#annotationEditorMode = mode;\n this.eventBus.dispatch(\"annotationeditormodechanged\", {\n source: this,\n mode,\n });\n\n this.#annotationEditorUIManager.updateMode(mode);\n }\n\n // eslint-disable-next-line accessor-pairs\n set annotationEditorParams({ type, value }) {\n if (!this.#annotationEditorUIManager) {\n throw new Error(`The AnnotationEditor is not enabled.`);\n }\n this.#annotationEditorUIManager.updateParams(type, value);\n }\n\n refresh(noUpdate = false, updateArgs = Object.create(null)) {\n if (!this.pdfDocument) {\n return;\n }\n for (const pageView of this._pages) {\n pageView.update(updateArgs);\n }\n if (this.#scaleTimeoutId !== null) {\n clearTimeout(this.#scaleTimeoutId);\n this.#scaleTimeoutId = null;\n }\n if (!noUpdate) {\n this.update();\n }\n }\n}\n\nexport { PagesCountLimit, PDFPageViewBuffer, PDFViewer };\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\").IRenderableView} IRenderableView */\n/** @typedef {import(\"./pdf_viewer\").PDFViewer} PDFViewer */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./pdf_thumbnail_viewer\").PDFThumbnailViewer} PDFThumbnailViewer */\n\nimport { RenderingCancelledException } from \"pdfjs-lib\";\nimport { RenderingStates } from \"./ui_utils.js\";\n\nconst CLEANUP_TIMEOUT = 30000;\n\n/**\n * Controls rendering of the views for pages and thumbnails.\n */\nclass PDFRenderingQueue {\n constructor() {\n this.pdfViewer = null;\n this.pdfThumbnailViewer = null;\n this.onIdle = null;\n this.highestPriorityPage = null;\n /** @type {number} */\n this.idleTimeout = null;\n this.printing = false;\n this.isThumbnailViewEnabled = false;\n }\n\n /**\n * @param {PDFViewer} pdfViewer\n */\n setViewer(pdfViewer) {\n this.pdfViewer = pdfViewer;\n }\n\n /**\n * @param {PDFThumbnailViewer} pdfThumbnailViewer\n */\n setThumbnailViewer(pdfThumbnailViewer) {\n this.pdfThumbnailViewer = pdfThumbnailViewer;\n }\n\n /**\n * @param {IRenderableView} view\n * @returns {boolean}\n */\n isHighestPriority(view) {\n return this.highestPriorityPage === view.renderingId;\n }\n\n /**\n * @returns {boolean}\n */\n hasViewer() {\n return !!this.pdfViewer;\n }\n\n /**\n * @param {Object} currentlyVisiblePages\n */\n renderHighestPriority(currentlyVisiblePages) {\n if (this.idleTimeout) {\n clearTimeout(this.idleTimeout);\n this.idleTimeout = null;\n }\n\n // Pages have a higher priority than thumbnails, so check them first.\n if (this.pdfViewer.forceRendering(currentlyVisiblePages)) {\n return;\n }\n // No pages needed rendering, so check thumbnails.\n if (\n this.isThumbnailViewEnabled &&\n this.pdfThumbnailViewer?.forceRendering()\n ) {\n return;\n }\n\n if (this.printing) {\n // If printing is currently ongoing do not reschedule cleanup.\n return;\n }\n\n if (this.onIdle) {\n this.idleTimeout = setTimeout(this.onIdle.bind(this), CLEANUP_TIMEOUT);\n }\n }\n\n /**\n * @param {Object} visible\n * @param {Array} views\n * @param {boolean} scrolledDown\n * @param {boolean} [preRenderExtra]\n */\n getHighestPriority(visible, views, scrolledDown, preRenderExtra = false) {\n /**\n * The state has changed. Figure out which page has the highest priority to\n * render next (if any).\n *\n * Priority:\n * 1. visible pages\n * 2. if last scrolled down, the page after the visible pages, or\n * if last scrolled up, the page before the visible pages\n */\n const visibleViews = visible.views,\n numVisible = visibleViews.length;\n\n if (numVisible === 0) {\n return null;\n }\n for (let i = 0; i < numVisible; i++) {\n const view = visibleViews[i].view;\n if (!this.isViewFinished(view)) {\n return view;\n }\n }\n const firstId = visible.first.id,\n lastId = visible.last.id;\n\n // All the visible views have rendered; try to handle any \"holes\" in the\n // page layout (can happen e.g. with spreadModes at higher zoom levels).\n if (lastId - firstId + 1 > numVisible) {\n const visibleIds = visible.ids;\n for (let i = 1, ii = lastId - firstId; i < ii; i++) {\n const holeId = scrolledDown ? firstId + i : lastId - i;\n if (visibleIds.has(holeId)) {\n continue;\n }\n const holeView = views[holeId - 1];\n if (!this.isViewFinished(holeView)) {\n return holeView;\n }\n }\n }\n\n // All the visible views have rendered; try to render next/previous page.\n // (IDs start at 1, so no need to add 1 when `scrolledDown === true`.)\n let preRenderIndex = scrolledDown ? lastId : firstId - 2;\n let preRenderView = views[preRenderIndex];\n\n if (preRenderView && !this.isViewFinished(preRenderView)) {\n return preRenderView;\n }\n if (preRenderExtra) {\n preRenderIndex += scrolledDown ? 1 : -1;\n preRenderView = views[preRenderIndex];\n\n if (preRenderView && !this.isViewFinished(preRenderView)) {\n return preRenderView;\n }\n }\n // Everything that needs to be rendered has been.\n return null;\n }\n\n /**\n * @param {IRenderableView} view\n * @returns {boolean}\n */\n isViewFinished(view) {\n return view.renderingState === RenderingStates.FINISHED;\n }\n\n /**\n * Render a page or thumbnail view. This calls the appropriate function\n * based on the views state. If the view is already rendered it will return\n * `false`.\n *\n * @param {IRenderableView} view\n */\n renderView(view) {\n switch (view.renderingState) {\n case RenderingStates.FINISHED:\n return false;\n case RenderingStates.PAUSED:\n this.highestPriorityPage = view.renderingId;\n view.resume();\n break;\n case RenderingStates.RUNNING:\n this.highestPriorityPage = view.renderingId;\n break;\n case RenderingStates.INITIAL:\n this.highestPriorityPage = view.renderingId;\n view\n .draw()\n .finally(() => {\n this.renderHighestPriority();\n })\n .catch(reason => {\n if (reason instanceof RenderingCancelledException) {\n return;\n }\n console.error(`renderView: \"${reason}\"`);\n });\n break;\n }\n return true;\n }\n}\n\nexport { PDFRenderingQueue };\n","// The module cache\nvar __webpack_module_cache__ = {};\n\n// The require function\nfunction __w_pdfjs_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, __w_pdfjs_require__);\n\n\t// Return the exports of the module\n\treturn module.exports;\n}\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 {\n LinkTarget,\n PDFLinkService,\n SimpleLinkService,\n} from \"./pdf_link_service.js\";\nimport {\n parseQueryString,\n ProgressBar,\n RenderingStates,\n ScrollMode,\n SpreadMode,\n} from \"./ui_utils.js\";\nimport { AnnotationLayerBuilder } from \"./annotation_layer_builder.js\";\nimport { DownloadManager } from \"./download_manager.js\";\nimport { EventBus } from \"./event_utils.js\";\nimport { GenericL10n } from \"./genericl10n.js\";\nimport { NullL10n } from \"./l10n_utils.js\";\nimport { PDFFindController } from \"./pdf_find_controller.js\";\nimport { PDFHistory } from \"./pdf_history.js\";\nimport { PDFPageView } from \"./pdf_page_view.js\";\nimport { PDFScriptingManager } from \"./pdf_scripting_manager.js\";\nimport { PDFSinglePageViewer } from \"./pdf_single_page_viewer.js\";\nimport { PDFViewer } from \"./pdf_viewer.js\";\nimport { StructTreeLayerBuilder } from \"./struct_tree_layer_builder.js\";\nimport { TextLayerBuilder } from \"./text_layer_builder.js\";\nimport { XfaLayerBuilder } from \"./xfa_layer_builder.js\";\n\n// eslint-disable-next-line no-unused-vars\nconst pdfjsVersion = PDFJSDev.eval(\"BUNDLE_VERSION\");\n// eslint-disable-next-line no-unused-vars\nconst pdfjsBuild = PDFJSDev.eval(\"BUNDLE_BUILD\");\n\nclass DefaultAnnotationLayerFactory {\n constructor() {\n throw new Error(\n \"The `DefaultAnnotationLayerFactory` has been removed, \" +\n \"please use the `annotationMode` option when initializing \" +\n \"the `PDFPageView`-instance to control AnnotationLayer rendering.\"\n );\n }\n}\n\nclass DefaultStructTreeLayerFactory {\n constructor() {\n throw new Error(\n \"The `DefaultStructTreeLayerFactory` has been removed, \" +\n \"this functionality is automatically enabled when the TextLayer is used.\"\n );\n }\n}\n\nclass DefaultTextLayerFactory {\n constructor() {\n throw new Error(\n \"The `DefaultTextLayerFactory` has been removed, \" +\n \"please use the `textLayerMode` option when initializing \" +\n \"the `PDFPageView`-instance to control TextLayer rendering.\"\n );\n }\n}\n\nclass DefaultXfaLayerFactory {\n constructor() {\n throw new Error(\n \"The `DefaultXfaLayerFactory` has been removed, \" +\n \"please use the `enableXfa` option when calling \" +\n \"the `getDocument`-function to control XfaLayer rendering.\"\n );\n }\n}\n\nexport {\n AnnotationLayerBuilder,\n DefaultAnnotationLayerFactory,\n DefaultStructTreeLayerFactory,\n DefaultTextLayerFactory,\n DefaultXfaLayerFactory,\n DownloadManager,\n EventBus,\n GenericL10n,\n LinkTarget,\n NullL10n,\n parseQueryString,\n PDFFindController,\n PDFHistory,\n PDFLinkService,\n PDFPageView,\n PDFScriptingManager,\n PDFSinglePageViewer,\n PDFViewer,\n ProgressBar,\n RenderingStates,\n ScrollMode,\n SimpleLinkService,\n SpreadMode,\n StructTreeLayerBuilder,\n TextLayerBuilder,\n XfaLayerBuilder,\n};\n"],"names":["_ui_utils","require","DEFAULT_LINK_REL","LinkTarget","NONE","SELF","BLANK","PARENT","TOP","exports","addLinkAttributes","link","url","target","rel","enabled","arguments","length","undefined","Error","urlNullRemoved","removeNullCharacters","href","title","onclick","targetStr","PDFLinkService","pagesRefCache","Map","constructor","eventBus","externalLinkTarget","externalLinkRel","ignoreDestinationZoom","externalLinkEnabled","_ignoreDestinationZoom","baseUrl","pdfDocument","pdfViewer","pdfHistory","setDocument","clear","setViewer","setHistory","pagesCount","numPages","page","currentPageNumber","value","rotation","pagesRotation","isInPresentationMode","goToDestinationHelper","rawDest","namedDest","explicitDest","destRef","pageNumber","_cachedPageNumber","getPageIndex","then","pageIndex","cachePageRef","catch","console","error","Number","isInteger","pushCurrentPosition","push","scrollPageIntoView","destArray","goToDestination","dest","getDestination","Array","isArray","goToPage","val","pageLabelToPageNumber","pushPage","newWindow","getDestinationHash","getAnchorUrl","escape","str","JSON","stringify","anchor","setHash","hash","includes","params","parseQueryString","has","query","get","replaceAll","phrase","dispatch","source","match","zoomArgs","split","zoomArg","zoomArgNumber","parseFloat","name","allowNegativeOffset","mode","unescape","parse","toString","ex","isValidExplicitDestination","executeNamedAction","action","_this$pdfHistory","_this$pdfHistory2","back","forward","nextPage","previousPage","executeSetOCGState","optionalContentConfig","optionalContentConfigPromise","operator","elem","state","setVisibility","group","getGroup","visible","Promise","resolve","pageNum","pageRef","refStr","gen","num","set","destLength","zoom","allowNull","i","param","SimpleLinkService","DEFAULT_SCALE_VALUE","DEFAULT_SCALE","DEFAULT_SCALE_DELTA","MIN_SCALE","MAX_SCALE","UNKNOWN_SCALE","MAX_AUTO_SCALE","SCROLLBAR_PADDING","VERTICAL_PADDING","RenderingStates","INITIAL","RUNNING","PAUSED","FINISHED","PresentationModeState","UNKNOWN","NORMAL","CHANGING","FULLSCREEN","SidebarView","THUMBS","OUTLINE","ATTACHMENTS","LAYERS","TextLayerMode","DISABLE","ENABLE","ENABLE_PERMISSIONS","ScrollMode","VERTICAL","HORIZONTAL","WRAPPED","PAGE","SpreadMode","ODD","EVEN","CursorTool","SELECT","HAND","ZOOM","AutoPrintRegExp","OutputScale","pixelRatio","window","devicePixelRatio","sx","sy","scaled","scrollIntoView","element","spot","scrollMatches","parent","offsetParent","offsetY","offsetTop","clientTop","offsetX","offsetLeft","clientLeft","clientHeight","scrollHeight","clientWidth","scrollWidth","classList","contains","getComputedStyle","overflow","top","left","scrollLeft","scrollTop","watchScroll","viewAreaElement","callback","debounceScroll","evt","rAF","requestAnimationFrame","viewAreaElementScrolled","currentX","lastX","right","currentY","lastY","down","_eventHandler","addEventListener","key","URLSearchParams","toLowerCase","InvisibleCharactersRegExp","replaceInvisible","binarySearchFirstItem","items","condition","start","minIndex","maxIndex","currentIndex","currentItem","approximateFraction","x","Math","floor","xinv","limit","x_","a","b","c","d","p","q","result","roundToDivide","div","r","round","getPageSizeInches","_ref","view","userUnit","rotate","x1","y1","x2","y2","changeOrientation","width","height","backtrackBeforeAllVisibleElements","index","views","elt","pageTop","getVisibleElements","_ref2","scrollEl","sortByVisibility","horizontal","rtl","bottom","isElementBottomAfterViewTop","elementBottom","isElementNextAfterViewHorizontally","elementLeft","elementRight","ids","Set","numViews","firstVisibleElementInd","lastEdge","currentWidth","currentHeight","viewWidth","viewHeight","viewRight","viewBottom","hiddenHeight","max","hiddenWidth","fractionHeight","fractionWidth","percent","id","y","widthPercent","add","first","last","at","sort","pc","abs","noContextMenuHandler","preventDefault","normalizeWheelEventDirection","delta","hypot","deltaX","deltaY","angle","atan2","PI","normalizeWheelEventDelta","deltaMode","MOUSE_PIXELS_PER_LINE","MOUSE_LINES_PER_PAGE","WheelEvent","DOM_DELTA_PIXEL","DOM_DELTA_LINE","isValidRotation","isValidScrollMode","Object","values","isValidSpreadMode","isPortraitOrientation","size","animationStarted","docStyle","document","documentElement","style","clamp","v","min","ProgressBar","disableAutoFetchTimeout","bar","isNaN","remove","setProperty","setWidth","viewer","container","parentNode","scrollbarWidth","offsetWidth","setDisableAutoFetch","delay","clearTimeout","show","setTimeout","hide","getActiveOrFocusedElement","curRoot","curActiveOrFocused","activeElement","querySelector","_curActiveOrFocused","shadowRoot","apiPageLayoutToViewerModes","layout","scrollMode","spreadMode","apiPageModeToSidebarView","toggleCheckedBtn","button","toggle","setAttribute","toggleExpandedBtn","_pdfjsLib","_l10n_utils","AnnotationLayerBuilder","numAnnotations","onPresentationModeChanged","pageDiv","pdfPage","linkService","downloadManager","annotationStorage","imageResourcesPath","renderForms","l10n","NullL10n","enableScripting","hasJSActionsPromise","fieldObjectsPromise","annotationCanvasMap","accessibilityManager","_hasJSActionsPromise","_fieldObjectsPromise","_annotationCanvasMap","_accessibilityManager","_cancelled","_eventBus","render","viewport","intent","AnnotationLayer","update","clone","dontFlip","annotations","hasJSActions","fieldObjects","all","getAnnotations","createElement","className","append","translate","updatePresentationModeState","_this$_eventBus","_on","cancel","_this$_eventBus2","_off","hidden","disableFormElements","section","childNodes","hasAttribute","inert","pdfjsLib","__non_webpack_require__","module","DEFAULT_L10N_STRINGS","of_pages","page_of_pages","document_properties_kb","document_properties_mb","document_properties_date_string","document_properties_page_size_unit_inches","document_properties_page_size_unit_millimeters","document_properties_page_size_orientation_portrait","document_properties_page_size_orientation_landscape","document_properties_page_size_name_a3","document_properties_page_size_name_a4","document_properties_page_size_name_letter","document_properties_page_size_name_legal","document_properties_page_size_dimension_string","document_properties_page_size_dimension_name_string","document_properties_linearized_yes","document_properties_linearized_no","additional_layers","page_landmark","thumb_page_title","thumb_page_canvas","find_reached_top","find_reached_bottom","find_not_found","page_scale_width","page_scale_fit","page_scale_auto","page_scale_actual","page_scale_percent","loading_error","invalid_file_error","missing_file_error","unexpected_response_error","rendering_error","printing_not_supported","printing_not_ready","web_fonts_disabled","free_text2_default_content","editor_free_text2_aria_label","editor_ink2_aria_label","editor_ink_canvas_aria_label","print_progress_percent","getL10nFallback","args","total","PARTIAL_LANG_CODES","en","es","fy","ga","gu","hi","hy","nb","ne","nn","pa","pt","sv","zh","fixupLangCode","langCode","formatL10nValue","text","getLanguage","getDirection","fallback","download","blobUrl","filename","click","body","DownloadManager","openBlobUrls","WeakMap","downloadUrl","_options","createValidAbsoluteUrl","downloadData","data","contentType","URL","createObjectURL","Blob","type","openOrDownloadData","isPdfData","isPdfFile","blob","WaitOnType","EVENT","TIMEOUT","waitOnEventOrTimeout","reject","handler","EventBus","eventHandler","removeEventListener","timeout","bind","timeoutHandler","listeners","create","on","eventName","listener","options","external","once","off","eventListeners","externalListeners","slice","ii","splice","AutomationEventBus","webL10n","GenericL10n","lang","_lang","_ready","setLanguage","gL10nData","gTextData","gTextProp","gLanguage","gMacros","gReadyState","gAsyncResourceLoading","getL10nResourceLinks","querySelectorAll","getL10nDictionary","script","innerHTML","getTranslatableChildren","getL10nAttributes","l10nId","getAttribute","l10nArgs","e","warn","xhrLoadText","onSuccess","onFailure","_onSuccess","_onFailure","xhr","XMLHttpRequest","open","overrideMimeType","onreadystatechange","readyState","status","responseText","onerror","ontimeout","send","parseResource","successCallback","failureCallback","baseURL","replace","evalString","lastIndexOf","parseProperties","parsedPropertiesCallback","dictionary","reBlank","reComment","reSection","reImport","reSplit","parseRawLines","rawText","extendedSyntax","parsedRawLinesCallback","entries","currentLang","genericLang","skipLang","nextEntry","line","shift","test","exec","loadImport","tmp","content","response","prop","substring","loadLocale","_callback","langLinks","langCount","dict","locales","default_locale","log","defaultLocale","anyCaseLang","onResourceLoaded","gResourceCount","L10nResourceLink","load","resource","getPluralRules","locales2rules","isIn","n","list","indexOf","isBetween","end","pluralRules","0","1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20","21","22","23","24","plural","_pluralRules","getL10nData","rv","substIndexes","substArguments","reIndex","reMatch","macroName","paramName","macro","reArgs","matched_text","arg","translateElement","getChildElementCount","children","found","l","nodeType","nodeValue","textNode","createTextNode","prepend","k","childElementCount","count","translateFragment","elementCount","fallbackString","getData","getText","rtlList","shortCode","getReadyState","ready","_pdf_find_utils","FindState","FOUND","NOT_FOUND","PENDING","FIND_TIMEOUT","MATCH_SCROLL_OFFSET_TOP","MATCH_SCROLL_OFFSET_LEFT","CHARACTERS_TO_NORMALIZE","DIACRITICS_EXCEPTION","DIACRITICS_EXCEPTION_STR","DIACRITICS_REG_EXP","SPECIAL_CHARS_REG_EXP","NOT_DIACRITIC_FROM_END_REG_EXP","NOT_DIACRITIC_FROM_START_REG_EXP","SYLLABLES_REG_EXP","SYLLABLES_LENGTHS","FIRST_CHAR_SYLLABLES_REG_EXP","NFKC_CHARS_TO_NORMALIZE","noSyllablesRegExp","withSyllablesRegExp","normalize","syllablePositions","m","char","len","normalizationRegex","keys","join","toNormalizeWithNFKC","getNormalizeWithNFKC","CJK","HKDiacritics","regexp","RegExp","rawDiacriticsPositions","normalized","positions","rawDiacriticsIndex","syllableIndex","shiftOrigin","eol","hasDiacritics","p1","p2","p3","p4","p5","p6","p7","p8","_syllablePositions$sy","replacement","jj","j","_rawDiacriticsPositio","charAt","_rawDiacriticsPositio2","hasTrailingDashEOL","endsWith","newCharLen","getOriginalIndex","diffs","pos","oldStart","oldEnd","oldLen","PDFFindController","updateMatchesCountOnProgress","visitedPagesCount","_linkService","onIsPageVisible","reset","onFind","onFindBarClose","highlightMatches","_highlightMatches","pageMatches","_pageMatches","pageMatchesLength","_pageMatchesLength","selected","_selected","_pdfDocument","_firstPageCapability","phraseSearch","shouldDirtyMatch","_dirtyMatch","updateUIState","promise","extractText","findbarClosed","pendingTimeout","_findTimeout","nextMatch","highlightAll","updateAllPages","scrollMatchIntoView","selectedLeft","matchIndex","_scrollMatches","matchIdx","pageIdx","_offset","wrapped","_extractTextPromises","_pageContents","_pageDiffs","_hasDiacritics","_matchesCountTotal","_pagesToSearch","_pendingFindMatches","_resumePageIdx","PromiseCapability","_rawQuery","_normalizedQuery","filter","map","_this$onIsPageVisible","newQuery","prevQuery","newType","prevType","call","isEntireWord","startIdx","charCodeAt","getCharacterType","calculateRegExpMatch","entireWord","pageContent","matches","matchesLength","matchPos","matchLen","convertToRegExpString","matchDiacritics","isUnicode","trailingSpaces","String","fromCharCode","calculateMatch","caseSensitive","reverse","isUnicodePart","queryPart","flags","updatePage","nextPageMatch","pageMatchesCount","updateUIResultsCount","textOptions","disableNormalization","extractTextCapability","getPage","getTextContent","textContent","strBuf","textItem","hasEOL","reason","previous","findPrevious","currentPageIndex","delete","offset","numPageMatches","updateMatch","advanceOffsetPage","matchesReady","numMatches","requestMatchesCount","current","_this$_pageMatches$i","matchesCount","_this$state","rawQuery","CharacterType","SPACE","ALPHA_LETTER","PUNCT","HAN_LETTER","KATAKANA_LETTER","HIRAGANA_LETTER","HALFWIDTH_KATAKANA_LETTER","THAI_LETTER","isAlphabeticalScript","charCode","isAscii","isAsciiAlpha","isAsciiDigit","isAsciiSpace","isHan","isKatakana","isHiragana","isHalfwidthKatakana","isThai","NormalizeWithNFKC","_event_utils","HASH_CHANGE_TIMEOUT","POSITION_UPDATED_THRESHOLD","UPDATE_VIEWAREA_TIMEOUT","getCurrentHash","location","PDFHistory","_initialized","_fingerprint","_boundEvents","_isPagesLoaded","initialize","fingerprint","resetHistory","updateUrl","reInitialized","_updateUrl","_bindEvents","history","_popStateInProgress","_blockHashChange","_currentHash","_numPositionUpdates","_uid","_maxUid","_destination","_position","_isValidState","_parseCurrentHash","_pushOrReplaceState","destination","_updateInternalState","uid","_initialRotation","_initialBookmark","_pageHide","_unbindEvents","_updateViewareaTimeout","_ref3","_isValidPage","forceReplace","isDestHashesEqual","isDestArraysEqual","_this$_destination","_tryPushCurrentPosition","popStateInProgress","initialBookmark","initialRotation","shouldReplace","newState","newUrl","startsWith","replaceState","pushState","temporary","position","assign","checkReload","perfEntry","performance","getEntriesByType","removeTemporary","checkNameddest","nameddest","_updateViewarea","_ref4","pdfOpenParams","_popState","_ref5","newHash","hashChanged","updateViewarea","popState","pageHide","destHash","pushHash","firstDest","secondDest","isEntryEqual","second","_annotation_editor_layer_builder","_annotation_layer_builder","_app_options","_pdf_link_service","_struct_tree_layer_builder","_text_accessibility","_text_highlighter","_text_layer_builder","_xfa_layer_builder","MAX_CANVAS_PIXELS","compatibilityParams","maxCanvasPixels","DEFAULT_LAYER_PROPERTIES","annotationEditorUIManager","findController","PDFPageView","annotationMode","AnnotationMode","ENABLE_FORMS","layerProperties","loadingId","previousRotation","renderError","renderingState","textLayerMode","useThumbnailCanvas","initialOptionalContent","regularAnnotations","viewportMap","_this$renderingQueue","defaultViewport","renderingId","pageLabel","scale","pdfPageRotate","_optionalContentConfigPromise","hasRestrictedScaling","useOnlyCssZoom","isOffscreenCanvasSupported","pageColors","renderingQueue","renderTask","resume","_isStandalone","hasViewer","annotationLayer","annotationEditorLayer","textLayer","zoomLayer","xfaLayer","structTreeLayer","msg","setDimensions","PixelsPerInch","PDF_TO_CSS_UNITS","hasInitialVisibility","setLayerDimensions","setPdfPage","totalRotation","getViewport","destroy","_this$pdfPage","cleanup","_textHighlighter","shadow","TextHighlighter","renderAnnotationLayer","renderAnnotationEditorLayer","renderXfaLayer","textDivs","buildXfaTextContentItems","renderTextLayer","renderingDone","readableStream","streamTextContent","includeMarkedContent","setTextContentSource","AbortException","numTextDivs","renderStructTreeLayer","_this$structTreeLayer","_this$structTreeLayer2","StructTreeLayerBuilder","tree","getStructTree","treeDom","_this$canvas","canvas","item","setTextMapping","enable","_resetZoomLayer","removeFromDOM","zoomLayerCanvas","firstChild","_this$annotationLayer","_this$annotationEdito","_this$xfaLayer","_this$textLayer","_this$structTreeLayer3","keepZoomLayer","keepAnnotationLayer","keepAnnotationEditorLayer","keepXfaLayer","keepTextLayer","cancelRendering","zoomLayerNode","annotationLayerNode","annotationEditorLayerNode","xfaLayerNode","textLayerNode","node","removeAttribute","drawingDelay","_this$div$parentNode","isScalingRestricted","outputScale","onlyCssZoom","postponeDrawing","cancelExtraDelay","cssTransform","redrawAnnotationLayer","redrawAnnotationEditorLayer","redrawXfaLayer","redrawTextLayer","hideTextLayer","timestamp","now","_this$_textHighlighte","disable","originalViewport","relativeRotation","absRotation","scaleX","scaleY","transform","_this$structTreeLayer4","getPagePoint","convertToPdfPoint","finishRenderTask","RenderingCancelledException","separateAnnots","draw","canvasWrapper","isPureXfa","TextAccessibilityManager","TextLayerBuilder","highlighter","enablePermissions","renderContinueCallback","cont","_showCanvas","showCanvas","isHighestPriority","hasHCM","background","foreground","isLastShow","ctx","getContext","alpha","actualSizeViewport","pixelsInViewport","maxScale","sqrt","sfx","sfy","renderContext","canvasContext","onContinue","resultPromise","_showCanvas2","AnnotationEditorLayerBuilder","uiManager","_showCanvas3","XfaLayerBuilder","setPageLabel","label","thumbnailCanvas","clonedViewport","tabIndex","AnnotationEditorLayer","parameters","isEmpty","userAgent","navigator","platform","maxTouchPoints","isAndroid","isIOS","checkCanvasSizeLimitation","OptionKind","VIEWER","API","WORKER","PREFERENCE","defaultOptions","annotationEditorMode","kind","cursorToolOnLoad","defaultZoomDelay","defaultZoomValue","disableHistory","disablePageLabels","enableFloatingToolbar","enablePrintAutoRotate","historyUpdateUrl","forcePageColors","pageColorsBackground","pageColorsForeground","pdfBugEnabled","printResolution","sidebarViewOnLoad","scrollModeOnLoad","spreadModeOnLoad","viewerCssTheme","viewOnLoad","cMapPacked","cMapUrl","disableAutoFetch","disableFontFace","disableRange","disableStream","docBaseUrl","enableXfa","fontExtraProperties","isEvalSupported","maxImageSize","pdfBug","standardFontDataUrl","verbosity","workerPort","workerSrc","defaultUrl","disablePreferences","locale","language","sandboxBundleSrc","userOptions","AppOptions","userOption","defaultOption","getAll","valueType","setAll","_hasUserOptions","PDF_ROLE_TO_HTML_ROLE","Document","DocumentFragment","Part","Sect","Div","Aside","NonStruct","P","H","Title","FENote","Sub","Lbl","Span","Em","Strong","Link","Annot","Form","Ruby","RB","RT","RP","Warichu","WT","WP","L","LI","LBody","Table","TR","TH","TD","THead","TBody","TFoot","Caption","Figure","Formula","Artifact","HEADING_PATTERN","structTree","walk","_this$treeDom","setAttributes","structElement","htmlElement","alt","role","kid","textChildren","textNodes","waitingElements","compareElementPositions","e1","e2","rect1","getBoundingClientRect","rect2","top1","bot1","mid1","top2","bot2","mid2","centerX1","centerX2","nodeIndex","getElementById","addIdToAriaOwns","isRemovable","addPointerInTextLayer","removePointerInTextLayer","_owns","owns","moveElementInDOM","contentElement","hasChildNodes","from","elementToCompare","before","after","_onUpdateTextLayerMatches","textContentItemsStr","divs","texts","_updateMatches","_convertMatches","iIndex","mm","begin","divIdx","_renderMatches","isSelectedPage","selectedMatchIdx","prevEnd","infinity","beginText","appendTextToDiv","fromOffset","toOffset","Node","TEXT_NODE","span","i0","i1","lastDivIdx","lastOffset","isSelected","highlightSuffix","n0","n1","clearedUntilDivIdx","textContentSource","textDivProperties","textLayerRenderTask","finishRendering","endOfContent","bindMouse","_this$highlighter","_this$accessibilityMa","_this$accessibilityMa2","globalThis","mustRotate","mustRescale","updateTextLayer","_this$highlighter2","_this$highlighter3","_this$highlighter4","_this$accessibilityMa3","adjustTop","getPropertyValue","divBounds","pageY","toFixed","event","selection","getSelection","clipboardData","setData","normalizeUnicode","stopPropagation","xfaHtml","XfaLayer","getXfa","PDFScriptingManager","scriptingFactory","docPropertiesLookup","_pdfViewer","_closeCapability","_destroyCapability","_scripting","_sandboxBundleSrc","_scriptingFactory","_docPropertiesLookup","detail","_this$_scripting3","_destroyScripting","objects","calculationOrder","docActions","getFieldObjects","getCalculationOrderIds","getJSActions","_createScripting","message","_internalEvents","_updateFromSandbox","_this$_scripting","dispatchEventInSandbox","_dispatchPageClose","_dispatchPageOpen","_pageOpenPending","_this$_scripting2","_this$_closeCapabilit","docProperties","_getDocProperties","createSandbox","appInfo","docInfo","actions","dispatchWillSave","_this$_scripting4","dispatchDidSave","_this$_scripting5","dispatchWillPrint","_this$_scripting6","dispatchDidPrint","_this$_scripting7","destroyPromise","_this$_destroyCapabil","_visitedPages","isChangingPresentationMode","siblings","command","modes","pagesPromise","currentScaleValue","increaseScale","decreaseScale","focus","elementId","dispatchEvent","CustomEvent","_this$_pdfDocument","setValue","visitedPages","pageView","getPageView","actionsPromise","_pageView$pdfPage","_this$_scripting8","_this$_scripting9","createScripting","GenericScripting","_this$_destroyCapabil3","_this$_destroyCapabil2","race","destroySandbox","info","metadata","contentDispositionFilename","contentLength","getMetadata","getDownloadInfo","filesize","getPdfFilenameFromUrl","getRaw","authors","loadScript","pdfjsSandbox","QuickJSSandbox","sandbox","nukeSandbox","_pdf_viewer","PDFSinglePageViewer","PDFViewer","_resetView","_scrollMode","_spreadMode","_updateScrollMode","_updateSpreadMode","_pdf_page_view","_pdf_rendering_queue","DEFAULT_CACHE_SIZE","PagesCountLimit","FORCE_SCROLL_MODE_PAGE","FORCE_LAZY_PAGE_INIT","PAUSE_EAGER_PAGE_INIT","isValidAnnotationEditorMode","AnnotationEditorType","PDFPageViewBuffer","buf","destroyFirstView","resize","newSize","idsToKeep","Symbol","iterator","firstView","next","buffer","containerTopLeft","copyCallbackBound","getAllTextInProgress","hiddenCopyElement","interruptCopyCondition","previousContainerHeight","resizeObserver","ResizeObserver","resizeObserverCallback","scrollModePageState","onVisibilityChange","scaleTimeoutId","_this$container","_this$viewer","viewerVersion","version","firstElementChild","tagName","observe","_getVisiblePages","_scriptingManager","scriptingManager","removePageBorders","CSS","supports","defaultRenderingQueue","PDFRenderingQueue","scroll","_scrollUpdate","presentationModeState","_onBeforeDraw","_onAfterDraw","updateContainerHeightCss","_pages","getCachedPageViews","pageViewsReady","_pagesCapability","settled","every","_currentPageNumber","_setCurrentPageNumber","_this$_pageLabels","resetCurrentPageView","_pageLabels","currentPageLabel","_this$_pageLabels2","currentScale","_currentScale","setScale","noScroll","_currentScaleValue","_pagesRotation","refresh","firstPagePromise","onePageRendered","_onePageRenderedCapability","self","_self$pdfDocument","_self$pdfDocument2","_self$pdfDocument3","initializePermissions","permissions","PermissionFlag","COPY","MODIFY_CONTENTS","MODIFY_ANNOTATIONS","FILL_INTERACTIVE_FORMS","onePageRenderedOrForceFetch","visibilityState","visibilityChangePromise","getAllText","copyCallback","focusNode","anchorNode","containsNode","savedCursor","cursor","interruptCopy","ev","clipboard","writeText","finally","_this$findController","_this$_scriptingManag","_cancelRendering","getOptionalContentConfig","permissionsPromise","getPermissions","firstPdfPage","AnnotationEditorUIManager","updateMode","viewerElement","firstPageView","ref","ensurePageViewVisible","_this$findController2","_this$_scriptingManag2","loadingParams","getPagesLeft","Language","setPageLabels","labels","_this$_pageLabels3","_location","_previousScrollMode","previousPageNumber","scrollDown","pages","pageIndexSet","parity","spread","dummyPage","pageSpot","isSameScale","newScale","setScaleUpdatePages","newValue","preset","presetValue","pageWidthScaleFactor","currentPage","hPadding","vPadding","pageWidthScale","pageHeightScale","horizontalScale","widthScale","heightScale","pageWidth","pageHeight","boundingRect","convertToViewportPoint","_updateLocation","firstPage","normalizedScaleValue","currentPageView","topLeft","intLeft","intTop","visiblePages","numVisiblePages","newCacheSize","renderHighestPriority","isSimpleLayout","currentId","stillFullyVisible","containsElement","_isContainerRtl","direction","isHorizontalScrollbarEnabled","isVerticalScrollbarEnabled","ensurePdfPageLoaded","_this$linkService$_ca","_this$linkService","getScrollAhead","_visible$first","_visible$last","forceRendering","currentlyVisiblePages","scrollAhead","preRenderExtra","getHighestPriority","renderView","hasEqualPageSizes","getPagesOverview","initialOrientation","orientation","cloneNode","_getPageAdvance","pageLayout","yArray","expectedId","firstId","lastId","advance","scaleFactor","steps","ceil","entry","borderBoxSize","blockSize","annotationEditorParams","_ref6","updateParams","noUpdate","updateArgs","CLEANUP_TIMEOUT","pdfThumbnailViewer","onIdle","highestPriorityPage","idleTimeout","printing","isThumbnailViewEnabled","setThumbnailViewer","_this$pdfThumbnailVie","scrolledDown","visibleViews","numVisible","isViewFinished","visibleIds","holeId","holeView","preRenderIndex","preRenderView","_download_manager","_genericl10n","_pdf_find_controller","_pdf_history","_pdf_scripting_manager","_pdf_single_page_viewer","pdfjsVersion","pdfjsBuild","DefaultAnnotationLayerFactory","DefaultStructTreeLayerFactory","DefaultTextLayerFactory","DefaultXfaLayerFactory"],"sourceRoot":""}
\No newline at end of file