securityos/node_modules/pdfjs-dist/build/pdf.js.map

1 line
1.4 MiB
Raw Permalink Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

{"version":3,"file":"pdf.js","mappings":";;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACUA,MAAMA,QAAA,GAEJ,OAAOC,OAAP,KAAmB,QADnB,IAEAA,OAAA,GAAU,EAAV,KAAiB,kBAFjB,IAGA,CAACA,OAAA,CAAQC,QAAR,CAAiBC,EAHlB,IAIA,EAAEF,OAAA,CAAQC,QAAR,CAAiBE,QAAjB,IAA6BH,OAAA,CAAQI,IAArC,IAA6CJ,OAAA,CAAQI,IAAR,KAAiB,SAA9D,CALJ;AApBAC,gBAAA,GAAAN,QAAA;AA2BA,MAAMO,eAAA,GAAkB,CAAC,CAAD,EAAI,CAAJ,EAAO,CAAP,EAAU,CAAV,EAAa,CAAb,EAAgB,CAAhB,CAAxB;AA3BAD,uBAAA,GAAAC,eAAA;AA4BA,MAAMC,oBAAA,GAAuB,CAAC,KAAD,EAAQ,CAAR,EAAW,CAAX,EAAc,KAAd,EAAqB,CAArB,EAAwB,CAAxB,CAA7B;AA5BAF,4BAAA,GAAAE,oBAAA;AA8BA,MAAMC,uBAAA,GAA0B,IAAhC;AA9BAH,+BAAA,GAAAG,uBAAA;AAkCA,MAAMC,WAAA,GAAc,IAApB;AAlCAJ,mBAAA,GAAAI,WAAA;AAmCA,MAAMC,mBAAA,GAAsB,IAA5B;AAnCAL,2BAAA,GAAAK,mBAAA;AAoCA,MAAMC,eAAA,GAAkBD,mBAAA,GAAsBD,WAA9C;AApCAJ,uBAAA,GAAAM,eAAA;AAkDA,MAAMC,mBAAA,GAAsB;EAC1BC,GAAA,EAAK,IADqB;EAE1BC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mBAAA;AAqBA,IAAAkuF,IAAA,GAAAluF,mBAAA;AAQA,IAAAE,cAAA,GAAAF,mBAAA;AAcA,IAAAmuF,WAAA,GAAAnuF,mBAAA;AACA,IAAAouF,wBAAA,GAAApuF,mBAAA;AACA,IAAA6f,MAAA,GAAA7f,mBAAA;AACA,IAAA0qE,iBAAA,GAAA1qE,mBAAA;AACA,IAAAM,eAAA,GAAAN,mBAAA;AACA,IAAAguE,UAAA,GAAAhuE,mBAAA;AAGA,MAAMquF,YAAA,GAC8B,UADpC;AAGA,MAAMC,UAAA,GAC8B,WADpC","sources":["webpack://pdfjs-dist/build/pdf/webpack/universalModuleDefinition","webpack://pdfjs-dist/build/pdf/src/shared/util.js","webpack://pdfjs-dist/build/pdf/src/display/api.js","webpack://pdfjs-dist/build/pdf/src/display/annotation_storage.js","webpack://pdfjs-dist/build/pdf/src/display/editor/editor.js","webpack://pdfjs-dist/build/pdf/src/display/editor/tools.js","webpack://pdfjs-dist/build/pdf/src/display/display_utils.js","webpack://pdfjs-dist/build/pdf/src/display/base_factory.js","webpack://pdfjs-dist/build/pdf/src/shared/murmurhash3.js","webpack://pdfjs-dist/build/pdf/src/display/font_loader.js","webpack://pdfjs-dist/build/pdf/src/display/node_utils.js","webpack://pdfjs-dist/build/pdf/src/display/canvas.js","webpack://pdfjs-dist/build/pdf/src/display/pattern_helper.js","webpack://pdfjs-dist/build/pdf/src/shared/image_utils.js","webpack://pdfjs-dist/build/pdf/src/display/worker_options.js","webpack://pdfjs-dist/build/pdf/src/shared/message_handler.js","webpack://pdfjs-dist/build/pdf/src/display/metadata.js","webpack://pdfjs-dist/build/pdf/src/display/optional_content_config.js","webpack://pdfjs-dist/build/pdf/src/display/transport_stream.js","webpack://pdfjs-dist/build/pdf/src/display/fetch_stream.js","webpack://pdfjs-dist/build/pdf/src/display/network_utils.js","webpack://pdfjs-dist/build/pdf/src/display/content_disposition.js","webpack://pdfjs-dist/build/pdf/src/display/network.js","webpack://pdfjs-dist/build/pdf/src/display/node_stream.js","webpack://pdfjs-dist/build/pdf/src/display/svg.js","webpack://pdfjs-dist/build/pdf/src/display/xfa_text.js","webpack://pdfjs-dist/build/pdf/src/display/text_layer.js","webpack://pdfjs-dist/build/pdf/src/display/editor/annotation_editor_layer.js","webpack://pdfjs-dist/build/pdf/src/display/editor/freetext.js","webpack://pdfjs-dist/build/pdf/src/display/annotation_layer.js","webpack://pdfjs-dist/build/pdf/src/shared/scripting_utils.js","webpack://pdfjs-dist/build/pdf/web/l10n_utils.js","webpack://pdfjs-dist/build/pdf/src/display/xfa_layer.js","webpack://pdfjs-dist/build/pdf/src/display/editor/ink.js","webpack://pdfjs-dist/build/pdf/src/display/editor/stamp.js","webpack://pdfjs-dist/build/pdf/webpack/bootstrap","webpack://pdfjs-dist/build/pdf/src/pdf.js"],"sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = root.pdfjsLib = factory();\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine(\"pdfjs-dist/build/pdf\", [], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"pdfjs-dist/build/pdf\"] = factory();\n\telse\n\t\troot[\"pdfjs-dist/build/pdf\"] = factory();\n})(globalThis, () => {\nreturn ","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals process */\n\n// NW.js / Electron is a browser context, but copies some Node.js objects; see\n// http://docs.nwjs.io/en/latest/For%20Users/Advanced/JavaScript%20Contexts%20in%20NW.js/#access-nodejs-and-nwjs-api-in-browser-context\n// https://www.electronjs.org/docs/api/process#processversionselectron-readonly\n// https://www.electronjs.org/docs/api/process#processtype-readonly\nconst isNodeJS =\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n typeof process === \"object\" &&\n process + \"\" === \"[object process]\" &&\n !process.versions.nw &&\n !(process.versions.electron && process.type && process.type !== \"browser\");\n\nconst IDENTITY_MATRIX = [1, 0, 0, 1, 0, 0];\nconst FONT_IDENTITY_MATRIX = [0.001, 0, 0, 0.001, 0, 0];\n\nconst MAX_IMAGE_SIZE_TO_CACHE = 10e6; // Ten megabytes.\n\n// Represent the percentage of the height of a single-line field over\n// the font size. Acrobat seems to use this value.\nconst LINE_FACTOR = 1.35;\nconst LINE_DESCENT_FACTOR = 0.35;\nconst BASELINE_FACTOR = LINE_DESCENT_FACTOR / LINE_FACTOR;\n\n/**\n * Refer to the `WorkerTransport.getRenderingIntent`-method in the API, to see\n * how these flags are being used:\n * - ANY, DISPLAY, and PRINT are the normal rendering intents, note the\n * `PDFPageProxy.{render, getOperatorList, getAnnotations}`-methods.\n * - ANNOTATIONS_FORMS, ANNOTATIONS_STORAGE, ANNOTATIONS_DISABLE control which\n * annotations are rendered onto the canvas (i.e. by being included in the\n * operatorList), note the `PDFPageProxy.{render, getOperatorList}`-methods\n * and their `annotationMode`-option.\n * - OPLIST is used with the `PDFPageProxy.getOperatorList`-method, note the\n * `OperatorList`-constructor (on the worker-thread).\n */\nconst RenderingIntentFlag = {\n ANY: 0x01,\n DISPLAY: 0x02,\n PRINT: 0x04,\n SAVE: 0x08,\n ANNOTATIONS_FORMS: 0x10,\n ANNOTATIONS_STORAGE: 0x20,\n ANNOTATIONS_DISABLE: 0x40,\n OPLIST: 0x100,\n};\n\nconst AnnotationMode = {\n DISABLE: 0,\n ENABLE: 1,\n ENABLE_FORMS: 2,\n ENABLE_STORAGE: 3,\n};\n\nconst AnnotationEditorPrefix = \"pdfjs_internal_editor_\";\n\nconst AnnotationEditorType = {\n DISABLE: -1,\n NONE: 0,\n FREETEXT: 3,\n STAMP: 13,\n INK: 15,\n};\n\nconst AnnotationEditorParamsType = {\n RESIZE: 1,\n CREATE: 2,\n FREETEXT_SIZE: 11,\n FREETEXT_COLOR: 12,\n FREETEXT_OPACITY: 13,\n INK_COLOR: 21,\n INK_THICKNESS: 22,\n INK_OPACITY: 23,\n};\n\n// Permission flags from Table 22, Section 7.6.3.2 of the PDF specification.\nconst PermissionFlag = {\n PRINT: 0x04,\n MODIFY_CONTENTS: 0x08,\n COPY: 0x10,\n MODIFY_ANNOTATIONS: 0x20,\n FILL_INTERACTIVE_FORMS: 0x100,\n COPY_FOR_ACCESSIBILITY: 0x200,\n ASSEMBLE: 0x400,\n PRINT_HIGH_QUALITY: 0x800,\n};\n\nconst TextRenderingMode = {\n FILL: 0,\n STROKE: 1,\n FILL_STROKE: 2,\n INVISIBLE: 3,\n FILL_ADD_TO_PATH: 4,\n STROKE_ADD_TO_PATH: 5,\n FILL_STROKE_ADD_TO_PATH: 6,\n ADD_TO_PATH: 7,\n FILL_STROKE_MASK: 3,\n ADD_TO_PATH_FLAG: 4,\n};\n\nconst ImageKind = {\n GRAYSCALE_1BPP: 1,\n RGB_24BPP: 2,\n RGBA_32BPP: 3,\n};\n\nconst AnnotationType = {\n TEXT: 1,\n LINK: 2,\n FREETEXT: 3,\n LINE: 4,\n SQUARE: 5,\n CIRCLE: 6,\n POLYGON: 7,\n POLYLINE: 8,\n HIGHLIGHT: 9,\n UNDERLINE: 10,\n SQUIGGLY: 11,\n STRIKEOUT: 12,\n STAMP: 13,\n CARET: 14,\n INK: 15,\n POPUP: 16,\n FILEATTACHMENT: 17,\n SOUND: 18,\n MOVIE: 19,\n WIDGET: 20,\n SCREEN: 21,\n PRINTERMARK: 22,\n TRAPNET: 23,\n WATERMARK: 24,\n THREED: 25,\n REDACT: 26,\n};\n\nconst AnnotationReplyType = {\n GROUP: \"Group\",\n REPLY: \"R\",\n};\n\nconst AnnotationFlag = {\n INVISIBLE: 0x01,\n HIDDEN: 0x02,\n PRINT: 0x04,\n NOZOOM: 0x08,\n NOROTATE: 0x10,\n NOVIEW: 0x20,\n READONLY: 0x40,\n LOCKED: 0x80,\n TOGGLENOVIEW: 0x100,\n LOCKEDCONTENTS: 0x200,\n};\n\nconst AnnotationFieldFlag = {\n READONLY: 0x0000001,\n REQUIRED: 0x0000002,\n NOEXPORT: 0x0000004,\n MULTILINE: 0x0001000,\n PASSWORD: 0x0002000,\n NOTOGGLETOOFF: 0x0004000,\n RADIO: 0x0008000,\n PUSHBUTTON: 0x0010000,\n COMBO: 0x0020000,\n EDIT: 0x0040000,\n SORT: 0x0080000,\n FILESELECT: 0x0100000,\n MULTISELECT: 0x0200000,\n DONOTSPELLCHECK: 0x0400000,\n DONOTSCROLL: 0x0800000,\n COMB: 0x1000000,\n RICHTEXT: 0x2000000,\n RADIOSINUNISON: 0x2000000,\n COMMITONSELCHANGE: 0x4000000,\n};\n\nconst AnnotationBorderStyleType = {\n SOLID: 1,\n DASHED: 2,\n BEVELED: 3,\n INSET: 4,\n UNDERLINE: 5,\n};\n\nconst AnnotationActionEventType = {\n E: \"Mouse Enter\",\n X: \"Mouse Exit\",\n D: \"Mouse Down\",\n U: \"Mouse Up\",\n Fo: \"Focus\",\n Bl: \"Blur\",\n PO: \"PageOpen\",\n PC: \"PageClose\",\n PV: \"PageVisible\",\n PI: \"PageInvisible\",\n K: \"Keystroke\",\n F: \"Format\",\n V: \"Validate\",\n C: \"Calculate\",\n};\n\nconst DocumentActionEventType = {\n WC: \"WillClose\",\n WS: \"WillSave\",\n DS: \"DidSave\",\n WP: \"WillPrint\",\n DP: \"DidPrint\",\n};\n\nconst PageActionEventType = {\n O: \"PageOpen\",\n C: \"PageClose\",\n};\n\nconst VerbosityLevel = {\n ERRORS: 0,\n WARNINGS: 1,\n INFOS: 5,\n};\n\nconst CMapCompressionType = {\n NONE: 0,\n BINARY: 1,\n};\n\n// All the possible operations for an operator list.\nconst OPS = {\n // Intentionally start from 1 so it is easy to spot bad operators that will be\n // 0's.\n // PLEASE NOTE: We purposely keep any removed operators commented out, since\n // re-numbering the list would risk breaking third-party users.\n dependency: 1,\n setLineWidth: 2,\n setLineCap: 3,\n setLineJoin: 4,\n setMiterLimit: 5,\n setDash: 6,\n setRenderingIntent: 7,\n setFlatness: 8,\n setGState: 9,\n save: 10,\n restore: 11,\n transform: 12,\n moveTo: 13,\n lineTo: 14,\n curveTo: 15,\n curveTo2: 16,\n curveTo3: 17,\n closePath: 18,\n rectangle: 19,\n stroke: 20,\n closeStroke: 21,\n fill: 22,\n eoFill: 23,\n fillStroke: 24,\n eoFillStroke: 25,\n closeFillStroke: 26,\n closeEOFillStroke: 27,\n endPath: 28,\n clip: 29,\n eoClip: 30,\n beginText: 31,\n endText: 32,\n setCharSpacing: 33,\n setWordSpacing: 34,\n setHScale: 35,\n setLeading: 36,\n setFont: 37,\n setTextRenderingMode: 38,\n setTextRise: 39,\n moveText: 40,\n setLeadingMoveText: 41,\n setTextMatrix: 42,\n nextLine: 43,\n showText: 44,\n showSpacedText: 45,\n nextLineShowText: 46,\n nextLineSetSpacingShowText: 47,\n setCharWidth: 48,\n setCharWidthAndBounds: 49,\n setStrokeColorSpace: 50,\n setFillColorSpace: 51,\n setStrokeColor: 52,\n setStrokeColorN: 53,\n setFillColor: 54,\n setFillColorN: 55,\n setStrokeGray: 56,\n setFillGray: 57,\n setStrokeRGBColor: 58,\n setFillRGBColor: 59,\n setStrokeCMYKColor: 60,\n setFillCMYKColor: 61,\n shadingFill: 62,\n beginInlineImage: 63,\n beginImageData: 64,\n endInlineImage: 65,\n paintXObject: 66,\n markPoint: 67,\n markPointProps: 68,\n beginMarkedContent: 69,\n beginMarkedContentProps: 70,\n endMarkedContent: 71,\n beginCompat: 72,\n endCompat: 73,\n paintFormXObjectBegin: 74,\n paintFormXObjectEnd: 75,\n beginGroup: 76,\n endGroup: 77,\n // beginAnnotations: 78,\n // endAnnotations: 79,\n beginAnnotation: 80,\n endAnnotation: 81,\n // paintJpegXObject: 82,\n paintImageMaskXObject: 83,\n paintImageMaskXObjectGroup: 84,\n paintImageXObject: 85,\n paintInlineImageXObject: 86,\n paintInlineImageXObjectGroup: 87,\n paintImageXObjectRepeat: 88,\n paintImageMaskXObjectRepeat: 89,\n paintSolidColorImageMask: 90,\n constructPath: 91,\n};\n\nconst PasswordResponses = {\n NEED_PASSWORD: 1,\n INCORRECT_PASSWORD: 2,\n};\n\nlet verbosity = VerbosityLevel.WARNINGS;\n\nfunction setVerbosityLevel(level) {\n if (Number.isInteger(level)) {\n verbosity = level;\n }\n}\n\nfunction getVerbosityLevel() {\n return verbosity;\n}\n\n// A notice for devs. These are good for things that are helpful to devs, such\n// as warning that Workers were disabled, which is important to devs but not\n// end users.\nfunction info(msg) {\n if (verbosity >= VerbosityLevel.INFOS) {\n console.log(`Info: ${msg}`);\n }\n}\n\n// Non-fatal warnings.\nfunction warn(msg) {\n if (verbosity >= VerbosityLevel.WARNINGS) {\n console.log(`Warning: ${msg}`);\n }\n}\n\nfunction unreachable(msg) {\n throw new Error(msg);\n}\n\nfunction assert(cond, msg) {\n if (!cond) {\n unreachable(msg);\n }\n}\n\n// Checks if URLs use one of the allowed protocols, e.g. to avoid XSS.\nfunction _isValidProtocol(url) {\n switch (url?.protocol) {\n case \"http:\":\n case \"https:\":\n case \"ftp:\":\n case \"mailto:\":\n case \"tel:\":\n return true;\n default:\n return false;\n }\n}\n\n/**\n * Attempts to create a valid absolute URL.\n *\n * @param {URL|string} url - An absolute, or relative, URL.\n * @param {URL|string} [baseUrl] - An absolute URL.\n * @param {Object} [options]\n * @returns Either a valid {URL}, or `null` otherwise.\n */\nfunction createValidAbsoluteUrl(url, baseUrl = null, options = null) {\n if (!url) {\n return null;\n }\n try {\n if (options && typeof url === \"string\") {\n // Let URLs beginning with \"www.\" default to using the \"http://\" protocol.\n if (options.addDefaultProtocol && url.startsWith(\"www.\")) {\n const dots = url.match(/\\./g);\n // Avoid accidentally matching a *relative* URL pointing to a file named\n // e.g. \"www.pdf\" or similar.\n if (dots?.length >= 2) {\n url = `http://${url}`;\n }\n }\n\n // According to ISO 32000-1:2008, section 12.6.4.7, URIs should be encoded\n // in 7-bit ASCII. Some bad PDFs use UTF-8 encoding; see bug 1122280.\n if (options.tryConvertEncoding) {\n try {\n url = stringToUTF8String(url);\n } catch {}\n }\n }\n\n const absoluteUrl = baseUrl ? new URL(url, baseUrl) : new URL(url);\n if (_isValidProtocol(absoluteUrl)) {\n return absoluteUrl;\n }\n } catch {\n /* `new URL()` will throw on incorrect data. */\n }\n return null;\n}\n\nfunction shadow(obj, prop, value, nonSerializable = false) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n prop in obj,\n `shadow: Property \"${prop && prop.toString()}\" not found in object.`\n );\n }\n Object.defineProperty(obj, prop, {\n value,\n enumerable: !nonSerializable,\n configurable: true,\n writable: false,\n });\n return value;\n}\n\n/**\n * @type {any}\n */\nconst BaseException = (function BaseExceptionClosure() {\n // eslint-disable-next-line no-shadow\n function BaseException(message, name) {\n if (this.constructor === BaseException) {\n unreachable(\"Cannot initialize BaseException.\");\n }\n this.message = message;\n this.name = name;\n }\n BaseException.prototype = new Error();\n BaseException.constructor = BaseException;\n\n return BaseException;\n})();\n\nclass PasswordException extends BaseException {\n constructor(msg, code) {\n super(msg, \"PasswordException\");\n this.code = code;\n }\n}\n\nclass UnknownErrorException extends BaseException {\n constructor(msg, details) {\n super(msg, \"UnknownErrorException\");\n this.details = details;\n }\n}\n\nclass InvalidPDFException extends BaseException {\n constructor(msg) {\n super(msg, \"InvalidPDFException\");\n }\n}\n\nclass MissingPDFException extends BaseException {\n constructor(msg) {\n super(msg, \"MissingPDFException\");\n }\n}\n\nclass UnexpectedResponseException extends BaseException {\n constructor(msg, status) {\n super(msg, \"UnexpectedResponseException\");\n this.status = status;\n }\n}\n\n/**\n * Error caused during parsing PDF data.\n */\nclass FormatError extends BaseException {\n constructor(msg) {\n super(msg, \"FormatError\");\n }\n}\n\n/**\n * Error used to indicate task cancellation.\n */\nclass AbortException extends BaseException {\n constructor(msg) {\n super(msg, \"AbortException\");\n }\n}\n\nfunction bytesToString(bytes) {\n if (typeof bytes !== \"object\" || bytes?.length === undefined) {\n unreachable(\"Invalid argument for bytesToString\");\n }\n const length = bytes.length;\n const MAX_ARGUMENT_COUNT = 8192;\n if (length < MAX_ARGUMENT_COUNT) {\n return String.fromCharCode.apply(null, bytes);\n }\n const strBuf = [];\n for (let i = 0; i < length; i += MAX_ARGUMENT_COUNT) {\n const chunkEnd = Math.min(i + MAX_ARGUMENT_COUNT, length);\n const chunk = bytes.subarray(i, chunkEnd);\n strBuf.push(String.fromCharCode.apply(null, chunk));\n }\n return strBuf.join(\"\");\n}\n\nfunction stringToBytes(str) {\n if (typeof str !== \"string\") {\n unreachable(\"Invalid argument for stringToBytes\");\n }\n const length = str.length;\n const bytes = new Uint8Array(length);\n for (let i = 0; i < length; ++i) {\n bytes[i] = str.charCodeAt(i) & 0xff;\n }\n return bytes;\n}\n\nfunction string32(value) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n typeof value === \"number\" && Math.abs(value) < 2 ** 32,\n `string32: Unexpected input \"${value}\".`\n );\n }\n return String.fromCharCode(\n (value >> 24) & 0xff,\n (value >> 16) & 0xff,\n (value >> 8) & 0xff,\n value & 0xff\n );\n}\n\nfunction objectSize(obj) {\n return Object.keys(obj).length;\n}\n\n// Ensure that the returned Object has a `null` prototype; hence why\n// `Object.fromEntries(...)` is not used.\nfunction objectFromMap(map) {\n const obj = Object.create(null);\n for (const [key, value] of map) {\n obj[key] = value;\n }\n return obj;\n}\n\n// Checks the endianness of the platform.\nfunction isLittleEndian() {\n const buffer8 = new Uint8Array(4);\n buffer8[0] = 1;\n const view32 = new Uint32Array(buffer8.buffer, 0, 1);\n return view32[0] === 1;\n}\n\n// Checks if it's possible to eval JS expressions.\nfunction isEvalSupported() {\n try {\n new Function(\"\"); // eslint-disable-line no-new, no-new-func\n return true;\n } catch {\n return false;\n }\n}\n\nclass FeatureTest {\n static get isLittleEndian() {\n return shadow(this, \"isLittleEndian\", isLittleEndian());\n }\n\n static get isEvalSupported() {\n return shadow(this, \"isEvalSupported\", isEvalSupported());\n }\n\n static get isOffscreenCanvasSupported() {\n return shadow(\n this,\n \"isOffscreenCanvasSupported\",\n typeof OffscreenCanvas !== \"undefined\"\n );\n }\n\n static get platform() {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n typeof navigator === \"undefined\"\n ) {\n return shadow(this, \"platform\", { isWin: false, isMac: false });\n }\n return shadow(this, \"platform\", {\n isWin: navigator.platform.includes(\"Win\"),\n isMac: navigator.platform.includes(\"Mac\"),\n });\n }\n\n static get isCSSRoundSupported() {\n return shadow(\n this,\n \"isCSSRoundSupported\",\n globalThis.CSS?.supports?.(\"width: round(1.5px, 1px)\")\n );\n }\n}\n\nconst hexNumbers = [...Array(256).keys()].map(n =>\n n.toString(16).padStart(2, \"0\")\n);\n\nclass Util {\n static makeHexColor(r, g, b) {\n return `#${hexNumbers[r]}${hexNumbers[g]}${hexNumbers[b]}`;\n }\n\n // Apply a scaling matrix to some min/max values.\n // If a scaling factor is negative then min and max must be\n // swaped.\n static scaleMinMax(transform, minMax) {\n let temp;\n if (transform[0]) {\n if (transform[0] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[1];\n minMax[1] = temp;\n }\n minMax[0] *= transform[0];\n minMax[1] *= transform[0];\n\n if (transform[3] < 0) {\n temp = minMax[2];\n minMax[2] = minMax[3];\n minMax[3] = temp;\n }\n minMax[2] *= transform[3];\n minMax[3] *= transform[3];\n } else {\n temp = minMax[0];\n minMax[0] = minMax[2];\n minMax[2] = temp;\n temp = minMax[1];\n minMax[1] = minMax[3];\n minMax[3] = temp;\n\n if (transform[1] < 0) {\n temp = minMax[2];\n minMax[2] = minMax[3];\n minMax[3] = temp;\n }\n minMax[2] *= transform[1];\n minMax[3] *= transform[1];\n\n if (transform[2] < 0) {\n temp = minMax[0];\n minMax[0] = minMax[1];\n minMax[1] = temp;\n }\n minMax[0] *= transform[2];\n minMax[1] *= transform[2];\n }\n minMax[0] += transform[4];\n minMax[1] += transform[4];\n minMax[2] += transform[5];\n minMax[3] += transform[5];\n }\n\n // Concatenates two transformation matrices together and returns the result.\n static transform(m1, m2) {\n return [\n m1[0] * m2[0] + m1[2] * m2[1],\n m1[1] * m2[0] + m1[3] * m2[1],\n m1[0] * m2[2] + m1[2] * m2[3],\n m1[1] * m2[2] + m1[3] * m2[3],\n m1[0] * m2[4] + m1[2] * m2[5] + m1[4],\n m1[1] * m2[4] + m1[3] * m2[5] + m1[5],\n ];\n }\n\n // For 2d affine transforms\n static applyTransform(p, m) {\n const xt = p[0] * m[0] + p[1] * m[2] + m[4];\n const yt = p[0] * m[1] + p[1] * m[3] + m[5];\n return [xt, yt];\n }\n\n static applyInverseTransform(p, m) {\n const d = m[0] * m[3] - m[1] * m[2];\n const xt = (p[0] * m[3] - p[1] * m[2] + m[2] * m[5] - m[4] * m[3]) / d;\n const yt = (-p[0] * m[1] + p[1] * m[0] + m[4] * m[1] - m[5] * m[0]) / d;\n return [xt, yt];\n }\n\n // Applies the transform to the rectangle and finds the minimum axially\n // aligned bounding box.\n static getAxialAlignedBoundingBox(r, m) {\n const p1 = this.applyTransform(r, m);\n const p2 = this.applyTransform(r.slice(2, 4), m);\n const p3 = this.applyTransform([r[0], r[3]], m);\n const p4 = this.applyTransform([r[2], r[1]], m);\n return [\n Math.min(p1[0], p2[0], p3[0], p4[0]),\n Math.min(p1[1], p2[1], p3[1], p4[1]),\n Math.max(p1[0], p2[0], p3[0], p4[0]),\n Math.max(p1[1], p2[1], p3[1], p4[1]),\n ];\n }\n\n static inverseTransform(m) {\n const d = m[0] * m[3] - m[1] * m[2];\n return [\n m[3] / d,\n -m[1] / d,\n -m[2] / d,\n m[0] / d,\n (m[2] * m[5] - m[4] * m[3]) / d,\n (m[4] * m[1] - m[5] * m[0]) / d,\n ];\n }\n\n // This calculation uses Singular Value Decomposition.\n // The SVD can be represented with formula A = USV. We are interested in the\n // matrix S here because it represents the scale values.\n static singularValueDecompose2dScale(m) {\n const transpose = [m[0], m[2], m[1], m[3]];\n\n // Multiply matrix m with its transpose.\n const a = m[0] * transpose[0] + m[1] * transpose[2];\n const b = m[0] * transpose[1] + m[1] * transpose[3];\n const c = m[2] * transpose[0] + m[3] * transpose[2];\n const d = m[2] * transpose[1] + m[3] * transpose[3];\n\n // Solve the second degree polynomial to get roots.\n const first = (a + d) / 2;\n const second = Math.sqrt((a + d) ** 2 - 4 * (a * d - c * b)) / 2;\n const sx = first + second || 1;\n const sy = first - second || 1;\n\n // Scale values are the square roots of the eigenvalues.\n return [Math.sqrt(sx), Math.sqrt(sy)];\n }\n\n // Normalize rectangle rect=[x1, y1, x2, y2] so that (x1,y1) < (x2,y2)\n // For coordinate systems whose origin lies in the bottom-left, this\n // means normalization to (BL,TR) ordering. For systems with origin in the\n // top-left, this means (TL,BR) ordering.\n static normalizeRect(rect) {\n const r = rect.slice(0); // clone rect\n if (rect[0] > rect[2]) {\n r[0] = rect[2];\n r[2] = rect[0];\n }\n if (rect[1] > rect[3]) {\n r[1] = rect[3];\n r[3] = rect[1];\n }\n return r;\n }\n\n // Returns a rectangle [x1, y1, x2, y2] corresponding to the\n // intersection of rect1 and rect2. If no intersection, returns 'null'\n // The rectangle coordinates of rect1, rect2 should be [x1, y1, x2, y2]\n static intersect(rect1, rect2) {\n const xLow = Math.max(\n Math.min(rect1[0], rect1[2]),\n Math.min(rect2[0], rect2[2])\n );\n const xHigh = Math.min(\n Math.max(rect1[0], rect1[2]),\n Math.max(rect2[0], rect2[2])\n );\n if (xLow > xHigh) {\n return null;\n }\n const yLow = Math.max(\n Math.min(rect1[1], rect1[3]),\n Math.min(rect2[1], rect2[3])\n );\n const yHigh = Math.min(\n Math.max(rect1[1], rect1[3]),\n Math.max(rect2[1], rect2[3])\n );\n if (yLow > yHigh) {\n return null;\n }\n\n return [xLow, yLow, xHigh, yHigh];\n }\n\n // From https://github.com/adobe-webplatform/Snap.svg/blob/b365287722a72526000ac4bfcf0ce4cac2faa015/src/path.js#L852\n static bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3) {\n const tvalues = [],\n bounds = [[], []];\n let a, b, c, t, t1, t2, b2ac, sqrtb2ac;\n for (let i = 0; i < 2; ++i) {\n if (i === 0) {\n b = 6 * x0 - 12 * x1 + 6 * x2;\n a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n c = 3 * x1 - 3 * x0;\n } else {\n b = 6 * y0 - 12 * y1 + 6 * y2;\n a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n c = 3 * y1 - 3 * y0;\n }\n if (Math.abs(a) < 1e-12) {\n if (Math.abs(b) < 1e-12) {\n continue;\n }\n t = -c / b;\n if (0 < t && t < 1) {\n tvalues.push(t);\n }\n continue;\n }\n b2ac = b * b - 4 * c * a;\n sqrtb2ac = Math.sqrt(b2ac);\n if (b2ac < 0) {\n continue;\n }\n t1 = (-b + sqrtb2ac) / (2 * a);\n if (0 < t1 && t1 < 1) {\n tvalues.push(t1);\n }\n t2 = (-b - sqrtb2ac) / (2 * a);\n if (0 < t2 && t2 < 1) {\n tvalues.push(t2);\n }\n }\n\n let j = tvalues.length,\n mt;\n const jlen = j;\n while (j--) {\n t = tvalues[j];\n mt = 1 - t;\n bounds[0][j] =\n mt * mt * mt * x0 +\n 3 * mt * mt * t * x1 +\n 3 * mt * t * t * x2 +\n t * t * t * x3;\n bounds[1][j] =\n mt * mt * mt * y0 +\n 3 * mt * mt * t * y1 +\n 3 * mt * t * t * y2 +\n t * t * t * y3;\n }\n\n bounds[0][jlen] = x0;\n bounds[1][jlen] = y0;\n bounds[0][jlen + 1] = x3;\n bounds[1][jlen + 1] = y3;\n bounds[0].length = bounds[1].length = jlen + 2;\n\n return [\n Math.min(...bounds[0]),\n Math.min(...bounds[1]),\n Math.max(...bounds[0]),\n Math.max(...bounds[1]),\n ];\n }\n}\n\nconst PDFStringTranslateTable = [\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x2d8,\n 0x2c7, 0x2c6, 0x2d9, 0x2dd, 0x2db, 0x2da, 0x2dc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,\n 0, 0, 0, 0, 0, 0, 0, 0, 0x2022, 0x2020, 0x2021, 0x2026, 0x2014, 0x2013, 0x192,\n 0x2044, 0x2039, 0x203a, 0x2212, 0x2030, 0x201e, 0x201c, 0x201d, 0x2018,\n 0x2019, 0x201a, 0x2122, 0xfb01, 0xfb02, 0x141, 0x152, 0x160, 0x178, 0x17d,\n 0x131, 0x142, 0x153, 0x161, 0x17e, 0, 0x20ac,\n];\n\nfunction stringToPDFString(str) {\n if (str[0] >= \"\\xEF\") {\n let encoding;\n if (str[0] === \"\\xFE\" && str[1] === \"\\xFF\") {\n encoding = \"utf-16be\";\n } else if (str[0] === \"\\xFF\" && str[1] === \"\\xFE\") {\n encoding = \"utf-16le\";\n } else if (str[0] === \"\\xEF\" && str[1] === \"\\xBB\" && str[2] === \"\\xBF\") {\n encoding = \"utf-8\";\n }\n\n if (encoding) {\n try {\n const decoder = new TextDecoder(encoding, { fatal: true });\n const buffer = stringToBytes(str);\n return decoder.decode(buffer);\n } catch (ex) {\n warn(`stringToPDFString: \"${ex}\".`);\n }\n }\n }\n // ISO Latin 1\n const strBuf = [];\n for (let i = 0, ii = str.length; i < ii; i++) {\n const code = PDFStringTranslateTable[str.charCodeAt(i)];\n strBuf.push(code ? String.fromCharCode(code) : str.charAt(i));\n }\n return strBuf.join(\"\");\n}\n\nfunction stringToUTF8String(str) {\n return decodeURIComponent(escape(str));\n}\n\nfunction utf8StringToString(str) {\n return unescape(encodeURIComponent(str));\n}\n\nfunction isArrayBuffer(v) {\n return typeof v === \"object\" && v?.byteLength !== undefined;\n}\n\nfunction isArrayEqual(arr1, arr2) {\n if (arr1.length !== arr2.length) {\n return false;\n }\n for (let i = 0, ii = arr1.length; i < ii; i++) {\n if (arr1[i] !== arr2[i]) {\n return false;\n }\n }\n return true;\n}\n\nfunction getModificationDate(date = new Date()) {\n const buffer = [\n date.getUTCFullYear().toString(),\n (date.getUTCMonth() + 1).toString().padStart(2, \"0\"),\n date.getUTCDate().toString().padStart(2, \"0\"),\n date.getUTCHours().toString().padStart(2, \"0\"),\n date.getUTCMinutes().toString().padStart(2, \"0\"),\n date.getUTCSeconds().toString().padStart(2, \"0\"),\n ];\n\n return buffer.join(\"\");\n}\n\nclass PromiseCapability {\n #settled = false;\n\n constructor() {\n /**\n * @type {Promise<any>} The Promise object.\n */\n this.promise = new Promise((resolve, reject) => {\n /**\n * @type {function} Fulfills the Promise.\n */\n this.resolve = data => {\n this.#settled = true;\n resolve(data);\n };\n\n /**\n * @type {function} Rejects the Promise.\n */\n this.reject = reason => {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(reason instanceof Error, 'Expected valid \"reason\" argument.');\n }\n this.#settled = true;\n reject(reason);\n };\n });\n }\n\n /**\n * @type {boolean} If the Promise has been fulfilled/rejected.\n */\n get settled() {\n return this.#settled;\n }\n}\n\nlet NormalizeRegex = null;\nlet NormalizationMap = null;\nfunction normalizeUnicode(str) {\n if (!NormalizeRegex) {\n // In order to generate the following regex:\n // - create a PDF containing all the chars in the range 0000-FFFF with\n // a NFKC which is different of the char.\n // - copy and paste all those chars and get the ones where NFKC is\n // required.\n // It appears that most the chars here contain some ligatures.\n NormalizeRegex =\n /([\\u00a0\\u00b5\\u037e\\u0eb3\\u2000-\\u200a\\u202f\\u2126\\ufb00-\\ufb04\\ufb06\\ufb20-\\ufb36\\ufb38-\\ufb3c\\ufb3e\\ufb40-\\ufb41\\ufb43-\\ufb44\\ufb46-\\ufba1\\ufba4-\\ufba9\\ufbae-\\ufbb1\\ufbd3-\\ufbdc\\ufbde-\\ufbe7\\ufbea-\\ufbf8\\ufbfc-\\ufbfd\\ufc00-\\ufc5d\\ufc64-\\ufcf1\\ufcf5-\\ufd3d\\ufd88\\ufdf4\\ufdfa-\\ufdfb\\ufe71\\ufe77\\ufe79\\ufe7b\\ufe7d]+)|(\\ufb05+)/gu;\n NormalizationMap = new Map([[\"ſt\", \"ſt\"]]);\n }\n return str.replaceAll(NormalizeRegex, (_, p1, p2) => {\n return p1 ? p1.normalize(\"NFKC\") : NormalizationMap.get(p2);\n });\n}\n\nfunction getUuid() {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n (typeof crypto !== \"undefined\" && typeof crypto?.randomUUID === \"function\")\n ) {\n return crypto.randomUUID();\n }\n const buf = new Uint8Array(32);\n if (\n typeof crypto !== \"undefined\" &&\n typeof crypto?.getRandomValues === \"function\"\n ) {\n crypto.getRandomValues(buf);\n } else {\n for (let i = 0; i < 32; i++) {\n buf[i] = Math.floor(Math.random() * 255);\n }\n }\n return bytesToString(buf);\n}\n\nconst AnnotationPrefix = \"pdfjs_internal_id_\";\n\nexport {\n AbortException,\n AnnotationActionEventType,\n AnnotationBorderStyleType,\n AnnotationEditorParamsType,\n AnnotationEditorPrefix,\n AnnotationEditorType,\n AnnotationFieldFlag,\n AnnotationFlag,\n AnnotationMode,\n AnnotationPrefix,\n AnnotationReplyType,\n AnnotationType,\n assert,\n BaseException,\n BASELINE_FACTOR,\n bytesToString,\n CMapCompressionType,\n createValidAbsoluteUrl,\n DocumentActionEventType,\n FeatureTest,\n FONT_IDENTITY_MATRIX,\n FormatError,\n getModificationDate,\n getUuid,\n getVerbosityLevel,\n IDENTITY_MATRIX,\n ImageKind,\n info,\n InvalidPDFException,\n isArrayBuffer,\n isArrayEqual,\n isNodeJS,\n LINE_DESCENT_FACTOR,\n LINE_FACTOR,\n MAX_IMAGE_SIZE_TO_CACHE,\n MissingPDFException,\n normalizeUnicode,\n objectFromMap,\n objectSize,\n OPS,\n PageActionEventType,\n PasswordException,\n PasswordResponses,\n PermissionFlag,\n PromiseCapability,\n RenderingIntentFlag,\n setVerbosityLevel,\n shadow,\n string32,\n stringToBytes,\n stringToPDFString,\n stringToUTF8String,\n TextRenderingMode,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n utf8StringToString,\n Util,\n VerbosityLevel,\n warn,\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @module pdfjsLib\n */\n\nimport {\n AbortException,\n AnnotationMode,\n assert,\n getVerbosityLevel,\n info,\n InvalidPDFException,\n isArrayBuffer,\n isNodeJS,\n MAX_IMAGE_SIZE_TO_CACHE,\n MissingPDFException,\n PasswordException,\n PromiseCapability,\n RenderingIntentFlag,\n setVerbosityLevel,\n shadow,\n stringToBytes,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n warn,\n} from \"../shared/util.js\";\nimport {\n AnnotationStorage,\n PrintAnnotationStorage,\n SerializableEmpty,\n} from \"./annotation_storage.js\";\nimport {\n deprecated,\n DOMCanvasFactory,\n DOMCMapReaderFactory,\n DOMFilterFactory,\n DOMStandardFontDataFactory,\n isDataScheme,\n isValidFetchUrl,\n loadScript,\n PageViewport,\n RenderingCancelledException,\n StatTimer,\n} from \"./display_utils.js\";\nimport { FontFaceObject, FontLoader } from \"./font_loader.js\";\nimport {\n NodeCanvasFactory,\n NodeCMapReaderFactory,\n NodeFilterFactory,\n NodeStandardFontDataFactory,\n} from \"display-node_utils\";\nimport { CanvasGraphics } from \"./canvas.js\";\nimport { GlobalWorkerOptions } from \"./worker_options.js\";\nimport { MessageHandler } from \"../shared/message_handler.js\";\nimport { Metadata } from \"./metadata.js\";\nimport { OptionalContentConfig } from \"./optional_content_config.js\";\nimport { PDFDataTransportStream } from \"./transport_stream.js\";\nimport { PDFFetchStream } from \"display-fetch_stream\";\nimport { PDFNetworkStream } from \"display-network\";\nimport { PDFNodeStream } from \"display-node_stream\";\nimport { SVGGraphics } from \"display-svg\";\nimport { XfaText } from \"./xfa_text.js\";\n\nconst DEFAULT_RANGE_CHUNK_SIZE = 65536; // 2^16 = 65536\nconst RENDERING_CANCELLED_TIMEOUT = 100; // ms\nconst DELAYED_CLEANUP_TIMEOUT = 5000; // ms\n\nconst DefaultCanvasFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeCanvasFactory\n : DOMCanvasFactory;\nconst DefaultCMapReaderFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeCMapReaderFactory\n : DOMCMapReaderFactory;\nconst DefaultFilterFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeFilterFactory\n : DOMFilterFactory;\nconst DefaultStandardFontDataFactory =\n typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC\") && isNodeJS\n ? NodeStandardFontDataFactory\n : DOMStandardFontDataFactory;\n\n/**\n * @typedef { Int8Array | Uint8Array | Uint8ClampedArray |\n * Int16Array | Uint16Array |\n * Int32Array | Uint32Array | Float32Array |\n * Float64Array\n * } TypedArray\n */\n\n/**\n * @typedef { TypedArray | ArrayBuffer | Array<number> | string } BinaryData\n */\n\n/**\n * @typedef {Object} RefProxy\n * @property {number} num\n * @property {number} gen\n */\n\n/**\n * Document initialization / loading parameters object.\n *\n * @typedef {Object} DocumentInitParameters\n * @property {string | URL} [url] - The URL of the PDF.\n * @property {BinaryData} [data] - Binary PDF data.\n * Use TypedArrays (Uint8Array) to improve the memory usage. If PDF data is\n * BASE64-encoded, use `atob()` to convert it to a binary string first.\n *\n * NOTE: If TypedArrays are used they will generally be transferred to the\n * worker-thread. This will help reduce main-thread memory usage, however\n * it will take ownership of the TypedArrays.\n * @property {Object} [httpHeaders] - Basic authentication headers.\n * @property {boolean} [withCredentials] - Indicates whether or not\n * cross-site Access-Control requests should be made using credentials such\n * as cookies or authorization headers. The default is `false`.\n * @property {string} [password] - For decrypting password-protected PDFs.\n * @property {number} [length] - The PDF file length. It's used for progress\n * reports and range requests operations.\n * @property {PDFDataRangeTransport} [range] - Allows for using a custom range\n * transport implementation.\n * @property {number} [rangeChunkSize] - Specify maximum number of bytes fetched\n * per range request. The default value is {@link DEFAULT_RANGE_CHUNK_SIZE}.\n * @property {PDFWorker} [worker] - The worker that will be used for loading and\n * parsing the PDF data.\n * @property {number} [verbosity] - Controls the logging level; the constants\n * from {@link VerbosityLevel} should be used.\n * @property {string} [docBaseUrl] - The base URL of the document, used when\n * attempting to recover valid absolute URLs for annotations, and outline\n * items, that (incorrectly) only specify relative URLs.\n * @property {string} [cMapUrl] - The URL where the predefined Adobe CMaps are\n * located. Include the trailing slash.\n * @property {boolean} [cMapPacked] - Specifies if the Adobe CMaps are binary\n * packed or not. The default value is `true`.\n * @property {Object} [CMapReaderFactory] - The factory that will be used when\n * reading built-in CMap files. Providing a custom factory is useful for\n * environments without Fetch API or `XMLHttpRequest` support, such as\n * Node.js. The default value is {DOMCMapReaderFactory}.\n * @property {boolean} [useSystemFonts] - When `true`, fonts that aren't\n * embedded in the PDF document will fallback to a system font.\n * The default value is `true` in web environments and `false` in Node.js;\n * unless `disableFontFace === true` in which case this defaults to `false`\n * regardless of the environment (to prevent completely broken fonts).\n * @property {string} [standardFontDataUrl] - The URL where the standard font\n * files are located. Include the trailing slash.\n * @property {Object} [StandardFontDataFactory] - The factory that will be used\n * when reading the standard font files. Providing a custom factory is useful\n * for environments without Fetch API or `XMLHttpRequest` support, such as\n * Node.js. The default value is {DOMStandardFontDataFactory}.\n * @property {boolean} [useWorkerFetch] - Enable using the Fetch API in the\n * worker-thread when reading CMap and standard font files. When `true`,\n * the `CMapReaderFactory` and `StandardFontDataFactory` options are ignored.\n * The default value is `true` in web environments and `false` in Node.js.\n * @property {boolean} [stopAtErrors] - Reject certain promises, e.g.\n * `getOperatorList`, `getTextContent`, and `RenderTask`, when the associated\n * PDF data cannot be successfully parsed, instead of attempting to recover\n * whatever possible of the data. The default value is `false`.\n * @property {number} [maxImageSize] - The maximum allowed image size in total\n * pixels, i.e. width * height. Images above this value will not be rendered.\n * Use -1 for no limit, which is also the default value.\n * @property {boolean} [isEvalSupported] - Determines if we can evaluate strings\n * as JavaScript. Primarily used to improve performance of font rendering, and\n * when parsing PDF functions. The default value is `true`.\n * @property {boolean} [isOffscreenCanvasSupported] - Determines if we can use\n * `OffscreenCanvas` in the worker. Primarily used to improve performance of\n * image conversion/rendering.\n * The default value is `true` in web environments and `false` in Node.js.\n * @property {number} [canvasMaxAreaInBytes] - The integer value is used to\n * know when an image must be resized (uses `OffscreenCanvas` in the worker).\n * If it's -1 then a possibly slow algorithm is used to guess the max value.\n * @property {boolean} [disableFontFace] - By default fonts are converted to\n * OpenType fonts and loaded via the Font Loading API or `@font-face` rules.\n * If disabled, fonts will be rendered using a built-in font renderer that\n * constructs the glyphs with primitive path commands.\n * The default value is `false` in web environments and `true` in Node.js.\n * @property {boolean} [fontExtraProperties] - Include additional properties,\n * which are unused during rendering of PDF documents, when exporting the\n * parsed font data from the worker-thread. This may be useful for debugging\n * purposes (and backwards compatibility), but note that it will lead to\n * increased memory usage. The default value is `false`.\n * @property {boolean} [enableXfa] - Render Xfa forms if any.\n * The default value is `false`.\n * @property {HTMLDocument} [ownerDocument] - Specify an explicit document\n * context to create elements with and to load resources, such as fonts,\n * into. Defaults to the current document.\n * @property {boolean} [disableRange] - Disable range request loading of PDF\n * files. When enabled, and if the server supports partial content requests,\n * then the PDF will be fetched in chunks. The default value is `false`.\n * @property {boolean} [disableStream] - Disable streaming of PDF file data.\n * By default PDF.js attempts to load PDF files in chunks. The default value\n * is `false`.\n * @property {boolean} [disableAutoFetch] - Disable pre-fetching of PDF file\n * data. When range requests are enabled PDF.js will automatically keep\n * fetching more data even if it isn't needed to display the current page.\n * The default value is `false`.\n *\n * NOTE: It is also necessary to disable streaming, see above, in order for\n * disabling of pre-fetching to work correctly.\n * @property {boolean} [pdfBug] - Enables special hooks for debugging PDF.js\n * (see `web/debugger.js`). The default value is `false`.\n * @property {Object} [canvasFactory] - The factory instance that will be used\n * when creating canvases. The default value is {new DOMCanvasFactory()}.\n * @property {Object} [filterFactory] - A factory instance that will be used\n * to create SVG filters when rendering some images on the main canvas.\n */\n\n/**\n * This is the main entry point for loading a PDF and interacting with it.\n *\n * NOTE: If a URL is used to fetch the PDF data a standard Fetch API call (or\n * XHR as fallback) is used, which means it must follow same origin rules,\n * e.g. no cross-domain requests without CORS.\n *\n * @param {string | URL | TypedArray | ArrayBuffer | DocumentInitParameters}\n * src - Can be a URL where a PDF file is located, a typed array (Uint8Array)\n * already populated with data, or a parameter object.\n * @returns {PDFDocumentLoadingTask}\n */\nfunction getDocument(src) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n if (typeof src === \"string\" || src instanceof URL) {\n src = { url: src };\n } else if (isArrayBuffer(src)) {\n src = { data: src };\n }\n }\n if (typeof src !== \"object\") {\n throw new Error(\"Invalid parameter in getDocument, need parameter object.\");\n }\n if (!src.url && !src.data && !src.range) {\n throw new Error(\n \"Invalid parameter object: need either .data, .range or .url\"\n );\n }\n const task = new PDFDocumentLoadingTask();\n const { docId } = task;\n\n const url = src.url ? getUrlProp(src.url) : null;\n const data = src.data ? getDataProp(src.data) : null;\n const httpHeaders = src.httpHeaders || null;\n const withCredentials = src.withCredentials === true;\n const password = src.password ?? null;\n const rangeTransport =\n src.range instanceof PDFDataRangeTransport ? src.range : null;\n const rangeChunkSize =\n Number.isInteger(src.rangeChunkSize) && src.rangeChunkSize > 0\n ? src.rangeChunkSize\n : DEFAULT_RANGE_CHUNK_SIZE;\n let worker = src.worker instanceof PDFWorker ? src.worker : null;\n const verbosity = src.verbosity;\n // Ignore \"data:\"-URLs, since they can't be used to recover valid absolute\n // URLs anyway. We want to avoid sending them to the worker-thread, since\n // they contain the *entire* PDF document and can thus be arbitrarily long.\n const docBaseUrl =\n typeof src.docBaseUrl === \"string\" && !isDataScheme(src.docBaseUrl)\n ? src.docBaseUrl\n : null;\n const cMapUrl = typeof src.cMapUrl === \"string\" ? src.cMapUrl : null;\n const cMapPacked = src.cMapPacked !== false;\n const CMapReaderFactory = src.CMapReaderFactory || DefaultCMapReaderFactory;\n const standardFontDataUrl =\n typeof src.standardFontDataUrl === \"string\"\n ? src.standardFontDataUrl\n : null;\n const StandardFontDataFactory =\n src.StandardFontDataFactory || DefaultStandardFontDataFactory;\n const ignoreErrors = src.stopAtErrors !== true;\n const maxImageSize =\n Number.isInteger(src.maxImageSize) && src.maxImageSize > -1\n ? src.maxImageSize\n : -1;\n const isEvalSupported = src.isEvalSupported !== false;\n const isOffscreenCanvasSupported =\n typeof src.isOffscreenCanvasSupported === \"boolean\"\n ? src.isOffscreenCanvasSupported\n : !isNodeJS;\n const canvasMaxAreaInBytes = Number.isInteger(src.canvasMaxAreaInBytes)\n ? src.canvasMaxAreaInBytes\n : -1;\n const disableFontFace =\n typeof src.disableFontFace === \"boolean\" ? src.disableFontFace : isNodeJS;\n const fontExtraProperties = src.fontExtraProperties === true;\n const enableXfa = src.enableXfa === true;\n const ownerDocument = src.ownerDocument || globalThis.document;\n const disableRange = src.disableRange === true;\n const disableStream = src.disableStream === true;\n const disableAutoFetch = src.disableAutoFetch === true;\n const pdfBug = src.pdfBug === true;\n\n // Parameters whose default values depend on other parameters.\n const length = rangeTransport ? rangeTransport.length : src.length ?? NaN;\n const useSystemFonts =\n typeof src.useSystemFonts === \"boolean\"\n ? src.useSystemFonts\n : !isNodeJS && !disableFontFace;\n const useWorkerFetch =\n typeof src.useWorkerFetch === \"boolean\"\n ? src.useWorkerFetch\n : (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n (CMapReaderFactory === DOMCMapReaderFactory &&\n StandardFontDataFactory === DOMStandardFontDataFactory &&\n cMapUrl &&\n standardFontDataUrl &&\n isValidFetchUrl(cMapUrl, document.baseURI) &&\n isValidFetchUrl(standardFontDataUrl, document.baseURI));\n const canvasFactory =\n src.canvasFactory || new DefaultCanvasFactory({ ownerDocument });\n const filterFactory =\n src.filterFactory || new DefaultFilterFactory({ docId, ownerDocument });\n\n // Parameters only intended for development/testing purposes.\n const styleElement =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")\n ? src.styleElement\n : null;\n\n // Set the main-thread verbosity level.\n setVerbosityLevel(verbosity);\n\n // Ensure that the various factories can be initialized, when necessary,\n // since the user may provide *custom* ones.\n const transportFactory = {\n canvasFactory,\n filterFactory,\n };\n if (!useWorkerFetch) {\n transportFactory.cMapReaderFactory = new CMapReaderFactory({\n baseUrl: cMapUrl,\n isCompressed: cMapPacked,\n });\n transportFactory.standardFontDataFactory = new StandardFontDataFactory({\n baseUrl: standardFontDataUrl,\n });\n }\n\n if (!worker) {\n const workerParams = {\n verbosity,\n port: GlobalWorkerOptions.workerPort,\n };\n // Worker was not provided -- creating and owning our own. If message port\n // is specified in global worker options, using it.\n worker = workerParams.port\n ? PDFWorker.fromPort(workerParams)\n : new PDFWorker(workerParams);\n task._worker = worker;\n }\n\n const fetchDocParams = {\n docId,\n apiVersion:\n typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"TESTING\")\n ? PDFJSDev.eval(\"BUNDLE_VERSION\")\n : null,\n data,\n password,\n disableAutoFetch,\n rangeChunkSize,\n length,\n docBaseUrl,\n enableXfa,\n evaluatorOptions: {\n maxImageSize,\n disableFontFace,\n ignoreErrors,\n isEvalSupported,\n isOffscreenCanvasSupported,\n canvasMaxAreaInBytes,\n fontExtraProperties,\n useSystemFonts,\n cMapUrl: useWorkerFetch ? cMapUrl : null,\n standardFontDataUrl: useWorkerFetch ? standardFontDataUrl : null,\n },\n };\n const transportParams = {\n ignoreErrors,\n isEvalSupported,\n disableFontFace,\n fontExtraProperties,\n enableXfa,\n ownerDocument,\n disableAutoFetch,\n pdfBug,\n styleElement,\n };\n\n worker.promise\n .then(function () {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n\n const workerIdPromise = _fetchDocument(worker, fetchDocParams);\n const networkStreamPromise = new Promise(function (resolve) {\n let networkStream;\n if (rangeTransport) {\n networkStream = new PDFDataTransportStream(\n {\n length,\n initialData: rangeTransport.initialData,\n progressiveDone: rangeTransport.progressiveDone,\n contentDispositionFilename:\n rangeTransport.contentDispositionFilename,\n disableRange,\n disableStream,\n },\n rangeTransport\n );\n } else if (!data) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: createPDFNetworkStream\");\n }\n const createPDFNetworkStream = params => {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS\n ) {\n return new PDFNodeStream(params);\n }\n return isValidFetchUrl(params.url)\n ? new PDFFetchStream(params)\n : new PDFNetworkStream(params);\n };\n\n networkStream = createPDFNetworkStream({\n url,\n length,\n httpHeaders,\n withCredentials,\n rangeChunkSize,\n disableRange,\n disableStream,\n });\n }\n resolve(networkStream);\n });\n\n return Promise.all([workerIdPromise, networkStreamPromise]).then(\n function ([workerId, networkStream]) {\n if (task.destroyed) {\n throw new Error(\"Loading aborted\");\n }\n\n const messageHandler = new MessageHandler(\n docId,\n workerId,\n worker.port\n );\n const transport = new WorkerTransport(\n messageHandler,\n task,\n networkStream,\n transportParams,\n transportFactory\n );\n task._transport = transport;\n messageHandler.send(\"Ready\", null);\n }\n );\n })\n .catch(task._capability.reject);\n\n return task;\n}\n\n/**\n * Starts fetching of specified PDF document/data.\n *\n * @param {PDFWorker} worker\n * @param {Object} source\n * @returns {Promise<string>} A promise that is resolved when the worker ID of\n * the `MessageHandler` is known.\n * @private\n */\nasync function _fetchDocument(worker, source) {\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n const workerId = await worker.messageHandler.sendWithPromise(\n \"GetDocRequest\",\n source,\n source.data ? [source.data.buffer] : null\n );\n\n if (worker.destroyed) {\n throw new Error(\"Worker was destroyed\");\n }\n return workerId;\n}\n\nfunction getUrlProp(val) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return null; // The 'url' is unused with `PDFDataRangeTransport`.\n }\n if (val instanceof URL) {\n return val.href;\n }\n try {\n // The full path is required in the 'url' field.\n return new URL(val, window.location).href;\n } catch {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS &&\n typeof val === \"string\"\n ) {\n return val; // Use the url as-is in Node.js environments.\n }\n }\n throw new Error(\n \"Invalid PDF url data: \" +\n \"either string or URL-object is expected in the url property.\"\n );\n}\n\nfunction getDataProp(val) {\n // Converting string or array-like data to Uint8Array.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS &&\n typeof Buffer !== \"undefined\" && // eslint-disable-line no-undef\n val instanceof Buffer // eslint-disable-line no-undef\n ) {\n throw new Error(\n \"Please provide binary data as `Uint8Array`, rather than `Buffer`.\"\n );\n }\n if (val instanceof Uint8Array && val.byteLength === val.buffer.byteLength) {\n // Use the data as-is when it's already a Uint8Array that completely\n // \"utilizes\" its underlying ArrayBuffer, to prevent any possible\n // issues when transferring it to the worker-thread.\n return val;\n }\n if (typeof val === \"string\") {\n return stringToBytes(val);\n }\n if ((typeof val === \"object\" && !isNaN(val?.length)) || isArrayBuffer(val)) {\n return new Uint8Array(val);\n }\n throw new Error(\n \"Invalid PDF binary data: either TypedArray, \" +\n \"string, or array-like object is expected in the data property.\"\n );\n}\n\n/**\n * @typedef {Object} OnProgressParameters\n * @property {number} loaded - Currently loaded number of bytes.\n * @property {number} total - Total number of bytes in the PDF file.\n */\n\n/**\n * The loading task controls the operations required to load a PDF document\n * (such as network requests) and provides a way to listen for completion,\n * after which individual pages can be rendered.\n */\nclass PDFDocumentLoadingTask {\n static #docId = 0;\n\n constructor() {\n this._capability = new PromiseCapability();\n this._transport = null;\n this._worker = null;\n\n /**\n * Unique identifier for the document loading task.\n * @type {string}\n */\n this.docId = `d${PDFDocumentLoadingTask.#docId++}`;\n\n /**\n * Whether the loading task is destroyed or not.\n * @type {boolean}\n */\n this.destroyed = false;\n\n /**\n * Callback to request a password if a wrong or no password was provided.\n * The callback receives two parameters: a function that should be called\n * with the new password, and a reason (see {@link PasswordResponses}).\n * @type {function}\n */\n this.onPassword = null;\n\n /**\n * Callback to be able to monitor the loading progress of the PDF file\n * (necessary to implement e.g. a loading bar).\n * The callback receives an {@link OnProgressParameters} argument.\n * @type {function}\n */\n this.onProgress = null;\n }\n\n /**\n * Promise for document loading task completion.\n * @type {Promise<PDFDocumentProxy>}\n */\n get promise() {\n return this._capability.promise;\n }\n\n /**\n * Abort all network requests and destroy the worker.\n * @returns {Promise<void>} A promise that is resolved when destruction is\n * completed.\n */\n async destroy() {\n this.destroyed = true;\n try {\n if (this._worker?.port) {\n this._worker._pendingDestroy = true;\n }\n await this._transport?.destroy();\n } catch (ex) {\n if (this._worker?.port) {\n delete this._worker._pendingDestroy;\n }\n throw ex;\n }\n\n this._transport = null;\n if (this._worker) {\n this._worker.destroy();\n this._worker = null;\n }\n }\n}\n\n/**\n * Abstract class to support range requests file loading.\n *\n * NOTE: The TypedArrays passed to the constructor and relevant methods below\n * will generally be transferred to the worker-thread. This will help reduce\n * main-thread memory usage, however it will take ownership of the TypedArrays.\n */\nclass PDFDataRangeTransport {\n /**\n * @param {number} length\n * @param {Uint8Array|null} initialData\n * @param {boolean} [progressiveDone]\n * @param {string} [contentDispositionFilename]\n */\n constructor(\n length,\n initialData,\n progressiveDone = false,\n contentDispositionFilename = null\n ) {\n this.length = length;\n this.initialData = initialData;\n this.progressiveDone = progressiveDone;\n this.contentDispositionFilename = contentDispositionFilename;\n\n this._rangeListeners = [];\n this._progressListeners = [];\n this._progressiveReadListeners = [];\n this._progressiveDoneListeners = [];\n this._readyCapability = new PromiseCapability();\n }\n\n /**\n * @param {function} listener\n */\n addRangeListener(listener) {\n this._rangeListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressListener(listener) {\n this._progressListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressiveReadListener(listener) {\n this._progressiveReadListeners.push(listener);\n }\n\n /**\n * @param {function} listener\n */\n addProgressiveDoneListener(listener) {\n this._progressiveDoneListeners.push(listener);\n }\n\n /**\n * @param {number} begin\n * @param {Uint8Array|null} chunk\n */\n onDataRange(begin, chunk) {\n for (const listener of this._rangeListeners) {\n listener(begin, chunk);\n }\n }\n\n /**\n * @param {number} loaded\n * @param {number|undefined} total\n */\n onDataProgress(loaded, total) {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressListeners) {\n listener(loaded, total);\n }\n });\n }\n\n /**\n * @param {Uint8Array|null} chunk\n */\n onDataProgressiveRead(chunk) {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressiveReadListeners) {\n listener(chunk);\n }\n });\n }\n\n onDataProgressiveDone() {\n this._readyCapability.promise.then(() => {\n for (const listener of this._progressiveDoneListeners) {\n listener();\n }\n });\n }\n\n transportReady() {\n this._readyCapability.resolve();\n }\n\n /**\n * @param {number} begin\n * @param {number} end\n */\n requestDataRange(begin, end) {\n unreachable(\"Abstract method PDFDataRangeTransport.requestDataRange\");\n }\n\n abort() {}\n}\n\n/**\n * Proxy to a `PDFDocument` in the worker thread.\n */\nclass PDFDocumentProxy {\n constructor(pdfInfo, transport) {\n this._pdfInfo = pdfInfo;\n this._transport = transport;\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n Object.defineProperty(this, \"getJavaScript\", {\n value: () => {\n deprecated(\n \"`PDFDocumentProxy.getJavaScript`, \" +\n \"please use `PDFDocumentProxy.getJSActions` instead.\"\n );\n return this.getJSActions().then(js => {\n if (!js) {\n return js;\n }\n const jsArr = [];\n for (const name in js) {\n jsArr.push(...js[name]);\n }\n return jsArr;\n });\n },\n });\n }\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"getXFADatasets\", {\n value: () => {\n return this._transport.getXFADatasets();\n },\n });\n Object.defineProperty(this, \"getXRefPrevValue\", {\n value: () => {\n return this._transport.getXRefPrevValue();\n },\n });\n Object.defineProperty(this, \"getAnnotArray\", {\n value: pageIndex => {\n return this._transport.getAnnotArray(pageIndex);\n },\n });\n }\n }\n\n /**\n * @type {AnnotationStorage} Storage for annotation data in forms.\n */\n get annotationStorage() {\n return this._transport.annotationStorage;\n }\n\n /**\n * @type {Object} The filter factory instance.\n */\n get filterFactory() {\n return this._transport.filterFactory;\n }\n\n /**\n * @type {number} Total number of pages in the PDF file.\n */\n get numPages() {\n return this._pdfInfo.numPages;\n }\n\n /**\n * @type {Array<string, string|null>} A (not guaranteed to be) unique ID to\n * identify the PDF document.\n * NOTE: The first element will always be defined for all PDF documents,\n * whereas the second element is only defined for *modified* PDF documents.\n */\n get fingerprints() {\n return this._pdfInfo.fingerprints;\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n }\n\n /**\n * NOTE: This is (mostly) intended to support printing of XFA forms.\n *\n * @type {Object | null} An object representing a HTML tree structure\n * to render the XFA, or `null` when no XFA form exists.\n */\n get allXfaHtml() {\n return this._transport._htmlForXfa;\n }\n\n /**\n * @param {number} pageNumber - The page number to get. The first page is 1.\n * @returns {Promise<PDFPageProxy>} A promise that is resolved with\n * a {@link PDFPageProxy} object.\n */\n getPage(pageNumber) {\n return this._transport.getPage(pageNumber);\n }\n\n /**\n * @param {RefProxy} ref - The page reference.\n * @returns {Promise<number>} A promise that is resolved with the page index,\n * starting from zero, that is associated with the reference.\n */\n getPageIndex(ref) {\n return this._transport.getPageIndex(ref);\n }\n\n /**\n * @returns {Promise<Object<string, Array<any>>>} A promise that is resolved\n * with a mapping from named destinations to references.\n *\n * This can be slow for large documents. Use `getDestination` instead.\n */\n getDestinations() {\n return this._transport.getDestinations();\n }\n\n /**\n * @param {string} id - The named destination to get.\n * @returns {Promise<Array<any> | null>} A promise that is resolved with all\n * information of the given named destination, or `null` when the named\n * destination is not present in the PDF file.\n */\n getDestination(id) {\n return this._transport.getDestination(id);\n }\n\n /**\n * @returns {Promise<Array<string> | null>} A promise that is resolved with\n * an {Array} containing the page labels that correspond to the page\n * indexes, or `null` when no page labels are present in the PDF file.\n */\n getPageLabels() {\n return this._transport.getPageLabels();\n }\n\n /**\n * @returns {Promise<string>} A promise that is resolved with a {string}\n * containing the page layout name.\n */\n getPageLayout() {\n return this._transport.getPageLayout();\n }\n\n /**\n * @returns {Promise<string>} A promise that is resolved with a {string}\n * containing the page mode name.\n */\n getPageMode() {\n return this._transport.getPageMode();\n }\n\n /**\n * @returns {Promise<Object | null>} A promise that is resolved with an\n * {Object} containing the viewer preferences, or `null` when no viewer\n * preferences are present in the PDF file.\n */\n getViewerPreferences() {\n return this._transport.getViewerPreferences();\n }\n\n /**\n * @returns {Promise<any | null>} A promise that is resolved with an {Array}\n * containing the destination, or `null` when no open action is present\n * in the PDF.\n */\n getOpenAction() {\n return this._transport.getOpenAction();\n }\n\n /**\n * @returns {Promise<any>} A promise that is resolved with a lookup table\n * for mapping named attachments to their content.\n */\n getAttachments() {\n return this._transport.getAttachments();\n }\n\n /**\n * @returns {Promise<Object | null>} A promise that is resolved with\n * an {Object} with the JavaScript actions:\n * - from the name tree.\n * - from A or AA entries in the catalog dictionary.\n * , or `null` if no JavaScript exists.\n */\n getJSActions() {\n return this._transport.getDocJSActions();\n }\n\n /**\n * @typedef {Object} OutlineNode\n * @property {string} title\n * @property {boolean} bold\n * @property {boolean} italic\n * @property {Uint8ClampedArray} color - The color in RGB format to use for\n * display purposes.\n * @property {string | Array<any> | null} dest\n * @property {string | null} url\n * @property {string | undefined} unsafeUrl\n * @property {boolean | undefined} newWindow\n * @property {number | undefined} count\n * @property {Array<OutlineNode>} items\n */\n\n /**\n * @returns {Promise<Array<OutlineNode>>} A promise that is resolved with an\n * {Array} that is a tree outline (if it has one) of the PDF file.\n */\n getOutline() {\n return this._transport.getOutline();\n }\n\n /**\n * @returns {Promise<OptionalContentConfig>} A promise that is resolved with\n * an {@link OptionalContentConfig} that contains all the optional content\n * groups (assuming that the document has any).\n */\n getOptionalContentConfig() {\n return this._transport.getOptionalContentConfig();\n }\n\n /**\n * @returns {Promise<Array<number> | null>} A promise that is resolved with\n * an {Array} that contains the permission flags for the PDF document, or\n * `null` when no permissions are present in the PDF file.\n */\n getPermissions() {\n return this._transport.getPermissions();\n }\n\n /**\n * @returns {Promise<{ info: Object, metadata: Metadata }>} A promise that is\n * resolved with an {Object} that has `info` and `metadata` properties.\n * `info` is an {Object} filled with anything available in the information\n * dictionary and similarly `metadata` is a {Metadata} object with\n * information from the metadata section of the PDF.\n */\n getMetadata() {\n return this._transport.getMetadata();\n }\n\n /**\n * @typedef {Object} MarkInfo\n * Properties correspond to Table 321 of the PDF 32000-1:2008 spec.\n * @property {boolean} Marked\n * @property {boolean} UserProperties\n * @property {boolean} Suspects\n */\n\n /**\n * @returns {Promise<MarkInfo | null>} A promise that is resolved with\n * a {MarkInfo} object that contains the MarkInfo flags for the PDF\n * document, or `null` when no MarkInfo values are present in the PDF file.\n */\n getMarkInfo() {\n return this._transport.getMarkInfo();\n }\n\n /**\n * @returns {Promise<Uint8Array>} A promise that is resolved with a\n * {Uint8Array} containing the raw data of the PDF document.\n */\n getData() {\n return this._transport.getData();\n }\n\n /**\n * @returns {Promise<Uint8Array>} A promise that is resolved with a\n * {Uint8Array} containing the full data of the saved document.\n */\n saveDocument() {\n return this._transport.saveDocument();\n }\n\n /**\n * @returns {Promise<{ length: number }>} A promise that is resolved when the\n * document's data is loaded. It is resolved with an {Object} that contains\n * the `length` property that indicates size of the PDF data in bytes.\n */\n getDownloadInfo() {\n return this._transport.downloadInfoCapability.promise;\n }\n\n /**\n * Cleans up resources allocated by the document on both the main and worker\n * threads.\n *\n * NOTE: Do not, under any circumstances, call this method when rendering is\n * currently ongoing since that may lead to rendering errors.\n *\n * @param {boolean} [keepLoadedFonts] - Let fonts remain attached to the DOM.\n * NOTE: This will increase persistent memory usage, hence don't use this\n * option unless absolutely necessary. The default value is `false`.\n * @returns {Promise} A promise that is resolved when clean-up has finished.\n */\n cleanup(keepLoadedFonts = false) {\n return this._transport.startCleanup(keepLoadedFonts || this.isPureXfa);\n }\n\n /**\n * Destroys the current document instance and terminates the worker.\n */\n destroy() {\n return this.loadingTask.destroy();\n }\n\n /**\n * @type {DocumentInitParameters} A subset of the current\n * {DocumentInitParameters}, which are needed in the viewer.\n */\n get loadingParams() {\n return this._transport.loadingParams;\n }\n\n /**\n * @type {PDFDocumentLoadingTask} The loadingTask for the current document.\n */\n get loadingTask() {\n return this._transport.loadingTask;\n }\n\n /**\n * @returns {Promise<Object<string, Array<Object>> | null>} A promise that is\n * resolved with an {Object} containing /AcroForm field data for the JS\n * sandbox, or `null` when no field data is present in the PDF file.\n */\n getFieldObjects() {\n return this._transport.getFieldObjects();\n }\n\n /**\n * @returns {Promise<boolean>} A promise that is resolved with `true`\n * if some /AcroForm fields have JavaScript actions.\n */\n hasJSActions() {\n return this._transport.hasJSActions();\n }\n\n /**\n * @returns {Promise<Array<string> | null>} A promise that is resolved with an\n * {Array<string>} containing IDs of annotations that have a calculation\n * action, or `null` when no such annotations are present in the PDF file.\n */\n getCalculationOrderIds() {\n return this._transport.getCalculationOrderIds();\n }\n}\n\n/**\n * Page getViewport parameters.\n *\n * @typedef {Object} GetViewportParameters\n * @property {number} scale - The desired scale of the viewport.\n * @property {number} [rotation] - The desired rotation, in degrees, of\n * the viewport. If omitted it defaults to the page rotation.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.\n * The default value is `0`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.\n * The default value is `0`.\n * @property {boolean} [dontFlip] - If true, the y-axis will not be\n * flipped. The default value is `false`.\n */\n\n/**\n * Page getTextContent parameters.\n *\n * @typedef {Object} getTextContentParameters\n * @property {boolean} [includeMarkedContent] - When true include marked\n * content items in the items array of TextContent. The default is `false`.\n * @property {boolean} [disableNormalization] - When true the text is *not*\n * normalized in the worker-thread. The default is `false`.\n */\n\n/**\n * Page text content.\n *\n * @typedef {Object} TextContent\n * @property {Array<TextItem | TextMarkedContent>} items - Array of\n * {@link TextItem} and {@link TextMarkedContent} objects. TextMarkedContent\n * items are included when includeMarkedContent is true.\n * @property {Object<string, TextStyle>} styles - {@link TextStyle} objects,\n * indexed by font name.\n */\n\n/**\n * Page text content part.\n *\n * @typedef {Object} TextItem\n * @property {string} str - Text content.\n * @property {string} dir - Text direction: 'ttb', 'ltr' or 'rtl'.\n * @property {Array<any>} transform - Transformation matrix.\n * @property {number} width - Width in device space.\n * @property {number} height - Height in device space.\n * @property {string} fontName - Font name used by PDF.js for converted font.\n * @property {boolean} hasEOL - Indicating if the text content is followed by a\n * line-break.\n */\n\n/**\n * Page text marked content part.\n *\n * @typedef {Object} TextMarkedContent\n * @property {string} type - Either 'beginMarkedContent',\n * 'beginMarkedContentProps', or 'endMarkedContent'.\n * @property {string} id - The marked content identifier. Only used for type\n * 'beginMarkedContentProps'.\n */\n\n/**\n * Text style.\n *\n * @typedef {Object} TextStyle\n * @property {number} ascent - Font ascent.\n * @property {number} descent - Font descent.\n * @property {boolean} vertical - Whether or not the text is in vertical mode.\n * @property {string} fontFamily - The possible font family.\n */\n\n/**\n * Page annotation parameters.\n *\n * @typedef {Object} GetAnnotationsParameters\n * @property {string} [intent] - Determines the annotations that are fetched,\n * can be 'display' (viewable annotations), 'print' (printable annotations),\n * or 'any' (all annotations). The default value is 'display'.\n */\n\n/**\n * Page render parameters.\n *\n * @typedef {Object} RenderParameters\n * @property {CanvasRenderingContext2D} canvasContext - A 2D context of a DOM\n * Canvas object.\n * @property {PageViewport} viewport - Rendering viewport obtained by calling\n * the `PDFPageProxy.getViewport` method.\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n * or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are rendered\n * onto the canvas, for annotations with appearance-data; the values from\n * {@link AnnotationMode} should be used. The following values are supported:\n * - `AnnotationMode.DISABLE`, which disables all annotations.\n * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n * it also depends on the `intent`-option, see above).\n * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n * interactive form elements (those will be rendered in the display layer).\n * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n * (as above) but where interactive form elements are updated with data\n * from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n * The default value is `AnnotationMode.ENABLE`.\n * @property {Array<any>} [transform] - Additional transform, applied just\n * before viewport transform.\n * @property {CanvasGradient | CanvasPattern | string} [background] - Background\n * to use for the canvas.\n * Any valid `canvas.fillStyle` can be used: a `DOMString` parsed as CSS\n * <color> value, a `CanvasGradient` object (a linear or radial gradient) or\n * a `CanvasPattern` object (a repetitive image). The default value is\n * 'rgb(255,255,255)'.\n *\n * NOTE: This option may be partially, or completely, ignored when the\n * `pageColors`-option is used.\n * @property {Object} [pageColors] - Overwrites background and foreground colors\n * with user defined ones in order to improve readability in high contrast\n * mode.\n * @property {Promise<OptionalContentConfig>} [optionalContentConfigPromise] -\n * A promise that should resolve with an {@link OptionalContentConfig}\n * created from `PDFDocumentProxy.getOptionalContentConfig`. If `null`,\n * the configuration will be fetched automatically with the default visibility\n * states set.\n * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap] - Map some\n * annotation ids with canvases used to render them.\n * @property {PrintAnnotationStorage} [printAnnotationStorage]\n */\n\n/**\n * Page getOperatorList parameters.\n *\n * @typedef {Object} GetOperatorListParameters\n * @property {string} [intent] - Rendering intent, can be 'display', 'print',\n * or 'any'. The default value is 'display'.\n * @property {number} [annotationMode] Controls which annotations are included\n * in the operatorList, for annotations with appearance-data; the values from\n * {@link AnnotationMode} should be used. The following values are supported:\n * - `AnnotationMode.DISABLE`, which disables all annotations.\n * - `AnnotationMode.ENABLE`, which includes all possible annotations (thus\n * it also depends on the `intent`-option, see above).\n * - `AnnotationMode.ENABLE_FORMS`, which excludes annotations that contain\n * interactive form elements (those will be rendered in the display layer).\n * - `AnnotationMode.ENABLE_STORAGE`, which includes all possible annotations\n * (as above) but where interactive form elements are updated with data\n * from the {@link AnnotationStorage}-instance; useful e.g. for printing.\n * The default value is `AnnotationMode.ENABLE`.\n * @property {PrintAnnotationStorage} [printAnnotationStorage]\n */\n\n/**\n * Structure tree node. The root node will have a role \"Root\".\n *\n * @typedef {Object} StructTreeNode\n * @property {Array<StructTreeNode | StructTreeContent>} children - Array of\n * {@link StructTreeNode} and {@link StructTreeContent} objects.\n * @property {string} role - element's role, already mapped if a role map exists\n * in the PDF.\n */\n\n/**\n * Structure tree content.\n *\n * @typedef {Object} StructTreeContent\n * @property {string} type - either \"content\" for page and stream structure\n * elements or \"object\" for object references.\n * @property {string} id - unique id that will map to the text layer.\n */\n\n/**\n * PDF page operator list.\n *\n * @typedef {Object} PDFOperatorList\n * @property {Array<number>} fnArray - Array containing the operator functions.\n * @property {Array<any>} argsArray - Array containing the arguments of the\n * functions.\n */\n\n/**\n * Proxy to a `PDFPage` in the worker thread.\n */\nclass PDFPageProxy {\n #delayedCleanupTimeout = null;\n\n #pendingCleanup = false;\n\n constructor(pageIndex, pageInfo, transport, pdfBug = false) {\n this._pageIndex = pageIndex;\n this._pageInfo = pageInfo;\n this._transport = transport;\n this._stats = pdfBug ? new StatTimer() : null;\n this._pdfBug = pdfBug;\n /** @type {PDFObjects} */\n this.commonObjs = transport.commonObjs;\n this.objs = new PDFObjects();\n\n this._maybeCleanupAfterRender = false;\n this._intentStates = new Map();\n this.destroyed = false;\n }\n\n /**\n * @type {number} Page number of the page. First page is 1.\n */\n get pageNumber() {\n return this._pageIndex + 1;\n }\n\n /**\n * @type {number} The number of degrees the page is rotated clockwise.\n */\n get rotate() {\n return this._pageInfo.rotate;\n }\n\n /**\n * @type {RefProxy | null} The reference that points to this page.\n */\n get ref() {\n return this._pageInfo.ref;\n }\n\n /**\n * @type {number} The default size of units in 1/72nds of an inch.\n */\n get userUnit() {\n return this._pageInfo.userUnit;\n }\n\n /**\n * @type {Array<number>} An array of the visible portion of the PDF page in\n * user space units [x1, y1, x2, y2].\n */\n get view() {\n return this._pageInfo.view;\n }\n\n /**\n * @param {GetViewportParameters} params - Viewport parameters.\n * @returns {PageViewport} Contains 'width' and 'height' properties\n * along with transforms required for rendering.\n */\n getViewport({\n scale,\n rotation = this.rotate,\n offsetX = 0,\n offsetY = 0,\n dontFlip = false,\n } = {}) {\n return new PageViewport({\n viewBox: this.view,\n scale,\n rotation,\n offsetX,\n offsetY,\n dontFlip,\n });\n }\n\n /**\n * @param {GetAnnotationsParameters} params - Annotation parameters.\n * @returns {Promise<Array<any>>} A promise that is resolved with an\n * {Array} of the annotation objects.\n */\n getAnnotations({ intent = \"display\" } = {}) {\n const intentArgs = this._transport.getRenderingIntent(intent);\n\n return this._transport.getAnnotations(\n this._pageIndex,\n intentArgs.renderingIntent\n );\n }\n\n /**\n * @returns {Promise<Object>} A promise that is resolved with an\n * {Object} with JS actions.\n */\n getJSActions() {\n return this._transport.getPageJSActions(this._pageIndex);\n }\n\n /**\n * @type {Object} The filter factory instance.\n */\n get filterFactory() {\n return this._transport.filterFactory;\n }\n\n /**\n * @type {boolean} True if only XFA form.\n */\n get isPureXfa() {\n return shadow(this, \"isPureXfa\", !!this._transport._htmlForXfa);\n }\n\n /**\n * @returns {Promise<Object | null>} A promise that is resolved with\n * an {Object} with a fake DOM object (a tree structure where elements\n * are {Object} with a name, attributes (class, style, ...), value and\n * children, very similar to a HTML DOM tree), or `null` if no XFA exists.\n */\n async getXfa() {\n return this._transport._htmlForXfa?.children[this._pageIndex] || null;\n }\n\n /**\n * Begins the process of rendering a page to the desired context.\n *\n * @param {RenderParameters} params - Page render parameters.\n * @returns {RenderTask} An object that contains a promise that is\n * resolved when the page finishes rendering.\n */\n render({\n canvasContext,\n viewport,\n intent = \"display\",\n annotationMode = AnnotationMode.ENABLE,\n transform = null,\n background = null,\n optionalContentConfigPromise = null,\n annotationCanvasMap = null,\n pageColors = null,\n printAnnotationStorage = null,\n }) {\n this._stats?.time(\"Overall\");\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode,\n printAnnotationStorage\n );\n // If there was a pending destroy, cancel it so no cleanup happens during\n // this call to render...\n this.#pendingCleanup = false;\n // ... and ensure that a delayed cleanup is always aborted.\n this.#abortDelayedCleanup();\n\n if (!optionalContentConfigPromise) {\n optionalContentConfigPromise = this._transport.getOptionalContentConfig();\n }\n\n let intentState = this._intentStates.get(intentArgs.cacheKey);\n if (!intentState) {\n intentState = Object.create(null);\n this._intentStates.set(intentArgs.cacheKey, intentState);\n }\n\n // Ensure that a pending `streamReader` cancel timeout is always aborted.\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n const intentPrint = !!(\n intentArgs.renderingIntent & RenderingIntentFlag.PRINT\n );\n\n // If there's no displayReadyCapability yet, then the operatorList\n // was never requested before. Make the request and create the promise.\n if (!intentState.displayReadyCapability) {\n intentState.displayReadyCapability = new PromiseCapability();\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n separateAnnots: null,\n };\n\n this._stats?.time(\"Page Request\");\n this._pumpOperatorList(intentArgs);\n }\n\n const complete = error => {\n intentState.renderTasks.delete(internalRenderTask);\n\n // Attempt to reduce memory usage during *printing*, by always running\n // cleanup immediately once rendering has finished.\n if (this._maybeCleanupAfterRender || intentPrint) {\n this.#pendingCleanup = true;\n }\n this.#tryCleanup(/* delayed = */ !intentPrint);\n\n if (error) {\n internalRenderTask.capability.reject(error);\n\n this._abortOperatorList({\n intentState,\n reason: error instanceof Error ? error : new Error(error),\n });\n } else {\n internalRenderTask.capability.resolve();\n }\n\n this._stats?.timeEnd(\"Rendering\");\n this._stats?.timeEnd(\"Overall\");\n };\n\n const internalRenderTask = new InternalRenderTask({\n callback: complete,\n // Only include the required properties, and *not* the entire object.\n params: {\n canvasContext,\n viewport,\n transform,\n background,\n },\n objs: this.objs,\n commonObjs: this.commonObjs,\n annotationCanvasMap,\n operatorList: intentState.operatorList,\n pageIndex: this._pageIndex,\n canvasFactory: this._transport.canvasFactory,\n filterFactory: this._transport.filterFactory,\n useRequestAnimationFrame: !intentPrint,\n pdfBug: this._pdfBug,\n pageColors,\n });\n\n (intentState.renderTasks ||= new Set()).add(internalRenderTask);\n const renderTask = internalRenderTask.task;\n\n Promise.all([\n intentState.displayReadyCapability.promise,\n optionalContentConfigPromise,\n ])\n .then(([transparency, optionalContentConfig]) => {\n if (this.destroyed) {\n complete();\n return;\n }\n this._stats?.time(\"Rendering\");\n\n internalRenderTask.initializeGraphics({\n transparency,\n optionalContentConfig,\n });\n internalRenderTask.operatorListChanged();\n })\n .catch(complete);\n\n return renderTask;\n }\n\n /**\n * @param {GetOperatorListParameters} params - Page getOperatorList\n * parameters.\n * @returns {Promise<PDFOperatorList>} A promise resolved with an\n * {@link PDFOperatorList} object that represents the page's operator list.\n */\n getOperatorList({\n intent = \"display\",\n annotationMode = AnnotationMode.ENABLE,\n printAnnotationStorage = null,\n } = {}) {\n if (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"GENERIC\")) {\n throw new Error(\"Not implemented: getOperatorList\");\n }\n function operatorListChanged() {\n if (intentState.operatorList.lastChunk) {\n intentState.opListReadCapability.resolve(intentState.operatorList);\n\n intentState.renderTasks.delete(opListTask);\n }\n }\n\n const intentArgs = this._transport.getRenderingIntent(\n intent,\n annotationMode,\n printAnnotationStorage,\n /* isOpList = */ true\n );\n let intentState = this._intentStates.get(intentArgs.cacheKey);\n if (!intentState) {\n intentState = Object.create(null);\n this._intentStates.set(intentArgs.cacheKey, intentState);\n }\n let opListTask;\n\n if (!intentState.opListReadCapability) {\n opListTask = Object.create(null);\n opListTask.operatorListChanged = operatorListChanged;\n intentState.opListReadCapability = new PromiseCapability();\n (intentState.renderTasks ||= new Set()).add(opListTask);\n intentState.operatorList = {\n fnArray: [],\n argsArray: [],\n lastChunk: false,\n separateAnnots: null,\n };\n\n this._stats?.time(\"Page Request\");\n this._pumpOperatorList(intentArgs);\n }\n return intentState.opListReadCapability.promise;\n }\n\n /**\n * NOTE: All occurrences of whitespace will be replaced by\n * standard spaces (0x20).\n *\n * @param {getTextContentParameters} params - getTextContent parameters.\n * @returns {ReadableStream} Stream for reading text content chunks.\n */\n streamTextContent({\n includeMarkedContent = false,\n disableNormalization = false,\n } = {}) {\n const TEXT_CONTENT_CHUNK_SIZE = 100;\n\n return this._transport.messageHandler.sendWithStream(\n \"GetTextContent\",\n {\n pageIndex: this._pageIndex,\n includeMarkedContent: includeMarkedContent === true,\n disableNormalization: disableNormalization === true,\n },\n {\n highWaterMark: TEXT_CONTENT_CHUNK_SIZE,\n size(textContent) {\n return textContent.items.length;\n },\n }\n );\n }\n\n /**\n * NOTE: All occurrences of whitespace will be replaced by\n * standard spaces (0x20).\n *\n * @param {getTextContentParameters} params - getTextContent parameters.\n * @returns {Promise<TextContent>} A promise that is resolved with a\n * {@link TextContent} object that represents the page's text content.\n */\n getTextContent(params = {}) {\n if (this._transport._htmlForXfa) {\n // TODO: We need to revisit this once the XFA foreground patch lands and\n // only do this for non-foreground XFA.\n return this.getXfa().then(xfa => {\n return XfaText.textContent(xfa);\n });\n }\n const readableStream = this.streamTextContent(params);\n\n return new Promise(function (resolve, reject) {\n function pump() {\n reader.read().then(function ({ value, done }) {\n if (done) {\n resolve(textContent);\n return;\n }\n Object.assign(textContent.styles, value.styles);\n textContent.items.push(...value.items);\n pump();\n }, reject);\n }\n\n const reader = readableStream.getReader();\n const textContent = {\n items: [],\n styles: Object.create(null),\n };\n pump();\n });\n }\n\n /**\n * @returns {Promise<StructTreeNode>} A promise that is resolved with a\n * {@link StructTreeNode} object that represents the page's structure tree,\n * or `null` when no structure tree is present for the current page.\n */\n getStructTree() {\n return this._transport.getStructTree(this._pageIndex);\n }\n\n /**\n * Destroys the page object.\n * @private\n */\n _destroy() {\n this.destroyed = true;\n\n const waitOn = [];\n for (const intentState of this._intentStates.values()) {\n this._abortOperatorList({\n intentState,\n reason: new Error(\"Page was destroyed.\"),\n force: true,\n });\n\n if (intentState.opListReadCapability) {\n // Avoid errors below, since the renderTasks are just stubs.\n continue;\n }\n for (const internalRenderTask of intentState.renderTasks) {\n waitOn.push(internalRenderTask.completed);\n internalRenderTask.cancel();\n }\n }\n this.objs.clear();\n this.#pendingCleanup = false;\n this.#abortDelayedCleanup();\n\n return Promise.all(waitOn);\n }\n\n /**\n * Cleans up resources allocated by the page.\n *\n * @param {boolean} [resetStats] - Reset page stats, if enabled.\n * The default value is `false`.\n * @returns {boolean} Indicates if clean-up was successfully run.\n */\n cleanup(resetStats = false) {\n this.#pendingCleanup = true;\n const success = this.#tryCleanup(/* delayed = */ false);\n\n if (resetStats && success) {\n this._stats &&= new StatTimer();\n }\n return success;\n }\n\n /**\n * Attempts to clean up if rendering is in a state where that's possible.\n * @param {boolean} [delayed] - Delay the cleanup, to e.g. improve zooming\n * performance in documents with large images.\n * The default value is `false`.\n * @returns {boolean} Indicates if clean-up was successfully run.\n */\n #tryCleanup(delayed = false) {\n this.#abortDelayedCleanup();\n\n if (!this.#pendingCleanup || this.destroyed) {\n return false;\n }\n if (delayed) {\n this.#delayedCleanupTimeout = setTimeout(() => {\n this.#delayedCleanupTimeout = null;\n this.#tryCleanup(/* delayed = */ false);\n }, DELAYED_CLEANUP_TIMEOUT);\n\n return false;\n }\n for (const { renderTasks, operatorList } of this._intentStates.values()) {\n if (renderTasks.size > 0 || !operatorList.lastChunk) {\n return false;\n }\n }\n this._intentStates.clear();\n this.objs.clear();\n this.#pendingCleanup = false;\n return true;\n }\n\n #abortDelayedCleanup() {\n if (this.#delayedCleanupTimeout) {\n clearTimeout(this.#delayedCleanupTimeout);\n this.#delayedCleanupTimeout = null;\n }\n }\n\n /**\n * @private\n */\n _startRenderPage(transparency, cacheKey) {\n const intentState = this._intentStates.get(cacheKey);\n if (!intentState) {\n return; // Rendering was cancelled.\n }\n this._stats?.timeEnd(\"Page Request\");\n\n // TODO Refactor RenderPageRequest to separate rendering\n // and operator list logic\n intentState.displayReadyCapability?.resolve(transparency);\n }\n\n /**\n * @private\n */\n _renderPageChunk(operatorListChunk, intentState) {\n // Add the new chunk to the current operator list.\n for (let i = 0, ii = operatorListChunk.length; i < ii; i++) {\n intentState.operatorList.fnArray.push(operatorListChunk.fnArray[i]);\n intentState.operatorList.argsArray.push(operatorListChunk.argsArray[i]);\n }\n intentState.operatorList.lastChunk = operatorListChunk.lastChunk;\n intentState.operatorList.separateAnnots = operatorListChunk.separateAnnots;\n\n // Notify all the rendering tasks there are more operators to be consumed.\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n\n if (operatorListChunk.lastChunk) {\n this.#tryCleanup(/* delayed = */ true);\n }\n }\n\n /**\n * @private\n */\n _pumpOperatorList({\n renderingIntent,\n cacheKey,\n annotationStorageSerializable,\n }) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n Number.isInteger(renderingIntent) && renderingIntent > 0,\n '_pumpOperatorList: Expected valid \"renderingIntent\" argument.'\n );\n }\n const { map, transfers } = annotationStorageSerializable;\n\n const readableStream = this._transport.messageHandler.sendWithStream(\n \"GetOperatorList\",\n {\n pageIndex: this._pageIndex,\n intent: renderingIntent,\n cacheKey,\n annotationStorage: map,\n },\n transfers\n );\n const reader = readableStream.getReader();\n\n const intentState = this._intentStates.get(cacheKey);\n intentState.streamReader = reader;\n\n const pump = () => {\n reader.read().then(\n ({ value, done }) => {\n if (done) {\n intentState.streamReader = null;\n return;\n }\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n this._renderPageChunk(value, intentState);\n pump();\n },\n reason => {\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n if (intentState.operatorList) {\n // Mark operator list as complete.\n intentState.operatorList.lastChunk = true;\n\n for (const internalRenderTask of intentState.renderTasks) {\n internalRenderTask.operatorListChanged();\n }\n this.#tryCleanup(/* delayed = */ true);\n }\n\n if (intentState.displayReadyCapability) {\n intentState.displayReadyCapability.reject(reason);\n } else if (intentState.opListReadCapability) {\n intentState.opListReadCapability.reject(reason);\n } else {\n throw reason;\n }\n }\n );\n };\n pump();\n }\n\n /**\n * @private\n */\n _abortOperatorList({ intentState, reason, force = false }) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n reason instanceof Error,\n '_abortOperatorList: Expected valid \"reason\" argument.'\n );\n }\n\n if (!intentState.streamReader) {\n return;\n }\n // Ensure that a pending `streamReader` cancel timeout is always aborted.\n if (intentState.streamReaderCancelTimeout) {\n clearTimeout(intentState.streamReaderCancelTimeout);\n intentState.streamReaderCancelTimeout = null;\n }\n\n if (!force) {\n // Ensure that an Error occurring in *only* one `InternalRenderTask`, e.g.\n // multiple render() calls on the same canvas, won't break all rendering.\n if (intentState.renderTasks.size > 0) {\n return;\n }\n // Don't immediately abort parsing on the worker-thread when rendering is\n // cancelled, since that will unnecessarily delay re-rendering when (for\n // partially parsed pages) e.g. zooming/rotation occurs in the viewer.\n if (reason instanceof RenderingCancelledException) {\n let delay = RENDERING_CANCELLED_TIMEOUT;\n if (reason.extraDelay > 0 && reason.extraDelay < /* ms = */ 1000) {\n // Above, we prevent the total delay from becoming arbitrarily large.\n delay += reason.extraDelay;\n }\n\n intentState.streamReaderCancelTimeout = setTimeout(() => {\n intentState.streamReaderCancelTimeout = null;\n this._abortOperatorList({ intentState, reason, force: true });\n }, delay);\n return;\n }\n }\n intentState.streamReader\n .cancel(new AbortException(reason.message))\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n intentState.streamReader = null;\n\n if (this._transport.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n // Remove the current `intentState`, since a cancelled `getOperatorList`\n // call on the worker-thread cannot be re-started...\n for (const [curCacheKey, curIntentState] of this._intentStates) {\n if (curIntentState === intentState) {\n this._intentStates.delete(curCacheKey);\n break;\n }\n }\n // ... and force clean-up to ensure that any old state is always removed.\n this.cleanup();\n }\n\n /**\n * @type {StatTimer | null} Returns page stats, if enabled; returns `null`\n * otherwise.\n */\n get stats() {\n return this._stats;\n }\n}\n\nclass LoopbackPort {\n #listeners = new Set();\n\n #deferred = Promise.resolve();\n\n postMessage(obj, transfer) {\n const event = {\n data: structuredClone(\n obj,\n (typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"SKIP_BABEL || TESTING\")) &&\n transfer\n ? { transfer }\n : null\n ),\n };\n\n this.#deferred.then(() => {\n for (const listener of this.#listeners) {\n listener.call(this, event);\n }\n });\n }\n\n addEventListener(name, listener) {\n this.#listeners.add(listener);\n }\n\n removeEventListener(name, listener) {\n this.#listeners.delete(listener);\n }\n\n terminate() {\n this.#listeners.clear();\n }\n}\n\n/**\n * @typedef {Object} PDFWorkerParameters\n * @property {string} [name] - The name of the worker.\n * @property {Worker} [port] - The `workerPort` object.\n * @property {number} [verbosity] - Controls the logging level;\n * the constants from {@link VerbosityLevel} should be used.\n */\n\nconst PDFWorkerUtil = {\n isWorkerDisabled: false,\n fallbackWorkerSrc: null,\n fakeWorkerId: 0,\n};\nif (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) {\n // eslint-disable-next-line no-undef\n if (isNodeJS && typeof __non_webpack_require__ === \"function\") {\n // Workers aren't supported in Node.js, force-disabling them there.\n PDFWorkerUtil.isWorkerDisabled = true;\n\n PDFWorkerUtil.fallbackWorkerSrc = PDFJSDev.test(\"LIB\")\n ? \"../pdf.worker.js\"\n : \"./pdf.worker.js\";\n } else if (typeof document === \"object\") {\n const pdfjsFilePath = document?.currentScript?.src;\n if (pdfjsFilePath) {\n PDFWorkerUtil.fallbackWorkerSrc = pdfjsFilePath.replace(\n /(\\.(?:min\\.)?js)(\\?.*)?$/i,\n \".worker$1$2\"\n );\n }\n }\n\n // Check if URLs have the same origin. For non-HTTP based URLs, returns false.\n PDFWorkerUtil.isSameOrigin = function (baseUrl, otherUrl) {\n let base;\n try {\n base = new URL(baseUrl);\n if (!base.origin || base.origin === \"null\") {\n return false; // non-HTTP url\n }\n } catch {\n return false;\n }\n\n const other = new URL(otherUrl, base);\n return base.origin === other.origin;\n };\n\n PDFWorkerUtil.createCDNWrapper = function (url) {\n // We will rely on blob URL's property to specify origin.\n // We want this function to fail in case if createObjectURL or Blob do not\n // exist or fail for some reason -- our Worker creation will fail anyway.\n const wrapper = `importScripts(\"${url}\");`;\n return URL.createObjectURL(new Blob([wrapper]));\n };\n}\n\n/**\n * PDF.js web worker abstraction that controls the instantiation of PDF\n * documents. Message handlers are used to pass information from the main\n * thread to the worker thread and vice versa. If the creation of a web\n * worker is not possible, a \"fake\" worker will be used instead.\n *\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n */\nclass PDFWorker {\n static #workerPorts;\n\n constructor({\n name = null,\n port = null,\n verbosity = getVerbosityLevel(),\n } = {}) {\n this.name = name;\n this.destroyed = false;\n this.verbosity = verbosity;\n\n this._readyCapability = new PromiseCapability();\n this._port = null;\n this._webWorker = null;\n this._messageHandler = null;\n\n if (\n (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) &&\n port\n ) {\n if (PDFWorker.#workerPorts?.has(port)) {\n throw new Error(\"Cannot use more than one PDFWorker per port.\");\n }\n (PDFWorker.#workerPorts ||= new WeakMap()).set(port, this);\n this._initializeFromPort(port);\n return;\n }\n this._initialize();\n }\n\n /**\n * Promise for worker initialization completion.\n * @type {Promise<void>}\n */\n get promise() {\n return this._readyCapability.promise;\n }\n\n /**\n * The current `workerPort`, when it exists.\n * @type {Worker}\n */\n get port() {\n return this._port;\n }\n\n /**\n * The current MessageHandler-instance.\n * @type {MessageHandler}\n */\n get messageHandler() {\n return this._messageHandler;\n }\n\n _initializeFromPort(port) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _initializeFromPort\");\n }\n this._port = port;\n this._messageHandler = new MessageHandler(\"main\", \"worker\", port);\n this._messageHandler.on(\"ready\", function () {\n // Ignoring \"ready\" event -- MessageHandler should already be initialized\n // and ready to accept messages.\n });\n this._readyCapability.resolve();\n // Send global setting, e.g. verbosity level.\n this._messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n }\n\n _initialize() {\n // If worker support isn't disabled explicit and the browser has worker\n // support, create a new web worker and test if it/the browser fulfills\n // all requirements to run parts of pdf.js in a web worker.\n // Right now, the requirement is, that an Uint8Array is still an\n // Uint8Array as it arrives on the worker. (Chrome added this with v.15.)\n if (\n !PDFWorkerUtil.isWorkerDisabled &&\n !PDFWorker._mainThreadWorkerMessageHandler\n ) {\n let { workerSrc } = PDFWorker;\n\n try {\n // Wraps workerSrc path into blob URL, if the former does not belong\n // to the same origin.\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC\") &&\n !PDFWorkerUtil.isSameOrigin(window.location.href, workerSrc)\n ) {\n workerSrc = PDFWorkerUtil.createCDNWrapper(\n new URL(workerSrc, window.location).href\n );\n }\n\n const worker =\n typeof PDFJSDev === \"undefined\" &&\n !workerSrc.endsWith(\"/build/pdf.worker.js\")\n ? new Worker(workerSrc, { type: \"module\" })\n : new Worker(workerSrc);\n const messageHandler = new MessageHandler(\"main\", \"worker\", worker);\n const terminateEarly = () => {\n worker.removeEventListener(\"error\", onWorkerError);\n messageHandler.destroy();\n worker.terminate();\n if (this.destroyed) {\n this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n } else {\n // Fall back to fake worker if the termination is caused by an\n // error (e.g. NetworkError / SecurityError).\n this._setupFakeWorker();\n }\n };\n\n const onWorkerError = () => {\n if (!this._webWorker) {\n // Worker failed to initialize due to an error. Clean up and fall\n // back to the fake worker.\n terminateEarly();\n }\n };\n worker.addEventListener(\"error\", onWorkerError);\n\n messageHandler.on(\"test\", data => {\n worker.removeEventListener(\"error\", onWorkerError);\n if (this.destroyed) {\n terminateEarly();\n return; // worker was destroyed\n }\n if (data) {\n this._messageHandler = messageHandler;\n this._port = worker;\n this._webWorker = worker;\n\n this._readyCapability.resolve();\n // Send global setting, e.g. verbosity level.\n messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n } else {\n this._setupFakeWorker();\n messageHandler.destroy();\n worker.terminate();\n }\n });\n\n messageHandler.on(\"ready\", data => {\n worker.removeEventListener(\"error\", onWorkerError);\n if (this.destroyed) {\n terminateEarly();\n return; // worker was destroyed\n }\n try {\n sendTest();\n } catch {\n // We need fallback to a faked worker.\n this._setupFakeWorker();\n }\n });\n\n const sendTest = () => {\n const testObj = new Uint8Array();\n // Ensure that we can use `postMessage` transfers.\n messageHandler.send(\"test\", testObj, [testObj.buffer]);\n };\n\n // It might take time for the worker to initialize. We will try to send\n // the \"test\" message immediately, and once the \"ready\" message arrives.\n // The worker shall process only the first received \"test\" message.\n sendTest();\n return;\n } catch {\n info(\"The worker has been disabled.\");\n }\n }\n // Either workers are disabled, not supported or have thrown an exception.\n // Thus, we fallback to a faked worker.\n this._setupFakeWorker();\n }\n\n _setupFakeWorker() {\n if (!PDFWorkerUtil.isWorkerDisabled) {\n warn(\"Setting up fake worker.\");\n PDFWorkerUtil.isWorkerDisabled = true;\n }\n\n PDFWorker._setupFakeWorkerGlobal\n .then(WorkerMessageHandler => {\n if (this.destroyed) {\n this._readyCapability.reject(new Error(\"Worker was destroyed\"));\n return;\n }\n const port = new LoopbackPort();\n this._port = port;\n\n // All fake workers use the same port, making id unique.\n const id = `fake${PDFWorkerUtil.fakeWorkerId++}`;\n\n // If the main thread is our worker, setup the handling for the\n // messages -- the main thread sends to it self.\n const workerHandler = new MessageHandler(id + \"_worker\", id, port);\n WorkerMessageHandler.setup(workerHandler, port);\n\n const messageHandler = new MessageHandler(id, id + \"_worker\", port);\n this._messageHandler = messageHandler;\n this._readyCapability.resolve();\n // Send global setting, e.g. verbosity level.\n messageHandler.send(\"configure\", {\n verbosity: this.verbosity,\n });\n })\n .catch(reason => {\n this._readyCapability.reject(\n new Error(`Setting up fake worker failed: \"${reason.message}\".`)\n );\n });\n }\n\n /**\n * Destroys the worker instance.\n */\n destroy() {\n this.destroyed = true;\n if (this._webWorker) {\n // We need to terminate only web worker created resource.\n this._webWorker.terminate();\n this._webWorker = null;\n }\n PDFWorker.#workerPorts?.delete(this._port);\n this._port = null;\n if (this._messageHandler) {\n this._messageHandler.destroy();\n this._messageHandler = null;\n }\n }\n\n /**\n * @param {PDFWorkerParameters} params - The worker initialization parameters.\n */\n static fromPort(params) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: fromPort\");\n }\n if (!params?.port) {\n throw new Error(\"PDFWorker.fromPort - invalid method signature.\");\n }\n const cachedPort = this.#workerPorts?.get(params.port);\n if (cachedPort) {\n if (cachedPort._pendingDestroy) {\n throw new Error(\n \"PDFWorker.fromPort - the worker is being destroyed.\\n\" +\n \"Please remember to await `PDFDocumentLoadingTask.destroy()`-calls.\"\n );\n }\n return cachedPort;\n }\n return new PDFWorker(params);\n }\n\n /**\n * The current `workerSrc`, when it exists.\n * @type {string}\n */\n static get workerSrc() {\n if (GlobalWorkerOptions.workerSrc) {\n return GlobalWorkerOptions.workerSrc;\n }\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n PDFWorkerUtil.fallbackWorkerSrc !== null\n ) {\n if (!isNodeJS) {\n deprecated('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n return PDFWorkerUtil.fallbackWorkerSrc;\n }\n throw new Error('No \"GlobalWorkerOptions.workerSrc\" specified.');\n }\n\n static get _mainThreadWorkerMessageHandler() {\n try {\n return globalThis.pdfjsWorker?.WorkerMessageHandler || null;\n } catch {\n return null;\n }\n }\n\n // Loads worker code into the main-thread.\n static get _setupFakeWorkerGlobal() {\n const loader = async () => {\n const mainWorkerMessageHandler = this._mainThreadWorkerMessageHandler;\n\n if (mainWorkerMessageHandler) {\n // The worker was already loaded using e.g. a `<script>` tag.\n return mainWorkerMessageHandler;\n }\n if (typeof PDFJSDev === \"undefined\") {\n const worker = await import(\"pdfjs/pdf.worker.js\");\n return worker.WorkerMessageHandler;\n }\n if (\n PDFJSDev.test(\"GENERIC\") &&\n isNodeJS &&\n // eslint-disable-next-line no-undef\n typeof __non_webpack_require__ === \"function\"\n ) {\n // Since bundlers, such as Webpack, cannot be told to leave `require`\n // statements alone we are thus forced to jump through hoops in order\n // to prevent `Critical dependency: ...` warnings in third-party\n // deployments of the built `pdf.js`/`pdf.worker.js` files; see\n // https://github.com/webpack/webpack/issues/8826\n //\n // The following hack is based on the assumption that code running in\n // Node.js won't ever be affected by e.g. Content Security Policies that\n // prevent the use of `eval`. If that ever occurs, we should revert this\n // to a normal `__non_webpack_require__` statement and simply document\n // the Webpack warnings instead (telling users to ignore them).\n //\n // eslint-disable-next-line no-eval\n const worker = eval(\"require\")(this.workerSrc);\n return worker.WorkerMessageHandler;\n }\n await loadScript(this.workerSrc);\n return window.pdfjsWorker.WorkerMessageHandler;\n };\n\n return shadow(this, \"_setupFakeWorkerGlobal\", loader());\n }\n}\n\n/**\n * For internal use only.\n * @ignore\n */\nclass WorkerTransport {\n #methodPromises = new Map();\n\n #pageCache = new Map();\n\n #pagePromises = new Map();\n\n #passwordCapability = null;\n\n constructor(messageHandler, loadingTask, networkStream, params, factory) {\n this.messageHandler = messageHandler;\n this.loadingTask = loadingTask;\n this.commonObjs = new PDFObjects();\n this.fontLoader = new FontLoader({\n ownerDocument: params.ownerDocument,\n styleElement: params.styleElement,\n });\n this._params = params;\n\n this.canvasFactory = factory.canvasFactory;\n this.filterFactory = factory.filterFactory;\n this.cMapReaderFactory = factory.cMapReaderFactory;\n this.standardFontDataFactory = factory.standardFontDataFactory;\n\n this.destroyed = false;\n this.destroyCapability = null;\n\n this._networkStream = networkStream;\n this._fullReader = null;\n this._lastProgress = null;\n this.downloadInfoCapability = new PromiseCapability();\n\n this.setupMessageHandler();\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"getXFADatasets\", {\n value: () => {\n return this.messageHandler.sendWithPromise(\"GetXFADatasets\", null);\n },\n });\n Object.defineProperty(this, \"getXRefPrevValue\", {\n value: () => {\n return this.messageHandler.sendWithPromise(\"GetXRefPrevValue\", null);\n },\n });\n Object.defineProperty(this, \"getAnnotArray\", {\n value: pageIndex => {\n return this.messageHandler.sendWithPromise(\"GetAnnotArray\", {\n pageIndex,\n });\n },\n });\n }\n }\n\n #cacheSimpleMethod(name, data = null) {\n const cachedPromise = this.#methodPromises.get(name);\n if (cachedPromise) {\n return cachedPromise;\n }\n const promise = this.messageHandler.sendWithPromise(name, data);\n\n this.#methodPromises.set(name, promise);\n return promise;\n }\n\n get annotationStorage() {\n return shadow(this, \"annotationStorage\", new AnnotationStorage());\n }\n\n getRenderingIntent(\n intent,\n annotationMode = AnnotationMode.ENABLE,\n printAnnotationStorage = null,\n isOpList = false\n ) {\n let renderingIntent = RenderingIntentFlag.DISPLAY; // Default value.\n let annotationStorageSerializable = SerializableEmpty;\n\n switch (intent) {\n case \"any\":\n renderingIntent = RenderingIntentFlag.ANY;\n break;\n case \"display\":\n break;\n case \"print\":\n renderingIntent = RenderingIntentFlag.PRINT;\n break;\n default:\n warn(`getRenderingIntent - invalid intent: ${intent}`);\n }\n\n switch (annotationMode) {\n case AnnotationMode.DISABLE:\n renderingIntent += RenderingIntentFlag.ANNOTATIONS_DISABLE;\n break;\n case AnnotationMode.ENABLE:\n break;\n case AnnotationMode.ENABLE_FORMS:\n renderingIntent += RenderingIntentFlag.ANNOTATIONS_FORMS;\n break;\n case AnnotationMode.ENABLE_STORAGE:\n renderingIntent += RenderingIntentFlag.ANNOTATIONS_STORAGE;\n\n const annotationStorage =\n renderingIntent & RenderingIntentFlag.PRINT &&\n printAnnotationStorage instanceof PrintAnnotationStorage\n ? printAnnotationStorage\n : this.annotationStorage;\n\n annotationStorageSerializable = annotationStorage.serializable;\n break;\n default:\n warn(`getRenderingIntent - invalid annotationMode: ${annotationMode}`);\n }\n\n if (isOpList) {\n renderingIntent += RenderingIntentFlag.OPLIST;\n }\n\n return {\n renderingIntent,\n cacheKey: `${renderingIntent}_${annotationStorageSerializable.hash}`,\n annotationStorageSerializable,\n };\n }\n\n destroy() {\n if (this.destroyCapability) {\n return this.destroyCapability.promise;\n }\n\n this.destroyed = true;\n this.destroyCapability = new PromiseCapability();\n\n this.#passwordCapability?.reject(\n new Error(\"Worker was destroyed during onPassword callback\")\n );\n\n const waitOn = [];\n // We need to wait for all renderings to be completed, e.g.\n // timeout/rAF can take a long time.\n for (const page of this.#pageCache.values()) {\n waitOn.push(page._destroy());\n }\n this.#pageCache.clear();\n this.#pagePromises.clear();\n // Allow `AnnotationStorage`-related clean-up when destroying the document.\n if (this.hasOwnProperty(\"annotationStorage\")) {\n this.annotationStorage.resetModified();\n }\n // We also need to wait for the worker to finish its long running tasks.\n const terminated = this.messageHandler.sendWithPromise(\"Terminate\", null);\n waitOn.push(terminated);\n\n Promise.all(waitOn).then(() => {\n this.commonObjs.clear();\n this.fontLoader.clear();\n this.#methodPromises.clear();\n this.filterFactory.destroy();\n\n this._networkStream?.cancelAllRequests(\n new AbortException(\"Worker was terminated.\")\n );\n\n if (this.messageHandler) {\n this.messageHandler.destroy();\n this.messageHandler = null;\n }\n this.destroyCapability.resolve();\n }, this.destroyCapability.reject);\n return this.destroyCapability.promise;\n }\n\n setupMessageHandler() {\n const { messageHandler, loadingTask } = this;\n\n messageHandler.on(\"GetReader\", (data, sink) => {\n assert(\n this._networkStream,\n \"GetReader - no `IPDFStream` instance available.\"\n );\n this._fullReader = this._networkStream.getFullReader();\n this._fullReader.onProgress = evt => {\n this._lastProgress = {\n loaded: evt.loaded,\n total: evt.total,\n };\n };\n sink.onPull = () => {\n this._fullReader\n .read()\n .then(function ({ value, done }) {\n if (done) {\n sink.close();\n return;\n }\n assert(\n value instanceof ArrayBuffer,\n \"GetReader - expected an ArrayBuffer.\"\n );\n // Enqueue data chunk into sink, and transfer it\n // to other side as `Transferable` object.\n sink.enqueue(new Uint8Array(value), 1, [value]);\n })\n .catch(reason => {\n sink.error(reason);\n });\n };\n\n sink.onCancel = reason => {\n this._fullReader.cancel(reason);\n\n sink.ready.catch(readyReason => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n throw readyReason;\n });\n };\n });\n\n messageHandler.on(\"ReaderHeadersReady\", data => {\n const headersCapability = new PromiseCapability();\n const fullReader = this._fullReader;\n fullReader.headersReady.then(() => {\n // If stream or range are disabled, it's our only way to report\n // loading progress.\n if (!fullReader.isStreamingSupported || !fullReader.isRangeSupported) {\n if (this._lastProgress) {\n loadingTask.onProgress?.(this._lastProgress);\n }\n fullReader.onProgress = evt => {\n loadingTask.onProgress?.({\n loaded: evt.loaded,\n total: evt.total,\n });\n };\n }\n\n headersCapability.resolve({\n isStreamingSupported: fullReader.isStreamingSupported,\n isRangeSupported: fullReader.isRangeSupported,\n contentLength: fullReader.contentLength,\n });\n }, headersCapability.reject);\n\n return headersCapability.promise;\n });\n\n messageHandler.on(\"GetRangeReader\", (data, sink) => {\n assert(\n this._networkStream,\n \"GetRangeReader - no `IPDFStream` instance available.\"\n );\n const rangeReader = this._networkStream.getRangeReader(\n data.begin,\n data.end\n );\n\n // When streaming is enabled, it's possible that the data requested here\n // has already been fetched via the `_fullRequestReader` implementation.\n // However, given that the PDF data is loaded asynchronously on the\n // main-thread and then sent via `postMessage` to the worker-thread,\n // it may not have been available during parsing (hence the attempt to\n // use range requests here).\n //\n // To avoid wasting time and resources here, we'll thus *not* dispatch\n // range requests if the data was already loaded but has not been sent to\n // the worker-thread yet (which will happen via the `_fullRequestReader`).\n if (!rangeReader) {\n sink.close();\n return;\n }\n\n sink.onPull = () => {\n rangeReader\n .read()\n .then(function ({ value, done }) {\n if (done) {\n sink.close();\n return;\n }\n assert(\n value instanceof ArrayBuffer,\n \"GetRangeReader - expected an ArrayBuffer.\"\n );\n sink.enqueue(new Uint8Array(value), 1, [value]);\n })\n .catch(reason => {\n sink.error(reason);\n });\n };\n\n sink.onCancel = reason => {\n rangeReader.cancel(reason);\n\n sink.ready.catch(readyReason => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n throw readyReason;\n });\n };\n });\n\n messageHandler.on(\"GetDoc\", ({ pdfInfo }) => {\n this._numPages = pdfInfo.numPages;\n this._htmlForXfa = pdfInfo.htmlForXfa;\n delete pdfInfo.htmlForXfa;\n loadingTask._capability.resolve(new PDFDocumentProxy(pdfInfo, this));\n });\n\n messageHandler.on(\"DocException\", function (ex) {\n let reason;\n switch (ex.name) {\n case \"PasswordException\":\n reason = new PasswordException(ex.message, ex.code);\n break;\n case \"InvalidPDFException\":\n reason = new InvalidPDFException(ex.message);\n break;\n case \"MissingPDFException\":\n reason = new MissingPDFException(ex.message);\n break;\n case \"UnexpectedResponseException\":\n reason = new UnexpectedResponseException(ex.message, ex.status);\n break;\n case \"UnknownErrorException\":\n reason = new UnknownErrorException(ex.message, ex.details);\n break;\n default:\n unreachable(\"DocException - expected a valid Error.\");\n }\n loadingTask._capability.reject(reason);\n });\n\n messageHandler.on(\"PasswordRequest\", exception => {\n this.#passwordCapability = new PromiseCapability();\n\n if (loadingTask.onPassword) {\n const updatePassword = password => {\n if (password instanceof Error) {\n this.#passwordCapability.reject(password);\n } else {\n this.#passwordCapability.resolve({ password });\n }\n };\n try {\n loadingTask.onPassword(updatePassword, exception.code);\n } catch (ex) {\n this.#passwordCapability.reject(ex);\n }\n } else {\n this.#passwordCapability.reject(\n new PasswordException(exception.message, exception.code)\n );\n }\n return this.#passwordCapability.promise;\n });\n\n messageHandler.on(\"DataLoaded\", data => {\n // For consistency: Ensure that progress is always reported when the\n // entire PDF file has been loaded, regardless of how it was fetched.\n loadingTask.onProgress?.({\n loaded: data.length,\n total: data.length,\n });\n\n this.downloadInfoCapability.resolve(data);\n });\n\n messageHandler.on(\"StartRenderPage\", data => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n\n const page = this.#pageCache.get(data.pageIndex);\n page._startRenderPage(data.transparency, data.cacheKey);\n });\n\n messageHandler.on(\"commonobj\", ([id, type, exportedData]) => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n\n if (this.commonObjs.has(id)) {\n return;\n }\n\n switch (type) {\n case \"Font\":\n const params = this._params;\n\n if (\"error\" in exportedData) {\n const exportedError = exportedData.error;\n warn(`Error during font loading: ${exportedError}`);\n this.commonObjs.resolve(id, exportedError);\n break;\n }\n\n const inspectFont =\n params.pdfBug && globalThis.FontInspector?.enabled\n ? (font, url) => globalThis.FontInspector.fontAdded(font, url)\n : null;\n const font = new FontFaceObject(exportedData, {\n isEvalSupported: params.isEvalSupported,\n disableFontFace: params.disableFontFace,\n ignoreErrors: params.ignoreErrors,\n inspectFont,\n });\n\n this.fontLoader\n .bind(font)\n .catch(reason => {\n return messageHandler.sendWithPromise(\"FontFallback\", { id });\n })\n .finally(() => {\n if (!params.fontExtraProperties && font.data) {\n // Immediately release the `font.data` property once the font\n // has been attached to the DOM, since it's no longer needed,\n // rather than waiting for a `PDFDocumentProxy.cleanup` call.\n // Since `font.data` could be very large, e.g. in some cases\n // multiple megabytes, this will help reduce memory usage.\n font.data = null;\n }\n this.commonObjs.resolve(id, font);\n });\n break;\n case \"FontPath\":\n case \"Image\":\n case \"Pattern\":\n this.commonObjs.resolve(id, exportedData);\n break;\n default:\n throw new Error(`Got unknown common object type ${type}`);\n }\n });\n\n messageHandler.on(\"obj\", ([id, pageIndex, type, imageData]) => {\n if (this.destroyed) {\n // Ignore any pending requests if the worker was terminated.\n return;\n }\n\n const pageProxy = this.#pageCache.get(pageIndex);\n if (pageProxy.objs.has(id)) {\n return;\n }\n\n switch (type) {\n case \"Image\":\n pageProxy.objs.resolve(id, imageData);\n\n // Heuristic that will allow us not to store large data.\n if (imageData) {\n let length;\n if (imageData.bitmap) {\n const { width, height } = imageData;\n length = width * height * 4;\n } else {\n length = imageData.data?.length || 0;\n }\n\n if (length > MAX_IMAGE_SIZE_TO_CACHE) {\n pageProxy._maybeCleanupAfterRender = true;\n }\n }\n break;\n case \"Pattern\":\n pageProxy.objs.resolve(id, imageData);\n break;\n default:\n throw new Error(`Got unknown object type ${type}`);\n }\n });\n\n messageHandler.on(\"DocProgress\", data => {\n if (this.destroyed) {\n return; // Ignore any pending requests if the worker was terminated.\n }\n loadingTask.onProgress?.({\n loaded: data.loaded,\n total: data.total,\n });\n });\n\n messageHandler.on(\"FetchBuiltInCMap\", data => {\n if (this.destroyed) {\n return Promise.reject(new Error(\"Worker was destroyed.\"));\n }\n if (!this.cMapReaderFactory) {\n return Promise.reject(\n new Error(\n \"CMapReaderFactory not initialized, see the `useWorkerFetch` parameter.\"\n )\n );\n }\n return this.cMapReaderFactory.fetch(data);\n });\n\n messageHandler.on(\"FetchStandardFontData\", data => {\n if (this.destroyed) {\n return Promise.reject(new Error(\"Worker was destroyed.\"));\n }\n if (!this.standardFontDataFactory) {\n return Promise.reject(\n new Error(\n \"StandardFontDataFactory not initialized, see the `useWorkerFetch` parameter.\"\n )\n );\n }\n return this.standardFontDataFactory.fetch(data);\n });\n }\n\n getData() {\n return this.messageHandler.sendWithPromise(\"GetData\", null);\n }\n\n saveDocument() {\n if (this.annotationStorage.size <= 0) {\n warn(\n \"saveDocument called while `annotationStorage` is empty, \" +\n \"please use the getData-method instead.\"\n );\n }\n const { map, transfers } = this.annotationStorage.serializable;\n\n return this.messageHandler\n .sendWithPromise(\n \"SaveDocument\",\n {\n isPureXfa: !!this._htmlForXfa,\n numPages: this._numPages,\n annotationStorage: map,\n filename: this._fullReader?.filename ?? null,\n },\n transfers\n )\n .finally(() => {\n this.annotationStorage.resetModified();\n });\n }\n\n getPage(pageNumber) {\n if (\n !Number.isInteger(pageNumber) ||\n pageNumber <= 0 ||\n pageNumber > this._numPages\n ) {\n return Promise.reject(new Error(\"Invalid page request.\"));\n }\n\n const pageIndex = pageNumber - 1,\n cachedPromise = this.#pagePromises.get(pageIndex);\n if (cachedPromise) {\n return cachedPromise;\n }\n const promise = this.messageHandler\n .sendWithPromise(\"GetPage\", {\n pageIndex,\n })\n .then(pageInfo => {\n if (this.destroyed) {\n throw new Error(\"Transport destroyed\");\n }\n const page = new PDFPageProxy(\n pageIndex,\n pageInfo,\n this,\n this._params.pdfBug\n );\n this.#pageCache.set(pageIndex, page);\n return page;\n });\n this.#pagePromises.set(pageIndex, promise);\n return promise;\n }\n\n getPageIndex(ref) {\n if (\n typeof ref !== \"object\" ||\n ref === null ||\n !Number.isInteger(ref.num) ||\n ref.num < 0 ||\n !Number.isInteger(ref.gen) ||\n ref.gen < 0\n ) {\n return Promise.reject(new Error(\"Invalid pageIndex request.\"));\n }\n return this.messageHandler.sendWithPromise(\"GetPageIndex\", {\n num: ref.num,\n gen: ref.gen,\n });\n }\n\n getAnnotations(pageIndex, intent) {\n return this.messageHandler.sendWithPromise(\"GetAnnotations\", {\n pageIndex,\n intent,\n });\n }\n\n getFieldObjects() {\n return this.#cacheSimpleMethod(\"GetFieldObjects\");\n }\n\n hasJSActions() {\n return this.#cacheSimpleMethod(\"HasJSActions\");\n }\n\n getCalculationOrderIds() {\n return this.messageHandler.sendWithPromise(\"GetCalculationOrderIds\", null);\n }\n\n getDestinations() {\n return this.messageHandler.sendWithPromise(\"GetDestinations\", null);\n }\n\n getDestination(id) {\n if (typeof id !== \"string\") {\n return Promise.reject(new Error(\"Invalid destination request.\"));\n }\n return this.messageHandler.sendWithPromise(\"GetDestination\", {\n id,\n });\n }\n\n getPageLabels() {\n return this.messageHandler.sendWithPromise(\"GetPageLabels\", null);\n }\n\n getPageLayout() {\n return this.messageHandler.sendWithPromise(\"GetPageLayout\", null);\n }\n\n getPageMode() {\n return this.messageHandler.sendWithPromise(\"GetPageMode\", null);\n }\n\n getViewerPreferences() {\n return this.messageHandler.sendWithPromise(\"GetViewerPreferences\", null);\n }\n\n getOpenAction() {\n return this.messageHandler.sendWithPromise(\"GetOpenAction\", null);\n }\n\n getAttachments() {\n return this.messageHandler.sendWithPromise(\"GetAttachments\", null);\n }\n\n getDocJSActions() {\n return this.#cacheSimpleMethod(\"GetDocJSActions\");\n }\n\n getPageJSActions(pageIndex) {\n return this.messageHandler.sendWithPromise(\"GetPageJSActions\", {\n pageIndex,\n });\n }\n\n getStructTree(pageIndex) {\n return this.messageHandler.sendWithPromise(\"GetStructTree\", {\n pageIndex,\n });\n }\n\n getOutline() {\n return this.messageHandler.sendWithPromise(\"GetOutline\", null);\n }\n\n getOptionalContentConfig() {\n return this.messageHandler\n .sendWithPromise(\"GetOptionalContentConfig\", null)\n .then(results => {\n return new OptionalContentConfig(results);\n });\n }\n\n getPermissions() {\n return this.messageHandler.sendWithPromise(\"GetPermissions\", null);\n }\n\n getMetadata() {\n const name = \"GetMetadata\",\n cachedPromise = this.#methodPromises.get(name);\n if (cachedPromise) {\n return cachedPromise;\n }\n const promise = this.messageHandler\n .sendWithPromise(name, null)\n .then(results => {\n return {\n info: results[0],\n metadata: results[1] ? new Metadata(results[1]) : null,\n contentDispositionFilename: this._fullReader?.filename ?? null,\n contentLength: this._fullReader?.contentLength ?? null,\n };\n });\n this.#methodPromises.set(name, promise);\n return promise;\n }\n\n getMarkInfo() {\n return this.messageHandler.sendWithPromise(\"GetMarkInfo\", null);\n }\n\n async startCleanup(keepLoadedFonts = false) {\n if (this.destroyed) {\n return; // No need to manually clean-up when destruction has started.\n }\n await this.messageHandler.sendWithPromise(\"Cleanup\", null);\n\n for (const page of this.#pageCache.values()) {\n const cleanupSuccessful = page.cleanup();\n\n if (!cleanupSuccessful) {\n throw new Error(\n `startCleanup: Page ${page.pageNumber} is currently rendering.`\n );\n }\n }\n this.commonObjs.clear();\n if (!keepLoadedFonts) {\n this.fontLoader.clear();\n }\n this.#methodPromises.clear();\n this.filterFactory.destroy(/* keepHCM = */ true);\n }\n\n get loadingParams() {\n const { disableAutoFetch, enableXfa } = this._params;\n return shadow(this, \"loadingParams\", {\n disableAutoFetch,\n enableXfa,\n });\n }\n}\n\n/**\n * A PDF document and page is built of many objects. E.g. there are objects for\n * fonts, images, rendering code, etc. These objects may get processed inside of\n * a worker. This class implements some basic methods to manage these objects.\n */\nclass PDFObjects {\n #objs = Object.create(null);\n\n /**\n * Ensures there is an object defined for `objId`.\n *\n * @param {string} objId\n * @returns {Object}\n */\n #ensureObj(objId) {\n return (this.#objs[objId] ||= {\n capability: new PromiseCapability(),\n data: null,\n });\n }\n\n /**\n * If called *without* callback, this returns the data of `objId` but the\n * object needs to be resolved. If it isn't, this method throws.\n *\n * If called *with* a callback, the callback is called with the data of the\n * object once the object is resolved. That means, if you call this method\n * and the object is already resolved, the callback gets called right away.\n *\n * @param {string} objId\n * @param {function} [callback]\n * @returns {any}\n */\n get(objId, callback = null) {\n // If there is a callback, then the get can be async and the object is\n // not required to be resolved right now.\n if (callback) {\n const obj = this.#ensureObj(objId);\n obj.capability.promise.then(() => callback(obj.data));\n return null;\n }\n // If there isn't a callback, the user expects to get the resolved data\n // directly.\n const obj = this.#objs[objId];\n // If there isn't an object yet or the object isn't resolved, then the\n // data isn't ready yet!\n if (!obj?.capability.settled) {\n throw new Error(`Requesting object that isn't resolved yet ${objId}.`);\n }\n return obj.data;\n }\n\n /**\n * @param {string} objId\n * @returns {boolean}\n */\n has(objId) {\n const obj = this.#objs[objId];\n return obj?.capability.settled || false;\n }\n\n /**\n * Resolves the object `objId` with optional `data`.\n *\n * @param {string} objId\n * @param {any} [data]\n */\n resolve(objId, data = null) {\n const obj = this.#ensureObj(objId);\n obj.data = data;\n obj.capability.resolve();\n }\n\n clear() {\n for (const objId in this.#objs) {\n const { data } = this.#objs[objId];\n data?.bitmap?.close(); // Release any `ImageBitmap` data.\n }\n this.#objs = Object.create(null);\n }\n}\n\n/**\n * Allows controlling of the rendering tasks.\n */\nclass RenderTask {\n #internalRenderTask = null;\n\n constructor(internalRenderTask) {\n this.#internalRenderTask = internalRenderTask;\n\n /**\n * Callback for incremental rendering -- a function that will be called\n * each time the rendering is paused. To continue rendering call the\n * function that is the first argument to the callback.\n * @type {function}\n */\n this.onContinue = null;\n }\n\n /**\n * Promise for rendering task completion.\n * @type {Promise<void>}\n */\n get promise() {\n return this.#internalRenderTask.capability.promise;\n }\n\n /**\n * Cancels the rendering task. If the task is currently rendering it will\n * not be cancelled until graphics pauses with a timeout. The promise that\n * this object extends will be rejected when cancelled.\n *\n * @param {number} [extraDelay]\n */\n cancel(extraDelay = 0) {\n this.#internalRenderTask.cancel(/* error = */ null, extraDelay);\n }\n\n /**\n * Whether form fields are rendered separately from the main operatorList.\n * @type {boolean}\n */\n get separateAnnots() {\n const { separateAnnots } = this.#internalRenderTask.operatorList;\n if (!separateAnnots) {\n return false;\n }\n const { annotationCanvasMap } = this.#internalRenderTask;\n return (\n separateAnnots.form ||\n (separateAnnots.canvas && annotationCanvasMap?.size > 0)\n );\n }\n}\n\n/**\n * For internal use only.\n * @ignore\n */\nclass InternalRenderTask {\n static #canvasInUse = new WeakSet();\n\n constructor({\n callback,\n params,\n objs,\n commonObjs,\n annotationCanvasMap,\n operatorList,\n pageIndex,\n canvasFactory,\n filterFactory,\n useRequestAnimationFrame = false,\n pdfBug = false,\n pageColors = null,\n }) {\n this.callback = callback;\n this.params = params;\n this.objs = objs;\n this.commonObjs = commonObjs;\n this.annotationCanvasMap = annotationCanvasMap;\n this.operatorListIdx = null;\n this.operatorList = operatorList;\n this._pageIndex = pageIndex;\n this.canvasFactory = canvasFactory;\n this.filterFactory = filterFactory;\n this._pdfBug = pdfBug;\n this.pageColors = pageColors;\n\n this.running = false;\n this.graphicsReadyCallback = null;\n this.graphicsReady = false;\n this._useRequestAnimationFrame =\n useRequestAnimationFrame === true && typeof window !== \"undefined\";\n this.cancelled = false;\n this.capability = new PromiseCapability();\n this.task = new RenderTask(this);\n // caching this-bound methods\n this._cancelBound = this.cancel.bind(this);\n this._continueBound = this._continue.bind(this);\n this._scheduleNextBound = this._scheduleNext.bind(this);\n this._nextBound = this._next.bind(this);\n this._canvas = params.canvasContext.canvas;\n }\n\n get completed() {\n return this.capability.promise.catch(function () {\n // Ignoring errors, since we only want to know when rendering is\n // no longer pending.\n });\n }\n\n initializeGraphics({ transparency = false, optionalContentConfig }) {\n if (this.cancelled) {\n return;\n }\n if (this._canvas) {\n if (InternalRenderTask.#canvasInUse.has(this._canvas)) {\n throw new Error(\n \"Cannot use the same canvas during multiple render() operations. \" +\n \"Use different canvas or ensure previous operations were \" +\n \"cancelled or completed.\"\n );\n }\n InternalRenderTask.#canvasInUse.add(this._canvas);\n }\n\n if (this._pdfBug && globalThis.StepperManager?.enabled) {\n this.stepper = globalThis.StepperManager.create(this._pageIndex);\n this.stepper.init(this.operatorList);\n this.stepper.nextBreakPoint = this.stepper.getNextBreakPoint();\n }\n const { canvasContext, viewport, transform, background } = this.params;\n\n this.gfx = new CanvasGraphics(\n canvasContext,\n this.commonObjs,\n this.objs,\n this.canvasFactory,\n this.filterFactory,\n { optionalContentConfig },\n this.annotationCanvasMap,\n this.pageColors\n );\n this.gfx.beginDrawing({\n transform,\n viewport,\n transparency,\n background,\n });\n this.operatorListIdx = 0;\n this.graphicsReady = true;\n this.graphicsReadyCallback?.();\n }\n\n cancel(error = null, extraDelay = 0) {\n this.running = false;\n this.cancelled = true;\n this.gfx?.endDrawing();\n InternalRenderTask.#canvasInUse.delete(this._canvas);\n\n this.callback(\n error ||\n new RenderingCancelledException(\n `Rendering cancelled, page ${this._pageIndex + 1}`,\n extraDelay\n )\n );\n }\n\n operatorListChanged() {\n if (!this.graphicsReady) {\n this.graphicsReadyCallback ||= this._continueBound;\n return;\n }\n this.stepper?.updateOperatorList(this.operatorList);\n\n if (this.running) {\n return;\n }\n this._continue();\n }\n\n _continue() {\n this.running = true;\n if (this.cancelled) {\n return;\n }\n if (this.task.onContinue) {\n this.task.onContinue(this._scheduleNextBound);\n } else {\n this._scheduleNext();\n }\n }\n\n _scheduleNext() {\n if (this._useRequestAnimationFrame) {\n window.requestAnimationFrame(() => {\n this._nextBound().catch(this._cancelBound);\n });\n } else {\n Promise.resolve().then(this._nextBound).catch(this._cancelBound);\n }\n }\n\n async _next() {\n if (this.cancelled) {\n return;\n }\n this.operatorListIdx = this.gfx.executeOperatorList(\n this.operatorList,\n this.operatorListIdx,\n this._continueBound,\n this.stepper\n );\n if (this.operatorListIdx === this.operatorList.argsArray.length) {\n this.running = false;\n if (this.operatorList.lastChunk) {\n this.gfx.endDrawing();\n InternalRenderTask.#canvasInUse.delete(this._canvas);\n\n this.callback();\n }\n }\n }\n}\n\n/** @type {string} */\nconst version =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_VERSION\") : null;\n/** @type {string} */\nconst build =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_BUILD\") : null;\n\nexport {\n build,\n DefaultCanvasFactory,\n DefaultCMapReaderFactory,\n DefaultFilterFactory,\n DefaultStandardFontDataFactory,\n getDocument,\n LoopbackPort,\n PDFDataRangeTransport,\n PDFDocumentLoadingTask,\n PDFDocumentProxy,\n PDFPageProxy,\n PDFWorker,\n PDFWorkerUtil,\n RenderTask,\n SVGGraphics,\n version,\n};\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { objectFromMap, unreachable } from \"../shared/util.js\";\nimport { AnnotationEditor } from \"./editor/editor.js\";\nimport { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\n\nconst SerializableEmpty = Object.freeze({\n map: null,\n hash: \"\",\n transfers: undefined,\n});\n\n/**\n * Key/value storage for annotation data in forms.\n */\nclass AnnotationStorage {\n #modified = false;\n\n #storage = new Map();\n\n constructor() {\n // Callbacks to signal when the modification state is set or reset.\n // This is used by the viewer to only bind on `beforeunload` if forms\n // are actually edited to prevent doing so unconditionally since that\n // can have undesirable effects.\n this.onSetModified = null;\n this.onResetModified = null;\n this.onAnnotationEditor = null;\n }\n\n /**\n * Get the value for a given key if it exists, or return the default value.\n * @param {string} key\n * @param {Object} defaultValue\n * @returns {Object}\n */\n getValue(key, defaultValue) {\n const value = this.#storage.get(key);\n if (value === undefined) {\n return defaultValue;\n }\n\n return Object.assign(defaultValue, value);\n }\n\n /**\n * Get the value for a given key.\n * @param {string} key\n * @returns {Object}\n */\n getRawValue(key) {\n return this.#storage.get(key);\n }\n\n /**\n * Remove a value from the storage.\n * @param {string} key\n */\n remove(key) {\n this.#storage.delete(key);\n\n if (this.#storage.size === 0) {\n this.resetModified();\n }\n\n if (typeof this.onAnnotationEditor === \"function\") {\n for (const value of this.#storage.values()) {\n if (value instanceof AnnotationEditor) {\n return;\n }\n }\n this.onAnnotationEditor(null);\n }\n }\n\n /**\n * Set the value for a given key\n * @param {string} key\n * @param {Object} value\n */\n setValue(key, value) {\n const obj = this.#storage.get(key);\n let modified = false;\n if (obj !== undefined) {\n for (const [entry, val] of Object.entries(value)) {\n if (obj[entry] !== val) {\n modified = true;\n obj[entry] = val;\n }\n }\n } else {\n modified = true;\n this.#storage.set(key, value);\n }\n if (modified) {\n this.#setModified();\n }\n\n if (\n value instanceof AnnotationEditor &&\n typeof this.onAnnotationEditor === \"function\"\n ) {\n this.onAnnotationEditor(value.constructor._type);\n }\n }\n\n /**\n * Check if the storage contains the given key.\n * @param {string} key\n * @returns {boolean}\n */\n has(key) {\n return this.#storage.has(key);\n }\n\n /**\n * @returns {Object | null}\n */\n getAll() {\n return this.#storage.size > 0 ? objectFromMap(this.#storage) : null;\n }\n\n /**\n * @param {Object} obj\n */\n setAll(obj) {\n for (const [key, val] of Object.entries(obj)) {\n this.setValue(key, val);\n }\n }\n\n get size() {\n return this.#storage.size;\n }\n\n #setModified() {\n if (!this.#modified) {\n this.#modified = true;\n if (typeof this.onSetModified === \"function\") {\n this.onSetModified();\n }\n }\n }\n\n resetModified() {\n if (this.#modified) {\n this.#modified = false;\n if (typeof this.onResetModified === \"function\") {\n this.onResetModified();\n }\n }\n }\n\n /**\n * @returns {PrintAnnotationStorage}\n */\n get print() {\n return new PrintAnnotationStorage(this);\n }\n\n /**\n * PLEASE NOTE: Only intended for usage within the API itself.\n * @ignore\n */\n get serializable() {\n if (this.#storage.size === 0) {\n return SerializableEmpty;\n }\n const map = new Map(),\n hash = new MurmurHash3_64(),\n transfers = [];\n const context = Object.create(null);\n let hasBitmap = false;\n\n for (const [key, val] of this.#storage) {\n const serialized =\n val instanceof AnnotationEditor\n ? val.serialize(/* isForCopying = */ false, context)\n : val;\n if (serialized) {\n map.set(key, serialized);\n\n hash.update(`${key}:${JSON.stringify(serialized)}`);\n hasBitmap ||= !!serialized.bitmap;\n }\n }\n\n if (hasBitmap) {\n // We must transfer the bitmap data separately, since it can be changed\n // during serialization with SVG images.\n for (const value of map.values()) {\n if (value.bitmap) {\n transfers.push(value.bitmap);\n }\n }\n }\n\n return map.size > 0\n ? { map, hash: hash.hexdigest(), transfers }\n : SerializableEmpty;\n }\n}\n\n/**\n * A special `AnnotationStorage` for use during printing, where the serializable\n * data is *frozen* upon initialization, to prevent scripting from modifying its\n * contents. (Necessary since printing is triggered synchronously in browsers.)\n */\nclass PrintAnnotationStorage extends AnnotationStorage {\n #serializable;\n\n constructor(parent) {\n super();\n const { map, hash, transfers } = parent.serializable;\n // Create a *copy* of the data, since Objects are passed by reference in JS.\n const clone = structuredClone(\n map,\n (typeof PDFJSDev === \"undefined\" ||\n PDFJSDev.test(\"SKIP_BABEL || TESTING\")) &&\n transfers\n ? { transfer: transfers }\n : null\n );\n this.#serializable = { map: clone, hash, transfers };\n }\n\n /**\n * @returns {PrintAnnotationStorage}\n */\n // eslint-disable-next-line getter-return\n get print() {\n unreachable(\"Should not call PrintAnnotationStorage.print\");\n }\n\n /**\n * PLEASE NOTE: Only intended for usage within the API itself.\n * @ignore\n */\n get serializable() {\n return this.#serializable;\n }\n}\n\nexport { AnnotationStorage, PrintAnnotationStorage, SerializableEmpty };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./tools.js\").AnnotationEditorUIManager} AnnotationEditorUIManager */\n\nimport { bindEvents, ColorManager } from \"./tools.js\";\nimport { FeatureTest, shadow, unreachable } from \"../../shared/util.js\";\nimport { noContextMenu } from \"../display_utils.js\";\n\n/**\n * @typedef {Object} AnnotationEditorParameters\n * @property {AnnotationEditorUIManager} uiManager - the global manager\n * @property {AnnotationEditorLayer} parent - the layer containing this editor\n * @property {string} id - editor id\n * @property {number} x - x-coordinate\n * @property {number} y - y-coordinate\n */\n\n/**\n * Base class for editors.\n */\nclass AnnotationEditor {\n #altText = \"\";\n\n #altTextDecorative = false;\n\n #altTextButton = null;\n\n #altTextTooltip = null;\n\n #altTextTooltipTimeout = null;\n\n #keepAspectRatio = false;\n\n #resizersDiv = null;\n\n #boundFocusin = this.focusin.bind(this);\n\n #boundFocusout = this.focusout.bind(this);\n\n #hasBeenClicked = false;\n\n #isEditing = false;\n\n #isInEditMode = false;\n\n _initialOptions = Object.create(null);\n\n _uiManager = null;\n\n _focusEventsAllowed = true;\n\n _l10nPromise = null;\n\n #isDraggable = false;\n\n #zIndex = AnnotationEditor._zIndex++;\n\n static _borderLineWidth = -1;\n\n static _colorManager = new ColorManager();\n\n static _zIndex = 1;\n\n // When one of the dimensions of an editor is smaller than this value, the\n // button to edit the alt text is visually moved outside of the editor.\n static SMALL_EDITOR_SIZE = 0;\n\n /**\n * @param {AnnotationEditorParameters} parameters\n */\n constructor(parameters) {\n if (this.constructor === AnnotationEditor) {\n unreachable(\"Cannot initialize AnnotationEditor.\");\n }\n\n this.parent = parameters.parent;\n this.id = parameters.id;\n this.width = this.height = null;\n this.pageIndex = parameters.parent.pageIndex;\n this.name = parameters.name;\n this.div = null;\n this._uiManager = parameters.uiManager;\n this.annotationElementId = null;\n this._willKeepAspectRatio = false;\n this._initialOptions.isCentered = parameters.isCentered;\n this._structTreeParentId = null;\n\n const {\n rotation,\n rawDims: { pageWidth, pageHeight, pageX, pageY },\n } = this.parent.viewport;\n\n this.rotation = rotation;\n this.pageRotation =\n (360 + rotation - this._uiManager.viewParameters.rotation) % 360;\n this.pageDimensions = [pageWidth, pageHeight];\n this.pageTranslation = [pageX, pageY];\n\n const [width, height] = this.parentDimensions;\n this.x = parameters.x / width;\n this.y = parameters.y / height;\n\n this.isAttachedToDOM = false;\n this.deleted = false;\n }\n\n get editorType() {\n return Object.getPrototypeOf(this).constructor._type;\n }\n\n static get _defaultLineColor() {\n return shadow(\n this,\n \"_defaultLineColor\",\n this._colorManager.getHexCode(\"CanvasText\")\n );\n }\n\n static deleteAnnotationElement(editor) {\n const fakeEditor = new FakeEditor({\n id: editor.parent.getNextId(),\n parent: editor.parent,\n uiManager: editor._uiManager,\n });\n fakeEditor.annotationElementId = editor.annotationElementId;\n fakeEditor.deleted = true;\n fakeEditor._uiManager.addToAnnotationStorage(fakeEditor);\n }\n\n /**\n * Initialize the l10n stuff for this type of editor.\n * @param {Object} l10n\n */\n static initialize(l10n, options = null) {\n AnnotationEditor._l10nPromise ||= new Map(\n [\n \"editor_alt_text_button_label\",\n \"editor_alt_text_edit_button_label\",\n \"editor_alt_text_decorative_tooltip\",\n ].map(str => [str, l10n.get(str)])\n );\n if (options?.strings) {\n for (const str of options.strings) {\n AnnotationEditor._l10nPromise.set(str, l10n.get(str));\n }\n }\n if (AnnotationEditor._borderLineWidth !== -1) {\n return;\n }\n const style = getComputedStyle(document.documentElement);\n AnnotationEditor._borderLineWidth =\n parseFloat(style.getPropertyValue(\"--outline-width\")) || 0;\n }\n\n /**\n * Update the default parameters for this type of editor.\n * @param {number} _type\n * @param {*} _value\n */\n static updateDefaultParams(_type, _value) {}\n\n /**\n * Get the default properties to set in the UI for this type of editor.\n * @returns {Array}\n */\n static get defaultPropertiesToUpdate() {\n return [];\n }\n\n /**\n * Check if this kind of editor is able to handle the given mime type for\n * pasting.\n * @param {string} mime\n * @returns {boolean}\n */\n static isHandlingMimeForPasting(mime) {\n return false;\n }\n\n /**\n * Extract the data from the clipboard item and delegate the creation of the\n * editor to the parent.\n * @param {DataTransferItem} item\n * @param {AnnotationEditorLayer} parent\n */\n static paste(item, parent) {\n unreachable(\"Not implemented\");\n }\n\n /**\n * Get the properties to update in the UI for this editor.\n * @returns {Array}\n */\n get propertiesToUpdate() {\n return [];\n }\n\n get _isDraggable() {\n return this.#isDraggable;\n }\n\n set _isDraggable(value) {\n this.#isDraggable = value;\n this.div?.classList.toggle(\"draggable\", value);\n }\n\n center() {\n const [pageWidth, pageHeight] = this.pageDimensions;\n switch (this.parentRotation) {\n case 90:\n this.x -= (this.height * pageHeight) / (pageWidth * 2);\n this.y += (this.width * pageWidth) / (pageHeight * 2);\n break;\n case 180:\n this.x += this.width / 2;\n this.y += this.height / 2;\n break;\n case 270:\n this.x += (this.height * pageHeight) / (pageWidth * 2);\n this.y -= (this.width * pageWidth) / (pageHeight * 2);\n break;\n default:\n this.x -= this.width / 2;\n this.y -= this.height / 2;\n break;\n }\n this.fixAndSetPosition();\n }\n\n /**\n * Add some commands into the CommandManager (undo/redo stuff).\n * @param {Object} params\n */\n addCommands(params) {\n this._uiManager.addCommands(params);\n }\n\n get currentLayer() {\n return this._uiManager.currentLayer;\n }\n\n /**\n * This editor will be behind the others.\n */\n setInBackground() {\n this.div.style.zIndex = 0;\n }\n\n /**\n * This editor will be in the foreground.\n */\n setInForeground() {\n this.div.style.zIndex = this.#zIndex;\n }\n\n setParent(parent) {\n if (parent !== null) {\n this.pageIndex = parent.pageIndex;\n this.pageDimensions = parent.pageDimensions;\n }\n this.parent = parent;\n }\n\n /**\n * onfocus callback.\n */\n focusin(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n if (!this.#hasBeenClicked) {\n this.parent.setSelected(this);\n } else {\n this.#hasBeenClicked = false;\n }\n }\n\n /**\n * onblur callback.\n * @param {FocusEvent} event\n */\n focusout(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n\n if (!this.isAttachedToDOM) {\n return;\n }\n\n // In case of focusout, the relatedTarget is the element which\n // is grabbing the focus.\n // So if the related target is an element under the div for this\n // editor, then the editor isn't unactive.\n const target = event.relatedTarget;\n if (target?.closest(`#${this.id}`)) {\n return;\n }\n\n event.preventDefault();\n\n if (!this.parent?.isMultipleSelection) {\n this.commitOrRemove();\n }\n }\n\n commitOrRemove() {\n if (this.isEmpty()) {\n this.remove();\n } else {\n this.commit();\n }\n }\n\n /**\n * Commit the data contained in this editor.\n */\n commit() {\n this.addToAnnotationStorage();\n }\n\n addToAnnotationStorage() {\n this._uiManager.addToAnnotationStorage(this);\n }\n\n /**\n * Set the editor position within its parent.\n * @param {number} x\n * @param {number} y\n * @param {number} tx - x-translation in screen coordinates.\n * @param {number} ty - y-translation in screen coordinates.\n */\n setAt(x, y, tx, ty) {\n const [width, height] = this.parentDimensions;\n [tx, ty] = this.screenToPageTranslation(tx, ty);\n\n this.x = (x + tx) / width;\n this.y = (y + ty) / height;\n\n this.fixAndSetPosition();\n }\n\n #translate([width, height], x, y) {\n [x, y] = this.screenToPageTranslation(x, y);\n\n this.x += x / width;\n this.y += y / height;\n\n this.fixAndSetPosition();\n }\n\n /**\n * Translate the editor position within its parent.\n * @param {number} x - x-translation in screen coordinates.\n * @param {number} y - y-translation in screen coordinates.\n */\n translate(x, y) {\n this.#translate(this.parentDimensions, x, y);\n }\n\n /**\n * Translate the editor position within its page and adjust the scroll\n * in order to have the editor in the view.\n * @param {number} x - x-translation in page coordinates.\n * @param {number} y - y-translation in page coordinates.\n */\n translateInPage(x, y) {\n this.#translate(this.pageDimensions, x, y);\n this.div.scrollIntoView({ block: \"nearest\" });\n }\n\n drag(tx, ty) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.x += tx / parentWidth;\n this.y += ty / parentHeight;\n if (this.parent && (this.x < 0 || this.x > 1 || this.y < 0 || this.y > 1)) {\n // It's possible to not have a parent: for example, when the user is\n // dragging all the selected editors but this one on a page which has been\n // destroyed.\n // It's why we need to check for it. In such a situation, it isn't really\n // a problem to not find a new parent: it's something which is related to\n // what the user is seeing, hence it depends on how pages are layed out.\n\n // The element will be outside of its parent so change the parent.\n const { x, y } = this.div.getBoundingClientRect();\n if (this.parent.findNewParent(this, x, y)) {\n this.x -= Math.floor(this.x);\n this.y -= Math.floor(this.y);\n }\n }\n\n // The editor can be moved wherever the user wants, so we don't need to fix\n // the position: it'll be done when the user will release the mouse button.\n\n let { x, y } = this;\n const [bx, by] = this.#getBaseTranslation();\n x += bx;\n y += by;\n\n this.div.style.left = `${(100 * x).toFixed(2)}%`;\n this.div.style.top = `${(100 * y).toFixed(2)}%`;\n this.div.scrollIntoView({ block: \"nearest\" });\n }\n\n #getBaseTranslation() {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const { _borderLineWidth } = AnnotationEditor;\n const x = _borderLineWidth / parentWidth;\n const y = _borderLineWidth / parentHeight;\n switch (this.rotation) {\n case 90:\n return [-x, y];\n case 180:\n return [x, y];\n case 270:\n return [x, -y];\n default:\n return [-x, -y];\n }\n }\n\n fixAndSetPosition() {\n const [pageWidth, pageHeight] = this.pageDimensions;\n let { x, y, width, height } = this;\n width *= pageWidth;\n height *= pageHeight;\n x *= pageWidth;\n y *= pageHeight;\n\n switch (this.rotation) {\n case 0:\n x = Math.max(0, Math.min(pageWidth - width, x));\n y = Math.max(0, Math.min(pageHeight - height, y));\n break;\n case 90:\n x = Math.max(0, Math.min(pageWidth - height, x));\n y = Math.min(pageHeight, Math.max(width, y));\n break;\n case 180:\n x = Math.min(pageWidth, Math.max(width, x));\n y = Math.min(pageHeight, Math.max(height, y));\n break;\n case 270:\n x = Math.min(pageWidth, Math.max(height, x));\n y = Math.max(0, Math.min(pageHeight - width, y));\n break;\n }\n\n this.x = x /= pageWidth;\n this.y = y /= pageHeight;\n\n const [bx, by] = this.#getBaseTranslation();\n x += bx;\n y += by;\n\n const { style } = this.div;\n style.left = `${(100 * x).toFixed(2)}%`;\n style.top = `${(100 * y).toFixed(2)}%`;\n\n this.moveInDOM();\n }\n\n static #rotatePoint(x, y, angle) {\n switch (angle) {\n case 90:\n return [y, -x];\n case 180:\n return [-x, -y];\n case 270:\n return [-y, x];\n default:\n return [x, y];\n }\n }\n\n /**\n * Convert a screen translation into a page one.\n * @param {number} x\n * @param {number} y\n */\n screenToPageTranslation(x, y) {\n return AnnotationEditor.#rotatePoint(x, y, this.parentRotation);\n }\n\n /**\n * Convert a page translation into a screen one.\n * @param {number} x\n * @param {number} y\n */\n pageTranslationToScreen(x, y) {\n return AnnotationEditor.#rotatePoint(x, y, 360 - this.parentRotation);\n }\n\n #getRotationMatrix(rotation) {\n switch (rotation) {\n case 90: {\n const [pageWidth, pageHeight] = this.pageDimensions;\n return [0, -pageWidth / pageHeight, pageHeight / pageWidth, 0];\n }\n case 180:\n return [-1, 0, 0, -1];\n case 270: {\n const [pageWidth, pageHeight] = this.pageDimensions;\n return [0, pageWidth / pageHeight, -pageHeight / pageWidth, 0];\n }\n default:\n return [1, 0, 0, 1];\n }\n }\n\n get parentScale() {\n return this._uiManager.viewParameters.realScale;\n }\n\n get parentRotation() {\n return (this._uiManager.viewParameters.rotation + this.pageRotation) % 360;\n }\n\n get parentDimensions() {\n const {\n parentScale,\n pageDimensions: [pageWidth, pageHeight],\n } = this;\n const scaledWidth = pageWidth * parentScale;\n const scaledHeight = pageHeight * parentScale;\n return FeatureTest.isCSSRoundSupported\n ? [Math.round(scaledWidth), Math.round(scaledHeight)]\n : [scaledWidth, scaledHeight];\n }\n\n /**\n * Set the dimensions of this editor.\n * @param {number} width\n * @param {number} height\n */\n setDims(width, height) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.div.style.width = `${((100 * width) / parentWidth).toFixed(2)}%`;\n if (!this.#keepAspectRatio) {\n this.div.style.height = `${((100 * height) / parentHeight).toFixed(2)}%`;\n }\n this.#altTextButton?.classList.toggle(\n \"small\",\n width < AnnotationEditor.SMALL_EDITOR_SIZE ||\n height < AnnotationEditor.SMALL_EDITOR_SIZE\n );\n }\n\n fixDims() {\n const { style } = this.div;\n const { height, width } = style;\n const widthPercent = width.endsWith(\"%\");\n const heightPercent = !this.#keepAspectRatio && height.endsWith(\"%\");\n if (widthPercent && heightPercent) {\n return;\n }\n\n const [parentWidth, parentHeight] = this.parentDimensions;\n if (!widthPercent) {\n style.width = `${((100 * parseFloat(width)) / parentWidth).toFixed(2)}%`;\n }\n if (!this.#keepAspectRatio && !heightPercent) {\n style.height = `${((100 * parseFloat(height)) / parentHeight).toFixed(\n 2\n )}%`;\n }\n }\n\n /**\n * Get the translation used to position this editor when it's created.\n * @returns {Array<number>}\n */\n getInitialTranslation() {\n return [0, 0];\n }\n\n #createResizers() {\n if (this.#resizersDiv) {\n return;\n }\n this.#resizersDiv = document.createElement(\"div\");\n this.#resizersDiv.classList.add(\"resizers\");\n const classes = [\"topLeft\", \"topRight\", \"bottomRight\", \"bottomLeft\"];\n if (!this._willKeepAspectRatio) {\n classes.push(\"topMiddle\", \"middleRight\", \"bottomMiddle\", \"middleLeft\");\n }\n for (const name of classes) {\n const div = document.createElement(\"div\");\n this.#resizersDiv.append(div);\n div.classList.add(\"resizer\", name);\n div.addEventListener(\n \"pointerdown\",\n this.#resizerPointerdown.bind(this, name)\n );\n div.addEventListener(\"contextmenu\", noContextMenu);\n }\n this.div.prepend(this.#resizersDiv);\n }\n\n #resizerPointerdown(name, event) {\n event.preventDefault();\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n return;\n }\n\n const boundResizerPointermove = this.#resizerPointermove.bind(this, name);\n const savedDraggable = this._isDraggable;\n this._isDraggable = false;\n const pointerMoveOptions = { passive: true, capture: true };\n window.addEventListener(\n \"pointermove\",\n boundResizerPointermove,\n pointerMoveOptions\n );\n const savedX = this.x;\n const savedY = this.y;\n const savedWidth = this.width;\n const savedHeight = this.height;\n const savedParentCursor = this.parent.div.style.cursor;\n const savedCursor = this.div.style.cursor;\n this.div.style.cursor = this.parent.div.style.cursor =\n window.getComputedStyle(event.target).cursor;\n\n const pointerUpCallback = () => {\n this._isDraggable = savedDraggable;\n window.removeEventListener(\"pointerup\", pointerUpCallback);\n window.removeEventListener(\"blur\", pointerUpCallback);\n window.removeEventListener(\n \"pointermove\",\n boundResizerPointermove,\n pointerMoveOptions\n );\n this.parent.div.style.cursor = savedParentCursor;\n this.div.style.cursor = savedCursor;\n\n const newX = this.x;\n const newY = this.y;\n const newWidth = this.width;\n const newHeight = this.height;\n if (\n newX === savedX &&\n newY === savedY &&\n newWidth === savedWidth &&\n newHeight === savedHeight\n ) {\n return;\n }\n\n this.addCommands({\n cmd: () => {\n this.width = newWidth;\n this.height = newHeight;\n this.x = newX;\n this.y = newY;\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(parentWidth * newWidth, parentHeight * newHeight);\n this.fixAndSetPosition();\n },\n undo: () => {\n this.width = savedWidth;\n this.height = savedHeight;\n this.x = savedX;\n this.y = savedY;\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(parentWidth * savedWidth, parentHeight * savedHeight);\n this.fixAndSetPosition();\n },\n mustExec: true,\n });\n };\n window.addEventListener(\"pointerup\", pointerUpCallback);\n // If the user switches to another window (with alt+tab), then we end the\n // resize session.\n window.addEventListener(\"blur\", pointerUpCallback);\n }\n\n #resizerPointermove(name, event) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const savedX = this.x;\n const savedY = this.y;\n const savedWidth = this.width;\n const savedHeight = this.height;\n const minWidth = AnnotationEditor.MIN_SIZE / parentWidth;\n const minHeight = AnnotationEditor.MIN_SIZE / parentHeight;\n\n // 10000 because we multiply by 100 and use toFixed(2) in fixAndSetPosition.\n // Without rounding, the positions of the corners other than the top left\n // one can be slightly wrong.\n const round = x => Math.round(x * 10000) / 10000;\n const rotationMatrix = this.#getRotationMatrix(this.rotation);\n const transf = (x, y) => [\n rotationMatrix[0] * x + rotationMatrix[2] * y,\n rotationMatrix[1] * x + rotationMatrix[3] * y,\n ];\n const invRotationMatrix = this.#getRotationMatrix(360 - this.rotation);\n const invTransf = (x, y) => [\n invRotationMatrix[0] * x + invRotationMatrix[2] * y,\n invRotationMatrix[1] * x + invRotationMatrix[3] * y,\n ];\n let getPoint;\n let getOpposite;\n let isDiagonal = false;\n let isHorizontal = false;\n\n switch (name) {\n case \"topLeft\":\n isDiagonal = true;\n getPoint = (w, h) => [0, 0];\n getOpposite = (w, h) => [w, h];\n break;\n case \"topMiddle\":\n getPoint = (w, h) => [w / 2, 0];\n getOpposite = (w, h) => [w / 2, h];\n break;\n case \"topRight\":\n isDiagonal = true;\n getPoint = (w, h) => [w, 0];\n getOpposite = (w, h) => [0, h];\n break;\n case \"middleRight\":\n isHorizontal = true;\n getPoint = (w, h) => [w, h / 2];\n getOpposite = (w, h) => [0, h / 2];\n break;\n case \"bottomRight\":\n isDiagonal = true;\n getPoint = (w, h) => [w, h];\n getOpposite = (w, h) => [0, 0];\n break;\n case \"bottomMiddle\":\n getPoint = (w, h) => [w / 2, h];\n getOpposite = (w, h) => [w / 2, 0];\n break;\n case \"bottomLeft\":\n isDiagonal = true;\n getPoint = (w, h) => [0, h];\n getOpposite = (w, h) => [w, 0];\n break;\n case \"middleLeft\":\n isHorizontal = true;\n getPoint = (w, h) => [0, h / 2];\n getOpposite = (w, h) => [w, h / 2];\n break;\n }\n\n const point = getPoint(savedWidth, savedHeight);\n const oppositePoint = getOpposite(savedWidth, savedHeight);\n let transfOppositePoint = transf(...oppositePoint);\n const oppositeX = round(savedX + transfOppositePoint[0]);\n const oppositeY = round(savedY + transfOppositePoint[1]);\n let ratioX = 1;\n let ratioY = 1;\n\n let [deltaX, deltaY] = this.screenToPageTranslation(\n event.movementX,\n event.movementY\n );\n [deltaX, deltaY] = invTransf(deltaX / parentWidth, deltaY / parentHeight);\n\n if (isDiagonal) {\n const oldDiag = Math.hypot(savedWidth, savedHeight);\n ratioX = ratioY = Math.max(\n Math.min(\n Math.hypot(\n oppositePoint[0] - point[0] - deltaX,\n oppositePoint[1] - point[1] - deltaY\n ) / oldDiag,\n // Avoid the editor to be larger than the page.\n 1 / savedWidth,\n 1 / savedHeight\n ),\n // Avoid the editor to be smaller than the minimum size.\n minWidth / savedWidth,\n minHeight / savedHeight\n );\n } else if (isHorizontal) {\n ratioX =\n Math.max(\n minWidth,\n Math.min(1, Math.abs(oppositePoint[0] - point[0] - deltaX))\n ) / savedWidth;\n } else {\n ratioY =\n Math.max(\n minHeight,\n Math.min(1, Math.abs(oppositePoint[1] - point[1] - deltaY))\n ) / savedHeight;\n }\n\n const newWidth = round(savedWidth * ratioX);\n const newHeight = round(savedHeight * ratioY);\n transfOppositePoint = transf(...getOpposite(newWidth, newHeight));\n const newX = oppositeX - transfOppositePoint[0];\n const newY = oppositeY - transfOppositePoint[1];\n\n this.width = newWidth;\n this.height = newHeight;\n this.x = newX;\n this.y = newY;\n\n this.setDims(parentWidth * newWidth, parentHeight * newHeight);\n this.fixAndSetPosition();\n }\n\n async addAltTextButton() {\n if (this.#altTextButton) {\n return;\n }\n const altText = (this.#altTextButton = document.createElement(\"button\"));\n altText.className = \"altText\";\n const msg = await AnnotationEditor._l10nPromise.get(\n \"editor_alt_text_button_label\"\n );\n altText.textContent = msg;\n altText.setAttribute(\"aria-label\", msg);\n altText.tabIndex = \"0\";\n altText.addEventListener(\"contextmenu\", noContextMenu);\n altText.addEventListener(\"pointerdown\", event => event.stopPropagation());\n altText.addEventListener(\n \"click\",\n event => {\n event.preventDefault();\n this._uiManager.editAltText(this);\n },\n { capture: true }\n );\n altText.addEventListener(\"keydown\", event => {\n if (event.target === altText && event.key === \"Enter\") {\n event.preventDefault();\n this._uiManager.editAltText(this);\n }\n });\n this.#setAltTextButtonState();\n this.div.append(altText);\n if (!AnnotationEditor.SMALL_EDITOR_SIZE) {\n // We take the width of the alt text button and we add 40% to it to be\n // sure to have enough space for it.\n const PERCENT = 40;\n AnnotationEditor.SMALL_EDITOR_SIZE = Math.min(\n 128,\n Math.round(altText.getBoundingClientRect().width * (1 + PERCENT / 100))\n );\n }\n }\n\n async #setAltTextButtonState() {\n const button = this.#altTextButton;\n if (!button) {\n return;\n }\n if (!this.#altText && !this.#altTextDecorative) {\n button.classList.remove(\"done\");\n this.#altTextTooltip?.remove();\n return;\n }\n AnnotationEditor._l10nPromise\n .get(\"editor_alt_text_edit_button_label\")\n .then(msg => {\n button.setAttribute(\"aria-label\", msg);\n });\n\n let tooltip = this.#altTextTooltip;\n if (!tooltip) {\n this.#altTextTooltip = tooltip = document.createElement(\"span\");\n tooltip.className = \"tooltip\";\n tooltip.setAttribute(\"role\", \"tooltip\");\n const id = (tooltip.id = `alt-text-tooltip-${this.id}`);\n button.setAttribute(\"aria-describedby\", id);\n\n const DELAY_TO_SHOW_TOOLTIP = 100;\n button.addEventListener(\"mouseenter\", () => {\n this.#altTextTooltipTimeout = setTimeout(() => {\n this.#altTextTooltipTimeout = null;\n this.#altTextTooltip.classList.add(\"show\");\n this._uiManager._eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n subtype: this.editorType,\n data: {\n action: \"alt_text_tooltip\",\n },\n },\n });\n }, DELAY_TO_SHOW_TOOLTIP);\n });\n button.addEventListener(\"mouseleave\", () => {\n clearTimeout(this.#altTextTooltipTimeout);\n this.#altTextTooltipTimeout = null;\n this.#altTextTooltip?.classList.remove(\"show\");\n });\n }\n button.classList.add(\"done\");\n tooltip.innerText = this.#altTextDecorative\n ? await AnnotationEditor._l10nPromise.get(\n \"editor_alt_text_decorative_tooltip\"\n )\n : this.#altText;\n\n if (!tooltip.parentNode) {\n button.append(tooltip);\n }\n }\n\n getClientDimensions() {\n return this.div.getBoundingClientRect();\n }\n\n get altTextData() {\n return {\n altText: this.#altText,\n decorative: this.#altTextDecorative,\n };\n }\n\n set altTextData({ altText, decorative }) {\n if (this.#altText === altText && this.#altTextDecorative === decorative) {\n return;\n }\n this.#altText = altText;\n this.#altTextDecorative = decorative;\n this.#setAltTextButtonState();\n }\n\n /**\n * Render this editor in a div.\n * @returns {HTMLDivElement}\n */\n render() {\n this.div = document.createElement(\"div\");\n this.div.setAttribute(\"data-editor-rotation\", (360 - this.rotation) % 360);\n this.div.className = this.name;\n this.div.setAttribute(\"id\", this.id);\n this.div.setAttribute(\"tabIndex\", 0);\n\n this.setInForeground();\n\n this.div.addEventListener(\"focusin\", this.#boundFocusin);\n this.div.addEventListener(\"focusout\", this.#boundFocusout);\n\n const [parentWidth, parentHeight] = this.parentDimensions;\n if (this.parentRotation % 180 !== 0) {\n this.div.style.maxWidth = `${((100 * parentHeight) / parentWidth).toFixed(\n 2\n )}%`;\n this.div.style.maxHeight = `${(\n (100 * parentWidth) /\n parentHeight\n ).toFixed(2)}%`;\n }\n\n const [tx, ty] = this.getInitialTranslation();\n this.translate(tx, ty);\n\n bindEvents(this, this.div, [\"pointerdown\"]);\n\n return this.div;\n }\n\n /**\n * Onpointerdown callback.\n * @param {PointerEvent} event\n */\n pointerdown(event) {\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n // Avoid to focus this editor because of a non-left click.\n event.preventDefault();\n return;\n }\n\n this.#hasBeenClicked = true;\n\n this.#setUpDragSession(event);\n }\n\n #setUpDragSession(event) {\n if (!this._isDraggable) {\n return;\n }\n\n const isSelected = this._uiManager.isSelected(this);\n this._uiManager.setUpDragSession();\n\n let pointerMoveOptions, pointerMoveCallback;\n if (isSelected) {\n pointerMoveOptions = { passive: true, capture: true };\n pointerMoveCallback = e => {\n const [tx, ty] = this.screenToPageTranslation(e.movementX, e.movementY);\n this._uiManager.dragSelectedEditors(tx, ty);\n };\n window.addEventListener(\n \"pointermove\",\n pointerMoveCallback,\n pointerMoveOptions\n );\n }\n\n const pointerUpCallback = () => {\n window.removeEventListener(\"pointerup\", pointerUpCallback);\n window.removeEventListener(\"blur\", pointerUpCallback);\n if (isSelected) {\n window.removeEventListener(\n \"pointermove\",\n pointerMoveCallback,\n pointerMoveOptions\n );\n }\n\n this.#hasBeenClicked = false;\n if (!this._uiManager.endDragSession()) {\n const { isMac } = FeatureTest.platform;\n if (\n (event.ctrlKey && !isMac) ||\n event.shiftKey ||\n (event.metaKey && isMac)\n ) {\n this.parent.toggleSelected(this);\n } else {\n this.parent.setSelected(this);\n }\n }\n };\n window.addEventListener(\"pointerup\", pointerUpCallback);\n // If the user is using alt+tab during the dragging session, the pointerup\n // event could be not fired, but a blur event is fired so we can use it in\n // order to interrupt the dragging session.\n window.addEventListener(\"blur\", pointerUpCallback);\n }\n\n moveInDOM() {\n this.parent?.moveEditorInDOM(this);\n }\n\n _setParentAndPosition(parent, x, y) {\n parent.changeParent(this);\n this.x = x;\n this.y = y;\n this.fixAndSetPosition();\n }\n\n /**\n * Convert the current rect into a page one.\n */\n getRect(tx, ty) {\n const scale = this.parentScale;\n const [pageWidth, pageHeight] = this.pageDimensions;\n const [pageX, pageY] = this.pageTranslation;\n const shiftX = tx / scale;\n const shiftY = ty / scale;\n const x = this.x * pageWidth;\n const y = this.y * pageHeight;\n const width = this.width * pageWidth;\n const height = this.height * pageHeight;\n\n switch (this.rotation) {\n case 0:\n return [\n x + shiftX + pageX,\n pageHeight - y - shiftY - height + pageY,\n x + shiftX + width + pageX,\n pageHeight - y - shiftY + pageY,\n ];\n case 90:\n return [\n x + shiftY + pageX,\n pageHeight - y + shiftX + pageY,\n x + shiftY + height + pageX,\n pageHeight - y + shiftX + width + pageY,\n ];\n case 180:\n return [\n x - shiftX - width + pageX,\n pageHeight - y + shiftY + pageY,\n x - shiftX + pageX,\n pageHeight - y + shiftY + height + pageY,\n ];\n case 270:\n return [\n x - shiftY - height + pageX,\n pageHeight - y - shiftX - width + pageY,\n x - shiftY + pageX,\n pageHeight - y - shiftX + pageY,\n ];\n default:\n throw new Error(\"Invalid rotation\");\n }\n }\n\n getRectInCurrentCoords(rect, pageHeight) {\n const [x1, y1, x2, y2] = rect;\n\n const width = x2 - x1;\n const height = y2 - y1;\n\n switch (this.rotation) {\n case 0:\n return [x1, pageHeight - y2, width, height];\n case 90:\n return [x1, pageHeight - y1, height, width];\n case 180:\n return [x2, pageHeight - y1, width, height];\n case 270:\n return [x2, pageHeight - y2, height, width];\n default:\n throw new Error(\"Invalid rotation\");\n }\n }\n\n /**\n * Executed once this editor has been rendered.\n */\n onceAdded() {}\n\n /**\n * Check if the editor contains something.\n * @returns {boolean}\n */\n isEmpty() {\n return false;\n }\n\n /**\n * Enable edit mode.\n */\n enableEditMode() {\n this.#isInEditMode = true;\n }\n\n /**\n * Disable edit mode.\n */\n disableEditMode() {\n this.#isInEditMode = false;\n }\n\n /**\n * Check if the editor is edited.\n * @returns {boolean}\n */\n isInEditMode() {\n return this.#isInEditMode;\n }\n\n /**\n * If it returns true, then this editor handle the keyboard\n * events itself.\n * @returns {boolean}\n */\n shouldGetKeyboardEvents() {\n return false;\n }\n\n /**\n * Check if this editor needs to be rebuilt or not.\n * @returns {boolean}\n */\n needsToBeRebuilt() {\n return this.div && !this.isAttachedToDOM;\n }\n\n /**\n * Rebuild the editor in case it has been removed on undo.\n *\n * To implement in subclasses.\n */\n rebuild() {\n this.div?.addEventListener(\"focusin\", this.#boundFocusin);\n this.div?.addEventListener(\"focusout\", this.#boundFocusout);\n }\n\n /**\n * Serialize the editor.\n * The result of the serialization will be used to construct a\n * new annotation to add to the pdf document.\n *\n * To implement in subclasses.\n * @param {boolean} isForCopying\n * @param {Object} [context]\n */\n serialize(isForCopying = false, context = null) {\n unreachable(\"An editor must be serializable\");\n }\n\n /**\n * Deserialize the editor.\n * The result of the deserialization is a new editor.\n *\n * @param {Object} data\n * @param {AnnotationEditorLayer} parent\n * @param {AnnotationEditorUIManager} uiManager\n * @returns {AnnotationEditor}\n */\n static deserialize(data, parent, uiManager) {\n const editor = new this.prototype.constructor({\n parent,\n id: parent.getNextId(),\n uiManager,\n });\n editor.rotation = data.rotation;\n\n const [pageWidth, pageHeight] = editor.pageDimensions;\n const [x, y, width, height] = editor.getRectInCurrentCoords(\n data.rect,\n pageHeight\n );\n editor.x = x / pageWidth;\n editor.y = y / pageHeight;\n editor.width = width / pageWidth;\n editor.height = height / pageHeight;\n\n return editor;\n }\n\n /**\n * Remove this editor.\n * It's used on ctrl+backspace action.\n */\n remove() {\n this.div.removeEventListener(\"focusin\", this.#boundFocusin);\n this.div.removeEventListener(\"focusout\", this.#boundFocusout);\n\n if (!this.isEmpty()) {\n // The editor is removed but it can be back at some point thanks to\n // undo/redo so we must commit it before.\n this.commit();\n }\n if (this.parent) {\n this.parent.remove(this);\n } else {\n this._uiManager.removeEditor(this);\n }\n\n // The editor is removed so we can remove the alt text button and if it's\n // restored then it's up to the subclass to add it back.\n this.#altTextButton?.remove();\n this.#altTextButton = null;\n this.#altTextTooltip = null;\n }\n\n /**\n * @returns {boolean} true if this editor can be resized.\n */\n get isResizable() {\n return false;\n }\n\n /**\n * Add the resizers to this editor.\n */\n makeResizable() {\n if (this.isResizable) {\n this.#createResizers();\n this.#resizersDiv.classList.remove(\"hidden\");\n }\n }\n\n /**\n * Select this editor.\n */\n select() {\n this.makeResizable();\n this.div?.classList.add(\"selectedEditor\");\n }\n\n /**\n * Unselect this editor.\n */\n unselect() {\n this.#resizersDiv?.classList.add(\"hidden\");\n this.div?.classList.remove(\"selectedEditor\");\n if (this.div?.contains(document.activeElement)) {\n // Don't use this.div.blur() because we don't know where the focus will\n // go.\n this._uiManager.currentLayer.div.focus();\n }\n }\n\n /**\n * Update some parameters which have been changed through the UI.\n * @param {number} type\n * @param {*} value\n */\n updateParams(type, value) {}\n\n /**\n * When the user disables the editing mode some editors can change some of\n * their properties.\n */\n disableEditing() {\n if (this.#altTextButton) {\n this.#altTextButton.hidden = true;\n }\n }\n\n /**\n * When the user enables the editing mode some editors can change some of\n * their properties.\n */\n enableEditing() {\n if (this.#altTextButton) {\n this.#altTextButton.hidden = false;\n }\n }\n\n /**\n * The editor is about to be edited.\n */\n enterInEditMode() {}\n\n /**\n * Get the div which really contains the displayed content.\n */\n get contentDiv() {\n return this.div;\n }\n\n /**\n * If true then the editor is currently edited.\n * @type {boolean}\n */\n get isEditing() {\n return this.#isEditing;\n }\n\n /**\n * When set to true, it means that this editor is currently edited.\n * @param {boolean} value\n */\n set isEditing(value) {\n this.#isEditing = value;\n if (!this.parent) {\n return;\n }\n if (value) {\n this.parent.setSelected(this);\n this.parent.setActiveEditor(this);\n } else {\n this.parent.setActiveEditor(null);\n }\n }\n\n /**\n * Set the aspect ratio to use when resizing.\n * @param {number} width\n * @param {number} height\n */\n setAspectRatio(width, height) {\n this.#keepAspectRatio = true;\n const aspectRatio = width / height;\n const { style } = this.div;\n style.aspectRatio = aspectRatio;\n style.height = \"auto\";\n }\n\n static get MIN_SIZE() {\n return 16;\n }\n}\n\n// This class is used to fake an editor which has been deleted.\nclass FakeEditor extends AnnotationEditor {\n constructor(params) {\n super(params);\n this.annotationElementId = params.annotationElementId;\n this.deleted = true;\n }\n\n serialize() {\n return {\n id: this.annotationElementId,\n deleted: true,\n pageIndex: this.pageIndex,\n };\n }\n}\n\nexport { AnnotationEditor };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./editor.js\").AnnotationEditor} AnnotationEditor */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n AnnotationEditorParamsType,\n AnnotationEditorPrefix,\n AnnotationEditorType,\n FeatureTest,\n getUuid,\n shadow,\n Util,\n warn,\n} from \"../../shared/util.js\";\nimport { getColorValues, getRGB, PixelsPerInch } from \"../display_utils.js\";\n\nfunction bindEvents(obj, element, names) {\n for (const name of names) {\n element.addEventListener(name, obj[name].bind(obj));\n }\n}\n\n/**\n * Convert a number between 0 and 100 into an hex number between 0 and 255.\n * @param {number} opacity\n * @return {string}\n */\nfunction opacityToHex(opacity) {\n return Math.round(Math.min(255, Math.max(1, 255 * opacity)))\n .toString(16)\n .padStart(2, \"0\");\n}\n\n/**\n * Class to create some unique ids for the different editors.\n */\nclass IdManager {\n #id = 0;\n\n /**\n * Get a unique id.\n * @returns {string}\n */\n getId() {\n return `${AnnotationEditorPrefix}${this.#id++}`;\n }\n}\n\n/**\n * Class to manage the images used by the editors.\n * The main idea is to try to minimize the memory used by the images.\n * The images are cached and reused when possible\n * We use a refCounter to know when an image is not used anymore but we need to\n * be able to restore an image after a remove+undo, so we keep a file reference\n * or an url one.\n */\nclass ImageManager {\n #baseId = getUuid();\n\n #id = 0;\n\n #cache = null;\n\n static get _isSVGFittingCanvas() {\n // By default, Firefox doesn't rescale without preserving the aspect ratio\n // when drawing an SVG image on a canvas, see https://bugzilla.mozilla.org/1547776.\n // The \"workaround\" is to append \"svgView(preserveAspectRatio(none))\" to the\n // url, but according to comment #15, it seems that it leads to unexpected\n // behavior in Safari.\n const svg = `data:image/svg+xml;charset=UTF-8,<svg viewBox=\"0 0 1 1\" width=\"1\" height=\"1\" xmlns=\"http://www.w3.org/2000/svg\"><rect width=\"1\" height=\"1\" style=\"fill:red;\"/></svg>`;\n const canvas = new OffscreenCanvas(1, 3);\n const ctx = canvas.getContext(\"2d\");\n const image = new Image();\n image.src = svg;\n const promise = image.decode().then(() => {\n ctx.drawImage(image, 0, 0, 1, 1, 0, 0, 1, 3);\n return new Uint32Array(ctx.getImageData(0, 0, 1, 1).data.buffer)[0] === 0;\n });\n\n return shadow(this, \"_isSVGFittingCanvas\", promise);\n }\n\n async #get(key, rawData) {\n this.#cache ||= new Map();\n let data = this.#cache.get(key);\n if (data === null) {\n // We already tried to load the image but it failed.\n return null;\n }\n if (data?.bitmap) {\n data.refCounter += 1;\n return data;\n }\n try {\n data ||= {\n bitmap: null,\n id: `image_${this.#baseId}_${this.#id++}`,\n refCounter: 0,\n isSvg: false,\n };\n let image;\n if (typeof rawData === \"string\") {\n data.url = rawData;\n\n const response = await fetch(rawData);\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n image = await response.blob();\n } else {\n image = data.file = rawData;\n }\n\n if (image.type === \"image/svg+xml\") {\n // Unfortunately, createImageBitmap doesn't work with SVG images.\n // (see https://bugzilla.mozilla.org/1841972).\n const mustRemoveAspectRatioPromise = ImageManager._isSVGFittingCanvas;\n const fileReader = new FileReader();\n const imageElement = new Image();\n const imagePromise = new Promise((resolve, reject) => {\n imageElement.onload = () => {\n data.bitmap = imageElement;\n data.isSvg = true;\n resolve();\n };\n fileReader.onload = async () => {\n const url = (data.svgUrl = fileReader.result);\n // We need to set the preserveAspectRatio to none in order to let\n // the image fits the canvas when resizing.\n imageElement.src = (await mustRemoveAspectRatioPromise)\n ? `${url}#svgView(preserveAspectRatio(none))`\n : url;\n };\n imageElement.onerror = fileReader.onerror = reject;\n });\n fileReader.readAsDataURL(image);\n await imagePromise;\n } else {\n data.bitmap = await createImageBitmap(image);\n }\n data.refCounter = 1;\n } catch (e) {\n console.error(e);\n data = null;\n }\n this.#cache.set(key, data);\n if (data) {\n this.#cache.set(data.id, data);\n }\n return data;\n }\n\n async getFromFile(file) {\n const { lastModified, name, size, type } = file;\n return this.#get(`${lastModified}_${name}_${size}_${type}`, file);\n }\n\n async getFromUrl(url) {\n return this.#get(url, url);\n }\n\n async getFromId(id) {\n this.#cache ||= new Map();\n const data = this.#cache.get(id);\n if (!data) {\n return null;\n }\n if (data.bitmap) {\n data.refCounter += 1;\n return data;\n }\n\n if (data.file) {\n return this.getFromFile(data.file);\n }\n return this.getFromUrl(data.url);\n }\n\n getSvgUrl(id) {\n const data = this.#cache.get(id);\n if (!data?.isSvg) {\n return null;\n }\n return data.svgUrl;\n }\n\n deleteId(id) {\n this.#cache ||= new Map();\n const data = this.#cache.get(id);\n if (!data) {\n return;\n }\n data.refCounter -= 1;\n if (data.refCounter !== 0) {\n return;\n }\n data.bitmap = null;\n }\n\n // We can use the id only if it belongs this manager.\n // We must take care of having the right manager because we can copy/paste\n // some images from other documents, hence it'd be a pity to use an id from an\n // other manager.\n isValidId(id) {\n return id.startsWith(`image_${this.#baseId}_`);\n }\n}\n\n/**\n * Class to handle undo/redo.\n * Commands are just saved in a buffer.\n * If we hit some memory issues we could likely use a circular buffer.\n * It has to be used as a singleton.\n */\nclass CommandManager {\n #commands = [];\n\n #locked = false;\n\n #maxSize;\n\n #position = -1;\n\n constructor(maxSize = 128) {\n this.#maxSize = maxSize;\n }\n\n /**\n * @typedef {Object} addOptions\n * @property {function} cmd\n * @property {function} undo\n * @property {boolean} mustExec\n * @property {number} type\n * @property {boolean} overwriteIfSameType\n * @property {boolean} keepUndo\n */\n\n /**\n * Add a new couple of commands to be used in case of redo/undo.\n * @param {addOptions} options\n */\n add({\n cmd,\n undo,\n mustExec,\n type = NaN,\n overwriteIfSameType = false,\n keepUndo = false,\n }) {\n if (mustExec) {\n cmd();\n }\n\n if (this.#locked) {\n return;\n }\n\n const save = { cmd, undo, type };\n if (this.#position === -1) {\n if (this.#commands.length > 0) {\n // All the commands have been undone and then a new one is added\n // hence we clear the queue.\n this.#commands.length = 0;\n }\n this.#position = 0;\n this.#commands.push(save);\n return;\n }\n\n if (overwriteIfSameType && this.#commands[this.#position].type === type) {\n // For example when we change a color we don't want to\n // be able to undo all the steps, hence we only want to\n // keep the last undoable action in this sequence of actions.\n if (keepUndo) {\n save.undo = this.#commands[this.#position].undo;\n }\n this.#commands[this.#position] = save;\n return;\n }\n\n const next = this.#position + 1;\n if (next === this.#maxSize) {\n this.#commands.splice(0, 1);\n } else {\n this.#position = next;\n if (next < this.#commands.length) {\n this.#commands.splice(next);\n }\n }\n\n this.#commands.push(save);\n }\n\n /**\n * Undo the last command.\n */\n undo() {\n if (this.#position === -1) {\n // Nothing to undo.\n return;\n }\n\n // Avoid to insert something during the undo execution.\n this.#locked = true;\n this.#commands[this.#position].undo();\n this.#locked = false;\n\n this.#position -= 1;\n }\n\n /**\n * Redo the last command.\n */\n redo() {\n if (this.#position < this.#commands.length - 1) {\n this.#position += 1;\n\n // Avoid to insert something during the redo execution.\n this.#locked = true;\n this.#commands[this.#position].cmd();\n this.#locked = false;\n }\n }\n\n /**\n * Check if there is something to undo.\n * @returns {boolean}\n */\n hasSomethingToUndo() {\n return this.#position !== -1;\n }\n\n /**\n * Check if there is something to redo.\n * @returns {boolean}\n */\n hasSomethingToRedo() {\n return this.#position < this.#commands.length - 1;\n }\n\n destroy() {\n this.#commands = null;\n }\n}\n\n/**\n * Class to handle the different keyboards shortcuts we can have on mac or\n * non-mac OSes.\n */\nclass KeyboardManager {\n /**\n * Create a new keyboard manager class.\n * @param {Array<Array>} callbacks - an array containing an array of shortcuts\n * and a callback to call.\n * A shortcut is a string like `ctrl+c` or `mac+ctrl+c` for mac OS.\n */\n constructor(callbacks) {\n this.buffer = [];\n this.callbacks = new Map();\n this.allKeys = new Set();\n\n const { isMac } = FeatureTest.platform;\n for (const [keys, callback, options = {}] of callbacks) {\n for (const key of keys) {\n const isMacKey = key.startsWith(\"mac+\");\n if (isMac && isMacKey) {\n this.callbacks.set(key.slice(4), { callback, options });\n this.allKeys.add(key.split(\"+\").at(-1));\n } else if (!isMac && !isMacKey) {\n this.callbacks.set(key, { callback, options });\n this.allKeys.add(key.split(\"+\").at(-1));\n }\n }\n }\n }\n\n /**\n * Serialize an event into a string in order to match a\n * potential key for a callback.\n * @param {KeyboardEvent} event\n * @returns {string}\n */\n #serialize(event) {\n if (event.altKey) {\n this.buffer.push(\"alt\");\n }\n if (event.ctrlKey) {\n this.buffer.push(\"ctrl\");\n }\n if (event.metaKey) {\n this.buffer.push(\"meta\");\n }\n if (event.shiftKey) {\n this.buffer.push(\"shift\");\n }\n this.buffer.push(event.key);\n const str = this.buffer.join(\"+\");\n this.buffer.length = 0;\n\n return str;\n }\n\n /**\n * Execute a callback, if any, for a given keyboard event.\n * The self is used as `this` in the callback.\n * @param {Object} self\n * @param {KeyboardEvent} event\n * @returns\n */\n exec(self, event) {\n if (!this.allKeys.has(event.key)) {\n return;\n }\n const info = this.callbacks.get(this.#serialize(event));\n if (!info) {\n return;\n }\n const {\n callback,\n options: { bubbles = false, args = [], checker = null },\n } = info;\n\n if (checker && !checker(self, event)) {\n return;\n }\n callback.bind(self, ...args)();\n\n // For example, ctrl+s in a FreeText must be handled by the viewer, hence\n // the event must bubble.\n if (!bubbles) {\n event.stopPropagation();\n event.preventDefault();\n }\n }\n}\n\nclass ColorManager {\n static _colorsMapping = new Map([\n [\"CanvasText\", [0, 0, 0]],\n [\"Canvas\", [255, 255, 255]],\n ]);\n\n get _colors() {\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"LIB\") &&\n typeof document === \"undefined\"\n ) {\n return shadow(this, \"_colors\", ColorManager._colorsMapping);\n }\n\n const colors = new Map([\n [\"CanvasText\", null],\n [\"Canvas\", null],\n ]);\n getColorValues(colors);\n return shadow(this, \"_colors\", colors);\n }\n\n /**\n * In High Contrast Mode, the color on the screen is not always the\n * real color used in the pdf.\n * For example in some cases white can appear to be black but when saving\n * we want to have white.\n * @param {string} color\n * @returns {Array<number>}\n */\n convert(color) {\n const rgb = getRGB(color);\n if (!window.matchMedia(\"(forced-colors: active)\").matches) {\n return rgb;\n }\n\n for (const [name, RGB] of this._colors) {\n if (RGB.every((x, i) => x === rgb[i])) {\n return ColorManager._colorsMapping.get(name);\n }\n }\n return rgb;\n }\n\n /**\n * An input element must have its color value as a hex string\n * and not as color name.\n * So this function converts a name into an hex string.\n * @param {string} name\n * @returns {string}\n */\n getHexCode(name) {\n const rgb = this._colors.get(name);\n if (!rgb) {\n return name;\n }\n return Util.makeHexColor(...rgb);\n }\n}\n\n/**\n * A pdf has several pages and each of them when it will rendered\n * will have an AnnotationEditorLayer which will contain the some\n * new Annotations associated to an editor in order to modify them.\n *\n * This class is used to manage all the different layers, editors and\n * some action like copy/paste, undo/redo, ...\n */\nclass AnnotationEditorUIManager {\n #activeEditor = null;\n\n #allEditors = new Map();\n\n #allLayers = new Map();\n\n #altTextManager = null;\n\n #annotationStorage = null;\n\n #commandManager = new CommandManager();\n\n #currentPageIndex = 0;\n\n #deletedAnnotationsElementIds = new Set();\n\n #draggingEditors = null;\n\n #editorTypes = null;\n\n #editorsToRescale = new Set();\n\n #filterFactory = null;\n\n #idManager = new IdManager();\n\n #isEnabled = false;\n\n #isWaiting = false;\n\n #lastActiveElement = null;\n\n #mode = AnnotationEditorType.NONE;\n\n #selectedEditors = new Set();\n\n #pageColors = null;\n\n #boundBlur = this.blur.bind(this);\n\n #boundFocus = this.focus.bind(this);\n\n #boundCopy = this.copy.bind(this);\n\n #boundCut = this.cut.bind(this);\n\n #boundPaste = this.paste.bind(this);\n\n #boundKeydown = this.keydown.bind(this);\n\n #boundOnEditingAction = this.onEditingAction.bind(this);\n\n #boundOnPageChanging = this.onPageChanging.bind(this);\n\n #boundOnScaleChanging = this.onScaleChanging.bind(this);\n\n #boundOnRotationChanging = this.onRotationChanging.bind(this);\n\n #previousStates = {\n isEditing: false,\n isEmpty: true,\n hasSomethingToUndo: false,\n hasSomethingToRedo: false,\n hasSelectedEditor: false,\n };\n\n #translation = [0, 0];\n\n #translationTimeoutId = null;\n\n #container = null;\n\n #viewer = null;\n\n static TRANSLATE_SMALL = 1; // page units.\n\n static TRANSLATE_BIG = 10; // page units.\n\n static get _keyboardManager() {\n const proto = AnnotationEditorUIManager.prototype;\n\n const arrowChecker = self => {\n // If the focused element is an input, we don't want to handle the arrow.\n // For example, sliders can be controlled with the arrow keys.\n const { activeElement } = document;\n return (\n activeElement &&\n self.#container.contains(activeElement) &&\n self.hasSomethingToControl()\n );\n };\n\n const small = this.TRANSLATE_SMALL;\n const big = this.TRANSLATE_BIG;\n\n return shadow(\n this,\n \"_keyboardManager\",\n new KeyboardManager([\n [[\"ctrl+a\", \"mac+meta+a\"], proto.selectAll],\n [[\"ctrl+z\", \"mac+meta+z\"], proto.undo],\n [\n // On mac, depending of the OS version, the event.key is either \"z\" or\n // \"Z\" when the user presses \"meta+shift+z\".\n [\n \"ctrl+y\",\n \"ctrl+shift+z\",\n \"mac+meta+shift+z\",\n \"ctrl+shift+Z\",\n \"mac+meta+shift+Z\",\n ],\n proto.redo,\n ],\n [\n [\n \"Backspace\",\n \"alt+Backspace\",\n \"ctrl+Backspace\",\n \"shift+Backspace\",\n \"mac+Backspace\",\n \"mac+alt+Backspace\",\n \"mac+ctrl+Backspace\",\n \"Delete\",\n \"ctrl+Delete\",\n \"shift+Delete\",\n \"mac+Delete\",\n ],\n proto.delete,\n ],\n [[\"Escape\", \"mac+Escape\"], proto.unselectAll],\n [\n [\"ArrowLeft\", \"mac+ArrowLeft\"],\n proto.translateSelectedEditors,\n { args: [-small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n proto.translateSelectedEditors,\n { args: [-big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowRight\", \"mac+ArrowRight\"],\n proto.translateSelectedEditors,\n { args: [small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n proto.translateSelectedEditors,\n { args: [big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowUp\", \"mac+ArrowUp\"],\n proto.translateSelectedEditors,\n { args: [0, -small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"],\n proto.translateSelectedEditors,\n { args: [0, -big], checker: arrowChecker },\n ],\n [\n [\"ArrowDown\", \"mac+ArrowDown\"],\n proto.translateSelectedEditors,\n { args: [0, small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"],\n proto.translateSelectedEditors,\n { args: [0, big], checker: arrowChecker },\n ],\n ])\n );\n }\n\n constructor(\n container,\n viewer,\n altTextManager,\n eventBus,\n pdfDocument,\n pageColors\n ) {\n this.#container = container;\n this.#viewer = viewer;\n this.#altTextManager = altTextManager;\n this._eventBus = eventBus;\n this._eventBus._on(\"editingaction\", this.#boundOnEditingAction);\n this._eventBus._on(\"pagechanging\", this.#boundOnPageChanging);\n this._eventBus._on(\"scalechanging\", this.#boundOnScaleChanging);\n this._eventBus._on(\"rotationchanging\", this.#boundOnRotationChanging);\n this.#annotationStorage = pdfDocument.annotationStorage;\n this.#filterFactory = pdfDocument.filterFactory;\n this.#pageColors = pageColors;\n this.viewParameters = {\n realScale: PixelsPerInch.PDF_TO_CSS_UNITS,\n rotation: 0,\n };\n }\n\n destroy() {\n this.#removeKeyboardManager();\n this.#removeFocusManager();\n this._eventBus._off(\"editingaction\", this.#boundOnEditingAction);\n this._eventBus._off(\"pagechanging\", this.#boundOnPageChanging);\n this._eventBus._off(\"scalechanging\", this.#boundOnScaleChanging);\n this._eventBus._off(\"rotationchanging\", this.#boundOnRotationChanging);\n for (const layer of this.#allLayers.values()) {\n layer.destroy();\n }\n this.#allLayers.clear();\n this.#allEditors.clear();\n this.#editorsToRescale.clear();\n this.#activeEditor = null;\n this.#selectedEditors.clear();\n this.#commandManager.destroy();\n this.#altTextManager.destroy();\n }\n\n get hcmFilter() {\n return shadow(\n this,\n \"hcmFilter\",\n this.#pageColors\n ? this.#filterFactory.addHCMFilter(\n this.#pageColors.foreground,\n this.#pageColors.background\n )\n : \"none\"\n );\n }\n\n get direction() {\n return shadow(\n this,\n \"direction\",\n getComputedStyle(this.#container).direction\n );\n }\n\n editAltText(editor) {\n this.#altTextManager?.editAltText(this, editor);\n }\n\n onPageChanging({ pageNumber }) {\n this.#currentPageIndex = pageNumber - 1;\n }\n\n focusMainContainer() {\n this.#container.focus();\n }\n\n findParent(x, y) {\n for (const layer of this.#allLayers.values()) {\n const {\n x: layerX,\n y: layerY,\n width,\n height,\n } = layer.div.getBoundingClientRect();\n if (\n x >= layerX &&\n x <= layerX + width &&\n y >= layerY &&\n y <= layerY + height\n ) {\n return layer;\n }\n }\n return null;\n }\n\n disableUserSelect(value = false) {\n this.#viewer.classList.toggle(\"noUserSelect\", value);\n }\n\n addShouldRescale(editor) {\n this.#editorsToRescale.add(editor);\n }\n\n removeShouldRescale(editor) {\n this.#editorsToRescale.delete(editor);\n }\n\n onScaleChanging({ scale }) {\n this.commitOrRemove();\n this.viewParameters.realScale = scale * PixelsPerInch.PDF_TO_CSS_UNITS;\n for (const editor of this.#editorsToRescale) {\n editor.onScaleChanging();\n }\n }\n\n onRotationChanging({ pagesRotation }) {\n this.commitOrRemove();\n this.viewParameters.rotation = pagesRotation;\n }\n\n /**\n * Add an editor in the annotation storage.\n * @param {AnnotationEditor} editor\n */\n addToAnnotationStorage(editor) {\n if (\n !editor.isEmpty() &&\n this.#annotationStorage &&\n !this.#annotationStorage.has(editor.id)\n ) {\n this.#annotationStorage.setValue(editor.id, editor);\n }\n }\n\n #addFocusManager() {\n window.addEventListener(\"focus\", this.#boundFocus);\n window.addEventListener(\"blur\", this.#boundBlur);\n }\n\n #removeFocusManager() {\n window.removeEventListener(\"focus\", this.#boundFocus);\n window.removeEventListener(\"blur\", this.#boundBlur);\n }\n\n blur() {\n if (!this.hasSelection) {\n return;\n }\n // When several editors are selected and the window loses focus, we want to\n // keep the last active element in order to be able to focus it again when\n // the window gets the focus back but we don't want to trigger any focus\n // callbacks else only one editor will be selected.\n const { activeElement } = document;\n for (const editor of this.#selectedEditors) {\n if (editor.div.contains(activeElement)) {\n this.#lastActiveElement = [editor, activeElement];\n editor._focusEventsAllowed = false;\n break;\n }\n }\n }\n\n focus() {\n if (!this.#lastActiveElement) {\n return;\n }\n const [lastEditor, lastActiveElement] = this.#lastActiveElement;\n this.#lastActiveElement = null;\n lastActiveElement.addEventListener(\n \"focusin\",\n () => {\n lastEditor._focusEventsAllowed = true;\n },\n { once: true }\n );\n lastActiveElement.focus();\n }\n\n #addKeyboardManager() {\n // The keyboard events are caught at the container level in order to be able\n // to execute some callbacks even if the current page doesn't have focus.\n window.addEventListener(\"keydown\", this.#boundKeydown, { capture: true });\n }\n\n #removeKeyboardManager() {\n window.removeEventListener(\"keydown\", this.#boundKeydown, {\n capture: true,\n });\n }\n\n #addCopyPasteListeners() {\n document.addEventListener(\"copy\", this.#boundCopy);\n document.addEventListener(\"cut\", this.#boundCut);\n document.addEventListener(\"paste\", this.#boundPaste);\n }\n\n #removeCopyPasteListeners() {\n document.removeEventListener(\"copy\", this.#boundCopy);\n document.removeEventListener(\"cut\", this.#boundCut);\n document.removeEventListener(\"paste\", this.#boundPaste);\n }\n\n addEditListeners() {\n this.#addKeyboardManager();\n this.#addCopyPasteListeners();\n }\n\n removeEditListeners() {\n this.#removeKeyboardManager();\n this.#removeCopyPasteListeners();\n }\n\n /**\n * Copy callback.\n * @param {ClipboardEvent} event\n */\n copy(event) {\n event.preventDefault();\n\n // An editor is being edited so just commit it.\n this.#activeEditor?.commitOrRemove();\n\n if (!this.hasSelection) {\n return;\n }\n\n const editors = [];\n for (const editor of this.#selectedEditors) {\n const serialized = editor.serialize(/* isForCopying = */ true);\n if (serialized) {\n editors.push(serialized);\n }\n }\n if (editors.length === 0) {\n return;\n }\n\n event.clipboardData.setData(\"application/pdfjs\", JSON.stringify(editors));\n }\n\n /**\n * Cut callback.\n * @param {ClipboardEvent} event\n */\n cut(event) {\n this.copy(event);\n this.delete();\n }\n\n /**\n * Paste callback.\n * @param {ClipboardEvent} event\n */\n paste(event) {\n event.preventDefault();\n const { clipboardData } = event;\n for (const item of clipboardData.items) {\n for (const editorType of this.#editorTypes) {\n if (editorType.isHandlingMimeForPasting(item.type)) {\n editorType.paste(item, this.currentLayer);\n return;\n }\n }\n }\n\n let data = clipboardData.getData(\"application/pdfjs\");\n if (!data) {\n return;\n }\n\n try {\n data = JSON.parse(data);\n } catch (ex) {\n warn(`paste: \"${ex.message}\".`);\n return;\n }\n\n if (!Array.isArray(data)) {\n return;\n }\n\n this.unselectAll();\n const layer = this.currentLayer;\n\n try {\n const newEditors = [];\n for (const editor of data) {\n const deserializedEditor = layer.deserialize(editor);\n if (!deserializedEditor) {\n return;\n }\n newEditors.push(deserializedEditor);\n }\n\n const cmd = () => {\n for (const editor of newEditors) {\n this.#addEditorToLayer(editor);\n }\n this.#selectEditors(newEditors);\n };\n const undo = () => {\n for (const editor of newEditors) {\n editor.remove();\n }\n };\n this.addCommands({ cmd, undo, mustExec: true });\n } catch (ex) {\n warn(`paste: \"${ex.message}\".`);\n }\n }\n\n /**\n * Keydown callback.\n * @param {KeyboardEvent} event\n */\n keydown(event) {\n if (!this.getActive()?.shouldGetKeyboardEvents()) {\n AnnotationEditorUIManager._keyboardManager.exec(this, event);\n }\n }\n\n /**\n * Execute an action for a given name.\n * For example, the user can click on the \"Undo\" entry in the context menu\n * and it'll trigger the undo action.\n * @param {Object} details\n */\n onEditingAction(details) {\n if ([\"undo\", \"redo\", \"delete\", \"selectAll\"].includes(details.name)) {\n this[details.name]();\n }\n }\n\n /**\n * Update the different possible states of this manager, e.g. is there\n * something to undo, redo, ...\n * @param {Object} details\n */\n #dispatchUpdateStates(details) {\n const hasChanged = Object.entries(details).some(\n ([key, value]) => this.#previousStates[key] !== value\n );\n\n if (hasChanged) {\n this._eventBus.dispatch(\"annotationeditorstateschanged\", {\n source: this,\n details: Object.assign(this.#previousStates, details),\n });\n }\n }\n\n #dispatchUpdateUI(details) {\n this._eventBus.dispatch(\"annotationeditorparamschanged\", {\n source: this,\n details,\n });\n }\n\n /**\n * Set the editing state.\n * It can be useful to temporarily disable it when the user is editing a\n * FreeText annotation.\n * @param {boolean} isEditing\n */\n setEditingState(isEditing) {\n if (isEditing) {\n this.#addFocusManager();\n this.#addKeyboardManager();\n this.#addCopyPasteListeners();\n this.#dispatchUpdateStates({\n isEditing: this.#mode !== AnnotationEditorType.NONE,\n isEmpty: this.#isEmpty(),\n hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n hasSelectedEditor: false,\n });\n } else {\n this.#removeFocusManager();\n this.#removeKeyboardManager();\n this.#removeCopyPasteListeners();\n this.#dispatchUpdateStates({\n isEditing: false,\n });\n this.disableUserSelect(false);\n }\n }\n\n registerEditorTypes(types) {\n if (this.#editorTypes) {\n return;\n }\n this.#editorTypes = types;\n for (const editorType of this.#editorTypes) {\n this.#dispatchUpdateUI(editorType.defaultPropertiesToUpdate);\n }\n }\n\n /**\n * Get an id.\n * @returns {string}\n */\n getId() {\n return this.#idManager.getId();\n }\n\n get currentLayer() {\n return this.#allLayers.get(this.#currentPageIndex);\n }\n\n getLayer(pageIndex) {\n return this.#allLayers.get(pageIndex);\n }\n\n get currentPageIndex() {\n return this.#currentPageIndex;\n }\n\n /**\n * Add a new layer for a page which will contains the editors.\n * @param {AnnotationEditorLayer} layer\n */\n addLayer(layer) {\n this.#allLayers.set(layer.pageIndex, layer);\n if (this.#isEnabled) {\n layer.enable();\n } else {\n layer.disable();\n }\n }\n\n /**\n * Remove a layer.\n * @param {AnnotationEditorLayer} layer\n */\n removeLayer(layer) {\n this.#allLayers.delete(layer.pageIndex);\n }\n\n /**\n * Change the editor mode (None, FreeText, Ink, ...)\n * @param {number} mode\n * @param {string|null} editId\n */\n updateMode(mode, editId = null) {\n if (this.#mode === mode) {\n return;\n }\n this.#mode = mode;\n if (mode === AnnotationEditorType.NONE) {\n this.setEditingState(false);\n this.#disableAll();\n return;\n }\n this.setEditingState(true);\n this.#enableAll();\n this.unselectAll();\n for (const layer of this.#allLayers.values()) {\n layer.updateMode(mode);\n }\n if (!editId) {\n return;\n }\n for (const editor of this.#allEditors.values()) {\n if (editor.annotationElementId === editId) {\n this.setSelected(editor);\n editor.enterInEditMode();\n break;\n }\n }\n }\n\n /**\n * Update the toolbar if it's required to reflect the tool currently used.\n * @param {number} mode\n * @returns {undefined}\n */\n updateToolbar(mode) {\n if (mode === this.#mode) {\n return;\n }\n this._eventBus.dispatch(\"switchannotationeditormode\", {\n source: this,\n mode,\n });\n }\n\n /**\n * Update a parameter in the current editor or globally.\n * @param {number} type\n * @param {*} value\n */\n updateParams(type, value) {\n if (!this.#editorTypes) {\n return;\n }\n if (type === AnnotationEditorParamsType.CREATE) {\n this.currentLayer.addNewEditor(type);\n return;\n }\n\n for (const editor of this.#selectedEditors) {\n editor.updateParams(type, value);\n }\n\n for (const editorType of this.#editorTypes) {\n editorType.updateDefaultParams(type, value);\n }\n }\n\n enableWaiting(mustWait = false) {\n if (this.#isWaiting === mustWait) {\n return;\n }\n this.#isWaiting = mustWait;\n for (const layer of this.#allLayers.values()) {\n if (mustWait) {\n layer.disableClick();\n } else {\n layer.enableClick();\n }\n layer.div.classList.toggle(\"waiting\", mustWait);\n }\n }\n\n /**\n * Enable all the layers.\n */\n #enableAll() {\n if (!this.#isEnabled) {\n this.#isEnabled = true;\n for (const layer of this.#allLayers.values()) {\n layer.enable();\n }\n }\n }\n\n /**\n * Disable all the layers.\n */\n #disableAll() {\n this.unselectAll();\n if (this.#isEnabled) {\n this.#isEnabled = false;\n for (const layer of this.#allLayers.values()) {\n layer.disable();\n }\n }\n }\n\n /**\n * Get all the editors belonging to a given page.\n * @param {number} pageIndex\n * @returns {Array<AnnotationEditor>}\n */\n getEditors(pageIndex) {\n const editors = [];\n for (const editor of this.#allEditors.values()) {\n if (editor.pageIndex === pageIndex) {\n editors.push(editor);\n }\n }\n return editors;\n }\n\n /**\n * Get an editor with the given id.\n * @param {string} id\n * @returns {AnnotationEditor}\n */\n getEditor(id) {\n return this.#allEditors.get(id);\n }\n\n /**\n * Add a new editor.\n * @param {AnnotationEditor} editor\n */\n addEditor(editor) {\n this.#allEditors.set(editor.id, editor);\n }\n\n /**\n * Remove an editor.\n * @param {AnnotationEditor} editor\n */\n removeEditor(editor) {\n this.#allEditors.delete(editor.id);\n this.unselect(editor);\n if (\n !editor.annotationElementId ||\n !this.#deletedAnnotationsElementIds.has(editor.annotationElementId)\n ) {\n this.#annotationStorage?.remove(editor.id);\n }\n }\n\n /**\n * The annotation element with the given id has been deleted.\n * @param {AnnotationEditor} editor\n */\n addDeletedAnnotationElement(editor) {\n this.#deletedAnnotationsElementIds.add(editor.annotationElementId);\n editor.deleted = true;\n }\n\n /**\n * Check if the annotation element with the given id has been deleted.\n * @param {string} annotationElementId\n * @returns {boolean}\n */\n isDeletedAnnotationElement(annotationElementId) {\n return this.#deletedAnnotationsElementIds.has(annotationElementId);\n }\n\n /**\n * The annotation element with the given id have been restored.\n * @param {AnnotationEditor} editor\n */\n removeDeletedAnnotationElement(editor) {\n this.#deletedAnnotationsElementIds.delete(editor.annotationElementId);\n editor.deleted = false;\n }\n\n /**\n * Add an editor to the layer it belongs to or add it to the global map.\n * @param {AnnotationEditor} editor\n */\n #addEditorToLayer(editor) {\n const layer = this.#allLayers.get(editor.pageIndex);\n if (layer) {\n layer.addOrRebuild(editor);\n } else {\n this.addEditor(editor);\n }\n }\n\n /**\n * Set the given editor as the active one.\n * @param {AnnotationEditor} editor\n */\n setActiveEditor(editor) {\n if (this.#activeEditor === editor) {\n return;\n }\n\n this.#activeEditor = editor;\n if (editor) {\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n }\n }\n\n /**\n * Add or remove an editor the current selection.\n * @param {AnnotationEditor} editor\n */\n toggleSelected(editor) {\n if (this.#selectedEditors.has(editor)) {\n this.#selectedEditors.delete(editor);\n editor.unselect();\n this.#dispatchUpdateStates({\n hasSelectedEditor: this.hasSelection,\n });\n return;\n }\n this.#selectedEditors.add(editor);\n editor.select();\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n this.#dispatchUpdateStates({\n hasSelectedEditor: true,\n });\n }\n\n /**\n * Set the last selected editor.\n * @param {AnnotationEditor} editor\n */\n setSelected(editor) {\n for (const ed of this.#selectedEditors) {\n if (ed !== editor) {\n ed.unselect();\n }\n }\n this.#selectedEditors.clear();\n\n this.#selectedEditors.add(editor);\n editor.select();\n this.#dispatchUpdateUI(editor.propertiesToUpdate);\n this.#dispatchUpdateStates({\n hasSelectedEditor: true,\n });\n }\n\n /**\n * Check if the editor is selected.\n * @param {AnnotationEditor} editor\n */\n isSelected(editor) {\n return this.#selectedEditors.has(editor);\n }\n\n /**\n * Unselect an editor.\n * @param {AnnotationEditor} editor\n */\n unselect(editor) {\n editor.unselect();\n this.#selectedEditors.delete(editor);\n this.#dispatchUpdateStates({\n hasSelectedEditor: this.hasSelection,\n });\n }\n\n get hasSelection() {\n return this.#selectedEditors.size !== 0;\n }\n\n /**\n * Undo the last command.\n */\n undo() {\n this.#commandManager.undo();\n this.#dispatchUpdateStates({\n hasSomethingToUndo: this.#commandManager.hasSomethingToUndo(),\n hasSomethingToRedo: true,\n isEmpty: this.#isEmpty(),\n });\n }\n\n /**\n * Redo the last undoed command.\n */\n redo() {\n this.#commandManager.redo();\n this.#dispatchUpdateStates({\n hasSomethingToUndo: true,\n hasSomethingToRedo: this.#commandManager.hasSomethingToRedo(),\n isEmpty: this.#isEmpty(),\n });\n }\n\n /**\n * Add a command to execute (cmd) and another one to undo it.\n * @param {Object} params\n */\n addCommands(params) {\n this.#commandManager.add(params);\n this.#dispatchUpdateStates({\n hasSomethingToUndo: true,\n hasSomethingToRedo: false,\n isEmpty: this.#isEmpty(),\n });\n }\n\n #isEmpty() {\n if (this.#allEditors.size === 0) {\n return true;\n }\n\n if (this.#allEditors.size === 1) {\n for (const editor of this.#allEditors.values()) {\n return editor.isEmpty();\n }\n }\n\n return false;\n }\n\n /**\n * Delete the current editor or all.\n */\n delete() {\n this.commitOrRemove();\n if (!this.hasSelection) {\n return;\n }\n\n const editors = [...this.#selectedEditors];\n const cmd = () => {\n for (const editor of editors) {\n editor.remove();\n }\n };\n const undo = () => {\n for (const editor of editors) {\n this.#addEditorToLayer(editor);\n }\n };\n\n this.addCommands({ cmd, undo, mustExec: true });\n }\n\n commitOrRemove() {\n // An editor is being edited so just commit it.\n this.#activeEditor?.commitOrRemove();\n }\n\n hasSomethingToControl() {\n return this.#activeEditor || this.hasSelection;\n }\n\n /**\n * Select the editors.\n * @param {Array<AnnotationEditor>} editors\n */\n #selectEditors(editors) {\n this.#selectedEditors.clear();\n for (const editor of editors) {\n if (editor.isEmpty()) {\n continue;\n }\n this.#selectedEditors.add(editor);\n editor.select();\n }\n this.#dispatchUpdateStates({ hasSelectedEditor: true });\n }\n\n /**\n * Select all the editors.\n */\n selectAll() {\n for (const editor of this.#selectedEditors) {\n editor.commit();\n }\n this.#selectEditors(this.#allEditors.values());\n }\n\n /**\n * Unselect all the selected editors.\n */\n unselectAll() {\n if (this.#activeEditor) {\n // An editor is being edited so just commit it.\n this.#activeEditor.commitOrRemove();\n return;\n }\n\n if (!this.hasSelection) {\n return;\n }\n for (const editor of this.#selectedEditors) {\n editor.unselect();\n }\n this.#selectedEditors.clear();\n this.#dispatchUpdateStates({\n hasSelectedEditor: false,\n });\n }\n\n translateSelectedEditors(x, y, noCommit = false) {\n if (!noCommit) {\n this.commitOrRemove();\n }\n if (!this.hasSelection) {\n return;\n }\n\n this.#translation[0] += x;\n this.#translation[1] += y;\n const [totalX, totalY] = this.#translation;\n const editors = [...this.#selectedEditors];\n\n // We don't want to have an undo/redo for each translation so we wait a bit\n // before adding the command to the command manager.\n const TIME_TO_WAIT = 1000;\n\n if (this.#translationTimeoutId) {\n clearTimeout(this.#translationTimeoutId);\n }\n\n this.#translationTimeoutId = setTimeout(() => {\n this.#translationTimeoutId = null;\n this.#translation[0] = this.#translation[1] = 0;\n\n this.addCommands({\n cmd: () => {\n for (const editor of editors) {\n if (this.#allEditors.has(editor.id)) {\n editor.translateInPage(totalX, totalY);\n }\n }\n },\n undo: () => {\n for (const editor of editors) {\n if (this.#allEditors.has(editor.id)) {\n editor.translateInPage(-totalX, -totalY);\n }\n }\n },\n mustExec: false,\n });\n }, TIME_TO_WAIT);\n\n for (const editor of editors) {\n editor.translateInPage(x, y);\n }\n }\n\n /**\n * Set up the drag session for moving the selected editors.\n */\n setUpDragSession() {\n // Note: don't use any references to the editor's parent which can be null\n // if the editor belongs to a destroyed page.\n if (!this.hasSelection) {\n return;\n }\n // Avoid to have spurious text selection in the text layer when dragging.\n this.disableUserSelect(true);\n this.#draggingEditors = new Map();\n for (const editor of this.#selectedEditors) {\n this.#draggingEditors.set(editor, {\n savedX: editor.x,\n savedY: editor.y,\n savedPageIndex: editor.pageIndex,\n newX: 0,\n newY: 0,\n newPageIndex: -1,\n });\n }\n }\n\n /**\n * Ends the drag session.\n * @returns {boolean} true if at least one editor has been moved.\n */\n endDragSession() {\n if (!this.#draggingEditors) {\n return false;\n }\n this.disableUserSelect(false);\n const map = this.#draggingEditors;\n this.#draggingEditors = null;\n let mustBeAddedInUndoStack = false;\n\n for (const [{ x, y, pageIndex }, value] of map) {\n value.newX = x;\n value.newY = y;\n value.newPageIndex = pageIndex;\n mustBeAddedInUndoStack ||=\n x !== value.savedX ||\n y !== value.savedY ||\n pageIndex !== value.savedPageIndex;\n }\n\n if (!mustBeAddedInUndoStack) {\n return false;\n }\n\n const move = (editor, x, y, pageIndex) => {\n if (this.#allEditors.has(editor.id)) {\n // The editor can be undone/redone on a page which is not visible (and\n // which potentially has no annotation editor layer), hence we need to\n // use the pageIndex instead of the parent.\n const parent = this.#allLayers.get(pageIndex);\n if (parent) {\n editor._setParentAndPosition(parent, x, y);\n } else {\n editor.pageIndex = pageIndex;\n editor.x = x;\n editor.y = y;\n }\n }\n };\n\n this.addCommands({\n cmd: () => {\n for (const [editor, { newX, newY, newPageIndex }] of map) {\n move(editor, newX, newY, newPageIndex);\n }\n },\n undo: () => {\n for (const [editor, { savedX, savedY, savedPageIndex }] of map) {\n move(editor, savedX, savedY, savedPageIndex);\n }\n },\n mustExec: true,\n });\n\n return true;\n }\n\n /**\n * Drag the set of selected editors.\n * @param {number} tx\n * @param {number} ty\n */\n dragSelectedEditors(tx, ty) {\n if (!this.#draggingEditors) {\n return;\n }\n for (const editor of this.#draggingEditors.keys()) {\n editor.drag(tx, ty);\n }\n }\n\n /**\n * Rebuild the editor (usually on undo/redo actions) on a potentially\n * non-rendered page.\n * @param {AnnotationEditor} editor\n */\n rebuild(editor) {\n if (editor.parent === null) {\n const parent = this.getLayer(editor.pageIndex);\n if (parent) {\n parent.changeParent(editor);\n parent.addOrRebuild(editor);\n } else {\n this.addEditor(editor);\n this.addToAnnotationStorage(editor);\n editor.rebuild();\n }\n } else {\n editor.parent.addOrRebuild(editor);\n }\n }\n\n /**\n * Is the current editor the one passed as argument?\n * @param {AnnotationEditor} editor\n * @returns\n */\n isActive(editor) {\n return this.#activeEditor === editor;\n }\n\n /**\n * Get the current active editor.\n * @returns {AnnotationEditor|null}\n */\n getActive() {\n return this.#activeEditor;\n }\n\n /**\n * Get the current editor mode.\n * @returns {number}\n */\n getMode() {\n return this.#mode;\n }\n\n get imageManager() {\n return shadow(this, \"imageManager\", new ImageManager());\n }\n}\n\nexport {\n AnnotationEditorUIManager,\n bindEvents,\n ColorManager,\n CommandManager,\n KeyboardManager,\n opacityToHex,\n};\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n BaseCanvasFactory,\n BaseCMapReaderFactory,\n BaseFilterFactory,\n BaseStandardFontDataFactory,\n BaseSVGFactory,\n} from \"./base_factory.js\";\nimport {\n BaseException,\n FeatureTest,\n shadow,\n stringToBytes,\n Util,\n warn,\n} from \"../shared/util.js\";\n\nconst SVG_NS = \"http://www.w3.org/2000/svg\";\n\nclass PixelsPerInch {\n static CSS = 96.0;\n\n static PDF = 72.0;\n\n static PDF_TO_CSS_UNITS = this.CSS / this.PDF;\n}\n\n/**\n * FilterFactory aims to create some SVG filters we can use when drawing an\n * image (or whatever) on a canvas.\n * Filters aren't applied with ctx.putImageData because it just overwrites the\n * underlying pixels.\n * With these filters, it's possible for example to apply some transfer maps on\n * an image without the need to apply them on the pixel arrays: the renderer\n * does the magic for us.\n */\nclass DOMFilterFactory extends BaseFilterFactory {\n #_cache;\n\n #_defs;\n\n #docId;\n\n #document;\n\n #hcmFilter;\n\n #hcmKey;\n\n #hcmUrl;\n\n #hcmHighlightFilter;\n\n #hcmHighlightKey;\n\n #hcmHighlightUrl;\n\n #id = 0;\n\n constructor({ docId, ownerDocument = globalThis.document } = {}) {\n super();\n this.#docId = docId;\n this.#document = ownerDocument;\n }\n\n get #cache() {\n return (this.#_cache ||= new Map());\n }\n\n get #defs() {\n if (!this.#_defs) {\n const div = this.#document.createElement(\"div\");\n const { style } = div;\n style.visibility = \"hidden\";\n style.contain = \"strict\";\n style.width = style.height = 0;\n style.position = \"absolute\";\n style.top = style.left = 0;\n style.zIndex = -1;\n\n const svg = this.#document.createElementNS(SVG_NS, \"svg\");\n svg.setAttribute(\"width\", 0);\n svg.setAttribute(\"height\", 0);\n this.#_defs = this.#document.createElementNS(SVG_NS, \"defs\");\n div.append(svg);\n svg.append(this.#_defs);\n this.#document.body.append(div);\n }\n return this.#_defs;\n }\n\n addFilter(maps) {\n if (!maps) {\n return \"none\";\n }\n\n // When a page is zoomed the page is re-drawn but the maps are likely\n // the same.\n let value = this.#cache.get(maps);\n if (value) {\n return value;\n }\n\n let tableR, tableG, tableB, key;\n if (maps.length === 1) {\n const mapR = maps[0];\n const buffer = new Array(256);\n for (let i = 0; i < 256; i++) {\n buffer[i] = mapR[i] / 255;\n }\n key = tableR = tableG = tableB = buffer.join(\",\");\n } else {\n const [mapR, mapG, mapB] = maps;\n const bufferR = new Array(256);\n const bufferG = new Array(256);\n const bufferB = new Array(256);\n for (let i = 0; i < 256; i++) {\n bufferR[i] = mapR[i] / 255;\n bufferG[i] = mapG[i] / 255;\n bufferB[i] = mapB[i] / 255;\n }\n tableR = bufferR.join(\",\");\n tableG = bufferG.join(\",\");\n tableB = bufferB.join(\",\");\n key = `${tableR}${tableG}${tableB}`;\n }\n\n value = this.#cache.get(key);\n if (value) {\n this.#cache.set(maps, value);\n return value;\n }\n\n // We create a SVG filter: feComponentTransferElement\n // https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement\n\n const id = `g_${this.#docId}_transfer_map_${this.#id++}`;\n const url = `url(#${id})`;\n this.#cache.set(maps, url);\n this.#cache.set(key, url);\n\n const filter = this.#createFilter(id);\n this.#addTransferMapConversion(tableR, tableG, tableB, filter);\n\n return url;\n }\n\n addHCMFilter(fgColor, bgColor) {\n const key = `${fgColor}-${bgColor}`;\n if (this.#hcmKey === key) {\n return this.#hcmUrl;\n }\n\n this.#hcmKey = key;\n this.#hcmUrl = \"none\";\n this.#hcmFilter?.remove();\n\n if (!fgColor || !bgColor) {\n return this.#hcmUrl;\n }\n\n const fgRGB = this.#getRGB(fgColor);\n fgColor = Util.makeHexColor(...fgRGB);\n const bgRGB = this.#getRGB(bgColor);\n bgColor = Util.makeHexColor(...bgRGB);\n this.#defs.style.color = \"\";\n\n if (\n (fgColor === \"#000000\" && bgColor === \"#ffffff\") ||\n fgColor === bgColor\n ) {\n return this.#hcmUrl;\n }\n\n // https://developer.mozilla.org/en-US/docs/Web/Accessibility/Understanding_Colors_and_Luminance\n //\n // Relative luminance:\n // https://www.w3.org/TR/WCAG20/#relativeluminancedef\n //\n // We compute the rounded luminance of the default background color.\n // Then for every color in the pdf, if its rounded luminance is the\n // same as the background one then it's replaced by the new\n // background color else by the foreground one.\n const map = new Array(256);\n for (let i = 0; i <= 255; i++) {\n const x = i / 255;\n map[i] = x <= 0.03928 ? x / 12.92 : ((x + 0.055) / 1.055) ** 2.4;\n }\n const table = map.join(\",\");\n\n const id = `g_${this.#docId}_hcm_filter`;\n const filter = (this.#hcmHighlightFilter = this.#createFilter(id));\n this.#addTransferMapConversion(table, table, table, filter);\n this.#addGrayConversion(filter);\n\n const getSteps = (c, n) => {\n const start = fgRGB[c] / 255;\n const end = bgRGB[c] / 255;\n const arr = new Array(n + 1);\n for (let i = 0; i <= n; i++) {\n arr[i] = start + (i / n) * (end - start);\n }\n return arr.join(\",\");\n };\n this.#addTransferMapConversion(\n getSteps(0, 5),\n getSteps(1, 5),\n getSteps(2, 5),\n filter\n );\n\n this.#hcmUrl = `url(#${id})`;\n return this.#hcmUrl;\n }\n\n addHighlightHCMFilter(fgColor, bgColor, newFgColor, newBgColor) {\n const key = `${fgColor}-${bgColor}-${newFgColor}-${newBgColor}`;\n if (this.#hcmHighlightKey === key) {\n return this.#hcmHighlightUrl;\n }\n\n this.#hcmHighlightKey = key;\n this.#hcmHighlightUrl = \"none\";\n this.#hcmHighlightFilter?.remove();\n\n if (!fgColor || !bgColor) {\n return this.#hcmHighlightUrl;\n }\n\n const [fgRGB, bgRGB] = [fgColor, bgColor].map(this.#getRGB.bind(this));\n let fgGray = Math.round(\n 0.2126 * fgRGB[0] + 0.7152 * fgRGB[1] + 0.0722 * fgRGB[2]\n );\n let bgGray = Math.round(\n 0.2126 * bgRGB[0] + 0.7152 * bgRGB[1] + 0.0722 * bgRGB[2]\n );\n let [newFgRGB, newBgRGB] = [newFgColor, newBgColor].map(\n this.#getRGB.bind(this)\n );\n if (bgGray < fgGray) {\n [fgGray, bgGray, newFgRGB, newBgRGB] = [\n bgGray,\n fgGray,\n newBgRGB,\n newFgRGB,\n ];\n }\n this.#defs.style.color = \"\";\n\n // Now we can create the filters to highlight some canvas parts.\n // The colors in the pdf will almost be Canvas and CanvasText, hence we\n // want to filter them to finally get Highlight and HighlightText.\n // Since we're in HCM the background color and the foreground color should\n // be really different when converted to grayscale (if they're not then it\n // means that we've a poor contrast). Once the canvas colors are converted\n // to grayscale we can easily map them on their new colors.\n // The grayscale step is important because if we've something like:\n // fgColor = #FF....\n // bgColor = #FF....\n // then we are enable to map the red component on the new red components\n // which can be different.\n\n const getSteps = (fg, bg, n) => {\n const arr = new Array(256);\n const step = (bgGray - fgGray) / n;\n const newStart = fg / 255;\n const newStep = (bg - fg) / (255 * n);\n let prev = 0;\n for (let i = 0; i <= n; i++) {\n const k = Math.round(fgGray + i * step);\n const value = newStart + i * newStep;\n for (let j = prev; j <= k; j++) {\n arr[j] = value;\n }\n prev = k + 1;\n }\n for (let i = prev; i < 256; i++) {\n arr[i] = arr[prev - 1];\n }\n return arr.join(\",\");\n };\n\n const id = `g_${this.#docId}_hcm_highlight_filter`;\n const filter = (this.#hcmHighlightFilter = this.#createFilter(id));\n\n this.#addGrayConversion(filter);\n this.#addTransferMapConversion(\n getSteps(newFgRGB[0], newBgRGB[0], 5),\n getSteps(newFgRGB[1], newBgRGB[1], 5),\n getSteps(newFgRGB[2], newBgRGB[2], 5),\n filter\n );\n\n this.#hcmHighlightUrl = `url(#${id})`;\n return this.#hcmHighlightUrl;\n }\n\n destroy(keepHCM = false) {\n if (keepHCM && (this.#hcmUrl || this.#hcmHighlightUrl)) {\n return;\n }\n if (this.#_defs) {\n this.#_defs.parentNode.parentNode.remove();\n this.#_defs = null;\n }\n if (this.#_cache) {\n this.#_cache.clear();\n this.#_cache = null;\n }\n this.#id = 0;\n }\n\n #addGrayConversion(filter) {\n const feColorMatrix = this.#document.createElementNS(\n SVG_NS,\n \"feColorMatrix\"\n );\n feColorMatrix.setAttribute(\"type\", \"matrix\");\n feColorMatrix.setAttribute(\n \"values\",\n \"0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0\"\n );\n filter.append(feColorMatrix);\n }\n\n #createFilter(id) {\n const filter = this.#document.createElementNS(SVG_NS, \"filter\");\n filter.setAttribute(\"color-interpolation-filters\", \"sRGB\");\n filter.setAttribute(\"id\", id);\n this.#defs.append(filter);\n\n return filter;\n }\n\n #appendFeFunc(feComponentTransfer, func, table) {\n const feFunc = this.#document.createElementNS(SVG_NS, func);\n feFunc.setAttribute(\"type\", \"discrete\");\n feFunc.setAttribute(\"tableValues\", table);\n feComponentTransfer.append(feFunc);\n }\n\n #addTransferMapConversion(rTable, gTable, bTable, filter) {\n const feComponentTransfer = this.#document.createElementNS(\n SVG_NS,\n \"feComponentTransfer\"\n );\n filter.append(feComponentTransfer);\n this.#appendFeFunc(feComponentTransfer, \"feFuncR\", rTable);\n this.#appendFeFunc(feComponentTransfer, \"feFuncG\", gTable);\n this.#appendFeFunc(feComponentTransfer, \"feFuncB\", bTable);\n }\n\n #getRGB(color) {\n this.#defs.style.color = color;\n return getRGB(getComputedStyle(this.#defs).getPropertyValue(\"color\"));\n }\n}\n\nclass DOMCanvasFactory extends BaseCanvasFactory {\n constructor({ ownerDocument = globalThis.document } = {}) {\n super();\n this._document = ownerDocument;\n }\n\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n const canvas = this._document.createElement(\"canvas\");\n canvas.width = width;\n canvas.height = height;\n return canvas;\n }\n}\n\nasync function fetchData(url, asTypedArray = false) {\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n isValidFetchUrl(url, document.baseURI)\n ) {\n const response = await fetch(url);\n if (!response.ok) {\n throw new Error(response.statusText);\n }\n return asTypedArray\n ? new Uint8Array(await response.arrayBuffer())\n : stringToBytes(await response.text());\n }\n\n // The Fetch API is not supported.\n return new Promise((resolve, reject) => {\n const request = new XMLHttpRequest();\n request.open(\"GET\", url, /* asTypedArray = */ true);\n\n if (asTypedArray) {\n request.responseType = \"arraybuffer\";\n }\n request.onreadystatechange = () => {\n if (request.readyState !== XMLHttpRequest.DONE) {\n return;\n }\n if (request.status === 200 || request.status === 0) {\n let data;\n if (asTypedArray && request.response) {\n data = new Uint8Array(request.response);\n } else if (!asTypedArray && request.responseText) {\n data = stringToBytes(request.responseText);\n }\n if (data) {\n resolve(data);\n return;\n }\n }\n reject(new Error(request.statusText));\n };\n\n request.send(null);\n });\n}\n\nclass DOMCMapReaderFactory extends BaseCMapReaderFactory {\n /**\n * @ignore\n */\n _fetchData(url, compressionType) {\n return fetchData(url, /* asTypedArray = */ this.isCompressed).then(data => {\n return { cMapData: data, compressionType };\n });\n }\n}\n\nclass DOMStandardFontDataFactory extends BaseStandardFontDataFactory {\n /**\n * @ignore\n */\n _fetchData(url) {\n return fetchData(url, /* asTypedArray = */ true);\n }\n}\n\nclass DOMSVGFactory extends BaseSVGFactory {\n /**\n * @ignore\n */\n _createSVG(type) {\n return document.createElementNS(SVG_NS, type);\n }\n}\n\n/**\n * @typedef {Object} PageViewportParameters\n * @property {Array<number>} viewBox - The xMin, yMin, xMax and\n * yMax coordinates.\n * @property {number} scale - The scale of the viewport.\n * @property {number} rotation - The rotation, in degrees, of the viewport.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset. The\n * default value is `0`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset. The\n * default value is `0`.\n * @property {boolean} [dontFlip] - If true, the y-axis will not be flipped.\n * The default value is `false`.\n */\n\n/**\n * @typedef {Object} PageViewportCloneParameters\n * @property {number} [scale] - The scale, overriding the one in the cloned\n * viewport. The default value is `this.scale`.\n * @property {number} [rotation] - The rotation, in degrees, overriding the one\n * in the cloned viewport. The default value is `this.rotation`.\n * @property {number} [offsetX] - The horizontal, i.e. x-axis, offset.\n * The default value is `this.offsetX`.\n * @property {number} [offsetY] - The vertical, i.e. y-axis, offset.\n * The default value is `this.offsetY`.\n * @property {boolean} [dontFlip] - If true, the x-axis will not be flipped.\n * The default value is `false`.\n */\n\n/**\n * PDF page viewport created based on scale, rotation and offset.\n */\nclass PageViewport {\n /**\n * @param {PageViewportParameters}\n */\n constructor({\n viewBox,\n scale,\n rotation,\n offsetX = 0,\n offsetY = 0,\n dontFlip = false,\n }) {\n this.viewBox = viewBox;\n this.scale = scale;\n this.rotation = rotation;\n this.offsetX = offsetX;\n this.offsetY = offsetY;\n\n // creating transform to convert pdf coordinate system to the normal\n // canvas like coordinates taking in account scale and rotation\n const centerX = (viewBox[2] + viewBox[0]) / 2;\n const centerY = (viewBox[3] + viewBox[1]) / 2;\n let rotateA, rotateB, rotateC, rotateD;\n // Normalize the rotation, by clamping it to the [0, 360) range.\n rotation %= 360;\n if (rotation < 0) {\n rotation += 360;\n }\n switch (rotation) {\n case 180:\n rotateA = -1;\n rotateB = 0;\n rotateC = 0;\n rotateD = 1;\n break;\n case 90:\n rotateA = 0;\n rotateB = 1;\n rotateC = 1;\n rotateD = 0;\n break;\n case 270:\n rotateA = 0;\n rotateB = -1;\n rotateC = -1;\n rotateD = 0;\n break;\n case 0:\n rotateA = 1;\n rotateB = 0;\n rotateC = 0;\n rotateD = -1;\n break;\n default:\n throw new Error(\n \"PageViewport: Invalid rotation, must be a multiple of 90 degrees.\"\n );\n }\n\n if (dontFlip) {\n rotateC = -rotateC;\n rotateD = -rotateD;\n }\n\n let offsetCanvasX, offsetCanvasY;\n let width, height;\n if (rotateA === 0) {\n offsetCanvasX = Math.abs(centerY - viewBox[1]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerX - viewBox[0]) * scale + offsetY;\n width = (viewBox[3] - viewBox[1]) * scale;\n height = (viewBox[2] - viewBox[0]) * scale;\n } else {\n offsetCanvasX = Math.abs(centerX - viewBox[0]) * scale + offsetX;\n offsetCanvasY = Math.abs(centerY - viewBox[1]) * scale + offsetY;\n width = (viewBox[2] - viewBox[0]) * scale;\n height = (viewBox[3] - viewBox[1]) * scale;\n }\n // creating transform for the following operations:\n // translate(-centerX, -centerY), rotate and flip vertically,\n // scale, and translate(offsetCanvasX, offsetCanvasY)\n this.transform = [\n rotateA * scale,\n rotateB * scale,\n rotateC * scale,\n rotateD * scale,\n offsetCanvasX - rotateA * scale * centerX - rotateC * scale * centerY,\n offsetCanvasY - rotateB * scale * centerX - rotateD * scale * centerY,\n ];\n\n this.width = width;\n this.height = height;\n }\n\n /**\n * The original, un-scaled, viewport dimensions.\n * @type {Object}\n */\n get rawDims() {\n const { viewBox } = this;\n return shadow(this, \"rawDims\", {\n pageWidth: viewBox[2] - viewBox[0],\n pageHeight: viewBox[3] - viewBox[1],\n pageX: viewBox[0],\n pageY: viewBox[1],\n });\n }\n\n /**\n * Clones viewport, with optional additional properties.\n * @param {PageViewportCloneParameters} [params]\n * @returns {PageViewport} Cloned viewport.\n */\n clone({\n scale = this.scale,\n rotation = this.rotation,\n offsetX = this.offsetX,\n offsetY = this.offsetY,\n dontFlip = false,\n } = {}) {\n return new PageViewport({\n viewBox: this.viewBox.slice(),\n scale,\n rotation,\n offsetX,\n offsetY,\n dontFlip,\n });\n }\n\n /**\n * Converts PDF point to the viewport coordinates. For examples, useful for\n * converting PDF location into canvas pixel coordinates.\n * @param {number} x - The x-coordinate.\n * @param {number} y - The y-coordinate.\n * @returns {Array} Array containing `x`- and `y`-coordinates of the\n * point in the viewport coordinate space.\n * @see {@link convertToPdfPoint}\n * @see {@link convertToViewportRectangle}\n */\n convertToViewportPoint(x, y) {\n return Util.applyTransform([x, y], this.transform);\n }\n\n /**\n * Converts PDF rectangle to the viewport coordinates.\n * @param {Array} rect - The xMin, yMin, xMax and yMax coordinates.\n * @returns {Array} Array containing corresponding coordinates of the\n * rectangle in the viewport coordinate space.\n * @see {@link convertToViewportPoint}\n */\n convertToViewportRectangle(rect) {\n const topLeft = Util.applyTransform([rect[0], rect[1]], this.transform);\n const bottomRight = Util.applyTransform([rect[2], rect[3]], this.transform);\n return [topLeft[0], topLeft[1], bottomRight[0], bottomRight[1]];\n }\n\n /**\n * Converts viewport coordinates to the PDF location. For examples, useful\n * for converting canvas pixel location into PDF one.\n * @param {number} x - The x-coordinate.\n * @param {number} y - The y-coordinate.\n * @returns {Array} Array containing `x`- and `y`-coordinates of the\n * point in the PDF coordinate space.\n * @see {@link convertToViewportPoint}\n */\n convertToPdfPoint(x, y) {\n return Util.applyInverseTransform([x, y], this.transform);\n }\n}\n\nclass RenderingCancelledException extends BaseException {\n constructor(msg, extraDelay = 0) {\n super(msg, \"RenderingCancelledException\");\n this.extraDelay = extraDelay;\n }\n}\n\nfunction isDataScheme(url) {\n const ii = url.length;\n let i = 0;\n while (i < ii && url[i].trim() === \"\") {\n i++;\n }\n return url.substring(i, i + 5).toLowerCase() === \"data:\";\n}\n\nfunction isPdfFile(filename) {\n return typeof filename === \"string\" && /\\.pdf$/i.test(filename);\n}\n\n/**\n * Gets the filename from a given URL.\n * @param {string} url\n * @param {boolean} [onlyStripPath]\n * @returns {string}\n */\nfunction getFilenameFromUrl(url, onlyStripPath = false) {\n if (!onlyStripPath) {\n [url] = url.split(/[#?]/, 1);\n }\n return url.substring(url.lastIndexOf(\"/\") + 1);\n}\n\n/**\n * Returns the filename or guessed filename from the url (see issue 3455).\n * @param {string} url - The original PDF location.\n * @param {string} defaultFilename - The value returned if the filename is\n * unknown, or the protocol is unsupported.\n * @returns {string} Guessed PDF filename.\n */\nfunction getPdfFilenameFromUrl(url, defaultFilename = \"document.pdf\") {\n if (typeof url !== \"string\") {\n return defaultFilename;\n }\n if (isDataScheme(url)) {\n warn('getPdfFilenameFromUrl: ignore \"data:\"-URL for performance reasons.');\n return defaultFilename;\n }\n const reURI = /^(?:(?:[^:]+:)?\\/\\/[^/]+)?([^?#]*)(\\?[^#]*)?(#.*)?$/;\n // SCHEME HOST 1.PATH 2.QUERY 3.REF\n // Pattern to get last matching NAME.pdf\n const reFilename = /[^/?#=]+\\.pdf\\b(?!.*\\.pdf\\b)/i;\n const splitURI = reURI.exec(url);\n let suggestedFilename =\n reFilename.exec(splitURI[1]) ||\n reFilename.exec(splitURI[2]) ||\n reFilename.exec(splitURI[3]);\n if (suggestedFilename) {\n suggestedFilename = suggestedFilename[0];\n if (suggestedFilename.includes(\"%\")) {\n // URL-encoded %2Fpath%2Fto%2Ffile.pdf should be file.pdf\n try {\n suggestedFilename = reFilename.exec(\n decodeURIComponent(suggestedFilename)\n )[0];\n } catch {\n // Possible (extremely rare) errors:\n // URIError \"Malformed URI\", e.g. for \"%AA.pdf\"\n // TypeError \"null has no properties\", e.g. for \"%2F.pdf\"\n }\n }\n }\n return suggestedFilename || defaultFilename;\n}\n\nclass StatTimer {\n started = Object.create(null);\n\n times = [];\n\n time(name) {\n if (name in this.started) {\n warn(`Timer is already running for ${name}`);\n }\n this.started[name] = Date.now();\n }\n\n timeEnd(name) {\n if (!(name in this.started)) {\n warn(`Timer has not been started for ${name}`);\n }\n this.times.push({\n name,\n start: this.started[name],\n end: Date.now(),\n });\n // Remove timer from started so it can be called again.\n delete this.started[name];\n }\n\n toString() {\n // Find the longest name for padding purposes.\n const outBuf = [];\n let longest = 0;\n for (const { name } of this.times) {\n longest = Math.max(name.length, longest);\n }\n for (const { name, start, end } of this.times) {\n outBuf.push(`${name.padEnd(longest)} ${end - start}ms\\n`);\n }\n return outBuf.join(\"\");\n }\n}\n\nfunction isValidFetchUrl(url, baseUrl) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: isValidFetchUrl\");\n }\n try {\n const { protocol } = baseUrl ? new URL(url, baseUrl) : new URL(url);\n // The Fetch API only supports the http/https protocols, and not file/ftp.\n return protocol === \"http:\" || protocol === \"https:\";\n } catch {\n return false; // `new URL()` will throw on incorrect data.\n }\n}\n\n/**\n * Event handler to suppress context menu.\n */\nfunction noContextMenu(e) {\n e.preventDefault();\n}\n\n/**\n * @param {string} src\n * @param {boolean} [removeScriptElement]\n * @returns {Promise<void>}\n */\nfunction loadScript(src, removeScriptElement = false) {\n return new Promise((resolve, reject) => {\n const script = document.createElement(\"script\");\n script.src = src;\n\n script.onload = function (evt) {\n if (removeScriptElement) {\n script.remove();\n }\n resolve(evt);\n };\n script.onerror = function () {\n reject(new Error(`Cannot load script at: ${script.src}`));\n };\n (document.head || document.documentElement).append(script);\n });\n}\n\n// Deprecated API function -- display regardless of the `verbosity` setting.\nfunction deprecated(details) {\n console.log(\"Deprecated API usage: \" + details);\n}\n\nlet pdfDateStringRegex;\n\nclass PDFDateString {\n /**\n * Convert a PDF date string to a JavaScript `Date` object.\n *\n * The PDF date string format is described in section 7.9.4 of the official\n * PDF 32000-1:2008 specification. However, in the PDF 1.7 reference (sixth\n * edition) Adobe describes the same format including a trailing apostrophe.\n * This syntax in incorrect, but Adobe Acrobat creates PDF files that contain\n * them. We ignore all apostrophes as they are not necessary for date parsing.\n *\n * Moreover, Adobe Acrobat doesn't handle changing the date to universal time\n * and doesn't use the user's time zone (effectively ignoring the HH' and mm'\n * parts of the date string).\n *\n * @param {string} input\n * @returns {Date|null}\n */\n static toDateObject(input) {\n if (!input || typeof input !== \"string\") {\n return null;\n }\n\n // Lazily initialize the regular expression.\n pdfDateStringRegex ||= new RegExp(\n \"^D:\" + // Prefix (required)\n \"(\\\\d{4})\" + // Year (required)\n \"(\\\\d{2})?\" + // Month (optional)\n \"(\\\\d{2})?\" + // Day (optional)\n \"(\\\\d{2})?\" + // Hour (optional)\n \"(\\\\d{2})?\" + // Minute (optional)\n \"(\\\\d{2})?\" + // Second (optional)\n \"([Z|+|-])?\" + // Universal time relation (optional)\n \"(\\\\d{2})?\" + // Offset hour (optional)\n \"'?\" + // Splitting apostrophe (optional)\n \"(\\\\d{2})?\" + // Offset minute (optional)\n \"'?\" // Trailing apostrophe (optional)\n );\n\n // Optional fields that don't satisfy the requirements from the regular\n // expression (such as incorrect digit counts or numbers that are out of\n // range) will fall back the defaults from the specification.\n const matches = pdfDateStringRegex.exec(input);\n if (!matches) {\n return null;\n }\n\n // JavaScript's `Date` object expects the month to be between 0 and 11\n // instead of 1 and 12, so we have to correct for that.\n const year = parseInt(matches[1], 10);\n let month = parseInt(matches[2], 10);\n month = month >= 1 && month <= 12 ? month - 1 : 0;\n let day = parseInt(matches[3], 10);\n day = day >= 1 && day <= 31 ? day : 1;\n let hour = parseInt(matches[4], 10);\n hour = hour >= 0 && hour <= 23 ? hour : 0;\n let minute = parseInt(matches[5], 10);\n minute = minute >= 0 && minute <= 59 ? minute : 0;\n let second = parseInt(matches[6], 10);\n second = second >= 0 && second <= 59 ? second : 0;\n const universalTimeRelation = matches[7] || \"Z\";\n let offsetHour = parseInt(matches[8], 10);\n offsetHour = offsetHour >= 0 && offsetHour <= 23 ? offsetHour : 0;\n let offsetMinute = parseInt(matches[9], 10) || 0;\n offsetMinute = offsetMinute >= 0 && offsetMinute <= 59 ? offsetMinute : 0;\n\n // Universal time relation 'Z' means that the local time is equal to the\n // universal time, whereas the relations '+'/'-' indicate that the local\n // time is later respectively earlier than the universal time. Every date\n // is normalized to universal time.\n if (universalTimeRelation === \"-\") {\n hour += offsetHour;\n minute += offsetMinute;\n } else if (universalTimeRelation === \"+\") {\n hour -= offsetHour;\n minute -= offsetMinute;\n }\n\n return new Date(Date.UTC(year, month, day, hour, minute, second));\n }\n}\n\n/**\n * NOTE: This is (mostly) intended to support printing of XFA forms.\n */\nfunction getXfaPageViewport(xfaPage, { scale = 1, rotation = 0 }) {\n const { width, height } = xfaPage.attributes.style;\n const viewBox = [0, 0, parseInt(width), parseInt(height)];\n\n return new PageViewport({\n viewBox,\n scale,\n rotation,\n });\n}\n\nfunction getRGB(color) {\n if (color.startsWith(\"#\")) {\n const colorRGB = parseInt(color.slice(1), 16);\n return [\n (colorRGB & 0xff0000) >> 16,\n (colorRGB & 0x00ff00) >> 8,\n colorRGB & 0x0000ff,\n ];\n }\n\n if (color.startsWith(\"rgb(\")) {\n // getComputedStyle(...).color returns a `rgb(R, G, B)` color.\n return color\n .slice(/* \"rgb(\".length */ 4, -1) // Strip out \"rgb(\" and \")\".\n .split(\",\")\n .map(x => parseInt(x));\n }\n\n if (color.startsWith(\"rgba(\")) {\n return color\n .slice(/* \"rgba(\".length */ 5, -1) // Strip out \"rgba(\" and \")\".\n .split(\",\")\n .map(x => parseInt(x))\n .slice(0, 3);\n }\n\n warn(`Not a valid color format: \"${color}\"`);\n return [0, 0, 0];\n}\n\nfunction getColorValues(colors) {\n const span = document.createElement(\"span\");\n span.style.visibility = \"hidden\";\n document.body.append(span);\n for (const name of colors.keys()) {\n span.style.color = name;\n const computedColor = window.getComputedStyle(span).color;\n colors.set(name, getRGB(computedColor));\n }\n span.remove();\n}\n\nfunction getCurrentTransform(ctx) {\n const { a, b, c, d, e, f } = ctx.getTransform();\n return [a, b, c, d, e, f];\n}\n\nfunction getCurrentTransformInverse(ctx) {\n const { a, b, c, d, e, f } = ctx.getTransform().invertSelf();\n return [a, b, c, d, e, f];\n}\n\n/**\n * @param {HTMLDivElement} div\n * @param {PageViewport} viewport\n * @param {boolean} mustFlip\n * @param {boolean} mustRotate\n */\nfunction setLayerDimensions(\n div,\n viewport,\n mustFlip = false,\n mustRotate = true\n) {\n if (viewport instanceof PageViewport) {\n const { pageWidth, pageHeight } = viewport.rawDims;\n const { style } = div;\n const useRound = FeatureTest.isCSSRoundSupported;\n\n const w = `var(--scale-factor) * ${pageWidth}px`,\n h = `var(--scale-factor) * ${pageHeight}px`;\n const widthStr = useRound ? `round(${w}, 1px)` : `calc(${w})`,\n heightStr = useRound ? `round(${h}, 1px)` : `calc(${h})`;\n\n if (!mustFlip || viewport.rotation % 180 === 0) {\n style.width = widthStr;\n style.height = heightStr;\n } else {\n style.width = heightStr;\n style.height = widthStr;\n }\n }\n\n if (mustRotate) {\n div.setAttribute(\"data-main-rotation\", viewport.rotation);\n }\n}\n\nexport {\n deprecated,\n DOMCanvasFactory,\n DOMCMapReaderFactory,\n DOMFilterFactory,\n DOMStandardFontDataFactory,\n DOMSVGFactory,\n getColorValues,\n getCurrentTransform,\n getCurrentTransformInverse,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getRGB,\n getXfaPageViewport,\n isDataScheme,\n isPdfFile,\n isValidFetchUrl,\n loadScript,\n noContextMenu,\n PageViewport,\n PDFDateString,\n PixelsPerInch,\n RenderingCancelledException,\n setLayerDimensions,\n StatTimer,\n};\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { CMapCompressionType, unreachable } from \"../shared/util.js\";\n\nclass BaseFilterFactory {\n constructor() {\n if (this.constructor === BaseFilterFactory) {\n unreachable(\"Cannot initialize BaseFilterFactory.\");\n }\n }\n\n addFilter(maps) {\n return \"none\";\n }\n\n addHCMFilter(fgColor, bgColor) {\n return \"none\";\n }\n\n addHighlightHCMFilter(fgColor, bgColor, newFgColor, newBgColor) {\n return \"none\";\n }\n\n destroy(keepHCM = false) {}\n}\n\nclass BaseCanvasFactory {\n constructor() {\n if (this.constructor === BaseCanvasFactory) {\n unreachable(\"Cannot initialize BaseCanvasFactory.\");\n }\n }\n\n create(width, height) {\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid canvas size\");\n }\n const canvas = this._createCanvas(width, height);\n return {\n canvas,\n context: canvas.getContext(\"2d\"),\n };\n }\n\n reset(canvasAndContext, width, height) {\n if (!canvasAndContext.canvas) {\n throw new Error(\"Canvas is not specified\");\n }\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid canvas size\");\n }\n canvasAndContext.canvas.width = width;\n canvasAndContext.canvas.height = height;\n }\n\n destroy(canvasAndContext) {\n if (!canvasAndContext.canvas) {\n throw new Error(\"Canvas is not specified\");\n }\n // Zeroing the width and height cause Firefox to release graphics\n // resources immediately, which can greatly reduce memory consumption.\n canvasAndContext.canvas.width = 0;\n canvasAndContext.canvas.height = 0;\n canvasAndContext.canvas = null;\n canvasAndContext.context = null;\n }\n\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n unreachable(\"Abstract method `_createCanvas` called.\");\n }\n}\n\nclass BaseCMapReaderFactory {\n constructor({ baseUrl = null, isCompressed = true }) {\n if (this.constructor === BaseCMapReaderFactory) {\n unreachable(\"Cannot initialize BaseCMapReaderFactory.\");\n }\n this.baseUrl = baseUrl;\n this.isCompressed = isCompressed;\n }\n\n async fetch({ name }) {\n if (!this.baseUrl) {\n throw new Error(\n 'The CMap \"baseUrl\" parameter must be specified, ensure that ' +\n 'the \"cMapUrl\" and \"cMapPacked\" API parameters are provided.'\n );\n }\n if (!name) {\n throw new Error(\"CMap name must be specified.\");\n }\n const url = this.baseUrl + name + (this.isCompressed ? \".bcmap\" : \"\");\n const compressionType = this.isCompressed\n ? CMapCompressionType.BINARY\n : CMapCompressionType.NONE;\n\n return this._fetchData(url, compressionType).catch(reason => {\n throw new Error(\n `Unable to load ${this.isCompressed ? \"binary \" : \"\"}CMap at: ${url}`\n );\n });\n }\n\n /**\n * @ignore\n */\n _fetchData(url, compressionType) {\n unreachable(\"Abstract method `_fetchData` called.\");\n }\n}\n\nclass BaseStandardFontDataFactory {\n constructor({ baseUrl = null }) {\n if (this.constructor === BaseStandardFontDataFactory) {\n unreachable(\"Cannot initialize BaseStandardFontDataFactory.\");\n }\n this.baseUrl = baseUrl;\n }\n\n async fetch({ filename }) {\n if (!this.baseUrl) {\n throw new Error(\n 'The standard font \"baseUrl\" parameter must be specified, ensure that ' +\n 'the \"standardFontDataUrl\" API parameter is provided.'\n );\n }\n if (!filename) {\n throw new Error(\"Font filename must be specified.\");\n }\n const url = `${this.baseUrl}${filename}`;\n\n return this._fetchData(url).catch(reason => {\n throw new Error(`Unable to load font data at: ${url}`);\n });\n }\n\n /**\n * @ignore\n */\n _fetchData(url) {\n unreachable(\"Abstract method `_fetchData` called.\");\n }\n}\n\nclass BaseSVGFactory {\n constructor() {\n if (this.constructor === BaseSVGFactory) {\n unreachable(\"Cannot initialize BaseSVGFactory.\");\n }\n }\n\n create(width, height, skipDimensions = false) {\n if (width <= 0 || height <= 0) {\n throw new Error(\"Invalid SVG dimensions\");\n }\n const svg = this._createSVG(\"svg:svg\");\n svg.setAttribute(\"version\", \"1.1\");\n\n if (!skipDimensions) {\n svg.setAttribute(\"width\", `${width}px`);\n svg.setAttribute(\"height\", `${height}px`);\n }\n\n svg.setAttribute(\"preserveAspectRatio\", \"none\");\n svg.setAttribute(\"viewBox\", `0 0 ${width} ${height}`);\n\n return svg;\n }\n\n createElement(type) {\n if (typeof type !== \"string\") {\n throw new Error(\"Invalid SVG element type\");\n }\n return this._createSVG(type);\n }\n\n /**\n * @ignore\n */\n _createSVG(type) {\n unreachable(\"Abstract method `_createSVG` called.\");\n }\n}\n\nexport {\n BaseCanvasFactory,\n BaseCMapReaderFactory,\n BaseFilterFactory,\n BaseStandardFontDataFactory,\n BaseSVGFactory,\n};\n","/* Copyright 2014 Opera Software ASA\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n *\n *\n * Based on https://code.google.com/p/smhasher/wiki/MurmurHash3.\n * Hashes roughly 100 KB per millisecond on i7 3.4 GHz.\n */\n\nimport { isArrayBuffer } from \"./util.js\";\n\nconst SEED = 0xc3d2e1f0;\n// Workaround for missing math precision in JS.\nconst MASK_HIGH = 0xffff0000;\nconst MASK_LOW = 0xffff;\n\nclass MurmurHash3_64 {\n constructor(seed) {\n this.h1 = seed ? seed & 0xffffffff : SEED;\n this.h2 = seed ? seed & 0xffffffff : SEED;\n }\n\n update(input) {\n let data, length;\n if (typeof input === \"string\") {\n data = new Uint8Array(input.length * 2);\n length = 0;\n for (let i = 0, ii = input.length; i < ii; i++) {\n const code = input.charCodeAt(i);\n if (code <= 0xff) {\n data[length++] = code;\n } else {\n data[length++] = code >>> 8;\n data[length++] = code & 0xff;\n }\n }\n } else if (isArrayBuffer(input)) {\n data = input.slice();\n length = data.byteLength;\n } else {\n throw new Error(\n \"Wrong data format in MurmurHash3_64_update. \" +\n \"Input must be a string or array.\"\n );\n }\n\n const blockCounts = length >> 2;\n const tailLength = length - blockCounts * 4;\n // We don't care about endianness here.\n const dataUint32 = new Uint32Array(data.buffer, 0, blockCounts);\n let k1 = 0,\n k2 = 0;\n let h1 = this.h1,\n h2 = this.h2;\n const C1 = 0xcc9e2d51,\n C2 = 0x1b873593;\n const C1_LOW = C1 & MASK_LOW,\n C2_LOW = C2 & MASK_LOW;\n\n for (let i = 0; i < blockCounts; i++) {\n if (i & 1) {\n k1 = dataUint32[i];\n k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW);\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW);\n h1 ^= k1;\n h1 = (h1 << 13) | (h1 >>> 19);\n h1 = h1 * 5 + 0xe6546b64;\n } else {\n k2 = dataUint32[i];\n k2 = ((k2 * C1) & MASK_HIGH) | ((k2 * C1_LOW) & MASK_LOW);\n k2 = (k2 << 15) | (k2 >>> 17);\n k2 = ((k2 * C2) & MASK_HIGH) | ((k2 * C2_LOW) & MASK_LOW);\n h2 ^= k2;\n h2 = (h2 << 13) | (h2 >>> 19);\n h2 = h2 * 5 + 0xe6546b64;\n }\n }\n\n k1 = 0;\n\n switch (tailLength) {\n case 3:\n k1 ^= data[blockCounts * 4 + 2] << 16;\n /* falls through */\n case 2:\n k1 ^= data[blockCounts * 4 + 1] << 8;\n /* falls through */\n case 1:\n k1 ^= data[blockCounts * 4];\n /* falls through */\n\n k1 = ((k1 * C1) & MASK_HIGH) | ((k1 * C1_LOW) & MASK_LOW);\n k1 = (k1 << 15) | (k1 >>> 17);\n k1 = ((k1 * C2) & MASK_HIGH) | ((k1 * C2_LOW) & MASK_LOW);\n if (blockCounts & 1) {\n h1 ^= k1;\n } else {\n h2 ^= k1;\n }\n }\n\n this.h1 = h1;\n this.h2 = h2;\n }\n\n hexdigest() {\n let h1 = this.h1,\n h2 = this.h2;\n\n h1 ^= h2 >>> 1;\n h1 = ((h1 * 0xed558ccd) & MASK_HIGH) | ((h1 * 0x8ccd) & MASK_LOW);\n h2 =\n ((h2 * 0xff51afd7) & MASK_HIGH) |\n (((((h2 << 16) | (h1 >>> 16)) * 0xafd7ed55) & MASK_HIGH) >>> 16);\n h1 ^= h2 >>> 1;\n h1 = ((h1 * 0x1a85ec53) & MASK_HIGH) | ((h1 * 0xec53) & MASK_LOW);\n h2 =\n ((h2 * 0xc4ceb9fe) & MASK_HIGH) |\n (((((h2 << 16) | (h1 >>> 16)) * 0xb9fe1a85) & MASK_HIGH) >>> 16);\n h1 ^= h2 >>> 1;\n\n return (\n (h1 >>> 0).toString(16).padStart(8, \"0\") +\n (h2 >>> 0).toString(16).padStart(8, \"0\")\n );\n }\n}\n\nexport { MurmurHash3_64 };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n assert,\n bytesToString,\n FeatureTest,\n isNodeJS,\n shadow,\n string32,\n unreachable,\n warn,\n} from \"../shared/util.js\";\n\nclass FontLoader {\n #systemFonts = new Set();\n\n constructor({\n ownerDocument = globalThis.document,\n styleElement = null, // For testing only.\n }) {\n this._document = ownerDocument;\n\n this.nativeFontFaces = new Set();\n this.styleElement =\n typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")\n ? styleElement\n : null;\n\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"MOZCENTRAL\")) {\n this.loadingRequests = [];\n this.loadTestFontId = 0;\n }\n }\n\n addNativeFontFace(nativeFontFace) {\n this.nativeFontFaces.add(nativeFontFace);\n this._document.fonts.add(nativeFontFace);\n }\n\n removeNativeFontFace(nativeFontFace) {\n this.nativeFontFaces.delete(nativeFontFace);\n this._document.fonts.delete(nativeFontFace);\n }\n\n insertRule(rule) {\n if (!this.styleElement) {\n this.styleElement = this._document.createElement(\"style\");\n this._document.documentElement\n .getElementsByTagName(\"head\")[0]\n .append(this.styleElement);\n }\n const styleSheet = this.styleElement.sheet;\n styleSheet.insertRule(rule, styleSheet.cssRules.length);\n }\n\n clear() {\n for (const nativeFontFace of this.nativeFontFaces) {\n this._document.fonts.delete(nativeFontFace);\n }\n this.nativeFontFaces.clear();\n this.#systemFonts.clear();\n\n if (this.styleElement) {\n // Note: ChildNode.remove doesn't throw if the parentNode is undefined.\n this.styleElement.remove();\n this.styleElement = null;\n }\n }\n\n async loadSystemFont(info) {\n if (!info || this.#systemFonts.has(info.loadedName)) {\n return;\n }\n assert(\n !this.disableFontFace,\n \"loadSystemFont shouldn't be called when `disableFontFace` is set.\"\n );\n\n if (this.isFontLoadingAPISupported) {\n const { loadedName, src, style } = info;\n const fontFace = new FontFace(loadedName, src, style);\n this.addNativeFontFace(fontFace);\n try {\n await fontFace.load();\n this.#systemFonts.add(loadedName);\n } catch {\n warn(\n `Cannot load system font: ${info.baseFontName}, installing it could help to improve PDF rendering.`\n );\n\n this.removeNativeFontFace(fontFace);\n }\n return;\n }\n\n unreachable(\n \"Not implemented: loadSystemFont without the Font Loading API.\"\n );\n }\n\n async bind(font) {\n // Add the font to the DOM only once; skip if the font is already loaded.\n if (font.attached || (font.missingFile && !font.systemFontInfo)) {\n return;\n }\n font.attached = true;\n\n if (font.systemFontInfo) {\n await this.loadSystemFont(font.systemFontInfo);\n return;\n }\n\n if (this.isFontLoadingAPISupported) {\n const nativeFontFace = font.createNativeFontFace();\n if (nativeFontFace) {\n this.addNativeFontFace(nativeFontFace);\n try {\n await nativeFontFace.loaded;\n } catch (ex) {\n warn(`Failed to load font '${nativeFontFace.family}': '${ex}'.`);\n\n // When font loading failed, fall back to the built-in font renderer.\n font.disableFontFace = true;\n throw ex;\n }\n }\n return; // The font was, asynchronously, loaded.\n }\n\n // !this.isFontLoadingAPISupported\n const rule = font.createFontFaceRule();\n if (rule) {\n this.insertRule(rule);\n\n if (this.isSyncFontLoadingSupported) {\n return; // The font was, synchronously, loaded.\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: async font loading\");\n }\n await new Promise(resolve => {\n const request = this._queueLoadingCallback(resolve);\n this._prepareFontLoadEvent(font, request);\n });\n // The font was, asynchronously, loaded.\n }\n }\n\n get isFontLoadingAPISupported() {\n const hasFonts = !!this._document?.fonts;\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n return shadow(\n this,\n \"isFontLoadingAPISupported\",\n hasFonts && !this.styleElement\n );\n }\n return shadow(this, \"isFontLoadingAPISupported\", hasFonts);\n }\n\n get isSyncFontLoadingSupported() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n return shadow(this, \"isSyncFontLoadingSupported\", true);\n }\n\n let supported = false;\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"CHROME\")) {\n if (isNodeJS) {\n // Node.js - we can pretend that sync font loading is supported.\n supported = true;\n } else if (\n typeof navigator !== \"undefined\" &&\n // User agent string sniffing is bad, but there is no reliable way to\n // tell if the font is fully loaded and ready to be used with canvas.\n /Mozilla\\/5.0.*?rv:\\d+.*? Gecko/.test(navigator.userAgent)\n ) {\n // Firefox, from version 14, supports synchronous font loading.\n supported = true;\n }\n }\n return shadow(this, \"isSyncFontLoadingSupported\", supported);\n }\n\n _queueLoadingCallback(callback) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _queueLoadingCallback\");\n }\n\n function completeRequest() {\n assert(!request.done, \"completeRequest() cannot be called twice.\");\n request.done = true;\n\n // Sending all completed requests in order of how they were queued.\n while (loadingRequests.length > 0 && loadingRequests[0].done) {\n const otherRequest = loadingRequests.shift();\n setTimeout(otherRequest.callback, 0);\n }\n }\n\n const { loadingRequests } = this;\n const request = {\n done: false,\n complete: completeRequest,\n callback,\n };\n loadingRequests.push(request);\n return request;\n }\n\n get _loadTestFont() {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _loadTestFont\");\n }\n\n // This is a CFF font with 1 glyph for '.' that fills its entire width\n // and height.\n const testFont = atob(\n \"T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQA\" +\n \"FQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAA\" +\n \"ALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgA\" +\n \"AAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1\" +\n \"AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD\" +\n \"6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACM\" +\n \"AooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4D\" +\n \"IP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAA\" +\n \"AAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUA\" +\n \"AQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgAB\" +\n \"AAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABY\" +\n \"AAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAA\" +\n \"AC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA\" +\n \"AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAA\" +\n \"AAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQAC\" +\n \"AQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3\" +\n \"Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTj\" +\n \"FQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==\"\n );\n return shadow(this, \"_loadTestFont\", testFont);\n }\n\n _prepareFontLoadEvent(font, request) {\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\"Not implemented: _prepareFontLoadEvent\");\n }\n\n /** Hack begin */\n // There's currently no event when a font has finished downloading so the\n // following code is a dirty hack to 'guess' when a font is ready.\n // It's assumed fonts are loaded in order, so add a known test font after\n // the desired fonts and then test for the loading of that test font.\n\n function int32(data, offset) {\n return (\n (data.charCodeAt(offset) << 24) |\n (data.charCodeAt(offset + 1) << 16) |\n (data.charCodeAt(offset + 2) << 8) |\n (data.charCodeAt(offset + 3) & 0xff)\n );\n }\n function spliceString(s, offset, remove, insert) {\n const chunk1 = s.substring(0, offset);\n const chunk2 = s.substring(offset + remove);\n return chunk1 + insert + chunk2;\n }\n let i, ii;\n\n // The temporary canvas is used to determine if fonts are loaded.\n const canvas = this._document.createElement(\"canvas\");\n canvas.width = 1;\n canvas.height = 1;\n const ctx = canvas.getContext(\"2d\");\n\n let called = 0;\n function isFontReady(name, callback) {\n // With setTimeout clamping this gives the font ~100ms to load.\n if (++called > 30) {\n warn(\"Load test font never loaded.\");\n callback();\n return;\n }\n ctx.font = \"30px \" + name;\n ctx.fillText(\".\", 0, 20);\n const imageData = ctx.getImageData(0, 0, 1, 1);\n if (imageData.data[3] > 0) {\n callback();\n return;\n }\n setTimeout(isFontReady.bind(null, name, callback));\n }\n\n const loadTestFontId = `lt${Date.now()}${this.loadTestFontId++}`;\n // Chromium seems to cache fonts based on a hash of the actual font data,\n // so the font must be modified for each load test else it will appear to\n // be loaded already.\n // TODO: This could maybe be made faster by avoiding the btoa of the full\n // font by splitting it in chunks before hand and padding the font id.\n let data = this._loadTestFont;\n const COMMENT_OFFSET = 976; // has to be on 4 byte boundary (for checksum)\n data = spliceString(\n data,\n COMMENT_OFFSET,\n loadTestFontId.length,\n loadTestFontId\n );\n // CFF checksum is important for IE, adjusting it\n const CFF_CHECKSUM_OFFSET = 16;\n const XXXX_VALUE = 0x58585858; // the \"comment\" filled with 'X'\n let checksum = int32(data, CFF_CHECKSUM_OFFSET);\n for (i = 0, ii = loadTestFontId.length - 3; i < ii; i += 4) {\n checksum = (checksum - XXXX_VALUE + int32(loadTestFontId, i)) | 0;\n }\n if (i < loadTestFontId.length) {\n // align to 4 bytes boundary\n checksum = (checksum - XXXX_VALUE + int32(loadTestFontId + \"XXX\", i)) | 0;\n }\n data = spliceString(data, CFF_CHECKSUM_OFFSET, 4, string32(checksum));\n\n const url = `url(data:font/opentype;base64,${btoa(data)});`;\n const rule = `@font-face {font-family:\"${loadTestFontId}\";src:${url}}`;\n this.insertRule(rule);\n\n const div = this._document.createElement(\"div\");\n div.style.visibility = \"hidden\";\n div.style.width = div.style.height = \"10px\";\n div.style.position = \"absolute\";\n div.style.top = div.style.left = \"0px\";\n\n for (const name of [font.loadedName, loadTestFontId]) {\n const span = this._document.createElement(\"span\");\n span.textContent = \"Hi\";\n span.style.fontFamily = name;\n div.append(span);\n }\n this._document.body.append(div);\n\n isFontReady(loadTestFontId, () => {\n div.remove();\n request.complete();\n });\n /** Hack end */\n }\n}\n\nclass FontFaceObject {\n constructor(\n translatedData,\n {\n isEvalSupported = true,\n disableFontFace = false,\n ignoreErrors = false,\n inspectFont = null,\n }\n ) {\n this.compiledGlyphs = Object.create(null);\n // importing translated data\n for (const i in translatedData) {\n this[i] = translatedData[i];\n }\n this.isEvalSupported = isEvalSupported !== false;\n this.disableFontFace = disableFontFace === true;\n this.ignoreErrors = ignoreErrors === true;\n this._inspectFont = inspectFont;\n }\n\n createNativeFontFace() {\n if (!this.data || this.disableFontFace) {\n return null;\n }\n let nativeFontFace;\n if (!this.cssFontInfo) {\n nativeFontFace = new FontFace(this.loadedName, this.data, {});\n } else {\n const css = {\n weight: this.cssFontInfo.fontWeight,\n };\n if (this.cssFontInfo.italicAngle) {\n css.style = `oblique ${this.cssFontInfo.italicAngle}deg`;\n }\n nativeFontFace = new FontFace(\n this.cssFontInfo.fontFamily,\n this.data,\n css\n );\n }\n\n this._inspectFont?.(this);\n return nativeFontFace;\n }\n\n createFontFaceRule() {\n if (!this.data || this.disableFontFace) {\n return null;\n }\n const data = bytesToString(this.data);\n // Add the @font-face rule to the document.\n const url = `url(data:${this.mimetype};base64,${btoa(data)});`;\n let rule;\n if (!this.cssFontInfo) {\n rule = `@font-face {font-family:\"${this.loadedName}\";src:${url}}`;\n } else {\n let css = `font-weight: ${this.cssFontInfo.fontWeight};`;\n if (this.cssFontInfo.italicAngle) {\n css += `font-style: oblique ${this.cssFontInfo.italicAngle}deg;`;\n }\n rule = `@font-face {font-family:\"${this.cssFontInfo.fontFamily}\";${css}src:${url}}`;\n }\n\n this._inspectFont?.(this, url);\n return rule;\n }\n\n getPathGenerator(objs, character) {\n if (this.compiledGlyphs[character] !== undefined) {\n return this.compiledGlyphs[character];\n }\n\n let cmds;\n try {\n cmds = objs.get(this.loadedName + \"_path_\" + character);\n } catch (ex) {\n if (!this.ignoreErrors) {\n throw ex;\n }\n warn(`getPathGenerator - ignoring character: \"${ex}\".`);\n\n return (this.compiledGlyphs[character] = function (c, size) {\n // No-op function, to allow rendering to continue.\n });\n }\n\n // If we can, compile cmds into JS for MAXIMUM SPEED...\n if (this.isEvalSupported && FeatureTest.isEvalSupported) {\n const jsBuf = [];\n for (const current of cmds) {\n const args = current.args !== undefined ? current.args.join(\",\") : \"\";\n jsBuf.push(\"c.\", current.cmd, \"(\", args, \");\\n\");\n }\n // eslint-disable-next-line no-new-func\n return (this.compiledGlyphs[character] = new Function(\n \"c\",\n \"size\",\n jsBuf.join(\"\")\n ));\n }\n // ... but fall back on using Function.prototype.apply() if we're\n // blocked from using eval() for whatever reason (like CSP policies).\n return (this.compiledGlyphs[character] = function (c, size) {\n for (const current of cmds) {\n if (current.cmd === \"scale\") {\n current.args = [size, -size];\n }\n // eslint-disable-next-line prefer-spread\n c[current.cmd].apply(c, current.args);\n }\n });\n }\n}\n\nexport { FontFaceObject, FontLoader };\n","/* Copyright 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/* globals __non_webpack_require__ */\n\nimport {\n BaseCanvasFactory,\n BaseCMapReaderFactory,\n BaseFilterFactory,\n BaseStandardFontDataFactory,\n} from \"./base_factory.js\";\nimport { isNodeJS, warn } from \"../shared/util.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./node_utils.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nif (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"SKIP_BABEL\")) {\n (function checkDOMMatrix() {\n if (globalThis.DOMMatrix || !isNodeJS) {\n return;\n }\n try {\n globalThis.DOMMatrix = __non_webpack_require__(\"canvas\").DOMMatrix;\n } catch (ex) {\n warn(`Cannot polyfill \\`DOMMatrix\\`, rendering may be broken: \"${ex}\".`);\n }\n })();\n\n (function checkPath2D() {\n if (globalThis.Path2D || !isNodeJS) {\n return;\n }\n try {\n const { CanvasRenderingContext2D } = __non_webpack_require__(\"canvas\");\n const { polyfillPath2D } = __non_webpack_require__(\"path2d-polyfill\");\n\n globalThis.CanvasRenderingContext2D = CanvasRenderingContext2D;\n polyfillPath2D(globalThis);\n } catch (ex) {\n warn(`Cannot polyfill \\`Path2D\\`, rendering may be broken: \"${ex}\".`);\n }\n })();\n}\n\nconst fetchData = function (url) {\n return new Promise((resolve, reject) => {\n const fs = __non_webpack_require__(\"fs\");\n fs.readFile(url, (error, data) => {\n if (error || !data) {\n reject(new Error(error));\n return;\n }\n resolve(new Uint8Array(data));\n });\n });\n};\n\nclass NodeFilterFactory extends BaseFilterFactory {}\n\nclass NodeCanvasFactory extends BaseCanvasFactory {\n /**\n * @ignore\n */\n _createCanvas(width, height) {\n const Canvas = __non_webpack_require__(\"canvas\");\n return Canvas.createCanvas(width, height);\n }\n}\n\nclass NodeCMapReaderFactory extends BaseCMapReaderFactory {\n /**\n * @ignore\n */\n _fetchData(url, compressionType) {\n return fetchData(url).then(data => {\n return { cMapData: data, compressionType };\n });\n }\n}\n\nclass NodeStandardFontDataFactory extends BaseStandardFontDataFactory {\n /**\n * @ignore\n */\n _fetchData(url) {\n return fetchData(url);\n }\n}\n\nexport {\n NodeCanvasFactory,\n NodeCMapReaderFactory,\n NodeFilterFactory,\n NodeStandardFontDataFactory,\n};\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n FeatureTest,\n FONT_IDENTITY_MATRIX,\n IDENTITY_MATRIX,\n ImageKind,\n info,\n isNodeJS,\n OPS,\n shadow,\n TextRenderingMode,\n unreachable,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport {\n getCurrentTransform,\n getCurrentTransformInverse,\n PixelsPerInch,\n} from \"./display_utils.js\";\nimport {\n getShadingPattern,\n PathType,\n TilingPattern,\n} from \"./pattern_helper.js\";\nimport { convertBlackAndWhiteToRGBA } from \"../shared/image_utils.js\";\n\n// <canvas> contexts store most of the state we need natively.\n// However, PDF needs a bit more state, which we store here.\n// Minimal font size that would be used during canvas fillText operations.\nconst MIN_FONT_SIZE = 16;\n// Maximum font size that would be used during canvas fillText operations.\nconst MAX_FONT_SIZE = 100;\nconst MAX_GROUP_SIZE = 4096;\n\n// Defines the time the `executeOperatorList`-method is going to be executing\n// before it stops and schedules a continue of execution.\nconst EXECUTION_TIME = 15; // ms\n// Defines the number of steps before checking the execution time.\nconst EXECUTION_STEPS = 10;\n\n// To disable Type3 compilation, set the value to `-1`.\nconst MAX_SIZE_TO_COMPILE = 1000;\n\nconst FULL_CHUNK_HEIGHT = 16;\n\n/**\n * Overrides certain methods on a 2d ctx so that when they are called they\n * will also call the same method on the destCtx. The methods that are\n * overridden are all the transformation state modifiers, path creation, and\n * save/restore. We only forward these specific methods because they are the\n * only state modifiers that we cannot copy over when we switch contexts.\n *\n * To remove mirroring call `ctx._removeMirroring()`.\n *\n * @param {Object} ctx - The 2d canvas context that will duplicate its calls on\n * the destCtx.\n * @param {Object} destCtx - The 2d canvas context that will receive the\n * forwarded calls.\n */\nfunction mirrorContextOperations(ctx, destCtx) {\n if (ctx._removeMirroring) {\n throw new Error(\"Context is already forwarding operations.\");\n }\n ctx.__originalSave = ctx.save;\n ctx.__originalRestore = ctx.restore;\n ctx.__originalRotate = ctx.rotate;\n ctx.__originalScale = ctx.scale;\n ctx.__originalTranslate = ctx.translate;\n ctx.__originalTransform = ctx.transform;\n ctx.__originalSetTransform = ctx.setTransform;\n ctx.__originalResetTransform = ctx.resetTransform;\n ctx.__originalClip = ctx.clip;\n ctx.__originalMoveTo = ctx.moveTo;\n ctx.__originalLineTo = ctx.lineTo;\n ctx.__originalBezierCurveTo = ctx.bezierCurveTo;\n ctx.__originalRect = ctx.rect;\n ctx.__originalClosePath = ctx.closePath;\n ctx.__originalBeginPath = ctx.beginPath;\n\n ctx._removeMirroring = () => {\n ctx.save = ctx.__originalSave;\n ctx.restore = ctx.__originalRestore;\n ctx.rotate = ctx.__originalRotate;\n ctx.scale = ctx.__originalScale;\n ctx.translate = ctx.__originalTranslate;\n ctx.transform = ctx.__originalTransform;\n ctx.setTransform = ctx.__originalSetTransform;\n ctx.resetTransform = ctx.__originalResetTransform;\n\n ctx.clip = ctx.__originalClip;\n ctx.moveTo = ctx.__originalMoveTo;\n ctx.lineTo = ctx.__originalLineTo;\n ctx.bezierCurveTo = ctx.__originalBezierCurveTo;\n ctx.rect = ctx.__originalRect;\n ctx.closePath = ctx.__originalClosePath;\n ctx.beginPath = ctx.__originalBeginPath;\n delete ctx._removeMirroring;\n };\n\n ctx.save = function ctxSave() {\n destCtx.save();\n this.__originalSave();\n };\n\n ctx.restore = function ctxRestore() {\n destCtx.restore();\n this.__originalRestore();\n };\n\n ctx.translate = function ctxTranslate(x, y) {\n destCtx.translate(x, y);\n this.__originalTranslate(x, y);\n };\n\n ctx.scale = function ctxScale(x, y) {\n destCtx.scale(x, y);\n this.__originalScale(x, y);\n };\n\n ctx.transform = function ctxTransform(a, b, c, d, e, f) {\n destCtx.transform(a, b, c, d, e, f);\n this.__originalTransform(a, b, c, d, e, f);\n };\n\n ctx.setTransform = function ctxSetTransform(a, b, c, d, e, f) {\n destCtx.setTransform(a, b, c, d, e, f);\n this.__originalSetTransform(a, b, c, d, e, f);\n };\n\n ctx.resetTransform = function ctxResetTransform() {\n destCtx.resetTransform();\n this.__originalResetTransform();\n };\n\n ctx.rotate = function ctxRotate(angle) {\n destCtx.rotate(angle);\n this.__originalRotate(angle);\n };\n\n ctx.clip = function ctxRotate(rule) {\n destCtx.clip(rule);\n this.__originalClip(rule);\n };\n\n ctx.moveTo = function (x, y) {\n destCtx.moveTo(x, y);\n this.__originalMoveTo(x, y);\n };\n\n ctx.lineTo = function (x, y) {\n destCtx.lineTo(x, y);\n this.__originalLineTo(x, y);\n };\n\n ctx.bezierCurveTo = function (cp1x, cp1y, cp2x, cp2y, x, y) {\n destCtx.bezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n this.__originalBezierCurveTo(cp1x, cp1y, cp2x, cp2y, x, y);\n };\n\n ctx.rect = function (x, y, width, height) {\n destCtx.rect(x, y, width, height);\n this.__originalRect(x, y, width, height);\n };\n\n ctx.closePath = function () {\n destCtx.closePath();\n this.__originalClosePath();\n };\n\n ctx.beginPath = function () {\n destCtx.beginPath();\n this.__originalBeginPath();\n };\n}\n\nclass CachedCanvases {\n constructor(canvasFactory) {\n this.canvasFactory = canvasFactory;\n this.cache = Object.create(null);\n }\n\n getCanvas(id, width, height) {\n let canvasEntry;\n if (this.cache[id] !== undefined) {\n canvasEntry = this.cache[id];\n this.canvasFactory.reset(canvasEntry, width, height);\n } else {\n canvasEntry = this.canvasFactory.create(width, height);\n this.cache[id] = canvasEntry;\n }\n return canvasEntry;\n }\n\n delete(id) {\n delete this.cache[id];\n }\n\n clear() {\n for (const id in this.cache) {\n const canvasEntry = this.cache[id];\n this.canvasFactory.destroy(canvasEntry);\n delete this.cache[id];\n }\n }\n}\n\nfunction drawImageAtIntegerCoords(\n ctx,\n srcImg,\n srcX,\n srcY,\n srcW,\n srcH,\n destX,\n destY,\n destW,\n destH\n) {\n const [a, b, c, d, tx, ty] = getCurrentTransform(ctx);\n if (b === 0 && c === 0) {\n // top-left corner is at (X, Y) and\n // bottom-right one is at (X + width, Y + height).\n\n // If leftX is 4.321 then it's rounded to 4.\n // If width is 10.432 then it's rounded to 11 because\n // rightX = leftX + width = 14.753 which is rounded to 15\n // so after rounding the total width is 11 (15 - 4).\n // It's why we can't just floor/ceil uniformly, it just depends\n // on the values we've.\n\n const tlX = destX * a + tx;\n const rTlX = Math.round(tlX);\n const tlY = destY * d + ty;\n const rTlY = Math.round(tlY);\n const brX = (destX + destW) * a + tx;\n\n // Some pdf contains images with 1x1 images so in case of 0-width after\n // scaling we must fallback on 1 to be sure there is something.\n const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n const brY = (destY + destH) * d + ty;\n const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n\n // We must apply a transformation in order to apply it on the image itself.\n // For example if a == 1 && d == -1, it means that the image itself is\n // mirrored w.r.t. the x-axis.\n ctx.setTransform(Math.sign(a), 0, 0, Math.sign(d), rTlX, rTlY);\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rWidth, rHeight);\n ctx.setTransform(a, b, c, d, tx, ty);\n\n return [rWidth, rHeight];\n }\n\n if (a === 0 && d === 0) {\n // This path is taken in issue9462.pdf (page 3).\n const tlX = destY * c + tx;\n const rTlX = Math.round(tlX);\n const tlY = destX * b + ty;\n const rTlY = Math.round(tlY);\n const brX = (destY + destH) * c + tx;\n const rWidth = Math.abs(Math.round(brX) - rTlX) || 1;\n const brY = (destX + destW) * b + ty;\n const rHeight = Math.abs(Math.round(brY) - rTlY) || 1;\n\n ctx.setTransform(0, Math.sign(b), Math.sign(c), 0, rTlX, rTlY);\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, 0, 0, rHeight, rWidth);\n ctx.setTransform(a, b, c, d, tx, ty);\n\n return [rHeight, rWidth];\n }\n\n // Not a scale matrix so let the render handle the case without rounding.\n ctx.drawImage(srcImg, srcX, srcY, srcW, srcH, destX, destY, destW, destH);\n\n const scaleX = Math.hypot(a, b);\n const scaleY = Math.hypot(c, d);\n return [scaleX * destW, scaleY * destH];\n}\n\nfunction compileType3Glyph(imgData) {\n const { width, height } = imgData;\n if (width > MAX_SIZE_TO_COMPILE || height > MAX_SIZE_TO_COMPILE) {\n return null;\n }\n\n const POINT_TO_PROCESS_LIMIT = 1000;\n const POINT_TYPES = new Uint8Array([\n 0, 2, 4, 0, 1, 0, 5, 4, 8, 10, 0, 8, 0, 2, 1, 0,\n ]);\n\n const width1 = width + 1;\n let points = new Uint8Array(width1 * (height + 1));\n let i, j, j0;\n\n // decodes bit-packed mask data\n const lineSize = (width + 7) & ~7;\n let data = new Uint8Array(lineSize * height),\n pos = 0;\n for (const elem of imgData.data) {\n let mask = 128;\n while (mask > 0) {\n data[pos++] = elem & mask ? 0 : 255;\n mask >>= 1;\n }\n }\n\n // finding interesting points: every point is located between mask pixels,\n // so there will be points of the (width + 1)x(height + 1) grid. Every point\n // will have flags assigned based on neighboring mask pixels:\n // 4 | 8\n // --P--\n // 2 | 1\n // We are interested only in points with the flags:\n // - outside corners: 1, 2, 4, 8;\n // - inside corners: 7, 11, 13, 14;\n // - and, intersections: 5, 10.\n let count = 0;\n pos = 0;\n if (data[pos] !== 0) {\n points[0] = 1;\n ++count;\n }\n for (j = 1; j < width; j++) {\n if (data[pos] !== data[pos + 1]) {\n points[j] = data[pos] ? 2 : 1;\n ++count;\n }\n pos++;\n }\n if (data[pos] !== 0) {\n points[j] = 2;\n ++count;\n }\n for (i = 1; i < height; i++) {\n pos = i * lineSize;\n j0 = i * width1;\n if (data[pos - lineSize] !== data[pos]) {\n points[j0] = data[pos] ? 1 : 8;\n ++count;\n }\n // 'sum' is the position of the current pixel configuration in the 'TYPES'\n // array (in order 8-1-2-4, so we can use '>>2' to shift the column).\n let sum = (data[pos] ? 4 : 0) + (data[pos - lineSize] ? 8 : 0);\n for (j = 1; j < width; j++) {\n sum =\n (sum >> 2) +\n (data[pos + 1] ? 4 : 0) +\n (data[pos - lineSize + 1] ? 8 : 0);\n if (POINT_TYPES[sum]) {\n points[j0 + j] = POINT_TYPES[sum];\n ++count;\n }\n pos++;\n }\n if (data[pos - lineSize] !== data[pos]) {\n points[j0 + j] = data[pos] ? 2 : 4;\n ++count;\n }\n\n if (count > POINT_TO_PROCESS_LIMIT) {\n return null;\n }\n }\n\n pos = lineSize * (height - 1);\n j0 = i * width1;\n if (data[pos] !== 0) {\n points[j0] = 8;\n ++count;\n }\n for (j = 1; j < width; j++) {\n if (data[pos] !== data[pos + 1]) {\n points[j0 + j] = data[pos] ? 4 : 8;\n ++count;\n }\n pos++;\n }\n if (data[pos] !== 0) {\n points[j0 + j] = 4;\n ++count;\n }\n if (count > POINT_TO_PROCESS_LIMIT) {\n return null;\n }\n\n // building outlines\n const steps = new Int32Array([0, width1, -1, 0, -width1, 0, 0, 0, 1]);\n const path = new Path2D();\n\n for (i = 0; count && i <= height; i++) {\n let p = i * width1;\n const end = p + width;\n while (p < end && !points[p]) {\n p++;\n }\n if (p === end) {\n continue;\n }\n path.moveTo(p % width1, i);\n\n const p0 = p;\n let type = points[p];\n do {\n const step = steps[type];\n do {\n p += step;\n } while (!points[p]);\n\n const pp = points[p];\n if (pp !== 5 && pp !== 10) {\n // set new direction\n type = pp;\n // delete mark\n points[p] = 0;\n } else {\n // type is 5 or 10, ie, a crossing\n // set new direction\n type = pp & ((0x33 * type) >> 4);\n // set new type for \"future hit\"\n points[p] &= (type >> 2) | (type << 2);\n }\n path.lineTo(p % width1, (p / width1) | 0);\n\n if (!points[p]) {\n --count;\n }\n } while (p0 !== p);\n --i;\n }\n\n // Immediately release the, potentially large, `Uint8Array`s after parsing.\n data = null;\n points = null;\n\n const drawOutline = function (c) {\n c.save();\n // the path shall be painted in [0..1]x[0..1] space\n c.scale(1 / width, -1 / height);\n c.translate(0, -height);\n c.fill(path);\n c.beginPath();\n c.restore();\n };\n\n return drawOutline;\n}\n\nclass CanvasExtraState {\n constructor(width, height) {\n // Are soft masks and alpha values shapes or opacities?\n this.alphaIsShape = false;\n this.fontSize = 0;\n this.fontSizeScale = 1;\n this.textMatrix = IDENTITY_MATRIX;\n this.textMatrixScale = 1;\n this.fontMatrix = FONT_IDENTITY_MATRIX;\n this.leading = 0;\n // Current point (in user coordinates)\n this.x = 0;\n this.y = 0;\n // Start of text line (in text coordinates)\n this.lineX = 0;\n this.lineY = 0;\n // Character and word spacing\n this.charSpacing = 0;\n this.wordSpacing = 0;\n this.textHScale = 1;\n this.textRenderingMode = TextRenderingMode.FILL;\n this.textRise = 0;\n // Default fore and background colors\n this.fillColor = \"#000000\";\n this.strokeColor = \"#000000\";\n this.patternFill = false;\n // Note: fill alpha applies to all non-stroking operations\n this.fillAlpha = 1;\n this.strokeAlpha = 1;\n this.lineWidth = 1;\n this.activeSMask = null;\n this.transferMaps = \"none\";\n\n this.startNewPathAndClipBox([0, 0, width, height]);\n }\n\n clone() {\n const clone = Object.create(this);\n clone.clipBox = this.clipBox.slice();\n return clone;\n }\n\n setCurrentPoint(x, y) {\n this.x = x;\n this.y = y;\n }\n\n updatePathMinMax(transform, x, y) {\n [x, y] = Util.applyTransform([x, y], transform);\n this.minX = Math.min(this.minX, x);\n this.minY = Math.min(this.minY, y);\n this.maxX = Math.max(this.maxX, x);\n this.maxY = Math.max(this.maxY, y);\n }\n\n updateRectMinMax(transform, rect) {\n const p1 = Util.applyTransform(rect, transform);\n const p2 = Util.applyTransform(rect.slice(2), transform);\n this.minX = Math.min(this.minX, p1[0], p2[0]);\n this.minY = Math.min(this.minY, p1[1], p2[1]);\n this.maxX = Math.max(this.maxX, p1[0], p2[0]);\n this.maxY = Math.max(this.maxY, p1[1], p2[1]);\n }\n\n updateScalingPathMinMax(transform, minMax) {\n Util.scaleMinMax(transform, minMax);\n this.minX = Math.min(this.minX, minMax[0]);\n this.maxX = Math.max(this.maxX, minMax[1]);\n this.minY = Math.min(this.minY, minMax[2]);\n this.maxY = Math.max(this.maxY, minMax[3]);\n }\n\n updateCurvePathMinMax(transform, x0, y0, x1, y1, x2, y2, x3, y3, minMax) {\n const box = Util.bezierBoundingBox(x0, y0, x1, y1, x2, y2, x3, y3);\n if (minMax) {\n minMax[0] = Math.min(minMax[0], box[0], box[2]);\n minMax[1] = Math.max(minMax[1], box[0], box[2]);\n minMax[2] = Math.min(minMax[2], box[1], box[3]);\n minMax[3] = Math.max(minMax[3], box[1], box[3]);\n return;\n }\n this.updateRectMinMax(transform, box);\n }\n\n getPathBoundingBox(pathType = PathType.FILL, transform = null) {\n const box = [this.minX, this.minY, this.maxX, this.maxY];\n if (pathType === PathType.STROKE) {\n if (!transform) {\n unreachable(\"Stroke bounding box must include transform.\");\n }\n // Stroked paths can be outside of the path bounding box by 1/2 the line\n // width.\n const scale = Util.singularValueDecompose2dScale(transform);\n const xStrokePad = (scale[0] * this.lineWidth) / 2;\n const yStrokePad = (scale[1] * this.lineWidth) / 2;\n box[0] -= xStrokePad;\n box[1] -= yStrokePad;\n box[2] += xStrokePad;\n box[3] += yStrokePad;\n }\n return box;\n }\n\n updateClipFromPath() {\n const intersect = Util.intersect(this.clipBox, this.getPathBoundingBox());\n this.startNewPathAndClipBox(intersect || [0, 0, 0, 0]);\n }\n\n isEmptyClip() {\n return this.minX === Infinity;\n }\n\n startNewPathAndClipBox(box) {\n this.clipBox = box;\n this.minX = Infinity;\n this.minY = Infinity;\n this.maxX = 0;\n this.maxY = 0;\n }\n\n getClippedPathBoundingBox(pathType = PathType.FILL, transform = null) {\n return Util.intersect(\n this.clipBox,\n this.getPathBoundingBox(pathType, transform)\n );\n }\n}\n\nfunction putBinaryImageData(ctx, imgData) {\n if (typeof ImageData !== \"undefined\" && imgData instanceof ImageData) {\n ctx.putImageData(imgData, 0, 0);\n return;\n }\n\n // Put the image data to the canvas in chunks, rather than putting the\n // whole image at once. This saves JS memory, because the ImageData object\n // is smaller. It also possibly saves C++ memory within the implementation\n // of putImageData(). (E.g. in Firefox we make two short-lived copies of\n // the data passed to putImageData()). |n| shouldn't be too small, however,\n // because too many putImageData() calls will slow things down.\n //\n // Note: as written, if the last chunk is partial, the putImageData() call\n // will (conceptually) put pixels past the bounds of the canvas. But\n // that's ok; any such pixels are ignored.\n\n const height = imgData.height,\n width = imgData.width;\n const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n\n const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n let srcPos = 0,\n destPos;\n const src = imgData.data;\n const dest = chunkImgData.data;\n let i, j, thisChunkHeight, elemsInThisChunk;\n\n // There are multiple forms in which the pixel data can be passed, and\n // imgData.kind tells us which one this is.\n if (imgData.kind === ImageKind.GRAYSCALE_1BPP) {\n // Grayscale, 1 bit per pixel (i.e. black-and-white).\n const srcLength = src.byteLength;\n const dest32 = new Uint32Array(dest.buffer, 0, dest.byteLength >> 2);\n const dest32DataLength = dest32.length;\n const fullSrcDiff = (width + 7) >> 3;\n const white = 0xffffffff;\n const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n\n for (i = 0; i < totalChunks; i++) {\n thisChunkHeight = i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n destPos = 0;\n for (j = 0; j < thisChunkHeight; j++) {\n const srcDiff = srcLength - srcPos;\n let k = 0;\n const kEnd = srcDiff > fullSrcDiff ? width : srcDiff * 8 - 7;\n const kEndUnrolled = kEnd & ~7;\n let mask = 0;\n let srcByte = 0;\n for (; k < kEndUnrolled; k += 8) {\n srcByte = src[srcPos++];\n dest32[destPos++] = srcByte & 128 ? white : black;\n dest32[destPos++] = srcByte & 64 ? white : black;\n dest32[destPos++] = srcByte & 32 ? white : black;\n dest32[destPos++] = srcByte & 16 ? white : black;\n dest32[destPos++] = srcByte & 8 ? white : black;\n dest32[destPos++] = srcByte & 4 ? white : black;\n dest32[destPos++] = srcByte & 2 ? white : black;\n dest32[destPos++] = srcByte & 1 ? white : black;\n }\n for (; k < kEnd; k++) {\n if (mask === 0) {\n srcByte = src[srcPos++];\n mask = 128;\n }\n\n dest32[destPos++] = srcByte & mask ? white : black;\n mask >>= 1;\n }\n }\n // We ran out of input. Make all remaining pixels transparent.\n while (destPos < dest32DataLength) {\n dest32[destPos++] = 0;\n }\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else if (imgData.kind === ImageKind.RGBA_32BPP) {\n // RGBA, 32-bits per pixel.\n j = 0;\n elemsInThisChunk = width * FULL_CHUNK_HEIGHT * 4;\n for (i = 0; i < fullChunks; i++) {\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n srcPos += elemsInThisChunk;\n\n ctx.putImageData(chunkImgData, 0, j);\n j += FULL_CHUNK_HEIGHT;\n }\n if (i < totalChunks) {\n elemsInThisChunk = width * partialChunkHeight * 4;\n dest.set(src.subarray(srcPos, srcPos + elemsInThisChunk));\n\n ctx.putImageData(chunkImgData, 0, j);\n }\n } else if (imgData.kind === ImageKind.RGB_24BPP) {\n // RGB, 24-bits per pixel.\n thisChunkHeight = FULL_CHUNK_HEIGHT;\n elemsInThisChunk = width * thisChunkHeight;\n for (i = 0; i < totalChunks; i++) {\n if (i >= fullChunks) {\n thisChunkHeight = partialChunkHeight;\n elemsInThisChunk = width * thisChunkHeight;\n }\n\n destPos = 0;\n for (j = elemsInThisChunk; j--; ) {\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = src[srcPos++];\n dest[destPos++] = 255;\n }\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n } else {\n throw new Error(`bad image kind: ${imgData.kind}`);\n }\n}\n\nfunction putBinaryImageMask(ctx, imgData) {\n if (imgData.bitmap) {\n // The bitmap has been created in the worker.\n ctx.drawImage(imgData.bitmap, 0, 0);\n return;\n }\n\n // Slow path: OffscreenCanvas isn't available in the worker.\n const height = imgData.height,\n width = imgData.width;\n const partialChunkHeight = height % FULL_CHUNK_HEIGHT;\n const fullChunks = (height - partialChunkHeight) / FULL_CHUNK_HEIGHT;\n const totalChunks = partialChunkHeight === 0 ? fullChunks : fullChunks + 1;\n\n const chunkImgData = ctx.createImageData(width, FULL_CHUNK_HEIGHT);\n let srcPos = 0;\n const src = imgData.data;\n const dest = chunkImgData.data;\n\n for (let i = 0; i < totalChunks; i++) {\n const thisChunkHeight =\n i < fullChunks ? FULL_CHUNK_HEIGHT : partialChunkHeight;\n\n // Expand the mask so it can be used by the canvas. Any required\n // inversion has already been handled.\n\n ({ srcPos } = convertBlackAndWhiteToRGBA({\n src,\n srcPos,\n dest,\n width,\n height: thisChunkHeight,\n nonBlackColor: 0,\n }));\n\n ctx.putImageData(chunkImgData, 0, i * FULL_CHUNK_HEIGHT);\n }\n}\n\nfunction copyCtxState(sourceCtx, destCtx) {\n const properties = [\n \"strokeStyle\",\n \"fillStyle\",\n \"fillRule\",\n \"globalAlpha\",\n \"lineWidth\",\n \"lineCap\",\n \"lineJoin\",\n \"miterLimit\",\n \"globalCompositeOperation\",\n \"font\",\n \"filter\",\n ];\n for (const property of properties) {\n if (sourceCtx[property] !== undefined) {\n destCtx[property] = sourceCtx[property];\n }\n }\n if (sourceCtx.setLineDash !== undefined) {\n destCtx.setLineDash(sourceCtx.getLineDash());\n destCtx.lineDashOffset = sourceCtx.lineDashOffset;\n }\n}\n\nfunction resetCtxToDefault(ctx) {\n ctx.strokeStyle = ctx.fillStyle = \"#000000\";\n ctx.fillRule = \"nonzero\";\n ctx.globalAlpha = 1;\n ctx.lineWidth = 1;\n ctx.lineCap = \"butt\";\n ctx.lineJoin = \"miter\";\n ctx.miterLimit = 10;\n ctx.globalCompositeOperation = \"source-over\";\n ctx.font = \"10px sans-serif\";\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash([]);\n ctx.lineDashOffset = 0;\n }\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n !isNodeJS\n ) {\n const { filter } = ctx;\n if (filter !== \"none\" && filter !== \"\") {\n ctx.filter = \"none\";\n }\n }\n}\n\nfunction composeSMaskBackdrop(bytes, r0, g0, b0) {\n const length = bytes.length;\n for (let i = 3; i < length; i += 4) {\n const alpha = bytes[i];\n if (alpha === 0) {\n bytes[i - 3] = r0;\n bytes[i - 2] = g0;\n bytes[i - 1] = b0;\n } else if (alpha < 255) {\n const alpha_ = 255 - alpha;\n bytes[i - 3] = (bytes[i - 3] * alpha + r0 * alpha_) >> 8;\n bytes[i - 2] = (bytes[i - 2] * alpha + g0 * alpha_) >> 8;\n bytes[i - 1] = (bytes[i - 1] * alpha + b0 * alpha_) >> 8;\n }\n }\n}\n\nfunction composeSMaskAlpha(maskData, layerData, transferMap) {\n const length = maskData.length;\n const scale = 1 / 255;\n for (let i = 3; i < length; i += 4) {\n const alpha = transferMap ? transferMap[maskData[i]] : maskData[i];\n layerData[i] = (layerData[i] * alpha * scale) | 0;\n }\n}\n\nfunction composeSMaskLuminosity(maskData, layerData, transferMap) {\n const length = maskData.length;\n for (let i = 3; i < length; i += 4) {\n const y =\n maskData[i - 3] * 77 + // * 0.3 / 255 * 0x10000\n maskData[i - 2] * 152 + // * 0.59 ....\n maskData[i - 1] * 28; // * 0.11 ....\n layerData[i] = transferMap\n ? (layerData[i] * transferMap[y >> 8]) >> 8\n : (layerData[i] * y) >> 16;\n }\n}\n\nfunction genericComposeSMask(\n maskCtx,\n layerCtx,\n width,\n height,\n subtype,\n backdrop,\n transferMap,\n layerOffsetX,\n layerOffsetY,\n maskOffsetX,\n maskOffsetY\n) {\n const hasBackdrop = !!backdrop;\n const r0 = hasBackdrop ? backdrop[0] : 0;\n const g0 = hasBackdrop ? backdrop[1] : 0;\n const b0 = hasBackdrop ? backdrop[2] : 0;\n\n const composeFn =\n subtype === \"Luminosity\" ? composeSMaskLuminosity : composeSMaskAlpha;\n\n // processing image in chunks to save memory\n const PIXELS_TO_PROCESS = 1048576;\n const chunkSize = Math.min(height, Math.ceil(PIXELS_TO_PROCESS / width));\n for (let row = 0; row < height; row += chunkSize) {\n const chunkHeight = Math.min(chunkSize, height - row);\n const maskData = maskCtx.getImageData(\n layerOffsetX - maskOffsetX,\n row + (layerOffsetY - maskOffsetY),\n width,\n chunkHeight\n );\n const layerData = layerCtx.getImageData(\n layerOffsetX,\n row + layerOffsetY,\n width,\n chunkHeight\n );\n\n if (hasBackdrop) {\n composeSMaskBackdrop(maskData.data, r0, g0, b0);\n }\n composeFn(maskData.data, layerData.data, transferMap);\n\n layerCtx.putImageData(layerData, layerOffsetX, row + layerOffsetY);\n }\n}\n\nfunction composeSMask(ctx, smask, layerCtx, layerBox) {\n const layerOffsetX = layerBox[0];\n const layerOffsetY = layerBox[1];\n const layerWidth = layerBox[2] - layerOffsetX;\n const layerHeight = layerBox[3] - layerOffsetY;\n if (layerWidth === 0 || layerHeight === 0) {\n return;\n }\n genericComposeSMask(\n smask.context,\n layerCtx,\n layerWidth,\n layerHeight,\n smask.subtype,\n smask.backdrop,\n smask.transferMap,\n layerOffsetX,\n layerOffsetY,\n smask.offsetX,\n smask.offsetY\n );\n ctx.save();\n ctx.globalAlpha = 1;\n ctx.globalCompositeOperation = \"source-over\";\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(layerCtx.canvas, 0, 0);\n ctx.restore();\n}\n\nfunction getImageSmoothingEnabled(transform, interpolate) {\n const scale = Util.singularValueDecompose2dScale(transform);\n // Round to a 32bit float so that `<=` check below will pass for numbers that\n // are very close, but not exactly the same 64bit floats.\n scale[0] = Math.fround(scale[0]);\n scale[1] = Math.fround(scale[1]);\n const actualScale = Math.fround(\n (globalThis.devicePixelRatio || 1) * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n if (interpolate !== undefined) {\n // If the value is explicitly set use it.\n return interpolate;\n } else if (scale[0] <= actualScale || scale[1] <= actualScale) {\n // Smooth when downscaling.\n return true;\n }\n // Don't smooth when upscaling.\n return false;\n}\n\nconst LINE_CAP_STYLES = [\"butt\", \"round\", \"square\"];\nconst LINE_JOIN_STYLES = [\"miter\", \"round\", \"bevel\"];\nconst NORMAL_CLIP = {};\nconst EO_CLIP = {};\n\nclass CanvasGraphics {\n constructor(\n canvasCtx,\n commonObjs,\n objs,\n canvasFactory,\n filterFactory,\n { optionalContentConfig, markedContentStack = null },\n annotationCanvasMap,\n pageColors\n ) {\n this.ctx = canvasCtx;\n this.current = new CanvasExtraState(\n this.ctx.canvas.width,\n this.ctx.canvas.height\n );\n this.stateStack = [];\n this.pendingClip = null;\n this.pendingEOFill = false;\n this.res = null;\n this.xobjs = null;\n this.commonObjs = commonObjs;\n this.objs = objs;\n this.canvasFactory = canvasFactory;\n this.filterFactory = filterFactory;\n this.groupStack = [];\n this.processingType3 = null;\n // Patterns are painted relative to the initial page/form transform, see\n // PDF spec 8.7.2 NOTE 1.\n this.baseTransform = null;\n this.baseTransformStack = [];\n this.groupLevel = 0;\n this.smaskStack = [];\n this.smaskCounter = 0;\n this.tempSMask = null;\n this.suspendedCtx = null;\n this.contentVisible = true;\n this.markedContentStack = markedContentStack || [];\n this.optionalContentConfig = optionalContentConfig;\n this.cachedCanvases = new CachedCanvases(this.canvasFactory);\n this.cachedPatterns = new Map();\n this.annotationCanvasMap = annotationCanvasMap;\n this.viewportScale = 1;\n this.outputScaleX = 1;\n this.outputScaleY = 1;\n this.pageColors = pageColors;\n\n this._cachedScaleForStroking = [-1, 0];\n this._cachedGetSinglePixelWidth = null;\n this._cachedBitmapsMap = new Map();\n }\n\n getObject(data, fallback = null) {\n if (typeof data === \"string\") {\n return data.startsWith(\"g_\")\n ? this.commonObjs.get(data)\n : this.objs.get(data);\n }\n return fallback;\n }\n\n beginDrawing({\n transform,\n viewport,\n transparency = false,\n background = null,\n }) {\n // For pdfs that use blend modes we have to clear the canvas else certain\n // blend modes can look wrong since we'd be blending with a white\n // backdrop. The problem with a transparent backdrop though is we then\n // don't get sub pixel anti aliasing on text, creating temporary\n // transparent canvas when we have blend modes.\n const width = this.ctx.canvas.width;\n const height = this.ctx.canvas.height;\n\n const savedFillStyle = this.ctx.fillStyle;\n this.ctx.fillStyle = background || \"#ffffff\";\n this.ctx.fillRect(0, 0, width, height);\n this.ctx.fillStyle = savedFillStyle;\n\n if (transparency) {\n const transparentCanvas = this.cachedCanvases.getCanvas(\n \"transparent\",\n width,\n height\n );\n this.compositeCtx = this.ctx;\n this.transparentCanvas = transparentCanvas.canvas;\n this.ctx = transparentCanvas.context;\n this.ctx.save();\n // The transform can be applied before rendering, transferring it to\n // the new canvas.\n this.ctx.transform(...getCurrentTransform(this.compositeCtx));\n }\n\n this.ctx.save();\n resetCtxToDefault(this.ctx);\n if (transform) {\n this.ctx.transform(...transform);\n this.outputScaleX = transform[0];\n this.outputScaleY = transform[0];\n }\n this.ctx.transform(...viewport.transform);\n this.viewportScale = viewport.scale;\n\n this.baseTransform = getCurrentTransform(this.ctx);\n }\n\n executeOperatorList(\n operatorList,\n executionStartIdx,\n continueCallback,\n stepper\n ) {\n const argsArray = operatorList.argsArray;\n const fnArray = operatorList.fnArray;\n let i = executionStartIdx || 0;\n const argsArrayLen = argsArray.length;\n\n // Sometimes the OperatorList to execute is empty.\n if (argsArrayLen === i) {\n return i;\n }\n\n const chunkOperations =\n argsArrayLen - i > EXECUTION_STEPS &&\n typeof continueCallback === \"function\";\n const endTime = chunkOperations ? Date.now() + EXECUTION_TIME : 0;\n let steps = 0;\n\n const commonObjs = this.commonObjs;\n const objs = this.objs;\n let fnId;\n\n while (true) {\n if (stepper !== undefined && i === stepper.nextBreakPoint) {\n stepper.breakIt(i, continueCallback);\n return i;\n }\n\n fnId = fnArray[i];\n\n if (fnId !== OPS.dependency) {\n // eslint-disable-next-line prefer-spread\n this[fnId].apply(this, argsArray[i]);\n } else {\n for (const depObjId of argsArray[i]) {\n const objsPool = depObjId.startsWith(\"g_\") ? commonObjs : objs;\n\n // If the promise isn't resolved yet, add the continueCallback\n // to the promise and bail out.\n if (!objsPool.has(depObjId)) {\n objsPool.get(depObjId, continueCallback);\n return i;\n }\n }\n }\n\n i++;\n\n // If the entire operatorList was executed, stop as were done.\n if (i === argsArrayLen) {\n return i;\n }\n\n // If the execution took longer then a certain amount of time and\n // `continueCallback` is specified, interrupt the execution.\n if (chunkOperations && ++steps > EXECUTION_STEPS) {\n if (Date.now() > endTime) {\n continueCallback();\n return i;\n }\n steps = 0;\n }\n\n // If the operatorList isn't executed completely yet OR the execution\n // time was short enough, do another execution round.\n }\n }\n\n #restoreInitialState() {\n // Finishing all opened operations such as SMask group painting.\n while (this.stateStack.length || this.inSMaskMode) {\n this.restore();\n }\n\n this.ctx.restore();\n\n if (this.transparentCanvas) {\n this.ctx = this.compositeCtx;\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0); // Avoid apply transform twice\n this.ctx.drawImage(this.transparentCanvas, 0, 0);\n this.ctx.restore();\n this.transparentCanvas = null;\n }\n }\n\n endDrawing() {\n this.#restoreInitialState();\n\n this.cachedCanvases.clear();\n this.cachedPatterns.clear();\n\n for (const cache of this._cachedBitmapsMap.values()) {\n for (const canvas of cache.values()) {\n if (\n typeof HTMLCanvasElement !== \"undefined\" &&\n canvas instanceof HTMLCanvasElement\n ) {\n canvas.width = canvas.height = 0;\n }\n }\n cache.clear();\n }\n this._cachedBitmapsMap.clear();\n this.#drawFilter();\n }\n\n #drawFilter() {\n if (this.pageColors) {\n const hcmFilterId = this.filterFactory.addHCMFilter(\n this.pageColors.foreground,\n this.pageColors.background\n );\n if (hcmFilterId !== \"none\") {\n const savedFilter = this.ctx.filter;\n this.ctx.filter = hcmFilterId;\n this.ctx.drawImage(this.ctx.canvas, 0, 0);\n this.ctx.filter = savedFilter;\n }\n }\n }\n\n _scaleImage(img, inverseTransform) {\n // Vertical or horizontal scaling shall not be more than 2 to not lose the\n // pixels during drawImage operation, painting on the temporary canvas(es)\n // that are twice smaller in size.\n const width = img.width;\n const height = img.height;\n let widthScale = Math.max(\n Math.hypot(inverseTransform[0], inverseTransform[1]),\n 1\n );\n let heightScale = Math.max(\n Math.hypot(inverseTransform[2], inverseTransform[3]),\n 1\n );\n\n let paintWidth = width,\n paintHeight = height;\n let tmpCanvasId = \"prescale1\";\n let tmpCanvas, tmpCtx;\n while (\n (widthScale > 2 && paintWidth > 1) ||\n (heightScale > 2 && paintHeight > 1)\n ) {\n let newWidth = paintWidth,\n newHeight = paintHeight;\n if (widthScale > 2 && paintWidth > 1) {\n // See bug 1820511 (Windows specific bug).\n // TODO: once the above bug is fixed we could revert to:\n // newWidth = Math.ceil(paintWidth / 2);\n newWidth =\n paintWidth >= 16384\n ? Math.floor(paintWidth / 2) - 1 || 1\n : Math.ceil(paintWidth / 2);\n widthScale /= paintWidth / newWidth;\n }\n if (heightScale > 2 && paintHeight > 1) {\n // TODO: see the comment above.\n newHeight =\n paintHeight >= 16384\n ? Math.floor(paintHeight / 2) - 1 || 1\n : Math.ceil(paintHeight) / 2;\n heightScale /= paintHeight / newHeight;\n }\n tmpCanvas = this.cachedCanvases.getCanvas(\n tmpCanvasId,\n newWidth,\n newHeight\n );\n tmpCtx = tmpCanvas.context;\n tmpCtx.clearRect(0, 0, newWidth, newHeight);\n tmpCtx.drawImage(\n img,\n 0,\n 0,\n paintWidth,\n paintHeight,\n 0,\n 0,\n newWidth,\n newHeight\n );\n img = tmpCanvas.canvas;\n paintWidth = newWidth;\n paintHeight = newHeight;\n tmpCanvasId = tmpCanvasId === \"prescale1\" ? \"prescale2\" : \"prescale1\";\n }\n return {\n img,\n paintWidth,\n paintHeight,\n };\n }\n\n _createMaskCanvas(img) {\n const ctx = this.ctx;\n const { width, height } = img;\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n const currentTransform = getCurrentTransform(ctx);\n\n let cache, cacheKey, scaled, maskCanvas;\n if ((img.bitmap || img.data) && img.count > 1) {\n const mainKey = img.bitmap || img.data.buffer;\n // We're reusing the same image several times, so we can cache it.\n // In case we've a pattern fill we just keep the scaled version of\n // the image.\n // Only the scaling part matters, the translation part is just used\n // to compute offsets (but not when filling patterns see #15573).\n // TODO: handle the case of a pattern fill if it's possible.\n cacheKey = JSON.stringify(\n isPatternFill\n ? currentTransform\n : [currentTransform.slice(0, 4), fillColor]\n );\n\n cache = this._cachedBitmapsMap.get(mainKey);\n if (!cache) {\n cache = new Map();\n this._cachedBitmapsMap.set(mainKey, cache);\n }\n const cachedImage = cache.get(cacheKey);\n if (cachedImage && !isPatternFill) {\n const offsetX = Math.round(\n Math.min(currentTransform[0], currentTransform[2]) +\n currentTransform[4]\n );\n const offsetY = Math.round(\n Math.min(currentTransform[1], currentTransform[3]) +\n currentTransform[5]\n );\n return {\n canvas: cachedImage,\n offsetX,\n offsetY,\n };\n }\n scaled = cachedImage;\n }\n\n if (!scaled) {\n maskCanvas = this.cachedCanvases.getCanvas(\"maskCanvas\", width, height);\n putBinaryImageMask(maskCanvas.context, img);\n }\n\n // Create the mask canvas at the size it will be drawn at and also set\n // its transform to match the current transform so if there are any\n // patterns applied they will be applied relative to the correct\n // transform.\n\n let maskToCanvas = Util.transform(currentTransform, [\n 1 / width,\n 0,\n 0,\n -1 / height,\n 0,\n 0,\n ]);\n maskToCanvas = Util.transform(maskToCanvas, [1, 0, 0, 1, 0, -height]);\n const cord1 = Util.applyTransform([0, 0], maskToCanvas);\n const cord2 = Util.applyTransform([width, height], maskToCanvas);\n const rect = Util.normalizeRect([cord1[0], cord1[1], cord2[0], cord2[1]]);\n const drawnWidth = Math.round(rect[2] - rect[0]) || 1;\n const drawnHeight = Math.round(rect[3] - rect[1]) || 1;\n const fillCanvas = this.cachedCanvases.getCanvas(\n \"fillCanvas\",\n drawnWidth,\n drawnHeight\n );\n const fillCtx = fillCanvas.context;\n\n // The offset will be the top-left cordinate mask.\n // If objToCanvas is [a,b,c,d,e,f] then:\n // - offsetX = min(a, c) + e\n // - offsetY = min(b, d) + f\n const offsetX = Math.min(cord1[0], cord2[0]);\n const offsetY = Math.min(cord1[1], cord2[1]);\n fillCtx.translate(-offsetX, -offsetY);\n fillCtx.transform(...maskToCanvas);\n\n if (!scaled) {\n // Pre-scale if needed to improve image smoothing.\n scaled = this._scaleImage(\n maskCanvas.canvas,\n getCurrentTransformInverse(fillCtx)\n );\n scaled = scaled.img;\n if (cache && isPatternFill) {\n cache.set(cacheKey, scaled);\n }\n }\n\n fillCtx.imageSmoothingEnabled = getImageSmoothingEnabled(\n getCurrentTransform(fillCtx),\n img.interpolate\n );\n\n drawImageAtIntegerCoords(\n fillCtx,\n scaled,\n 0,\n 0,\n scaled.width,\n scaled.height,\n 0,\n 0,\n width,\n height\n );\n fillCtx.globalCompositeOperation = \"source-in\";\n\n const inverse = Util.transform(getCurrentTransformInverse(fillCtx), [\n 1,\n 0,\n 0,\n 1,\n -offsetX,\n -offsetY,\n ]);\n fillCtx.fillStyle = isPatternFill\n ? fillColor.getPattern(ctx, this, inverse, PathType.FILL)\n : fillColor;\n\n fillCtx.fillRect(0, 0, width, height);\n\n if (cache && !isPatternFill) {\n // The fill canvas is put in the cache associated to the mask image\n // so we must remove from the cached canvas: it mustn't be used again.\n this.cachedCanvases.delete(\"fillCanvas\");\n cache.set(cacheKey, fillCanvas.canvas);\n }\n\n // Round the offsets to avoid drawing fractional pixels.\n return {\n canvas: fillCanvas.canvas,\n offsetX: Math.round(offsetX),\n offsetY: Math.round(offsetY),\n };\n }\n\n // Graphics state\n setLineWidth(width) {\n if (width !== this.current.lineWidth) {\n this._cachedScaleForStroking[0] = -1;\n }\n this.current.lineWidth = width;\n this.ctx.lineWidth = width;\n }\n\n setLineCap(style) {\n this.ctx.lineCap = LINE_CAP_STYLES[style];\n }\n\n setLineJoin(style) {\n this.ctx.lineJoin = LINE_JOIN_STYLES[style];\n }\n\n setMiterLimit(limit) {\n this.ctx.miterLimit = limit;\n }\n\n setDash(dashArray, dashPhase) {\n const ctx = this.ctx;\n if (ctx.setLineDash !== undefined) {\n ctx.setLineDash(dashArray);\n ctx.lineDashOffset = dashPhase;\n }\n }\n\n setRenderingIntent(intent) {\n // This operation is ignored since we haven't found a use case for it yet.\n }\n\n setFlatness(flatness) {\n // This operation is ignored since we haven't found a use case for it yet.\n }\n\n setGState(states) {\n for (const [key, value] of states) {\n switch (key) {\n case \"LW\":\n this.setLineWidth(value);\n break;\n case \"LC\":\n this.setLineCap(value);\n break;\n case \"LJ\":\n this.setLineJoin(value);\n break;\n case \"ML\":\n this.setMiterLimit(value);\n break;\n case \"D\":\n this.setDash(value[0], value[1]);\n break;\n case \"RI\":\n this.setRenderingIntent(value);\n break;\n case \"FL\":\n this.setFlatness(value);\n break;\n case \"Font\":\n this.setFont(value[0], value[1]);\n break;\n case \"CA\":\n this.current.strokeAlpha = value;\n break;\n case \"ca\":\n this.current.fillAlpha = value;\n this.ctx.globalAlpha = value;\n break;\n case \"BM\":\n this.ctx.globalCompositeOperation = value;\n break;\n case \"SMask\":\n this.current.activeSMask = value ? this.tempSMask : null;\n this.tempSMask = null;\n this.checkSMaskState();\n break;\n case \"TR\":\n this.ctx.filter = this.current.transferMaps =\n this.filterFactory.addFilter(value);\n break;\n }\n }\n }\n\n get inSMaskMode() {\n return !!this.suspendedCtx;\n }\n\n checkSMaskState() {\n const inSMaskMode = this.inSMaskMode;\n if (this.current.activeSMask && !inSMaskMode) {\n this.beginSMaskMode();\n } else if (!this.current.activeSMask && inSMaskMode) {\n this.endSMaskMode();\n }\n // Else, the state is okay and nothing needs to be done.\n }\n\n /**\n * Soft mask mode takes the current main drawing canvas and replaces it with\n * a temporary canvas. Any drawing operations that happen on the temporary\n * canvas need to be composed with the main canvas that was suspended (see\n * `compose()`). The temporary canvas also duplicates many of its operations\n * on the suspended canvas to keep them in sync, so that when the soft mask\n * mode ends any clipping paths or transformations will still be active and in\n * the right order on the canvas' graphics state stack.\n */\n beginSMaskMode() {\n if (this.inSMaskMode) {\n throw new Error(\"beginSMaskMode called while already in smask mode\");\n }\n const drawnWidth = this.ctx.canvas.width;\n const drawnHeight = this.ctx.canvas.height;\n const cacheId = \"smaskGroupAt\" + this.groupLevel;\n const scratchCanvas = this.cachedCanvases.getCanvas(\n cacheId,\n drawnWidth,\n drawnHeight\n );\n this.suspendedCtx = this.ctx;\n this.ctx = scratchCanvas.context;\n const ctx = this.ctx;\n ctx.setTransform(...getCurrentTransform(this.suspendedCtx));\n copyCtxState(this.suspendedCtx, ctx);\n mirrorContextOperations(ctx, this.suspendedCtx);\n\n this.setGState([\n [\"BM\", \"source-over\"],\n [\"ca\", 1],\n [\"CA\", 1],\n ]);\n }\n\n endSMaskMode() {\n if (!this.inSMaskMode) {\n throw new Error(\"endSMaskMode called while not in smask mode\");\n }\n // The soft mask is done, now restore the suspended canvas as the main\n // drawing canvas.\n this.ctx._removeMirroring();\n copyCtxState(this.ctx, this.suspendedCtx);\n this.ctx = this.suspendedCtx;\n\n this.suspendedCtx = null;\n }\n\n compose(dirtyBox) {\n if (!this.current.activeSMask) {\n return;\n }\n\n if (!dirtyBox) {\n dirtyBox = [0, 0, this.ctx.canvas.width, this.ctx.canvas.height];\n } else {\n dirtyBox[0] = Math.floor(dirtyBox[0]);\n dirtyBox[1] = Math.floor(dirtyBox[1]);\n dirtyBox[2] = Math.ceil(dirtyBox[2]);\n dirtyBox[3] = Math.ceil(dirtyBox[3]);\n }\n const smask = this.current.activeSMask;\n const suspendedCtx = this.suspendedCtx;\n\n composeSMask(suspendedCtx, smask, this.ctx, dirtyBox);\n // Whatever was drawn has been moved to the suspended canvas, now clear it\n // out of the current canvas.\n this.ctx.save();\n this.ctx.setTransform(1, 0, 0, 1, 0, 0);\n this.ctx.clearRect(0, 0, this.ctx.canvas.width, this.ctx.canvas.height);\n this.ctx.restore();\n }\n\n save() {\n if (this.inSMaskMode) {\n // SMask mode may be turned on/off causing us to lose graphics state.\n // Copy the temporary canvas state to the main(suspended) canvas to keep\n // it in sync.\n copyCtxState(this.ctx, this.suspendedCtx);\n // Don't bother calling save on the temporary canvas since state is not\n // saved there.\n this.suspendedCtx.save();\n } else {\n this.ctx.save();\n }\n const old = this.current;\n this.stateStack.push(old);\n this.current = old.clone();\n }\n\n restore() {\n if (this.stateStack.length === 0 && this.inSMaskMode) {\n this.endSMaskMode();\n }\n if (this.stateStack.length !== 0) {\n this.current = this.stateStack.pop();\n if (this.inSMaskMode) {\n // Graphics state is stored on the main(suspended) canvas. Restore its\n // state then copy it over to the temporary canvas.\n this.suspendedCtx.restore();\n copyCtxState(this.suspendedCtx, this.ctx);\n } else {\n this.ctx.restore();\n }\n this.checkSMaskState();\n\n // Ensure that the clipping path is reset (fixes issue6413.pdf).\n this.pendingClip = null;\n\n this._cachedScaleForStroking[0] = -1;\n this._cachedGetSinglePixelWidth = null;\n }\n }\n\n transform(a, b, c, d, e, f) {\n this.ctx.transform(a, b, c, d, e, f);\n\n this._cachedScaleForStroking[0] = -1;\n this._cachedGetSinglePixelWidth = null;\n }\n\n // Path\n constructPath(ops, args, minMax) {\n const ctx = this.ctx;\n const current = this.current;\n let x = current.x,\n y = current.y;\n let startX, startY;\n const currentTransform = getCurrentTransform(ctx);\n\n // Most of the time the current transform is a scaling matrix\n // so we don't need to transform points before computing min/max:\n // we can compute min/max first and then smartly \"apply\" the\n // transform (see Util.scaleMinMax).\n // For rectangle, moveTo and lineTo, min/max are computed in the\n // worker (see evaluator.js).\n const isScalingMatrix =\n (currentTransform[0] === 0 && currentTransform[3] === 0) ||\n (currentTransform[1] === 0 && currentTransform[2] === 0);\n const minMaxForBezier = isScalingMatrix ? minMax.slice(0) : null;\n\n for (let i = 0, j = 0, ii = ops.length; i < ii; i++) {\n switch (ops[i] | 0) {\n case OPS.rectangle:\n x = args[j++];\n y = args[j++];\n const width = args[j++];\n const height = args[j++];\n\n const xw = x + width;\n const yh = y + height;\n ctx.moveTo(x, y);\n if (width === 0 || height === 0) {\n ctx.lineTo(xw, yh);\n } else {\n ctx.lineTo(xw, y);\n ctx.lineTo(xw, yh);\n ctx.lineTo(x, yh);\n }\n if (!isScalingMatrix) {\n current.updateRectMinMax(currentTransform, [x, y, xw, yh]);\n }\n ctx.closePath();\n break;\n case OPS.moveTo:\n x = args[j++];\n y = args[j++];\n ctx.moveTo(x, y);\n if (!isScalingMatrix) {\n current.updatePathMinMax(currentTransform, x, y);\n }\n break;\n case OPS.lineTo:\n x = args[j++];\n y = args[j++];\n ctx.lineTo(x, y);\n if (!isScalingMatrix) {\n current.updatePathMinMax(currentTransform, x, y);\n }\n break;\n case OPS.curveTo:\n startX = x;\n startY = y;\n x = args[j + 4];\n y = args[j + 5];\n ctx.bezierCurveTo(\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3],\n x,\n y\n );\n current.updateCurvePathMinMax(\n currentTransform,\n startX,\n startY,\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3],\n x,\n y,\n minMaxForBezier\n );\n j += 6;\n break;\n case OPS.curveTo2:\n startX = x;\n startY = y;\n ctx.bezierCurveTo(\n x,\n y,\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3]\n );\n current.updateCurvePathMinMax(\n currentTransform,\n startX,\n startY,\n x,\n y,\n args[j],\n args[j + 1],\n args[j + 2],\n args[j + 3],\n minMaxForBezier\n );\n x = args[j + 2];\n y = args[j + 3];\n j += 4;\n break;\n case OPS.curveTo3:\n startX = x;\n startY = y;\n x = args[j + 2];\n y = args[j + 3];\n ctx.bezierCurveTo(args[j], args[j + 1], x, y, x, y);\n current.updateCurvePathMinMax(\n currentTransform,\n startX,\n startY,\n args[j],\n args[j + 1],\n x,\n y,\n x,\n y,\n minMaxForBezier\n );\n j += 4;\n break;\n case OPS.closePath:\n ctx.closePath();\n break;\n }\n }\n\n if (isScalingMatrix) {\n current.updateScalingPathMinMax(currentTransform, minMaxForBezier);\n }\n\n current.setCurrentPoint(x, y);\n }\n\n closePath() {\n this.ctx.closePath();\n }\n\n stroke(consumePath = true) {\n const ctx = this.ctx;\n const strokeColor = this.current.strokeColor;\n // For stroke we want to temporarily change the global alpha to the\n // stroking alpha.\n ctx.globalAlpha = this.current.strokeAlpha;\n if (this.contentVisible) {\n if (typeof strokeColor === \"object\" && strokeColor?.getPattern) {\n ctx.save();\n ctx.strokeStyle = strokeColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.STROKE\n );\n this.rescaleAndStroke(/* saveRestore */ false);\n ctx.restore();\n } else {\n this.rescaleAndStroke(/* saveRestore */ true);\n }\n }\n if (consumePath) {\n this.consumePath(this.current.getClippedPathBoundingBox());\n }\n // Restore the global alpha to the fill alpha\n ctx.globalAlpha = this.current.fillAlpha;\n }\n\n closeStroke() {\n this.closePath();\n this.stroke();\n }\n\n fill(consumePath = true) {\n const ctx = this.ctx;\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n let needRestore = false;\n\n if (isPatternFill) {\n ctx.save();\n ctx.fillStyle = fillColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL\n );\n needRestore = true;\n }\n\n const intersect = this.current.getClippedPathBoundingBox();\n if (this.contentVisible && intersect !== null) {\n if (this.pendingEOFill) {\n ctx.fill(\"evenodd\");\n this.pendingEOFill = false;\n } else {\n ctx.fill();\n }\n }\n\n if (needRestore) {\n ctx.restore();\n }\n if (consumePath) {\n this.consumePath(intersect);\n }\n }\n\n eoFill() {\n this.pendingEOFill = true;\n this.fill();\n }\n\n fillStroke() {\n this.fill(false);\n this.stroke(false);\n\n this.consumePath();\n }\n\n eoFillStroke() {\n this.pendingEOFill = true;\n this.fillStroke();\n }\n\n closeFillStroke() {\n this.closePath();\n this.fillStroke();\n }\n\n closeEOFillStroke() {\n this.pendingEOFill = true;\n this.closePath();\n this.fillStroke();\n }\n\n endPath() {\n this.consumePath();\n }\n\n // Clipping\n clip() {\n this.pendingClip = NORMAL_CLIP;\n }\n\n eoClip() {\n this.pendingClip = EO_CLIP;\n }\n\n // Text\n beginText() {\n this.current.textMatrix = IDENTITY_MATRIX;\n this.current.textMatrixScale = 1;\n this.current.x = this.current.lineX = 0;\n this.current.y = this.current.lineY = 0;\n }\n\n endText() {\n const paths = this.pendingTextPaths;\n const ctx = this.ctx;\n if (paths === undefined) {\n ctx.beginPath();\n return;\n }\n\n ctx.save();\n ctx.beginPath();\n for (const path of paths) {\n ctx.setTransform(...path.transform);\n ctx.translate(path.x, path.y);\n path.addToPath(ctx, path.fontSize);\n }\n ctx.restore();\n ctx.clip();\n ctx.beginPath();\n delete this.pendingTextPaths;\n }\n\n setCharSpacing(spacing) {\n this.current.charSpacing = spacing;\n }\n\n setWordSpacing(spacing) {\n this.current.wordSpacing = spacing;\n }\n\n setHScale(scale) {\n this.current.textHScale = scale / 100;\n }\n\n setLeading(leading) {\n this.current.leading = -leading;\n }\n\n setFont(fontRefName, size) {\n const fontObj = this.commonObjs.get(fontRefName);\n const current = this.current;\n\n if (!fontObj) {\n throw new Error(`Can't find font for ${fontRefName}`);\n }\n current.fontMatrix = fontObj.fontMatrix || FONT_IDENTITY_MATRIX;\n\n // A valid matrix needs all main diagonal elements to be non-zero\n // This also ensures we bypass FF bugzilla bug #719844.\n if (current.fontMatrix[0] === 0 || current.fontMatrix[3] === 0) {\n warn(\"Invalid font matrix for font \" + fontRefName);\n }\n\n // The spec for Tf (setFont) says that 'size' specifies the font 'scale',\n // and in some docs this can be negative (inverted x-y axes).\n if (size < 0) {\n size = -size;\n current.fontDirection = -1;\n } else {\n current.fontDirection = 1;\n }\n\n this.current.font = fontObj;\n this.current.fontSize = size;\n\n if (fontObj.isType3Font) {\n return; // we don't need ctx.font for Type3 fonts\n }\n\n const name = fontObj.loadedName || \"sans-serif\";\n const typeface =\n fontObj.systemFontInfo?.css || `\"${name}\", ${fontObj.fallbackName}`;\n\n let bold = \"normal\";\n if (fontObj.black) {\n bold = \"900\";\n } else if (fontObj.bold) {\n bold = \"bold\";\n }\n const italic = fontObj.italic ? \"italic\" : \"normal\";\n\n // Some font backends cannot handle fonts below certain size.\n // Keeping the font at minimal size and using the fontSizeScale to change\n // the current transformation matrix before the fillText/strokeText.\n // See https://bugzilla.mozilla.org/show_bug.cgi?id=726227\n let browserFontSize = size;\n if (size < MIN_FONT_SIZE) {\n browserFontSize = MIN_FONT_SIZE;\n } else if (size > MAX_FONT_SIZE) {\n browserFontSize = MAX_FONT_SIZE;\n }\n this.current.fontSizeScale = size / browserFontSize;\n\n this.ctx.font = `${italic} ${bold} ${browserFontSize}px ${typeface}`;\n }\n\n setTextRenderingMode(mode) {\n this.current.textRenderingMode = mode;\n }\n\n setTextRise(rise) {\n this.current.textRise = rise;\n }\n\n moveText(x, y) {\n this.current.x = this.current.lineX += x;\n this.current.y = this.current.lineY += y;\n }\n\n setLeadingMoveText(x, y) {\n this.setLeading(-y);\n this.moveText(x, y);\n }\n\n setTextMatrix(a, b, c, d, e, f) {\n this.current.textMatrix = [a, b, c, d, e, f];\n this.current.textMatrixScale = Math.hypot(a, b);\n\n this.current.x = this.current.lineX = 0;\n this.current.y = this.current.lineY = 0;\n }\n\n nextLine() {\n this.moveText(0, this.current.leading);\n }\n\n paintChar(character, x, y, patternTransform) {\n const ctx = this.ctx;\n const current = this.current;\n const font = current.font;\n const textRenderingMode = current.textRenderingMode;\n const fontSize = current.fontSize / current.fontSizeScale;\n const fillStrokeMode =\n textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;\n const isAddToPathSet = !!(\n textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG\n );\n const patternFill = current.patternFill && !font.missingFile;\n\n let addToPath;\n if (font.disableFontFace || isAddToPathSet || patternFill) {\n addToPath = font.getPathGenerator(this.commonObjs, character);\n }\n\n if (font.disableFontFace || patternFill) {\n ctx.save();\n ctx.translate(x, y);\n ctx.beginPath();\n addToPath(ctx, fontSize);\n if (patternTransform) {\n ctx.setTransform(...patternTransform);\n }\n if (\n fillStrokeMode === TextRenderingMode.FILL ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.fill();\n }\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.stroke();\n }\n ctx.restore();\n } else {\n if (\n fillStrokeMode === TextRenderingMode.FILL ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.fillText(character, x, y);\n }\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n ctx.strokeText(character, x, y);\n }\n }\n\n if (isAddToPathSet) {\n const paths = (this.pendingTextPaths ||= []);\n paths.push({\n transform: getCurrentTransform(ctx),\n x,\n y,\n fontSize,\n addToPath,\n });\n }\n }\n\n get isFontSubpixelAAEnabled() {\n // Checks if anti-aliasing is enabled when scaled text is painted.\n // On Windows GDI scaled fonts looks bad.\n const { context: ctx } = this.cachedCanvases.getCanvas(\n \"isFontSubpixelAAEnabled\",\n 10,\n 10\n );\n ctx.scale(1.5, 1);\n ctx.fillText(\"I\", 0, 10);\n const data = ctx.getImageData(0, 0, 10, 10).data;\n let enabled = false;\n for (let i = 3; i < data.length; i += 4) {\n if (data[i] > 0 && data[i] < 255) {\n enabled = true;\n break;\n }\n }\n return shadow(this, \"isFontSubpixelAAEnabled\", enabled);\n }\n\n showText(glyphs) {\n const current = this.current;\n const font = current.font;\n if (font.isType3Font) {\n return this.showType3Text(glyphs);\n }\n\n const fontSize = current.fontSize;\n if (fontSize === 0) {\n return undefined;\n }\n\n const ctx = this.ctx;\n const fontSizeScale = current.fontSizeScale;\n const charSpacing = current.charSpacing;\n const wordSpacing = current.wordSpacing;\n const fontDirection = current.fontDirection;\n const textHScale = current.textHScale * fontDirection;\n const glyphsLength = glyphs.length;\n const vertical = font.vertical;\n const spacingDir = vertical ? 1 : -1;\n const defaultVMetrics = font.defaultVMetrics;\n const widthAdvanceScale = fontSize * current.fontMatrix[0];\n\n const simpleFillText =\n current.textRenderingMode === TextRenderingMode.FILL &&\n !font.disableFontFace &&\n !current.patternFill;\n\n ctx.save();\n ctx.transform(...current.textMatrix);\n ctx.translate(current.x, current.y + current.textRise);\n\n if (fontDirection > 0) {\n ctx.scale(textHScale, -1);\n } else {\n ctx.scale(textHScale, 1);\n }\n\n let patternTransform;\n if (current.patternFill) {\n ctx.save();\n const pattern = current.fillColor.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL\n );\n patternTransform = getCurrentTransform(ctx);\n ctx.restore();\n ctx.fillStyle = pattern;\n }\n\n let lineWidth = current.lineWidth;\n const scale = current.textMatrixScale;\n if (scale === 0 || lineWidth === 0) {\n const fillStrokeMode =\n current.textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n lineWidth = this.getSinglePixelWidth();\n }\n } else {\n lineWidth /= scale;\n }\n\n if (fontSizeScale !== 1.0) {\n ctx.scale(fontSizeScale, fontSizeScale);\n lineWidth /= fontSizeScale;\n }\n\n ctx.lineWidth = lineWidth;\n\n if (font.isInvalidPDFjsFont) {\n const chars = [];\n let width = 0;\n for (const glyph of glyphs) {\n chars.push(glyph.unicode);\n width += glyph.width;\n }\n ctx.fillText(chars.join(\"\"), 0, 0);\n current.x += width * widthAdvanceScale * textHScale;\n ctx.restore();\n this.compose();\n\n return undefined;\n }\n\n let x = 0,\n i;\n for (i = 0; i < glyphsLength; ++i) {\n const glyph = glyphs[i];\n if (typeof glyph === \"number\") {\n x += (spacingDir * glyph * fontSize) / 1000;\n continue;\n }\n\n let restoreNeeded = false;\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const character = glyph.fontChar;\n const accent = glyph.accent;\n let scaledX, scaledY;\n let width = glyph.width;\n if (vertical) {\n const vmetric = glyph.vmetric || defaultVMetrics;\n const vx =\n -(glyph.vmetric ? vmetric[1] : width * 0.5) * widthAdvanceScale;\n const vy = vmetric[2] * widthAdvanceScale;\n\n width = vmetric ? -vmetric[0] : width;\n scaledX = vx / fontSizeScale;\n scaledY = (x + vy) / fontSizeScale;\n } else {\n scaledX = x / fontSizeScale;\n scaledY = 0;\n }\n\n if (font.remeasure && width > 0) {\n // Some standard fonts may not have the exact width: rescale per\n // character if measured width is greater than expected glyph width\n // and subpixel-aa is enabled, otherwise just center the glyph.\n const measuredWidth =\n ((ctx.measureText(character).width * 1000) / fontSize) *\n fontSizeScale;\n if (width < measuredWidth && this.isFontSubpixelAAEnabled) {\n const characterScaleX = width / measuredWidth;\n restoreNeeded = true;\n ctx.save();\n ctx.scale(characterScaleX, 1);\n scaledX /= characterScaleX;\n } else if (width !== measuredWidth) {\n scaledX +=\n (((width - measuredWidth) / 2000) * fontSize) / fontSizeScale;\n }\n }\n\n // Only attempt to draw the glyph if it is actually in the embedded font\n // file or if there isn't a font file so the fallback font is shown.\n if (this.contentVisible && (glyph.isInFont || font.missingFile)) {\n if (simpleFillText && !accent) {\n // common case\n ctx.fillText(character, scaledX, scaledY);\n } else {\n this.paintChar(character, scaledX, scaledY, patternTransform);\n if (accent) {\n const scaledAccentX =\n scaledX + (fontSize * accent.offset.x) / fontSizeScale;\n const scaledAccentY =\n scaledY - (fontSize * accent.offset.y) / fontSizeScale;\n this.paintChar(\n accent.fontChar,\n scaledAccentX,\n scaledAccentY,\n patternTransform\n );\n }\n }\n }\n\n const charWidth = vertical\n ? width * widthAdvanceScale - spacing * fontDirection\n : width * widthAdvanceScale + spacing * fontDirection;\n x += charWidth;\n\n if (restoreNeeded) {\n ctx.restore();\n }\n }\n if (vertical) {\n current.y -= x;\n } else {\n current.x += x * textHScale;\n }\n ctx.restore();\n this.compose();\n\n return undefined;\n }\n\n showType3Text(glyphs) {\n // Type3 fonts - each glyph is a \"mini-PDF\"\n const ctx = this.ctx;\n const current = this.current;\n const font = current.font;\n const fontSize = current.fontSize;\n const fontDirection = current.fontDirection;\n const spacingDir = font.vertical ? 1 : -1;\n const charSpacing = current.charSpacing;\n const wordSpacing = current.wordSpacing;\n const textHScale = current.textHScale * fontDirection;\n const fontMatrix = current.fontMatrix || FONT_IDENTITY_MATRIX;\n const glyphsLength = glyphs.length;\n const isTextInvisible =\n current.textRenderingMode === TextRenderingMode.INVISIBLE;\n let i, glyph, width, spacingLength;\n\n if (isTextInvisible || fontSize === 0) {\n return;\n }\n this._cachedScaleForStroking[0] = -1;\n this._cachedGetSinglePixelWidth = null;\n\n ctx.save();\n ctx.transform(...current.textMatrix);\n ctx.translate(current.x, current.y);\n\n ctx.scale(textHScale, fontDirection);\n\n for (i = 0; i < glyphsLength; ++i) {\n glyph = glyphs[i];\n if (typeof glyph === \"number\") {\n spacingLength = (spacingDir * glyph * fontSize) / 1000;\n this.ctx.translate(spacingLength, 0);\n current.x += spacingLength * textHScale;\n continue;\n }\n\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const operatorList = font.charProcOperatorList[glyph.operatorListId];\n if (!operatorList) {\n warn(`Type3 character \"${glyph.operatorListId}\" is not available.`);\n continue;\n }\n if (this.contentVisible) {\n this.processingType3 = glyph;\n this.save();\n ctx.scale(fontSize, fontSize);\n ctx.transform(...fontMatrix);\n this.executeOperatorList(operatorList);\n this.restore();\n }\n\n const transformed = Util.applyTransform([glyph.width, 0], fontMatrix);\n width = transformed[0] * fontSize + spacing;\n\n ctx.translate(width, 0);\n current.x += width * textHScale;\n }\n ctx.restore();\n this.processingType3 = null;\n }\n\n // Type3 fonts\n setCharWidth(xWidth, yWidth) {\n // We can safely ignore this since the width should be the same\n // as the width in the Widths array.\n }\n\n setCharWidthAndBounds(xWidth, yWidth, llx, lly, urx, ury) {\n this.ctx.rect(llx, lly, urx - llx, ury - lly);\n this.ctx.clip();\n this.endPath();\n }\n\n // Color\n getColorN_Pattern(IR) {\n let pattern;\n if (IR[0] === \"TilingPattern\") {\n const color = IR[1];\n const baseTransform = this.baseTransform || getCurrentTransform(this.ctx);\n const canvasGraphicsFactory = {\n createCanvasGraphics: ctx => {\n return new CanvasGraphics(\n ctx,\n this.commonObjs,\n this.objs,\n this.canvasFactory,\n this.filterFactory,\n {\n optionalContentConfig: this.optionalContentConfig,\n markedContentStack: this.markedContentStack,\n }\n );\n },\n };\n pattern = new TilingPattern(\n IR,\n color,\n this.ctx,\n canvasGraphicsFactory,\n baseTransform\n );\n } else {\n pattern = this._getPattern(IR[1], IR[2]);\n }\n return pattern;\n }\n\n setStrokeColorN() {\n this.current.strokeColor = this.getColorN_Pattern(arguments);\n }\n\n setFillColorN() {\n this.current.fillColor = this.getColorN_Pattern(arguments);\n this.current.patternFill = true;\n }\n\n setStrokeRGBColor(r, g, b) {\n const color = Util.makeHexColor(r, g, b);\n this.ctx.strokeStyle = color;\n this.current.strokeColor = color;\n }\n\n setFillRGBColor(r, g, b) {\n const color = Util.makeHexColor(r, g, b);\n this.ctx.fillStyle = color;\n this.current.fillColor = color;\n this.current.patternFill = false;\n }\n\n _getPattern(objId, matrix = null) {\n let pattern;\n if (this.cachedPatterns.has(objId)) {\n pattern = this.cachedPatterns.get(objId);\n } else {\n pattern = getShadingPattern(this.getObject(objId));\n this.cachedPatterns.set(objId, pattern);\n }\n if (matrix) {\n pattern.matrix = matrix;\n }\n return pattern;\n }\n\n shadingFill(objId) {\n if (!this.contentVisible) {\n return;\n }\n const ctx = this.ctx;\n\n this.save();\n const pattern = this._getPattern(objId);\n ctx.fillStyle = pattern.getPattern(\n ctx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.SHADING\n );\n\n const inv = getCurrentTransformInverse(ctx);\n if (inv) {\n const { width, height } = ctx.canvas;\n const [x0, y0, x1, y1] = Util.getAxialAlignedBoundingBox(\n [0, 0, width, height],\n inv\n );\n\n this.ctx.fillRect(x0, y0, x1 - x0, y1 - y0);\n } else {\n // HACK to draw the gradient onto an infinite rectangle.\n // PDF gradients are drawn across the entire image while\n // Canvas only allows gradients to be drawn in a rectangle\n // The following bug should allow us to remove this.\n // https://bugzilla.mozilla.org/show_bug.cgi?id=664884\n\n this.ctx.fillRect(-1e10, -1e10, 2e10, 2e10);\n }\n\n this.compose(this.current.getClippedPathBoundingBox());\n this.restore();\n }\n\n // Images\n beginInlineImage() {\n unreachable(\"Should not call beginInlineImage\");\n }\n\n beginImageData() {\n unreachable(\"Should not call beginImageData\");\n }\n\n paintFormXObjectBegin(matrix, bbox) {\n if (!this.contentVisible) {\n return;\n }\n this.save();\n this.baseTransformStack.push(this.baseTransform);\n\n if (Array.isArray(matrix) && matrix.length === 6) {\n this.transform(...matrix);\n }\n\n this.baseTransform = getCurrentTransform(this.ctx);\n\n if (bbox) {\n const width = bbox[2] - bbox[0];\n const height = bbox[3] - bbox[1];\n this.ctx.rect(bbox[0], bbox[1], width, height);\n this.current.updateRectMinMax(getCurrentTransform(this.ctx), bbox);\n this.clip();\n this.endPath();\n }\n }\n\n paintFormXObjectEnd() {\n if (!this.contentVisible) {\n return;\n }\n this.restore();\n this.baseTransform = this.baseTransformStack.pop();\n }\n\n beginGroup(group) {\n if (!this.contentVisible) {\n return;\n }\n\n this.save();\n // If there's an active soft mask we don't want it enabled for the group, so\n // clear it out. The mask and suspended canvas will be restored in endGroup.\n if (this.inSMaskMode) {\n this.endSMaskMode();\n this.current.activeSMask = null;\n }\n\n const currentCtx = this.ctx;\n // TODO non-isolated groups - according to Rik at adobe non-isolated\n // group results aren't usually that different and they even have tools\n // that ignore this setting. Notes from Rik on implementing:\n // - When you encounter an transparency group, create a new canvas with\n // the dimensions of the bbox\n // - copy the content from the previous canvas to the new canvas\n // - draw as usual\n // - remove the backdrop alpha:\n // alphaNew = 1 - (1 - alpha)/(1 - alphaBackdrop) with 'alpha' the alpha\n // value of your transparency group and 'alphaBackdrop' the alpha of the\n // backdrop\n // - remove background color:\n // colorNew = color - alphaNew *colorBackdrop /(1 - alphaNew)\n if (!group.isolated) {\n info(\"TODO: Support non-isolated groups.\");\n }\n\n // TODO knockout - supposedly possible with the clever use of compositing\n // modes.\n if (group.knockout) {\n warn(\"Knockout groups not supported.\");\n }\n\n const currentTransform = getCurrentTransform(currentCtx);\n if (group.matrix) {\n currentCtx.transform(...group.matrix);\n }\n if (!group.bbox) {\n throw new Error(\"Bounding box is required.\");\n }\n\n // Based on the current transform figure out how big the bounding box\n // will actually be.\n let bounds = Util.getAxialAlignedBoundingBox(\n group.bbox,\n getCurrentTransform(currentCtx)\n );\n // Clip the bounding box to the current canvas.\n const canvasBounds = [\n 0,\n 0,\n currentCtx.canvas.width,\n currentCtx.canvas.height,\n ];\n bounds = Util.intersect(bounds, canvasBounds) || [0, 0, 0, 0];\n // Use ceil in case we're between sizes so we don't create canvas that is\n // too small and make the canvas at least 1x1 pixels.\n const offsetX = Math.floor(bounds[0]);\n const offsetY = Math.floor(bounds[1]);\n let drawnWidth = Math.max(Math.ceil(bounds[2]) - offsetX, 1);\n let drawnHeight = Math.max(Math.ceil(bounds[3]) - offsetY, 1);\n let scaleX = 1,\n scaleY = 1;\n if (drawnWidth > MAX_GROUP_SIZE) {\n scaleX = drawnWidth / MAX_GROUP_SIZE;\n drawnWidth = MAX_GROUP_SIZE;\n }\n if (drawnHeight > MAX_GROUP_SIZE) {\n scaleY = drawnHeight / MAX_GROUP_SIZE;\n drawnHeight = MAX_GROUP_SIZE;\n }\n\n this.current.startNewPathAndClipBox([0, 0, drawnWidth, drawnHeight]);\n\n let cacheId = \"groupAt\" + this.groupLevel;\n if (group.smask) {\n // Using two cache entries is case if masks are used one after another.\n cacheId += \"_smask_\" + (this.smaskCounter++ % 2);\n }\n const scratchCanvas = this.cachedCanvases.getCanvas(\n cacheId,\n drawnWidth,\n drawnHeight\n );\n const groupCtx = scratchCanvas.context;\n\n // Since we created a new canvas that is just the size of the bounding box\n // we have to translate the group ctx.\n groupCtx.scale(1 / scaleX, 1 / scaleY);\n groupCtx.translate(-offsetX, -offsetY);\n groupCtx.transform(...currentTransform);\n\n if (group.smask) {\n // Saving state and cached mask to be used in setGState.\n this.smaskStack.push({\n canvas: scratchCanvas.canvas,\n context: groupCtx,\n offsetX,\n offsetY,\n scaleX,\n scaleY,\n subtype: group.smask.subtype,\n backdrop: group.smask.backdrop,\n transferMap: group.smask.transferMap || null,\n startTransformInverse: null, // used during suspend operation\n });\n } else {\n // Setup the current ctx so when the group is popped we draw it at the\n // right location.\n currentCtx.setTransform(1, 0, 0, 1, 0, 0);\n currentCtx.translate(offsetX, offsetY);\n currentCtx.scale(scaleX, scaleY);\n currentCtx.save();\n }\n // The transparency group inherits all off the current graphics state\n // except the blend mode, soft mask, and alpha constants.\n copyCtxState(currentCtx, groupCtx);\n this.ctx = groupCtx;\n this.setGState([\n [\"BM\", \"source-over\"],\n [\"ca\", 1],\n [\"CA\", 1],\n ]);\n this.groupStack.push(currentCtx);\n this.groupLevel++;\n }\n\n endGroup(group) {\n if (!this.contentVisible) {\n return;\n }\n this.groupLevel--;\n const groupCtx = this.ctx;\n const ctx = this.groupStack.pop();\n this.ctx = ctx;\n // Turn off image smoothing to avoid sub pixel interpolation which can\n // look kind of blurry for some pdfs.\n this.ctx.imageSmoothingEnabled = false;\n\n if (group.smask) {\n this.tempSMask = this.smaskStack.pop();\n this.restore();\n } else {\n this.ctx.restore();\n const currentMtx = getCurrentTransform(this.ctx);\n this.restore();\n this.ctx.save();\n this.ctx.setTransform(...currentMtx);\n const dirtyBox = Util.getAxialAlignedBoundingBox(\n [0, 0, groupCtx.canvas.width, groupCtx.canvas.height],\n currentMtx\n );\n this.ctx.drawImage(groupCtx.canvas, 0, 0);\n this.ctx.restore();\n this.compose(dirtyBox);\n }\n }\n\n beginAnnotation(id, rect, transform, matrix, hasOwnCanvas) {\n // The annotations are drawn just after the page content.\n // The page content drawing can potentially have set a transform,\n // a clipping path, whatever...\n // So in order to have something clean, we restore the initial state.\n this.#restoreInitialState();\n resetCtxToDefault(this.ctx);\n\n this.ctx.save();\n this.save();\n\n if (this.baseTransform) {\n this.ctx.setTransform(...this.baseTransform);\n }\n\n if (Array.isArray(rect) && rect.length === 4) {\n const width = rect[2] - rect[0];\n const height = rect[3] - rect[1];\n\n if (hasOwnCanvas && this.annotationCanvasMap) {\n transform = transform.slice();\n transform[4] -= rect[0];\n transform[5] -= rect[1];\n\n rect = rect.slice();\n rect[0] = rect[1] = 0;\n rect[2] = width;\n rect[3] = height;\n\n const [scaleX, scaleY] = Util.singularValueDecompose2dScale(\n getCurrentTransform(this.ctx)\n );\n const { viewportScale } = this;\n const canvasWidth = Math.ceil(\n width * this.outputScaleX * viewportScale\n );\n const canvasHeight = Math.ceil(\n height * this.outputScaleY * viewportScale\n );\n\n this.annotationCanvas = this.canvasFactory.create(\n canvasWidth,\n canvasHeight\n );\n const { canvas, context } = this.annotationCanvas;\n this.annotationCanvasMap.set(id, canvas);\n this.annotationCanvas.savedCtx = this.ctx;\n this.ctx = context;\n this.ctx.save();\n this.ctx.setTransform(scaleX, 0, 0, -scaleY, 0, height * scaleY);\n\n resetCtxToDefault(this.ctx);\n } else {\n resetCtxToDefault(this.ctx);\n\n this.ctx.rect(rect[0], rect[1], width, height);\n this.ctx.clip();\n this.endPath();\n }\n }\n\n this.current = new CanvasExtraState(\n this.ctx.canvas.width,\n this.ctx.canvas.height\n );\n\n this.transform(...transform);\n this.transform(...matrix);\n }\n\n endAnnotation() {\n if (this.annotationCanvas) {\n this.ctx.restore();\n this.#drawFilter();\n\n this.ctx = this.annotationCanvas.savedCtx;\n delete this.annotationCanvas.savedCtx;\n delete this.annotationCanvas;\n }\n }\n\n paintImageMaskXObject(img) {\n if (!this.contentVisible) {\n return;\n }\n const count = img.count;\n img = this.getObject(img.data, img);\n img.count = count;\n\n const ctx = this.ctx;\n const glyph = this.processingType3;\n\n if (glyph) {\n if (glyph.compiled === undefined) {\n glyph.compiled = compileType3Glyph(img);\n }\n\n if (glyph.compiled) {\n glyph.compiled(ctx);\n return;\n }\n }\n const mask = this._createMaskCanvas(img);\n const maskCanvas = mask.canvas;\n\n ctx.save();\n // The mask is drawn with the transform applied. Reset the current\n // transform to draw to the identity.\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.drawImage(maskCanvas, mask.offsetX, mask.offsetY);\n ctx.restore();\n this.compose();\n }\n\n paintImageMaskXObjectRepeat(\n img,\n scaleX,\n skewX = 0,\n skewY = 0,\n scaleY,\n positions\n ) {\n if (!this.contentVisible) {\n return;\n }\n\n img = this.getObject(img.data, img);\n\n const ctx = this.ctx;\n ctx.save();\n const currentTransform = getCurrentTransform(ctx);\n ctx.transform(scaleX, skewX, skewY, scaleY, 0, 0);\n const mask = this._createMaskCanvas(img);\n\n ctx.setTransform(\n 1,\n 0,\n 0,\n 1,\n mask.offsetX - currentTransform[4],\n mask.offsetY - currentTransform[5]\n );\n for (let i = 0, ii = positions.length; i < ii; i += 2) {\n const trans = Util.transform(currentTransform, [\n scaleX,\n skewX,\n skewY,\n scaleY,\n positions[i],\n positions[i + 1],\n ]);\n\n const [x, y] = Util.applyTransform([0, 0], trans);\n ctx.drawImage(mask.canvas, x, y);\n }\n ctx.restore();\n this.compose();\n }\n\n paintImageMaskXObjectGroup(images) {\n if (!this.contentVisible) {\n return;\n }\n const ctx = this.ctx;\n\n const fillColor = this.current.fillColor;\n const isPatternFill = this.current.patternFill;\n\n for (const image of images) {\n const { data, width, height, transform } = image;\n\n const maskCanvas = this.cachedCanvases.getCanvas(\n \"maskCanvas\",\n width,\n height\n );\n const maskCtx = maskCanvas.context;\n maskCtx.save();\n\n const img = this.getObject(data, image);\n putBinaryImageMask(maskCtx, img);\n\n maskCtx.globalCompositeOperation = \"source-in\";\n\n maskCtx.fillStyle = isPatternFill\n ? fillColor.getPattern(\n maskCtx,\n this,\n getCurrentTransformInverse(ctx),\n PathType.FILL\n )\n : fillColor;\n maskCtx.fillRect(0, 0, width, height);\n\n maskCtx.restore();\n\n ctx.save();\n ctx.transform(...transform);\n ctx.scale(1, -1);\n drawImageAtIntegerCoords(\n ctx,\n maskCanvas.canvas,\n 0,\n 0,\n width,\n height,\n 0,\n -1,\n 1,\n 1\n );\n ctx.restore();\n }\n this.compose();\n }\n\n paintImageXObject(objId) {\n if (!this.contentVisible) {\n return;\n }\n const imgData = this.getObject(objId);\n if (!imgData) {\n warn(\"Dependent image isn't ready yet\");\n return;\n }\n\n this.paintInlineImageXObject(imgData);\n }\n\n paintImageXObjectRepeat(objId, scaleX, scaleY, positions) {\n if (!this.contentVisible) {\n return;\n }\n const imgData = this.getObject(objId);\n if (!imgData) {\n warn(\"Dependent image isn't ready yet\");\n return;\n }\n\n const width = imgData.width;\n const height = imgData.height;\n const map = [];\n for (let i = 0, ii = positions.length; i < ii; i += 2) {\n map.push({\n transform: [scaleX, 0, 0, scaleY, positions[i], positions[i + 1]],\n x: 0,\n y: 0,\n w: width,\n h: height,\n });\n }\n this.paintInlineImageXObjectGroup(imgData, map);\n }\n\n applyTransferMapsToCanvas(ctx) {\n if (this.current.transferMaps !== \"none\") {\n ctx.filter = this.current.transferMaps;\n ctx.drawImage(ctx.canvas, 0, 0);\n ctx.filter = \"none\";\n }\n return ctx.canvas;\n }\n\n applyTransferMapsToBitmap(imgData) {\n if (this.current.transferMaps === \"none\") {\n return imgData.bitmap;\n }\n const { bitmap, width, height } = imgData;\n const tmpCanvas = this.cachedCanvases.getCanvas(\n \"inlineImage\",\n width,\n height\n );\n const tmpCtx = tmpCanvas.context;\n tmpCtx.filter = this.current.transferMaps;\n tmpCtx.drawImage(bitmap, 0, 0);\n tmpCtx.filter = \"none\";\n\n return tmpCanvas.canvas;\n }\n\n paintInlineImageXObject(imgData) {\n if (!this.contentVisible) {\n return;\n }\n const width = imgData.width;\n const height = imgData.height;\n const ctx = this.ctx;\n\n this.save();\n\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n !isNodeJS\n ) {\n // The filter, if any, will be applied in applyTransferMapsToBitmap.\n // It must be applied to the image before rescaling else some artifacts\n // could appear.\n // The final restore will reset it to its value.\n const { filter } = ctx;\n if (filter !== \"none\" && filter !== \"\") {\n ctx.filter = \"none\";\n }\n }\n\n // scale the image to the unit square\n ctx.scale(1 / width, -1 / height);\n\n let imgToPaint;\n if (imgData.bitmap) {\n imgToPaint = this.applyTransferMapsToBitmap(imgData);\n } else if (\n (typeof HTMLElement === \"function\" && imgData instanceof HTMLElement) ||\n !imgData.data\n ) {\n // typeof check is needed due to node.js support, see issue #8489\n imgToPaint = imgData;\n } else {\n const tmpCanvas = this.cachedCanvases.getCanvas(\n \"inlineImage\",\n width,\n height\n );\n const tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData);\n imgToPaint = this.applyTransferMapsToCanvas(tmpCtx);\n }\n\n const scaled = this._scaleImage(\n imgToPaint,\n getCurrentTransformInverse(ctx)\n );\n ctx.imageSmoothingEnabled = getImageSmoothingEnabled(\n getCurrentTransform(ctx),\n imgData.interpolate\n );\n\n drawImageAtIntegerCoords(\n ctx,\n scaled.img,\n 0,\n 0,\n scaled.paintWidth,\n scaled.paintHeight,\n 0,\n -height,\n width,\n height\n );\n this.compose();\n this.restore();\n }\n\n paintInlineImageXObjectGroup(imgData, map) {\n if (!this.contentVisible) {\n return;\n }\n const ctx = this.ctx;\n let imgToPaint;\n if (imgData.bitmap) {\n imgToPaint = imgData.bitmap;\n } else {\n const w = imgData.width;\n const h = imgData.height;\n\n const tmpCanvas = this.cachedCanvases.getCanvas(\"inlineImage\", w, h);\n const tmpCtx = tmpCanvas.context;\n putBinaryImageData(tmpCtx, imgData);\n imgToPaint = this.applyTransferMapsToCanvas(tmpCtx);\n }\n\n for (const entry of map) {\n ctx.save();\n ctx.transform(...entry.transform);\n ctx.scale(1, -1);\n drawImageAtIntegerCoords(\n ctx,\n imgToPaint,\n entry.x,\n entry.y,\n entry.w,\n entry.h,\n 0,\n -1,\n 1,\n 1\n );\n ctx.restore();\n }\n this.compose();\n }\n\n paintSolidColorImageMask() {\n if (!this.contentVisible) {\n return;\n }\n this.ctx.fillRect(0, 0, 1, 1);\n this.compose();\n }\n\n // Marked content\n\n markPoint(tag) {\n // TODO Marked content.\n }\n\n markPointProps(tag, properties) {\n // TODO Marked content.\n }\n\n beginMarkedContent(tag) {\n this.markedContentStack.push({\n visible: true,\n });\n }\n\n beginMarkedContentProps(tag, properties) {\n if (tag === \"OC\") {\n this.markedContentStack.push({\n visible: this.optionalContentConfig.isVisible(properties),\n });\n } else {\n this.markedContentStack.push({\n visible: true,\n });\n }\n this.contentVisible = this.isContentVisible();\n }\n\n endMarkedContent() {\n this.markedContentStack.pop();\n this.contentVisible = this.isContentVisible();\n }\n\n // Compatibility\n\n beginCompat() {\n // TODO ignore undefined operators (should we do that anyway?)\n }\n\n endCompat() {\n // TODO stop ignoring undefined operators\n }\n\n // Helper functions\n\n consumePath(clipBox) {\n const isEmpty = this.current.isEmptyClip();\n if (this.pendingClip) {\n this.current.updateClipFromPath();\n }\n if (!this.pendingClip) {\n this.compose(clipBox);\n }\n const ctx = this.ctx;\n if (this.pendingClip) {\n if (!isEmpty) {\n if (this.pendingClip === EO_CLIP) {\n ctx.clip(\"evenodd\");\n } else {\n ctx.clip();\n }\n }\n this.pendingClip = null;\n }\n this.current.startNewPathAndClipBox(this.current.clipBox);\n ctx.beginPath();\n }\n\n getSinglePixelWidth() {\n if (!this._cachedGetSinglePixelWidth) {\n const m = getCurrentTransform(this.ctx);\n if (m[1] === 0 && m[2] === 0) {\n // Fast path\n this._cachedGetSinglePixelWidth =\n 1 / Math.min(Math.abs(m[0]), Math.abs(m[3]));\n } else {\n const absDet = Math.abs(m[0] * m[3] - m[2] * m[1]);\n const normX = Math.hypot(m[0], m[2]);\n const normY = Math.hypot(m[1], m[3]);\n this._cachedGetSinglePixelWidth = Math.max(normX, normY) / absDet;\n }\n }\n return this._cachedGetSinglePixelWidth;\n }\n\n getScaleForStroking() {\n // A pixel has thicknessX = thicknessY = 1;\n // A transformed pixel is a parallelogram and the thicknesses\n // corresponds to the heights.\n // The goal of this function is to rescale before setting the\n // lineWidth in order to have both thicknesses greater or equal\n // to 1 after transform.\n if (this._cachedScaleForStroking[0] === -1) {\n const { lineWidth } = this.current;\n const { a, b, c, d } = this.ctx.getTransform();\n let scaleX, scaleY;\n\n if (b === 0 && c === 0) {\n // Fast path\n const normX = Math.abs(a);\n const normY = Math.abs(d);\n if (normX === normY) {\n if (lineWidth === 0) {\n scaleX = scaleY = 1 / normX;\n } else {\n const scaledLineWidth = normX * lineWidth;\n scaleX = scaleY = scaledLineWidth < 1 ? 1 / scaledLineWidth : 1;\n }\n } else if (lineWidth === 0) {\n scaleX = 1 / normX;\n scaleY = 1 / normY;\n } else {\n const scaledXLineWidth = normX * lineWidth;\n const scaledYLineWidth = normY * lineWidth;\n scaleX = scaledXLineWidth < 1 ? 1 / scaledXLineWidth : 1;\n scaleY = scaledYLineWidth < 1 ? 1 / scaledYLineWidth : 1;\n }\n } else {\n // A pixel (base (x, y)) is transformed by M into a parallelogram:\n // - its area is |det(M)|;\n // - heightY (orthogonal to Mx) has a length: |det(M)| / norm(Mx);\n // - heightX (orthogonal to My) has a length: |det(M)| / norm(My).\n // heightX and heightY are the thicknesses of the transformed pixel\n // and they must be both greater or equal to 1.\n const absDet = Math.abs(a * d - b * c);\n const normX = Math.hypot(a, b);\n const normY = Math.hypot(c, d);\n if (lineWidth === 0) {\n scaleX = normY / absDet;\n scaleY = normX / absDet;\n } else {\n const baseArea = lineWidth * absDet;\n scaleX = normY > baseArea ? normY / baseArea : 1;\n scaleY = normX > baseArea ? normX / baseArea : 1;\n }\n }\n this._cachedScaleForStroking[0] = scaleX;\n this._cachedScaleForStroking[1] = scaleY;\n }\n return this._cachedScaleForStroking;\n }\n\n // Rescale before stroking in order to have a final lineWidth\n // with both thicknesses greater or equal to 1.\n rescaleAndStroke(saveRestore) {\n const { ctx } = this;\n const { lineWidth } = this.current;\n const [scaleX, scaleY] = this.getScaleForStroking();\n\n ctx.lineWidth = lineWidth || 1;\n\n if (scaleX === 1 && scaleY === 1) {\n ctx.stroke();\n return;\n }\n\n const dashes = ctx.getLineDash();\n if (saveRestore) {\n ctx.save();\n }\n\n ctx.scale(scaleX, scaleY);\n\n // How the dashed line is rendered depends on the current transform...\n // so we added a rescale to handle too thin lines and consequently\n // the way the line is dashed will be modified.\n // If scaleX === scaleY, the dashed lines will be rendered correctly\n // else we'll have some bugs (but only with too thin lines).\n // Here we take the max... why not taking the min... or something else.\n // Anyway, as said it's buggy when scaleX !== scaleY.\n if (dashes.length > 0) {\n const scale = Math.max(scaleX, scaleY);\n ctx.setLineDash(dashes.map(x => x / scale));\n ctx.lineDashOffset /= scale;\n }\n\n ctx.stroke();\n\n if (saveRestore) {\n ctx.restore();\n }\n }\n\n isContentVisible() {\n for (let i = this.markedContentStack.length - 1; i >= 0; i--) {\n if (!this.markedContentStack[i].visible) {\n return false;\n }\n }\n return true;\n }\n}\n\nfor (const op in OPS) {\n if (CanvasGraphics.prototype[op] !== undefined) {\n CanvasGraphics.prototype[OPS[op]] = CanvasGraphics.prototype[op];\n }\n}\n\nexport { CanvasGraphics };\n","/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FormatError, info, unreachable, Util } from \"../shared/util.js\";\nimport { getCurrentTransform } from \"./display_utils.js\";\n\nconst PathType = {\n FILL: \"Fill\",\n STROKE: \"Stroke\",\n SHADING: \"Shading\",\n};\n\nfunction applyBoundingBox(ctx, bbox) {\n if (!bbox) {\n return;\n }\n const width = bbox[2] - bbox[0];\n const height = bbox[3] - bbox[1];\n const region = new Path2D();\n region.rect(bbox[0], bbox[1], width, height);\n ctx.clip(region);\n}\n\nclass BaseShadingPattern {\n constructor() {\n if (this.constructor === BaseShadingPattern) {\n unreachable(\"Cannot initialize BaseShadingPattern.\");\n }\n }\n\n getPattern() {\n unreachable(\"Abstract method `getPattern` called.\");\n }\n}\n\nclass RadialAxialShadingPattern extends BaseShadingPattern {\n constructor(IR) {\n super();\n this._type = IR[1];\n this._bbox = IR[2];\n this._colorStops = IR[3];\n this._p0 = IR[4];\n this._p1 = IR[5];\n this._r0 = IR[6];\n this._r1 = IR[7];\n this.matrix = null;\n }\n\n _createGradient(ctx) {\n let grad;\n if (this._type === \"axial\") {\n grad = ctx.createLinearGradient(\n this._p0[0],\n this._p0[1],\n this._p1[0],\n this._p1[1]\n );\n } else if (this._type === \"radial\") {\n grad = ctx.createRadialGradient(\n this._p0[0],\n this._p0[1],\n this._r0,\n this._p1[0],\n this._p1[1],\n this._r1\n );\n }\n\n for (const colorStop of this._colorStops) {\n grad.addColorStop(colorStop[0], colorStop[1]);\n }\n return grad;\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n let pattern;\n if (pathType === PathType.STROKE || pathType === PathType.FILL) {\n const ownerBBox = owner.current.getClippedPathBoundingBox(\n pathType,\n getCurrentTransform(ctx)\n ) || [0, 0, 0, 0];\n // Create a canvas that is only as big as the current path. This doesn't\n // allow us to cache the pattern, but it generally creates much smaller\n // canvases and saves memory use. See bug 1722807 for an example.\n const width = Math.ceil(ownerBBox[2] - ownerBBox[0]) || 1;\n const height = Math.ceil(ownerBBox[3] - ownerBBox[1]) || 1;\n\n const tmpCanvas = owner.cachedCanvases.getCanvas(\n \"pattern\",\n width,\n height,\n true\n );\n\n const tmpCtx = tmpCanvas.context;\n tmpCtx.clearRect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n tmpCtx.beginPath();\n tmpCtx.rect(0, 0, tmpCtx.canvas.width, tmpCtx.canvas.height);\n // Non shading fill patterns are positioned relative to the base transform\n // (usually the page's initial transform), but we may have created a\n // smaller canvas based on the path, so we must account for the shift.\n tmpCtx.translate(-ownerBBox[0], -ownerBBox[1]);\n inverse = Util.transform(inverse, [\n 1,\n 0,\n 0,\n 1,\n ownerBBox[0],\n ownerBBox[1],\n ]);\n\n tmpCtx.transform(...owner.baseTransform);\n if (this.matrix) {\n tmpCtx.transform(...this.matrix);\n }\n applyBoundingBox(tmpCtx, this._bbox);\n\n tmpCtx.fillStyle = this._createGradient(tmpCtx);\n tmpCtx.fill();\n\n pattern = ctx.createPattern(tmpCanvas.canvas, \"no-repeat\");\n const domMatrix = new DOMMatrix(inverse);\n pattern.setTransform(domMatrix);\n } else {\n // Shading fills are applied relative to the current matrix which is also\n // how canvas gradients work, so there's no need to do anything special\n // here.\n applyBoundingBox(ctx, this._bbox);\n pattern = this._createGradient(ctx);\n }\n return pattern;\n }\n}\n\nfunction drawTriangle(data, context, p1, p2, p3, c1, c2, c3) {\n // Very basic Gouraud-shaded triangle rasterization algorithm.\n const coords = context.coords,\n colors = context.colors;\n const bytes = data.data,\n rowSize = data.width * 4;\n let tmp;\n if (coords[p1 + 1] > coords[p2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n if (coords[p2 + 1] > coords[p3 + 1]) {\n tmp = p2;\n p2 = p3;\n p3 = tmp;\n tmp = c2;\n c2 = c3;\n c3 = tmp;\n }\n if (coords[p1 + 1] > coords[p2 + 1]) {\n tmp = p1;\n p1 = p2;\n p2 = tmp;\n tmp = c1;\n c1 = c2;\n c2 = tmp;\n }\n const x1 = (coords[p1] + context.offsetX) * context.scaleX;\n const y1 = (coords[p1 + 1] + context.offsetY) * context.scaleY;\n const x2 = (coords[p2] + context.offsetX) * context.scaleX;\n const y2 = (coords[p2 + 1] + context.offsetY) * context.scaleY;\n const x3 = (coords[p3] + context.offsetX) * context.scaleX;\n const y3 = (coords[p3 + 1] + context.offsetY) * context.scaleY;\n if (y1 >= y3) {\n return;\n }\n const c1r = colors[c1],\n c1g = colors[c1 + 1],\n c1b = colors[c1 + 2];\n const c2r = colors[c2],\n c2g = colors[c2 + 1],\n c2b = colors[c2 + 2];\n const c3r = colors[c3],\n c3g = colors[c3 + 1],\n c3b = colors[c3 + 2];\n\n const minY = Math.round(y1),\n maxY = Math.round(y3);\n let xa, car, cag, cab;\n let xb, cbr, cbg, cbb;\n for (let y = minY; y <= maxY; y++) {\n if (y < y2) {\n const k = y < y1 ? 0 : (y1 - y) / (y1 - y2);\n xa = x1 - (x1 - x2) * k;\n car = c1r - (c1r - c2r) * k;\n cag = c1g - (c1g - c2g) * k;\n cab = c1b - (c1b - c2b) * k;\n } else {\n let k;\n if (y > y3) {\n k = 1;\n } else if (y2 === y3) {\n k = 0;\n } else {\n k = (y2 - y) / (y2 - y3);\n }\n xa = x2 - (x2 - x3) * k;\n car = c2r - (c2r - c3r) * k;\n cag = c2g - (c2g - c3g) * k;\n cab = c2b - (c2b - c3b) * k;\n }\n\n let k;\n if (y < y1) {\n k = 0;\n } else if (y > y3) {\n k = 1;\n } else {\n k = (y1 - y) / (y1 - y3);\n }\n xb = x1 - (x1 - x3) * k;\n cbr = c1r - (c1r - c3r) * k;\n cbg = c1g - (c1g - c3g) * k;\n cbb = c1b - (c1b - c3b) * k;\n const x1_ = Math.round(Math.min(xa, xb));\n const x2_ = Math.round(Math.max(xa, xb));\n let j = rowSize * y + x1_ * 4;\n for (let x = x1_; x <= x2_; x++) {\n k = (xa - x) / (xa - xb);\n if (k < 0) {\n k = 0;\n } else if (k > 1) {\n k = 1;\n }\n bytes[j++] = (car - (car - cbr) * k) | 0;\n bytes[j++] = (cag - (cag - cbg) * k) | 0;\n bytes[j++] = (cab - (cab - cbb) * k) | 0;\n bytes[j++] = 255;\n }\n }\n}\n\nfunction drawFigure(data, figure, context) {\n const ps = figure.coords;\n const cs = figure.colors;\n let i, ii;\n switch (figure.type) {\n case \"lattice\":\n const verticesPerRow = figure.verticesPerRow;\n const rows = Math.floor(ps.length / verticesPerRow) - 1;\n const cols = verticesPerRow - 1;\n for (i = 0; i < rows; i++) {\n let q = i * verticesPerRow;\n for (let j = 0; j < cols; j++, q++) {\n drawTriangle(\n data,\n context,\n ps[q],\n ps[q + 1],\n ps[q + verticesPerRow],\n cs[q],\n cs[q + 1],\n cs[q + verticesPerRow]\n );\n drawTriangle(\n data,\n context,\n ps[q + verticesPerRow + 1],\n ps[q + 1],\n ps[q + verticesPerRow],\n cs[q + verticesPerRow + 1],\n cs[q + 1],\n cs[q + verticesPerRow]\n );\n }\n }\n break;\n case \"triangles\":\n for (i = 0, ii = ps.length; i < ii; i += 3) {\n drawTriangle(\n data,\n context,\n ps[i],\n ps[i + 1],\n ps[i + 2],\n cs[i],\n cs[i + 1],\n cs[i + 2]\n );\n }\n break;\n default:\n throw new Error(\"illegal figure\");\n }\n}\n\nclass MeshShadingPattern extends BaseShadingPattern {\n constructor(IR) {\n super();\n this._coords = IR[2];\n this._colors = IR[3];\n this._figures = IR[4];\n this._bounds = IR[5];\n this._bbox = IR[7];\n this._background = IR[8];\n this.matrix = null;\n }\n\n _createMeshCanvas(combinedScale, backgroundColor, cachedCanvases) {\n // we will increase scale on some weird factor to let antialiasing take\n // care of \"rough\" edges\n const EXPECTED_SCALE = 1.1;\n // MAX_PATTERN_SIZE is used to avoid OOM situation.\n const MAX_PATTERN_SIZE = 3000; // 10in @ 300dpi shall be enough\n // We need to keep transparent border around our pattern for fill():\n // createPattern with 'no-repeat' will bleed edges across entire area.\n const BORDER_SIZE = 2;\n\n const offsetX = Math.floor(this._bounds[0]);\n const offsetY = Math.floor(this._bounds[1]);\n const boundsWidth = Math.ceil(this._bounds[2]) - offsetX;\n const boundsHeight = Math.ceil(this._bounds[3]) - offsetY;\n\n const width = Math.min(\n Math.ceil(Math.abs(boundsWidth * combinedScale[0] * EXPECTED_SCALE)),\n MAX_PATTERN_SIZE\n );\n const height = Math.min(\n Math.ceil(Math.abs(boundsHeight * combinedScale[1] * EXPECTED_SCALE)),\n MAX_PATTERN_SIZE\n );\n const scaleX = boundsWidth / width;\n const scaleY = boundsHeight / height;\n\n const context = {\n coords: this._coords,\n colors: this._colors,\n offsetX: -offsetX,\n offsetY: -offsetY,\n scaleX: 1 / scaleX,\n scaleY: 1 / scaleY,\n };\n\n const paddedWidth = width + BORDER_SIZE * 2;\n const paddedHeight = height + BORDER_SIZE * 2;\n\n const tmpCanvas = cachedCanvases.getCanvas(\n \"mesh\",\n paddedWidth,\n paddedHeight,\n false\n );\n const tmpCtx = tmpCanvas.context;\n\n const data = tmpCtx.createImageData(width, height);\n if (backgroundColor) {\n const bytes = data.data;\n for (let i = 0, ii = bytes.length; i < ii; i += 4) {\n bytes[i] = backgroundColor[0];\n bytes[i + 1] = backgroundColor[1];\n bytes[i + 2] = backgroundColor[2];\n bytes[i + 3] = 255;\n }\n }\n for (const figure of this._figures) {\n drawFigure(data, figure, context);\n }\n tmpCtx.putImageData(data, BORDER_SIZE, BORDER_SIZE);\n const canvas = tmpCanvas.canvas;\n\n return {\n canvas,\n offsetX: offsetX - BORDER_SIZE * scaleX,\n offsetY: offsetY - BORDER_SIZE * scaleY,\n scaleX,\n scaleY,\n };\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n applyBoundingBox(ctx, this._bbox);\n let scale;\n if (pathType === PathType.SHADING) {\n scale = Util.singularValueDecompose2dScale(getCurrentTransform(ctx));\n } else {\n // Obtain scale from matrix and current transformation matrix.\n scale = Util.singularValueDecompose2dScale(owner.baseTransform);\n if (this.matrix) {\n const matrixScale = Util.singularValueDecompose2dScale(this.matrix);\n scale = [scale[0] * matrixScale[0], scale[1] * matrixScale[1]];\n }\n }\n\n // Rasterizing on the main thread since sending/queue large canvases\n // might cause OOM.\n const temporaryPatternCanvas = this._createMeshCanvas(\n scale,\n pathType === PathType.SHADING ? null : this._background,\n owner.cachedCanvases\n );\n\n if (pathType !== PathType.SHADING) {\n ctx.setTransform(...owner.baseTransform);\n if (this.matrix) {\n ctx.transform(...this.matrix);\n }\n }\n\n ctx.translate(\n temporaryPatternCanvas.offsetX,\n temporaryPatternCanvas.offsetY\n );\n ctx.scale(temporaryPatternCanvas.scaleX, temporaryPatternCanvas.scaleY);\n\n return ctx.createPattern(temporaryPatternCanvas.canvas, \"no-repeat\");\n }\n}\n\nclass DummyShadingPattern extends BaseShadingPattern {\n getPattern() {\n return \"hotpink\";\n }\n}\n\nfunction getShadingPattern(IR) {\n switch (IR[0]) {\n case \"RadialAxial\":\n return new RadialAxialShadingPattern(IR);\n case \"Mesh\":\n return new MeshShadingPattern(IR);\n case \"Dummy\":\n return new DummyShadingPattern();\n }\n throw new Error(`Unknown IR type: ${IR[0]}`);\n}\n\nconst PaintType = {\n COLORED: 1,\n UNCOLORED: 2,\n};\n\nclass TilingPattern {\n // 10in @ 300dpi shall be enough.\n static MAX_PATTERN_SIZE = 3000;\n\n constructor(IR, color, ctx, canvasGraphicsFactory, baseTransform) {\n this.operatorList = IR[2];\n this.matrix = IR[3] || [1, 0, 0, 1, 0, 0];\n this.bbox = IR[4];\n this.xstep = IR[5];\n this.ystep = IR[6];\n this.paintType = IR[7];\n this.tilingType = IR[8];\n this.color = color;\n this.ctx = ctx;\n this.canvasGraphicsFactory = canvasGraphicsFactory;\n this.baseTransform = baseTransform;\n }\n\n createPatternCanvas(owner) {\n const operatorList = this.operatorList;\n const bbox = this.bbox;\n const xstep = this.xstep;\n const ystep = this.ystep;\n const paintType = this.paintType;\n const tilingType = this.tilingType;\n const color = this.color;\n const canvasGraphicsFactory = this.canvasGraphicsFactory;\n\n info(\"TilingType: \" + tilingType);\n\n // A tiling pattern as defined by PDF spec 8.7.2 is a cell whose size is\n // described by bbox, and may repeat regularly by shifting the cell by\n // xstep and ystep.\n // Because the HTML5 canvas API does not support pattern repetition with\n // gaps in between, we use the xstep/ystep instead of the bbox's size.\n //\n // This has the following consequences (similarly for ystep):\n //\n // - If xstep is the same as bbox, then there is no observable difference.\n //\n // - If xstep is larger than bbox, then the pattern canvas is partially\n // empty: the area bounded by bbox is painted, the outside area is void.\n //\n // - If xstep is smaller than bbox, then the pixels between xstep and the\n // bbox boundary will be missing. This is INCORRECT behavior.\n // \"Figures on adjacent tiles should not overlap\" (PDF spec 8.7.3.1),\n // but overlapping cells without common pixels are still valid.\n // TODO: Fix the implementation, to allow this scenario to be painted\n // correctly.\n\n const x0 = bbox[0],\n y0 = bbox[1],\n x1 = bbox[2],\n y1 = bbox[3];\n\n // Obtain scale from matrix and current transformation matrix.\n const matrixScale = Util.singularValueDecompose2dScale(this.matrix);\n const curMatrixScale = Util.singularValueDecompose2dScale(\n this.baseTransform\n );\n const combinedScale = [\n matrixScale[0] * curMatrixScale[0],\n matrixScale[1] * curMatrixScale[1],\n ];\n\n // Use width and height values that are as close as possible to the end\n // result when the pattern is used. Too low value makes the pattern look\n // blurry. Too large value makes it look too crispy.\n const dimx = this.getSizeAndScale(\n xstep,\n this.ctx.canvas.width,\n combinedScale[0]\n );\n const dimy = this.getSizeAndScale(\n ystep,\n this.ctx.canvas.height,\n combinedScale[1]\n );\n\n const tmpCanvas = owner.cachedCanvases.getCanvas(\n \"pattern\",\n dimx.size,\n dimy.size,\n true\n );\n const tmpCtx = tmpCanvas.context;\n const graphics = canvasGraphicsFactory.createCanvasGraphics(tmpCtx);\n graphics.groupLevel = owner.groupLevel;\n\n this.setFillAndStrokeStyleToContext(graphics, paintType, color);\n\n let adjustedX0 = x0;\n let adjustedY0 = y0;\n let adjustedX1 = x1;\n let adjustedY1 = y1;\n // Some bounding boxes have negative x0/y0 coordinates which will cause the\n // some of the drawing to be off of the canvas. To avoid this shift the\n // bounding box over.\n if (x0 < 0) {\n adjustedX0 = 0;\n adjustedX1 += Math.abs(x0);\n }\n if (y0 < 0) {\n adjustedY0 = 0;\n adjustedY1 += Math.abs(y0);\n }\n tmpCtx.translate(-(dimx.scale * adjustedX0), -(dimy.scale * adjustedY0));\n graphics.transform(dimx.scale, 0, 0, dimy.scale, 0, 0);\n\n // To match CanvasGraphics beginDrawing we must save the context here or\n // else we end up with unbalanced save/restores.\n tmpCtx.save();\n\n this.clipBbox(graphics, adjustedX0, adjustedY0, adjustedX1, adjustedY1);\n\n graphics.baseTransform = getCurrentTransform(graphics.ctx);\n\n graphics.executeOperatorList(operatorList);\n\n graphics.endDrawing();\n\n return {\n canvas: tmpCanvas.canvas,\n scaleX: dimx.scale,\n scaleY: dimy.scale,\n offsetX: adjustedX0,\n offsetY: adjustedY0,\n };\n }\n\n getSizeAndScale(step, realOutputSize, scale) {\n // xstep / ystep may be negative -- normalize.\n step = Math.abs(step);\n // MAX_PATTERN_SIZE is used to avoid OOM situation.\n // Use the destination canvas's size if it is bigger than the hard-coded\n // limit of MAX_PATTERN_SIZE to avoid clipping patterns that cover the\n // whole canvas.\n const maxSize = Math.max(TilingPattern.MAX_PATTERN_SIZE, realOutputSize);\n let size = Math.ceil(step * scale);\n if (size >= maxSize) {\n size = maxSize;\n } else {\n scale = size / step;\n }\n return { scale, size };\n }\n\n clipBbox(graphics, x0, y0, x1, y1) {\n const bboxWidth = x1 - x0;\n const bboxHeight = y1 - y0;\n graphics.ctx.rect(x0, y0, bboxWidth, bboxHeight);\n graphics.current.updateRectMinMax(getCurrentTransform(graphics.ctx), [\n x0,\n y0,\n x1,\n y1,\n ]);\n graphics.clip();\n graphics.endPath();\n }\n\n setFillAndStrokeStyleToContext(graphics, paintType, color) {\n const context = graphics.ctx,\n current = graphics.current;\n switch (paintType) {\n case PaintType.COLORED:\n const ctx = this.ctx;\n context.fillStyle = ctx.fillStyle;\n context.strokeStyle = ctx.strokeStyle;\n current.fillColor = ctx.fillStyle;\n current.strokeColor = ctx.strokeStyle;\n break;\n case PaintType.UNCOLORED:\n const cssColor = Util.makeHexColor(color[0], color[1], color[2]);\n context.fillStyle = cssColor;\n context.strokeStyle = cssColor;\n // Set color needed by image masks (fixes issues 3226 and 8741).\n current.fillColor = cssColor;\n current.strokeColor = cssColor;\n break;\n default:\n throw new FormatError(`Unsupported paint type: ${paintType}`);\n }\n }\n\n getPattern(ctx, owner, inverse, pathType) {\n // PDF spec 8.7.2 NOTE 1: pattern's matrix is relative to initial matrix.\n let matrix = inverse;\n if (pathType !== PathType.SHADING) {\n matrix = Util.transform(matrix, owner.baseTransform);\n if (this.matrix) {\n matrix = Util.transform(matrix, this.matrix);\n }\n }\n\n const temporaryPatternCanvas = this.createPatternCanvas(owner);\n\n let domMatrix = new DOMMatrix(matrix);\n // Rescale and so that the ctx.createPattern call generates a pattern with\n // the desired size.\n domMatrix = domMatrix.translate(\n temporaryPatternCanvas.offsetX,\n temporaryPatternCanvas.offsetY\n );\n domMatrix = domMatrix.scale(\n 1 / temporaryPatternCanvas.scaleX,\n 1 / temporaryPatternCanvas.scaleY\n );\n\n const pattern = ctx.createPattern(temporaryPatternCanvas.canvas, \"repeat\");\n pattern.setTransform(domMatrix);\n\n return pattern;\n }\n}\n\nexport { getShadingPattern, PathType, TilingPattern };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { FeatureTest, ImageKind } from \"./util.js\";\n\nfunction convertToRGBA(params) {\n switch (params.kind) {\n case ImageKind.GRAYSCALE_1BPP:\n return convertBlackAndWhiteToRGBA(params);\n case ImageKind.RGB_24BPP:\n return convertRGBToRGBA(params);\n }\n\n return null;\n}\n\nfunction convertBlackAndWhiteToRGBA({\n src,\n srcPos = 0,\n dest,\n width,\n height,\n nonBlackColor = 0xffffffff,\n inverseDecode = false,\n}) {\n const black = FeatureTest.isLittleEndian ? 0xff000000 : 0x000000ff;\n const [zeroMapping, oneMapping] = inverseDecode\n ? [nonBlackColor, black]\n : [black, nonBlackColor];\n const widthInSource = width >> 3;\n const widthRemainder = width & 7;\n const srcLength = src.length;\n dest = new Uint32Array(dest.buffer);\n let destPos = 0;\n\n for (let i = 0; i < height; i++) {\n for (const max = srcPos + widthInSource; srcPos < max; srcPos++) {\n const elem = srcPos < srcLength ? src[srcPos] : 255;\n dest[destPos++] = elem & 0b10000000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1000000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b100000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b10000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1000 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b100 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b10 ? oneMapping : zeroMapping;\n dest[destPos++] = elem & 0b1 ? oneMapping : zeroMapping;\n }\n if (widthRemainder === 0) {\n continue;\n }\n const elem = srcPos < srcLength ? src[srcPos++] : 255;\n for (let j = 0; j < widthRemainder; j++) {\n dest[destPos++] = elem & (1 << (7 - j)) ? oneMapping : zeroMapping;\n }\n }\n return { srcPos, destPos };\n}\n\nfunction convertRGBToRGBA({\n src,\n srcPos = 0,\n dest,\n destPos = 0,\n width,\n height,\n}) {\n let i = 0;\n const len32 = src.length >> 2;\n const src32 = new Uint32Array(src.buffer, srcPos, len32);\n\n if (FeatureTest.isLittleEndian) {\n // It's a way faster to do the shuffle manually instead of working\n // component by component with some Uint8 arrays.\n for (; i < len32 - 2; i += 3, destPos += 4) {\n const s1 = src32[i]; // R2B1G1R1\n const s2 = src32[i + 1]; // G3R3B2G2\n const s3 = src32[i + 2]; // B4G4R4B3\n\n dest[destPos] = s1 | 0xff000000;\n dest[destPos + 1] = (s1 >>> 24) | (s2 << 8) | 0xff000000;\n dest[destPos + 2] = (s2 >>> 16) | (s3 << 16) | 0xff000000;\n dest[destPos + 3] = (s3 >>> 8) | 0xff000000;\n }\n\n for (let j = i * 4, jj = src.length; j < jj; j += 3) {\n dest[destPos++] =\n src[j] | (src[j + 1] << 8) | (src[j + 2] << 16) | 0xff000000;\n }\n } else {\n for (; i < len32 - 2; i += 3, destPos += 4) {\n const s1 = src32[i]; // R1G1B1R2\n const s2 = src32[i + 1]; // G2B2R3G3\n const s3 = src32[i + 2]; // B3R4G4B4\n\n dest[destPos] = s1 | 0xff;\n dest[destPos + 1] = (s1 << 24) | (s2 >>> 8) | 0xff;\n dest[destPos + 2] = (s2 << 16) | (s3 >>> 16) | 0xff;\n dest[destPos + 3] = (s3 << 8) | 0xff;\n }\n\n for (let j = i * 4, jj = src.length; j < jj; j += 3) {\n dest[destPos++] =\n (src[j] << 24) | (src[j + 1] << 16) | (src[j + 2] << 8) | 0xff;\n }\n }\n\n return { srcPos, destPos };\n}\n\nfunction grayToRGBA(src, dest) {\n if (FeatureTest.isLittleEndian) {\n for (let i = 0, ii = src.length; i < ii; i++) {\n dest[i] = (src[i] * 0x10101) | 0xff000000;\n }\n } else {\n for (let i = 0, ii = src.length; i < ii; i++) {\n dest[i] = (src[i] * 0x1010100) | 0x000000ff;\n }\n }\n}\n\nexport { convertBlackAndWhiteToRGBA, convertToRGBA, grayToRGBA };\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * @typedef {Object} GlobalWorkerOptionsType\n * @property {Worker | null} workerPort - Defines global port for worker\n * process. Overrides the `workerSrc` option.\n * @property {string} workerSrc - A string containing the path and filename\n * of the worker file.\n *\n * NOTE: The `workerSrc` option should always be set, in order to prevent any\n * issues when using the PDF.js library.\n */\n\n/** @type {GlobalWorkerOptionsType} */\nconst GlobalWorkerOptions = Object.create(null);\n\nGlobalWorkerOptions.workerPort = null;\nGlobalWorkerOptions.workerSrc = \"\";\n\nexport { GlobalWorkerOptions };\n","/* Copyright 2018 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AbortException,\n assert,\n MissingPDFException,\n PasswordException,\n PromiseCapability,\n UnexpectedResponseException,\n UnknownErrorException,\n unreachable,\n} from \"./util.js\";\n\nconst CallbackKind = {\n UNKNOWN: 0,\n DATA: 1,\n ERROR: 2,\n};\n\nconst StreamKind = {\n UNKNOWN: 0,\n CANCEL: 1,\n CANCEL_COMPLETE: 2,\n CLOSE: 3,\n ENQUEUE: 4,\n ERROR: 5,\n PULL: 6,\n PULL_COMPLETE: 7,\n START_COMPLETE: 8,\n};\n\nfunction wrapReason(reason) {\n if (\n !(\n reason instanceof Error ||\n (typeof reason === \"object\" && reason !== null)\n )\n ) {\n unreachable(\n 'wrapReason: Expected \"reason\" to be a (possibly cloned) Error.'\n );\n }\n switch (reason.name) {\n case \"AbortException\":\n return new AbortException(reason.message);\n case \"MissingPDFException\":\n return new MissingPDFException(reason.message);\n case \"PasswordException\":\n return new PasswordException(reason.message, reason.code);\n case \"UnexpectedResponseException\":\n return new UnexpectedResponseException(reason.message, reason.status);\n case \"UnknownErrorException\":\n return new UnknownErrorException(reason.message, reason.details);\n default:\n return new UnknownErrorException(reason.message, reason.toString());\n }\n}\n\nclass MessageHandler {\n constructor(sourceName, targetName, comObj) {\n this.sourceName = sourceName;\n this.targetName = targetName;\n this.comObj = comObj;\n this.callbackId = 1;\n this.streamId = 1;\n this.streamSinks = Object.create(null);\n this.streamControllers = Object.create(null);\n this.callbackCapabilities = Object.create(null);\n this.actionHandler = Object.create(null);\n\n this._onComObjOnMessage = event => {\n const data = event.data;\n if (data.targetName !== this.sourceName) {\n return;\n }\n if (data.stream) {\n this.#processStreamMessage(data);\n return;\n }\n if (data.callback) {\n const callbackId = data.callbackId;\n const capability = this.callbackCapabilities[callbackId];\n if (!capability) {\n throw new Error(`Cannot resolve callback ${callbackId}`);\n }\n delete this.callbackCapabilities[callbackId];\n\n if (data.callback === CallbackKind.DATA) {\n capability.resolve(data.data);\n } else if (data.callback === CallbackKind.ERROR) {\n capability.reject(wrapReason(data.reason));\n } else {\n throw new Error(\"Unexpected callback case\");\n }\n return;\n }\n const action = this.actionHandler[data.action];\n if (!action) {\n throw new Error(`Unknown action from worker: ${data.action}`);\n }\n if (data.callbackId) {\n const cbSourceName = this.sourceName;\n const cbTargetName = data.sourceName;\n\n new Promise(function (resolve) {\n resolve(action(data.data));\n }).then(\n function (result) {\n comObj.postMessage({\n sourceName: cbSourceName,\n targetName: cbTargetName,\n callback: CallbackKind.DATA,\n callbackId: data.callbackId,\n data: result,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName: cbSourceName,\n targetName: cbTargetName,\n callback: CallbackKind.ERROR,\n callbackId: data.callbackId,\n reason: wrapReason(reason),\n });\n }\n );\n return;\n }\n if (data.streamId) {\n this.#createStreamSink(data);\n return;\n }\n action(data.data);\n };\n comObj.addEventListener(\"message\", this._onComObjOnMessage);\n }\n\n on(actionName, handler) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n typeof handler === \"function\",\n 'MessageHandler.on: Expected \"handler\" to be a function.'\n );\n }\n const ah = this.actionHandler;\n if (ah[actionName]) {\n throw new Error(`There is already an actionName called \"${actionName}\"`);\n }\n ah[actionName] = handler;\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n */\n send(actionName, data, transfers) {\n this.comObj.postMessage(\n {\n sourceName: this.sourceName,\n targetName: this.targetName,\n action: actionName,\n data,\n },\n transfers\n );\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * Expects that the other side will callback with the response.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n * @returns {Promise} Promise to be resolved with response data.\n */\n sendWithPromise(actionName, data, transfers) {\n const callbackId = this.callbackId++;\n const capability = new PromiseCapability();\n this.callbackCapabilities[callbackId] = capability;\n try {\n this.comObj.postMessage(\n {\n sourceName: this.sourceName,\n targetName: this.targetName,\n action: actionName,\n callbackId,\n data,\n },\n transfers\n );\n } catch (ex) {\n capability.reject(ex);\n }\n return capability.promise;\n }\n\n /**\n * Sends a message to the comObj to invoke the action with the supplied data.\n * Expect that the other side will callback to signal 'start_complete'.\n * @param {string} actionName - Action to call.\n * @param {JSON} data - JSON data to send.\n * @param {Object} queueingStrategy - Strategy to signal backpressure based on\n * internal queue.\n * @param {Array} [transfers] - List of transfers/ArrayBuffers.\n * @returns {ReadableStream} ReadableStream to read data in chunks.\n */\n sendWithStream(actionName, data, queueingStrategy, transfers) {\n const streamId = this.streamId++,\n sourceName = this.sourceName,\n targetName = this.targetName,\n comObj = this.comObj;\n\n return new ReadableStream(\n {\n start: controller => {\n const startCapability = new PromiseCapability();\n this.streamControllers[streamId] = {\n controller,\n startCall: startCapability,\n pullCall: null,\n cancelCall: null,\n isClosed: false,\n };\n comObj.postMessage(\n {\n sourceName,\n targetName,\n action: actionName,\n streamId,\n data,\n desiredSize: controller.desiredSize,\n },\n transfers\n );\n // Return Promise for Async process, to signal success/failure.\n return startCapability.promise;\n },\n\n pull: controller => {\n const pullCapability = new PromiseCapability();\n this.streamControllers[streamId].pullCall = pullCapability;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL,\n streamId,\n desiredSize: controller.desiredSize,\n });\n // Returning Promise will not call \"pull\"\n // again until current pull is resolved.\n return pullCapability.promise;\n },\n\n cancel: reason => {\n assert(reason instanceof Error, \"cancel must have a valid reason\");\n const cancelCapability = new PromiseCapability();\n this.streamControllers[streamId].cancelCall = cancelCapability;\n this.streamControllers[streamId].isClosed = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL,\n streamId,\n reason: wrapReason(reason),\n });\n // Return Promise to signal success or failure.\n return cancelCapability.promise;\n },\n },\n queueingStrategy\n );\n }\n\n #createStreamSink(data) {\n const streamId = data.streamId,\n sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n const self = this,\n action = this.actionHandler[data.action];\n\n const streamSink = {\n enqueue(chunk, size = 1, transfers) {\n if (this.isCancelled) {\n return;\n }\n const lastDesiredSize = this.desiredSize;\n this.desiredSize -= size;\n // Enqueue decreases the desiredSize property of sink,\n // so when it changes from positive to negative,\n // set ready as unresolved promise.\n if (lastDesiredSize > 0 && this.desiredSize <= 0) {\n this.sinkCapability = new PromiseCapability();\n this.ready = this.sinkCapability.promise;\n }\n comObj.postMessage(\n {\n sourceName,\n targetName,\n stream: StreamKind.ENQUEUE,\n streamId,\n chunk,\n },\n transfers\n );\n },\n\n close() {\n if (this.isCancelled) {\n return;\n }\n this.isCancelled = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CLOSE,\n streamId,\n });\n delete self.streamSinks[streamId];\n },\n\n error(reason) {\n assert(reason instanceof Error, \"error must have a valid reason\");\n if (this.isCancelled) {\n return;\n }\n this.isCancelled = true;\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.ERROR,\n streamId,\n reason: wrapReason(reason),\n });\n },\n\n sinkCapability: new PromiseCapability(),\n onPull: null,\n onCancel: null,\n isCancelled: false,\n desiredSize: data.desiredSize,\n ready: null,\n };\n\n streamSink.sinkCapability.resolve();\n streamSink.ready = streamSink.sinkCapability.promise;\n this.streamSinks[streamId] = streamSink;\n\n new Promise(function (resolve) {\n resolve(action(data.data, streamSink));\n }).then(\n function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.START_COMPLETE,\n streamId,\n success: true,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.START_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n }\n\n #processStreamMessage(data) {\n const streamId = data.streamId,\n sourceName = this.sourceName,\n targetName = data.sourceName,\n comObj = this.comObj;\n const streamController = this.streamControllers[streamId],\n streamSink = this.streamSinks[streamId];\n\n switch (data.stream) {\n case StreamKind.START_COMPLETE:\n if (data.success) {\n streamController.startCall.resolve();\n } else {\n streamController.startCall.reject(wrapReason(data.reason));\n }\n break;\n case StreamKind.PULL_COMPLETE:\n if (data.success) {\n streamController.pullCall.resolve();\n } else {\n streamController.pullCall.reject(wrapReason(data.reason));\n }\n break;\n case StreamKind.PULL:\n // Ignore any pull after close is called.\n if (!streamSink) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n success: true,\n });\n break;\n }\n // Pull increases the desiredSize property of sink, so when it changes\n // from negative to positive, set ready property as resolved promise.\n if (streamSink.desiredSize <= 0 && data.desiredSize > 0) {\n streamSink.sinkCapability.resolve();\n }\n // Reset desiredSize property of sink on every pull.\n streamSink.desiredSize = data.desiredSize;\n\n new Promise(function (resolve) {\n resolve(streamSink.onPull?.());\n }).then(\n function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n success: true,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.PULL_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n break;\n case StreamKind.ENQUEUE:\n assert(streamController, \"enqueue should have stream controller\");\n if (streamController.isClosed) {\n break;\n }\n streamController.controller.enqueue(data.chunk);\n break;\n case StreamKind.CLOSE:\n assert(streamController, \"close should have stream controller\");\n if (streamController.isClosed) {\n break;\n }\n streamController.isClosed = true;\n streamController.controller.close();\n this.#deleteStreamController(streamController, streamId);\n break;\n case StreamKind.ERROR:\n assert(streamController, \"error should have stream controller\");\n streamController.controller.error(wrapReason(data.reason));\n this.#deleteStreamController(streamController, streamId);\n break;\n case StreamKind.CANCEL_COMPLETE:\n if (data.success) {\n streamController.cancelCall.resolve();\n } else {\n streamController.cancelCall.reject(wrapReason(data.reason));\n }\n this.#deleteStreamController(streamController, streamId);\n break;\n case StreamKind.CANCEL:\n if (!streamSink) {\n break;\n }\n\n new Promise(function (resolve) {\n resolve(streamSink.onCancel?.(wrapReason(data.reason)));\n }).then(\n function () {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL_COMPLETE,\n streamId,\n success: true,\n });\n },\n function (reason) {\n comObj.postMessage({\n sourceName,\n targetName,\n stream: StreamKind.CANCEL_COMPLETE,\n streamId,\n reason: wrapReason(reason),\n });\n }\n );\n streamSink.sinkCapability.reject(wrapReason(data.reason));\n streamSink.isCancelled = true;\n delete this.streamSinks[streamId];\n break;\n default:\n throw new Error(\"Unexpected stream case\");\n }\n }\n\n async #deleteStreamController(streamController, streamId) {\n // Delete the `streamController` only when the start, pull, and cancel\n // capabilities have settled, to prevent `TypeError`s.\n await Promise.allSettled([\n streamController.startCall?.promise,\n streamController.pullCall?.promise,\n streamController.cancelCall?.promise,\n ]);\n delete this.streamControllers[streamId];\n }\n\n destroy() {\n this.comObj.removeEventListener(\"message\", this._onComObjOnMessage);\n }\n}\n\nexport { MessageHandler };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { objectFromMap } from \"../shared/util.js\";\n\nclass Metadata {\n #metadataMap;\n\n #data;\n\n constructor({ parsedData, rawData }) {\n this.#metadataMap = parsedData;\n this.#data = rawData;\n }\n\n getRaw() {\n return this.#data;\n }\n\n get(name) {\n return this.#metadataMap.get(name) ?? null;\n }\n\n getAll() {\n return objectFromMap(this.#metadataMap);\n }\n\n has(name) {\n return this.#metadataMap.has(name);\n }\n}\n\nexport { Metadata };\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { objectFromMap, unreachable, warn } from \"../shared/util.js\";\nimport { MurmurHash3_64 } from \"../shared/murmurhash3.js\";\n\nconst INTERNAL = Symbol(\"INTERNAL\");\n\nclass OptionalContentGroup {\n #visible = true;\n\n constructor(name, intent) {\n this.name = name;\n this.intent = intent;\n }\n\n /**\n * @type {boolean}\n */\n get visible() {\n return this.#visible;\n }\n\n /**\n * @ignore\n */\n _setVisible(internal, visible) {\n if (internal !== INTERNAL) {\n unreachable(\"Internal method `_setVisible` called.\");\n }\n this.#visible = visible;\n }\n}\n\nclass OptionalContentConfig {\n #cachedGetHash = null;\n\n #groups = new Map();\n\n #initialHash = null;\n\n #order = null;\n\n constructor(data) {\n this.name = null;\n this.creator = null;\n\n if (data === null) {\n return;\n }\n this.name = data.name;\n this.creator = data.creator;\n this.#order = data.order;\n for (const group of data.groups) {\n this.#groups.set(\n group.id,\n new OptionalContentGroup(group.name, group.intent)\n );\n }\n\n if (data.baseState === \"OFF\") {\n for (const group of this.#groups.values()) {\n group._setVisible(INTERNAL, false);\n }\n }\n\n for (const on of data.on) {\n this.#groups.get(on)._setVisible(INTERNAL, true);\n }\n\n for (const off of data.off) {\n this.#groups.get(off)._setVisible(INTERNAL, false);\n }\n\n // The following code must always run *last* in the constructor.\n this.#initialHash = this.getHash();\n }\n\n #evaluateVisibilityExpression(array) {\n const length = array.length;\n if (length < 2) {\n return true;\n }\n const operator = array[0];\n for (let i = 1; i < length; i++) {\n const element = array[i];\n let state;\n if (Array.isArray(element)) {\n state = this.#evaluateVisibilityExpression(element);\n } else if (this.#groups.has(element)) {\n state = this.#groups.get(element).visible;\n } else {\n warn(`Optional content group not found: ${element}`);\n return true;\n }\n switch (operator) {\n case \"And\":\n if (!state) {\n return false;\n }\n break;\n case \"Or\":\n if (state) {\n return true;\n }\n break;\n case \"Not\":\n return !state;\n default:\n return true;\n }\n }\n return operator === \"And\";\n }\n\n isVisible(group) {\n if (this.#groups.size === 0) {\n return true;\n }\n if (!group) {\n warn(\"Optional content group not defined.\");\n return true;\n }\n if (group.type === \"OCG\") {\n if (!this.#groups.has(group.id)) {\n warn(`Optional content group not found: ${group.id}`);\n return true;\n }\n return this.#groups.get(group.id).visible;\n } else if (group.type === \"OCMD\") {\n // Per the spec, the expression should be preferred if available.\n if (group.expression) {\n return this.#evaluateVisibilityExpression(group.expression);\n }\n if (!group.policy || group.policy === \"AnyOn\") {\n // Default\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (this.#groups.get(id).visible) {\n return true;\n }\n }\n return false;\n } else if (group.policy === \"AllOn\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (!this.#groups.get(id).visible) {\n return false;\n }\n }\n return true;\n } else if (group.policy === \"AnyOff\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (!this.#groups.get(id).visible) {\n return true;\n }\n }\n return false;\n } else if (group.policy === \"AllOff\") {\n for (const id of group.ids) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return true;\n }\n if (this.#groups.get(id).visible) {\n return false;\n }\n }\n return true;\n }\n warn(`Unknown optional content policy ${group.policy}.`);\n return true;\n }\n warn(`Unknown group type ${group.type}.`);\n return true;\n }\n\n setVisibility(id, visible = true) {\n if (!this.#groups.has(id)) {\n warn(`Optional content group not found: ${id}`);\n return;\n }\n this.#groups.get(id)._setVisible(INTERNAL, !!visible);\n\n this.#cachedGetHash = null;\n }\n\n get hasInitialVisibility() {\n return this.#initialHash === null || this.getHash() === this.#initialHash;\n }\n\n getOrder() {\n if (!this.#groups.size) {\n return null;\n }\n if (this.#order) {\n return this.#order.slice();\n }\n return [...this.#groups.keys()];\n }\n\n getGroups() {\n return this.#groups.size > 0 ? objectFromMap(this.#groups) : null;\n }\n\n getGroup(id) {\n return this.#groups.get(id) || null;\n }\n\n getHash() {\n if (this.#cachedGetHash !== null) {\n return this.#cachedGetHash;\n }\n const hash = new MurmurHash3_64();\n\n for (const [id, group] of this.#groups) {\n hash.update(`${id}:${group.visible}`);\n }\n return (this.#cachedGetHash = hash.hexdigest());\n }\n}\n\nexport { OptionalContentConfig };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"../interfaces\").IPDFStream} IPDFStream */\n/** @typedef {import(\"../interfaces\").IPDFStreamReader} IPDFStreamReader */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../interfaces\").IPDFStreamRangeReader} IPDFStreamRangeReader */\n\nimport { assert, PromiseCapability } from \"../shared/util.js\";\nimport { isPdfFile } from \"./display_utils.js\";\n\n/** @implements {IPDFStream} */\nclass PDFDataTransportStream {\n constructor(\n {\n length,\n initialData,\n progressiveDone = false,\n contentDispositionFilename = null,\n disableRange = false,\n disableStream = false,\n },\n pdfDataRangeTransport\n ) {\n assert(\n pdfDataRangeTransport,\n 'PDFDataTransportStream - missing required \"pdfDataRangeTransport\" argument.'\n );\n\n this._queuedChunks = [];\n this._progressiveDone = progressiveDone;\n this._contentDispositionFilename = contentDispositionFilename;\n\n if (initialData?.length > 0) {\n // Prevent any possible issues by only transferring a Uint8Array that\n // completely \"utilizes\" its underlying ArrayBuffer.\n const buffer =\n initialData instanceof Uint8Array &&\n initialData.byteLength === initialData.buffer.byteLength\n ? initialData.buffer\n : new Uint8Array(initialData).buffer;\n this._queuedChunks.push(buffer);\n }\n\n this._pdfDataRangeTransport = pdfDataRangeTransport;\n this._isStreamingSupported = !disableStream;\n this._isRangeSupported = !disableRange;\n this._contentLength = length;\n\n this._fullRequestReader = null;\n this._rangeReaders = [];\n\n this._pdfDataRangeTransport.addRangeListener((begin, chunk) => {\n this._onReceiveData({ begin, chunk });\n });\n\n this._pdfDataRangeTransport.addProgressListener((loaded, total) => {\n this._onProgress({ loaded, total });\n });\n\n this._pdfDataRangeTransport.addProgressiveReadListener(chunk => {\n this._onReceiveData({ chunk });\n });\n\n this._pdfDataRangeTransport.addProgressiveDoneListener(() => {\n this._onProgressiveDone();\n });\n\n this._pdfDataRangeTransport.transportReady();\n }\n\n _onReceiveData({ begin, chunk }) {\n // Prevent any possible issues by only transferring a Uint8Array that\n // completely \"utilizes\" its underlying ArrayBuffer.\n const buffer =\n chunk instanceof Uint8Array &&\n chunk.byteLength === chunk.buffer.byteLength\n ? chunk.buffer\n : new Uint8Array(chunk).buffer;\n\n if (begin === undefined) {\n if (this._fullRequestReader) {\n this._fullRequestReader._enqueue(buffer);\n } else {\n this._queuedChunks.push(buffer);\n }\n } else {\n const found = this._rangeReaders.some(function (rangeReader) {\n if (rangeReader._begin !== begin) {\n return false;\n }\n rangeReader._enqueue(buffer);\n return true;\n });\n assert(\n found,\n \"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.\"\n );\n }\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n _onProgress(evt) {\n if (evt.total === undefined) {\n // Reporting to first range reader, if it exists.\n this._rangeReaders[0]?.onProgress?.({ loaded: evt.loaded });\n } else {\n this._fullRequestReader?.onProgress?.({\n loaded: evt.loaded,\n total: evt.total,\n });\n }\n }\n\n _onProgressiveDone() {\n this._fullRequestReader?.progressiveDone();\n this._progressiveDone = true;\n }\n\n _removeRangeReader(reader) {\n const i = this._rangeReaders.indexOf(reader);\n if (i >= 0) {\n this._rangeReaders.splice(i, 1);\n }\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFDataTransportStream.getFullReader can only be called once.\"\n );\n const queuedChunks = this._queuedChunks;\n this._queuedChunks = null;\n return new PDFDataTransportStreamReader(\n this,\n queuedChunks,\n this._progressiveDone,\n this._contentDispositionFilename\n );\n }\n\n getRangeReader(begin, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const reader = new PDFDataTransportStreamRangeReader(this, begin, end);\n this._pdfDataRangeTransport.requestDataRange(begin, end);\n this._rangeReaders.push(reader);\n return reader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeReaders.slice(0)) {\n reader.cancel(reason);\n }\n this._pdfDataRangeTransport.abort();\n }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFDataTransportStreamReader {\n constructor(\n stream,\n queuedChunks,\n progressiveDone = false,\n contentDispositionFilename = null\n ) {\n this._stream = stream;\n this._done = progressiveDone || false;\n this._filename = isPdfFile(contentDispositionFilename)\n ? contentDispositionFilename\n : null;\n this._queuedChunks = queuedChunks || [];\n this._loaded = 0;\n for (const chunk of this._queuedChunks) {\n this._loaded += chunk.byteLength;\n }\n this._requests = [];\n this._headersReady = Promise.resolve();\n stream._fullRequestReader = this;\n\n this.onProgress = null;\n }\n\n _enqueue(chunk) {\n if (this._done) {\n return; // Ignore new data.\n }\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n requestCapability.resolve({ value: chunk, done: false });\n } else {\n this._queuedChunks.push(chunk);\n }\n this._loaded += chunk.byteLength;\n }\n\n get headersReady() {\n return this._headersReady;\n }\n\n get filename() {\n return this._filename;\n }\n\n get isRangeSupported() {\n return this._stream._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._stream._isStreamingSupported;\n }\n\n get contentLength() {\n return this._stream._contentLength;\n }\n\n async read() {\n if (this._queuedChunks.length > 0) {\n const chunk = this._queuedChunks.shift();\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = new PromiseCapability();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n }\n\n progressiveDone() {\n if (this._done) {\n return;\n }\n this._done = true;\n }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFDataTransportStreamRangeReader {\n constructor(stream, begin, end) {\n this._stream = stream;\n this._begin = begin;\n this._end = end;\n this._queuedChunk = null;\n this._requests = [];\n this._done = false;\n\n this.onProgress = null;\n }\n\n _enqueue(chunk) {\n if (this._done) {\n return; // ignore new data\n }\n if (this._requests.length === 0) {\n this._queuedChunk = chunk;\n } else {\n const requestsCapability = this._requests.shift();\n requestsCapability.resolve({ value: chunk, done: false });\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n }\n this._done = true;\n this._stream._removeRangeReader(this);\n }\n\n get isStreamingSupported() {\n return false;\n }\n\n async read() {\n if (this._queuedChunk) {\n const chunk = this._queuedChunk;\n this._queuedChunk = null;\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = new PromiseCapability();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n this._stream._removeRangeReader(this);\n }\n}\n\nexport { PDFDataTransportStream };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AbortException,\n assert,\n PromiseCapability,\n warn,\n} from \"../shared/util.js\";\nimport {\n createResponseStatusError,\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n validateResponseStatus,\n} from \"./network_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./fetch_stream.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nfunction createFetchOptions(headers, withCredentials, abortController) {\n return {\n method: \"GET\",\n headers,\n signal: abortController.signal,\n mode: \"cors\",\n credentials: withCredentials ? \"include\" : \"same-origin\",\n redirect: \"follow\",\n };\n}\n\nfunction createHeaders(httpHeaders) {\n const headers = new Headers();\n for (const property in httpHeaders) {\n const value = httpHeaders[property];\n if (value === undefined) {\n continue;\n }\n headers.append(property, value);\n }\n return headers;\n}\n\nfunction getArrayBuffer(val) {\n if (val instanceof Uint8Array) {\n return val.buffer;\n }\n if (val instanceof ArrayBuffer) {\n return val;\n }\n warn(`getArrayBuffer - unexpected data format: ${val}`);\n return new Uint8Array(val).buffer;\n}\n\n/** @implements {IPDFStream} */\nclass PDFFetchStream {\n constructor(source) {\n this.source = source;\n this.isHttp = /^https?:/i.test(source.url);\n this.httpHeaders = (this.isHttp && source.httpHeaders) || {};\n\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFFetchStream.getFullReader can only be called once.\"\n );\n this._fullRequestReader = new PDFFetchStreamReader(this);\n return this._fullRequestReader;\n }\n\n getRangeReader(begin, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const reader = new PDFFetchStreamRangeReader(this, begin, end);\n this._rangeRequestReaders.push(reader);\n return reader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFFetchStreamReader {\n constructor(stream) {\n this._stream = stream;\n this._reader = null;\n this._loaded = 0;\n this._filename = null;\n const source = stream.source;\n this._withCredentials = source.withCredentials || false;\n this._contentLength = source.length;\n this._headersCapability = new PromiseCapability();\n this._disableRange = source.disableRange || false;\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._abortController = new AbortController();\n this._isStreamingSupported = !source.disableStream;\n this._isRangeSupported = !source.disableRange;\n\n this._headers = createHeaders(this._stream.httpHeaders);\n\n const url = source.url;\n fetch(\n url,\n createFetchOptions(\n this._headers,\n this._withCredentials,\n this._abortController\n )\n )\n .then(response => {\n if (!validateResponseStatus(response.status)) {\n throw createResponseStatusError(response.status, url);\n }\n this._reader = response.body.getReader();\n this._headersCapability.resolve();\n\n const getResponseHeader = name => {\n return response.headers.get(name);\n };\n const { allowRangeRequests, suggestedLength } =\n validateRangeRequestCapabilities({\n getResponseHeader,\n isHttp: this._stream.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange,\n });\n\n this._isRangeSupported = allowRangeRequests;\n // Setting right content length.\n this._contentLength = suggestedLength || this._contentLength;\n\n this._filename = extractFilenameFromHeader(getResponseHeader);\n\n // We need to stop reading when range is supported and streaming is\n // disabled.\n if (!this._isStreamingSupported && this._isRangeSupported) {\n this.cancel(new AbortException(\"Streaming is disabled.\"));\n }\n })\n .catch(this._headersCapability.reject);\n\n this.onProgress = null;\n }\n\n get headersReady() {\n return this._headersCapability.promise;\n }\n\n get filename() {\n return this._filename;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._headersCapability.promise;\n const { value, done } = await this._reader.read();\n if (done) {\n return { value, done };\n }\n this._loaded += value.byteLength;\n this.onProgress?.({\n loaded: this._loaded,\n total: this._contentLength,\n });\n\n return { value: getArrayBuffer(value), done: false };\n }\n\n cancel(reason) {\n this._reader?.cancel(reason);\n this._abortController.abort();\n }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFFetchStreamRangeReader {\n constructor(stream, begin, end) {\n this._stream = stream;\n this._reader = null;\n this._loaded = 0;\n const source = stream.source;\n this._withCredentials = source.withCredentials || false;\n this._readCapability = new PromiseCapability();\n this._isStreamingSupported = !source.disableStream;\n\n this._abortController = new AbortController();\n this._headers = createHeaders(this._stream.httpHeaders);\n this._headers.append(\"Range\", `bytes=${begin}-${end - 1}`);\n\n const url = source.url;\n fetch(\n url,\n createFetchOptions(\n this._headers,\n this._withCredentials,\n this._abortController\n )\n )\n .then(response => {\n if (!validateResponseStatus(response.status)) {\n throw createResponseStatusError(response.status, url);\n }\n this._readCapability.resolve();\n this._reader = response.body.getReader();\n })\n .catch(this._readCapability.reject);\n\n this.onProgress = null;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n const { value, done } = await this._reader.read();\n if (done) {\n return { value, done };\n }\n this._loaded += value.byteLength;\n this.onProgress?.({ loaded: this._loaded });\n\n return { value: getArrayBuffer(value), done: false };\n }\n\n cancel(reason) {\n this._reader?.cancel(reason);\n this._abortController.abort();\n }\n}\n\nexport { PDFFetchStream };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n assert,\n MissingPDFException,\n UnexpectedResponseException,\n} from \"../shared/util.js\";\nimport { getFilenameFromContentDispositionHeader } from \"./content_disposition.js\";\nimport { isPdfFile } from \"./display_utils.js\";\n\nfunction validateRangeRequestCapabilities({\n getResponseHeader,\n isHttp,\n rangeChunkSize,\n disableRange,\n}) {\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n assert(\n Number.isInteger(rangeChunkSize) && rangeChunkSize > 0,\n \"rangeChunkSize must be an integer larger than zero.\"\n );\n }\n const returnValues = {\n allowRangeRequests: false,\n suggestedLength: undefined,\n };\n\n const length = parseInt(getResponseHeader(\"Content-Length\"), 10);\n if (!Number.isInteger(length)) {\n return returnValues;\n }\n\n returnValues.suggestedLength = length;\n\n if (length <= 2 * rangeChunkSize) {\n // The file size is smaller than the size of two chunks, so it does not\n // make any sense to abort the request and retry with a range request.\n return returnValues;\n }\n\n if (disableRange || !isHttp) {\n return returnValues;\n }\n if (getResponseHeader(\"Accept-Ranges\") !== \"bytes\") {\n return returnValues;\n }\n\n const contentEncoding = getResponseHeader(\"Content-Encoding\") || \"identity\";\n if (contentEncoding !== \"identity\") {\n return returnValues;\n }\n\n returnValues.allowRangeRequests = true;\n return returnValues;\n}\n\nfunction extractFilenameFromHeader(getResponseHeader) {\n const contentDisposition = getResponseHeader(\"Content-Disposition\");\n if (contentDisposition) {\n let filename = getFilenameFromContentDispositionHeader(contentDisposition);\n if (filename.includes(\"%\")) {\n try {\n filename = decodeURIComponent(filename);\n } catch {}\n }\n if (isPdfFile(filename)) {\n return filename;\n }\n }\n return null;\n}\n\nfunction createResponseStatusError(status, url) {\n if (status === 404 || (status === 0 && url.startsWith(\"file:\"))) {\n return new MissingPDFException('Missing PDF \"' + url + '\".');\n }\n return new UnexpectedResponseException(\n `Unexpected server response (${status}) while retrieving PDF \"${url}\".`,\n status\n );\n}\n\nfunction validateResponseStatus(status) {\n return status === 200 || status === 206;\n}\n\nexport {\n createResponseStatusError,\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n validateResponseStatus,\n};\n","/* Copyright 2017 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { stringToBytes } from \"../shared/util.js\";\n\n// This getFilenameFromContentDispositionHeader function is adapted from\n// https://github.com/Rob--W/open-in-browser/blob/7e2e35a38b8b4e981b11da7b2f01df0149049e92/extension/content-disposition.js\n// with the following changes:\n// - Modified to conform to PDF.js's coding style.\n// - Move return to the end of the function to prevent Babel from dropping the\n// function declarations.\n\n/**\n * Extract file name from the Content-Disposition HTTP response header.\n *\n * @param {string} contentDisposition\n * @returns {string} Filename, if found in the Content-Disposition header.\n */\nfunction getFilenameFromContentDispositionHeader(contentDisposition) {\n let needsEncodingFixup = true;\n\n // filename*=ext-value (\"ext-value\" from RFC 5987, referenced by RFC 6266).\n let tmp = toParamRegExp(\"filename\\\\*\", \"i\").exec(contentDisposition);\n if (tmp) {\n tmp = tmp[1];\n let filename = rfc2616unquote(tmp);\n filename = unescape(filename);\n filename = rfc5987decode(filename);\n filename = rfc2047decode(filename);\n return fixupEncoding(filename);\n }\n\n // Continuations (RFC 2231 section 3, referenced by RFC 5987 section 3.1).\n // filename*n*=part\n // filename*n=part\n tmp = rfc2231getparam(contentDisposition);\n if (tmp) {\n // RFC 2047, section\n const filename = rfc2047decode(tmp);\n return fixupEncoding(filename);\n }\n\n // filename=value (RFC 5987, section 4.1).\n tmp = toParamRegExp(\"filename\", \"i\").exec(contentDisposition);\n if (tmp) {\n tmp = tmp[1];\n let filename = rfc2616unquote(tmp);\n filename = rfc2047decode(filename);\n return fixupEncoding(filename);\n }\n\n // After this line there are only function declarations. We cannot put\n // \"return\" here for readability because babel would then drop the function\n // declarations...\n function toParamRegExp(attributePattern, flags) {\n return new RegExp(\n \"(?:^|;)\\\\s*\" +\n attributePattern +\n \"\\\\s*=\\\\s*\" +\n // Captures: value = token | quoted-string\n // (RFC 2616, section 3.6 and referenced by RFC 6266 4.1)\n \"(\" +\n '[^\";\\\\s][^;\\\\s]*' +\n \"|\" +\n '\"(?:[^\"\\\\\\\\]|\\\\\\\\\"?)+\"?' +\n \")\",\n flags\n );\n }\n function textdecode(encoding, value) {\n if (encoding) {\n if (!/^[\\x00-\\xFF]+$/.test(value)) {\n return value;\n }\n try {\n const decoder = new TextDecoder(encoding, { fatal: true });\n const buffer = stringToBytes(value);\n value = decoder.decode(buffer);\n needsEncodingFixup = false;\n } catch {\n // TextDecoder constructor threw - unrecognized encoding.\n }\n }\n return value;\n }\n function fixupEncoding(value) {\n if (needsEncodingFixup && /[\\x80-\\xff]/.test(value)) {\n // Maybe multi-byte UTF-8.\n value = textdecode(\"utf-8\", value);\n if (needsEncodingFixup) {\n // Try iso-8859-1 encoding.\n value = textdecode(\"iso-8859-1\", value);\n }\n }\n return value;\n }\n function rfc2231getparam(contentDispositionStr) {\n const matches = [];\n let match;\n // Iterate over all filename*n= and filename*n*= with n being an integer\n // of at least zero. Any non-zero number must not start with '0'.\n const iter = toParamRegExp(\"filename\\\\*((?!0\\\\d)\\\\d+)(\\\\*?)\", \"ig\");\n while ((match = iter.exec(contentDispositionStr)) !== null) {\n let [, n, quot, part] = match; // eslint-disable-line prefer-const\n n = parseInt(n, 10);\n if (n in matches) {\n // Ignore anything after the invalid second filename*0.\n if (n === 0) {\n break;\n }\n continue;\n }\n matches[n] = [quot, part];\n }\n const parts = [];\n for (let n = 0; n < matches.length; ++n) {\n if (!(n in matches)) {\n // Numbers must be consecutive. Truncate when there is a hole.\n break;\n }\n let [quot, part] = matches[n]; // eslint-disable-line prefer-const\n part = rfc2616unquote(part);\n if (quot) {\n part = unescape(part);\n if (n === 0) {\n part = rfc5987decode(part);\n }\n }\n parts.push(part);\n }\n return parts.join(\"\");\n }\n function rfc2616unquote(value) {\n if (value.startsWith('\"')) {\n const parts = value.slice(1).split('\\\\\"');\n // Find the first unescaped \" and terminate there.\n for (let i = 0; i < parts.length; ++i) {\n const quotindex = parts[i].indexOf('\"');\n if (quotindex !== -1) {\n parts[i] = parts[i].slice(0, quotindex);\n parts.length = i + 1; // Truncates and stop the iteration.\n }\n parts[i] = parts[i].replaceAll(/\\\\(.)/g, \"$1\");\n }\n value = parts.join('\"');\n }\n return value;\n }\n function rfc5987decode(extvalue) {\n // Decodes \"ext-value\" from RFC 5987.\n const encodingend = extvalue.indexOf(\"'\");\n if (encodingend === -1) {\n // Some servers send \"filename*=\" without encoding 'language' prefix,\n // e.g. in https://github.com/Rob--W/open-in-browser/issues/26\n // Let's accept the value like Firefox (57) (Chrome 62 rejects it).\n return extvalue;\n }\n const encoding = extvalue.slice(0, encodingend);\n const langvalue = extvalue.slice(encodingend + 1);\n // Ignore language (RFC 5987 section 3.2.1, and RFC 6266 section 4.1 ).\n const value = langvalue.replace(/^[^']*'/, \"\");\n return textdecode(encoding, value);\n }\n function rfc2047decode(value) {\n // RFC 2047-decode the result. Firefox tried to drop support for it, but\n // backed out because some servers use it - https://bugzil.la/875615\n // Firefox's condition for decoding is here: https://searchfox.org/mozilla-central/rev/4a590a5a15e35d88a3b23dd6ac3c471cf85b04a8/netwerk/mime/nsMIMEHeaderParamImpl.cpp#742-748\n\n // We are more strict and only recognize RFC 2047-encoding if the value\n // starts with \"=?\", since then it is likely that the full value is\n // RFC 2047-encoded.\n\n // Firefox also decodes words even where RFC 2047 section 5 states:\n // \"An 'encoded-word' MUST NOT appear within a 'quoted-string'.\"\n if (!value.startsWith(\"=?\") || /[\\x00-\\x19\\x80-\\xff]/.test(value)) {\n return value;\n }\n // RFC 2047, section 2.4\n // encoded-word = \"=?\" charset \"?\" encoding \"?\" encoded-text \"?=\"\n // charset = token (but let's restrict to characters that denote a\n // possibly valid encoding).\n // encoding = q or b\n // encoded-text = any printable ASCII character other than ? or space.\n // ... but Firefox permits ? and space.\n return value.replaceAll(\n /=\\?([\\w-]*)\\?([QqBb])\\?((?:[^?]|\\?(?!=))*)\\?=/g,\n function (matches, charset, encoding, text) {\n if (encoding === \"q\" || encoding === \"Q\") {\n // RFC 2047 section 4.2.\n text = text.replaceAll(\"_\", \" \");\n text = text.replaceAll(/=([0-9a-fA-F]{2})/g, function (match, hex) {\n return String.fromCharCode(parseInt(hex, 16));\n });\n return textdecode(charset, text);\n } // else encoding is b or B - base64 (RFC 2047 section 4.1)\n try {\n text = atob(text);\n } catch {}\n return textdecode(charset, text);\n }\n );\n }\n\n return \"\";\n}\n\nexport { getFilenameFromContentDispositionHeader };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { assert, PromiseCapability, stringToBytes } from \"../shared/util.js\";\nimport {\n createResponseStatusError,\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n} from \"./network_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./network.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nconst OK_RESPONSE = 200;\nconst PARTIAL_CONTENT_RESPONSE = 206;\n\nfunction getArrayBuffer(xhr) {\n const data = xhr.response;\n if (typeof data !== \"string\") {\n return data;\n }\n return stringToBytes(data).buffer;\n}\n\nclass NetworkManager {\n constructor(url, args = {}) {\n this.url = url;\n this.isHttp = /^https?:/i.test(url);\n this.httpHeaders = (this.isHttp && args.httpHeaders) || Object.create(null);\n this.withCredentials = args.withCredentials || false;\n\n this.currXhrId = 0;\n this.pendingRequests = Object.create(null);\n }\n\n requestRange(begin, end, listeners) {\n const args = {\n begin,\n end,\n };\n for (const prop in listeners) {\n args[prop] = listeners[prop];\n }\n return this.request(args);\n }\n\n requestFull(listeners) {\n return this.request(listeners);\n }\n\n request(args) {\n const xhr = new XMLHttpRequest();\n const xhrId = this.currXhrId++;\n const pendingRequest = (this.pendingRequests[xhrId] = { xhr });\n\n xhr.open(\"GET\", this.url);\n xhr.withCredentials = this.withCredentials;\n for (const property in this.httpHeaders) {\n const value = this.httpHeaders[property];\n if (value === undefined) {\n continue;\n }\n xhr.setRequestHeader(property, value);\n }\n if (this.isHttp && \"begin\" in args && \"end\" in args) {\n xhr.setRequestHeader(\"Range\", `bytes=${args.begin}-${args.end - 1}`);\n pendingRequest.expectedStatus = PARTIAL_CONTENT_RESPONSE;\n } else {\n pendingRequest.expectedStatus = OK_RESPONSE;\n }\n xhr.responseType = \"arraybuffer\";\n\n if (args.onError) {\n xhr.onerror = function (evt) {\n args.onError(xhr.status);\n };\n }\n xhr.onreadystatechange = this.onStateChange.bind(this, xhrId);\n xhr.onprogress = this.onProgress.bind(this, xhrId);\n\n pendingRequest.onHeadersReceived = args.onHeadersReceived;\n pendingRequest.onDone = args.onDone;\n pendingRequest.onError = args.onError;\n pendingRequest.onProgress = args.onProgress;\n\n xhr.send(null);\n\n return xhrId;\n }\n\n onProgress(xhrId, evt) {\n const pendingRequest = this.pendingRequests[xhrId];\n if (!pendingRequest) {\n return; // Maybe abortRequest was called...\n }\n pendingRequest.onProgress?.(evt);\n }\n\n onStateChange(xhrId, evt) {\n const pendingRequest = this.pendingRequests[xhrId];\n if (!pendingRequest) {\n return; // Maybe abortRequest was called...\n }\n\n const xhr = pendingRequest.xhr;\n if (xhr.readyState >= 2 && pendingRequest.onHeadersReceived) {\n pendingRequest.onHeadersReceived();\n delete pendingRequest.onHeadersReceived;\n }\n\n if (xhr.readyState !== 4) {\n return;\n }\n\n if (!(xhrId in this.pendingRequests)) {\n // The XHR request might have been aborted in onHeadersReceived()\n // callback, in which case we should abort request.\n return;\n }\n\n delete this.pendingRequests[xhrId];\n\n // Success status == 0 can be on ftp, file and other protocols.\n if (xhr.status === 0 && this.isHttp) {\n pendingRequest.onError?.(xhr.status);\n return;\n }\n const xhrStatus = xhr.status || OK_RESPONSE;\n\n // From http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.35.2:\n // \"A server MAY ignore the Range header\". This means it's possible to\n // get a 200 rather than a 206 response from a range request.\n const ok_response_on_range_request =\n xhrStatus === OK_RESPONSE &&\n pendingRequest.expectedStatus === PARTIAL_CONTENT_RESPONSE;\n\n if (\n !ok_response_on_range_request &&\n xhrStatus !== pendingRequest.expectedStatus\n ) {\n pendingRequest.onError?.(xhr.status);\n return;\n }\n\n const chunk = getArrayBuffer(xhr);\n if (xhrStatus === PARTIAL_CONTENT_RESPONSE) {\n const rangeHeader = xhr.getResponseHeader(\"Content-Range\");\n const matches = /bytes (\\d+)-(\\d+)\\/(\\d+)/.exec(rangeHeader);\n pendingRequest.onDone({\n begin: parseInt(matches[1], 10),\n chunk,\n });\n } else if (chunk) {\n pendingRequest.onDone({\n begin: 0,\n chunk,\n });\n } else {\n pendingRequest.onError?.(xhr.status);\n }\n }\n\n getRequestXhr(xhrId) {\n return this.pendingRequests[xhrId].xhr;\n }\n\n isPendingRequest(xhrId) {\n return xhrId in this.pendingRequests;\n }\n\n abortRequest(xhrId) {\n const xhr = this.pendingRequests[xhrId].xhr;\n delete this.pendingRequests[xhrId];\n xhr.abort();\n }\n}\n\n/** @implements {IPDFStream} */\nclass PDFNetworkStream {\n constructor(source) {\n this._source = source;\n this._manager = new NetworkManager(source.url, {\n httpHeaders: source.httpHeaders,\n withCredentials: source.withCredentials,\n });\n this._rangeChunkSize = source.rangeChunkSize;\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n _onRangeRequestReaderClosed(reader) {\n const i = this._rangeRequestReaders.indexOf(reader);\n if (i >= 0) {\n this._rangeRequestReaders.splice(i, 1);\n }\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFNetworkStream.getFullReader can only be called once.\"\n );\n this._fullRequestReader = new PDFNetworkStreamFullRequestReader(\n this._manager,\n this._source\n );\n return this._fullRequestReader;\n }\n\n getRangeReader(begin, end) {\n const reader = new PDFNetworkStreamRangeRequestReader(\n this._manager,\n begin,\n end\n );\n reader.onClosed = this._onRangeRequestReaderClosed.bind(this);\n this._rangeRequestReaders.push(reader);\n return reader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n}\n\n/** @implements {IPDFStreamReader} */\nclass PDFNetworkStreamFullRequestReader {\n constructor(manager, source) {\n this._manager = manager;\n\n const args = {\n onHeadersReceived: this._onHeadersReceived.bind(this),\n onDone: this._onDone.bind(this),\n onError: this._onError.bind(this),\n onProgress: this._onProgress.bind(this),\n };\n this._url = source.url;\n this._fullRequestId = manager.requestFull(args);\n this._headersReceivedCapability = new PromiseCapability();\n this._disableRange = source.disableRange || false;\n this._contentLength = source.length; // Optional\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._isStreamingSupported = false;\n this._isRangeSupported = false;\n\n this._cachedChunks = [];\n this._requests = [];\n this._done = false;\n this._storedError = undefined;\n this._filename = null;\n\n this.onProgress = null;\n }\n\n _onHeadersReceived() {\n const fullRequestXhrId = this._fullRequestId;\n const fullRequestXhr = this._manager.getRequestXhr(fullRequestXhrId);\n\n const getResponseHeader = name => {\n return fullRequestXhr.getResponseHeader(name);\n };\n const { allowRangeRequests, suggestedLength } =\n validateRangeRequestCapabilities({\n getResponseHeader,\n isHttp: this._manager.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange,\n });\n\n if (allowRangeRequests) {\n this._isRangeSupported = true;\n }\n // Setting right content length.\n this._contentLength = suggestedLength || this._contentLength;\n\n this._filename = extractFilenameFromHeader(getResponseHeader);\n\n if (this._isRangeSupported) {\n // NOTE: by cancelling the full request, and then issuing range\n // requests, there will be an issue for sites where you can only\n // request the pdf once. However, if this is the case, then the\n // server should not be returning that it can support range requests.\n this._manager.abortRequest(fullRequestXhrId);\n }\n\n this._headersReceivedCapability.resolve();\n }\n\n _onDone(data) {\n if (data) {\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n requestCapability.resolve({ value: data.chunk, done: false });\n } else {\n this._cachedChunks.push(data.chunk);\n }\n }\n this._done = true;\n if (this._cachedChunks.length > 0) {\n return;\n }\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n }\n\n _onError(status) {\n this._storedError = createResponseStatusError(status, this._url);\n this._headersReceivedCapability.reject(this._storedError);\n for (const requestCapability of this._requests) {\n requestCapability.reject(this._storedError);\n }\n this._requests.length = 0;\n this._cachedChunks.length = 0;\n }\n\n _onProgress(evt) {\n this.onProgress?.({\n loaded: evt.loaded,\n total: evt.lengthComputable ? evt.total : this._contentLength,\n });\n }\n\n get filename() {\n return this._filename;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get headersReady() {\n return this._headersReceivedCapability.promise;\n }\n\n async read() {\n if (this._storedError) {\n throw this._storedError;\n }\n if (this._cachedChunks.length > 0) {\n const chunk = this._cachedChunks.shift();\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = new PromiseCapability();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n this._headersReceivedCapability.reject(reason);\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n if (this._manager.isPendingRequest(this._fullRequestId)) {\n this._manager.abortRequest(this._fullRequestId);\n }\n this._fullRequestReader = null;\n }\n}\n\n/** @implements {IPDFStreamRangeReader} */\nclass PDFNetworkStreamRangeRequestReader {\n constructor(manager, begin, end) {\n this._manager = manager;\n\n const args = {\n onDone: this._onDone.bind(this),\n onError: this._onError.bind(this),\n onProgress: this._onProgress.bind(this),\n };\n this._url = manager.url;\n this._requestId = manager.requestRange(begin, end, args);\n this._requests = [];\n this._queuedChunk = null;\n this._done = false;\n this._storedError = undefined;\n\n this.onProgress = null;\n this.onClosed = null;\n }\n\n _close() {\n this.onClosed?.(this);\n }\n\n _onDone(data) {\n const chunk = data.chunk;\n if (this._requests.length > 0) {\n const requestCapability = this._requests.shift();\n requestCapability.resolve({ value: chunk, done: false });\n } else {\n this._queuedChunk = chunk;\n }\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n this._close();\n }\n\n _onError(status) {\n this._storedError = createResponseStatusError(status, this._url);\n for (const requestCapability of this._requests) {\n requestCapability.reject(this._storedError);\n }\n this._requests.length = 0;\n this._queuedChunk = null;\n }\n\n _onProgress(evt) {\n if (!this.isStreamingSupported) {\n this.onProgress?.({ loaded: evt.loaded });\n }\n }\n\n get isStreamingSupported() {\n return false;\n }\n\n async read() {\n if (this._storedError) {\n throw this._storedError;\n }\n if (this._queuedChunk !== null) {\n const chunk = this._queuedChunk;\n this._queuedChunk = null;\n return { value: chunk, done: false };\n }\n if (this._done) {\n return { value: undefined, done: true };\n }\n const requestCapability = new PromiseCapability();\n this._requests.push(requestCapability);\n return requestCapability.promise;\n }\n\n cancel(reason) {\n this._done = true;\n for (const requestCapability of this._requests) {\n requestCapability.resolve({ value: undefined, done: true });\n }\n this._requests.length = 0;\n if (this._manager.isPendingRequest(this._requestId)) {\n this._manager.abortRequest(this._requestId);\n }\n this._close();\n }\n}\n\nexport { PDFNetworkStream };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals __non_webpack_require__ */\n\nimport {\n AbortException,\n assert,\n MissingPDFException,\n PromiseCapability,\n} from \"../shared/util.js\";\nimport {\n extractFilenameFromHeader,\n validateRangeRequestCapabilities,\n} from \"./network_utils.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n throw new Error(\n 'Module \"./node_stream.js\" shall not be used with MOZCENTRAL builds.'\n );\n}\n\nconst fileUriRegex = /^file:\\/\\/\\/[a-zA-Z]:\\//;\n\nfunction parseUrl(sourceUrl) {\n const url = __non_webpack_require__(\"url\");\n const parsedUrl = url.parse(sourceUrl);\n if (parsedUrl.protocol === \"file:\" || parsedUrl.host) {\n return parsedUrl;\n }\n // Prepending 'file:///' to Windows absolute path.\n if (/^[a-z]:[/\\\\]/i.test(sourceUrl)) {\n return url.parse(`file:///${sourceUrl}`);\n }\n // Changes protocol to 'file:' if url refers to filesystem.\n if (!parsedUrl.host) {\n parsedUrl.protocol = \"file:\";\n }\n return parsedUrl;\n}\n\nclass PDFNodeStream {\n constructor(source) {\n this.source = source;\n this.url = parseUrl(source.url);\n this.isHttp =\n this.url.protocol === \"http:\" || this.url.protocol === \"https:\";\n // Check if url refers to filesystem.\n this.isFsUrl = this.url.protocol === \"file:\";\n this.httpHeaders = (this.isHttp && source.httpHeaders) || {};\n\n this._fullRequestReader = null;\n this._rangeRequestReaders = [];\n }\n\n get _progressiveDataLength() {\n return this._fullRequestReader?._loaded ?? 0;\n }\n\n getFullReader() {\n assert(\n !this._fullRequestReader,\n \"PDFNodeStream.getFullReader can only be called once.\"\n );\n this._fullRequestReader = this.isFsUrl\n ? new PDFNodeStreamFsFullReader(this)\n : new PDFNodeStreamFullReader(this);\n return this._fullRequestReader;\n }\n\n getRangeReader(start, end) {\n if (end <= this._progressiveDataLength) {\n return null;\n }\n const rangeReader = this.isFsUrl\n ? new PDFNodeStreamFsRangeReader(this, start, end)\n : new PDFNodeStreamRangeReader(this, start, end);\n this._rangeRequestReaders.push(rangeReader);\n return rangeReader;\n }\n\n cancelAllRequests(reason) {\n this._fullRequestReader?.cancel(reason);\n\n for (const reader of this._rangeRequestReaders.slice(0)) {\n reader.cancel(reason);\n }\n }\n}\n\nclass BaseFullReader {\n constructor(stream) {\n this._url = stream.url;\n this._done = false;\n this._storedError = null;\n this.onProgress = null;\n const source = stream.source;\n this._contentLength = source.length; // optional\n this._loaded = 0;\n this._filename = null;\n\n this._disableRange = source.disableRange || false;\n this._rangeChunkSize = source.rangeChunkSize;\n if (!this._rangeChunkSize && !this._disableRange) {\n this._disableRange = true;\n }\n\n this._isStreamingSupported = !source.disableStream;\n this._isRangeSupported = !source.disableRange;\n\n this._readableStream = null;\n this._readCapability = new PromiseCapability();\n this._headersCapability = new PromiseCapability();\n }\n\n get headersReady() {\n return this._headersCapability.promise;\n }\n\n get filename() {\n return this._filename;\n }\n\n get contentLength() {\n return this._contentLength;\n }\n\n get isRangeSupported() {\n return this._isRangeSupported;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n if (this._done) {\n return { value: undefined, done: true };\n }\n if (this._storedError) {\n throw this._storedError;\n }\n\n const chunk = this._readableStream.read();\n if (chunk === null) {\n this._readCapability = new PromiseCapability();\n return this.read();\n }\n this._loaded += chunk.length;\n this.onProgress?.({\n loaded: this._loaded,\n total: this._contentLength,\n });\n\n // Ensure that `read()` method returns ArrayBuffer.\n const buffer = new Uint8Array(chunk).buffer;\n return { value: buffer, done: false };\n }\n\n cancel(reason) {\n // Call `this._error()` method when cancel is called\n // before _readableStream is set.\n if (!this._readableStream) {\n this._error(reason);\n return;\n }\n this._readableStream.destroy(reason);\n }\n\n _error(reason) {\n this._storedError = reason;\n this._readCapability.resolve();\n }\n\n _setReadableStream(readableStream) {\n this._readableStream = readableStream;\n readableStream.on(\"readable\", () => {\n this._readCapability.resolve();\n });\n\n readableStream.on(\"end\", () => {\n // Destroy readable to minimize resource usage.\n readableStream.destroy();\n this._done = true;\n this._readCapability.resolve();\n });\n\n readableStream.on(\"error\", reason => {\n this._error(reason);\n });\n\n // We need to stop reading when range is supported and streaming is\n // disabled.\n if (!this._isStreamingSupported && this._isRangeSupported) {\n this._error(new AbortException(\"streaming is disabled\"));\n }\n\n // Destroy ReadableStream if already in errored state.\n if (this._storedError) {\n this._readableStream.destroy(this._storedError);\n }\n }\n}\n\nclass BaseRangeReader {\n constructor(stream) {\n this._url = stream.url;\n this._done = false;\n this._storedError = null;\n this.onProgress = null;\n this._loaded = 0;\n this._readableStream = null;\n this._readCapability = new PromiseCapability();\n const source = stream.source;\n this._isStreamingSupported = !source.disableStream;\n }\n\n get isStreamingSupported() {\n return this._isStreamingSupported;\n }\n\n async read() {\n await this._readCapability.promise;\n if (this._done) {\n return { value: undefined, done: true };\n }\n if (this._storedError) {\n throw this._storedError;\n }\n\n const chunk = this._readableStream.read();\n if (chunk === null) {\n this._readCapability = new PromiseCapability();\n return this.read();\n }\n this._loaded += chunk.length;\n this.onProgress?.({ loaded: this._loaded });\n\n // Ensure that `read()` method returns ArrayBuffer.\n const buffer = new Uint8Array(chunk).buffer;\n return { value: buffer, done: false };\n }\n\n cancel(reason) {\n // Call `this._error()` method when cancel is called\n // before _readableStream is set.\n if (!this._readableStream) {\n this._error(reason);\n return;\n }\n this._readableStream.destroy(reason);\n }\n\n _error(reason) {\n this._storedError = reason;\n this._readCapability.resolve();\n }\n\n _setReadableStream(readableStream) {\n this._readableStream = readableStream;\n readableStream.on(\"readable\", () => {\n this._readCapability.resolve();\n });\n\n readableStream.on(\"end\", () => {\n // Destroy readableStream to minimize resource usage.\n readableStream.destroy();\n this._done = true;\n this._readCapability.resolve();\n });\n\n readableStream.on(\"error\", reason => {\n this._error(reason);\n });\n\n // Destroy readableStream if already in errored state.\n if (this._storedError) {\n this._readableStream.destroy(this._storedError);\n }\n }\n}\n\nfunction createRequestOptions(parsedUrl, headers) {\n return {\n protocol: parsedUrl.protocol,\n auth: parsedUrl.auth,\n host: parsedUrl.hostname,\n port: parsedUrl.port,\n path: parsedUrl.path,\n method: \"GET\",\n headers,\n };\n}\n\nclass PDFNodeStreamFullReader extends BaseFullReader {\n constructor(stream) {\n super(stream);\n\n const handleResponse = response => {\n if (response.statusCode === 404) {\n const error = new MissingPDFException(`Missing PDF \"${this._url}\".`);\n this._storedError = error;\n this._headersCapability.reject(error);\n return;\n }\n this._headersCapability.resolve();\n this._setReadableStream(response);\n\n const getResponseHeader = name => {\n // Make sure that headers name are in lower case, as mentioned\n // here: https://nodejs.org/api/http.html#http_message_headers.\n return this._readableStream.headers[name.toLowerCase()];\n };\n const { allowRangeRequests, suggestedLength } =\n validateRangeRequestCapabilities({\n getResponseHeader,\n isHttp: stream.isHttp,\n rangeChunkSize: this._rangeChunkSize,\n disableRange: this._disableRange,\n });\n\n this._isRangeSupported = allowRangeRequests;\n // Setting right content length.\n this._contentLength = suggestedLength || this._contentLength;\n\n this._filename = extractFilenameFromHeader(getResponseHeader);\n };\n\n this._request = null;\n if (this._url.protocol === \"http:\") {\n const http = __non_webpack_require__(\"http\");\n this._request = http.request(\n createRequestOptions(this._url, stream.httpHeaders),\n handleResponse\n );\n } else {\n const https = __non_webpack_require__(\"https\");\n this._request = https.request(\n createRequestOptions(this._url, stream.httpHeaders),\n handleResponse\n );\n }\n\n this._request.on(\"error\", reason => {\n this._storedError = reason;\n this._headersCapability.reject(reason);\n });\n // Note: `request.end(data)` is used to write `data` to request body\n // and notify end of request. But one should always call `request.end()`\n // even if there is no data to write -- (to notify the end of request).\n this._request.end();\n }\n}\n\nclass PDFNodeStreamRangeReader extends BaseRangeReader {\n constructor(stream, start, end) {\n super(stream);\n\n this._httpHeaders = {};\n for (const property in stream.httpHeaders) {\n const value = stream.httpHeaders[property];\n if (value === undefined) {\n continue;\n }\n this._httpHeaders[property] = value;\n }\n this._httpHeaders.Range = `bytes=${start}-${end - 1}`;\n\n const handleResponse = response => {\n if (response.statusCode === 404) {\n const error = new MissingPDFException(`Missing PDF \"${this._url}\".`);\n this._storedError = error;\n return;\n }\n this._setReadableStream(response);\n };\n\n this._request = null;\n if (this._url.protocol === \"http:\") {\n const http = __non_webpack_require__(\"http\");\n this._request = http.request(\n createRequestOptions(this._url, this._httpHeaders),\n handleResponse\n );\n } else {\n const https = __non_webpack_require__(\"https\");\n this._request = https.request(\n createRequestOptions(this._url, this._httpHeaders),\n handleResponse\n );\n }\n\n this._request.on(\"error\", reason => {\n this._storedError = reason;\n });\n this._request.end();\n }\n}\n\nclass PDFNodeStreamFsFullReader extends BaseFullReader {\n constructor(stream) {\n super(stream);\n\n let path = decodeURIComponent(this._url.path);\n\n // Remove the extra slash to get right path from url like `file:///C:/`\n if (fileUriRegex.test(this._url.href)) {\n path = path.replace(/^\\//, \"\");\n }\n\n const fs = __non_webpack_require__(\"fs\");\n fs.lstat(path, (error, stat) => {\n if (error) {\n if (error.code === \"ENOENT\") {\n error = new MissingPDFException(`Missing PDF \"${path}\".`);\n }\n this._storedError = error;\n this._headersCapability.reject(error);\n return;\n }\n // Setting right content length.\n this._contentLength = stat.size;\n\n this._setReadableStream(fs.createReadStream(path));\n this._headersCapability.resolve();\n });\n }\n}\n\nclass PDFNodeStreamFsRangeReader extends BaseRangeReader {\n constructor(stream, start, end) {\n super(stream);\n\n let path = decodeURIComponent(this._url.path);\n\n // Remove the extra slash to get right path from url like `file:///C:/`\n if (fileUriRegex.test(this._url.href)) {\n path = path.replace(/^\\//, \"\");\n }\n\n const fs = __non_webpack_require__(\"fs\");\n this._setReadableStream(fs.createReadStream(path, { start, end: end - 1 }));\n }\n}\n\nexport { PDFNodeStream };\n","/* Copyright 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n/* globals __non_webpack_require__ */\n\nimport { deprecated, DOMSVGFactory } from \"./display_utils.js\";\nimport {\n FONT_IDENTITY_MATRIX,\n IDENTITY_MATRIX,\n ImageKind,\n isNodeJS,\n OPS,\n TextRenderingMode,\n Util,\n warn,\n} from \"../shared/util.js\";\n\nif (typeof PDFJSDev !== \"undefined\" && !PDFJSDev.test(\"GENERIC\")) {\n throw new Error(\n 'Module \"SVGGraphics\" shall not be used outside GENERIC builds.'\n );\n}\n\nconst SVG_DEFAULTS = {\n fontStyle: \"normal\",\n fontWeight: \"normal\",\n fillColor: \"#000000\",\n};\nconst XML_NS = \"http://www.w3.org/XML/1998/namespace\";\nconst XLINK_NS = \"http://www.w3.org/1999/xlink\";\nconst LINE_CAP_STYLES = [\"butt\", \"round\", \"square\"];\nconst LINE_JOIN_STYLES = [\"miter\", \"round\", \"bevel\"];\n\nconst createObjectURL = function (\n data,\n contentType = \"\",\n forceDataSchema = false\n) {\n if (URL.createObjectURL && typeof Blob !== \"undefined\" && !forceDataSchema) {\n return URL.createObjectURL(new Blob([data], { type: contentType }));\n }\n // Blob/createObjectURL is not available, falling back to data schema.\n const digits =\n \"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=\";\n\n let buffer = `data:${contentType};base64,`;\n for (let i = 0, ii = data.length; i < ii; i += 3) {\n const b1 = data[i] & 0xff;\n const b2 = data[i + 1] & 0xff;\n const b3 = data[i + 2] & 0xff;\n const d1 = b1 >> 2,\n d2 = ((b1 & 3) << 4) | (b2 >> 4);\n const d3 = i + 1 < ii ? ((b2 & 0xf) << 2) | (b3 >> 6) : 64;\n const d4 = i + 2 < ii ? b3 & 0x3f : 64;\n buffer += digits[d1] + digits[d2] + digits[d3] + digits[d4];\n }\n return buffer;\n};\n\nconst convertImgDataToPng = (function () {\n const PNG_HEADER = new Uint8Array([\n 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a,\n ]);\n const CHUNK_WRAPPER_SIZE = 12;\n\n const crcTable = new Int32Array(256);\n for (let i = 0; i < 256; i++) {\n let c = i;\n for (let h = 0; h < 8; h++) {\n c = c & 1 ? 0xedb88320 ^ ((c >> 1) & 0x7fffffff) : (c >> 1) & 0x7fffffff;\n }\n crcTable[i] = c;\n }\n\n function crc32(data, start, end) {\n let crc = -1;\n for (let i = start; i < end; i++) {\n const a = (crc ^ data[i]) & 0xff;\n const b = crcTable[a];\n crc = (crc >>> 8) ^ b;\n }\n return crc ^ -1;\n }\n\n function writePngChunk(type, body, data, offset) {\n let p = offset;\n const len = body.length;\n\n data[p] = (len >> 24) & 0xff;\n data[p + 1] = (len >> 16) & 0xff;\n data[p + 2] = (len >> 8) & 0xff;\n data[p + 3] = len & 0xff;\n p += 4;\n\n data[p] = type.charCodeAt(0) & 0xff;\n data[p + 1] = type.charCodeAt(1) & 0xff;\n data[p + 2] = type.charCodeAt(2) & 0xff;\n data[p + 3] = type.charCodeAt(3) & 0xff;\n p += 4;\n\n data.set(body, p);\n p += body.length;\n\n const crc = crc32(data, offset + 4, p);\n data[p] = (crc >> 24) & 0xff;\n data[p + 1] = (crc >> 16) & 0xff;\n data[p + 2] = (crc >> 8) & 0xff;\n data[p + 3] = crc & 0xff;\n }\n\n function adler32(data, start, end) {\n let a = 1;\n let b = 0;\n for (let i = start; i < end; ++i) {\n a = (a + (data[i] & 0xff)) % 65521;\n b = (b + a) % 65521;\n }\n return (b << 16) | a;\n }\n\n /**\n * @param {Uint8Array} literals The input data.\n * @returns {Uint8Array} The DEFLATE-compressed data stream in zlib format.\n * This is the required format for compressed streams in the PNG format:\n * http://www.libpng.org/pub/png/spec/1.2/PNG-Compression.html\n */\n function deflateSync(literals) {\n if (!isNodeJS) {\n // zlib is certainly not available outside of Node.js. We can either use\n // the pako library for client-side DEFLATE compression, or use the\n // canvas API of the browser to obtain a more optimal PNG file.\n return deflateSyncUncompressed(literals);\n }\n try {\n // NOTE: This implementation is far from perfect, but already way better\n // than not applying any compression.\n //\n // A better algorithm will try to choose a good predictor/filter and\n // then choose a suitable zlib compression strategy (e.g. 3,Z_RLE).\n //\n // Node v0.11.12 zlib.deflateSync is introduced (and returns a Buffer).\n // Node v3.0.0 Buffer inherits from Uint8Array.\n // Node v8.0.0 zlib.deflateSync accepts Uint8Array as input.\n const input =\n // eslint-disable-next-line no-undef\n parseInt(process.versions.node) >= 8 ? literals : Buffer.from(literals);\n const output = __non_webpack_require__(\"zlib\").deflateSync(input, {\n level: 9,\n });\n return output instanceof Uint8Array ? output : new Uint8Array(output);\n } catch (e) {\n warn(\"Not compressing PNG because zlib.deflateSync is unavailable: \" + e);\n }\n\n return deflateSyncUncompressed(literals);\n }\n\n // An implementation of DEFLATE with compression level 0 (Z_NO_COMPRESSION).\n function deflateSyncUncompressed(literals) {\n let len = literals.length;\n const maxBlockLength = 0xffff;\n\n const deflateBlocks = Math.ceil(len / maxBlockLength);\n const idat = new Uint8Array(2 + len + deflateBlocks * 5 + 4);\n let pi = 0;\n idat[pi++] = 0x78; // compression method and flags\n idat[pi++] = 0x9c; // flags\n\n let pos = 0;\n while (len > maxBlockLength) {\n // writing non-final DEFLATE blocks type 0 and length of 65535\n idat[pi++] = 0x00;\n idat[pi++] = 0xff;\n idat[pi++] = 0xff;\n idat[pi++] = 0x00;\n idat[pi++] = 0x00;\n idat.set(literals.subarray(pos, pos + maxBlockLength), pi);\n pi += maxBlockLength;\n pos += maxBlockLength;\n len -= maxBlockLength;\n }\n\n // writing non-final DEFLATE blocks type 0\n idat[pi++] = 0x01;\n idat[pi++] = len & 0xff;\n idat[pi++] = (len >> 8) & 0xff;\n idat[pi++] = ~len & 0xffff & 0xff;\n idat[pi++] = ((~len & 0xffff) >> 8) & 0xff;\n idat.set(literals.subarray(pos), pi);\n pi += literals.length - pos;\n\n const adler = adler32(literals, 0, literals.length); // checksum\n idat[pi++] = (adler >> 24) & 0xff;\n idat[pi++] = (adler >> 16) & 0xff;\n idat[pi++] = (adler >> 8) & 0xff;\n idat[pi++] = adler & 0xff;\n return idat;\n }\n\n function encode(imgData, kind, forceDataSchema, isMask) {\n const width = imgData.width;\n const height = imgData.height;\n let bitDepth, colorType, lineSize;\n const bytes = imgData.data;\n\n switch (kind) {\n case ImageKind.GRAYSCALE_1BPP:\n colorType = 0;\n bitDepth = 1;\n lineSize = (width + 7) >> 3;\n break;\n case ImageKind.RGB_24BPP:\n colorType = 2;\n bitDepth = 8;\n lineSize = width * 3;\n break;\n case ImageKind.RGBA_32BPP:\n colorType = 6;\n bitDepth = 8;\n lineSize = width * 4;\n break;\n default:\n throw new Error(\"invalid format\");\n }\n\n // prefix every row with predictor 0\n const literals = new Uint8Array((1 + lineSize) * height);\n let offsetLiterals = 0,\n offsetBytes = 0;\n for (let y = 0; y < height; ++y) {\n literals[offsetLiterals++] = 0; // no prediction\n literals.set(\n bytes.subarray(offsetBytes, offsetBytes + lineSize),\n offsetLiterals\n );\n offsetBytes += lineSize;\n offsetLiterals += lineSize;\n }\n\n if (kind === ImageKind.GRAYSCALE_1BPP && isMask) {\n // inverting for image masks\n offsetLiterals = 0;\n for (let y = 0; y < height; y++) {\n offsetLiterals++; // skipping predictor\n for (let i = 0; i < lineSize; i++) {\n literals[offsetLiterals++] ^= 0xff;\n }\n }\n }\n\n const ihdr = new Uint8Array([\n (width >> 24) & 0xff,\n (width >> 16) & 0xff,\n (width >> 8) & 0xff,\n width & 0xff,\n (height >> 24) & 0xff,\n (height >> 16) & 0xff,\n (height >> 8) & 0xff,\n height & 0xff,\n bitDepth, // bit depth\n colorType, // color type\n 0x00, // compression method\n 0x00, // filter method\n 0x00, // interlace method\n ]);\n const idat = deflateSync(literals);\n\n // PNG consists of: header, IHDR+data, IDAT+data, and IEND.\n const pngLength =\n PNG_HEADER.length + CHUNK_WRAPPER_SIZE * 3 + ihdr.length + idat.length;\n const data = new Uint8Array(pngLength);\n let offset = 0;\n data.set(PNG_HEADER, offset);\n offset += PNG_HEADER.length;\n writePngChunk(\"IHDR\", ihdr, data, offset);\n offset += CHUNK_WRAPPER_SIZE + ihdr.length;\n writePngChunk(\"IDATA\", idat, data, offset);\n offset += CHUNK_WRAPPER_SIZE + idat.length;\n writePngChunk(\"IEND\", new Uint8Array(0), data, offset);\n\n return createObjectURL(data, \"image/png\", forceDataSchema);\n }\n\n // eslint-disable-next-line no-shadow\n return function convertImgDataToPng(imgData, forceDataSchema, isMask) {\n const kind =\n imgData.kind === undefined ? ImageKind.GRAYSCALE_1BPP : imgData.kind;\n return encode(imgData, kind, forceDataSchema, isMask);\n };\n})();\n\nclass SVGExtraState {\n constructor() {\n this.fontSizeScale = 1;\n this.fontWeight = SVG_DEFAULTS.fontWeight;\n this.fontSize = 0;\n\n this.textMatrix = IDENTITY_MATRIX;\n this.fontMatrix = FONT_IDENTITY_MATRIX;\n this.leading = 0;\n this.textRenderingMode = TextRenderingMode.FILL;\n this.textMatrixScale = 1;\n\n // Current point (in user coordinates)\n this.x = 0;\n this.y = 0;\n\n // Start of text line (in text coordinates)\n this.lineX = 0;\n this.lineY = 0;\n\n // Character and word spacing\n this.charSpacing = 0;\n this.wordSpacing = 0;\n this.textHScale = 1;\n this.textRise = 0;\n\n // Default foreground and background colors\n this.fillColor = SVG_DEFAULTS.fillColor;\n this.strokeColor = \"#000000\";\n\n this.fillAlpha = 1;\n this.strokeAlpha = 1;\n this.lineWidth = 1;\n this.lineJoin = \"\";\n this.lineCap = \"\";\n this.miterLimit = 0;\n\n this.dashArray = [];\n this.dashPhase = 0;\n\n this.dependencies = [];\n\n // Clipping\n this.activeClipUrl = null;\n this.clipGroup = null;\n\n this.maskId = \"\";\n }\n\n clone() {\n return Object.create(this);\n }\n\n setCurrentPoint(x, y) {\n this.x = x;\n this.y = y;\n }\n}\n\nfunction opListToTree(opList) {\n let opTree = [];\n const tmp = [];\n\n for (const opListElement of opList) {\n if (opListElement.fn === \"save\") {\n opTree.push({ fnId: 92, fn: \"group\", items: [] });\n tmp.push(opTree);\n opTree = opTree.at(-1).items;\n continue;\n }\n\n if (opListElement.fn === \"restore\") {\n opTree = tmp.pop();\n } else {\n opTree.push(opListElement);\n }\n }\n return opTree;\n}\n\n/**\n * Format a float number as a string.\n *\n * @param value {number} - The float number to format.\n * @returns {string}\n */\nfunction pf(value) {\n if (Number.isInteger(value)) {\n return value.toString();\n }\n const s = value.toFixed(10);\n let i = s.length - 1;\n if (s[i] !== \"0\") {\n return s;\n }\n\n // Remove trailing zeros.\n do {\n i--;\n } while (s[i] === \"0\");\n return s.substring(0, s[i] === \".\" ? i : i + 1);\n}\n\n/**\n * Format a transform matrix as a string. The standard rotation, scale and\n * translation matrices are replaced by their shorter forms, and for\n * identity matrices an empty string is returned to save memory.\n *\n * @param m {Array} - The transform matrix to format.\n * @returns {string}\n */\nfunction pm(m) {\n if (m[4] === 0 && m[5] === 0) {\n if (m[1] === 0 && m[2] === 0) {\n if (m[0] === 1 && m[3] === 1) {\n return \"\";\n }\n return `scale(${pf(m[0])} ${pf(m[3])})`;\n }\n if (m[0] === m[3] && m[1] === -m[2]) {\n const a = (Math.acos(m[0]) * 180) / Math.PI;\n return `rotate(${pf(a)})`;\n }\n } else if (m[0] === 1 && m[1] === 0 && m[2] === 0 && m[3] === 1) {\n return `translate(${pf(m[4])} ${pf(m[5])})`;\n }\n return (\n `matrix(${pf(m[0])} ${pf(m[1])} ${pf(m[2])} ${pf(m[3])} ${pf(m[4])} ` +\n `${pf(m[5])})`\n );\n}\n\n// The counts below are relevant for all pages, so they have to be global\n// instead of being members of `SVGGraphics` (which is recreated for\n// each page).\nlet clipCount = 0;\nlet maskCount = 0;\nlet shadingCount = 0;\n\nclass SVGGraphics {\n constructor(commonObjs, objs, forceDataSchema = false) {\n deprecated(\n \"The SVG back-end is no longer maintained and *may* be removed in the future.\"\n );\n this.svgFactory = new DOMSVGFactory();\n\n this.current = new SVGExtraState();\n this.transformMatrix = IDENTITY_MATRIX; // Graphics state matrix\n this.transformStack = [];\n this.extraStack = [];\n this.commonObjs = commonObjs;\n this.objs = objs;\n this.pendingClip = null;\n this.pendingEOFill = false;\n\n this.embedFonts = false;\n this.embeddedFonts = Object.create(null);\n this.cssStyle = null;\n this.forceDataSchema = !!forceDataSchema;\n\n // In `src/shared/util.js` the operator names are mapped to IDs.\n // The list below represents the reverse of that, i.e., it maps IDs\n // to operator names.\n this._operatorIdMapping = [];\n for (const op in OPS) {\n this._operatorIdMapping[OPS[op]] = op;\n }\n }\n\n getObject(data, fallback = null) {\n if (typeof data === \"string\") {\n return data.startsWith(\"g_\")\n ? this.commonObjs.get(data)\n : this.objs.get(data);\n }\n return fallback;\n }\n\n save() {\n this.transformStack.push(this.transformMatrix);\n const old = this.current;\n this.extraStack.push(old);\n this.current = old.clone();\n }\n\n restore() {\n this.transformMatrix = this.transformStack.pop();\n this.current = this.extraStack.pop();\n this.pendingClip = null;\n this.tgrp = null;\n }\n\n group(items) {\n this.save();\n this.executeOpTree(items);\n this.restore();\n }\n\n loadDependencies(operatorList) {\n const fnArray = operatorList.fnArray;\n const argsArray = operatorList.argsArray;\n\n for (let i = 0, ii = fnArray.length; i < ii; i++) {\n if (fnArray[i] !== OPS.dependency) {\n continue;\n }\n\n for (const obj of argsArray[i]) {\n const objsPool = obj.startsWith(\"g_\") ? this.commonObjs : this.objs;\n const promise = new Promise(resolve => {\n objsPool.get(obj, resolve);\n });\n this.current.dependencies.push(promise);\n }\n }\n return Promise.all(this.current.dependencies);\n }\n\n transform(a, b, c, d, e, f) {\n const transformMatrix = [a, b, c, d, e, f];\n this.transformMatrix = Util.transform(\n this.transformMatrix,\n transformMatrix\n );\n this.tgrp = null;\n }\n\n getSVG(operatorList, viewport) {\n this.viewport = viewport;\n\n const svgElement = this._initialize(viewport);\n return this.loadDependencies(operatorList).then(() => {\n this.transformMatrix = IDENTITY_MATRIX;\n this.executeOpTree(this.convertOpList(operatorList));\n return svgElement;\n });\n }\n\n convertOpList(operatorList) {\n const operatorIdMapping = this._operatorIdMapping;\n const argsArray = operatorList.argsArray;\n const fnArray = operatorList.fnArray;\n const opList = [];\n for (let i = 0, ii = fnArray.length; i < ii; i++) {\n const fnId = fnArray[i];\n opList.push({\n fnId,\n fn: operatorIdMapping[fnId],\n args: argsArray[i],\n });\n }\n return opListToTree(opList);\n }\n\n executeOpTree(opTree) {\n for (const opTreeElement of opTree) {\n const fn = opTreeElement.fn;\n const fnId = opTreeElement.fnId;\n const args = opTreeElement.args;\n\n switch (fnId | 0) {\n case OPS.beginText:\n this.beginText();\n break;\n case OPS.dependency:\n // Handled in `loadDependencies`, so no warning should be shown.\n break;\n case OPS.setLeading:\n this.setLeading(args);\n break;\n case OPS.setLeadingMoveText:\n this.setLeadingMoveText(args[0], args[1]);\n break;\n case OPS.setFont:\n this.setFont(args);\n break;\n case OPS.showText:\n this.showText(args[0]);\n break;\n case OPS.showSpacedText:\n this.showText(args[0]);\n break;\n case OPS.endText:\n this.endText();\n break;\n case OPS.moveText:\n this.moveText(args[0], args[1]);\n break;\n case OPS.setCharSpacing:\n this.setCharSpacing(args[0]);\n break;\n case OPS.setWordSpacing:\n this.setWordSpacing(args[0]);\n break;\n case OPS.setHScale:\n this.setHScale(args[0]);\n break;\n case OPS.setTextMatrix:\n this.setTextMatrix(\n args[0],\n args[1],\n args[2],\n args[3],\n args[4],\n args[5]\n );\n break;\n case OPS.setTextRise:\n this.setTextRise(args[0]);\n break;\n case OPS.setTextRenderingMode:\n this.setTextRenderingMode(args[0]);\n break;\n case OPS.setLineWidth:\n this.setLineWidth(args[0]);\n break;\n case OPS.setLineJoin:\n this.setLineJoin(args[0]);\n break;\n case OPS.setLineCap:\n this.setLineCap(args[0]);\n break;\n case OPS.setMiterLimit:\n this.setMiterLimit(args[0]);\n break;\n case OPS.setFillRGBColor:\n this.setFillRGBColor(args[0], args[1], args[2]);\n break;\n case OPS.setStrokeRGBColor:\n this.setStrokeRGBColor(args[0], args[1], args[2]);\n break;\n case OPS.setStrokeColorN:\n this.setStrokeColorN(args);\n break;\n case OPS.setFillColorN:\n this.setFillColorN(args);\n break;\n case OPS.shadingFill:\n this.shadingFill(args[0]);\n break;\n case OPS.setDash:\n this.setDash(args[0], args[1]);\n break;\n case OPS.setRenderingIntent:\n this.setRenderingIntent(args[0]);\n break;\n case OPS.setFlatness:\n this.setFlatness(args[0]);\n break;\n case OPS.setGState:\n this.setGState(args[0]);\n break;\n case OPS.fill:\n this.fill();\n break;\n case OPS.eoFill:\n this.eoFill();\n break;\n case OPS.stroke:\n this.stroke();\n break;\n case OPS.fillStroke:\n this.fillStroke();\n break;\n case OPS.eoFillStroke:\n this.eoFillStroke();\n break;\n case OPS.clip:\n this.clip(\"nonzero\");\n break;\n case OPS.eoClip:\n this.clip(\"evenodd\");\n break;\n case OPS.paintSolidColorImageMask:\n this.paintSolidColorImageMask();\n break;\n case OPS.paintImageXObject:\n this.paintImageXObject(args[0]);\n break;\n case OPS.paintInlineImageXObject:\n this.paintInlineImageXObject(args[0]);\n break;\n case OPS.paintImageMaskXObject:\n this.paintImageMaskXObject(args[0]);\n break;\n case OPS.paintFormXObjectBegin:\n this.paintFormXObjectBegin(args[0], args[1]);\n break;\n case OPS.paintFormXObjectEnd:\n this.paintFormXObjectEnd();\n break;\n case OPS.closePath:\n this.closePath();\n break;\n case OPS.closeStroke:\n this.closeStroke();\n break;\n case OPS.closeFillStroke:\n this.closeFillStroke();\n break;\n case OPS.closeEOFillStroke:\n this.closeEOFillStroke();\n break;\n case OPS.nextLine:\n this.nextLine();\n break;\n case OPS.transform:\n this.transform(args[0], args[1], args[2], args[3], args[4], args[5]);\n break;\n case OPS.constructPath:\n this.constructPath(args[0], args[1]);\n break;\n case OPS.endPath:\n this.endPath();\n break;\n case 92:\n this.group(opTreeElement.items);\n break;\n default:\n warn(`Unimplemented operator ${fn}`);\n break;\n }\n }\n }\n\n setWordSpacing(wordSpacing) {\n this.current.wordSpacing = wordSpacing;\n }\n\n setCharSpacing(charSpacing) {\n this.current.charSpacing = charSpacing;\n }\n\n nextLine() {\n this.moveText(0, this.current.leading);\n }\n\n setTextMatrix(a, b, c, d, e, f) {\n const current = this.current;\n current.textMatrix = current.lineMatrix = [a, b, c, d, e, f];\n current.textMatrixScale = Math.hypot(a, b);\n\n current.x = current.lineX = 0;\n current.y = current.lineY = 0;\n\n current.xcoords = [];\n current.ycoords = [];\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.tspan.setAttributeNS(null, \"font-family\", current.fontFamily);\n current.tspan.setAttributeNS(\n null,\n \"font-size\",\n `${pf(current.fontSize)}px`\n );\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n\n current.txtElement = this.svgFactory.createElement(\"svg:text\");\n current.txtElement.append(current.tspan);\n }\n\n beginText() {\n const current = this.current;\n current.x = current.lineX = 0;\n current.y = current.lineY = 0;\n current.textMatrix = IDENTITY_MATRIX;\n current.lineMatrix = IDENTITY_MATRIX;\n current.textMatrixScale = 1;\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.txtElement = this.svgFactory.createElement(\"svg:text\");\n current.txtgrp = this.svgFactory.createElement(\"svg:g\");\n current.xcoords = [];\n current.ycoords = [];\n }\n\n moveText(x, y) {\n const current = this.current;\n current.x = current.lineX += x;\n current.y = current.lineY += y;\n\n current.xcoords = [];\n current.ycoords = [];\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.tspan.setAttributeNS(null, \"font-family\", current.fontFamily);\n current.tspan.setAttributeNS(\n null,\n \"font-size\",\n `${pf(current.fontSize)}px`\n );\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n }\n\n showText(glyphs) {\n const current = this.current;\n const font = current.font;\n const fontSize = current.fontSize;\n if (fontSize === 0) {\n return;\n }\n\n const fontSizeScale = current.fontSizeScale;\n const charSpacing = current.charSpacing;\n const wordSpacing = current.wordSpacing;\n const fontDirection = current.fontDirection;\n const textHScale = current.textHScale * fontDirection;\n const vertical = font.vertical;\n const spacingDir = vertical ? 1 : -1;\n const defaultVMetrics = font.defaultVMetrics;\n const widthAdvanceScale = fontSize * current.fontMatrix[0];\n\n let x = 0;\n for (const glyph of glyphs) {\n if (glyph === null) {\n // Word break\n x += fontDirection * wordSpacing;\n continue;\n } else if (typeof glyph === \"number\") {\n x += (spacingDir * glyph * fontSize) / 1000;\n continue;\n }\n\n const spacing = (glyph.isSpace ? wordSpacing : 0) + charSpacing;\n const character = glyph.fontChar;\n let scaledX, scaledY;\n let width = glyph.width;\n if (vertical) {\n let vx;\n const vmetric = glyph.vmetric || defaultVMetrics;\n vx = glyph.vmetric ? vmetric[1] : width * 0.5;\n vx = -vx * widthAdvanceScale;\n const vy = vmetric[2] * widthAdvanceScale;\n\n width = vmetric ? -vmetric[0] : width;\n scaledX = vx / fontSizeScale;\n scaledY = (x + vy) / fontSizeScale;\n } else {\n scaledX = x / fontSizeScale;\n scaledY = 0;\n }\n\n if (glyph.isInFont || font.missingFile) {\n current.xcoords.push(current.x + scaledX);\n if (vertical) {\n current.ycoords.push(-current.y + scaledY);\n }\n current.tspan.textContent += character;\n } else {\n // TODO: To assist with text selection, we should replace the missing\n // character with a space character if charWidth is not zero.\n // But we cannot just do \"character = ' '\", because the ' ' character\n // might actually map to a different glyph.\n }\n\n const charWidth = vertical\n ? width * widthAdvanceScale - spacing * fontDirection\n : width * widthAdvanceScale + spacing * fontDirection;\n\n x += charWidth;\n }\n current.tspan.setAttributeNS(null, \"x\", current.xcoords.map(pf).join(\" \"));\n if (vertical) {\n current.tspan.setAttributeNS(\n null,\n \"y\",\n current.ycoords.map(pf).join(\" \")\n );\n } else {\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n }\n\n if (vertical) {\n current.y -= x;\n } else {\n current.x += x * textHScale;\n }\n\n current.tspan.setAttributeNS(null, \"font-family\", current.fontFamily);\n current.tspan.setAttributeNS(\n null,\n \"font-size\",\n `${pf(current.fontSize)}px`\n );\n if (current.fontStyle !== SVG_DEFAULTS.fontStyle) {\n current.tspan.setAttributeNS(null, \"font-style\", current.fontStyle);\n }\n if (current.fontWeight !== SVG_DEFAULTS.fontWeight) {\n current.tspan.setAttributeNS(null, \"font-weight\", current.fontWeight);\n }\n\n const fillStrokeMode =\n current.textRenderingMode & TextRenderingMode.FILL_STROKE_MASK;\n if (\n fillStrokeMode === TextRenderingMode.FILL ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n if (current.fillColor !== SVG_DEFAULTS.fillColor) {\n current.tspan.setAttributeNS(null, \"fill\", current.fillColor);\n }\n if (current.fillAlpha < 1) {\n current.tspan.setAttributeNS(null, \"fill-opacity\", current.fillAlpha);\n }\n } else if (current.textRenderingMode === TextRenderingMode.ADD_TO_PATH) {\n // Workaround for Firefox: We must set fill=\"transparent\" because\n // fill=\"none\" would generate an empty clipping path.\n current.tspan.setAttributeNS(null, \"fill\", \"transparent\");\n } else {\n current.tspan.setAttributeNS(null, \"fill\", \"none\");\n }\n\n if (\n fillStrokeMode === TextRenderingMode.STROKE ||\n fillStrokeMode === TextRenderingMode.FILL_STROKE\n ) {\n const lineWidthScale = 1 / (current.textMatrixScale || 1);\n this._setStrokeAttributes(current.tspan, lineWidthScale);\n }\n\n // Include the text rise in the text matrix since the `pm` function\n // creates the SVG element's `translate` entry (work on a copy to avoid\n // altering the original text matrix).\n let textMatrix = current.textMatrix;\n if (current.textRise !== 0) {\n textMatrix = textMatrix.slice();\n textMatrix[5] += current.textRise;\n }\n\n current.txtElement.setAttributeNS(\n null,\n \"transform\",\n `${pm(textMatrix)} scale(${pf(textHScale)}, -1)`\n );\n current.txtElement.setAttributeNS(XML_NS, \"xml:space\", \"preserve\");\n current.txtElement.append(current.tspan);\n current.txtgrp.append(current.txtElement);\n\n this._ensureTransformGroup().append(current.txtElement);\n }\n\n setLeadingMoveText(x, y) {\n this.setLeading(-y);\n this.moveText(x, y);\n }\n\n addFontStyle(fontObj) {\n if (!fontObj.data) {\n throw new Error(\n \"addFontStyle: No font data available, \" +\n 'ensure that the \"fontExtraProperties\" API parameter is set.'\n );\n }\n if (!this.cssStyle) {\n this.cssStyle = this.svgFactory.createElement(\"svg:style\");\n this.cssStyle.setAttributeNS(null, \"type\", \"text/css\");\n this.defs.append(this.cssStyle);\n }\n\n const url = createObjectURL(\n fontObj.data,\n fontObj.mimetype,\n this.forceDataSchema\n );\n this.cssStyle.textContent +=\n `@font-face { font-family: \"${fontObj.loadedName}\";` +\n ` src: url(${url}); }\\n`;\n }\n\n setFont(details) {\n const current = this.current;\n const fontObj = this.commonObjs.get(details[0]);\n let size = details[1];\n current.font = fontObj;\n\n if (\n this.embedFonts &&\n !fontObj.missingFile &&\n !this.embeddedFonts[fontObj.loadedName]\n ) {\n this.addFontStyle(fontObj);\n this.embeddedFonts[fontObj.loadedName] = fontObj;\n }\n current.fontMatrix = fontObj.fontMatrix || FONT_IDENTITY_MATRIX;\n\n let bold = \"normal\";\n if (fontObj.black) {\n bold = \"900\";\n } else if (fontObj.bold) {\n bold = \"bold\";\n }\n const italic = fontObj.italic ? \"italic\" : \"normal\";\n\n if (size < 0) {\n size = -size;\n current.fontDirection = -1;\n } else {\n current.fontDirection = 1;\n }\n current.fontSize = size;\n current.fontFamily = fontObj.loadedName;\n current.fontWeight = bold;\n current.fontStyle = italic;\n\n current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n current.tspan.setAttributeNS(null, \"y\", pf(-current.y));\n current.xcoords = [];\n current.ycoords = [];\n }\n\n endText() {\n const current = this.current;\n if (\n current.textRenderingMode & TextRenderingMode.ADD_TO_PATH_FLAG &&\n current.txtElement?.hasChildNodes()\n ) {\n // If no glyphs are shown (i.e. no child nodes), no clipping occurs.\n current.element = current.txtElement;\n this.clip(\"nonzero\");\n this.endPath();\n }\n }\n\n // Path properties\n setLineWidth(width) {\n if (width > 0) {\n this.current.lineWidth = width;\n }\n }\n\n setLineCap(style) {\n this.current.lineCap = LINE_CAP_STYLES[style];\n }\n\n setLineJoin(style) {\n this.current.lineJoin = LINE_JOIN_STYLES[style];\n }\n\n setMiterLimit(limit) {\n this.current.miterLimit = limit;\n }\n\n setStrokeAlpha(strokeAlpha) {\n this.current.strokeAlpha = strokeAlpha;\n }\n\n setStrokeRGBColor(r, g, b) {\n this.current.strokeColor = Util.makeHexColor(r, g, b);\n }\n\n setFillAlpha(fillAlpha) {\n this.current.fillAlpha = fillAlpha;\n }\n\n setFillRGBColor(r, g, b) {\n this.current.fillColor = Util.makeHexColor(r, g, b);\n this.current.tspan = this.svgFactory.createElement(\"svg:tspan\");\n this.current.xcoords = [];\n this.current.ycoords = [];\n }\n\n setStrokeColorN(args) {\n this.current.strokeColor = this._makeColorN_Pattern(args);\n }\n\n setFillColorN(args) {\n this.current.fillColor = this._makeColorN_Pattern(args);\n }\n\n shadingFill(args) {\n const { width, height } = this.viewport;\n const inv = Util.inverseTransform(this.transformMatrix);\n const [x0, y0, x1, y1] = Util.getAxialAlignedBoundingBox(\n [0, 0, width, height],\n inv\n );\n\n const rect = this.svgFactory.createElement(\"svg:rect\");\n rect.setAttributeNS(null, \"x\", x0);\n rect.setAttributeNS(null, \"y\", y0);\n rect.setAttributeNS(null, \"width\", x1 - x0);\n rect.setAttributeNS(null, \"height\", y1 - y0);\n rect.setAttributeNS(null, \"fill\", this._makeShadingPattern(args));\n if (this.current.fillAlpha < 1) {\n rect.setAttributeNS(null, \"fill-opacity\", this.current.fillAlpha);\n }\n this._ensureTransformGroup().append(rect);\n }\n\n /**\n * @private\n */\n _makeColorN_Pattern(args) {\n if (args[0] === \"TilingPattern\") {\n return this._makeTilingPattern(args);\n }\n return this._makeShadingPattern(args);\n }\n\n /**\n * @private\n */\n _makeTilingPattern(args) {\n const color = args[1];\n const operatorList = args[2];\n const matrix = args[3] || IDENTITY_MATRIX;\n const [x0, y0, x1, y1] = args[4];\n const xstep = args[5];\n const ystep = args[6];\n const paintType = args[7];\n\n const tilingId = `shading${shadingCount++}`;\n const [tx0, ty0, tx1, ty1] = Util.normalizeRect([\n ...Util.applyTransform([x0, y0], matrix),\n ...Util.applyTransform([x1, y1], matrix),\n ]);\n const [xscale, yscale] = Util.singularValueDecompose2dScale(matrix);\n const txstep = xstep * xscale;\n const tystep = ystep * yscale;\n\n const tiling = this.svgFactory.createElement(\"svg:pattern\");\n tiling.setAttributeNS(null, \"id\", tilingId);\n tiling.setAttributeNS(null, \"patternUnits\", \"userSpaceOnUse\");\n tiling.setAttributeNS(null, \"width\", txstep);\n tiling.setAttributeNS(null, \"height\", tystep);\n tiling.setAttributeNS(null, \"x\", `${tx0}`);\n tiling.setAttributeNS(null, \"y\", `${ty0}`);\n\n // Save current state.\n const svg = this.svg;\n const transformMatrix = this.transformMatrix;\n const fillColor = this.current.fillColor;\n const strokeColor = this.current.strokeColor;\n\n const bbox = this.svgFactory.create(tx1 - tx0, ty1 - ty0);\n this.svg = bbox;\n this.transformMatrix = matrix;\n if (paintType === 2) {\n const cssColor = Util.makeHexColor(...color);\n this.current.fillColor = cssColor;\n this.current.strokeColor = cssColor;\n }\n this.executeOpTree(this.convertOpList(operatorList));\n\n // Restore saved state.\n this.svg = svg;\n this.transformMatrix = transformMatrix;\n this.current.fillColor = fillColor;\n this.current.strokeColor = strokeColor;\n\n tiling.append(bbox.childNodes[0]);\n this.defs.append(tiling);\n return `url(#${tilingId})`;\n }\n\n /**\n * @private\n */\n _makeShadingPattern(args) {\n if (typeof args === \"string\") {\n args = this.objs.get(args);\n }\n switch (args[0]) {\n case \"RadialAxial\":\n const shadingId = `shading${shadingCount++}`;\n const colorStops = args[3];\n let gradient;\n\n switch (args[1]) {\n case \"axial\":\n const point0 = args[4];\n const point1 = args[5];\n gradient = this.svgFactory.createElement(\"svg:linearGradient\");\n gradient.setAttributeNS(null, \"id\", shadingId);\n gradient.setAttributeNS(null, \"gradientUnits\", \"userSpaceOnUse\");\n gradient.setAttributeNS(null, \"x1\", point0[0]);\n gradient.setAttributeNS(null, \"y1\", point0[1]);\n gradient.setAttributeNS(null, \"x2\", point1[0]);\n gradient.setAttributeNS(null, \"y2\", point1[1]);\n break;\n case \"radial\":\n const focalPoint = args[4];\n const circlePoint = args[5];\n const focalRadius = args[6];\n const circleRadius = args[7];\n gradient = this.svgFactory.createElement(\"svg:radialGradient\");\n gradient.setAttributeNS(null, \"id\", shadingId);\n gradient.setAttributeNS(null, \"gradientUnits\", \"userSpaceOnUse\");\n gradient.setAttributeNS(null, \"cx\", circlePoint[0]);\n gradient.setAttributeNS(null, \"cy\", circlePoint[1]);\n gradient.setAttributeNS(null, \"r\", circleRadius);\n gradient.setAttributeNS(null, \"fx\", focalPoint[0]);\n gradient.setAttributeNS(null, \"fy\", focalPoint[1]);\n gradient.setAttributeNS(null, \"fr\", focalRadius);\n break;\n default:\n throw new Error(`Unknown RadialAxial type: ${args[1]}`);\n }\n for (const colorStop of colorStops) {\n const stop = this.svgFactory.createElement(\"svg:stop\");\n stop.setAttributeNS(null, \"offset\", colorStop[0]);\n stop.setAttributeNS(null, \"stop-color\", colorStop[1]);\n gradient.append(stop);\n }\n this.defs.append(gradient);\n return `url(#${shadingId})`;\n case \"Mesh\":\n warn(\"Unimplemented pattern Mesh\");\n return null;\n case \"Dummy\":\n return \"hotpink\";\n default:\n throw new Error(`Unknown IR type: ${args[0]}`);\n }\n }\n\n setDash(dashArray, dashPhase) {\n this.current.dashArray = dashArray;\n this.current.dashPhase = dashPhase;\n }\n\n constructPath(ops, args) {\n const current = this.current;\n let x = current.x,\n y = current.y;\n let d = [];\n let j = 0;\n\n for (const op of ops) {\n switch (op | 0) {\n case OPS.rectangle:\n x = args[j++];\n y = args[j++];\n const width = args[j++];\n const height = args[j++];\n const xw = x + width;\n const yh = y + height;\n d.push(\n \"M\",\n pf(x),\n pf(y),\n \"L\",\n pf(xw),\n pf(y),\n \"L\",\n pf(xw),\n pf(yh),\n \"L\",\n pf(x),\n pf(yh),\n \"Z\"\n );\n break;\n case OPS.moveTo:\n x = args[j++];\n y = args[j++];\n d.push(\"M\", pf(x), pf(y));\n break;\n case OPS.lineTo:\n x = args[j++];\n y = args[j++];\n d.push(\"L\", pf(x), pf(y));\n break;\n case OPS.curveTo:\n x = args[j + 4];\n y = args[j + 5];\n d.push(\n \"C\",\n pf(args[j]),\n pf(args[j + 1]),\n pf(args[j + 2]),\n pf(args[j + 3]),\n pf(x),\n pf(y)\n );\n j += 6;\n break;\n case OPS.curveTo2:\n d.push(\n \"C\",\n pf(x),\n pf(y),\n pf(args[j]),\n pf(args[j + 1]),\n pf(args[j + 2]),\n pf(args[j + 3])\n );\n x = args[j + 2];\n y = args[j + 3];\n j += 4;\n break;\n case OPS.curveTo3:\n x = args[j + 2];\n y = args[j + 3];\n d.push(\"C\", pf(args[j]), pf(args[j + 1]), pf(x), pf(y), pf(x), pf(y));\n j += 4;\n break;\n case OPS.closePath:\n d.push(\"Z\");\n break;\n }\n }\n\n d = d.join(\" \");\n\n if (\n current.path &&\n ops.length > 0 &&\n ops[0] !== OPS.rectangle &&\n ops[0] !== OPS.moveTo\n ) {\n // If a path does not start with an OPS.rectangle or OPS.moveTo, it has\n // probably been divided into two OPS.constructPath operators by\n // OperatorList. Append the commands to the previous path element.\n d = current.path.getAttributeNS(null, \"d\") + d;\n } else {\n current.path = this.svgFactory.createElement(\"svg:path\");\n this._ensureTransformGroup().append(current.path);\n }\n\n current.path.setAttributeNS(null, \"d\", d);\n current.path.setAttributeNS(null, \"fill\", \"none\");\n\n // Saving a reference in current.element so that it can be addressed\n // in 'fill' and 'stroke'\n current.element = current.path;\n current.setCurrentPoint(x, y);\n }\n\n endPath() {\n const current = this.current;\n\n // Painting operators end a path.\n current.path = null;\n\n if (!this.pendingClip) {\n return;\n }\n if (!current.element) {\n this.pendingClip = null;\n return;\n }\n\n // Add the current path to a clipping path.\n const clipId = `clippath${clipCount++}`;\n const clipPath = this.svgFactory.createElement(\"svg:clipPath\");\n clipPath.setAttributeNS(null, \"id\", clipId);\n clipPath.setAttributeNS(null, \"transform\", pm(this.transformMatrix));\n\n // A deep clone is needed when text is used as a clipping path.\n const clipElement = current.element.cloneNode(true);\n if (this.pendingClip === \"evenodd\") {\n clipElement.setAttributeNS(null, \"clip-rule\", \"evenodd\");\n } else {\n clipElement.setAttributeNS(null, \"clip-rule\", \"nonzero\");\n }\n this.pendingClip = null;\n clipPath.append(clipElement);\n this.defs.append(clipPath);\n\n if (current.activeClipUrl) {\n // The previous clipping group content can go out of order -- resetting\n // cached clipGroups.\n current.clipGroup = null;\n for (const prev of this.extraStack) {\n prev.clipGroup = null;\n }\n // Intersect with the previous clipping path.\n clipPath.setAttributeNS(null, \"clip-path\", current.activeClipUrl);\n }\n current.activeClipUrl = `url(#${clipId})`;\n\n this.tgrp = null;\n }\n\n clip(type) {\n this.pendingClip = type;\n }\n\n closePath() {\n const current = this.current;\n if (current.path) {\n const d = `${current.path.getAttributeNS(null, \"d\")}Z`;\n current.path.setAttributeNS(null, \"d\", d);\n }\n }\n\n setLeading(leading) {\n this.current.leading = -leading;\n }\n\n setTextRise(textRise) {\n this.current.textRise = textRise;\n }\n\n setTextRenderingMode(textRenderingMode) {\n this.current.textRenderingMode = textRenderingMode;\n }\n\n setHScale(scale) {\n this.current.textHScale = scale / 100;\n }\n\n setRenderingIntent(intent) {\n // This operation is ignored since we haven't found a use case for it yet.\n }\n\n setFlatness(flatness) {\n // This operation is ignored since we haven't found a use case for it yet.\n }\n\n setGState(states) {\n for (const [key, value] of states) {\n switch (key) {\n case \"LW\":\n this.setLineWidth(value);\n break;\n case \"LC\":\n this.setLineCap(value);\n break;\n case \"LJ\":\n this.setLineJoin(value);\n break;\n case \"ML\":\n this.setMiterLimit(value);\n break;\n case \"D\":\n this.setDash(value[0], value[1]);\n break;\n case \"RI\":\n this.setRenderingIntent(value);\n break;\n case \"FL\":\n this.setFlatness(value);\n break;\n case \"Font\":\n this.setFont(value);\n break;\n case \"CA\":\n this.setStrokeAlpha(value);\n break;\n case \"ca\":\n this.setFillAlpha(value);\n break;\n default:\n warn(`Unimplemented graphic state operator ${key}`);\n break;\n }\n }\n }\n\n fill() {\n const current = this.current;\n if (current.element) {\n current.element.setAttributeNS(null, \"fill\", current.fillColor);\n current.element.setAttributeNS(null, \"fill-opacity\", current.fillAlpha);\n this.endPath();\n }\n }\n\n stroke() {\n const current = this.current;\n if (current.element) {\n this._setStrokeAttributes(current.element);\n current.element.setAttributeNS(null, \"fill\", \"none\");\n this.endPath();\n }\n }\n\n /**\n * @private\n */\n _setStrokeAttributes(element, lineWidthScale = 1) {\n const current = this.current;\n let dashArray = current.dashArray;\n if (lineWidthScale !== 1 && dashArray.length > 0) {\n dashArray = dashArray.map(function (value) {\n return lineWidthScale * value;\n });\n }\n element.setAttributeNS(null, \"stroke\", current.strokeColor);\n element.setAttributeNS(null, \"stroke-opacity\", current.strokeAlpha);\n element.setAttributeNS(null, \"stroke-miterlimit\", pf(current.miterLimit));\n element.setAttributeNS(null, \"stroke-linecap\", current.lineCap);\n element.setAttributeNS(null, \"stroke-linejoin\", current.lineJoin);\n element.setAttributeNS(\n null,\n \"stroke-width\",\n pf(lineWidthScale * current.lineWidth) + \"px\"\n );\n element.setAttributeNS(\n null,\n \"stroke-dasharray\",\n dashArray.map(pf).join(\" \")\n );\n element.setAttributeNS(\n null,\n \"stroke-dashoffset\",\n pf(lineWidthScale * current.dashPhase) + \"px\"\n );\n }\n\n eoFill() {\n this.current.element?.setAttributeNS(null, \"fill-rule\", \"evenodd\");\n this.fill();\n }\n\n fillStroke() {\n // Order is important since stroke wants fill to be none.\n // First stroke, then if fill needed, it will be overwritten.\n this.stroke();\n this.fill();\n }\n\n eoFillStroke() {\n this.current.element?.setAttributeNS(null, \"fill-rule\", \"evenodd\");\n this.fillStroke();\n }\n\n closeStroke() {\n this.closePath();\n this.stroke();\n }\n\n closeFillStroke() {\n this.closePath();\n this.fillStroke();\n }\n\n closeEOFillStroke() {\n this.closePath();\n this.eoFillStroke();\n }\n\n paintSolidColorImageMask() {\n const rect = this.svgFactory.createElement(\"svg:rect\");\n rect.setAttributeNS(null, \"x\", \"0\");\n rect.setAttributeNS(null, \"y\", \"0\");\n rect.setAttributeNS(null, \"width\", \"1px\");\n rect.setAttributeNS(null, \"height\", \"1px\");\n rect.setAttributeNS(null, \"fill\", this.current.fillColor);\n\n this._ensureTransformGroup().append(rect);\n }\n\n paintImageXObject(objId) {\n const imgData = this.getObject(objId);\n if (!imgData) {\n warn(`Dependent image with object ID ${objId} is not ready yet`);\n return;\n }\n this.paintInlineImageXObject(imgData);\n }\n\n paintInlineImageXObject(imgData, mask) {\n const width = imgData.width;\n const height = imgData.height;\n\n const imgSrc = convertImgDataToPng(imgData, this.forceDataSchema, !!mask);\n const cliprect = this.svgFactory.createElement(\"svg:rect\");\n cliprect.setAttributeNS(null, \"x\", \"0\");\n cliprect.setAttributeNS(null, \"y\", \"0\");\n cliprect.setAttributeNS(null, \"width\", pf(width));\n cliprect.setAttributeNS(null, \"height\", pf(height));\n this.current.element = cliprect;\n this.clip(\"nonzero\");\n\n const imgEl = this.svgFactory.createElement(\"svg:image\");\n imgEl.setAttributeNS(XLINK_NS, \"xlink:href\", imgSrc);\n imgEl.setAttributeNS(null, \"x\", \"0\");\n imgEl.setAttributeNS(null, \"y\", pf(-height));\n imgEl.setAttributeNS(null, \"width\", pf(width) + \"px\");\n imgEl.setAttributeNS(null, \"height\", pf(height) + \"px\");\n imgEl.setAttributeNS(\n null,\n \"transform\",\n `scale(${pf(1 / width)} ${pf(-1 / height)})`\n );\n if (mask) {\n mask.append(imgEl);\n } else {\n this._ensureTransformGroup().append(imgEl);\n }\n }\n\n paintImageMaskXObject(img) {\n const imgData = this.getObject(img.data, img);\n if (imgData.bitmap) {\n warn(\n \"paintImageMaskXObject: ImageBitmap support is not implemented, \" +\n \"ensure that the `isOffscreenCanvasSupported` API parameter is disabled.\"\n );\n return;\n }\n const current = this.current;\n const width = imgData.width;\n const height = imgData.height;\n const fillColor = current.fillColor;\n\n current.maskId = `mask${maskCount++}`;\n const mask = this.svgFactory.createElement(\"svg:mask\");\n mask.setAttributeNS(null, \"id\", current.maskId);\n\n const rect = this.svgFactory.createElement(\"svg:rect\");\n rect.setAttributeNS(null, \"x\", \"0\");\n rect.setAttributeNS(null, \"y\", \"0\");\n rect.setAttributeNS(null, \"width\", pf(width));\n rect.setAttributeNS(null, \"height\", pf(height));\n rect.setAttributeNS(null, \"fill\", fillColor);\n rect.setAttributeNS(null, \"mask\", `url(#${current.maskId})`);\n\n this.defs.append(mask);\n this._ensureTransformGroup().append(rect);\n\n this.paintInlineImageXObject(imgData, mask);\n }\n\n paintFormXObjectBegin(matrix, bbox) {\n if (Array.isArray(matrix) && matrix.length === 6) {\n this.transform(\n matrix[0],\n matrix[1],\n matrix[2],\n matrix[3],\n matrix[4],\n matrix[5]\n );\n }\n\n if (bbox) {\n const width = bbox[2] - bbox[0];\n const height = bbox[3] - bbox[1];\n\n const cliprect = this.svgFactory.createElement(\"svg:rect\");\n cliprect.setAttributeNS(null, \"x\", bbox[0]);\n cliprect.setAttributeNS(null, \"y\", bbox[1]);\n cliprect.setAttributeNS(null, \"width\", pf(width));\n cliprect.setAttributeNS(null, \"height\", pf(height));\n this.current.element = cliprect;\n this.clip(\"nonzero\");\n this.endPath();\n }\n }\n\n paintFormXObjectEnd() {}\n\n /**\n * @private\n */\n _initialize(viewport) {\n const svg = this.svgFactory.create(viewport.width, viewport.height);\n\n // Create the definitions element.\n const definitions = this.svgFactory.createElement(\"svg:defs\");\n svg.append(definitions);\n this.defs = definitions;\n\n // Create the root group element, which acts a container for all other\n // groups and applies the viewport transform.\n const rootGroup = this.svgFactory.createElement(\"svg:g\");\n rootGroup.setAttributeNS(null, \"transform\", pm(viewport.transform));\n svg.append(rootGroup);\n\n // For the construction of the SVG image we are only interested in the\n // root group, so we expose it as the entry point of the SVG image for\n // the other code in this class.\n this.svg = rootGroup;\n\n return svg;\n }\n\n /**\n * @private\n */\n _ensureClipGroup() {\n if (!this.current.clipGroup) {\n const clipGroup = this.svgFactory.createElement(\"svg:g\");\n clipGroup.setAttributeNS(null, \"clip-path\", this.current.activeClipUrl);\n this.svg.append(clipGroup);\n this.current.clipGroup = clipGroup;\n }\n return this.current.clipGroup;\n }\n\n /**\n * @private\n */\n _ensureTransformGroup() {\n if (!this.tgrp) {\n this.tgrp = this.svgFactory.createElement(\"svg:g\");\n this.tgrp.setAttributeNS(null, \"transform\", pm(this.transformMatrix));\n if (this.current.activeClipUrl) {\n this._ensureClipGroup().append(this.tgrp);\n } else {\n this.svg.append(this.tgrp);\n }\n }\n return this.tgrp;\n }\n}\n\nexport { SVGGraphics };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./api\").TextContent} TextContent */\n\nclass XfaText {\n /**\n * Walk an XFA tree and create an array of text nodes that is compatible\n * with a regular PDFs TextContent. Currently, only TextItem.str is supported,\n * all other fields and styles haven't been implemented.\n *\n * @param {Object} xfa - An XFA fake DOM object.\n *\n * @returns {TextContent}\n */\n static textContent(xfa) {\n const items = [];\n const output = {\n items,\n styles: Object.create(null),\n };\n function walk(node) {\n if (!node) {\n return;\n }\n let str = null;\n const name = node.name;\n if (name === \"#text\") {\n str = node.value;\n } else if (!XfaText.shouldBuildText(name)) {\n return;\n } else if (node?.attributes?.textContent) {\n str = node.attributes.textContent;\n } else if (node.value) {\n str = node.value;\n }\n if (str !== null) {\n items.push({\n str,\n });\n }\n if (!node.children) {\n return;\n }\n for (const child of node.children) {\n walk(child);\n }\n }\n walk(xfa);\n return output;\n }\n\n /**\n * @param {string} name - DOM node name. (lower case)\n *\n * @returns {boolean} true if the DOM node should have a corresponding text\n * node.\n */\n static shouldBuildText(name) {\n return !(\n name === \"textarea\" ||\n name === \"input\" ||\n name === \"option\" ||\n name === \"select\"\n );\n }\n}\n\nexport { XfaText };\n","/* Copyright 2015 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"./api\").TextContent} TextContent */\n\nimport {\n AbortException,\n FeatureTest,\n PromiseCapability,\n Util,\n} from \"../shared/util.js\";\nimport { deprecated, setLayerDimensions } from \"./display_utils.js\";\n\n/**\n * Text layer render parameters.\n *\n * @typedef {Object} TextLayerRenderParameters\n * @property {ReadableStream | TextContent} textContentSource - Text content to\n * render, i.e. the value returned by the page's `streamTextContent` or\n * `getTextContent` method.\n * @property {HTMLElement} container - The DOM node that will contain the text\n * runs.\n * @property {PageViewport} viewport - The target viewport to properly layout\n * the text runs.\n * @property {Array<HTMLElement>} [textDivs] - HTML elements that correspond to\n * the text items of the textContent input.\n * This is output and shall initially be set to an empty array.\n * @property {WeakMap<HTMLElement,Object>} [textDivProperties] - Some properties\n * weakly mapped to the HTML elements used to render the text.\n * @property {Array<string>} [textContentItemsStr] - Strings that correspond to\n * the `str` property of the text items of the textContent input.\n * This is output and shall initially be set to an empty array.\n * @property {boolean} [isOffscreenCanvasSupported] true if we can use\n * OffscreenCanvas to measure string widths.\n */\n\n/**\n * Text layer update parameters.\n *\n * @typedef {Object} TextLayerUpdateParameters\n * @property {HTMLElement} container - The DOM node that will contain the text\n * runs.\n * @property {PageViewport} viewport - The target viewport to properly layout\n * the text runs.\n * @property {Array<HTMLElement>} [textDivs] - HTML elements that correspond to\n * the text items of the textContent input.\n * This is output and shall initially be set to an empty array.\n * @property {WeakMap<HTMLElement,Object>} [textDivProperties] - Some properties\n * weakly mapped to the HTML elements used to render the text.\n * @property {boolean} [isOffscreenCanvasSupported] true if we can use\n * OffscreenCanvas to measure string widths.\n * @property {boolean} [mustRotate] true if the text layer must be rotated.\n * @property {boolean} [mustRescale] true if the text layer contents must be\n * rescaled.\n */\n\nconst MAX_TEXT_DIVS_TO_RENDER = 100000;\nconst DEFAULT_FONT_SIZE = 30;\nconst DEFAULT_FONT_ASCENT = 0.8;\nconst ascentCache = new Map();\n\nfunction getCtx(size, isOffscreenCanvasSupported) {\n let ctx;\n if (isOffscreenCanvasSupported && FeatureTest.isOffscreenCanvasSupported) {\n ctx = new OffscreenCanvas(size, size).getContext(\"2d\", { alpha: false });\n } else {\n const canvas = document.createElement(\"canvas\");\n canvas.width = canvas.height = size;\n ctx = canvas.getContext(\"2d\", { alpha: false });\n }\n\n return ctx;\n}\n\nfunction getAscent(fontFamily, isOffscreenCanvasSupported) {\n const cachedAscent = ascentCache.get(fontFamily);\n if (cachedAscent) {\n return cachedAscent;\n }\n\n const ctx = getCtx(DEFAULT_FONT_SIZE, isOffscreenCanvasSupported);\n\n ctx.font = `${DEFAULT_FONT_SIZE}px ${fontFamily}`;\n const metrics = ctx.measureText(\"\");\n\n // Both properties aren't available by default in Firefox.\n let ascent = metrics.fontBoundingBoxAscent;\n let descent = Math.abs(metrics.fontBoundingBoxDescent);\n if (ascent) {\n const ratio = ascent / (ascent + descent);\n ascentCache.set(fontFamily, ratio);\n\n ctx.canvas.width = ctx.canvas.height = 0;\n return ratio;\n }\n\n // Try basic heuristic to guess ascent/descent.\n // Draw a g with baseline at 0,0 and then get the line\n // number where a pixel has non-null red component (starting\n // from bottom).\n ctx.strokeStyle = \"red\";\n ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);\n ctx.strokeText(\"g\", 0, 0);\n let pixels = ctx.getImageData(\n 0,\n 0,\n DEFAULT_FONT_SIZE,\n DEFAULT_FONT_SIZE\n ).data;\n descent = 0;\n for (let i = pixels.length - 1 - 3; i >= 0; i -= 4) {\n if (pixels[i] > 0) {\n descent = Math.ceil(i / 4 / DEFAULT_FONT_SIZE);\n break;\n }\n }\n\n // Draw an A with baseline at 0,DEFAULT_FONT_SIZE and then get the line\n // number where a pixel has non-null red component (starting\n // from top).\n ctx.clearRect(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE);\n ctx.strokeText(\"A\", 0, DEFAULT_FONT_SIZE);\n pixels = ctx.getImageData(0, 0, DEFAULT_FONT_SIZE, DEFAULT_FONT_SIZE).data;\n ascent = 0;\n for (let i = 0, ii = pixels.length; i < ii; i += 4) {\n if (pixels[i] > 0) {\n ascent = DEFAULT_FONT_SIZE - Math.floor(i / 4 / DEFAULT_FONT_SIZE);\n break;\n }\n }\n\n ctx.canvas.width = ctx.canvas.height = 0;\n\n if (ascent) {\n const ratio = ascent / (ascent + descent);\n ascentCache.set(fontFamily, ratio);\n return ratio;\n }\n\n ascentCache.set(fontFamily, DEFAULT_FONT_ASCENT);\n return DEFAULT_FONT_ASCENT;\n}\n\nfunction appendText(task, geom, styles) {\n // Initialize all used properties to keep the caches monomorphic.\n const textDiv = document.createElement(\"span\");\n const textDivProperties = {\n angle: 0,\n canvasWidth: 0,\n hasText: geom.str !== \"\",\n hasEOL: geom.hasEOL,\n fontSize: 0,\n };\n task._textDivs.push(textDiv);\n\n const tx = Util.transform(task._transform, geom.transform);\n let angle = Math.atan2(tx[1], tx[0]);\n const style = styles[geom.fontName];\n if (style.vertical) {\n angle += Math.PI / 2;\n }\n const fontHeight = Math.hypot(tx[2], tx[3]);\n const fontAscent =\n fontHeight * getAscent(style.fontFamily, task._isOffscreenCanvasSupported);\n\n let left, top;\n if (angle === 0) {\n left = tx[4];\n top = tx[5] - fontAscent;\n } else {\n left = tx[4] + fontAscent * Math.sin(angle);\n top = tx[5] - fontAscent * Math.cos(angle);\n }\n\n const scaleFactorStr = \"calc(var(--scale-factor)*\";\n const divStyle = textDiv.style;\n // Setting the style properties individually, rather than all at once,\n // should be OK since the `textDiv` isn't appended to the document yet.\n if (task._container === task._rootContainer) {\n divStyle.left = `${((100 * left) / task._pageWidth).toFixed(2)}%`;\n divStyle.top = `${((100 * top) / task._pageHeight).toFixed(2)}%`;\n } else {\n // We're in a marked content span, hence we can't use percents.\n divStyle.left = `${scaleFactorStr}${left.toFixed(2)}px)`;\n divStyle.top = `${scaleFactorStr}${top.toFixed(2)}px)`;\n }\n divStyle.fontSize = `${scaleFactorStr}${fontHeight.toFixed(2)}px)`;\n divStyle.fontFamily = style.fontFamily;\n\n textDivProperties.fontSize = fontHeight;\n\n // Keeps screen readers from pausing on every new text span.\n textDiv.setAttribute(\"role\", \"presentation\");\n\n textDiv.textContent = geom.str;\n // geom.dir may be 'ttb' for vertical texts.\n textDiv.dir = geom.dir;\n\n // `fontName` is only used by the FontInspector, and we only use `dataset`\n // here to make the font name available in the debugger.\n if (task._fontInspectorEnabled) {\n textDiv.dataset.fontName = geom.fontName;\n }\n if (angle !== 0) {\n textDivProperties.angle = angle * (180 / Math.PI);\n }\n // We don't bother scaling single-char text divs, because it has very\n // little effect on text highlighting. This makes scrolling on docs with\n // lots of such divs a lot faster.\n let shouldScaleText = false;\n if (geom.str.length > 1) {\n shouldScaleText = true;\n } else if (geom.str !== \" \" && geom.transform[0] !== geom.transform[3]) {\n const absScaleX = Math.abs(geom.transform[0]),\n absScaleY = Math.abs(geom.transform[3]);\n // When the horizontal/vertical scaling differs significantly, also scale\n // even single-char text to improve highlighting (fixes issue11713.pdf).\n if (\n absScaleX !== absScaleY &&\n Math.max(absScaleX, absScaleY) / Math.min(absScaleX, absScaleY) > 1.5\n ) {\n shouldScaleText = true;\n }\n }\n if (shouldScaleText) {\n textDivProperties.canvasWidth = style.vertical ? geom.height : geom.width;\n }\n task._textDivProperties.set(textDiv, textDivProperties);\n if (task._isReadableStream) {\n task._layoutText(textDiv);\n }\n}\n\nfunction layout(params) {\n const { div, scale, properties, ctx, prevFontSize, prevFontFamily } = params;\n const { style } = div;\n let transform = \"\";\n if (properties.canvasWidth !== 0 && properties.hasText) {\n const { fontFamily } = style;\n const { canvasWidth, fontSize } = properties;\n\n if (prevFontSize !== fontSize || prevFontFamily !== fontFamily) {\n ctx.font = `${fontSize * scale}px ${fontFamily}`;\n params.prevFontSize = fontSize;\n params.prevFontFamily = fontFamily;\n }\n\n // Only measure the width for multi-char text divs, see `appendText`.\n const { width } = ctx.measureText(div.textContent);\n\n if (width > 0) {\n transform = `scaleX(${(canvasWidth * scale) / width})`;\n }\n }\n if (properties.angle !== 0) {\n transform = `rotate(${properties.angle}deg) ${transform}`;\n }\n if (transform.length > 0) {\n style.transform = transform;\n }\n}\n\nfunction render(task) {\n if (task._canceled) {\n return;\n }\n const textDivs = task._textDivs;\n const capability = task._capability;\n const textDivsLength = textDivs.length;\n\n // No point in rendering many divs as it would make the browser\n // unusable even after the divs are rendered.\n if (textDivsLength > MAX_TEXT_DIVS_TO_RENDER) {\n capability.resolve();\n return;\n }\n\n if (!task._isReadableStream) {\n for (const textDiv of textDivs) {\n task._layoutText(textDiv);\n }\n }\n capability.resolve();\n}\n\nclass TextLayerRenderTask {\n constructor({\n textContentSource,\n container,\n viewport,\n textDivs,\n textDivProperties,\n textContentItemsStr,\n isOffscreenCanvasSupported,\n }) {\n this._textContentSource = textContentSource;\n this._isReadableStream = textContentSource instanceof ReadableStream;\n this._container = this._rootContainer = container;\n this._textDivs = textDivs || [];\n this._textContentItemsStr = textContentItemsStr || [];\n this._isOffscreenCanvasSupported = isOffscreenCanvasSupported;\n this._fontInspectorEnabled = !!globalThis.FontInspector?.enabled;\n\n this._reader = null;\n this._textDivProperties = textDivProperties || new WeakMap();\n this._canceled = false;\n this._capability = new PromiseCapability();\n this._layoutTextParams = {\n prevFontSize: null,\n prevFontFamily: null,\n div: null,\n scale: viewport.scale * (globalThis.devicePixelRatio || 1),\n properties: null,\n ctx: getCtx(0, isOffscreenCanvasSupported),\n };\n const { pageWidth, pageHeight, pageX, pageY } = viewport.rawDims;\n this._transform = [1, 0, 0, -1, -pageX, pageY + pageHeight];\n this._pageWidth = pageWidth;\n this._pageHeight = pageHeight;\n\n setLayerDimensions(container, viewport);\n\n // Always clean-up the temporary canvas once rendering is no longer pending.\n this._capability.promise\n .finally(() => {\n this._layoutTextParams = null;\n })\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n }\n\n /**\n * Promise for textLayer rendering task completion.\n * @type {Promise<void>}\n */\n get promise() {\n return this._capability.promise;\n }\n\n /**\n * Cancel rendering of the textLayer.\n */\n cancel() {\n this._canceled = true;\n if (this._reader) {\n this._reader\n .cancel(new AbortException(\"TextLayer task cancelled.\"))\n .catch(() => {\n // Avoid \"Uncaught promise\" messages in the console.\n });\n this._reader = null;\n }\n this._capability.reject(new AbortException(\"TextLayer task cancelled.\"));\n }\n\n /**\n * @private\n */\n _processItems(items, styleCache) {\n for (const item of items) {\n if (item.str === undefined) {\n if (\n item.type === \"beginMarkedContentProps\" ||\n item.type === \"beginMarkedContent\"\n ) {\n const parent = this._container;\n this._container = document.createElement(\"span\");\n this._container.classList.add(\"markedContent\");\n if (item.id !== null) {\n this._container.setAttribute(\"id\", `${item.id}`);\n }\n parent.append(this._container);\n } else if (item.type === \"endMarkedContent\") {\n this._container = this._container.parentNode;\n }\n continue;\n }\n this._textContentItemsStr.push(item.str);\n appendText(this, item, styleCache);\n }\n }\n\n /**\n * @private\n */\n _layoutText(textDiv) {\n const textDivProperties = (this._layoutTextParams.properties =\n this._textDivProperties.get(textDiv));\n this._layoutTextParams.div = textDiv;\n layout(this._layoutTextParams);\n\n if (textDivProperties.hasText) {\n this._container.append(textDiv);\n }\n if (textDivProperties.hasEOL) {\n const br = document.createElement(\"br\");\n br.setAttribute(\"role\", \"presentation\");\n this._container.append(br);\n }\n }\n\n /**\n * @private\n */\n _render() {\n const capability = new PromiseCapability();\n let styleCache = Object.create(null);\n\n if (this._isReadableStream) {\n const pump = () => {\n this._reader.read().then(({ value, done }) => {\n if (done) {\n capability.resolve();\n return;\n }\n\n Object.assign(styleCache, value.styles);\n this._processItems(value.items, styleCache);\n pump();\n }, capability.reject);\n };\n\n this._reader = this._textContentSource.getReader();\n pump();\n } else if (this._textContentSource) {\n const { items, styles } = this._textContentSource;\n this._processItems(items, styles);\n capability.resolve();\n } else {\n throw new Error('No \"textContentSource\" parameter specified.');\n }\n\n capability.promise.then(() => {\n styleCache = null;\n render(this);\n }, this._capability.reject);\n }\n}\n\n/**\n * @param {TextLayerRenderParameters} params\n * @returns {TextLayerRenderTask}\n */\nfunction renderTextLayer(params) {\n if (\n (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"GENERIC\")) &&\n !params.textContentSource &&\n (params.textContent || params.textContentStream)\n ) {\n deprecated(\n \"The TextLayerRender `textContent`/`textContentStream` parameters \" +\n \"will be removed in the future, please use `textContentSource` instead.\"\n );\n params.textContentSource = params.textContent || params.textContentStream;\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"GENERIC && !TESTING\")) {\n const { container, viewport } = params;\n const style = getComputedStyle(container);\n const visibility = style.getPropertyValue(\"visibility\");\n const scaleFactor = parseFloat(style.getPropertyValue(\"--scale-factor\"));\n\n if (\n visibility === \"visible\" &&\n (!scaleFactor || Math.abs(scaleFactor - viewport.scale) > 1e-5)\n ) {\n console.error(\n \"The `--scale-factor` CSS-variable must be set, \" +\n \"to the same value as `viewport.scale`, \" +\n \"either on the `container`-element itself or higher up in the DOM.\"\n );\n }\n }\n const task = new TextLayerRenderTask(params);\n task._render();\n return task;\n}\n\n/**\n * @param {TextLayerUpdateParameters} params\n * @returns {undefined}\n */\nfunction updateTextLayer({\n container,\n viewport,\n textDivs,\n textDivProperties,\n isOffscreenCanvasSupported,\n mustRotate = true,\n mustRescale = true,\n}) {\n if (mustRotate) {\n setLayerDimensions(container, { rotation: viewport.rotation });\n }\n\n if (mustRescale) {\n const ctx = getCtx(0, isOffscreenCanvasSupported);\n const scale = viewport.scale * (globalThis.devicePixelRatio || 1);\n const params = {\n prevFontSize: null,\n prevFontFamily: null,\n div: null,\n scale,\n properties: null,\n ctx,\n };\n for (const div of textDivs) {\n params.properties = textDivProperties.get(div);\n params.div = div;\n layout(params);\n }\n }\n}\n\nexport { renderTextLayer, TextLayerRenderTask, updateTextLayer };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./tools.js\").AnnotationEditorUIManager} AnnotationEditorUIManager */\n/** @typedef {import(\"../display_utils.js\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../../../web/text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n/** @typedef {import(\"../../../web/interfaces\").IL10n} IL10n */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../annotation_layer.js\").AnnotationLayer} AnnotationLayer */\n\nimport { AnnotationEditorType, FeatureTest } from \"../../shared/util.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { FreeTextEditor } from \"./freetext.js\";\nimport { InkEditor } from \"./ink.js\";\nimport { setLayerDimensions } from \"../display_utils.js\";\nimport { StampEditor } from \"./stamp.js\";\n\n/**\n * @typedef {Object} AnnotationEditorLayerOptions\n * @property {Object} mode\n * @property {HTMLDivElement} div\n * @property {AnnotationEditorUIManager} uiManager\n * @property {boolean} enabled\n * @property {TextAccessibilityManager} [accessibilityManager]\n * @property {number} pageIndex\n * @property {IL10n} l10n\n * @property {AnnotationLayer} [annotationLayer]\n * @property {PageViewport} viewport\n */\n\n/**\n * @typedef {Object} RenderEditorLayerOptions\n * @property {PageViewport} viewport\n */\n\n/**\n * Manage all the different editors on a page.\n */\nclass AnnotationEditorLayer {\n #accessibilityManager;\n\n #allowClick = false;\n\n #annotationLayer = null;\n\n #boundPointerup = this.pointerup.bind(this);\n\n #boundPointerdown = this.pointerdown.bind(this);\n\n #editors = new Map();\n\n #hadPointerDown = false;\n\n #isCleaningUp = false;\n\n #isDisabling = false;\n\n #uiManager;\n\n static _initialized = false;\n\n /**\n * @param {AnnotationEditorLayerOptions} options\n */\n constructor({\n uiManager,\n pageIndex,\n div,\n accessibilityManager,\n annotationLayer,\n viewport,\n l10n,\n }) {\n const editorTypes = [FreeTextEditor, InkEditor, StampEditor];\n if (!AnnotationEditorLayer._initialized) {\n AnnotationEditorLayer._initialized = true;\n for (const editorType of editorTypes) {\n editorType.initialize(l10n);\n }\n }\n uiManager.registerEditorTypes(editorTypes);\n\n this.#uiManager = uiManager;\n this.pageIndex = pageIndex;\n this.div = div;\n this.#accessibilityManager = accessibilityManager;\n this.#annotationLayer = annotationLayer;\n this.viewport = viewport;\n\n this.#uiManager.addLayer(this);\n }\n\n get isEmpty() {\n return this.#editors.size === 0;\n }\n\n /**\n * Update the toolbar if it's required to reflect the tool currently used.\n * @param {number} mode\n */\n updateToolbar(mode) {\n this.#uiManager.updateToolbar(mode);\n }\n\n /**\n * The mode has changed: it must be updated.\n * @param {number} mode\n */\n updateMode(mode = this.#uiManager.getMode()) {\n this.#cleanup();\n if (mode === AnnotationEditorType.INK) {\n // We always want to an ink editor ready to draw in.\n this.addInkEditorIfNeeded(false);\n this.disableClick();\n } else {\n this.enableClick();\n }\n\n if (mode !== AnnotationEditorType.NONE) {\n this.div.classList.toggle(\n \"freeTextEditing\",\n mode === AnnotationEditorType.FREETEXT\n );\n this.div.classList.toggle(\n \"inkEditing\",\n mode === AnnotationEditorType.INK\n );\n this.div.classList.toggle(\n \"stampEditing\",\n mode === AnnotationEditorType.STAMP\n );\n this.div.hidden = false;\n }\n }\n\n addInkEditorIfNeeded(isCommitting) {\n if (\n !isCommitting &&\n this.#uiManager.getMode() !== AnnotationEditorType.INK\n ) {\n return;\n }\n\n if (!isCommitting) {\n // We're removing an editor but an empty one can already exist so in this\n // case we don't need to create a new one.\n for (const editor of this.#editors.values()) {\n if (editor.isEmpty()) {\n editor.setInBackground();\n return;\n }\n }\n }\n\n const editor = this.#createAndAddNewEditor(\n { offsetX: 0, offsetY: 0 },\n /* isCentered = */ false\n );\n editor.setInBackground();\n }\n\n /**\n * Set the editing state.\n * @param {boolean} isEditing\n */\n setEditingState(isEditing) {\n this.#uiManager.setEditingState(isEditing);\n }\n\n /**\n * Add some commands into the CommandManager (undo/redo stuff).\n * @param {Object} params\n */\n addCommands(params) {\n this.#uiManager.addCommands(params);\n }\n\n /**\n * Enable pointer events on the main div in order to enable\n * editor creation.\n */\n enable() {\n this.div.style.pointerEvents = \"auto\";\n const annotationElementIds = new Set();\n for (const editor of this.#editors.values()) {\n editor.enableEditing();\n if (editor.annotationElementId) {\n annotationElementIds.add(editor.annotationElementId);\n }\n }\n\n if (!this.#annotationLayer) {\n return;\n }\n\n const editables = this.#annotationLayer.getEditableAnnotations();\n for (const editable of editables) {\n // The element must be hidden whatever its state is.\n editable.hide();\n if (this.#uiManager.isDeletedAnnotationElement(editable.data.id)) {\n continue;\n }\n if (annotationElementIds.has(editable.data.id)) {\n continue;\n }\n const editor = this.deserialize(editable);\n if (!editor) {\n continue;\n }\n this.addOrRebuild(editor);\n editor.enableEditing();\n }\n }\n\n /**\n * Disable editor creation.\n */\n disable() {\n this.#isDisabling = true;\n this.div.style.pointerEvents = \"none\";\n const hiddenAnnotationIds = new Set();\n for (const editor of this.#editors.values()) {\n editor.disableEditing();\n if (!editor.annotationElementId || editor.serialize() !== null) {\n hiddenAnnotationIds.add(editor.annotationElementId);\n continue;\n }\n this.getEditableAnnotation(editor.annotationElementId)?.show();\n editor.remove();\n }\n\n if (this.#annotationLayer) {\n // Show the annotations that were hidden in enable().\n const editables = this.#annotationLayer.getEditableAnnotations();\n for (const editable of editables) {\n const { id } = editable.data;\n if (\n hiddenAnnotationIds.has(id) ||\n this.#uiManager.isDeletedAnnotationElement(id)\n ) {\n continue;\n }\n editable.show();\n }\n }\n\n this.#cleanup();\n if (this.isEmpty) {\n this.div.hidden = true;\n }\n this.#isDisabling = false;\n }\n\n getEditableAnnotation(id) {\n return this.#annotationLayer?.getEditableAnnotation(id) || null;\n }\n\n /**\n * Set the current editor.\n * @param {AnnotationEditor} editor\n */\n setActiveEditor(editor) {\n const currentActive = this.#uiManager.getActive();\n if (currentActive === editor) {\n return;\n }\n\n this.#uiManager.setActiveEditor(editor);\n }\n\n enableClick() {\n this.div.addEventListener(\"pointerdown\", this.#boundPointerdown);\n this.div.addEventListener(\"pointerup\", this.#boundPointerup);\n }\n\n disableClick() {\n this.div.removeEventListener(\"pointerdown\", this.#boundPointerdown);\n this.div.removeEventListener(\"pointerup\", this.#boundPointerup);\n }\n\n attach(editor) {\n this.#editors.set(editor.id, editor);\n const { annotationElementId } = editor;\n if (\n annotationElementId &&\n this.#uiManager.isDeletedAnnotationElement(annotationElementId)\n ) {\n this.#uiManager.removeDeletedAnnotationElement(editor);\n }\n }\n\n detach(editor) {\n this.#editors.delete(editor.id);\n this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv);\n\n if (!this.#isDisabling && editor.annotationElementId) {\n this.#uiManager.addDeletedAnnotationElement(editor);\n }\n }\n\n /**\n * Remove an editor.\n * @param {AnnotationEditor} editor\n */\n remove(editor) {\n // Since we can undo a removal we need to keep the\n // parent property as it is, so don't null it!\n\n this.detach(editor);\n this.#uiManager.removeEditor(editor);\n if (editor.div.contains(document.activeElement)) {\n setTimeout(() => {\n // When the div is removed from DOM the focus can move on the\n // document.body, so we need to move it back to the main container.\n this.#uiManager.focusMainContainer();\n }, 0);\n }\n editor.div.remove();\n editor.isAttachedToDOM = false;\n\n if (!this.#isCleaningUp) {\n this.addInkEditorIfNeeded(/* isCommitting = */ false);\n }\n }\n\n /**\n * An editor can have a different parent, for example after having\n * being dragged and droped from a page to another.\n * @param {AnnotationEditor} editor\n */\n changeParent(editor) {\n if (editor.parent === this) {\n return;\n }\n\n if (editor.annotationElementId) {\n this.#uiManager.addDeletedAnnotationElement(editor.annotationElementId);\n AnnotationEditor.deleteAnnotationElement(editor);\n editor.annotationElementId = null;\n }\n\n this.attach(editor);\n editor.parent?.detach(editor);\n editor.setParent(this);\n if (editor.div && editor.isAttachedToDOM) {\n editor.div.remove();\n this.div.append(editor.div);\n }\n }\n\n /**\n * Add a new editor in the current view.\n * @param {AnnotationEditor} editor\n */\n add(editor) {\n this.changeParent(editor);\n this.#uiManager.addEditor(editor);\n this.attach(editor);\n\n if (!editor.isAttachedToDOM) {\n const div = editor.render();\n this.div.append(div);\n editor.isAttachedToDOM = true;\n }\n\n // The editor will be correctly moved into the DOM (see fixAndSetPosition).\n editor.fixAndSetPosition();\n editor.onceAdded();\n this.#uiManager.addToAnnotationStorage(editor);\n }\n\n moveEditorInDOM(editor) {\n if (!editor.isAttachedToDOM) {\n return;\n }\n\n const { activeElement } = document;\n if (editor.div.contains(activeElement)) {\n // When the div is moved in the DOM the focus can move somewhere else,\n // so we want to be sure that the focus will stay on the editor but we\n // don't want to call any focus callbacks, hence we disable them and only\n // re-enable them when the editor has the focus.\n editor._focusEventsAllowed = false;\n setTimeout(() => {\n if (!editor.div.contains(document.activeElement)) {\n editor.div.addEventListener(\n \"focusin\",\n () => {\n editor._focusEventsAllowed = true;\n },\n { once: true }\n );\n activeElement.focus();\n } else {\n editor._focusEventsAllowed = true;\n }\n }, 0);\n }\n\n editor._structTreeParentId = this.#accessibilityManager?.moveElementInDOM(\n this.div,\n editor.div,\n editor.contentDiv,\n /* isRemovable = */ true\n );\n }\n\n /**\n * Add or rebuild depending if it has been removed or not.\n * @param {AnnotationEditor} editor\n */\n addOrRebuild(editor) {\n if (editor.needsToBeRebuilt()) {\n editor.rebuild();\n } else {\n this.add(editor);\n }\n }\n\n /**\n * Add a new editor and make this addition undoable.\n * @param {AnnotationEditor} editor\n */\n addUndoableEditor(editor) {\n const cmd = () => editor._uiManager.rebuild(editor);\n const undo = () => {\n editor.remove();\n };\n\n this.addCommands({ cmd, undo, mustExec: false });\n }\n\n /**\n * Get an id for an editor.\n * @returns {string}\n */\n getNextId() {\n return this.#uiManager.getId();\n }\n\n /**\n * Create a new editor\n * @param {Object} params\n * @returns {AnnotationEditor}\n */\n #createNewEditor(params) {\n switch (this.#uiManager.getMode()) {\n case AnnotationEditorType.FREETEXT:\n return new FreeTextEditor(params);\n case AnnotationEditorType.INK:\n return new InkEditor(params);\n case AnnotationEditorType.STAMP:\n return new StampEditor(params);\n }\n return null;\n }\n\n /**\n * Paste some content into a new editor.\n * @param {number} mode\n * @param {Object} params\n */\n pasteEditor(mode, params) {\n this.#uiManager.updateToolbar(mode);\n this.#uiManager.updateMode(mode);\n\n const { offsetX, offsetY } = this.#getCenterPoint();\n const id = this.getNextId();\n const editor = this.#createNewEditor({\n parent: this,\n id,\n x: offsetX,\n y: offsetY,\n uiManager: this.#uiManager,\n isCentered: true,\n ...params,\n });\n if (editor) {\n this.add(editor);\n }\n }\n\n /**\n * Create a new editor\n * @param {Object} data\n * @returns {AnnotationEditor}\n */\n deserialize(data) {\n switch (data.annotationType ?? data.annotationEditorType) {\n case AnnotationEditorType.FREETEXT:\n return FreeTextEditor.deserialize(data, this, this.#uiManager);\n case AnnotationEditorType.INK:\n return InkEditor.deserialize(data, this, this.#uiManager);\n case AnnotationEditorType.STAMP:\n return StampEditor.deserialize(data, this, this.#uiManager);\n }\n return null;\n }\n\n /**\n * Create and add a new editor.\n * @param {PointerEvent} event\n * @param {boolean} isCentered\n * @returns {AnnotationEditor}\n */\n #createAndAddNewEditor(event, isCentered) {\n const id = this.getNextId();\n const editor = this.#createNewEditor({\n parent: this,\n id,\n x: event.offsetX,\n y: event.offsetY,\n uiManager: this.#uiManager,\n isCentered,\n });\n if (editor) {\n this.add(editor);\n }\n\n return editor;\n }\n\n #getCenterPoint() {\n const { x, y, width, height } = this.div.getBoundingClientRect();\n const tlX = Math.max(0, x);\n const tlY = Math.max(0, y);\n const brX = Math.min(window.innerWidth, x + width);\n const brY = Math.min(window.innerHeight, y + height);\n const centerX = (tlX + brX) / 2 - x;\n const centerY = (tlY + brY) / 2 - y;\n const [offsetX, offsetY] =\n this.viewport.rotation % 180 === 0\n ? [centerX, centerY]\n : [centerY, centerX];\n\n return { offsetX, offsetY };\n }\n\n /**\n * Create and add a new editor.\n */\n addNewEditor() {\n this.#createAndAddNewEditor(\n this.#getCenterPoint(),\n /* isCentered = */ true\n );\n }\n\n /**\n * Set the last selected editor.\n * @param {AnnotationEditor} editor\n */\n setSelected(editor) {\n this.#uiManager.setSelected(editor);\n }\n\n /**\n * Add or remove an editor the current selection.\n * @param {AnnotationEditor} editor\n */\n toggleSelected(editor) {\n this.#uiManager.toggleSelected(editor);\n }\n\n /**\n * Check if the editor is selected.\n * @param {AnnotationEditor} editor\n */\n isSelected(editor) {\n return this.#uiManager.isSelected(editor);\n }\n\n /**\n * Unselect an editor.\n * @param {AnnotationEditor} editor\n */\n unselect(editor) {\n this.#uiManager.unselect(editor);\n }\n\n /**\n * Pointerup callback.\n * @param {PointerEvent} event\n */\n pointerup(event) {\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n // Don't create an editor on right click.\n return;\n }\n\n if (event.target !== this.div) {\n return;\n }\n\n if (!this.#hadPointerDown) {\n // It can happen when the user starts a drag inside a text editor\n // and then releases the mouse button outside of it. In such a case\n // we don't want to create a new editor, hence we check that a pointerdown\n // occurred on this div previously.\n return;\n }\n this.#hadPointerDown = false;\n\n if (!this.#allowClick) {\n this.#allowClick = true;\n return;\n }\n\n if (this.#uiManager.getMode() === AnnotationEditorType.STAMP) {\n this.#uiManager.unselectAll();\n return;\n }\n\n this.#createAndAddNewEditor(event, /* isCentered = */ false);\n }\n\n /**\n * Pointerdown callback.\n * @param {PointerEvent} event\n */\n pointerdown(event) {\n if (this.#hadPointerDown) {\n // It's possible to have a second pointerdown event before a pointerup one\n // when the user puts a finger on a touchscreen and then add a second one\n // to start a pinch-to-zoom gesture.\n // That said, in case it's possible to have two pointerdown events with\n // a mouse, we don't want to create a new editor in such a case either.\n this.#hadPointerDown = false;\n return;\n }\n const { isMac } = FeatureTest.platform;\n if (event.button !== 0 || (event.ctrlKey && isMac)) {\n // Do nothing on right click.\n return;\n }\n\n if (event.target !== this.div) {\n return;\n }\n\n this.#hadPointerDown = true;\n\n const editor = this.#uiManager.getActive();\n this.#allowClick = !editor || editor.isEmpty();\n }\n\n /**\n *\n * @param {AnnotationEditor} editor\n * @param {number} x\n * @param {number} y\n * @returns\n */\n findNewParent(editor, x, y) {\n const layer = this.#uiManager.findParent(x, y);\n if (layer === null || layer === this) {\n return false;\n }\n layer.changeParent(editor);\n return true;\n }\n\n /**\n * Destroy the main editor.\n */\n destroy() {\n if (this.#uiManager.getActive()?.parent === this) {\n // We need to commit the current editor before destroying the layer.\n this.#uiManager.commitOrRemove();\n this.#uiManager.setActiveEditor(null);\n }\n\n for (const editor of this.#editors.values()) {\n this.#accessibilityManager?.removePointerInTextLayer(editor.contentDiv);\n editor.setParent(null);\n editor.isAttachedToDOM = false;\n editor.div.remove();\n }\n this.div = null;\n this.#editors.clear();\n this.#uiManager.removeLayer(this);\n }\n\n #cleanup() {\n // When we're cleaning up, some editors are removed but we don't want\n // to add a new one which will induce an addition in this.#editors, hence\n // an infinite loop.\n this.#isCleaningUp = true;\n for (const editor of this.#editors.values()) {\n if (editor.isEmpty()) {\n editor.remove();\n }\n }\n this.#isCleaningUp = false;\n }\n\n /**\n * Render the main editor.\n * @param {RenderEditorLayerOptions} parameters\n */\n render({ viewport }) {\n this.viewport = viewport;\n setLayerDimensions(this.div, viewport);\n for (const editor of this.#uiManager.getEditors(this.pageIndex)) {\n this.add(editor);\n }\n this.updateMode();\n }\n\n /**\n * Update the main editor.\n * @param {RenderEditorLayerOptions} parameters\n */\n update({ viewport }) {\n // Editors have their dimensions/positions in percent so to avoid any\n // issues (see #15582), we must commit the current one before changing\n // the viewport.\n this.#uiManager.commitOrRemove();\n\n this.viewport = viewport;\n setLayerDimensions(this.div, { rotation: viewport.rotation });\n this.updateMode();\n }\n\n /**\n * Get page dimensions.\n * @returns {Object} dimensions.\n */\n get pageDimensions() {\n const { pageWidth, pageHeight } = this.viewport.rawDims;\n return [pageWidth, pageHeight];\n }\n}\n\nexport { AnnotationEditorLayer };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_editor_layer.js\").AnnotationEditorLayer} AnnotationEditorLayer */\n\nimport {\n AnnotationEditorParamsType,\n AnnotationEditorType,\n assert,\n LINE_FACTOR,\n shadow,\n Util,\n} from \"../../shared/util.js\";\nimport {\n AnnotationEditorUIManager,\n bindEvents,\n KeyboardManager,\n} from \"./tools.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { FreeTextAnnotationElement } from \"../annotation_layer.js\";\n\n/**\n * Basic text editor in order to create a FreeTex annotation.\n */\nclass FreeTextEditor extends AnnotationEditor {\n #boundEditorDivBlur = this.editorDivBlur.bind(this);\n\n #boundEditorDivFocus = this.editorDivFocus.bind(this);\n\n #boundEditorDivInput = this.editorDivInput.bind(this);\n\n #boundEditorDivKeydown = this.editorDivKeydown.bind(this);\n\n #color;\n\n #content = \"\";\n\n #editorDivId = `${this.id}-editor`;\n\n #fontSize;\n\n #initialData = null;\n\n static _freeTextDefaultContent = \"\";\n\n static _internalPadding = 0;\n\n static _defaultColor = null;\n\n static _defaultFontSize = 10;\n\n static get _keyboardManager() {\n const proto = FreeTextEditor.prototype;\n\n const arrowChecker = self => self.isEmpty();\n\n const small = AnnotationEditorUIManager.TRANSLATE_SMALL;\n const big = AnnotationEditorUIManager.TRANSLATE_BIG;\n\n return shadow(\n this,\n \"_keyboardManager\",\n new KeyboardManager([\n [\n // Commit the text in case the user use ctrl+s to save the document.\n // The event must bubble in order to be caught by the viewer.\n // See bug 1831574.\n [\"ctrl+s\", \"mac+meta+s\", \"ctrl+p\", \"mac+meta+p\"],\n proto.commitOrRemove,\n { bubbles: true },\n ],\n [\n [\"ctrl+Enter\", \"mac+meta+Enter\", \"Escape\", \"mac+Escape\"],\n proto.commitOrRemove,\n ],\n [\n [\"ArrowLeft\", \"mac+ArrowLeft\"],\n proto._translateEmpty,\n { args: [-small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowLeft\", \"mac+shift+ArrowLeft\"],\n proto._translateEmpty,\n { args: [-big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowRight\", \"mac+ArrowRight\"],\n proto._translateEmpty,\n { args: [small, 0], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowRight\", \"mac+shift+ArrowRight\"],\n proto._translateEmpty,\n { args: [big, 0], checker: arrowChecker },\n ],\n [\n [\"ArrowUp\", \"mac+ArrowUp\"],\n proto._translateEmpty,\n { args: [0, -small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowUp\", \"mac+shift+ArrowUp\"],\n proto._translateEmpty,\n { args: [0, -big], checker: arrowChecker },\n ],\n [\n [\"ArrowDown\", \"mac+ArrowDown\"],\n proto._translateEmpty,\n { args: [0, small], checker: arrowChecker },\n ],\n [\n [\"ctrl+ArrowDown\", \"mac+shift+ArrowDown\"],\n proto._translateEmpty,\n { args: [0, big], checker: arrowChecker },\n ],\n ])\n );\n }\n\n static _type = \"freetext\";\n\n constructor(params) {\n super({ ...params, name: \"freeTextEditor\" });\n this.#color =\n params.color ||\n FreeTextEditor._defaultColor ||\n AnnotationEditor._defaultLineColor;\n this.#fontSize = params.fontSize || FreeTextEditor._defaultFontSize;\n }\n\n /** @inheritdoc */\n static initialize(l10n) {\n AnnotationEditor.initialize(l10n, {\n strings: [\"free_text2_default_content\", \"editor_free_text2_aria_label\"],\n });\n const style = getComputedStyle(document.documentElement);\n\n if (typeof PDFJSDev === \"undefined\" || PDFJSDev.test(\"TESTING\")) {\n const lineHeight = parseFloat(\n style.getPropertyValue(\"--freetext-line-height\")\n );\n assert(\n lineHeight === LINE_FACTOR,\n \"Update the CSS variable to agree with the constant.\"\n );\n }\n\n this._internalPadding = parseFloat(\n style.getPropertyValue(\"--freetext-padding\")\n );\n }\n\n /** @inheritdoc */\n static updateDefaultParams(type, value) {\n switch (type) {\n case AnnotationEditorParamsType.FREETEXT_SIZE:\n FreeTextEditor._defaultFontSize = value;\n break;\n case AnnotationEditorParamsType.FREETEXT_COLOR:\n FreeTextEditor._defaultColor = value;\n break;\n }\n }\n\n /** @inheritdoc */\n updateParams(type, value) {\n switch (type) {\n case AnnotationEditorParamsType.FREETEXT_SIZE:\n this.#updateFontSize(value);\n break;\n case AnnotationEditorParamsType.FREETEXT_COLOR:\n this.#updateColor(value);\n break;\n }\n }\n\n /** @inheritdoc */\n static get defaultPropertiesToUpdate() {\n return [\n [\n AnnotationEditorParamsType.FREETEXT_SIZE,\n FreeTextEditor._defaultFontSize,\n ],\n [\n AnnotationEditorParamsType.FREETEXT_COLOR,\n FreeTextEditor._defaultColor || AnnotationEditor._defaultLineColor,\n ],\n ];\n }\n\n /** @inheritdoc */\n get propertiesToUpdate() {\n return [\n [AnnotationEditorParamsType.FREETEXT_SIZE, this.#fontSize],\n [AnnotationEditorParamsType.FREETEXT_COLOR, this.#color],\n ];\n }\n\n /**\n * Update the font size and make this action as undoable.\n * @param {number} fontSize\n */\n #updateFontSize(fontSize) {\n const setFontsize = size => {\n this.editorDiv.style.fontSize = `calc(${size}px * var(--scale-factor))`;\n this.translate(0, -(size - this.#fontSize) * this.parentScale);\n this.#fontSize = size;\n this.#setEditorDimensions();\n };\n const savedFontsize = this.#fontSize;\n this.addCommands({\n cmd: () => {\n setFontsize(fontSize);\n },\n undo: () => {\n setFontsize(savedFontsize);\n },\n mustExec: true,\n type: AnnotationEditorParamsType.FREETEXT_SIZE,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n }\n\n /**\n * Update the color and make this action undoable.\n * @param {string} color\n */\n #updateColor(color) {\n const savedColor = this.#color;\n this.addCommands({\n cmd: () => {\n this.#color = this.editorDiv.style.color = color;\n },\n undo: () => {\n this.#color = this.editorDiv.style.color = savedColor;\n },\n mustExec: true,\n type: AnnotationEditorParamsType.FREETEXT_COLOR,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n }\n\n /**\n * Helper to translate the editor with the keyboard when it's empty.\n * @param {number} x in page units.\n * @param {number} y in page units.\n */\n _translateEmpty(x, y) {\n this._uiManager.translateSelectedEditors(x, y, /* noCommit = */ true);\n }\n\n /** @inheritdoc */\n getInitialTranslation() {\n // The start of the base line is where the user clicked.\n const scale = this.parentScale;\n return [\n -FreeTextEditor._internalPadding * scale,\n -(FreeTextEditor._internalPadding + this.#fontSize) * scale,\n ];\n }\n\n /** @inheritdoc */\n rebuild() {\n if (!this.parent) {\n return;\n }\n super.rebuild();\n if (this.div === null) {\n return;\n }\n\n if (!this.isAttachedToDOM) {\n // At some point this editor was removed and we're rebuilting it,\n // hence we must add it to its parent.\n this.parent.add(this);\n }\n }\n\n /** @inheritdoc */\n enableEditMode() {\n if (this.isInEditMode()) {\n return;\n }\n\n this.parent.setEditingState(false);\n this.parent.updateToolbar(AnnotationEditorType.FREETEXT);\n super.enableEditMode();\n this.overlayDiv.classList.remove(\"enabled\");\n this.editorDiv.contentEditable = true;\n this._isDraggable = false;\n this.div.removeAttribute(\"aria-activedescendant\");\n this.editorDiv.addEventListener(\"keydown\", this.#boundEditorDivKeydown);\n this.editorDiv.addEventListener(\"focus\", this.#boundEditorDivFocus);\n this.editorDiv.addEventListener(\"blur\", this.#boundEditorDivBlur);\n this.editorDiv.addEventListener(\"input\", this.#boundEditorDivInput);\n }\n\n /** @inheritdoc */\n disableEditMode() {\n if (!this.isInEditMode()) {\n return;\n }\n\n this.parent.setEditingState(true);\n super.disableEditMode();\n this.overlayDiv.classList.add(\"enabled\");\n this.editorDiv.contentEditable = false;\n this.div.setAttribute(\"aria-activedescendant\", this.#editorDivId);\n this._isDraggable = true;\n this.editorDiv.removeEventListener(\"keydown\", this.#boundEditorDivKeydown);\n this.editorDiv.removeEventListener(\"focus\", this.#boundEditorDivFocus);\n this.editorDiv.removeEventListener(\"blur\", this.#boundEditorDivBlur);\n this.editorDiv.removeEventListener(\"input\", this.#boundEditorDivInput);\n\n // On Chrome, the focus is given to <body> when contentEditable is set to\n // false, hence we focus the div.\n this.div.focus({\n preventScroll: true /* See issue #15744 */,\n });\n\n // In case the blur callback hasn't been called.\n this.isEditing = false;\n this.parent.div.classList.add(\"freeTextEditing\");\n }\n\n /** @inheritdoc */\n focusin(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n super.focusin(event);\n if (event.target !== this.editorDiv) {\n this.editorDiv.focus();\n }\n }\n\n /** @inheritdoc */\n onceAdded() {\n if (this.width) {\n this.#cheatInitialRect();\n // The editor was created in using ctrl+c.\n return;\n }\n this.enableEditMode();\n this.editorDiv.focus();\n if (this._initialOptions?.isCentered) {\n this.center();\n }\n this._initialOptions = null;\n }\n\n /** @inheritdoc */\n isEmpty() {\n return !this.editorDiv || this.editorDiv.innerText.trim() === \"\";\n }\n\n /** @inheritdoc */\n remove() {\n this.isEditing = false;\n if (this.parent) {\n this.parent.setEditingState(true);\n this.parent.div.classList.add(\"freeTextEditing\");\n }\n super.remove();\n }\n\n /**\n * Extract the text from this editor.\n * @returns {string}\n */\n #extractText() {\n const divs = this.editorDiv.getElementsByTagName(\"div\");\n if (divs.length === 0) {\n return this.editorDiv.innerText;\n }\n const buffer = [];\n for (const div of divs) {\n buffer.push(div.innerText.replace(/\\r\\n?|\\n/, \"\"));\n }\n return buffer.join(\"\\n\");\n }\n\n #setEditorDimensions() {\n const [parentWidth, parentHeight] = this.parentDimensions;\n\n let rect;\n if (this.isAttachedToDOM) {\n rect = this.div.getBoundingClientRect();\n } else {\n // This editor isn't on screen but we need to get its dimensions, so\n // we just insert it in the DOM, get its bounding box and then remove it.\n const { currentLayer, div } = this;\n const savedDisplay = div.style.display;\n div.style.display = \"hidden\";\n currentLayer.div.append(this.div);\n rect = div.getBoundingClientRect();\n div.remove();\n div.style.display = savedDisplay;\n }\n\n // The dimensions are relative to the rotation of the page, hence we need to\n // take that into account (see issue #16636).\n if (this.rotation % 180 === this.parentRotation % 180) {\n this.width = rect.width / parentWidth;\n this.height = rect.height / parentHeight;\n } else {\n this.width = rect.height / parentWidth;\n this.height = rect.width / parentHeight;\n }\n this.fixAndSetPosition();\n }\n\n /**\n * Commit the content we have in this editor.\n * @returns {undefined}\n */\n commit() {\n if (!this.isInEditMode()) {\n return;\n }\n\n super.commit();\n this.disableEditMode();\n const savedText = this.#content;\n const newText = (this.#content = this.#extractText().trimEnd());\n if (savedText === newText) {\n return;\n }\n\n const setText = text => {\n this.#content = text;\n if (!text) {\n this.remove();\n return;\n }\n this.#setContent();\n this._uiManager.rebuild(this);\n this.#setEditorDimensions();\n };\n this.addCommands({\n cmd: () => {\n setText(newText);\n },\n undo: () => {\n setText(savedText);\n },\n mustExec: false,\n });\n this.#setEditorDimensions();\n }\n\n /** @inheritdoc */\n shouldGetKeyboardEvents() {\n return this.isInEditMode();\n }\n\n /** @inheritdoc */\n enterInEditMode() {\n this.enableEditMode();\n this.editorDiv.focus();\n }\n\n /**\n * ondblclick callback.\n * @param {MouseEvent} event\n */\n dblclick(event) {\n this.enterInEditMode();\n }\n\n /**\n * onkeydown callback.\n * @param {KeyboardEvent} event\n */\n keydown(event) {\n if (event.target === this.div && event.key === \"Enter\") {\n this.enterInEditMode();\n // Avoid to add an unwanted new line.\n event.preventDefault();\n }\n }\n\n editorDivKeydown(event) {\n FreeTextEditor._keyboardManager.exec(this, event);\n }\n\n editorDivFocus(event) {\n this.isEditing = true;\n }\n\n editorDivBlur(event) {\n this.isEditing = false;\n }\n\n editorDivInput(event) {\n this.parent.div.classList.toggle(\"freeTextEditing\", this.isEmpty());\n }\n\n /** @inheritdoc */\n disableEditing() {\n this.editorDiv.setAttribute(\"role\", \"comment\");\n this.editorDiv.removeAttribute(\"aria-multiline\");\n }\n\n /** @inheritdoc */\n enableEditing() {\n this.editorDiv.setAttribute(\"role\", \"textbox\");\n this.editorDiv.setAttribute(\"aria-multiline\", true);\n }\n\n /** @inheritdoc */\n render() {\n if (this.div) {\n return this.div;\n }\n\n let baseX, baseY;\n if (this.width) {\n baseX = this.x;\n baseY = this.y;\n }\n\n super.render();\n this.editorDiv = document.createElement(\"div\");\n this.editorDiv.className = \"internal\";\n\n this.editorDiv.setAttribute(\"id\", this.#editorDivId);\n this.enableEditing();\n\n AnnotationEditor._l10nPromise\n .get(\"editor_free_text2_aria_label\")\n .then(msg => this.editorDiv?.setAttribute(\"aria-label\", msg));\n\n AnnotationEditor._l10nPromise\n .get(\"free_text2_default_content\")\n .then(msg => this.editorDiv?.setAttribute(\"default-content\", msg));\n this.editorDiv.contentEditable = true;\n\n const { style } = this.editorDiv;\n style.fontSize = `calc(${this.#fontSize}px * var(--scale-factor))`;\n style.color = this.#color;\n\n this.div.append(this.editorDiv);\n\n this.overlayDiv = document.createElement(\"div\");\n this.overlayDiv.classList.add(\"overlay\", \"enabled\");\n this.div.append(this.overlayDiv);\n\n // TODO: implement paste callback.\n // The goal is to sanitize and have something suitable for this\n // editor.\n bindEvents(this, this.div, [\"dblclick\", \"keydown\"]);\n\n if (this.width) {\n // This editor was created in using copy (ctrl+c).\n const [parentWidth, parentHeight] = this.parentDimensions;\n if (this.annotationElementId) {\n // This stuff is hard to test: if something is changed here, please\n // test with the following PDF file:\n // - freetexts.pdf\n // - rotated_freetexts.pdf\n // Only small variations between the original annotation and its editor\n // are allowed.\n\n // position is the position of the first glyph in the annotation\n // and it's relative to its container.\n const { position } = this.#initialData;\n let [tx, ty] = this.getInitialTranslation();\n [tx, ty] = this.pageTranslationToScreen(tx, ty);\n const [pageWidth, pageHeight] = this.pageDimensions;\n const [pageX, pageY] = this.pageTranslation;\n let posX, posY;\n switch (this.rotation) {\n case 0:\n posX = baseX + (position[0] - pageX) / pageWidth;\n posY = baseY + this.height - (position[1] - pageY) / pageHeight;\n break;\n case 90:\n posX = baseX + (position[0] - pageX) / pageWidth;\n posY = baseY - (position[1] - pageY) / pageHeight;\n [tx, ty] = [ty, -tx];\n break;\n case 180:\n posX = baseX - this.width + (position[0] - pageX) / pageWidth;\n posY = baseY - (position[1] - pageY) / pageHeight;\n [tx, ty] = [-tx, -ty];\n break;\n case 270:\n posX =\n baseX +\n (position[0] - pageX - this.height * pageHeight) / pageWidth;\n posY =\n baseY +\n (position[1] - pageY - this.width * pageWidth) / pageHeight;\n [tx, ty] = [-ty, tx];\n break;\n }\n this.setAt(posX * parentWidth, posY * parentHeight, tx, ty);\n } else {\n this.setAt(\n baseX * parentWidth,\n baseY * parentHeight,\n this.width * parentWidth,\n this.height * parentHeight\n );\n }\n\n this.#setContent();\n this._isDraggable = true;\n this.editorDiv.contentEditable = false;\n } else {\n this._isDraggable = false;\n this.editorDiv.contentEditable = true;\n }\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n this.div.setAttribute(\"annotation-id\", this.annotationElementId);\n }\n\n return this.div;\n }\n\n #setContent() {\n this.editorDiv.replaceChildren();\n if (!this.#content) {\n return;\n }\n for (const line of this.#content.split(\"\\n\")) {\n const div = document.createElement(\"div\");\n div.append(\n line ? document.createTextNode(line) : document.createElement(\"br\")\n );\n this.editorDiv.append(div);\n }\n }\n\n get contentDiv() {\n return this.editorDiv;\n }\n\n /** @inheritdoc */\n static deserialize(data, parent, uiManager) {\n let initialData = null;\n if (data instanceof FreeTextAnnotationElement) {\n const {\n data: {\n defaultAppearanceData: { fontSize, fontColor },\n rect,\n rotation,\n id,\n },\n textContent,\n textPosition,\n parent: {\n page: { pageNumber },\n },\n } = data;\n // textContent is supposed to be an array of strings containing each line\n // of text. However, it can be null or empty.\n if (!textContent || textContent.length === 0) {\n // Empty annotation.\n return null;\n }\n initialData = data = {\n annotationType: AnnotationEditorType.FREETEXT,\n color: Array.from(fontColor),\n fontSize,\n value: textContent.join(\"\\n\"),\n position: textPosition,\n pageIndex: pageNumber - 1,\n rect,\n rotation,\n id,\n deleted: false,\n };\n }\n const editor = super.deserialize(data, parent, uiManager);\n\n editor.#fontSize = data.fontSize;\n editor.#color = Util.makeHexColor(...data.color);\n editor.#content = data.value;\n editor.annotationElementId = data.id || null;\n editor.#initialData = initialData;\n\n return editor;\n }\n\n /** @inheritdoc */\n serialize(isForCopying = false) {\n if (this.isEmpty()) {\n return null;\n }\n\n if (this.deleted) {\n return {\n pageIndex: this.pageIndex,\n id: this.annotationElementId,\n deleted: true,\n };\n }\n\n const padding = FreeTextEditor._internalPadding * this.parentScale;\n const rect = this.getRect(padding, padding);\n const color = AnnotationEditor._colorManager.convert(\n this.isAttachedToDOM\n ? getComputedStyle(this.editorDiv).color\n : this.#color\n );\n\n const serialized = {\n annotationType: AnnotationEditorType.FREETEXT,\n color,\n fontSize: this.#fontSize,\n value: this.#content,\n pageIndex: this.pageIndex,\n rect,\n rotation: this.rotation,\n structTreeParentId: this._structTreeParentId,\n };\n\n if (isForCopying) {\n // Don't add the id when copying because the pasted editor mustn't be\n // linked to an existing annotation.\n return serialized;\n }\n\n if (this.annotationElementId && !this.#hasElementChanged(serialized)) {\n return null;\n }\n\n serialized.id = this.annotationElementId;\n\n return serialized;\n }\n\n #hasElementChanged(serialized) {\n const { value, fontSize, color, rect, pageIndex } = this.#initialData;\n\n return (\n serialized.value !== value ||\n serialized.fontSize !== fontSize ||\n serialized.rect.some((x, i) => Math.abs(x - rect[i]) >= 1) ||\n serialized.color.some((c, i) => c !== color[i]) ||\n serialized.pageIndex !== pageIndex\n );\n }\n\n #cheatInitialRect(delayed = false) {\n // The annotation has a rect but the editor has an other one.\n // When we want to know if the annotation has changed (e.g. has been moved)\n // we must compare the editor initial rect with the current one.\n // So this method is a hack to have a way to compare the real rects.\n if (!this.annotationElementId) {\n return;\n }\n\n this.#setEditorDimensions();\n if (!delayed && (this.width === 0 || this.height === 0)) {\n setTimeout(() => this.#cheatInitialRect(/* delayed = */ true), 0);\n return;\n }\n\n const padding = FreeTextEditor._internalPadding * this.parentScale;\n this.#initialData.rect = this.getRect(padding, padding);\n }\n}\n\nexport { FreeTextEditor };\n","/* Copyright 2014 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/** @typedef {import(\"./api\").PDFPageProxy} PDFPageProxy */\n/** @typedef {import(\"./display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../../web/text_accessibility.js\").TextAccessibilityManager} TextAccessibilityManager */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"../../web/interfaces\").IDownloadManager} IDownloadManager */\n/** @typedef {import(\"../../web/interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport {\n AnnotationBorderStyleType,\n AnnotationEditorType,\n AnnotationPrefix,\n AnnotationType,\n FeatureTest,\n LINE_FACTOR,\n shadow,\n unreachable,\n Util,\n warn,\n} from \"../shared/util.js\";\nimport {\n DOMSVGFactory,\n getFilenameFromUrl,\n PDFDateString,\n setLayerDimensions,\n} from \"./display_utils.js\";\nimport { AnnotationStorage } from \"./annotation_storage.js\";\nimport { ColorConverters } from \"../shared/scripting_utils.js\";\nimport { NullL10n } from \"display-l10n_utils\";\nimport { XfaLayer } from \"./xfa_layer.js\";\n\nconst DEFAULT_TAB_INDEX = 1000;\nconst DEFAULT_FONT_SIZE = 9;\nconst GetElementsByNameSet = new WeakSet();\n\nfunction getRectDims(rect) {\n return {\n width: rect[2] - rect[0],\n height: rect[3] - rect[1],\n };\n}\n\n/**\n * @typedef {Object} AnnotationElementParameters\n * @property {Object} data\n * @property {HTMLDivElement} layer\n * @property {IPDFLinkService} linkService\n * @property {IDownloadManager} downloadManager\n * @property {AnnotationStorage} [annotationStorage]\n * @property {string} [imageResourcesPath] - Path for image resources, mainly\n * for annotation icons. Include trailing slash.\n * @property {boolean} renderForms\n * @property {Object} svgFactory\n * @property {boolean} [enableScripting]\n * @property {boolean} [hasJSActions]\n * @property {Object} [fieldObjects]\n */\n\nclass AnnotationElementFactory {\n /**\n * @param {AnnotationElementParameters} parameters\n * @returns {AnnotationElement}\n */\n static create(parameters) {\n const subtype = parameters.data.annotationType;\n\n switch (subtype) {\n case AnnotationType.LINK:\n return new LinkAnnotationElement(parameters);\n\n case AnnotationType.TEXT:\n return new TextAnnotationElement(parameters);\n\n case AnnotationType.WIDGET:\n const fieldType = parameters.data.fieldType;\n\n switch (fieldType) {\n case \"Tx\":\n return new TextWidgetAnnotationElement(parameters);\n case \"Btn\":\n if (parameters.data.radioButton) {\n return new RadioButtonWidgetAnnotationElement(parameters);\n } else if (parameters.data.checkBox) {\n return new CheckboxWidgetAnnotationElement(parameters);\n }\n return new PushButtonWidgetAnnotationElement(parameters);\n case \"Ch\":\n return new ChoiceWidgetAnnotationElement(parameters);\n case \"Sig\":\n return new SignatureWidgetAnnotationElement(parameters);\n }\n return new WidgetAnnotationElement(parameters);\n\n case AnnotationType.POPUP:\n return new PopupAnnotationElement(parameters);\n\n case AnnotationType.FREETEXT:\n return new FreeTextAnnotationElement(parameters);\n\n case AnnotationType.LINE:\n return new LineAnnotationElement(parameters);\n\n case AnnotationType.SQUARE:\n return new SquareAnnotationElement(parameters);\n\n case AnnotationType.CIRCLE:\n return new CircleAnnotationElement(parameters);\n\n case AnnotationType.POLYLINE:\n return new PolylineAnnotationElement(parameters);\n\n case AnnotationType.CARET:\n return new CaretAnnotationElement(parameters);\n\n case AnnotationType.INK:\n return new InkAnnotationElement(parameters);\n\n case AnnotationType.POLYGON:\n return new PolygonAnnotationElement(parameters);\n\n case AnnotationType.HIGHLIGHT:\n return new HighlightAnnotationElement(parameters);\n\n case AnnotationType.UNDERLINE:\n return new UnderlineAnnotationElement(parameters);\n\n case AnnotationType.SQUIGGLY:\n return new SquigglyAnnotationElement(parameters);\n\n case AnnotationType.STRIKEOUT:\n return new StrikeOutAnnotationElement(parameters);\n\n case AnnotationType.STAMP:\n return new StampAnnotationElement(parameters);\n\n case AnnotationType.FILEATTACHMENT:\n return new FileAttachmentAnnotationElement(parameters);\n\n default:\n return new AnnotationElement(parameters);\n }\n }\n}\n\nclass AnnotationElement {\n #hasBorder = false;\n\n constructor(\n parameters,\n {\n isRenderable = false,\n ignoreBorder = false,\n createQuadrilaterals = false,\n } = {}\n ) {\n this.isRenderable = isRenderable;\n this.data = parameters.data;\n this.layer = parameters.layer;\n this.linkService = parameters.linkService;\n this.downloadManager = parameters.downloadManager;\n this.imageResourcesPath = parameters.imageResourcesPath;\n this.renderForms = parameters.renderForms;\n this.svgFactory = parameters.svgFactory;\n this.annotationStorage = parameters.annotationStorage;\n this.enableScripting = parameters.enableScripting;\n this.hasJSActions = parameters.hasJSActions;\n this._fieldObjects = parameters.fieldObjects;\n this.parent = parameters.parent;\n\n if (isRenderable) {\n this.container = this._createContainer(ignoreBorder);\n }\n if (createQuadrilaterals) {\n this._createQuadrilaterals();\n }\n }\n\n static _hasPopupData({ titleObj, contentsObj, richText }) {\n return !!(titleObj?.str || contentsObj?.str || richText?.str);\n }\n\n get hasPopupData() {\n return AnnotationElement._hasPopupData(this.data);\n }\n\n /**\n * Create an empty container for the annotation's HTML element.\n *\n * @private\n * @param {boolean} ignoreBorder\n * @memberof AnnotationElement\n * @returns {HTMLElement} A section element.\n */\n _createContainer(ignoreBorder) {\n const {\n data,\n parent: { page, viewport },\n } = this;\n\n const container = document.createElement(\"section\");\n container.setAttribute(\"data-annotation-id\", data.id);\n if (!(this instanceof WidgetAnnotationElement)) {\n container.tabIndex = DEFAULT_TAB_INDEX;\n }\n\n // The accessibility manager will move the annotation in the DOM in\n // order to match the visual ordering.\n // But if an annotation is above an other one, then we must draw it\n // after the other one whatever the order is in the DOM, hence the\n // use of the z-index.\n container.style.zIndex = this.parent.zIndex++;\n\n if (this.data.popupRef) {\n container.setAttribute(\"aria-haspopup\", \"dialog\");\n }\n\n if (data.noRotate) {\n container.classList.add(\"norotate\");\n }\n\n const { pageWidth, pageHeight, pageX, pageY } = viewport.rawDims;\n\n if (!data.rect || this instanceof PopupAnnotationElement) {\n const { rotation } = data;\n if (!data.hasOwnCanvas && rotation !== 0) {\n this.setRotation(rotation, container);\n }\n return container;\n }\n\n const { width, height } = getRectDims(data.rect);\n\n // Do *not* modify `data.rect`, since that will corrupt the annotation\n // position on subsequent calls to `_createContainer` (see issue 6804).\n const rect = Util.normalizeRect([\n data.rect[0],\n page.view[3] - data.rect[1] + page.view[1],\n data.rect[2],\n page.view[3] - data.rect[3] + page.view[1],\n ]);\n\n if (!ignoreBorder && data.borderStyle.width > 0) {\n container.style.borderWidth = `${data.borderStyle.width}px`;\n\n const horizontalRadius = data.borderStyle.horizontalCornerRadius;\n const verticalRadius = data.borderStyle.verticalCornerRadius;\n if (horizontalRadius > 0 || verticalRadius > 0) {\n const radius = `calc(${horizontalRadius}px * var(--scale-factor)) / calc(${verticalRadius}px * var(--scale-factor))`;\n container.style.borderRadius = radius;\n } else if (this instanceof RadioButtonWidgetAnnotationElement) {\n const radius = `calc(${width}px * var(--scale-factor)) / calc(${height}px * var(--scale-factor))`;\n container.style.borderRadius = radius;\n }\n\n switch (data.borderStyle.style) {\n case AnnotationBorderStyleType.SOLID:\n container.style.borderStyle = \"solid\";\n break;\n\n case AnnotationBorderStyleType.DASHED:\n container.style.borderStyle = \"dashed\";\n break;\n\n case AnnotationBorderStyleType.BEVELED:\n warn(\"Unimplemented border style: beveled\");\n break;\n\n case AnnotationBorderStyleType.INSET:\n warn(\"Unimplemented border style: inset\");\n break;\n\n case AnnotationBorderStyleType.UNDERLINE:\n container.style.borderBottomStyle = \"solid\";\n break;\n\n default:\n break;\n }\n\n const borderColor = data.borderColor || null;\n if (borderColor) {\n this.#hasBorder = true;\n container.style.borderColor = Util.makeHexColor(\n borderColor[0] | 0,\n borderColor[1] | 0,\n borderColor[2] | 0\n );\n } else {\n // Transparent (invisible) border, so do not draw it at all.\n container.style.borderWidth = 0;\n }\n }\n\n container.style.left = `${(100 * (rect[0] - pageX)) / pageWidth}%`;\n container.style.top = `${(100 * (rect[1] - pageY)) / pageHeight}%`;\n\n const { rotation } = data;\n if (data.hasOwnCanvas || rotation === 0) {\n container.style.width = `${(100 * width) / pageWidth}%`;\n container.style.height = `${(100 * height) / pageHeight}%`;\n } else {\n this.setRotation(rotation, container);\n }\n\n return container;\n }\n\n setRotation(angle, container = this.container) {\n if (!this.data.rect) {\n return;\n }\n const { pageWidth, pageHeight } = this.parent.viewport.rawDims;\n const { width, height } = getRectDims(this.data.rect);\n\n let elementWidth, elementHeight;\n if (angle % 180 === 0) {\n elementWidth = (100 * width) / pageWidth;\n elementHeight = (100 * height) / pageHeight;\n } else {\n elementWidth = (100 * height) / pageWidth;\n elementHeight = (100 * width) / pageHeight;\n }\n\n container.style.width = `${elementWidth}%`;\n container.style.height = `${elementHeight}%`;\n\n container.setAttribute(\"data-main-rotation\", (360 - angle) % 360);\n }\n\n get _commonActions() {\n const setColor = (jsName, styleName, event) => {\n const color = event.detail[jsName];\n const colorType = color[0];\n const colorArray = color.slice(1);\n event.target.style[styleName] =\n ColorConverters[`${colorType}_HTML`](colorArray);\n this.annotationStorage.setValue(this.data.id, {\n [styleName]: ColorConverters[`${colorType}_rgb`](colorArray),\n });\n };\n\n return shadow(this, \"_commonActions\", {\n display: event => {\n const { display } = event.detail;\n // See scripting/constants.js for the values of `Display`.\n // 0 = visible, 1 = hidden, 2 = noPrint and 3 = noView.\n const hidden = display % 2 === 1;\n this.container.style.visibility = hidden ? \"hidden\" : \"visible\";\n this.annotationStorage.setValue(this.data.id, {\n noView: hidden,\n noPrint: display === 1 || display === 2,\n });\n },\n print: event => {\n this.annotationStorage.setValue(this.data.id, {\n noPrint: !event.detail.print,\n });\n },\n hidden: event => {\n const { hidden } = event.detail;\n this.container.style.visibility = hidden ? \"hidden\" : \"visible\";\n this.annotationStorage.setValue(this.data.id, {\n noPrint: hidden,\n noView: hidden,\n });\n },\n focus: event => {\n setTimeout(() => event.target.focus({ preventScroll: false }), 0);\n },\n userName: event => {\n // tooltip\n event.target.title = event.detail.userName;\n },\n readonly: event => {\n event.target.disabled = event.detail.readonly;\n },\n required: event => {\n this._setRequired(event.target, event.detail.required);\n },\n bgColor: event => {\n setColor(\"bgColor\", \"backgroundColor\", event);\n },\n fillColor: event => {\n setColor(\"fillColor\", \"backgroundColor\", event);\n },\n fgColor: event => {\n setColor(\"fgColor\", \"color\", event);\n },\n textColor: event => {\n setColor(\"textColor\", \"color\", event);\n },\n borderColor: event => {\n setColor(\"borderColor\", \"borderColor\", event);\n },\n strokeColor: event => {\n setColor(\"strokeColor\", \"borderColor\", event);\n },\n rotation: event => {\n const angle = event.detail.rotation;\n this.setRotation(angle);\n this.annotationStorage.setValue(this.data.id, {\n rotation: angle,\n });\n },\n });\n }\n\n _dispatchEventFromSandbox(actions, jsEvent) {\n const commonActions = this._commonActions;\n for (const name of Object.keys(jsEvent.detail)) {\n const action = actions[name] || commonActions[name];\n action?.(jsEvent);\n }\n }\n\n _setDefaultPropertiesFromJS(element) {\n if (!this.enableScripting) {\n return;\n }\n\n // Some properties may have been updated thanks to JS.\n const storedData = this.annotationStorage.getRawValue(this.data.id);\n if (!storedData) {\n return;\n }\n\n const commonActions = this._commonActions;\n for (const [actionName, detail] of Object.entries(storedData)) {\n const action = commonActions[actionName];\n if (action) {\n const eventProxy = {\n detail: {\n [actionName]: detail,\n },\n target: element,\n };\n action(eventProxy);\n // The action has been consumed: no need to keep it.\n delete storedData[actionName];\n }\n }\n }\n\n /**\n * Create quadrilaterals from the annotation's quadpoints.\n *\n * @private\n * @memberof AnnotationElement\n */\n _createQuadrilaterals() {\n if (!this.container) {\n return;\n }\n const { quadPoints } = this.data;\n if (!quadPoints) {\n return;\n }\n\n const [rectBlX, rectBlY, rectTrX, rectTrY] = this.data.rect;\n\n if (quadPoints.length === 1) {\n const [, { x: trX, y: trY }, { x: blX, y: blY }] = quadPoints[0];\n if (\n rectTrX === trX &&\n rectTrY === trY &&\n rectBlX === blX &&\n rectBlY === blY\n ) {\n // The quadpoints cover the whole annotation rectangle, so no need to\n // create a quadrilateral.\n return;\n }\n }\n\n const { style } = this.container;\n let svgBuffer;\n if (this.#hasBorder) {\n const { borderColor, borderWidth } = style;\n style.borderWidth = 0;\n svgBuffer = [\n \"url('data:image/svg+xml;utf8,\",\n `<svg xmlns=\"http://www.w3.org/2000/svg\"`,\n ` preserveAspectRatio=\"none\" viewBox=\"0 0 1 1\">`,\n `<g fill=\"transparent\" stroke=\"${borderColor}\" stroke-width=\"${borderWidth}\">`,\n ];\n this.container.classList.add(\"hasBorder\");\n }\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n this.container.classList.add(\"hasClipPath\");\n }\n\n const width = rectTrX - rectBlX;\n const height = rectTrY - rectBlY;\n\n const { svgFactory } = this;\n const svg = svgFactory.createElement(\"svg\");\n svg.classList.add(\"quadrilateralsContainer\");\n svg.setAttribute(\"width\", 0);\n svg.setAttribute(\"height\", 0);\n const defs = svgFactory.createElement(\"defs\");\n svg.append(defs);\n const clipPath = svgFactory.createElement(\"clipPath\");\n const id = `clippath_${this.data.id}`;\n clipPath.setAttribute(\"id\", id);\n clipPath.setAttribute(\"clipPathUnits\", \"objectBoundingBox\");\n defs.append(clipPath);\n\n for (const [, { x: trX, y: trY }, { x: blX, y: blY }] of quadPoints) {\n const rect = svgFactory.createElement(\"rect\");\n const x = (blX - rectBlX) / width;\n const y = (rectTrY - trY) / height;\n const rectWidth = (trX - blX) / width;\n const rectHeight = (trY - blY) / height;\n rect.setAttribute(\"x\", x);\n rect.setAttribute(\"y\", y);\n rect.setAttribute(\"width\", rectWidth);\n rect.setAttribute(\"height\", rectHeight);\n clipPath.append(rect);\n svgBuffer?.push(\n `<rect vector-effect=\"non-scaling-stroke\" x=\"${x}\" y=\"${y}\" width=\"${rectWidth}\" height=\"${rectHeight}\"/>`\n );\n }\n\n if (this.#hasBorder) {\n svgBuffer.push(`</g></svg>')`);\n style.backgroundImage = svgBuffer.join(\"\");\n }\n\n this.container.append(svg);\n this.container.style.clipPath = `url(#${id})`;\n }\n\n /**\n * Create a popup for the annotation's HTML element. This is used for\n * annotations that do not have a Popup entry in the dictionary, but\n * are of a type that works with popups (such as Highlight annotations).\n *\n * @private\n * @memberof AnnotationElement\n */\n _createPopup() {\n const { container, data } = this;\n container.setAttribute(\"aria-haspopup\", \"dialog\");\n\n const popup = new PopupAnnotationElement({\n data: {\n color: data.color,\n titleObj: data.titleObj,\n modificationDate: data.modificationDate,\n contentsObj: data.contentsObj,\n richText: data.richText,\n parentRect: data.rect,\n borderStyle: 0,\n id: `popup_${data.id}`,\n rotation: data.rotation,\n },\n parent: this.parent,\n elements: [this],\n });\n this.parent.div.append(popup.render());\n }\n\n /**\n * Render the annotation's HTML element(s).\n *\n * @public\n * @memberof AnnotationElement\n */\n render() {\n unreachable(\"Abstract method `AnnotationElement.render` called\");\n }\n\n /**\n * @private\n * @returns {Array}\n */\n _getElementsByName(name, skipId = null) {\n const fields = [];\n\n if (this._fieldObjects) {\n const fieldObj = this._fieldObjects[name];\n if (fieldObj) {\n for (const { page, id, exportValues } of fieldObj) {\n if (page === -1) {\n continue;\n }\n if (id === skipId) {\n continue;\n }\n const exportValue =\n typeof exportValues === \"string\" ? exportValues : null;\n\n const domElement = document.querySelector(\n `[data-element-id=\"${id}\"]`\n );\n if (domElement && !GetElementsByNameSet.has(domElement)) {\n warn(`_getElementsByName - element not allowed: ${id}`);\n continue;\n }\n fields.push({ id, exportValue, domElement });\n }\n }\n return fields;\n }\n // Fallback to a regular DOM lookup, to ensure that the standalone\n // viewer components won't break.\n for (const domElement of document.getElementsByName(name)) {\n const { exportValue } = domElement;\n const id = domElement.getAttribute(\"data-element-id\");\n if (id === skipId) {\n continue;\n }\n if (!GetElementsByNameSet.has(domElement)) {\n continue;\n }\n fields.push({ id, exportValue, domElement });\n }\n return fields;\n }\n\n show() {\n if (this.container) {\n this.container.hidden = false;\n }\n this.popup?.maybeShow();\n }\n\n hide() {\n if (this.container) {\n this.container.hidden = true;\n }\n this.popup?.forceHide();\n }\n\n /**\n * Get the HTML element(s) which can trigger a popup when clicked or hovered.\n *\n * @public\n * @memberof AnnotationElement\n * @returns {Array<HTMLElement>|HTMLElement} An array of elements or an\n * element.\n */\n getElementsToTriggerPopup() {\n return this.container;\n }\n\n addHighlightArea() {\n const triggers = this.getElementsToTriggerPopup();\n if (Array.isArray(triggers)) {\n for (const element of triggers) {\n element.classList.add(\"highlightArea\");\n }\n } else {\n triggers.classList.add(\"highlightArea\");\n }\n }\n\n _editOnDoubleClick() {\n const {\n annotationEditorType: mode,\n data: { id: editId },\n } = this;\n this.container.addEventListener(\"dblclick\", () => {\n this.linkService.eventBus?.dispatch(\"switchannotationeditormode\", {\n source: this,\n mode,\n editId,\n });\n });\n }\n}\n\nclass LinkAnnotationElement extends AnnotationElement {\n constructor(parameters, options = null) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: !!options?.ignoreBorder,\n createQuadrilaterals: true,\n });\n this.isTooltipOnly = parameters.data.isTooltipOnly;\n }\n\n render() {\n const { data, linkService } = this;\n const link = document.createElement(\"a\");\n link.setAttribute(\"data-element-id\", data.id);\n let isBound = false;\n\n if (data.url) {\n linkService.addLinkAttributes(link, data.url, data.newWindow);\n isBound = true;\n } else if (data.action) {\n this._bindNamedAction(link, data.action);\n isBound = true;\n } else if (data.attachment) {\n this._bindAttachment(link, data.attachment);\n isBound = true;\n } else if (data.setOCGState) {\n this.#bindSetOCGState(link, data.setOCGState);\n isBound = true;\n } else if (data.dest) {\n this._bindLink(link, data.dest);\n isBound = true;\n } else {\n if (\n data.actions &&\n (data.actions.Action ||\n data.actions[\"Mouse Up\"] ||\n data.actions[\"Mouse Down\"]) &&\n this.enableScripting &&\n this.hasJSActions\n ) {\n this._bindJSAction(link, data);\n isBound = true;\n }\n\n if (data.resetForm) {\n this._bindResetFormAction(link, data.resetForm);\n isBound = true;\n } else if (this.isTooltipOnly && !isBound) {\n this._bindLink(link, \"\");\n isBound = true;\n }\n }\n\n this.container.classList.add(\"linkAnnotation\");\n if (isBound) {\n this.container.append(link);\n }\n\n return this.container;\n }\n\n #setInternalLink() {\n this.container.setAttribute(\"data-internal-link\", \"\");\n }\n\n /**\n * Bind internal links to the link element.\n *\n * @private\n * @param {Object} link\n * @param {Object} destination\n * @memberof LinkAnnotationElement\n */\n _bindLink(link, destination) {\n link.href = this.linkService.getDestinationHash(destination);\n link.onclick = () => {\n if (destination) {\n this.linkService.goToDestination(destination);\n }\n return false;\n };\n if (destination || destination === /* isTooltipOnly = */ \"\") {\n this.#setInternalLink();\n }\n }\n\n /**\n * Bind named actions to the link element.\n *\n * @private\n * @param {Object} link\n * @param {Object} action\n * @memberof LinkAnnotationElement\n */\n _bindNamedAction(link, action) {\n link.href = this.linkService.getAnchorUrl(\"\");\n link.onclick = () => {\n this.linkService.executeNamedAction(action);\n return false;\n };\n this.#setInternalLink();\n }\n\n /**\n * Bind attachments to the link element.\n * @param {Object} link\n * @param {Object} attachment\n */\n _bindAttachment(link, attachment) {\n link.href = this.linkService.getAnchorUrl(\"\");\n link.onclick = () => {\n this.downloadManager?.openOrDownloadData(\n this.container,\n attachment.content,\n attachment.filename\n );\n return false;\n };\n this.#setInternalLink();\n }\n\n /**\n * Bind SetOCGState actions to the link element.\n * @param {Object} link\n * @param {Object} action\n */\n #bindSetOCGState(link, action) {\n link.href = this.linkService.getAnchorUrl(\"\");\n link.onclick = () => {\n this.linkService.executeSetOCGState(action);\n return false;\n };\n this.#setInternalLink();\n }\n\n /**\n * Bind JS actions to the link element.\n *\n * @private\n * @param {Object} link\n * @param {Object} data\n * @memberof LinkAnnotationElement\n */\n _bindJSAction(link, data) {\n link.href = this.linkService.getAnchorUrl(\"\");\n const map = new Map([\n [\"Action\", \"onclick\"],\n [\"Mouse Up\", \"onmouseup\"],\n [\"Mouse Down\", \"onmousedown\"],\n ]);\n for (const name of Object.keys(data.actions)) {\n const jsName = map.get(name);\n if (!jsName) {\n continue;\n }\n link[jsName] = () => {\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: data.id,\n name,\n },\n });\n return false;\n };\n }\n\n if (!link.onclick) {\n link.onclick = () => false;\n }\n this.#setInternalLink();\n }\n\n _bindResetFormAction(link, resetForm) {\n const otherClickAction = link.onclick;\n if (!otherClickAction) {\n link.href = this.linkService.getAnchorUrl(\"\");\n }\n this.#setInternalLink();\n\n if (!this._fieldObjects) {\n warn(\n `_bindResetFormAction - \"resetForm\" action not supported, ` +\n \"ensure that the `fieldObjects` parameter is provided.\"\n );\n if (!otherClickAction) {\n link.onclick = () => false;\n }\n return;\n }\n\n link.onclick = () => {\n otherClickAction?.();\n\n const {\n fields: resetFormFields,\n refs: resetFormRefs,\n include,\n } = resetForm;\n\n const allFields = [];\n if (resetFormFields.length !== 0 || resetFormRefs.length !== 0) {\n const fieldIds = new Set(resetFormRefs);\n for (const fieldName of resetFormFields) {\n const fields = this._fieldObjects[fieldName] || [];\n for (const { id } of fields) {\n fieldIds.add(id);\n }\n }\n for (const fields of Object.values(this._fieldObjects)) {\n for (const field of fields) {\n if (fieldIds.has(field.id) === include) {\n allFields.push(field);\n }\n }\n }\n } else {\n for (const fields of Object.values(this._fieldObjects)) {\n allFields.push(...fields);\n }\n }\n\n const storage = this.annotationStorage;\n const allIds = [];\n for (const field of allFields) {\n const { id } = field;\n allIds.push(id);\n switch (field.type) {\n case \"text\": {\n const value = field.defaultValue || \"\";\n storage.setValue(id, { value });\n break;\n }\n case \"checkbox\":\n case \"radiobutton\": {\n const value = field.defaultValue === field.exportValues;\n storage.setValue(id, { value });\n break;\n }\n case \"combobox\":\n case \"listbox\": {\n const value = field.defaultValue || \"\";\n storage.setValue(id, { value });\n break;\n }\n default:\n continue;\n }\n\n const domElement = document.querySelector(`[data-element-id=\"${id}\"]`);\n if (!domElement) {\n continue;\n } else if (!GetElementsByNameSet.has(domElement)) {\n warn(`_bindResetFormAction - element not allowed: ${id}`);\n continue;\n }\n domElement.dispatchEvent(new Event(\"resetform\"));\n }\n\n if (this.enableScripting) {\n // Update the values in the sandbox.\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: \"app\",\n ids: allIds,\n name: \"ResetForm\",\n },\n });\n }\n\n return false;\n };\n }\n}\n\nclass TextAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: true });\n }\n\n render() {\n this.container.classList.add(\"textAnnotation\");\n\n const image = document.createElement(\"img\");\n image.src =\n this.imageResourcesPath +\n \"annotation-\" +\n this.data.name.toLowerCase() +\n \".svg\";\n image.alt = \"[{{type}} Annotation]\";\n image.dataset.l10nId = \"text_annotation_type\";\n image.dataset.l10nArgs = JSON.stringify({ type: this.data.name });\n\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.append(image);\n return this.container;\n }\n}\n\nclass WidgetAnnotationElement extends AnnotationElement {\n render() {\n // Show only the container for unsupported field types.\n if (this.data.alternativeText) {\n this.container.title = this.data.alternativeText;\n }\n\n return this.container;\n }\n\n showElementAndHideCanvas(element) {\n if (this.data.hasOwnCanvas) {\n if (element.previousSibling?.nodeName === \"CANVAS\") {\n element.previousSibling.hidden = true;\n }\n element.hidden = false;\n }\n }\n\n _getKeyModifier(event) {\n const { isWin, isMac } = FeatureTest.platform;\n return (isWin && event.ctrlKey) || (isMac && event.metaKey);\n }\n\n _setEventListener(element, elementData, baseName, eventName, valueGetter) {\n if (baseName.includes(\"mouse\")) {\n // Mouse events\n element.addEventListener(baseName, event => {\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: this.data.id,\n name: eventName,\n value: valueGetter(event),\n shift: event.shiftKey,\n modifier: this._getKeyModifier(event),\n },\n });\n });\n } else {\n // Non-mouse events\n element.addEventListener(baseName, event => {\n if (baseName === \"blur\") {\n if (!elementData.focused || !event.relatedTarget) {\n return;\n }\n elementData.focused = false;\n } else if (baseName === \"focus\") {\n if (elementData.focused) {\n return;\n }\n elementData.focused = true;\n }\n\n if (!valueGetter) {\n return;\n }\n\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id: this.data.id,\n name: eventName,\n value: valueGetter(event),\n },\n });\n });\n }\n }\n\n _setEventListeners(element, elementData, names, getter) {\n for (const [baseName, eventName] of names) {\n if (eventName === \"Action\" || this.data.actions?.[eventName]) {\n if (eventName === \"Focus\" || eventName === \"Blur\") {\n elementData ||= { focused: false };\n }\n this._setEventListener(\n element,\n elementData,\n baseName,\n eventName,\n getter\n );\n if (eventName === \"Focus\" && !this.data.actions?.Blur) {\n // Ensure that elementData will have the correct value.\n this._setEventListener(element, elementData, \"blur\", \"Blur\", null);\n } else if (eventName === \"Blur\" && !this.data.actions?.Focus) {\n this._setEventListener(element, elementData, \"focus\", \"Focus\", null);\n }\n }\n }\n }\n\n _setBackgroundColor(element) {\n const color = this.data.backgroundColor || null;\n element.style.backgroundColor =\n color === null\n ? \"transparent\"\n : Util.makeHexColor(color[0], color[1], color[2]);\n }\n\n /**\n * Apply text styles to the text in the element.\n *\n * @private\n * @param {HTMLDivElement} element\n * @memberof TextWidgetAnnotationElement\n */\n _setTextStyle(element) {\n const TEXT_ALIGNMENT = [\"left\", \"center\", \"right\"];\n const { fontColor } = this.data.defaultAppearanceData;\n const fontSize =\n this.data.defaultAppearanceData.fontSize || DEFAULT_FONT_SIZE;\n\n const style = element.style;\n\n // TODO: If the font-size is zero, calculate it based on the height and\n // width of the element.\n // Not setting `style.fontSize` will use the default font-size for now.\n\n // We don't use the font, as specified in the PDF document, for the <input>\n // element. Hence using the original `fontSize` could look bad, which is why\n // it's instead based on the field height.\n // If the height is \"big\" then it could lead to a too big font size\n // so in this case use the one we've in the pdf (hence the min).\n let computedFontSize;\n const BORDER_SIZE = 2;\n const roundToOneDecimal = x => Math.round(10 * x) / 10;\n if (this.data.multiLine) {\n const height = Math.abs(\n this.data.rect[3] - this.data.rect[1] - BORDER_SIZE\n );\n const numberOfLines = Math.round(height / (LINE_FACTOR * fontSize)) || 1;\n const lineHeight = height / numberOfLines;\n computedFontSize = Math.min(\n fontSize,\n roundToOneDecimal(lineHeight / LINE_FACTOR)\n );\n } else {\n const height = Math.abs(\n this.data.rect[3] - this.data.rect[1] - BORDER_SIZE\n );\n computedFontSize = Math.min(\n fontSize,\n roundToOneDecimal(height / LINE_FACTOR)\n );\n }\n style.fontSize = `calc(${computedFontSize}px * var(--scale-factor))`;\n\n style.color = Util.makeHexColor(fontColor[0], fontColor[1], fontColor[2]);\n\n if (this.data.textAlignment !== null) {\n style.textAlign = TEXT_ALIGNMENT[this.data.textAlignment];\n }\n }\n\n _setRequired(element, isRequired) {\n if (isRequired) {\n element.setAttribute(\"required\", true);\n } else {\n element.removeAttribute(\"required\");\n }\n element.setAttribute(\"aria-required\", isRequired);\n }\n}\n\nclass TextWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n const isRenderable =\n parameters.renderForms ||\n (!parameters.data.hasAppearance && !!parameters.data.fieldValue);\n super(parameters, { isRenderable });\n }\n\n setPropertyOnSiblings(base, key, value, keyInStorage) {\n const storage = this.annotationStorage;\n for (const element of this._getElementsByName(\n base.name,\n /* skipId = */ base.id\n )) {\n if (element.domElement) {\n element.domElement[key] = value;\n }\n storage.setValue(element.id, { [keyInStorage]: value });\n }\n }\n\n render() {\n const storage = this.annotationStorage;\n const id = this.data.id;\n\n this.container.classList.add(\"textWidgetAnnotation\");\n\n let element = null;\n if (this.renderForms) {\n // NOTE: We cannot set the values using `element.value` below, since it\n // prevents the AnnotationLayer rasterizer in `test/driver.js`\n // from parsing the elements correctly for the reference tests.\n const storedData = storage.getValue(id, {\n value: this.data.fieldValue,\n });\n let textContent = storedData.value || \"\";\n const maxLen = storage.getValue(id, {\n charLimit: this.data.maxLen,\n }).charLimit;\n if (maxLen && textContent.length > maxLen) {\n textContent = textContent.slice(0, maxLen);\n }\n\n let fieldFormattedValues =\n storedData.formattedValue || this.data.textContent?.join(\"\\n\") || null;\n if (fieldFormattedValues && this.data.comb) {\n fieldFormattedValues = fieldFormattedValues.replaceAll(/\\s+/g, \"\");\n }\n\n const elementData = {\n userValue: textContent,\n formattedValue: fieldFormattedValues,\n lastCommittedValue: null,\n commitKey: 1,\n focused: false,\n };\n\n if (this.data.multiLine) {\n element = document.createElement(\"textarea\");\n element.textContent = fieldFormattedValues ?? textContent;\n if (this.data.doNotScroll) {\n element.style.overflowY = \"hidden\";\n }\n } else {\n element = document.createElement(\"input\");\n element.type = \"text\";\n element.setAttribute(\"value\", fieldFormattedValues ?? textContent);\n if (this.data.doNotScroll) {\n element.style.overflowX = \"hidden\";\n }\n }\n if (this.data.hasOwnCanvas) {\n element.hidden = true;\n }\n GetElementsByNameSet.add(element);\n element.setAttribute(\"data-element-id\", id);\n\n element.disabled = this.data.readOnly;\n element.name = this.data.fieldName;\n element.tabIndex = DEFAULT_TAB_INDEX;\n\n this._setRequired(element, this.data.required);\n\n if (maxLen) {\n element.maxLength = maxLen;\n }\n\n element.addEventListener(\"input\", event => {\n storage.setValue(id, { value: event.target.value });\n this.setPropertyOnSiblings(\n element,\n \"value\",\n event.target.value,\n \"value\"\n );\n elementData.formattedValue = null;\n });\n\n element.addEventListener(\"resetform\", event => {\n const defaultValue = this.data.defaultFieldValue ?? \"\";\n element.value = elementData.userValue = defaultValue;\n elementData.formattedValue = null;\n });\n\n let blurListener = event => {\n const { formattedValue } = elementData;\n if (formattedValue !== null && formattedValue !== undefined) {\n event.target.value = formattedValue;\n }\n // Reset the cursor position to the start of the field (issue 12359).\n event.target.scrollLeft = 0;\n };\n\n if (this.enableScripting && this.hasJSActions) {\n element.addEventListener(\"focus\", event => {\n if (elementData.focused) {\n return;\n }\n const { target } = event;\n if (elementData.userValue) {\n target.value = elementData.userValue;\n }\n elementData.lastCommittedValue = target.value;\n elementData.commitKey = 1;\n elementData.focused = true;\n });\n\n element.addEventListener(\"updatefromsandbox\", jsEvent => {\n this.showElementAndHideCanvas(jsEvent.target);\n const actions = {\n value(event) {\n elementData.userValue = event.detail.value ?? \"\";\n storage.setValue(id, { value: elementData.userValue.toString() });\n event.target.value = elementData.userValue;\n },\n formattedValue(event) {\n const { formattedValue } = event.detail;\n elementData.formattedValue = formattedValue;\n if (\n formattedValue !== null &&\n formattedValue !== undefined &&\n event.target !== document.activeElement\n ) {\n // Input hasn't the focus so display formatted string\n event.target.value = formattedValue;\n }\n storage.setValue(id, {\n formattedValue,\n });\n },\n selRange(event) {\n event.target.setSelectionRange(...event.detail.selRange);\n },\n charLimit: event => {\n const { charLimit } = event.detail;\n const { target } = event;\n if (charLimit === 0) {\n target.removeAttribute(\"maxLength\");\n return;\n }\n\n target.setAttribute(\"maxLength\", charLimit);\n let value = elementData.userValue;\n if (!value || value.length <= charLimit) {\n return;\n }\n value = value.slice(0, charLimit);\n target.value = elementData.userValue = value;\n storage.setValue(id, { value });\n\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n willCommit: true,\n commitKey: 1,\n selStart: target.selectionStart,\n selEnd: target.selectionEnd,\n },\n });\n },\n };\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n // Even if the field hasn't any actions\n // leaving it can still trigger some actions with Calculate\n element.addEventListener(\"keydown\", event => {\n elementData.commitKey = 1;\n // If the key is one of Escape, Enter then the data are committed.\n // If we've a Tab then data will be committed on blur.\n let commitKey = -1;\n if (event.key === \"Escape\") {\n commitKey = 0;\n } else if (event.key === \"Enter\" && !this.data.multiLine) {\n // When we've a multiline field, \"Enter\" key is a key as the other\n // hence we don't commit the data (Acrobat behaves the same way)\n // (see issue #15627).\n commitKey = 2;\n } else if (event.key === \"Tab\") {\n elementData.commitKey = 3;\n }\n if (commitKey === -1) {\n return;\n }\n const { value } = event.target;\n if (elementData.lastCommittedValue === value) {\n return;\n }\n elementData.lastCommittedValue = value;\n // Save the entered value\n elementData.userValue = value;\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n willCommit: true,\n commitKey,\n selStart: event.target.selectionStart,\n selEnd: event.target.selectionEnd,\n },\n });\n });\n const _blurListener = blurListener;\n blurListener = null;\n element.addEventListener(\"blur\", event => {\n if (!elementData.focused || !event.relatedTarget) {\n return;\n }\n elementData.focused = false;\n const { value } = event.target;\n elementData.userValue = value;\n if (elementData.lastCommittedValue !== value) {\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n willCommit: true,\n commitKey: elementData.commitKey,\n selStart: event.target.selectionStart,\n selEnd: event.target.selectionEnd,\n },\n });\n }\n _blurListener(event);\n });\n\n if (this.data.actions?.Keystroke) {\n element.addEventListener(\"beforeinput\", event => {\n elementData.lastCommittedValue = null;\n const { data, target } = event;\n const { value, selectionStart, selectionEnd } = target;\n\n let selStart = selectionStart,\n selEnd = selectionEnd;\n\n switch (event.inputType) {\n // https://rawgit.com/w3c/input-events/v1/index.html#interface-InputEvent-Attributes\n case \"deleteWordBackward\": {\n const match = value\n .substring(0, selectionStart)\n .match(/\\w*[^\\w]*$/);\n if (match) {\n selStart -= match[0].length;\n }\n break;\n }\n case \"deleteWordForward\": {\n const match = value\n .substring(selectionStart)\n .match(/^[^\\w]*\\w*/);\n if (match) {\n selEnd += match[0].length;\n }\n break;\n }\n case \"deleteContentBackward\":\n if (selectionStart === selectionEnd) {\n selStart -= 1;\n }\n break;\n case \"deleteContentForward\":\n if (selectionStart === selectionEnd) {\n selEnd += 1;\n }\n break;\n }\n\n // We handle the event ourselves.\n event.preventDefault();\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value,\n change: data || \"\",\n willCommit: false,\n selStart,\n selEnd,\n },\n });\n });\n }\n\n this._setEventListeners(\n element,\n elementData,\n [\n [\"focus\", \"Focus\"],\n [\"blur\", \"Blur\"],\n [\"mousedown\", \"Mouse Down\"],\n [\"mouseenter\", \"Mouse Enter\"],\n [\"mouseleave\", \"Mouse Exit\"],\n [\"mouseup\", \"Mouse Up\"],\n ],\n event => event.target.value\n );\n }\n\n if (blurListener) {\n element.addEventListener(\"blur\", blurListener);\n }\n\n if (this.data.comb) {\n const fieldWidth = this.data.rect[2] - this.data.rect[0];\n const combWidth = fieldWidth / maxLen;\n\n element.classList.add(\"comb\");\n element.style.letterSpacing = `calc(${combWidth}px * var(--scale-factor) - 1ch)`;\n }\n } else {\n element = document.createElement(\"div\");\n element.textContent = this.data.fieldValue;\n element.style.verticalAlign = \"middle\";\n element.style.display = \"table-cell\";\n }\n\n this._setTextStyle(element);\n this._setBackgroundColor(element);\n this._setDefaultPropertiesFromJS(element);\n\n this.container.append(element);\n return this.container;\n }\n}\n\nclass SignatureWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: !!parameters.data.hasOwnCanvas });\n }\n}\n\nclass CheckboxWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: parameters.renderForms });\n }\n\n render() {\n const storage = this.annotationStorage;\n const data = this.data;\n const id = data.id;\n let value = storage.getValue(id, {\n value: data.exportValue === data.fieldValue,\n }).value;\n if (typeof value === \"string\") {\n // The value has been changed through js and set in annotationStorage.\n value = value !== \"Off\";\n storage.setValue(id, { value });\n }\n\n this.container.classList.add(\"buttonWidgetAnnotation\", \"checkBox\");\n\n const element = document.createElement(\"input\");\n GetElementsByNameSet.add(element);\n element.setAttribute(\"data-element-id\", id);\n\n element.disabled = data.readOnly;\n this._setRequired(element, this.data.required);\n element.type = \"checkbox\";\n element.name = data.fieldName;\n if (value) {\n element.setAttribute(\"checked\", true);\n }\n element.setAttribute(\"exportValue\", data.exportValue);\n element.tabIndex = DEFAULT_TAB_INDEX;\n\n element.addEventListener(\"change\", event => {\n const { name, checked } = event.target;\n for (const checkbox of this._getElementsByName(name, /* skipId = */ id)) {\n const curChecked = checked && checkbox.exportValue === data.exportValue;\n if (checkbox.domElement) {\n checkbox.domElement.checked = curChecked;\n }\n storage.setValue(checkbox.id, { value: curChecked });\n }\n storage.setValue(id, { value: checked });\n });\n\n element.addEventListener(\"resetform\", event => {\n const defaultValue = data.defaultFieldValue || \"Off\";\n event.target.checked = defaultValue === data.exportValue;\n });\n\n if (this.enableScripting && this.hasJSActions) {\n element.addEventListener(\"updatefromsandbox\", jsEvent => {\n const actions = {\n value(event) {\n event.target.checked = event.detail.value !== \"Off\";\n storage.setValue(id, { value: event.target.checked });\n },\n };\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n this._setEventListeners(\n element,\n null,\n [\n [\"change\", \"Validate\"],\n [\"change\", \"Action\"],\n [\"focus\", \"Focus\"],\n [\"blur\", \"Blur\"],\n [\"mousedown\", \"Mouse Down\"],\n [\"mouseenter\", \"Mouse Enter\"],\n [\"mouseleave\", \"Mouse Exit\"],\n [\"mouseup\", \"Mouse Up\"],\n ],\n event => event.target.checked\n );\n }\n\n this._setBackgroundColor(element);\n this._setDefaultPropertiesFromJS(element);\n\n this.container.append(element);\n return this.container;\n }\n}\n\nclass RadioButtonWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: parameters.renderForms });\n }\n\n render() {\n this.container.classList.add(\"buttonWidgetAnnotation\", \"radioButton\");\n const storage = this.annotationStorage;\n const data = this.data;\n const id = data.id;\n let value = storage.getValue(id, {\n value: data.fieldValue === data.buttonValue,\n }).value;\n if (typeof value === \"string\") {\n // The value has been changed through js and set in annotationStorage.\n value = value !== data.buttonValue;\n storage.setValue(id, { value });\n }\n\n const element = document.createElement(\"input\");\n GetElementsByNameSet.add(element);\n element.setAttribute(\"data-element-id\", id);\n\n element.disabled = data.readOnly;\n this._setRequired(element, this.data.required);\n element.type = \"radio\";\n element.name = data.fieldName;\n if (value) {\n element.setAttribute(\"checked\", true);\n }\n element.tabIndex = DEFAULT_TAB_INDEX;\n\n element.addEventListener(\"change\", event => {\n const { name, checked } = event.target;\n for (const radio of this._getElementsByName(name, /* skipId = */ id)) {\n storage.setValue(radio.id, { value: false });\n }\n storage.setValue(id, { value: checked });\n });\n\n element.addEventListener(\"resetform\", event => {\n const defaultValue = data.defaultFieldValue;\n event.target.checked =\n defaultValue !== null &&\n defaultValue !== undefined &&\n defaultValue === data.buttonValue;\n });\n\n if (this.enableScripting && this.hasJSActions) {\n const pdfButtonValue = data.buttonValue;\n element.addEventListener(\"updatefromsandbox\", jsEvent => {\n const actions = {\n value: event => {\n const checked = pdfButtonValue === event.detail.value;\n for (const radio of this._getElementsByName(event.target.name)) {\n const curChecked = checked && radio.id === id;\n if (radio.domElement) {\n radio.domElement.checked = curChecked;\n }\n storage.setValue(radio.id, { value: curChecked });\n }\n },\n };\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n this._setEventListeners(\n element,\n null,\n [\n [\"change\", \"Validate\"],\n [\"change\", \"Action\"],\n [\"focus\", \"Focus\"],\n [\"blur\", \"Blur\"],\n [\"mousedown\", \"Mouse Down\"],\n [\"mouseenter\", \"Mouse Enter\"],\n [\"mouseleave\", \"Mouse Exit\"],\n [\"mouseup\", \"Mouse Up\"],\n ],\n event => event.target.checked\n );\n }\n\n this._setBackgroundColor(element);\n this._setDefaultPropertiesFromJS(element);\n\n this.container.append(element);\n return this.container;\n }\n}\n\nclass PushButtonWidgetAnnotationElement extends LinkAnnotationElement {\n constructor(parameters) {\n super(parameters, { ignoreBorder: parameters.data.hasAppearance });\n }\n\n render() {\n // The rendering and functionality of a push button widget annotation is\n // equal to that of a link annotation, but may have more functionality, such\n // as performing actions on form fields (resetting, submitting, et cetera).\n const container = super.render();\n container.classList.add(\"buttonWidgetAnnotation\", \"pushButton\");\n\n if (this.data.alternativeText) {\n container.title = this.data.alternativeText;\n }\n\n const linkElement = container.lastChild;\n if (this.enableScripting && this.hasJSActions && linkElement) {\n this._setDefaultPropertiesFromJS(linkElement);\n\n linkElement.addEventListener(\"updatefromsandbox\", jsEvent => {\n this._dispatchEventFromSandbox({}, jsEvent);\n });\n }\n\n return container;\n }\n}\n\nclass ChoiceWidgetAnnotationElement extends WidgetAnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: parameters.renderForms });\n }\n\n render() {\n this.container.classList.add(\"choiceWidgetAnnotation\");\n const storage = this.annotationStorage;\n const id = this.data.id;\n\n const storedData = storage.getValue(id, {\n value: this.data.fieldValue,\n });\n\n const selectElement = document.createElement(\"select\");\n GetElementsByNameSet.add(selectElement);\n selectElement.setAttribute(\"data-element-id\", id);\n\n selectElement.disabled = this.data.readOnly;\n this._setRequired(selectElement, this.data.required);\n selectElement.name = this.data.fieldName;\n selectElement.tabIndex = DEFAULT_TAB_INDEX;\n\n let addAnEmptyEntry = this.data.combo && this.data.options.length > 0;\n\n if (!this.data.combo) {\n // List boxes have a size and (optionally) multiple selection.\n selectElement.size = this.data.options.length;\n if (this.data.multiSelect) {\n selectElement.multiple = true;\n }\n }\n\n selectElement.addEventListener(\"resetform\", event => {\n const defaultValue = this.data.defaultFieldValue;\n for (const option of selectElement.options) {\n option.selected = option.value === defaultValue;\n }\n });\n\n // Insert the options into the choice field.\n for (const option of this.data.options) {\n const optionElement = document.createElement(\"option\");\n optionElement.textContent = option.displayValue;\n optionElement.value = option.exportValue;\n if (storedData.value.includes(option.exportValue)) {\n optionElement.setAttribute(\"selected\", true);\n addAnEmptyEntry = false;\n }\n selectElement.append(optionElement);\n }\n\n let removeEmptyEntry = null;\n if (addAnEmptyEntry) {\n const noneOptionElement = document.createElement(\"option\");\n noneOptionElement.value = \" \";\n noneOptionElement.setAttribute(\"hidden\", true);\n noneOptionElement.setAttribute(\"selected\", true);\n selectElement.prepend(noneOptionElement);\n\n removeEmptyEntry = () => {\n noneOptionElement.remove();\n selectElement.removeEventListener(\"input\", removeEmptyEntry);\n removeEmptyEntry = null;\n };\n selectElement.addEventListener(\"input\", removeEmptyEntry);\n }\n\n const getValue = isExport => {\n const name = isExport ? \"value\" : \"textContent\";\n const { options, multiple } = selectElement;\n if (!multiple) {\n return options.selectedIndex === -1\n ? null\n : options[options.selectedIndex][name];\n }\n return Array.prototype.filter\n .call(options, option => option.selected)\n .map(option => option[name]);\n };\n\n let selectedValues = getValue(/* isExport */ false);\n\n const getItems = event => {\n const options = event.target.options;\n return Array.prototype.map.call(options, option => {\n return { displayValue: option.textContent, exportValue: option.value };\n });\n };\n\n if (this.enableScripting && this.hasJSActions) {\n selectElement.addEventListener(\"updatefromsandbox\", jsEvent => {\n const actions = {\n value(event) {\n removeEmptyEntry?.();\n const value = event.detail.value;\n const values = new Set(Array.isArray(value) ? value : [value]);\n for (const option of selectElement.options) {\n option.selected = values.has(option.value);\n }\n storage.setValue(id, {\n value: getValue(/* isExport */ true),\n });\n selectedValues = getValue(/* isExport */ false);\n },\n multipleSelection(event) {\n selectElement.multiple = true;\n },\n remove(event) {\n const options = selectElement.options;\n const index = event.detail.remove;\n options[index].selected = false;\n selectElement.remove(index);\n if (options.length > 0) {\n const i = Array.prototype.findIndex.call(\n options,\n option => option.selected\n );\n if (i === -1) {\n options[0].selected = true;\n }\n }\n storage.setValue(id, {\n value: getValue(/* isExport */ true),\n items: getItems(event),\n });\n selectedValues = getValue(/* isExport */ false);\n },\n clear(event) {\n while (selectElement.length !== 0) {\n selectElement.remove(0);\n }\n storage.setValue(id, { value: null, items: [] });\n selectedValues = getValue(/* isExport */ false);\n },\n insert(event) {\n const { index, displayValue, exportValue } = event.detail.insert;\n const selectChild = selectElement.children[index];\n const optionElement = document.createElement(\"option\");\n optionElement.textContent = displayValue;\n optionElement.value = exportValue;\n\n if (selectChild) {\n selectChild.before(optionElement);\n } else {\n selectElement.append(optionElement);\n }\n storage.setValue(id, {\n value: getValue(/* isExport */ true),\n items: getItems(event),\n });\n selectedValues = getValue(/* isExport */ false);\n },\n items(event) {\n const { items } = event.detail;\n while (selectElement.length !== 0) {\n selectElement.remove(0);\n }\n for (const item of items) {\n const { displayValue, exportValue } = item;\n const optionElement = document.createElement(\"option\");\n optionElement.textContent = displayValue;\n optionElement.value = exportValue;\n selectElement.append(optionElement);\n }\n if (selectElement.options.length > 0) {\n selectElement.options[0].selected = true;\n }\n storage.setValue(id, {\n value: getValue(/* isExport */ true),\n items: getItems(event),\n });\n selectedValues = getValue(/* isExport */ false);\n },\n indices(event) {\n const indices = new Set(event.detail.indices);\n for (const option of event.target.options) {\n option.selected = indices.has(option.index);\n }\n storage.setValue(id, {\n value: getValue(/* isExport */ true),\n });\n selectedValues = getValue(/* isExport */ false);\n },\n editable(event) {\n event.target.disabled = !event.detail.editable;\n },\n };\n this._dispatchEventFromSandbox(actions, jsEvent);\n });\n\n selectElement.addEventListener(\"input\", event => {\n const exportValue = getValue(/* isExport */ true);\n storage.setValue(id, { value: exportValue });\n\n event.preventDefault();\n\n this.linkService.eventBus?.dispatch(\"dispatcheventinsandbox\", {\n source: this,\n detail: {\n id,\n name: \"Keystroke\",\n value: selectedValues,\n changeEx: exportValue,\n willCommit: false,\n commitKey: 1,\n keyDown: false,\n },\n });\n });\n\n this._setEventListeners(\n selectElement,\n null,\n [\n [\"focus\", \"Focus\"],\n [\"blur\", \"Blur\"],\n [\"mousedown\", \"Mouse Down\"],\n [\"mouseenter\", \"Mouse Enter\"],\n [\"mouseleave\", \"Mouse Exit\"],\n [\"mouseup\", \"Mouse Up\"],\n [\"input\", \"Action\"],\n [\"input\", \"Validate\"],\n ],\n event => event.target.value\n );\n } else {\n selectElement.addEventListener(\"input\", function (event) {\n storage.setValue(id, { value: getValue(/* isExport */ true) });\n });\n }\n\n if (this.data.combo) {\n this._setTextStyle(selectElement);\n } else {\n // Just use the default font size...\n // it's a bit hard to guess what is a good size.\n }\n this._setBackgroundColor(selectElement);\n this._setDefaultPropertiesFromJS(selectElement);\n\n this.container.append(selectElement);\n return this.container;\n }\n}\n\nclass PopupAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n const { data, elements } = parameters;\n super(parameters, { isRenderable: AnnotationElement._hasPopupData(data) });\n this.elements = elements;\n }\n\n render() {\n this.container.classList.add(\"popupAnnotation\");\n\n const popup = new PopupElement({\n container: this.container,\n color: this.data.color,\n titleObj: this.data.titleObj,\n modificationDate: this.data.modificationDate,\n contentsObj: this.data.contentsObj,\n richText: this.data.richText,\n rect: this.data.rect,\n parentRect: this.data.parentRect || null,\n parent: this.parent,\n elements: this.elements,\n open: this.data.open,\n });\n\n const elementIds = [];\n for (const element of this.elements) {\n element.popup = popup;\n elementIds.push(element.data.id);\n element.addHighlightArea();\n }\n\n this.container.setAttribute(\n \"aria-controls\",\n elementIds.map(id => `${AnnotationPrefix}${id}`).join(\",\")\n );\n\n return this.container;\n }\n}\n\nclass PopupElement {\n #dateTimePromise = null;\n\n #boundKeyDown = this.#keyDown.bind(this);\n\n #boundHide = this.#hide.bind(this);\n\n #boundShow = this.#show.bind(this);\n\n #boundToggle = this.#toggle.bind(this);\n\n #color = null;\n\n #container = null;\n\n #contentsObj = null;\n\n #elements = null;\n\n #parent = null;\n\n #parentRect = null;\n\n #pinned = false;\n\n #popup = null;\n\n #rect = null;\n\n #richText = null;\n\n #titleObj = null;\n\n #wasVisible = false;\n\n constructor({\n container,\n color,\n elements,\n titleObj,\n modificationDate,\n contentsObj,\n richText,\n parent,\n rect,\n parentRect,\n open,\n }) {\n this.#container = container;\n this.#titleObj = titleObj;\n this.#contentsObj = contentsObj;\n this.#richText = richText;\n this.#parent = parent;\n this.#color = color;\n this.#rect = rect;\n this.#parentRect = parentRect;\n this.#elements = elements;\n\n const dateObject = PDFDateString.toDateObject(modificationDate);\n if (dateObject) {\n // The modification date is shown in the popup instead of the creation\n // date if it is available and can be parsed correctly, which is\n // consistent with other viewers such as Adobe Acrobat.\n this.#dateTimePromise = parent.l10n.get(\"annotation_date_string\", {\n date: dateObject.toLocaleDateString(),\n time: dateObject.toLocaleTimeString(),\n });\n }\n\n this.trigger = elements.flatMap(e => e.getElementsToTriggerPopup());\n // Attach the event listeners to the trigger element.\n for (const element of this.trigger) {\n element.addEventListener(\"click\", this.#boundToggle);\n element.addEventListener(\"mouseenter\", this.#boundShow);\n element.addEventListener(\"mouseleave\", this.#boundHide);\n element.classList.add(\"popupTriggerArea\");\n }\n\n // Attach the event listener to toggle the popup with the keyboard.\n for (const element of elements) {\n element.container?.addEventListener(\"keydown\", this.#boundKeyDown);\n }\n\n this.#container.hidden = true;\n if (open) {\n this.#toggle();\n }\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n // Since the popup is lazily created, we need to ensure that it'll be\n // created and displayed during reference tests.\n this.#parent.popupShow.push(async () => {\n if (this.#container.hidden) {\n this.#show();\n }\n if (this.#dateTimePromise) {\n await this.#dateTimePromise;\n }\n });\n }\n }\n\n render() {\n if (this.#popup) {\n return;\n }\n\n const {\n page: { view },\n viewport: {\n rawDims: { pageWidth, pageHeight, pageX, pageY },\n },\n } = this.#parent;\n const popup = (this.#popup = document.createElement(\"div\"));\n popup.className = \"popup\";\n\n if (this.#color) {\n const baseColor = (popup.style.outlineColor = Util.makeHexColor(\n ...this.#color\n ));\n if (\n (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) ||\n CSS.supports(\"background-color\", \"color-mix(in srgb, red 30%, white)\")\n ) {\n popup.style.backgroundColor = `color-mix(in srgb, ${baseColor} 30%, white)`;\n } else {\n // color-mix isn't supported in some browsers hence this version.\n // See https://developer.mozilla.org/en-US/docs/Web/CSS/color_value/color-mix#browser_compatibility\n // TODO: Use color-mix when it's supported everywhere.\n // Enlighten the color.\n const BACKGROUND_ENLIGHT = 0.7;\n popup.style.backgroundColor = Util.makeHexColor(\n ...this.#color.map(c =>\n Math.floor(BACKGROUND_ENLIGHT * (255 - c) + c)\n )\n );\n }\n }\n\n const header = document.createElement(\"span\");\n header.className = \"header\";\n const title = document.createElement(\"h1\");\n header.append(title);\n ({ dir: title.dir, str: title.textContent } = this.#titleObj);\n popup.append(header);\n\n if (this.#dateTimePromise) {\n const modificationDate = document.createElement(\"span\");\n modificationDate.classList.add(\"popupDate\");\n this.#dateTimePromise.then(localized => {\n modificationDate.textContent = localized;\n });\n header.append(modificationDate);\n }\n\n const contentsObj = this.#contentsObj;\n const richText = this.#richText;\n if (\n richText?.str &&\n (!contentsObj?.str || contentsObj.str === richText.str)\n ) {\n XfaLayer.render({\n xfaHtml: richText.html,\n intent: \"richText\",\n div: popup,\n });\n popup.lastChild.classList.add(\"richText\", \"popupContent\");\n } else {\n const contents = this._formatContents(contentsObj);\n popup.append(contents);\n }\n\n let useParentRect = !!this.#parentRect;\n let rect = useParentRect ? this.#parentRect : this.#rect;\n for (const element of this.#elements) {\n if (!rect || Util.intersect(element.data.rect, rect) !== null) {\n rect = element.data.rect;\n useParentRect = true;\n break;\n }\n }\n\n const normalizedRect = Util.normalizeRect([\n rect[0],\n view[3] - rect[1] + view[1],\n rect[2],\n view[3] - rect[3] + view[1],\n ]);\n\n const HORIZONTAL_SPACE_AFTER_ANNOTATION = 5;\n const parentWidth = useParentRect\n ? rect[2] - rect[0] + HORIZONTAL_SPACE_AFTER_ANNOTATION\n : 0;\n const popupLeft = normalizedRect[0] + parentWidth;\n const popupTop = normalizedRect[1];\n\n const { style } = this.#container;\n style.left = `${(100 * (popupLeft - pageX)) / pageWidth}%`;\n style.top = `${(100 * (popupTop - pageY)) / pageHeight}%`;\n\n this.#container.append(popup);\n }\n\n /**\n * Format the contents of the popup by adding newlines where necessary.\n *\n * @private\n * @param {Object<string, string>} contentsObj\n * @memberof PopupElement\n * @returns {HTMLParagraphElement}\n */\n _formatContents({ str, dir }) {\n const p = document.createElement(\"p\");\n p.classList.add(\"popupContent\");\n p.dir = dir;\n const lines = str.split(/(?:\\r\\n?|\\n)/);\n for (let i = 0, ii = lines.length; i < ii; ++i) {\n const line = lines[i];\n p.append(document.createTextNode(line));\n if (i < ii - 1) {\n p.append(document.createElement(\"br\"));\n }\n }\n return p;\n }\n\n #keyDown(event) {\n if (event.altKey || event.shiftKey || event.ctrlKey || event.metaKey) {\n return;\n }\n\n if (event.key === \"Enter\" || (event.key === \"Escape\" && this.#pinned)) {\n this.#toggle();\n }\n }\n\n /**\n * Toggle the visibility of the popup.\n */\n #toggle() {\n this.#pinned = !this.#pinned;\n if (this.#pinned) {\n this.#show();\n this.#container.addEventListener(\"click\", this.#boundToggle);\n this.#container.addEventListener(\"keydown\", this.#boundKeyDown);\n } else {\n this.#hide();\n this.#container.removeEventListener(\"click\", this.#boundToggle);\n this.#container.removeEventListener(\"keydown\", this.#boundKeyDown);\n }\n }\n\n /**\n * Show the popup.\n */\n #show() {\n if (!this.#popup) {\n this.render();\n }\n if (!this.isVisible) {\n this.#container.hidden = false;\n this.#container.style.zIndex =\n parseInt(this.#container.style.zIndex) + 1000;\n } else if (this.#pinned) {\n this.#container.classList.add(\"focused\");\n }\n }\n\n /**\n * Hide the popup.\n */\n #hide() {\n this.#container.classList.remove(\"focused\");\n if (this.#pinned || !this.isVisible) {\n return;\n }\n this.#container.hidden = true;\n this.#container.style.zIndex =\n parseInt(this.#container.style.zIndex) - 1000;\n }\n\n forceHide() {\n this.#wasVisible = this.isVisible;\n if (!this.#wasVisible) {\n return;\n }\n this.#container.hidden = true;\n }\n\n maybeShow() {\n if (!this.#wasVisible) {\n return;\n }\n this.#wasVisible = false;\n this.#container.hidden = false;\n }\n\n get isVisible() {\n return this.#container.hidden === false;\n }\n}\n\nclass FreeTextAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n this.textContent = parameters.data.textContent;\n this.textPosition = parameters.data.textPosition;\n this.annotationEditorType = AnnotationEditorType.FREETEXT;\n }\n\n render() {\n this.container.classList.add(\"freeTextAnnotation\");\n\n if (this.textContent) {\n const content = document.createElement(\"div\");\n content.classList.add(\"annotationTextContent\");\n content.setAttribute(\"role\", \"comment\");\n for (const line of this.textContent) {\n const lineSpan = document.createElement(\"span\");\n lineSpan.textContent = line;\n content.append(lineSpan);\n }\n this.container.append(content);\n }\n\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this._editOnDoubleClick();\n\n return this.container;\n }\n}\n\nclass LineAnnotationElement extends AnnotationElement {\n #line = null;\n\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n }\n\n render() {\n this.container.classList.add(\"lineAnnotation\");\n\n // Create an invisible line with the same starting and ending coordinates\n // that acts as the trigger for the popup. Only the line itself should\n // trigger the popup, not the entire container.\n const data = this.data;\n const { width, height } = getRectDims(data.rect);\n const svg = this.svgFactory.create(\n width,\n height,\n /* skipDimensions = */ true\n );\n\n // PDF coordinates are calculated from a bottom left origin, so transform\n // the line coordinates to a top left origin for the SVG element.\n const line = (this.#line = this.svgFactory.createElement(\"svg:line\"));\n line.setAttribute(\"x1\", data.rect[2] - data.lineCoordinates[0]);\n line.setAttribute(\"y1\", data.rect[3] - data.lineCoordinates[1]);\n line.setAttribute(\"x2\", data.rect[2] - data.lineCoordinates[2]);\n line.setAttribute(\"y2\", data.rect[3] - data.lineCoordinates[3]);\n // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n // won't be possible to open/close the popup (note e.g. issue 11122).\n line.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n line.setAttribute(\"stroke\", \"transparent\");\n line.setAttribute(\"fill\", \"transparent\");\n\n svg.append(line);\n this.container.append(svg);\n\n // Create the popup ourselves so that we can bind it to the line instead\n // of to the entire container (which is the default).\n if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n return this.container;\n }\n\n getElementsToTriggerPopup() {\n return this.#line;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n}\n\nclass SquareAnnotationElement extends AnnotationElement {\n #square = null;\n\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n }\n\n render() {\n this.container.classList.add(\"squareAnnotation\");\n\n // Create an invisible square with the same rectangle that acts as the\n // trigger for the popup. Only the square itself should trigger the\n // popup, not the entire container.\n const data = this.data;\n const { width, height } = getRectDims(data.rect);\n const svg = this.svgFactory.create(\n width,\n height,\n /* skipDimensions = */ true\n );\n\n // The browser draws half of the borders inside the square and half of\n // the borders outside the square by default. This behavior cannot be\n // changed programmatically, so correct for that here.\n const borderWidth = data.borderStyle.width;\n const square = (this.#square = this.svgFactory.createElement(\"svg:rect\"));\n square.setAttribute(\"x\", borderWidth / 2);\n square.setAttribute(\"y\", borderWidth / 2);\n square.setAttribute(\"width\", width - borderWidth);\n square.setAttribute(\"height\", height - borderWidth);\n // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n // won't be possible to open/close the popup (note e.g. issue 11122).\n square.setAttribute(\"stroke-width\", borderWidth || 1);\n square.setAttribute(\"stroke\", \"transparent\");\n square.setAttribute(\"fill\", \"transparent\");\n\n svg.append(square);\n this.container.append(svg);\n\n // Create the popup ourselves so that we can bind it to the square instead\n // of to the entire container (which is the default).\n if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n return this.container;\n }\n\n getElementsToTriggerPopup() {\n return this.#square;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n}\n\nclass CircleAnnotationElement extends AnnotationElement {\n #circle = null;\n\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n }\n\n render() {\n this.container.classList.add(\"circleAnnotation\");\n\n // Create an invisible circle with the same ellipse that acts as the\n // trigger for the popup. Only the circle itself should trigger the\n // popup, not the entire container.\n const data = this.data;\n const { width, height } = getRectDims(data.rect);\n const svg = this.svgFactory.create(\n width,\n height,\n /* skipDimensions = */ true\n );\n\n // The browser draws half of the borders inside the circle and half of\n // the borders outside the circle by default. This behavior cannot be\n // changed programmatically, so correct for that here.\n const borderWidth = data.borderStyle.width;\n const circle = (this.#circle =\n this.svgFactory.createElement(\"svg:ellipse\"));\n circle.setAttribute(\"cx\", width / 2);\n circle.setAttribute(\"cy\", height / 2);\n circle.setAttribute(\"rx\", width / 2 - borderWidth / 2);\n circle.setAttribute(\"ry\", height / 2 - borderWidth / 2);\n // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n // won't be possible to open/close the popup (note e.g. issue 11122).\n circle.setAttribute(\"stroke-width\", borderWidth || 1);\n circle.setAttribute(\"stroke\", \"transparent\");\n circle.setAttribute(\"fill\", \"transparent\");\n\n svg.append(circle);\n this.container.append(svg);\n\n // Create the popup ourselves so that we can bind it to the circle instead\n // of to the entire container (which is the default).\n if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n return this.container;\n }\n\n getElementsToTriggerPopup() {\n return this.#circle;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n}\n\nclass PolylineAnnotationElement extends AnnotationElement {\n #polyline = null;\n\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n\n this.containerClassName = \"polylineAnnotation\";\n this.svgElementName = \"svg:polyline\";\n }\n\n render() {\n this.container.classList.add(this.containerClassName);\n\n // Create an invisible polyline with the same points that acts as the\n // trigger for the popup. Only the polyline itself should trigger the\n // popup, not the entire container.\n const data = this.data;\n const { width, height } = getRectDims(data.rect);\n const svg = this.svgFactory.create(\n width,\n height,\n /* skipDimensions = */ true\n );\n\n // Convert the vertices array to a single points string that the SVG\n // polyline element expects (\"x1,y1 x2,y2 ...\"). PDF coordinates are\n // calculated from a bottom left origin, so transform the polyline\n // coordinates to a top left origin for the SVG element.\n let points = [];\n for (const coordinate of data.vertices) {\n const x = coordinate.x - data.rect[0];\n const y = data.rect[3] - coordinate.y;\n points.push(x + \",\" + y);\n }\n points = points.join(\" \");\n\n const polyline = (this.#polyline = this.svgFactory.createElement(\n this.svgElementName\n ));\n polyline.setAttribute(\"points\", points);\n // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n // won't be possible to open/close the popup (note e.g. issue 11122).\n polyline.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n polyline.setAttribute(\"stroke\", \"transparent\");\n polyline.setAttribute(\"fill\", \"transparent\");\n\n svg.append(polyline);\n this.container.append(svg);\n\n // Create the popup ourselves so that we can bind it to the polyline\n // instead of to the entire container (which is the default).\n if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n return this.container;\n }\n\n getElementsToTriggerPopup() {\n return this.#polyline;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n}\n\nclass PolygonAnnotationElement extends PolylineAnnotationElement {\n constructor(parameters) {\n // Polygons are specific forms of polylines, so reuse their logic.\n super(parameters);\n\n this.containerClassName = \"polygonAnnotation\";\n this.svgElementName = \"svg:polygon\";\n }\n}\n\nclass CaretAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n }\n\n render() {\n this.container.classList.add(\"caretAnnotation\");\n\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n return this.container;\n }\n}\n\nclass InkAnnotationElement extends AnnotationElement {\n #polylines = [];\n\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n\n this.containerClassName = \"inkAnnotation\";\n\n // Use the polyline SVG element since it allows us to use coordinates\n // directly and to draw both straight lines and curves.\n this.svgElementName = \"svg:polyline\";\n this.annotationEditorType = AnnotationEditorType.INK;\n }\n\n render() {\n this.container.classList.add(this.containerClassName);\n\n // Create an invisible polyline with the same points that acts as the\n // trigger for the popup.\n const data = this.data;\n const { width, height } = getRectDims(data.rect);\n const svg = this.svgFactory.create(\n width,\n height,\n /* skipDimensions = */ true\n );\n\n for (const inkList of data.inkLists) {\n // Convert the ink list to a single points string that the SVG\n // polyline element expects (\"x1,y1 x2,y2 ...\"). PDF coordinates are\n // calculated from a bottom left origin, so transform the polyline\n // coordinates to a top left origin for the SVG element.\n let points = [];\n for (const coordinate of inkList) {\n const x = coordinate.x - data.rect[0];\n const y = data.rect[3] - coordinate.y;\n points.push(`${x},${y}`);\n }\n points = points.join(\" \");\n\n const polyline = this.svgFactory.createElement(this.svgElementName);\n this.#polylines.push(polyline);\n polyline.setAttribute(\"points\", points);\n // Ensure that the 'stroke-width' is always non-zero, since otherwise it\n // won't be possible to open/close the popup (note e.g. issue 11122).\n polyline.setAttribute(\"stroke-width\", data.borderStyle.width || 1);\n polyline.setAttribute(\"stroke\", \"transparent\");\n polyline.setAttribute(\"fill\", \"transparent\");\n\n // Create the popup ourselves so that we can bind it to the polyline\n // instead of to the entire container (which is the default).\n if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n svg.append(polyline);\n }\n\n this.container.append(svg);\n return this.container;\n }\n\n getElementsToTriggerPopup() {\n return this.#polylines;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n}\n\nclass HighlightAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.classList.add(\"highlightAnnotation\");\n return this.container;\n }\n}\n\nclass UnderlineAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.classList.add(\"underlineAnnotation\");\n return this.container;\n }\n}\n\nclass SquigglyAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.classList.add(\"squigglyAnnotation\");\n return this.container;\n }\n}\n\nclass StrikeOutAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, {\n isRenderable: true,\n ignoreBorder: true,\n createQuadrilaterals: true,\n });\n }\n\n render() {\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n\n this.container.classList.add(\"strikeoutAnnotation\");\n return this.container;\n }\n}\n\nclass StampAnnotationElement extends AnnotationElement {\n constructor(parameters) {\n super(parameters, { isRenderable: true, ignoreBorder: true });\n }\n\n render() {\n this.container.classList.add(\"stampAnnotation\");\n\n if (!this.data.popupRef && this.hasPopupData) {\n this._createPopup();\n }\n return this.container;\n }\n}\n\nclass FileAttachmentAnnotationElement extends AnnotationElement {\n #trigger = null;\n\n constructor(parameters) {\n super(parameters, { isRenderable: true });\n\n const { filename, content } = this.data.file;\n this.filename = getFilenameFromUrl(filename, /* onlyStripPath = */ true);\n this.content = content;\n\n this.linkService.eventBus?.dispatch(\"fileattachmentannotation\", {\n source: this,\n filename,\n content,\n });\n }\n\n render() {\n this.container.classList.add(\"fileAttachmentAnnotation\");\n\n const { container, data } = this;\n let trigger;\n if (data.hasAppearance || data.fillAlpha === 0) {\n trigger = document.createElement(\"div\");\n } else {\n // Unfortunately it seems that it's not clearly specified exactly what\n // names are actually valid, since Table 184 contains:\n // Conforming readers shall provide predefined icon appearances for at\n // least the following standard names: GraphPushPin, PaperclipTag.\n // Additional names may be supported as well. Default value: PushPin.\n trigger = document.createElement(\"img\");\n trigger.src = `${this.imageResourcesPath}annotation-${\n /paperclip/i.test(data.name) ? \"paperclip\" : \"pushpin\"\n }.svg`;\n\n if (data.fillAlpha && data.fillAlpha < 1) {\n trigger.style = `filter: opacity(${Math.round(\n data.fillAlpha * 100\n )}%);`;\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n this.container.classList.add(\"hasFillAlpha\");\n }\n }\n }\n trigger.addEventListener(\"dblclick\", this.#download.bind(this));\n this.#trigger = trigger;\n\n const { isMac } = FeatureTest.platform;\n container.addEventListener(\"keydown\", evt => {\n if (evt.key === \"Enter\" && (isMac ? evt.metaKey : evt.ctrlKey)) {\n this.#download();\n }\n });\n\n if (!data.popupRef && this.hasPopupData) {\n this._createPopup();\n } else {\n trigger.classList.add(\"popupTriggerArea\");\n }\n\n container.append(trigger);\n return container;\n }\n\n getElementsToTriggerPopup() {\n return this.#trigger;\n }\n\n addHighlightArea() {\n this.container.classList.add(\"highlightArea\");\n }\n\n /**\n * Download the file attachment associated with this annotation.\n */\n #download() {\n this.downloadManager?.openOrDownloadData(\n this.container,\n this.content,\n this.filename\n );\n }\n}\n\n/**\n * @typedef {Object} AnnotationLayerParameters\n * @property {PageViewport} viewport\n * @property {HTMLDivElement} div\n * @property {Array} annotations\n * @property {PDFPageProxy} page\n * @property {IPDFLinkService} linkService\n * @property {IDownloadManager} downloadManager\n * @property {AnnotationStorage} [annotationStorage]\n * @property {string} [imageResourcesPath] - Path for image resources, mainly\n * for annotation icons. Include trailing slash.\n * @property {boolean} renderForms\n * @property {boolean} [enableScripting] - Enable embedded script execution.\n * @property {boolean} [hasJSActions] - Some fields have JS actions.\n * The default value is `false`.\n * @property {Object<string, Array<Object>> | null} [fieldObjects]\n * @property {Map<string, HTMLCanvasElement>} [annotationCanvasMap]\n * @property {TextAccessibilityManager} [accessibilityManager]\n */\n\n/**\n * Manage the layer containing all the annotations.\n */\nclass AnnotationLayer {\n #accessibilityManager = null;\n\n #annotationCanvasMap = null;\n\n #editableAnnotations = new Map();\n\n constructor({\n div,\n accessibilityManager,\n annotationCanvasMap,\n l10n,\n page,\n viewport,\n }) {\n this.div = div;\n this.#accessibilityManager = accessibilityManager;\n this.#annotationCanvasMap = annotationCanvasMap;\n this.l10n = l10n;\n this.page = page;\n this.viewport = viewport;\n this.zIndex = 0;\n\n if (\n typeof PDFJSDev !== \"undefined\" &&\n PDFJSDev.test(\"GENERIC && !TESTING\")\n ) {\n this.l10n ||= NullL10n;\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n // For testing purposes.\n Object.defineProperty(this, \"showPopups\", {\n value: async () => {\n for (const show of this.popupShow) {\n await show();\n }\n },\n });\n this.popupShow = [];\n }\n }\n\n #appendElement(element, id) {\n const contentElement = element.firstChild || element;\n contentElement.id = `${AnnotationPrefix}${id}`;\n\n this.div.append(element);\n this.#accessibilityManager?.moveElementInDOM(\n this.div,\n element,\n contentElement,\n /* isRemovable = */ false\n );\n }\n\n /**\n * Render a new annotation layer with all annotation elements.\n *\n * @param {AnnotationLayerParameters} params\n * @memberof AnnotationLayer\n */\n async render(params) {\n const { annotations } = params;\n const layer = this.div;\n setLayerDimensions(layer, this.viewport);\n\n const popupToElements = new Map();\n const elementParams = {\n data: null,\n layer,\n linkService: params.linkService,\n downloadManager: params.downloadManager,\n imageResourcesPath: params.imageResourcesPath || \"\",\n renderForms: params.renderForms !== false,\n svgFactory: new DOMSVGFactory(),\n annotationStorage: params.annotationStorage || new AnnotationStorage(),\n enableScripting: params.enableScripting === true,\n hasJSActions: params.hasJSActions,\n fieldObjects: params.fieldObjects,\n parent: this,\n elements: null,\n };\n\n for (const data of annotations) {\n if (data.noHTML) {\n continue;\n }\n const isPopupAnnotation = data.annotationType === AnnotationType.POPUP;\n if (!isPopupAnnotation) {\n const { width, height } = getRectDims(data.rect);\n if (width <= 0 || height <= 0) {\n continue; // Ignore empty annotations.\n }\n } else {\n const elements = popupToElements.get(data.id);\n if (!elements) {\n // Ignore popup annotations without a corresponding annotation.\n continue;\n }\n elementParams.elements = elements;\n }\n elementParams.data = data;\n const element = AnnotationElementFactory.create(elementParams);\n\n if (!element.isRenderable) {\n continue;\n }\n\n if (!isPopupAnnotation && data.popupRef) {\n const elements = popupToElements.get(data.popupRef);\n if (!elements) {\n popupToElements.set(data.popupRef, [element]);\n } else {\n elements.push(element);\n }\n }\n\n if (element.annotationEditorType > 0) {\n this.#editableAnnotations.set(element.data.id, element);\n }\n\n const rendered = element.render();\n if (data.hidden) {\n rendered.style.visibility = \"hidden\";\n }\n this.#appendElement(rendered, data.id);\n }\n\n this.#setAnnotationCanvasMap();\n\n await this.l10n.translate(layer);\n }\n\n /**\n * Update the annotation elements on existing annotation layer.\n *\n * @param {AnnotationLayerParameters} viewport\n * @memberof AnnotationLayer\n */\n update({ viewport }) {\n const layer = this.div;\n this.viewport = viewport;\n setLayerDimensions(layer, { rotation: viewport.rotation });\n\n this.#setAnnotationCanvasMap();\n layer.hidden = false;\n }\n\n #setAnnotationCanvasMap() {\n if (!this.#annotationCanvasMap) {\n return;\n }\n const layer = this.div;\n for (const [id, canvas] of this.#annotationCanvasMap) {\n const element = layer.querySelector(`[data-annotation-id=\"${id}\"]`);\n if (!element) {\n continue;\n }\n\n const { firstChild } = element;\n if (!firstChild) {\n element.append(canvas);\n } else if (firstChild.nodeName === \"CANVAS\") {\n firstChild.replaceWith(canvas);\n } else {\n firstChild.before(canvas);\n }\n }\n this.#annotationCanvasMap.clear();\n }\n\n getEditableAnnotations() {\n return Array.from(this.#editableAnnotations.values());\n }\n\n getEditableAnnotation(id) {\n return this.#editableAnnotations.get(id);\n }\n}\n\nexport {\n AnnotationLayer,\n FreeTextAnnotationElement,\n InkAnnotationElement,\n StampAnnotationElement,\n};\n","/* Copyright 2020 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * PLEASE NOTE: This file is currently imported in both the `../display/` and\n * `../scripting_api/` folders, hence be EXTREMELY careful about\n * introducing any dependencies here since that can lead to an\n * unexpected/unnecessary size increase of the *built* files.\n */\n\nfunction makeColorComp(n) {\n return Math.floor(Math.max(0, Math.min(1, n)) * 255)\n .toString(16)\n .padStart(2, \"0\");\n}\n\nfunction scaleAndClamp(x) {\n return Math.max(0, Math.min(255, 255 * x));\n}\n\n// PDF specifications section 10.3\nclass ColorConverters {\n static CMYK_G([c, y, m, k]) {\n return [\"G\", 1 - Math.min(1, 0.3 * c + 0.59 * m + 0.11 * y + k)];\n }\n\n static G_CMYK([g]) {\n return [\"CMYK\", 0, 0, 0, 1 - g];\n }\n\n static G_RGB([g]) {\n return [\"RGB\", g, g, g];\n }\n\n static G_rgb([g]) {\n g = scaleAndClamp(g);\n return [g, g, g];\n }\n\n static G_HTML([g]) {\n const G = makeColorComp(g);\n return `#${G}${G}${G}`;\n }\n\n static RGB_G([r, g, b]) {\n return [\"G\", 0.3 * r + 0.59 * g + 0.11 * b];\n }\n\n static RGB_rgb(color) {\n return color.map(scaleAndClamp);\n }\n\n static RGB_HTML(color) {\n return `#${color.map(makeColorComp).join(\"\")}`;\n }\n\n static T_HTML() {\n return \"#00000000\";\n }\n\n static T_rgb() {\n return [null];\n }\n\n static CMYK_RGB([c, y, m, k]) {\n return [\n \"RGB\",\n 1 - Math.min(1, c + k),\n 1 - Math.min(1, m + k),\n 1 - Math.min(1, y + k),\n ];\n }\n\n static CMYK_rgb([c, y, m, k]) {\n return [\n scaleAndClamp(1 - Math.min(1, c + k)),\n scaleAndClamp(1 - Math.min(1, m + k)),\n scaleAndClamp(1 - Math.min(1, y + k)),\n ];\n }\n\n static CMYK_HTML(components) {\n const rgb = this.CMYK_RGB(components).slice(1);\n return this.RGB_HTML(rgb);\n }\n\n static RGB_CMYK([r, g, b]) {\n const c = 1 - r;\n const m = 1 - g;\n const y = 1 - b;\n const k = Math.min(c, m, y);\n return [\"CMYK\", c, m, y, k];\n }\n}\n\nexport { ColorConverters };\n","/* Copyright 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 * PLEASE NOTE: This file is currently imported in both the `web/` and\n * `src/display/` folders, hence be EXTREMELY careful about\n * introducing any dependencies here since that can lead to an\n * unexpected/unnecessary size increase of the *built* files.\n */\n\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 annotation_date_string: \"{{date}}, {{time}}\",\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 editor_alt_text_button_label: \"Alt text\",\n editor_alt_text_edit_button_label: \"Edit alt text\",\n editor_alt_text_decorative_tooltip: \"Marked as decorative\",\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\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 { getL10nFallback, NullL10n };\n","/* Copyright 2021 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./annotation_storage\").AnnotationStorage} AnnotationStorage */\n/** @typedef {import(\"./display_utils\").PageViewport} PageViewport */\n/** @typedef {import(\"../../web/interfaces\").IPDFLinkService} IPDFLinkService */\n\nimport { XfaText } from \"./xfa_text.js\";\n\n/**\n * @typedef {Object} XfaLayerParameters\n * @property {PageViewport} viewport\n * @property {HTMLDivElement} div\n * @property {Object} xfaHtml\n * @property {AnnotationStorage} [annotationStorage]\n * @property {IPDFLinkService} linkService\n * @property {string} [intent] - (default value is 'display').\n */\n\nclass XfaLayer {\n static setupStorage(html, id, element, storage, intent) {\n const storedData = storage.getValue(id, { value: null });\n switch (element.name) {\n case \"textarea\":\n if (storedData.value !== null) {\n html.textContent = storedData.value;\n }\n if (intent === \"print\") {\n break;\n }\n html.addEventListener(\"input\", event => {\n storage.setValue(id, { value: event.target.value });\n });\n break;\n case \"input\":\n if (\n element.attributes.type === \"radio\" ||\n element.attributes.type === \"checkbox\"\n ) {\n if (storedData.value === element.attributes.xfaOn) {\n html.setAttribute(\"checked\", true);\n } else if (storedData.value === element.attributes.xfaOff) {\n // The checked attribute may have been set when opening the file,\n // unset through the UI and we're here because of printing.\n html.removeAttribute(\"checked\");\n }\n if (intent === \"print\") {\n break;\n }\n html.addEventListener(\"change\", event => {\n storage.setValue(id, {\n value: event.target.checked\n ? event.target.getAttribute(\"xfaOn\")\n : event.target.getAttribute(\"xfaOff\"),\n });\n });\n } else {\n if (storedData.value !== null) {\n html.setAttribute(\"value\", storedData.value);\n }\n if (intent === \"print\") {\n break;\n }\n html.addEventListener(\"input\", event => {\n storage.setValue(id, { value: event.target.value });\n });\n }\n break;\n case \"select\":\n if (storedData.value !== null) {\n html.setAttribute(\"value\", storedData.value);\n for (const option of element.children) {\n if (option.attributes.value === storedData.value) {\n option.attributes.selected = true;\n } else if (option.attributes.hasOwnProperty(\"selected\")) {\n delete option.attributes.selected;\n }\n }\n }\n html.addEventListener(\"input\", event => {\n const options = event.target.options;\n const value =\n options.selectedIndex === -1\n ? \"\"\n : options[options.selectedIndex].value;\n storage.setValue(id, { value });\n });\n break;\n }\n }\n\n static setAttributes({ html, element, storage = null, intent, linkService }) {\n const { attributes } = element;\n const isHTMLAnchorElement = html instanceof HTMLAnchorElement;\n\n if (attributes.type === \"radio\") {\n // Avoid to have a radio group when printing with the same as one\n // already displayed.\n attributes.name = `${attributes.name}-${intent}`;\n }\n for (const [key, value] of Object.entries(attributes)) {\n if (value === null || value === undefined) {\n continue;\n }\n\n switch (key) {\n case \"class\":\n if (value.length) {\n html.setAttribute(key, value.join(\" \"));\n }\n break;\n case \"dataId\":\n // We don't need to add dataId in the html object but it can\n // be useful to know its value when writing printing tests:\n // in this case, don't skip dataId to have its value.\n break;\n case \"id\":\n html.setAttribute(\"data-element-id\", value);\n break;\n case \"style\":\n Object.assign(html.style, value);\n break;\n case \"textContent\":\n html.textContent = value;\n break;\n default:\n if (!isHTMLAnchorElement || (key !== \"href\" && key !== \"newWindow\")) {\n html.setAttribute(key, value);\n }\n }\n }\n\n if (isHTMLAnchorElement) {\n linkService.addLinkAttributes(\n html,\n attributes.href,\n attributes.newWindow\n );\n }\n\n // Set the value after the others to be sure to overwrite any other values.\n if (storage && attributes.dataId) {\n this.setupStorage(html, attributes.dataId, element, storage);\n }\n }\n\n /**\n * Render the XFA layer.\n *\n * @param {XfaLayerParameters} parameters\n */\n static render(parameters) {\n const storage = parameters.annotationStorage;\n const linkService = parameters.linkService;\n const root = parameters.xfaHtml;\n const intent = parameters.intent || \"display\";\n const rootHtml = document.createElement(root.name);\n if (root.attributes) {\n this.setAttributes({\n html: rootHtml,\n element: root,\n intent,\n linkService,\n });\n }\n const stack = [[root, -1, rootHtml]];\n\n const rootDiv = parameters.div;\n rootDiv.append(rootHtml);\n\n if (parameters.viewport) {\n const transform = `matrix(${parameters.viewport.transform.join(\",\")})`;\n rootDiv.style.transform = transform;\n }\n\n // Set defaults.\n if (intent !== \"richText\") {\n rootDiv.setAttribute(\"class\", \"xfaLayer xfaFont\");\n }\n\n // Text nodes used for the text highlighter.\n const textDivs = [];\n\n while (stack.length > 0) {\n const [parent, i, html] = stack.at(-1);\n if (i + 1 === parent.children.length) {\n stack.pop();\n continue;\n }\n\n const child = parent.children[++stack.at(-1)[1]];\n if (child === null) {\n continue;\n }\n\n const { name } = child;\n if (name === \"#text\") {\n const node = document.createTextNode(child.value);\n textDivs.push(node);\n html.append(node);\n continue;\n }\n\n const childHtml = child?.attributes?.xmlns\n ? document.createElementNS(child.attributes.xmlns, name)\n : document.createElement(name);\n\n html.append(childHtml);\n if (child.attributes) {\n this.setAttributes({\n html: childHtml,\n element: child,\n storage,\n intent,\n linkService,\n });\n }\n\n if (child.children && child.children.length > 0) {\n stack.push([child, -1, childHtml]);\n } else if (child.value) {\n const node = document.createTextNode(child.value);\n if (XfaText.shouldBuildText(name)) {\n textDivs.push(node);\n }\n childHtml.append(node);\n }\n }\n\n /**\n * TODO: re-enable that stuff once we've JS implementation.\n * See https://bugzilla.mozilla.org/show_bug.cgi?id=1719465.\n *\n * for (const el of rootDiv.querySelectorAll(\n * \".xfaDisabled input, .xfaDisabled textarea\"\n * )) {\n * el.setAttribute(\"disabled\", true);\n * }\n * for (const el of rootDiv.querySelectorAll(\n * \".xfaReadOnly input, .xfaReadOnly textarea\"\n * )) {\n * el.setAttribute(\"readOnly\", true);\n * }\n */\n\n for (const el of rootDiv.querySelectorAll(\n \".xfaNonInteractive input, .xfaNonInteractive textarea\"\n )) {\n el.setAttribute(\"readOnly\", true);\n }\n\n return {\n textDivs,\n };\n }\n\n /**\n * Update the XFA layer.\n *\n * @param {XfaLayerParameters} parameters\n */\n static update(parameters) {\n const transform = `matrix(${parameters.viewport.transform.join(\",\")})`;\n parameters.div.style.transform = transform;\n parameters.div.hidden = false;\n }\n}\n\nexport { XfaLayer };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport {\n AnnotationEditorParamsType,\n AnnotationEditorType,\n Util,\n} from \"../../shared/util.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { InkAnnotationElement } from \"../annotation_layer.js\";\nimport { noContextMenu } from \"../display_utils.js\";\nimport { opacityToHex } from \"./tools.js\";\n\n/**\n * Basic draw editor in order to generate an Ink annotation.\n */\nclass InkEditor extends AnnotationEditor {\n #baseHeight = 0;\n\n #baseWidth = 0;\n\n #boundCanvasPointermove = this.canvasPointermove.bind(this);\n\n #boundCanvasPointerleave = this.canvasPointerleave.bind(this);\n\n #boundCanvasPointerup = this.canvasPointerup.bind(this);\n\n #boundCanvasPointerdown = this.canvasPointerdown.bind(this);\n\n #currentPath2D = new Path2D();\n\n #disableEditing = false;\n\n #hasSomethingToDraw = false;\n\n #isCanvasInitialized = false;\n\n #observer = null;\n\n #realWidth = 0;\n\n #realHeight = 0;\n\n #requestFrameCallback = null;\n\n static _defaultColor = null;\n\n static _defaultOpacity = 1;\n\n static _defaultThickness = 1;\n\n static _type = \"ink\";\n\n constructor(params) {\n super({ ...params, name: \"inkEditor\" });\n this.color = params.color || null;\n this.thickness = params.thickness || null;\n this.opacity = params.opacity || null;\n this.paths = [];\n this.bezierPath2D = [];\n this.allRawPaths = [];\n this.currentPath = [];\n this.scaleFactor = 1;\n this.translationX = this.translationY = 0;\n this.x = 0;\n this.y = 0;\n this._willKeepAspectRatio = true;\n }\n\n /** @inheritdoc */\n static initialize(l10n) {\n AnnotationEditor.initialize(l10n, {\n strings: [\"editor_ink_canvas_aria_label\", \"editor_ink2_aria_label\"],\n });\n }\n\n /** @inheritdoc */\n static updateDefaultParams(type, value) {\n switch (type) {\n case AnnotationEditorParamsType.INK_THICKNESS:\n InkEditor._defaultThickness = value;\n break;\n case AnnotationEditorParamsType.INK_COLOR:\n InkEditor._defaultColor = value;\n break;\n case AnnotationEditorParamsType.INK_OPACITY:\n InkEditor._defaultOpacity = value / 100;\n break;\n }\n }\n\n /** @inheritdoc */\n updateParams(type, value) {\n switch (type) {\n case AnnotationEditorParamsType.INK_THICKNESS:\n this.#updateThickness(value);\n break;\n case AnnotationEditorParamsType.INK_COLOR:\n this.#updateColor(value);\n break;\n case AnnotationEditorParamsType.INK_OPACITY:\n this.#updateOpacity(value);\n break;\n }\n }\n\n /** @inheritdoc */\n static get defaultPropertiesToUpdate() {\n return [\n [AnnotationEditorParamsType.INK_THICKNESS, InkEditor._defaultThickness],\n [\n AnnotationEditorParamsType.INK_COLOR,\n InkEditor._defaultColor || AnnotationEditor._defaultLineColor,\n ],\n [\n AnnotationEditorParamsType.INK_OPACITY,\n Math.round(InkEditor._defaultOpacity * 100),\n ],\n ];\n }\n\n /** @inheritdoc */\n get propertiesToUpdate() {\n return [\n [\n AnnotationEditorParamsType.INK_THICKNESS,\n this.thickness || InkEditor._defaultThickness,\n ],\n [\n AnnotationEditorParamsType.INK_COLOR,\n this.color ||\n InkEditor._defaultColor ||\n AnnotationEditor._defaultLineColor,\n ],\n [\n AnnotationEditorParamsType.INK_OPACITY,\n Math.round(100 * (this.opacity ?? InkEditor._defaultOpacity)),\n ],\n ];\n }\n\n /**\n * Update the thickness and make this action undoable.\n * @param {number} thickness\n */\n #updateThickness(thickness) {\n const savedThickness = this.thickness;\n this.addCommands({\n cmd: () => {\n this.thickness = thickness;\n this.#fitToContent();\n },\n undo: () => {\n this.thickness = savedThickness;\n this.#fitToContent();\n },\n mustExec: true,\n type: AnnotationEditorParamsType.INK_THICKNESS,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n }\n\n /**\n * Update the color and make this action undoable.\n * @param {string} color\n */\n #updateColor(color) {\n const savedColor = this.color;\n this.addCommands({\n cmd: () => {\n this.color = color;\n this.#redraw();\n },\n undo: () => {\n this.color = savedColor;\n this.#redraw();\n },\n mustExec: true,\n type: AnnotationEditorParamsType.INK_COLOR,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n }\n\n /**\n * Update the opacity and make this action undoable.\n * @param {number} opacity\n */\n #updateOpacity(opacity) {\n opacity /= 100;\n const savedOpacity = this.opacity;\n this.addCommands({\n cmd: () => {\n this.opacity = opacity;\n this.#redraw();\n },\n undo: () => {\n this.opacity = savedOpacity;\n this.#redraw();\n },\n mustExec: true,\n type: AnnotationEditorParamsType.INK_OPACITY,\n overwriteIfSameType: true,\n keepUndo: true,\n });\n }\n\n /** @inheritdoc */\n rebuild() {\n if (!this.parent) {\n return;\n }\n super.rebuild();\n if (this.div === null) {\n return;\n }\n\n if (!this.canvas) {\n this.#createCanvas();\n this.#createObserver();\n }\n\n if (!this.isAttachedToDOM) {\n // At some point this editor was removed and we're rebuilding it,\n // hence we must add it to its parent.\n this.parent.add(this);\n this.#setCanvasDims();\n }\n this.#fitToContent();\n }\n\n /** @inheritdoc */\n remove() {\n if (this.canvas === null) {\n return;\n }\n\n if (!this.isEmpty()) {\n this.commit();\n }\n\n // Destroy the canvas.\n this.canvas.width = this.canvas.height = 0;\n this.canvas.remove();\n this.canvas = null;\n\n this.#observer.disconnect();\n this.#observer = null;\n\n super.remove();\n }\n\n setParent(parent) {\n if (!this.parent && parent) {\n // We've a parent hence the rescale will be handled thanks to the\n // ResizeObserver.\n this._uiManager.removeShouldRescale(this);\n } else if (this.parent && parent === null) {\n // The editor is removed from the DOM, hence we handle the rescale thanks\n // to the onScaleChanging callback.\n // This way, it'll be saved/printed correctly.\n this._uiManager.addShouldRescale(this);\n }\n super.setParent(parent);\n }\n\n onScaleChanging() {\n const [parentWidth, parentHeight] = this.parentDimensions;\n const width = this.width * parentWidth;\n const height = this.height * parentHeight;\n this.setDimensions(width, height);\n }\n\n /** @inheritdoc */\n enableEditMode() {\n if (this.#disableEditing || this.canvas === null) {\n return;\n }\n\n super.enableEditMode();\n this._isDraggable = false;\n this.canvas.addEventListener(\"pointerdown\", this.#boundCanvasPointerdown);\n }\n\n /** @inheritdoc */\n disableEditMode() {\n if (!this.isInEditMode() || this.canvas === null) {\n return;\n }\n\n super.disableEditMode();\n this._isDraggable = !this.isEmpty();\n this.div.classList.remove(\"editing\");\n\n this.canvas.removeEventListener(\n \"pointerdown\",\n this.#boundCanvasPointerdown\n );\n }\n\n /** @inheritdoc */\n onceAdded() {\n this._isDraggable = !this.isEmpty();\n }\n\n /** @inheritdoc */\n isEmpty() {\n return (\n this.paths.length === 0 ||\n (this.paths.length === 1 && this.paths[0].length === 0)\n );\n }\n\n #getInitialBBox() {\n const {\n parentRotation,\n parentDimensions: [width, height],\n } = this;\n switch (parentRotation) {\n case 90:\n return [0, height, height, width];\n case 180:\n return [width, height, width, height];\n case 270:\n return [width, 0, height, width];\n default:\n return [0, 0, width, height];\n }\n }\n\n /**\n * Set line styles.\n */\n #setStroke() {\n const { ctx, color, opacity, thickness, parentScale, scaleFactor } = this;\n ctx.lineWidth = (thickness * parentScale) / scaleFactor;\n ctx.lineCap = \"round\";\n ctx.lineJoin = \"round\";\n ctx.miterLimit = 10;\n ctx.strokeStyle = `${color}${opacityToHex(opacity)}`;\n }\n\n /**\n * Start to draw on the canvas.\n * @param {number} x\n * @param {number} y\n */\n #startDrawing(x, y) {\n this.canvas.addEventListener(\"contextmenu\", noContextMenu);\n this.canvas.addEventListener(\"pointerleave\", this.#boundCanvasPointerleave);\n this.canvas.addEventListener(\"pointermove\", this.#boundCanvasPointermove);\n this.canvas.addEventListener(\"pointerup\", this.#boundCanvasPointerup);\n this.canvas.removeEventListener(\n \"pointerdown\",\n this.#boundCanvasPointerdown\n );\n\n this.isEditing = true;\n if (!this.#isCanvasInitialized) {\n this.#isCanvasInitialized = true;\n this.#setCanvasDims();\n this.thickness ||= InkEditor._defaultThickness;\n this.color ||=\n InkEditor._defaultColor || AnnotationEditor._defaultLineColor;\n this.opacity ??= InkEditor._defaultOpacity;\n }\n this.currentPath.push([x, y]);\n this.#hasSomethingToDraw = false;\n this.#setStroke();\n\n this.#requestFrameCallback = () => {\n this.#drawPoints();\n if (this.#requestFrameCallback) {\n window.requestAnimationFrame(this.#requestFrameCallback);\n }\n };\n window.requestAnimationFrame(this.#requestFrameCallback);\n }\n\n /**\n * Draw on the canvas.\n * @param {number} x\n * @param {number} y\n */\n #draw(x, y) {\n const [lastX, lastY] = this.currentPath.at(-1);\n if (this.currentPath.length > 1 && x === lastX && y === lastY) {\n return;\n }\n const currentPath = this.currentPath;\n let path2D = this.#currentPath2D;\n currentPath.push([x, y]);\n this.#hasSomethingToDraw = true;\n\n if (currentPath.length <= 2) {\n path2D.moveTo(...currentPath[0]);\n path2D.lineTo(x, y);\n return;\n }\n\n if (currentPath.length === 3) {\n this.#currentPath2D = path2D = new Path2D();\n path2D.moveTo(...currentPath[0]);\n }\n\n this.#makeBezierCurve(\n path2D,\n ...currentPath.at(-3),\n ...currentPath.at(-2),\n x,\n y\n );\n }\n\n #endPath() {\n if (this.currentPath.length === 0) {\n return;\n }\n const lastPoint = this.currentPath.at(-1);\n this.#currentPath2D.lineTo(...lastPoint);\n }\n\n /**\n * Stop to draw on the canvas.\n * @param {number} x\n * @param {number} y\n */\n #stopDrawing(x, y) {\n this.#requestFrameCallback = null;\n\n x = Math.min(Math.max(x, 0), this.canvas.width);\n y = Math.min(Math.max(y, 0), this.canvas.height);\n\n this.#draw(x, y);\n this.#endPath();\n\n // Interpolate the path entered by the user with some\n // Bezier's curves in order to have a smoother path and\n // to reduce the data size used to draw it in the PDF.\n let bezier;\n if (this.currentPath.length !== 1) {\n bezier = this.#generateBezierPoints();\n } else {\n // We have only one point finally.\n const xy = [x, y];\n bezier = [[xy, xy.slice(), xy.slice(), xy]];\n }\n const path2D = this.#currentPath2D;\n const currentPath = this.currentPath;\n this.currentPath = [];\n this.#currentPath2D = new Path2D();\n\n const cmd = () => {\n this.allRawPaths.push(currentPath);\n this.paths.push(bezier);\n this.bezierPath2D.push(path2D);\n this.rebuild();\n };\n\n const undo = () => {\n this.allRawPaths.pop();\n this.paths.pop();\n this.bezierPath2D.pop();\n if (this.paths.length === 0) {\n this.remove();\n } else {\n if (!this.canvas) {\n this.#createCanvas();\n this.#createObserver();\n }\n this.#fitToContent();\n }\n };\n\n this.addCommands({ cmd, undo, mustExec: true });\n }\n\n #drawPoints() {\n if (!this.#hasSomethingToDraw) {\n return;\n }\n this.#hasSomethingToDraw = false;\n\n const thickness = Math.ceil(this.thickness * this.parentScale);\n const lastPoints = this.currentPath.slice(-3);\n const x = lastPoints.map(xy => xy[0]);\n const y = lastPoints.map(xy => xy[1]);\n const xMin = Math.min(...x) - thickness;\n const xMax = Math.max(...x) + thickness;\n const yMin = Math.min(...y) - thickness;\n const yMax = Math.max(...y) + thickness;\n\n const { ctx } = this;\n ctx.save();\n\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"MOZCENTRAL\")) {\n // In Chrome, the clip() method doesn't work as expected.\n ctx.clearRect(xMin, yMin, xMax - xMin, yMax - yMin);\n ctx.beginPath();\n ctx.rect(xMin, yMin, xMax - xMin, yMax - yMin);\n ctx.clip();\n } else {\n ctx.clearRect(0, 0, this.canvas.width, this.canvas.height);\n }\n\n for (const path of this.bezierPath2D) {\n ctx.stroke(path);\n }\n ctx.stroke(this.#currentPath2D);\n\n ctx.restore();\n }\n\n #makeBezierCurve(path2D, x0, y0, x1, y1, x2, y2) {\n const prevX = (x0 + x1) / 2;\n const prevY = (y0 + y1) / 2;\n const x3 = (x1 + x2) / 2;\n const y3 = (y1 + y2) / 2;\n\n path2D.bezierCurveTo(\n prevX + (2 * (x1 - prevX)) / 3,\n prevY + (2 * (y1 - prevY)) / 3,\n x3 + (2 * (x1 - x3)) / 3,\n y3 + (2 * (y1 - y3)) / 3,\n x3,\n y3\n );\n }\n\n #generateBezierPoints() {\n const path = this.currentPath;\n if (path.length <= 2) {\n return [[path[0], path[0], path.at(-1), path.at(-1)]];\n }\n\n const bezierPoints = [];\n let i;\n let [x0, y0] = path[0];\n for (i = 1; i < path.length - 2; i++) {\n const [x1, y1] = path[i];\n const [x2, y2] = path[i + 1];\n const x3 = (x1 + x2) / 2;\n const y3 = (y1 + y2) / 2;\n\n // The quadratic is: [[x0, y0], [x1, y1], [x3, y3]].\n // Convert the quadratic to a cubic\n // (see https://fontforge.org/docs/techref/bezier.html#converting-truetype-to-postscript)\n const control1 = [x0 + (2 * (x1 - x0)) / 3, y0 + (2 * (y1 - y0)) / 3];\n const control2 = [x3 + (2 * (x1 - x3)) / 3, y3 + (2 * (y1 - y3)) / 3];\n\n bezierPoints.push([[x0, y0], control1, control2, [x3, y3]]);\n\n [x0, y0] = [x3, y3];\n }\n\n const [x1, y1] = path[i];\n const [x2, y2] = path[i + 1];\n\n // The quadratic is: [[x0, y0], [x1, y1], [x2, y2]].\n const control1 = [x0 + (2 * (x1 - x0)) / 3, y0 + (2 * (y1 - y0)) / 3];\n const control2 = [x2 + (2 * (x1 - x2)) / 3, y2 + (2 * (y1 - y2)) / 3];\n\n bezierPoints.push([[x0, y0], control1, control2, [x2, y2]]);\n return bezierPoints;\n }\n\n /**\n * Redraw all the paths.\n */\n #redraw() {\n if (this.isEmpty()) {\n this.#updateTransform();\n return;\n }\n this.#setStroke();\n\n const { canvas, ctx } = this;\n ctx.setTransform(1, 0, 0, 1, 0, 0);\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n this.#updateTransform();\n\n for (const path of this.bezierPath2D) {\n ctx.stroke(path);\n }\n }\n\n /**\n * Commit the curves we have in this editor.\n */\n commit() {\n if (this.#disableEditing) {\n return;\n }\n\n super.commit();\n\n this.isEditing = false;\n this.disableEditMode();\n\n // This editor must be on top of the main ink editor.\n this.setInForeground();\n\n this.#disableEditing = true;\n this.div.classList.add(\"disabled\");\n\n this.#fitToContent(/* firstTime = */ true);\n this.makeResizable();\n\n this.parent.addInkEditorIfNeeded(/* isCommitting = */ true);\n\n // When commiting, the position of this editor is changed, hence we must\n // move it to the right position in the DOM.\n this.moveInDOM();\n this.div.focus({\n preventScroll: true /* See issue #15744 */,\n });\n }\n\n /** @inheritdoc */\n focusin(event) {\n if (!this._focusEventsAllowed) {\n return;\n }\n super.focusin(event);\n this.enableEditMode();\n }\n\n /**\n * onpointerdown callback for the canvas we're drawing on.\n * @param {PointerEvent} event\n */\n canvasPointerdown(event) {\n if (event.button !== 0 || !this.isInEditMode() || this.#disableEditing) {\n return;\n }\n\n // We want to draw on top of any other editors.\n // Since it's the last child, there's no need to give it a higher z-index.\n this.setInForeground();\n\n event.preventDefault();\n\n if (event.type !== \"mouse\") {\n this.div.focus();\n }\n\n this.#startDrawing(event.offsetX, event.offsetY);\n }\n\n /**\n * onpointermove callback for the canvas we're drawing on.\n * @param {PointerEvent} event\n */\n canvasPointermove(event) {\n event.preventDefault();\n this.#draw(event.offsetX, event.offsetY);\n }\n\n /**\n * onpointerup callback for the canvas we're drawing on.\n * @param {PointerEvent} event\n */\n canvasPointerup(event) {\n event.preventDefault();\n this.#endDrawing(event);\n }\n\n /**\n * onpointerleave callback for the canvas we're drawing on.\n * @param {PointerEvent} event\n */\n canvasPointerleave(event) {\n this.#endDrawing(event);\n }\n\n /**\n * End the drawing.\n * @param {PointerEvent} event\n */\n #endDrawing(event) {\n this.canvas.removeEventListener(\n \"pointerleave\",\n this.#boundCanvasPointerleave\n );\n this.canvas.removeEventListener(\n \"pointermove\",\n this.#boundCanvasPointermove\n );\n this.canvas.removeEventListener(\"pointerup\", this.#boundCanvasPointerup);\n this.canvas.addEventListener(\"pointerdown\", this.#boundCanvasPointerdown);\n\n // Slight delay to avoid the context menu to appear (it can happen on a long\n // tap with a pen).\n setTimeout(() => {\n this.canvas.removeEventListener(\"contextmenu\", noContextMenu);\n }, 10);\n\n this.#stopDrawing(event.offsetX, event.offsetY);\n\n this.addToAnnotationStorage();\n\n // Since the ink editor covers all of the page and we want to be able\n // to select another editor, we just put this one in the background.\n this.setInBackground();\n }\n\n /**\n * Create the canvas element.\n */\n #createCanvas() {\n this.canvas = document.createElement(\"canvas\");\n this.canvas.width = this.canvas.height = 0;\n this.canvas.className = \"inkEditorCanvas\";\n\n AnnotationEditor._l10nPromise\n .get(\"editor_ink_canvas_aria_label\")\n .then(msg => this.canvas?.setAttribute(\"aria-label\", msg));\n this.div.append(this.canvas);\n this.ctx = this.canvas.getContext(\"2d\");\n }\n\n /**\n * Create the resize observer.\n */\n #createObserver() {\n this.#observer = new ResizeObserver(entries => {\n const rect = entries[0].contentRect;\n if (rect.width && rect.height) {\n this.setDimensions(rect.width, rect.height);\n }\n });\n this.#observer.observe(this.div);\n }\n\n /** @inheritdoc */\n get isResizable() {\n return !this.isEmpty() && this.#disableEditing;\n }\n\n /** @inheritdoc */\n render() {\n if (this.div) {\n return this.div;\n }\n\n let baseX, baseY;\n if (this.width) {\n baseX = this.x;\n baseY = this.y;\n }\n\n super.render();\n\n AnnotationEditor._l10nPromise\n .get(\"editor_ink2_aria_label\")\n .then(msg => this.div?.setAttribute(\"aria-label\", msg));\n\n const [x, y, w, h] = this.#getInitialBBox();\n this.setAt(x, y, 0, 0);\n this.setDims(w, h);\n\n this.#createCanvas();\n\n if (this.width) {\n // This editor was created in using copy (ctrl+c).\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setAspectRatio(this.width * parentWidth, this.height * parentHeight);\n this.setAt(\n baseX * parentWidth,\n baseY * parentHeight,\n this.width * parentWidth,\n this.height * parentHeight\n );\n this.#isCanvasInitialized = true;\n this.#setCanvasDims();\n this.setDims(this.width * parentWidth, this.height * parentHeight);\n this.#redraw();\n this.div.classList.add(\"disabled\");\n } else {\n this.div.classList.add(\"editing\");\n this.enableEditMode();\n }\n\n this.#createObserver();\n\n return this.div;\n }\n\n #setCanvasDims() {\n if (!this.#isCanvasInitialized) {\n return;\n }\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.canvas.width = Math.ceil(this.width * parentWidth);\n this.canvas.height = Math.ceil(this.height * parentHeight);\n this.#updateTransform();\n }\n\n /**\n * When the dimensions of the div change the inner canvas must\n * renew its dimensions, hence it must redraw its own contents.\n * @param {number} width - the new width of the div\n * @param {number} height - the new height of the div\n * @returns\n */\n setDimensions(width, height) {\n const roundedWidth = Math.round(width);\n const roundedHeight = Math.round(height);\n if (\n this.#realWidth === roundedWidth &&\n this.#realHeight === roundedHeight\n ) {\n return;\n }\n\n this.#realWidth = roundedWidth;\n this.#realHeight = roundedHeight;\n\n this.canvas.style.visibility = \"hidden\";\n\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.width = width / parentWidth;\n this.height = height / parentHeight;\n this.fixAndSetPosition();\n\n if (this.#disableEditing) {\n this.#setScaleFactor(width, height);\n }\n\n this.#setCanvasDims();\n this.#redraw();\n\n this.canvas.style.visibility = \"visible\";\n\n // For any reason the dimensions couldn't be in percent but in pixels, hence\n // we must fix them.\n this.fixDims();\n }\n\n #setScaleFactor(width, height) {\n const padding = this.#getPadding();\n const scaleFactorW = (width - padding) / this.#baseWidth;\n const scaleFactorH = (height - padding) / this.#baseHeight;\n this.scaleFactor = Math.min(scaleFactorW, scaleFactorH);\n }\n\n /**\n * Update the canvas transform.\n */\n #updateTransform() {\n const padding = this.#getPadding() / 2;\n this.ctx.setTransform(\n this.scaleFactor,\n 0,\n 0,\n this.scaleFactor,\n this.translationX * this.scaleFactor + padding,\n this.translationY * this.scaleFactor + padding\n );\n }\n\n /**\n * Convert into a Path2D.\n * @param {Array<Array<number>>} bezier\n * @returns {Path2D}\n */\n static #buildPath2D(bezier) {\n const path2D = new Path2D();\n for (let i = 0, ii = bezier.length; i < ii; i++) {\n const [first, control1, control2, second] = bezier[i];\n if (i === 0) {\n path2D.moveTo(...first);\n }\n path2D.bezierCurveTo(\n control1[0],\n control1[1],\n control2[0],\n control2[1],\n second[0],\n second[1]\n );\n }\n return path2D;\n }\n\n static #toPDFCoordinates(points, rect, rotation) {\n const [blX, blY, trX, trY] = rect;\n\n switch (rotation) {\n case 0:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n points[i] += blX;\n points[i + 1] = trY - points[i + 1];\n }\n break;\n case 90:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n const x = points[i];\n points[i] = points[i + 1] + blX;\n points[i + 1] = x + blY;\n }\n break;\n case 180:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n points[i] = trX - points[i];\n points[i + 1] += blY;\n }\n break;\n case 270:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n const x = points[i];\n points[i] = trX - points[i + 1];\n points[i + 1] = trY - x;\n }\n break;\n default:\n throw new Error(\"Invalid rotation\");\n }\n return points;\n }\n\n static #fromPDFCoordinates(points, rect, rotation) {\n const [blX, blY, trX, trY] = rect;\n\n switch (rotation) {\n case 0:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n points[i] -= blX;\n points[i + 1] = trY - points[i + 1];\n }\n break;\n case 90:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n const x = points[i];\n points[i] = points[i + 1] - blY;\n points[i + 1] = x - blX;\n }\n break;\n case 180:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n points[i] = trX - points[i];\n points[i + 1] -= blY;\n }\n break;\n case 270:\n for (let i = 0, ii = points.length; i < ii; i += 2) {\n const x = points[i];\n points[i] = trY - points[i + 1];\n points[i + 1] = trX - x;\n }\n break;\n default:\n throw new Error(\"Invalid rotation\");\n }\n return points;\n }\n\n /**\n * Transform and serialize the paths.\n * @param {number} s - scale factor\n * @param {number} tx - abscissa of the translation\n * @param {number} ty - ordinate of the translation\n * @param {Array<number>} rect - the bounding box of the annotation\n */\n #serializePaths(s, tx, ty, rect) {\n const paths = [];\n const padding = this.thickness / 2;\n const shiftX = s * tx + padding;\n const shiftY = s * ty + padding;\n for (const bezier of this.paths) {\n const buffer = [];\n const points = [];\n for (let j = 0, jj = bezier.length; j < jj; j++) {\n const [first, control1, control2, second] = bezier[j];\n const p10 = s * first[0] + shiftX;\n const p11 = s * first[1] + shiftY;\n const p20 = s * control1[0] + shiftX;\n const p21 = s * control1[1] + shiftY;\n const p30 = s * control2[0] + shiftX;\n const p31 = s * control2[1] + shiftY;\n const p40 = s * second[0] + shiftX;\n const p41 = s * second[1] + shiftY;\n\n if (j === 0) {\n buffer.push(p10, p11);\n points.push(p10, p11);\n }\n buffer.push(p20, p21, p30, p31, p40, p41);\n points.push(p20, p21);\n if (j === jj - 1) {\n points.push(p40, p41);\n }\n }\n paths.push({\n bezier: InkEditor.#toPDFCoordinates(buffer, rect, this.rotation),\n points: InkEditor.#toPDFCoordinates(points, rect, this.rotation),\n });\n }\n\n return paths;\n }\n\n /**\n * Get the bounding box containing all the paths.\n * @returns {Array<number>}\n */\n #getBbox() {\n let xMin = Infinity;\n let xMax = -Infinity;\n let yMin = Infinity;\n let yMax = -Infinity;\n\n for (const path of this.paths) {\n for (const [first, control1, control2, second] of path) {\n const bbox = Util.bezierBoundingBox(\n ...first,\n ...control1,\n ...control2,\n ...second\n );\n xMin = Math.min(xMin, bbox[0]);\n yMin = Math.min(yMin, bbox[1]);\n xMax = Math.max(xMax, bbox[2]);\n yMax = Math.max(yMax, bbox[3]);\n }\n }\n\n return [xMin, yMin, xMax, yMax];\n }\n\n /**\n * The bounding box is computed with null thickness, so we must take\n * it into account for the display.\n * It corresponds to the total padding, hence it should be divided by 2\n * in order to have left/right paddings.\n * @returns {number}\n */\n #getPadding() {\n return this.#disableEditing\n ? Math.ceil(this.thickness * this.parentScale)\n : 0;\n }\n\n /**\n * Set the div position and dimensions in order to fit to\n * the bounding box of the contents.\n * @returns {undefined}\n */\n #fitToContent(firstTime = false) {\n if (this.isEmpty()) {\n return;\n }\n\n if (!this.#disableEditing) {\n this.#redraw();\n return;\n }\n\n const bbox = this.#getBbox();\n const padding = this.#getPadding();\n this.#baseWidth = Math.max(AnnotationEditor.MIN_SIZE, bbox[2] - bbox[0]);\n this.#baseHeight = Math.max(AnnotationEditor.MIN_SIZE, bbox[3] - bbox[1]);\n\n const width = Math.ceil(padding + this.#baseWidth * this.scaleFactor);\n const height = Math.ceil(padding + this.#baseHeight * this.scaleFactor);\n\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.width = width / parentWidth;\n this.height = height / parentHeight;\n\n this.setAspectRatio(width, height);\n\n const prevTranslationX = this.translationX;\n const prevTranslationY = this.translationY;\n\n this.translationX = -bbox[0];\n this.translationY = -bbox[1];\n this.#setCanvasDims();\n this.#redraw();\n\n this.#realWidth = width;\n this.#realHeight = height;\n\n this.setDims(width, height);\n const unscaledPadding = firstTime ? padding / this.scaleFactor / 2 : 0;\n this.translate(\n prevTranslationX - this.translationX - unscaledPadding,\n prevTranslationY - this.translationY - unscaledPadding\n );\n }\n\n /** @inheritdoc */\n static deserialize(data, parent, uiManager) {\n if (data instanceof InkAnnotationElement) {\n return null;\n }\n const editor = super.deserialize(data, parent, uiManager);\n\n editor.thickness = data.thickness;\n editor.color = Util.makeHexColor(...data.color);\n editor.opacity = data.opacity;\n\n const [pageWidth, pageHeight] = editor.pageDimensions;\n const width = editor.width * pageWidth;\n const height = editor.height * pageHeight;\n const scaleFactor = editor.parentScale;\n const padding = data.thickness / 2;\n\n editor.#disableEditing = true;\n editor.#realWidth = Math.round(width);\n editor.#realHeight = Math.round(height);\n\n const { paths, rect, rotation } = data;\n\n for (let { bezier } of paths) {\n bezier = InkEditor.#fromPDFCoordinates(bezier, rect, rotation);\n const path = [];\n editor.paths.push(path);\n let p0 = scaleFactor * (bezier[0] - padding);\n let p1 = scaleFactor * (bezier[1] - padding);\n for (let i = 2, ii = bezier.length; i < ii; i += 6) {\n const p10 = scaleFactor * (bezier[i] - padding);\n const p11 = scaleFactor * (bezier[i + 1] - padding);\n const p20 = scaleFactor * (bezier[i + 2] - padding);\n const p21 = scaleFactor * (bezier[i + 3] - padding);\n const p30 = scaleFactor * (bezier[i + 4] - padding);\n const p31 = scaleFactor * (bezier[i + 5] - padding);\n path.push([\n [p0, p1],\n [p10, p11],\n [p20, p21],\n [p30, p31],\n ]);\n p0 = p30;\n p1 = p31;\n }\n const path2D = this.#buildPath2D(path);\n editor.bezierPath2D.push(path2D);\n }\n\n const bbox = editor.#getBbox();\n editor.#baseWidth = Math.max(AnnotationEditor.MIN_SIZE, bbox[2] - bbox[0]);\n editor.#baseHeight = Math.max(AnnotationEditor.MIN_SIZE, bbox[3] - bbox[1]);\n editor.#setScaleFactor(width, height);\n\n return editor;\n }\n\n /** @inheritdoc */\n serialize() {\n if (this.isEmpty()) {\n return null;\n }\n\n const rect = this.getRect(0, 0);\n const color = AnnotationEditor._colorManager.convert(this.ctx.strokeStyle);\n\n return {\n annotationType: AnnotationEditorType.INK,\n color,\n thickness: this.thickness,\n opacity: this.opacity,\n paths: this.#serializePaths(\n this.scaleFactor / this.parentScale,\n this.translationX,\n this.translationY,\n rect\n ),\n pageIndex: this.pageIndex,\n rect,\n rotation: this.rotation,\n structTreeParentId: this._structTreeParentId,\n };\n }\n}\n\nexport { InkEditor };\n","/* Copyright 2022 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { AnnotationEditorType, shadow } from \"../../shared/util.js\";\nimport { AnnotationEditor } from \"./editor.js\";\nimport { PixelsPerInch } from \"../display_utils.js\";\nimport { StampAnnotationElement } from \"../annotation_layer.js\";\n\n/**\n * Basic text editor in order to create a FreeTex annotation.\n */\nclass StampEditor extends AnnotationEditor {\n #bitmap = null;\n\n #bitmapId = null;\n\n #bitmapPromise = null;\n\n #bitmapUrl = null;\n\n #bitmapFile = null;\n\n #canvas = null;\n\n #observer = null;\n\n #resizeTimeoutId = null;\n\n #isSvg = false;\n\n #hasBeenAddedInUndoStack = false;\n\n static _type = \"stamp\";\n\n constructor(params) {\n super({ ...params, name: \"stampEditor\" });\n this.#bitmapUrl = params.bitmapUrl;\n this.#bitmapFile = params.bitmapFile;\n }\n\n /** @inheritdoc */\n static initialize(l10n) {\n AnnotationEditor.initialize(l10n);\n }\n\n static get supportedTypes() {\n // See https://developer.mozilla.org/en-US/docs/Web/Media/Formats/Image_types\n // to know which types are supported by the browser.\n const types = [\n \"apng\",\n \"avif\",\n \"bmp\",\n \"gif\",\n \"jpeg\",\n \"png\",\n \"svg+xml\",\n \"webp\",\n \"x-icon\",\n ];\n return shadow(\n this,\n \"supportedTypes\",\n types.map(type => `image/${type}`)\n );\n }\n\n static get supportedTypesStr() {\n return shadow(this, \"supportedTypesStr\", this.supportedTypes.join(\",\"));\n }\n\n /** @inheritdoc */\n static isHandlingMimeForPasting(mime) {\n return this.supportedTypes.includes(mime);\n }\n\n /** @inheritdoc */\n static paste(item, parent) {\n parent.pasteEditor(AnnotationEditorType.STAMP, {\n bitmapFile: item.getAsFile(),\n });\n }\n\n #getBitmapFetched(data, fromId = false) {\n if (!data) {\n this.remove();\n return;\n }\n this.#bitmap = data.bitmap;\n if (!fromId) {\n this.#bitmapId = data.id;\n this.#isSvg = data.isSvg;\n }\n this.#createCanvas();\n }\n\n #getBitmapDone() {\n this.#bitmapPromise = null;\n this._uiManager.enableWaiting(false);\n if (this.#canvas) {\n this.div.focus();\n }\n }\n\n #getBitmap() {\n if (this.#bitmapId) {\n this._uiManager.enableWaiting(true);\n this._uiManager.imageManager\n .getFromId(this.#bitmapId)\n .then(data => this.#getBitmapFetched(data, /* fromId = */ true))\n .finally(() => this.#getBitmapDone());\n return;\n }\n\n if (this.#bitmapUrl) {\n const url = this.#bitmapUrl;\n this.#bitmapUrl = null;\n this._uiManager.enableWaiting(true);\n this.#bitmapPromise = this._uiManager.imageManager\n .getFromUrl(url)\n .then(data => this.#getBitmapFetched(data))\n .finally(() => this.#getBitmapDone());\n return;\n }\n\n if (this.#bitmapFile) {\n const file = this.#bitmapFile;\n this.#bitmapFile = null;\n this._uiManager.enableWaiting(true);\n this.#bitmapPromise = this._uiManager.imageManager\n .getFromFile(file)\n .then(data => this.#getBitmapFetched(data))\n .finally(() => this.#getBitmapDone());\n return;\n }\n\n const input = document.createElement(\"input\");\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n input.hidden = true;\n input.id = \"stampEditorFileInput\";\n document.body.append(input);\n }\n input.type = \"file\";\n input.accept = StampEditor.supportedTypesStr;\n this.#bitmapPromise = new Promise(resolve => {\n input.addEventListener(\"change\", async () => {\n if (!input.files || input.files.length === 0) {\n this.remove();\n } else {\n this._uiManager.enableWaiting(true);\n const data = await this._uiManager.imageManager.getFromFile(\n input.files[0]\n );\n this.#getBitmapFetched(data);\n }\n if (typeof PDFJSDev !== \"undefined\" && PDFJSDev.test(\"TESTING\")) {\n input.remove();\n }\n resolve();\n });\n input.addEventListener(\"cancel\", () => {\n this.remove();\n resolve();\n });\n }).finally(() => this.#getBitmapDone());\n if (typeof PDFJSDev === \"undefined\" || !PDFJSDev.test(\"TESTING\")) {\n input.click();\n }\n }\n\n /** @inheritdoc */\n remove() {\n if (this.#bitmapId) {\n this.#bitmap = null;\n this._uiManager.imageManager.deleteId(this.#bitmapId);\n this.#canvas?.remove();\n this.#canvas = null;\n this.#observer?.disconnect();\n this.#observer = null;\n }\n super.remove();\n }\n\n /** @inheritdoc */\n rebuild() {\n if (!this.parent) {\n // It's possible to have to rebuild an editor which is not on a visible\n // page.\n if (this.#bitmapId) {\n this.#getBitmap();\n }\n return;\n }\n super.rebuild();\n if (this.div === null) {\n return;\n }\n\n if (this.#bitmapId) {\n this.#getBitmap();\n }\n\n if (!this.isAttachedToDOM) {\n // At some point this editor was removed and we're rebuilting it,\n // hence we must add it to its parent.\n this.parent.add(this);\n }\n }\n\n /** @inheritdoc */\n onceAdded() {\n this._isDraggable = true;\n this.div.focus();\n }\n\n /** @inheritdoc */\n isEmpty() {\n return !(\n this.#bitmapPromise ||\n this.#bitmap ||\n this.#bitmapUrl ||\n this.#bitmapFile\n );\n }\n\n /** @inheritdoc */\n get isResizable() {\n return true;\n }\n\n /** @inheritdoc */\n render() {\n if (this.div) {\n return this.div;\n }\n\n let baseX, baseY;\n if (this.width) {\n baseX = this.x;\n baseY = this.y;\n }\n\n super.render();\n this.div.hidden = true;\n\n if (this.#bitmap) {\n this.#createCanvas();\n } else {\n this.#getBitmap();\n }\n\n if (this.width) {\n // This editor was created in using copy (ctrl+c).\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setAt(\n baseX * parentWidth,\n baseY * parentHeight,\n this.width * parentWidth,\n this.height * parentHeight\n );\n }\n\n return this.div;\n }\n\n #createCanvas() {\n const { div } = this;\n let { width, height } = this.#bitmap;\n const [pageWidth, pageHeight] = this.pageDimensions;\n const MAX_RATIO = 0.75;\n if (this.width) {\n width = this.width * pageWidth;\n height = this.height * pageHeight;\n } else if (\n width > MAX_RATIO * pageWidth ||\n height > MAX_RATIO * pageHeight\n ) {\n // If the the image is too big compared to the page dimensions\n // (more than MAX_RATIO) then we scale it down.\n const factor = Math.min(\n (MAX_RATIO * pageWidth) / width,\n (MAX_RATIO * pageHeight) / height\n );\n width *= factor;\n height *= factor;\n }\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.setDims(\n (width * parentWidth) / pageWidth,\n (height * parentHeight) / pageHeight\n );\n\n this._uiManager.enableWaiting(false);\n const canvas = (this.#canvas = document.createElement(\"canvas\"));\n div.append(canvas);\n div.hidden = false;\n this.#drawBitmap(width, height);\n this.#createObserver();\n if (!this.#hasBeenAddedInUndoStack) {\n this.parent.addUndoableEditor(this);\n this.#hasBeenAddedInUndoStack = true;\n }\n\n // There are multiple ways to add an image to the page, so here we just\n // count the number of times an image is added to the page whatever the way\n // is.\n this._uiManager._eventBus.dispatch(\"reporttelemetry\", {\n source: this,\n details: {\n type: \"editing\",\n subtype: this.editorType,\n data: {\n action: \"inserted_image\",\n },\n },\n });\n this.addAltTextButton();\n }\n\n /**\n * When the dimensions of the div change the inner canvas must\n * renew its dimensions, hence it must redraw its own contents.\n * @param {number} width - the new width of the div\n * @param {number} height - the new height of the div\n * @returns\n */\n #setDimensions(width, height) {\n const [parentWidth, parentHeight] = this.parentDimensions;\n this.width = width / parentWidth;\n this.height = height / parentHeight;\n this.setDims(width, height);\n if (this._initialOptions?.isCentered) {\n this.center();\n } else {\n this.fixAndSetPosition();\n }\n this._initialOptions = null;\n if (this.#resizeTimeoutId !== null) {\n clearTimeout(this.#resizeTimeoutId);\n }\n // When the user is resizing the editor we just use CSS to scale the image\n // to avoid redrawing it too often.\n // And once the user stops resizing the editor we redraw the image in\n // rescaling it correctly (see this.#scaleBitmap).\n const TIME_TO_WAIT = 200;\n this.#resizeTimeoutId = setTimeout(() => {\n this.#resizeTimeoutId = null;\n this.#drawBitmap(width, height);\n }, TIME_TO_WAIT);\n }\n\n #scaleBitmap(width, height) {\n const { width: bitmapWidth, height: bitmapHeight } = this.#bitmap;\n\n let newWidth = bitmapWidth;\n let newHeight = bitmapHeight;\n let bitmap = this.#bitmap;\n while (newWidth > 2 * width || newHeight > 2 * height) {\n const prevWidth = newWidth;\n const prevHeight = newHeight;\n\n if (newWidth > 2 * width) {\n // See bug 1820511 (Windows specific bug).\n // TODO: once the above bug is fixed we could revert to:\n // newWidth = Math.ceil(newWidth / 2);\n newWidth =\n newWidth >= 16384\n ? Math.floor(newWidth / 2) - 1\n : Math.ceil(newWidth / 2);\n }\n if (newHeight > 2 * height) {\n newHeight =\n newHeight >= 16384\n ? Math.floor(newHeight / 2) - 1\n : Math.ceil(newHeight / 2);\n }\n\n const offscreen = new OffscreenCanvas(newWidth, newHeight);\n const ctx = offscreen.getContext(\"2d\");\n ctx.drawImage(\n bitmap,\n 0,\n 0,\n prevWidth,\n prevHeight,\n 0,\n 0,\n newWidth,\n newHeight\n );\n bitmap = offscreen.transferToImageBitmap();\n }\n\n return bitmap;\n }\n\n #drawBitmap(width, height) {\n width = Math.ceil(width);\n height = Math.ceil(height);\n const canvas = this.#canvas;\n if (!canvas || (canvas.width === width && canvas.height === height)) {\n return;\n }\n canvas.width = width;\n canvas.height = height;\n const bitmap = this.#isSvg\n ? this.#bitmap\n : this.#scaleBitmap(width, height);\n const ctx = canvas.getContext(\"2d\");\n ctx.filter = this._uiManager.hcmFilter;\n ctx.drawImage(\n bitmap,\n 0,\n 0,\n bitmap.width,\n bitmap.height,\n 0,\n 0,\n width,\n height\n );\n }\n\n #serializeBitmap(toUrl) {\n if (toUrl) {\n if (this.#isSvg) {\n const url = this._uiManager.imageManager.getSvgUrl(this.#bitmapId);\n if (url) {\n return url;\n }\n }\n // We convert to a data url because it's sync and the url can live in the\n // clipboard.\n const canvas = document.createElement(\"canvas\");\n ({ width: canvas.width, height: canvas.height } = this.#bitmap);\n const ctx = canvas.getContext(\"2d\");\n ctx.drawImage(this.#bitmap, 0, 0);\n\n return canvas.toDataURL();\n }\n\n if (this.#isSvg) {\n const [pageWidth, pageHeight] = this.pageDimensions;\n // Multiply by PixelsPerInch.PDF_TO_CSS_UNITS in order to increase the\n // image resolution when rasterizing it.\n const width = Math.round(\n this.width * pageWidth * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n const height = Math.round(\n this.height * pageHeight * PixelsPerInch.PDF_TO_CSS_UNITS\n );\n const offscreen = new OffscreenCanvas(width, height);\n const ctx = offscreen.getContext(\"2d\");\n ctx.drawImage(\n this.#bitmap,\n 0,\n 0,\n this.#bitmap.width,\n this.#bitmap.height,\n 0,\n 0,\n width,\n height\n );\n return offscreen.transferToImageBitmap();\n }\n\n return structuredClone(this.#bitmap);\n }\n\n /**\n * Create the resize observer.\n */\n #createObserver() {\n this.#observer = new ResizeObserver(entries => {\n const rect = entries[0].contentRect;\n if (rect.width && rect.height) {\n this.#setDimensions(rect.width, rect.height);\n }\n });\n this.#observer.observe(this.div);\n }\n\n /** @inheritdoc */\n static deserialize(data, parent, uiManager) {\n if (data instanceof StampAnnotationElement) {\n return null;\n }\n const editor = super.deserialize(data, parent, uiManager);\n const { rect, bitmapUrl, bitmapId, isSvg, accessibilityData } = data;\n if (bitmapId && uiManager.imageManager.isValidId(bitmapId)) {\n editor.#bitmapId = bitmapId;\n } else {\n editor.#bitmapUrl = bitmapUrl;\n }\n editor.#isSvg = isSvg;\n\n const [parentWidth, parentHeight] = editor.pageDimensions;\n editor.width = (rect[2] - rect[0]) / parentWidth;\n editor.height = (rect[3] - rect[1]) / parentHeight;\n\n if (accessibilityData) {\n editor.altTextData = accessibilityData;\n }\n\n return editor;\n }\n\n /** @inheritdoc */\n serialize(isForCopying = false, context = null) {\n if (this.isEmpty()) {\n return null;\n }\n\n const serialized = {\n annotationType: AnnotationEditorType.STAMP,\n bitmapId: this.#bitmapId,\n pageIndex: this.pageIndex,\n rect: this.getRect(0, 0),\n rotation: this.rotation,\n isSvg: this.#isSvg,\n structTreeParentId: this._structTreeParentId,\n };\n\n if (isForCopying) {\n // We don't know what's the final destination (this pdf or another one)\n // of this annotation and the clipboard doesn't support ImageBitmaps,\n // hence we serialize the bitmap to a data url.\n serialized.bitmapUrl = this.#serializeBitmap(/* toUrl = */ true);\n serialized.accessibilityData = this.altTextData;\n return serialized;\n }\n\n const { decorative, altText } = this.altTextData;\n if (!decorative && altText) {\n serialized.accessibilityData = { type: \"Figure\", alt: altText };\n }\n\n if (context === null) {\n return serialized;\n }\n\n context.stamps ||= new Map();\n const area = this.#isSvg\n ? (serialized.rect[2] - serialized.rect[0]) *\n (serialized.rect[3] - serialized.rect[1])\n : null;\n if (!context.stamps.has(this.#bitmapId)) {\n // We don't want to have multiple copies of the same bitmap in the\n // annotationMap, hence we only add the bitmap the first time we meet it.\n context.stamps.set(this.#bitmapId, { area, serialized });\n serialized.bitmap = this.#serializeBitmap(/* toUrl = */ false);\n } else if (this.#isSvg) {\n // If we have multiple copies of the same svg but with different sizes,\n // then we want to keep the biggest one.\n const prevData = context.stamps.get(this.#bitmapId);\n if (area > prevData.area) {\n prevData.area = area;\n prevData.serialized.bitmap.close();\n prevData.serialized.bitmap = this.#serializeBitmap(/* toUrl = */ false);\n }\n }\n return serialized;\n }\n}\n\nexport { StampEditor };\n","// 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 2012 Mozilla Foundation\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./display/api\").OnProgressParameters} OnProgressParameters */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./display/api\").PDFDocumentLoadingTask} PDFDocumentLoadingTask */\n/** @typedef {import(\"./display/api\").PDFDocumentProxy} PDFDocumentProxy */\n/** @typedef {import(\"./display/api\").PDFPageProxy} PDFPageProxy */\n/** @typedef {import(\"./display/api\").RenderTask} RenderTask */\n/** @typedef {import(\"./display/display_utils\").PageViewport} PageViewport */\n// eslint-disable-next-line max-len\n/** @typedef {import(\"./display/text_layer\").TextLayerRenderTask} TextLayerRenderTask */\n\nimport {\n AbortException,\n AnnotationEditorParamsType,\n AnnotationEditorType,\n AnnotationMode,\n CMapCompressionType,\n createValidAbsoluteUrl,\n FeatureTest,\n ImageKind,\n InvalidPDFException,\n MissingPDFException,\n normalizeUnicode,\n OPS,\n PasswordResponses,\n PermissionFlag,\n PromiseCapability,\n shadow,\n UnexpectedResponseException,\n Util,\n VerbosityLevel,\n} from \"./shared/util.js\";\nimport {\n build,\n getDocument,\n PDFDataRangeTransport,\n PDFWorker,\n SVGGraphics,\n version,\n} from \"./display/api.js\";\nimport {\n DOMSVGFactory,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getXfaPageViewport,\n isDataScheme,\n isPdfFile,\n loadScript,\n noContextMenu,\n PDFDateString,\n PixelsPerInch,\n RenderingCancelledException,\n setLayerDimensions,\n} from \"./display/display_utils.js\";\nimport { renderTextLayer, updateTextLayer } from \"./display/text_layer.js\";\nimport { AnnotationEditorLayer } from \"./display/editor/annotation_editor_layer.js\";\nimport { AnnotationEditorUIManager } from \"./display/editor/tools.js\";\nimport { AnnotationLayer } from \"./display/annotation_layer.js\";\nimport { GlobalWorkerOptions } from \"./display/worker_options.js\";\nimport { XfaLayer } from \"./display/xfa_layer.js\";\n\n/* eslint-disable-next-line no-unused-vars */\nconst pdfjsVersion =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_VERSION\") : void 0;\n/* eslint-disable-next-line no-unused-vars */\nconst pdfjsBuild =\n typeof PDFJSDev !== \"undefined\" ? PDFJSDev.eval(\"BUNDLE_BUILD\") : void 0;\n\nexport {\n AbortException,\n AnnotationEditorLayer,\n AnnotationEditorParamsType,\n AnnotationEditorType,\n AnnotationEditorUIManager,\n AnnotationLayer,\n AnnotationMode,\n build,\n CMapCompressionType,\n createValidAbsoluteUrl,\n DOMSVGFactory,\n FeatureTest,\n getDocument,\n getFilenameFromUrl,\n getPdfFilenameFromUrl,\n getXfaPageViewport,\n GlobalWorkerOptions,\n ImageKind,\n InvalidPDFException,\n isDataScheme,\n isPdfFile,\n loadScript,\n MissingPDFException,\n noContextMenu,\n normalizeUnicode,\n OPS,\n PasswordResponses,\n PDFDataRangeTransport,\n PDFDateString,\n PDFWorker,\n PermissionFlag,\n PixelsPerInch,\n PromiseCapability,\n RenderingCancelledException,\n renderTextLayer,\n setLayerDimensions,\n shadow,\n SVGGraphics,\n UnexpectedResponseException,\n updateTextLayer,\n Util,\n VerbosityLevel,\n version,\n XfaLayer,\n};\n"],"names":["isNodeJS","process","versions","nw","electron","type","exports","IDENTITY_MATRIX","FONT_IDENTITY_MATRIX","MAX_IMAGE_SIZE_TO_CACHE","LINE_FACTOR","LINE_DESCENT_FACTOR","BASELINE_FACTOR","RenderingIntentFlag","ANY","DISPLAY","PRINT","SAVE","ANNOTATIONS_FORMS","ANNOTATIONS_STORAGE","ANNOTATIONS_DISABLE","OPLIST","AnnotationMode","DISABLE","ENABLE","ENABLE_FORMS","ENABLE_STORAGE","AnnotationEditorPrefix","AnnotationEditorType","NONE","FREETEXT","STAMP","INK","AnnotationEditorParamsType","RESIZE","CREATE","FREETEXT_SIZE","FREETEXT_COLOR","FREETEXT_OPACITY","INK_COLOR","INK_THICKNESS","INK_OPACITY","PermissionFlag","MODIFY_CONTENTS","COPY","MODIFY_ANNOTATIONS","FILL_INTERACTIVE_FORMS","COPY_FOR_ACCESSIBILITY","ASSEMBLE","PRINT_HIGH_QUALITY","TextRenderingMode","FILL","STROKE","FILL_STROKE","INVISIBLE","FILL_ADD_TO_PATH","STROKE_ADD_TO_PATH","FILL_STROKE_ADD_TO_PATH","ADD_TO_PATH","FILL_STROKE_MASK","ADD_TO_PATH_FLAG","ImageKind","GRAYSCALE_1BPP","RGB_24BPP","RGBA_32BPP","AnnotationType","TEXT","LINK","LINE","SQUARE","CIRCLE","POLYGON","POLYLINE","HIGHLIGHT","UNDERLINE","SQUIGGLY","STRIKEOUT","CARET","POPUP","FILEATTACHMENT","SOUND","MOVIE","WIDGET","SCREEN","PRINTERMARK","TRAPNET","WATERMARK","THREED","REDACT","AnnotationReplyType","GROUP","REPLY","AnnotationFlag","HIDDEN","NOZOOM","NOROTATE","NOVIEW","READONLY","LOCKED","TOGGLENOVIEW","LOCKEDCONTENTS","AnnotationFieldFlag","REQUIRED","NOEXPORT","MULTILINE","PASSWORD","NOTOGGLETOOFF","RADIO","PUSHBUTTON","COMBO","EDIT","SORT","FILESELECT","MULTISELECT","DONOTSPELLCHECK","DONOTSCROLL","COMB","RICHTEXT","RADIOSINUNISON","COMMITONSELCHANGE","AnnotationBorderStyleType","SOLID","DASHED","BEVELED","INSET","AnnotationActionEventType","E","X","D","U","Fo","Bl","PO","PC","PV","PI","K","F","V","C","DocumentActionEventType","WC","WS","DS","WP","DP","PageActionEventType","O","VerbosityLevel","ERRORS","WARNINGS","INFOS","CMapCompressionType","BINARY","OPS","dependency","setLineWidth","setLineCap","setLineJoin","setMiterLimit","setDash","setRenderingIntent","setFlatness","setGState","save","restore","transform","moveTo","lineTo","curveTo","curveTo2","curveTo3","closePath","rectangle","stroke","closeStroke","fill","eoFill","fillStroke","eoFillStroke","closeFillStroke","closeEOFillStroke","endPath","clip","eoClip","beginText","endText","setCharSpacing","setWordSpacing","setHScale","setLeading","setFont","setTextRenderingMode","setTextRise","moveText","setLeadingMoveText","setTextMatrix","nextLine","showText","showSpacedText","nextLineShowText","nextLineSetSpacingShowText","setCharWidth","setCharWidthAndBounds","setStrokeColorSpace","setFillColorSpace","setStrokeColor","setStrokeColorN","setFillColor","setFillColorN","setStrokeGray","setFillGray","setStrokeRGBColor","setFillRGBColor","setStrokeCMYKColor","setFillCMYKColor","shadingFill","beginInlineImage","beginImageData","endInlineImage","paintXObject","markPoint","markPointProps","beginMarkedContent","beginMarkedContentProps","endMarkedContent","beginCompat","endCompat","paintFormXObjectBegin","paintFormXObjectEnd","beginGroup","endGroup","beginAnnotation","endAnnotation","paintImageMaskXObject","paintImageMaskXObjectGroup","paintImageXObject","paintInlineImageXObject","paintInlineImageXObjectGroup","paintImageXObjectRepeat","paintImageMaskXObjectRepeat","paintSolidColorImageMask","constructPath","PasswordResponses","NEED_PASSWORD","INCORRECT_PASSWORD","verbosity","setVerbosityLevel","level","Number","isInteger","getVerbosityLevel","info","msg","console","log","warn","unreachable","Error","assert","cond","_isValidProtocol","url","protocol","createValidAbsoluteUrl","baseUrl","options","addDefaultProtocol","startsWith","dots","match","length","tryConvertEncoding","stringToUTF8String","absoluteUrl","URL","shadow","obj","prop","value","nonSerializable","Object","defineProperty","enumerable","configurable","writable","BaseException","BaseExceptionClosure","message","name","constructor","prototype","PasswordException","code","UnknownErrorException","details","InvalidPDFException","MissingPDFException","UnexpectedResponseException","status","FormatError","AbortException","bytesToString","bytes","undefined","MAX_ARGUMENT_COUNT","String","fromCharCode","apply","strBuf","i","chunkEnd","Math","min","chunk","subarray","push","join","stringToBytes","str","Uint8Array","charCodeAt","string32","objectSize","keys","objectFromMap","map","create","key","isLittleEndian","buffer8","view32","Uint32Array","buffer","isEvalSupported","Function","FeatureTest","isOffscreenCanvasSupported","OffscreenCanvas","platform","navigator","isWin","isMac","includes","isCSSRoundSupported","globalThis","CSS","supports","hexNumbers","Array","n","toString","padStart","Util","makeHexColor","r","g","b","scaleMinMax","minMax","temp","m1","m2","applyTransform","p","m","xt","yt","applyInverseTransform","d","getAxialAlignedBoundingBox","p1","p2","slice","p3","p4","max","inverseTransform","singularValueDecompose2dScale","transpose","a","c","first","second","sqrt","sx","sy","normalizeRect","rect","intersect","rect1","rect2","xLow","xHigh","yLow","yHigh","bezierBoundingBox","x0","y0","x1","y1","x2","y2","x3","y3","tvalues","bounds","t","t1","t2","b2ac","sqrtb2ac","abs","j","mt","jlen","PDFStringTranslateTable","stringToPDFString","encoding","decoder","TextDecoder","fatal","decode","ex","ii","charAt","decodeURIComponent","escape","utf8StringToString","unescape","encodeURIComponent","isArrayBuffer","v","byteLength","isArrayEqual","arr1","arr2","getModificationDate","date","Date","getUTCFullYear","getUTCMonth","getUTCDate","getUTCHours","getUTCMinutes","getUTCSeconds","PromiseCapability","settled","promise","Promise","resolve","reject","data","reason","NormalizeRegex","NormalizationMap","normalizeUnicode","Map","replaceAll","_","normalize","get","getUuid","crypto","randomUUID","buf","getRandomValues","floor","random","AnnotationPrefix","_util","require","_annotation_storage","_display_utils","_font_loader","_displayNode_utils","_canvas","_worker_options","_message_handler","_metadata","_optional_content_config","_transport_stream","_displayFetch_stream","_displayNetwork","_displayNode_stream","_displaySvg","_xfa_text","DEFAULT_RANGE_CHUNK_SIZE","RENDERING_CANCELLED_TIMEOUT","DELAYED_CLEANUP_TIMEOUT","DefaultCanvasFactory","NodeCanvasFactory","DOMCanvasFactory","DefaultCMapReaderFactory","NodeCMapReaderFactory","DOMCMapReaderFactory","DefaultFilterFactory","NodeFilterFactory","DOMFilterFactory","DefaultStandardFontDataFactory","NodeStandardFontDataFactory","DOMStandardFontDataFactory","getDocument","src","range","task","PDFDocumentLoadingTask","docId","getUrlProp","getDataProp","httpHeaders","withCredentials","password","rangeTransport","PDFDataRangeTransport","rangeChunkSize","worker","PDFWorker","docBaseUrl","isDataScheme","cMapUrl","cMapPacked","CMapReaderFactory","standardFontDataUrl","StandardFontDataFactory","ignoreErrors","stopAtErrors","maxImageSize","canvasMaxAreaInBytes","disableFontFace","fontExtraProperties","enableXfa","ownerDocument","document","disableRange","disableStream","disableAutoFetch","pdfBug","NaN","useSystemFonts","useWorkerFetch","isValidFetchUrl","baseURI","canvasFactory","filterFactory","styleElement","transportFactory","cMapReaderFactory","isCompressed","standardFontDataFactory","workerParams","port","GlobalWorkerOptions","workerPort","fromPort","_worker","fetchDocParams","apiVersion","evaluatorOptions","transportParams","then","destroyed","workerIdPromise","_fetchDocument","networkStreamPromise","networkStream","PDFDataTransportStream","initialData","progressiveDone","contentDispositionFilename","createPDFNetworkStream","params","PDFNodeStream","PDFFetchStream","PDFNetworkStream","all","workerId","messageHandler","MessageHandler","transport","WorkerTransport","_transport","send","catch","_capability","source","sendWithPromise","val","href","window","location","Buffer","isNaN","onPassword","onProgress","destroy","_pendingDestroy","_rangeListeners","_progressListeners","_progressiveReadListeners","_progressiveDoneListeners","_readyCapability","addRangeListener","listener","addProgressListener","addProgressiveReadListener","addProgressiveDoneListener","onDataRange","begin","onDataProgress","loaded","total","onDataProgressiveRead","onDataProgressiveDone","transportReady","requestDataRange","end","abort","PDFDocumentProxy","pdfInfo","_pdfInfo","deprecated","getJSActions","js","jsArr","annotationStorage","numPages","fingerprints","isPureXfa","_htmlForXfa","allXfaHtml","getPage","pageNumber","getPageIndex","ref","getDestinations","getDestination","id","getPageLabels","getPageLayout","getPageMode","getViewerPreferences","getOpenAction","getAttachments","getDocJSActions","getOutline","getOptionalContentConfig","getPermissions","getMetadata","getMarkInfo","getData","saveDocument","getDownloadInfo","downloadInfoCapability","cleanup","keepLoadedFonts","startCleanup","loadingTask","loadingParams","getFieldObjects","hasJSActions","getCalculationOrderIds","PDFPageProxy","delayedCleanupTimeout","pendingCleanup","pageIndex","pageInfo","_pageIndex","_pageInfo","_stats","StatTimer","_pdfBug","commonObjs","objs","PDFObjects","_maybeCleanupAfterRender","_intentStates","rotate","userUnit","view","getViewport","scale","rotation","offsetX","offsetY","dontFlip","PageViewport","viewBox","getAnnotations","intent","intentArgs","getRenderingIntent","renderingIntent","getPageJSActions","getXfa","children","render","canvasContext","viewport","annotationMode","background","optionalContentConfigPromise","annotationCanvasMap","pageColors","printAnnotationStorage","time","abortDelayedCleanup","intentState","cacheKey","set","streamReaderCancelTimeout","clearTimeout","intentPrint","displayReadyCapability","operatorList","fnArray","argsArray","lastChunk","separateAnnots","_pumpOperatorList","complete","error","renderTasks","delete","internalRenderTask","tryCleanup","capability","_abortOperatorList","timeEnd","InternalRenderTask","callback","useRequestAnimationFrame","Set","add","renderTask","transparency","optionalContentConfig","initializeGraphics","operatorListChanged","getOperatorList","opListReadCapability","opListTask","streamTextContent","includeMarkedContent","disableNormalization","TEXT_CONTENT_CHUNK_SIZE","sendWithStream","highWaterMark","size","textContent","items","getTextContent","xfa","XfaText","readableStream","pump","reader","read","done","assign","styles","getReader","getStructTree","_destroy","waitOn","values","force","completed","cancel","clear","resetStats","success","delayed","setTimeout","_startRenderPage","_renderPageChunk","operatorListChunk","annotationStorageSerializable","transfers","streamReader","RenderingCancelledException","delay","extraDelay","curCacheKey","curIntentState","stats","LoopbackPort","listeners","deferred","postMessage","transfer","event","structuredClone","call","addEventListener","removeEventListener","terminate","PDFWorkerUtil","isWorkerDisabled","fallbackWorkerSrc","fakeWorkerId","__non_webpack_require__","pdfjsFilePath","currentScript","replace","isSameOrigin","otherUrl","base","origin","other","createCDNWrapper","wrapper","createObjectURL","Blob","workerPorts","_port","_webWorker","_messageHandler","has","WeakMap","_initializeFromPort","_initialize","on","_mainThreadWorkerMessageHandler","workerSrc","Worker","terminateEarly","onWorkerError","_setupFakeWorker","sendTest","testObj","_setupFakeWorkerGlobal","WorkerMessageHandler","workerHandler","setup","cachedPort","pdfjsWorker","loader","mainWorkerMessageHandler","eval","loadScript","methodPromises","pageCache","pagePromises","passwordCapability","factory","fontLoader","FontLoader","_params","destroyCapability","_networkStream","_fullReader","_lastProgress","setupMessageHandler","cacheSimpleMethod","cachedPromise","AnnotationStorage","isOpList","SerializableEmpty","PrintAnnotationStorage","serializable","hash","page","hasOwnProperty","resetModified","terminated","cancelAllRequests","sink","getFullReader","evt","onPull","close","ArrayBuffer","enqueue","onCancel","ready","readyReason","headersCapability","fullReader","headersReady","isStreamingSupported","isRangeSupported","contentLength","rangeReader","getRangeReader","_numPages","htmlForXfa","exception","updatePassword","exportedData","exportedError","inspectFont","FontInspector","enabled","font","fontAdded","FontFaceObject","bind","finally","imageData","pageProxy","bitmap","width","height","fetch","filename","num","gen","results","OptionalContentConfig","metadata","Metadata","cleanupSuccessful","ensureObj","objId","RenderTask","onContinue","form","canvas","canvasInUse","WeakSet","operatorListIdx","running","graphicsReadyCallback","graphicsReady","_useRequestAnimationFrame","cancelled","_cancelBound","_continueBound","_continue","_scheduleNextBound","_scheduleNext","_nextBound","_next","StepperManager","stepper","init","nextBreakPoint","getNextBreakPoint","gfx","CanvasGraphics","beginDrawing","endDrawing","updateOperatorList","requestAnimationFrame","executeOperatorList","version","build","_editor","_murmurhash","freeze","modified","storage","onSetModified","onResetModified","onAnnotationEditor","getValue","defaultValue","getRawValue","remove","AnnotationEditor","setValue","entry","entries","setModified","_type","getAll","setAll","print","MurmurHash3_64","context","hasBitmap","serialized","serialize","update","JSON","stringify","hexdigest","parent","clone","_tools","altText","altTextDecorative","altTextButton","altTextTooltip","altTextTooltipTimeout","keepAspectRatio","resizersDiv","boundFocusin","focusin","boundFocusout","focusout","hasBeenClicked","isEditing","isInEditMode","_initialOptions","_uiManager","_focusEventsAllowed","_l10nPromise","isDraggable","zIndex","_zIndex","_borderLineWidth","_colorManager","ColorManager","SMALL_EDITOR_SIZE","parameters","div","uiManager","annotationElementId","_willKeepAspectRatio","isCentered","_structTreeParentId","rawDims","pageWidth","pageHeight","pageX","pageY","pageRotation","viewParameters","pageDimensions","pageTranslation","parentDimensions","x","y","isAttachedToDOM","deleted","editorType","getPrototypeOf","_defaultLineColor","getHexCode","deleteAnnotationElement","editor","fakeEditor","FakeEditor","getNextId","addToAnnotationStorage","initialize","l10n","strings","style","getComputedStyle","documentElement","parseFloat","getPropertyValue","updateDefaultParams","_value","defaultPropertiesToUpdate","isHandlingMimeForPasting","mime","paste","item","propertiesToUpdate","_isDraggable","classList","toggle","center","parentRotation","fixAndSetPosition","addCommands","currentLayer","setInBackground","setInForeground","setParent","setSelected","target","relatedTarget","closest","preventDefault","isMultipleSelection","commitOrRemove","isEmpty","commit","setAt","tx","ty","screenToPageTranslation","translate","translateInPage","scrollIntoView","block","drag","parentWidth","parentHeight","getBoundingClientRect","findNewParent","bx","by","getBaseTranslation","left","toFixed","top","moveInDOM","rotatePoint","angle","pageTranslationToScreen","getRotationMatrix","parentScale","realScale","scaledWidth","scaledHeight","round","setDims","fixDims","widthPercent","endsWith","heightPercent","getInitialTranslation","createResizers","createElement","classes","append","resizerPointerdown","noContextMenu","prepend","button","ctrlKey","boundResizerPointermove","resizerPointermove","savedDraggable","pointerMoveOptions","passive","capture","savedX","savedY","savedWidth","savedHeight","savedParentCursor","cursor","savedCursor","pointerUpCallback","newX","newY","newWidth","newHeight","cmd","undo","mustExec","minWidth","MIN_SIZE","minHeight","rotationMatrix","transf","invRotationMatrix","invTransf","getPoint","getOpposite","isDiagonal","isHorizontal","w","h","point","oppositePoint","transfOppositePoint","oppositeX","oppositeY","ratioX","ratioY","deltaX","deltaY","movementX","movementY","oldDiag","hypot","addAltTextButton","className","setAttribute","tabIndex","stopPropagation","editAltText","setAltTextButtonState","PERCENT","tooltip","DELAY_TO_SHOW_TOOLTIP","_eventBus","dispatch","subtype","action","innerText","parentNode","getClientDimensions","altTextData","decorative","maxWidth","maxHeight","bindEvents","pointerdown","setUpDragSession","isSelected","pointerMoveCallback","e","dragSelectedEditors","endDragSession","shiftKey","metaKey","toggleSelected","moveEditorInDOM","_setParentAndPosition","changeParent","getRect","shiftX","shiftY","getRectInCurrentCoords","onceAdded","enableEditMode","disableEditMode","shouldGetKeyboardEvents","needsToBeRebuilt","rebuild","isForCopying","deserialize","removeEditor","isResizable","makeResizable","select","unselect","contains","activeElement","focus","updateParams","disableEditing","hidden","enableEditing","enterInEditMode","contentDiv","setActiveEditor","setAspectRatio","aspectRatio","element","names","opacityToHex","opacity","IdManager","getId","ImageManager","baseId","cache","_isSVGFittingCanvas","svg","ctx","getContext","image","Image","drawImage","getImageData","rawData","refCounter","isSvg","response","ok","statusText","blob","file","mustRemoveAspectRatioPromise","fileReader","FileReader","imageElement","imagePromise","onload","svgUrl","result","onerror","readAsDataURL","createImageBitmap","getFromFile","lastModified","getFromUrl","getFromId","getSvgUrl","deleteId","isValidId","CommandManager","commands","locked","maxSize","position","overwriteIfSameType","keepUndo","next","splice","redo","hasSomethingToUndo","hasSomethingToRedo","KeyboardManager","callbacks","allKeys","isMacKey","split","at","altKey","exec","self","bubbles","args","checker","_colorsMapping","_colors","colors","getColorValues","convert","color","rgb","getRGB","matchMedia","matches","RGB","every","AnnotationEditorUIManager","activeEditor","allEditors","allLayers","altTextManager","commandManager","currentPageIndex","deletedAnnotationsElementIds","draggingEditors","editorTypes","editorsToRescale","idManager","isEnabled","isWaiting","lastActiveElement","mode","selectedEditors","boundBlur","blur","boundFocus","boundCopy","copy","boundCut","cut","boundPaste","boundKeydown","keydown","boundOnEditingAction","onEditingAction","boundOnPageChanging","onPageChanging","boundOnScaleChanging","onScaleChanging","boundOnRotationChanging","onRotationChanging","previousStates","hasSelectedEditor","translation","translationTimeoutId","container","viewer","TRANSLATE_SMALL","TRANSLATE_BIG","_keyboardManager","proto","arrowChecker","hasSomethingToControl","small","big","selectAll","unselectAll","translateSelectedEditors","eventBus","pdfDocument","_on","PixelsPerInch","PDF_TO_CSS_UNITS","removeKeyboardManager","removeFocusManager","_off","layer","hcmFilter","addHCMFilter","foreground","direction","focusMainContainer","findParent","layerX","layerY","disableUserSelect","addShouldRescale","removeShouldRescale","pagesRotation","addFocusManager","hasSelection","lastEditor","once","addKeyboardManager","addCopyPasteListeners","removeCopyPasteListeners","addEditListeners","removeEditListeners","editors","clipboardData","setData","parse","isArray","newEditors","deserializedEditor","addEditorToLayer","selectEditors","getActive","dispatchUpdateStates","hasChanged","some","dispatchUpdateUI","setEditingState","registerEditorTypes","types","getLayer","addLayer","enable","disable","removeLayer","updateMode","editId","disableAll","enableAll","updateToolbar","addNewEditor","enableWaiting","mustWait","disableClick","enableClick","getEditors","getEditor","addEditor","addDeletedAnnotationElement","isDeletedAnnotationElement","removeDeletedAnnotationElement","addOrRebuild","ed","noCommit","totalX","totalY","TIME_TO_WAIT","savedPageIndex","newPageIndex","mustBeAddedInUndoStack","move","isActive","getMode","imageManager","_base_factory","SVG_NS","PDF","BaseFilterFactory","_cache","_defs","hcmKey","hcmUrl","hcmHighlightFilter","hcmHighlightKey","hcmHighlightUrl","defs","visibility","contain","createElementNS","body","addFilter","maps","tableR","tableG","tableB","mapR","mapG","mapB","bufferR","bufferG","bufferB","filter","createFilter","addTransferMapConversion","fgColor","bgColor","fgRGB","bgRGB","table","addGrayConversion","getSteps","start","arr","addHighlightHCMFilter","newFgColor","newBgColor","fgGray","bgGray","newFgRGB","newBgRGB","fg","bg","step","newStart","newStep","prev","k","keepHCM","feColorMatrix","appendFeFunc","feComponentTransfer","func","feFunc","rTable","gTable","bTable","BaseCanvasFactory","_document","_createCanvas","fetchData","asTypedArray","arrayBuffer","text","request","XMLHttpRequest","open","responseType","onreadystatechange","readyState","DONE","responseText","BaseCMapReaderFactory","_fetchData","compressionType","cMapData","BaseStandardFontDataFactory","DOMSVGFactory","BaseSVGFactory","_createSVG","centerX","centerY","rotateA","rotateB","rotateC","rotateD","offsetCanvasX","offsetCanvasY","convertToViewportPoint","convertToViewportRectangle","topLeft","bottomRight","convertToPdfPoint","trim","substring","toLowerCase","isPdfFile","test","getFilenameFromUrl","onlyStripPath","lastIndexOf","getPdfFilenameFromUrl","defaultFilename","reURI","reFilename","splitURI","suggestedFilename","started","times","now","outBuf","longest","padEnd","removeScriptElement","script","head","pdfDateStringRegex","PDFDateString","toDateObject","input","RegExp","year","parseInt","month","day","hour","minute","universalTimeRelation","offsetHour","offsetMinute","UTC","getXfaPageViewport","xfaPage","attributes","colorRGB","span","computedColor","getCurrentTransform","f","getTransform","getCurrentTransformInverse","invertSelf","setLayerDimensions","mustFlip","mustRotate","useRound","widthStr","heightStr","reset","canvasAndContext","skipDimensions","SEED","MASK_HIGH","MASK_LOW","seed","h1","h2","blockCounts","tailLength","dataUint32","k1","k2","C1","C2","C1_LOW","C2_LOW","systemFonts","nativeFontFaces","loadingRequests","loadTestFontId","addNativeFontFace","nativeFontFace","fonts","removeNativeFontFace","insertRule","rule","getElementsByTagName","styleSheet","sheet","cssRules","loadSystemFont","loadedName","isFontLoadingAPISupported","fontFace","FontFace","load","baseFontName","attached","missingFile","systemFontInfo","createNativeFontFace","family","createFontFaceRule","isSyncFontLoadingSupported","_queueLoadingCallback","_prepareFontLoadEvent","hasFonts","supported","userAgent","completeRequest","otherRequest","shift","_loadTestFont","testFont","atob","int32","offset","spliceString","s","insert","chunk1","chunk2","called","isFontReady","fillText","COMMENT_OFFSET","CFF_CHECKSUM_OFFSET","XXXX_VALUE","checksum","btoa","fontFamily","translatedData","compiledGlyphs","_inspectFont","cssFontInfo","css","weight","fontWeight","italicAngle","mimetype","getPathGenerator","character","cmds","jsBuf","current","fs","readFile","Canvas","createCanvas","_pattern_helper","_image_utils","MIN_FONT_SIZE","MAX_FONT_SIZE","MAX_GROUP_SIZE","EXECUTION_TIME","EXECUTION_STEPS","MAX_SIZE_TO_COMPILE","FULL_CHUNK_HEIGHT","mirrorContextOperations","destCtx","_removeMirroring","__originalSave","__originalRestore","__originalRotate","__originalScale","__originalTranslate","__originalTransform","__originalSetTransform","setTransform","__originalResetTransform","resetTransform","__originalClip","__originalMoveTo","__originalLineTo","__originalBezierCurveTo","bezierCurveTo","__originalRect","__originalClosePath","__originalBeginPath","beginPath","ctxSave","ctxRestore","ctxTranslate","ctxScale","ctxTransform","ctxSetTransform","ctxResetTransform","ctxRotate","cp1x","cp1y","cp2x","cp2y","CachedCanvases","getCanvas","canvasEntry","drawImageAtIntegerCoords","srcImg","srcX","srcY","srcW","srcH","destX","destY","destW","destH","tlX","rTlX","tlY","rTlY","brX","rWidth","brY","rHeight","sign","scaleX","scaleY","compileType3Glyph","imgData","POINT_TO_PROCESS_LIMIT","POINT_TYPES","width1","points","j0","lineSize","pos","elem","mask","count","sum","steps","Int32Array","path","Path2D","p0","pp","drawOutline","CanvasExtraState","alphaIsShape","fontSize","fontSizeScale","textMatrix","textMatrixScale","fontMatrix","leading","lineX","lineY","charSpacing","wordSpacing","textHScale","textRenderingMode","textRise","fillColor","strokeColor","patternFill","fillAlpha","strokeAlpha","lineWidth","activeSMask","transferMaps","startNewPathAndClipBox","clipBox","setCurrentPoint","updatePathMinMax","minX","minY","maxX","maxY","updateRectMinMax","updateScalingPathMinMax","updateCurvePathMinMax","box","getPathBoundingBox","pathType","PathType","xStrokePad","yStrokePad","updateClipFromPath","isEmptyClip","Infinity","getClippedPathBoundingBox","putBinaryImageData","ImageData","putImageData","partialChunkHeight","fullChunks","totalChunks","chunkImgData","createImageData","srcPos","destPos","dest","thisChunkHeight","elemsInThisChunk","kind","srcLength","dest32","dest32DataLength","fullSrcDiff","white","black","srcDiff","kEnd","kEndUnrolled","srcByte","putBinaryImageMask","convertBlackAndWhiteToRGBA","nonBlackColor","copyCtxState","sourceCtx","properties","property","setLineDash","getLineDash","lineDashOffset","resetCtxToDefault","strokeStyle","fillStyle","fillRule","globalAlpha","lineCap","lineJoin","miterLimit","globalCompositeOperation","composeSMaskBackdrop","r0","g0","b0","alpha","alpha_","composeSMaskAlpha","maskData","layerData","transferMap","composeSMaskLuminosity","genericComposeSMask","maskCtx","layerCtx","backdrop","layerOffsetX","layerOffsetY","maskOffsetX","maskOffsetY","hasBackdrop","composeFn","PIXELS_TO_PROCESS","chunkSize","ceil","row","chunkHeight","composeSMask","smask","layerBox","layerWidth","layerHeight","getImageSmoothingEnabled","interpolate","fround","actualScale","devicePixelRatio","LINE_CAP_STYLES","LINE_JOIN_STYLES","NORMAL_CLIP","EO_CLIP","canvasCtx","markedContentStack","stateStack","pendingClip","pendingEOFill","res","xobjs","groupStack","processingType3","baseTransform","baseTransformStack","groupLevel","smaskStack","smaskCounter","tempSMask","suspendedCtx","contentVisible","cachedCanvases","cachedPatterns","viewportScale","outputScaleX","outputScaleY","_cachedScaleForStroking","_cachedGetSinglePixelWidth","_cachedBitmapsMap","getObject","fallback","savedFillStyle","fillRect","transparentCanvas","compositeCtx","executionStartIdx","continueCallback","argsArrayLen","chunkOperations","endTime","fnId","breakIt","depObjId","objsPool","restoreInitialState","inSMaskMode","HTMLCanvasElement","drawFilter","hcmFilterId","savedFilter","_scaleImage","img","widthScale","heightScale","paintWidth","paintHeight","tmpCanvasId","tmpCanvas","tmpCtx","clearRect","_createMaskCanvas","isPatternFill","currentTransform","scaled","maskCanvas","mainKey","cachedImage","maskToCanvas","cord1","cord2","drawnWidth","drawnHeight","fillCanvas","fillCtx","imageSmoothingEnabled","inverse","getPattern","limit","dashArray","dashPhase","flatness","states","checkSMaskState","beginSMaskMode","endSMaskMode","cacheId","scratchCanvas","compose","dirtyBox","old","pop","ops","startX","startY","isScalingMatrix","minMaxForBezier","xw","yh","consumePath","rescaleAndStroke","needRestore","paths","pendingTextPaths","addToPath","spacing","fontRefName","fontObj","fontDirection","isType3Font","typeface","fallbackName","bold","italic","browserFontSize","rise","paintChar","patternTransform","fillStrokeMode","isAddToPathSet","strokeText","isFontSubpixelAAEnabled","glyphs","showType3Text","glyphsLength","vertical","spacingDir","defaultVMetrics","widthAdvanceScale","simpleFillText","pattern","getSinglePixelWidth","isInvalidPDFjsFont","chars","glyph","unicode","restoreNeeded","isSpace","fontChar","accent","scaledX","scaledY","vmetric","vx","vy","remeasure","measuredWidth","measureText","characterScaleX","isInFont","scaledAccentX","scaledAccentY","charWidth","isTextInvisible","spacingLength","charProcOperatorList","operatorListId","transformed","xWidth","yWidth","llx","lly","urx","ury","getColorN_Pattern","IR","canvasGraphicsFactory","createCanvasGraphics","TilingPattern","_getPattern","arguments","matrix","getShadingPattern","SHADING","inv","bbox","group","currentCtx","isolated","knockout","canvasBounds","groupCtx","startTransformInverse","currentMtx","hasOwnCanvas","canvasWidth","canvasHeight","annotationCanvas","savedCtx","compiled","skewX","skewY","positions","trans","images","applyTransferMapsToCanvas","applyTransferMapsToBitmap","imgToPaint","HTMLElement","tag","visible","isVisible","isContentVisible","absDet","normX","normY","getScaleForStroking","scaledLineWidth","scaledXLineWidth","scaledYLineWidth","baseArea","saveRestore","dashes","op","applyBoundingBox","region","BaseShadingPattern","RadialAxialShadingPattern","_bbox","_colorStops","_p0","_p1","_r0","_r1","_createGradient","grad","createLinearGradient","createRadialGradient","colorStop","addColorStop","owner","ownerBBox","createPattern","domMatrix","DOMMatrix","drawTriangle","c1","c2","c3","coords","rowSize","tmp","c1r","c1g","c1b","c2r","c2g","c2b","c3r","c3g","c3b","xa","car","cag","cab","xb","cbr","cbg","cbb","x1_","x2_","drawFigure","figure","ps","cs","verticesPerRow","rows","cols","q","MeshShadingPattern","_coords","_figures","_bounds","_background","_createMeshCanvas","combinedScale","backgroundColor","EXPECTED_SCALE","MAX_PATTERN_SIZE","BORDER_SIZE","boundsWidth","boundsHeight","paddedWidth","paddedHeight","matrixScale","temporaryPatternCanvas","DummyShadingPattern","PaintType","COLORED","UNCOLORED","xstep","ystep","paintType","tilingType","createPatternCanvas","curMatrixScale","dimx","getSizeAndScale","dimy","graphics","setFillAndStrokeStyleToContext","adjustedX0","adjustedY0","adjustedX1","adjustedY1","clipBbox","realOutputSize","bboxWidth","bboxHeight","cssColor","convertToRGBA","convertRGBToRGBA","inverseDecode","zeroMapping","oneMapping","widthInSource","widthRemainder","len32","src32","s1","s2","s3","jj","grayToRGBA","CallbackKind","UNKNOWN","DATA","ERROR","StreamKind","CANCEL","CANCEL_COMPLETE","CLOSE","ENQUEUE","PULL","PULL_COMPLETE","START_COMPLETE","wrapReason","sourceName","targetName","comObj","callbackId","streamId","streamSinks","streamControllers","callbackCapabilities","actionHandler","_onComObjOnMessage","stream","processStreamMessage","cbSourceName","cbTargetName","createStreamSink","actionName","handler","ah","queueingStrategy","ReadableStream","controller","startCapability","startCall","pullCall","cancelCall","isClosed","desiredSize","pull","pullCapability","cancelCapability","streamSink","isCancelled","lastDesiredSize","sinkCapability","streamController","deleteStreamController","allSettled","metadataMap","parsedData","getRaw","INTERNAL","Symbol","OptionalContentGroup","_setVisible","internal","cachedGetHash","groups","initialHash","order","creator","baseState","off","getHash","evaluateVisibilityExpression","array","operator","state","expression","policy","ids","setVisibility","hasInitialVisibility","getOrder","getGroups","getGroup","pdfDataRangeTransport","_queuedChunks","_progressiveDone","_contentDispositionFilename","_pdfDataRangeTransport","_isStreamingSupported","_isRangeSupported","_contentLength","_fullRequestReader","_rangeReaders","_onReceiveData","_onProgress","_onProgressiveDone","_enqueue","found","_begin","_progressiveDataLength","_loaded","_removeRangeReader","indexOf","queuedChunks","PDFDataTransportStreamReader","PDFDataTransportStreamRangeReader","_stream","_done","_filename","_requests","_headersReady","requestCapability","_end","_queuedChunk","requestsCapability","_network_utils","createFetchOptions","headers","abortController","method","signal","credentials","redirect","createHeaders","Headers","getArrayBuffer","isHttp","_rangeRequestReaders","PDFFetchStreamReader","PDFFetchStreamRangeReader","_reader","_withCredentials","_headersCapability","_disableRange","_rangeChunkSize","_abortController","AbortController","_headers","validateResponseStatus","createResponseStatusError","getResponseHeader","allowRangeRequests","suggestedLength","validateRangeRequestCapabilities","extractFilenameFromHeader","_readCapability","_content_disposition","returnValues","contentEncoding","contentDisposition","getFilenameFromContentDispositionHeader","needsEncodingFixup","toParamRegExp","rfc2616unquote","rfc5987decode","rfc2047decode","fixupEncoding","rfc2231getparam","attributePattern","flags","textdecode","contentDispositionStr","iter","quot","part","parts","quotindex","extvalue","encodingend","langvalue","charset","hex","OK_RESPONSE","PARTIAL_CONTENT_RESPONSE","xhr","NetworkManager","currXhrId","pendingRequests","requestRange","requestFull","xhrId","pendingRequest","setRequestHeader","expectedStatus","onError","onStateChange","onprogress","onHeadersReceived","onDone","xhrStatus","ok_response_on_range_request","rangeHeader","getRequestXhr","isPendingRequest","abortRequest","_source","_manager","_onRangeRequestReaderClosed","PDFNetworkStreamFullRequestReader","PDFNetworkStreamRangeRequestReader","onClosed","manager","_onHeadersReceived","_onDone","_onError","_url","_fullRequestId","_headersReceivedCapability","_cachedChunks","_storedError","fullRequestXhrId","fullRequestXhr","lengthComputable","_requestId","_close","fileUriRegex","parseUrl","sourceUrl","parsedUrl","host","isFsUrl","PDFNodeStreamFsFullReader","PDFNodeStreamFullReader","PDFNodeStreamFsRangeReader","PDFNodeStreamRangeReader","BaseFullReader","_readableStream","_error","_setReadableStream","BaseRangeReader","createRequestOptions","auth","hostname","handleResponse","statusCode","_request","http","https","_httpHeaders","Range","lstat","stat","createReadStream","SVG_DEFAULTS","fontStyle","XML_NS","XLINK_NS","contentType","forceDataSchema","digits","b1","b2","b3","d1","d2","d3","d4","convertImgDataToPng","PNG_HEADER","CHUNK_WRAPPER_SIZE","crcTable","crc32","crc","writePngChunk","len","adler32","deflateSync","literals","deflateSyncUncompressed","node","from","output","maxBlockLength","deflateBlocks","idat","pi","adler","encode","isMask","bitDepth","colorType","offsetLiterals","offsetBytes","ihdr","pngLength","SVGExtraState","dependencies","activeClipUrl","clipGroup","maskId","opListToTree","opList","opTree","opListElement","fn","pf","pm","acos","clipCount","maskCount","shadingCount","SVGGraphics","svgFactory","transformMatrix","transformStack","extraStack","embedFonts","embeddedFonts","cssStyle","_operatorIdMapping","tgrp","executeOpTree","loadDependencies","getSVG","svgElement","convertOpList","operatorIdMapping","opTreeElement","lineMatrix","xcoords","ycoords","tspan","setAttributeNS","txtElement","txtgrp","lineWidthScale","_setStrokeAttributes","_ensureTransformGroup","addFontStyle","hasChildNodes","setStrokeAlpha","setFillAlpha","_makeColorN_Pattern","_makeShadingPattern","_makeTilingPattern","tilingId","tx0","ty0","tx1","ty1","xscale","yscale","txstep","tystep","tiling","childNodes","shadingId","colorStops","gradient","point0","point1","focalPoint","circlePoint","focalRadius","circleRadius","stop","getAttributeNS","clipId","clipPath","clipElement","cloneNode","imgSrc","cliprect","imgEl","definitions","rootGroup","_ensureClipGroup","walk","shouldBuildText","child","MAX_TEXT_DIVS_TO_RENDER","DEFAULT_FONT_SIZE","DEFAULT_FONT_ASCENT","ascentCache","getCtx","getAscent","cachedAscent","metrics","ascent","fontBoundingBoxAscent","descent","fontBoundingBoxDescent","ratio","pixels","appendText","geom","textDiv","textDivProperties","hasText","hasEOL","_textDivs","_transform","atan2","fontName","fontHeight","fontAscent","_isOffscreenCanvasSupported","sin","cos","scaleFactorStr","divStyle","_container","_rootContainer","_pageWidth","_pageHeight","dir","_fontInspectorEnabled","dataset","shouldScaleText","absScaleX","absScaleY","_textDivProperties","_isReadableStream","_layoutText","layout","prevFontSize","prevFontFamily","_canceled","textDivs","textDivsLength","TextLayerRenderTask","textContentSource","textContentItemsStr","_textContentSource","_textContentItemsStr","_layoutTextParams","_processItems","styleCache","br","_render","renderTextLayer","textContentStream","scaleFactor","updateTextLayer","mustRescale","_freetext","_ink","_stamp","AnnotationEditorLayer","accessibilityManager","allowClick","annotationLayer","boundPointerup","pointerup","boundPointerdown","hadPointerDown","isCleaningUp","isDisabling","_initialized","FreeTextEditor","InkEditor","StampEditor","addInkEditorIfNeeded","isCommitting","createAndAddNewEditor","pointerEvents","annotationElementIds","editables","getEditableAnnotations","editable","hide","hiddenAnnotationIds","getEditableAnnotation","show","currentActive","attach","detach","removePointerInTextLayer","moveElementInDOM","addUndoableEditor","createNewEditor","pasteEditor","getCenterPoint","annotationType","annotationEditorType","innerWidth","innerHeight","_annotation_layer","boundEditorDivBlur","editorDivBlur","boundEditorDivFocus","editorDivFocus","boundEditorDivInput","editorDivInput","boundEditorDivKeydown","editorDivKeydown","content","editorDivId","_freeTextDefaultContent","_internalPadding","_defaultColor","_defaultFontSize","_translateEmpty","updateFontSize","updateColor","setFontsize","editorDiv","setEditorDimensions","savedFontsize","savedColor","overlayDiv","contentEditable","removeAttribute","preventScroll","cheatInitialRect","extractText","divs","savedDisplay","display","savedText","newText","trimEnd","setText","setContent","dblclick","baseX","baseY","posX","posY","replaceChildren","line","createTextNode","FreeTextAnnotationElement","defaultAppearanceData","fontColor","textPosition","padding","structTreeParentId","hasElementChanged","_scripting_utils","_displayL10n_utils","_xfa_layer","DEFAULT_TAB_INDEX","GetElementsByNameSet","getRectDims","AnnotationElementFactory","LinkAnnotationElement","TextAnnotationElement","fieldType","TextWidgetAnnotationElement","radioButton","RadioButtonWidgetAnnotationElement","checkBox","CheckboxWidgetAnnotationElement","PushButtonWidgetAnnotationElement","ChoiceWidgetAnnotationElement","SignatureWidgetAnnotationElement","WidgetAnnotationElement","PopupAnnotationElement","LineAnnotationElement","SquareAnnotationElement","CircleAnnotationElement","PolylineAnnotationElement","CaretAnnotationElement","InkAnnotationElement","PolygonAnnotationElement","HighlightAnnotationElement","UnderlineAnnotationElement","SquigglyAnnotationElement","StrikeOutAnnotationElement","StampAnnotationElement","FileAttachmentAnnotationElement","AnnotationElement","hasBorder","isRenderable","ignoreBorder","createQuadrilaterals","linkService","downloadManager","imageResourcesPath","renderForms","enableScripting","_fieldObjects","fieldObjects","_createContainer","_createQuadrilaterals","_hasPopupData","titleObj","contentsObj","richText","hasPopupData","popupRef","noRotate","setRotation","borderStyle","borderWidth","horizontalRadius","horizontalCornerRadius","verticalRadius","verticalCornerRadius","radius","borderRadius","borderBottomStyle","borderColor","elementWidth","elementHeight","_commonActions","setColor","jsName","styleName","detail","colorArray","ColorConverters","noView","noPrint","userName","title","readonly","disabled","required","_setRequired","textColor","_dispatchEventFromSandbox","actions","jsEvent","commonActions","_setDefaultPropertiesFromJS","storedData","eventProxy","quadPoints","rectBlX","rectBlY","rectTrX","rectTrY","trX","trY","blX","blY","svgBuffer","rectWidth","rectHeight","backgroundImage","_createPopup","popup","modificationDate","parentRect","elements","_getElementsByName","skipId","fields","fieldObj","exportValues","exportValue","domElement","querySelector","getElementsByName","getAttribute","maybeShow","forceHide","getElementsToTriggerPopup","addHighlightArea","triggers","_editOnDoubleClick","isTooltipOnly","link","isBound","addLinkAttributes","newWindow","_bindNamedAction","attachment","_bindAttachment","setOCGState","bindSetOCGState","_bindLink","Action","_bindJSAction","resetForm","_bindResetFormAction","setInternalLink","destination","getDestinationHash","onclick","goToDestination","getAnchorUrl","executeNamedAction","openOrDownloadData","executeSetOCGState","otherClickAction","resetFormFields","refs","resetFormRefs","include","allFields","fieldIds","fieldName","field","allIds","dispatchEvent","Event","alt","l10nId","l10nArgs","alternativeText","showElementAndHideCanvas","previousSibling","nodeName","_getKeyModifier","_setEventListener","elementData","baseName","eventName","valueGetter","modifier","focused","_setEventListeners","getter","Blur","Focus","_setBackgroundColor","_setTextStyle","TEXT_ALIGNMENT","computedFontSize","roundToOneDecimal","multiLine","numberOfLines","lineHeight","textAlignment","textAlign","isRequired","hasAppearance","fieldValue","setPropertyOnSiblings","keyInStorage","maxLen","charLimit","fieldFormattedValues","formattedValue","comb","userValue","lastCommittedValue","commitKey","doNotScroll","overflowY","overflowX","readOnly","maxLength","defaultFieldValue","blurListener","scrollLeft","selRange","setSelectionRange","willCommit","selStart","selectionStart","selEnd","selectionEnd","_blurListener","Keystroke","inputType","change","fieldWidth","combWidth","letterSpacing","verticalAlign","checked","checkbox","curChecked","buttonValue","radio","pdfButtonValue","linkElement","lastChild","selectElement","addAnEmptyEntry","combo","multiSelect","multiple","option","selected","optionElement","displayValue","removeEmptyEntry","noneOptionElement","isExport","selectedIndex","selectedValues","getItems","multipleSelection","index","findIndex","selectChild","before","indices","changeEx","keyDown","PopupElement","elementIds","dateTimePromise","boundKeyDown","boundHide","boundShow","boundToggle","pinned","wasVisible","dateObject","toLocaleDateString","toLocaleTimeString","trigger","flatMap","baseColor","outlineColor","BACKGROUND_ENLIGHT","header","localized","XfaLayer","xfaHtml","html","contents","_formatContents","useParentRect","normalizedRect","HORIZONTAL_SPACE_AFTER_ANNOTATION","popupLeft","popupTop","lines","lineSpan","lineCoordinates","square","circle","polyline","containerClassName","svgElementName","coordinate","vertices","polylines","inkList","inkLists","download","AnnotationLayer","editableAnnotations","NullL10n","appendElement","contentElement","firstChild","annotations","popupToElements","elementParams","noHTML","isPopupAnnotation","rendered","setAnnotationCanvasMap","replaceWith","makeColorComp","scaleAndClamp","CMYK_G","G_CMYK","G_RGB","G_rgb","G_HTML","G","RGB_G","RGB_rgb","RGB_HTML","T_HTML","T_rgb","CMYK_RGB","CMYK_rgb","CMYK_HTML","components","RGB_CMYK","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","annotation_date_string","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","editor_alt_text_button_label","editor_alt_text_edit_button_label","editor_alt_text_decorative_tooltip","print_progress_percent","getL10nFallback","formatL10nValue","getLanguage","getDirection","setupStorage","xfaOn","xfaOff","setAttributes","isHTMLAnchorElement","HTMLAnchorElement","dataId","root","rootHtml","stack","rootDiv","childHtml","xmlns","el","querySelectorAll","baseHeight","baseWidth","boundCanvasPointermove","canvasPointermove","boundCanvasPointerleave","canvasPointerleave","boundCanvasPointerup","canvasPointerup","boundCanvasPointerdown","canvasPointerdown","currentPath2D","hasSomethingToDraw","isCanvasInitialized","observer","realWidth","realHeight","requestFrameCallback","_defaultOpacity","_defaultThickness","thickness","bezierPath2D","allRawPaths","currentPath","translationX","translationY","updateThickness","updateOpacity","savedThickness","fitToContent","redraw","savedOpacity","createObserver","setCanvasDims","disconnect","setDimensions","getInitialBBox","setStroke","startDrawing","drawPoints","draw","lastX","lastY","path2D","makeBezierCurve","lastPoint","stopDrawing","bezier","generateBezierPoints","xy","lastPoints","xMin","xMax","yMin","yMax","prevX","prevY","bezierPoints","control1","control2","updateTransform","ResizeObserver","contentRect","observe","roundedWidth","roundedHeight","setScaleFactor","getPadding","scaleFactorW","scaleFactorH","buildPath2D","toPDFCoordinates","fromPDFCoordinates","serializePaths","p10","p11","p20","p21","p30","p31","p40","p41","getBbox","firstTime","prevTranslationX","prevTranslationY","unscaledPadding","bitmapId","bitmapPromise","bitmapUrl","bitmapFile","resizeTimeoutId","hasBeenAddedInUndoStack","supportedTypes","supportedTypesStr","getAsFile","getBitmapFetched","fromId","getBitmapDone","getBitmap","accept","files","click","MAX_RATIO","factor","drawBitmap","scaleBitmap","bitmapWidth","bitmapHeight","prevWidth","prevHeight","offscreen","transferToImageBitmap","serializeBitmap","toUrl","toDataURL","accessibilityData","stamps","area","prevData","_api","_text_layer","_annotation_editor_layer","pdfjsVersion","pdfjsBuild"],"sourceRoot":""}